summaryrefslogtreecommitdiffhomepage
path: root/logic
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-12-09 12:45:29 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-12-09 12:54:55 +0100
commit5a5cf4bac9af84252b28e56b15b71708f8cd3b7b (patch)
tree19c4561fcf66ab32b2a629f74157f815c7b464d5 /logic
parentbad34742736f7d9ee781f77766629140a49d6f28 (diff)
gui, logic: allow toggle neck displacement
It was only possible to zero the values to turn it off.
Diffstat (limited to 'logic')
-rw-r--r--logic/main-settings.hpp2
-rw-r--r--logic/tracker.cpp7
2 files changed, 6 insertions, 3 deletions
diff --git a/logic/main-settings.hpp b/logic/main-settings.hpp
index ea1d93f3..749f6d25 100644
--- a/logic/main-settings.hpp
+++ b/logic/main-settings.hpp
@@ -75,6 +75,7 @@ struct main_settings
value<bool> center_at_startup;
value<int> center_method;
value<int> neck_y, neck_z;
+ value<bool> neck_enable;
key_opts key_start_tracking, key_stop_tracking, key_toggle_tracking, key_restart_tracking;
key_opts key_center, key_toggle, key_zero;
key_opts key_toggle_press, key_zero_press;
@@ -107,6 +108,7 @@ struct main_settings
center_method(b, "centering-method", true),
neck_y(b, "neck-height", 0),
neck_z(b, "neck-depth", 0),
+ neck_enable(b, "neck-enable", false),
key_start_tracking(b, "start-tracking"),
key_stop_tracking(b, "stop-tracking"),
key_toggle_tracking(b, "toggle-tracking"),
diff --git a/logic/tracker.cpp b/logic/tracker.cpp
index 25e067a7..332828a9 100644
--- a/logic/tracker.cpp
+++ b/logic/tracker.cpp
@@ -281,15 +281,16 @@ void Tracker::logic()
euler_t neck, rel;
+ if (s.neck_enable)
{
double ny = s.neck_y, nz = -s.neck_z;
if (ny != 0 || nz != 0)
{
const rmat R = euler_to_rmat(
- euler_t(value(Yaw) * d2r,
- value(Pitch) * d2r,
- value(Roll) * d2r));
+ euler_t(value(Yaw) * d2r,
+ value(Pitch) * d2r,
+ value(Roll) * d2r));
euler_t xyz(0, ny, nz);
t_compensate(R, xyz, xyz, false, false, false);
neck(TX) = xyz(TX);