The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatrix3x3, btVector3 and btTransform. More...
#include <btQuaternion.h>
Public Member Functions | |
btQuaternion () | |
No initialization constructor. | |
btQuaternion (const btScalar &_x, const btScalar &_y, const btScalar &_z, const btScalar &_w) | |
Constructor from scalars. | |
btQuaternion (const btVector3 &_axis, const btScalar &_angle) | |
Axis angle Constructor. | |
btQuaternion (const btScalar &yaw, const btScalar &pitch, const btScalar &roll) | |
Constructor from Euler angles. | |
void | setRotation (const btVector3 &axis, const btScalar &_angle) |
Set the rotation using axis angle notation. | |
void | setEuler (const btScalar &yaw, const btScalar &pitch, const btScalar &roll) |
Set the quaternion using Euler angles. | |
void | setEulerZYX (const btScalar &yaw, const btScalar &pitch, const btScalar &roll) |
Set the quaternion using euler angles. | |
btQuaternion & | operator+= (const btQuaternion &q) |
Add two quaternions. | |
btQuaternion & | operator-= (const btQuaternion &q) |
Subtract out a quaternion. | |
btQuaternion & | operator*= (const btScalar &s) |
Scale this quaternion. | |
btQuaternion & | operator*= (const btQuaternion &q) |
Multiply this quaternion by q on the right. | |
btScalar | dot (const btQuaternion &q) const |
Return the dot product between this quaternion and another. | |
btScalar | length2 () const |
Return the length squared of the quaternion. | |
btScalar | length () const |
Return the length of the quaternion. | |
btQuaternion & | normalize () |
Normalize the quaternion Such that x^2 + y^2 + z^2 +w^2 = 1. | |
btQuaternion | operator* (const btScalar &s) const |
Return a scaled version of this quaternion. | |
btQuaternion | operator/ (const btScalar &s) const |
Return an inversely scaled versionof this quaternion. | |
btQuaternion & | operator/= (const btScalar &s) |
Inversely scale this quaternion. | |
btQuaternion | normalized () const |
Return a normalized version of this quaternion. | |
btScalar | angle (const btQuaternion &q) const |
Return the angle between this quaternion and the other. | |
btScalar | getAngle () const |
Return the angle of rotation represented by this quaternion. | |
btVector3 | getAxis () const |
Return the axis of the rotation represented by this quaternion. | |
btQuaternion | inverse () const |
Return the inverse of this quaternion. | |
btQuaternion | operator+ (const btQuaternion &q2) const |
Return the sum of this quaternion and the other. | |
btQuaternion | operator- (const btQuaternion &q2) const |
Return the difference between this quaternion and the other. | |
btQuaternion | operator- () const |
Return the negative of this quaternion This simply negates each element. | |
btQuaternion | farthest (const btQuaternion &qd) const |
btQuaternion | nearest (const btQuaternion &qd) const |
btQuaternion | slerp (const btQuaternion &q, const btScalar &t) const |
Return the quaternion which is the result of Spherical Linear Interpolation between this and the other quaternion. | |
const btScalar & | getW () const |
Static Public Member Functions | |
static const btQuaternion & | getIdentity () |
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatrix3x3, btVector3 and btTransform.
Definition at line 42 of file btQuaternion.h.
btQuaternion::btQuaternion | ( | ) | [inline] |
No initialization constructor.
Definition at line 45 of file btQuaternion.h.
btQuaternion::btQuaternion | ( | const btScalar & | _x, | |
const btScalar & | _y, | |||
const btScalar & | _z, | |||
const btScalar & | _w | |||
) | [inline] |
Constructor from scalars.
Definition at line 74 of file btQuaternion.h.
Axis angle Constructor.
axis | The axis which the rotation is around | |
angle | The magnitude of the rotation around the angle (Radians) |
Definition at line 80 of file btQuaternion.h.
btQuaternion::btQuaternion | ( | const btScalar & | yaw, | |
const btScalar & | pitch, | |||
const btScalar & | roll | |||
) | [inline] |
Constructor from Euler angles.
yaw | Angle around Y unless BT_EULER_DEFAULT_ZYX defined then Z | |
pitch | Angle around X unless BT_EULER_DEFAULT_ZYX defined then Y | |
roll | Angle around Z unless BT_EULER_DEFAULT_ZYX defined then X |
Definition at line 88 of file btQuaternion.h.
btScalar btQuaternion::angle | ( | const btQuaternion & | q | ) | const [inline] |
Return the angle between this quaternion and the other.
q | The other quaternion |
Definition at line 389 of file btQuaternion.h.
btScalar btQuaternion::dot | ( | const btQuaternion & | q | ) | const [inline] |
Return the dot product between this quaternion and another.
q | The other quaternion |
Definition at line 286 of file btQuaternion.h.
btQuaternion btQuaternion::farthest | ( | const btQuaternion & | qd | ) | const [inline] |
Definition at line 469 of file btQuaternion.h.
btScalar btQuaternion::getAngle | ( | ) | const [inline] |
Return the angle of rotation represented by this quaternion.
Definition at line 396 of file btQuaternion.h.
btVector3 btQuaternion::getAxis | ( | ) | const [inline] |
Return the axis of the rotation represented by this quaternion.
Definition at line 403 of file btQuaternion.h.
static const btQuaternion& btQuaternion::getIdentity | ( | ) | [inline, static] |
Definition at line 523 of file btQuaternion.h.
const btScalar& btQuaternion::getW | ( | ) | const [inline] |
Definition at line 529 of file btQuaternion.h.
btQuaternion btQuaternion::inverse | ( | ) | const [inline] |
Return the inverse of this quaternion.
Definition at line 414 of file btQuaternion.h.
btScalar btQuaternion::length | ( | ) | const [inline] |
Return the length of the quaternion.
Definition at line 319 of file btQuaternion.h.
btScalar btQuaternion::length2 | ( | ) | const [inline] |
Return the length squared of the quaternion.
Definition at line 313 of file btQuaternion.h.
btQuaternion btQuaternion::nearest | ( | const btQuaternion & | qd | ) | const [inline] |
Definition at line 480 of file btQuaternion.h.
btQuaternion& btQuaternion::normalize | ( | ) | [inline] |
Normalize the quaternion Such that x^2 + y^2 + z^2 +w^2 = 1.
Definition at line 326 of file btQuaternion.h.
btQuaternion btQuaternion::normalized | ( | ) | const [inline] |
Return a normalized version of this quaternion.
Definition at line 383 of file btQuaternion.h.
btQuaternion btQuaternion::operator* | ( | const btScalar & | s | ) | const [inline] |
Return a scaled version of this quaternion.
s | The scale factor |
Definition at line 352 of file btQuaternion.h.
btQuaternion& btQuaternion::operator*= | ( | const btScalar & | s | ) | [inline] |
Scale this quaternion.
s | The scalar to scale by |
Definition at line 183 of file btQuaternion.h.
btQuaternion& btQuaternion::operator*= | ( | const btQuaternion & | q | ) | [inline] |
Multiply this quaternion by q on the right.
q | The other quaternion Equivilant to this = this * q |
Definition at line 203 of file btQuaternion.h.
btQuaternion btQuaternion::operator+ | ( | const btQuaternion & | q2 | ) | const [inline] |
Return the sum of this quaternion and the other.
q2 | The other quaternion |
Definition at line 428 of file btQuaternion.h.
btQuaternion& btQuaternion::operator+= | ( | const btQuaternion & | q | ) | [inline] |
Add two quaternions.
q | The quaternion to add to this one |
Definition at line 149 of file btQuaternion.h.
btQuaternion btQuaternion::operator- | ( | const btQuaternion & | q2 | ) | const [inline] |
Return the difference between this quaternion and the other.
q2 | The other quaternion |
Definition at line 443 of file btQuaternion.h.
btQuaternion btQuaternion::operator- | ( | ) | const [inline] |
Return the negative of this quaternion This simply negates each element.
Definition at line 457 of file btQuaternion.h.
btQuaternion& btQuaternion::operator-= | ( | const btQuaternion & | q | ) | [inline] |
Subtract out a quaternion.
q | The quaternion to subtract from this one |
Definition at line 166 of file btQuaternion.h.
btQuaternion btQuaternion::operator/ | ( | const btScalar & | s | ) | const [inline] |
Return an inversely scaled versionof this quaternion.
s | The inverse scale factor |
Definition at line 368 of file btQuaternion.h.
btQuaternion& btQuaternion::operator/= | ( | const btScalar & | s | ) | [inline] |
Inversely scale this quaternion.
s | The scale factor |
Definition at line 376 of file btQuaternion.h.
void btQuaternion::setEuler | ( | const btScalar & | yaw, | |
const btScalar & | pitch, | |||
const btScalar & | roll | |||
) | [inline] |
Set the quaternion using Euler angles.
yaw | Angle around Y | |
pitch | Angle around X | |
roll | Angle around Z |
Definition at line 111 of file btQuaternion.h.
void btQuaternion::setEulerZYX | ( | const btScalar & | yaw, | |
const btScalar & | pitch, | |||
const btScalar & | roll | |||
) | [inline] |
Set the quaternion using euler angles.
yaw | Angle around Z | |
pitch | Angle around Y | |
roll | Angle around X |
Definition at line 131 of file btQuaternion.h.
Set the rotation using axis angle notation.
axis | The axis around which to rotate | |
angle | The magnitude of the rotation in Radians |
Definition at line 99 of file btQuaternion.h.
btQuaternion btQuaternion::slerp | ( | const btQuaternion & | q, | |
const btScalar & | t | |||
) | const [inline] |
Return the quaternion which is the result of Spherical Linear Interpolation between this and the other quaternion.
q | The other quaternion to interpolate with | |
t | The ratio between this and q to interpolate. If t = 0 the result is this, if t=1 the result is q. Slerp interpolates assuming constant velocity. |
Definition at line 495 of file btQuaternion.h.