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