#include <matrix44.h>
Accessors | |
T | getTrace () const throw () |
Compute the trace. | |
void | setIdentity () throw () |
Set to an identity matrix. | |
void | set (const T &t=(T) 1) throw () |
Set the diagonal elements to the given value. | |
void | transpose () throw () |
Mirror the Matrix at the diagonal. | |
TVector4< T > | getRow (Position row) const throw (Exception::IndexOverflow) |
Get a row of the matrix. | |
TVector4< T > | getColumn (Position col) const throw (Exception::IndexOverflow) |
Get a column of the matrix. | |
void | setRow (Position row, const TVector4< T > &row_value) throw (Exception::IndexOverflow) |
Set a row of the matrix. | |
void | setColumn (Position col, const TVector4< T > &col_value) throw (Exception::IndexOverflow) |
Set a column of the matrix. | |
bool | isEqual (const TMatrix4x4 &m) const throw () |
Test whether two matrices are equal. | |
TVector4< T > | getDiagonal () const throw () |
Get the diagonal of the matrix. | |
T & | operator() (Position row, Position col) throw (Exception::IndexOverflow) |
Access operator of a cell. | |
const T & | operator() (Position row, Position col) const throw (Exception::IndexOverflow) |
Constant access operator of a cell. | |
const T & | operator[] (Position position) const throw (Exception::IndexOverflow) |
Constant random access operator. | |
T & | operator[] (Position position) throw (Exception::IndexOverflow) |
Mutable random access operator. | |
TMatrix4x4 | operator+ () const throw () |
Positive sign. | |
TMatrix4x4 | operator- () const throw () |
Negative sign. | |
TMatrix4x4 | operator+ (const TMatrix4x4 &m) const throw () |
Addition operator. | |
TMatrix4x4 & | operator+= (const TMatrix4x4 &m) throw () |
Addition operator. | |
TMatrix4x4 | operator- (const TMatrix4x4 &m) const throw () |
Subtraction operator. | |
TMatrix4x4 & | operator-= (const TMatrix4x4 &m) throw () |
Subtraction operator. | |
TMatrix4x4 | operator * (const T &scalar) const throw () |
Multiply by a scalar. | |
TMatrix4x4 & | operator *= (const T &scalar) throw () |
Multiply by a scalar. | |
TMatrix4x4 | operator/ (const T &scalar) const throw (Exception::DivisionByZero) |
Divide by a scalar. | |
TMatrix4x4 & | operator/= (const T &scalar) throw (Exception::DivisionByZero) |
Divide by a scalar. | |
TMatrix4x4 | operator * (const TMatrix4x4 &m) const throw () |
Multiply two matrices. | |
TMatrix4x4 & | operator *= (const TMatrix4x4 &m) throw () |
Multiply two matrices. | |
TVector4< T > | operator * (const TVector4< T > &vector) const throw () |
Multiplication by an instance of type TVector4 . | |
bool | invert (TMatrix4x4 &inverse) const throw () |
Invert the matrix. | |
bool | invert () throw () |
Invert the matrix. | |
T | getDeterminant () const throw () |
Compute the determinant. | |
void | translate (const T &x, const T &y, const T &z) throw () |
Translate the matrix. | |
void | translate (const TVector3< T > &v) throw () |
Translate the matrix. | |
void | setTranslation (const T &x, const T &y, const T &z) throw () |
Set the matrix to a translation matrix. | |
void | setTranslation (const TVector3< T > &v) throw () |
Set the matrix to a translation matrix. | |
void | scale (const T &x_scale, const T &y_scale, const T &z_scale) throw () |
Scale the matrix. | |
void | scale (const T &scale) throw () |
Scale the matrix. | |
void | scale (const TVector3< T > &v) throw () |
Scale the matrix. | |
void | setScale (const T &x_scale, const T &y_scale, const T &z_scale) throw () |
Set the matrix to a scalation matrix. | |
void | setScale (const T &scale) throw () |
Set the matrix to a scalation matrix. | |
void | setScale (const TVector3< T > &v) throw () |
Set the matrix to a scalation matrix. | |
void | rotateX (const TAngle< T > &phi) throw () |
Rotate the matrix around the x axis. | |
void | setRotationX (const TAngle< T > &phi) throw () |
Set the matrix to a x rotation matrix. | |
void | rotateY (const TAngle< T > &phi) throw () |
Rotate the matrix around the y axis. | |
void | setRotationY (const TAngle< T > &phi) throw () |
Set the matrix to a y rotation matrix. | |
void | rotateZ (const TAngle< T > &phi) throw () |
Rotate the matrix around the z axis. | |
void | setRotationZ (const TAngle< T > &phi) throw () |
Set the matrix to a z rotation matrix. | |
void | rotate (const TAngle< T > &phi, const T &axis_x, const T &axis_y, const T &axis_z) throw () |
Rotate the matrix around a given axis. | |
void | rotate (const TAngle< T > &phi, const TVector3< T > &axis) throw () |
Rotate the matrix around a given axis. | |
void | rotate (const TAngle< T > &phi, const TVector4< T > &axis) throw () |
Rotate the matrix around a given axis. | |
void | setRotation (const TAngle< T > &phi, const T &axis_x, const T &axis_y, const T &axis_z) throw () |
Set the matrix to a rotation matrix. | |
void | setRotation (const TAngle< T > &phi, const TVector3< T > &axis) throw () |
Set the matrix to a rotation matrix. | |
void | setRotation (const TAngle< T > &phi, const TVector4< T > &axis) throw () |
Set the matrix to a rotation matrix. | |
const TMatrix4x4 & | getZero () throw () |
Create a zero matrix. | |
const TMatrix4x4 & | getIdentity () throw () |
Create an identity matrix. | |
Public Member Functions | |
Constructors and Destructors | |
TMatrix4x4 () throw () | |
Default constructor. | |
TMatrix4x4 (const T *ptr) throw (Exception::NullPointer) | |
Array constructor. | |
TMatrix4x4 (const T ptr[4][4]) throw (Exception::NullPointer) | |
Array constructor. | |
TMatrix4x4 (const TMatrix4x4 &m) throw () | |
Copy constructor. | |
TMatrix4x4 (const TVector4< T > &col1, const TVector4< T > &col2, const TVector4< T > &col3, const TVector4< T > &col4) throw () | |
Detailed constructor. | |
TMatrix4x4 (const T &m11, const T &m12, const T &m13, const T &m14, const T &m21, const T &m22, const T &m23, const T &m24, const T &m31, const T &m32, const T &m33, const T &m34, const T &m41, const T &m42, const T &m43, const T &m44) throw () | |
Detailed constructor. | |
virtual | ~TMatrix4x4 () throw () |
Destructor. | |
virtual void | clear () throw () |
Clear method. | |
Assignment | |
void | set (const T *ptr) throw (Exception::NullPointer) |
Assign from array-ptr. | |
void | set (const T ptr[4][4]) throw (Exception::NullPointer) |
Assign from the first sixteen elements. | |
void | set (const TMatrix4x4 &m) throw () |
Assign from another instance. | |
void | set (const TVector4< T > &col1, const TVector4< T > &col2, const TVector4< T > &col3, const TVector4< T > &col4) throw () |
Assign from four TVector4. | |
void | set (const T &m11, const T &m12, const T &m13, const T &m14, const T &m21, const T &m22, const T &m23, const T &m24, const T &m31, const T &m32, const T &m33, const T &m34, const T &m41, const T &m42, const T &m43, const T &m44) throw () |
Assign from sixteen values of type T. | |
TMatrix4x4 & | operator= (const T *ptr) throw (Exception::NullPointer) |
Assignment operator. | |
TMatrix4x4 & | operator= (const T ptr[4][4]) throw (Exception::NullPointer) |
Assignment operator. | |
TMatrix4x4 & | operator= (const TMatrix4x4 &m) throw () |
Assignment operator. | |
void | get (T *ptr) const throw (Exception::NullPointer) |
Assign to an array. | |
void | get (T ptr[4][4]) const throw (Exception::NullPointer) |
Assign to an array. | |
void | get (TMatrix4x4 &m) const throw () |
Assign to another instance. | |
void | get (TVector4< T > &col1, TVector4< T > &col2, TVector4< T > &col3, TVector4< T > &col4) const throw () |
Assign to four variables of type TVector4 . | |
void | get (T &m11, T &m12, T &m13, T &m14, T &m21, T &m22, T &m23, T &m24, T &m31, T &m32, T &m33, T &m34, T &m41, T &m42, T &m43, T &m44) const throw () |
Assign to sixteen variables of type T . | |
void | swap (TMatrix4x4 &m) throw () |
Swap the contents of two instances of TMatrix4x4. | |
Predicates | |
bool | operator== (const TMatrix4x4 &m) const throw () |
Equality operator. | |
bool | operator!= (const TMatrix4x4 &m) const throw () |
Inequality operator. | |
bool | isIdentity () const throw () |
Test whether this matrix is an identity matrix. | |
bool | isRegular () const throw () |
Test whether this matrix is regular. | |
bool | isSingular () const throw () |
Test whether this matrix is singular. | |
bool | isSymmetric () const throw () |
Test whether this matrix is symmetric. | |
bool | isLowerTriangular () const throw () |
Test whether the lower triangular is zero. | |
bool | isUpperTriangular () const throw () |
Test whether the upper triangular is zero. | |
bool | isDiagonal () const throw () |
Test whether all cells but the diagonal are zero. | |
Debugging and Diagnostics | |
bool | isValid () const throw () |
Test whether instance is valid. | |
void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
Internal state dump. | |
Public Attributes | |
Attributes | |
T | m11 |
1st cell in the 1st row | |
T | m12 |
2nd cell in the 1st row | |
T | m13 |
3rd cell in the 1st row | |
T | m14 |
4th cell in the 1st row | |
T | m21 |
1st cell in the 2nd row | |
T | m22 |
2nd cell in the 2nd row | |
T | m23 |
3rd cell in the 2nd row | |
T | m24 |
4th cell in the 2nd row | |
T | m31 |
1st cell in the 3rd row | |
T | m32 |
2nd cell in the 3rd row | |
T | m33 |
3rd cell in the 3rd row | |
T | m34 |
4th cell in the 3rd row | |
T | m41 |
1st cell in the 4th row | |
T | m42 |
2nd cell in the 4th row | |
T | m43 |
3rd cell in the 4th row | |
T | m44 |
4th cell in the 4th row |
|
Default constructor.
This method creates a new TMatrix4x4 object. The components are initialized to |
|
Array constructor.
This constructor creates a TMatrix4x4 object from the first sixteen elements pointed to by
|
|
Array constructor.
This constructor creates a TMatrix4x4 object from the sixteen elements in the array assigned by
|
|
Copy constructor. Create a new TMatrix4x4 object from another.
|
|
Detailed constructor. Create a new TMatrix4x4 object from four TVector4.
|
|
Detailed constructor.
Create a new TMatrix4x4 object from sixteen
|
|
Destructor. Destructs the TMatrix4x4 object. As there are no dynamic data structures, nothing happens. |
|
Clear method. The values are set to 0. |
|
Internal state dump. Dump the current internal state of {*this} to the output ostream s with dumping depth depth .
|
|
Assign to sixteen variables of type
|
|
Assign to four variables of type TVector4 .
|
|
Assign to another instance. Assigns the components to another TMatrix4x4.
|
|
Assign to an array.
Assigns the components to an array of sixteen values of type
|
|
Assign to an array.
Assigns the components to a pointer of an array of sixteen values of type
|
|
Get a column of the matrix.
|
|
Compute the determinant.
|
|
Get the diagonal of the matrix.
|
|
Create an identity matrix. A new matrix object is created and all elements but the diagonal are set to zero. The diagonal elements are set to 1. |
|
Get a row of the matrix.
|
|
Compute the trace. Get the sum of the diagonal elements (m11 + m22 + m33 + m44).
|
|
Create a zero matrix. A new matrix object is created and all elements set to 0. |
|
Invert the matrix. Tests if the matrix can be inverted. If this is possible, the result is stored in the matrix.
|
|
Invert the matrix. Tests if the matrix can be inverted. If possible, the result will be inverted and the result returned in inverse .
|
|
Test whether all cells but the diagonal are zero.
|
|
Test whether two matrices are equal. Two matrices are considered equal, if Maths::isEqual returns true for each pair of corresponding elements.
|
|
Test whether this matrix is an identity matrix. (I.e. m11, m22, m33, m44 = 1 and the other cells have the value 0)
|
|
Test whether the lower triangular is zero.
|
|
Test whether this matrix is regular.
|
|
Test whether this matrix is singular.
|
|
Test whether this matrix is symmetric. (m12 = m21, m31 = m13, ...)
|
|
Test whether the upper triangular is zero.
|
|
Test whether instance is valid. Always returns true.
|
|
Multiplication by an instance of type TVector4 .
|
|
Multiply two matrices.
|
|
Multiply by a scalar. Operator for multiplying every cell value with a scalar value.
|
|
Multiply two matrices.
|
|
Multiply by a scalar. Operator for multiplying every cell value with a scalar value.
|
|
Inequality operator. Instead of this operator isEqual should be used. isEqual
|
|
Constant access operator of a cell.
|
|
Access operator of a cell.
|
|
Addition operator. Adds another matrix to this matrix and return the result.
|
|
Positive sign.
|
|
Addition operator. Adds another matrix to this matrix.
|
|
Subtraction operator. Subtract another matrix from this matrix and return the result
|
|
Negative sign.
|
|
Subtraction operator. Subtract another matrix from this matrix.
|
|
Divide by a scalar. Operator for dividing every cell value by a scalar value.
|
|
Divide by a scalar. Operator for dividing every cell value by a scalar value.
|
|
Assignment operator. Assign the components from another instance of TMatrix4x4.
|
|
Assignment operator.
Assign the components from the first 16 values assigned by
|
|
Assignment operator.
Assign the components from the first 16 values assigned by
|
|
Equality operator. Instead of this operator isEqual should be used. isEqual
|
|
Mutable random access operator.
|
|
Constant random access operator.
Access single elements of the matrix. |
|
Rotate the matrix around a given axis.
|
|
Rotate the matrix around a given axis.
|
|
Rotate the matrix around a given axis.
|
|
Rotate the matrix around the x axis.
|
|
Rotate the matrix around the y axis.
|
|
Rotate the matrix around the z axis.
|
|
Scale the matrix.
|
|
Scale the matrix.
|
|
Scale the matrix.
|
|
Set the diagonal elements to the given value. All other elements are set to 0.
|
|
Assign from sixteen values of type T.
|
|
Assign from four TVector4.
|
|
Assign from another instance.
|
|
Assign from the first sixteen elements.
pointed to by the array assigned by
|
|
Assign from array-ptr.
Assign from the first sixteen elements pointed to by
|
|
Set a column of the matrix.
|
|
Set to an identity matrix. m11, m22, m33, m44 = 1; the other cells have the value 0; |
|
Set the matrix to a rotation matrix.
|
|
Set the matrix to a rotation matrix.
|
|
Set the matrix to a rotation matrix.
|
|
Set the matrix to a x rotation matrix.
|
|
Set the matrix to a y rotation matrix.
|
|
Set the matrix to a z rotation matrix.
|
|
Set a row of the matrix.
|
|
Set the matrix to a scalation matrix.
|
|
Set the matrix to a scalation matrix.
|
|
Set the matrix to a scalation matrix.
|
|
Set the matrix to a translation matrix.
|
|
Set the matrix to a translation matrix.
|
|
Swap the contents of two instances of TMatrix4x4.
|
|
Translate the matrix.
|
|
Translate the matrix.
|
|
Mirror the Matrix at the diagonal. All values are swaped by the mirrored value. (I.e. m12 <=> m21 , m13 <=> m31 , ...) |