3x3 matrix class. More...
#include <Inventor/SbMatrix.h>
Public Member Functions | |
SbMatrix3 () | |
Default constructor. | |
SbMatrix3 (float a11, float a12, float a13, float a21, float a22, float a23, float a31, float a32, float a33) | |
Constructor. | |
SbMatrix3 (const SbMat3 &m) | |
Constructor. | |
void | setValue (const SbMat3 &m) |
Sets value from 3x3 array of elements. | |
void | setValue (const float *pMat) |
Sets value from a 9 value float array. | |
void | makeIdentity () |
Sets matrix to be identity. | |
void | setRotate (const SbRotation &q) |
Sets matrix to rotate by given rotation. | |
void | setScale (float s) |
Sets matrix to scale by given uniform factor. | |
void | setScale (const SbVec3f &s) |
Sets matrix to scale by given vector. | |
void | getValue (SbMat3 &m) const |
Returns 3x3 array of elements. | |
const SbMat3 & | getValue () const |
Returns 3x3 array of elements. | |
SbMatrix3 & | multRight (const SbMatrix3 &m) |
Post-multiplies the matrix by the given matrix. | |
SbMatrix3 & | multLeft (const SbMatrix3 &m) |
Pre-multiplies matrix by the given matrix. | |
void | multMatrixVec (const SbVec3f &src, SbVec3f &dst) const |
Post-multiplies matrix by the given column vector, giving a 3D vector result. | |
void | multVecMatrix (const SbVec3f &src, SbVec3f &dst) const |
Pre-multiplies matrix by the given row vector, giving a 3D vector result. | |
float | det () const |
Returns the determinant of the matrix. | |
SbMatrix3 | inverse () const |
Returns the inverse of the matrix. | |
void | print (FILE *fp) const |
Prints a formatted version of the matrix to the given file pointer. | |
operator float * () | |
Cast: returns pointer to storage of first element. | |
operator SbMat3 & () | |
Cast: returns reference to 3x3 array. | |
float * | operator[] (int i) |
Make it look like a usual matrix (so you can do m[2][2]). | |
const float * | operator[] (int i) const |
Make it look like a usual matrix (so you can do m[2][2]). | |
SbVec3f | operator* (const SbVec3f &v) const |
Multiplies matrices by vector, returning a matrix result. | |
SbMatrix3 & | operator= (const SbMat3 &m) |
Sets value from 3x3 array of elements. | |
SbMatrix3 & | operator= (const SbMatrix3 &m) |
Set the matrix from another SbMatrix3. | |
SbMatrix3 & | operator= (const SbRotation &q) |
Set the matrix from an SbRotation. | |
SbMatrix3 & | operator*= (const SbMatrix3 &m) |
Post-multiplies the matrix by the given matrix (equivalent to multRight() method). | |
Static Public Member Functions | |
static SbMatrix3 | identity () |
Returns an identity matrix. | |
Friends | |
SbVec3f | operator* (const SbVec3f &v, const SbMatrix3 &m) |
Multiplies matrices by vector, returning a vector result. | |
SbMatrix3 | operator* (const SbMatrix3 &m1, const SbMatrix3 &m2) |
Multiplies two matrices, returning a matrix result. | |
int | operator== (const SbMatrix3 &m1, const SbMatrix3 &m2) |
Equality comparison operator. | |
int | operator!= (const SbMatrix3 &m1, const SbMatrix3 &m2) |
Inequality comparison operator. | |
3x3 matrix class.
3x3 matrix class/datatype.
See SbMatrix for discussion of storage layout and usage of matrices.
SbMatrix, SbMatrixd, SbRotation, SbRotationd, SbVec2d, SbVec2f, SbVec2i32, SbVec2s, SbVec3d, SbVec3f, SbVec3i32, SbVec3s, SbVec4b, SbVec4d, SbVec4f, SbVec4i32, SbVec4s, SbVec4ub, SbVec4ui32, SbVec4us
Definition at line 1186 of file SbMatrix.h.
|
inline |
Default constructor.
The matrix is initialized with zeros.
Definition at line 1192 of file SbMatrix.h.
SbMatrix3::SbMatrix3 | ( | float | a11, |
float | a12, | ||
float | a13, | ||
float | a21, | ||
float | a22, | ||
float | a23, | ||
float | a31, | ||
float | a32, | ||
float | a33 | ||
) |
Constructor.
SbMatrix3::SbMatrix3 | ( | const SbMat3 & | m | ) |
Constructor.
float SbMatrix3::det | ( | ) | const |
Returns the determinant of the matrix.
|
inline |
Returns 3x3 array of elements.
Definition at line 1263 of file SbMatrix.h.
void SbMatrix3::getValue | ( | SbMat3 & | m | ) | const |
Returns 3x3 array of elements.
|
static |
Returns an identity matrix.
SbMatrix3 SbMatrix3::inverse | ( | ) | const |
Returns the inverse of the matrix.
Results are undefined for singular matrices.
The matrix is not modified.
void SbMatrix3::makeIdentity | ( | ) |
Sets matrix to be identity.
Pre-multiplies matrix by the given matrix.
Matrix is replaced by the result.
Post-multiplies matrix by the given column vector, giving a 3D vector result.
It is safe to let src and dst be the same instance of SbVec3f.
Post-multiplies the matrix by the given matrix.
Matrix is replaced by the result.
Pre-multiplies matrix by the given row vector, giving a 3D vector result.
It is safe to let src and dst be the same instance of SbVec3f.
|
inline |
Cast: returns pointer to storage of first element.
Definition at line 1308 of file SbMatrix.h.
|
inline |
Cast: returns reference to 3x3 array.
Definition at line 1313 of file SbMatrix.h.
Multiplies matrices by vector, returning a matrix result.
Return M*v
Post-multiplies the matrix by the given matrix (equivalent to multRight() method).
Matrix is replaced by the resulting matrix.
Definition at line 1350 of file SbMatrix.h.
SbMatrix3 & SbMatrix3::operator= | ( | const SbMat3 & | m | ) |
Sets value from 3x3 array of elements.
|
inline |
Set the matrix from an SbRotation.
Definition at line 1344 of file SbMatrix.h.
|
inline |
Make it look like a usual matrix (so you can do m[2][2]).
Definition at line 1318 of file SbMatrix.h.
|
inline |
Make it look like a usual matrix (so you can do m[2][2]).
Definition at line 1323 of file SbMatrix.h.
void SbMatrix3::print | ( | FILE * | fp | ) | const |
Prints a formatted version of the matrix to the given file pointer.
void SbMatrix3::setRotate | ( | const SbRotation & | q | ) |
Sets matrix to rotate by given rotation.
void SbMatrix3::setScale | ( | const SbVec3f & | s | ) |
Sets matrix to scale by given vector.
void SbMatrix3::setScale | ( | float | s | ) |
Sets matrix to scale by given uniform factor.
|
inline |
Sets value from a 9 value float array.
Definition at line 1215 of file SbMatrix.h.
void SbMatrix3::setValue | ( | const SbMat3 & | m | ) |
Sets value from 3x3 array of elements.
Inequality comparison operator.
Definition at line 1370 of file SbMatrix.h.
Multiplies two matrices, returning a matrix result.
Multiplies matrices by vector, returning a vector result.
Return v*m.