summaryrefslogtreecommitdiff
path: root/include/SSystem/SComponent
diff options
context:
space:
mode:
authorCaroline Madsen <69010899+randomsalience@users.noreply.github.com>2024-10-22 19:09:12 -0400
committerGitHub <noreply@github.com>2024-10-22 16:09:12 -0700
commitc44ea2139d298e515f2a5208bf8847a88c15ecf1 (patch)
treefa2fad766e4813f14984b5ca72dfa3905891f0eb /include/SSystem/SComponent
parent66bc920f4e8b1810faea967e01bfef21b2233b89 (diff)
c_m3d mostly done (#2222)
Diffstat (limited to 'include/SSystem/SComponent')
-rw-r--r--include/SSystem/SComponent/c_m3d.h10
-rw-r--r--include/SSystem/SComponent/c_m3d_g_cyl.h1
-rw-r--r--include/SSystem/SComponent/c_m3d_g_pla.h5
3 files changed, 12 insertions, 4 deletions
diff --git a/include/SSystem/SComponent/c_m3d.h b/include/SSystem/SComponent/c_m3d.h
index 0855f6d908..028e85d653 100644
--- a/include/SSystem/SComponent/c_m3d.h
+++ b/include/SSystem/SComponent/c_m3d.h
@@ -14,7 +14,11 @@ class cM3dGTri;
class csXyz;
class cXyz;
-struct cM3d_Range;
+struct cM3d_Range {
+ /* 0x0 */ f32 mMin;
+ /* 0x4 */ f32 mMax;
+};
+
struct Vec;
extern const f32 G_CM3D_F_ABS_MIN;
@@ -73,7 +77,7 @@ static int cM3d_Cross_CylPntPnt(const cM3dGCyl*, const Vec*, const Vec*, Vec*, V
static bool cM3d_Cross_CylPnt(const cM3dGCyl*, const Vec*);
bool cM3d_Cross_CpsCps(const cM3dGCps&, const cM3dGCps&, Vec*);
bool cM3d_Cross_CpsCyl(const cM3dGCps&, const cM3dGCyl&, Vec*);
-static bool cM3d_Cross_CpsSph_CrossPos(const cM3dGCps&, const cM3dGSph&, const Vec&, Vec*);
+static void cM3d_Cross_CpsSph_CrossPos(const cM3dGCps&, const cM3dGSph&, const Vec&, Vec*);
bool cM3d_Cross_CpsSph(const cM3dGCps&, const cM3dGSph&, Vec*);
bool cM3d_Cross_TriTri(const cM3dGTri&, const cM3dGTri&, Vec*);
bool cM3d_Cross_CpsTri(const cM3dGCps&, cM3dGTri, Vec*);
@@ -99,4 +103,4 @@ inline f32 cM3d_LenSq(const Vec* a, const Vec* b) {
return VECSquareDistance(a, b);
}
-#endif \ No newline at end of file
+#endif
diff --git a/include/SSystem/SComponent/c_m3d_g_cyl.h b/include/SSystem/SComponent/c_m3d_g_cyl.h
index c23beb95f5..5d5f3a395b 100644
--- a/include/SSystem/SComponent/c_m3d_g_cyl.h
+++ b/include/SSystem/SComponent/c_m3d_g_cyl.h
@@ -36,6 +36,7 @@ public:
f32* GetRP() { return &mRadius; }
f32 GetH() const { return mHeight; }
cXyz& GetC() { return mCenter; }
+ const cXyz& GetC() const { return mCenter; }
bool Cross(const cM3dGCps* cps, cXyz* xyz) const { return cM3d_Cross_CpsCyl(*cps, *this, xyz); }
bool Cross(const cM3dGTri& tri, cXyz* xyz) const { return cM3d_Cross_CylTri(this, &tri, xyz); }
diff --git a/include/SSystem/SComponent/c_m3d_g_pla.h b/include/SSystem/SComponent/c_m3d_g_pla.h
index 568f46f6dc..ff4057b336 100644
--- a/include/SSystem/SComponent/c_m3d_g_pla.h
+++ b/include/SSystem/SComponent/c_m3d_g_pla.h
@@ -32,6 +32,9 @@ public:
f32 getCrossY_NonIsZero(const cXyz *param_1) {
return ((-mNormal.x * param_1->x - mNormal.z * param_1->z) - mD) / mNormal.y;
}
+ bool cross(cM3dGLin const& line, Vec& point) {
+ return cM3d_Cross_LinPla(&line, this, &point, true, true);
+ }
};
-#endif \ No newline at end of file
+#endif