Matrix.h 683 B

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