From 25bcd92706ce2cd6aee24cfb81e9ff2fd7dd4820 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 11 Aug 2009 11:49:12 +0000 Subject: misc_model support --- src/game/base/ship.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/game/base') 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)); -- cgit v1.2.3