summaryrefslogtreecommitdiffhomepage
path: root/opentrack
diff options
context:
space:
mode:
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/simple-mat.cpp6
-rw-r--r--opentrack/simple-mat.hpp6
2 files changed, 9 insertions, 3 deletions
diff --git a/opentrack/simple-mat.cpp b/opentrack/simple-mat.cpp
index 4ab68e0f..367cf365 100644
--- a/opentrack/simple-mat.cpp
+++ b/opentrack/simple-mat.cpp
@@ -36,9 +36,9 @@ euler_t rmat_to_euler(const dmat<3, 3>& R)
// tait-bryan angles, not euler
rmat euler_to_rmat(const double* input)
{
- auto H = input[0] * pi / 180;
- auto P = input[1] * pi / 180;
- auto B = input[2] * pi / 180;
+ 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 f5680ec4..8dc03014 100644
--- a/opentrack/simple-mat.hpp
+++ b/opentrack/simple-mat.hpp
@@ -253,3 +253,9 @@ euler_t OPENTRACK_API_EXPORT rmat_to_euler(const dmat<3, 3>& R);
} // end ns euler
template<int h_, int w_> using dmat = Mat<double, h_, w_>;
+
+template<typename num, int h, int w>
+inline Mat<num, h, w> operator*(num scalar, const Mat<num, h, w>& mat)
+{
+ return mat * scalar;
+}