MatrixStack

Constructors

this
this(size_t depth)

Creates a matrix stack.

Destructor

~this
~this()

Relases the matrix stack memory.

Members

Aliases

MatrixType
alias MatrixType = Matrix!(T, R, R)

Functions

invTop
MatrixType invTop()
loadIdentity
void loadIdentity()
lookAt
void lookAt(Vector!(T, 3) eye, Vector!(T, 3) target, Vector!(T, 3) up)
mult
void mult(MatrixType m)
mult
void mult(MatrixType m, MatrixType invM)
perspective
void perspective(T FOVInRadians, T width, T height, T zNear, T zFar)
pop
void pop()

Replacement for glPopMatrix.

push
void push()
rotate
void rotate(T angle, Vector!(T, 3) axis)
scale
void scale(Vector!(T, R - 1) v)
top
MatrixType top()
top
void top(MatrixType m)
translate
void translate(Vector!(T, R - 1) v)

Examples

auto m = new MatrixStack!(4, double)();
scope(exit) destroy(m);
m.loadIdentity();
m.push();
m.pop();
m.translate(Vector!(double, 3)(2.4, 3.3, 7.5));
m.scale(Vector!(double, 3)(0.7));
auto t = new MatrixStack!(3, float)();
scope(exit) destroy(t);
t.loadIdentity();
t.push();
t.pop();
t.translate(Vector!(float, 2)(1, -8));
t.scale(Vector!(float, 2)(0.2));

Meta