Bullet Collision Detection & Physics Library
Public Member Functions | Static Public Member Functions | List of all members
btQuaternion Class Reference

The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatrix3x3, btVector3 and btTransform. More...

#include <btQuaternion.h>

Inheritance diagram for btQuaternion:
Inheritance graph
[legend]
Collaboration diagram for btQuaternion:
Collaboration graph
[legend]

Public Member Functions

 btQuaternion ()
 No initialization constructor. More...
 
 btQuaternion (const btScalar &_x, const btScalar &_y, const btScalar &_z, const btScalar &_w)
 Constructor from scalars. More...
 
 btQuaternion (const btVector3 &_axis, const btScalar &_angle)
 Axis angle Constructor. More...
 
 btQuaternion (const btScalar &yaw, const btScalar &pitch, const btScalar &roll)
 Constructor from Euler angles. More...
 
void setRotation (const btVector3 &axis, const btScalar &_angle)
 Set the rotation using axis angle notation. More...
 
void setEuler (const btScalar &yaw, const btScalar &pitch, const btScalar &roll)
 Set the quaternion using Euler angles. More...
 
void setEulerZYX (const btScalar &yaw, const btScalar &pitch, const btScalar &roll)
 Set the quaternion using euler angles. More...
 
btQuaternionoperator+= (const btQuaternion &q)
 Add two quaternions. More...
 
btQuaternionoperator-= (const btQuaternion &q)
 Subtract out a quaternion. More...
 
btQuaternionoperator*= (const btScalar &s)
 Scale this quaternion. More...
 
btQuaternionoperator*= (const btQuaternion &q)
 Multiply this quaternion by q on the right. More...
 
btScalar dot (const btQuaternion &q) const
 Return the dot product between this quaternion and another. More...
 
btScalar length2 () const
 Return the length squared of the quaternion. More...
 
btScalar length () const
 Return the length of the quaternion. More...
 
btQuaternionnormalize ()
 Normalize the quaternion Such that x^2 + y^2 + z^2 +w^2 = 1. More...
 
btQuaternion operator* (const btScalar &s) const
 Return a scaled version of this quaternion. More...
 
btQuaternion operator/ (const btScalar &s) const
 Return an inversely scaled versionof this quaternion. More...
 
btQuaternionoperator/= (const btScalar &s)
 Inversely scale this quaternion. More...
 
btQuaternion normalized () const
 Return a normalized version of this quaternion. More...
 
btScalar angle (const btQuaternion &q) const
 Return the ***half*** angle between this quaternion and the other. More...
 
btScalar angleShortestPath (const btQuaternion &q) const
 Return the angle between this quaternion and the other along the shortest path. More...
 
btScalar getAngle () const
 Return the angle of rotation represented by this quaternion. More...
 
btScalar getAngleShortestPath () const
 Return the angle of rotation represented by this quaternion along the shortest path. More...
 
btVector3 getAxis () const
 Return the axis of the rotation represented by this quaternion. More...
 
btQuaternion inverse () const
 Return the inverse of this quaternion. More...
 
btQuaternion operator+ (const btQuaternion &q2) const
 Return the sum of this quaternion and the other. More...
 
btQuaternion operator- (const btQuaternion &q2) const
 Return the difference between this quaternion and the other. More...
 
btQuaternion operator- () const
 Return the negative of this quaternion This simply negates each element. More...
 
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. More...
 
const btScalargetW () const
 
void serialize (struct btQuaternionData &dataOut) const
 
void deSerialize (const struct btQuaternionData &dataIn)
 
void serializeFloat (struct btQuaternionFloatData &dataOut) const
 
void deSerializeFloat (const struct btQuaternionFloatData &dataIn)
 
void serializeDouble (struct btQuaternionDoubleData &dataOut) const
 
void deSerializeDouble (const struct btQuaternionDoubleData &dataIn)
 
- Public Member Functions inherited from btQuadWord
const btScalargetX () const
 Return the x value. More...
 
const btScalargetY () const
 Return the y value. More...
 
const btScalargetZ () const
 Return the z value. More...
 
void setX (btScalar _x)
 Set the x value. More...
 
void setY (btScalar _y)
 Set the y value. More...
 
void setZ (btScalar _z)
 Set the z value. More...
 
void setW (btScalar _w)
 Set the w value. More...
 
const btScalarx () const
 Return the x value. More...
 
const btScalary () const
 Return the y value. More...
 
const btScalarz () const
 Return the z value. More...
 
const btScalarw () const
 Return the w value. More...
 
 operator btScalar * ()
 operator btScalar*() replaces operator[], using implicit conversion. We added operator != and operator == to avoid pointer comparisons. More...
 
 operator const btScalar * () const
 
bool operator== (const btQuadWord &other) const
 
bool operator!= (const btQuadWord &other) const
 
void setValue (const btScalar &_x, const btScalar &_y, const btScalar &_z)
 Set x,y,z and zero w. More...
 
void setValue (const btScalar &_x, const btScalar &_y, const btScalar &_z, const btScalar &_w)
 Set the values. More...
 
 btQuadWord ()
 No initialization constructor. More...
 
 btQuadWord (const btScalar &_x, const btScalar &_y, const btScalar &_z)
 Three argument constructor (zeros w) More...
 
 btQuadWord (const btScalar &_x, const btScalar &_y, const btScalar &_z, const btScalar &_w)
 Initializing constructor. More...
 
void setMax (const btQuadWord &other)
 Set each element to the max of the current values and the values of another btQuadWord. More...
 
void setMin (const btQuadWord &other)
 Set each element to the min of the current values and the values of another btQuadWord. More...
 

Static Public Member Functions

static const btQuaterniongetIdentity ()
 

Additional Inherited Members

- Protected Attributes inherited from btQuadWord
btScalar m_floats [4]
 

Detailed Description

The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatrix3x3, btVector3 and btTransform.

Definition at line 55 of file btQuaternion.h.

Constructor & Destructor Documentation

btQuaternion::btQuaternion ( )
inline

No initialization constructor.

Definition at line 58 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 87 of file btQuaternion.h.

btQuaternion::btQuaternion ( const btVector3 _axis,
const btScalar _angle 
)
inline

Axis angle Constructor.

Parameters
axisThe axis which the rotation is around
angleThe magnitude of the rotation around the angle (Radians)

Definition at line 93 of file btQuaternion.h.

btQuaternion::btQuaternion ( const btScalar yaw,
const btScalar pitch,
const btScalar roll 
)
inline

Constructor from Euler angles.

Parameters
yawAngle around Y unless BT_EULER_DEFAULT_ZYX defined then Z
pitchAngle around X unless BT_EULER_DEFAULT_ZYX defined then Y
rollAngle around Z unless BT_EULER_DEFAULT_ZYX defined then X

Definition at line 101 of file btQuaternion.h.

Member Function Documentation

btScalar btQuaternion::angle ( const btQuaternion q) const
inline

Return the ***half*** angle between this quaternion and the other.

Parameters
qThe other quaternion

Definition at line 402 of file btQuaternion.h.

btScalar btQuaternion::angleShortestPath ( const btQuaternion q) const
inline

Return the angle between this quaternion and the other along the shortest path.

Parameters
qThe other quaternion

Definition at line 411 of file btQuaternion.h.

void btQuaternion::deSerialize ( const struct btQuaternionData dataIn)
inline

Definition at line 973 of file btQuaternion.h.

void btQuaternion::deSerializeDouble ( const struct btQuaternionDoubleData dataIn)
inline

Definition at line 959 of file btQuaternion.h.

void btQuaternion::deSerializeFloat ( const struct btQuaternionFloatData dataIn)
inline

Definition at line 945 of file btQuaternion.h.

btScalar btQuaternion::dot ( const btQuaternion q) const
inline

Return the dot product between this quaternion and another.

Parameters
qThe other quaternion

Definition at line 299 of file btQuaternion.h.

btQuaternion btQuaternion::farthest ( const btQuaternion qd) const
inline

Definition at line 508 of file btQuaternion.h.

btScalar btQuaternion::getAngle ( ) const
inline

Return the angle of rotation represented by this quaternion.

Definition at line 422 of file btQuaternion.h.

btScalar btQuaternion::getAngleShortestPath ( ) const
inline

Return the angle of rotation represented by this quaternion along the shortest path.

Definition at line 429 of file btQuaternion.h.

btVector3 btQuaternion::getAxis ( ) const
inline

Return the axis of the rotation represented by this quaternion.

Definition at line 442 of file btQuaternion.h.

static const btQuaternion& btQuaternion::getIdentity ( )
inlinestatic

Definition at line 562 of file btQuaternion.h.

const btScalar& btQuaternion::getW ( ) const
inline

Definition at line 568 of file btQuaternion.h.

btQuaternion btQuaternion::inverse ( ) const
inline

Return the inverse of this quaternion.

Definition at line 453 of file btQuaternion.h.

btScalar btQuaternion::length ( ) const
inline

Return the length of the quaternion.

Definition at line 332 of file btQuaternion.h.

btScalar btQuaternion::length2 ( ) const
inline

Return the length squared of the quaternion.

Definition at line 326 of file btQuaternion.h.

btQuaternion btQuaternion::nearest ( const btQuaternion qd) const
inline

Definition at line 519 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 339 of file btQuaternion.h.

btQuaternion btQuaternion::normalized ( ) const
inline

Return a normalized version of this quaternion.

Definition at line 396 of file btQuaternion.h.

btQuaternion btQuaternion::operator* ( const btScalar s) const
inline

Return a scaled version of this quaternion.

Parameters
sThe scale factor

Definition at line 365 of file btQuaternion.h.

btQuaternion& btQuaternion::operator*= ( const btScalar s)
inline

Scale this quaternion.

Parameters
sThe scalar to scale by

Definition at line 196 of file btQuaternion.h.

btQuaternion& btQuaternion::operator*= ( const btQuaternion q)
inline

Multiply this quaternion by q on the right.

Parameters
qThe other quaternion Equivilant to this = this * q

Definition at line 216 of file btQuaternion.h.

btQuaternion btQuaternion::operator+ ( const btQuaternion q2) const
inline

Return the sum of this quaternion and the other.

Parameters
q2The other quaternion

Definition at line 467 of file btQuaternion.h.

btQuaternion& btQuaternion::operator+= ( const btQuaternion q)
inline

Add two quaternions.

Parameters
qThe quaternion to add to this one

Definition at line 162 of file btQuaternion.h.

btQuaternion btQuaternion::operator- ( const btQuaternion q2) const
inline

Return the difference between this quaternion and the other.

Parameters
q2The other quaternion

Definition at line 482 of file btQuaternion.h.

btQuaternion btQuaternion::operator- ( ) const
inline

Return the negative of this quaternion This simply negates each element.

Definition at line 496 of file btQuaternion.h.

btQuaternion& btQuaternion::operator-= ( const btQuaternion q)
inline

Subtract out a quaternion.

Parameters
qThe quaternion to subtract from this one

Definition at line 179 of file btQuaternion.h.

btQuaternion btQuaternion::operator/ ( const btScalar s) const
inline

Return an inversely scaled versionof this quaternion.

Parameters
sThe inverse scale factor

Definition at line 381 of file btQuaternion.h.

btQuaternion& btQuaternion::operator/= ( const btScalar s)
inline

Inversely scale this quaternion.

Parameters
sThe scale factor

Definition at line 389 of file btQuaternion.h.

void btQuaternion::serialize ( struct btQuaternionData dataOut) const
inline

could also do a memcpy, check if it is worth it

Definition at line 966 of file btQuaternion.h.

void btQuaternion::serializeDouble ( struct btQuaternionDoubleData dataOut) const
inline

could also do a memcpy, check if it is worth it

Definition at line 952 of file btQuaternion.h.

void btQuaternion::serializeFloat ( struct btQuaternionFloatData dataOut) const
inline

could also do a memcpy, check if it is worth it

Definition at line 938 of file btQuaternion.h.

void btQuaternion::setEuler ( const btScalar yaw,
const btScalar pitch,
const btScalar roll 
)
inline

Set the quaternion using Euler angles.

Parameters
yawAngle around Y
pitchAngle around X
rollAngle around Z

Definition at line 124 of file btQuaternion.h.

void btQuaternion::setEulerZYX ( const btScalar yaw,
const btScalar pitch,
const btScalar roll 
)
inline

Set the quaternion using euler angles.

Parameters
yawAngle around Z
pitchAngle around Y
rollAngle around X

Definition at line 144 of file btQuaternion.h.

void btQuaternion::setRotation ( const btVector3 axis,
const btScalar _angle 
)
inline

Set the rotation using axis angle notation.

Parameters
axisThe axis around which to rotate
angleThe magnitude of the rotation in Radians

Definition at line 112 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.

Parameters
qThe other quaternion to interpolate with
tThe 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 534 of file btQuaternion.h.


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