Linearly interpolates a value over a period of time. More...
#include "Interpolator.hpp"
Public Member Functions | |
VarInterpolatorT (cf::TypeSys::VarT< T > &v) | |
cf::TypeSys::VarBaseT * | GetVar () const override |
Returns the variable that this is an interpolator for. More... | |
void | ReInit () override |
Re-initializes this interpolator to the variable's current value. More... | |
void | UpdateTargetValue () override |
Updates the interpolator to interpolate from the current interpolated value to the current value of the variable (the new target value). More... | |
void | UpdateAfterReprediction () override |
Updates the interpolator to account for the new target value after the local human player's reprediction has been performed. More... | |
void | UpdateAfterPrediction () override |
Updates the interpolator to account for the new target value after the local human player's prediction has been performed. More... | |
void | AdvanceTime (float Time) override |
Advances the interpolation over the given time. More... | |
void | SetCurrentValue () override |
Assigns the interpolation's current value to the variable. More... | |
void | SetTargetValue () override |
Assigns the interpolation's target value to the variable. More... | |
Linearly interpolates a value over a period of time.
The course of the interpolation is adapted/updated whenever a new reference value is set. This is mostly intended for game entities on clients, where we interpolate from the "current" value towards the reference value of the most recent server update. If the subsequent server update happens to arrive later than the one before it, our interpolation may (briefly) turn into an extrapolation for bridging the gap.
|
inlineoverridevirtual |
Advances the interpolation over the given time.
Implements cf::GameSys::ApproxBaseT.
|
inlineoverridevirtual |
Returns the variable that this is an interpolator for.
Implements cf::GameSys::ApproxBaseT.
|
inlineoverridevirtual |
Re-initializes this interpolator to the variable's current value.
Implements cf::GameSys::ApproxBaseT.
|
inlineoverridevirtual |
Assigns the interpolation's current value to the variable.
Implements cf::GameSys::ApproxBaseT.
|
inlineoverridevirtual |
Assigns the interpolation's target value to the variable.
Implements cf::GameSys::ApproxBaseT.
|
inlineoverridevirtual |
Updates the interpolator to account for the new target value after the local human player's prediction has been performed.
Implements cf::GameSys::ApproxBaseT.
|
inlineoverridevirtual |
Updates the interpolator to account for the new target value after the local human player's reprediction has been performed.
Implements cf::GameSys::ApproxBaseT.
|
inlineoverridevirtual |
Updates the interpolator to interpolate from the current interpolated value to the current value of the variable (the new target value).
Implements cf::GameSys::ApproxBaseT.