diff options
| author | Elijah Thomas <42302100+elijah-thomas774@users.noreply.github.com> | 2025-05-24 03:42:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-24 03:42:26 -0400 |
| commit | 4c62e0102547907becb945138356f401b150120e (patch) | |
| tree | 26ab52a682f8f09a894eab1b0365eda206c68e36 /include/d/col | |
| parent | 9efc1e0ab925eb88a00e1e3f2e7810fa63d5267b (diff) | |
d_jnt_col OK (#174)
* d_jnt_col almost ok
* OK: Thanks Robo!
Diffstat (limited to 'include/d/col')
| -rw-r--r-- | include/d/col/c/c_m3d.h | 25 | ||||
| -rw-r--r-- | include/d/col/c/c_m3d_g_pla.h | 8 |
2 files changed, 25 insertions, 8 deletions
diff --git a/include/d/col/c/c_m3d.h b/include/d/col/c/c_m3d.h index cf9c3450..8623afb9 100644 --- a/include/d/col/c/c_m3d.h +++ b/include/d/col/c/c_m3d.h @@ -3,9 +3,10 @@ #include "common.h" #include "math.h" -#include "nw4r/math.h" // IWYU pragma: export #include "nw4r/types_nw4r.h" +#include "nw4r/math.h" // IWYU pragma: export + class cM3dGAab; class cM3dGCps; class cM3dGCyl; @@ -21,18 +22,24 @@ extern const f32 G_CM3D_F_ABS_MIN; bool cM3d_Len2dSqPntAndSegLine(f32, f32, f32, f32, f32, f32, f32 *, f32 *, f32 *); bool cM3d_Len3dSqPntAndSegLine(const cM3dGLin &, const nw4r::math::VEC3 &, nw4r::math::VEC3 *, f32 *, f32 *); -f32 cM3d_SignedLenPlaAndPos(const cM3dGPla &, const nw4r::math::VEC3 *); -void cM3d_CalcPla(const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, nw4r::math::VEC3 *, f32 *); +f32 cM3d_SignedLenPlaAndPos(const cM3dGPla *, const nw4r::math::VEC3 *); +void cM3d_CalcPla( + const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, nw4r::math::VEC3 *, f32 * +); int cM3d_Check_LinLin(const cM3dGLin &, const cM3dGLin *, f32 *, f32 *); bool cM3d_Cross_LinPla(const cM3dGLin &, const cM3dGPla *, nw4r::math::VEC3 *, bool, bool); -bool cM3d_Cross_MinMaxBoxLine(const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *); +bool cM3d_Cross_MinMaxBoxLine( + const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 * +); bool cM3d_InclusionCheckPosIn3PosBox3d( const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, f32 ); bool cM3d_CrossX_Tri(const cM3dGTri &, const nw4r::math::VEC3 *, f32); bool cM3d_CrossX_Tri(const cM3dGTri &, const nw4r::math::VEC3 *); bool cM3d_CrossY_Tri(const cM3dGTri &, const nw4r::math::VEC3 *); -bool cM3d_CrossY_Tri_Front(const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, const nw4r::math::VEC3 *); +bool cM3d_CrossY_Tri_Front( + const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, const nw4r::math::VEC3 * +); bool cM3d_CrossY_Tri(const cM3dGTri &, const nw4r::math::VEC3 *, f32 *); bool cM3d_CrossY_Tri(const cM3dGTri &, const nw4r::math::VEC3 *, f32); bool cM3d_CrossY_Tri(const cM3dGTri &, const nw4r::math::VEC3 *, const cM3d_Range *, f32 *); @@ -59,7 +66,9 @@ bool cM3d_Cross_CylCyl(const cM3dGCyl &, const cM3dGCyl &, f32 *); bool cM3d_Cross_CylCyl(const cM3dGCyl &, const cM3dGCyl &, nw4r::math::VEC3 *); bool cM3d_Cross_CylTri(const cM3dGCyl &, const cM3dGTri &, nw4r::math::VEC3 *); int cM3d_Cross_CylLin(const cM3dGCyl &, const cM3dGLin &, nw4r::math::VEC3 *, nw4r::math::VEC3 *); -int cM3d_Cross_CylPntPnt(const cM3dGCyl &, const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, nw4r::math::VEC3 *, nw4r::math::VEC3 *); +int cM3d_Cross_CylPntPnt( + const cM3dGCyl &, const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, nw4r::math::VEC3 *, nw4r::math::VEC3 * +); bool cM3d_Cross_CylPnt(const cM3dGCyl &, const nw4r::math::VEC3 &); bool cM3d_Cross_CpsCps(const cM3dGCps &, const cM3dGCps &, nw4r::math::VEC3 *, f32 *, f32 *); bool cM3d_Cross_CpsCyl(const cM3dGCps &, const cM3dGCyl &, nw4r::math::VEC3 *); @@ -72,7 +81,9 @@ void cM3d_PlaneCrossLineProcWork(f32, f32, f32, f32, f32, f32, f32, f32 *, f32 * int cM3d_2PlaneCrossLine(const cM3dGPla &, const cM3dGPla &, cM3dGLin *); bool cM3d_3PlaneCrossPos(const cM3dGPla &, const cM3dGPla &, const cM3dGPla &, nw4r::math::VEC3 *); f32 cM3d_lineVsPosSuisenCross(const cM3dGLin &, const nw4r::math::VEC3 &, nw4r::math::VEC3 *); -f32 cM3d_lineVsPosSuisenCross(const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, nw4r::math::VEC3 *); +f32 cM3d_lineVsPosSuisenCross( + const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, nw4r::math::VEC3 * +); bool cM3d_Cross_UnkTri(const cM3dGUnk &, cM3dGTri &, nw4r::math::VEC3 *); bool cM3d_Cross_CylUnk(const cM3dGCyl &, cM3dGUnk &, nw4r::math::VEC3 *); diff --git a/include/d/col/c/c_m3d_g_pla.h b/include/d/col/c/c_m3d_g_pla.h index b7e6d602..77734b2f 100644 --- a/include/d/col/c/c_m3d_g_pla.h +++ b/include/d/col/c/c_m3d_g_pla.h @@ -5,6 +5,7 @@ #include "d/col/c/c_m3d.h" #include "m/m_angle.h" #include "m/m_vec.h" +#include "rvl/MTX/vec.h" // Plane with a normal class cM3dGPla { @@ -22,8 +23,13 @@ public: mAng GetAngle(mAng) const; mAng GetNegativeAngle(mAng) const; + void SetupNP0(const mVec3_c &normal, const mVec3_c &point) { + mNormal = normal; + VECNormalize(mNormal, mNormal); + mD = -VECDotProduct(mNormal, point); + } + // Unused - // void SetupNP0(const mVec3_c &, const mVec3_c &); // void SetupNP(const mVec3_c &, const mVec3_c &); // bool getCrossY(const mVec3_c &, f32 *) const; // void Set(const cM3dGPla *); |
