From deab967439d1824131859a5e0892d680034767c9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 28 Nov 2014 23:10:59 +0100 Subject: don't reset coords on pause Issue: #99 --- opentrack/tracker.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'opentrack/tracker.cpp') diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index cba5137c..be0ecd84 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -129,12 +129,11 @@ void Tracker::logic() Pose value, raw; - if (enabledp) - for (int i = 0; i < 6; i++) - { - value(i) = newpose[i]; - raw(i) = newpose[i]; - } + for (int i = 0; i < 6; i++) + { + value(i) = newpose[i]; + raw(i) = newpose[i]; + } if (centerp) { @@ -208,8 +207,14 @@ void Tracker::run() { while (!should_quit) { t.start(); - - libs.pTracker->data(newpose); + + double tmp[6]; + libs.pTracker->data(tmp); + + if (enabledp) + for (int i = 0; i < 6; i++) + newpose[i] = tmp[i]; + logic(); long q = sleep_ms * 1000L - t.elapsed()/1000L; -- cgit v1.2.3