diff options
-rw-r--r-- | logic/pipeline.cpp | 11 | ||||
-rw-r--r-- | logic/pipeline.hpp | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp index 658c62bb..39c75e99 100644 --- a/logic/pipeline.cpp +++ b/logic/pipeline.cpp @@ -442,14 +442,13 @@ void pipeline::logic() nan_check(value); } - if (!hold_ordered) - goto ok; + goto ok; error: { QMutexLocker foo(&mtx); - value = output_pose; + value = last_value; raw = raw_6dof; // for widget last value display @@ -465,8 +464,10 @@ ok: for (int i = 0; i < 6; i++) value(i) = 0; - if (hold_ordered) value = output_pose; - else value = apply_zero_pos(value); + if (hold_ordered) + value = last_value; + last_value = value; + value = apply_zero_pos(value); ev.run_events(EV::ev_finished, value); libs.pProtocol->pose(value, raw); diff --git a/logic/pipeline.hpp b/logic/pipeline.hpp index 7775054e..fc1f2060 100644 --- a/logic/pipeline.hpp +++ b/logic/pipeline.hpp @@ -87,7 +87,7 @@ class OTR_LOGIC_EXPORT pipeline : private QThread event_handler& ev; Timer t; - Pose output_pose, raw_6dof; + Pose output_pose, raw_6dof, last_value; Pose newpose; runtime_libraries const& libs; |