fix physics animation jitter

This commit is contained in:
2026-02-23 00:15:25 +01:00
parent 443069f597
commit f5bb155b5c

View File

@ -63,7 +63,6 @@ auto main(int argc, char *argv[]) -> int {
state.previous_state = state.current_state;
input.HandleInput();
state.UpdateGraph(); // Add state added after user input
camera.Update(mass_springs.GetMass(state.current_state).position);
// Physics update
#ifdef PRINT_TIMINGS
@ -87,6 +86,9 @@ auto main(int argc, char *argv[]) -> int {
physics_time_accumulator += pe - ps;
#endif
// Update the camera after the physics, so target lock is smooth
camera.Update(mass_springs.GetMass(state.current_state).position);
// Rendering
#ifdef PRINT_TIMINGS
std::chrono::high_resolution_clock::time_point rs =