30 #ifndef _CEGUIQuaternion_h_
31 #define _CEGUIQuaternion_h_
33 #include "CEGUI/Base.h"
34 #include "CEGUI/Interpolator.h"
35 #include "CEGUI/Vector.h"
73 inline Quaternion(
float w = 1.0f,
float x = 0.0f,
float y = 0.0f,
float z = 0.0f):
111 static Quaternion eulerAnglesRadians(
float x,
float y,
float z);
125 static Quaternion eulerAnglesDegrees(
float x,
float y,
float z);
150 return (d_w == v.
d_w) && (d_x == v.
d_x) && (d_y == v.
d_y) && (d_z == v.
d_z);
156 return (d_w != v.
d_w) || (d_x != v.
d_x) || (d_y != v.
d_y) || (d_z != v.
d_z);
168 return Quaternion(d_w * v, d_x * v, d_y * v, d_z * v);
180 return d_w * v.
d_w + d_x * v.
d_x + d_y * v.
d_y + d_z * v.
d_z;
209 inline float length()
const
211 return sqrtf((d_w * d_w) + (d_x * d_x) + (d_y * d_y) + (d_z * d_z));
217 inline float normalise()
219 const float len = length();
220 const float factor = 1.0f / len;
221 *
this = *
this * factor;
251 inline friend std::ostream& operator << (std::ostream& s,
const Quaternion& v)
253 s <<
"CEGUI::Quaternion(" << v.
d_w <<
", " << v.
d_x <<
", " << v.
d_y <<
", " << v.
d_z <<
")";
304 #endif // end of guard _CEGUIQuaternion_h_