29 #ifndef _CEGUIQuaternion_h_
30 #define _CEGUIQuaternion_h_
32 #include "CEGUI/Base.h"
33 #include "CEGUI/Interpolator.h"
34 #include "CEGUI/Vector.h"
72 inline Quaternion(
float w = 1.0f,
float x = 0.0f,
float y = 0.0f,
float z = 0.0f):
110 static Quaternion eulerAnglesRadians(
float x,
float y,
float z);
124 static Quaternion eulerAnglesDegrees(
float x,
float y,
float z);
149 return (d_w == v.
d_w) && (d_x == v.
d_x) && (d_y == v.
d_y) && (d_z == v.
d_z);
155 return (d_w != v.
d_w) || (d_x != v.
d_x) || (d_y != v.
d_y) || (d_z != v.
d_z);
167 return Quaternion(d_w * v, d_x * v, d_y * v, d_z * v);
179 return d_w * v.
d_w + d_x * v.
d_x + d_y * v.
d_y + d_z * v.
d_z;
208 inline float length()
const
210 return sqrtf((d_w * d_w) + (d_x * d_x) + (d_y * d_y) + (d_z * d_z));
216 inline float normalise()
218 const float len = length();
219 const float factor = 1.0f / len;
220 *
this = *
this * factor;
250 inline friend std::ostream& operator << (std::ostream& s,
const Quaternion& v)
252 s <<
"CEGUI::Quaternion(" << v.
d_w <<
", " << v.
d_x <<
", " << v.
d_y <<
", " << v.
d_z <<
")";
303 #endif // end of guard _CEGUIQuaternion_h_