X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=examples%2Fbassteroids%2Fsource%2Fphysics.cpp;h=0fb43260f4cff7b82f57e39eb6fed6aa72b3b954;hb=da195e0fa114b82708d7c2bbd6297590f34f79a4;hp=a8d49ec4d0331cb98437c07a24264a6c724b88a8;hpb=1819b186d60376a546722d99edd686e876b81d9f;p=libs%2Fgame.git diff --git a/examples/bassteroids/source/physics.cpp b/examples/bassteroids/source/physics.cpp index a8d49ec..0fb4326 100644 --- a/examples/bassteroids/source/physics.cpp +++ b/examples/bassteroids/source/physics.cpp @@ -76,6 +76,8 @@ void Physics::copy_in(SimulatedEntity &entity) Game::Handle body = entity.entity->get_body(); entity.inverse_mass = 1.0f/body->get_mass(); entity.moment_of_inertia = body->get_moment_of_inertia(); + entity.external_force = body->get_force(); + entity.external_torque = body->get_torque(); entity.velocity = body->get_velocity(); entity.angular_velocity = body->get_angular_velocity(); } @@ -93,6 +95,7 @@ void Physics::copy_out(SimulatedEntity &entity) Game::Handle body = entity.entity->get_body(); body->set_velocity(entity.velocity); body->set_angular_velocity(entity.angular_velocity); + body->clear_forces(); } }