12345678910111213141516171819202122232425262728293031323334 |
- #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);
- Matrix& scale(float s);
- Matrix& translate(float tx, float ty);
- Matrix& translateX(float tx);
- Matrix& translateY(float ty);
- Matrix& translateTo(float tx, float ty);
- Matrix& rotate(float degrees);
- private:
- float data[9];
- };
- std::ostream& operator<<(std::ostream& os, const Matrix& m);
- #endif
|