mirror of
https://github.com/zeldaret/oot
synced 2026-08-22 06:44:46 -04:00
Math Files (#76)
* math3d wip * math3d wip * wip * wip * wip * wip * final update before pr * run format.sh * fix merge conflicts * tharo suggestions update * fig formatting suggestion * math3d pr updates * use sFactorialTbl in sys_math
This commit is contained in:
+67
-75
@@ -7,6 +7,8 @@ float fabsf(float f);
|
||||
#pragma intrinsic(fabsf)
|
||||
float sqrtf(float f);
|
||||
#pragma intrinsic(sqrtf)
|
||||
double sqrt(double d);
|
||||
#pragma intrinsic(sqrt)
|
||||
|
||||
void cleararena(void);
|
||||
void bootproc(void);
|
||||
@@ -1590,81 +1592,71 @@ u32 SysCfb_GetFbPtr(s32 idx);
|
||||
u32 SysCfb_GetFbEnd();
|
||||
f32 func_800CA720(f32);
|
||||
f32 func_800CA774(f32);
|
||||
// ? func_800CA7D0(?);
|
||||
// ? func_800CA8E8(?);
|
||||
// ? func_800CAB94(?);
|
||||
// ? func_800CACAC(?);
|
||||
// ? func_800CAD08(?);
|
||||
// ? func_800CAEE8(?);
|
||||
// ? func_800CAF5C(?);
|
||||
// ? func_800CAFA0(?);
|
||||
// ? func_800CAFEC(?);
|
||||
// ? func_800CB010(?);
|
||||
// ? func_800CB1F8(?);
|
||||
// ? func_800CB338(?);
|
||||
// ? func_800CB55C(?);
|
||||
// ? func_800CB594(?);
|
||||
// ? func_800CB600(?);
|
||||
// ? func_800CB628(?);
|
||||
// ? func_800CB650(?);
|
||||
f32 func_800CB678(Vec3f*, Vec3f*);
|
||||
// ? func_800CB698(?);
|
||||
// ? func_800CB7B4(?);
|
||||
// ? func_800CB824(?);
|
||||
// ? func_800CB88C(?);
|
||||
// ? func_800CB934(?);
|
||||
// ? func_800CBAE4(?);
|
||||
// ? func_800CBC60(?);
|
||||
// ? func_800CC8B4(?);
|
||||
// ? func_800CC9C8(?);
|
||||
// ? func_800CCA04(?);
|
||||
// ? func_800CCA3C(?);
|
||||
// ? func_800CCB0C(?);
|
||||
// ? func_800CCBE4(?);
|
||||
// ? func_800CCF00(?);
|
||||
// ? func_800CCF98(?);
|
||||
// ? func_800CD044(?);
|
||||
// ? func_800CD0F0(?);
|
||||
// ? func_800CD168(?);
|
||||
// ? func_800CD2D8(?);
|
||||
// ? func_800CD34C(?);
|
||||
// ? func_800CD668(?);
|
||||
// ? func_800CD6B0(?);
|
||||
// ? func_800CD760(?);
|
||||
// ? func_800CD7D8(?);
|
||||
// ? func_800CD95C(?);
|
||||
// ? func_800CD9D0(?);
|
||||
// ? func_800CDD18(?);
|
||||
// ? func_800CDD60(?);
|
||||
// ? func_800CDE10(?);
|
||||
// ? func_800CDE88(?);
|
||||
// ? func_800CE010(?);
|
||||
// ? func_800CE084(?);
|
||||
// ? func_800CE15C(?);
|
||||
// ? func_800CE25C(?);
|
||||
// ? func_800CE3C0(?);
|
||||
// ? func_800CE46C(?);
|
||||
// ? func_800CE4B8(?);
|
||||
// ? func_800CE600(?);
|
||||
// ? func_800CE800(?);
|
||||
// ? func_800CE934(?);
|
||||
// ? func_800CED50(?);
|
||||
// ? func_800CEE0C(?);
|
||||
// ? func_800CF7D0(?);
|
||||
// ? func_800CFC6C(?);
|
||||
// ? func_800CFC8C(?);
|
||||
// ? func_800CFCAC(?);
|
||||
// ? func_800CFD84(?);
|
||||
// ? func_800CFDA4(?);
|
||||
// ? func_800CFF14(?);
|
||||
// ? func_800CFF34(?);
|
||||
// ? func_800D0104(?);
|
||||
// ? func_800D0480(?);
|
||||
// ? func_800D04F0(?);
|
||||
// ? func_800D0560(?);
|
||||
// ? func_800D05D0(?);
|
||||
// ? func_800D05DC(?);
|
||||
// ? func_800D05F0(?);
|
||||
s32 func_800CA7D0(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, Vec3f* arg8,
|
||||
Vec3f* arg9, Vec3f* argA);
|
||||
void Math3D_LineVsPos(Linef* arg0, Vec3f* arg1, Vec3f* arg2);
|
||||
s32 func_800CAEE8(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, Vec3f* arg8,
|
||||
Vec3f* arg9);
|
||||
void func_800CAFA0(Vec3f* arg0, Vec3f* arg1, f32 arg2, Vec3f* arg3);
|
||||
f32 Math3D_DotProduct(Vec3f* vec1, Vec3f* vec2);
|
||||
s32 func_800CB010(Vec3f* vec1, Vec3f* vec2, f32* dst);
|
||||
void func_800CB0C0(Vec3f* vec1, Vec3f* vec2, Vec3f* ret);
|
||||
s32 func_800CB198(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5);
|
||||
f32 func_800CB55C(f32 arg0, f32 arg1);
|
||||
f32 func_800CB594(f32 arg0, f32 arg1, f32 arg2, f32 arg3);
|
||||
f32 func_800CB600(Vec3f* vec);
|
||||
f32 Math3D_Vec3fMagnitude(Vec3f* vec);
|
||||
f32 func_800CB650(Vec3f* arg0, Vec3f* arg1);
|
||||
void Math3D_Vec3f_Cross(Vec3f* a, Vec3f* b, Vec3f* ret);
|
||||
void Math3D_SurfaceNorm(Vec3f* va, Vec3f* vb, Vec3f* vc, Vec3f* normal);
|
||||
f32 Math3D_Vec3f_DistXYZ(Vec3f*, Vec3f*);
|
||||
s32 func_800CB88C(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2);
|
||||
s32 func_800CB934(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2);
|
||||
s32 func_800CBAE4(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2);
|
||||
s32 func_800CBC60(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3);
|
||||
void func_800CC824(Vec3f* arg0, s16 arg1, f32* arg2, f32* arg3, f32* arg4);
|
||||
void func_800CC8B4(Vec3f* va, Vec3f* vb, Vec3f* vc, f32* nx, f32* ny, f32* nz, f32* nd);
|
||||
f32 Math3D_UDistPlaneToPos(f32 x, f32 y, f32 z, f32 arg3, Vec3f* norm);
|
||||
f32 Math3D_DistPlaneToPos(f32 x, f32 y, f32 z, f32 arg3, Vec3f* norm);
|
||||
s32 func_800CCF48(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32 arg3, f32 arg4);
|
||||
s32 func_800CCF98(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32 arg3, f32 normMagnitude, f32 arg5, f32 arg6, f32 arg7,
|
||||
f32 arg8, f32* pointDist, f32 argA);
|
||||
s32 func_800CD044(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8,
|
||||
f32* arg9, f32 argA);
|
||||
s32 Math3D_TriVtxCylTouching(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7,
|
||||
f32 arg8, f32* arg9, f32 argA, f32 argB);
|
||||
s32 func_800CD2D8(Vec3f* v0, Vec3f* v1, Vec3f* v2, Plane* plane, f32 z, f32 x, f32 arg6);
|
||||
s32 func_800CD6B0(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8,
|
||||
f32* arg9);
|
||||
s32 func_800CD7D8(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8,
|
||||
f32* arg9, f32 argA, f32 argB);
|
||||
s32 func_800CD95C(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32* arg3, f32 arg4, f32 arg5, f32 arg6);
|
||||
s32 func_800CDD60(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8,
|
||||
f32* arg9);
|
||||
s32 func_800CDE88(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8,
|
||||
f32* arg9, f32 argA, f32 argB);
|
||||
s32 func_800CE010(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4, f32 arg5, f32 arg6);
|
||||
s32 func_800CE15C(f32 arg0, f32 arg1, f32 arg2, f32 arg3, Vec3f* arg4, Vec3f* arg5, Vec3f* arg6, s32 arg7);
|
||||
void Math3D_TriNorm(TriNorm* tri, Vec3f* va, Vec3f* vb, Vec3f* vc);
|
||||
s32 func_800CE4B8(f32 param_1, f32 param_2, f32 param_3, f32 param_4, f32 param_5, f32 param_6, f32* param_7);
|
||||
s32 func_800CE600(Sphere16* arg0, Linef* arg1);
|
||||
s32 func_800CE934(Sphere16* arg0, TriNorm* arg1, Vec3f* arg2);
|
||||
s32 func_800CEE0C(Cylinder16* arg0, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4);
|
||||
s32 Math3D_CylTriTouching(Cylinder16* cyl, TriNorm* tri);
|
||||
s32 Math3D_CylTriTouchingIntersect(Cylinder16* cyl, TriNorm* tri, Vec3f* intersect);
|
||||
s32 Math3D_SpheresTouching(Sphere16* sphereA, Sphere16* sphereB);
|
||||
s32 Math3D_SpheresTouchingSurface(Sphere16* arg0, Sphere16* arg1, f32* arg2);
|
||||
s32 Math3D_SpheresTouchingSurfaceCenter(Sphere16* arg0, Sphere16* arg1, f32* arg2, f32* arg3);
|
||||
s32 func_800CFD84(Sphere16* sph, Cylinder16* cyl, f32* surfaceDist);
|
||||
s32 func_800CFDA4(Sphere16* sph, Cylinder16* cyl, f32* surfaceDist, f32* centerDist);
|
||||
s32 Math3D_CylinderOutCylinder(Cylinder16* arg0, Cylinder16* arg1, f32* arg2);
|
||||
s32 Math3D_CylinderOutCylinderDist(Cylinder16* arg0, Cylinder16* arg1, f32* arg2, f32* arg3);
|
||||
s32 Math3D_TrisIntersect(TriNorm* ta, TriNorm* tb, Vec3f* intersect);
|
||||
s32 func_800D0480(Sphere16* arg0, f32 arg1, f32 arg2);
|
||||
s32 func_800D04F0(Sphere16* arg0, f32 arg1, f32 arg2);
|
||||
s32 func_800D0560(Sphere16* arg0, f32 arg1, f32 arg2);
|
||||
void func_800D05D0(s32 arg0, s32 arg1);
|
||||
void func_800D05DC(s32 arg0, s32 arg1);
|
||||
s16 atan2s(f32 x, f32 y);
|
||||
f32 atan2f(f32 x, f32 y);
|
||||
void Matrix_Init(GameState* gameState);
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#define M_PI 3.14159265358979323846f
|
||||
#define M_SQRT2 1.41421356237309504880f
|
||||
#define FLT_MAX 340282346638528859811704183484516925440.0f
|
||||
#define SHT_MAX 32767.0f
|
||||
#define SHT_MINV (1.0f / SHT_MAX)
|
||||
|
||||
float sinf(float);
|
||||
double sin(double);
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
#include <z64item.h>
|
||||
#include <z64animation.h>
|
||||
#include <z64dma.h>
|
||||
#include <z64vec.h>
|
||||
#include <z64math.h>
|
||||
#include <bgm.h>
|
||||
#include <sfx.h>
|
||||
#include <color.h>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#define _Z64ACTOR_H_
|
||||
|
||||
#include <z64animation.h>
|
||||
#include <z64vec.h>
|
||||
#include <z64math.h>
|
||||
|
||||
#define ACTOR_DLF_MAX 471
|
||||
#define ACTOR_NUMBER_MAX 200
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <ultra64/gbi.h>
|
||||
#include <z64dma.h>
|
||||
#include <z64vec.h>
|
||||
#include <z64math.h>
|
||||
|
||||
#define LINK_ANIMETION_OFFSET(addr,offset) (((u32)&_link_animetionSegmentRomStart)+((u32)addr)-((u32)&link_animetion_segment)+((u32)offset))
|
||||
#define LIMB_DONE 0xFF
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
#ifndef _Z64MATH_H_
|
||||
#define _Z64MATH_H_
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
#define VEC_SET(V,X,Y,Z) V.x=X;V.y=Y;V.z=Z
|
||||
|
||||
typedef struct {
|
||||
f32 x, y;
|
||||
} Vec2f;
|
||||
|
||||
typedef struct {
|
||||
f32 x, y, z;
|
||||
} Vec3f;
|
||||
|
||||
typedef struct {
|
||||
s16 x, y, z;
|
||||
} Vec3s;
|
||||
|
||||
typedef struct {
|
||||
s32 x, y, z;
|
||||
} Vec3i;
|
||||
|
||||
typedef struct {
|
||||
Vec3s center;
|
||||
s16 radius;
|
||||
} Sphere16;
|
||||
|
||||
typedef struct {
|
||||
Vec3f center;
|
||||
f32 radius;
|
||||
} Spheref;
|
||||
|
||||
|
||||
typedef struct {
|
||||
Vec3f normal;
|
||||
f32 originDist;
|
||||
} Plane;
|
||||
|
||||
typedef struct {
|
||||
Vec3f vtx[3];
|
||||
Plane plane;
|
||||
} TriNorm;
|
||||
|
||||
typedef struct {
|
||||
s16 radius;
|
||||
s16 height;
|
||||
s16 yShift;
|
||||
Vec3s pos;
|
||||
} Cylinder16;
|
||||
|
||||
typedef struct {
|
||||
f32 radius;
|
||||
f32 height;
|
||||
f32 yShift;
|
||||
Vec3f pos;
|
||||
} Cylinderf;
|
||||
|
||||
typedef struct {
|
||||
Vec3f a;
|
||||
Vec3f b;
|
||||
} Linef;
|
||||
|
||||
#endif
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef _Z64VEC_H_
|
||||
#define _Z64VEC_H_
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
typedef struct {
|
||||
f32 x, y;
|
||||
} Vec2f;
|
||||
|
||||
typedef struct {
|
||||
f32 x, y, z;
|
||||
} Vec3f;
|
||||
|
||||
typedef struct {
|
||||
s16 x, y, z;
|
||||
} Vec3s;
|
||||
|
||||
typedef struct {
|
||||
s32 x, y, z;
|
||||
} Vec3i;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user