12345678910111213141516171819202122232425262728293031323334353637 |
- #ifndef CORE_MATRIX_H
- #define CORE_MATRIX_H
- #include "core/Quaternion.hpp"
- namespace Core {
- class Matrix final {
- Vector4 data[4];
- public:
- Matrix();
- Matrix& unit();
- Matrix& set(size_t index, const Vector4& v);
- Matrix transpose() const;
- const float* getValues() const;
- Matrix& operator*=(const Matrix& other);
- Matrix operator*(const Matrix& other) const;
- Vector3 operator*(const Vector3& v) const;
- Matrix& scale(const Vector3& v);
- Matrix& scale(float f);
- Matrix& translate(const Vector3& v);
- Matrix& translateX(float tx);
- Matrix& translateY(float ty);
- Matrix& translateZ(float tz);
- Matrix& translateTo(const Vector3& v);
- Matrix& rotateX(float radians);
- Matrix& rotateY(float radians);
- Matrix& rotateZ(float radians);
- Matrix& rotate(const Quaternion& q);
- size_t toString(char* s, size_t n) const;
- private:
- Matrix& rotate(float degrees, int a, int b);
- };
- }
- #endif
|