diff options
author | Stijn Buys <ingar@osirion.org> | 2010-10-17 17:19:03 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-10-17 17:19:03 +0000 |
commit | d6e4c4e7c2b1e28961f1dfe2f25ef96ced60b21b (patch) | |
tree | 63744dff093a8b23f65d9c68b922b678805647d9 /src/game/base/ship.cc | |
parent | ea6e6bb769d713ac55114c1940626f13e384ebed (diff) |
core bullet physics support,
initial vstrafe support
Diffstat (limited to 'src/game/base/ship.cc')
-rw-r--r-- | src/game/base/ship.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index a588122..d7d6b59 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -76,6 +76,8 @@ Ship::Ship(core::Player *owner, ShipModel *shipmodel) : core::EntityControlable( set_flag(core::Entity::Dockable); } + + set_mass(radius()); reset(); } @@ -89,7 +91,10 @@ void Ship::reset() current_target_pitch = 0.0f;; current_target_roll = 0.0f; current_target_strafe = 0.0f; + current_target_vstrafe = 0.0f; current_target_afterburner = 0.0f; + + EntityControlable::reset(); } // this is called if another shuo wants to dock this ship @@ -617,6 +622,16 @@ void Ship::frame(float seconds) if ((entity_movement > 0) || (entity_speed > 0)) { set_dirty(); } + + // transfer entity location to motion state + btTransform t; + t.setIdentity(); + t.setOrigin(math::to_btVector3(location())); + t.setBasis(math::to_btMatrix3x3(axis())); + entity_body->setWorldTransform(t); + + if (zone()) + zone()->physics()->synchronizeSingleMotionState(entity_body); } } // namespace game |