some c_m3d (#97)

* decompiled some bgs_chk funcs

* c_m3d_g

* c_math progress

* remove duplicate SComponent headers

* move some variables and decompile a function

* some inlined from debug

* cM3d_2PlaneLinePosNearPos

* fix fabsf and decompile cM3d_CrawVec

* format

* cleanup

* more cleanup

Co-authored-by: Pheenoh <pheenoh@gmail.com>
This commit is contained in:
lepelog
2021-01-26 17:48:47 -05:00
committed by GitHub
co-authored by Pheenoh
parent b8d0da505d
commit 1e105b87f1
135 changed files with 1022 additions and 2738 deletions
+16 -14
View File
@@ -3,26 +3,28 @@
#include "SComponent/c_bg_s_chk.h"
// __ct__8cBgS_ChkFv
asm cBgS_Chk::cBgS_Chk(void) {
nofralloc
#include "SComponent/c_bg_s_chk/asm/func_80267B4C.s"
cBgS_Chk::cBgS_Chk(void) {
unk_0x00 = 0;
unk_0x04 = 0;
unk_0x0C = 1;
}
// __dt__8cBgS_ChkFv
asm cBgS_Chk::~cBgS_Chk(void) {
nofralloc
#include "SComponent/c_bg_s_chk/asm/func_80267B70.s"
}
cBgS_Chk::~cBgS_Chk(void) {}
// SetExtChk__8cBgS_ChkFR8cBgS_Chk
asm void cBgS_Chk::SetExtChk(cBgS_Chk&) {
nofralloc
#include "SComponent/c_bg_s_chk/asm/func_80267BB8.s"
void cBgS_Chk::SetExtChk(cBgS_Chk& pOther) {
unk_0x00 = pOther.unk_0x00;
unk_0x04 = pOther.unk_0x04;
unk_0x08 = pOther.unk_0x08;
unk_0x0C = pOther.unk_0x0C;
}
// ChkSameActorPid__8cBgS_ChkCFUi
// cBgS_Chk::ChkSameActorPid(unsigned int) const
asm bool cBgS_Chk::ChkSameActorPid(unsigned int) const {
nofralloc
#include "SComponent/c_bg_s_chk/asm/func_80267BDC.s"
bool cBgS_Chk::ChkSameActorPid(unsigned int pUint) const {
if (unk_0x08 == -1 || pUint == UINT32_MAX || unk_0x0C == 0) {
return 0;
} else {
return (unk_0x08 == pUint) ? 1 : 0;
}
}
@@ -2,6 +2,10 @@
#include "SComponent/c_bg_s_gnd_chk.h"
// additional symbols needed for c_bg_s_gnd_chk.cpp
// autogenerated by split.py v0.3 at 2020-12-31 14:10:48.795807
extern u8 lbl_803C3F90;
// __ct__11cBgS_GndChkFv
asm cBgS_GndChk::cBgS_GndChk(void) {
nofralloc
@@ -2,6 +2,10 @@
#include "SComponent/c_bg_s_lin_chk.h"
// additional symbols needed for c_bg_s_lin_chk.cpp
// autogenerated by split.py v0.3 at 2021-01-01 12:56:44.686018
extern u8 lbl_803C3FA8;
// __ct__11cBgS_LinChkFv
// cBgS_LinChk::cBgS_LinChk(void)
asm cBgS_LinChk::cBgS_LinChk(void) {
+33 -37
View File
@@ -3,64 +3,60 @@
#include "SComponent/c_bg_s_poly_info.h"
// __ct__13cBgS_PolyInfoFv
// cBgS_PolyInfo::cBgS_PolyInfo(void)
asm cBgS_PolyInfo::cBgS_PolyInfo(void) {
nofralloc
#include "SComponent/c_bg_s_poly_info/asm/func_80268074.s"
cBgS_PolyInfo::cBgS_PolyInfo(void) {
this->ClearPi();
}
// __dt__13cBgS_PolyInfoFv
// cBgS_PolyInfo::~cBgS_PolyInfo(void)
asm cBgS_PolyInfo::~cBgS_PolyInfo(void) {
nofralloc
#include "SComponent/c_bg_s_poly_info/asm/func_802680B0.s"
}
cBgS_PolyInfo::~cBgS_PolyInfo(void) {}
// ChkSetInfo__13cBgS_PolyInfoCFv
// cBgS_PolyInfo::ChkSetInfo(void) const
asm bool cBgS_PolyInfo::ChkSetInfo(void) const {
nofralloc
#include "SComponent/c_bg_s_poly_info/asm/func_802680F8.s"
bool cBgS_PolyInfo::ChkSetInfo(void) const {
if (mPolyIndex == 0xFFFF || unk_0x02 == 0x100) {
return false;
} else {
return true;
}
}
// ClearPi__13cBgS_PolyInfoFv
// cBgS_PolyInfo::ClearPi(void)
asm void cBgS_PolyInfo::ClearPi(void) {
nofralloc
#include "SComponent/c_bg_s_poly_info/asm/func_80268120.s"
void cBgS_PolyInfo::ClearPi(void) {
mPolyIndex = 0xFFFF;
unk_0x02 = 0x100;
unk_0x04 = 0;
unk_0x08 = -1;
}
// SetPolyInfo__13cBgS_PolyInfoFRC13cBgS_PolyInfo
// cBgS_PolyInfo::SetPolyInfo(const cBgS_PolyInfo&)
asm void cBgS_PolyInfo::SetPolyInfo(const cBgS_PolyInfo&) {
nofralloc
#include "SComponent/c_bg_s_poly_info/asm/func_80268148.s"
void cBgS_PolyInfo::SetPolyInfo(const cBgS_PolyInfo& pOther) {
mPolyIndex = pOther.mPolyIndex;
unk_0x02 = pOther.unk_0x02;
unk_0x04 = pOther.unk_0x04;
unk_0x08 = pOther.unk_0x08;
}
// SetActorInfo__13cBgS_PolyInfoFiPvUi
// cBgS_PolyInfo::SetActorInfo(int, void*, unsigned int)
asm void cBgS_PolyInfo::SetActorInfo(int, void*, unsigned int) {
nofralloc
#include "SComponent/c_bg_s_poly_info/asm/func_8026816C.s"
void cBgS_PolyInfo::SetActorInfo(int param_1, void* param_2, unsigned int param_3) {
unk_0x02 = param_1;
unk_0x04 = param_2;
unk_0x08 = param_3;
}
// ChkSafe__13cBgS_PolyInfoCFPCvUi
// cBgS_PolyInfo::ChkSafe(const void*, unsigned int) const
asm bool cBgS_PolyInfo::ChkSafe(const void*, unsigned int) const {
nofralloc
#include "SComponent/c_bg_s_poly_info/asm/func_8026817C.s"
bool cBgS_PolyInfo::ChkSafe(const void* param_1, unsigned int param_2) const {
if (unk_0x04 == param_1 && unk_0x08 == param_2) {
return true;
} else {
return false;
}
}
// SetPolyIndex__13cBgS_PolyInfoFi
// cBgS_PolyInfo::SetPolyIndex(int)
asm void cBgS_PolyInfo::SetPolyIndex(int) {
nofralloc
#include "SComponent/c_bg_s_poly_info/asm/func_802681A4.s"
void cBgS_PolyInfo::SetPolyIndex(int pPolyIndex) {
mPolyIndex = pPolyIndex;
}
// ChkBgIndex__13cBgS_PolyInfoCFv
// cBgS_PolyInfo::ChkBgIndex(void) const
asm bool cBgS_PolyInfo::ChkBgIndex(void) const {
nofralloc
#include "SComponent/c_bg_s_poly_info/asm/func_802681AC.s"
bool cBgS_PolyInfo::ChkBgIndex(void) const {
return unk_0x02 != 0x100;
}
@@ -2,6 +2,10 @@
#include "SComponent/c_bg_s_shdw_draw.h"
// additional symbols needed for c_bg_s_shdw_draw.cpp
// autogenerated by split.py v0.3 at 2021-01-01 13:07:28.433195
extern u8 lbl_803C3FC0;
// __ct__13cBgS_ShdwDrawFv
// cBgS_ShdwDraw::cBgS_ShdwDraw(void)
asm cBgS_ShdwDraw::cBgS_ShdwDraw(void) {
+10
View File
@@ -2,6 +2,16 @@
#include "SComponent/c_m2d.h"
// additional symbols needed for c_m2d.cpp
// autogenerated by split.py v0.3 at 2021-01-01 14:23:08.023070
extern u8 lbl_80455110;
extern u8 lbl_80455100;
extern u8 lbl_80455108;
extern u8 lbl_804550FC;
extern u8 lbl_804550F8;
extern u8 lbl_804550F4;
extern u8 lbl_804550F0;
// cM2d_CrossCirLin__FR8cM2dGCirffffPfPf
asm void cM2d_CrossCirLin(cM2dGCir&, float, float, float, float, float*, float*) {
nofralloc
File diff suppressed because it is too large Load Diff
+38 -44
View File
@@ -2,79 +2,73 @@
#include "SComponent/c_m3d_g_aab.h"
// additional symbols needed for c_m3d_g_aab.cpp
// autogenerated by split.py v0.3 at 2021-01-01 14:25:53.390342
extern f32 lbl_804551D4;
extern f32 lbl_804551D0;
extern f32 lbl_804551D8;
// Set__8cM3dGAabFPC4cXyzPC4cXyz
// cM3dGAab::Set(const cXyz*, const cXyz*)
asm void cM3dGAab::Set(const cXyz*, const cXyz*) {
nofralloc
#include "SComponent/c_m3d_g_aab/asm/func_8026EC54.s"
void cM3dGAab::Set(const cXyz* pMin, const cXyz* pMax) {
mMin = *pMin;
mMax = *pMax;
}
// CrossY__8cM3dGAabCFPC4cXyz
// cM3dGAab::CrossY(const cXyz*) const
asm bool cM3dGAab::CrossY(const cXyz*) const {
nofralloc
#include "SComponent/c_m3d_g_aab/asm/func_8026EC88.s"
bool cM3dGAab::CrossY(const cXyz* pOther) const {
if (mMin.x > pOther->x || mMax.x < pOther->x || mMin.z > pOther->z || mMax.z < pOther->z) {
return false;
} else {
return true;
}
}
// UnderPlaneYUnder__8cM3dGAabCFf
// cM3dGAab::UnderPlaneYUnder(float) const
asm bool cM3dGAab::UnderPlaneYUnder(float) const {
nofralloc
#include "SComponent/c_m3d_g_aab/asm/func_8026ECD0.s"
bool cM3dGAab::UnderPlaneYUnder(f32 pY) const {
return mMin.y < pY;
}
// TopPlaneYUnder__8cM3dGAabCFf
// cM3dGAab::TopPlaneYUnder(float) const
asm bool cM3dGAab::TopPlaneYUnder(float) const {
nofralloc
#include "SComponent/c_m3d_g_aab/asm/func_8026ECE4.s"
bool cM3dGAab::TopPlaneYUnder(f32 pY) const {
return mMax.y < pY;
}
// ClearForMinMax__8cM3dGAabFv
// cM3dGAab::ClearForMinMax(void)
asm void cM3dGAab::ClearForMinMax(void) {
nofralloc
#include "SComponent/c_m3d_g_aab/asm/func_8026ECF8.s"
void cM3dGAab::ClearForMinMax(void) {
mMin.setAll(lbl_804551D0);
mMax.setAll(lbl_804551D4);
}
// SetMinMax__8cM3dGAabFRC4cXyz
// cM3dGAab::SetMinMax(const cXyz&)
asm void cM3dGAab::SetMinMax(const cXyz&) {
nofralloc
#include "SComponent/c_m3d_g_aab/asm/func_8026ED1C.s"
void cM3dGAab::SetMinMax(const cXyz& pMinMax) {
this->SetMin(pMinMax);
this->SetMax(pMinMax);
}
// SetMinMax__8cM3dGAabFRC8cM3dGAab
// cM3dGAab::SetMinMax(const cM3dGAab&)
asm void cM3dGAab::SetMinMax(const cM3dGAab&) {
nofralloc
#include "SComponent/c_m3d_g_aab/asm/func_8026ED60.s"
void cM3dGAab::SetMinMax(const cM3dGAab& pOther) {
this->SetMinMax(pOther.mMin);
this->SetMinMax(pOther.mMax);
}
// SetMin__8cM3dGAabFRC4cXyz
// cM3dGAab::SetMin(const cXyz&)
asm void cM3dGAab::SetMin(const cXyz&) {
nofralloc
#include "SComponent/c_m3d_g_aab/asm/func_8026EDA4.s"
void cM3dGAab::SetMin(const cXyz& pMin) {
mMin.setMin(pMin);
}
// SetMax__8cM3dGAabFRC4cXyz
// cM3dGAab::SetMax(const cXyz&)
asm void cM3dGAab::SetMax(const cXyz&) {
nofralloc
#include "SComponent/c_m3d_g_aab/asm/func_8026EDE4.s"
void cM3dGAab::SetMax(const cXyz& pMax) {
mMax.setMax(pMax);
}
// CalcCenter__8cM3dGAabCFP4cXyz
// cM3dGAab::CalcCenter(cXyz*) const
asm void cM3dGAab::CalcCenter(cXyz*) const {
nofralloc
#include "SComponent/c_m3d_g_aab/asm/func_8026EE24.s"
void cM3dGAab::CalcCenter(cXyz* pOut) const {
PSVECAdd(&mMin, &mMax, pOut);
PSVECScale(pOut, pOut, lbl_804551D8);
}
// PlusR__8cM3dGAabFf
// cM3dGAab::PlusR(float)
asm void cM3dGAab::PlusR(float) {
nofralloc
#include "SComponent/c_m3d_g_aab/asm/func_8026EE68.s"
void cM3dGAab::PlusR(f32 pR) {
mMin -= pR;
mMax += pR;
}
+8 -22
View File
@@ -3,32 +3,18 @@
#include "SComponent/c_m3d_g_cir.h"
// __ct__8cM3dGCirFv
// cM3dGCir::cM3dGCir(void)
asm cM3dGCir::cM3dGCir(void) {
nofralloc
#include "SComponent/c_m3d_g_cir/asm/func_8026EEB4.s"
}
extern "C" {
cM3dGCir::cM3dGCir(void) {}
// inlined here
// __dt__8cM2dGCirFv
// cM2dGCir::~cM2dGCir(void)
asm void __dt__8cM2dGCirFv(void) {
nofralloc
#include "SComponent/c_m3d_g_cir/asm/func_8026EED0.s"
}
}
// __dt__8cM3dGCirFv
// cM3dGCir::~cM3dGCir(void)
asm cM3dGCir::~cM3dGCir(void) {
nofralloc
#include "SComponent/c_m3d_g_cir/asm/func_8026EF18.s"
}
cM3dGCir::~cM3dGCir(void) {}
// Set__8cM3dGCirFffff
// cM3dGCir::Set(float, float, float, float)
asm void cM3dGCir::Set(float, float, float, float) {
nofralloc
#include "SComponent/c_m3d_g_cir/asm/func_8026EF74.s"
void cM3dGCir::Set(f32 pPosX, f32 pPosY, f32 pPosZ, f32 pRadius) {
mPosX = pPosX;
mPosY = pPosY;
mRadius = pRadius;
mPosZ = pPosZ;
}
+10 -22
View File
@@ -3,36 +3,24 @@
#include "SComponent/c_m3d_g_cps.h"
// __ct__8cM3dGCpsFv
// cM3dGCps::cM3dGCps(void)
asm cM3dGCps::cM3dGCps(void) {
nofralloc
#include "SComponent/c_m3d_g_cps/asm/func_8026EF88.s"
}
cM3dGCps::cM3dGCps(void) {}
// __dt__8cM3dGCpsFv
// cM3dGCps::~cM3dGCps(void)
asm cM3dGCps::~cM3dGCps(void) {
nofralloc
#include "SComponent/c_m3d_g_cps/asm/func_8026EFA4.s"
}
cM3dGCps::~cM3dGCps(void) {}
// Set__8cM3dGCpsFRC4cXyzRC4cXyzf
// cM3dGCps::Set(const cXyz&, const cXyz&, float)
asm void cM3dGCps::Set(const cXyz&, const cXyz&, float) {
nofralloc
#include "SComponent/c_m3d_g_cps/asm/func_8026F000.s"
void cM3dGCps::Set(const cXyz& pStart, const cXyz& pEnd, f32 pUnkF) {
this->SetStartEnd(pStart, pEnd);
unk_0x1c = pUnkF;
}
// Set__8cM3dGCpsFRC9cM3dGCpsS
// cM3dGCps::Set(const cM3dGCpsS&)
asm void cM3dGCps::Set(const cM3dGCpsS&) {
nofralloc
#include "SComponent/c_m3d_g_cps/asm/func_8026F03C.s"
void cM3dGCps::Set(const cM3dGCpsS& other) {
this->SetStartEnd(other.mStart, other.mEnd);
unk_0x1c = other.unk_0x1c;
}
// SetCps__8cM3dGCpsFRC8cM3dGCps
// cM3dGCps::SetCps(const cM3dGCps&)
asm void cM3dGCps::SetCps(const cM3dGCps&) {
nofralloc
#include "SComponent/c_m3d_g_cps/asm/func_8026F080.s"
void cM3dGCps::SetCps(const cM3dGCps& other) {
this->Set(other.GetStartP(), other.GetEndP(), other.unk_0x1c);
}
+31 -36
View File
@@ -1,66 +1,61 @@
/* c_m3d_g_cyl.cpp autogenerated by split.py v0.3 at 2021-01-01 14:45:46.600671 */
#include "SComponent/c_m3d_g_cyl.h"
#include "SComponent/c_m3d.h"
// __ct__8cM3dGCylFPC4cXyzff
// cM3dGCyl::cM3dGCyl(const cXyz*, float, float)
asm cM3dGCyl::cM3dGCyl(const cXyz*, float, float) {
nofralloc
#include "SComponent/c_m3d_g_cyl/asm/func_8026F0A8.s"
cM3dGCyl::cM3dGCyl(const cXyz* pCenter, f32 pRadius, f32 pHeight) {
this->SetC(*pCenter);
this->SetR(pRadius);
this->SetH(pHeight);
}
// Set__8cM3dGCylFRC9cM3dGCylS
// cM3dGCyl::Set(const cM3dGCylS&)
asm void cM3dGCyl::Set(const cM3dGCylS&) {
nofralloc
#include "SComponent/c_m3d_g_cyl/asm/func_8026F114.s"
void cM3dGCyl::Set(const cM3dGCylS& other) {
this->SetC(cXyz(other.mCenter));
this->SetR(other.mRadius);
this->SetH(other.mHeight);
}
// Set__8cM3dGCylFRC4cXyzff
// cM3dGCyl::Set(const cXyz&, float, float)
asm void cM3dGCyl::Set(const cXyz&, float, float) {
nofralloc
#include "SComponent/c_m3d_g_cyl/asm/func_8026F180.s"
void cM3dGCyl::Set(const cXyz& pCenter, f32 pRadius, f32 pHeight) {
this->SetC(pCenter);
this->SetR(pRadius);
this->SetH(pHeight);
}
// SetC__8cM3dGCylFRC4cXyz
// cM3dGCyl::SetC(const cXyz&)
asm void cM3dGCyl::SetC(const cXyz&) {
nofralloc
#include "SComponent/c_m3d_g_cyl/asm/func_8026F1DC.s"
void cM3dGCyl::SetC(const cXyz& pCenter) {
mCenter = pCenter;
}
// SetH__8cM3dGCylFf
// cM3dGCyl::SetH(float)
asm void cM3dGCyl::SetH(float) {
nofralloc
#include "SComponent/c_m3d_g_cyl/asm/func_8026F1F8.s"
void cM3dGCyl::SetH(f32 pHeight) {
mHeight = pHeight;
}
// SetR__8cM3dGCylFf
// cM3dGCyl::SetR(float)
asm void cM3dGCyl::SetR(float) {
nofralloc
#include "SComponent/c_m3d_g_cyl/asm/func_8026F200.s"
void cM3dGCyl::SetR(f32 pRadius) {
mRadius = pRadius;
}
// cross__8cM3dGCylCFPC8cM3dGSphP4cXyz
// cM3dGCyl::cross(const cM3dGSph*, cXyz*) const
asm bool cM3dGCyl::cross(const cM3dGSph*, cXyz*) const {
nofralloc
#include "SComponent/c_m3d_g_cyl/asm/func_8026F208.s"
bool cM3dGCyl::cross(const cM3dGSph* pOther, cXyz* pOut) const {
f32 f;
return cM3d_Cross_CylSph(this, pOther, pOut, &f);
}
// cross__8cM3dGCylCFPC8cM3dGCylP4cXyz
// cM3dGCyl::cross(const cM3dGCyl*, cXyz*) const
asm bool cM3dGCyl::cross(const cM3dGCyl*, cXyz*) const {
nofralloc
#include "SComponent/c_m3d_g_cyl/asm/func_8026F22C.s"
bool cM3dGCyl::cross(const cM3dGCyl* pOther, cXyz* pOut) const {
return cM3d_Cross_CylCyl(this, pOther, pOut);
}
// calcMinMax__8cM3dGCylFP4cXyzP4cXyz
// cM3dGCyl::calcMinMax(cXyz*, cXyz*)
asm void cM3dGCyl::calcMinMax(cXyz*, cXyz*) {
nofralloc
#include "SComponent/c_m3d_g_cyl/asm/func_8026F24C.s"
void cM3dGCyl::calcMinMax(cXyz* pMin, cXyz* pMax) {
pMin->x = mCenter.x - mRadius;
pMin->y = mCenter.y;
pMin->z = mCenter.z - mRadius;
pMax->x = mCenter.x + mRadius;
pMax->y = mCenter.y + mHeight;
pMax->z = mCenter.z + mRadius;
}
+15 -22
View File
@@ -1,38 +1,31 @@
/* c_m3d_g_lin.cpp autogenerated by split.py v0.3 at 2021-01-01 14:48:45.519641 */
#include "SComponent/c_m3d_g_lin.h"
#include "SComponent/c_m3d.h"
// __ct__8cM3dGLinFRC4cXyzRC4cXyz
// cM3dGLin::cM3dGLin(const cXyz&, const cXyz&)
asm cM3dGLin::cM3dGLin(const cXyz&, const cXyz&) {
nofralloc
#include "SComponent/c_m3d_g_lin/asm/func_8026F2A8.s"
}
cM3dGLin::cM3dGLin(const cXyz& pStart, const cXyz& pEnd) : mStart(pStart), mEnd(pEnd) {}
// SetStartEnd__8cM3dGLinFRC4cXyzRC4cXyz
// cM3dGLin::SetStartEnd(const cXyz&, const cXyz&)
asm void cM3dGLin::SetStartEnd(const cXyz&, const cXyz&) {
nofralloc
#include "SComponent/c_m3d_g_lin/asm/func_8026F2E8.s"
void cM3dGLin::SetStartEnd(const cXyz& pStart, const cXyz& pEnd) {
mStart = pStart;
mEnd = pEnd;
}
// SetStartEnd__8cM3dGLinFRC3VecRC3Vec
// cM3dGLin::SetStartEnd(const Vec&, const Vec&)
asm void cM3dGLin::SetStartEnd(const Vec&, const Vec&) {
nofralloc
#include "SComponent/c_m3d_g_lin/asm/func_8026F31C.s"
void cM3dGLin::SetStartEnd(const Vec& pStart, const Vec& pEnd) {
mStart = pStart;
mEnd = pEnd;
}
// CalcPos__8cM3dGLinCFP3Vecf
// cM3dGLin::CalcPos(Vec*, float) const
asm void cM3dGLin::CalcPos(Vec*, float) const {
nofralloc
#include "SComponent/c_m3d_g_lin/asm/func_8026F350.s"
void cM3dGLin::CalcPos(Vec* pOut, f32 pScale) const {
Vec tmp;
PSVECSubtract(&mEnd, &mStart, &tmp);
PSVECScale(&tmp, &tmp, pScale);
PSVECAdd(&tmp, &mStart, pOut);
}
// SetEnd__8cM3dGLinFRC4cXyz
// cM3dGLin::SetEnd(const cXyz&)
asm void cM3dGLin::SetEnd(const cXyz&) {
nofralloc
#include "SComponent/c_m3d_g_lin/asm/func_8026F3C0.s"
void cM3dGLin::SetEnd(const cXyz& pEnd) {
mEnd = pEnd;
}
+35 -29
View File
@@ -1,52 +1,58 @@
/* c_m3d_g_pla.cpp autogenerated by split.py v0.3 at 2021-01-01 14:50:54.810233 */
#include "SComponent/c_m3d_g_pla.h"
#include "SComponent/c_m3d.h"
// __ct__8cM3dGPlaFPC4cXyzf
// cM3dGPla::cM3dGPla(const cXyz*, float)
asm cM3dGPla::cM3dGPla(const cXyz*, float) {
nofralloc
#include "SComponent/c_m3d_g_pla/asm/func_8026F3DC.s"
}
cM3dGPla::cM3dGPla(const cXyz* pNormal, f32 pD) : mNormal(*pNormal), mD(pD) {}
// crossInfLin__8cM3dGPlaCFRC4cXyzRC4cXyzR4cXyz
// cM3dGPla::crossInfLin(const cXyz&, const cXyz&, cXyz&) const
asm void cM3dGPla::crossInfLin(const cXyz&, const cXyz&, cXyz&) const {
nofralloc
#include "SComponent/c_m3d_g_pla/asm/func_8026F408.s"
bool cM3dGPla::crossInfLin(const cXyz& pStart, const cXyz& pEnd, cXyz& out) const {
f32 tmp1 = (mD + PSVECDotProduct(&mNormal, &pStart));
f32 tmp2 = tmp1 - (mD + PSVECDotProduct(&mNormal, &pEnd));
if (fabsf(tmp2) < lbl_80451180) {
out = pEnd;
return false;
} else {
cM3d_InDivPos2(&pStart, &pEnd, (tmp1 / tmp2), &out);
return true;
}
}
// SetupNP0__8cM3dGPlaFRC3VecRC3Vec
// cM3dGPla::SetupNP0(const Vec&, const Vec&)
asm void cM3dGPla::SetupNP0(const Vec&, const Vec&) {
nofralloc
#include "SComponent/c_m3d_g_pla/asm/func_8026F4C4.s"
void cM3dGPla::SetupNP0(const Vec& pNormal, const Vec& pPoint) {
mNormal = pNormal;
PSVECNormalize(&mNormal, &mNormal);
mD = -PSVECDotProduct(&mNormal, &pPoint);
}
// SetupNP__8cM3dGPlaFRC3VecRC3Vec
// cM3dGPla::SetupNP(const Vec&, const Vec&)
asm void cM3dGPla::SetupNP(const Vec&, const Vec&) {
nofralloc
#include "SComponent/c_m3d_g_pla/asm/func_8026F52C.s"
void cM3dGPla::SetupNP(const Vec& pNormal, const Vec& pPoint) {
mNormal = pNormal;
mD = -PSVECDotProduct(&mNormal, &pPoint);
}
// getCrossY__8cM3dGPlaCFRC4cXyzPf
// cM3dGPla::getCrossY(const cXyz&, float*) const
asm bool cM3dGPla::getCrossY(const cXyz&, float*) const {
nofralloc
#include "SComponent/c_m3d_g_pla/asm/func_8026F57C.s"
bool cM3dGPla::getCrossY(const cXyz& pPoint, f32* pOut) const {
if (fabsf(mNormal.y) < lbl_80451180) {
return false;
} else {
*pOut = (-mNormal.x * pPoint.x - mNormal.z * pPoint.z - mD) / mNormal.y;
return true;
}
}
// getCrossYLessD__8cM3dGPlaCFRC3VecPf
// cM3dGPla::getCrossYLessD(const Vec&, float*) const
asm bool cM3dGPla::getCrossYLessD(const Vec&, float*) const {
nofralloc
#include "SComponent/c_m3d_g_pla/asm/func_8026F5D4.s"
bool cM3dGPla::getCrossYLessD(const Vec& pPoint, f32* pOut) const {
if (fabsf(mNormal.y) < lbl_80451180) {
return false;
} else {
*pOut = (-mNormal.x * pPoint.x - mNormal.z * pPoint.z) / mNormal.y;
return true;
}
}
// Set__8cM3dGPlaFPC8cM3dGPla
// cM3dGPla::Set(const cM3dGPla*)
asm void cM3dGPla::Set(const cM3dGPla*) {
nofralloc
#include "SComponent/c_m3d_g_pla/asm/func_8026F624.s"
void cM3dGPla::Set(const cM3dGPla* pOther) {
*this = *pOther;
}
+23 -28
View File
@@ -1,52 +1,47 @@
/* c_m3d_g_sph.cpp autogenerated by split.py v0.3 at 2021-01-01 14:53:31.074880 */
#include "SComponent/c_m3d_g_sph.h"
#include "SComponent/c_m3d.h"
// SetC__8cM3dGSphFRC4cXyz
// cM3dGSph::SetC(const cXyz&)
asm void cM3dGSph::SetC(const cXyz&) {
nofralloc
#include "SComponent/c_m3d_g_sph/asm/func_8026F648.s"
void cM3dGSph::SetC(const cXyz& pCenter) {
mCenter = pCenter;
}
// Set__8cM3dGSphFRC4cXyzf
// cM3dGSph::Set(const cXyz&, float)
asm void cM3dGSph::Set(const cXyz&, float) {
nofralloc
#include "SComponent/c_m3d_g_sph/asm/func_8026F664.s"
void cM3dGSph::Set(const cXyz& pCenter, f32 pRadius) {
this->SetC(pCenter);
this->SetR(pRadius);
}
// Set__8cM3dGSphFRC9cM3dGSphS
// cM3dGSph::Set(const cM3dGSphS&)
asm void cM3dGSph::Set(const cM3dGSphS&) {
nofralloc
#include "SComponent/c_m3d_g_sph/asm/func_8026F6A8.s"
void cM3dGSph::Set(const cM3dGSphS& pOther) {
this->SetC(cXyz(pOther.mCenter));
this->SetR(pOther.mRadius);
}
// SetR__8cM3dGSphFf
// cM3dGSph::SetR(float)
asm void cM3dGSph::SetR(float) {
nofralloc
#include "SComponent/c_m3d_g_sph/asm/func_8026F708.s"
void cM3dGSph::SetR(f32 pRadius) {
mRadius = pRadius;
}
// cross__8cM3dGSphCFPC8cM3dGSphP4cXyz
// cM3dGSph::cross(const cM3dGSph*, cXyz*) const
asm bool cM3dGSph::cross(const cM3dGSph*, cXyz*) const {
nofralloc
#include "SComponent/c_m3d_g_sph/asm/func_8026F710.s"
bool cM3dGSph::cross(const cM3dGSph* pOther, cXyz* pOut) const {
return cM3d_Cross_SphSph(pOther, this, pOut);
}
// cross__8cM3dGSphCFPC8cM3dGCylP4cXyz
// cM3dGSph::cross(const cM3dGCyl*, cXyz*) const
asm bool cM3dGSph::cross(const cM3dGCyl*, cXyz*) const {
nofralloc
#include "SComponent/c_m3d_g_sph/asm/func_8026F73C.s"
bool cM3dGSph::cross(const cM3dGCyl* pCylinder, cXyz* pOut) const {
f32 f;
return cM3d_Cross_CylSph(pCylinder, this, pOut, &f);
}
// GetMinMaxCube__8cM3dGSphCFR4cXyzR4cXyz
// cM3dGSph::GetMinMaxCube(cXyz&, cXyz&) const
asm void cM3dGSph::GetMinMaxCube(cXyz&, cXyz&) const {
nofralloc
#include "SComponent/c_m3d_g_sph/asm/func_8026F76C.s"
void cM3dGSph::GetMinMaxCube(cXyz& pMin, cXyz& pMax) const {
pMin.x = mCenter.x - mRadius;
pMin.y = mCenter.y - mRadius;
pMin.z = mCenter.z - mRadius;
pMax.x = mCenter.x + mRadius;
pMax.y = mCenter.y + mRadius;
pMax.z = mCenter.z + mRadius;
}
+18 -16
View File
@@ -1,31 +1,33 @@
/* c_m3d_g_tri.cpp autogenerated by split.py v0.3 at 2021-01-01 14:55:53.593962 */
#include "SComponent/c_m3d_g_tri.h"
#include "SComponent/c_m3d.h"
// cross__8cM3dGTriCFPC8cM3dGCylP3Vec
// cM3dGTri::cross(const cM3dGCyl*, Vec*) const
asm bool cM3dGTri::cross(const cM3dGCyl*, Vec*) const {
nofralloc
#include "SComponent/c_m3d_g_tri/asm/func_8026F7B0.s"
bool cM3dGTri::cross(const cM3dGCyl* pCylinder, Vec* out) const {
return cM3d_Cross_CylTri(pCylinder, this, out);
}
// setPos__8cM3dGTriFPC3VecPC3VecPC3Vec
// cM3dGTri::setPos(const Vec*, const Vec*, const Vec*)
asm void cM3dGTri::setPos(const Vec*, const Vec*, const Vec*) {
nofralloc
#include "SComponent/c_m3d_g_tri/asm/func_8026F7DC.s"
void cM3dGTri::setPos(const Vec* pA, const Vec* pB, const Vec* pC) {
mA = *pA;
mB = *pB;
mC = *pC;
cM3d_CalcPla(&mA, &mB, &mC, &mPlane.mNormal, &mPlane.mD);
}
// setBg__8cM3dGTriFPC3VecPC3VecPC3VecPC8cM3dGPla
// cM3dGTri::setBg(const Vec*, const Vec*, const Vec*, const cM3dGPla*)
asm void cM3dGTri::setBg(const Vec*, const Vec*, const Vec*, const cM3dGPla*) {
nofralloc
#include "SComponent/c_m3d_g_tri/asm/func_8026F85C.s"
void cM3dGTri::setBg(const Vec* pA, const Vec* pB, const Vec* pC, const cM3dGPla* pPlane) {
mA = *pA;
mB = *pB;
mC = *pC;
mPlane.Set(pPlane);
}
// set__8cM3dGTriFPC3VecPC3VecPC3VecPC3Vec
// cM3dGTri::set(const Vec*, const Vec*, const Vec*, const Vec*)
asm void cM3dGTri::set(const Vec*, const Vec*, const Vec*, const Vec*) {
nofralloc
#include "SComponent/c_m3d_g_tri/asm/func_8026F8C8.s"
void cM3dGTri::set(const Vec* pA, const Vec* pB, const Vec* pC, const Vec* pNormal) {
mA = *pA;
mB = *pB;
mC = *pC;
mPlane.SetupNP(*pNormal, *pA);
}
+5 -2
View File
@@ -2,6 +2,9 @@
#include "SComponent/c_sxyz.h"
extern u8 lbl_804550A0;
extern u8 lbl_80430DA8;
// __ct__5csXyzFsss
csXyz::csXyz(s16 pX, s16 pY, s16 pZ) {
mX = pX;
@@ -28,11 +31,11 @@ csXyz csXyz::operator-(csXyz& other) {
// __ml__5csXyzFf
#ifdef NON_MATCHING
csXyz csXyz::operator*(float pFactor) {
csXyz csXyz::operator*(f32 pFactor) {
return csXyz(mX * pFactor, mY * pFactor, mZ * pFactor);
}
#else
asm csXyz csXyz::operator*(float) {
asm csXyz csXyz::operator*(f32) {
nofralloc
#include "SComponent/c_sxyz/asm/func_802674E8.s"
}
+11 -11
View File
@@ -17,7 +17,7 @@ cXyz cXyz::operator-(const Vec& vec) const {
}
// __ml__4cXyzCFf
cXyz cXyz::operator*(float scale) const {
cXyz cXyz::operator*(f32 scale) const {
Vec ret;
PSVECScale(this, &ret, scale);
return cXyz(ret);
@@ -37,7 +37,7 @@ cXyz cXyz::operator*(const Vec& vec) const {
}
// __dv__4cXyzCFf
cXyz cXyz::operator/(float scale) const {
cXyz cXyz::operator/(f32 scale) const {
Vec ret;
PSVECScale(this, &ret, /* 1.0 */ lbl_80455070 / scale);
return cXyz(ret);
@@ -90,12 +90,12 @@ cXyz cXyz::normZC(void) const {
if (!local_40.checkEpsilon()) {
cXyz ret;
// ret.baseZ();
float v = lbl_80455080;
f32 v = lbl_80455080;
ret.x = v;
ret.y = v;
v = lbl_80455070;
ret.z = v;
// should do a struct copy with word and not float loads
// should do a struct copy with word and not f32 loads
vec = lbl_8039A868;
vec = ret;
}
@@ -147,14 +147,14 @@ bool cXyz::operator!=(const Vec& vec) const {
// isZero__4cXyzCFv
bool cXyz::isZero(void) const {
// return (float)fabsf(this->x) < lbl_80455084 * lbl_80450AEC &&
// (float)fabsf(this->y) < lbl_80455084 * lbl_80450AEC &&
// (float)fabsf(this->z) < lbl_80455084 * lbl_80450AEC;
return (float)fabsf(this->x) <
// return (f32)fabsf(this->x) < lbl_80455084 * lbl_80450AEC &&
// (f32)fabsf(this->y) < lbl_80455084 * lbl_80450AEC &&
// (f32)fabsf(this->z) < lbl_80455084 * lbl_80450AEC;
return fabsf(this->x) <
/* 32 */ lbl_80455084 *
/* MSL_C.PPCEABI.bare.H::__float_epsilon */ *(float*)0x80450AEC &&
(float)fabsf(this->y) < lbl_80455084 * *(float*)0x80450AEC &&
(float)fabsf(this->z) < lbl_80455084 * *(float*)0x80450AEC;
/* MSL_C.PPCEABI.bare.H::__f32_epsilon */ *(f32*)0x80450AEC &&
fabsf(this->y) < lbl_80455084 * *(f32*)0x80450AEC &&
fabsf(this->z) < lbl_80455084 * *(f32*)0x80450AEC;
}
// atan2sX_Z__4cXyzCFv