#include <SIBCQuaternion.h>
Public Member Functions |
|
| CSIBCQuaternion () | |
| CSIBCQuaternion (const CSIBCQuaternion &in_quat) | |
| SI_Error | Init () |
| SI_Error | Init (CSIBCQuaternion &in_quat) |
| SI_Error | Init (SI_Float in_dX, SI_Float in_dY, SI_Float in_dZ, SI_Float in_dW) |
| SI_Error | Init (SI_Float in_dX, SI_Float in_dY, SI_Float in_dZ) |
| SI_Float | GetX () const |
| SI_Float | GetY () const |
| SI_Float | GetZ () const |
| SI_Float | GetW () const |
| SI_Error | SetX (SI_Float in_dX) |
| SI_Error | SetY (SI_Float in_dY) |
| SI_Error | SetZ (SI_Float in_dZ) |
| SI_Error | SetW (SI_Float in_dW) |
| SI_Error | GetMatrix (CSIBCMatrix4x4 &out_mat) |
| SI_Error | GetXYZRotation (CSIBCVector3D &out_vect) |
| SI_Error | GetXYZRotation (SI_Float in_dX, SI_Float in_dY, SI_Float in_dZ, CSIBCVector3D &out_vect) |
| SI_Error | GetAxisAngle (CSIBCVector3D &out_vAxis, float &out_fAngle) |
| SI_Error | Set (SI_Float in_dX, SI_Float in_dY, SI_Float in_dZ, SI_Float in_dW) |
| void | operator= (const CSIBCQuaternion &in_quat) |
| SI_Error | SelfTest () |
The notation used in this quaternion class (W, X, Y, Z) makes the quaternions closely related to 4D vectors (See CSIBCVector4D). In general, the quaternion can be thought of as a scalar plus a vector, where the W component is the vector, and X, Y and Z are the coefficients of the I, J and K matricies respectively.
The components of the CSIBCQuaternion class are represented by single precision floating-point numbers. Its corresponding double precision class, CSIBCQuaterniond, has much more functionality, such as the ability to interpolate and multiply quaternions.
| CSIBCQuaternion | ( | ) | [inline] |
Default Constructor. Sets all components of the quaternion to zero, except W, which is set to one.
| CSIBCQuaternion | ( | const CSIBCQuaternion & | in_quat | ) | [inline] |
Copy Copnstructor. Copies the data from in_quat to the new quaternion.
| in_quat | Quaternion containing data to copy to this quaternion. |
| SI_Error Init | ( | ) | [inline] |
Initializes the quaternion components values all to zero, except W, which is set to one.
| SI_Error Init | ( | CSIBCQuaternion & | in_quat | ) |
Initializes the quaternion component values to those of in_quat.
| in_quat | The quaternion from which to copy initialization values. |
| SI_Error Init | ( | SI_Float | in_dX, | |
| SI_Float | in_dY, | |||
| SI_Float | in_dZ, | |||
| SI_Float | in_dW | |||
| ) |
Initializes the quaternion components values to the values given.
| in_dX | The new value for the X component of the quaternion. | |
| in_dY | The new value for the Y component of the quaternion. | |
| in_dZ | The new value for the Z component of the quaternion. | |
| in_dW | The new value for the W component of the quaternion. |
| SI_Error Init | ( | SI_Float | in_dX, | |
| SI_Float | in_dY, | |||
| SI_Float | in_dZ | |||
| ) |
Initializes the quaternion to the quaternion represented by the euler rotations given by the euler angles (pitch-roll-yaw) of the parameters.
| in_dX | Value for the pitch euler angle, for the quaternion value. | |
| in_dY | Value for the roll euler angle, for the quaternion value. | |
| in_dZ | Value for the yaw euler angle, for the quaternion value. |
| SI_Float GetX | ( | ) | const [inline] |
Gets the X component of the quaternion.
| SI_Float GetY | ( | ) | const [inline] |
Gets the Y component of the quaternion.
| SI_Float GetZ | ( | ) | const [inline] |
Gets the Z component of the quaternion.
| SI_Float GetW | ( | ) | const [inline] |
Gets the W component of the quaternion.
| SI_Error SetX | ( | SI_Float | in_dX | ) | [inline] |
Sets the X component of the quaternion.
| in_dX | The new values for the X component of the quaternion. |
| SI_Error SetY | ( | SI_Float | in_dY | ) | [inline] |
Sets the Y component of the quaternion.
| in_dY | The new values for the Y component of the quaternion. |
| SI_Error SetZ | ( | SI_Float | in_dZ | ) | [inline] |
Sets the Z component of the quaternion.
| in_dZ | The new values for the Z component of the quaternion. |
| SI_Error SetW | ( | SI_Float | in_dW | ) | [inline] |
Sets the W component of the quaternion.
| in_dW | The new values for the W component of the quaternion. |
| SI_Error GetMatrix | ( | CSIBCMatrix4x4 & | out_mat | ) |
Returns the rotation matrix corresponding to this quaternion. The quaternion must be a unit quaternion for this operation to succeed.
| out_mat | Reference to the matrix object to receive the rotation matrix. |
| SI_Error GetXYZRotation | ( | CSIBCVector3D & | out_vect | ) | [inline] |
Returns the euler rotation angles (pitch-roll-yaw) represented by this quaternion.
| out_vect | Vector to receive the euler rotation angles. |
| SI_Error GetXYZRotation | ( | SI_Float | in_dX, | |
| SI_Float | in_dY, | |||
| SI_Float | in_dZ, | |||
| CSIBCVector3D & | out_vect | |||
| ) |
Returns the euler rotation angles (pitch-roll-yaw) represented by this quaternion.
| out_vect | Vector to receive the euler rotation angles. | |
| in_dX | Ignored. | |
| in_dY | Ignored. | |
| in_dZ | Ignored. |
| SI_Error GetAxisAngle | ( | CSIBCVector3D & | out_vAxis, | |
| float & | out_fAngle | |||
| ) |
Gets the axis of rotation, and rotation angle about the axis, that is represented by this quaternion.
| out_vAxis | Receives the axis of rotation. | |
| out_fAngle | Receives the angle of rotation about the axis (in radians). |
| SI_Error Set | ( | SI_Float | in_dX, | |
| SI_Float | in_dY, | |||
| SI_Float | in_dZ, | |||
| SI_Float | in_dW | |||
| ) | [inline] |
Sets all components of the quaternion.
| in_dX | Value for the X component of the quaternion. | |
| in_dY | Value for the Y component of the quaternion. | |
| in_dZ | Value for the Z component of the quaternion. | |
| in_dW | Value for the W component of the quaternion. |
| void operator= | ( | const CSIBCQuaternion & | in_quat | ) | [inline] |
Sets this quaternion equal to in_quat.
| in_quat | Quaternion to set this quaternion equal to. |
| SI_Error SelfTest | ( | ) | [inline] |
Tests to see whether this quaternion is valid. If the quaternion is invalid, an assertion will occur.