diff options
author | Stijn Buys <ingar@osirion.org> | 2009-08-11 11:49:12 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-08-11 11:49:12 +0000 |
commit | 25bcd92706ce2cd6aee24cfb81e9ff2fd7dd4820 (patch) | |
tree | 19e71f817ffc36247f4db718454f3634904284b0 /src/game | |
parent | a2ae048571310e80ba7502f1d81b5dd2eb1e38fa (diff) |
misc_model support
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/base/ship.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index b512d34..03fe3de 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -537,11 +537,14 @@ void Ship::frame(float seconds) // get physics body world transformation btTransform t; - body()->getMotionState()->getWorldTransform(t); + if (body()->getMotionState()) + body()->getMotionState()->getWorldTransform(t); + else + t = body()->getWorldTransform(); // get entity location from physics body btVector3 v(t.getOrigin()); - location().assign(v[0], v[1], v[2]); + entity_location.assign(v[0], v[1], v[2]); // apply engine trust to the body body()->applyCentralImpulse(to_btVector3(axis().forward() * actual_thrust * actual_acceleration * seconds * 20.0f)); |