Matrix3D.h 919 B

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