![]() |
Public API Reference |
#include <quaterni.h>
Public Methods | |
| void | Init (float theR, float theX, float theY, float theZ) |
| Initialize a quaternion with specific values. More... | |
| csQuaternion () | |
| Construct a 0,0,0,0 quaternion. More... | |
| csQuaternion (float theR, float theX=0.0, float theY=0.0, float theZ=0.0) | |
| Construct a quaternion with the given parameters. More... | |
| csQuaternion (const csQuaternion &q) | |
| Copy constructor. More... | |
| csQuaternion (const csVector3 &q) | |
| Construct quaternion from a vector. More... | |
| csQuaternion (const csMatrix3 &smat) | |
| Construct quaternion from a matrix. More... | |
| csQuaternion & | operator *= (const csQuaternion &q2) |
| Multiply two quaternions. More... | |
| void | Negate () |
| Negate all parameters of the quaternion. More... | |
| void | Invert () |
| Invert the orientation of this quaternion. More... | |
| void | GetAxisAngle (csVector3 &axis, float &phi) const |
| Get an axis-angle representation of this orientation. More... | |
| void | SetWithAxisAngle (csVector3 axis, float phi) |
| Set the quaternion using an axis-angle representation. More... | |
| void | PrepRotation (float angle, csVector3 vec) |
| Prepare a rotation quaternion, we do a rotation around vec by an angle of "angle". More... | |
| csVector3 | Rotate (csVector3 vec) |
| rotated = q * vec * qConj. More... | |
| void | Normalize () |
| Normalize this quaternion. More... | |
| void | SetWithEuler (const csVector3 &rot) |
| Convert a set of Euler angles to a Quaternion. More... | |
| void | GetEulerAngles (csVector3 &angles) |
| Convert a Quaternion to a set of Euler angles. More... | |
| csQuaternion | ToAxisAngle () const |
| Return an Axis Angle representation of this Quaternion. More... | |
| csQuaternion | Slerp (const csQuaternion &quat2, float slerp) const |
| Spherical Linear Interpolation between two quaternions Calculated between this class & the second quaternion by the slerp factor and returned as a new quaternion. More... | |
Friends | |
| csQuaternion | operator+ (const csQuaternion &q1, const csQuaternion &q2) |
| Add two quaternions. More... | |
| csQuaternion | operator- (const csQuaternion &q1, const csQuaternion &q2) |
| Subtract two quaternions. More... | |
| csQuaternion | operator * (const csQuaternion &q1, const csQuaternion &q2) |
| Multiply two quaternions. More... | |
Definition at line 35 of file quaterni.h.
|
|
Construct a 0,0,0,0 quaternion.
Definition at line 43 of file quaterni.h. References Init. |
|
||||||||||||||||||||
|
Construct a quaternion with the given parameters.
Definition at line 45 of file quaterni.h. References Init. |
|
|
Copy constructor.
Definition at line 48 of file quaterni.h. |
|
|
Construct quaternion from a vector.
Definition at line 50 of file quaterni.h. References Init, csVector3::x, csVector3::y, and csVector3::z. |
|
|
Construct quaternion from a matrix.
|
|
||||||||||||
|
Get an axis-angle representation of this orientation.
|
|
|
Convert a Quaternion to a set of Euler angles. Returns a (X,Y,Z) rather than Yaw-Pitch-Roll (Y,X,Z). |
|
||||||||||||||||||||
|
Initialize a quaternion with specific values.
Definition at line 39 of file quaterni.h. Referenced by csQuaternion, Negate, operator *=, and PrepRotation. |
|
|
Invert the orientation of this quaternion.
|
|
|
Negate all parameters of the quaternion.
Definition at line 93 of file quaterni.h. References Init. |
|
|
Normalize this quaternion.
Definition at line 136 of file quaterni.h. References qisqrt. |
|
|
Multiply two quaternions.
Definition at line 80 of file quaterni.h. |
|
||||||||||||
|
Prepare a rotation quaternion, we do a rotation around vec by an angle of "angle". Note that vec needs to be a normalized vector (we don't check this). Definition at line 117 of file quaterni.h. References Init, csVector3::x, csVector3::y, and csVector3::z. |
|
|
rotated = q * vec * qConj.
Definition at line 125 of file quaterni.h. |
|
||||||||||||
|
Set the quaternion using an axis-angle representation.
|
|
|
Convert a set of Euler angles to a Quaternion. Takes a (X,Y,Z) rather than Yaw-Pitch-Roll (Y,X,Z) The output is NOT Normalized, if you wish to do so, normalize it yourself. |
|
||||||||||||
|
Spherical Linear Interpolation between two quaternions Calculated between this class & the second quaternion by the slerp factor and returned as a new quaternion.
|
|
|
Return an Axis Angle representation of this Quaternion.
|
|
||||||||||||
|
Multiply two quaternions.
Definition at line 70 of file quaterni.h. |
|
||||||||||||
|
Add two quaternions.
Definition at line 56 of file quaterni.h. |
|
||||||||||||
|
Subtract two quaternions.
Definition at line 63 of file quaterni.h. |