From c2a6f7c2ee6245109c897ee23b093b5277a30594 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 20 Oct 2010 19:13:46 +0000 Subject: removes Static and Solid entity flags, corrects EntityDynamic motionstate sync --- src/game/base/ship.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/game/base/ship.cc') diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index d426a0d..0ac7461 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -275,19 +275,21 @@ void Ship::action (btScalar seconds) { float maxspeed = 0; float engine_force = 0; + float torque_force = ship_torque_force; btTransform t; switch (entity_state) { case core::Entity::Normal: engine_force = ship_thrust_force * entity_thrust; - maxspeed = ship_shipmodel->maxspeed() * entity_thrust; + maxspeed = ship_shipmodel->maxspeed() * entity_thrust; break; case core::Entity::ImpulseInitiate: case core::Entity::Impulse: engine_force = ship_impulse_force; maxspeed = (Game::g_impulsespeed ? Game::g_impulsespeed->value() * 0.01f : 0.0f); + torque_force *= .5f; break; case core::Entity::JumpInitiate: @@ -333,11 +335,11 @@ void Ship::action (btScalar seconds) } // apply direction - body()->applyTorqueImpulse(math::to_btVector3(axis().up() * current_target_direction * ship_torque_force * torque_scale)); + body()->applyTorqueImpulse(math::to_btVector3(axis().up() * current_target_direction * torque_force * torque_scale)); // apply pitch - body()->applyTorqueImpulse(math::to_btVector3(axis().left() * -current_target_pitch * ship_torque_force * torque_scale)); + body()->applyTorqueImpulse(math::to_btVector3(axis().left() * -current_target_pitch * torque_force * torque_scale)); // apply roll - body()->applyTorqueImpulse(math::to_btVector3(axis().forward() * -current_target_roll * ship_torque_force * roll_scale * torque_scale)); + body()->applyTorqueImpulse(math::to_btVector3(axis().forward() * -current_target_roll * torque_force * roll_scale * torque_scale)); // limit speed entity_speed = (float) entity_body->getLinearVelocity().length(); -- cgit v1.2.3