#include <PS2Math.h>
Public Member Functions | |
Matrix44 (bool Identity=false) | |
Constructor 1, if Identity is true then an identity 4x4 matrix is created. | |
Matrix44 (float Angle, MainAxis Axis) | |
To build directly a RotationMatrix. | |
void | Reset () |
Reset function set all values of the matrix to 0.0f. | |
Matrix44 & | AddRotation (float Angle, MainAxis Axis) |
Add a rotation to the current matrix. | |
Matrix44 & | ViewLH (const Vector4 &Eye, const Vector4 &At, const Vector4 &Up) |
Set this instance of the matrix to a Left Handed View Matrix. | |
Matrix44 & | ViewRH (const Vector4 &Eye, const Vector4 &At, const Vector4 &Up) |
Set this instance of the matrix to a Rigth Handed View Matrix. | |
Matrix44 & | PerspectiveLH (float Width, float Height, float zNear, float zFar) |
Set this instance of the matrix to a Left Handed Projection Matrix. | |
Matrix44 & | PerspectiveRH (float Width, float Height, float zNear, float zFar) |
Set this instance of the matrix to a Rigth Handed Projection Matrix. | |
Matrix44 & | MapToViewPort (float xMin, float xMax, float yMin, float yMax, float zMin, float zMax) |
Map a projection matrix to a ViewPort, it is used to buld final projection matrix. | |
float *const | operator[] (int Index) |
Operator [] used to access row as array of float. | |
const float * | operator[] (int Index) const |
Operator [] used to access row as array of float. (Const version). | |
Rotations member functions. | |
These functions are used to set or add a particular kind of rotation to the instance of the matrix. | |
Matrix44 & | SetRotationX (float Angle) |
Set a rotation of desidered angle about X axis. | |
Matrix44 & | SetRotationY (float Angle) |
Set a rotation of desidered angle about Y axis. | |
Matrix44 & | SetRotationZ (float Angle) |
Set a rotation of desidered angle about Z axis. | |
Matrix44 & | AddRotationX (float Angle) |
Add a rotation of desidered angle about X axis. | |
Matrix44 & | AddRotationY (float Angle) |
Add a rotation of desidered angle about Y axis. | |
Matrix44 & | AddRotationZ (float Angle) |
Add a rotation of desidered angle about Z axis. | |
Public Attributes | |
float | elem [4][4] |
Array that contains the element of the matrix. |
Definition at line 40 of file PS2Math.h.
|
Build a Matrix44 Object, an optional bool parameter is used to requests an identity matrix. If you want to set a View or Projection matrix you do not need to have an identity matrix so some time can be saved because elements of the matrix are not to be initialized.
Definition at line 24 of file Matrix44.cpp. |
|
Sometimes there is the need to obtain immediatly a matrix that represent a rotation transform, this constructor is used to build directly a rotation matrix about one of the main three axixs.
Definition at line 43 of file Matrix44.cpp. |
|
This member function is used to add a rotation about one of main axis to current transform expressed by the matrix. Code is simple, a temporary Matrix44 representing desidered rotation is created and then it is composed with current matrix. Remember that since column vector notation is used, to add a transformation to an existing matrix, it has to be premultiplicated by new transform. For this reason the Matrix44MultiplyR is used.
Definition at line 180 of file Matrix44.cpp. |
|
This member function is used to add a rotation about X axis to current transform expressed by the matrix. Code is simple, a temporary Matrix44 representing desidered rotation is created and then it is composed with current matrix. Remember that since column vector notation is used, to add a transformation to an existing matrix, it has to be premultiplicated by new transform. For this reason the Matrix44MultiplyR is used.
Definition at line 128 of file Matrix44.cpp. |
|
This member function is used to add a rotation about Y axis to current transform expressed by the matrix. Code is simple, a temporary Matrix44 representing desidered rotation is created and then it is composed with current matrix. Remember that since column vector notation is used, to add a transformation to an existing matrix, it has to be premultiplicated by new transform. For this reason the Matrix44MultiplyR is used.
Definition at line 145 of file Matrix44.cpp. |
|
This member function is used to add a rotation about Z axis to current transform expressed by the matrix. Code is simple, a temporary Matrix44 representing desidered rotation is created and then it is composed with current matrix. Remember that since column vector notation is used, to add a transformation to an existing matrix, it has to be premultiplicated by new transform. For this reason the Matrix44MultiplyR is used.
Definition at line 162 of file Matrix44.cpp. |
|
This method does a simple mapping to a given viewport. To know why the MapMatrix has this particular form, consult Appendix A of the tutorial in witch there is a full explanation on how to build a Projection Matrix. Definition at line 302 of file Matrix44.cpp. |
|
Build a perspective matrix left handed Consult appendix A of the tutorial to have furter details on how this matrix is build.
Definition at line 256 of file Matrix44.cpp. |
|
Buld a Perspective Projection Matrix Rigth handed with the near plane of Viewing Frustum centered on direction of view. To have a complete explanation on how to build such a matrix, consult appendix A of the tutorial.
Definition at line 280 of file Matrix44.cpp. |
|
If this member function is called then the matrix become a Rotation matrix about X axis, all preceeding content is deleted, and there is no prerequisites about values contained before this function is called, because element of the matrix are resetted as the first operation.
Definition at line 70 of file Matrix44.cpp. |
|
If this member function is called then the matrix become a Rotation matrix about Y axis, all preceeding content is deleted, and there is no prerequisites about values contained before this function is called, because element of the matrix are resetted as the first operation.
Definition at line 89 of file Matrix44.cpp. |
|
If this member function is called then the matrix become a Rotation matrix about Z axis, all preceeding content is deleted, and there is no prerequisites about values contained before this function is called, because element of the matrix are resetted as the first operation.
Definition at line 108 of file Matrix44.cpp. |
|
Build a Left Handed View Matrix used to translate geomety from World Coordinate System to Camera (View) Coordinate System. The
Definition at line 207 of file Matrix44.cpp. |