From 84d474fd3bd78f5ba6dcee65323f267fa8061b03 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 27 Apr 2008 16:50:30 +0000 Subject: more 3D changes --- src/game/ship.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/game') diff --git a/src/game/ship.cc b/src/game/ship.cc index af10525..c9e2266 100644 --- a/src/game/ship.cc +++ b/src/game/ship.cc @@ -42,16 +42,6 @@ void Ship::frame(float seconds) else if(entity_thrust > 1.0f) entity_thrust = 1.0f; - // update direction - if (target_direction > 1.0f) - target_direction = 1.0f; - else if (target_direction < -1.0f) - target_direction = -1.0f; - - float direction_offset = ship_shipmodel->turnspeed() * seconds * target_direction; - if (direction_offset) - entity_axis.change_direction(360.0f * direction_offset); - // update pitch if (target_pitch > 1.0f) target_pitch = 1.0f; @@ -62,6 +52,16 @@ void Ship::frame(float seconds) if (pitch_offset) entity_axis.change_pitch(360.0f * pitch_offset); + // update direction + if (target_direction > 1.0f) + target_direction = 1.0f; + else if (target_direction < -1.0f) + target_direction = -1.0f; + + float direction_offset = ship_shipmodel->turnspeed() * seconds * target_direction; + if (direction_offset) + entity_axis.change_direction(360.0f * direction_offset); + // update speed if (entity_speed < entity_thrust * ship_shipmodel->maxspeed()) { entity_speed += ship_shipmodel->acceleration() * seconds; -- cgit v1.2.3