This module is not related to the interpolating between server updates. Instead, it is responsible for interpolating between FixedUpdate ticks during the Update state.
Usually, the simulation is run during the FixedUpdate schedule so that it doesn't depend on frame rate. This can cause some visual inconsistencies (jitter) because the frames (Update schedule) don't correspond exactly to the FixedUpdate schedule: there can be frames with several fixed-update ticks, and some frames with no fixed-update ticks.
To solve this, we visually display the state of the game with 1 tick of delay. For example if on the Update state we have an overstep of 0.7 and the current tick is 10, we display the state of the game interpolated at 0.7 between tick 9 and tick 10.
Another way to solve this would be to run an extra 'partial' simulation step with 0.7 dt and use this for the visual state.
To enable FrameInterpolation:
- register an interpolation rule for the component or bundle. Existing
interpolation rules are reused by default; if the component should not use
delayed interpolation history, register it with
InterpolationFns::no_history. - FrameInterpolation is not enabled by default; add [
FrameInterpolationPlugin] manually - To enable FrameInterpolation on a given entity, add the type-erased [
FrameInterpolate] marker to it manually
Frame interpolation writes through Bevy's change-detection-aware component
access. Systems ordered after [FrameInterpolationSystems::Interpolate] can
therefore use Changed<C> to react to the visual value.
# use *;
# use *;
# use App;
# use *;
#
# ;
#
let mut app = new;
app.add_plugins;
app.;