Fix a bug with cutscene triggers
fix some animation bugs
This commit is contained in:
parent
058ad8fd98
commit
c000fd60cb
|
@ -158,7 +158,7 @@ static void gameProc(void* arg) {
|
|||
dynamicSceneInit();
|
||||
contactSolverInit(&gContactSolver);
|
||||
portalSurfaceCleanupQueueInit();
|
||||
levelLoad(3);
|
||||
levelLoad(1);
|
||||
cutsceneRunnerReset();
|
||||
controllersInit();
|
||||
initAudio(fps);
|
||||
|
|
|
@ -160,7 +160,7 @@ int skAnimatorBoneStateIndexOfFrame(struct SKAnimator* animator, int frame) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void skAnimatorStep(struct SKAnimator* animator, float deltaTime) {
|
||||
|
@ -183,6 +183,14 @@ void skAnimatorStep(struct SKAnimator* animator, float deltaTime) {
|
|||
int nextFrame = (int)ceilf(currentFrameFractional);
|
||||
float lerpValue = currentFrameFractional - prevFrame;
|
||||
|
||||
if (nextFrame >= currentClip->nFrames) {
|
||||
nextFrame -= currentClip->nFrames;
|
||||
}
|
||||
|
||||
if (nextFrame == prevFrame) {
|
||||
lerpValue = 1.0f;
|
||||
}
|
||||
|
||||
int existingPrevFrame = skAnimatorBoneStateIndexOfFrame(animator, prevFrame);
|
||||
int existingNextFrame = skAnimatorBoneStateIndexOfFrame(animator, nextFrame);
|
||||
|
||||
|
|
|
@ -35,10 +35,6 @@ local function proccessStaticNodes(nodes)
|
|||
mesh_bb.max.x = math.floor(mesh_bb.max.x + 0.5)
|
||||
mesh_bb.max.y = math.floor(mesh_bb.max.y + 0.5)
|
||||
mesh_bb.max.z = math.floor(mesh_bb.max.z + 0.5)
|
||||
|
||||
if v.node.name == '@static floor.005' then
|
||||
print(mesh_bb)
|
||||
end
|
||||
|
||||
table.insert(result, {
|
||||
node = v.node,
|
||||
|
|
|
@ -279,6 +279,7 @@ local function generate_cutscenes()
|
|||
table.insert(cutscenes_result, {
|
||||
name = cutscene.name,
|
||||
steps = steps,
|
||||
macro = cutscene.macro,
|
||||
})
|
||||
|
||||
table.insert(cutscene_data, {
|
||||
|
|
Loading…
Reference in a new issue