Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
iv_components
Physical2D
Physical2D_Updater.cpp
Go to the documentation of this file.
1
#include "
Physical2D_Updater.hpp
"
2
#include "../Defs.hpp"
3
4
namespace
comp
5
{
6
7
Physical2D_Updater::Physical2D_Updater
(
iv::Instance
* inst,
Physical2D_World
* world ) :
8
iv
::FixedUpdateClient( inst, ::
comp
::Defs::Time::
Physics
),
9
cm( inst, this,
"Physical2D_Updater"
),
10
world( world )
11
{
12
this->
cm
.
inherits
( this->
iv::FixedUpdateClient::cm
);
13
}
14
15
void
Physical2D_Updater::fixed_update
(
iv::TimeId
time,
int
time_step,
int
steps )
16
{
17
for
(
size_t
i = 0; i < steps; i++ )
18
this->world->
Step
(
float
( time_step ) / 1000.0f );
19
}
20
21
22
}