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
This commit is contained in:
Elijah Thomas
2024-11-12 22:30:01 -05:00
committed by GitHub
parent 9525f8e9e5
commit 2ecf6509dd
43 changed files with 1335 additions and 193 deletions
+7 -10
View File
@@ -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() {