diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-05-30 02:32:23 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-05-30 02:32:23 +0200 |
commit | c52b5ad0a8340012fab7982f0c670a46c3e5d93d (patch) | |
tree | b54b567b006d4f2981285e320845dc1e05e47ff5 /logic/tracker.cpp | |
parent | 5b819219889e78093e0dd32615adb6dcdc66cbcb (diff) |
logic/tracker: allow for "hold-toggle" hold-enable
Must press "keypress-toggle" to toggle (uh) that mode.
Diffstat (limited to 'logic/tracker.cpp')
-rw-r--r-- | logic/tracker.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/logic/tracker.cpp b/logic/tracker.cpp index e09000e2..1a37a8a1 100644 --- a/logic/tracker.cpp +++ b/logic/tracker.cpp @@ -132,7 +132,7 @@ void Tracker::logic() Pose tmp; libs.pTracker->data(tmp); - if (get(f_enabled)) + if (get(f_enabled_p) ^ !get(f_enabled_h)) for (int i = 0; i < 6; i++) newpose[i] = elide_nan(tmp(i), newpose(i)); } @@ -445,6 +445,14 @@ void Tracker::raw_and_mapped_pose(double* mapped, double* raw) const } } +void Tracker::center() { set(f_center, true); } + +void Tracker::set_toggle(bool value) { set(f_enabled_h, value); } +void Tracker::set_zero(bool value) { set(f_zero, value); } + +void Tracker::zero() { negate(f_zero); } +void Tracker::toggle_enabled() { negate(f_enabled_p); } + void bits::set(bits::flags flag_, bool val_) { @@ -486,7 +494,8 @@ bool bits::get(bits::flags flag) bits::bits() : b(0u) { set(f_center, true); - set(f_enabled, true); + set(f_enabled_p, true); + set(f_enabled_h, true); set(f_zero, false); set(f_should_quit, false); } |