diff options
Diffstat (limited to 'opentrack/tracker.cpp')
-rw-r--r-- | opentrack/tracker.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
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; |