c_m3d mostly done (#2222)

This commit is contained in:
Caroline Madsen 2024-10-22 19:09:12 -04:00 committed by GitHub
parent 66bc920f4e
commit c44ea2139d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 1430 additions and 295 deletions

View File

@ -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
#endif

View File

@ -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); }

View File

@ -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
#endif

File diff suppressed because it is too large Load Diff