summaryrefslogtreecommitdiffhomepage
path: root/logic
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-03-17 10:46:41 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-03-17 10:46:41 +0100
commit949d847ed9df6d2d2a7931f3f69014aa56a5ab7c (patch)
tree305500b7d7363c1024e05803c4ac0d9ae7dde037 /logic
parent9a8ce5a15e6a461031ca5af92975c82281c06a64 (diff)
logic/tracker: avoid using zero position in reltrans/mapping
Diffstat (limited to 'logic')
-rw-r--r--logic/tracker.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/logic/tracker.cpp b/logic/tracker.cpp
index 007189ec..9b085108 100644
--- a/logic/tracker.cpp
+++ b/logic/tracker.cpp
@@ -288,9 +288,6 @@ void Tracker::logic()
for (int i = 3; i < 6; i++)
value(i) = map(value(i), m(i));
- for (int i = 0; i < 6; i++)
- value(i) += m(i).opts.zero;
-
if (get(f_zero))
for (int i = 0; i < 6; i++)
value(i) = 0;
@@ -348,6 +345,10 @@ void Tracker::logic()
(void) map(raw_6dof(i), m(i));
}
+ // custom zero position
+ for (int i = 0; i < 6; i++)
+ value(i) += m(i).opts.zero * (m(i).opts.invert ? -1 : 1);
+
if (!nanp)
libs.pProtocol->pose(value);