1234567891011121314151617181920212223242526272829303132333435363738 |
- #ifndef CORE_MATRIX_HPP
- #define CORE_MATRIX_HPP
- #include "core/math/Quaternion.hpp"
- #include "core/utils/ArrayString.hpp"
- namespace Core {
- class Matrix final {
- Vector4 data[4];
- public:
- Matrix();
- Matrix& unit();
- Matrix& set(size_t index, const Vector4& v);
- Matrix transpose();
- 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 degrees);
- Matrix& rotateY(float degrees);
- Matrix& rotateZ(float degrees);
- Matrix& rotate(const Quaternion& q);
- void toString(BufferString& s) const;
- private:
- Matrix& rotate(float degrees, int a, int b);
- };
- }
- #endif
|