summaryrefslogtreecommitdiff
path: root/src/d/col
diff options
context:
space:
mode:
authorElijah Thomas <42302100+elijah-thomas774@users.noreply.github.com>2024-11-12 22:30:01 -0500
committerGitHub <noreply@github.com>2024-11-12 22:30:01 -0500
commit2ecf6509dd625096fe6c7841a36bb4c7ec954cb6 (patch)
treeb9f2af52c8ef6bbaed59cb9d708e2c3500f06b53 /src/d/col
parent9525f8e9e5c20dccd8a9848fb6a3625f88c3e803 (diff)
Tubo! (d_a_obj_tubo) (#95)
* begin work * fixup modifications to d_a_base header * progress * update from main again (forgor to fetch) * progress * Basically done * clean up some inlines * some at/tg hit typing and tubo naming * more naming
Diffstat (limited to 'src/d/col')
-rw-r--r--src/d/col/bg/d_bg_s_gnd_chk.cpp4
-rw-r--r--src/d/col/c/c_cc_d.cpp17
-rw-r--r--src/d/col/c/c_m3d_g_sph.cpp8
-rw-r--r--src/d/col/cc/d_cc_d.cpp6
4 files changed, 16 insertions, 19 deletions
diff --git a/src/d/col/bg/d_bg_s_gnd_chk.cpp b/src/d/col/bg/d_bg_s_gnd_chk.cpp
index 8a06c4e4..9c8fdab3 100644
--- a/src/d/col/bg/d_bg_s_gnd_chk.cpp
+++ b/src/d/col/bg/d_bg_s_gnd_chk.cpp
@@ -58,8 +58,8 @@ void dBgS_ObjGndChk::ClearInstance() {
sInstance.ClearPi();
}
-bool dBgS_ObjGndChk::CheckPos(const mVec3_c *pPos) {
- sInstance.SetPos(pPos);
+bool dBgS_ObjGndChk::CheckPos(const mVec3_c &pPos) {
+ sInstance.SetPos(&pPos);
sGroundHeight = dBgS::GetInstance()->GroundCross(&sInstance);
return sGroundHeight != -1e9f;
}
diff --git a/src/d/col/c/c_cc_d.cpp b/src/d/col/c/c_cc_d.cpp
index 67140f50..1dd65c6d 100644
--- a/src/d/col/c/c_cc_d.cpp
+++ b/src/d/col/c/c_cc_d.cpp
@@ -1,5 +1,6 @@
#include "d/col/c/c_cc_d.h"
+#include "c/c_math.h"
#include "common.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/c/c_m3d.h"
@@ -16,10 +17,6 @@
#include "rvl/MTX.h" // IWYU pragma: export
#include "s/s_Math.h"
-// Very Hack ??
-static inline bool IsZero(f32 in) {
- return fabsf(in) <= EGG::Math<f32>::epsilon();
-}
static inline void MtxTransMinusXYZ(mMtx_c &mtx, f32 x, f32 y, f32 z) {
PSMTXTrans(mtx, -x, -y, -z);
}
@@ -441,7 +438,7 @@ bool cCcD_Obj::ChkTgAtHitType(u32 mask) const {
return mTg.mAtHitSrc.mType & mask;
}
-u32 cCcD_Obj::GetTg_0x58() const {
+u32 cCcD_Obj::GetTgAtHitType() const {
return mTg.mAtHitSrc.mType;
}
@@ -508,8 +505,8 @@ dAcObjBase_c *cCcD_Obj::GetTgActor() {
return mTg.GetActor();
}
-const mVec3_c &cCcD_Obj::GetTg_0x2C() const {
- return mTg.mField_0x2C;
+const mVec3_c &cCcD_Obj::GetTgAtHitDir() const {
+ return mTg.mAtHitDir;
}
dAcObjBase_c *cCcD_Obj::GetCoActor() {
@@ -612,7 +609,7 @@ bool cCcD_TriAttr::Calc(const mVec3_c &start, const mVec3_c &end, mVec3_c *pOut)
}
mVec3_c tmp2 = tmp1 - tmp0;
f32 mag = tmp2.squaredLength();
- if (IsZero(mag)) {
+ if (cM::isZero(mag)) {
bVar1 = true;
} else {
mag = tmp2.dot(*pOut - tmp0) / mag;
@@ -978,7 +975,7 @@ bool cCcD_CpsAttr::Calc(const mVec3_c &start, const mVec3_c &end, mVec3_c *pOut)
bool bInverse;
f32 dist = EGG::Math<f32>::sqrt(tmp0.x * tmp0.x + tmp0.z * tmp0.z);
- if (IsZero(dist)) {
+ if (cM::isZero(dist)) {
tmp1 = start;
tmp2 = end;
if (endRef.y > startRef.y) {
@@ -1308,7 +1305,7 @@ void cCcD_SphAttr::Set(const cCcD_SrcSphAttr &src) {
a.z = 0.0f;
a.y = 0.0f;
a.x = 0.0f;
- SetC(&a);
+ SetC(a);
}
mVec3_c &cCcD_SphAttr::GetCoP() {
diff --git a/src/d/col/c/c_m3d_g_sph.cpp b/src/d/col/c/c_m3d_g_sph.cpp
index 5f377f98..a5292fe8 100644
--- a/src/d/col/c/c_m3d_g_sph.cpp
+++ b/src/d/col/c/c_m3d_g_sph.cpp
@@ -6,12 +6,12 @@ cM3dGSph::cM3dGSph() {
mRatio = 1.0f;
}
-void cM3dGSph::SetC(const mVec3_c *c) {
- mCenter = *c;
+void cM3dGSph::SetC(const mVec3_c &c) {
+ mCenter = c;
}
void cM3dGSph::Set(const mVec3_c *c, f32 r) {
- SetC(c);
+ SetC(*c);
SetR(r);
}
@@ -24,7 +24,7 @@ void cM3dGSph::SetR(f32 r) {
void cM3dGSph::SetC(f32 x, f32 y, f32 z) {
mVec3_c c(x, y, z);
- SetC(&c);
+ SetC(c);
}
bool cM3dGSph::Cross(cM3dGUnk &pUnk, mVec3_c *pOut) {
diff --git a/src/d/col/cc/d_cc_d.cpp b/src/d/col/cc/d_cc_d.cpp
index 3524192f..ce7e720f 100644
--- a/src/d/col/cc/d_cc_d.cpp
+++ b/src/d/col/cc/d_cc_d.cpp
@@ -62,17 +62,17 @@ void dCcD_Sph::Set(const dCcD_SrcSph &src) {
void dCcD_Sph::setCenter(const mVec3_c &c) {
SetAtVec(mVec3_c::Zero);
- SetC(&c);
+ SetC(c);
}
void dCcD_Sph::moveCenter(const mVec3_c &c) {
SetAtVec(c - GetC());
- SetC(&c);
+ SetC(c);
}
void dCcD_Sph::setCenterAndAtVec(const mVec3_c &a, const mVec3_c &b) {
SetAtVec(b);
- SetC(&a);
+ SetC(a);
}
cCcD_ShapeAttr *dCcD_Sph::GetShapeAttr() {