diff options
author | David Thompson <dthompson2@worcester.edu> | 2019-01-06 00:04:54 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2019-01-06 00:04:54 -0500 |
commit | 088dddcd454d58efc2545a78d4f7a126b9c7e4c0 (patch) | |
tree | f2db6c256be3e7670f9ddf01ae6be6a7af9d5741 | |
parent | b7580bbfe01d634247c4caf8f0a81c7460c435a6 (diff) |
Fix normalization of game controller axis values.
* chickadee.scm (controller-axis): Fix math so that axis values are
actually in the range [0, 1].
-rw-r--r-- | chickadee.scm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/chickadee.scm b/chickadee.scm index 478cf6c..e14f924 100644 --- a/chickadee.scm +++ b/chickadee.scm @@ -105,9 +105,8 @@ "Return a floating point value in the range [-1, 1] corresponding to how much AXIS is being pushed on CONTROLLER. 0 is returned if AXIS is not being pushed at all." - (- (/ (sdl2:game-controller-axis controller axis) - 32768.0) - 0.5)) + (/ (sdl2:game-controller-axis controller axis) + 32768.0)) (define current-window (make-parameter #f)) |