Level H Engine
|
Contains the Mat4 structure with functions and overloaded operators. This is row major. More...
#include <Mat4.h>
Public Member Functions | |
Mat4 () | |
Constructs the Mat4 setting the values of the matrix to 0. More... | |
Mat4 (Vec4 v1, Vec4 v2, Vec4 v3, Vec4 v4) | |
Constructs the Mat4 setting the values to the input vectors. More... | |
Mat4 * | operator+= (Mat4 mIn) |
Overloads the += operator. More... | |
Mat4 * | operator-= (Mat4 mIn) |
Overloads the -= operator. More... | |
void | setAsIdentityMatrix () |
Sets the values of the matrix to that of a identity matrix. More... | |
void | setAsPerspectiveMatrix (float fovy, float aspect, float n, float f) |
Sets the values of the matrix to that of a Perspective matrix. More... | |
void | setAsOrthogonalProjectionMatrix (float w, float h, float n, float f) |
Sets the values of the matrix to that of a Orthogonal Projection matrix. More... | |
void | setPos (Vec3 pv) |
Sets the position of the matrix using the input vector. More... | |
void | setPos (Mat4 &matrix, Vec3 pos) |
void | scale (Mat4 &matrix, float sv) |
Scales the matrix using the input vector. More... | |
void | scale (Mat4 &matrix, Vec3 &sv) |
Scales the matrix using the input vector. More... | |
void | translate (Mat4 &matrix, Vec3 tv) |
Translates the matrix using the input vector. More... | |
void | rotate (Mat4 &matrix, Vec3 angle) |
Rotate the matrix using the angle of rotation along the axis. More... | |
void | rotateAlongX (Mat4 &matrix, float angle) |
Rotate the matrix using the angle of rotation along the x axis. More... | |
void | rotateAlongY (Mat4 &matrix, float angle) |
Rotate the matrix using the angle of rotation along the y axis. More... | |
void | rotateAlongZ (Mat4 &matrix, float angle) |
Rotate the matrix using the angle of rotation along the z axis. More... | |
void | rotatePointAroundXAxis (Mat4 &matrix, Vec3 axisPoint, float angle) |
Rotate the matrix around a point using the angle of rotation along the x axis. More... | |
void | rotatePointAroundYAxis (Mat4 &matrix, Vec3 axisPoint, float angle) |
Rotate the matrix around a point using the angle of rotation along the y axis. More... | |
void | rotatePointAroundZAxis (Mat4 &matrix, Vec3 axisPoint, float angle) |
Rotate the matrix around a point using the angle of rotation along the z axis. More... | |
void | getInverse (Mat4 &matrix) |
A function to get the inverse of a matrix. More... | |
Vec3 | getPos () |
Gets the position of the matrix. More... | |
float * | getMatrixArray () |
A function to get a pointer to the first index of the array. More... | |
Public Attributes | |
float | m [16] |
Contains the Mat4 structure with functions and overloaded operators. This is row major.
|
inline |
Constructs the Mat4 setting the values of the matrix to 0.
Constructs the Mat4 setting the values to the input vectors.
v1 | The first inputed vector. |
v2 | The second inputed vector. |
v3 | The third inputed vector. |
v4 | The forth inputed vector. |
void Mat4::getInverse | ( | Mat4 & | matrix | ) |
A function to get the inverse of a matrix.
matrix | A pointer to the matrix to invert. |
|
inline |
A function to get a pointer to the first index of the array.
|
inline |
Gets the position of the matrix.
Rotate the matrix using the angle of rotation along the axis.
matrix | A pointer to the matrix to rotate. |
angle | The angles to rotate the matrix by, must be a Radian. |
void Mat4::rotateAlongX | ( | Mat4 & | matrix, |
float | angle | ||
) |
Rotate the matrix using the angle of rotation along the x axis.
matrix | A pointer to the matrix to rotate. |
angle | The angle to rotate the matrix by, must be a Radian. |
void Mat4::rotateAlongY | ( | Mat4 & | matrix, |
float | angle | ||
) |
Rotate the matrix using the angle of rotation along the y axis.
matrix | A pointer to the matrix to rotate. |
angle | The angle to rotate the matrix by, must be a Radian. |
void Mat4::rotateAlongZ | ( | Mat4 & | matrix, |
float | angle | ||
) |
Rotate the matrix using the angle of rotation along the z axis.
matrix | A pointer to the matrix to rotate. |
angle | The angle to rotate the matrix by, must be a Radian. |
Rotate the matrix around a point using the angle of rotation along the x axis.
matrix | A pointer to the matrix to rotate. |
axisPoint | The point to rtate around. |
angle | The angle to rotate the matrix by, must be a Radian. |
Rotate the matrix around a point using the angle of rotation along the y axis.
matrix | A pointer to the matrix to rotate. |
axisPoint | The point to rtate around. |
angle | The angle to rotate the matrix by, must be a Radian. |
Rotate the matrix around a point using the angle of rotation along the z axis.
matrix | A pointer to the matrix to rotate. |
axisPoint | The point to rtate around. |
angle | The angle to rotate the matrix by, must be a Radian. |
void Mat4::scale | ( | Mat4 & | matrix, |
float | sv | ||
) |
Scales the matrix using the input vector.
matrix | A pointer to the matrix to scale. |
sV | The scale vector vec3 to scale the matrix by. |
Scales the matrix using the input vector.
matrix | A pointer to the matrix to scale. |
sV | The scale vector vec3 to scale the matrix by. |
|
inline |
Sets the values of the matrix to that of a identity matrix.
|
inline |
Sets the values of the matrix to that of a Orthogonal Projection matrix.
w | The width of the area to view. |
h | The height of the area to view. |
f | The z plane which is the furthest the view can see. |
n | The z plane which is the closest the view can see. |
|
inline |
Sets the values of the matrix to that of a Perspective matrix.
fovy | The field of view on the y axis. |
a | The aspect. |
f | The z plane which is far from the camera. |
n | The z plane closer to the camera. |
|
inline |
Sets the position of the matrix using the input vector.
pv | The position vector vec3 to set the matrix position. |
Translates the matrix using the input vector.
matrix | A pointer to the matrix to rotate. |
tv | The translation vector vec3 to set the matrix position. |
float Mat4::m[16] |
matrix variables [00]x [01]y [02]z [03]w [04]x [05]y [06]z [07]w [08]x [09]y [10]z [11]w [12]x [13]y [14]z [15]w