#include <quaternion.h>
Public Member Functions | |
Quaternion () | |
Quaternion (float x, float y, float z, float w) | |
void | getAxisRotation (float &radians, float &x, float &y, float &z) |
Quaternion | operator* (float s) const |
Quaternion & | operator*= (float s) |
Quaternion | operator+ (const Quaternion &q) const |
Quaternion & | operator+= (const Quaternion &q) |
Quaternion | operator* (const Quaternion &q) const |
Quaternion & | operator*= (const Quaternion &q) |
Quaternion | conjugate () const |
Vector3D | transform (const Vector3D &p) const |
Vector3D | inverseTransform (const Vector3D &p) const |
Static Public Member Functions | |
static Quaternion | create (float radians, float x, float y, float z) |
static Quaternion | slerp (const Quaternion &a, const Quaternion &b, float t) |
physics::Quaternion::Quaternion | ( | ) | [inline] |
Create a non-oriented quaternion
physics::Quaternion::Quaternion | ( | float | x, | |
float | y, | |||
float | z, | |||
float | w | |||
) | [inline] |
Create a quaternion from x/y/z/w components.
static Quaternion physics::Quaternion::create | ( | float | radians, | |
float | x, | |||
float | y, | |||
float | z | |||
) | [inline, static] |
Create a quaternion from a rotation about an axis. e.g. Quaternion::create(2.0, 1.0, 0.0, 0.0) = 2 radians around X. Note: x/y/z _must_ be normalised.
void physics::Quaternion::getAxisRotation | ( | float & | radians, | |
float & | x, | |||
float & | y, | |||
float & | z | |||
) |
Get this quaternion as a rotation about some axis.
Quaternion physics::Quaternion::operator* | ( | float | s | ) | const [inline] |
Scale the quaternion.
Quaternion& physics::Quaternion::operator*= | ( | float | s | ) | [inline] |
Scale the quaternion.
Quaternion physics::Quaternion::operator+ | ( | const Quaternion & | q | ) | const [inline] |
Add two quaternions together
Quaternion& physics::Quaternion::operator+= | ( | const Quaternion & | q | ) | [inline] |
Add two quaternions together
Quaternion physics::Quaternion::operator* | ( | const Quaternion & | q | ) | const [inline] |
Multiply two quaternions together. This combines the rotation as would combining two rotation matrices.
Quaternion& physics::Quaternion::operator*= | ( | const Quaternion & | q | ) |
Multiply two quaternions together. This combines the rotation as would combining two rotation matrices.
static Quaternion physics::Quaternion::slerp | ( | const Quaternion & | a, | |
const Quaternion & | b, | |||
float | t | |||
) | [inline, static] |
Interpolate between two quaternion rotations.
a | Start quaternion (t = 0). | |
b | End quaternion (t = 1). | |
t | Interpolation value between 0 and 1. |
Quaternion physics::Quaternion::conjugate | ( | ) | const [inline] |
Conjugate, a kind of inverse.
Transform a point by the rotation represented by this quaternion.
Transform a point by the inverse of the rotation represented by this quaternion.