Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# Keos::CQuaternion Class Reference

Quaternions class. More...

`#include <KeosQuaternion.h>`

List of all members.

## Public Member Functions

| CQuaternion (float X=0.0f, float Y=0.0f, float Z=0.0f, float W=1.0f)
| Default constructor.
| CQuaternion (const CMatrix4 &Matrix)
| Constructor from one matrix.
| CQuaternion (const TVector3F &Axis, float Angle)
| Constructor from one axis and one angle.
void | Identity ()
| Identity quaternion.
void | Normalize ()
| Normalize the quaternion.
CQuaternion | Conjugate () const
| Return the conjugate.
CMatrix4 | ToMatrix () const
| Build a rotation matrix from quaternion.
void | FromMatrix (const CMatrix4 &Matrix)
| Build quaternion from one matrice.
void | FromAxisAngle (const TVector3F &Axis, float Angle)
| Build quaternion from one axis and one angle.
void | ToAxisAngle (TVector3F &Axis, float &Angle) const
| Transform quaternion into an axis and a rotation angle.
void | FromEulerAngles (float X, float Y, float Z)
| Build quaternion from three Euler angles.
CQuaternion | operator * (const CQuaternion &Quaternion) const
const CQuaternion & | operator *= (const CQuaternion &Quaternion)

## Public Attributes

float | x
float | y
float | z
float | w

## Detailed Description

Quaternions class.

Definition at line 34 of file KeosQuaternion.h.

## Constructor & Destructor Documentation

Keos::CQuaternion::CQuaternion | ( | float | X = `0.0f`,
|  | float | Y = `0.0f`,
|  | float | Z = `0.0f`,
|  | float | W = `1.0f`
| ) | `[inline]`

| Default constructor. Definition at line 114 of file KeosQuaternion.h. Referenced by Conjugate(), and operator *().

Keos::CQuaternion::CQuaternion | ( | const CMatrix4 & | Matrix | ) | `[inline]`

| Constructor from one matrix.

Parameters:

  | Matrix | Source matrix.

Definition at line 124 of file KeosQuaternion.h.

References FromMatrix().

Keos::CQuaternion::CQuaternion | ( | const TVector3F & | Axis,
|  | float | Angle
| ) | `[inline]`

| Constructor from one axis and one angle.

Parameters:

  | Axis | Rotation axis.
  | Angle | Rotation angle.

Definition at line 130 of file KeosQuaternion.h.

References FromAxisAngle().

## Member Function Documentation

CQuaternion Keos::CQuaternion::Conjugate | ( |  | ) | const`[inline]`

| Return the conjugate.

Returns:
  Quaternion conjugate.

Definition at line 157 of file KeosQuaternion.h.

References CQuaternion(), w, x, y, and z.

void Keos::CQuaternion::FromAxisAngle | ( | const TVector3F & | Axis,
|  | float | Angle
| ) | `[inline]`

| Build quaternion from one axis and one angle.

Parameters:

  | Axis | Rotation axis.
  | Angle | Rotation angle.

Definition at line 224 of file KeosQuaternion.h.

References Normalize().

Referenced by CQuaternion().

void Keos::CQuaternion::FromEulerAngles | ( | float | X,
|  | float | Y,
|  | float | Z
| ) | `[inline]`

| Build quaternion from three Euler angles.

Parameters:

  | X | X-axis rotation.
  | Y | Y-axis rotation.
  | Z | Z-axis rotation.

Definition at line 260 of file KeosQuaternion.h.

void Keos::CQuaternion::FromMatrix | ( | const CMatrix4 & | Matrix | ) | `[inline]`

| Build quaternion from one matrice.

Parameters:

  | Matrix | Source matrix.

Definition at line 182 of file KeosQuaternion.h.

References w, x, y, and z.

Referenced by CQuaternion().

void Keos::CQuaternion::Identity | ( |  | ) | `[inline]`

| Identity quaternion. Definition at line 136 of file KeosQuaternion.h. References w, x, y, and z.

void Keos::CQuaternion::Normalize | ( |  | ) | `[inline]`

| Normalize the quaternion. Definition at line 143 of file KeosQuaternion.h. References w, x, y, and z. Referenced by FromAxisAngle().

CQuaternion Keos::CQuaternion::operator * | ( | const CQuaternion & | Quaternion | ) | const`[inline]`

| Definition at line 270 of file KeosQuaternion.h. References CQuaternion(), x, y, and z.

const CQuaternion & Keos::CQuaternion::operator *= | ( | const CQuaternion & | Quaternion | ) | `[inline]`

| Definition at line 279 of file KeosQuaternion.h.

void Keos::CQuaternion::ToAxisAngle | ( | TVector3F & | Axis,
|  | float & | Angle
| ) | const`[inline]`

| Transform quaternion into an axis and a rotation angle.

Parameters:

  | Axis | Rotation axis.
  | Angle | Rotation angle.

Definition at line 238 of file KeosQuaternion.h.

CMatrix4 Keos::CQuaternion::ToMatrix | ( |  | ) | const`[inline]`

| Build a rotation matrix from quaternion.

Returns:
  Built matrix.

Definition at line 163 of file KeosQuaternion.h.

References w, x, y, and z.

## Member Data Documentation

float Keos::CQuaternion::w

| Definition at line 102 of file KeosQuaternion.h. Referenced by Conjugate(), FromMatrix(), Identity(), Normalize(), and ToMatrix().

float Keos::CQuaternion::x

| Definition at line 99 of file KeosQuaternion.h. Referenced by Conjugate(), FromMatrix(), Identity(), Normalize(), operator *(), and ToMatrix().

float Keos::CQuaternion::y

| Definition at line 100 of file KeosQuaternion.h. Referenced by Conjugate(), FromMatrix(), Identity(), Normalize(), operator *(), and ToMatrix().

float Keos::CQuaternion::z

| Definition at line 101 of file KeosQuaternion.h. Referenced by Conjugate(), FromMatrix(), Identity(), Normalize(), operator *(), and ToMatrix().

The documentation for this class was generated from the following file:

- KeosEngine/KeosQuaternion.h