diff options
Diffstat (limited to 'include/dolphin')
-rw-r--r-- | include/dolphin/mtx.h | 3 | ||||
-rw-r--r-- | include/dolphin/vec.h | 36 |
2 files changed, 37 insertions, 2 deletions
diff --git a/include/dolphin/mtx.h b/include/dolphin/mtx.h index f57beea..b1c5525 100644 --- a/include/dolphin/mtx.h +++ b/include/dolphin/mtx.h @@ -68,9 +68,8 @@ 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); +void PSMTXMultVecArraySR(const Mtx m, const Vec* src, Vec* dst, u32 n); void PSMTXQuat(Mtx m, const Quaternion* q); void PSMTXReflect(Mtx m, const Vec* p, const Vec* n); void PSMTXTrans(Mtx m, f32 xT, f32 yT, f32 zT); diff --git a/include/dolphin/vec.h b/include/dolphin/vec.h new file mode 100644 index 0000000..27a0037 --- /dev/null +++ b/include/dolphin/vec.h @@ -0,0 +1,36 @@ +#ifndef _DOLPHIN_VEC_H +#define _DOLPHIN_VEC_H + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif // ifdef __cplusplus + +typedef struct Vec { + f32 x; + f32 y; + f32 z; +} Vec; + +void PSVECAdd(const Vec*, const Vec*, Vec*); +void PSVECSubtract(const Vec*, const Vec*, Vec*); +void PSVECNormalize(const Vec*, Vec*); +f32 PSVECMag(const Vec*); +void PSVECCrossProduct(const Vec*, const Vec*, Vec*); + +#ifdef __cplusplus +} +#endif + +// lfs f1,0(r3) +// lfs f0,4(r3) +// fmuls f1,f1,f1 +// lfs f2,8(r3) +// fmuls f0,f0,f0 +// fmuls f2,f2,f2 +// fadds f0,f1,f0 +// fadds f1,f2,f0 +// blr + +#endif |