dimforge / dimforge/bevy_rapier
Interpolation is broken.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 282
- PR merge metrics
- No merged PRs in 30d
Description
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`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.