summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/rotation.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-09-15 15:00:56 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-09-15 15:00:56 +0200
commit490f3ddb79018d13182fc17bb92943bbe427643d (patch)
treed1efc46c88878cf5435a19bfc9519dfd098220a8 /facetracknoir/rotation.h
parentbef7aff31e5ea073f0f160ca6a2f1e56b7dd881a (diff)
New PT from Patrick Ruoff adapted to Linux
Diffstat (limited to 'facetracknoir/rotation.h')
-rw-r--r--facetracknoir/rotation.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/facetracknoir/rotation.h b/facetracknoir/rotation.h
index e97ec0f0..747a23f9 100644
--- a/facetracknoir/rotation.h
+++ b/facetracknoir/rotation.h
@@ -9,15 +9,15 @@
#define ROTATION_H
#include <cmath>
// ----------------------------------------------------------------------------
-class Rotation {
+class RotationType {
public:
- Rotation() : a(1.0),b(0.0),c(0.0),d(0.0) {}
- Rotation(double yaw, double pitch, double roll) { fromEuler(yaw, pitch, roll); }
- Rotation(double a, double b, double c, double d) : a(a),b(b),c(c),d(d) {}
+ RotationType() : a(1.0),b(0.0),c(0.0),d(0.0) {}
+ RotationType(double yaw, double pitch, double roll) { fromEuler(yaw, pitch, roll); }
+ RotationType(double a, double b, double c, double d) : a(a),b(b),c(c),d(d) {}
- Rotation inv(){ // inverse
- return Rotation(a,-b,-c, -d);
+ RotationType inv(){ // inverse
+ return RotationType(a,-b,-c, -d);
}
@@ -46,10 +46,10 @@ public:
yaw = atan2(2.0*(a*d + b*c), 1.0 - 2.0*(c*c + d*d));
}
- const Rotation operator*(const Rotation& B)
+ const RotationType operator*(const RotationType& B)
{
- const Rotation& A = *this;
- return Rotation(A.a*B.a - A.b*B.b - A.c*B.c - A.d*B.d, // quaternion multiplication
+ const RotationType& A = *this;
+ return RotationType(A.a*B.a - A.b*B.b - A.c*B.c - A.d*B.d, // quaternion multiplication
A.a*B.b + A.b*B.a + A.c*B.d - A.d*B.c,
A.a*B.c - A.b*B.d + A.c*B.a + A.d*B.b,
A.a*B.d + A.b*B.c - A.c*B.b + A.d*B.a);