2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _DOLPHIN_MTX
|
|
|
|
#define _DOLPHIN_MTX
|
2022-09-05 04:00:04 +00:00
|
|
|
|
|
|
|
#include <dolphin/types.h>
|
|
|
|
|
2022-11-30 01:56:37 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-09-05 04:00:04 +00:00
|
|
|
typedef f32 Mtx[3][4];
|
|
|
|
typedef f32 (*MtxPtr)[4];
|
|
|
|
|
2022-11-30 01:56:37 +00:00
|
|
|
typedef struct {
|
|
|
|
f32 x;
|
|
|
|
f32 y;
|
|
|
|
f32 z;
|
|
|
|
} Vec, *VecPtr;
|
|
|
|
|
|
|
|
void C_MTXIdentity(Mtx m);
|
|
|
|
void C_MTXCopy(const Mtx src, Mtx dst);
|
|
|
|
void C_MTXConcat(const Mtx a, const Mtx b, Mtx ab);
|
|
|
|
void C_MTXConcatArray(const Mtx a, const Mtx* srcBase, Mtx* dstBase, u32 count);
|
|
|
|
void C_MTXTranspose(const Mtx src, Mtx xPose);
|
|
|
|
u32 C_MTXInverse(const Mtx src, Mtx inv);
|
|
|
|
u32 C_MTXInvXpose(const Mtx src, Mtx invX);
|
|
|
|
void C_MTXMultVec(const Mtx m, const Vec* src, Vec* dst);
|
|
|
|
void C_MTXMultVecArray(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
|
|
|
|
void C_MTXMultVecSR(const Mtx m, const Vec* src, Vec* dst);
|
|
|
|
void C_MTXMultVecArraySR(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
|
|
|
|
|
|
|
|
#ifdef __MWERKS__
|
|
|
|
void PSMTXIdentity(Mtx m);
|
|
|
|
void PSMTXCopy(const Mtx src, Mtx dst);
|
|
|
|
void PSMTXConcat(const Mtx a, const Mtx b, Mtx ab);
|
|
|
|
void PSMTXConcatArray(const Mtx a, const Mtx* srcBase, Mtx* dstBase, u32 count);
|
|
|
|
void PSMTXTranspose(const Mtx src, Mtx xPose);
|
|
|
|
u32 PSMTXInverse(const Mtx src, Mtx inv);
|
|
|
|
u32 PSMTXInvXpose(const Mtx src, Mtx invX);
|
|
|
|
void PSMTXMultVec(const Mtx m, const Vec* src, Vec* dst);
|
|
|
|
void PSMTXMultVecArray(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
|
|
|
|
void PSMTXMultVecSR(const Mtx m, const Vec* src, Vec* dst);
|
|
|
|
void PSMTXMultVecArraySR(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __MWERKS__
|
|
|
|
#define MTXIdentity PSMTXIdentity
|
|
|
|
#define MTXCopy PSMTXCopy
|
|
|
|
#define MTXConcat PSMTXConcat
|
|
|
|
#define MTXConcatArray PSMTXConcatArray
|
|
|
|
#define MTXTranspose PSMTXTranspose
|
|
|
|
#define MTXInverse PSMTXInverse
|
|
|
|
#define MTXInvXpose PSMTXInvXpose
|
|
|
|
#define MTXMultVec PSMTXMultVec
|
|
|
|
#define MTXMultVecArray PSMTXMultVecArray
|
|
|
|
#define MTXMultVecSR PSMTXMultVecSR
|
|
|
|
#define MTXMultVecArraySR PSMTXMultVecArraySR
|
|
|
|
#else
|
|
|
|
#define MTXIdentity C_MTXIdentity
|
|
|
|
#define MTXCopy C_MTXCopy
|
|
|
|
#define MTXConcat C_MTXConcat
|
|
|
|
#define MTXConcatArray C_MTXConcatArray
|
|
|
|
#define MTXTranspose C_MTXTranspose
|
|
|
|
#define MTXInverse C_MTXInverse
|
|
|
|
#define MTXInvXpose C_MTXInvXpose
|
|
|
|
#define MTXMultVec C_MTXMultVec
|
|
|
|
#define MTXMultVecArray C_MTXMultVecArray
|
|
|
|
#define MTXMultVecSR C_MTXMultVecSR
|
|
|
|
#define MTXMultVecArraySR C_MTXMultVecArraySR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _DOLPHIN_MTX
|