QuatC
QuatC class defines a quaternion class which is used by the Demopaja system. The quaternion class implements standard set of methods and overdriven operators for easy use.
This class is implemented by the system.
| Header: | QuatC.h |
| Library: | core.lib |
QuatC(
|
Creates a new quaternion with the values as the arguments.
QuatC(
|
Copy constructor. Creates a new quaternion with the same values as the argument.
void from_rot_matrix(
|
Converts a matrix to quaternion and stores the result to the quaternion.
Matrix3C to_rot_matrix() const;
|
Rotation matrix.
Converts the quaternion to matrix and returns the result.
void from_axis_angle(
|
void from_axis_angle(
|
Creates quaternion from axis-angle presentation and stores the result in the quaternion.
void to_axis_angle(
|
void to_axis_angle(
|
Converts the quaternion to axis-angle presentation and stores the result to the arguments.
QuatC operator-() const;
|
Negates the quaternion and returns the result.
float32& operator[](
|
const float32& operator[](
|
Reference to the component pointed by the index.
The index values from 0 to 3 corresponds to components X, Y, Z, and W respectively. There are two versions of this method, the first enables to assign values and the second is for retrieving the values.
QuatC operator+(
|
Adds the quaternion specified by argument from the quaternion and returns the result.
QuatC operator-(
|
Substracts the quaternion specified by argument from the quaternion and returns the result.
QuatC operator*(
|
Multiplies the quaternion specified by argument from the quaternion and returns the result.
QuatC operator/(
|
Divides the quaternion specified by argument from the quaternion and returns the result.
QuatC operator*(
|
Multiplies the quaternion by a scalar value specified by the argument and returns the result.
friend QuatC operator*(
|
Multiplies the quaternion by a scalar value specified by the argument and returns the result.
bool operator==(
|
True if both quaternions are equal, else false.
bool operator!=(
|
True if both quaternions are not equal, else false.
float32 dot(
|
Computes the quaternion dot product and returns the result.
float32 norm() const;
|
Return the squared-length of the quaternion.
QuatC inverse() const;
|
Converts the quaternion to unit-length and inverses it and returns the result. Use this method to inverse non-unit-length quaternions.
QuatC unit_inverse() const;
|
Inverses the quaternion and returns the result. Use this method to inverse unit-length quaternions.
QuatC exp() const;
|
Computes the exponential of the quaternion and returns the result.
QuatC log() const;
|
Computes the logarithm of the quaternion and returns the result.
QuatC normalize() const;
|
Normalizes the quaternion to unit length and returns the result.
static QuatC slerp(
|
Interpolated quaternion.
Uses spherical linear interpolation to find the quaternion value between the first and the second interpolation quaternions.
Copyright © 2000 Moppi Productions