![]() |
Gamedev Framework (gf)
0.4.0
A C++11 framework for 2D games
|
Fixed timestep model. More...
#include <gf/Models.h>
Public Member Functions | |
FixedTimestepModel (Model &model, float timestep=1/60.0f) | |
Constructor. More... | |
virtual void | update (float dt) override |
Update the model's state. More... | |
![]() | |
virtual | ~Model () |
Destructor. More... | |
Fixed timestep model.
This model takes another model that needs a fixed timestep and provides it event if the original timestep is not fixed. This may be useful for physics model, for example.
gf::FixedTimestepModel::FixedTimestepModel | ( | Model & | model, |
float | timestep = 1/60.0f |
||
) |
Constructor.
model | The original model |
timestep | The fixed timestep |
|
overridevirtual |
Update the model's state.
Models are updated each frame. The time between two frames is given as a parameter to help in the update. This time is in seconds.
dt | The time (in seconds) since the last update |
Reimplemented from gf::Model.