1 #include "PhysicsEntity.h"
4 #include "../Vector2.h"
6 /// ***** Public Class Methods *****
7 PhysicsEntity::PhysicsEntity(const Vector2& pos)
12 PhysicsEntity::~PhysicsEntity()
17 void PhysicsEntity::update(float time_step)
19 position = positionAt(time_step);
20 velocity = velocityAt(time_step);
25 Vector2 PhysicsEntity::positionAt(float time_step) const
27 return force/mass / 2 * time_step * time_step + velocity * time_step + position;
30 Vector2 PhysicsEntity::velocityAt(float time_step) const
32 return force/mass / 2 * time_step + velocity;
35 void PhysicsEntity::applyForce(const Vector2& force)
40 void PhysicsEntity::applyImpulse(const Vector2& impluse)