Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Public Member Functions | Public Attributes | Static Public Attributes
core::quaternion Class Reference

Quaternion class. More...

#include <Quaternion.h>

List of all members.

Public Member Functions

f32 dotProduct (const quaternion &other) const
 Returns the dot product.
void fromAngleAxis (const f32 &angle, const vector3d &axis)
void fromDegreeAxis (const f32 &degree, const vector3d &axis)
void fromRotationMatrix (const matrix4 &m)
quaternion getInverse () const
 Get the Invert of this quaternion.
quaternion getUnitInverse () const
f32 getXDegrees () const
 Calculate the local X element of this quaternion.
f32 getYDegrees () const
 Calculate the local Y element of this quaternion.
f32 getZDegrees () const
 Calculate the local Z element of this quaternion.
void invert ()
 Inverts the quaternion.
quaternionnormalize ()
 Normalizes the quaternion.
bool operator!= (const quaternion &other) const
quaternion operator* (const quaternion &other) const
 multiplication operator
quaternion operator* (f32 s) const
 multiplication operator
vector3d operator* (const vector3d &v) const
 multiplication operator
quaternionoperator*= (const quaternion &other)
 multiplication operator
quaternionoperator*= (f32 s)
 multiplication operator
quaternion operator+ (const quaternion &other) const
 add operator
quaternion operator- () const
quaternion operator- (const quaternion &other) const
 subtract operator
quaternionoperator= (const matrix4 &other)
 matrix assignment operator
quaternionoperator= (const quaternion &other)
 assignment operator
bool operator== (const quaternion &other) const
 equal operator
 quaternion (f32 X, f32 Y, f32 Z, f32 W)
 quaternion (const matrix4 &mat)
 quaternion (const quaternion &other)
 quaternion (const vector3d &axis, const f32 &angle)
 quaternion ()
 quaternion (f32 x, f32 y, f32 z)
void set (f32 x, f32 y, f32 z, f32 w)
 Sets new quaternion.
void set (vector3d rot)
 Sets new quaternion based on Euler angles.
void set (f32 x, f32 y, f32 z)
 Sets new quaternion based on Euler angles.
void setDegrees (f32 x, f32 y, f32 z)
 Sets new quaternion based on Euler angles in degrees instead of radians.
void setDegrees (vector3d rot)
 Sets new quaternion based on Euler angles in degrees instead of radians.
void setDegrees (const vector3d &axis, const f32 &angle)
 Sets new quaternion based on axis and angle where the angle is in degrees instead of radians.
vector3d toEulerAngles () const
 convert the quaternion to Euler angles
vector3d toEulerDegrees () const
 convert the quaternion to Euler degrees
matrix4 toRotationMatrix () const
void unitInvert ()

Public Attributes

f32 W
f32 X
f32 Y
f32 Z

Static Public Attributes

static const quaternion IDENTITY = quaternion(0.0f, 0.0f, 0.0f, 1.0f)
static const quaternion ZERO = quaternion(0.0f, 0.0f, 0.0f, 0.0f)

Detailed Description

Quaternion class.


Constructor & Destructor Documentation

core::quaternion::quaternion ( )
core::quaternion::quaternion ( const matrix4 mat)
core::quaternion::quaternion ( f32  x,
f32  y,
f32  z 
)
core::quaternion::quaternion ( f32  X,
f32  Y,
f32  Z,
f32  W 
)
core::quaternion::quaternion ( const quaternion other)
core::quaternion::quaternion ( const vector3d axis,
const f32 angle 
)

References fromAngleAxis().


Member Function Documentation

f32 core::quaternion::dotProduct ( const quaternion other) const

Returns the dot product.

References W, X, Y, and Z.

void core::quaternion::fromAngleAxis ( const f32 angle,
const vector3d axis 
)
void core::quaternion::fromDegreeAxis ( const f32 degree,
const vector3d axis 
)
void core::quaternion::fromRotationMatrix ( const matrix4 m)

References core::sqrt(), W, X, Y, and Z.

Referenced by render::Camera::setDirection().

quaternion core::quaternion::getInverse ( ) const

Get the Invert of this quaternion.

References quaternion(), W, X, Y, and Z.

Referenced by scene::Node::rotate(), render::Camera::rotate(), and scene::Node::translate().

quaternion core::quaternion::getUnitInverse ( ) const

References quaternion(), X, Y, and Z.

f32 core::quaternion::getXDegrees ( void  ) const

Calculate the local X element of this quaternion.

References core::atan2(), core::RADTODEG, W, X, Y, and Z.

f32 core::quaternion::getYDegrees ( void  ) const

Calculate the local Y element of this quaternion.

References core::atan2(), core::RADTODEG, W, X, Y, and Z.

f32 core::quaternion::getZDegrees ( void  ) const

Calculate the local Z element of this quaternion.

References core::asin(), core::HALF_PI, core::RADTODEG, W, X, Y, and Z.

void core::quaternion::invert ( )

Inverts the quaternion.

References W, X, Y, and Z.

quaternion & core::quaternion::normalize ( )

Normalizes the quaternion.

References core::sqrt(), W, X, Y, and Z.

Referenced by operator=(), and set().

bool core::quaternion::operator!= ( const quaternion other) const

References core::EPSILON, W, X, Y, and Z.

vector3d core::quaternion::operator* ( const vector3d v) const

multiplication operator

References core::vector3d::crossProduct(), W, X, Y, and Z.

quaternion core::quaternion::operator* ( const quaternion other) const

multiplication operator

References W, X, Y, and Z.

quaternion core::quaternion::operator* ( f32  s) const

multiplication operator

References quaternion(), W, X, Y, and Z.

quaternion & core::quaternion::operator*= ( f32  s)

multiplication operator

References W, X, Y, and Z.

quaternion & core::quaternion::operator*= ( const quaternion other)

multiplication operator

quaternion core::quaternion::operator+ ( const quaternion other) const

add operator

References quaternion(), W, X, Y, and Z.

quaternion core::quaternion::operator- ( ) const

References quaternion(), W, X, Y, and Z.

quaternion core::quaternion::operator- ( const quaternion other) const

subtract operator

References quaternion(), W, X, Y, and Z.

quaternion & core::quaternion::operator= ( const matrix4 other)

matrix assignment operator

References normalize(), core::sqrt(), W, X, Y, and Z.

quaternion & core::quaternion::operator= ( const quaternion other)

assignment operator

References W, X, Y, and Z.

bool core::quaternion::operator== ( const quaternion other) const

equal operator

References core::EPSILON, W, X, Y, and Z.

void core::quaternion::set ( vector3d  rot)

Sets new quaternion based on Euler angles.

References core::vector3d::X, core::vector3d::Y, and core::vector3d::Z.

void core::quaternion::set ( f32  x,
f32  y,
f32  z,
f32  w 
)

Sets new quaternion.

References W, X, Y, and Z.

void core::quaternion::set ( f32  x,
f32  y,
f32  z 
)

Sets new quaternion based on Euler angles.

References core::cos(), normalize(), core::sin(), W, X, Y, and Z.

void core::quaternion::setDegrees ( f32  x,
f32  y,
f32  z 
)

Sets new quaternion based on Euler angles in degrees instead of radians.

References core::DEGTORAD.

void core::quaternion::setDegrees ( const vector3d axis,
const f32 angle 
)

Sets new quaternion based on axis and angle where the angle is in degrees instead of radians.

References core::DEGTORAD, and fromAngleAxis().

void core::quaternion::setDegrees ( vector3d  rot)

Sets new quaternion based on Euler angles in degrees instead of radians.

References core::DEGTORAD, core::vector3d::X, core::vector3d::Y, and core::vector3d::Z.

vector3d core::quaternion::toEulerAngles ( ) const

convert the quaternion to Euler angles

References core::asin(), core::atan2(), core::HALF_PI, W, core::vector3d::X, X, core::vector3d::Y, Y, core::vector3d::Z, and Z.

Referenced by toEulerDegrees().

vector3d core::quaternion::toEulerDegrees ( ) const

convert the quaternion to Euler degrees

References core::RADTODEG, toEulerAngles(), core::vector3d::X, core::vector3d::Y, and core::vector3d::Z.

matrix4 core::quaternion::toRotationMatrix ( ) const
void core::quaternion::unitInvert ( )

References X, Y, and Z.


Member Data Documentation

const quaternion core::quaternion::IDENTITY = quaternion(0.0f, 0.0f, 0.0f, 1.0f) [static]
const quaternion core::quaternion::ZERO = quaternion(0.0f, 0.0f, 0.0f, 0.0f) [static]

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

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:07 by Doxygen (1.7.4)