summaryrefslogtreecommitdiffhomepage
path: root/opentrack/simple-mat.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-22 07:53:33 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-23 11:05:33 +0200
commit256b5d2204bcae3db62c86cdf4774bdaa448c6b8 (patch)
treee1c737e65f2be27407af94f84cb4f1f61912cc4a /opentrack/simple-mat.cpp
parent6bd980833c4da698540224fb58adbd4c988e11c2 (diff)
api/simple-mat: don't use a temporary array
Diffstat (limited to 'opentrack/simple-mat.cpp')
-rw-r--r--opentrack/simple-mat.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/opentrack/simple-mat.cpp b/opentrack/simple-mat.cpp
index b9273fc0..6a5421c1 100644
--- a/opentrack/simple-mat.cpp
+++ b/opentrack/simple-mat.cpp
@@ -43,22 +43,20 @@ rmat euler_to_rmat(const double* input)
const auto c3 = cos(B);
const auto s3 = sin(B);
- double foo[] = {
- // z
- c1 * c2,
- c1 * s2 * s3 - c3 * s1,
- s1 * s3 + c1 * c3 * s2,
- // y
- c2 * s1,
- c1 * c3 + s1 * s2 * s3,
- c3 * s1 * s2 - c1 * s3,
- // x
- -s2,
- c2 * s3,
- c2 * c3
- };
-
- return dmat<3, 3>(foo);
+ return dmat<3, 3>(
+ // z
+ c1 * c2,
+ c1 * s2 * s3 - c3 * s1,
+ s1 * s3 + c1 * c3 * s2,
+ // y
+ c2 * s1,
+ c1 * c3 + s1 * s2 * s3,
+ c3 * s1 * s2 - c1 * s3,
+ // x
+ -s2,
+ c2 * s3,
+ c2 * c3
+ );
}
} // end ns euler