summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-22 10:09:41 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-23 11:05:33 +0200
commit8d428560bbcf2d5b96df406e3c6b7c5830571058 (patch)
tree5f52ff8d42241ed3733695bd1d9bcf781a86d39b
parent256b5d2204bcae3db62c86cdf4774bdaa448c6b8 (diff)
logic, api: switch euler to use euler_t input. adjust usages.
-rw-r--r--opentrack-logic/tracker.cpp8
-rw-r--r--opentrack/simple-mat.cpp8
-rw-r--r--opentrack/simple-mat.hpp2
3 files changed, 10 insertions, 8 deletions
diff --git a/opentrack-logic/tracker.cpp b/opentrack-logic/tracker.cpp
index e8d8a522..aec9e654 100644
--- a/opentrack-logic/tracker.cpp
+++ b/opentrack-logic/tracker.cpp
@@ -194,7 +194,7 @@ void Tracker::logic()
for (int i = 0; i < 3; i++)
{
- value(i) = tmp[i];
+ value(i) = tmp(i);
value(i+3) = euler(i);
}
}
@@ -223,9 +223,11 @@ void Tracker::logic()
value(Pitch) * d2r,
value(Roll) * d2r);
t_compensate(euler_to_rmat(&value_[0]),
- value,
- value,
+ value_,
+ value_,
s.tcomp_tz);
+ for (int i = 3; i < 6; i++)
+ value(i) = value_(i);
}
for (int i = 0; i < 6; i++)
diff --git a/opentrack/simple-mat.cpp b/opentrack/simple-mat.cpp
index 6a5421c1..ed372299 100644
--- a/opentrack/simple-mat.cpp
+++ b/opentrack/simple-mat.cpp
@@ -30,11 +30,11 @@ euler_t rmat_to_euler(const dmat<3, 3>& R)
}
// tait-bryan angles, not euler
-rmat euler_to_rmat(const double* input)
+rmat euler_to_rmat(const euler_t input)
{
- const double H = input[0];
- const double P = input[1];
- const double B = input[2];
+ const double H = input(0);
+ const double P = input(1);
+ const double B = input(2);
const auto c1 = cos(H);
const auto s1 = sin(H);
diff --git a/opentrack/simple-mat.hpp b/opentrack/simple-mat.hpp
index 04cd38ee..93d0d0c9 100644
--- a/opentrack/simple-mat.hpp
+++ b/opentrack/simple-mat.hpp
@@ -268,7 +268,7 @@ template<int y, int x> using dmat = Mat<double, y, x>;
using rmat = dmat<3, 3>;
using euler_t = dmat<3, 1>;
-rmat OPENTRACK_API_EXPORT euler_to_rmat(const double* input);
+rmat OPENTRACK_API_EXPORT euler_to_rmat(const euler_t input);
// http://stackoverflow.com/a/18436193
euler_t OPENTRACK_API_EXPORT rmat_to_euler(const dmat<3, 3>& R);