MatrixStack.cpp 372 B

1234567891011121314151617181920212223
  1. #include <cassert>
  2. #include "client/math/MatrixStack.h"
  3. void MatrixStack::pop() {
  4. assert(index > 0);
  5. index--;
  6. }
  7. void MatrixStack::push() {
  8. assert(index < stack.size() - 1);
  9. index++;
  10. stack[index] = stack[index - 1];
  11. }
  12. Matrix& MatrixStack::get() {
  13. return stack[index];
  14. }
  15. void MatrixStack::clear() {
  16. index = 0;
  17. stack[0].setToIdentity();
  18. }