Row-major 4x4 Matrix.
More...
#include <Matrix.hpp>
|
| Matrix44 () |
| Constructor. Inits to identity.
|
|
| Matrix44 (float xDeg, float yDeg, float zDeg) |
| Constructor that makes an XYZ rotation matrix.
|
|
| Matrix44 (const Matrix44 &other) |
|
| Matrix44 (const float *data) |
|
Matrix44 & | operator= (const Matrix44 &other) |
|
void | Scale (float x, float y, float z) |
|
void | InitFrom (const float *data) |
|
void | MakeIdentity () |
| Resets this matrix.
|
|
void | MakeLookAt (const Vec3 &eye, const Vec3 ¢er, const Vec3 &up) |
|
void | MakeProjection (float fovDegrees, float aspect, float nearDepth, float farDepth) |
|
void | MakeProjection (float left, float right, float bottom, float top, float nearDepth, float farDepth) |
|
void | MakeRotationXYZ (float xDeg, float yDeg, float zDeg) |
|
void | Print () const |
| Prints the matrix to the console.
|
|
void | Transpose (Matrix44 &out) const |
|
void | Translate (const Vec3 &v) |
|
|
static void | Invert (const Matrix44 &matrix, Matrix44 &out) |
| Inverts a matrix. More...
|
|
static void | InverseTranspose (const float m[16], float *out) |
| Inverse transpose. More...
|
|
static void | Multiply (const Matrix44 &a, const Matrix44 &b, Matrix44 &out) |
|
static void | TransformPoint (const Vec4 &vec, const Matrix44 &mat, Vec4 *out) |
|
static void | TransformPoint (const Vec3 &vec, const Matrix44 &mat, Vec3 *out) |
|
static void | TransformDirection (const Vec3 &dir, const Matrix44 &mat, Vec3 *out) |
|
|
float | m [16] |
| Member data, row-major.
|
|
|
static const Matrix44 | identity |
| Identity matrix.
|
|
static const Matrix44 | bias |
| Converts depth coordinates from [-1,1] to [0,1]. This is needed to sample the shadow map texture.
|
|
◆ Matrix44() [1/2]
Matrix44::Matrix44 |
( |
const Matrix44 & |
other | ) |
|
Copy constructor.
- Parameters
-
◆ Matrix44() [2/2]
Matrix44::Matrix44 |
( |
const float * |
data | ) |
|
|
explicit |
- Parameters
-
data | Column-major initialization data. |
◆ InitFrom()
void Matrix44::InitFrom |
( |
const float * |
data | ) |
|
- Parameters
-
data | 4x4 column-major matrix data. |
◆ InverseTranspose()
void Matrix44::InverseTranspose |
( |
const float |
m[16], |
|
|
float * |
out |
|
) |
| |
|
static |
Inverse transpose.
- Parameters
-
m | Matrix data. |
out | Inverse transpose of m. |
- See also
- Transpose.
◆ Invert()
Inverts a matrix.
- Parameters
-
matrix | 4x4 matrix. |
out | Inverted matrix. |
◆ MakeLookAt()
void Matrix44::MakeLookAt |
( |
const Vec3 & |
eye, |
|
|
const Vec3 & |
center, |
|
|
const Vec3 & |
up |
|
) |
| |
Makes a lookat matrix.
- Parameters
-
eye | Eye (camera) position. |
center | Target position. |
up | World up vector. |
◆ MakeProjection() [1/2]
void Matrix44::MakeProjection |
( |
float |
fovDegrees, |
|
|
float |
aspect, |
|
|
float |
nearDepth, |
|
|
float |
farDepth |
|
) |
| |
Sets perspective projection (right-handed). Calculated as in gluPerspective (http://www.opengl.org/wiki/GluPerspective_code)
- Parameters
-
fovDegrees | Field-of-View in degrees. |
aspect | Aspect ratio. |
nearDepth | Near plane distance. |
farDepth | Far plane distance. |
◆ MakeProjection() [2/2]
void Matrix44::MakeProjection |
( |
float |
left, |
|
|
float |
right, |
|
|
float |
bottom, |
|
|
float |
top, |
|
|
float |
nearDepth, |
|
|
float |
farDepth |
|
) |
| |
Sets orthographic projection.
- Parameters
-
left | Left. |
right | Right. |
bottom | Bottom. |
top | Top. |
nearDepth | Near plane distance. |
farDepth | Far plane distance. |
◆ MakeRotationXYZ()
void Matrix44::MakeRotationXYZ |
( |
float |
xDeg, |
|
|
float |
yDeg, |
|
|
float |
zDeg |
|
) |
| |
Makes a rotation around axes.
- Parameters
-
xDeg | X-axis degrees. |
yDeg | Y-axis degrees. |
zDeg | Z-axis degrees. |
◆ Multiply()
- Parameters
-
a | First Matrix. |
b | Second Matrix. |
out | a * b. |
◆ operator=()
- Parameters
-
other | Matrix from which this matrix is initialized. |
- Returns
- this.
◆ Scale()
void Matrix44::Scale |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| |
◆ TransformDirection()
void Matrix44::TransformDirection |
( |
const Vec3 & |
dir, |
|
|
const Matrix44 & |
mat, |
|
|
Vec3 * |
out |
|
) |
| |
|
static |
Multiplies a matrix with a vector. Vector's missing w is treated as 0.
- Parameters
-
dir | Direction vector. |
mat | Matrix. |
out | dir * mat. |
◆ TransformPoint() [1/2]
void Matrix44::TransformPoint |
( |
const Vec3 & |
vec, |
|
|
const Matrix44 & |
mat, |
|
|
Vec3 * |
out |
|
) |
| |
|
static |
Multiplies a matrix with a vector. Vector's missing w is treated as 1.
- Parameters
-
vec | Vector. |
mat | Matrix. |
out | vec * mat. |
◆ TransformPoint() [2/2]
void Matrix44::TransformPoint |
( |
const Vec4 & |
vec, |
|
|
const Matrix44 & |
mat, |
|
|
Vec4 * |
out |
|
) |
| |
|
static |
Multiplies a matrix with a vector.
- Parameters
-
vec | Vector. |
mat | Matrix. |
out | vec * mat. |
◆ Translate()
void Matrix44::Translate |
( |
const Vec3 & |
v | ) |
|
◆ Transpose()
void Matrix44::Transpose |
( |
Matrix44 & |
out | ) |
const |
The documentation for this struct was generated from the following files:
- /home/glaze/Documents/src/Aether3D_2013/Include/Matrix.hpp
- /home/glaze/Documents/src/Aether3D_2013/Include/Matrix.cpp