Physics Interpolation - refactor client interpolation pump

* Move client interpolation pump to earlier in the iteration before 3D physics synced
* Allow `get_global_transform_interpolated()` to prime the client interpolation inside a physics tick
This commit is contained in:
lawnjelly
2024-06-19 07:36:06 +01:00
parent 12781e4554
commit d80b206643
4 changed files with 17 additions and 9 deletions

View File

@@ -2367,14 +2367,14 @@ bool Main::iteration() {
uint64_t physics_begin = OS::get_singleton()->get_ticks_usec();
PhysicsServer::get_singleton()->flush_queries();
// Prepare the fixed timestep interpolated nodes
// BEFORE they are updated by the physics 2D,
// BEFORE they are updated by the physics,
// otherwise the current and previous transforms
// may be the same, and no interpolation takes place.
OS::get_singleton()->get_main_loop()->iteration_prepare();
PhysicsServer::get_singleton()->flush_queries();
Physics2DServer::get_singleton()->sync();
Physics2DServer::get_singleton()->flush_queries();