![]() |
ezEngine
Release 25.03
|
Implements a simple time step smoothing algorithm. More...
#include <DefaultTimeStepSmoothing.h>
Public Member Functions | |
virtual ezTime | GetSmoothedTimeStep (ezTime rawTimeStep, const ezClock *pClock) override |
The function to override to implement time step smoothing. More... | |
virtual void | Reset (const ezClock *pClock) override |
Called when ezClock::Reset(), ezClock::Load() or ezClock::SetPaused(true) was called. More... | |
void | SetLerpFactor (float f) |
Changes the factor with which to lerp from the last used time step to the new average time step. Default is 0.2. More... | |
Implements a simple time step smoothing algorithm.
The description for the algorithm was taken from here: http://bitsquid.blogspot.de/2010/10/time-step-smoothing.html
This class implements that algorithm pretty much verbatim. It does not implement keeping track of the time dept and paying that off later, though.
|
overridevirtual |
The function to override to implement time step smoothing.
RawTimeStep | The actual raw time difference since the last clock update without any modification. |
pClock | The clock that calls this time step smoother. Can be used to look up the clock speed and min/max time step. |
Implements ezTimeStepSmoothing.
|
overridevirtual |
Called when ezClock::Reset(), ezClock::Load() or ezClock::SetPaused(true) was called.
pClock | The clock that is calling this function. |
Implements ezTimeStepSmoothing.
|
inline |
Changes the factor with which to lerp from the last used time step to the new average time step. Default is 0.2.
A value of 1.0 would mean that the new average time step is used immediately. The lower the value the more slowly the time step will change from its previous value to the new average value, thus smoothing the time step even more.