Handle skipped keyframes

This commit is contained in:
Camden Dixie O'Brien committed 2025-10-02 17:42:25 +01:00
1 parent 7bc84e9465
commit 4c3fe8d8f7
1 file changed
+2 -1
+2 -1
View File
@@ -110,7 +110,8 @@ void animation_update(
animation_state_t *state, const model_t *model, uint32_t dt_us) animation_state_t *state, const model_t *model, uint32_t dt_us)
{ {
state->elapsed_us += dt_us; state->elapsed_us += dt_us;
if (state->elapsed_us >= state->duration_us) { // Move to next keyframe while (state->elapsed_us >= state->duration_us) {
assert(state->duration_us != 0);
state->elapsed_us -= state->duration_us; state->elapsed_us -= state->duration_us;
state->current_keyframe = state->next_keyframe; state->current_keyframe = state->next_keyframe;
load_keyframe(state, model); load_keyframe(state, model);