From 58fa27476e4be965d78782a971439e430032d6b0 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 10 May 2008 12:32:05 +0000 Subject: more interpolation issues --- src/game/ship.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/game') 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) { -- cgit v1.2.3