diff options
author | Stijn Buys <ingar@osirion.org> | 2008-05-10 12:32:05 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-05-10 12:32:05 +0000 |
commit | 58fa27476e4be965d78782a971439e430032d6b0 (patch) | |
tree | 28e2cb520331662122bb6cfeff32a6613f5cfd5d /src/game | |
parent | 6d9b90ccce41c183e11eab0e70e7204ba8580dff (diff) |
more interpolation issues
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/ship.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/ship.cc b/src/game/ship.cc index a1d4531..525bf71 100644 --- a/src/game/ship.cc +++ b/src/game/ship.cc @@ -47,9 +47,9 @@ void Ship::frame(float seconds) // update pitch math::clamp(target_pitch, -1.0f, 1.0f); - if (current_target_pitch < target_pitch) { + if (current_target_pitch - target_pitch < 0) { current_target_pitch += direction_change_speed * seconds; - } else if (current_target_pitch > target_pitch) { + } else if (current_target_pitch - target_pitch > 0) { current_target_pitch -= direction_change_speed * seconds; } if (fabs(current_target_pitch) < direction_change_speed * seconds) { @@ -62,9 +62,9 @@ void Ship::frame(float seconds) // update direction math::clamp(target_direction, -1.0f, 1.0f); - if (current_target_direction < target_direction) { + if (current_target_direction - target_direction < 0) { current_target_direction += direction_change_speed * seconds; - } else if (current_target_direction > target_direction) { + } else if (current_target_direction - target_direction > 0) { current_target_direction -= direction_change_speed * seconds; } if (fabs(current_target_direction) < direction_change_speed * seconds) { @@ -77,9 +77,9 @@ void Ship::frame(float seconds) // update roll math::clamp(target_roll, -1.0f, 1.0f); - if (current_target_roll < target_roll) { + if (current_target_roll - target_roll < 0) { current_target_roll += direction_change_speed * seconds; - } else if (current_target_roll > target_roll) { + } else if (current_target_roll - target_roll > 0) { current_target_roll -= direction_change_speed * seconds; } if (fabs(current_target_roll) < direction_change_speed * seconds) { |