diff options
author | Stijn Buys <ingar@osirion.org> | 2008-05-11 08:39:40 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-05-11 08:39:40 +0000 |
commit | fb227d62e699ebaea6e428f570bedc684873f15b (patch) | |
tree | 8a2a8e9ee4681479bcbd4828bdf7d6f76d5a1be1 /src/game | |
parent | 17e9ce54ee3972b9804174b874652ec0856efcd0 (diff) |
fix movement in local game, fix camera cockpit mode offset
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/ship.cc | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/game/ship.cc b/src/game/ship.cc index 5c36205..e864aba 100644 --- a/src/game/ship.cc +++ b/src/game/ship.cc @@ -57,9 +57,7 @@ void Ship::frame(float seconds) current_target_pitch = target_pitch; } - if (fabs(seconds*current_target_pitch) < 0.00005f) { - current_target_pitch = 0.0f; - } else { + if (fabs(seconds*current_target_pitch) > 0.0f) { math::clamp(current_target_pitch, -1.0f, 1.0f); float pitch_offset = seconds * current_target_pitch; entity_axis.change_pitch(360.0f * ship_shipmodel->turnspeed() * pitch_offset); @@ -78,9 +76,7 @@ void Ship::frame(float seconds) current_target_direction = target_direction; } } - if (fabs(seconds*current_target_direction) < 0.00005f) { - current_target_direction = 0.0f; - } else { + if (fabs(seconds*current_target_direction) > 0.0f ) { math::clamp(current_target_direction, -1.0f, 1.0f); float direction_offset = seconds * current_target_direction; entity_axis.change_direction(360.0f * ship_shipmodel->turnspeed() * direction_offset); @@ -97,9 +93,7 @@ void Ship::frame(float seconds) if (current_target_roll < target_roll) current_target_roll = target_roll; } - if (fabs(current_target_roll) < 0.00005f) { - current_target_roll = 0.0f; - } else { + if (fabs(current_target_roll) > 0.0f) { math::clamp(current_target_roll, -1.0f, 1.0f); float roll_offset = seconds * current_target_roll; entity_axis.change_roll(360.0f * ship_shipmodel->turnspeed() * roll_offset); |