mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-18 21:18:23 -04:00
d_a_npc_md work
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user