tag_allmato almost, swhit0 treesh swball done, misc cleanup (#2312)

* d_a_tag_allmato almost done

* d_a_swhit0 done

* some SSystem cleanup

* treesh done

* swball done, some other rel cleanup
This commit is contained in:
TakaRikka
2025-03-01 04:48:49 -08:00
committed by GitHub
parent 80edf3c8a8
commit f06311cd09
54 changed files with 2162 additions and 1767 deletions
+19 -14
View File
@@ -7,38 +7,42 @@
#include "SSystem/SComponent/c_m3d.h"
/* 8026F3DC-8026F408 269D1C 002C+00 0/0 3/3 0/0 .text __ct__8cM3dGPlaFPC4cXyzf */
cM3dGPla::cM3dGPla(const cXyz* normal, f32 d) : mNormal(*normal), mD(d) {}
cM3dGPla::cM3dGPla(const cXyz* normal, f32 d) {
mNormal = *normal;
mD = d;
}
/* 8026F408-8026F4C4 269D48 00BC+00 0/0 3/3 0/0 .text crossInfLin__8cM3dGPlaCFRC4cXyzRC4cXyzR4cXyz
*/
bool cM3dGPla::crossInfLin(const cXyz& start, const cXyz& end, cXyz& out) const {
f32 tmp1 = (mD + VECDotProduct(&mNormal, &start));
f32 tmp2 = tmp1 - (mD + VECDotProduct(&mNormal, &end));
if (fabsf(tmp2) < G_CM3D_F_ABS_MIN) {
f32 tmp1 = getPlaneFunc(&start);
f32 tmp2 = getPlaneFunc(&end);
if (cM3d_IsZero(tmp1 - tmp2)) {
out = end;
return false;
} else {
cM3d_InDivPos2(&start, &end, (tmp1 / tmp2), &out);
return true;
}
f32 var_f29 = tmp1 / (tmp1 - tmp2);
cM3d_InDivPos2(&start, &end, var_f29, &out);
return true;
}
/* 8026F4C4-8026F52C 269E04 0068+00 0/0 1/1 0/0 .text SetupNP0__8cM3dGPlaFRC3VecRC3Vec */
void cM3dGPla::SetupNP0(const Vec& normal, const Vec& point) {
mNormal = normal;
VECNormalize(&mNormal, &mNormal);
mD = -VECDotProduct(&mNormal, &point);
PSVECNormalize(&mNormal, &mNormal);
mD = -PSVECDotProduct(&mNormal, &point);
}
/* 8026F52C-8026F57C 269E6C 0050+00 0/0 2/2 0/0 .text SetupNP__8cM3dGPlaFRC3VecRC3Vec */
void cM3dGPla::SetupNP(const Vec& normal, const Vec& point) {
mNormal = normal;
mD = -VECDotProduct(&mNormal, &point);
mD = -PSVECDotProduct(&mNormal, &point);
}
/* 8026F57C-8026F5D4 269EBC 0058+00 0/0 2/2 0/0 .text getCrossY__8cM3dGPlaCFRC4cXyzPf */
bool cM3dGPla::getCrossY(const cXyz& point, f32* out) const {
if (fabsf(mNormal.y) < G_CM3D_F_ABS_MIN) {
if (cM3d_IsZero(mNormal.y)) {
return false;
} else {
*out = (-mNormal.x * point.x - mNormal.z * point.z - mD) / mNormal.y;
@@ -49,7 +53,7 @@ bool cM3dGPla::getCrossY(const cXyz& point, f32* out) const {
/* 8026F5D4-8026F624 269F14 0050+00 0/0 1/1 0/0 .text getCrossYLessD__8cM3dGPlaCFRC3VecPf
*/
bool cM3dGPla::getCrossYLessD(const Vec& point, f32* out) const {
if (fabsf(mNormal.y) < G_CM3D_F_ABS_MIN) {
if (cM3d_IsZero(mNormal.y)) {
return false;
} else {
*out = (-mNormal.x * point.x - mNormal.z * point.z) / mNormal.y;
@@ -59,5 +63,6 @@ bool cM3dGPla::getCrossYLessD(const Vec& point, f32* out) const {
/* 8026F624-8026F648 269F64 0024+00 0/0 1/1 0/0 .text Set__8cM3dGPlaFPC8cM3dGPla */
void cM3dGPla::Set(const cM3dGPla* other) {
*this = *other;
}
mNormal = *other->GetNP();
mD = other->GetD();
}