#include <Matrix4.h>
This class is part of the Tools namespace and its target is the handling and computing of different linear transformations (e.g. transformations, rotations,etc.). For all operations including such linear transformations this class which based on homogenous coordinates should be used.
With specific initialization function such as
m00 | m01 | m02 | m03 |
m10 | m11 | m12 | m13 |
m20 | m21 | m22 | m23 |
m30 | m31 | m32 | m33 |
Public Member Functions | |
Matrix4 (void) | |
This is the standard constructor. | |
Matrix4 (double n_MatrixElements __gc[,]) | |
Constructor initialization by a specified array of matrix elements. | |
Matrix4 (Matrix4 *n_Matrix) | |
Constructor initialization by an existing Matrix4 object. | |
Vector4 * | multiply_WithPoint (Vector4 *v_Point) |
Use this function for multiply matrices with a specified Vector4 object. | |
void | multiply_WithScalar (double n_Scalar) |
Multiply the current matrix with a skalar value. | |
double | getItem (int row, int column) |
This function returns the specific matrix element. | |
double | getArray (void) __gc[ |
Get all matrix elements as two dimensional double array. | |
double void | setItem (int row, int column, double value) |
This function sets a specific matrix element by the specified value. | |
double | getOneDimArray (void) __gc[] |
Get an one dimensional array of the matrix elements. | |
Matrix4 * | getNegativeMatrix (void) |
This function returns the negative matrix of the current Matrix4 object. | |
double | calculateDeterminant (void) |
Calculates the determinant of the current matrix. | |
Matrix4 * | transpose (void) |
Returns the transpose matrix of the current matrix. | |
Static Public Member Functions | |
static Matrix4 * | CreateTranslationMatrix (Vector3 *n_Tanslation) |
Creates a newly translation matrix based on the specified translation vector. | |
static Matrix4 * | CreateRotXMatrix (double n_angle) |
Creates a newly rotaion matrix around the x-axis based on the specified angle. | |
static Matrix4 * | CreateRotYMatrix (double n_angle) |
Creates a newly rotaion matrix around the y-axis based on the specified angle. | |
static Matrix4 * | CreateRotZMatrix (double n_angle) |
Creates a newly rotaion matrix around the z-axis based on the specified angle. | |
static Matrix4 * | InvertMatrix (Matrix4 *n_Matrix) |
Calculates the inverted matrix of the specified 4x4 matrix. | |
static Matrix4 * | CreateScaleUniformMatrix (double n_ScaleFactor) |
Creates an uniform scale matrix by the specified scale parameter around the origin.. | |
static Matrix4 * | CreateScaleUniformMatrix (double n_ScaleFactor, Vector3 *n_FixedPoint) |
Creates an uniform scale matrix by the specified scale parameter around an arbitrary point. | |
static Matrix4 * | MultiplyMatices (Matrix4 *leftMatrix, Matrix4 *rightMatrix) |
This static funtion multiplies the specified 4x4 matrices. | |
static Matrix4 * | CreateReflectionAboutXMatrix (void) |
Creates a reflection matrix about the x-axis. | |
static Matrix4 * | CreateReflectionAboutYMatrix (void) |
Creates a reflection matrix about the y-axis. | |
static Matrix4 * | CreateReflectionAboutZMatrix (void) |
Creates a reflection matrix about the z-axis. | |
static Matrix4 * | CreateIdentityMatrix (void) |
Creates an newly 4x4 identity matrix. | |
Static Public Attributes | |
static const unsigned char | ORDER = 4 |
A constant that specifies the matrix order of matices of this class type. | |
Private Attributes | |
double m_MatrixElements | __gc [,] |
The array of the necessary matrix elements. |
|
This is the standard constructor. This standard constructor initialized all matrix elements with zero. |
|
Constructor initialization by a specified array of matrix elements. This constructor initialized all matrix elements with the corresponding elements of the specified 2 dimensional array.
|
|
Constructor initialization by an existing Matrix4 object. This constructor initialized all matrix elements with the corresponfing values of the specified Matrix4 object. Please notice that the currently initialized object is not directly linked to the specified parameter by the same memory address but it has its own memory space.
|
|
Calculates the determinant of the current matrix. For the calculation of the determinant the ordinary mathematical method will be used. This method is based on reducing the 4x4 matrix to a 3x3 matrix which determinant value can be easily calculated.
|
|
Creates an newly 4x4 identity matrix.
|
|
Creates a reflection matrix about the x-axis.
|
|
Creates a reflection matrix about the y-axis.
|
|
Creates a reflection matrix about the z-axis.
|
|
Creates a newly rotaion matrix around the x-axis based on the specified angle. Please notice that the angle parameter have to be only in radians and not in degrees.
|
|
Creates a newly rotaion matrix around the y-axis based on the specified angle. Please notice that the angle parameter have to be only in radians and not in degrees.
|
|
Creates a newly rotaion matrix around the z-axis based on the specified angle. Please notice that the angle parameter have to be only in radians and not in degrees.
|
|
Creates an uniform scale matrix by the specified scale parameter around an arbitrary point. That means that all dimensions will be scaled by the same factor around a fix point.
|
|
Creates an uniform scale matrix by the specified scale parameter around the origin.. That means that all dimensions will be scaled by the same factor.
|
|
Creates a newly translation matrix based on the specified translation vector. With the values of the Vector3 instance a standard translation matrix will be created.
|
|
Get all matrix elements as two dimensional double array.
|
|
This function returns the specific matrix element. This element is specified by the specified parameter which are the row and column count.
|
|
This function returns the negative matrix of the current Matrix4 object. This means that the current matrix is multiplied with the skalar -1 which is actually a skalar product.
|
|
Get an one dimensional array of the matrix elements.
|
|
Calculates the inverted matrix of the specified 4x4 matrix. The calculation of the inverse matrix will be realized by multiply the Cofactor matrix with the inverse determinant (just an abrasive try to explain this approximation of the inverse matrix).
|
|
Use this function for multiply matrices with a specified Vector4 object. A right-side matrix multiplication will be used so that the Vector4 object always is the right sided matrix.
|
|
Multiply the current matrix with a skalar value.
|
|
This static funtion multiplies the specified 4x4 matrices. An ordinary matrix multiplication will be used and the resultiin 3x3 matrix will be saved to a new created Matrix4 object.
|
|
This function sets a specific matrix element by the specified value. The matrix element which should be overwrited is specified by the specified parameter which are the row and column count.
|
|
Returns the transpose matrix of the current matrix. For the transpose matrix a new instance of the Matrix4 class will be created.
|
|
The array of the necessary matrix elements. All the needed 16 matrix elements are saved in a double array. |