ShaderMatrix.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef SHADER_MATRIX_H
  2. #define SHADER_MATRIX_H
  3. #include "math/MatrixStack.h"
  4. #include "math/Quaternion.h"
  5. #include "math/Vector.h"
  6. #include "rendering/Shader.h"
  7. class ShaderMatrix final {
  8. Shader* shader;
  9. MatrixStack<16>& stack;
  10. Matrix* view;
  11. public:
  12. ShaderMatrix(Shader* shader, MatrixStack<16>& stack, Matrix* view);
  13. ShaderMatrix& operator=(ShaderMatrix&& other);
  14. void pop();
  15. void push();
  16. ShaderMatrix& update();
  17. ShaderMatrix& update(const Vector3& pos, const Quaternion& rotation);
  18. ShaderMatrix& scale(float sx, float sy, float sz);
  19. ShaderMatrix& scale(float s);
  20. ShaderMatrix& translate(float tx, float ty, float tz);
  21. ShaderMatrix& translateX(float tx);
  22. ShaderMatrix& translateY(float ty);
  23. ShaderMatrix& translateZ(float tz);
  24. ShaderMatrix& translateTo(float tx, float ty, float tz);
  25. ShaderMatrix& rotateX(float degrees);
  26. ShaderMatrix& rotateY(float degrees);
  27. ShaderMatrix& rotateZ(float degrees);
  28. ShaderMatrix& identity();
  29. };
  30. #endif