Ocular Engine
Euler.hpp
1 
17 #ifndef __H__OCULAR_MATH_EULER_H__
18 #define __H__OCULAR_MATH_EULER_H__
19 
20 #include "Utilities/Types.hpp"
21 
22 //------------------------------------------------------------------------------------------
23 
28 namespace Ocular
29 {
34  namespace Math
35  {
36  //----------------------------------------------------------------
37  // Forward Declarations
38 
39  template<typename T> class Vector3;
40  class Matrix3x3;
41  class Quaternion;
42 
43  //----------------------------------------------------------------
44 
54  class Euler
55  {
56  friend class Matrix3x3;
57  friend class Quaternion;
58 
59  public:
60 
64  Euler();
65 
71  Euler(float const pPitch, float const pYaw, float const pRoll);
72 
76  Euler(Vector3<float> const& vector);
77 
83  Euler(Matrix3x3 const& rotationMatrix);
84 
89  Euler(Quaternion const& quaternion);
90 
91  ~Euler();
92 
93  //------------------------------------------------------------
94  // GETTERS / SETTERS
95  //------------------------------------------------------------
96 
100  float getYaw() const;
101 
105  float getYawRadians() const;
106 
110  float getPitch() const;
111 
115  float getPitchRadians() const;
116 
120  float getRoll() const;
121 
125  float getRollRadians() const;
126 
133  void setYaw(float const yaw);
134 
138  void setYawRadians(float const yaw);
139 
146  void setPitch(float const pitch);
147 
151  void setPitchRadians(float const pitch);
152 
159  void setRoll(float const roll);
160 
164  void setRollRadians(float const roll);
165 
166  //------------------------------------------------------------
167  // CONVERSIONS
168  //------------------------------------------------------------
169 
176  Matrix3x3 toRotationMatrix() const;
177 
184  Quaternion toQuaternion() const;
185 
186  //------------------------------------------------------------
187  // OPERATIONS
188  //------------------------------------------------------------
189 
194  static float normalizeAxis(float const& angle);
195 
200  static float denormalizeAxis(float const& angle);
201 
205  void normalize();
206 
210  Euler getNormalized() const;
211 
215  void denormalize();
216 
220  Euler getDenormalized() const;
221 
222  protected:
223 
224  private:
225 
226  float m_Yaw;
227  float m_Pitch;
228  float m_Roll;
229  };
230  }
234 }
239 OCULAR_REGISTER_TYPE_CUSTOM(Ocular::Math::Euler, "Euler");
240 
241 //------------------------------------------------------------------------------------------
242 
243 #endif
void setYawRadians(float const yaw)
Definition: Euler.cpp:120
Matrix3x3 toRotationMatrix() const
Definition: Euler.cpp:149
void setYaw(float const yaw)
Definition: Euler.cpp:115
Definition: Euler.hpp:39
float getYawRadians() const
Definition: Euler.cpp:90
void setPitch(float const pitch)
Definition: Euler.cpp:125
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
Definition: Euler.hpp:54
Quaternion toQuaternion() const
Definition: Euler.cpp:154
Definition: Quaternion.hpp:50
A 3x3 column-major float matrix.
Definition: Matrix3x3.hpp:63
void setRoll(float const roll)
Definition: Euler.cpp:135
float getYaw() const
Definition: Euler.cpp:85
float getPitch() const
Definition: Euler.cpp:95
void setRollRadians(float const roll)
Definition: Euler.cpp:140
float getPitchRadians() const
Definition: Euler.cpp:100
float getRoll() const
Definition: Euler.cpp:105
void denormalize()
Definition: Euler.cpp:206
void normalize()
Definition: Euler.cpp:191
static float denormalizeAxis(float const &angle)
Definition: Euler.cpp:177
static float normalizeAxis(float const &angle)
Definition: Euler.cpp:163
void setPitchRadians(float const pitch)
Definition: Euler.cpp:130
float getRollRadians() const
Definition: Euler.cpp:110