summaryrefslogtreecommitdiffhomepage
path: root/logic
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-06-12 23:27:46 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-06-12 23:27:46 +0200
commitf5770a675ec0a716fb5f0350f4ff48f17f252105 (patch)
tree129cdcfc4226ef11db0e87dc0f24a178f3df85dd /logic
parente52611bc00698aa24a2efd85d495f3826e5919af (diff)
logic/tracker: unrotate position data
Diffstat (limited to 'logic')
-rw-r--r--logic/tracker.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/logic/tracker.cpp b/logic/tracker.cpp
index ffa3eff4..7f546236 100644
--- a/logic/tracker.cpp
+++ b/logic/tracker.cpp
@@ -225,6 +225,9 @@ void Tracker::logic()
}
euler_t pos = euler_t(&value[TX]) - t_center;
+
+ t_compensate(real_rotation.rot_center, pos, pos, false, false, false);
+
euler_t rot = r2d * c_mult * rmat_to_euler(rotation);
for (int i = 0; i < 3; i++)
@@ -398,9 +401,14 @@ void Tracker::run()
backlog_time += ns(elapsed_nsecs - const_sleep_ms);
- const int sleep_time_ms = iround((time_cast<ms>(clamp(const_sleep_ms - backlog_time,
- ms_::zero(), ms_(50))))
- .count());
+ const int sleep_time_ms = time_cast<ms_>(clamp(const_sleep_ms - backlog_time,
+ ms_::zero(), ms_(10))).count();
+
+#if 0
+ qDebug() << "sleepy time" << sleep_time_ms
+ << "elapsed" << time_cast<ms>(elapsed_nsecs).count()
+ << "backlog" << time_cast<ms>(backlog_time).count();
+#endif
portable::sleep(sleep_time_ms);
}