Blender V2.61 - r43446
|
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with btQuaternion, btTransform and btVector3. Make sure to only include a pure orthogonal matrix without scaling. More...
#include <btMatrix3x3.h>
Public Member Functions | |
btMatrix3x3 () | |
No initializaion constructor. | |
btMatrix3x3 (const btQuaternion &q) | |
Constructor from Quaternion. | |
btMatrix3x3 (const btScalar &xx, const btScalar &xy, const btScalar &xz, const btScalar &yx, const btScalar &yy, const btScalar &yz, const btScalar &zx, const btScalar &zy, const btScalar &zz) | |
Constructor with row major formatting. | |
SIMD_FORCE_INLINE | btMatrix3x3 (const btMatrix3x3 &other) |
Copy constructor. | |
SIMD_FORCE_INLINE btMatrix3x3 & | operator= (const btMatrix3x3 &other) |
Assignment Operator. | |
SIMD_FORCE_INLINE btVector3 | getColumn (int i) const |
Get a column of the matrix as a vector. | |
SIMD_FORCE_INLINE const btVector3 & | getRow (int i) const |
Get a row of the matrix as a vector. | |
SIMD_FORCE_INLINE btVector3 & | operator[] (int i) |
Get a mutable reference to a row of the matrix as a vector. | |
SIMD_FORCE_INLINE const btVector3 & | operator[] (int i) const |
Get a const reference to a row of the matrix as a vector. | |
btMatrix3x3 & | operator*= (const btMatrix3x3 &m) |
Multiply by the target matrix on the right. | |
btMatrix3x3 & | operator+= (const btMatrix3x3 &m) |
Adds by the target matrix on the right. | |
btMatrix3x3 & | operator-= (const btMatrix3x3 &m) |
Substractss by the target matrix on the right. | |
void | setFromOpenGLSubMatrix (const btScalar *m) |
Set from the rotational part of a 4x4 OpenGL matrix. | |
void | setValue (const btScalar &xx, const btScalar &xy, const btScalar &xz, const btScalar &yx, const btScalar &yy, const btScalar &yz, const btScalar &zx, const btScalar &zy, const btScalar &zz) |
Set the values of the matrix explicitly (row major) | |
void | setRotation (const btQuaternion &q) |
Set the matrix from a quaternion. | |
void | setEulerYPR (const btScalar &yaw, const btScalar &pitch, const btScalar &roll) |
Set the matrix from euler angles using YPR around YXZ respectively. | |
void | setEulerZYX (btScalar eulerX, btScalar eulerY, btScalar eulerZ) |
Set the matrix from euler angles YPR around ZYX axes. | |
void | setIdentity () |
Set the matrix to the identity. | |
void | getOpenGLSubMatrix (btScalar *m) const |
Fill the rotational part of an OpenGL matrix and clear the shear/perspective. | |
void | getRotation (btQuaternion &q) const |
Get the matrix represented as a quaternion. | |
void | getEulerYPR (btScalar &yaw, btScalar &pitch, btScalar &roll) const |
Get the matrix represented as euler angles around YXZ, roundtrip with setEulerYPR. | |
void | getEulerZYX (btScalar &yaw, btScalar &pitch, btScalar &roll, unsigned int solution_number=1) const |
Get the matrix represented as euler angles around ZYX. | |
btMatrix3x3 | scaled (const btVector3 &s) const |
Create a scaled copy of the matrix. | |
btScalar | determinant () const |
Return the determinant of the matrix. | |
btMatrix3x3 | adjoint () const |
Return the adjoint of the matrix. | |
btMatrix3x3 | absolute () const |
Return the matrix with all values non negative. | |
btMatrix3x3 | transpose () const |
Return the transpose of the matrix. | |
btMatrix3x3 | inverse () const |
Return the inverse of the matrix. | |
btMatrix3x3 | transposeTimes (const btMatrix3x3 &m) const |
btMatrix3x3 | timesTranspose (const btMatrix3x3 &m) const |
SIMD_FORCE_INLINE btScalar | tdotx (const btVector3 &v) const |
SIMD_FORCE_INLINE btScalar | tdoty (const btVector3 &v) const |
SIMD_FORCE_INLINE btScalar | tdotz (const btVector3 &v) const |
void | diagonalize (btMatrix3x3 &rot, btScalar threshold, int maxSteps) |
diagonalizes this matrix by the Jacobi method. | |
btScalar | cofac (int r1, int c1, int r2, int c2) const |
Calculate the matrix cofactor. | |
void | serialize (struct btMatrix3x3Data &dataOut) const |
void | serializeFloat (struct btMatrix3x3FloatData &dataOut) const |
void | deSerialize (const struct btMatrix3x3Data &dataIn) |
void | deSerializeFloat (const struct btMatrix3x3FloatData &dataIn) |
void | deSerializeDouble (const struct btMatrix3x3DoubleData &dataIn) |
Static Public Member Functions | |
static const btMatrix3x3 & | getIdentity () |
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with btQuaternion, btTransform and btVector3. Make sure to only include a pure orthogonal matrix without scaling.
Definition at line 31 of file btMatrix3x3.h.
btMatrix3x3::btMatrix3x3 | ( | ) | [inline] |
No initializaion constructor.
Definition at line 38 of file btMatrix3x3.h.
Referenced by absolute(), adjoint(), inverse(), scaled(), timesTranspose(), transpose(), and transposeTimes().
btMatrix3x3::btMatrix3x3 | ( | const btQuaternion & | q | ) | [inline, explicit] |
btMatrix3x3::btMatrix3x3 | ( | const btScalar & | xx, |
const btScalar & | xy, | ||
const btScalar & | xz, | ||
const btScalar & | yx, | ||
const btScalar & | yy, | ||
const btScalar & | yz, | ||
const btScalar & | zx, | ||
const btScalar & | zy, | ||
const btScalar & | zz | ||
) | [inline] |
Constructor with row major formatting.
Definition at line 52 of file btMatrix3x3.h.
References setValue().
SIMD_FORCE_INLINE btMatrix3x3::btMatrix3x3 | ( | const btMatrix3x3 & | other | ) | [inline] |
Copy constructor.
Definition at line 61 of file btMatrix3x3.h.
SIMD_FORCE_INLINE btMatrix3x3 btMatrix3x3::absolute | ( | ) | const |
Return the matrix with all values non negative.
Definition at line 617 of file btMatrix3x3.h.
References btFabs(), and btMatrix3x3().
Referenced by btTransformAabb(), GIM_BOX_BOX_TRANSFORM_CACHE::calc_absolute_matrix(), CcdGraphicController::getAabb(), btHeightfieldTerrainShape::getAabb(), btTriangleMeshShape::getAabb(), and btCapsuleShape::getAabb().
SIMD_FORCE_INLINE btMatrix3x3 btMatrix3x3::adjoint | ( | ) | const |
Return the adjoint of the matrix.
Definition at line 634 of file btMatrix3x3.h.
References btMatrix3x3(), and cofac().
Referenced by PolarDecompose().
btScalar btMatrix3x3::cofac | ( | int | r1, |
int | c1, | ||
int | r2, | ||
int | c2 | ||
) | const [inline] |
Calculate the matrix cofactor.
r1 | The first row to use for calculating the cofactor |
c1 | The first column to use for calculating the cofactor |
r1 | The second row to use for calculating the cofactor |
c1 | The second column to use for calculating the cofactor See http://en.wikipedia.org/wiki/Cofactor_(linear_algebra) for more details |
Definition at line 509 of file btMatrix3x3.h.
SIMD_FORCE_INLINE void btMatrix3x3::deSerialize | ( | const struct btMatrix3x3Data & | dataIn | ) |
Definition at line 752 of file btMatrix3x3.h.
References i.
Referenced by btTransform::deSerialize().
SIMD_FORCE_INLINE void btMatrix3x3::deSerializeDouble | ( | const struct btMatrix3x3DoubleData & | dataIn | ) |
Definition at line 764 of file btMatrix3x3.h.
References i, and btMatrix3x3DoubleData::m_el.
Referenced by btTransform::deSerializeDouble().
SIMD_FORCE_INLINE void btMatrix3x3::deSerializeFloat | ( | const struct btMatrix3x3FloatData & | dataIn | ) |
Definition at line 758 of file btMatrix3x3.h.
References i, and btMatrix3x3FloatData::m_el.
Referenced by btTransform::deSerializeFloat().
SIMD_FORCE_INLINE btScalar btMatrix3x3::determinant | ( | ) | const |
Return the determinant of the matrix.
Definition at line 610 of file btMatrix3x3.h.
References btTriple().
Referenced by PolarDecompose(), and btSoftBody::updatePose().
void btMatrix3x3::diagonalize | ( | btMatrix3x3 & | rot, |
btScalar | threshold, | ||
int | maxSteps | ||
) | [inline] |
diagonalizes this matrix by the Jacobi method.
rot | stores the rotation from the coordinate system in which the matrix is diagonal to the original coordinate system, i.e., old_this = rot * new_this * rot^T. |
threshold | See iteration |
iteration | The iteration stops when all off-diagonal elements are less than the threshold multiplied by the sum of the absolute values of the diagonal, or when maxSteps have been executed. |
Note that this matrix is assumed to be symmetric.
Definition at line 421 of file btMatrix3x3.h.
References btFabs(), btSqrt(), cos(), i, max, p, setIdentity(), SIMD_EPSILON, sin(), and step().
Referenced by btConvexTriangleMeshShape::calculatePrincipalAxisTransform().
SIMD_FORCE_INLINE btVector3 btMatrix3x3::getColumn | ( | int | i | ) | const [inline] |
Get a column of the matrix as a vector.
i | Column number 0 indexed |
Definition at line 78 of file btMatrix3x3.h.
Referenced by btGeneric6DofConstraint::buildJacobian(), btConeTwistConstraint::calcAngleInfo(), btConeTwistConstraint::calcAngleInfo2(), btGeneric6DofConstraint::calculateAngleInfo(), btSliderConstraint::calculateTransforms(), capsuleCapsuleDistance(), btDiscreteDynamicsWorld::debugDrawConstraint(), btSliderConstraint::getInfo2NonVirtual(), btConeTwistConstraint::getInfo2NonVirtual(), btGeneric6DofConstraint::setLinearLimits(), btSliderConstraint::testAngLimits(), and btRaycastVehicle::updateFriction().
Get the matrix represented as euler angles around YXZ, roundtrip with setEulerYPR.
yaw | Yaw around Y axis |
pitch | Pitch around X axis |
roll | around Z axis |
Definition at line 279 of file btMatrix3x3.h.
References btAsin(), btAtan2(), btFabs(), SIMD_HALF_PI, and SIMD_PI.
void btMatrix3x3::getEulerZYX | ( | btScalar & | yaw, |
btScalar & | pitch, | ||
btScalar & | roll, | ||
unsigned int | solution_number = 1 |
||
) | const [inline] |
Get the matrix represented as euler angles around ZYX.
yaw | Yaw around X axis |
pitch | Pitch around Y axis |
roll | around X axis |
solution_number | Which solution of two possible solutions ( 1 or 2) are possible values |
Definition at line 308 of file btMatrix3x3.h.
References btAsin(), btAtan2(), btCos(), btFabs(), and SIMD_PI.
static const btMatrix3x3& btMatrix3x3::getIdentity | ( | ) | [inline, static] |
Definition at line 213 of file btMatrix3x3.h.
Referenced by btTransform::getIdentity().
void btMatrix3x3::getOpenGLSubMatrix | ( | btScalar * | m | ) | const [inline] |
Fill the rotational part of an OpenGL matrix and clear the shear/perspective.
m | The array to be filled |
Definition at line 223 of file btMatrix3x3.h.
Referenced by btTransform::getOpenGLMatrix(), DefaultMotionState::getWorldOrientation(), and CcdPhysicsController::SynchronizeMotionStates().
void btMatrix3x3::getRotation | ( | btQuaternion & | q | ) | const [inline] |
Get the matrix represented as a quaternion.
q | The quaternion which will be set |
Definition at line 241 of file btMatrix3x3.h.
References btSqrt(), i, and trace.
Referenced by btTransformUtil::calculateDiffAxisAngle(), btTransform::getRotation(), and CcdPhysicsController::SynchronizeMotionStates().
SIMD_FORCE_INLINE const btVector3& btMatrix3x3::getRow | ( | int | i | ) | const [inline] |
Get a row of the matrix as a vector.
i | Row number 0 indexed |
Definition at line 86 of file btMatrix3x3.h.
References btFullAssert, and i.
Referenced by GIM_AABB::appy_transform(), and btCompareTransformsEqual().
SIMD_FORCE_INLINE btMatrix3x3 btMatrix3x3::inverse | ( | ) | const |
Return the inverse of the matrix.
Definition at line 642 of file btMatrix3x3.h.
References btFullAssert, btMatrix3x3(), co, and cofac().
Referenced by ATTRIBUTE_ALIGNED16(), GIM_BOX_BOX_TRANSFORM_CACHE::calc_from_full_invert(), btGeneric6DofConstraint::calculateAngleInfo(), btTransformUtil::calculateDiffAxisAngle(), btGeneric6DofConstraint::calculateLinearInfo(), btSoftBody::initializeClusters(), CcdPhysicsController::RelativeRotate(), btSoftBody::setPose(), and btSoftBody::updateClusters().
SIMD_FORCE_INLINE btMatrix3x3 & btMatrix3x3::operator*= | ( | const btMatrix3x3 & | m | ) |
Multiply by the target matrix on the right.
m | Rotation matrix to be applied Equivilant to this = this * m |
Definition at line 528 of file btMatrix3x3.h.
References setValue(), tdotx(), tdoty(), and tdotz().
SIMD_FORCE_INLINE btMatrix3x3 & btMatrix3x3::operator+= | ( | const btMatrix3x3 & | m | ) |
Adds by the target matrix on the right.
m | matrix to be applied Equivilant to this = this + m |
Definition at line 537 of file btMatrix3x3.h.
References setValue().
SIMD_FORCE_INLINE btMatrix3x3 & btMatrix3x3::operator-= | ( | const btMatrix3x3 & | m | ) |
Substractss by the target matrix on the right.
m | matrix to be applied Equivilant to this = this - m |
Definition at line 593 of file btMatrix3x3.h.
References setValue().
SIMD_FORCE_INLINE btMatrix3x3& btMatrix3x3::operator= | ( | const btMatrix3x3 & | other | ) | [inline] |
Assignment Operator.
Definition at line 68 of file btMatrix3x3.h.
SIMD_FORCE_INLINE const btVector3& btMatrix3x3::operator[] | ( | int | i | ) | const [inline] |
Get a const reference to a row of the matrix as a vector.
i | Row number 0 indexed |
Definition at line 102 of file btMatrix3x3.h.
References btFullAssert, and i.
SIMD_FORCE_INLINE btVector3& btMatrix3x3::operator[] | ( | int | i | ) | [inline] |
Get a mutable reference to a row of the matrix as a vector.
i | Row number 0 indexed |
Definition at line 94 of file btMatrix3x3.h.
References btFullAssert, and i.
btMatrix3x3 btMatrix3x3::scaled | ( | const btVector3 & | s | ) | const [inline] |
Create a scaled copy of the matrix.
s | Scaling vector The elements of the vector will scale each column |
Definition at line 377 of file btMatrix3x3.h.
References btMatrix3x3().
Referenced by gim_inertia_add_transformed(), and btRigidBody::updateInertiaTensor().
SIMD_FORCE_INLINE void btMatrix3x3::serialize | ( | struct btMatrix3x3Data & | dataOut | ) | const |
Definition at line 739 of file btMatrix3x3.h.
References i.
Referenced by btRigidBody::serialize(), and btTransform::serialize().
SIMD_FORCE_INLINE void btMatrix3x3::serializeFloat | ( | struct btMatrix3x3FloatData & | dataOut | ) | const |
Definition at line 745 of file btMatrix3x3.h.
References i, and btMatrix3x3FloatData::m_el.
Referenced by btTransform::serializeFloat().
void btMatrix3x3::setEulerYPR | ( | const btScalar & | yaw, |
const btScalar & | pitch, | ||
const btScalar & | roll | ||
) | [inline] |
Set the matrix from euler angles using YPR around YXZ respectively.
yaw | Yaw about Y axis |
pitch | Pitch about X axis |
roll | Roll about Z axis |
Definition at line 173 of file btMatrix3x3.h.
References setEulerZYX().
Set the matrix from euler angles YPR around ZYX axes.
eulerX | Roll about X axis |
eulerY | Pitch around Y axis |
eulerZ | Yaw aboud Z axis |
These angles are used to produce a rotation matrix. The euler angles are applied in ZYX order. I.e a vector is first rotated about X then Y and then Z
Definition at line 187 of file btMatrix3x3.h.
References btCos(), btSin(), setValue(), and si.
Referenced by setEulerYPR().
void btMatrix3x3::setFromOpenGLSubMatrix | ( | const btScalar * | m | ) | [inline] |
Set from the rotational part of a 4x4 OpenGL matrix.
m | A pointer to the beginning of the array of scalars |
Definition at line 125 of file btMatrix3x3.h.
Referenced by CcdPhysicsController::GetTransformFromMotionState(), CcdPhysicsController::GetWorldOrientation(), BlenderBulletMotionState::getWorldTransform(), btTransform::setFromOpenGLMatrix(), and DefaultMotionState::setWorldOrientation().
void btMatrix3x3::setIdentity | ( | ) | [inline] |
Set the matrix to the identity.
Definition at line 206 of file btMatrix3x3.h.
References setValue().
Referenced by diagonalize(), btSoftBody::initDefaults(), PolarDecompose(), btTransform::setIdentity(), btSoftBody::setPose(), and btEigen::system().
void btMatrix3x3::setRotation | ( | const btQuaternion & | q | ) | [inline] |
Set the matrix from a quaternion.
q | The Quaternion to match |
Definition at line 153 of file btMatrix3x3.h.
References btFullAssert, simple_enum_gen::d, btQuaternion::length2(), and setValue().
Referenced by btMatrix3x3(), and btTransform::setRotation().
void btMatrix3x3::setValue | ( | const btScalar & | xx, |
const btScalar & | xy, | ||
const btScalar & | xz, | ||
const btScalar & | yx, | ||
const btScalar & | yy, | ||
const btScalar & | yz, | ||
const btScalar & | zx, | ||
const btScalar & | zy, | ||
const btScalar & | zz | ||
) | [inline] |
Set the values of the matrix explicitly (row major)
xx | Top left |
xy | Top Middle |
xz | Top Right |
yx | Middle Left |
yy | Middle Middle |
yz | Middle Right |
zx | Bottom Left |
zy | Bottom Middle |
zz | Bottom Right |
Definition at line 142 of file btMatrix3x3.h.
Referenced by ATTRIBUTE_ALIGNED16(), btHinge2Constraint::btHinge2Constraint(), btMatrix3x3(), btUniversalConstraint::btUniversalConstraint(), CcdPhysicsEnvironment::createConstraint(), operator*=(), operator+=(), operator-=(), btGeneric6DofSpringConstraint::setAxis(), btGeneric6DofConstraint::setAxis(), btUniversalConstraint::setAxis(), setEulerZYX(), setIdentity(), and setRotation().
SIMD_FORCE_INLINE btScalar btMatrix3x3::tdotx | ( | const btVector3 & | v | ) | const [inline] |
Definition at line 398 of file btMatrix3x3.h.
Referenced by operator*(), and operator*=().
SIMD_FORCE_INLINE btScalar btMatrix3x3::tdoty | ( | const btVector3 & | v | ) | const [inline] |
Definition at line 402 of file btMatrix3x3.h.
Referenced by operator*(), and operator*=().
SIMD_FORCE_INLINE btScalar btMatrix3x3::tdotz | ( | const btVector3 & | v | ) | const [inline] |
Definition at line 406 of file btMatrix3x3.h.
Referenced by operator*(), and operator*=().
SIMD_FORCE_INLINE btMatrix3x3 btMatrix3x3::timesTranspose | ( | const btMatrix3x3 & | m | ) | const |
Definition at line 669 of file btMatrix3x3.h.
References btMatrix3x3(), and dot().
SIMD_FORCE_INLINE btMatrix3x3 btMatrix3x3::transpose | ( | ) | const |
Return the transpose of the matrix.
Definition at line 626 of file btMatrix3x3.h.
References btMatrix3x3().
Referenced by btGeneric6DofConstraint::buildAngularJacobian(), btConeTwistConstraint::buildJacobian(), btGeneric6DofConstraint::buildLinearJacobian(), GIM_BOX_BOX_TRANSFORM_CACHE::calc_from_homogenic(), gim_inertia_add_transformed(), btTransform::inverse(), btTransform::invXform(), PolarDecompose(), resolveSingleBilateral(), btSoftBody::updateClusters(), btRigidBody::updateInertiaTensor(), and btSoftBody::updatePose().
SIMD_FORCE_INLINE btMatrix3x3 btMatrix3x3::transposeTimes | ( | const btMatrix3x3 & | m | ) | const |
Definition at line 654 of file btMatrix3x3.h.
References btMatrix3x3().
Referenced by gjkepa2_impl::Initialize(), and btTransform::inverseTimes().