Work on d_bg_w (#1894)

This commit is contained in:
hatal175
2023-08-23 18:40:37 +03:00
committed by GitHub
parent 1f75e16efc
commit eba4ca3b13
46 changed files with 697 additions and 2288 deletions
+1
View File
@@ -30,6 +30,7 @@ public:
void SetPolyPassChk(cBgS_PolyPassChk* p_chk) { mPolyPassChk = p_chk; }
void SetGrpPassChk(cBgS_GrpPassChk* p_chk) { mGrpPassChk = p_chk; }
cBgS_PolyPassChk* GetPolyPassChk() const { return mPolyPassChk; }
cBgS_GrpPassChk* GetGrpPassChk() const { return mGrpPassChk; }
virtual ~cBgS_Chk(void);
}; // Size: 0x14
@@ -16,6 +16,8 @@ public:
f32 GetNowY() const { return mNowY; }
void SetNowY(f32 y) { mNowY = y; }
const cXyz& GetPointP() { return m_pos; }
u32 GetWallPrecheck() const { return mWallPrecheck; }
private:
/* 0x24 */ cXyz m_pos;
@@ -10,7 +10,7 @@ class cM3dGPla;
typedef int (*cBgS_ShdwDraw_Callback)(class cBgS_ShdwDraw*, cBgD_Vtx_t*, int, int, int, cM3dGPla*);
class cBgS_ShdwDraw : cBgS_Chk {
class cBgS_ShdwDraw : public cBgS_Chk {
public:
cBgS_ShdwDraw(void);
virtual ~cBgS_ShdwDraw(void);
@@ -19,7 +19,6 @@ public:
cM3dGAab* GetBndP() { return &mM3dGAab; }
private:
/* 0x14 */ cM3dGAab mM3dGAab;
/* 0x30 */ cBgS_ShdwDraw_Callback mCallbackFun;
};
+3
View File
@@ -62,6 +62,9 @@ static bool cM3d_Cross_SphSph(const cM3dGSph*, const cM3dGSph*, f32*, f32*);
bool cM3d_Cross_SphSph(const cM3dGSph*, const cM3dGSph*, Vec*);
static void cM3d_CalcSphVsTriCrossPoint(const cM3dGSph*, const cM3dGTri*, Vec*);
bool cM3d_Cross_SphTri(const cM3dGSph*, const cM3dGTri*, Vec*);
inline bool cM3d_Cross_SphTri(const cM3dGSph* param_0, const cM3dGTri* param_1) {
return cM3d_Cross_SphTri(param_0, param_1, NULL);
}
bool cM3d_Cross_CylCyl(const cM3dGCyl*, const cM3dGCyl*, f32*);
bool cM3d_Cross_CylCyl(const cM3dGCyl*, const cM3dGCyl*, Vec*);
bool cM3d_Cross_CylTri(const cM3dGCyl*, const cM3dGTri*, Vec*);
+14
View File
@@ -2,6 +2,8 @@
#define C_M3D_G_AAB_H
#include "SSystem/SComponent/c_xyz.h"
#include "SSystem/SComponent/c_m3d_g_lin.h"
#include "SSystem/SComponent/c_m3d.h"
#include "global.h"
// Axis aligned bounding box
@@ -32,6 +34,18 @@ public:
const f32 GetMinX(void) const { return mMin.x; }
const f32 GetMinY(void) const { return mMin.y; }
const f32 GetMinZ(void) const { return mMin.z; }
bool Cross(const cM3dGLin *param_1) {
return cM3d_Cross_MinMaxBoxLine(GetMinP(), GetMaxP(), (Vec*)&param_1->GetStartP(), (Vec*)&param_1->GetEndP());
}
bool Cross(const cM3dGAab *param_1) {
return cM3d_Cross_AabAab(this, param_1);
}
bool Cross(const cM3dGCyl *param_1) {
return cM3d_Cross_AabCyl(this, param_1);
}
bool Cross(const cM3dGSph *param_1) {
return cM3d_Cross_AabSph(this, param_1);
}
}; // Size = 0x1C
STATIC_ASSERT(0x1C == sizeof(cM3dGAab));
+3
View File
@@ -30,6 +30,9 @@ public:
void SetupFrom3Vtx(const Vec* v1, const Vec* v2, const Vec* v3) {
cM3d_CalcPla(v1, v2, v3, &mNormal, &mD);
}
f32 getCrossY_NonIsZero(const cXyz *param_1) {
return ((-mNormal.x * param_1->x - mNormal.z * param_1->z) - mD) / mNormal.y;
}
};
#endif
+3
View File
@@ -27,6 +27,9 @@ public:
void SetR(f32);
bool cross(const cM3dGSph*, cXyz*) const;
bool cross(const cM3dGCyl*, cXyz*) const;
inline bool cross(const cM3dGTri *param_1) const {
return cM3d_Cross_SphTri(this, param_1);
}
void GetMinMaxCube(cXyz&, cXyz&) const;
const cXyz& GetC(void) const { return mCenter; }
const cXyz* GetCP() const { return &mCenter; }
+1
View File
@@ -159,6 +159,7 @@ public:
bool ChkMoveBGOnly() const { return m_flags & MOVE_BG_ONLY; }
void SetWallHit() { m_flags |= WALL_HIT; }
void ClrWallNone() { m_flags &= ~WALL_NONE; }
cM3dGCyl* GetWallBmdCylP() { return &m_wall_cyl; }
// inline dupe
void i_ClrGroundHit() { m_flags &= ~GROUND_HIT; }
+20
View File
@@ -0,0 +1,20 @@
#ifndef D_BG_D_BG_S_CAPT_POLY_H
#define D_BG_D_BG_S_CAPT_POLY_H
#include "SSystem/SComponent/c_bg_s_chk.h"
#include "SSystem/SComponent/c_m3d_g_aab.h"
#include "d/bg/d_bg_s_chk.h"
struct dBgS_CaptPoly;
typedef void (*CaptPolyCallback)(dBgS_CaptPoly&, cBgD_Vtx_t*, u16, u16, u16, cM3dGPla*);
struct dBgS_CaptPoly : public cBgS_Chk, public dBgS_Chk {
public:
cM3dGAab* GetBndP() { return &m_pos;}
/* 0x2C */ cM3dGAab m_pos;
/* 0x48 */ CaptPolyCallback m_callback;
};
#endif
+2 -1
View File
@@ -21,7 +21,8 @@ public:
void OffNormalGrp() { mGrp &= ~NORMAL_GRP; }
void OffFullGrp() { mGrp &= ~FULL_GRP; }
void OnAll() { mGrp |= FULL_GRP; }
u32 MaskNormalGrp() const {return mGrp & 1; }
u32 MaskWaterGrp() const {return mGrp & 2; }
private:
/* 0x4 */ u32 mGrp;
};
+1
View File
@@ -17,6 +17,7 @@ public:
void SetNowY(f32 y) { mNowY = y; }
void i_SetPos(cXyz const& pos) { m_pos = pos; }
f32 GetNowY() { return mNowY; }
cXyz* GetPosP() { return &m_pos; }
private:
/* 0x3C */ cXyz m_pos;
+1
View File
@@ -29,6 +29,7 @@ public:
void SetHeight(f32 height) { m_height = height; }
f32 GetHeight() { return m_height; }
cXyz& GetPosP() { return m_ground; }
f32 GetRoof() const { return m_roof; }
private:
/* 0x3C */ cXyz m_ground;
+18 -19
View File
@@ -9,8 +9,8 @@
class cBgS_GrpPassChk;
class cBgS_PolyPassChk;
class fopAc_ac_c;
struct dBgS_CaptPoly {};
struct cBgD_Vtx_t;
struct dBgS_CaptPoly;
class cBgW_TriElm {
public:
@@ -74,8 +74,7 @@ struct dzb_b_data {
struct dzb_tree_data {
/* 0x0 */ u16 field_0x0;
/* 0x2 */ u16 field_0x2;
/* 0x4 */ u16 m_id[1];
/* 0x6 */ u8 field_0x6[0x14 - 0x6];
/* 0x4 */ u16 m_id[8];
}; // Size: 0x14
struct dzb_g_data {
@@ -123,10 +122,10 @@ public:
/* 8007A200 */ bool RwgLineCheck(u16, cBgS_LinChk*);
/* 8007A3A0 */ bool LineCheckRp(cBgS_LinChk*, int);
/* 8007A52C */ bool LineCheckGrpRp(cBgS_LinChk*, int, int);
/* 8007A680 */ void RwgGroundCheckCommon(f32, u16, cBgS_GndChk*);
/* 8007A774 */ void RwgGroundCheckGnd(u16, cBgS_GndChk*);
/* 8007A824 */ void RwgGroundCheckWall(u16, cBgS_GndChk*);
/* 8007A8F4 */ void GroundCrossRp(cBgS_GndChk*, int);
/* 8007A680 */ bool RwgGroundCheckCommon(f32, u16, cBgS_GndChk*);
/* 8007A774 */ bool RwgGroundCheckGnd(u16, cBgS_GndChk*);
/* 8007A824 */ bool RwgGroundCheckWall(u16, cBgS_GndChk*);
/* 8007A8F4 */ bool GroundCrossRp(cBgS_GndChk*, int);
/* 8007AA50 */ bool GroundCrossGrpRp(cBgS_GndChk*, int, int);
/* 8007ABC4 */ void CopyOldMtx();
/* 8007AC10 */ void Move();
@@ -223,7 +222,7 @@ public:
/* 0x92 */ u16 field_0x92;
/* 0x94 */ cBgW_TriElm* pm_tri;
/* 0x98 */ cBgW_RwgElm* pm_rwg;
/* 0x9C */ Vec* pm_vtx_tbl;
/* 0x9C */ cBgD_Vtx_t* pm_vtx_tbl;
/* 0xA0 */ cBgD_t* pm_bgd;
/* 0xA4 */ cBgW_unk_b_data* field_0xa4;
/* 0xA8 */ cBgW_GrpElm* pm_grp;
@@ -232,7 +231,7 @@ public:
class dBgW;
typedef void (*dBgW_RideCallback)(dBgW*, fopAc_ac_c*, fopAc_ac_c*);
typedef void (*dBgW_ArrowStickCallback)(fopAc_ac_c*, fopAc_ac_c*, cXyz&);
typedef void (*dBgW_ArrowStickCallback)(dBgW*, fopAc_ac_c*, fopAc_ac_c*, cXyz&);
typedef void (*dBgW_CrrFunc)(dBgW*, void*, cBgS_PolyInfo const&, bool, cXyz*, csXyz*, csXyz*);
class dBgW : public cBgW {
@@ -240,23 +239,23 @@ public:
/* 8007B970 */ dBgW();
/* 8007B9C0 */ void Move();
/* 8007B9EC */ void positionWallCorrect(dBgS_Acch*, f32, cM3dGPla&, cXyz* pupper_pos, f32);
/* 8007BA40 */ void RwgWallCorrect(dBgS_Acch*, u16);
/* 8007C234 */ void WallCorrectRp(dBgS_Acch*, int);
/* 8007BA40 */ bool RwgWallCorrect(dBgS_Acch*, u16);
/* 8007C234 */ bool WallCorrectRp(dBgS_Acch*, int);
/* 8007C360 */ bool WallCorrectGrpRp(dBgS_Acch*, int, int);
/* 8007C4AC */ void RwgWallCorrectSort(dBgS_Acch*, u16);
/* 8007C714 */ void WallCorrectRpSort(dBgS_Acch*, int);
/* 8007C808 */ void WallCorrectGrpRpSort(dBgS_Acch*, int, int);
/* 8007D0DC */ void RwgRoofChk(u16, dBgS_RoofChk*);
/* 8007D208 */ void RoofChkRp(dBgS_RoofChk*, int);
/* 8007C808 */ bool WallCorrectGrpRpSort(dBgS_Acch*, int, int);
/* 8007D0DC */ bool RwgRoofChk(u16, dBgS_RoofChk*);
/* 8007D208 */ bool RoofChkRp(dBgS_RoofChk*, int);
/* 8007D330 */ bool RoofChkGrpRp(dBgS_RoofChk*, int, int);
/* 8007D498 */ void RwgSplGrpChk(u16, dBgS_SplGrpChk*);
/* 8007D5C4 */ void SplGrpChkRp(dBgS_SplGrpChk*, int);
/* 8007D498 */ bool RwgSplGrpChk(u16, dBgS_SplGrpChk*);
/* 8007D5C4 */ bool SplGrpChkRp(dBgS_SplGrpChk*, int);
/* 8007D6F0 */ bool SplGrpChkGrpRp(dBgS_SplGrpChk*, int, int);
/* 8007D858 */ void RwgCaptPoly(int, dBgS_CaptPoly&);
/* 8007D8E8 */ void CaptPolyRp(dBgS_CaptPoly&, int);
/* 8007DA04 */ void CaptPolyGrpRp(dBgS_CaptPoly&, int, int);
/* 8007DB20 */ void RwgSphChk(u16, dBgS_SphChk*, void*);
/* 8007DC70 */ void SphChkRp(dBgS_SphChk*, void*, int);
/* 8007DB20 */ bool RwgSphChk(u16, dBgS_SphChk*, void*);
/* 8007DC70 */ bool SphChkRp(dBgS_SphChk*, void*, int);
/* 8007DDE0 */ bool SphChkGrpRp(dBgS_SphChk*, void*, int, int);
/* 8007E548 */ virtual ~dBgW();