#include <gauge3d/3dmath/quaternion.h>
Public Methods | |
GQuaternion () | |
Creates an uninitialized quaternion. | |
GQuaternion (const GVector &axis,GCoordinate angle) | |
Creates a quaternion that represents the given axis-angle rotation. The axis must be normalized! | |
void | Rotate (const GVector in[],GVector out[],int num)const |
Applies the quaternion rotation to a set of vectors. More... | |
void | Rotate (GVector *vec)const |
Rotate a single vector in place. | |
void | Interpolate (const GQuaternion &q1,const GQuaternion &q2,GCoordinate t) |
Spherical linear interpolation between quaternions. More... | |
GCoordinate | Angle ()const |
Extracts the angle of the quaternion rotation. | |
GVector | Axis ()const |
Extracts the axis of the quaternion rotation. | |
GVector | RawAxis ()const |
Returns the axis without normalizing it. Faster. | |
void | Set (const GVector &axis,GCoordinate angle) |
Sets the quaternion to represent the given axis-angle rotation. The axis must be a unit vector! | |
GQuaternion | operator * (const GQuaternion &other)const |
Combines two quaternion rotations into one. More... | |
const GQuaternion& | operator *= (const GQuaternion &other) |
Combines two quaternion rotations into one. More... | |
Public Attributes | |
Coordinates | |
GCoordinate | x |
imaginary component 1. | |
GCoordinate | y |
imaginary component 2. | |
GCoordinate | z |
imaginary component 3. | |
GCoordinate | w |
real component. |
A quaternion is a complex number with one real component and three imaginary components. But you don't need to worry about that. All you care about is the fact that quaternions are an efficient way to represent axis-angle rotations.
|
Applies the quaternion rotation to a set of vectors.
|
|
Spherical linear interpolation between quaternions. Interpolate() interpolates along a sphere between q1 and q2 using time value t, which is between 0.0 (q1), and 1.0 (q2). The results are stored in this. This is useful if you want to find the orientation between two quaternions, or want to animate an object moving between these two orientations. |
|
Combines two quaternion rotations into one. Applying the resulting quaternion to a vector will have the same effect as if you had first applied the second operand of the multiplication to the vector, and then the first operand. This is similar to matrix multiplication. |
|
Combines two quaternion rotations into one. Applying the resulting quaternion to a vector will have the same effect as if you had first applied the second operand of the multiplication to the vector, and then the first operand. This is similar to matrix multiplication. |