Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members |
Quaternion class. More...
#include <Quaternion.h>
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 °ree, 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. | |
quaternion & | normalize () |
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 | |
quaternion & | operator*= (const quaternion &other) |
multiplication operator | |
quaternion & | operator*= (f32 s) |
multiplication operator | |
quaternion | operator+ (const quaternion &other) const |
add operator | |
quaternion | operator- () const |
quaternion | operator- (const quaternion &other) const |
subtract operator | |
quaternion & | operator= (const matrix4 &other) |
matrix assignment operator | |
quaternion & | operator= (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) |
Quaternion class.
core::quaternion::quaternion | ( | ) |
Referenced by getInverse(), getUnitInverse(), operator*(), operator+(), and operator-().
core::quaternion::quaternion | ( | const matrix4 & | mat | ) |
core::quaternion::quaternion | ( | const quaternion & | other | ) |
References fromAngleAxis().
f32 core::quaternion::dotProduct | ( | const quaternion & | other | ) | const |
References core::cos(), core::sin(), W, core::vector3d::X, X, core::vector3d::Y, Y, core::vector3d::Z, and Z.
Referenced by quaternion(), setDegrees(), and render::Camera::setDirection().
References core::cos(), core::DEGTORAD, core::sin(), W, core::vector3d::X, X, core::vector3d::Y, Y, core::vector3d::Z, and Z.
Referenced by scene::Node::rotate(), and render::Camera::rotate().
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.
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.
multiplication operator
References core::vector3d::crossProduct(), W, X, Y, and Z.
quaternion core::quaternion::operator* | ( | const quaternion & | other | ) | const |
quaternion core::quaternion::operator* | ( | f32 | s | ) | const |
multiplication operator
References quaternion(), W, X, Y, and Z.
quaternion & core::quaternion::operator*= | ( | f32 | s | ) |
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 | ) |
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.
Sets new quaternion based on Euler angles.
References core::cos(), normalize(), core::sin(), W, X, Y, and Z.
Sets new quaternion based on Euler angles in degrees instead of radians.
References core::DEGTORAD.
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 |
const quaternion core::quaternion::IDENTITY = quaternion(0.0f, 0.0f, 0.0f, 1.0f) [static] |
Referenced by scene::Node::initProperties(), render::Camera::setDirection(), and physics::Shape::Shape().
Referenced by dotProduct(), fromAngleAxis(), fromDegreeAxis(), fromRotationMatrix(), getInverse(), getXDegrees(), getYDegrees(), getZDegrees(), invert(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator-(), operator=(), operator==(), resource::Serializer::readObject(), set(), render::Camera::setDirection(), toEulerAngles(), toRotationMatrix(), and resource::Serializer::writeObject().
Referenced by dotProduct(), fromAngleAxis(), fromDegreeAxis(), fromRotationMatrix(), getInverse(), getUnitInverse(), getXDegrees(), getYDegrees(), getZDegrees(), invert(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator-(), operator=(), operator==(), resource::Serializer::readObject(), set(), render::Camera::setDirection(), toEulerAngles(), toRotationMatrix(), unitInvert(), and resource::Serializer::writeObject().
Referenced by dotProduct(), fromAngleAxis(), fromDegreeAxis(), fromRotationMatrix(), getInverse(), getUnitInverse(), getXDegrees(), getYDegrees(), getZDegrees(), invert(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator-(), operator=(), operator==(), resource::Serializer::readObject(), set(), render::Camera::setDirection(), toEulerAngles(), toRotationMatrix(), unitInvert(), and resource::Serializer::writeObject().
Referenced by dotProduct(), fromAngleAxis(), fromDegreeAxis(), fromRotationMatrix(), getInverse(), getUnitInverse(), getXDegrees(), getYDegrees(), getZDegrees(), invert(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator-(), operator=(), operator==(), resource::Serializer::readObject(), set(), render::Camera::setDirection(), toEulerAngles(), toRotationMatrix(), unitInvert(), and resource::Serializer::writeObject().
const quaternion core::quaternion::ZERO = quaternion(0.0f, 0.0f, 0.0f, 0.0f) [static] |
The KG Game Engine
Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:07 by
Doxygen
(1.7.4)
|