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 | |
__attribute__ ((deprecated)) void getEulerZYX(btScalar &yaw | |
Get the matrix represented as euler angles around ZYX. | |
btMatrix3x3 | absolute () const |
Return the matrix with all values non negative. | |
btMatrix3x3 | adjoint () const |
Return the adjoint of the matrix. | |
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. | |
btScalar | cofac (int r1, int c1, int r2, int c2) const |
Calculate the matrix cofactor. | |
void | deSerialize (const struct btMatrix3x3Data &dataIn) |
void | deSerializeDouble (const struct btMatrix3x3DoubleData &dataIn) |
void | deSerializeFloat (const struct btMatrix3x3FloatData &dataIn) |
btScalar | determinant () const |
Return the determinant of the matrix. | |
void | diagonalize (btMatrix3x3 &rot, btScalar threshold, int maxSteps) |
diagonalizes this matrix by the Jacobi method. | |
SIMD_FORCE_INLINE btVector3 | getColumn (int i) const |
Get a column of the matrix as a vector. | |
void | getEulerYPR (btScalar &yaw, btScalar &pitch, btScalar &roll, unsigned int solution_number=1) const |
Get the matrix represented as euler angles around YXZ, roundtrip with setEulerYPR. | |
void | getOpenGLSubMatrix (btScalar *m) const |
Fill the values of the matrix into a 9 element array. | |
void | getRotation (btQuaternion &q) const |
Get the matrix represented as a quaternion. | |
SIMD_FORCE_INLINE const btVector3 & | getRow (int i) const |
Get a row of the matrix as a vector. | |
void | getRPY (btScalar &roll, btScalar &pitch, btScalar &yaw, unsigned int solution_number=1) const |
Get the matrix represented as roll pitch and yaw about fixed axes XYZ. | |
btMatrix3x3 | inverse () const |
Return the inverse of the matrix. | |
btMatrix3x3 & | operator*= (const btMatrix3x3 &m) |
Multiply by the target matrix on the right. | |
SIMD_FORCE_INLINE btMatrix3x3 & | operator= (const btMatrix3x3 &other) |
Assignment Operator. | |
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 | scaled (const btVector3 &s) const |
Create a scaled copy of the matrix. | |
void | serialize (struct btMatrix3x3Data &dataOut) const |
void | serializeFloat (struct btMatrix3x3FloatData &dataOut) const |
void | setEulerYPR (btScalar eulerZ, btScalar eulerY, btScalar eulerX) |
Set the matrix from euler angles YPR around ZYX axes. | |
void | setEulerZYX (const btScalar &yaw, const btScalar &pitch, const btScalar &roll) __attribute__((deprecated)) |
Set the matrix from euler angles using YPR around ZYX respectively. | |
void | setFromOpenGLSubMatrix (const btScalar *m) |
Set from a carray of btScalars. | |
void | setIdentity () |
Set the matrix to the identity. | |
void | setRotation (const btQuaternion &q) |
Set the matrix from a quaternion. | |
void | setRPY (btScalar roll, btScalar pitch, btScalar yaw) |
Set the matrix using RPY about XYZ fixed axes. | |
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) | |
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 |
btMatrix3x3 | timesTranspose (const btMatrix3x3 &m) const |
btMatrix3x3 | transpose () const |
Return the transpose of the matrix. | |
btMatrix3x3 | transposeTimes (const btMatrix3x3 &m) const |
Static Public Member Functions | |
static const btMatrix3x3 & | getIdentity () |
Public Attributes | |
btScalar & | pitch |
btScalar btScalar & | roll |
btScalar btScalar unsigned int | solution_number |
Private Attributes | |
btVector3 | m_el [3] |
Data storage for the matrix, each vector is a row of the matrix. |
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.
btMatrix3x3::btMatrix3x3 | ( | const btQuaternion & | q | ) | [inline, explicit] |
Constructor from Quaternion.
Definition at line 43 of file btMatrix3x3.h.
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.
SIMD_FORCE_INLINE btMatrix3x3::btMatrix3x3 | ( | const btMatrix3x3 & | other | ) | [inline] |
Copy constructor.
Definition at line 61 of file btMatrix3x3.h.
btMatrix3x3::__attribute__ | ( | (deprecated) | ) |
Get the matrix represented as euler angles around ZYX.
yaw | Yaw around Z axis |
pitch | Pitch around Y axis |
roll | around X axis |
solution_number | Which solution of two possible solutions ( 1 or 2) are possible values |
Return the matrix with all values non negative.
Definition at line 536 of file btMatrix3x3.h.
SIMD_FORCE_INLINE btMatrix3x3 btMatrix3x3::adjoint | ( | ) | const |
Return the adjoint of the matrix.
Definition at line 553 of file btMatrix3x3.h.
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 501 of file btMatrix3x3.h.
SIMD_FORCE_INLINE void btMatrix3x3::deSerialize | ( | const struct btMatrix3x3Data & | dataIn | ) |
Definition at line 671 of file btMatrix3x3.h.
SIMD_FORCE_INLINE void btMatrix3x3::deSerializeDouble | ( | const struct btMatrix3x3DoubleData & | dataIn | ) |
Definition at line 683 of file btMatrix3x3.h.
SIMD_FORCE_INLINE void btMatrix3x3::deSerializeFloat | ( | const struct btMatrix3x3FloatData & | dataIn | ) |
Definition at line 677 of file btMatrix3x3.h.
Return the determinant of the matrix.
Definition at line 529 of file btMatrix3x3.h.
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 413 of file btMatrix3x3.h.
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.
void btMatrix3x3::getEulerYPR | ( | btScalar & | yaw, |
btScalar & | pitch, | ||
btScalar & | roll, | ||
unsigned int | solution_number = 1 |
||
) | const [inline] |
Get the matrix represented as euler angles around YXZ, roundtrip with setEulerYPR.
yaw | Yaw around Z axis |
pitch | Pitch around Y axis |
roll | around X axis |
Definition at line 289 of file btMatrix3x3.h.
static const btMatrix3x3& btMatrix3x3::getIdentity | ( | ) | [inline, static] |
Definition at line 212 of file btMatrix3x3.h.
void btMatrix3x3::getOpenGLSubMatrix | ( | btScalar * | m | ) | const [inline] |
Fill the values of the matrix into a 9 element array.
m | The array to be filled |
Definition at line 222 of file btMatrix3x3.h.
void btMatrix3x3::getRotation | ( | btQuaternion & | q | ) | const [inline] |
Get the matrix represented as a quaternion.
q | The quaternion which will be set |
Definition at line 240 of file btMatrix3x3.h.
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.
void btMatrix3x3::getRPY | ( | btScalar & | roll, |
btScalar & | pitch, | ||
btScalar & | yaw, | ||
unsigned int | solution_number = 1 |
||
) | const [inline] |
Get the matrix represented as roll pitch and yaw about fixed axes XYZ.
roll | around X axis |
pitch | Pitch around Y axis |
yaw | Yaw around Z axis |
solution_number | Which solution of two possible solutions ( 1 or 2) are possible values |
Definition at line 361 of file btMatrix3x3.h.
SIMD_FORCE_INLINE btMatrix3x3 btMatrix3x3::inverse | ( | ) | const |
Return the inverse of the matrix.
Definition at line 561 of file btMatrix3x3.h.
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 520 of file btMatrix3x3.h.
SIMD_FORCE_INLINE btMatrix3x3& btMatrix3x3::operator= | ( | const btMatrix3x3 & | other | ) | [inline] |
Assignment Operator.
Definition at line 68 of file btMatrix3x3.h.
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.
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.
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 369 of file btMatrix3x3.h.
SIMD_FORCE_INLINE void btMatrix3x3::serialize | ( | struct btMatrix3x3Data & | dataOut | ) | const |
Definition at line 658 of file btMatrix3x3.h.
SIMD_FORCE_INLINE void btMatrix3x3::serializeFloat | ( | struct btMatrix3x3FloatData & | dataOut | ) | const |
Definition at line 664 of file btMatrix3x3.h.
void btMatrix3x3::setEulerYPR | ( | btScalar | eulerZ, |
btScalar | eulerY, | ||
btScalar | eulerX | ||
) | [inline] |
Set the matrix from euler angles YPR around ZYX axes.
eulerZ | Yaw aboud Z axis |
eulerY | Pitch around Y axis |
eulerX | Roll about X 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 177 of file btMatrix3x3.h.
void btMatrix3x3::setEulerZYX | ( | const btScalar & | yaw, |
const btScalar & | pitch, | ||
const btScalar & | roll | ||
) | [inline] |
Set the matrix from euler angles using YPR around ZYX respectively.
yaw | Yaw about Z axis |
pitch | Pitch about Y axis |
roll | Roll about X axis |
Definition at line 163 of file btMatrix3x3.h.
void btMatrix3x3::setFromOpenGLSubMatrix | ( | const btScalar * | m | ) | [inline] |
Set from a carray of btScalars.
m | A pointer to the beginning of an array of 9 btScalars |
Definition at line 115 of file btMatrix3x3.h.
void btMatrix3x3::setIdentity | ( | ) | [inline] |
Set the matrix to the identity.
Definition at line 205 of file btMatrix3x3.h.
void btMatrix3x3::setRotation | ( | const btQuaternion & | q | ) | [inline] |
Set the matrix from a quaternion.
q | The Quaternion to match |
Definition at line 143 of file btMatrix3x3.h.
void btMatrix3x3::setRPY | ( | btScalar | roll, |
btScalar | pitch, | ||
btScalar | yaw | ||
) | [inline] |
Set the matrix using RPY about XYZ fixed axes.
roll | Roll about X axis |
pitch | Pitch around Y axis |
yaw | Yaw aboud Z axis |
Definition at line 200 of file btMatrix3x3.h.
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 132 of file btMatrix3x3.h.
SIMD_FORCE_INLINE btScalar btMatrix3x3::tdotx | ( | const btVector3 & | v | ) | const [inline] |
Definition at line 390 of file btMatrix3x3.h.
SIMD_FORCE_INLINE btScalar btMatrix3x3::tdoty | ( | const btVector3 & | v | ) | const [inline] |
Definition at line 394 of file btMatrix3x3.h.
SIMD_FORCE_INLINE btScalar btMatrix3x3::tdotz | ( | const btVector3 & | v | ) | const [inline] |
Definition at line 398 of file btMatrix3x3.h.
SIMD_FORCE_INLINE btMatrix3x3 btMatrix3x3::timesTranspose | ( | const btMatrix3x3 & | m | ) | const |
Definition at line 588 of file btMatrix3x3.h.
Return the transpose of the matrix.
Definition at line 545 of file btMatrix3x3.h.
SIMD_FORCE_INLINE btMatrix3x3 btMatrix3x3::transposeTimes | ( | const btMatrix3x3 & | m | ) | const |
Definition at line 573 of file btMatrix3x3.h.
btVector3 btMatrix3x3::m_el[3] [private] |
Data storage for the matrix, each vector is a row of the matrix.
Definition at line 34 of file btMatrix3x3.h.
Definition at line 279 of file btMatrix3x3.h.
Definition at line 279 of file btMatrix3x3.h.
btScalar btScalar unsigned int btMatrix3x3::solution_number |
1) const { getEulerYPR(yaw, pitch, roll, solution_number); }
Definition at line 279 of file btMatrix3x3.h.