diff options
Diffstat (limited to 'opentrack/tracker.cpp')
-rw-r--r-- | opentrack/tracker.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index a6f228e7..338c9113 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -24,7 +24,7 @@ Tracker::Tracker(main_settings& s, Mappings &m, SelectedLibraries &libs) : s(s), m(m), - centerp(false), + centerp(true), enabledp(true), zero_(false), should_quit(false), @@ -106,8 +106,20 @@ void Tracker::logic() r = cam * r; + bool can_center = false; + if (centerp) { + for (int i = 0; i < 6; i++) + if (fabs(newpose[i]) != 0) + { + can_center = true; + break; + } + } + + if (can_center) + { centerp = false; for (int i = 0; i < 3; i++) t_b[i] = t(i, 0); @@ -179,7 +191,7 @@ void Tracker::run() { { t.start(); - double tmp[6]; + double tmp[6] {0,0,0, 0,0,0}; libs.pTracker->data(tmp); if (enabledp) |