summaryrefslogtreecommitdiffhomepage
path: root/opentrack
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-11-28 23:10:59 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-11-28 23:10:59 +0100
commitdeab967439d1824131859a5e0892d680034767c9 (patch)
tree816482255a49fc122f5cb99cdce6378bb5ccef4c /opentrack
parent2ba54cd3841d41fb3838a3910941c763586414af (diff)
don't reset coords on pause
Issue: #99
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/tracker.cpp21
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;