diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-02 11:30:25 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-02 11:30:25 -0400 |
commit | 55487832c614edb61ebf22d0c153944ba864feaa (patch) | |
tree | 335e05d8c9a4ab4b4154b26bdd078ef66ccb7254 /include/dolphin/vec.h | |
parent | ac1bd37d19f946142d03992a35b4d5d353e003ff (diff) |
sdk: Add `mtx`
We're slowly getting there.
Diffstat (limited to 'include/dolphin/vec.h')
-rw-r--r-- | include/dolphin/vec.h | 36 |
1 files changed, 36 insertions, 0 deletions
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 |