summaryrefslogtreecommitdiff
path: root/include/sf64math.h
diff options
context:
space:
mode:
authorpetrie911 <69443847+petrie911@users.noreply.github.com>2023-12-14 08:41:43 -0600
committerGitHub <noreply@github.com>2023-12-14 11:41:43 -0300
commit89ae8dff96bf6afcf9015446fe24df90b872c774 (patch)
treed433efb6b7cab03f0f2e0efba4c3283173540220 /include/sf64math.h
parent2b051a0828d598f53c18ef43a693ee33b8aacac1 (diff)
fox_6B3B0 and a bunch of names for things (#50)
* stuff * three whole files * format * format and such * a switch in time * merge prep * nintendo switch * format * the great switch statement of our time * 43AC0 matched * stuff * Enums everywhere * oh god the switch * knakyo * new headers * format * fox * everyone hates recursion * format * one more thing * one more one more thing * renames
Diffstat (limited to 'include/sf64math.h')
-rw-r--r--include/sf64math.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/sf64math.h b/include/sf64math.h
index 508a848e..420a2d1e 100644
--- a/include/sf64math.h
+++ b/include/sf64math.h
@@ -10,6 +10,11 @@ typedef struct {
} Vec3f; // size = 0xC
typedef struct {
+ Vec3f normal;
+ f32 dist;
+} Plane;
+
+typedef struct {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
/* 0x4 */ s16 z;
@@ -26,4 +31,53 @@ typedef union {
// u64 force_struct_alignment;
} Matrix; // size = 0x40
+f32 Math_ModF(f32 value, f32 mod);
+void Rand_Init(void);
+f32 Rand_ZeroOne(void);
+void Rand_SetSeed(s32 seed1, s32 seed2, s32 seed3);
+f32 Rand_ZeroOneSeeded(void);
+f32 Math_Atan2F(f32 y, f32 x);
+f32 Math_Atan2F_XY(f32 x, f32 y);
+f32 Math_Atan2F_XYAlt(f32 x, f32 y);
+f32 Math_PowF(f32 base, s32 exp);
+void Math_MinMax(s32* min, s32* max, s32 val1, s32 val2, s32 val3);
+
+f32 Math_SmoothStepToF(f32 *value, f32 target, f32 scale, f32 maxStep, f32 minStep);
+f32 Math_SmoothStepToAngle(f32 *angle, f32 target, f32 scale, f32 maxStep, f32 minStep);
+void Math_SmoothStepToVec3fArray(Vec3f *src, Vec3f *dst, s32 mode, s32 count, f32 scale, f32 maxStep, f32 minStep);
+s32 Math_PursueVec3f(Vec3f *pos, Vec3f *target, Vec3f *rot, f32 stepSize, f32 scaleTurn, f32 maxTurn, f32 dist);
+void Math_Vec3fFromAngles(Vec3f *step, f32 xRot, f32 yRot, f32 stepsize);
+f32 Math_RadToDeg(f32 rAngle);
+
+void Matrix_Copy(Matrix*, Matrix*);
+void Matrix_Push(Matrix** mtxStack);
+void Matrix_Pop(Matrix** mtxStack);
+void Matrix_Mult(Matrix*, Matrix*, u8);
+void Matrix_Translate(Matrix*, f32, f32, f32, u8);
+void Matrix_Scale(Matrix*, f32, f32, f32, u8);
+void Matrix_RotateX(Matrix*, f32, u8);
+void Matrix_RotateY(Matrix*, f32, u8);
+void Matrix_RotateZ(Matrix*, f32, u8);
+void Matrix_RotateAxis(Matrix*, f32, f32, f32, f32, u8);
+void Matrix_ToMtx(Mtx *dest);
+void Matrix_FromMtx(Mtx *src, Matrix *dest);
+void Matrix_MultVec3f(Matrix*, Vec3f*, Vec3f*);
+void Matrix_MultVec3fNoTranslate(Matrix*, Vec3f*, Vec3f*);
+void Matrix_GetYRPAngles(Matrix*, Vec3f*);
+void Matrix_GetXYZAngles(Matrix*, Vec3f*);
+void Matrix_LookAt(Matrix*, f32, f32, f32, f32, f32, f32, f32, f32, f32, u8);
+void Matrix_SetGfxMtx(Gfx**);
+
+f32 Math_FAtanF(f32);
+f32 Math_FAtan2F(f32, f32);
+f32 Math_FAsinF(f32);
+f32 Math_FAcosF(f32);
+
+f32 __sinf(f32);
+f32 __cosf(f32);
+
+s64 __ull_div(s64, s64);
+s64 __ll_mul(s64, s64);
+s64 __ll_rshift(s64, s64);
+
#endif