diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-29 14:27:07 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-29 14:27:07 +0200 |
commit | 94f510f31c3f5ca79f24f2daa085cb34d5650565 (patch) | |
tree | b32f0c7408c6afbfc526246b6f87f36adc167c31 /logic | |
parent | 9de8f8910535b1c1258bad3d953719b65a32d866 (diff) |
logic/tracker: call center() before data()
Diffstat (limited to 'logic')
-rw-r--r-- | logic/tracker.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/logic/tracker.cpp b/logic/tracker.cpp index 9b085108..ab526a86 100644 --- a/logic/tracker.cpp +++ b/logic/tracker.cpp @@ -38,7 +38,6 @@ Tracker::Tracker(Mappings& m, SelectedLibraries& libs, TrackLogger& logger) : backlog_time(0), tracking_started(false) { - set(f_center, s.center_at_startup); } Tracker::~Tracker() @@ -127,6 +126,10 @@ void Tracker::logic() logger.write_dt(); logger.reset_dt(); + const bool center_ordered = get(f_center) && tracking_started; + set(f_center, false); + const bool own_center_logic = center_ordered && libs.pTracker->center(); + Pose value, raw; for (int i = 0; i < 6; i++) @@ -183,16 +186,16 @@ void Tracker::logic() } tracking_started &= !nanp; + + if (tracking_started && s.center_at_startup) + { + set(f_center, true); + } } - if (get(f_center) && tracking_started) + if (center_ordered) { - set(f_center, false); - - if (libs.pFilter) - libs.pFilter->center(); - - if (libs.pTracker->center()) + if (own_center_logic) { scaled_rotation.rotation = scaled_rotation.camera.t(); real_rotation.rotation = real_rotation.camera.t(); |