d_a_npc_md work

This commit is contained in:
LagoLunatic
2023-12-07 15:45:07 -05:00
parent 475ab11743
commit 18d1ef98ff
9 changed files with 250 additions and 30 deletions
+2
View File
@@ -4,6 +4,7 @@
#include "MSL_C/math.h"
#include "dolphin/types.h"
#include "dolphin/mtx/vec.h"
#include "dolphin/mtx/mtx.h"
class cM3dGAab;
class cM3dGCps;
@@ -85,6 +86,7 @@ f32 cM3d_lineVsPosSuisenCross(const cM3dGLin*, const Vec*, Vec*);
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*);
void cM3d_UpMtx_Base(const Vec&, const Vec&, MtxP);
inline bool cM3d_IsZero(f32 f) {
return fabsf(f) < G_CM3D_F_ABS_MIN;
+20 -4
View File
@@ -10,8 +10,9 @@ class cM3dGPla {
public:
/* 0x00 */ cXyz mNormal;
/* 0x0C */ f32 mD;
/* 0x10 vtable */
/* 0x10 */ /* vtable */
public:
cM3dGPla() {}
void CalcAngleXz(short* pAngleX, short* pAngleY) const;
void SetupNP0(const Vec&, const Vec&);
@@ -20,8 +21,9 @@ public:
return mD + VECDotProduct(&mNormal, p);
}
const cXyz * GetNP() const { return &mNormal; }
float getCrossY(const cXyz& i_axis) const {
cXyz* GetNP() { return &mNormal; }
const cXyz* GetNP() const { return &mNormal; }
float getCrossY(const cXyz& i_axis) const { // fake inline
return (-mNormal.x * i_axis.x - mNormal.z * i_axis.z - mD) / mNormal.y;
}
void getCrossY(const cXyz& i_axis, float* i_value) const {
@@ -29,8 +31,22 @@ public:
*i_value = getCrossY(i_axis);
}
}
f32 getSignedLenPos(const cXyz* param_1) const {
return cM3d_SignedLenPlaAndPos(this, param_1);
}
virtual ~cM3dGPla() {}
};
// TODO
void GetD() const {}
void Set(const cM3dGPla*) {}
void SetupFrom3Vtx(const Vec*, const Vec*, const Vec*) {}
cM3dGPla(const cM3dGPla&) {}
cM3dGPla(const cXyz*, float) {}
void cross(const cM3dGLin&, Vec&) const {}
void getCrossYLessD(const Vec&, float*) const {}
void getCrossY_NonIsZero(const cXyz&) const {}
void operator=(const cM3dGPla&) {}
}; // Size: 0x14
#endif
+32 -6
View File
@@ -13,16 +13,42 @@ struct cM3dGTriS {
};
class cM3dGTri : public cM3dGPla {
// private:
public:
// cM3dGPla mPlane;
Vec mA;
Vec mB;
Vec mC;
/* 0x00 */ /* cM3dGPla */
/* 0x14 */ Vec mA;
/* 0x20 */ Vec mB;
/* 0x2C */ Vec mC;
public:
cM3dGTri() {}
cM3dGTri(const Vec *pA, const Vec *pB, const Vec *pC);
bool cross(const cM3dGCyl*, Vec*) const;
};
bool cross(const cM3dGLin* line, Vec* vec, bool param_3, bool param_4) const {
return cM3d_Cross_LinTri(line, this, vec, param_3, param_4);
}
void Up(f32 dist) {
Vec delta;
PSVECScale(&mNormal, &delta, dist);
PSVECAdd(&mA, &delta, &mA);
PSVECAdd(&mB, &delta, &mB);
PSVECAdd(&mC, &delta, &mC);
mD -= dist;
}
// TODO
void Cross(const cM3dGCps&, Vec*) const {}
void Cross(const cM3dGCyl&, Vec*) const {}
void Cross(const cM3dGSph&, Vec*) const {}
void Cross(const cM3dGTri&, Vec*) const {}
cM3dGTri(const cM3dGTri&) {}
void crossX(const Vec*, f32*) const {}
void crossY(const Vec*) const {}
void crossZ(const Vec*, f32*) const {}
void setBg(const Vec*, const Vec*, const Vec*, const cM3dGPla*) {}
void setPos(const Vec*, const Vec*, const Vec*) {}
void setUp() {}
~cM3dGTri() {}
}; // Size: 0x38
#endif
+8
View File
@@ -138,6 +138,14 @@ struct cXyz : Vec {
f32 getDotProduct(const Vec& other) const { return VECDotProduct(this, &other); }
f32 inprod(const Vec& other) const { return getDotProduct(other); }
// TODO
// void inprodXZ(const Vec&) const {}
// void isNearZeroSquare(const cXyz&) const {}
// void operator*=(const Vec&) {}
// void operator/=(float) {}
// void operator=(const cXyz&) {}
// void print(const char*) {}
};
#endif /* C_XYZ_H */
+10 -8
View File
@@ -243,13 +243,14 @@ public:
s8 getArmRlocJntNum() { return m_armRloc_jnt_num; }
s8 getArmLJntNum() { return m_armL_jnt_num; }
s8 getArmLlocJntNum() { return m_armLloc_jnt_num; }
s8 getHairJntNum(int i) { return m_hair_jnt_nums[i]; }
J3DModel* getModel() { return mpMorf->getModel(); }
cXyz& getAttentionBasePos() { return m3094; }
cXyz& getEyePos() { return m3088; }
void getPHairDist(int) {}
void getPHairPos(int) {}
void getPHairVec(int) {}
cXyz* getPHairPos(int i) { return &m3174[i]; }
cXyz* getPHairVec(int i) { return &m31D4[i]; }
f32* getPHairDist(int i) { return &m3264[i]; }
cXyz* getPHairWall() { return m3234; }
void incAttnSetCount() {
@@ -258,9 +259,11 @@ public:
}
}
u8 checkBitHairMode(u8 bit) { return m3134 & bit; }
void setBitHairMode(u8 bit) { m3134 |= bit; }
void calcFlyingTimer() {}
void checkBitEffectStatus(u8) {}
void checkBitHairMode(u8) {}
void checkStatus(u32) {}
void checkStatusCamTagIn() {}
void checkStatusFly() {}
@@ -269,7 +272,6 @@ public:
void clearStatus(u32) {}
void countPiyo2TalkCNT() {}
void getFlyingTimer() {}
void getHairJntNum(int) {}
void getPiyo2TalkCNT() {}
void getTalkType() {}
void isLightBodyHit() {}
@@ -294,7 +296,6 @@ public:
void onPlayerRoom() {}
void onShipRide() {}
void setBitEffectStatus(u8) {}
void setBitHairMode(u8) {}
void setBitStatus(u32) {}
void setEffectStatus(u8) {}
void setFlyingTimer(s16) {}
@@ -540,7 +541,8 @@ public:
/* 0x3131 */ u8 m3131;
/* 0x3132 */ s8 mActionStatus;
/* 0x3133 */ u8 m3133;
/* 0x3134 */ u8 m3134[0x3136 - 0x3134];
/* 0x3134 */ u8 m3134;
/* 0x3135 */ u8 m3135[0x3136 - 0x3135];
/* 0x3136 */ u8 m3136;
/* 0x3137 */ u8 m3137;
/* 0x3138 */ u8 m3138;
@@ -564,7 +566,7 @@ public:
/* 0x3174 */ cXyz m3174[8];
/* 0x31D4 */ cXyz m31D4[8];
/* 0x3234 */ cXyz m3234[4];
/* 0x3264 */ u8 m3264[0x3284 - 0x3264];
/* 0x3264 */ f32 m3264[8];
/* 0x3284 */ char mModelArcName[3];
/* 0x3287 */ u8 m3287[0x32A4 - 0x3287];
/* 0x32A4 */ cXyz m32A4;
+1
View File
@@ -364,5 +364,6 @@ void dKyw_pntwind_cut(WIND_INFLUENCE*);
void dKyw_pwind_cylinder_set(WIND_INFLUENCE*);
void dKyw_evt_wind_set(s16 i_windX, s16 i_windY);
void dKyw_evt_wind_set_go();
void dKyw_get_AllWind_vec(cXyz* param_0, cXyz* i_direction, f32* i_power);
#endif /* D_KANKYO_WETHER_H */
+14
View File
@@ -305,6 +305,12 @@ public:
*/
static void ZrotM(s16 z) { mDoMtx_ZrotM(now, z); }
/**
* Rotates the `now` matrix on the Z-axis
* @param z The rotation value
*/
static void ZrotS(s16 z) { mDoMtx_ZrotS(now, z); }
static void inverse() { MTXInverse(now, now); }
static void inverseTranspose() { mDoMtx_inverseTranspose(now, now); }
@@ -323,6 +329,14 @@ public:
*/
static void copy(const Mtx m) { MTXCopy(m, now); }
static void rotAxisRadS(const Vec* axis, f32 rad) {
MTXRotAxisRad(now, axis, rad);
}
// TODO
static void quatS(const Quaternion*) {}
static void rYrotS(f32) {}
static Mtx now;
static Mtx buffer[16];
static Mtx* next;