diff options
Diffstat (limited to 'src/game/ship.cc')
-rw-r--r-- | src/game/ship.cc | 20 |
1 files changed, 10 insertions, 10 deletions
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; |