Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

QuatC Class Reference

Quaternion class. More...

#include <QuatC.h>

List of all members.

Public Methods

 QuatC (float32 f32X=0, float32 f32Y=0, float32 f32Z=0, float32 f32W=1)
 Default constructor.

 QuatC (const QuatC &rQuat)
 copy constructor.

virtual ~QuatC ()
 Default destructor.

void from_rot_matrix (const Matrix3C &rMat)
 Converts a matrix to quaternion and stores the result to the quaternion.

Matrix3C to_rot_matrix () const
 Converts the quaternion to matrix and returns the result.

void from_axis_angle (const Vector3C &rVec, float32 f32Angle)
 Creates quaternion from axis-angle presentation and stores the result in the quaternion.

void from_axis_angle (float32 f32X, float32 f32Y, float32 f32Z, float32 f32Angle)
 Creates quaternion from axis-angle presentation and stores the result in the quaternion.

void to_axis_angle (Vector3C &rVec, float32 &f32Angle) const
 Converts the quaternion to axis-angle presentation and stores the result to the arguments.

void to_axis_angle (float32 &f32X, float32 &f32Y, float32 &f32Z, float32 &f32Angle) const
 Converts the quaternion to axis-angle presentation and stores the result to the arguments.

QuatC operator- () const
 Negates the quaternion and returns the result.

float32operator[] (int32 i)
 Return reference to the component pointed by the index.

const float32operator[] (int32 i) const
 Return reference to the component pointed by the index.

QuatC operator+ (const QuatC &rQuat) const
 Adds the quaternion specified by argument from the quaternion and returns the result.

QuatC operator- (const QuatC &rQuat) const
 Substracts the quaternion specified by argument from the quaternion and returns the result.

QuatC operator * (const QuatC &rQuat) const
 Multiplies the quaternion specified by argument from the quaternion and returns the result.

QuatC operator/ (const QuatC &rQuat) const
 Divides the quaternion specified by argument from the quaternion and returns the result.

QuatC operator * (float32 f32Scalar) const
 Multiplies the quaternion by a scalar value specified by the argument and returns the result.

bool operator== (const QuatC &rQuat) const
 Returns true if both quaternions are equal, else false.

bool operator!= (const QuatC &rQuat) const
 Returns true if both quaternions are non-equal, else false.

float32 dot (const QuatC &rQuat) const
 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.

QuatC unit_inverse () const
 Inverses the quaternion and returns the result.

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 Public Methods

QuatC slerp (float32 f32T, const QuatC &rQ, const QuatC &rP)
 Spherical linear interpolation.


Friends

QuatC operator * (float32 f32Scalar, const QuatC &rQuat)
 Multiplies the quaternion by a scalar value specified by the argument and returns the result.


Detailed Description

Quaternion class.

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.


Constructor & Destructor Documentation

QuatC float32    f32X = 0,
float32    f32Y = 0,
float32    f32Z = 0,
float32    f32W = 1
 

Default constructor.

QuatC const QuatC &    rQuat
 

copy constructor.

virtual ~QuatC   [virtual]
 

Default destructor.


Member Function Documentation

float32 dot const QuatC &    rQuat const [inline]
 

Computes the quaternion dot product and returns the result.

QuatC exp   const
 

Computes the exponential of the quaternion and returns the result.

void from_axis_angle float32    f32X,
float32    f32Y,
float32    f32Z,
float32    f32Angle
 

Creates quaternion from axis-angle presentation and stores the result in the quaternion.

void from_axis_angle const Vector3C   rVec,
float32    f32Angle
 

Creates quaternion from axis-angle presentation and stores the result in the quaternion.

void from_rot_matrix const Matrix3C   rMat
 

Converts a matrix to quaternion and stores the result to 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 log   const
 

Computes the logarithm of the quaternion and returns the result.

float32 norm   const [inline]
 

Return the squared-length of the quaternion.

QuatC normalize   const
 

Normalizes the quaternion to unit length and returns the result.

QuatC operator * float32    f32Scalar const [inline]
 

Multiplies the quaternion by a scalar value specified by the argument and returns the result.

QuatC operator * const QuatC &    rQuat const
 

Multiplies the quaternion specified by argument from the quaternion and returns the result.

bool operator!= const QuatC &    rQuat const [inline]
 

Returns true if both quaternions are non-equal, else false.

QuatC operator+ const QuatC &    rQuat const [inline]
 

Adds the quaternion specified by argument from the quaternion and returns the result.

QuatC operator- const QuatC &    rQuat const [inline]
 

Substracts the quaternion specified by argument from the quaternion and returns the result.

QuatC operator-   const [inline]
 

Negates the quaternion and returns the result.

QuatC operator/ const QuatC &    rQuat const
 

Divides the quaternion specified by argument from the quaternion and returns the result.

bool operator== const QuatC &    rQuat const [inline]
 

Returns true if both quaternions are equal, else false.

const float32 & operator[] int32    i const [inline]
 

Return 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, this version is for retrieving the values.

float32 & operator[] int32    i [inline]
 

Return 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, this version is to assign values.

QuatC slerp float32    f32T,
const QuatC &    rQ,
const QuatC &    rP
[static]
 

Spherical linear interpolation.

Parameters:
f32T  The time of interpolation. Range 0..1.
Reference  to the quaternion to interpolate from.
Reference  to the quaternion to interpolate to.
Uses spherical linear interpolation to find the quaternion value between the first and the second interpolation quaternions.

void to_axis_angle float32   f32X,
float32   f32Y,
float32   f32Z,
float32   f32Angle
const
 

Converts the quaternion to axis-angle presentation and stores the result to the arguments.

void to_axis_angle Vector3C   rVec,
float32   f32Angle
const
 

Converts the quaternion to axis-angle presentation and stores the result to the arguments.

Matrix3C to_rot_matrix   const
 

Converts the quaternion to matrix and returns the result.

QuatC unit_inverse   const [inline]
 

Inverses the quaternion and returns the result.

Use this method to inverse unit-length quaternions.


Friends And Related Function Documentation

QuatC operator * float32    f32Scalar,
const QuatC &    rQuat
[friend]
 

Multiplies the quaternion by a scalar value specified by the argument and returns the result.


Moppi Demopaja SDK Documentation -- Copyright © 2000-2002 Moppi Productions