Clutter Engine 0.0.1
|
4x4 matrix class with row-major storage. Provides common matrix operations for 3D graphics. More...
#include <Matrix4Row.h>
Public Member Functions | |
Matrix4Row () | |
Default constructor. Initializes to identity matrix. | |
Matrix4Row (float inMat[4][4]) | |
Constructs a matrix from a 2D float array. | |
const float * | GetAsFloatPtr () const |
Returns a pointer to the first element as a float pointer. | |
Matrix4Row & | operator*= (const Matrix4Row &right) |
Multiplies this matrix by another matrix. | |
Matrix4Row | Inverse () const |
Returns the inverse of this matrix. | |
Vector3 | GetTranslation () const |
Gets the translation component of the matrix. | |
Vector3 | GetXAxis () const |
Gets the X axis (first row) as a normalized vector. | |
Vector3 | GetYAxis () const |
Gets the Y axis (second row) as a normalized vector. | |
Vector3 | GetZAxis () const |
Gets the Z axis (third row) as a normalized vector. | |
Vector3 | GetScale () const |
Gets the scale component of the matrix. | |
Static Public Member Functions | |
static Matrix4Row | CreateScale (float xScale, float yScale, float zScale) |
Creates a scale matrix. | |
static Matrix4Row | InvertMatrix (const Matrix4Row &mat) |
Inverts a matrix (static version). | |
static Matrix4Row | CreateScale (const Vector3 &scaleVector) |
Creates a scale matrix from a vector. | |
static Matrix4Row | CreateScale (float scale) |
Creates a uniform scale matrix. | |
static Matrix4Row | CreateRotationX (float theta) |
Creates a rotation matrix around the X axis. | |
static Matrix4Row | CreateRotationY (float theta) |
Creates a rotation matrix around the Y axis. | |
static Matrix4Row | CreateRotationZ (float theta) |
Creates a rotation matrix around the Z axis. | |
static Matrix4Row | CreateTranslation (const Vector3 &trans) |
Creates a translation matrix. | |
static Matrix4Row | CreateSimpleViewProj (float width, float height) |
Creates a simple orthographic view-projection matrix. | |
static Matrix4Row | CreateFromQuaternion (const Quaternion &q) |
Creates a rotation matrix from a quaternion. | |
static Matrix4Row | CreateLookAt (const Vector3 &eye, const Vector3 &target, const Vector3 &up) |
Creates a look-at view matrix. | |
static Matrix4Row | CreateOrtho (float width, float height, float pNear, float pFar) |
Creates an orthographic projection matrix. | |
static Matrix4Row | CreatePerspectiveFOV (float fovY, float width, float height, float pNear, float pFar) |
Creates a perspective projection matrix using field of view. | |
static Matrix4Row | CreatePerspective (float left, float right, float bottom, float top, float pNear, float pFar) |
Creates a perspective projection matrix. | |
Public Attributes | |
float | mat [4][4] |
The matrix elements in row-major order. | |
Static Public Attributes | |
static const Matrix4Row | Identity |
The identity matrix constant. | |
Friends | |
Matrix4Row | operator* (const Matrix4Row &a, const Matrix4Row &b) |
Matrix multiplication (a * b). | |
Vector3 | operator* (const Matrix4Row &mat, const Vector3 &vec) |
Multiplies a matrix by a Vector3 (assumes w=1). | |
Vector4 | operator* (const Matrix4Row &mat, const Vector4 &vec) |
Multiplies a matrix by a Vector4. | |
4x4 matrix class with row-major storage. Provides common matrix operations for 3D graphics.
|
inlineexplicit |
Constructs a matrix from a 2D float array.
inMat | 4x4 array of floats. |
|
inlinestatic |
Creates a rotation matrix from a quaternion.
q | The quaternion. |
|
inlinestatic |
Creates a look-at view matrix.
eye | The camera position. |
target | The target point. |
up | The up direction. |
|
inlinestatic |
Creates an orthographic projection matrix.
width | The width of the view volume. |
height | The height of the view volume. |
pNear | The near plane. |
pFar | The far plane. |
|
inlinestatic |
Creates a perspective projection matrix.
left | Left plane. |
right | Right plane. |
bottom | Bottom plane. |
top | Top plane. |
pNear | Near plane. |
pFar | Far plane. |
|
inlinestatic |
Creates a perspective projection matrix using field of view.
fovY | Field of view in Y, in radians. |
width | The width of the view. |
height | The height of the view. |
pNear | The near plane. |
pFar | The far plane. |
|
inlinestatic |
Creates a rotation matrix around the X axis.
theta | Angle in radians. |
|
inlinestatic |
Creates a rotation matrix around the Y axis.
theta | Angle in radians. |
|
inlinestatic |
Creates a rotation matrix around the Z axis.
theta | Angle in radians. |
|
inlinestatic |
Creates a scale matrix from a vector.
scaleVector | The scale vector. |
|
inlinestatic |
Creates a uniform scale matrix.
scale | The uniform scale. |
|
inlinestatic |
Creates a scale matrix.
xScale | Scale along X. |
yScale | Scale along Y. |
zScale | Scale along Z. |
|
inlinestatic |
Creates a simple orthographic view-projection matrix.
width | The width of the view. |
height | The height of the view. |
|
inlinestatic |
Creates a translation matrix.
trans | The translation vector. |
|
inline |
Returns a pointer to the first element as a float pointer.
|
inline |
Gets the scale component of the matrix.
|
inline |
Gets the translation component of the matrix.
|
inline |
Gets the X axis (first row) as a normalized vector.
|
inline |
Gets the Y axis (second row) as a normalized vector.
|
inline |
Gets the Z axis (third row) as a normalized vector.
Matrix4Row Matrix4Row::Inverse | ( | ) | const |
Returns the inverse of this matrix.
|
inlinestatic |
Inverts a matrix (static version).
mat | The matrix to invert. |
|
inline |
Multiplies this matrix by another matrix.
right | The right-hand matrix. |
|
friend |
Matrix multiplication (a * b).
a | Left matrix. |
b | Right matrix. |
|
friend |
|
friend |