diff --git a/src/main.cpp b/src/main.cpp index 254cd23..954a765 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 =