36 #ifndef __Quaternion_H__
37 #define __Quaternion_H__
62 : w(1), x(0), y(0), z(0)
69 : w(fW), x(fX), y(fY), z(fZ)
75 this->FromRotationMatrix(rot);
80 this->FromAngleAxis(rfAngle, rkAxis);
85 this->FromAxes(xaxis, yaxis, zaxis);
90 this->FromAxes(akAxis);
95 memcpy(&w, valptr,
sizeof(
Real)*4);
109 inline Real operator [] (
const size_t i )
const
117 inline Real& operator [] (
const size_t i )
136 void FromRotationMatrix (
const Matrix3& kRot);
137 void ToRotationMatrix (
Matrix3& kRot)
const;
141 void FromAngleAxis (
const Radian& rfAngle,
const Vector3& rkAxis);
145 ToAngleAxis ( rAngle, rkAxis );
151 void FromAxes (
const Vector3* akAxis);
154 void ToAxes (
Vector3* akAxis)
const;
189 return (rhs.
x == x) && (rhs.
y == y) &&
190 (rhs.
z == z) && (rhs.
w == w);
204 Real normalise(
void);
222 Radian getRoll(
bool reprojectAxis =
true)
const;
232 Radian getPitch(
bool reprojectAxis =
true)
const;
242 Radian getYaw(
bool reprojectAxis =
true)
const;
259 const Quaternion& rkQ,
bool shortestPath =
false);
270 static void Intermediate (
const Quaternion& rkQ0,
277 const Quaternion& rkQ,
bool shortestPath =
false);
294 const Quaternion& rkQ,
bool shortestPath =
false);
314 inline _OgreExport friend std::ostream&
operator <<
317 o <<
"Quaternion(" << q.w <<
", " << q.x <<
", " << q.y <<
", " << q.z <<
")";