Matrix4x4

A Matrix is a structure which may describe different transformation. Note: Matrix4x4.init is the identity Matrix.

Constructors

this
this(float a, float b, float c, float d, float e, float f, float g, float h, float i)

CTor

Members

Functions

det
float det()

Calculate the determinant

getInverse
Matrix4x4 getInverse()

Returns the inverse Matrix of the current. If the current matrix has a determinant of approximately zero, the identity Matrix (.init) is returned.

getValues
inout(float[16]) getValues()

Returns the 16 values of the Matrix by ref

loadIdentity
Matrix4x4 loadIdentity()

Reset the current Matrix to the identity Matrix

lookAt
void lookAt(const Vector3f eye, const Vector3f look, const Vector3f up)

Calculates a View-Matrix

opBinary
Matrix4x4 opBinary(ref const Matrix4x4 mat)

Supported operations: only *

opEquals
bool opEquals(ref const Matrix4x4 mat)

Compares two Matrices approximately

opIndex
inout(float) opIndex(ubyte index)

Returns a specific value by index

opOpAssign
Matrix4x4 opOpAssign(ref const Matrix4x4 math)

Supported operations: only *=

ortho
bool ortho(const Rect rect, float zNear = 1, float zFar = -1)

Calculate a prthographic projection

perspective
void perspective(float fov, float ratio, float nearp, float farp)

Calculate a perspective projection

rotate
Matrix4x4 rotate(float angle)

Rotate the Matrix about angle (in degree!)

rotate
Matrix4x4 rotate(float angle, const Vector2f center)

Rotate the Matrix about angle (in degree!) about the given center position

scale
Matrix4x4 scale(const Vector2f scale)

Scale the Matrix about factor scale

scale
Matrix4x4 scale(const Vector2f scale, const Vector2f center)

Scale the Matrix about factor scale about the given center position

translate
Matrix4x4 translate(const Vector2f vec)

Translate the Matrix

Meta

Authors

Randy Schuett (rswhite4@googlemail.com)