ML Reference
|
A four by four matrix class consisting of 4 row vectors. More...
#include <mlMatrix4.h>
Public Types | |
typedef DT | ComponentType |
A typedef to "export" the type of components. | |
Public Member Functions | |
Tvec3< DT > | transformPoint (const Tvec3< DT > &sourceVec) const |
Transforms the given sourceVec and returns the result vector. | |
bool | operator< (const Tmat4< DT > &) const |
Dummy "lesser than operator" which always returns false. | |
Deprecated | |
void | TransformPoint (const Tvec3< DT > &sourceVec, Tvec3< DT > &targetVec) const |
Constructors, set and get functionality of class Tmat4. | |
Tmat4 () | |
Construct matrix from 16 zero elements. | |
Tmat4 (const DT diagValue) | |
Tmat4 (const Tvec4< DT > &row0, const Tvec4< DT > &row1, const Tvec4< DT > &row2, const Tvec4< DT > &row3) | |
Composes a matrix from the four vectors row0, row1, row2 and row3. | |
Tmat4 (const Tmat4< DT > &mat) | |
Copy constructor from the Tmat4 mat. | |
Tmat4 (const float mat[16]) | |
Constructor from 16 floating point values in an array given by mat, row by row. | |
Tmat4 (const double mat[16]) | |
Constructor from 16 double values in an array given by mat, row by row. | |
void | set (const double val) |
Set all values to val. | |
const Tmat4< DT > & | operator= (const Tmat4< DT > &m) |
Assignment of a Tmat4. | |
const Tmat4< DT > & | operator+= (const Tmat4< DT > &m) |
Incrementation by a Tmat4. | |
const Tmat4< DT > & | operator-= (const Tmat4< DT > &m) |
Decrement by a Tmat4. | |
const Tmat4< DT > & | operator*= (const DT d) |
Multiplication by an MLdouble constant d. | |
const Tmat4< DT > & | operator/= (const DT d) |
Division by an MLdouble constant d. Division by zero is not handled and must be avoided by caller. | |
const Tmat4< DT > & | apply (MLDblFuncPtr fct) |
Apply method fct to all vectors of *this and return the matrix. | |
static Tmat4< DT > | getMat (const double val) |
Return a matrix filled with values val. | |
Tmat4<DT> member functions | |
Tmat4 (const double in00, const double in01, const double in02, const double in03, const double in10, const double in11, const double in12, const double in13, const double in20, const double in21, const double in22, const double in23, const double in30, const double in31, const double in32, const double in33) | |
Initialize all matrix elements explicitly with scalars, row by row. | |
Tmat4 (const Tvec3< DT > &n0, const Tvec3< DT > &n1, const Tvec3< DT > &n3, const Tvec3< DT > &t) | |
Construct matrix from three base vectors and translation (as COLUMN vectors) | |
void | setValues (const float mat[16]) |
Copy contents of mat into *this, row by row. | |
void | getValues (float mat[16]) const |
Copy contents of *this into floating point matrix mat, row by row. | |
void | setValues (const double mat[16]) |
Copy contents of mat into *this, row by row. | |
void | getValues (double mat[16]) const |
Copy contents of *this into mat, row by row. | |
void | setScaleMatrix (const DT scale) |
Set diagonal matrix with scale on diagonal. | |
DT | det3 (DT A, DT B, DT C, DT D, DT E, DT F, DT G, DT H, DT I) const |
Determine the determinant of a 3x3 matrix given by A,B,C,D,E,F,G,H,I. | |
DT | determinantLower3 (const int col1, const int col2, const int col3) const |
Determine the (sub)determinant of columns given by col1, col2 and col3. | |
DT | det () const |
Returns the determinant of *this. | |
Tmat4< DT > | transpose () const |
Return the transposed *this. | |
Tmat4< DT > | inverse (bool *isInvertible=NULL) const |
Returns the inverse. | |
static Tmat4< DT > | getIdentity () |
Return identity matrix. |
A four by four matrix class consisting of 4 row vectors.
Definition at line 40 of file mlMatrix4.h.
typedef DT ml::Tmat4< DT >::ComponentType |
A typedef to "export" the type of components.
Reimplemented from ml::FloatingPointMatrix< Tvec4< DT >, 4 >.
Definition at line 45 of file mlMatrix4.h.
Construct matrix from 16 zero elements.
Definition at line 185 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
Definition at line 194 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
ml::Tmat4< DT >::Tmat4 | ( | const Tvec4< DT > & | row0, |
const Tvec4< DT > & | row1, | ||
const Tvec4< DT > & | row2, | ||
const Tvec4< DT > & | row3 | ||
) | [inline] |
Composes a matrix from the four vectors row0, row1, row2 and row3.
Definition at line 206 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
Copy constructor from the Tmat4 mat.
Definition at line 218 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec4< DT >, 4 >::v.
Constructor from 16 floating point values in an array given by mat, row by row.
Definition at line 230 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
Constructor from 16 double values in an array given by mat, row by row.
Definition at line 239 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
ml::Tmat4< DT >::Tmat4 | ( | const double | in00, |
const double | in01, | ||
const double | in02, | ||
const double | in03, | ||
const double | in10, | ||
const double | in11, | ||
const double | in12, | ||
const double | in13, | ||
const double | in20, | ||
const double | in21, | ||
const double | in22, | ||
const double | in23, | ||
const double | in30, | ||
const double | in31, | ||
const double | in32, | ||
const double | in33 | ||
) |
Initialize all matrix elements explicitly with scalars, row by row.
Definition at line 500 of file mlMatrix4.h.
References ML_TRACE_IN.
ml::Tmat4< DT >::Tmat4 | ( | const Tvec3< DT > & | n0, |
const Tvec3< DT > & | n1, | ||
const Tvec3< DT > & | n3, | ||
const Tvec3< DT > & | t | ||
) | [inline] |
Construct matrix from three base vectors and translation (as COLUMN vectors)
Definition at line 470 of file mlMatrix4.h.
References ML_TRACE_IN.
const Tmat4< DT > & ml::Tmat4< DT >::apply | ( | MLDblFuncPtr | fct | ) | [inline] |
Apply method fct to all vectors of *this and return the matrix.
Definition at line 339 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
DT ml::Tmat4< DT >::det | ( | ) | const [inline] |
Returns the determinant of *this.
Definition at line 629 of file mlMatrix4.h.
References ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.
DT ml::Tmat4< DT >::det3 | ( | DT | A, |
DT | B, | ||
DT | C, | ||
DT | D, | ||
DT | E, | ||
DT | F, | ||
DT | G, | ||
DT | H, | ||
DT | I | ||
) | const [inline] |
Determine the determinant of a 3x3 matrix given by A,B,C,D,E,F,G,H,I.
Definition at line 603 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
DT ml::Tmat4< DT >::determinantLower3 | ( | const int | col1, |
const int | col2, | ||
const int | col3 | ||
) | const |
Determine the (sub)determinant of columns given by col1, col2 and col3.
Definition at line 615 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
Return identity matrix.
Definition at line 663 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
Return a matrix filled with values val.
Definition at line 248 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
void ml::Tmat4< DT >::getValues | ( | float | mat[16] | ) | const |
Copy contents of *this into floating point matrix mat, row by row.
Note that range and precision of the float values may not be sufficient for double or long double matrix contents.
Definition at line 536 of file mlMatrix4.h.
References ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.
void ml::Tmat4< DT >::getValues | ( | double | mat[16] | ) | const |
Copy contents of *this into mat, row by row.
Note that range and precision of the float values may not be sufficient for long double matrix contents.
Definition at line 572 of file mlMatrix4.h.
References ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.
Returns the inverse.
Gauss-Jordan elimination with partial pivoting. If a non-NULL Boolean pointer is passed to isInvertible then true is returned in *isInvertible in the case of a successful inversion or false if the inversion is not possible (function return is the identity then). If a NULL pointer is passed as isInvertible the matrix must be invertible, otherwise errors will occur.
Definition at line 787 of file mlMatrix4.h.
References ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, and ml::MLInverseMatHelper().
Multiplication by an MLdouble constant d.
Definition at line 310 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
const Tmat4< DT > & ml::Tmat4< DT >::operator+= | ( | const Tmat4< DT > & | m | ) | [inline] |
Incrementation by a Tmat4.
Definition at line 284 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec4< DT >, 4 >::v.
const Tmat4< DT > & ml::Tmat4< DT >::operator-= | ( | const Tmat4< DT > & | m | ) | [inline] |
Decrement by a Tmat4.
Definition at line 297 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec4< DT >, 4 >::v.
Division by an MLdouble constant d. Division by zero is not handled and must be avoided by caller.
Definition at line 323 of file mlMatrix4.h.
References ML_CATCH_RETHROW, ML_TRACE_IN_TIME_CRITICAL, and ML_TRY.
Dummy "lesser than operator" which always returns false.
It is needed to make class work with some STL containers on VC7.
Definition at line 127 of file mlMatrix4.h.
Assignment of a Tmat4.
Definition at line 269 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL, and ml::FloatingPointMatrix< Tvec4< DT >, 4 >::v.
void ml::Tmat4< DT >::set | ( | const double | val | ) | [inline] |
Set all values to val.
Definition at line 260 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
Referenced by ml::TQuaternion< DT >::getAsMat4().
void ml::Tmat4< DT >::setScaleMatrix | ( | const DT | scale | ) |
Set diagonal matrix with scale on diagonal.
Definition at line 589 of file mlMatrix4.h.
References ML_TRACE_IN.
void ml::Tmat4< DT >::setValues | ( | const float | mat[16] | ) |
Copy contents of mat into *this, row by row.
Definition at line 517 of file mlMatrix4.h.
References ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.
void ml::Tmat4< DT >::setValues | ( | const double | mat[16] | ) |
Copy contents of mat into *this, row by row.
Definition at line 553 of file mlMatrix4.h.
References ML_CATCH_RETHROW, ML_TRACE_IN, and ML_TRY.
void ml::Tmat4< DT >::TransformPoint | ( | const Tvec3< DT > & | sourceVec, |
Tvec3< DT > & | targetVec | ||
) | const [inline] |
For SML compatibility.
Definition at line 109 of file mlMatrix4.h.
Tvec3<DT> ml::Tmat4< DT >::transformPoint | ( | const Tvec3< DT > & | sourceVec | ) | const [inline] |
Transforms the given sourceVec and returns the result vector.
Definition at line 99 of file mlMatrix4.h.
Return the transposed *this.
Definition at line 649 of file mlMatrix4.h.
References ML_TRACE_IN_TIME_CRITICAL.
Referenced by ml::operator*().