Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base/ship.cc')
-rw-r--r--src/game/base/ship.cc15
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