mirror of
https://github.com/zeldaret/tp
synced 2026-08-15 04:50:37 -04:00
clean up dolphin files / work on some rels (#212)
* d_a_alldie / d_a_tboxSw / d_a_tag_gstart / d_a_tag_hstop * dolphin OS work / cleanup * dolphin GX work / cleanup * finish changing dolphin files to C * more files into C * match rest of MSL_C math functions * more dolphin files converted to C * remove asm * d_bg_w work * remove asm * d_a_alink work / kytag14
This commit is contained in:
@@ -27,6 +27,7 @@ public:
|
||||
u32 GetActorPid() const { return mActorPid; }
|
||||
void SetPolyPassChk(cBgS_PolyPassChk* p_chk) { mPolyPassChk = p_chk; }
|
||||
void SetGrpPassChk(cBgS_GrpPassChk* p_chk) { mGrpPassChk = p_chk; }
|
||||
cBgS_PolyPassChk* GetPolyPassChk() const { return mPolyPassChk; }
|
||||
|
||||
virtual ~cBgS_Chk(void);
|
||||
}; // Size: 0x14
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class cBgS_LinChk : public cBgS_Chk, public cBgS_PolyInfo {
|
||||
private:
|
||||
/* 0x024 */ cM3dGLin mLinP;
|
||||
public:
|
||||
/* 0x024 */ cM3dGLin mLin;
|
||||
/* 0x040 */ cXyz field_0x40;
|
||||
/* 0x04C */ u32 field_0x4c;
|
||||
/* 0x050 */ bool mPreWallChk;
|
||||
/* 0x051 */ bool mPreGroundChk;
|
||||
/* 0x052 */ bool mPreRoofChk;
|
||||
/* 0x053 */ u8 mFrontFlag;
|
||||
/* 0x054 */ u8 mBackFlag;
|
||||
/* 0x053 */ bool mFrontFlag;
|
||||
/* 0x054 */ bool mBackFlag;
|
||||
|
||||
public:
|
||||
cBgS_LinChk();
|
||||
@@ -30,6 +30,13 @@ public:
|
||||
void ClrHit() { field_0x4c &= ~16; }
|
||||
void SetHit() { field_0x4c |= 16; }
|
||||
u32 ChkHit() const { return field_0x4c & 16; }
|
||||
void SetCross(const cXyz& pos) { mLin.SetEnd(pos); }
|
||||
cM3dGLin* GetLinP() { return &mLin; }
|
||||
bool ChkBackFlag() const { return mBackFlag; }
|
||||
bool ChkFrontFlag() const { return mFrontFlag; }
|
||||
bool GetPreWallChk() const { return mPreWallChk; }
|
||||
bool GetPreGroundChk() const { return mPreGroundChk; }
|
||||
bool GetPreRoofChk() const { return mPreRoofChk; }
|
||||
};
|
||||
|
||||
#endif /* C_BG_S_LIN_CHK_H */
|
||||
|
||||
@@ -26,12 +26,12 @@ public:
|
||||
void PlusR(f32);
|
||||
const cXyz& getMaxP(void) const { return mMax; }
|
||||
const cXyz& getMinP(void) const { return mMin; }
|
||||
const f32 GetMaxX(void) const { return mMax.GetX(); }
|
||||
const f32 GetMaxY(void) const { return mMax.GetY(); }
|
||||
const f32 GetMaxZ(void) const { return mMax.GetZ(); }
|
||||
const f32 GetMinX(void) const { return mMin.GetX(); }
|
||||
const f32 GetMinY(void) const { return mMin.GetY(); }
|
||||
const f32 GetMinZ(void) const { return mMin.GetZ(); }
|
||||
const f32 GetMaxX(void) const { return mMax.x; }
|
||||
const f32 GetMaxY(void) const { return mMax.y; }
|
||||
const f32 GetMaxZ(void) const { return mMax.z; }
|
||||
const f32 GetMinX(void) const { return mMin.x; }
|
||||
const f32 GetMinY(void) const { return mMin.y; }
|
||||
const f32 GetMinZ(void) const { return mMin.z; }
|
||||
}; // Size = 0x1C
|
||||
|
||||
STATIC_ASSERT(0x1C == sizeof(cM3dGAab));
|
||||
|
||||
@@ -2,26 +2,34 @@
|
||||
#define C_M3C_G_PLA_H_
|
||||
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "SSystem/SComponent/c_m3d.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
// Plane with a normal
|
||||
class cM3dGPla {
|
||||
public:
|
||||
cXyz mNormal;
|
||||
f32 mD;
|
||||
/* 0x00 */ cXyz mNormal;
|
||||
/* 0x0C */ f32 mD;
|
||||
/* 0x10 vtable */
|
||||
|
||||
cM3dGPla() {}
|
||||
cM3dGPla(const cXyz*, f32);
|
||||
virtual ~cM3dGPla() {}
|
||||
bool crossInfLin(const cXyz&, const cXyz&, cXyz&) const;
|
||||
void SetupNP0(const Vec&, const Vec&);
|
||||
void SetupNP(const Vec&, const Vec&);
|
||||
bool getCrossY(const cXyz&, f32*) const;
|
||||
bool getCrossYLessD(const Vec&, f32*) const;
|
||||
void Set(const cM3dGPla*);
|
||||
void GetNP();
|
||||
|
||||
virtual ~cM3dGPla() {}
|
||||
|
||||
f32 getPlaneFunc(const Vec* pPoint) const { return mD + PSVECDotProduct(&mNormal, pPoint); }
|
||||
const cXyz& GetNP() const { return mNormal; }
|
||||
void GetNP();
|
||||
f32 GetD() const { return mD; }
|
||||
void SetupFrom3Vtx(const Vec* v1, const Vec* v2, const Vec* v3) {
|
||||
cM3d_CalcPla(v1, v2, v3, &mNormal, &mD);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -29,9 +29,9 @@ public:
|
||||
void GetMinMaxCube(cXyz&, cXyz&) const;
|
||||
const cXyz& GetC(void) const { return mCenter; }
|
||||
const f32 GetR(void) const { return mRadius; }
|
||||
f32 GetCX(void) const { return mCenter.GetX(); }
|
||||
f32 GetCY(void) const { return mCenter.GetY(); }
|
||||
f32 GetCZ(void) const { return mCenter.GetZ(); }
|
||||
f32 GetCX(void) const { return mCenter.x; }
|
||||
f32 GetCY(void) const { return mCenter.y; }
|
||||
f32 GetCZ(void) const { return mCenter.z; }
|
||||
|
||||
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); }
|
||||
|
||||
@@ -27,6 +27,9 @@ public:
|
||||
bool Cross(cM3dGTri const& other, cXyz* xyz) const {
|
||||
return cM3d_Cross_TriTri(*this, other, xyz);
|
||||
}
|
||||
bool cross(const cM3dGLin* lin, Vec* xyz, bool param_2, bool param_3) const {
|
||||
return cM3d_Cross_LinTri(lin, this, xyz, param_2, param_3);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -18,6 +18,18 @@ public:
|
||||
s16 GetX() const { return x; }
|
||||
s16 GetY() const { return y; }
|
||||
s16 GetZ() const { return z; }
|
||||
|
||||
void set(s16 oX, s16 oY, s16 oZ) {
|
||||
x = oX;
|
||||
y = oY;
|
||||
z = oZ;
|
||||
}
|
||||
|
||||
void setall(s16 val) {
|
||||
x = val;
|
||||
y = val;
|
||||
z = val;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* C_SXYZ_H */
|
||||
|
||||
@@ -41,6 +41,8 @@ struct cXyz : Vec {
|
||||
/* 80266B84 */ cXyz operator*(f32) const;
|
||||
/* 80266BD0 */ cXyz operator*(Vec const&) const;
|
||||
/* 80266C18 */ cXyz operator/(f32) const;
|
||||
/* 800977D8 */ // void operator=(cXyz const&);
|
||||
|
||||
void operator+=(f32 f) {
|
||||
x += f;
|
||||
y += f;
|
||||
@@ -72,6 +74,22 @@ struct cXyz : Vec {
|
||||
/* 80267128 */ s16 atan2sX_Z() const;
|
||||
/* 80267150 */ s16 atan2sY_XZ() const;
|
||||
|
||||
void set(f32 pX, f32 pY, f32 pZ) {
|
||||
x = pX;
|
||||
y = pY;
|
||||
z = pZ;
|
||||
}
|
||||
|
||||
void set(const Vec& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
}
|
||||
|
||||
f32 getXDiff(const Vec* other) const { return x - other->x; }
|
||||
f32 getYDiff(const Vec* other) const { return y - other->y; }
|
||||
f32 getZDiff(const Vec* other) const { return z - other->z; }
|
||||
|
||||
void setAll(f32 f) { set(f, f, f); }
|
||||
|
||||
void setMin(const cXyz& other) {
|
||||
|
||||
Reference in New Issue
Block a user