Matrix3D.h 793 B

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