ShaderMatrix.h 1.0 KB

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