12345678910111213141516171819202122232425262728293031323334 |
- #ifndef CORE_MATRIX_H
- #define CORE_MATRIX_H
- // #include "core/Quaternion.h"
- #include "core/Vector.h"
- typedef struct {
- CoreVector4 data[4];
- } CoreMatrix;
- #define CORE_ZERO_MATRIX ((CoreMatrix){0})
- #define CORE_UNIT_MATRIX \
- ((CoreMatrix){{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}})
- CoreMatrix* coreTransposeMatrix(CoreMatrix* m);
- CoreMatrix* coreMulSetMatrix(CoreMatrix* m, const CoreMatrix* a);
- CoreMatrix* coreMulMatrix(CoreMatrix* m, const CoreMatrix* a,
- const CoreMatrix* b);
- CoreVector3* coreMulMatrixV3(CoreVector3* v, const CoreMatrix* m,
- const CoreVector3* a);
- CoreMatrix* coreScaleMatrix(CoreMatrix* m, const CoreVector3* v);
- CoreMatrix* coreScaleMatrixF(CoreMatrix* m, float f);
- CoreMatrix* coreTranslateMatrix(CoreMatrix* m, const CoreVector3* v);
- CoreMatrix* coreTranslateMatrixX(CoreMatrix* m, float tx);
- CoreMatrix* coreTranslateMatrixY(CoreMatrix* m, float ty);
- CoreMatrix* coreTranslateMatrixZ(CoreMatrix* m, float tz);
- CoreMatrix* coreTranslateMatrixTo(CoreMatrix* m, const CoreVector3* v);
- CoreMatrix* coreRotateMatrixX(CoreMatrix* m, float degrees);
- CoreMatrix* coreRotateMatrixY(CoreMatrix* m, float degrees);
- CoreMatrix* coreRotateMatrixZ(CoreMatrix* m, float degrees);
- // CoreMatrix* coreRotateMatrix(const Quaternion& q);
- size_t coreToStringMatrix(const CoreMatrix* m, char* buffer, size_t n);
- #endif
|