natiny_physics_set_interpolation
void natiny_physics_set_interpolation(NatinyBody body, bool enabled);
Enables or disables visual interpolation of a body's entity transform between fixed physics ticks.
Parameters
| Name | Type | Description |
|---|---|---|
body |
NatinyBody |
Body handle |
enabled |
bool |
true to interpolate the transform; false to use the latest simulated transform |
Example
natiny_physics_set_interpolation(crate, true);
Notes
- Interpolation is disabled when a body is created.
- It blends position linearly and rotation along the shortest quaternion path. This changes only the entity transform used by rendering; it does not change the solver state or the fixed 60 Hz simulation rate.
- The interpolated transform can trail the latest simulated transform by up to one physics tick. Objects parented to the body follow that transform.
- Changing the body transform through the entity API resets its interpolation history, so teleporting it does not produce a sweep from the old transform.
- Enabling interpolation starts from the body's current transform. Passing a handle that is not a live body has no effect.