bevy_rapier icon indicating copy to clipboard operation
bevy_rapier copied to clipboard

Interpolation is broken.

Open Jakkestt opened this issue 10 months ago • 0 comments

The way that interpolation is implemented currently is broken. It works fine when the games refresh rate is equal or greater than the fixed timestep of the engine. But if the refresh rate is less than the timestep, you will eventually start getting frames where 2 or more fixed updates happen. The way that the interpolation works currently is that the start and end fields of the TransformInterpolation struct get set to the RigidBody's position. The problem comes when both of these fields have to be updated on the same frame. Both of the fields get set to the same Transform which means that you cannot get interpolated values from the TransformInterpolation struct. The fix for this would be to use FixedUpdate schedule for the physics systems to make sure that the systems can get all of the transform changes. That being said we the interpolation has to still happen at the same rate as the game's refresh rate which means that the systems that are responsible for doing the interpolation would have to stay in PostUpdate.

Jakkestt avatar Feb 26 '25 02:02 Jakkestt