t
Loading...
Searching...
No Matches
EulerRotation.hpp
1#include "constants.hpp"
2
3#ifndef EULERROTATION_HPP
4#define EULERROTATION_HPP
5
6namespace t {
7
18public:
19 double x;
20 double y;
21 double z;
33 EulerRotation(double _x, double _y, double _z, EulerRotationOrder _order)
34 : x(_x), y(_y), z(_z), order(_order) {}
35
43 x = source.x;
44 y = source.y;
45 z = source.z;
46 order = source.order;
47
48 return *this;
49 }
50
59 const EulerRotation &b) {
60 return EulerRotation(a.x + b.x, a.y + b.y, a.z + b.z, a.order);
61 }
62
71 const EulerRotation &b) {
72 return EulerRotation(a.x - b.x, a.y - b.y, a.z - b.z, a.order);
73 }
74};
75
76} // namespace t
77
78#endif // EULERROTATION_HPP
The Euler rotation class.
Definition EulerRotation.hpp:17
double x
The amount of rotation about the local X axis in radians.
Definition EulerRotation.hpp:19
friend EulerRotation operator+(const EulerRotation &a, const EulerRotation &b)
Adds 2 Euler rotations.
Definition EulerRotation.hpp:58
EulerRotation & copy(const EulerRotation &source)
Copies another Euler rotation into this Euler rotation.
Definition EulerRotation.hpp:42
double y
The amount of rotation about the local Y axis in radians.
Definition EulerRotation.hpp:20
EulerRotation(double _x, double _y, double _z, EulerRotationOrder _order)
Creates a new representation of a rotation based on Euler angles.
Definition EulerRotation.hpp:33
double z
The amount of rotation about the local Z axis in radians.
Definition EulerRotation.hpp:21
friend EulerRotation operator-(const EulerRotation &a, const EulerRotation &b)
Substracts an Euler rotation from another Euler rotation.
Definition EulerRotation.hpp:70
EulerRotationOrder order
The order to perform the rotations around individual axes.
Definition EulerRotation.hpp:23
Contains various constants and enumerations.
The t software 3D graphics library namespace.
Definition algorithms.hpp:12
EulerRotationOrder
The Euler rotation order.
Definition constants.hpp:19