diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-12-19 18:57:52 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-12-19 18:58:51 +0100 |
commit | a0f9bec29f95a790b30c72d97b2c45684c63aa4f (patch) | |
tree | 8827d1f9728f2cd982dc49bbf66124a28acf37dc /opentrack | |
parent | b02a27fa4bc6712b761b26420d2f7f86d7c86578 (diff) |
tracker: fix typo breaking Z value
Issue: #106
Yaw value was copied as Z value due to typo.
Diffstat (limited to 'opentrack')
-rw-r--r-- | opentrack/tracker.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index 60ed4c33..31939dea 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -102,10 +102,9 @@ void Tracker::logic() }; const rmat cam = rmat::euler_to_rmat(off); rmat r = rmat::euler_to_rmat(&value[Yaw]); - dmat<3, 1> t { value(0), value(1), value(3) }; + dmat<3, 1> t { value(0), value(1), value(2) }; r = cam * r; - t = cam * t; if (centerp) { @@ -116,11 +115,13 @@ void Tracker::logic() } { + double tmp[3] = { t(0, 0) - t_b[0], t(1, 0) - t_b[1], t(2, 0) - t_b[2] }; + t_compensate(cam, tmp, tmp, false); const rmat m_ = r * r_b.t(); const dmat<3, 1> euler = rmat::rmat_to_euler(m_); for (int i = 0; i < 3; i++) { - value(i) = t(i, 0) - t_b[i]; + value(i) = tmp[i]; value(i+3) = euler(i, 0) * r2d; } } |