A matrix math class for 4x4 matrices of floats.
This class provides access to Maya's internal matrix math library allowing matrices to be handled easily, and in a manner compatible with internal Maya data structures.
animInfoCmd.cpp, anisotropicShader.cpp, cellShader.cpp, cgfxShaderNode.cpp, D3DResourceManager.cpp, flameShader.cpp, footPrintNode.cpp, hwColorPerVertexShader.cpp, hwPhongShader.cpp, lavaShader.cpp, noiseShader.cpp, sampleCmd.cpp, sampleParticles.cpp, slopeShaderNode.cpp, and solidCheckerShader.cpp.
#include <MFloatMatrix.h>
Public Member Functions |
|
MFloatMatrix () | |
The default contstructor. |
|
MFloatMatrix (const MFloatMatrix &src) | |
The copy Constructor. |
|
MFloatMatrix (const double m[4][4]) | |
Initialize the instance with a 4x4 matrix of
doubles. |
|
MFloatMatrix (const float m[4][4]) | |
Initialize the instance with a 4x4 matrix of
floats. |
|
~MFloatMatrix () | |
The class destructor. |
|
MFloatMatrix & | operator= (const MFloatMatrix &) |
The assignment operator. |
|
float | operator() (unsigned int row, unsigned int col) const |
Index operator. |
|
const float * | operator[] (unsigned int row) const |
Index operator. |
|
MStatus | get (double dest[4][4]) const |
Fill a 4x4 matrix of doubles with the
elements from the instance. |
|
MStatus | get (float dest[4][4]) const |
Fill a 4x4 matrix of floats with the
elements from the instance. |
|
MFloatMatrix | transpose () const |
Compute and return the transpose of this
instance. |
|
MFloatMatrix & | setToIdentity () |
Set this instance to the 4x4 identity
matrix. |
|
MFloatMatrix & | setToProduct (const MFloatMatrix &left, const MFloatMatrix &right) |
Set this instance to the inner product of
the two argument matrices. |
|
MFloatMatrix & | operator+= (const MFloatMatrix &right) |
The in place matrix addition operator.
|
|
MFloatMatrix | operator+ (const MFloatMatrix &right) const |
The matrix addition operator. |
|
MFloatMatrix & | operator-= (const MFloatMatrix &right) |
The in place matrix subtraction operator.
|
|
MFloatMatrix | operator- (const MFloatMatrix &right) const |
The matrix subtraction operator. |
|
MFloatMatrix & | operator*= (const MFloatMatrix &right) |
The in place matrix multiplication operator.
|
|
MFloatMatrix | operator* (const MFloatMatrix &right) const |
The matrix multiplication operator. |
|
MFloatMatrix & | operator*= (float) |
The in place matrix multiply by a scalar
operator. |
|
MFloatMatrix | operator* (float) const |
The matrix multiply by a scalar operator.
|
|
bool | operator== (const MFloatMatrix &other) const |
The matrix equality operator. |
|
bool | operator!= (const MFloatMatrix &other) const |
The matrix inequality operator. |
|
MFloatMatrix | inverse () const |
Compute and return the inverse of this
instance. |
|
MFloatMatrix | adjoint () const |
Compute and return the adjoint of this
instance. |
|
MFloatMatrix | homogenize () const |
Compute and return a homogenized version of
this instance. |
|
float | det4x4 () const |
Compute and return the determinant of this
instance. |
|
float | det3x3 () const |
Compute and return the determinant of the
upper left 3x3 submatrix of this instance. |
|
bool | isEquivalent (const MFloatMatrix &other, float tolerance=MFloatMatrix_kTol) const |
Determine if the given matrix is equivalent
to this instance within the specified tolerance. |
|
float & | operator() (unsigned int row, unsigned int col) |
NO SCRIPT SUPPORT. |
|
float * | operator[] (unsigned int row) |
NO SCRIPT SUPPORT. |
|
Static Public Member Functions |
|
static const char * | className () |
Returns the name of this class. |
|
Public Attributes |
|
float | matrix [4][4] |
the matrix data |
|
Friends |
|
OPENMAYA_EXPORT MFloatMatrix | operator* (float, const MFloatMatrix &right) |
NO SCRIPT SUPPORT. |
|
OPENMAYA_EXPORT std::ostream & | operator<< (std::ostream &os, const MFloatMatrix &m) |
NO SCRIPT SUPPORT. |
MFloatMatrix | ( | ) |
The default contstructor.
The instance is initialized to the 4x4 identity matrix.
MFloatMatrix | ( | const MFloatMatrix & | src | ) |
The copy Constructor.
[in] | src | the instance to copy data from |
MFloatMatrix | ( | const double | src_matrix[4][4] | ) |
Initialize the instance with a 4x4 matrix of doubles.
[in] | src_matrix | a 4x4 matrix of doubles |
MFloatMatrix | ( | const float | src_matrix[4][4] | ) |
Initialize the instance with a 4x4 matrix of floats.
[in] | src_matrix | a 4x4 matrix of floats |
MFloatMatrix & operator= | ( | const MFloatMatrix & | src | ) |
The assignment operator.
[in] | src | The matrix to copy from. |
float operator() | ( | unsigned int | row, |
unsigned int | col | ||
) | const [inline] |
Index operator.
Given row and column indices, it will return the value at the specified location in the matrix.
[in] | row | index of the row to access |
[in] | col | index of the column to access |
const float * operator[] | ( | unsigned int | row | ) | const [inline] |
Index operator.
Returns an entire row of the matrix as an array of floats.
[in] | row | index of the row to access |
MStatus get | ( | double | dest[4][4] | ) | const |
Fill a 4x4 matrix of doubles with the elements from the instance.
[out] | dest | the 4x4 matrix of doubles to populate |
MStatus get | ( | float | dest[4][4] | ) | const |
Fill a 4x4 matrix of floats with the elements from the instance.
[out] | dest | The 4x4 matrix of floats to populate. |
MFloatMatrix transpose | ( | ) | const |
Compute and return the transpose of this instance.
MFloatMatrix & setToIdentity | ( | ) |
Set this instance to the 4x4 identity matrix.
MFloatMatrix & setToProduct | ( | const MFloatMatrix & | left, |
const MFloatMatrix & | right | ||
) |
Set this instance to the inner product of the two argument matrices.
[in] | left | The left hand matrix for the operation |
[in] | right | The right hand matrix for the operation |
MFloatMatrix & operator+= | ( | const MFloatMatrix & | right | ) |
The in place matrix addition operator.
[in] | right | Matrix to add. |
MFloatMatrix operator+ | ( | const MFloatMatrix & | right | ) | const |
The matrix addition operator.
[in] | right | Matrix to add. |
MFloatMatrix & operator-= | ( | const MFloatMatrix & | right | ) |
The in place matrix subtraction operator.
[in] | right | Matrix to subtract. |
MFloatMatrix operator- | ( | const MFloatMatrix & | right | ) | const |
The matrix subtraction operator.
[in] | right | Matrix to subtract. |
MFloatMatrix & operator*= | ( | const MFloatMatrix & | right | ) |
The in place matrix multiplication operator.
[in] | right | Matrix to multiply. |
MFloatMatrix operator* | ( | const MFloatMatrix & | right | ) | const |
The matrix multiplication operator.
[in] | right | Matrix to multiply. |
MFloatMatrix & operator*= | ( | float | factor | ) |
The in place matrix multiply by a scalar operator.
[in] | factor | scaling factor. |
MFloatMatrix operator* | ( | float | factor | ) | const |
The matrix multiply by a scalar operator.
[in] | factor | Scaling factor. |
bool operator== | ( | const MFloatMatrix & | other | ) | const |
The matrix equality operator.
[in] | other | Matrix to test with. |
bool operator!= | ( | const MFloatMatrix & | other | ) | const |
The matrix inequality operator.
[in] | other | Matrix to test with. |
MFloatMatrix inverse | ( | ) | const |
Compute and return the inverse of this instance.
MFloatMatrix adjoint | ( | ) | const |
Compute and return the adjoint of this instance.
MFloatMatrix homogenize | ( | ) | const |
Compute and return a homogenized version of this instance.
float det4x4 | ( | ) | const |
Compute and return the determinant of this instance.
float det3x3 | ( | ) | const |
Compute and return the determinant of the upper left 3x3 submatrix of this instance.
bool isEquivalent | ( | const MFloatMatrix & | other, |
float | tolerance =
MFloatMatrix_kTol |
||
) | const |
Determine if the given matrix is equivalent to this instance within the specified tolerance.
[in] | other | the matrix to compare to |
[in] | tolerance | the tolerance to use during the comparison |
float & operator() | ( | unsigned int | row, |
unsigned int | col | ||
) | [inline] |
NO SCRIPT SUPPORT.
Index operator.
Given row and column indices, it will return the value at the specified location in the matrix.
[in] | row | index of the row to access |
[in] | col | index of the column to access |
float * operator[] | ( | unsigned int | row | ) | [inline] |
NO SCRIPT SUPPORT.
Index operator.
Returns an entire row of the matrix as an array of floats.
[in] | row | index of the row to access |
const char * className | ( | ) | [static] |
OPENMAYA_EXPORT MFloatMatrix operator* | ( | float | factor, |
const MFloatMatrix & | right | ||
) | [friend] |
NO SCRIPT SUPPORT.
[in] | factor | Scaling factor. |
[in] | right | Matrix to multiply. |
OPENMAYA_EXPORT std::ostream& operator<< | ( | std::ostream & | os, |
const MFloatMatrix & | m | ||
) | [friend] |
NO SCRIPT SUPPORT.
The format used is [[r11, r12, r13, r14] [r21, r22, r23, r24] [r31, r32, r33, r34] [r41, r42, r43, r44]].
[in] | os | the ostream to print to |
[in] | m | the MFloatMatrix whose value is to be printed |