1234567891011121314151617181920212223242526272829303132 |
- #ifndef CORE_MATRIX_H
- #define CORE_MATRIX_H
- #include "core/Quaternion.h"
- #include "core/Vector.h"
- typedef struct {
- Vector4 data[4];
- } Matrix;
- #define ZERO_MATRIX ((Matrix){0})
- #define UNIT_MATRIX \
- ((Matrix){{{{1, 0, 0, 0}}, {{0, 1, 0, 0}}, {{0, 0, 1, 0}}, {{0, 0, 0, 1}}}})
- Matrix* transposeMatrix(Matrix* m);
- Matrix* mulSetMatrix(Matrix* m, const Matrix* a);
- Matrix* mulMatrix(Matrix* m, const Matrix* a, const Matrix* b);
- Vector3* mulMatrixV3(Vector3* v, const Matrix* m, const Vector3* a);
- Matrix* scaleMatrix(Matrix* m, const Vector3* v);
- Matrix* scaleMatrixF(Matrix* m, float f);
- Matrix* translateMatrix(Matrix* m, const Vector3* v);
- Matrix* translateMatrixX(Matrix* m, float tx);
- Matrix* translateMatrixY(Matrix* m, float ty);
- Matrix* translateMatrixZ(Matrix* m, float tz);
- Matrix* translateMatrixTo(Matrix* m, const Vector3* v);
- Matrix* rotateMatrixX(Matrix* m, float radians);
- Matrix* rotateMatrixY(Matrix* m, float radians);
- Matrix* rotateMatrixZ(Matrix* m, float radians);
- Matrix* rotateMatrix(Matrix* m, const Quaternion* q);
- size_t toStringMatrix(const Matrix* m, char* buffer, size_t n);
- #endif
|