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

@ -24,6 +24,7 @@
<description>
When using physics interpolation, there will be circumstances in which you want to know the interpolated (displayed) transform of a node rather than the standard transform (which may only be accurate to the most recent physics tick).
This is particularly important for frame-based operations that take place in [method Node._process], rather than [method Node._physics_process]. Examples include [Camera]s focusing on a node, or finding where to fire lasers from on a frame rather than physics tick.
[b]Note:[/b] This function creates an interpolation pump on the [Spatial] the first time it is called, which can respond to physics interpolation resets. If you get problems with "streaking" when initially following a [Spatial], be sure to call [method get_global_transform_interpolated] at least once [i]before[/i] resetting the [Spatial] physics interpolation.
</description>
</method>
<method name="get_parent_spatial" qualifiers="const">