2016-03-08 18:49:28 +00:00
|
|
|
#include "physics_object.hpp"
|
|
|
|
|
2016-03-08 20:16:02 +00:00
|
|
|
void PhysicsObject::update(State state) {
|
|
|
|
sf::Vector2f forces = getForces(state);
|
2016-03-08 18:49:28 +00:00
|
|
|
|
|
|
|
// TODO: intégrer le vecteur force dans la vitesse puis la position
|
|
|
|
}
|
|
|
|
|
|
|
|
sf::Vector2f PhysicsObject::getForces(State state) {
|
|
|
|
sf::Vector2f forces(0, 0);
|
|
|
|
|
|
|
|
// force de gravité
|
2016-03-08 20:16:02 +00:00
|
|
|
forces += sf::Vector2f(0, PhysicsObject::GRAVITY);
|
2016-03-08 18:49:28 +00:00
|
|
|
|
|
|
|
// TODO: collisions entre objets
|
|
|
|
|
|
|
|
return forces;
|
|
|
|
}
|