123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #ifndef CORE_MATRIX_H
- #define CORE_MATRIX_H
- #include "core/Quaternion.h"
- #include "core/Vector.h"
- struct CoreMatrixT {
- CoreVector4 data[4];
- };
- typedef struct CoreMatrixT 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(CoreMatrix* m, const CoreQuaternion* q);
- #ifdef IMPORT_CORE
- #define Matrix CoreMatrix
- #define ZERO_MATRIX CORE_ZERO_MATRIX
- #define UNIT_MATRIX CORE_UNIT_MATRIX
- #define transposeMatrix coreTransposeMatrix
- #define mulSetMatrix coreMulSetMatrix
- #define mulMatrix coreMulMatrix
- #define mulMatrixV3 coreMulMatrixV3
- #define scaleMatrix coreScaleMatrix
- #define scaleMatrixF coreScaleMatrixF
- #define translateMatrix coreTranslateMatrix
- #define translateMatrixX coreTranslateMatrixX
- #define translateMatrixY coreTranslateMatrixY
- #define translateMatrixZ coreTranslateMatrixZ
- #define translateMatrixTo coreTranslateMatrixTo
- #define rotateMatrixX coreRotateMatrixX
- #define rotateMatrixY coreRotateMatrixY
- #define rotateMatrixZ coreRotateMatrixZ
- #define rotateMatrix coreRotateMatrix
- #define toStringMatrix coreToStringMatrix
- #endif
- #endif
|