diff options
Diffstat (limited to 'src/game/base')
-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)); |