summaryrefslogtreecommitdiffhomepage
path: root/opentrack-logic
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-04 10:37:46 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-04 10:37:46 +0200
commita822de144cd679af6c27262d86884483b1fc634e (patch)
tree226c0343cae98febdb8bd33d52ecaafc990dd1ea /opentrack-logic
parentc63688786b535b775cf34c7ad33b3afd238f04bb (diff)
logic/tracker: get roll for camera centering from inertial centering
It stays centered this way. Sadly yaw and pitch are still somewhat not fixed in the user's reference frame.
Diffstat (limited to 'opentrack-logic')
-rw-r--r--opentrack-logic/tracker.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/opentrack-logic/tracker.cpp b/opentrack-logic/tracker.cpp
index 6557b061..10512059 100644
--- a/opentrack-logic/tracker.cpp
+++ b/opentrack-logic/tracker.cpp
@@ -177,12 +177,17 @@ void Tracker::logic()
rmat m_;
switch (s.center_method)
{
+ // inertial
case 0:
default:
m_ = r * r_b.t();
break;
+ // relative
case 1:
- m_ = r_b.t() * r;
+ euler_t degs = rmat_to_euler(r_b.t() * r);
+ degs(2) = rmat_to_euler(r * r_b.t())(2);
+ m_ = euler_to_rmat(degs);
+ break;
}
const euler_t euler = r2d * rmat_to_euler(m_);