|
Blender V4.3
|
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatrix3x3, btVector3 and btTransform. More...
#include <btQuaternion.h>
Inherits btQuadWord.
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 &yawZ, const btScalar &pitchY, const btScalar &rollX) |
| Set the quaternion using euler angles. | |
| void | getEulerZYX (btScalar &yawZ, btScalar &pitchY, btScalar &rollX) const |
| Get the euler angles from this quaternion. | |
| SIMD_FORCE_INLINE 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 & | safeNormalize () |
| btQuaternion & | normalize () |
| Normalize the quaternion Such that x^2 + y^2 + z^2 +w^2 = 1. | |
| SIMD_FORCE_INLINE 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 half angle between this quaternion and the other. | |
| btScalar | angleShortestPath (const btQuaternion &q) const |
| Return the angle between this quaternion and the other along the shortest path. | |
| btScalar | getAngle () const |
| Return the angle [0, 2Pi] of rotation represented by this quaternion. | |
| btScalar | getAngleShortestPath () const |
| Return the angle [0, Pi] of rotation represented by this quaternion along the shortest path. | |
| btVector3 | getAxis () const |
| Return the axis of the rotation represented by this quaternion. | |
| btQuaternion | inverse () const |
| Return the inverse of this quaternion. | |
| SIMD_FORCE_INLINE btQuaternion | operator+ (const btQuaternion &q2) const |
| Return the sum of this quaternion and the other. | |
| SIMD_FORCE_INLINE btQuaternion | operator- (const btQuaternion &q2) const |
| Return the difference between this quaternion and the other. | |
| SIMD_FORCE_INLINE btQuaternion | operator- () const |
| Return the negative of this quaternion This simply negates each element. | |
| SIMD_FORCE_INLINE btQuaternion | farthest (const btQuaternion &qd) const |
| SIMD_FORCE_INLINE 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. | |
| SIMD_FORCE_INLINE const btScalar & | getW () const |
| SIMD_FORCE_INLINE void | serialize (struct btQuaternionData &dataOut) const |
| SIMD_FORCE_INLINE void | deSerialize (const struct btQuaternionFloatData &dataIn) |
| SIMD_FORCE_INLINE void | deSerialize (const struct btQuaternionDoubleData &dataIn) |
| SIMD_FORCE_INLINE void | serializeFloat (struct btQuaternionFloatData &dataOut) const |
| SIMD_FORCE_INLINE void | deSerializeFloat (const struct btQuaternionFloatData &dataIn) |
| SIMD_FORCE_INLINE void | serializeDouble (struct btQuaternionDoubleData &dataOut) const |
| SIMD_FORCE_INLINE void | deSerializeDouble (const struct btQuaternionDoubleData &dataIn) |
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 49 of file btQuaternion.h.
|
inline |
No initialization constructor.
Definition at line 53 of file btQuaternion.h.
Referenced by inverse(), operator*(), operator+(), operator-(), operator-(), and slerp().
|
inline |
Constructor from scalars.
Definition at line 82 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 89 of file btQuaternion.h.
References setRotation().
|
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 97 of file btQuaternion.h.
References setEuler(), and setEulerZYX().
|
inline |
|
inline |
| SIMD_FORCE_INLINE void btQuaternion::deSerialize | ( | const struct btQuaternionDoubleData & | dataIn | ) |
Definition at line 1015 of file btQuaternion.h.
References btQuaternionDoubleData::m_floats, and m_floats.
| SIMD_FORCE_INLINE void btQuaternion::deSerialize | ( | const struct btQuaternionFloatData & | dataIn | ) |
Definition at line 1009 of file btQuaternion.h.
References btQuaternionFloatData::m_floats, and m_floats.
| SIMD_FORCE_INLINE void btQuaternion::deSerializeDouble | ( | const struct btQuaternionDoubleData & | dataIn | ) |
Definition at line 996 of file btQuaternion.h.
References btQuaternionDoubleData::m_floats, and m_floats.
| SIMD_FORCE_INLINE void btQuaternion::deSerializeFloat | ( | const struct btQuaternionFloatData & | dataIn | ) |
Definition at line 983 of file btQuaternion.h.
References btQuaternionFloatData::m_floats, and m_floats.
|
inline |
Return the dot product between this quaternion and another.
| q | The other quaternion |
Definition at line 337 of file btQuaternion.h.
References m_floats.
Referenced by angle(), angleShortestPath(), length2(), and slerp().
|
inline |
Definition at line 552 of file btQuaternion.h.
|
inline |
Return the angle [0, 2Pi] of rotation represented by this quaternion.
Definition at line 468 of file btQuaternion.h.
References btAcos(), and m_floats.
Referenced by calcAngleInfo2(), btTransformUtil::calculateDiffAxisAngle(), btTransformUtil::calculateDiffAxisAngleQuaternion(), computeConeLimitInfo(), computeTwistLimitInfo(), and setMotorTarget().
|
inline |
Return the angle [0, Pi] of rotation represented by this quaternion along the shortest path.
Definition at line 475 of file btQuaternion.h.
|
inline |
Return the axis of the rotation represented by this quaternion.
Definition at line 486 of file btQuaternion.h.
References btSqrt(), btVector3, m_floats, and SIMD_EPSILON.
|
inlinestatic |
Definition at line 608 of file btQuaternion.h.
|
inline |
Definition at line 614 of file btQuaternion.h.
References m_floats.
Referenced by copy_quat_btquat().
|
inline |
Return the inverse of this quaternion.
Definition at line 497 of file btQuaternion.h.
References btQuaternion(), and m_floats.
Referenced by calcAngleInfo2(), btTransformUtil::calculateDiffAxisAngleQuaternion(), btRigidBody::computeGyroscopicImpulseImplicit_Body(), btMultiBodySphericalJointMotor::createConstraintRows(), inverse(), quatRotate(), setMotorTarget(), setMotorTarget(), setMotorTargetInConstraintSpace(), and setUpVector().
|
inline |
Return the length of the quaternion.
Definition at line 370 of file btQuaternion.h.
References btSqrt(), and length2().
Referenced by length(), normalize(), and normalized().
|
inline |
Return the length squared of the quaternion.
Definition at line 364 of file btQuaternion.h.
References dot().
Referenced by angle(), angleShortestPath(), btTransformUtil::integrateTransform(), length(), safeNormalize(), setRotation(), and slerp().
|
inline |
Definition at line 563 of file btQuaternion.h.
Referenced by btTransformUtil::calculateDiffAxisAngleQuaternion().
|
inline |
Normalize the quaternion Such that x^2 + y^2 + z^2 +w^2 = 1.
Definition at line 385 of file btQuaternion.h.
References length().
Referenced by calcAngleInfo2(), btTransformUtil::calculateDiffAxisAngle(), extractRotation(), predictPositionsMultiDof(), safeNormalize(), setMotorTarget(), setMotorTargetInConstraintSpace(), and stepPositionsMultiDof().
|
inline |
Return a normalized version of this quaternion.
Definition at line 442 of file btQuaternion.h.
References length().
|
inline |
Return a scaled version of this quaternion.
| s | The scale factor |
Definition at line 411 of file btQuaternion.h.
References btQuaternion(), m_floats, x, y, and z().
|
inline |
Multiply this quaternion by q on the right.
| q | The other quaternion Equivilant to this = this * q |
Definition at line 254 of file btQuaternion.h.
References A0, A1, A2, m_floats, and setValue().
|
inline |
Scale this quaternion.
| s | The scalar to scale by |
Definition at line 234 of file btQuaternion.h.
References m_floats.
|
inline |
Return the sum of this quaternion and the other.
| q2 | The other quaternion |
Definition at line 511 of file btQuaternion.h.
References btQuaternion(), and q1.
|
inline |
Add two quaternions.
| q | The quaternion to add to this one |
Definition at line 200 of file btQuaternion.h.
References m_floats.
|
inline |
Return the negative of this quaternion This simply negates each element.
Definition at line 540 of file btQuaternion.h.
References btQuaternion().
|
inline |
Return the difference between this quaternion and the other.
| q2 | The other quaternion |
Definition at line 526 of file btQuaternion.h.
References btQuaternion(), and q1.
|
inline |
Subtract out a quaternion.
| q | The quaternion to subtract from this one |
Definition at line 217 of file btQuaternion.h.
References m_floats.
|
inline |
Return an inversely scaled versionof this quaternion.
| s | The inverse scale factor |
Definition at line 427 of file btQuaternion.h.
References btAssert.
|
inline |
Inversely scale this quaternion.
| s | The scale factor |
Definition at line 435 of file btQuaternion.h.
References btAssert.
|
inline |
Definition at line 374 of file btQuaternion.h.
References length2(), normalize(), and SIMD_EPSILON.
Referenced by btTransformUtil::integrateTransform().
| SIMD_FORCE_INLINE void btQuaternion::serialize | ( | struct btQuaternionData & | dataOut | ) | const |
could also do a memcpy, check if it is worth it
Definition at line 1002 of file btQuaternion.h.
References m_floats.
| SIMD_FORCE_INLINE void btQuaternion::serializeDouble | ( | struct btQuaternionDoubleData & | dataOut | ) | const |
could also do a memcpy, check if it is worth it
Definition at line 989 of file btQuaternion.h.
References btQuaternionDoubleData::m_floats, and m_floats.
| SIMD_FORCE_INLINE void btQuaternion::serializeFloat | ( | struct btQuaternionFloatData & | dataOut | ) | const |
could also do a memcpy, check if it is worth it
Definition at line 976 of file btQuaternion.h.
References btQuaternionFloatData::m_floats, and m_floats.
|
inline |
Set the quaternion using Euler angles.
| yaw | Angle around Y |
| pitch | Angle around X |
| roll | Angle around Z |
Definition at line 120 of file btQuaternion.h.
References btCos(), btSin(), and setValue().
Referenced by btQuaternion().
|
inline |
Set the quaternion using euler angles.
| yaw | Angle around Z |
| pitch | Angle around Y |
| roll | Angle around X |
Definition at line 140 of file btQuaternion.h.
References btCos(), btSin(), and setValue().
Referenced by btQuaternion().
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 108 of file btQuaternion.h.
References btAssert, btCos(), btSin(), and setValue().
Referenced by btQuaternion(), btTransformUtil::integrateTransform(), setUpVector(), and btSoftBody::updateDeformation().
|
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 577 of file btQuaternion.h.
References btAcos(), btAssert, btFabs(), btQuaternion(), btSin(), btSqrt(), dot(), length2(), m_floats, and SIMD_EPSILON.
Referenced by slerp().