|
@@ -25,15 +25,15 @@ public:
|
|
|
this->requireComponent<RigidBodyComponent>();
|
|
|
}
|
|
|
|
|
|
- void Update()
|
|
|
+ void update(double deltaTime)
|
|
|
{
|
|
|
for (auto entity: this->getSystemEntities())
|
|
|
{
|
|
|
auto &transform = entity.getComponent<TransformComponent>();
|
|
|
const auto rigidbody = entity.getComponent<RigidBodyComponent>();
|
|
|
|
|
|
- transform.position.x += rigidbody.velocity.x;
|
|
|
- transform.position.y += rigidbody.velocity.y;
|
|
|
+ transform.position.x += rigidbody.velocity.x * deltaTime;
|
|
|
+ transform.position.y += rigidbody.velocity.y * deltaTime;
|
|
|
|
|
|
Logger::Debug("Entity id#%d - Position is now (%f, %f)",
|
|
|
entity.getId(), transform.position.x, transform.position.y);
|