MatrixStack

A matrix stack designed to replace fixed-pipeline matrix stacks.

This stack always exposes both the top element and its inverse.

Constructors

this
this()

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

Members

Aliases

M
alias M = Matrix!(F, 4, 4)

The matrix type this stack works with.

Functions

invTop
M invTop()
loadIdentity
void loadIdentity()

Replacement for glLoadIdentity.

mult
void mult(M m)

Replacement for glMultMatrix.

mult
void mult(M m, M invM)

Replacement for glMultMatrix, with provided inverse.

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

Replacement for glOrtho.

perspective
void perspective(F left, F right, F bottom, F top, F near, F far)

Replacement for gluPerspective.

pop
void pop()

Replacement for glPopMatrix.

push
void push()

Replacement for glPushMatrix.

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

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

scale
void scale(Vector!(F, 3) v)

Replacement for glScale.

scale
void scale(F x, F y, F z)

Replacement for glScale.

setTop
void setTop(M m)

Sets top matrix. Replaces glLoadMatrix.

top
M top()
translate
void translate(Vector!(F, 3) v)
void translate(F x, F y, F z)

Replacement for glTranslate.

Meta