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;
210 return sqrtf((d_w * d_w) + (d_x * d_x) + (d_y * d_y) + (d_z * d_z));
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_
virtual const String & getType() const
returns type string of this interpolator
static const Quaternion IDENTITY
Quaternion(1, 0, 0, 0)
Definition: Quaternion.h:245
Definition: MemoryAllocatedObject.h:109
float d_w
imaginary part
Definition: Quaternion.h:257
bool CEGUIEXPORT operator==(const String &str1, const String &str2)
Return true if String str1 is equal to String str2.
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
float d_y
y component of the vector part
Definition: Quaternion.h:261
float d_x
x component of the vector part
Definition: Quaternion.h:259
Quaternion(float w=1.0f, float x=0.0f, float y=0.0f, float z=0.0f)
verbatim constructor
Definition: Quaternion.h:72
float d_z
z component of the vector part
Definition: Quaternion.h:263
float dot(const Quaternion &v) const
quaternion dot product
Definition: Quaternion.h:177
static const Quaternion ZERO
Quaternion(0, 0, 0, 0)
Definition: Quaternion.h:243
String CEGUIEXPORT operator+(const String &str1, const String &str2)
Return String object that is the concatenation of the given inputs.
virtual String interpolateAbsolute(const String &value1, const String &value2, float position)
float length() const
computers and returns the length of this quaternion
Definition: Quaternion.h:208
bool CEGUIEXPORT operator!=(const String &str1, const String &str2)
Return true if String str1 is not equal to String str2.
virtual ~QuaternionSlerpInterpolator()
destructor
Definition: Quaternion.h:278
Class to represent rotation, avoids Gimbal lock.
Definition: Quaternion.h:67
virtual String interpolateRelative(const String &base, const String &value1, const String &value2, float position)
Defines a 'interpolator' class.
Definition: Interpolator.h:53
Special interpolator class for Quaternion.
Definition: Quaternion.h:272
Definition: PropertyHelper.h:611
virtual String interpolateRelativeMultiply(const String &base, const String &value1, const String &value2, float position)
String class used within the GUI system.
Definition: String.h:62
float normalise()
normalises this quaternion and returns it's length (since it has to be computed anyways) ...
Definition: Quaternion.h:216
Quaternion(const Quaternion &v)
copy constructor
Definition: Quaternion.h:80