summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_joystick
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-12 04:18:59 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-12 04:18:59 +0200
commit0e10668c887f7306e86d8015c9b8e295e2e75197 (patch)
tree73c51f92b26f5155b883e177c1b875d691be747d /ftnoir_tracker_joystick
parenteb9af9a745933f1e816a963ce2497f92f352159f (diff)
Joystick makes even less sense at 3am
Issue: #38
Diffstat (limited to 'ftnoir_tracker_joystick')
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
index 34ac0dca..195dd760 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
@@ -225,9 +225,9 @@ void FTNoIR_Tracker::GetHeadPoseData(double *data)
auto mid = (min_[idx] + max_[idx]) / 2;
auto val = values[idx] - mid;
- auto max = (max_[idx] - min_[idx]) / 2;
- auto min = (min_[idx] - max_[idx]) / -2;
- data[i] = val * limits[i] / (double) (val >= 0 ? max : min);
+ auto max = (max_[idx] - mid) * 2;
+ auto min = (mid - min_[idx]) * 2;
+ data[i] = val * limits[i] / (double) (val > mid ? max : min);
}
}
}