diff options
| author | lepelog <lepelog@users.noreply.github.com> | 2021-06-13 00:20:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-12 18:20:45 -0400 |
| commit | 5be309a186d35e952080d73cc9584a8345d9e029 (patch) | |
| tree | 8b7101e8d097661615643fbc7ed2d19fbf3d28bb /include/SSystem/SComponent | |
| parent | b728ec1ef544571b02ef5fe05f418b9935c2b071 (diff) | |
c_cc_d (#132)
* gnd check
* more c_bg_s
* start adding static asserts for size
* Add more size checks
* c_cc
* c_cc progress
* failed implementing cCcD_*Attr
* progress
* format
* try destructor
* data
* remove unused asm
* remove inlineCross
* remove functions that didn't belong there
* naming fix
* match cCcD_SphAttr::CalcAabBox
* cCcD_Stts::ClrTg
* c_cc_s and mass fixes
Diffstat (limited to 'include/SSystem/SComponent')
| -rw-r--r-- | include/SSystem/SComponent/c_bg_s_chk.h | 3 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_bg_s_gnd_chk.h | 24 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_bg_s_lin_chk.h | 12 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_bg_s_shdw_draw.h | 10 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_cc_d.h | 351 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_cc_s.h | 60 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_m3d.h | 5 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_m3d_g_aab.h | 11 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_m3d_g_cps.h | 18 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_m3d_g_cyl.h | 19 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_m3d_g_lin.h | 11 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_m3d_g_pla.h | 2 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_m3d_g_sph.h | 14 | ||||
| -rw-r--r-- | include/SSystem/SComponent/c_m3d_g_tri.h | 19 |
14 files changed, 351 insertions, 208 deletions
diff --git a/include/SSystem/SComponent/c_bg_s_chk.h b/include/SSystem/SComponent/c_bg_s_chk.h index e544c3be4c..3000479fa7 100644 --- a/include/SSystem/SComponent/c_bg_s_chk.h +++ b/include/SSystem/SComponent/c_bg_s_chk.h @@ -15,6 +15,7 @@ public: virtual ~cBgS_Chk(void); void SetExtChk(cBgS_Chk&); bool ChkSameActorPid(unsigned int) const; -}; + void setActorPid(u32 pid) { mActorPid = pid; } +}; // Size = 0x14 #endif /* C_BG_S_CHK_H */ diff --git a/include/SSystem/SComponent/c_bg_s_gnd_chk.h b/include/SSystem/SComponent/c_bg_s_gnd_chk.h index 8b03e38b5e..7c63a99c6a 100644 --- a/include/SSystem/SComponent/c_bg_s_gnd_chk.h +++ b/include/SSystem/SComponent/c_bg_s_gnd_chk.h @@ -6,20 +6,18 @@ #include "SSystem/SComponent/c_xyz.h" #include "dolphin/types.h" -class cBgS_GndChk : public cBgS_Chk { -private: - /* 0x14 */ cBgS_PolyInfo mPolyInfo; - /* 0x24 */ cXyz m_pos; - /* 0x30 */ int field_0x30; - /* 0x34 */ float mNowY; - /* 0x38 */ void* mWallPrecheck; +class cBgS_GndChk : public cBgS_Chk, public cBgS_PolyInfo { + /* 80267C1C */ cBgS_GndChk(); + /* 80267C94 */ virtual ~cBgS_GndChk(); + /* 80267D28 */ void SetPos(cXyz const*); + /* 80267D0C */ void SetPos(Vec const*); + /* 80267D44 */ void PreCheck(); -public: - cBgS_GndChk(void); - virtual ~cBgS_GndChk(void); - void SetPos(const Vec*); - void SetPos(const cXyz*); - void PreCheck(void); +private: + /* 0x24 */ cXyz mPosition; + /* 0x30 */ s32 _30; + /* 0x34 */ f32 mNowY; + /* 0x38 */ u32 mWallPrecheck; }; #endif /* C_BG_S_GND_CHK_H */ diff --git a/include/SSystem/SComponent/c_bg_s_lin_chk.h b/include/SSystem/SComponent/c_bg_s_lin_chk.h index 60944d6b62..8e42c12876 100644 --- a/include/SSystem/SComponent/c_bg_s_lin_chk.h +++ b/include/SSystem/SComponent/c_bg_s_lin_chk.h @@ -7,22 +7,20 @@ #include "SSystem/SComponent/c_xyz.h" #include "dolphin/types.h" -class cBgS_LinChk { +class cBgS_LinChk : public cBgS_Chk, public cBgS_PolyInfo { private: - /* 0x000 */ cBgS_Chk mChk; - /* 0x014 */ cBgS_PolyInfo mPolyInfo; /* 0x024 */ cM3dGLin mLin; /* 0x040 */ cXyz field_0x40; /* 0x04C */ int field_0x4c; - /* 0x050 */ u8 mPreWallChk; - /* 0x051 */ u8 mPreGroundChk; - /* 0x052 */ u8 mPreRoofChk; + /* 0x050 */ bool mPreWallChk; + /* 0x051 */ bool mPreGroundChk; + /* 0x052 */ bool mPreRoofChk; /* 0x053 */ u8 mFrontFlag; /* 0x054 */ u8 mBackFlag; public: cBgS_LinChk(void); - ~cBgS_LinChk(void); + virtual ~cBgS_LinChk(void); void ct(void); void Set2(const cXyz*, const cXyz*, unsigned int); void PreCalc(void); diff --git a/include/SSystem/SComponent/c_bg_s_shdw_draw.h b/include/SSystem/SComponent/c_bg_s_shdw_draw.h index 21177adf6d..ceb4a5e6bd 100644 --- a/include/SSystem/SComponent/c_bg_s_shdw_draw.h +++ b/include/SSystem/SComponent/c_bg_s_shdw_draw.h @@ -1,6 +1,8 @@ #ifndef C_BG_S_SHDW_DRAW_H #define C_BG_S_SHDW_DRAW_H +#include "SSystem/SComponent/c_bg_s_chk.h" +#include "SSystem/SComponent/c_m3d_g_aab.h" #include "SSystem/SComponent/c_m3d_g_pla.h" #include "SSystem/SComponent/c_xyz.h" #include "dolphin/types.h" @@ -9,12 +11,16 @@ struct cBgD_Vtx_t; typedef int (*cBgS_ShdwDraw_Callback)(class cBgS_ShdwDraw*, cBgD_Vtx_t*, int, int, int, cM3dGPla*); -class cBgS_ShdwDraw { +class cBgS_ShdwDraw : cBgS_Chk { public: cBgS_ShdwDraw(void); - ~cBgS_ShdwDraw(void); + virtual ~cBgS_ShdwDraw(void); void Set(cXyz&, cXyz&); void SetCallback(cBgS_ShdwDraw_Callback); + +private: + /* 0x14 */ cM3dGAab mM3dGAab; + /* 0x30 */ cBgS_ShdwDraw_Callback mCallbackFun; }; #endif /* C_BG_S_SHDW_DRAW_H */ diff --git a/include/SSystem/SComponent/c_cc_d.h b/include/SSystem/SComponent/c_cc_d.h index fafdc7a515..9acffbdcd1 100644 --- a/include/SSystem/SComponent/c_cc_d.h +++ b/include/SSystem/SComponent/c_cc_d.h @@ -1,152 +1,187 @@ #ifndef C_CC_D_H #define C_CC_D_H +#include "SSystem/SComponent/c_m3d.h" #include "SSystem/SComponent/c_m3d_g_aab.h" #include "SSystem/SComponent/c_m3d_g_cps.h" #include "SSystem/SComponent/c_m3d_g_cyl.h" #include "SSystem/SComponent/c_m3d_g_sph.h" #include "SSystem/SComponent/c_m3d_g_tri.h" #include "dolphin/gx/GXTexture.h" -#include "dolphin/types.h" #include "f_op/f_op_actor.h" +#include "global.h" -class cCcD_ShapeAttr { -private: - /* 0x00 */ cM3dGAab mAab; +class cCcD_PntAttr; +class cCcD_CpsAttr; +class cCcD_TriAttr; +class cCcD_AabAttr; +class cCcD_CylAttr; +class cCcD_SphAttr; +class cCcD_ShapeAttr { public: - struct Shape {}; - - /* 8008556C */ virtual ~cCcD_ShapeAttr(); - /* 802649D8 */ virtual bool CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const; - /* 802649E0 */ virtual bool CrossCo(cCcD_ShapeAttr const&, f32*) const; - /* 80084E38 */ virtual void GetCoCP() const; - /* 80084E2C */ virtual void GetCoCP(); - /* 80263A64 */ virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const; + /* 0x00 */ cM3dGAab mAab; + /* 0x1C vtable */ + + struct Shape { + /* 0x00 */ u32 _0; + /* 0x04 */ f32 _4; + /* 0x08 */ f32 _8; + /* 0x0C */ f32 _C; + /* 0x10 */ f32 _10; + /* 0x14 */ f32 _14; + }; + + /* 8008556C vt[2] */ virtual ~cCcD_ShapeAttr() {} + /* 802649D8 vt[3] */ virtual bool CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const; + /* vt[4] */ virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const = 0; + /* vt[5] */ virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const = 0; + /* vt[6] */ virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const = 0; + /* vt[7] */ virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const = 0; + /* vt[8] */ virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const = 0; + /* vt[9] */ virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const = 0; + /* 802649E0 vt[10]*/ virtual bool CrossCo(cCcD_ShapeAttr const&, f32*) const; + /* vt[11]*/ virtual bool CrossCo(cCcD_PntAttr const&, f32*) const = 0; + /* vt[12]*/ virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const = 0; + /* vt[13]*/ virtual bool CrossCo(cCcD_TriAttr const&, f32*) const = 0; + /* vt[14]*/ virtual bool CrossCo(cCcD_AabAttr const&, f32*) const = 0; + /* vt[15]*/ virtual bool CrossCo(cCcD_CylAttr const&, f32*) const = 0; + /* vt[16]*/ virtual bool CrossCo(cCcD_SphAttr const&, f32*) const = 0; + /* 80084E38 vt[17]*/ virtual const cXyz& GetCoCP() const; + /* 80084E2C vt[18]*/ virtual cXyz& GetCoCP(); + /* vt[19]*/ virtual void CalcAabBox() = 0; + /* vt[20]*/ virtual bool GetNVec(cXyz const&, cXyz*) const = 0; + /* 80263A64 vt[21]*/ virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const; static f32 m_virtual_center[3]; }; -class cCcD_SphAttr; -class cCcD_CylAttr; -class cCcD_TriAttr; -class cCcD_PntAttr; -class cCcD_AabAttr; +STATIC_ASSERT(0x20 == sizeof(cCcD_ShapeAttr)); + +class cCcD_TriAttr : public cCcD_ShapeAttr, public cM3dGTri { +public: + /* 80084E44 */ virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const; + /* 80263A88 */ virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const; + /* 80263BCC */ virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const; + /* 80084E4C */ virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const; + /* 80263B90 */ virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const; + /* 80084E54 */ virtual bool CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const; + /* 80263B58 */ virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const; + /* 80084E9C */ virtual bool CrossCo(cCcD_AabAttr const&, f32*) const; + /* 80084EBC */ virtual bool CrossCo(cCcD_ShapeAttr const&, f32*) const; + /* 80084EA4 */ virtual bool CrossCo(cCcD_TriAttr const&, f32*) const; + /* 80084E8C */ virtual bool CrossCo(cCcD_SphAttr const&, f32*) const; + /* 80084EAC */ virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const; + /* 80084E94 */ virtual bool CrossCo(cCcD_CylAttr const&, f32*) const; + /* 80084EB4 */ virtual bool CrossCo(cCcD_PntAttr const&, f32*) const; + /* 80263C04 */ virtual void CalcAabBox(); + /* 80263C9C */ virtual bool GetNVec(cXyz const&, cXyz*) const; + /* 80264938 */ virtual ~cCcD_TriAttr(); +}; -class cCcD_CpsAttr : public cCcD_ShapeAttr { +class cCcD_CpsAttr : public cCcD_ShapeAttr, public cM3dGCps { public: /* 80085450 */ virtual ~cCcD_CpsAttr(); - /* 80263DC0 */ virtual void CrossAtTg(cCcD_SphAttr const&, cXyz*) const; - /* 80263E04 */ virtual void CrossAtTg(cCcD_TriAttr const&, cXyz*) const; - /* 80084FE4 */ virtual void CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const; + /* 80263DC0 */ virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const; + /* 80263E04 */ virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const; + /* 80084FE4 */ virtual bool CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const; /* 80084FDC */ virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const; /* 80084FD4 */ virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const; - /* 80263D38 */ virtual void CrossAtTg(cCcD_CpsAttr const&, cXyz*) const; - /* 80263D7C */ virtual void CrossAtTg(cCcD_CylAttr const&, cXyz*) const; - /* 80263F24 */ virtual void CrossCo(cCcD_CylAttr const&, f32*) const; + /* 80263D38 */ virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const; + /* 80263D7C */ virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const; + /* 80263F24 */ virtual bool CrossCo(cCcD_CylAttr const&, f32*) const; /* 80085024 */ virtual bool CrossCo(cCcD_TriAttr const&, f32*) const; /* 8008502C */ virtual bool CrossCo(cCcD_PntAttr const&, f32*) const; /* 8008501C */ virtual bool CrossCo(cCcD_AabAttr const&, f32*) const; - /* 80263ED4 */ virtual void CrossCo(cCcD_CpsAttr const&, f32*) const; - /* 80263F74 */ virtual void CrossCo(cCcD_SphAttr const&, f32*) const; - /* 80085034 */ virtual void CrossCo(cCcD_ShapeAttr const&, f32*) const; + /* 80263ED4 */ virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const; + /* 80263F74 */ virtual bool CrossCo(cCcD_SphAttr const&, f32*) const; + /* 80085034 */ virtual bool CrossCo(cCcD_ShapeAttr const&, f32*) const; /* 80263FC4 */ virtual void CalcAabBox(); - /* 80264014 */ virtual void GetNVec(cXyz const&, cXyz*) const; - -private: - /* 0x20 */ cM3dGCps mCps; + /* 80264014 */ virtual bool GetNVec(cXyz const&, cXyz*) const; }; -class cCcD_SphAttr : public cCcD_ShapeAttr { +STATIC_ASSERT(0x40 == sizeof(cCcD_CpsAttr)); + +class cCcD_SphAttr : public cCcD_ShapeAttr, public cM3dGSph { public: /* 8008721C */ virtual ~cCcD_SphAttr(); - /* 80264538 */ virtual void CrossAtTg(cCcD_CylAttr const&, cXyz*) const; - /* 802645C0 */ virtual void CrossAtTg(cCcD_TriAttr const&, cXyz*) const; + /* 80264538 */ virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const; + /* 802645C0 */ virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const; /* 80084B4C */ virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const; /* 80084B54 */ virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const; - /* 80084B5C */ virtual void CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const; - /* 802644EC */ virtual void CrossAtTg(cCcD_CpsAttr const&, cXyz*) const; - /* 8026457C */ virtual void CrossAtTg(cCcD_SphAttr const&, cXyz*) const; - /* 80264688 */ virtual void CrossCo(cCcD_CpsAttr const&, f32*) const; + /* 80084B5C */ virtual bool CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const; + /* 802644EC */ virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const; + /* 8026457C */ virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const; + /* 80264688 */ virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const; /* 80084B94 */ virtual bool CrossCo(cCcD_AabAttr const&, f32*) const; /* 80084B9C */ virtual bool CrossCo(cCcD_TriAttr const&, f32*) const; /* 80084BA4 */ virtual bool CrossCo(cCcD_PntAttr const&, f32*) const; - /* 80084BAC */ virtual void CrossCo(cCcD_ShapeAttr const&, f32*) const; - /* 80264644 */ virtual void CrossCo(cCcD_SphAttr const&, f32*) const; - /* 802645F8 */ virtual void CrossCo(cCcD_CylAttr const&, f32*) const; - /* 80084B44 */ virtual void GetCoCP() const; - /* 80037A54 */ virtual void GetCoCP(); + /* 80084BAC */ virtual bool CrossCo(cCcD_ShapeAttr const&, f32*) const; + /* 80264644 */ virtual bool CrossCo(cCcD_SphAttr const&, f32*) const; + /* 802645F8 */ virtual bool CrossCo(cCcD_CylAttr const&, f32*) const; + /* 80084B44 */ virtual const cXyz& GetCoCP() const; + /* 80037A54 */ virtual cXyz& GetCoCP(); /* 802646E0 */ virtual void CalcAabBox(); - /* 8026476C */ virtual void GetNVec(cXyz const&, cXyz*) const; + /* 8026476C */ virtual bool GetNVec(cXyz const&, cXyz*) const; /* 80264808 */ virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const; -private: - /* 0x20 */ cM3dGSph mSph; -}; // Size = 0x30 +}; // Size = 0x34 -class cCcD_CylAttr : public cCcD_ShapeAttr { +STATIC_ASSERT(0x34 == sizeof(cCcD_SphAttr)); + +class cCcD_CylAttr : public cCcD_ShapeAttr, public cM3dGCyl { public: /* 800854E0 */ virtual ~cCcD_CylAttr(); - /* 8026420C */ virtual void CrossAtTg(cCcD_SphAttr const&, cXyz*) const; - /* 802641C8 */ virtual void CrossAtTg(cCcD_CylAttr const&, cXyz*) const; + /* 8026420C */ virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const; + /* 802641C8 */ virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const; /* 80084CC8 */ virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const; - /* 80264250 */ virtual void CrossAtTg(cCcD_TriAttr const&, cXyz*) const; + /* 80264250 */ virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const; /* 80084CD0 */ virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const; - /* 80084CD8 */ virtual void CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const; - /* 8026417C */ virtual void CrossAtTg(cCcD_CpsAttr const&, cXyz*) const; - /* 80264288 */ virtual void CrossCo(cCcD_CylAttr const&, f32*) const; - /* 80264310 */ virtual void CrossCo(cCcD_CpsAttr const&, f32*) const; + /* 80084CD8 */ virtual bool CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const; + /* 8026417C */ virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const; + /* 80264288 */ virtual bool CrossCo(cCcD_CylAttr const&, f32*) const; + /* 80264310 */ virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const; /* 80084D10 */ virtual bool CrossCo(cCcD_AabAttr const&, f32*) const; /* 80084D18 */ virtual bool CrossCo(cCcD_TriAttr const&, f32*) const; /* 80084D20 */ virtual bool CrossCo(cCcD_PntAttr const&, f32*) const; - /* 80084D28 */ virtual void CrossCo(cCcD_ShapeAttr const&, f32*) const; - /* 802642CC */ virtual void CrossCo(cCcD_SphAttr const&, f32*) const; - /* 80084CC0 */ virtual void GetCoCP() const; - /* 80037A4C */ virtual void GetCoCP(); + /* 80084D28 */ virtual bool CrossCo(cCcD_ShapeAttr const&, f32*) const; + /* 802642CC */ virtual bool CrossCo(cCcD_SphAttr const&, f32*) const; + /* 80084CC0 */ virtual const cXyz& GetCoCP() const; + /* 80037A4C */ virtual cXyz& GetCoCP(); /* 80264368 */ virtual void CalcAabBox(); - /* 802643D0 */ virtual void GetNVec(cXyz const&, cXyz*) const; + /* 802643D0 */ virtual bool GetNVec(cXyz const&, cXyz*) const; /* 802644B8 */ virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const; -private: - /* 0x20 */ cM3dGCyl mCyl; -}; // Size = 0x34 +}; // Size = 0x38 -class cCcD_TriAttr { - /* 80084E44 */ bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const; - /* 80263A88 */ void CrossAtTg(cCcD_CpsAttr const&, cXyz*) const; - /* 80263BCC */ void CrossAtTg(cCcD_TriAttr const&, cXyz*) const; - /* 80084E4C */ bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const; - /* 80263B90 */ void CrossAtTg(cCcD_SphAttr const&, cXyz*) const; - /* 80084E54 */ void CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const; - /* 80263B58 */ void CrossAtTg(cCcD_CylAttr const&, cXyz*) const; - /* 80084E9C */ bool CrossCo(cCcD_AabAttr const&, f32*) const; - /* 80084EBC */ void CrossCo(cCcD_ShapeAttr const&, f32*) const; - /* 80084EA4 */ bool CrossCo(cCcD_TriAttr const&, f32*) const; - /* 80084E8C */ bool CrossCo(cCcD_SphAttr const&, f32*) const; - /* 80084EAC */ bool CrossCo(cCcD_CpsAttr const&, f32*) const; - /* 80084E94 */ bool CrossCo(cCcD_CylAttr const&, f32*) const; - /* 80084EB4 */ bool CrossCo(cCcD_PntAttr const&, f32*) const; - /* 80263C04 */ void CalcAabBox(); - /* 80263C9C */ void GetNVec(cXyz const&, cXyz*) const; - /* 80264938 */ ~cCcD_TriAttr(); -}; +STATIC_ASSERT(0x38 == sizeof(cCcD_CylAttr)); class cCcD_DivideInfo { private: /* 0x00 */ u32 field_0x0; /* 0x04 */ u32 field_0x4; /* 0x08 */ u32 field_0x8; - + /* 0x0C vtable */ public: virtual void test(); // temp to build OK, remove later virtual ~cCcD_DivideInfo(); /* 80263358 */ void Set(u32, u32, u32); - /* 80263368 */ void Chk(cCcD_DivideInfo const&) const; -}; + /* 80263368 */ bool Chk(cCcD_DivideInfo const&) const; +}; // Size = 0x10 -class cCcD_DivideArea { +STATIC_ASSERT(0x10 == sizeof(cCcD_DivideInfo)); + +class cCcD_DivideArea : public cM3dGAab { private: - cM3dGAab mAab; + /* 0x1C */ bool mXDiffIsZero; + /* 0x20 */ f32 mScaledXDiff; + /* 0x24 */ f32 mInvScaledXDiff; + /* 0x28 */ bool mYDiffIsZero; + /* 0x2C */ f32 mScaledYDiff; + /* 0x30 */ f32 mInvScaledYDiff; + /* 0x34 */ bool mZDiffIsZero; + /* 0x38 */ f32 mScaledZDiff; + /* 0x3C */ f32 mInvScaledZDiff; public: virtual void test(); // temp to build OK, remove later @@ -154,15 +189,31 @@ public: /* 802633A8 */ void SetArea(cM3dGAab const&); /* 802634D4 */ void CalcDivideInfo(cCcD_DivideInfo*, cM3dGAab const&, u32); /* 802636A0 */ void CalcDivideInfoOverArea(cCcD_DivideInfo*, cM3dGAab const&); -}; +}; // Size = 0x40 + +STATIC_ASSERT(0x40 == sizeof(cCcD_DivideArea)); -struct cCcD_SrcObjTg {}; +struct cCcD_SrcObjTg { + s32 mType; + s32 mSPrm; +}; -struct cCcD_SrcObjHitInf {}; +struct cCcD_SrcObjAt { + s32 mType; + u8 mAtp; + s32 mSPrm; +}; -struct cCcD_SrcObjAt {}; +struct cCcD_SrcObjHitInf { + cCcD_SrcObjAt mObjAt; + cCcD_SrcObjTg mObjTg; + s32 mSPrm; +}; -struct cCcD_SrcObj {}; +struct cCcD_SrcObj { + int field_0x0; + cCcD_SrcObjHitInf mSrcObjHitInf; +}; class cCcD_GStts { public: @@ -173,69 +224,82 @@ private: }; // Size = 0x4 class cCcD_Stts { -public: - /* 801410A4 */ ~cCcD_Stts(); - /* 80263894 */ bool GetGStts() const; - /* 8026389C */ bool GetGStts(); - /* 802638A4 */ void Init(int, int, void*, unsigned int); - /* 80263904 */ void Ct(); - /* 80263934 */ void PlusCcMove(f32, f32, f32); - /* 8026395C */ void ClrCcMove(); - /* 80263970 */ void PlusDmg(int); - /* 80263984 */ void GetWeightF() const; - /* 802649E8 */ void ClrAt(); - /* 802649EC */ void ClrTg(); - private: - /* 0x00 */ cXyz field_0x00; + /* 0x00 */ cXyz mXyz; /* 0x0C */ fopAc_ac_c* mActor; /* 0x10 */ int mApid; /* 0x14 */ u8 mWeight; /* 0x15 */ u8 field_0x15; /* 0x16 */ u8 mTg; - /* 0x18 */ void* vtable; + +public: + /* 801410A4 vt[3] */ virtual ~cCcD_Stts() {} + /* 80263894 vt[4] */ virtual const cCcD_GStts* GetGStts() const; + /* 8026389C vt[5] */ virtual cCcD_GStts* GetGStts(); + /* 802638A4 */ void Init(int, int, void*, unsigned int); + /* 80263904 vt[6] */ virtual void Ct(); + /* 80263934 */ void PlusCcMove(f32, f32, f32); + /* 8026395C */ void ClrCcMove(); + /* 80263970 */ void PlusDmg(int); + /* 80263984 */ f32 GetWeightF() const; + /* 802649E8 vt[7] */ virtual void ClrAt(); + /* 802649EC vt[8] */ virtual void ClrTg(); + u8 GetWeightUc() const { return mWeight; } + void SetWeight(u8 weight) { mWeight = weight; } + fopAc_ac_c* GetAc() { return mActor; } }; // Size = 0x1C +STATIC_ASSERT(0x1C == sizeof(cCcD_Stts)); + +class cCcD_Obj; // placeholder + class cCcD_ObjCommonBase { public: /* 8008409C */ ~cCcD_ObjCommonBase(); /* 802639B0 */ void ct(); + void setSPrm(s32 sprm) { mSPrm = sprm; } + s32 getSPrm() { return mSPrm; } -private: +protected: /* 0x00 */ int mSPrm; /* 0x04 */ int mRPrm; - /* 0x08 */ void* mHitObj; // cCcD_Obj* type + /* 0x08 */ cCcD_Obj* mHitObj; /* 0x0C */ void* vtable; }; -class cCcD_Obj; -#pragma pack(push, 1) -class cCcD_ObjAt : cCcD_ObjCommonBase { +STATIC_ASSERT(0x10 == sizeof(cCcD_ObjCommonBase)); + +class cCcD_ObjAt : public cCcD_ObjCommonBase { public: /* 80084040 */ ~cCcD_ObjAt(); /* 8026483C */ void SetHit(cCcD_Obj*); /* 8026484C */ void Set(cCcD_SrcObjAt const&); /* 80264868 */ void ClrHit(); + int GetType() const { return mType; } private: /* 0x10 */ int mType; /* 0x14 */ u8 mAtp; }; -#pragma pack(pop) -class cCcD_ObjTg : cCcD_ObjCommonBase { +STATIC_ASSERT(0x18 == sizeof(cCcD_ObjAt)); + +class cCcD_ObjTg : public cCcD_ObjCommonBase { public: /* 80083FE4 */ ~cCcD_ObjTg(); /* 80264880 */ void Set(cCcD_SrcObjTg const&); /* 80264894 */ void SetGrp(u32); /* 802648B0 */ void ClrHit(); /* 802648C8 */ void SetHit(cCcD_Obj*); + int GetType() const { return mType; } private: /* 0x10 */ int mType; }; -class cCcD_ObjCo : cCcD_ObjCommonBase { +STATIC_ASSERT(0x14 == sizeof(cCcD_ObjTg)); + +class cCcD_ObjCo : public cCcD_ObjCommonBase { public: /* 80083F88 */ ~cCcD_ObjCo(); /* 802648D8 */ void SetHit(cCcD_Obj*); @@ -244,30 +308,41 @@ public: /* 8026491C */ void SetVsGrp(u32); }; -class cCcD_ObjHitInf { -public: - /* 80083EC8 */ ~cCcD_ObjHitInf(); - /* 802639C4 */ void Set(cCcD_SrcObjHitInf const&); +STATIC_ASSERT(0x10 == sizeof(cCcD_ObjCo)); +class cCcD_ObjHitInf { private: /* 0x000 */ cCcD_ObjAt mObjAt; - /* 0x015 */ u8 field_0x15[3]; // padding? /* 0x018 */ cCcD_ObjTg mObjTg; /* 0x02C */ cCcD_ObjCo mObjCo; - /* 0x03C */ void* vtable; + /* 0x03C vtable */ +public: + /* 80083EC8 */ virtual ~cCcD_ObjHitInf(); + /* 802639C4 */ void Set(cCcD_SrcObjHitInf const&); + cCcD_ObjAt& GetObjAt() { return mObjAt; } + cCcD_ObjTg& GetObjTg() { return mObjTg; } + cCcD_ObjCo& GetObjCo() { return mObjCo; } + }; // Size = 0x40 -class cCcD_Obj : cCcD_ObjHitInf { +STATIC_ASSERT(0x40 == sizeof(cCcD_ObjHitInf)); + +class cCcD_GObjInf; + +class cCcD_Obj : public cCcD_ObjHitInf { public: - /* 80083DE0 */ ~cCcD_Obj(); - /* 800851A4 */ bool GetGObjInf() const; - /* 800847C8 */ bool GetGObjInf(); - /* 80084BE8 */ bool GetShapeAttr() const; - /* 80085130 */ bool GetShapeAttr(); - /* 80084BF0 */ void Draw(_GXColor const&); + /* 80083DE0 */ virtual ~cCcD_Obj(); + /* 800851A4 */ virtual cCcD_GObjInf const* GetGObjInf() const; + /* 800847C8 */ virtual cCcD_GObjInf* GetGObjInf(); + /* 80084BE8 */ virtual cCcD_ShapeAttr const* GetShapeAttr() const; + /* 80085130 */ virtual cCcD_ShapeAttr* GetShapeAttr(); + /* 80084BF0 */ virtual void Draw(_GXColor const&); /* 80263A10 */ void ct(); /* 80263A1C */ void Set(cCcD_SrcObj const&); - void GetAc(); + fopAc_ac_c* GetAc(); + + cCcD_Stts* GetStts() { return mStts; } + cCcD_DivideInfo& GetDivideInfo() { return mDivideInfo; } private: /* 0x040 */ int field_0x40; @@ -275,14 +350,18 @@ private: /* 0x048 */ cCcD_DivideInfo mDivideInfo; }; // Size = 0x58 -class cCcD_GObjInf : cCcD_Obj { +STATIC_ASSERT(0x58 == sizeof(cCcD_Obj)); + +class cCcD_GObjInf : public cCcD_Obj { public: - /* 80083CE8 */ ~cCcD_GObjInf(); - /* 800851A0 */ void GetGObjInf(); - /* 80084BE4 */ void GetGObjInf() const; - /* 80085138 */ void ClrAtHit(); - /* 80085158 */ void ClrTgHit(); - /* 8008517C */ void ClrCoHit(); + /* 80083CE8 */ virtual ~cCcD_GObjInf(); + /* 800851A0 */ virtual cCcD_GObjInf* GetGObjInf(); + /* 80084BE4 */ virtual cCcD_GObjInf const* GetGObjInf() const; + /* 80085138 */ virtual void ClrAtHit(); + /* 80085158 */ virtual void ClrTgHit(); + /* 8008517C */ virtual void ClrCoHit(); }; +STATIC_ASSERT(0x58 == sizeof(cCcD_GObjInf)); + #endif /* C_CC_D_H */ diff --git a/include/SSystem/SComponent/c_cc_s.h b/include/SSystem/SComponent/c_cc_s.h index 6e8acc2b79..a2f2517163 100644 --- a/include/SSystem/SComponent/c_cc_s.h +++ b/include/SSystem/SComponent/c_cc_s.h @@ -4,44 +4,62 @@ #include "SSystem/SComponent/c_cc_d.h" #include "dolphin/types.h" +enum WeightType { + WeightType_0 = 0, + WeightType_1 = 1, + WeightType_2 = 2, +}; + class cCcS { +private: + /* 0x0000 */ cCcD_Obj* mpObjAt[0x100]; + /* 0x0400 */ cCcD_Obj* mpObjTg[0x300]; + /* 0x1000 */ cCcD_Obj* mpObjCo[0x100]; + /* 0x1400 */ cCcD_Obj* mpObj[0x500]; + /* 0x2800 */ u16 mObjAtCount; + /* 0x2802 */ u16 mObjTgCount; + /* 0x2804 */ u16 mObjCoCount; + /* 0x2806 */ u16 mObjCount; + /* 0x2808 */ cCcD_DivideArea mDivideArea; + /* 0x2848 vtable */ + public: - /* 80030BDC */ ~cCcS(); /* 80264A6C */ cCcS(); /* 80264A94 */ void Ct(); /* 80264B60 */ void Dt(); - /* 80264B80 */ void GetWt(u8) const; + /* 80264B80 */ WeightType GetWt(u8) const; /* 80264BA8 */ void Set(cCcD_Obj*); /* 80264C5C */ void ClrCoHitInf(); /* 80264CF0 */ void ClrTgHitInf(); /* 80264D90 */ void ClrAtHitInf(); - /* 80264E2C */ void ChkNoHitAtTg(cCcD_Obj*, cCcD_Obj*); + /* 80264E2C */ int ChkNoHitAtTg(cCcD_Obj*, cCcD_Obj*); /* 80264F40 */ void ChkAtTg(); /* 8026515C */ void ChkNoHitCo(cCcD_Obj*, cCcD_Obj*); /* 80265230 */ void ChkCo(); - /* 802653A0 */ void CalcTgPlusDmg(cCcD_Obj*, cCcD_Obj*, cCcD_Stts*, cCcD_Stts*); + /* 802653A0 vt[2] */ virtual void CalcTgPlusDmg(cCcD_Obj*, cCcD_Obj*, cCcD_Stts*, cCcD_Stts*); /* 802653C8 */ void SetAtTgCommonHitInf(cCcD_Obj*, cCcD_Obj*, cXyz*); /* 802655E4 */ void SetCoCommonHitInf(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32); - /* 80265750 */ void SetPosCorrect(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32); + /* 80265750 vt[3]*/ virtual void SetPosCorrect(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32); /* 80265BB4 */ void CalcArea(); /* 80265CCC */ void Move(); /* 80265D30 */ void DrawClear(); - /* 80265DF4 */ void SetCoGCorrectProc(cCcD_Obj*, cCcD_Obj*); - /* 80265DF8 */ void SetCoGObjInf(bool, bool, cCcD_GObjInf*, cCcD_GObjInf*, cCcD_Stts*, - cCcD_Stts*, cCcD_GStts*, cCcD_GStts*); - /* 80265DFC */ void SetAtTgGObjInf(bool, bool, cCcD_Obj*, cCcD_Obj*, cCcD_GObjInf*, - cCcD_GObjInf*, cCcD_Stts*, cCcD_Stts*, cCcD_GStts*, - cCcD_GStts*, cXyz*); - /* 80265E00 */ bool ChkNoHitGAtTg(cCcD_GObjInf const*, cCcD_GObjInf const*, cCcD_GStts*, - cCcD_GStts*); - /* 80265E08 */ bool ChkAtTgHitAfterCross(bool, bool, cCcD_GObjInf const*, cCcD_GObjInf const*, - cCcD_Stts*, cCcD_Stts*, cCcD_GStts*, cCcD_GStts*); - /* 80265E10 */ bool ChkNoHitGCo(cCcD_Obj*, cCcD_Obj*); - /* 80265E18 */ void MoveAfterCheck(); + /* 80265DF8 vt[4] */ virtual void SetCoGObjInf(bool, bool, cCcD_GObjInf*, cCcD_GObjInf*, + cCcD_Stts*, cCcD_Stts*, cCcD_GStts*, + cCcD_GStts*); + /* 80265DFC vt[5] */ virtual void SetAtTgGObjInf(bool, bool, cCcD_Obj*, cCcD_Obj*, + cCcD_GObjInf*, cCcD_GObjInf*, cCcD_Stts*, + cCcD_Stts*, cCcD_GStts*, cCcD_GStts*, cXyz*); + /* 80265E00 vt[6] */ virtual bool ChkNoHitGAtTg(cCcD_GObjInf const*, cCcD_GObjInf const*, + cCcD_GStts*, cCcD_GStts*); + /* 80265E08 vt[7] */ virtual bool ChkAtTgHitAfterCross(bool, bool, cCcD_GObjInf const*, + cCcD_GObjInf const*, cCcD_Stts*, + cCcD_Stts*, cCcD_GStts*, cCcD_GStts*); + /* 80265E10 vt[8] */ virtual bool ChkNoHitGCo(cCcD_Obj*, cCcD_Obj*); + /* 80030BDC vt[9] */ virtual ~cCcS(); + /* 80265E18 vt[10] */ virtual void MoveAfterCheck(); + /* 80265DF4 vt[11] */ virtual void SetCoGCorrectProc(cCcD_Obj*, cCcD_Obj*); +}; // Size = 0x284C -private: - u8 field_0x0[10260]; - cCcD_DivideArea mDivideArea; -}; +STATIC_ASSERT(sizeof(cCcS) == 0x284C); #endif /* C_CC_S_H */ diff --git a/include/SSystem/SComponent/c_m3d.h b/include/SSystem/SComponent/c_m3d.h index 81d18507cb..7f3113dd41 100644 --- a/include/SSystem/SComponent/c_m3d.h +++ b/include/SSystem/SComponent/c_m3d.h @@ -2,6 +2,7 @@ #define C_M3D_H_ #include "dolphin/types.h" +#include "msl_c/math.h" class cM3dGAab; class cM3dGCps; @@ -83,4 +84,8 @@ f32 cM3d_lineVsPosSuisenCross(const Vec&, const Vec&, const Vec&, Vec*); int cM3d_2PlaneLinePosNearPos(const cM3dGPla&, const cM3dGPla&, const Vec*, Vec*); void cM3d_CrawVec(const Vec&, const Vec&, Vec*); +inline bool cM3d_IsZero(f32 f) { + return fabsf(f) < G_CM3D_F_ABS_MIN; +} + #endif
\ No newline at end of file diff --git a/include/SSystem/SComponent/c_m3d_g_aab.h b/include/SSystem/SComponent/c_m3d_g_aab.h index a246c70d0e..b8a0b25020 100644 --- a/include/SSystem/SComponent/c_m3d_g_aab.h +++ b/include/SSystem/SComponent/c_m3d_g_aab.h @@ -8,11 +8,12 @@ class cM3dGAab { private: public: - cXyz mMin; - cXyz mMax; + /* 0x00 */ cXyz mMin; + /* 0x0C */ cXyz mMax; + /* 0x18 vtable */ virtual void test(); // temp to build OK, remove later - virtual ~cM3dGAab(); + virtual ~cM3dGAab() {} void Set(const cXyz*, const cXyz*); bool CrossY(const cXyz*) const; bool UnderPlaneYUnder(f32) const; @@ -32,6 +33,8 @@ public: const f32 GetMinX(void) const { return mMin.GetX(); } const f32 GetMinY(void) const { return mMin.GetY(); } const f32 GetMinZ(void) const { return mMin.GetZ(); } -}; +}; // Size = 0x1C + +STATIC_ASSERT(0x1C == sizeof(cM3dGAab)); #endif /* C_M3D_G_AAB_H */ diff --git a/include/SSystem/SComponent/c_m3d_g_cps.h b/include/SSystem/SComponent/c_m3d_g_cps.h index 7bf6132c93..47acd885af 100644 --- a/include/SSystem/SComponent/c_m3d_g_cps.h +++ b/include/SSystem/SComponent/c_m3d_g_cps.h @@ -1,6 +1,7 @@ #ifndef C_M3D_G_CPS_H #define C_M3D_G_CPS_H +#include "SSystem/SComponent/c_m3d.h" #include "SSystem/SComponent/c_m3d_g_lin.h" #include "SSystem/SComponent/c_xyz.h" #include "dolphin/types.h" @@ -8,19 +9,26 @@ struct cM3dGCpsS { Vec mStart; Vec mEnd; - f32 unk_0x1c; + f32 mRadius; }; class cM3dGCps : public cM3dGLin { -private: - f32 unk_0x1c; - public: + /* 0x1C */ f32 mRadius; + cM3dGCps(void); virtual ~cM3dGCps(void); void Set(const cXyz&, const cXyz&, f32); void Set(const cM3dGCpsS&); void SetCps(const cM3dGCps&); -}; + bool Cross(cM3dGCps const* other, cXyz* xyz) const { + return cM3d_Cross_CpsCps(*this, *other, xyz); + } + bool Cross(cM3dGCyl const* cyl, cXyz* xyz) const { return cM3d_Cross_CpsCyl(*this, *cyl, xyz); } + bool Cross(cM3dGSph const* sph, cXyz* xyz) const { return cM3d_Cross_CpsSph(*this, *sph, xyz); } + +}; // Size = 0x20 + +STATIC_ASSERT(0x20 == sizeof(cM3dGCps)); #endif /* C_M3D_G_CPS_H */ diff --git a/include/SSystem/SComponent/c_m3d_g_cyl.h b/include/SSystem/SComponent/c_m3d_g_cyl.h index f3bc618b33..3aeff46bcd 100644 --- a/include/SSystem/SComponent/c_m3d_g_cyl.h +++ b/include/SSystem/SComponent/c_m3d_g_cyl.h @@ -1,18 +1,20 @@ #ifndef C_M3D_G_CYL_H #define C_M3D_G_CYL_H +#include "SSystem/SComponent/c_m3d.h" #include "SSystem/SComponent/c_xyz.h" #include "dolphin/types.h" // Cylinder struct cM3dGCylS { - cXyz mCenter; - f32 mRadius; - f32 mHeight; -}; + /* 0x00 */ cXyz mCenter; + /* 0x0C */ f32 mRadius; + /* 0x10 */ f32 mHeight; +}; // Size = 0x14 class cM3dGSph; class cM3dGCyl : public cM3dGCylS { + /* 0x14 vtable */ public: cM3dGCyl(const cXyz*, f32, f32); virtual void test(); // temp to build OK, remove later @@ -28,6 +30,13 @@ public: const cXyz& GetCP(void) const { return mCenter; } f32 GetR(void) const { return mRadius; } f32 GetH(void) const { return mHeight; } -}; + + 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); } + bool Cross(const cM3dGCyl* other, f32* f) const { return cM3d_Cross_CylCyl(this, other, f); } + bool Cross(const cM3dGSph* sph, f32* f) const { return cM3d_Cross_CylSph(this, sph, f); } +}; // Size = 0x18 + +STATIC_ASSERT(0x18 == sizeof(cM3dGCyl)); #endif /* C_M3D_G_CYL_H */ diff --git a/include/SSystem/SComponent/c_m3d_g_lin.h b/include/SSystem/SComponent/c_m3d_g_lin.h index b858765a9c..92f4342c13 100644 --- a/include/SSystem/SComponent/c_m3d_g_lin.h +++ b/include/SSystem/SComponent/c_m3d_g_lin.h @@ -3,14 +3,15 @@ #include "SSystem/SComponent/c_xyz.h" #include "dolphin/mtx/vec.h" -#include "dolphin/types.h" +#include "global.h" // Line class cM3dGLin { // private: public: - cXyz mStart; - cXyz mEnd; + /* 0x00 */ cXyz mStart; + /* 0x0C */ cXyz mEnd; + /* 0x18 vtable */ cM3dGLin() {} cM3dGLin(const cXyz&, const cXyz&); @@ -24,6 +25,8 @@ public: cXyz& GetStartP(void) { return mStart; } const cXyz& GetEndP(void) const { return mEnd; } cXyz& GetEndP(void) { return mEnd; } -}; +}; // Size = 0x1C + +STATIC_ASSERT(0x1C == sizeof(cM3dGLin)); #endif /* C_M3D_G_LIN_H */ diff --git a/include/SSystem/SComponent/c_m3d_g_pla.h b/include/SSystem/SComponent/c_m3d_g_pla.h index 25f7cf8978..71d5fd4532 100644 --- a/include/SSystem/SComponent/c_m3d_g_pla.h +++ b/include/SSystem/SComponent/c_m3d_g_pla.h @@ -11,7 +11,7 @@ public: f32 mD; cM3dGPla(); cM3dGPla(const cXyz*, f32); - virtual ~cM3dGPla(); + virtual ~cM3dGPla() {} bool crossInfLin(const cXyz&, const cXyz&, cXyz&) const; void SetupNP0(const Vec&, const Vec&); void SetupNP(const Vec&, const Vec&); diff --git a/include/SSystem/SComponent/c_m3d_g_sph.h b/include/SSystem/SComponent/c_m3d_g_sph.h index e03e026fa4..1956468a22 100644 --- a/include/SSystem/SComponent/c_m3d_g_sph.h +++ b/include/SSystem/SComponent/c_m3d_g_sph.h @@ -1,6 +1,7 @@ #ifndef C_M3D_G_SPH_H_ #define C_M3D_G_SPH_H_ +#include "SSystem/SComponent/c_m3d.h" #include "SSystem/SComponent/c_m3d_g_cyl.h" #include "SSystem/SComponent/c_xyz.h" #include "dolphin/types.h" @@ -13,8 +14,9 @@ struct cM3dGSphS { class cM3dGSph { private: public: - cXyz mCenter; - f32 mRadius; + /* 0x00 */ cXyz mCenter; + /* 0x0C */ f32 mRadius; + /* 0x10 vtable */ virtual void test(); // temp to build OK, remove later virtual ~cM3dGSph(); @@ -30,7 +32,13 @@ public: f32 GetCX(void) const { return mCenter.GetX(); } f32 GetCY(void) const { return mCenter.GetY(); } f32 GetCZ(void) const { return mCenter.GetZ(); } -}; + + bool Cross(const cM3dGSph* other, f32* f) const { return cM3d_Cross_SphSph(this, other, f); } + bool Cross(const cM3dGCps* cps, cXyz* xyz) const { return cM3d_Cross_CpsSph(*cps, *this, xyz); } + bool Cross(const cM3dGCyl* cyl, f32* f) const { return cM3d_Cross_CylSph(cyl, this, f); } +}; // Size = 0x14 + +STATIC_ASSERT(0x14 == sizeof(cM3dGSph)); // additional symbols needed for cM3dGSph extern "C" { diff --git a/include/SSystem/SComponent/c_m3d_g_tri.h b/include/SSystem/SComponent/c_m3d_g_tri.h index 04cb82d449..072bb48dd2 100644 --- a/include/SSystem/SComponent/c_m3d_g_tri.h +++ b/include/SSystem/SComponent/c_m3d_g_tri.h @@ -1,24 +1,31 @@ #ifndef C_M3D_G_TRI_H_ #define C_M3D_G_TRI_H_ +#include "SSystem/SComponent/c_m3d.h" #include "SSystem/SComponent/c_m3d_g_cyl.h" #include "SSystem/SComponent/c_m3d_g_pla.h" #include "SSystem/SComponent/c_xyz.h" #include "dolphin/types.h" -class cM3dGTri { +class cM3dGTri : public cM3dGPla { // private: public: - ~cM3dGTri(); - cM3dGPla mPlane; - cXyz mA; - cXyz mB; - cXyz mC; + // cM3dGPla mPlane; + Vec mA; + Vec mB; + Vec mC; + virtual ~cM3dGTri() {} bool cross(const cM3dGCyl*, Vec*) const; void setPos(const Vec*, const Vec*, const Vec*); void setBg(const Vec*, const Vec*, const Vec*, const cM3dGPla*); void set(const Vec*, const Vec*, const Vec*, const Vec*); + bool Cross(cM3dGCps const& cps, cXyz* xyz) const { return cM3d_Cross_CpsTri(cps, *this, xyz); } + bool Cross(cM3dGCyl const& cyl, cXyz* xyz) const { return this->cross(&cyl, xyz); } + bool Cross(cM3dGSph const& sph, cXyz* xyz) const { return cM3d_Cross_SphTri(&sph, this, xyz); } + bool Cross(cM3dGTri const& other, cXyz* xyz) const { + return cM3d_Cross_TriTri(*this, other, xyz); + } }; #endif
\ No newline at end of file |
