//
for (WorldObject wo : world.getObjects()) {
for (Force force : wo.getForces()) {
Vector2d dir = force.getDirection();
Vector2d origin = force.getOrigin();
Vec2 fvect = new Vec2((float) dir.getX(), (float) dir.getY());
Vec2 point = new Vec2((float) origin.getX(), (float) origin.getY());
fvect = wo.getBody().getWorldVector(fvect);
point = wo.getBody().getWorldPoint(point);
wo.getBody().applyForce(fvect, point);
}
Vector2d p = wo.getPosition();
for (Environment env : world.getEnvironments()) {
Vector2d g = env.getGravity(p);
double fr = env.getFriction(p); // TODO Should we get rid of this?
g.scale(wo.getBody().getMass());
Vec2 point = wo.getBody().getWorldCenter();
wo.getBody().applyForce(new Vec2((float) g.getX(), (float) g.getY()), point);
}
// Time space
wo.onGameTick();
if(wo.isAlive() == false){