gfm



class  MatrixStack(int R, T) if (R == 3 || R == 4);

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

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


alias  matrix_t = Matrix!(T, R, R);

Type of matrices in the stack. Can be 3x3 or 4x4.


nothrow this(size_t depth = 32);

Creates a matrix stack.

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


pure nothrow void  loadIdentity();

Replacement for glLoadIdentity.


pure nothrow void  push();

Replacement for glPushMatrix.


pure nothrow void  pop();

Replacement for glPopMatrix.


const pure nothrow matrix_t  top();

Returns
Top matrix.

Replaces glLoadMatrix.

const pure nothrow matrix_t  invTop();

Returns
Inverse of top matrix.

pure nothrow void  setTop(matrix_t m);

Sets top matrix.

Replaces glLoadMatrix.


pure nothrow void  mult(matrix_t m);

Replacement for glMultMatrix.


pure nothrow void  mult(matrix_t m, matrix_t invM);

Replacement for glMultMatrix, with provided inverse.


pure nothrow void  translate(Vector!(T, R - 1) v);

Replacement for glTranslate.


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

Replacement for glScale.


pure nothrow void  rotate(T angle, Vector!(T, 3) axis);

Replacement for glRotate.

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

pure nothrow void  perspective(T FOVInRadians, T aspect, T zNear, T zFar);

Replacement for gluPerspective.

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

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

Replacement for glOrtho.


pure nothrow void  lookAt(vec3!T eye, vec3!T target, vec3!T up);

Replacement for gluLookAt.