Matrix.h 785 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef MATRIX_H
  2. #define MATRIX_H
  3. #include <iostream>
  4. class Matrix final {
  5. public:
  6. Matrix();
  7. Matrix& set(const Matrix& other);
  8. Matrix& setToIdentity();
  9. Matrix& set(unsigned int index, float f);
  10. const float* getValues() const;
  11. Matrix& mul(const Matrix& m);
  12. Matrix& scale(float sx, float sy, float sz);
  13. Matrix& scale(float s);
  14. Matrix& translate(float tx, float ty, float tz);
  15. Matrix& translateX(float tx);
  16. Matrix& translateY(float ty);
  17. Matrix& translateZ(float tz);
  18. Matrix& translateTo(float tx, float ty, float tz);
  19. Matrix& rotateX(float degrees);
  20. Matrix& rotateY(float degrees);
  21. Matrix& rotateZ(float degrees);
  22. private:
  23. float data[16];
  24. };
  25. std::ostream& operator<<(std::ostream& os, const Matrix& m);
  26. #endif