MatrixStack

A matrix stack designed to replace fixed-pipeline matrix stacks. This stack always expose both the top element and its inverse.

Constructors

this
this(size_t depth = 32)

Creates a matrix stack. The stack is initialized with one element, an identity matrix.

Destructor

~this
~this()

Releases the matrix stack memory.

Members

Functions

invTop
matrix_t invTop()
loadIdentity
void loadIdentity()

Replacement for glLoadIdentity.

lookAt
void lookAt(vec3!T eye, vec3!T target, vec3!T up)

Replacement for gluLookAt.

mult
void mult(matrix_t m)

Replacement for glMultMatrix.

mult
void mult(matrix_t m, matrix_t invM)

Replacement for glMultMatrix, with provided inverse.

ortho
void ortho(T left, T right, T bottom, T top, T near, T far)

Replacement for glOrtho.

perspective
void perspective(T FOVInRadians, T aspect, T zNear, T zFar)

Replacement for gluPerspective. Warning: FOV is given in radians, unlike the original API.

pop
void pop()

Replacement for glPopMatrix.

push
void push()

Replacement for glPushMatrix.

rotate
void rotate(T angle, Vector!(T, 3) axis)

Replacement for glRotate. Warning: Angle is given in radians, unlike the original API.

scale
void scale(Vector!(T, R - 1) v)

Replacement for glScale.

setTop
void setTop(matrix_t m)

Sets top matrix. Replaces glLoadMatrix.

top
matrix_t top()
translate
void translate(Vector!(T, R - 1) v)

Replacement for glTranslate.

Meta