Apply renames

This commit is contained in:
angie
2023-05-24 10:14:19 -04:00
parent b1e87f7838
commit 61f71acccd
29 changed files with 305 additions and 310 deletions
+44 -44
View File
@@ -222,17 +222,17 @@ f32 Math_Atan2F_XY(f32 x, f32 y);
f32 Math3D_Normalize(Vec3f* vec);
s32 Math3D_PlaneVsLineSegClosestPoint(f32 planeAA, f32 planeAB, f32 planeAC, f32 planeADist, f32 planeBA, f32 planeBB, f32 planeBC, f32 planeBDist, Vec3f* linePointA, Vec3f* linePointB, Vec3f* closestPoint);
s32 Math3D_LineVsLineClosestTwoPoints(Vec3f* lineAPointA, Vec3f* lineAPointB, Vec3f* lineBPointA, Vec3f* lineBPointB, Vec3f* lineAClosestToB, Vec3f* lineBClosestToA);
s32 Math3D_LineSegMakePerpLineSeg(Vec3f* lineAPointA, Vec3f* lineAPointB, Vec3f* lineBPointA, Vec3f* lineBPointB, Vec3f* lineAClosestToB, Vec3f* lineBClosestToA);
f32 Math3D_LineClosestToPoint(Linef* line, Vec3f* pos, Vec3f* closestPoint);
void func_80179B34(float planeAAxis1Norm, f32 planeAAxis2Norm, f32 planeBAxis1Norm, f32 planeBAxis2Norm, f32 axis3Direction, f32 planeADist, f32 planeBDist, float* axis1Point, float* axis2Point);
s32 func_80179B94(f32 planeAA, f32 planeAB, f32 planeAC, f32 planeADist, f32 planeBA, f32 planeBB, f32 planeBC, f32 planeBDist, InfiniteLine* intersect);
// void func_80179D74(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10);
void Math3D_ScaleAndAdd(Vec3f* v0, Vec3f* dir, f32 scale, Vec3f* ret);
void Math3D_Lerp(Vec3f* v0, Vec3f* v1, f32 ratio, Vec3f* ret);
void Math3D_FindPointOnPlaneIntersect(float planeAAxis1Norm, f32 planeAAxis2Norm, f32 planeBAxis1Norm, f32 planeBAxis2Norm, f32 axis3Direction, f32 planeADist, f32 planeBDist, float* axis1Point, float* axis2Point);
s32 Math3D_PlaneVsPlaneNewLine(f32 planeAA, f32 planeAB, f32 planeAC, f32 planeADist, f32 planeBA, f32 planeBB, f32 planeBC, f32 planeBDist, InfiniteLine* intersect);
// void Math3D_PlaneVsPlaneVsLineClosestPoint(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10);
void Math3D_PointOnDirectedLine(Vec3f* v0, Vec3f* dir, f32 scale, Vec3f* ret);
void Math3D_LineSplitRatio(Vec3f* v0, Vec3f* v1, f32 ratio, Vec3f* ret);
f32 Math3D_Cos(Vec3f* a, Vec3f* b);
s32 Math3D_CosOut(Vec3f* a, Vec3f* b, f32* dst);
void func_80179F64(Vec3f* vec, Vec3f* normal, Vec3f* reflVec);
s32 Math3D_XZBoundCheck(f32 upperLeftX, f32 lowerRightX, f32 upperLeftY, f32 lowerRightY, f32 x, f32 y);
void Math3D_Vec3fReflect(Vec3f* vec, Vec3f* normal, Vec3f* reflVec);
s32 Math3D_PointInSquare2D(f32 upperLeftX, f32 lowerRightX, f32 upperLeftY, f32 lowerRightY, f32 x, f32 y);
// void func_8017A09C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_8017A1D0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
s32 func_8017A304(Vec3f* arg0, Vec3f* arg1, Vec3f* arg2, f32 arg3, f32 arg4, f32 arg5);
@@ -256,59 +256,59 @@ s32 Math3D_PointRelativeToCubeEdges(Vec3f* point, Vec3f* min, Vec3f* max);
s32 Math3D_PointRelativeToCubeVertices(Vec3f* point, Vec3f* min, Vec3f* max);
s32 Math3D_LineVsCube(Vec3f* min, Vec3f* max, Vec3f* a, Vec3f* b);
s32 Math3D_LineVsCubeShort(Vec3s* min, Vec3s* max, Vec3s* a, Vec3s* b);
void func_8017B7F8(Vec3f* pointOnPlane, s16 angle, f32* a, f32* c, f32* d);
void Math3D_UnitNormalVector(Vec3f* va, Vec3f* vb, Vec3f* vc, f32* nx, f32* ny, f32* nz, f32* originDist);
f32 Math3D_SignedDistanceFromPlane(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* pointOnPlane);
f32 func_8017B9D8(Plane* plane, Vec3f* pointOnPlane);
void Math3D_RotateXZPlane(Vec3f* pointOnPlane, s16 angle, f32* a, f32* c, f32* d);
void Math3D_DefPlane(Vec3f* va, Vec3f* vb, Vec3f* vc, f32* nx, f32* ny, f32* nz, f32* originDist);
f32 Math3D_PlaneF(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* pointOnPlane);
f32 Math3D_Plane(Plane* plane, Vec3f* pointOnPlane);
f32 Math3D_UDistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* p);
f32 Math3D_DistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* p);
s32 Math3D_TriChkPointParaYDist(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 z, f32 x, f32 detMax, f32 chkDist, f32 ny);
// void func_8017BD98(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
// void func_8017BDE0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
s32 Math3D_TriChkPointParaYImpl(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 z, f32 x, f32 detMax, f32 chkDist, f32 ny);
// void Math3D_TriChkPointParaYDeterminate(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
// void Math3D_TriChkPointParaYSlopedY(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
s32 Math3D_TriChkPointParaYIntersectDist(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 z, f32 x, f32* yIntersect, f32 chkDist);
s32 Math3D_TriChkPointParaYIntersectInsideTri(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 z, f32 x, f32* yIntersect, f32 chkDist);
// void func_8017BF8C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void Math3D_TriChkPointParaY(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
s32 Math3D_TriChkLineSegParaYIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 z, f32 x, f32* yIntersect, f32 y0, f32 y1);
// void func_8017C17C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
// void func_8017C1F0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8);
s32 Math3D_TriChkPointParaYIntersectInsideTri2(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 z, f32 x, f32* yIntersect, f32 chkDist);
s32 Math3D_TriChkPointParaXDist(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 y, f32 z, f32 detMax, f32 chkDist, f32 ny);
// void func_8017C808(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
// void Math3D_TriChkPointParaYDist(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
// void Math3D_TriChkPointParaYImplNoCheckRange(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8);
s32 Math3D_TriChkPointParaYNoRangeCheckIntersectInsideTri(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 z, f32 x, f32* yIntersect, f32 chkDist);
s32 Math3D_TriChkPointParaXImpl(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 y, f32 z, f32 detMax, f32 chkDist, f32 ny);
// void Math3D_TriChkPointParaXDeterminate(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
s32 Math3D_TriChkPointParaXIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 y, f32 z, f32* xIntersect);
// void func_8017C904(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void Math3D_TriChkPointParaX(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
s32 Math3D_TriChkLineSegParaXIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 y, f32 z, f32* xIntersect, f32 x0, f32 x1);
// void func_8017CB08(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
s32 Math3D_TriChkLineSegParaZDist(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 x, f32 y, f32 detMax, f32 chkDist, f32 nz);
// void func_8017CEA8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
// void Math3D_TriChkLineSegParaXDist(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
s32 Math3D_TriChkPointParaZImpl(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 x, f32 y, f32 detMax, f32 chkDist, f32 nz);
// void Math3D_TriChkPointParaZDeterminate(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
s32 Math3D_TriChkPointParaZIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 x, f32 y, f32* zIntersect);
// void func_8017CFA4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void Math3D_TriChkPointParaZ(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
s32 Math3D_TriChkLineSegParaZIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 x, f32 y, f32* zIntersect, f32 z0, f32 z1);
// void func_8017D1AC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
// void func_8017D220(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void Math3D_TriChkLineSegParaZDist(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
// void Math3D_LineSegFindPlaneIntersect(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
s32 Math3D_LineSegVsPlane(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* linePointA, Vec3f* linePointB, Vec3f* intersect, s32 fromFront);
s32 func_8017D404(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* linePointA, Vec3f* linePointB, Vec3f* intersect, s32 fromFront) ;
void Math3D_TriSetCoords(TriNorm* tri, Vec3f* va, Vec3f* vb, Vec3f* vc);
s32 Math3D_IsPointInSphere(Sphere16* sphere, Vec3f* point);
s32 Math3D_TriLineIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* linePointA, Vec3f* linePointB, Vec3f* intersect, s32 fromFront) ;
void Math3D_TriNorm(TriNorm* tri, Vec3f* va, Vec3f* vb, Vec3f* vc);
s32 Math3D_PointInSph(Sphere16* sphere, Vec3f* point);
s32 Math3D_PointDistToLine2D(f32 x0, f32 y0, f32 x1, f32 y1, f32 x2, f32 y2, f32* perpXOut, f32* perpYOut, f32* lineLenSq); // returns boolean
s32 func_8017D7C0(f32 x0, f32 y0, f32 x1, f32 y1, f32 x2, f32 y2, f32* lineLenSq);
s32 func_8017D814(f32 x0, f32 y0, Vec3f* p1, Vec3f* p2, f32* lineLenSq);
s32 func_8017D91C(f32 y0, f32 z0, Vec3f* p1, Vec3f* p2, f32* lineLenSq);
s32 func_8017DA24(f32 z0, f32 x0, Vec3f* p1, Vec3f* p2, f32* lineLenSq);
s32 Math3D_LineVsSph(Sphere16* sphere, Linef* line);
void func_8017DD34(Sphere16* sphere, TriNorm* tri, Vec3f* intersectPoint);
s32 Math3D_ColSphereTri(Sphere16* sphere, TriNorm* tri, Vec3f* intersectPoint);
s32 func_8017E294(Cylinder16* cyl, Vec3f* point);
s32 func_8017E350(Cylinder16* cyl, Vec3f* linePointA, Vec3f* linePointB, Vec3f* intersectA, Vec3f* intersectB);
s32 Math3D_ColCylinderTri(Cylinder16* cyl, TriNorm* tri, Vec3f* intersect);
// void func_8017F1A0(void);
void Math3D_GetSphVsTriIntersectPoint(Sphere16* sphere, TriNorm* tri, Vec3f* intersectPoint);
s32 Math3D_TriVsSphIntersect(Sphere16* sphere, TriNorm* tri, Vec3f* intersectPoint);
s32 Math3D_PointInCyl(Cylinder16* cyl, Vec3f* point);
s32 Math3D_CylVsLineSeg(Cylinder16* cyl, Vec3f* linePointA, Vec3f* linePointB, Vec3f* intersectA, Vec3f* intersectB);
s32 Math3D_CylTriVsIntersect(Cylinder16* cyl, TriNorm* tri, Vec3f* intersect);
// void Math3D_CylVsTri(void);
s32 Math3D_SphVsSph(Sphere16* sphereA, Sphere16* sphereB);
s32 Math3D_ColSphereSphereIntersect(Sphere16* sphereA, Sphere16* sphereB, f32* overlapSize);
s32 Math3D_ColSphereSphereIntersectAndDistance(Sphere16* sphereA, Sphere16* sphereB, f32* overlapSize, f32* centerDist);
s32 Math3D_ColSphereCylinderDistance(Sphere16* sph, Cylinder16* cyl, f32* overlapSize);
s32 Math3D_ColSphereCylinderDistanceAndAmount(Sphere16* sph, Cylinder16* cyl, f32* overlapSize, f32* centerDist);
s32 Math3D_ColCylinderCylinderAmount(Cylinder16* ca, Cylinder16* cb, f32* deadSpace);
s32 Math3D_ColCylinderCylinderAmountAndDistance(Cylinder16* ca, Cylinder16* cb, f32* deadSpace, f32* xzDist);
s32 Math3d_ColTriTri(TriNorm* ta, TriNorm* tb, Vec3f* intersect);
s32 Math3D_SphVsSphOverlap(Sphere16* sphereA, Sphere16* sphereB, f32* overlapSize);
s32 Math3D_SphVsSphOverlapCenter(Sphere16* sphereA, Sphere16* sphereB, f32* overlapSize, f32* centerDist);
s32 Math3D_SphVsCylOverlapDist(Sphere16* sph, Cylinder16* cyl, f32* overlapSize);
s32 Math3D_SphVsCylOverlapCenterDist(Sphere16* sph, Cylinder16* cyl, f32* overlapSize, f32* centerDist);
s32 Math3D_CylOutsideCyl(Cylinder16* ca, Cylinder16* cb, f32* deadSpace);
s32 Math3D_CylOutsideCylDist(Cylinder16* ca, Cylinder16* cb, f32* deadSpace, f32* xzDist);
s32 Math3D_TriVsTriIntersect(TriNorm* ta, TriNorm* tb, Vec3f* intersect);
s32 Math3D_XZInSphere(Sphere16* sphere, f32 x, f32 z);
s32 Math3D_XYInSphere(Sphere16* sphere, f32 x, f32 y);
s32 Math3D_YZInSphere(Sphere16* sphere, f32 y, f32 z);
+11 -60
View File
@@ -2,56 +2,6 @@
#include "libc/stdbool.h"
#include "libc/math.h"
#define Math3D_FindPointOnPlaneIntersect func_80179B34
#define Math3D_PlaneVsPlaneNewLine func_80179B94
#define Math3D_LineSegMakePerpLineSeg Math3D_LineVsLineClosestTwoPoints
#define Math3D_Plane func_8017B9D8
#define Math3D_TriLineIntersect func_8017D404
#define Math3D_CylOutsideCylDist Math3D_ColCylinderCylinderAmountAndDistance
#define Math3D_CylOutsideCyl Math3D_ColCylinderCylinderAmount
#define Math3D_SphVsCylOverlapCenterDist Math3D_ColSphereCylinderDistanceAndAmount
#define Math3D_CylTriVsIntersect Math3D_ColCylinderTri
#define Math3D_CylVsTri func_8017F1A0
#define Math3D_SphVsSph Math3D_SphVsSph
#define Math3D_SphVsSphOverlap Math3D_ColSphereSphereIntersect
#define Math3D_SphVsSphOverlapCenter Math3D_ColSphereSphereIntersectAndDistance
#define Math3D_SphVsCylOverlapDist Math3D_ColSphereCylinderDistance
#define Math3D_CylVsLineSeg func_8017E350
#define Math3D_TriVsSphIntersect Math3D_ColSphereTri
#define Math3D_PointOnDirectedLine Math3D_ScaleAndAdd
#define Math3D_LineSplitRatio Math3D_Lerp
#define Math3D_PlaneVsPlaneVsLineClosestPoint func_80179D74
#define Math3D_PointInCyl func_8017E294
#define Math3D_Vec3fReflect func_80179F64
#define Math3D_PointInSquare2D Math3D_XZBoundCheck
#define Math3D_RotateXZPlane func_8017B7F8
#define Math3D_DefPlane Math3D_UnitNormalVector
#define Math3D_PlaneF Math3D_SignedDistanceFromPlane
#define Math3D_Plane func_8017B9D8
#define Math3D_DistPlaneToPos Math3D_DistPlaneToPos
#define Math3D_TriChkPointParaYImpl Math3D_TriChkPointParaYDist
#define Math3D_TriChkPointParaYDeterminate func_8017BD98
#define Math3D_TriChkPointParaYSlopedY func_8017BDE0
#define Math3D_TriChkPointParaY func_8017BF8C
#define Math3D_TriChkPointParaYDist_ func_8017C17C
#define Math3D_TriChkPointParaYImplNoCheckRange func_8017C1F0
#define Math3D_TriChkPointParaYNoRangeCheckIntersectInsideTri Math3D_TriChkPointParaYIntersectInsideTri2
#define Math3D_TriChkPointParaXImpl Math3D_TriChkPointParaXDist
#define Math3D_TriChkPointParaXDeterminate func_8017C808
#define Math3D_TriChkPointParaX func_8017C904
#define Math3D_TriChkLineSegParaXDist func_8017CB08
#define Math3D_TriChkPointParaZImpl Math3D_TriChkLineSegParaZDist
#define Math3D_TriChkPointParaZDeterminate func_8017CEA8
#define Math3D_TriChkPointParaZ func_8017CFA4
#define Math3D_TriChkLineSegParaZDist_ func_8017D1AC
#define Math3D_LineSegFindPlaneIntersect func_8017D220
#define Math3D_TriLineIntersect func_8017D404
#define Math3D_TriNorm Math3D_TriSetCoords
#define Math3D_PointInSph Math3D_IsPointInSphere
#define Math3D_PointDistToLine2D_ func_8017D814
#define Math3D_TriVsTriIntersect Math3d_ColTriTri
#define Math3D_GetSphVsTriIntersectPoint func_8017DD34
f32 Math3D_Normalize(Vec3f* vec) {
f32 magnitude = Math3D_Vec3fMagnitude(vec);
@@ -100,7 +50,7 @@ s32 Math3D_PlaneVsLineSegClosestPoint(f32 planeAA, f32 planeAB, f32 planeAC, f32
/**
* Finds the two points on lines A and B where the lines are closest together.
*/
s32 Math3D_LineVsLineClosestTwoPoints(Vec3f* lineAPointA, Vec3f* lineAPointB, Vec3f* lineBPointA, Vec3f* lineBPointB,
s32 Math3D_LineSegMakePerpLineSeg(Vec3f* lineAPointA, Vec3f* lineAPointB, Vec3f* lineBPointA, Vec3f* lineBPointB,
Vec3f* lineAClosestToB, Vec3f* lineBClosestToA) {
f32 sqMag;
f32 scaleB;
@@ -246,7 +196,7 @@ s32 Math3D_PlaneVsPlaneVsLineClosestPoint(f32 planeAA, f32 planeAB, f32 planeAC,
return true;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_80179D74.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_PlaneVsPlaneVsLineClosestPoint.s")
#endif
/**
@@ -974,7 +924,7 @@ void Math3D_DefPlane(Vec3f* va, Vec3f* vb, Vec3f* vc, f32* nx, f32* ny, f32* nz,
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_UnitNormalVector.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_DefPlane.s")
#endif
f32 Math3D_PlaneF(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* pointOnPlane) {
@@ -1526,7 +1476,8 @@ s32 func_8017D7C0(f32 x0, f32 y0, f32 x1, f32 y1, f32 x2, f32 y2, f32* lineLenSq
return Math3D_PointDistToLine2D(x0, y0, x1, y1, x2, y2, &perpX, &perpY, lineLenSq);
}
s32 Math3D_PointDistToLine2D_(f32 x0, f32 y0, Vec3f* p1, Vec3f* p2, f32* lineLenSq) {
// Math3D_PointDistToLine2D_
s32 func_8017D814(f32 x0, f32 y0, Vec3f* p1, Vec3f* p2, f32* lineLenSq) {
f32 perpendicularRatio;
f32 xDiff = p2->x - p1->x;
f32 yDiff = p2->y - p1->y;
@@ -1672,7 +1623,7 @@ void Math3D_GetSphVsTriIntersectPoint(Sphere16* sphere, TriNorm* tri, Vec3f* int
Math3D_LineSplitRatio(&sphereCenter, &v0v1Center, splitRatio, intersectPoint);
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017DD34.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_GetSphVsTriIntersectPoint.s")
#endif
#ifdef NON_MATCHING
@@ -1762,7 +1713,7 @@ s32 Math3D_TriVsSphIntersect(Sphere16* sphere, TriNorm* tri, Vec3f* intersectPoi
return false;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_ColSphereTri.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriVsSphIntersect.s")
#endif
s32 Math3D_PointInCyl(Cylinder16* cyl, Vec3f* point) {
@@ -1964,7 +1915,7 @@ s32 Math3D_CylVsLineSeg(Cylinder16* cyl, Vec3f* linePointA, Vec3f* linePointB, V
return count;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017E350.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_CylVsLineSeg.s")
#endif
#ifdef NON_MATCHING
@@ -2062,7 +2013,7 @@ s32 Math3D_CylTriVsIntersect(Cylinder16* cyl, TriNorm* tri, Vec3f* intersect) {
return false;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_ColCylinderTri.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_CylTriVsIntersect.s")
#endif
s32 Math3D_CylVsTri(Cylinder16* cyl, TriNorm* tri) {
@@ -2153,7 +2104,7 @@ s32 Math3D_SphVsCylOverlapCenterDist(Sphere16* sph, Cylinder16* cyl, f32* overla
return false;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_ColSphereCylinderDistanceAndAmount.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_SphVsCylOverlapCenterDist.s")
#endif
s32 Math3D_CylOutsideCyl(Cylinder16* ca, Cylinder16* cb, f32* deadSpace) {
@@ -2195,7 +2146,7 @@ s32 Math3D_CylOutsideCylDist(Cylinder16* ca, Cylinder16* cb, f32* deadSpace, f32
return true;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_ColCylinderCylinderAmountAndDistance.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_CylOutsideCylDist.s")
#endif
s32 Math3D_TriVsTriIntersect(TriNorm* ta, TriNorm* tb, Vec3f* intersect) {
+6 -6
View File
@@ -363,7 +363,7 @@ s32 CollisionPoly_CheckYIntersect(CollisionPoly* poly, Vec3s* vtxList, f32 x, f3
nx = COLPOLY_GET_NORMAL(poly->normal.x);
ny = COLPOLY_GET_NORMAL(poly->normal.y);
nz = COLPOLY_GET_NORMAL(poly->normal.z);
return Math3D_TriChkPointParaYIntersectInsideTri2(&D_801EDA18[0], &D_801EDA18[1], &D_801EDA18[2], nx, ny, nz,
return Math3D_TriChkPointParaYNoRangeCheckIntersectInsideTri(&D_801EDA18[0], &D_801EDA18[1], &D_801EDA18[2], nx, ny, nz,
poly->dist, z, x, yIntersect, checkDist);
}
@@ -429,16 +429,16 @@ s32 CollisionPoly_LineVsPoly(BgLineVsPolyTest* a0) {
CollisionPoly_GetNormalF(a0->poly, &sPlane.normal.x, &sPlane.normal.y, &sPlane.normal.z);
CollisionPoly_GetVertices(a0->poly, a0->vtxList, sPolyVerts);
Math3D_Lerp(a0->posA, a0->posB, planeDistA / (planeDistA - planeDistB), a0->planeIntersect);
Math3D_LineSplitRatio(a0->posA, a0->posB, planeDistA / (planeDistA - planeDistB), a0->planeIntersect);
if (((fabsf(sPlane.normal.x) > 0.5f) &&
Math3D_TriChkPointParaXDist(&sPolyVerts[0], &sPolyVerts[1], &sPolyVerts[2], a0->planeIntersect->y,
Math3D_TriChkPointParaXImpl(&sPolyVerts[0], &sPolyVerts[1], &sPolyVerts[2], a0->planeIntersect->y,
a0->planeIntersect->z, 0.0f, a0->checkDist, sPlane.normal.x)) ||
((fabsf(sPlane.normal.y) > 0.5f) &&
Math3D_TriChkPointParaYDist(&sPolyVerts[0], &sPolyVerts[1], &sPolyVerts[2], a0->planeIntersect->z,
Math3D_TriChkPointParaYImpl(&sPolyVerts[0], &sPolyVerts[1], &sPolyVerts[2], a0->planeIntersect->z,
a0->planeIntersect->x, 0.0f, a0->checkDist, sPlane.normal.y)) ||
((fabsf(sPlane.normal.z) > 0.5f) &&
Math3D_TriChkLineSegParaZDist(&sPolyVerts[0], &sPolyVerts[1], &sPolyVerts[2], a0->planeIntersect->x,
Math3D_TriChkPointParaZImpl(&sPolyVerts[0], &sPolyVerts[1], &sPolyVerts[2], a0->planeIntersect->x,
a0->planeIntersect->y, 0.0f, a0->checkDist, sPlane.normal.z))) {
return true;
}
@@ -463,7 +463,7 @@ s32 CollisionPoly_SphVsPoly(CollisionPoly* poly, Vec3s* vtxList, Vec3f* center,
sSphere.center.y = center->y;
sSphere.center.z = center->z;
sSphere.radius = radius;
return Math3D_ColSphereTri(&sSphere, &sTri, &intersect);
return Math3D_TriVsSphIntersect(&sSphere, &sTri, &intersect);
}
#else
s32 CollisionPoly_SphVsPoly(CollisionPoly* poly, Vec3s* vtxList, Vec3f* center, f32 radius);
+2 -2
View File
@@ -1847,13 +1847,13 @@ void Camera_CalcDefaultSwing(Camera* camera, VecGeo* arg1, VecGeo* arg2, f32 arg
//! FAKE:
dummy:;
swing->unk_64 = 0;
} else if ((sp88 = Math3D_SignedDistanceFromPlane(swing->eyeAtColChk.norm.x, swing->eyeAtColChk.norm.y,
} else if ((sp88 = Math3D_PlaneF(swing->eyeAtColChk.norm.x, swing->eyeAtColChk.norm.y,
swing->eyeAtColChk.norm.z, swing->eyeAtColChk.poly->dist,
at)) > 0.0f) {
swing->unk_64 = 0;
} else if ((sp88 = OLib_Vec3fDist(eye, &swing->eyeAtColChk.pos)) < 10.0f) {
swing->unk_64 = 0;
} else if ((sp88 = Math3D_SignedDistanceFromPlane(swing->atEyeColChk.norm.x, swing->atEyeColChk.norm.y,
} else if ((sp88 = Math3D_PlaneF(swing->atEyeColChk.norm.x, swing->atEyeColChk.norm.y,
swing->atEyeColChk.norm.z, swing->atEyeColChk.poly->dist,
eye)) > 0.0f) {
swing->unk_64 = 0;
+62 -62
View File
@@ -619,7 +619,7 @@ s32 Collider_SetTrisElementDim(PlayState* play, TriNorm* dim, ColliderTrisElemen
*destVtx = *srcVtx;
}
Math3D_UnitNormalVector(&src->vtx[0], &src->vtx[1], &src->vtx[2], &nx, &ny, &nz, &originDist);
Math3D_DefPlane(&src->vtx[0], &src->vtx[1], &src->vtx[2], &nx, &ny, &nz, &originDist);
dim->plane.normal.x = nx;
dim->plane.normal.y = ny;
@@ -1733,7 +1733,7 @@ void CollisionCheck_AC_JntSphVsJntSph(PlayState* play, CollisionCheckContext* co
continue;
}
if (Math3D_ColSphereSphereIntersectAndDistance(&atElem->dim.worldSphere, &acElem->dim.worldSphere,
if (Math3D_SphVsSphOverlapCenter(&atElem->dim.worldSphere, &acElem->dim.worldSphere,
&overlapSize, &centerDist) != 0) {
f32 acToHit;
Vec3f hitPos;
@@ -1784,7 +1784,7 @@ void CollisionCheck_AC_JntSphVsCyl(PlayState* play, CollisionCheckContext* colCt
if (CollisionCheck_NoSharedFlags(&atElem->info, &ac->info)) {
continue;
}
if (Math3D_ColSphereCylinderDistanceAndAmount(&atElem->dim.worldSphere, &ac->dim, &overlapSize,
if (Math3D_SphVsCylOverlapCenterDist(&atElem->dim.worldSphere, &ac->dim, &overlapSize,
&centerDist)) {
Vec3f hitPos;
Vec3f atPos;
@@ -1834,7 +1834,7 @@ void CollisionCheck_AC_JntSphVsTris(PlayState* play, CollisionCheckContext* colC
if (CollisionCheck_NoSharedFlags(&atElem->info, &acElem->info)) {
continue;
}
if (Math3D_ColSphereTri(&atElem->dim.worldSphere, &acElem->dim, &hitPos) != 0) {
if (Math3D_TriVsSphIntersect(&atElem->dim.worldSphere, &acElem->dim, &hitPos) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -1862,8 +1862,8 @@ void CollisionCheck_AC_JntSphVsQuad(PlayState* play, CollisionCheckContext* colC
if (CollisionCheck_SkipBump(&ac->info)) {
return;
}
Math3D_TriSetCoords(&D_801EF590, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]);
Math3D_TriSetCoords(&D_801EF5C8, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]);
Math3D_TriNorm(&D_801EF590, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]);
Math3D_TriNorm(&D_801EF5C8, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]);
for (sphElem = at->elements; sphElem < &at->elements[at->count]; sphElem++) {
if (CollisionCheck_SkipTouch(&sphElem->info)) {
@@ -1872,8 +1872,8 @@ void CollisionCheck_AC_JntSphVsQuad(PlayState* play, CollisionCheckContext* colC
if (CollisionCheck_NoSharedFlags(&sphElem->info, &ac->info)) {
continue;
}
if (Math3D_ColSphereTri(&sphElem->dim.worldSphere, &D_801EF590, &hitPos) != 0 ||
Math3D_ColSphereTri(&sphElem->dim.worldSphere, &D_801EF5C8, &hitPos) != 0) {
if (Math3D_TriVsSphIntersect(&sphElem->dim.worldSphere, &D_801EF590, &hitPos) != 0 ||
Math3D_TriVsSphIntersect(&sphElem->dim.worldSphere, &D_801EF5C8, &hitPos) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -1909,7 +1909,7 @@ void CollisionCheck_AC_JntSphVsSphere(PlayState* play, CollisionCheckContext* co
if (CollisionCheck_NoSharedFlags(&sphElem->info, &ac->info)) {
continue;
}
if (Math3D_ColSphereSphereIntersectAndDistance(&sphElem->dim.worldSphere, &ac->dim.worldSphere,
if (Math3D_SphVsSphOverlapCenter(&sphElem->dim.worldSphere, &ac->dim.worldSphere,
&overlapSize, &centerDist) != 0) {
f32 acToHit;
Vec3f hitPos;
@@ -1954,7 +1954,7 @@ void CollisionCheck_AC_CylVsJntSph(PlayState* play, CollisionCheckContext* colCt
if (CollisionCheck_NoSharedFlags(&at->info, &sphElem->info)) {
continue;
}
if (Math3D_ColSphereCylinderDistanceAndAmount(&sphElem->dim.worldSphere, &at->dim, &overlapSize,
if (Math3D_SphVsCylOverlapCenterDist(&sphElem->dim.worldSphere, &at->dim, &overlapSize,
&centerDist) != 0) {
Vec3f hitPos;
Vec3f atPos;
@@ -2005,7 +2005,7 @@ void CollisionCheck_AC_CylVsCyl(PlayState* play, CollisionCheckContext* colCtxt,
return;
}
if (Math3D_ColCylinderCylinderAmountAndDistance(&at->dim, &ac->dim, &overlapSize, &centerDist) != 0) {
if (Math3D_CylOutsideCylDist(&at->dim, &ac->dim, &overlapSize, &centerDist) != 0) {
Vec3f hitPos;
Vec3f atPos;
Vec3f acPos;
@@ -2059,7 +2059,7 @@ void CollisionCheck_AC_CylVsTris(PlayState* play, CollisionCheckContext* colCtxt
continue;
}
if (Math3D_ColCylinderTri(&at->dim, &acElem->dim, &hitPos) != 0) {
if (Math3D_CylTriVsIntersect(&at->dim, &acElem->dim, &hitPos) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -2089,17 +2089,17 @@ void CollisionCheck_AC_CylVsQuad(PlayState* play, CollisionCheckContext* colCtxt
if (CollisionCheck_NoSharedFlags(&at->info, &ac->info)) {
return;
}
Math3D_TriSetCoords(&D_801EF600, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]);
Math3D_TriSetCoords(&D_801EF638, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]);
Math3D_TriNorm(&D_801EF600, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]);
Math3D_TriNorm(&D_801EF638, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]);
if (Math3D_ColCylinderTri(&at->dim, &D_801EF600, &D_801EDE00) != 0) {
if (Math3D_CylTriVsIntersect(&at->dim, &D_801EF600, &D_801EDE00) != 0) {
Vec3f atPos;
Vec3f acPos;
Math_Vec3s_ToVec3f(&atPos, &at->dim.pos);
CollisionCheck_QuadAvgPoint(ac, &acPos);
CollisionCheck_SetATvsAC(play, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos, &D_801EDE00);
} else if (Math3D_ColCylinderTri(&at->dim, &D_801EF638, &D_801EDE00) != 0) {
} else if (Math3D_CylTriVsIntersect(&at->dim, &D_801EF638, &D_801EDE00) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -2130,7 +2130,7 @@ void CollisionCheck_AC_CylVsSphere(PlayState* play, CollisionCheckContext* colCt
return;
}
if (Math3D_ColSphereCylinderDistanceAndAmount(&ac->dim.worldSphere, &at->dim, &overlapSize, &centerDist) != 0) {
if (Math3D_SphVsCylOverlapCenterDist(&ac->dim.worldSphere, &at->dim, &overlapSize, &centerDist) != 0) {
Vec3f hitPos;
Vec3f atPos;
Vec3f acPos;
@@ -2178,7 +2178,7 @@ void CollisionCheck_AC_TrisVsJntSph(PlayState* play, CollisionCheckContext* colC
if (CollisionCheck_NoSharedFlags(&atElem->info, &acElem->info)) {
continue;
}
if (Math3D_ColSphereTri(&acElem->dim.worldSphere, &atElem->dim, &hitPos)) {
if (Math3D_TriVsSphIntersect(&acElem->dim.worldSphere, &atElem->dim, &hitPos)) {
Vec3f atPos;
Vec3f acPos;
@@ -2215,7 +2215,7 @@ void CollisionCheck_AC_TrisVsCyl(PlayState* play, CollisionCheckContext* colCtxt
if (CollisionCheck_NoSharedFlags(&atElem->info, &ac->info)) {
continue;
}
if (Math3D_ColCylinderTri(&ac->dim, &atElem->dim, &D_801EDE10) != 0) {
if (Math3D_CylTriVsIntersect(&ac->dim, &atElem->dim, &D_801EDE10) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -2250,7 +2250,7 @@ void CollisionCheck_AC_TrisVsTris(PlayState* play, CollisionCheckContext* colCtx
if (CollisionCheck_NoSharedFlags(&atElem->info, &acElem->info)) {
continue;
}
if (Math3d_ColTriTri(&atElem->dim, &acElem->dim, &D_801EDE20) != 0) {
if (Math3D_TriVsTriIntersect(&atElem->dim, &acElem->dim, &D_801EDE20) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -2278,8 +2278,8 @@ void CollisionCheck_AC_TrisVsQuad(PlayState* play, CollisionCheckContext* colCtx
return;
}
Math3D_TriSetCoords(&D_801EDE40, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]);
Math3D_TriSetCoords(&D_801EDE78, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]);
Math3D_TriNorm(&D_801EDE40, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]);
Math3D_TriNorm(&D_801EDE78, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]);
for (atElem = at->elements; atElem < &at->elements[at->count]; atElem++) {
if (CollisionCheck_SkipTouch(&atElem->info)) {
@@ -2288,8 +2288,8 @@ void CollisionCheck_AC_TrisVsQuad(PlayState* play, CollisionCheckContext* colCtx
if (CollisionCheck_NoSharedFlags(&atElem->info, &ac->info)) {
continue;
}
if (Math3d_ColTriTri(&D_801EDE40, &atElem->dim, &D_801EDE30) != 0 ||
Math3d_ColTriTri(&D_801EDE78, &atElem->dim, &D_801EDE30) != 0) {
if (Math3D_TriVsTriIntersect(&D_801EDE40, &atElem->dim, &D_801EDE30) != 0 ||
Math3D_TriVsTriIntersect(&D_801EDE78, &atElem->dim, &D_801EDE30) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -2323,7 +2323,7 @@ void CollisionCheck_AC_TrisVsSphere(PlayState* play, CollisionCheckContext* colC
if (CollisionCheck_NoSharedFlags(&atElem->info, &ac->info)) {
continue;
}
if (Math3D_ColSphereTri(&ac->dim.worldSphere, &atElem->dim, &hitPos) != 0) {
if (Math3D_TriVsSphIntersect(&ac->dim.worldSphere, &atElem->dim, &hitPos) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -2348,8 +2348,8 @@ void CollisionCheck_AC_QuadVsJntSph(PlayState* play, CollisionCheckContext* colC
if (CollisionCheck_SkipTouch(&at->info)) {
return;
}
Math3D_TriSetCoords(&D_801EDEC8, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]);
Math3D_TriSetCoords(&D_801EDF00, &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]);
Math3D_TriNorm(&D_801EDEC8, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]);
Math3D_TriNorm(&D_801EDF00, &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]);
for (acElem = ac->elements; acElem < &ac->elements[ac->count]; acElem++) {
if (CollisionCheck_SkipBump(&acElem->info)) {
@@ -2358,8 +2358,8 @@ void CollisionCheck_AC_QuadVsJntSph(PlayState* play, CollisionCheckContext* colC
if (CollisionCheck_NoSharedFlags(&at->info, &acElem->info)) {
continue;
}
if (Math3D_ColSphereTri(&acElem->dim.worldSphere, &D_801EDEC8, &hitPos) != 0 ||
Math3D_ColSphereTri(&acElem->dim.worldSphere, &D_801EDF00, &hitPos) != 0) {
if (Math3D_TriVsSphIntersect(&acElem->dim.worldSphere, &D_801EDEC8, &hitPos) != 0 ||
Math3D_TriVsSphIntersect(&acElem->dim.worldSphere, &D_801EDF00, &hitPos) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -2396,10 +2396,10 @@ void CollisionCheck_AC_QuadVsCyl(PlayState* play, CollisionCheckContext* colCtxt
return;
}
Math3D_TriSetCoords(&D_801EDF58, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]);
Math3D_TriSetCoords(&D_801EDF90, &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]);
Math3D_TriNorm(&D_801EDF58, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]);
Math3D_TriNorm(&D_801EDF90, &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]);
if (Math3D_ColCylinderTri(&ac->dim, &D_801EDF58, &D_801EDFE0) != 0) {
if (Math3D_CylTriVsIntersect(&ac->dim, &D_801EDF58, &D_801EDFE0) != 0) {
if (Collider_QuadSetNearestAC(play, at, &D_801EDFE0)) {
Vec3f atPos;
Vec3f acPos;
@@ -2410,7 +2410,7 @@ void CollisionCheck_AC_QuadVsCyl(PlayState* play, CollisionCheckContext* colCtxt
return;
}
}
if (Math3D_ColCylinderTri(&ac->dim, &D_801EDF90, &D_801EDFE0) != 0) {
if (Math3D_CylTriVsIntersect(&ac->dim, &D_801EDF90, &D_801EDFE0) != 0) {
if (Collider_QuadSetNearestAC(play, at, &D_801EDFE0)) {
Vec3f atPos;
Vec3f acPos;
@@ -2436,8 +2436,8 @@ void CollisionCheck_AC_QuadVsTris(PlayState* play, CollisionCheckContext* colCtx
return;
}
Math3D_TriSetCoords(&D_801EE000, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]);
Math3D_TriSetCoords(&D_801EE038, &at->dim.quad[1], &at->dim.quad[0], &at->dim.quad[2]);
Math3D_TriNorm(&D_801EE000, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]);
Math3D_TriNorm(&D_801EE038, &at->dim.quad[1], &at->dim.quad[0], &at->dim.quad[2]);
for (acElem = ac->elements; acElem < &ac->elements[ac->count]; acElem++) {
if (CollisionCheck_SkipBump(&acElem->info)) {
@@ -2447,8 +2447,8 @@ void CollisionCheck_AC_QuadVsTris(PlayState* play, CollisionCheckContext* colCtx
continue;
}
if ((Math3d_ColTriTri(&D_801EE000, &acElem->dim, &D_801EDFF0) != 0) ||
(Math3d_ColTriTri(&D_801EE038, &acElem->dim, &D_801EDFF0) != 0)) {
if ((Math3D_TriVsTriIntersect(&D_801EE000, &acElem->dim, &D_801EDFF0) != 0) ||
(Math3D_TriVsTriIntersect(&D_801EE038, &acElem->dim, &D_801EDFF0) != 0)) {
if (Collider_QuadSetNearestAC(play, at, &D_801EDFF0)) {
Vec3f atPos;
Vec3f acPos;
@@ -2483,14 +2483,14 @@ void CollisionCheck_AC_QuadVsQuad(PlayState* play, CollisionCheckContext* colCtx
return;
}
Math3D_TriSetCoords(&D_801EE0E8[0], &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]);
Math3D_TriSetCoords(&D_801EE0E8[1], &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]);
Math3D_TriSetCoords(&D_801EE070[0], &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]);
Math3D_TriSetCoords(&D_801EE070[1], &ac->dim.quad[2], &ac->dim.quad[1], &ac->dim.quad[0]);
Math3D_TriNorm(&D_801EE0E8[0], &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]);
Math3D_TriNorm(&D_801EE0E8[1], &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]);
Math3D_TriNorm(&D_801EE070[0], &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]);
Math3D_TriNorm(&D_801EE070[1], &ac->dim.quad[2], &ac->dim.quad[1], &ac->dim.quad[0]);
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
if (Math3d_ColTriTri(&D_801EE0E8[j], &D_801EE070[i], &D_801EE0D8) != 0 &&
if (Math3D_TriVsTriIntersect(&D_801EE0E8[j], &D_801EE070[i], &D_801EE0D8) != 0 &&
Collider_QuadSetNearestAC(play, at, &D_801EE0D8) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -2519,11 +2519,11 @@ void CollisionCheck_AC_QuadVsSphere(PlayState* play, CollisionCheckContext* colC
return;
}
Math3D_TriSetCoords(&D_801EE150, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]);
Math3D_TriSetCoords(&D_801EE188, &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]);
Math3D_TriNorm(&D_801EE150, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]);
Math3D_TriNorm(&D_801EE188, &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]);
if ((Math3D_ColSphereTri(&ac->dim.worldSphere, &D_801EE150, &hitPos) != 0) ||
(Math3D_ColSphereTri(&ac->dim.worldSphere, &D_801EE188, &hitPos) != 0)) {
if ((Math3D_TriVsSphIntersect(&ac->dim.worldSphere, &D_801EE150, &hitPos) != 0) ||
(Math3D_TriVsSphIntersect(&ac->dim.worldSphere, &D_801EE188, &hitPos) != 0)) {
if (Collider_QuadSetNearestAC(play, at, &hitPos)) {
Vec3f atPos;
Vec3f acPos;
@@ -2559,7 +2559,7 @@ void CollisionCheck_AC_SphereVsJntSph(PlayState* play, CollisionCheckContext* co
continue;
}
if (Math3D_ColSphereSphereIntersectAndDistance(&at->dim.worldSphere, &acElem->dim.worldSphere, &overlapSize,
if (Math3D_SphVsSphOverlapCenter(&at->dim.worldSphere, &acElem->dim.worldSphere, &overlapSize,
&centerDist) != 0) {
f32 acToHit;
Vec3f hitPos;
@@ -2602,7 +2602,7 @@ void CollisionCheck_AC_SphereVsCylinder(PlayState* play, CollisionCheckContext*
return;
}
if (Math3D_ColSphereCylinderDistanceAndAmount(&at->dim.worldSphere, &ac->dim, &overlapSize, &centerDist) != 0) {
if (Math3D_SphVsCylOverlapCenterDist(&at->dim.worldSphere, &ac->dim, &overlapSize, &centerDist) != 0) {
Vec3f hitPos;
Vec3f atPos;
Vec3f acPos;
@@ -2649,7 +2649,7 @@ void CollisionCheck_AC_SphereVsTris(PlayState* play, CollisionCheckContext* colC
if (CollisionCheck_NoSharedFlags(&at->info, &acElem->info)) {
continue;
}
if (Math3D_ColSphereTri(&at->dim.worldSphere, &acElem->dim, &hitPos) != 0) {
if (Math3D_TriVsSphIntersect(&at->dim.worldSphere, &acElem->dim, &hitPos) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -2676,11 +2676,11 @@ void CollisionCheck_AC_SphereVsQuad(PlayState* play, CollisionCheckContext* colC
return;
}
Math3D_TriSetCoords(&D_801EE6C8, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]);
Math3D_TriSetCoords(&D_801EE700, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]);
Math3D_TriNorm(&D_801EE6C8, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]);
Math3D_TriNorm(&D_801EE700, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]);
if (Math3D_ColSphereTri(&at->dim.worldSphere, &D_801EE6C8, &hitPos) != 0 ||
Math3D_ColSphereTri(&at->dim.worldSphere, &D_801EE700, &hitPos) != 0) {
if (Math3D_TriVsSphIntersect(&at->dim.worldSphere, &D_801EE6C8, &hitPos) != 0 ||
Math3D_TriVsSphIntersect(&at->dim.worldSphere, &D_801EE700, &hitPos) != 0) {
Vec3f atPos;
Vec3f acPos;
@@ -2710,7 +2710,7 @@ void CollisionCheck_AC_SphereVsSphere(PlayState* play, CollisionCheckContext* co
return;
}
if (Math3D_ColSphereSphereIntersectAndDistance(&at->dim.worldSphere, &ac->dim.worldSphere, &overlapSize,
if (Math3D_SphVsSphOverlapCenter(&at->dim.worldSphere, &ac->dim.worldSphere, &overlapSize,
&centerDist) != 0) {
f32 acToHit;
Vec3f hitPos;
@@ -3043,7 +3043,7 @@ void CollisionCheck_OC_JntSphVsJntSph(PlayState* play, CollisionCheckContext* co
if (!(rightElem->info.ocElemFlags & OCELEM_ON)) {
continue;
}
if (Math3D_ColSphereSphereIntersect(&leftElem->dim.worldSphere, &rightElem->dim.worldSphere,
if (Math3D_SphVsSphOverlap(&leftElem->dim.worldSphere, &rightElem->dim.worldSphere,
&overlap) != 0) {
Vec3f leftPos;
Vec3f rightPos;
@@ -3074,7 +3074,7 @@ void CollisionCheck_OC_JntSphVsCyl(PlayState* play, CollisionCheckContext* colCt
if (!(leftElem->info.ocElemFlags & OCELEM_ON)) {
continue;
}
if (Math3D_ColSphereCylinderDistance(&leftElem->dim.worldSphere, &right->dim, &overlap) != 0) {
if (Math3D_SphVsCylOverlapDist(&leftElem->dim.worldSphere, &right->dim, &overlap) != 0) {
Vec3f leftPos;
Vec3f rightPos;
@@ -3103,7 +3103,7 @@ void CollisionCheck_OC_JntSphVsSphere(PlayState* play, CollisionCheckContext* co
if (!(leftElem->info.ocElemFlags & OCELEM_ON)) {
continue;
}
if (Math3D_ColSphereSphereIntersect(&leftElem->dim.worldSphere, &right->dim.worldSphere, &overlap) != 0) {
if (Math3D_SphVsSphOverlap(&leftElem->dim.worldSphere, &right->dim.worldSphere, &overlap) != 0) {
Vec3f leftPos;
Vec3f rightPos;
@@ -3133,7 +3133,7 @@ void CollisionCheck_OC_CylVsCyl(PlayState* play, CollisionCheckContext* colCtxt,
if ((left->base.ocFlags1 & OCELEM_ON) && (right->base.ocFlags1 & OCELEM_ON) &&
(left->info.ocElemFlags & OCELEM_ON) && (right->info.ocElemFlags & OCELEM_ON)) {
if (Math3D_ColCylinderCylinderAmount(&left->dim, &right->dim, &overlap) != 0) {
if (Math3D_CylOutsideCyl(&left->dim, &right->dim, &overlap) != 0) {
Vec3f leftPos;
Vec3f rightPos;
@@ -3155,7 +3155,7 @@ void CollisionCheck_OC_CylVsSphere(PlayState* play, CollisionCheckContext* colCt
if ((left->base.ocFlags1 & OCELEM_ON) && (left->info.ocElemFlags & OCELEM_ON) &&
(right->base.ocFlags1 & OCELEM_ON) && (right->info.ocElemFlags & OCELEM_ON)) {
if (Math3D_ColSphereCylinderDistance(&right->dim.worldSphere, &left->dim, &overlap) != 0) {
if (Math3D_SphVsCylOverlapDist(&right->dim.worldSphere, &left->dim, &overlap) != 0) {
Vec3f leftPos;
Vec3f rightPos;
@@ -3191,7 +3191,7 @@ void CollisionCheck_OC_SphereVsSphere(PlayState* play, CollisionCheckContext* co
if ((left->base.ocFlags1 & OCELEM_ON) && (left->info.ocElemFlags & OCELEM_ON) &&
(right->base.ocFlags1 & OCELEM_ON) && (right->info.ocElemFlags & OCELEM_ON)) {
if (Math3D_ColSphereSphereIntersect(&left->dim.worldSphere, &right->dim.worldSphere, &overlap) != 0) {
if (Math3D_SphVsSphOverlap(&left->dim.worldSphere, &right->dim.worldSphere, &overlap) != 0) {
Vec3f leftPos;
Vec3f rightPos;
@@ -3496,7 +3496,7 @@ s32 CollisionCheck_LineOC_Cyl(PlayState* play, CollisionCheckContext* colChkCtx,
return 0;
}
if (func_8017E350(&cylinder->dim, a, b, &D_801EDF38, &D_801EDF48) != 0) {
if (Math3D_CylVsLineSeg(&cylinder->dim, a, b, &D_801EDF38, &D_801EDF48) != 0) {
return 1;
}
@@ -3627,7 +3627,7 @@ void Collider_SetTrisVertices(ColliderTris* collider, s32 index, Vec3f* a, Vec3f
Math_Vec3f_Copy(&element->dim.vtx[0], a);
Math_Vec3f_Copy(&element->dim.vtx[1], b);
Math_Vec3f_Copy(&element->dim.vtx[2], c);
Math3D_UnitNormalVector(a, b, c, &nx, &ny, &nz, &originDist);
Math3D_DefPlane(a, b, c, &nx, &ny, &nz, &originDist);
element->dim.plane.normal.x = nx;
element->dim.plane.normal.y = ny;
element->dim.plane.normal.z = nz;
+2 -2
View File
@@ -57,8 +57,8 @@ void func_800AE930(CollisionContext* colCtx, EffectTireMark* this, Vec3f* pos, f
sp48.y = spB8.y;
sp48.z = spB8.z;
if ((Math3D_LineVsLineClosestTwoPoints(&sp84, &sp90, &sp54, &sp60, &sp6C, &sp30) != 0) &&
(Math3D_LineVsLineClosestTwoPoints(&sp84, &sp90, &sp3C, &sp48, &sp78, &sp30) != 0)) {
if ((Math3D_LineSegMakePerpLineSeg(&sp84, &sp90, &sp54, &sp60, &sp6C, &sp30) != 0) &&
(Math3D_LineSegMakePerpLineSeg(&sp84, &sp90, &sp3C, &sp48, &sp78, &sp30) != 0)) {
if (!(spAC->flags & 2)) {
spAC->flags |= 1;
}
+1 -1
View File
@@ -577,7 +577,7 @@ s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex) {
diffZ = points[index + 1].z - points[index - 1].z;
}
func_8017B7F8(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
Math3D_RotateXZPlane(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
if (((px * actor->world.pos.x) + (pz * actor->world.pos.z) + d) > 0.0f) {
reached = true;
}
@@ -179,7 +179,7 @@ s32 func_80BECD10(EnAkindonuts* this, Path* path, s32 arg2) {
phi_f14 = sp5C[idx + 1].z - sp5C[idx - 1].z;
}
func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
Math3D_RotateXZPlane(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
sp50 = true;
}
@@ -170,7 +170,7 @@ s32 func_8089F908(EnBubble* this) {
void EnBubble_Vec3fNormalizedReflect(Vec3f* vec1, Vec3f* vec2, Vec3f* dest) {
f32 norm;
func_80179F64(vec1, vec2, dest);
Math3D_Vec3fReflect(vec1, vec2, dest);
norm = sqrtf(SQ(dest->x) + SQ(dest->y) + SQ(dest->z));
if (norm != 0.0f) {
dest->x /= norm;
+1 -1
View File
@@ -280,7 +280,7 @@ s32 EnDg_HasReachedPoint(EnDg* this, Path* path, s32 pointIndex) {
diffZ = points[currentPoint + 1].z - points[currentPoint - 1].z;
}
func_8017B7F8(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
Math3D_RotateXZPlane(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
if (((this->actor.world.pos.x * px) + (pz * this->actor.world.pos.z) + d) > 0.0f) {
reached = true;
+1 -1
View File
@@ -310,7 +310,7 @@ s32 func_80B3B648(EnGg2* this, Path* path, s32 arg2_) {
phi_f14 = points[arg2 + 1].z - points[arg2 - 1].z;
}
func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
Math3D_RotateXZPlane(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
ret = true;
+1 -1
View File
@@ -374,7 +374,7 @@ s32 func_80B50C78(EnGk* this, Path* path, s32 arg2_) {
phi_f14 = sp5C[arg2 + 1].z - sp5C[arg2 - 1].z;
}
func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
Math3D_RotateXZPlane(&sp30, RAD_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
ret = true;
@@ -327,7 +327,7 @@ void func_8087B7C0(EnHorse* this, PlayState* play, Path* path) {
phi_f14 = spA0[this->curRaceWaypoint + 1].z - spA0[this->curRaceWaypoint - 1].z;
}
func_8017B7F8(&sp8C, Math_Atan2S(phi_f12, phi_f14), &sp7C, &sp78, &sp74);
Math3D_RotateXZPlane(&sp8C, Math_Atan2S(phi_f12, phi_f14), &sp7C, &sp78, &sp74);
if (((this->actor.world.pos.x * sp7C) + (sp78 * this->actor.world.pos.z) + sp74) > 0.0f) {
this->curRaceWaypoint++;
@@ -2809,7 +2809,7 @@ s32 EnHorse_UpdateHbaRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceInfo
f32 d;
EnHorse_RaceWaypointPos(raceInfo->waypoints, this->curRaceWaypoint, &pos);
func_8017B7F8(&pos, raceInfo->waypoints[this->curRaceWaypoint].angle, &px, &pz, &d);
Math3D_RotateXZPlane(&pos, raceInfo->waypoints[this->curRaceWaypoint].angle, &px, &pz, &d);
if ((this->curRaceWaypoint >= (raceInfo->numWaypoints - 1)) &&
(Math3D_Vec3f_DistXYZ(&pos, &this->actor.world.pos) < DREG(8))) {
@@ -257,21 +257,21 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
}
if (!(this->unk_164 & 0x1000)) {
if (Math3D_XZBoundCheck(D_808F9BAC[0], D_808F9BAC[1], D_808F9BAC[2], D_808F9BAC[3],
if (Math3D_PointInSquare2D(D_808F9BAC[0], D_808F9BAC[1], D_808F9BAC[2], D_808F9BAC[3],
this->horse1->actor.world.pos.x, this->horse1->actor.world.pos.z)) {
this->unk_164 |= 0x1000;
}
}
if (!(this->unk_164 & 0x2000) && (this->unk_164 & 0x1000)) {
if (Math3D_XZBoundCheck(D_808F9BBC[0], D_808F9BBC[1], D_808F9BBC[2], D_808F9BBC[3],
if (Math3D_PointInSquare2D(D_808F9BBC[0], D_808F9BBC[1], D_808F9BBC[2], D_808F9BBC[3],
this->horse1->actor.world.pos.x, this->horse1->actor.world.pos.z)) {
this->unk_164 |= 0x2000;
}
}
if (!(this->unk_164 & 0x4000) && (this->unk_164 & 0x2000)) {
if (Math3D_XZBoundCheck(D_808F9BCC[0], D_808F9BCC[1], D_808F9BCC[2], D_808F9BCC[3],
if (Math3D_PointInSquare2D(D_808F9BCC[0], D_808F9BCC[1], D_808F9BCC[2], D_808F9BCC[3],
this->horse1->actor.world.pos.x, this->horse1->actor.world.pos.z)) {
this->unk_164 |= 0x4000;
}
@@ -290,21 +290,21 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
}
if (!(this->unk_164 & 0x80000)) {
if (Math3D_XZBoundCheck(D_808F9BAC[0], D_808F9BAC[1], D_808F9BAC[2], D_808F9BAC[3],
if (Math3D_PointInSquare2D(D_808F9BAC[0], D_808F9BAC[1], D_808F9BAC[2], D_808F9BAC[3],
this->horse2->actor.world.pos.x, this->horse2->actor.world.pos.z)) {
this->unk_164 |= 0x80000;
}
}
if (!(this->unk_164 & 0x100000) && (this->unk_164 & 0x80000)) {
if (Math3D_XZBoundCheck(D_808F9BBC[0], D_808F9BBC[1], D_808F9BBC[2], D_808F9BBC[3],
if (Math3D_PointInSquare2D(D_808F9BBC[0], D_808F9BBC[1], D_808F9BBC[2], D_808F9BBC[3],
this->horse2->actor.world.pos.x, this->horse2->actor.world.pos.z)) {
this->unk_164 |= 0x100000;
}
}
if (!(this->unk_164 & 0x200000) && (this->unk_164 & 0x100000)) {
if (Math3D_XZBoundCheck(D_808F9BCC[0], D_808F9BCC[1], D_808F9BCC[2], D_808F9BCC[3],
if (Math3D_PointInSquare2D(D_808F9BCC[0], D_808F9BCC[1], D_808F9BCC[2], D_808F9BCC[3],
this->horse2->actor.world.pos.x, this->horse2->actor.world.pos.z)) {
this->unk_164 |= 0x200000;
}
@@ -322,19 +322,19 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
this->unk_174 = 60;
}
if (!(this->unk_164 & 0x20) && Math3D_XZBoundCheck(D_808F9BAC[0], D_808F9BAC[1], D_808F9BAC[2], D_808F9BAC[3],
if (!(this->unk_164 & 0x20) && Math3D_PointInSquare2D(D_808F9BAC[0], D_808F9BAC[1], D_808F9BAC[2], D_808F9BAC[3],
horse->actor.world.pos.x, horse->actor.world.pos.z)) {
this->unk_164 |= 0x20;
}
if (!(this->unk_164 & 0x40) && (this->unk_164 & 0x20) &&
Math3D_XZBoundCheck(D_808F9BBC[0], D_808F9BBC[1], D_808F9BBC[2], D_808F9BBC[3], horse->actor.world.pos.x,
Math3D_PointInSquare2D(D_808F9BBC[0], D_808F9BBC[1], D_808F9BBC[2], D_808F9BBC[3], horse->actor.world.pos.x,
horse->actor.world.pos.z)) {
this->unk_164 |= 0x40;
}
if (!(this->unk_164 & 0x80) && (this->unk_164 & 0x40) &&
Math3D_XZBoundCheck(D_808F9BCC[0], D_808F9BCC[1], D_808F9BCC[2], D_808F9BCC[3], horse->actor.world.pos.x,
Math3D_PointInSquare2D(D_808F9BCC[0], D_808F9BCC[1], D_808F9BCC[2], D_808F9BCC[3], horse->actor.world.pos.x,
horse->actor.world.pos.z)) {
this->unk_164 |= 0x80;
}
+1 -1
View File
@@ -242,7 +242,7 @@ s32 EnJg_ReachedPoint(EnJg* this, Path* path, s32 pointIndex) {
diffZ = points[currentPoint + 1].z - points[currentPoint - 1].z;
}
func_8017B7F8(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
Math3D_RotateXZPlane(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
if (((this->actor.world.pos.x * px) + (pz * this->actor.world.pos.z) + d) > 0.0f) {
reached = true;
@@ -69,7 +69,7 @@ static Vec3f sCheckpointPositions[] = {
* The range extends a little bit beyond the finish line's in-game visual.
*/
s32 EnMttag_IsInFinishLine(Vec3f* pos) {
return Math3D_XZBoundCheck(-1261.0f, -901.0f, -1600.0f, -1520.0f, pos->x, pos->z);
return Math3D_PointInSquare2D(-1261.0f, -901.0f, -1600.0f, -1520.0f, pos->x, pos->z);
}
/**
@@ -78,11 +78,11 @@ s32 EnMttag_IsInFinishLine(Vec3f* pos) {
*/
s32 EnMttag_CheckPlayerCheatStatus(Vec3f* pos) {
if (!CHECK_EVENTINF(EVENTINF_10)) {
if (Math3D_XZBoundCheck(-466.0f, -386.0f, -687.0f, 193.0f, pos->x, pos->z)) {
if (Math3D_PointInSquare2D(-466.0f, -386.0f, -687.0f, 193.0f, pos->x, pos->z)) {
// The race hasn't started yet, but the player is beyond the starting line.
return GORON_RACE_CHEAT_FALSE_START;
}
} else if (Math3D_XZBoundCheck(-1127.0f, -1007.0f, -867.0f, -787.0f, pos->x, pos->z)) {
} else if (Math3D_PointInSquare2D(-1127.0f, -1007.0f, -867.0f, -787.0f, pos->x, pos->z)) {
// The goal is actually quite close to the start, just behind a large wall.
// This checks if the player is in an area "behind" the goal that is not accessible
// in normal play; it can only be reached by climbing the wall somehow. Perhaps they
@@ -602,11 +602,11 @@ void func_80A69ADC(Actor* thisx) {
s32 pad2;
if (this->unk_358 < 1.0f) {
sp44 = Math3D_SignedDistanceFromPlane(
sp44 = Math3D_PlaneF(
this->unk_310.x, this->unk_310.y, this->unk_310.z,
func_80A69AA8(this->unk_310.x, this->unk_310.y, this->unk_310.z, &this->actor.world.pos),
&bean->dyna.actor.world.pos);
sp40 = Math3D_SignedDistanceFromPlane(
sp40 = Math3D_PlaneF(
this->unk_328.x, this->unk_328.y, this->unk_328.z,
func_80A69AA8(this->unk_328.x, this->unk_328.y, this->unk_328.z, &this->actor.world.pos),
&bean->dyna.actor.world.pos);
@@ -648,11 +648,11 @@ void func_80A69D3C(EnMushi2* this) {
f32 sp38;
if ((this->unk_34C != NULL) && (this->unk_358 > 0.999f)) {
sp40 = Math3D_SignedDistanceFromPlane(
sp40 = Math3D_PlaneF(
this->unk_310.x, this->unk_310.y, this->unk_310.z,
func_80A69AA8(this->unk_310.x, this->unk_310.y, this->unk_310.z, &this->actor.world.pos),
&this->unk_34C->dyna.actor.world.pos);
sp3C = Math3D_SignedDistanceFromPlane(
sp3C = Math3D_PlaneF(
this->unk_328.x, this->unk_328.y, this->unk_328.z,
func_80A69AA8(this->unk_328.x, this->unk_328.y, this->unk_328.z, &this->actor.world.pos),
&this->unk_34C->dyna.actor.world.pos);
+1 -1
View File
@@ -614,7 +614,7 @@ void func_80BF4AB8(EnRg* this, PlayState* play) {
}
s32 func_80BF4D64(Vec3f* arg0) {
return Math3D_XZBoundCheck(-1261.0f, -901.0f, -1600.0f, -1520.0f, arg0->x, arg0->z);
return Math3D_PointInSquare2D(-1261.0f, -901.0f, -1600.0f, -1520.0f, arg0->x, arg0->z);
}
s32 func_80BF4DA8(EnRg* this) {
@@ -163,7 +163,7 @@ s32 EnRuppecrow_ReachedPointClockwise(EnRuppecrow* this, Path* path, s32 pointIn
}
}
func_8017B7F8(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
Math3D_RotateXZPlane(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
if (((this->actor.world.pos.x * px) + (pz * this->actor.world.pos.z) + d) > 0.0f) {
reached = true;
}
@@ -198,7 +198,7 @@ s32 EnRuppecrow_ReachedPointCounterClockwise(EnRuppecrow* this, Path* path, s32
}
}
func_8017B7F8(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
Math3D_RotateXZPlane(&point, RAD_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
if (((this->actor.world.pos.x * px) + (pz * this->actor.world.pos.z) + d) > 0.0f) {
reached = true;
}
@@ -192,7 +192,7 @@ s32 func_80BCD334(EnScopecrow* this, Path* path, s32 pointIndex) {
phi_fa1 = points[index + 1].z - points[index - 1].z;
}
func_8017B7F8(&sp30, RAD_TO_BINANG(func_80086B30(phi_fa0, phi_fa1)), &sp3C.z, &sp3C.y, &sp3C.x);
Math3D_RotateXZPlane(&sp30, RAD_TO_BINANG(func_80086B30(phi_fa0, phi_fa1)), &sp3C.z, &sp3C.y, &sp3C.x);
if (((this->actor.world.pos.x * sp3C.z) + (sp3C.y * this->actor.world.pos.z) + sp3C.x) > 0.0f) {
ret = true;

Some files were not shown because too many files have changed in this diff Show More