123456789101112131415161718192021222324252627 |
- #include <cassert>
- #include "client/math/MatrixStack.h"
- void MatrixStack::pop()
- {
- assert(index > 0);
- index--;
- }
- void MatrixStack::push()
- {
- assert(index < stack.size() - 1);
- index++;
- stack[index] = stack[index - 1];
- }
- Matrix& MatrixStack::get()
- {
- return stack[index];
- }
- void MatrixStack::clear()
- {
- index = 0;
- stack[0].setToIdentity();
- }
|