123456789101112131415161718192021222324252627282930313233343536373839 |
- #ifndef MATRIX_H
- #define MATRIX_H
- #include <iostream>
- class Matrix final {
- public:
- Matrix();
- Matrix& set(const Matrix& other);
- Matrix& setToIdentity();
- Matrix& set(uint index, float f);
- const float* getValues() const;
- Matrix& mul(const Matrix& m);
- Matrix& scale(float sx, float sy, float sz);
- Matrix& scale(float s);
- Matrix& translate(float tx, float ty, float tz);
- Matrix& translateX(float tx);
- Matrix& translateY(float ty);
- Matrix& translateZ(float tz);
- Matrix& translateTo(float tx, float ty, float tz);
- Matrix& rotateX(float degrees);
- Matrix& rotateY(float degrees);
- Matrix& rotateZ(float degrees);
- private:
- Matrix& rotate(float degrees, uint indexA, uint indexB);
- alignas(16) float data[16];
- };
- std::ostream& operator<<(std::ostream& os, const Matrix& m);
- #endif
|