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 23:48:47 +01:00
committed by GitHub
parent b8d0da505d
commit 1e105b87f1
135 changed files with 1022 additions and 2738 deletions
+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;
}