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-08-06 21:03:54 +0000
committerStijn Buys <ingar@osirion.org>2008-08-06 21:03:54 +0000
commit1525e4ecb2f6450b4467b8787d1283a34ca75e68 (patch)
treeb672558c41f56c63e0f0fc1f58d17ddb8c8f0f32 /src/client/input.cc
parent8d45578fcda02132d24af6065b8cf3b48a37c49c (diff)
joystick throttle/thruster control
Diffstat (limited to 'src/client/input.cc')
-rw-r--r--src/client/input.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/input.cc b/src/client/input.cc
index fce83dc..7812d7e 100644
--- a/src/client/input.cc
+++ b/src/client/input.cc
@@ -588,6 +588,15 @@ void axis_event(int axis, int value)
local_roll *= -1;
break;
+
+ case 3: // throttle
+ if (value >= 0) {
+ local_thrust = (float) value / 32767.0f;
+ } else {
+ local_thrust = (float) value / 32768.0f;
+ }
+
+ local_thrust = -0.5f * local_thrust + 0.5f;
}
}