summaryrefslogtreecommitdiffhomepage
path: root/logic/pipeline.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-05-04 12:38:50 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-05-05 12:34:52 +0200
commit870fc5d19e31e9643f0c8e6b8abc5b356d54a621 (patch)
treed1f784e90f82f39de7738a38366545af938d6de8 /logic/pipeline.cpp
parenta6f095c01e93090e185afd0d9f26bf4565a552ed (diff)
logic/pipeline: skip filter when hold ordered
Also fix faulty xor logic Issue: #777 Requested-by: @r8d
Diffstat (limited to 'logic/pipeline.cpp')
-rw-r--r--logic/pipeline.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp
index e562ef7f..e7d6caf6 100644
--- a/logic/pipeline.cpp
+++ b/logic/pipeline.cpp
@@ -452,6 +452,7 @@ void pipeline::logic()
// we must center prior to getting data from the tracker
const bool center_ordered = get(f_center | f_held_center) && tracking_started;
const bool own_center_logic = center_ordered && libs.pTracker->center();
+ const bool hold_ordered = get(f_enabled_p) ^ get(f_enabled_h);
Pose value, raw;
vec6_bool disabled;
@@ -461,10 +462,7 @@ void pipeline::logic()
libs.pTracker->data(tmp);
nan_check(tmp);
ev.run_events(EV::ev_raw, tmp);
-
- if (get(f_enabled_p) ^ !get(f_enabled_h))
- for (int i = 0; i < 6; i++)
- newpose(i) = tmp(i);
+ newpose = tmp;
}
std::tie(raw, value, disabled) = get_selected_axis_value(newpose);
@@ -503,7 +501,12 @@ void pipeline::logic()
nan_check(value);
}
- goto ok;
+ // we must proceed with all the filtering since the filter
+ // needs fresh values to prevent deconvergence
+ // same for other stuff that needs dt, it could go stupid
+
+ if (!hold_ordered)
+ goto ok;
error:
{