project cleanup (#2895)

* some wii OS fixes

* remove old dol2asm comments

* remove dol2asm.h

* remove function address comments

* normalize ATTRIBUTE_ALIGN usage

* DECL_WEAK macro

* fix gcc attribute weak macro

* wrap more mwcc specific things in ifdefs

* fixes

* fix revo sdk version flags

* fixes
This commit is contained in:
TakaRikka
2025-11-30 14:23:42 -08:00
committed by GitHub
parent 434415337d
commit a6e76c0841
2375 changed files with 24683 additions and 71069 deletions
-143
View File
@@ -12,26 +12,20 @@
#include "SSystem/SComponent/c_math.h"
#include "SSystem/SComponent/c_sxyz.h"
/* 80451180-80451188 000680 0004+04 29/29 44/44 65/65 .sbss G_CM3D_F_ABS_MIN */
const f32 G_CM3D_F_ABS_MIN = 32 * FLT_EPSILON;
/* 80268560-802685B0 262EA0 0050+00 2/2 0/0 0/0 .text cM3d_InDivPos1__FPC3VecPC3VecfP3Vec
*/
void cM3d_InDivPos1(const Vec* pVecA, const Vec* pVecB, f32 pF, Vec* pOut) {
Vec tmp;
VECScale(pVecB, &tmp, pF);
VECAdd(&tmp, pVecA, pOut);
}
/* 802685B0-80268614 262EF0 0064+00 2/2 1/1 2/2 .text cM3d_InDivPos2__FPC3VecPC3VecfP3Vec
*/
void cM3d_InDivPos2(const Vec* pVecA, const Vec* pVecB, f32 pF, Vec* pOut) {
Vec tmp;
VECSubtract(pVecB, pVecA, &tmp);
cM3d_InDivPos1(pVecA, &tmp, pF, pOut);
}
/* 80268614-8026862C 262F54 0018+00 3/3 4/4 0/0 .text cM3d_Len2dSq__Fffff */
f32 cM3d_Len2dSq(f32 pX1, f32 pY1, f32 pX2, f32 pY2) {
f32 xDiff = pX1 - pX2;
f32 yDiff = pY1 - pY2;
@@ -42,8 +36,6 @@ static f32 dummy(f32 x) {
return sqrtf(x);
}
/* 8026862C-80268710 262F6C 00E4+00 0/0 10/10 3/3 .text cM3d_Len2dSqPntAndSegLine__FffffffPfPfPf
*/
bool cM3d_Len2dSqPntAndSegLine(f32 param_1, f32 param_2, f32 param_3, f32 param_4, f32 p5, f32 p6,
f32* param_7, f32* param_8, f32* param_9) {
bool retVal = false;
@@ -65,8 +57,6 @@ bool cM3d_Len2dSqPntAndSegLine(f32 param_1, f32 param_2, f32 param_3, f32 param_
}
}
/* 80268710-80268814 263050 0104+00 2/2 8/8 9/9 .text
* cM3d_Len3dSqPntAndSegLine__FPC8cM3dGLinPC3VecP3VecPf */
bool cM3d_Len3dSqPntAndSegLine(const cM3dGLin* pLine, const Vec* pVec, Vec* pOutVec, f32* pOutF) {
bool retVal = false;
Vec tmp;
@@ -92,8 +82,6 @@ bool cM3d_Len3dSqPntAndSegLine(const cM3dGLin* pLine, const Vec* pVec, Vec* pOut
}
}
/* 80268814-80268894 263154 0080+00 1/1 3/3 0/0 .text cM3d_SignedLenPlaAndPos__FPC8cM3dGPlaPC3Vec
*/
f32 cM3d_SignedLenPlaAndPos(const cM3dGPla* pPlane, const Vec* pPosition) {
f32 mag = VECMag(pPlane->GetNP());
if (cM3d_IsZero(mag)) {
@@ -103,13 +91,10 @@ f32 cM3d_SignedLenPlaAndPos(const cM3dGPla* pPlane, const Vec* pPosition) {
}
}
/* 80268894-802688B4 2631D4 0020+00 11/11 2/2 2/2 .text cM3d_VectorProduct2d__Fffffff */
f32 cM3d_VectorProduct2d(f32 pX1, f32 pY1, f32 pX2, f32 pY2, f32 pX3, f32 pY3) {
return (pX2 - pX1) * (pY3 - pY1) - (pY2 - pY1) * (pX3 - pX1);
}
/* 802688B4-8026891C 2631F4 0068+00 0/0 0/0 1/1 .text
* cM3d_VectorProduct__FPC4cXyzPC4cXyzPC4cXyzP4cXyz */
void cM3d_VectorProduct(const cXyz* pVecA, const cXyz* pVecB, const cXyz* pVecC, cXyz* pVecOut) {
Vec tmp1;
Vec tmp2;
@@ -118,7 +103,6 @@ void cM3d_VectorProduct(const cXyz* pVecA, const cXyz* pVecB, const cXyz* pVecC,
VECCrossProduct(&tmp1, &tmp2, pVecOut);
}
/* 8026891C-802689E8 26325C 00CC+00 0/0 2/2 0/0 .text cM3d_CalcPla__FPC3VecPC3VecPC3VecP3VecPf */
void cM3d_CalcPla(const Vec* pVecA, const Vec* pVecB, const Vec* pVecC, Vec* pVecOut, f32* pD) {
Vec tmp2;
Vec tmp1;
@@ -151,8 +135,6 @@ inline bool cM3d_CrossNumSection(f32 lMinX, f32 lMaxX, f32 rMinX, f32 rMaxX) {
}
}
/* 802689E8-80268B0C 263328 0124+00 0/0 4/4 0/0 .text cM3d_Cross_AabAab__FPC8cM3dGAabPC8cM3dGAab
*/
bool cM3d_Cross_AabAab(const cM3dGAab* pAabA, const cM3dGAab* pAabB) {
if (cM3d_CrossNumSection(pAabA->GetMinP()->x, pAabA->GetMaxP()->x, pAabB->GetMinP()->x,
pAabB->GetMaxP()->x) &&
@@ -167,8 +149,6 @@ bool cM3d_Cross_AabAab(const cM3dGAab* pAabA, const cM3dGAab* pAabB) {
}
}
/* 80268B0C-80268BB4 26344C 00A8+00 0/0 4/4 0/0 .text cM3d_Cross_AabCyl__FPC8cM3dGAabPC8cM3dGCyl
*/
bool cM3d_Cross_AabCyl(const cM3dGAab* pAab, const cM3dGCyl* pCyl) {
if (pAab->GetMinP()->x > pCyl->GetCP()->x + pCyl->GetR()) {
return false;
@@ -187,8 +167,6 @@ bool cM3d_Cross_AabCyl(const cM3dGAab* pAab, const cM3dGCyl* pCyl) {
}
}
/* 80268BB4-80268C5C 2634F4 00A8+00 0/0 2/2 0/0 .text cM3d_Cross_AabSph__FPC8cM3dGAabPC8cM3dGSph
*/
bool cM3d_Cross_AabSph(const cM3dGAab* pAab, const cM3dGSph* pSph) {
f32 radius = pSph->GetR();
f32 cx = pSph->GetC().x;
@@ -214,8 +192,6 @@ bool cM3d_Cross_AabSph(const cM3dGAab* pAab, const cM3dGSph* pSph) {
return true;
}
/* 80268C5C-80268ED4 26359C 0278+00 3/3 0/0 0/0 .text
* cM3d_Check_LinLin__FPC8cM3dGLinPC8cM3dGLinPfPf */
int cM3d_Check_LinLin(const cM3dGLin* lin_a, const cM3dGLin* lin_b, f32* dst_a, f32* dst_b) {
Vec linAVec;
Vec linBVec;
@@ -268,8 +244,6 @@ int cM3d_Check_LinLin(const cM3dGLin* lin_a, const cM3dGLin* lin_b, f32* dst_a,
}
/* 80268ED4-80268F34 263814 0060+00 2/2 0/0 0/0 .text
* cM3d_CrossInfLineVsInfPlane_proc__FffPC3VecPC3VecP3Vec */
static bool cM3d_CrossInfLineVsInfPlane_proc(f32 pFloatA, f32 pFloatB, const Vec* pVecA,
const Vec* pVecB, Vec* pVecOut) {
if (cM3d_IsZero(pFloatA - pFloatB)) {
@@ -281,8 +255,6 @@ static bool cM3d_CrossInfLineVsInfPlane_proc(f32 pFloatA, f32 pFloatB, const Vec
}
}
/* 80268F34-80269050 263874 011C+00 3/3 1/1 0/0 .text
* cM3d_Cross_LinPla__FPC8cM3dGLinPC8cM3dGPlaP3Vecbb */
bool cM3d_Cross_LinPla(const cM3dGLin* lin, const cM3dGPla* pla, Vec* dst, bool a, bool b) {
f32 startVal = pla->getPlaneFunc(&lin->GetStartP());
f32 endVal = pla->getPlaneFunc(&lin->GetEndP());
@@ -304,82 +276,56 @@ bool cM3d_Cross_LinPla(const cM3dGLin* lin, const cM3dGPla* pla, Vec* dst, bool
}
}
/* 80455140-80455144 003740 0004+00 1/1 0/0 0/0 .sdata2 BPCP_OUTCODE0 */
static u32 const BPCP_OUTCODE0 = 0x00000001;
/* 80455144-80455148 003744 0004+00 1/1 0/0 0/0 .sdata2 BPCP_OUTCODE1 */
static u32 const BPCP_OUTCODE1 = 0x00000002;
/* 80455148-8045514C 003748 0004+00 1/1 0/0 0/0 .sdata2 BPCP_OUTCODE4 */
static u32 const BPCP_OUTCODE4 = 0x00000010;
/* 8045514C-80455150 00374C 0004+00 1/1 0/0 0/0 .sdata2 BPCP_OUTCODE5 */
static u32 const BPCP_OUTCODE5 = 0x00000020;
/* 80455150-80455154 003750 0004+00 1/1 0/0 0/0 .sdata2 BPCP_OUTCODE2 */
static u32 const BPCP_OUTCODE2 = 0x00000004;
/* 80455154-80455158 003754 0004+00 1/1 0/0 0/0 .sdata2 BPCP_OUTCODE3 */
static u32 const BPCP_OUTCODE3 = 0x00000008;
/* 80455158-8045515C 003758 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE0 */
static u32 const BEVEL2D_OUTCODE0 = 0x00000001;
/* 8045515C-80455160 00375C 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE1 */
static u32 const BEVEL2D_OUTCODE1 = 0x00000002;
/* 80455160-80455164 003760 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE2 */
static u32 const BEVEL2D_OUTCODE2 = 0x00000004;
/* 80455164-80455168 003764 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE3 */
static u32 const BEVEL2D_OUTCODE3 = 0x00000008;
/* 80455168-8045516C 003768 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE4 */
static u32 const BEVEL2D_OUTCODE4 = 0x00000010;
/* 8045516C-80455170 00376C 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE5 */
static u32 const BEVEL2D_OUTCODE5 = 0x00000020;
/* 80455170-80455174 003770 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE6 */
static u32 const BEVEL2D_OUTCODE6 = 0x00000040;
/* 80455174-80455178 003774 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE7 */
static u32 const BEVEL2D_OUTCODE7 = 0x00000080;
/* 80455178-8045517C 003778 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE8 */
static u32 const BEVEL2D_OUTCODE8 = 0x00000100;
/* 8045517C-80455180 00377C 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE9 */
static u32 const BEVEL2D_OUTCODE9 = 0x00000200;
/* 80455180-80455184 003780 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE10 */
static u32 const BEVEL2D_OUTCODE10 = 0x00000400;
/* 80455184-80455188 003784 0004+00 1/1 0/0 0/0 .sdata2 BEVEL2D_OUTCODE11 */
static u32 const BEVEL2D_OUTCODE11 = 0x00000800;
/* 80455188-8045518C 003788 0004+00 1/1 0/0 0/0 .sdata2 BEVEL3D_OUTCODE0 */
static u32 const BEVEL3D_OUTCODE0 = 0x00000001;
/* 8045518C-80455190 00378C 0004+00 1/1 0/0 0/0 .sdata2 BEVEL3D_OUTCODE1 */
static u32 const BEVEL3D_OUTCODE1 = 0x00000002;
/* 80455190-80455194 003790 0004+00 1/1 0/0 0/0 .sdata2 BEVEL3D_OUTCODE2 */
static u32 const BEVEL3D_OUTCODE2 = 0x00000004;
/* 80455194-80455198 003794 0004+00 1/1 0/0 0/0 .sdata2 BEVEL3D_OUTCODE3 */
static u32 const BEVEL3D_OUTCODE3 = 0x00000008;
/* 80455198-8045519C 003798 0004+00 1/1 0/0 0/0 .sdata2 BEVEL3D_OUTCODE4 */
static u32 const BEVEL3D_OUTCODE4 = 0x00000010;
/* 8045519C-804551A0 00379C 0004+00 1/1 0/0 0/0 .sdata2 BEVEL3D_OUTCODE5 */
static u32 const BEVEL3D_OUTCODE5 = 0x00000020;
/* 804551A0-804551A4 0037A0 0004+00 1/1 0/0 0/0 .sdata2 BEVEL3D_OUTCODE6 */
static u32 const BEVEL3D_OUTCODE6 = 0x00000040;
/* 804551A4-804551A8 0037A4 0004+00 1/1 0/0 0/0 .sdata2 BEVEL3D_OUTCODE7 */
static u32 const BEVEL3D_OUTCODE7 = 0x00000080;
inline u32 cM3d_CheckBoxEdgePlane_Bevel2DCheck(Vec const* param_0, Vec const* param_1,
@@ -454,8 +400,6 @@ inline u32 cM3d_CheckBoxEdgePlane_Bevel3DCheck(Vec const* param_0, Vec const* pa
return ret;
}
/* 80269050-80269C2C 263990 0BDC+00 0/0 2/2 0/0 .text
* cM3d_Cross_MinMaxBoxLine__FPC3VecPC3VecPC3VecPC3Vec */
bool cM3d_Cross_MinMaxBoxLine(Vec const* param_0, Vec const* param_1, Vec const* param_2,
Vec const* param_3) {
u32 uVar3 = 0;
@@ -623,8 +567,6 @@ bool cM3d_Cross_MinMaxBoxLine(Vec const* param_0, Vec const* param_1, Vec const*
return false;
}
/* 80269C2C-80269D64 26456C 0138+00 1/1 0/0 0/0 .text
* cM3d_InclusionCheckPosIn3PosBox3d__FPC3VecPC3VecPC3VecPC3Vecf */
bool cM3d_InclusionCheckPosIn3PosBox3d(const Vec* pVecA, const Vec* pVecB, const Vec* pVecC,
const Vec* pVecD, f32 pF) {
f32 min, max;
@@ -678,8 +620,6 @@ bool cM3d_InclusionCheckPosIn3PosBox3d(const Vec* pVecA, const Vec* pVecB, const
return true;
}
/* 80269D64-80269E18 2646A4 00B4+00 11/11 0/0 0/0 .text
* cM3d_InclusionCheckPosIn3PosBox2d__Ffffffffff */
static bool cM3d_InclusionCheckPosIn3PosBox2d(f32 param_1, f32 param_2, f32 param_3,
f32 param_4, f32 param_5, f32 param_6,
f32 param_7, f32 param_8, f32 param_9) {
@@ -726,7 +666,6 @@ static bool cM3d_InclusionCheckPosIn3PosBox2d(f32 param_1, f32 param_2, f32 para
return true;
}
/* 80269E18-80269FBC 264758 01A4+00 1/1 0/0 0/0 .text cM3d_CrossX_Tri__FPC8cM3dGTriPC3Vecf */
static bool cM3d_CrossX_Tri(cM3dGTri const* tri, Vec const* vec, f32 param_2) {
if (cM3d_IsZero(tri->GetNP()->x)) {
return false;
@@ -756,8 +695,6 @@ static bool cM3d_CrossX_Tri(cM3dGTri const* tri, Vec const* vec, f32 param_2) {
return false;
}
/* 80269FBC-8026A160 2648FC 01A4+00 1/1 0/0 0/0 .text cM3d_CrossX_Tri__FPC8cM3dGTriPC3Vec
*/
static bool cM3d_CrossX_Tri(cM3dGTri const* tri, Vec const* vec) {
if (cM3d_IsZero(tri->GetNP()->x)) {
return false;
@@ -787,8 +724,6 @@ static bool cM3d_CrossX_Tri(cM3dGTri const* tri, Vec const* vec) {
return false;
}
/* 8026A160-8026A2E4 264AA0 0184+00 1/1 0/0 0/0 .text cM3d_CrossX_LinTri_proc__FPC8cM3dGTriPC3Vec
*/
static bool cM3d_CrossX_LinTri_proc(cM3dGTri const* tri, Vec const* vec) {
if (!cM3d_InclusionCheckPosIn3PosBox2d(tri->mA.y, tri->mA.z, tri->mB.y, tri->mB.z,
tri->mC.y, tri->mC.z, vec->y, vec->z, 0.005f)) {
@@ -814,8 +749,6 @@ static bool cM3d_CrossX_LinTri_proc(cM3dGTri const* tri, Vec const* vec) {
return false;
}
/* 8026A2E4-8026A488 264C24 01A4+00 2/2 0/0 1/1 .text cM3d_CrossY_Tri__FPC8cM3dGTriPC3Vec
*/
bool cM3d_CrossY_Tri(cM3dGTri const* tri, Vec const* vec) {
if (cM3d_IsZero(tri->GetNP()->y)) {
return false;
@@ -845,8 +778,6 @@ bool cM3d_CrossY_Tri(cM3dGTri const* tri, Vec const* vec) {
return false;
}
/* 8026A488-8026A60C 264DC8 0184+00 1/1 0/0 0/0 .text cM3d_CrossY_LinTri_proc__FPC8cM3dGTriPC3Vec
*/
static bool cM3d_CrossY_LinTri_proc(cM3dGTri const* tri, Vec const* vec) {
if (!cM3d_InclusionCheckPosIn3PosBox2d(tri->mA.z, tri->mA.x, tri->mB.z, tri->mB.x,
tri->mC.z, tri->mC.x, vec->z, vec->x, 0.005f)) {
@@ -872,8 +803,6 @@ static bool cM3d_CrossY_LinTri_proc(cM3dGTri const* tri, Vec const* vec) {
return false;
}
/* 8026A60C-8026A7B8 264F4C 01AC+00 0/0 2/2 0/0 .text
* cM3d_CrossY_Tri__FRC3VecRC3VecRC3VecRC8cM3dGPlaPC3Vec */
bool cM3d_CrossY_Tri(Vec const& a, Vec const& b, Vec const& c, cM3dGPla const& plane,
Vec const* vec) {
if (cM3d_IsZero(plane.mNormal.y)) {
@@ -904,8 +833,6 @@ bool cM3d_CrossY_Tri(Vec const& a, Vec const& b, Vec const& c, cM3dGPla const& p
return false;
}
/* 8026A7B8-8026A8C0 2650F8 0108+00 0/0 1/1 0/0 .text
* cM3d_CrossY_Tri_Front__FRC3VecRC3VecRC3VecPC3Vec */
bool cM3d_CrossY_Tri_Front(Vec const& a, Vec const& b, Vec const& c, Vec const* vec) {
if (!cM3d_InclusionCheckPosIn3PosBox2d(a.z, a.x, b.z, b.x,
c.z, c.x, vec->z, vec->x, 0.005f)) {
@@ -922,7 +849,6 @@ bool cM3d_CrossY_Tri_Front(Vec const& a, Vec const& b, Vec const& c, Vec const*
return false;
}
/* 8026A8C0-8026A944 265200 0084+00 1/1 0/0 0/0 .text cM3d_CrossY_Tri__FPC8cM3dGTriPC3VecPf */
static bool cM3d_CrossY_Tri(cM3dGTri const* tri, Vec const* vec, f32* param_2) {
if (cM3d_CrossY_Tri(tri, vec)) {
*param_2 = (vec->x * -tri->GetNP()->x - vec->z * tri->GetNP()->z - tri->GetD()) / tri->GetNP()->y;
@@ -932,7 +858,6 @@ static bool cM3d_CrossY_Tri(cM3dGTri const* tri, Vec const* vec, f32* param_2) {
return false;
}
/* 8026A944-8026AAE8 265284 01A4+00 1/1 0/0 0/0 .text cM3d_CrossY_Tri__FPC8cM3dGTriPC3Vecf */
static bool cM3d_CrossY_Tri(cM3dGTri const* tri, Vec const* vec, f32 param_2) {
if (cM3d_IsZero(tri->GetNP()->y)) {
return false;
@@ -962,8 +887,6 @@ static bool cM3d_CrossY_Tri(cM3dGTri const* tri, Vec const* vec, f32 param_2) {
return false;
}
/* 8026AAE8-8026ABD8 265428 00F0+00 1/1 0/0 0/0 .text
* cM3d_CrossY_Tri__FPC8cM3dGTriPC3VecPC10cM3d_RangePf */
static bool cM3d_CrossY_Tri(cM3dGTri const* tri, Vec const* vec, cM3d_Range const* range,
f32* param_3) {
if (cM3d_IsZero(tri->GetNP()->y)) {
@@ -985,7 +908,6 @@ static bool cM3d_CrossY_Tri(cM3dGTri const* tri, Vec const* vec, cM3d_Range cons
return cM3d_CrossY_Tri(tri, vec, param_3);
}
/* 8026ABD8-8026AD7C 265518 01A4+00 1/1 0/0 0/0 .text cM3d_CrossZ_Tri__FPC8cM3dGTriPC3Vecf */
static bool cM3d_CrossZ_Tri(cM3dGTri const* tri, Vec const* vec, f32 param_2) {
if (cM3d_IsZero(tri->GetNP()->z)) {
return false;
@@ -1015,8 +937,6 @@ static bool cM3d_CrossZ_Tri(cM3dGTri const* tri, Vec const* vec, f32 param_2) {
return false;
}
/* 8026AD7C-8026AF20 2656BC 01A4+00 1/1 0/0 0/0 .text cM3d_CrossZ_Tri__FPC8cM3dGTriPC3Vec
*/
static bool cM3d_CrossZ_Tri(cM3dGTri const* tri, Vec const* vec) {
if (cM3d_IsZero(tri->GetNP()->z)) {
return false;
@@ -1046,8 +966,6 @@ static bool cM3d_CrossZ_Tri(cM3dGTri const* tri, Vec const* vec) {
return false;
}
/* 8026AF20-8026B0A4 265860 0184+00 1/1 0/0 0/0 .text cM3d_CrossZ_LinTri_proc__FPC8cM3dGTriPC3Vec
*/
static bool cM3d_CrossZ_LinTri_proc(cM3dGTri const* tri, Vec const* vec) {
if (!cM3d_InclusionCheckPosIn3PosBox2d(tri->mA.x, tri->mA.y, tri->mB.x, tri->mB.y,
tri->mC.x, tri->mC.y, vec->x, vec->y, 0.005f)) {
@@ -1073,8 +991,6 @@ static bool cM3d_CrossZ_LinTri_proc(cM3dGTri const* tri, Vec const* vec) {
return false;
}
/* 8026B0A4-8026B17C 2659E4 00D8+00 1/1 1/1 0/0 .text
* cM3d_Cross_LinTri__FPC8cM3dGLinPC8cM3dGTriP3Vecbb */
bool cM3d_Cross_LinTri(cM3dGLin const* line, cM3dGTri const* tri, Vec* vec, bool param_3,
bool param_4) {
if (!cM3d_Cross_LinPla(line, tri, vec, param_3, param_4)) {
@@ -1091,8 +1007,6 @@ bool cM3d_Cross_LinTri(cM3dGLin const* line, cM3dGTri const* tri, Vec* vec, bool
return false;
}
/* 8026B17C-8026B238 265ABC 00BC+00 1/1 0/0 0/0 .text cM3d_Cross_LinTri_Easy__FPC8cM3dGTriPC3Vec
*/
static bool cM3d_Cross_LinTri_Easy(cM3dGTri const* tri, Vec const* vec) {
if ((cM3d_IsZero(tri->GetNP()->x) || cM3d_CrossX_Tri(tri, vec))
&& (cM3d_IsZero(tri->GetNP()->y) || cM3d_CrossY_Tri(tri, vec))
@@ -1104,13 +1018,10 @@ static bool cM3d_Cross_LinTri_Easy(cM3dGTri const* tri, Vec const* vec) {
return false;
}
/* 8026B238-8026B280 265B78 0048+00 1/1 0/0 0/0 .text cM3d_Cross_SphPnt__FPC8cM3dGSphPC3Vec */
static bool cM3d_Cross_SphPnt(cM3dGSph const* sph, Vec const* point) {
return cM3d_LenSq(sph->GetCP(), point) <= sph->GetR() * sph->GetR();
}
/* 8026B280-8026B4E8 265BC0 0268+00 1/1 0/0 2/2 .text
* cM3d_Cross_LinSph__FPC8cM3dGLinPC8cM3dGSphP3Vec */
bool cM3d_Cross_LinSph(cM3dGLin const* line, cM3dGSph const* sph, Vec* param_2) {
Vec lin_vec;
cXyz vec;
@@ -1179,8 +1090,6 @@ bool cM3d_Cross_LinSph(cM3dGLin const* line, cM3dGSph const* sph, Vec* param_2)
return false;
}
/* 8026B4E8-8026B8A4 265E28 03BC+00 1/1 2/2 0/0 .text
* cM3d_Cross_LinSph_CrossPos__FRC8cM3dGSphRC8cM3dGLinP3VecP3Vec */
int cM3d_Cross_LinSph_CrossPos(cM3dGSph const& sph, cM3dGLin const& line, Vec* param_2,
Vec* param_3) {
int ret;
@@ -1225,8 +1134,6 @@ int cM3d_Cross_LinSph_CrossPos(cM3dGSph const& sph, cM3dGLin const& line, Vec* p
return ret;
}
/* 8026B8A4-8026BA48 2661E4 01A4+00 0/0 2/2 0/0 .text cM3d_Cross_CylSph__FPC8cM3dGCylPC8cM3dGSphPf
*/
bool cM3d_Cross_CylSph(cM3dGCyl const* cyl, cM3dGSph const* sph, f32* param_2) {
const cXyz* sph_center = sph->GetCP();
const cXyz* cyl_center = cyl->GetCP();
@@ -1247,8 +1154,6 @@ bool cM3d_Cross_CylSph(cM3dGCyl const* cyl, cM3dGSph const* sph, f32* param_2) {
return false;
}
/* 8026BA48-8026BC7C 266388 0234+00 1/1 2/2 0/0 .text
* cM3d_Cross_CylSph__FPC8cM3dGCylPC8cM3dGSphP3VecPf */
bool cM3d_Cross_CylSph(cM3dGCyl const* cyl, cM3dGSph const* sph, Vec* param_2, f32* param_3) {
const Vec* sph_center = sph->GetCP();
const Vec* cyl_center = cyl->GetCP();
@@ -1282,8 +1187,6 @@ bool cM3d_Cross_CylSph(cM3dGCyl const* cyl, cM3dGSph const* sph, Vec* param_2, f
return false;
}
/* 8026BC7C-8026BCFC 2665BC 0080+00 0/0 1/1 0/0 .text cM3d_Cross_SphSph__FPC8cM3dGSphPC8cM3dGSphPf
*/
bool cM3d_Cross_SphSph(cM3dGSph const* sph1, cM3dGSph const* sph2, f32* param_2) {
Vec delta;
VECSubtract(sph1->GetCP(), sph2->GetCP(), &delta);
@@ -1297,8 +1200,6 @@ bool cM3d_Cross_SphSph(cM3dGSph const* sph1, cM3dGSph const* sph2, f32* param_2)
}
}
/* 8026BCFC-8026BD88 26663C 008C+00 1/1 0/0 0/0 .text
* cM3d_Cross_SphSph__FPC8cM3dGSphPC8cM3dGSphPfPf */
static bool cM3d_Cross_SphSph(cM3dGSph const* sph1, cM3dGSph const* sph2, f32* param_2,
f32* param_3) {
Vec delta;
@@ -1313,8 +1214,6 @@ static bool cM3d_Cross_SphSph(cM3dGSph const* sph1, cM3dGSph const* sph2, f32* p
}
}
/* 8026BD88-8026BE5C 2666C8 00D4+00 0/0 1/1 0/0 .text
* cM3d_Cross_SphSph__FPC8cM3dGSphPC8cM3dGSphP3Vec */
bool cM3d_Cross_SphSph(const cM3dGSph* pSphereA, const cM3dGSph* pSphereB, Vec* pVecOut) {
f32 centerDist;
f32 overlapLen;
@@ -1335,8 +1234,6 @@ bool cM3d_Cross_SphSph(const cM3dGSph* pSphereA, const cM3dGSph* pSphereB, Vec*
}
}
/* 8026BE5C-8026BF04 26679C 00A8+00 1/1 0/0 0/0 .text
* cM3d_CalcSphVsTriCrossPoint__FPC8cM3dGSphPC8cM3dGTriP3Vec */
void cM3d_CalcSphVsTriCrossPoint(const cM3dGSph* pSphere, const cM3dGTri* pTriangle, Vec* pVecOut) {
Vec tmp2;
Vec tmp;
@@ -1350,8 +1247,6 @@ void cM3d_CalcSphVsTriCrossPoint(const cM3dGSph* pSphere, const cM3dGTri* pTrian
}
}
/* 8026BF04-8026C22C 266844 0328+00 1/1 4/4 0/0 .text
* cM3d_Cross_SphTri__FPC8cM3dGSphPC8cM3dGTriP3Vec */
bool cM3d_Cross_SphTri(cM3dGSph const* sph, cM3dGTri const* tri, Vec* param_2) {
if (!cM3d_InclusionCheckPosIn3PosBox3d(&tri->mA, &tri->mB, &tri->mC, sph->GetCP(), sph->GetR())) {
return false;
@@ -1416,8 +1311,6 @@ bool cM3d_Cross_SphTri(cM3dGSph const* sph, cM3dGTri const* tri, Vec* param_2) {
return false;
}
/* 8026C22C-8026C3B4 266B6C 0188+00 0/0 1/1 0/0 .text cM3d_Cross_CylCyl__FPC8cM3dGCylPC8cM3dGCylPf
*/
bool cM3d_Cross_CylCyl(cM3dGCyl const* cyl1, cM3dGCyl const* cyl2, f32* param_2) {
const Vec& center1 = cyl1->GetC();
const Vec& center2 = cyl2->GetC();
@@ -1440,8 +1333,6 @@ bool cM3d_Cross_CylCyl(cM3dGCyl const* cyl1, cM3dGCyl const* cyl2, f32* param_2)
return true;
}
/* 8026C3B4-8026C5D0 266CF4 021C+00 0/0 1/1 0/0 .text
* cM3d_Cross_CylCyl__FPC8cM3dGCylPC8cM3dGCylP3Vec */
bool cM3d_Cross_CylCyl(cM3dGCyl const* cyl1, cM3dGCyl const* cyl2, Vec* param_2) {
const Vec& center1 = cyl1->GetC();
const Vec& center2 = cyl2->GetC();
@@ -1480,8 +1371,6 @@ bool cM3d_Cross_CylCyl(cM3dGCyl const* cyl1, cM3dGCyl const* cyl2, Vec* param_2)
return true;
}
/* 8026C5D0-8026C944 266F10 0374+00 0/0 2/2 0/0 .text
* cM3d_Cross_CylTri__FPC8cM3dGCylPC8cM3dGTriP3Vec */
bool cM3d_Cross_CylTri(cM3dGCyl const* cyl, cM3dGTri const* tri, Vec* param_2) {
const Vec& center = cyl->GetC();
f32 top_y = center.y + cyl->GetH();
@@ -1544,8 +1433,6 @@ bool cM3d_Cross_CylTri(cM3dGCyl const* cyl, cM3dGTri const* tri, Vec* param_2) {
return false;
}
/* 8026C944-8026D044 267284 0700+00 1/1 2/2 1/1 .text
* cM3d_Cross_CylLin__FPC8cM3dGCylPC8cM3dGLinP3VecP3Vec */
int cM3d_Cross_CylLin(cM3dGCyl const* cyl, cM3dGLin const* line, Vec* param_2, Vec* param_3) {
f32 ratio;
f32 f2;
@@ -1720,8 +1607,6 @@ int cM3d_Cross_CylLin(cM3dGCyl const* cyl, cM3dGLin const* line, Vec* param_2, V
return count;
}
/* 8026D044-8026D0B0 267984 006C+00 1/1 0/0 0/0 .text
* cM3d_Cross_CylPntPnt__FPC8cM3dGCylPC3VecPC3VecP3VecP3Vec */
static int cM3d_Cross_CylPntPnt(const cM3dGCyl* pCylinder, const Vec* pVecStart, const Vec* pVecEnd,
Vec* pVecOutA, Vec* pVecOutB) {
cM3dGLin lin;
@@ -1729,7 +1614,6 @@ static int cM3d_Cross_CylPntPnt(const cM3dGCyl* pCylinder, const Vec* pVecStart,
return cM3d_Cross_CylLin(pCylinder, &lin, pVecOutA, pVecOutB);
}
/* 8026D0B0-8026D114 2679F0 0064+00 2/2 0/0 0/0 .text cM3d_Cross_CylPnt__FPC8cM3dGCylPC3Vec */
bool cM3d_Cross_CylPnt(const cM3dGCyl* pCylinder, const Vec* pPoint) {
f32 dX = pCylinder->GetCP()->getXDiff(pPoint);
f32 dZ = pCylinder->GetCP()->getZDiff(pPoint);
@@ -1743,8 +1627,6 @@ bool cM3d_Cross_CylPnt(const cM3dGCyl* pCylinder, const Vec* pPoint) {
}
}
/* 8026D114-8026D3D4 267A54 02C0+00 0/0 2/2 0/0 .text
* cM3d_Cross_CpsCps__FRC8cM3dGCpsRC8cM3dGCpsP3Vec */
bool cM3d_Cross_CpsCps(cM3dGCps const& cps1, cM3dGCps const& cps2, Vec* param_2) {
f32 f1, f2;
int iVar1 = cM3d_Check_LinLin(&cps1, &cps2, &f1, &f2);
@@ -1816,8 +1698,6 @@ inline bool cM3d_Cross_CpsCyl_Check(cM3dGCps const& cps, cM3dGCyl const& cyl, Ve
return false;
}
/* 8026D3D4-8026DAE0 267D14 070C+00 0/0 4/4 0/0 .text
* cM3d_Cross_CpsCyl__FRC8cM3dGCpsRC8cM3dGCylP3Vec */
bool cM3d_Cross_CpsCyl(cM3dGCps const& cps, cM3dGCyl const& cyl, Vec* param_2) {
cM3dGLin line;
@@ -1924,8 +1804,6 @@ bool cM3d_Cross_CpsCyl(cM3dGCps const& cps, cM3dGCyl const& cyl, Vec* param_2) {
return false;
}
/* 8026DAE0-8026DC3C 268420 015C+00 1/1 0/0 0/0 .text
* cM3d_Cross_CpsSph_CrossPos__FRC8cM3dGCpsRC8cM3dGSphRC3VecP3Vec */
static void cM3d_Cross_CpsSph_CrossPos(cM3dGCps const& param_1, cM3dGSph const& param_2,
Vec const& param_3, Vec* param_4) {
Vec aVStack_70;
@@ -1955,8 +1833,6 @@ static void cM3d_Cross_CpsSph_CrossPos(cM3dGCps const& param_1, cM3dGSph const&
}
/* 8026DC3C-8026DE2C 26857C 01F0+00 0/0 4/4 0/0 .text
* cM3d_Cross_CpsSph__FRC8cM3dGCpsRC8cM3dGSphP3Vec */
bool cM3d_Cross_CpsSph(cM3dGCps const& param_1, cM3dGSph const& param_2, Vec* param_3) {
f32 local_38 = VECDistance(&param_1.GetStartP(), param_2.GetCP());
if (local_38 < param_1.GetR() + param_2.GetR()) {
@@ -1978,8 +1854,6 @@ bool cM3d_Cross_CpsSph(cM3dGCps const& param_1, cM3dGSph const& param_2, Vec* pa
return false;
}
/* 8026DE2C-8026E12C 26876C 0300+00 0/0 1/1 0/0 .text
* cM3d_Cross_TriTri__FRC8cM3dGTriRC8cM3dGTriP3Vec */
bool cM3d_Cross_TriTri(cM3dGTri const& tri1, cM3dGTri const& tri2, Vec* param_2) {
f32 f1 = tri1.getPlaneFunc(&tri2.mA);
f32 f2 = tri1.getPlaneFunc(&tri2.mB);
@@ -2040,8 +1914,6 @@ inline f32 cM3d_2LinCenter(cM3dGLin const& pLinA, f32 pLinAF, cM3dGLin const& pL
return VECDistance(&tmp, &tmp2);
}
/* 8026E12C-8026E4FC 268A6C 03D0+00 0/0 2/2 0/0 .text
* cM3d_Cross_CpsTri__FRC8cM3dGCps8cM3dGTriP3Vec */
bool cM3d_Cross_CpsTri(cM3dGCps const& cps, cM3dGTri tri, Vec* param_2) {
cM3dGSph sph;
sph.SetC(cps.GetStartP());
@@ -2094,14 +1966,11 @@ bool cM3d_Cross_CpsTri(cM3dGCps const& cps, cM3dGTri tri, Vec* param_2) {
return false;
}
/* 8026E4FC-8026E570 268E3C 0074+00 0/0 0/0 1/1 .text cM3d_CalcVecAngle__FRC3VecPsPs */
void cM3d_CalcVecAngle(const Vec& pVec, s16* pOutA, s16* pOutB) {
*pOutA = -cM_atan2s(-pVec.z * pVec.y, 1.0f);
*pOutB = cM_atan2s(-pVec.x * pVec.y, 1.0f);
}
/* 8026E570-8026E6C4 268EB0 0154+00 0/0 1/1 0/0 .text cM3d_CalcVecZAngle__FRC3VecP5csXyz
*/
void cM3d_CalcVecZAngle(Vec const& param_0, csXyz* param_1) {
param_1->x = -cM_atan2s(param_0.y, sqrtf(param_0.x * param_0.x + param_0.z * param_0.z));
param_1->y = cM_atan2s(param_0.x, param_0.z);
@@ -2109,15 +1978,12 @@ void cM3d_CalcVecZAngle(Vec const& param_0, csXyz* param_1) {
}
/* 8026E6C4-8026E6F0 269004 002C+00 1/1 0/0 0/0 .text cM3d_PlaneCrossLineProcWork__FfffffffPfPf */
void cM3d_PlaneCrossLineProcWork(f32 f1, f32 f2, f32 f3, f32 f4, f32 f5, f32 f6, f32 f7, f32* pF1,
f32* pF2) {
*pF1 = ((f2 * f7) - (f4 * f6)) / f5;
*pF2 = ((f3 * f6) - (f1 * f7)) / f5;
}
/* 8026E6F0-8026E8A0 269030 01B0+00 2/2 0/0 0/0 .text
* cM3d_2PlaneCrossLine__FRC8cM3dGPlaRC8cM3dGPlaP8cM3dGLin */
static int cM3d_2PlaneCrossLine(const cM3dGPla& pPlaneA, const cM3dGPla& pPlaneB,
cM3dGLin* pLinOut) {
Vec tmp;
@@ -2154,8 +2020,6 @@ static int cM3d_2PlaneCrossLine(const cM3dGPla& pPlaneA, const cM3dGPla& pPlaneB
}
}
/* 8026E8A0-8026E980 2691E0 00E0+00 0/0 1/1 0/0 .text
* cM3d_3PlaneCrossPos__FRC8cM3dGPlaRC8cM3dGPlaRC8cM3dGPlaP3Vec */
BOOL cM3d_3PlaneCrossPos(const cM3dGPla& pPlaneA, const cM3dGPla& pPlaneB, const cM3dGPla& pPlaneC,
Vec* pVecOut) {
cM3dGLin lin;
@@ -2173,8 +2037,6 @@ BOOL cM3d_3PlaneCrossPos(const cM3dGPla& pPlaneA, const cM3dGPla& pPlaneB, const
}
}
/* 8026E980-8026EA5C 2692C0 00DC+00 1/1 1/1 0/0 .text
* cM3d_lineVsPosSuisenCross__FPC8cM3dGLinPC3VecP3Vec */
f32 cM3d_lineVsPosSuisenCross(const cM3dGLin* pLine, const Vec* pPoint, Vec* pVecOut) {
Vec tmp1;
Vec tmp2;
@@ -2193,8 +2055,6 @@ f32 cM3d_lineVsPosSuisenCross(const cM3dGLin* pLine, const Vec* pPoint, Vec* pVe
}
}
/* 8026EA5C-8026EB38 26939C 00DC+00 0/0 1/1 0/0 .text
* cM3d_lineVsPosSuisenCross__FRC3VecRC3VecRC3VecP3Vec */
f32 cM3d_lineVsPosSuisenCross(const Vec& pLinePointA, const Vec& pLinePointB, const Vec& pPoint,
Vec* pVecOut) {
Vec tmp1;
@@ -2215,8 +2075,6 @@ f32 cM3d_lineVsPosSuisenCross(const Vec& pLinePointA, const Vec& pLinePointB, co
}
}
/* 8026EB38-8026EBBC 269478 0084+00 0/0 1/1 0/0 .text
* cM3d_2PlaneLinePosNearPos__FRC8cM3dGPlaRC8cM3dGPlaPC3VecP3Vec */
int cM3d_2PlaneLinePosNearPos(const cM3dGPla& pPlaneA, const cM3dGPla& pPlaneB, const Vec* pVec,
Vec* pVecOut) {
cM3dGLin lin;
@@ -2228,7 +2086,6 @@ int cM3d_2PlaneLinePosNearPos(const cM3dGPla& pPlaneA, const cM3dGPla& pPlaneB,
}
}
/* 8026EBBC-8026EC3C 2694FC 0080+00 0/0 1/1 0/0 .text cM3d_CrawVec__FRC3VecRC3VecP3Vec */
void cM3d_CrawVec(const Vec& pVecA, const Vec& pVecB, Vec* pVecOut) {
Vec tmp;
VECScale(&pVecA, &tmp, fabsf(pVecB.x * pVecA.x + pVecB.y * pVecA.y + pVecB.z * pVecA.z));