diff options
Diffstat (limited to 'opentrack/simple-mat.cpp')
-rw-r--r-- | opentrack/simple-mat.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/opentrack/simple-mat.cpp b/opentrack/simple-mat.cpp index 645bcbbe..4ab68e0f 100644 --- a/opentrack/simple-mat.cpp +++ b/opentrack/simple-mat.cpp @@ -9,46 +9,8 @@ enum Axis TX, TY, TZ, Yaw, Pitch, Roll }; -static constexpr double eps_ = 2e1; -static constexpr double d2r = pi / 180; -static constexpr double eps = eps_ * d2r; - -euler_t euler_filter(const euler_t& rot_) -{ - using std::fabs; - using std::copysign; - - euler_t rot(rot_); - - static constexpr double thres[] = - { - pi, pi/2, pi - }; - - double changed_eps[] = { 0, 0, 0 }; - - for (int i = 0; i < 3; i++) - if (fabs(rot(i)) > thres[i] - eps && fabs(rot(i)) < thres[i] + eps) - { - const double eps__ = copysign(eps, rot(i)); - changed_eps[i] = eps__; - - rot(i) -= eps__; - rot = rmat_to_euler(euler_to_rmat(rot)); - } - - for (int i = 0; i < 3; i++) - { - rot(i) += changed_eps[i]; - if (fabs(rot(i)) > 2*pi) - rot(i) = copysign(2*pi, rot(i)); - } - return rot; -} - euler_t rmat_to_euler(const dmat<3, 3>& R) { - static constexpr double pi = 3.141592653; const double pitch_1 = asin(-R(0, 2)); const double pitch_2 = pi - pitch_1; const double cos_p1 = cos(pitch_1), cos_p2 = cos(pitch_2); @@ -74,7 +36,6 @@ euler_t rmat_to_euler(const dmat<3, 3>& R) // tait-bryan angles, not euler rmat euler_to_rmat(const double* input) { - static constexpr double pi = 3.141592653; auto H = input[0] * pi / 180; auto P = input[1] * pi / 180; auto B = input[2] * pi / 180; |