Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XFcQuaternion Class Reference

Quaternion class. More...

Collaboration diagram for XFcQuaternion:

[legend]
List of all members.

## Public Member Functions
| XFcQuaternion ()
| Empty constructor.
| XFcQuaternion (const XFcQuaternion &aQuat)
| Copy constructor.
| XFcQuaternion (const XFcVector3 &aVec)
| Construction from a vector.
| XFcQuaternion (const REAL aX, const REAL aY, const REAL aZ, const REAL aW)
| Construction from 4 values.
XFcQuaternion & | operator+= (const XFcQuaternion &aQuat)
| Adds components of another quaternion to this quaternion.
XFcQuaternion | operator+ (const XFcQuaternion &aQuat) const
| Creates a new quaternion which contains the result of this + another quaternion.
XFcQuaternion & | operator-= (const XFcQuaternion &aQuat)
| Substracts components of another quaternion from this quaternion.
XFcQuaternion | operator- (const XFcQuaternion &aQuat) const
| Creates a new quaternion which contains the result of this - another quaternion.
XFcQuaternion | operator *= (const INT32 aArg)
| Multiplies this quaternion by an INT32.
XFcQuaternion | operator *= (const FLOAT32 aArg)
| Multiplies this quaternion by a FLOAT32.
XFcQuaternion | operator * (const INT32 aArg) const
| Creates a new quaternion which contains the result of this * INT32.
XFcQuaternion | operator * (const FLOAT32 aArg) const
| Creates a new quaternion which contains the result of this * FLOAT32.
XFcQuaternion | operator/= (const INT32 aArg)
| Divides this quaternion by an INT32.
XFcQuaternion | operator/= (const FLOAT32 aArg)
| Divides this quaternion by an FLOAT32.
XFcQuaternion | operator/ (const INT32 aArg) const
| Creates a new quaternion which contains the result of this / INT32.
XFcQuaternion | operator/ (const FLOAT32 aArg) const
| Creates a new quaternion which contains the result of this / FLOAT32.
XFcQuaternion | operator *= (const REAL &aArg)
XFcQuaternion | operator * (const REAL &aArg) const
XFcQuaternion | operator/= (const REAL &aArg)
XFcQuaternion | operator/ (const REAL &aArg) const
XFcQuaternion | operator * (const XFcQuaternion &aQuat) const
| Multiplication with another quaternion.
XFcQuaternion & | operator *= (const XFcQuaternion &aQuat)
| Multiplication with another quaternion.
XFcQuaternion | operator/ (const XFcQuaternion &aQuat) const
| Division with another quaternion.
XFcQuaternion & | operator/= (const XFcQuaternion &aQuat)
| Division with another quaternion.
REAL | normal ()
| Calculates the normal of the quaterion (x^2+y^2+z^2+w^2).
REAL | length ()
| Calculates the length of the quaternion.
void | normalize ()
| Normalizes a quaternion to unit length.
void | conjugate ()
| Conjugates the quaternion (negates x,y,z).
void | inverse ()
| Inverses the quaternion (q^-1 = q^* / N(q)).
## Public Attributes
REAL | x
| X-component of the rotation.
REAL | y
| Y-component of the rotation.
REAL | z
| Z-component of the rotation.
REAL | w
| W-component of the rotation.
## Friends
XFcQuaternion | operator * (const INT32 aArg, const XFcQuaternion &aQuat)
| Creates a new quaternion which contains the result of INT32 * this.
XFcQuaternion | operator * (const FLOAT32 aArg, const XFcQuaternion &aQuat)
| Creates a new quaternion which contains the result of FLOAT32 * this.
XFcQuaternion | operator/ (const INT32 aArg, const XFcQuaternion &aQuat)
| Creates a new quaternion which contains the result of INT32 / this.
XFcQuaternion | operator/ (const FLOAT32 aArg, const XFcQuaternion &aQuat)
| Creates a new quaternion which contains the result of FLOAT32 / this.
XFcQuaternion | operator * (const REAL &aArg, const XFcQuaternion &aQuat)
XFcQuaternion | operator/ (const REAL &aArg, const XFcQuaternion &aQuat)

## Detailed Description

Quaternion class.

Provides tools to store and manipulate rotation stored into a quaternion.

See also:
  XFcMath

## Constructor & Destructor Documentation

XFcQuaternion::XFcQuaternion | ( |  | ) | `[inline]`

| Empty constructor.

XFcQuaternion::XFcQuaternion | ( | const XFcQuaternion & | aQuat | ) | `[inline]`

| Copy constructor.

XFcQuaternion::XFcQuaternion | ( | const XFcVector3 & | aVec | ) | `[inline]`

| Construction from a vector.

XFcQuaternion::XFcQuaternion | ( | const REAL | aX,
|  | const REAL | aY,
|  | const REAL | aZ,
|  | const REAL | aW
| ) | `[inline]`

| Construction from 4 values.

## Member Function Documentation

void XFcQuaternion::conjugate | ( |  | ) | `[inline]`

| Conjugates the quaternion (negates x,y,z). Conjugate of a quaternion is defined in the same way as with complex numbers.

void XFcQuaternion::inverse | ( |  | ) | `[inline]`

| Inverses the quaternion (q^-1 = q^* / N(q)).

REAL XFcQuaternion::length | ( |  | ) | `[inline]`

| Calculates the length of the quaternion.

REAL XFcQuaternion::normal | ( |  | ) | `[inline]`

| Calculates the normal of the quaterion (x^2+y^2+z^2+w^2).

void XFcQuaternion::normalize | ( |  | ) | `[inline]`

| Normalizes a quaternion to unit length. Note: Matrix conversion requires unit quaternions.

XFcQuaternion XFcQuaternion::operator * | ( | const XFcQuaternion & | aQuat | ) | const`[inline]`

| Multiplication with another quaternion.

XFcQuaternion XFcQuaternion::operator * | ( | const REAL & | aArg | ) | const`[inline]`

XFcQuaternion XFcQuaternion::operator * | ( | const FLOAT32 | aArg | ) | const`[inline]`

| Creates a new quaternion which contains the result of this * FLOAT32.

XFcQuaternion XFcQuaternion::operator * | ( | const INT32 | aArg | ) | const`[inline]`

| Creates a new quaternion which contains the result of this * INT32.

XFcQuaternion & XFcQuaternion::operator *= | ( | const XFcQuaternion & | aQuat | ) | `[inline]`

| Multiplication with another quaternion.

XFcQuaternion XFcQuaternion::operator *= | ( | const REAL & | aArg | ) | `[inline]`

XFcQuaternion XFcQuaternion::operator *= | ( | const FLOAT32 | aArg | ) | `[inline]`

| Multiplies this quaternion by a FLOAT32.

XFcQuaternion XFcQuaternion::operator *= | ( | const INT32 | aArg | ) | `[inline]`

| Multiplies this quaternion by an INT32.

XFcQuaternion XFcQuaternion::operator+ | ( | const XFcQuaternion & | aQuat | ) | const`[inline]`

  | Creates a new quaternion which contains the result of this + another quaternion. Parameters:
  aQuat | quaternion to be added to this quaternion.
Returns: A new quaternion containing the result.

XFcQuaternion & XFcQuaternion::operator+= | ( | const XFcQuaternion & | aQuat | ) | `[inline]`

  | Adds components of another quaternion to this quaternion. Parameters:
  aQuat | quaternion to be added to this quaternion.
Returns: reference to this quaternion.

XFcQuaternion XFcQuaternion::operator- | ( | const XFcQuaternion & | aQuat | ) | const`[inline]`

  | Creates a new quaternion which contains the result of this - another quaternion. Parameters:
  aQuat | quaternion to be substracted from this quaternion.
Returns: A new quaternion containing the result.

XFcQuaternion & XFcQuaternion::operator-= | ( | const XFcQuaternion & | aQuat | ) | `[inline]`

  | Substracts components of another quaternion from this quaternion. Parameters:
  aQuat | quaternion to be substracted from this quaternion.
Returns: reference to this quaternion.

XFcQuaternion XFcQuaternion::operator/ | ( | const XFcQuaternion & | aQuat | ) | const`[inline]`

| Division with another quaternion.

XFcQuaternion XFcQuaternion::operator/ | ( | const REAL & | aArg | ) | const`[inline]`

XFcQuaternion XFcQuaternion::operator/ | ( | const FLOAT32 | aArg | ) | const`[inline]`

| Creates a new quaternion which contains the result of this / FLOAT32.

XFcQuaternion XFcQuaternion::operator/ | ( | const INT32 | aArg | ) | const`[inline]`

| Creates a new quaternion which contains the result of this / INT32.

XFcQuaternion & XFcQuaternion::operator/= | ( | const XFcQuaternion & | aQuat | ) | `[inline]`

| Division with another quaternion.

XFcQuaternion XFcQuaternion::operator/= | ( | const REAL & | aArg | ) | `[inline]`

XFcQuaternion XFcQuaternion::operator/= | ( | const FLOAT32 | aArg | ) | `[inline]`

| Divides this quaternion by an FLOAT32.

XFcQuaternion XFcQuaternion::operator/= | ( | const INT32 | aArg | ) | `[inline]`

| Divides this quaternion by an INT32.

## Friends And Related Function Documentation

XFcQuaternion operator * | ( | const REAL & | aArg,
|  | const XFcQuaternion & | aQuat
| ) | `[friend]`

XFcQuaternion operator * | ( | const FLOAT32 | aArg,
|  | const XFcQuaternion & | aQuat
| ) | `[friend]`

| Creates a new quaternion which contains the result of FLOAT32 * this.

XFcQuaternion operator * | ( | const INT32 | aArg,
|  | const XFcQuaternion & | aQuat
| ) | `[friend]`

| Creates a new quaternion which contains the result of INT32 * this.

XFcQuaternion operator/ | ( | const REAL & | aArg,
|  | const XFcQuaternion & | aQuat
| ) | `[friend]`

XFcQuaternion operator/ | ( | const FLOAT32 | aArg,
|  | const XFcQuaternion & | aQuat
| ) | `[friend]`

| Creates a new quaternion which contains the result of FLOAT32 / this.

XFcQuaternion operator/ | ( | const INT32 | aArg,
|  | const XFcQuaternion & | aQuat
| ) | `[friend]`

| Creates a new quaternion which contains the result of INT32 / this.

## Member Data Documentation

REAL XFcQuaternion::w

| W-component of the rotation.

REAL XFcQuaternion::x

| X-component of the rotation.

REAL XFcQuaternion::y

| Y-component of the rotation.

REAL XFcQuaternion::z

| Z-component of the rotation.

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch