Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-10 12:32:05 +0000
committerStijn Buys <ingar@osirion.org>2008-05-10 12:32:05 +0000
commit58fa27476e4be965d78782a971439e430032d6b0 (patch)
tree28e2cb520331662122bb6cfeff32a6613f5cfd5d /src/game/ship.cc
parent6d9b90ccce41c183e11eab0e70e7204ba8580dff (diff)
more interpolation issues
Diffstat (limited to 'src/game/ship.cc')
-rw-r--r--src/game/ship.cc12
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) {