summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_joystick
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-12 04:25:40 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-12 04:25:40 +0200
commit5d2d9bc14c0b97a2f5d3f5be6e533966f5a4df39 (patch)
treea27a01b48ffda4f1c70d329cb8c642913a2af4c5 /ftnoir_tracker_joystick
parent0e10668c887f7306e86d8015c9b8e295e2e75197 (diff)
Don't cut ranges in half needlessly
Issue: #38
Diffstat (limited to 'ftnoir_tracker_joystick')
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
index 195dd760..cbb4440e 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
@@ -225,8 +225,8 @@ void FTNoIR_Tracker::GetHeadPoseData(double *data)
auto mid = (min_[idx] + max_[idx]) / 2;
auto val = values[idx] - mid;
- auto max = (max_[idx] - mid) * 2;
- auto min = (mid - min_[idx]) * 2;
+ auto max = (max_[idx] - mid);
+ auto min = (mid - min_[idx]);
data[i] = val * limits[i] / (double) (val > mid ? max : min);
}
}