mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-04 09:08:39 -04:00
@@ -0,0 +1,21 @@
|
||||
#ifndef C_API_H
|
||||
#define C_API_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
typedef void (*cAPIGph_Mthd)(void);
|
||||
|
||||
struct cAPIGph__Iface
|
||||
{
|
||||
u8 * mpGInfo;
|
||||
cAPIGph_Mthd mpCreate;
|
||||
cAPIGph_Mthd mpBeforeOfDraw;
|
||||
cAPIGph_Mthd mpAfterOfDraw;
|
||||
cAPIGph_Mthd mpPainter;
|
||||
cAPIGph_Mthd mpBlankingOn;
|
||||
cAPIGph_Mthd mpBlankingOff;
|
||||
};
|
||||
|
||||
extern cAPIGph__Iface g_cAPI_Interface;
|
||||
|
||||
#endif /* C_API_H */
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef C_API_CONTROLLER_PAD_
|
||||
#define C_API_CONTROLLER_PAD_
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
struct interface_of_controller_pad {
|
||||
/* 0x00 */ f32 mMainStickPosX;
|
||||
/* 0x04 */ f32 mMainStickPosY;
|
||||
/* 0x08 */ f32 mMainStickValue;
|
||||
/* 0x0C */ s16 mMainStickAngle;
|
||||
/* 0x0E */ u8 field_0xe;
|
||||
/* 0x0F */ u8 field_0xf;
|
||||
/* 0x10 */ f32 mCStickPosX;
|
||||
/* 0x14 */ f32 mCStickPosY;
|
||||
/* 0x18 */ f32 mCStickValue;
|
||||
/* 0x1C */ s16 mCStickAngle;
|
||||
/* 0x1E */ u8 field_0x1e;
|
||||
/* 0x1F */ u8 field_0x1f;
|
||||
/* 0x20 */ f32 mAnalogA;
|
||||
/* 0x24 */ f32 mAnalogB;
|
||||
/* 0x28 */ f32 mTriggerLeft;
|
||||
/* 0x2C */ f32 mTriggerRight;
|
||||
/* 0x30 */ u32 mButtonFlags;
|
||||
/* 0x34 */ s8 mGamepadErrorFlags;
|
||||
/* 0x35 */ u8 mHoldLockL;
|
||||
/* 0x36 */ u8 mTrigLockL;
|
||||
/* 0x37 */ u8 mHoldLockR;
|
||||
/* 0x38 */ u8 mTrigLockR;
|
||||
/* 0x39 */ u8 field_0x3d;
|
||||
/* 0x3A */ u8 field_0x3e;
|
||||
/* 0x3B */ u8 field_0x3f;
|
||||
};
|
||||
|
||||
void cAPICPad_recalibrate(void);
|
||||
u32 cAPICPad_ANY_BUTTON(u32 param_0);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef C_API_GRAPHIC_H
|
||||
#define C_API_GRAPHIC_H
|
||||
|
||||
void cAPIGph_Painter(void);
|
||||
void cAPIGph_BeforeOfDraw(void);
|
||||
void cAPIGph_AfterOfDraw(void);
|
||||
|
||||
#endif /* C_API_GRAPHIC_H */
|
||||
@@ -0,0 +1,143 @@
|
||||
#ifndef C_ANGLE_H
|
||||
#define C_ANGLE_H
|
||||
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
|
||||
class cSAngle {
|
||||
private:
|
||||
s16 mAngle;
|
||||
|
||||
public:
|
||||
const static cSAngle _0;
|
||||
const static cSAngle _1;
|
||||
const static cSAngle _90;
|
||||
const static cSAngle _180;
|
||||
const static cSAngle _270;
|
||||
cSAngle() {}
|
||||
~cSAngle() {}
|
||||
cSAngle(const cSAngle&);
|
||||
cSAngle(s16);
|
||||
cSAngle(float);
|
||||
s16 Val() const { return this->mAngle; }
|
||||
// void Set(s16 angle) { this->mAngle = angle; }
|
||||
void Val(const cSAngle&);
|
||||
void Val(s16);
|
||||
void Val(float);
|
||||
float Degree(void) const;
|
||||
float Radian(void) const;
|
||||
float Norm(void) const;
|
||||
s16 Abs(void) const;
|
||||
s16 Inv(void) const;
|
||||
float Sin(void) const;
|
||||
float Cos(void) const;
|
||||
float Tan(void) const;
|
||||
cSAngle operator-(void) const;
|
||||
cSAngle operator+(const cSAngle&) const;
|
||||
cSAngle operator-(const cSAngle&) const;
|
||||
void operator+=(const cSAngle&);
|
||||
void operator-=(const cSAngle&);
|
||||
cSAngle operator+(short) const;
|
||||
cSAngle operator-(short) const;
|
||||
void operator+=(short);
|
||||
void operator-=(short);
|
||||
cSAngle operator*(float) const;
|
||||
void operator*=(float);
|
||||
bool operator<(const cSAngle& other) const { return mAngle < other.mAngle; }
|
||||
bool operator>(const cSAngle& other) const { return mAngle > other.mAngle; }
|
||||
operator s16(void) const { return mAngle; }
|
||||
void operator=(const cSAngle& other) { mAngle = other.mAngle; }
|
||||
static inline cSAngle getMaxNegative(void) { return cSAngle((s16)-0x8000); }
|
||||
inline void mirrorAtMaxNeg(void) { *this = cSAngle((s16)-0x8000) - *this; }
|
||||
};
|
||||
|
||||
cSAngle operator+(short, const cSAngle&);
|
||||
cSAngle operator-(short, const cSAngle&);
|
||||
|
||||
struct cAngle {
|
||||
static f32 Radian_to_Degree(f32 rad) { return rad * 57.2957763671875f; }
|
||||
static f32 Degree_to_Radian(f32 deg) { return deg * 0.017453292f; }
|
||||
static s16 Degree_to_SAngle(f32 deg) { return deg * 182.04444885253906f; }
|
||||
static f32 SAngle_to_Degree(s16 angle) { return (360.0f / 65536.0f) * angle; }
|
||||
static f32 SAngle_to_Radian(s16 angle) { return 9.58738E-5f * angle; }
|
||||
static f32 SAngle_to_Normal(s16 angle) { return 3.0517578E-5f * angle; }
|
||||
static s16 Radian_to_SAngle(f32 rad) { return rad * 10430.378f; }
|
||||
|
||||
/* Converts Radian value into Degree value */
|
||||
static f32 r2d(f32 r) { return Radian_to_Degree(r); }
|
||||
|
||||
/* Converts Degree value to s16 angle */
|
||||
static s16 d2s(f32 d) { return Degree_to_SAngle(d); }
|
||||
|
||||
template <typename T>
|
||||
static T Adjust(T f1, T f2, T f3);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
T cAngle::Adjust(T f1, T f2, T f3) {
|
||||
while (f1 >= f3) {
|
||||
f1 -= f3 - f2;
|
||||
}
|
||||
while (f1 < f2) {
|
||||
f1 += f3 - f2;
|
||||
}
|
||||
return f1;
|
||||
}
|
||||
|
||||
class cDegree {
|
||||
private:
|
||||
float mDegree;
|
||||
|
||||
public:
|
||||
cDegree(float);
|
||||
~cDegree() {}
|
||||
|
||||
cDegree& Formal(void);
|
||||
void Val(float);
|
||||
float Radian(void) const;
|
||||
float Sin(void) const;
|
||||
float Cos(void) const;
|
||||
};
|
||||
|
||||
class cSPolar {
|
||||
private:
|
||||
float mRadial;
|
||||
cSAngle mAngle1;
|
||||
cSAngle mAngle2;
|
||||
|
||||
public:
|
||||
cSPolar() {}
|
||||
cSPolar(const cXyz&);
|
||||
cSPolar& Formal(void);
|
||||
void Val(float, short, short);
|
||||
void Val(const cXyz&);
|
||||
cXyz Xyz(void) const;
|
||||
void Globe(class cSGlobe*) const;
|
||||
};
|
||||
|
||||
class cSGlobe {
|
||||
private:
|
||||
float mRadius;
|
||||
cSAngle mAzimuth; // original: V
|
||||
cSAngle mInclination; // original: U
|
||||
|
||||
public:
|
||||
cSGlobe(const cSGlobe&);
|
||||
cSGlobe(float, short, short);
|
||||
cSGlobe(float, const cSAngle&, const cSAngle&);
|
||||
cSGlobe(const cXyz&);
|
||||
~cSGlobe() {}
|
||||
cSGlobe& Formal(void);
|
||||
void Val(const cSGlobe&);
|
||||
void Val(float, short, short);
|
||||
void Val(float, const cSAngle&, const cSAngle&);
|
||||
void Val(const cXyz&);
|
||||
float R(void) const { return mRadius; }
|
||||
const cSAngle& V(void) const { return mAzimuth; }
|
||||
const cSAngle& U(void) const { return mInclination; }
|
||||
cXyz Xyz(void) const;
|
||||
void Polar(cSPolar*) const;
|
||||
cXyz Norm(void) const;
|
||||
cSGlobe& Invert(void);
|
||||
};
|
||||
|
||||
#endif /* C_ANGLE_H */
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef C_BG_S_CHK_H
|
||||
#define C_BG_S_CHK_H
|
||||
|
||||
#include "dolphin/mtx/vec.h"
|
||||
|
||||
struct cBgD_Vtx_t : public Vec {};
|
||||
|
||||
class cBgS_GrpPassChk {
|
||||
public:
|
||||
virtual ~cBgS_GrpPassChk();
|
||||
};
|
||||
|
||||
class cBgS_PolyPassChk;
|
||||
|
||||
class cBgS_Chk {
|
||||
private:
|
||||
/* 0x0 */ cBgS_PolyPassChk* mPolyPassChk;
|
||||
/* 0x4 */ cBgS_GrpPassChk* mGrpPassChk;
|
||||
/* 0x8 */ u32 mActorPid;
|
||||
/* 0xC */ u8 unk_0x0C;
|
||||
/* 0x10 */ // __vtable__
|
||||
|
||||
public:
|
||||
cBgS_Chk();
|
||||
void SetExtChk(cBgS_Chk&);
|
||||
bool ChkSameActorPid(unsigned int) const;
|
||||
|
||||
void setActorPid(u32 pid) { mActorPid = pid; }
|
||||
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; }
|
||||
cBgS_GrpPassChk* GetGrpPassChk() const { return mGrpPassChk; }
|
||||
|
||||
virtual ~cBgS_Chk(void);
|
||||
}; // Size: 0x14
|
||||
|
||||
#endif /* C_BG_S_CHK_H */
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef C_BG_S_GND_CHK_H
|
||||
#define C_BG_S_GND_CHK_H
|
||||
|
||||
#include "SSystem/SComponent/c_bg_s_chk.h"
|
||||
#include "SSystem/SComponent/c_bg_s_poly_info.h"
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
|
||||
class cBgS_GndChk : public cBgS_Chk, public cBgS_PolyInfo {
|
||||
public:
|
||||
cBgS_GndChk();
|
||||
void SetPos(cXyz const*);
|
||||
void SetPos(Vec const*);
|
||||
void PreCheck();
|
||||
|
||||
virtual ~cBgS_GndChk();
|
||||
|
||||
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;
|
||||
/* 0x30 */ u32 mFlags;
|
||||
/* 0x34 */ f32 mNowY;
|
||||
/* 0x38 */ u32 mWallPrecheck;
|
||||
};
|
||||
|
||||
#endif /* C_BG_S_GND_CHK_H */
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef C_BG_S_LIN_CHK_H
|
||||
#define C_BG_S_LIN_CHK_H
|
||||
|
||||
#include "SSystem/SComponent/c_bg_s_chk.h"
|
||||
#include "SSystem/SComponent/c_bg_s_poly_info.h"
|
||||
#include "SSystem/SComponent/c_m3d_g_lin.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class cBgS_LinChk : public cBgS_Chk, public cBgS_PolyInfo {
|
||||
public:
|
||||
/* 0x024 */ cM3dGLin mLin;
|
||||
/* 0x040 */ cXyz field_0x40;
|
||||
/* 0x04C */ u32 field_0x4c;
|
||||
/* 0x050 */ bool mPreWallChk;
|
||||
/* 0x051 */ bool mPreGroundChk;
|
||||
/* 0x052 */ bool mPreRoofChk;
|
||||
/* 0x053 */ bool mFrontFlag;
|
||||
/* 0x054 */ bool mBackFlag;
|
||||
|
||||
public:
|
||||
cBgS_LinChk();
|
||||
void ct();
|
||||
void Set2(cXyz*, cXyz*, unsigned int);
|
||||
void PreCalc();
|
||||
void GetCross();
|
||||
|
||||
virtual ~cBgS_LinChk();
|
||||
|
||||
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); }
|
||||
cXyz& i_GetCross() { return mLin.GetEnd(); }
|
||||
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 */
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef C_BG_S_POLY_INFO_H
|
||||
#define C_BG_S_POLY_INFO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class cBgS_PolyInfo {
|
||||
private:
|
||||
/* 0x00 */ u16 mPolyIndex;
|
||||
/* 0x02 */ u16 mBgIndex;
|
||||
/* 0x04 */ void* unk_0x04;
|
||||
/* 0x08 */ unsigned int mActorId;
|
||||
|
||||
public:
|
||||
cBgS_PolyInfo();
|
||||
bool ChkSetInfo() const;
|
||||
void ClearPi();
|
||||
void SetPolyInfo(const cBgS_PolyInfo&);
|
||||
void SetActorInfo(int, void*, unsigned int);
|
||||
bool ChkSafe(const void*, unsigned int) const;
|
||||
void SetPolyIndex(int);
|
||||
bool ChkBgIndex() const;
|
||||
|
||||
virtual ~cBgS_PolyInfo();
|
||||
|
||||
u16 GetPolyIndex() const { return mPolyIndex; }
|
||||
u16 GetBgIndex() const { return mBgIndex; }
|
||||
}; // Size: 0x10
|
||||
|
||||
#endif /* C_BG_S_POLY_INFO_H */
|
||||
@@ -0,0 +1,26 @@
|
||||
#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 "dolphin/types.h"
|
||||
|
||||
struct cBgD_Vtx_t;
|
||||
class cM3dGPla;
|
||||
|
||||
typedef int (*cBgS_ShdwDraw_Callback)(class cBgS_ShdwDraw*, cBgD_Vtx_t*, int, int, int, cM3dGPla*);
|
||||
|
||||
class cBgS_ShdwDraw : public cBgS_Chk {
|
||||
public:
|
||||
cBgS_ShdwDraw(void);
|
||||
virtual ~cBgS_ShdwDraw(void);
|
||||
void Set(cXyz&, cXyz&);
|
||||
void SetCallback(cBgS_ShdwDraw_Callback);
|
||||
|
||||
cM3dGAab* GetBndP() { return &mM3dGAab; }
|
||||
|
||||
/* 0x14 */ cM3dGAab mM3dGAab;
|
||||
/* 0x30 */ cBgS_ShdwDraw_Callback mCallbackFun;
|
||||
};
|
||||
|
||||
#endif /* C_BG_S_SHDW_DRAW_H */
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef C_BG_W_H
|
||||
#define C_BG_W_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class cBgW_BgId {
|
||||
private:
|
||||
/* 0x0 */ u16 m_id;
|
||||
/* 0x4 vtable */
|
||||
|
||||
public:
|
||||
void Release();
|
||||
bool ChkUsed() const;
|
||||
void Regist(int);
|
||||
|
||||
virtual ~cBgW_BgId() {}
|
||||
|
||||
cBgW_BgId() { Ct(); }
|
||||
void Ct() { m_id = 0x100; }
|
||||
|
||||
u16 GetId() const { return m_id; }
|
||||
};
|
||||
|
||||
bool cBgW_CheckBGround(float a1);
|
||||
bool cBgW_CheckBRoof(float a1);
|
||||
bool cBgW_CheckBWall(float a1);
|
||||
|
||||
#endif /* C_BG_W_H */
|
||||
@@ -0,0 +1,564 @@
|
||||
#ifndef C_CC_D_H
|
||||
#define C_CC_D_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"
|
||||
|
||||
typedef struct _GXColor GXColor;
|
||||
class fopAc_ac_c;
|
||||
|
||||
enum CcG_Tg_HitMark {
|
||||
CcG_Tg_UNK_MARK_6 = 6,
|
||||
CcG_Tg_UNK_MARK_8 = 8,
|
||||
};
|
||||
|
||||
class cCcD_PntAttr;
|
||||
class cCcD_CpsAttr;
|
||||
class cCcD_TriAttr;
|
||||
class cCcD_AabAttr;
|
||||
class cCcD_CylAttr;
|
||||
class cCcD_SphAttr;
|
||||
|
||||
enum cCcD_ObjAtType {
|
||||
/* 0x00000002 */ AT_TYPE_NORMAL_SWORD = (1 << 1), // wooden or ordon
|
||||
/* 0x00000004 */ AT_TYPE_HORSE = (1 << 2),
|
||||
/* 0x00000008 */ AT_TYPE_THROW_OBJ = (1 << 3),
|
||||
/* 0x00000010 */ AT_TYPE_SHIELD_ATTACK = (1 << 4),
|
||||
/* 0x00000020 */ AT_TYPE_BOMB = (1 << 5),
|
||||
/* 0x00000040 */ AT_TYPE_40 = (1 << 6),
|
||||
/* 0x00000080 */ AT_TYPE_SLINGSHOT = (1 << 7),
|
||||
/* 0x00000200 */ AT_TYPE_LANTERN_SWING = (1 << 9),
|
||||
/* 0x00000400 */ AT_TYPE_CSTATUE_SWING = (1 << 10),
|
||||
/* 0x00000800 */ AT_TYPE_800 = (1 << 11),
|
||||
/* 0x00001000 */ AT_TYPE_1000 = (1 << 12),
|
||||
/* 0x00002000 */ AT_TYPE_ARROW = (1 << 13),
|
||||
/* 0x00004000 */ AT_TYPE_HOOKSHOT = (1 << 14),
|
||||
/* 0x00010000 */ AT_TYPE_BOOMERANG = (1 << 16),
|
||||
/* 0x00040000 */ AT_TYPE_40000 = (1 << 18),
|
||||
/* 0x00080000 */ AT_TYPE_SPINNER = (1 << 19),
|
||||
/* 0x00100000 */ AT_TYPE_CSTATUE_BOSS_SWING = (1 << 20),
|
||||
/* 0x00200000 */ AT_TYPE_HEAVY_BOOTS = (1 << 21),
|
||||
/* 0x00400000 */ AT_TYPE_IRON_BALL = (1 << 22),
|
||||
/* 0x00800000 */ AT_TYPE_COPY_ROD = (1 << 23),
|
||||
/* 0x01000000 */ AT_TYPE_1000000 = (1 << 24),
|
||||
/* 0x04000000 */ AT_TYPE_MASTER_SWORD = (1 << 26),
|
||||
/* 0x08000000 */ AT_TYPE_MIDNA_LOCK = (1 << 27),
|
||||
/* 0x10000000 */ AT_TYPE_10000000 = (1 << 28),
|
||||
/* 0x40000000 */ AT_TYPE_WOLF_CUT_TURN = (1 << 30),
|
||||
/* 0x80000000 */ AT_TYPE_WOLF_ATTACK = (1 << 31),
|
||||
/* 0xD8000000 */ AT_TYPE_UNK = 0xD8000000
|
||||
};
|
||||
|
||||
class cCcD_ShapeAttr {
|
||||
public:
|
||||
/* 0x00 */ cM3dGAab mAab;
|
||||
/* 0x1C vtable */
|
||||
|
||||
struct Shape {
|
||||
~Shape();
|
||||
|
||||
/* 0x00 */ int _0;
|
||||
/* 0x04 */ f32 _4;
|
||||
/* 0x08 */ f32 _8;
|
||||
/* 0x0C */ f32 _C;
|
||||
/* 0x10 */ f32 _10;
|
||||
/* 0x14 */ f32 _14;
|
||||
};
|
||||
cCcD_ShapeAttr() {}
|
||||
virtual ~cCcD_ShapeAttr() {}
|
||||
virtual bool CrossAtTg(cCcD_ShapeAttr const&, cXyz*) const {
|
||||
return false;
|
||||
}
|
||||
virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const = 0;
|
||||
virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const = 0;
|
||||
virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const = 0;
|
||||
virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const = 0;
|
||||
virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const = 0;
|
||||
virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const = 0;
|
||||
virtual bool CrossCo(cCcD_ShapeAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_PntAttr const&, f32*) const = 0;
|
||||
virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const = 0;
|
||||
virtual bool CrossCo(cCcD_TriAttr const&, f32*) const = 0;
|
||||
virtual bool CrossCo(cCcD_AabAttr const&, f32*) const = 0;
|
||||
virtual bool CrossCo(cCcD_CylAttr const&, f32*) const = 0;
|
||||
virtual bool CrossCo(cCcD_SphAttr const&, f32*) const = 0;
|
||||
virtual const cXyz& GetCoCP() const { return m_virtual_center; }
|
||||
virtual cXyz& GetCoCP() { return m_virtual_center; }
|
||||
virtual void CalcAabBox() = 0;
|
||||
virtual bool GetNVec(cXyz const&, cXyz*) const = 0;
|
||||
virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const;
|
||||
|
||||
cM3dGAab& GetWorkAab() { return mAab; }
|
||||
cM3dGAab const& GetWorkAab() const { return mAab; }
|
||||
|
||||
static cXyz m_virtual_center;
|
||||
};
|
||||
|
||||
STATIC_ASSERT(0x20 == sizeof(cCcD_ShapeAttr));
|
||||
|
||||
struct cCcD_SrcTriAttr {
|
||||
cM3dGTriS mTri;
|
||||
};
|
||||
|
||||
class cCcD_TriAttr : public cCcD_ShapeAttr, public cM3dGTri {
|
||||
public:
|
||||
virtual void CalcAabBox();
|
||||
virtual bool GetNVec(cXyz const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_ShapeAttr const& shape, cXyz* xyz) const {
|
||||
return shape.CrossAtTg(*this, xyz);
|
||||
}
|
||||
virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const { return false; }
|
||||
virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const { return false; }
|
||||
virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const;
|
||||
virtual bool CrossCo(cCcD_ShapeAttr const& shape, f32* f) const {
|
||||
return shape.CrossCo(*this, f);
|
||||
}
|
||||
virtual bool CrossCo(cCcD_PntAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_TriAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_AabAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_CylAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_SphAttr const&, f32*) const { return false; }
|
||||
virtual ~cCcD_TriAttr() {}
|
||||
cCcD_TriAttr() {}
|
||||
};
|
||||
|
||||
struct cCcD_SrcCpsAttr {
|
||||
cM3dGCpsS mCps;
|
||||
};
|
||||
|
||||
class cCcD_CpsAttr : public cCcD_ShapeAttr, public cM3dGCps {
|
||||
public:
|
||||
cCcD_CpsAttr() {}
|
||||
void Set(const cCcD_SrcCpsAttr& pSrc) {
|
||||
cM3dGCps::Set(pSrc.mCps);
|
||||
}
|
||||
void Set(const cXyz& pStart, const cXyz& pEnd, float radius) {
|
||||
cM3dGCps::Set(pStart, pEnd, radius);
|
||||
}
|
||||
|
||||
virtual ~cCcD_CpsAttr() {}
|
||||
virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_ShapeAttr const& shape, cXyz* xyz) const {
|
||||
return shape.CrossAtTg(*this, xyz);
|
||||
}
|
||||
virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const { return false; }
|
||||
virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const { return false; }
|
||||
virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const;
|
||||
virtual bool CrossCo(cCcD_CylAttr const&, f32*) const;
|
||||
virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const;
|
||||
virtual bool CrossCo(cCcD_SphAttr const&, f32*) const;
|
||||
virtual bool CrossCo(cCcD_ShapeAttr const& shape, f32* f) const {
|
||||
return shape.CrossCo(*this, f);
|
||||
}
|
||||
virtual bool CrossCo(cCcD_PntAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_TriAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_AabAttr const&, f32*) const { return false; }
|
||||
virtual void CalcAabBox();
|
||||
virtual bool GetNVec(cXyz const&, cXyz*) const;
|
||||
};
|
||||
|
||||
STATIC_ASSERT(0x40 == sizeof(cCcD_CpsAttr));
|
||||
|
||||
struct cCcD_SrcSphAttr {
|
||||
cM3dGSphS mSph;
|
||||
};
|
||||
|
||||
class cCcD_SphAttr : public cCcD_ShapeAttr, public cM3dGSph {
|
||||
public:
|
||||
cCcD_SphAttr() {}
|
||||
void Set(const cCcD_SrcSphAttr& src) {
|
||||
cM3dGSph::Set(src.mSph);
|
||||
}
|
||||
|
||||
virtual ~cCcD_SphAttr() {}
|
||||
virtual const cXyz& GetCoCP() const { return mCenter; }
|
||||
virtual cXyz& GetCoCP() { return mCenter; }
|
||||
virtual bool CrossAtTg(cCcD_ShapeAttr const& shape, cXyz* xyz) const {
|
||||
return shape.CrossAtTg(*this, xyz);
|
||||
}
|
||||
virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const { return false; }
|
||||
virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_ShapeAttr const& shape, f32* f) const {
|
||||
return shape.CrossCo(*this, f);
|
||||
}
|
||||
virtual bool CrossCo(cCcD_PntAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_TriAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_AabAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const;
|
||||
virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const;
|
||||
virtual bool CrossCo(cCcD_SphAttr const&, f32*) const;
|
||||
virtual bool CrossCo(cCcD_CylAttr const&, f32*) const;
|
||||
virtual void CalcAabBox();
|
||||
virtual bool GetNVec(cXyz const&, cXyz*) const;
|
||||
virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const;
|
||||
|
||||
}; // Size = 0x34
|
||||
|
||||
STATIC_ASSERT(0x34 == sizeof(cCcD_SphAttr));
|
||||
|
||||
class cCcD_CylAttr : public cCcD_ShapeAttr, public cM3dGCyl {
|
||||
public:
|
||||
cCcD_CylAttr() {}
|
||||
virtual ~cCcD_CylAttr() {}
|
||||
virtual const cXyz& GetCoCP() const { return mCenter; }
|
||||
virtual bool CrossAtTg(cCcD_SphAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_CylAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_TriAttr const&, cXyz*) const;
|
||||
virtual bool CrossAtTg(cCcD_ShapeAttr const& shape, cXyz* xyz) const {
|
||||
return shape.CrossAtTg(*this, xyz);
|
||||
}
|
||||
virtual bool CrossAtTg(cCcD_PntAttr const&, cXyz*) const { return false; }
|
||||
virtual bool CrossAtTg(cCcD_AabAttr const&, cXyz*) const { return false; }
|
||||
virtual bool CrossAtTg(cCcD_CpsAttr const&, cXyz*) const;
|
||||
virtual bool CrossCo(cCcD_CylAttr const&, f32*) const;
|
||||
virtual bool CrossCo(cCcD_CpsAttr const&, f32*) const;
|
||||
virtual bool CrossCo(cCcD_ShapeAttr const& shape, f32* f) const {
|
||||
return shape.CrossCo(*this, f);
|
||||
}
|
||||
virtual bool CrossCo(cCcD_PntAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_TriAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_AabAttr const&, f32*) const { return false; }
|
||||
virtual bool CrossCo(cCcD_SphAttr const&, f32*) const;
|
||||
virtual cXyz& GetCoCP() { return mCenter; }
|
||||
virtual void CalcAabBox();
|
||||
virtual bool GetNVec(cXyz const&, cXyz*) const;
|
||||
virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const;
|
||||
|
||||
}; // Size = 0x38
|
||||
|
||||
STATIC_ASSERT(0x38 == sizeof(cCcD_CylAttr));
|
||||
|
||||
class cCcD_DivideInfo {
|
||||
private:
|
||||
/* 0x00 */ u32 mXDivInfo;
|
||||
/* 0x04 */ u32 mYDivInfo;
|
||||
/* 0x08 */ u32 mZDivInfo;
|
||||
/* 0x0C vtable */
|
||||
public:
|
||||
cCcD_DivideInfo() {}
|
||||
virtual ~cCcD_DivideInfo() {}
|
||||
void Set(u32, u32, u32);
|
||||
bool Chk(cCcD_DivideInfo const&) const;
|
||||
}; // Size = 0x10
|
||||
|
||||
STATIC_ASSERT(0x10 == sizeof(cCcD_DivideInfo));
|
||||
|
||||
class cCcD_DivideArea : public cM3dGAab {
|
||||
private:
|
||||
/* 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:
|
||||
cCcD_DivideArea() {}
|
||||
virtual ~cCcD_DivideArea() {}
|
||||
void SetArea(cM3dGAab const&);
|
||||
void CalcDivideInfo(cCcD_DivideInfo*, cM3dGAab const&, u32);
|
||||
void CalcDivideInfoOverArea(cCcD_DivideInfo*, cM3dGAab const&);
|
||||
}; // Size = 0x40
|
||||
|
||||
STATIC_ASSERT(0x40 == sizeof(cCcD_DivideArea));
|
||||
|
||||
struct cCcD_SrcObjCommonBase {
|
||||
/* 0x0 */ s32 mSPrm;
|
||||
};
|
||||
|
||||
struct cCcD_SrcObjTg {
|
||||
/* 0x0 */ s32 mType;
|
||||
/* 0x4 */ cCcD_SrcObjCommonBase mBase;
|
||||
}; // Size: 0x8
|
||||
|
||||
struct cCcD_SrcObjAt {
|
||||
/* 0x0 */ s32 mType;
|
||||
/* 0x4 */ u8 mAtp;
|
||||
/* 0x8 */ cCcD_SrcObjCommonBase mBase;
|
||||
}; // Size: 0xC
|
||||
|
||||
struct cCcD_SrcObjCo {
|
||||
/* 0x0 */ cCcD_SrcObjCommonBase mBase;
|
||||
}; // Size: 0x4
|
||||
|
||||
struct cCcD_SrcObjHitInf {
|
||||
/* 0x00 */ cCcD_SrcObjAt mObjAt;
|
||||
/* 0x0C */ cCcD_SrcObjTg mObjTg;
|
||||
/* 0x14 */ cCcD_SrcObjCo mObjCo;
|
||||
}; // Size: 0x18
|
||||
|
||||
struct cCcD_SrcObj {
|
||||
/* 0x0 */ int mFlags;
|
||||
/* 0x4 */ cCcD_SrcObjHitInf mSrcObjHitInf;
|
||||
}; // Size: 0x1C
|
||||
|
||||
class cCcD_GStts {
|
||||
public:
|
||||
virtual ~cCcD_GStts() {}
|
||||
|
||||
private:
|
||||
/* 0x00 vtable */
|
||||
}; // Size = 0x4
|
||||
|
||||
class cCcD_Stts {
|
||||
private:
|
||||
/* 0x00 */ cXyz mXyz;
|
||||
/* 0x0C */ fopAc_ac_c* mActor;
|
||||
/* 0x10 */ int mApid;
|
||||
/* 0x14 */ u8 mWeight;
|
||||
/* 0x15 */ u8 field_0x15;
|
||||
/* 0x16 */ u8 mTg;
|
||||
|
||||
public:
|
||||
cCcD_Stts() {}
|
||||
virtual ~cCcD_Stts() {}
|
||||
virtual const cCcD_GStts* GetGStts() const;
|
||||
virtual cCcD_GStts* GetGStts();
|
||||
void Init(int, int, void*, unsigned int);
|
||||
virtual void Ct();
|
||||
void PlusCcMove(f32, f32, f32);
|
||||
void ClrCcMove();
|
||||
void PlusDmg(int);
|
||||
f32 GetWeightF() const;
|
||||
virtual void ClrAt() {}
|
||||
virtual void ClrTg() { mTg = 0; }
|
||||
|
||||
u8 GetWeightUc() const { return mWeight; }
|
||||
void SetWeight(u8 weight) { mWeight = weight; }
|
||||
fopAc_ac_c* GetAc() { return mActor; }
|
||||
fopAc_ac_c* GetActor() const { return mActor; }
|
||||
void SetActor(void* ac) { mActor = (fopAc_ac_c*)ac; }
|
||||
cXyz* GetCCMoveP() { return &mXyz; }
|
||||
unsigned int GetApid() const { return mApid; }
|
||||
}; // Size = 0x1C
|
||||
|
||||
STATIC_ASSERT(0x1C == sizeof(cCcD_Stts));
|
||||
|
||||
class cCcD_Obj; // placeholder
|
||||
|
||||
class cCcD_ObjCommonBase {
|
||||
protected:
|
||||
/* 0x00 */ u32 mSPrm;
|
||||
/* 0x04 */ u32 mRPrm;
|
||||
/* 0x08 */ cCcD_Obj* mHitObj;
|
||||
/* 0x0C vtable */
|
||||
public:
|
||||
enum CoSPrm_e {
|
||||
CO_SPRM_SET = 1,
|
||||
CO_SPRM_NO_CRR = 0x100,
|
||||
CO_SPRM_NO_CO_HIT_INF_SET = 0x200,
|
||||
CO_SPRM_SAME_ACTOR_HIT = 0x400,
|
||||
};
|
||||
|
||||
cCcD_ObjCommonBase() { ct(); }
|
||||
virtual ~cCcD_ObjCommonBase() {}
|
||||
void ct();
|
||||
void SetSPrm(u32 sprm) { mSPrm = sprm; }
|
||||
s32 getSPrm() const { return mSPrm; }
|
||||
void setRPrm(s32 rprm) { mRPrm = rprm; }
|
||||
s32 getRPrm() const { return mRPrm; }
|
||||
cCcD_Obj* GetHitObj() { return mHitObj; }
|
||||
u32 MskSPrm(u32 mask) const { return mSPrm & mask; }
|
||||
u32 MskRPrm(u32 mask) { return mRPrm & mask; }
|
||||
void OnSPrmBit(u32 flag) { mSPrm |= flag; }
|
||||
void OffSPrmBit(u32 flag) { mSPrm &= ~flag; }
|
||||
|
||||
void Set(cCcD_SrcObjCommonBase const& src) {
|
||||
mSPrm = src.mSPrm;
|
||||
}
|
||||
};
|
||||
|
||||
STATIC_ASSERT(0x10 == sizeof(cCcD_ObjCommonBase));
|
||||
|
||||
class cCcD_ObjAt : public cCcD_ObjCommonBase {
|
||||
public:
|
||||
cCcD_ObjAt() { mType = 0; }
|
||||
virtual ~cCcD_ObjAt() {}
|
||||
void SetHit(cCcD_Obj*);
|
||||
void Set(cCcD_SrcObjAt const&);
|
||||
void ClrHit();
|
||||
int GetType() const { return mType; }
|
||||
u32 GetGrp() const { return MskSPrm(0x1E); }
|
||||
bool ChkSet() const { return MskSPrm(1); }
|
||||
u8 GetAtp() const { return mAtp; }
|
||||
u32 MskType(u32 msk) const { return mType & msk; }
|
||||
void SetType(u32 type) { mType = type; }
|
||||
void SetAtp(int atp) { mAtp = atp; }
|
||||
void ClrSet() { OffSPrmBit(1); }
|
||||
u32 ChkHit() { return MskRPrm(1); }
|
||||
|
||||
protected:
|
||||
/* 0x10 */ int mType;
|
||||
/* 0x14 */ u8 mAtp;
|
||||
};
|
||||
|
||||
STATIC_ASSERT(0x18 == sizeof(cCcD_ObjAt));
|
||||
|
||||
class cCcD_ObjTg : public cCcD_ObjCommonBase {
|
||||
public:
|
||||
cCcD_ObjTg() { ct(); }
|
||||
virtual ~cCcD_ObjTg() {}
|
||||
void Set(cCcD_SrcObjTg const&);
|
||||
void SetGrp(u32);
|
||||
void ClrHit();
|
||||
void SetHit(cCcD_Obj*);
|
||||
int GetType() const { return mType; }
|
||||
void SetType(u32 type) { mType = type; }
|
||||
u32 GetGrp() const { return MskSPrm(0x1E); }
|
||||
bool ChkSet() const { return MskSPrm(1); }
|
||||
void ClrSet() { OffSPrmBit(1); }
|
||||
u32 ChkHit() { return MskRPrm(1); }
|
||||
|
||||
private:
|
||||
/* 0x10 */ int mType;
|
||||
};
|
||||
|
||||
STATIC_ASSERT(0x14 == sizeof(cCcD_ObjTg));
|
||||
|
||||
class cCcD_ObjCo : public cCcD_ObjCommonBase {
|
||||
public:
|
||||
virtual ~cCcD_ObjCo() {}
|
||||
void SetHit(cCcD_Obj*);
|
||||
void ClrHit();
|
||||
void SetIGrp(u32);
|
||||
void SetVsGrp(u32);
|
||||
u32 GetGrp() const { return MskSPrm(0x1E); }
|
||||
bool ChkSet() const { return MskSPrm(1); }
|
||||
u32 GetVsGrp() const { return MskSPrm(0x70); }
|
||||
u32 GetIGrp() const { return MskSPrm(0xE); }
|
||||
u32 ChkNoCrr() const { return MskSPrm(0x100); }
|
||||
u32 ChkSph3DCrr() const { return MskSPrm(0x80); }
|
||||
void ClrSet() { OffSPrmBit(1); }
|
||||
u32 ChkHit() { return MskRPrm(1); }
|
||||
|
||||
void Set(cCcD_SrcObjCo const& src) {
|
||||
cCcD_ObjCommonBase::Set(src.mBase);
|
||||
}
|
||||
};
|
||||
|
||||
STATIC_ASSERT(0x10 == sizeof(cCcD_ObjCo));
|
||||
|
||||
class cCcD_ObjHitInf {
|
||||
protected:
|
||||
/* 0x000 */ cCcD_ObjAt mObjAt;
|
||||
/* 0x018 */ cCcD_ObjTg mObjTg;
|
||||
/* 0x02C */ cCcD_ObjCo mObjCo;
|
||||
/* 0x03C vtable */
|
||||
public:
|
||||
virtual ~cCcD_ObjHitInf() {}
|
||||
void Set(cCcD_SrcObjHitInf const&);
|
||||
cCcD_ObjAt& GetObjAt() { return mObjAt; }
|
||||
cCcD_ObjTg& GetObjTg() { return mObjTg; }
|
||||
cCcD_ObjCo& GetObjCo() { return mObjCo; }
|
||||
u32 GetTgGrp() const { return mObjTg.GetGrp(); }
|
||||
u32 GetAtGrp() const { return mObjAt.GetGrp(); }
|
||||
u32 GetCoGrp() const { return mObjCo.GetGrp(); }
|
||||
int GetTgType() const { return mObjTg.GetType(); }
|
||||
u32 GetAtType() const { return mObjAt.GetType(); }
|
||||
bool ChkTgSet() const { return mObjTg.ChkSet(); }
|
||||
bool ChkAtSet() const { return mObjAt.ChkSet(); }
|
||||
bool ChkCoSet() const { return mObjCo.ChkSet(); }
|
||||
u32 ChkCoSameActorHit() const { return mObjCo.MskSPrm(0x400); }
|
||||
u32 GetCoVsGrp() const { return mObjCo.GetVsGrp(); }
|
||||
u32 GetCoIGrp() const { return mObjCo.GetIGrp(); }
|
||||
u8 GetAtAtp() const { return mObjAt.GetAtp(); }
|
||||
u32 ChkAtNoTgHitInfSet() const { return mObjAt.MskSPrm(0x20); }
|
||||
u32 ChkTgNoAtHitInfSet() const { return mObjTg.MskSPrm(0x20); }
|
||||
u32 ChkCoNoCoHitInfSet() const { return mObjCo.MskSPrm(0x200); }
|
||||
bool ChkTgNoSlingHitInfSet() const { return mObjTg.MskSPrm(0x40); }
|
||||
void SetAtHit(cCcD_Obj* obj) { mObjAt.SetHit(obj); }
|
||||
void SetTgHit(cCcD_Obj* obj) { mObjTg.SetHit(obj); }
|
||||
void SetCoHit(cCcD_Obj* obj) { mObjCo.SetHit(obj); }
|
||||
bool ChkAtType(u32 type) const { return mObjAt.MskType(type); }
|
||||
u32 ChkCoNoCrr() const { return mObjCo.ChkNoCrr(); }
|
||||
u32 ChkCoSph3DCrr() const { return mObjCo.ChkSph3DCrr(); }
|
||||
void OnAtSPrmBit(u32 flag) { mObjAt.OnSPrmBit(flag); }
|
||||
void OffAtSPrmBit(u32 flag) { mObjAt.OffSPrmBit(flag); }
|
||||
void OffCoSPrmBit(u32 flag) { mObjCo.OffSPrmBit(flag); }
|
||||
void SetAtType(u32 type) { mObjAt.SetType(type); }
|
||||
void OnAtSetBit() { mObjAt.OnSPrmBit(1); }
|
||||
void SetAtAtp(int atp) { mObjAt.SetAtp(atp); }
|
||||
void OffCoSetBit() { mObjCo.ClrSet(); }
|
||||
void SetTgType(u32 type) { mObjTg.SetType(type); }
|
||||
void OnTgSPrmBit(u32 flag) { mObjTg.OnSPrmBit(flag); }
|
||||
void OffAtSetBit() { mObjAt.ClrSet(); }
|
||||
void OnTgSetBit() { mObjTg.OnSPrmBit(1); }
|
||||
void OffTgSetBit() { mObjTg.ClrSet(); }
|
||||
void OnCoSetBit() { mObjCo.OnSPrmBit(1); }
|
||||
void OffAtVsPlayerBit() { mObjAt.OffSPrmBit(0xC); }
|
||||
void OnAtVsPlayerBit() { mObjAt.OnSPrmBit(0xC); }
|
||||
void OnCoSPrmBit(u32 flag) { mObjCo.OnSPrmBit(flag); }
|
||||
void SetTgSPrm(u32 prm) { mObjTg.SetSPrm(prm); }
|
||||
void SetCoSPrm(u32 prm) { mObjCo.SetSPrm(prm); }
|
||||
void ClrAtHit() { mObjAt.ClrHit(); }
|
||||
void ClrTgHit() { mObjTg.ClrHit(); }
|
||||
void ClrCoHit() { mObjCo.ClrHit(); }
|
||||
u32 ChkAtHit() { return mObjAt.ChkHit(); }
|
||||
u32 ChkTgHit() { return mObjTg.ChkHit(); }
|
||||
u32 ChkCoHit() { return mObjCo.ChkHit(); }
|
||||
cCcD_Obj* GetAtHitObj() { return mObjAt.GetHitObj(); }
|
||||
cCcD_Obj* GetTgHitObj() { return mObjTg.GetHitObj(); }
|
||||
cCcD_Obj* GetCoHitObj() { return mObjCo.GetHitObj(); }
|
||||
|
||||
}; // Size = 0x40
|
||||
|
||||
STATIC_ASSERT(0x40 == sizeof(cCcD_ObjHitInf));
|
||||
|
||||
class cCcD_GObjInf;
|
||||
|
||||
class cCcD_Obj : public cCcD_ObjHitInf {
|
||||
public:
|
||||
cCcD_Obj() { ct(); }
|
||||
virtual ~cCcD_Obj() {}
|
||||
virtual cCcD_GObjInf const* GetGObjInf() const { return NULL; }
|
||||
virtual cCcD_GObjInf* GetGObjInf() { return NULL; }
|
||||
virtual cCcD_ShapeAttr const* GetShapeAttr() const { return NULL; }
|
||||
virtual cCcD_ShapeAttr* GetShapeAttr() { return NULL; }
|
||||
virtual void Draw(_GXColor const&) {}
|
||||
void ct();
|
||||
void Set(cCcD_SrcObj const&);
|
||||
fopAc_ac_c* GetAc();
|
||||
|
||||
cCcD_Stts* GetStts() { return mStts; }
|
||||
void SetStts(cCcD_Stts* stts) { mStts = stts; }
|
||||
cCcD_DivideInfo& GetDivideInfo() { return mDivideInfo; }
|
||||
cCcD_DivideInfo* GetPDivideInfo() { return &mDivideInfo; }
|
||||
int ChkBsRevHit() const { return mFlags & 2; }
|
||||
|
||||
private:
|
||||
/* 0x040 */ int mFlags;
|
||||
/* 0x044 */ cCcD_Stts* mStts;
|
||||
/* 0x048 */ cCcD_DivideInfo mDivideInfo;
|
||||
}; // Size = 0x58
|
||||
|
||||
STATIC_ASSERT(0x58 == sizeof(cCcD_Obj));
|
||||
|
||||
class cCcD_GObjInf : public cCcD_Obj {
|
||||
public:
|
||||
cCcD_GObjInf() {}
|
||||
virtual ~cCcD_GObjInf() {}
|
||||
virtual void ClrAtHit() { mObjAt.ClrHit(); }
|
||||
virtual void ClrTgHit() { mObjTg.ClrHit(); }
|
||||
virtual void ClrCoHit() { mObjCo.ClrHit(); }
|
||||
virtual cCcD_GObjInf const* GetGObjInf() const { return this; }
|
||||
virtual cCcD_GObjInf* GetGObjInf() { return this; }
|
||||
};
|
||||
|
||||
STATIC_ASSERT(0x58 == sizeof(cCcD_GObjInf));
|
||||
|
||||
#endif /* C_CC_D_H */
|
||||
@@ -0,0 +1,60 @@
|
||||
#ifndef C_CC_S_H
|
||||
#define C_CC_S_H
|
||||
|
||||
#include "SSystem/SComponent/c_cc_d.h"
|
||||
#include "global.h"
|
||||
|
||||
enum WeightType {
|
||||
WeightType_0 = 0,
|
||||
WeightType_1 = 1,
|
||||
WeightType_2 = 2,
|
||||
};
|
||||
|
||||
class cCcS {
|
||||
public:
|
||||
/* 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 */
|
||||
|
||||
cCcS();
|
||||
void Ct();
|
||||
void Dt();
|
||||
WeightType GetWt(u8) const;
|
||||
void Set(cCcD_Obj*);
|
||||
void ClrCoHitInf();
|
||||
void ClrTgHitInf();
|
||||
void ClrAtHitInf();
|
||||
bool ChkNoHitAtTg(cCcD_Obj*, cCcD_Obj*);
|
||||
void ChkAtTg();
|
||||
bool ChkNoHitCo(cCcD_Obj*, cCcD_Obj*);
|
||||
void ChkCo();
|
||||
virtual void CalcTgPlusDmg(cCcD_Obj*, cCcD_Obj*, cCcD_Stts*, cCcD_Stts*);
|
||||
void SetAtTgCommonHitInf(cCcD_Obj*, cCcD_Obj*, cXyz*);
|
||||
void SetCoCommonHitInf(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32);
|
||||
virtual void SetPosCorrect(cCcD_Obj*, cXyz*, cCcD_Obj*, cXyz*, f32);
|
||||
void CalcArea();
|
||||
void Move();
|
||||
void DrawClear();
|
||||
virtual void SetCoGObjInf(bool, bool, cCcD_GObjInf*, cCcD_GObjInf*, cCcD_Stts*, cCcD_Stts*,
|
||||
cCcD_GStts*, cCcD_GStts*);
|
||||
virtual void SetAtTgGObjInf(bool, bool, cCcD_Obj*, cCcD_Obj*, cCcD_GObjInf*, cCcD_GObjInf*,
|
||||
cCcD_Stts*, cCcD_Stts*, cCcD_GStts*, cCcD_GStts*, cXyz*);
|
||||
virtual bool ChkNoHitGAtTg(cCcD_GObjInf const*, cCcD_GObjInf const*, cCcD_GStts*, cCcD_GStts*);
|
||||
virtual bool ChkAtTgHitAfterCross(bool, bool, cCcD_GObjInf const*, cCcD_GObjInf const*,
|
||||
cCcD_Stts*, cCcD_Stts*, cCcD_GStts*, cCcD_GStts*);
|
||||
virtual bool ChkNoHitGCo(cCcD_Obj*, cCcD_Obj*);
|
||||
virtual ~cCcS() {}
|
||||
virtual void MoveAfterCheck();
|
||||
virtual void SetCoGCorrectProc(cCcD_Obj*, cCcD_Obj*);
|
||||
}; // Size = 0x284C
|
||||
|
||||
STATIC_ASSERT(sizeof(cCcS) == 0x284C);
|
||||
|
||||
#endif /* C_CC_S_H */
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef C_COUNTER_H
|
||||
#define C_COUNTER_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
struct counter_class {
|
||||
u32 mCounter0;
|
||||
s32 mCounter1;
|
||||
s32 mTimer;
|
||||
};
|
||||
|
||||
extern counter_class g_Counter;
|
||||
|
||||
void cCt_Counter(int resetCounter1);
|
||||
|
||||
inline void cCt_execCounter() {
|
||||
g_Counter.mTimer++;
|
||||
}
|
||||
|
||||
#endif /* C_COUNTER_H */
|
||||
@@ -0,0 +1,51 @@
|
||||
#ifndef C_DATA_TBL
|
||||
#define C_DATA_TBL
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
struct cDT_NamePTbl {
|
||||
cDT_NamePTbl();
|
||||
virtual ~cDT_NamePTbl();
|
||||
int GetIndex(const char *pName, int start) const;
|
||||
void Set(u32 count, char** pNames);
|
||||
|
||||
u32 mCount;
|
||||
char ** mpNames;
|
||||
};
|
||||
|
||||
struct cDT_DataSrc {
|
||||
u32 mRowNum;
|
||||
u32 mColNum;
|
||||
u8 *mpData;
|
||||
|
||||
cDT_DataSrc();
|
||||
virtual ~cDT_DataSrc();
|
||||
u8 GetInf(int row, int col) const;
|
||||
void Set(u32 rowNum, u32 colNum, u8* pData);
|
||||
};
|
||||
|
||||
struct cDT_Format : public cDT_NamePTbl {
|
||||
cDT_Format();
|
||||
~cDT_Format();
|
||||
};
|
||||
|
||||
struct cDT_Name : public cDT_NamePTbl {
|
||||
cDT_Name();
|
||||
~cDT_Name();
|
||||
};
|
||||
|
||||
struct cDT {
|
||||
public:
|
||||
cDT();
|
||||
~cDT();
|
||||
|
||||
u8 GetInf(int row, int col) const;
|
||||
void Set(u32 fmtNum, char **pFmt, u32 nameNum, char **pName, u8* pData);
|
||||
|
||||
private:
|
||||
cDT_Format mFmt;
|
||||
cDT_Name mName;
|
||||
cDT_DataSrc mSrc;
|
||||
};
|
||||
|
||||
#endif /* C_DATA_TBL */
|
||||
@@ -0,0 +1,110 @@
|
||||
#ifndef C_LIB_H_
|
||||
#define C_LIB_H_
|
||||
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "dolphin/mtx/mtx.h"
|
||||
|
||||
inline bool cLib_IsZero(f32 value) {
|
||||
return fabsf(value) < 8e-11f;
|
||||
}
|
||||
|
||||
void cLib_memCpy(void* dst, const void* src, unsigned long size);
|
||||
void cLib_memSet(void* ptr, int value, unsigned long size);
|
||||
|
||||
f32 cLib_addCalc(f32* o_value, f32 target, f32 scale, f32 maxStep, f32 minStep);
|
||||
void cLib_addCalc2(f32* o_value, f32 target, f32 scale, f32 maxStep);
|
||||
void cLib_addCalc0(f32* o_value, f32 scale, f32 maxStep);
|
||||
f32 cLib_addCalcPos(cXyz* o_value, cXyz const& target, f32 scale, f32 maxStep, f32 minStep);
|
||||
f32 cLib_addCalcPosXZ(cXyz* o_value, cXyz const& target, f32 scale, f32 maxStep, f32 minStep);
|
||||
void cLib_addCalcPos2(cXyz* o_value, cXyz const& target, f32 scale, f32 maxStep);
|
||||
void cLib_addCalcPosXZ2(cXyz* o_value, cXyz const& target, f32 scale, f32 maxStep);
|
||||
s16 cLib_addCalcAngleS(s16* o_value, s16 target, s16 scale, s16 maxStep, s16 minStep);
|
||||
void cLib_addCalcAngleS2(s16* o_value, s16 target, s16 scale, s16 maxStep);
|
||||
|
||||
int cLib_chaseUC(u8* o_value, u8 target, u8 step);
|
||||
int cLib_chaseS(s16* o_value, s16 target, s16 step);
|
||||
int cLib_chaseF(f32* o_value, f32 target, f32 step);
|
||||
int cLib_chasePos(cXyz* o_value, cXyz const& target, f32 step);
|
||||
int cLib_chasePosXZ(cXyz* o_value, cXyz const& target, f32 step);
|
||||
int cLib_chaseAngleS(s16* o_value, s16 target, s16 step);
|
||||
|
||||
s16 cLib_targetAngleY(const Vec* lhs, const Vec* rhs);
|
||||
s16 cLib_targetAngleY(const Vec& lhs, const Vec& rhs);
|
||||
s16 cLib_targetAngleX(const cXyz*, const cXyz*);
|
||||
|
||||
void cLib_offsetPos(cXyz* pDest, cXyz const* pSrc, s16 angle, cXyz const* vec);
|
||||
s32 cLib_distanceAngleS(s16 x, s16 y);
|
||||
|
||||
template <typename T>
|
||||
inline void cLib_offBit(T& value, u8 bit) {
|
||||
value &= ~bit;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline void cLib_onBit(T& value, u8 bit) {
|
||||
value |= bit;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T cLib_checkBit(T& value, u8 bit) {
|
||||
return value & bit;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T cLib_minMaxLimit(T val, T min, T max) {
|
||||
T ret;
|
||||
T var_r30;
|
||||
|
||||
if (val < min) {
|
||||
ret = min;
|
||||
} else {
|
||||
if (val > max) {
|
||||
var_r30 = max;
|
||||
} else {
|
||||
var_r30 = val;
|
||||
}
|
||||
|
||||
ret = var_r30;
|
||||
}
|
||||
|
||||
return (T)ret;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T cLib_maxLimit(T val, T max) {
|
||||
T ret;
|
||||
T var_r30;
|
||||
|
||||
if (val > max) {
|
||||
var_r30 = max;
|
||||
} else {
|
||||
var_r30 = val;
|
||||
}
|
||||
|
||||
ret = var_r30;
|
||||
return (T)ret;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T cLib_calcTimer(T* value) {
|
||||
if (*value != 0) {
|
||||
*value = *value - 1;
|
||||
}
|
||||
return *value;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T cLib_getRndValue(T min, T range) {
|
||||
return (T)(min + cM_rndF((f32)range));
|
||||
}
|
||||
|
||||
void MtxInit(void);
|
||||
void MtxTrans(f32, f32, f32, u8);
|
||||
void MtxScale(f32, f32, f32, u8);
|
||||
void MtxPosition(cXyz*, cXyz*);
|
||||
void MtxPush(void);
|
||||
Mtx* MtxPull(void);
|
||||
|
||||
extern Mtx* calc_mtx;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef C_LIST_H
|
||||
#define C_LIST_H
|
||||
|
||||
|
||||
typedef struct node_class node_class;
|
||||
|
||||
typedef struct node_list_class {
|
||||
node_class* mpHead;
|
||||
node_class* mpTail;
|
||||
int mSize;
|
||||
} node_list_class;
|
||||
|
||||
void cLs_Init(node_list_class* pList);
|
||||
int cLs_SingleCut(node_class* pNode);
|
||||
int cLs_Addition(node_list_class* pList, node_class* pNode);
|
||||
int cLs_Insert(node_list_class* pList, int idx, node_class* pNode);
|
||||
node_class* cLs_GetFirst(node_list_class* pList);
|
||||
void cLs_Create(node_list_class* pList);
|
||||
|
||||
#endif /* C_LIST_H */
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef C_LIST_ITER_H
|
||||
#define C_LIST_ITER_H
|
||||
|
||||
#include "SSystem/SComponent/c_node_iter.h"
|
||||
|
||||
typedef struct node_list_class node_list_class;
|
||||
|
||||
int cLsIt_Method(node_list_class* pList, cNdIt_MethodFunc pMethod, void* pUserData);
|
||||
void* cLsIt_Judge(node_list_class* pList, cNdIt_JudgeFunc pJudge, void* pUserData);
|
||||
|
||||
#endif /* C_LIST_ITER_H */
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef C_M2D_H
|
||||
#define C_M2D_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
struct cM2dGCir;
|
||||
|
||||
void cM2d_CrossCirLin(cM2dGCir&, float, float, float, float, float*, float*);
|
||||
|
||||
#endif /* C_M2D_H */
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef C_M2D_G_BOX_H
|
||||
#define C_M2D_G_BOX_H
|
||||
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
|
||||
class cM2dGBox {
|
||||
public:
|
||||
cXy mP0, mP1;
|
||||
|
||||
void Set(cXy& pA, cXy& pB);
|
||||
f32 GetLen(const cXy& pXy) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,98 @@
|
||||
#ifndef C_M3D_H_
|
||||
#define C_M3D_H_
|
||||
|
||||
#include "MSL_C/math.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class cM3dGAab;
|
||||
class cM3dGCps;
|
||||
class cM3dGCyl;
|
||||
class cM3dGLin;
|
||||
class cM3dGPla;
|
||||
class cM3dGSph;
|
||||
class cM3dGTri;
|
||||
class csXyz;
|
||||
class cXyz;
|
||||
|
||||
struct cM3d_Range;
|
||||
struct Vec;
|
||||
|
||||
extern f32 G_CM3D_F_ABS_MIN;
|
||||
|
||||
static void cM3d_InDivPos1(const Vec*, const Vec*, f32, Vec*);
|
||||
void cM3d_InDivPos2(const Vec*, const Vec*, f32, Vec*);
|
||||
f32 cM3d_Len2dSq(f32, f32, f32, f32);
|
||||
bool cM3d_Len2dSqPntAndSegLine(f32, f32, f32, f32, f32, f32, f32*, f32*, f32*);
|
||||
bool cM3d_Len3dSqPntAndSegLine(const cM3dGLin*, const Vec*, Vec*, f32*);
|
||||
f32 cM3d_SignedLenPlaAndPos(const cM3dGPla*, const Vec*);
|
||||
f32 cM3d_VectorProduct2d(f32, f32, f32, f32, f32, f32);
|
||||
void cM3d_VectorProduct(const cXyz*, const cXyz*, const cXyz*, cXyz*);
|
||||
void cM3d_CalcPla(const Vec*, const Vec*, const Vec*, Vec*, f32*);
|
||||
bool cM3d_Cross_AabAab(const cM3dGAab*, const cM3dGAab*);
|
||||
bool cM3d_Cross_AabCyl(const cM3dGAab*, const cM3dGCyl*);
|
||||
bool cM3d_Cross_AabSph(const cM3dGAab*, const cM3dGSph*);
|
||||
static int cM3d_Check_LinLin(const cM3dGLin*, const cM3dGLin*, f32*, f32*);
|
||||
static bool cM3d_CrossInfLineVsInfPlane_proc(f32, f32, const Vec*, const Vec*, Vec*);
|
||||
bool cM3d_Cross_LinPla(const cM3dGLin*, const cM3dGPla*, Vec*, bool, bool);
|
||||
bool cM3d_Cross_MinMaxBoxLine(const Vec*, const Vec*, const Vec*, const Vec*);
|
||||
static bool cM3d_InclusionCheckPosIn3PosBox3d(const Vec*, const Vec*, const Vec*, const Vec*, f32);
|
||||
static bool cM3d_InclusionCheckPosIn3PosBox2d(f32, f32, f32, f32, f32, f32, f32, f32, f32);
|
||||
static bool cM3d_CrossX_Tri(const cM3dGTri*, const Vec*, f32);
|
||||
static bool cM3d_CrossX_Tri(const cM3dGTri*, const Vec*);
|
||||
static bool cM3d_CrossX_LinTri_proc(const cM3dGTri*, const Vec*);
|
||||
bool cM3d_CrossY_Tri(const cM3dGTri*, const Vec*);
|
||||
static bool cM3d_CrossY_LinTri_proc(const cM3dGTri*, const Vec*);
|
||||
bool cM3d_CrossY_Tri(const Vec&, const Vec&, const Vec&, const cM3dGPla&, const Vec*);
|
||||
bool cM3d_CrossY_Tri_Front(const Vec&, const Vec&, const Vec&, const Vec*);
|
||||
static bool cM3d_CrossY_Tri(const cM3dGTri*, const Vec*, f32*);
|
||||
static bool cM3d_CrossY_Tri(const cM3dGTri*, const Vec*, f32);
|
||||
static bool cM3d_CrossY_Tri(const cM3dGTri*, const Vec*, const cM3d_Range*, f32*);
|
||||
static bool cM3d_CrossZ_Tri(const cM3dGTri*, const Vec*, f32);
|
||||
static bool cM3d_CrossZ_Tri(const cM3dGTri*, const Vec*);
|
||||
static bool cM3d_CrossZ_LinTri_proc(const cM3dGTri*, const Vec*);
|
||||
bool cM3d_Cross_LinTri(const cM3dGLin*, const cM3dGTri*, Vec*, bool, bool);
|
||||
static bool cM3d_Cross_LinTri_Easy(const cM3dGTri*, const Vec*);
|
||||
static bool cM3d_Cross_SphPnt(const cM3dGSph*, const Vec*);
|
||||
bool cM3d_Cross_LinSph(const cM3dGLin*, const cM3dGSph*, Vec*);
|
||||
int cM3d_Cross_LinSph_CrossPos(const cM3dGSph&, const cM3dGLin&, Vec*, Vec*);
|
||||
bool cM3d_Cross_CylSph(const cM3dGCyl*, const cM3dGSph*, f32*);
|
||||
bool cM3d_Cross_CylSph(const cM3dGCyl*, const cM3dGSph*, Vec*, f32*);
|
||||
bool cM3d_Cross_SphSph(const cM3dGSph*, const cM3dGSph*, f32*);
|
||||
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*);
|
||||
int cM3d_Cross_CylLin(const cM3dGCyl*, const cM3dGLin*, Vec*, Vec*);
|
||||
static int cM3d_Cross_CylPntPnt(const cM3dGCyl*, const Vec*, const Vec*, Vec*, Vec*);
|
||||
static bool cM3d_Cross_CylPnt(const cM3dGCyl*, const Vec*);
|
||||
bool cM3d_Cross_CpsCps(const cM3dGCps&, const cM3dGCps&, Vec*);
|
||||
bool cM3d_Cross_CpsCyl(const cM3dGCps&, const cM3dGCyl&, Vec*);
|
||||
static bool cM3d_Cross_CpsSph_CrossPos(const cM3dGCps&, const cM3dGSph&, const Vec&, Vec*);
|
||||
bool cM3d_Cross_CpsSph(const cM3dGCps&, const cM3dGSph&, Vec*);
|
||||
bool cM3d_Cross_TriTri(const cM3dGTri&, const cM3dGTri&, Vec*);
|
||||
bool cM3d_Cross_CpsTri(const cM3dGCps&, cM3dGTri, Vec*);
|
||||
void cM3d_CalcVecAngle(const Vec&, short*, short*);
|
||||
void cM3d_CalcVecZAngle(const Vec&, csXyz*);
|
||||
static void cM3d_PlaneCrossLineProcWork(f32, f32, f32, f32, f32, f32, f32, f32*, f32*);
|
||||
static int cM3d_2PlaneCrossLine(const cM3dGPla&, const cM3dGPla&, cM3dGLin*);
|
||||
bool cM3d_3PlaneCrossPos(const cM3dGPla&, const cM3dGPla&, const cM3dGPla&, Vec*);
|
||||
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*);
|
||||
|
||||
inline bool cM3d_IsZero(f32 f) {
|
||||
return fabsf(f) < G_CM3D_F_ABS_MIN;
|
||||
}
|
||||
// this is the inline cM3d_IsZero but inverted. Sometimes this will get a match where the regular cM3d_IsZero inline won't
|
||||
inline bool cM3d_IsZero_inverted(f32 param_0) {
|
||||
return !(fabsf(param_0) < G_CM3D_F_ABS_MIN);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef C_M3D_G_AAB_H
|
||||
#define C_M3D_G_AAB_H
|
||||
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "SSystem/SComponent/c_m3d.h"
|
||||
#include "global.h"
|
||||
|
||||
// Axis aligned bounding box
|
||||
class cM3dGAab {
|
||||
private:
|
||||
public:
|
||||
/* 0x00 */ cXyz mMin;
|
||||
/* 0x0C */ cXyz mMax;
|
||||
/* 0x18 vtable */
|
||||
|
||||
virtual ~cM3dGAab() {}
|
||||
void SetMinMax(const cXyz&);
|
||||
void SetMin(const cXyz&);
|
||||
void SetMax(const cXyz&);
|
||||
const cXyz* GetMaxP(void) const { return &mMax; }
|
||||
const cXyz* GetMinP(void) const { return &mMin; }
|
||||
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; }
|
||||
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));
|
||||
|
||||
#endif /* C_M3D_G_AAB_H */
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef C_M3D_G_CIR_H
|
||||
#define C_M3D_G_CIR_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class cM2dGCir {
|
||||
public:
|
||||
f32 mPosX;
|
||||
f32 mPosY;
|
||||
f32 mRadius;
|
||||
|
||||
f32 GetCx() const { return mPosX; }
|
||||
f32 GetCy() const { return mPosY; }
|
||||
f32 GetR() const { return mRadius; }
|
||||
|
||||
cM2dGCir() {}
|
||||
virtual ~cM2dGCir() {}
|
||||
};
|
||||
|
||||
class cM3dGCir : public cM2dGCir {
|
||||
f32 mPosZ;
|
||||
|
||||
public:
|
||||
cM3dGCir(void);
|
||||
virtual ~cM3dGCir(void);
|
||||
void Set(f32, f32, f32, f32);
|
||||
};
|
||||
|
||||
#endif /* C_M3D_G_CIR_H */
|
||||
@@ -0,0 +1,40 @@
|
||||
#ifndef C_M3D_G_CYL_H
|
||||
#define C_M3D_G_CYL_H
|
||||
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "global.h"
|
||||
|
||||
// Cylinder
|
||||
struct cM3dGCylS {
|
||||
/* 0x00 */ Vec mCenter;
|
||||
/* 0x0C */ f32 mRadius;
|
||||
/* 0x10 */ f32 mHeight;
|
||||
}; // Size = 0x14
|
||||
|
||||
class cM3dGSph;
|
||||
|
||||
class cM3dGCyl {
|
||||
public:
|
||||
/* 0x00 */ cXyz mCenter;
|
||||
/* 0x0C */ f32 mRadius;
|
||||
/* 0x10 */ f32 mHeight;
|
||||
/* 0x14 vtable */
|
||||
cM3dGCyl() {}
|
||||
cM3dGCyl(const cXyz*, f32, f32);
|
||||
virtual ~cM3dGCyl() {}
|
||||
void SetC(const cXyz& pos);
|
||||
void SetH(f32 h);
|
||||
void SetR(f32 r);
|
||||
bool cross(const cM3dGSph*, cXyz*) const;
|
||||
bool cross(const cM3dGCyl*, cXyz*) const;
|
||||
bool cross(const cM3dGSph*, f32*) const;
|
||||
bool cross(const cM3dGCyl*, f32*) const;
|
||||
const cXyz* GetCP(void) const { return &mCenter; }
|
||||
f32 GetR(void) const { return mRadius; }
|
||||
f32 GetH(void) const { return mHeight; }
|
||||
cXyz& GetC() { return mCenter; }
|
||||
}; // Size = 0x18
|
||||
|
||||
STATIC_ASSERT(0x18 == sizeof(cM3dGCyl));
|
||||
|
||||
#endif /* C_M3D_G_CYL_H */
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef C_M3D_G_PLA_H_
|
||||
#define C_M3D_G_PLA_H_
|
||||
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
|
||||
// Plane with a normal
|
||||
class cM3dGPla {
|
||||
public:
|
||||
/* 0x00 */ cXyz mNormal;
|
||||
/* 0x0C */ f32 mD;
|
||||
/* 0x10 vtable */
|
||||
|
||||
cM3dGPla() {}
|
||||
void CalcAngleXz(short* pAngleX, short* pAngleY) const;
|
||||
void SetupNP0(const Vec&, const Vec&);
|
||||
|
||||
virtual ~cM3dGPla() {}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,44 @@
|
||||
#ifndef C_M3D_G_SPH_H_
|
||||
#define C_M3D_G_SPH_H_
|
||||
|
||||
#include "SSystem/SComponent/c_m3d.h"
|
||||
#include "SSystem/SComponent/c_xyz.h"
|
||||
#include "global.h"
|
||||
|
||||
class cM3dGCyl;
|
||||
|
||||
struct cM3dGSphS {
|
||||
/* 0x0 */ Vec mCenter;
|
||||
/* 0xC */ f32 mRadius;
|
||||
}; // Size: 0x10
|
||||
|
||||
class cM3dGSph {
|
||||
private:
|
||||
public:
|
||||
/* 0x00 */ cXyz mCenter;
|
||||
/* 0x0C */ f32 mRadius;
|
||||
/* 0x10 vtable */
|
||||
|
||||
cM3dGSph() {}
|
||||
virtual ~cM3dGSph() {}
|
||||
void SetC(const cXyz&);
|
||||
void SetR(f32);
|
||||
bool cross(const cM3dGSph*, cXyz*) const;
|
||||
bool cross(const cM3dGCyl*, cXyz*) const;
|
||||
bool cross(const cM3dGSph*, f32*) const;
|
||||
const cXyz& GetC(void) const { return mCenter; }
|
||||
const cXyz* GetCP() const { return &mCenter; }
|
||||
const f32 GetR(void) const { return mRadius; }
|
||||
f32 GetCX(void) const { return mCenter.x; }
|
||||
f32 GetCY(void) const { return mCenter.y; }
|
||||
f32 GetCZ(void) const { return mCenter.z; }
|
||||
}; // Size = 0x14
|
||||
|
||||
STATIC_ASSERT(0x14 == sizeof(cM3dGSph));
|
||||
|
||||
// additional symbols needed for cM3dGSph
|
||||
extern "C" {
|
||||
void Set__8cM3dGSphFRC4cXyzf(void);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef C_M3D_G_TRI_H_
|
||||
#define C_M3D_G_TRI_H_
|
||||
|
||||
#include "SSystem/SComponent/c_m3d_g_pla.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class cM3dGCyl;
|
||||
|
||||
struct cM3dGTriS {
|
||||
Vec a;
|
||||
Vec b;
|
||||
Vec c;
|
||||
};
|
||||
|
||||
class cM3dGTri : public cM3dGPla {
|
||||
// private:
|
||||
public:
|
||||
// cM3dGPla mPlane;
|
||||
Vec mA;
|
||||
Vec mB;
|
||||
Vec mC;
|
||||
|
||||
cM3dGTri(const Vec *pA, const Vec *pB, const Vec *pC);
|
||||
bool cross(const cM3dGCyl*, Vec*) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef C_MALLOC_H
|
||||
#define C_MALLOC_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class JKRHeap;
|
||||
|
||||
struct cMl {
|
||||
static JKRHeap* Heap;
|
||||
static void init(JKRHeap*);
|
||||
static void* memalignB(int, u32);
|
||||
static void free(void*);
|
||||
};
|
||||
|
||||
#endif /* C_MALLOC_H */
|
||||
@@ -0,0 +1,51 @@
|
||||
#ifndef C_MATH_H
|
||||
#define C_MATH_H
|
||||
|
||||
#include "JSystem/JMath/JMATrigonometric.h"
|
||||
|
||||
s16 cM_rad2s(float rad);
|
||||
u16 U_GetAtanTable(float, float);
|
||||
s16 cM_atan2s(float y, float x);
|
||||
float cM_atan2f(float y, float x);
|
||||
void cM_initRnd(int, int, int);
|
||||
float cM_rnd(void);
|
||||
float cM_rndF(float);
|
||||
float cM_rndFX(float);
|
||||
void cM_initRnd2(int, int, int);
|
||||
float cM_rnd2(void);
|
||||
float cM_rndF2(float);
|
||||
float cM_rndFX2(float);
|
||||
|
||||
inline f32 cM_scos(s16 x) {
|
||||
return JMASCos(x);
|
||||
}
|
||||
|
||||
inline f32 cM_ssin(s16 x) {
|
||||
return JMASSin(x);
|
||||
}
|
||||
|
||||
inline s16 cM_deg2s(f32 deg) {
|
||||
return deg * 182.04445f;
|
||||
}
|
||||
|
||||
inline s16 i_cM_deg2s(f32 deg) {
|
||||
return deg;
|
||||
}
|
||||
|
||||
inline f32 cM_fcos(f32 x) {
|
||||
return JMASCos(cM_rad2s(x));
|
||||
}
|
||||
|
||||
inline f32 cM_fsin(f32 x) {
|
||||
return JMASSin(cM_rad2s(x));
|
||||
}
|
||||
|
||||
inline f32 cM_sht2d(f32 v) {
|
||||
return v * 0.005493164f;
|
||||
}
|
||||
|
||||
inline f32 cM_s2rad(s16 x) {
|
||||
return x * 9.58738e-05f;
|
||||
}
|
||||
|
||||
#endif /* C_MATH_H */
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef C_NODE_H
|
||||
#define C_NODE_H
|
||||
|
||||
|
||||
typedef struct node_class {
|
||||
struct node_class* mpPrevNode;
|
||||
void* mpData;
|
||||
struct node_class* mpNextNode;
|
||||
} node_class;
|
||||
|
||||
void cNd_Join(node_class* pA, node_class* pB);
|
||||
int cNd_LengthOf(node_class* pNode);
|
||||
node_class* cNd_First(node_class* pNode);
|
||||
node_class* cNd_Last(node_class* pNode);
|
||||
node_class* cNd_Order(node_class* pNode, int idx);
|
||||
void cNd_SingleCut(node_class* pNode);
|
||||
void cNd_Cut(node_class* pNode);
|
||||
void cNd_Addition(node_class* pA, node_class* pB);
|
||||
void cNd_Insert(node_class* pA, node_class* pB);
|
||||
void cNd_SetObject(node_class* pNode, void* pData);
|
||||
void cNd_ClearObject(node_class* pNode);
|
||||
void cNd_ForcedClear(node_class* pNode);
|
||||
void cNd_Create(node_class* pNode, void* pData);
|
||||
|
||||
#define NODE_GET_PREV(pNode) (pNode ? pNode->mpPrevNode : NULL)
|
||||
#define NODE_GET_NEXT(pNode) (pNode ? pNode->mpNextNode : NULL)
|
||||
|
||||
#endif /* C_NODE_H */
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef C_NODE_ITER_H
|
||||
#define C_NODE_ITER_H
|
||||
|
||||
|
||||
typedef struct node_class node_class;
|
||||
|
||||
typedef int (*cNdIt_MethodFunc)(node_class* pNode, void* pUserData);
|
||||
int cNdIt_Method(node_class* pNode, cNdIt_MethodFunc pMethod, void* pUserData);
|
||||
|
||||
typedef void* (*cNdIt_JudgeFunc)(node_class* pNode, void* pUserData);
|
||||
void* cNdIt_Judge(node_class* pNode, cNdIt_JudgeFunc pJudge, void* pUserData);
|
||||
|
||||
#endif /* C_NODE_ITER_H */
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef C_PHASE_H
|
||||
#define C_PHASE_H
|
||||
|
||||
|
||||
typedef int (*cPhs__Handler)(void*);
|
||||
|
||||
enum cPhs__Step {
|
||||
/* 0x0 */ cPhs_INIT_e,
|
||||
/* 0x1 */ cPhs_LOADING_e,
|
||||
/* 0x2 */ cPhs_NEXT_e,
|
||||
/* 0x3 */ cPhs_UNK3_e, // appears to be an alternate error code, unsure how it differs
|
||||
/* 0x4 */ cPhs_COMPLEATE_e,
|
||||
/* 0x5 */ cPhs_ERROR_e,
|
||||
};
|
||||
|
||||
typedef struct request_of_phase_process_class {
|
||||
cPhs__Handler* mpHandlerTable;
|
||||
int id;
|
||||
} request_of_phase_process_class;
|
||||
|
||||
typedef int (*request_of_phase_process_fn)(void*);
|
||||
|
||||
void cPhs_Reset(request_of_phase_process_class* pPhase);
|
||||
void cPhs_Set(request_of_phase_process_class* pPhase, cPhs__Handler* pHandlerTable);
|
||||
void cPhs_UnCompleate(request_of_phase_process_class* pPhase);
|
||||
int cPhs_Compleate(request_of_phase_process_class* pPhase);
|
||||
int cPhs_Next(request_of_phase_process_class* pPhase);
|
||||
int cPhs_Do(request_of_phase_process_class* pPhase, void* pUserData);
|
||||
int cPhs_Handler(request_of_phase_process_class* pPhase, cPhs__Handler* pHandlerTable,
|
||||
void* pUserData);
|
||||
|
||||
#endif /* C_PHASE_H */
|
||||
@@ -0,0 +1,212 @@
|
||||
#ifndef C_REQUEST_H
|
||||
#define C_REQUEST_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
struct request_base_class {
|
||||
struct {
|
||||
u8 flag0 : 1;
|
||||
u8 flag1 : 1;
|
||||
u8 flag2 : 6;
|
||||
} field_0x0;
|
||||
u8 field_0x1;
|
||||
u8 field_0x2;
|
||||
u8 field_0x3;
|
||||
u16 field_0x4;
|
||||
u8 field_0x6;
|
||||
u8 field_0x7;
|
||||
u32 field_0x8;
|
||||
s8 field_0xc;
|
||||
u8 field_0xd;
|
||||
u8 field_0xe;
|
||||
u8 field_0xf;
|
||||
int* field_0x10;
|
||||
// u8 field_0x11;
|
||||
// u8 field_0x12;
|
||||
// u8 field_0x13;
|
||||
u8 field_0x14;
|
||||
u8 field_0x15;
|
||||
u8 field_0x16;
|
||||
u8 field_0x17;
|
||||
u8 field_0x18;
|
||||
u8 field_0x19;
|
||||
u8 field_0x1a;
|
||||
u8 field_0x1b;
|
||||
u8 field_0x1c;
|
||||
u8 field_0x1d;
|
||||
u8 field_0x1e;
|
||||
u8 field_0x1f;
|
||||
u32* field_0x20;
|
||||
u8 field_0x24;
|
||||
u8 field_0x25;
|
||||
u8 field_0x26;
|
||||
u8 field_0x27;
|
||||
u8 field_0x28;
|
||||
u8 field_0x29;
|
||||
u8 field_0x2a;
|
||||
u8 field_0x2b;
|
||||
u8 field_0x2c;
|
||||
u8 field_0x2d;
|
||||
u8 field_0x2e;
|
||||
u8 field_0x2f;
|
||||
u8 field_0x30;
|
||||
u8 field_0x31;
|
||||
u8 field_0x32;
|
||||
u8 field_0x33;
|
||||
u8 field_0x34;
|
||||
u8 field_0x35;
|
||||
u8 field_0x36;
|
||||
u8 field_0x37;
|
||||
u8 field_0x38;
|
||||
u8 field_0x39;
|
||||
u8 field_0x3a;
|
||||
u8 field_0x3b;
|
||||
u8 field_0x3c;
|
||||
u8 field_0x3d;
|
||||
u8 field_0x3e;
|
||||
u8 field_0x3f;
|
||||
u8 field_0x40;
|
||||
u8 field_0x41;
|
||||
u8 field_0x42;
|
||||
u8 field_0x43;
|
||||
u8 field_0x44;
|
||||
u8 field_0x45;
|
||||
u8 field_0x46;
|
||||
u8 field_0x47;
|
||||
u8 field_0x48;
|
||||
u8 field_0x49;
|
||||
u8 field_0x4a;
|
||||
u8 field_0x4b;
|
||||
u8 field_0x4c;
|
||||
u8 field_0x4d;
|
||||
u8 field_0x4e;
|
||||
u8 field_0x4f;
|
||||
u8 field_0x50;
|
||||
u8 field_0x51;
|
||||
u8 field_0x52;
|
||||
u8 field_0x53;
|
||||
u8 field_0x54;
|
||||
u8 field_0x55;
|
||||
u8 field_0x56;
|
||||
u8 field_0x57;
|
||||
u8 field_0x58;
|
||||
u8 field_0x59;
|
||||
u8 field_0x5a;
|
||||
u8 field_0x5b;
|
||||
u8 field_0x5c;
|
||||
u8 field_0x5d;
|
||||
u8 field_0x5e;
|
||||
u8 field_0x5f;
|
||||
u8 field_0x60;
|
||||
u8 field_0x61;
|
||||
u8 field_0x62;
|
||||
u8 field_0x63;
|
||||
u8 field_0x64;
|
||||
u8 field_0x65;
|
||||
u8 field_0x66;
|
||||
u8 field_0x67;
|
||||
u8 field_0x68;
|
||||
u8 field_0x69;
|
||||
u8 field_0x6a;
|
||||
u8 field_0x6b;
|
||||
u8 field_0x6c;
|
||||
u8 field_0x6d;
|
||||
u8 field_0x6e;
|
||||
u8 field_0x6f;
|
||||
u8 field_0x70;
|
||||
u8 field_0x71;
|
||||
u8 field_0x72;
|
||||
u8 field_0x73;
|
||||
u8 field_0x74;
|
||||
u8 field_0x75;
|
||||
u8 field_0x76;
|
||||
u8 field_0x77;
|
||||
u8 field_0x78;
|
||||
u8 field_0x79;
|
||||
u8 field_0x7a;
|
||||
u8 field_0x7b;
|
||||
u8 field_0x7c;
|
||||
u8 field_0x7d;
|
||||
u8 field_0x7e;
|
||||
u8 field_0x7f;
|
||||
u8 field_0x80;
|
||||
u8 field_0x81;
|
||||
u8 field_0x82;
|
||||
u8 field_0x83;
|
||||
u8 field_0x84;
|
||||
u8 field_0x85;
|
||||
u8 field_0x86;
|
||||
u8 field_0x87;
|
||||
u8 field_0x88;
|
||||
u8 field_0x89;
|
||||
u8 field_0x8a;
|
||||
u8 field_0x8b;
|
||||
u8 field_0x8c;
|
||||
u8 field_0x8d;
|
||||
u8 field_0x8e;
|
||||
u8 field_0x8f;
|
||||
u8 field_0x90;
|
||||
u8 field_0x91;
|
||||
u8 field_0x92;
|
||||
u8 field_0x93;
|
||||
u8 field_0x94;
|
||||
u8 field_0x95;
|
||||
u8 field_0x96;
|
||||
u8 field_0x97;
|
||||
u8 field_0x98;
|
||||
u8 field_0x99;
|
||||
u8 field_0x9a;
|
||||
u8 field_0x9b;
|
||||
u8 field_0x9c;
|
||||
u8 field_0x9d;
|
||||
u8 field_0x9e;
|
||||
u8 field_0x9f;
|
||||
u8 field_0xa0;
|
||||
u8 field_0xa1;
|
||||
u8 field_0xa2;
|
||||
u8 field_0xa3;
|
||||
u8 field_0xa4;
|
||||
u8 field_0xa5;
|
||||
u8 field_0xa6;
|
||||
u8 field_0xa7;
|
||||
u8 field_0xa8;
|
||||
u8 field_0xa9;
|
||||
u8 field_0xaa;
|
||||
u8 field_0xab;
|
||||
u8 field_0xac;
|
||||
u8 field_0xad;
|
||||
u8 field_0xae;
|
||||
u8 field_0xaf;
|
||||
u8 field_0xb0;
|
||||
u8 field_0xb1;
|
||||
u8 field_0xb2;
|
||||
u8 field_0xb3;
|
||||
u8 field_0xb4;
|
||||
u8 field_0xb5;
|
||||
u8 field_0xb6;
|
||||
u8 field_0xb7;
|
||||
u8 field_0xb8;
|
||||
u8 field_0xb9;
|
||||
u8 field_0xba;
|
||||
u8 field_0xbb;
|
||||
u8 field_0xbc;
|
||||
u8 field_0xbd;
|
||||
u8 field_0xbe;
|
||||
u8 field_0xbf;
|
||||
u32 field_0xc0;
|
||||
// u8 field_0xc1;
|
||||
// u8 field_0xc2;
|
||||
// u8 field_0xc3;
|
||||
request_base_class* field_0xc4;
|
||||
// u8 field_0xc5;
|
||||
// u8 field_0xc6;
|
||||
// u8 field_0xc7;
|
||||
u32* field_0xc8;
|
||||
};
|
||||
|
||||
int cReq_Is_Done(request_base_class*);
|
||||
void cReq_Done(request_base_class*);
|
||||
void cReq_Command(request_base_class*, u8);
|
||||
void cReq_Create(request_base_class*, u8);
|
||||
|
||||
#endif /* C_REQUEST_H */
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef C_SXYZ_H
|
||||
#define C_SXYZ_H
|
||||
|
||||
#include "dolphin/mtx/vec.h"
|
||||
|
||||
class csXyz : public SVec {
|
||||
public:
|
||||
static const csXyz Zero;
|
||||
~csXyz() {};
|
||||
/* inline */ csXyz() {}
|
||||
/* inline */ csXyz(const csXyz& other) : SVec(other){};
|
||||
csXyz(s16, s16, s16);
|
||||
csXyz operator+(csXyz&);
|
||||
void operator+=(csXyz&);
|
||||
csXyz operator-(csXyz&);
|
||||
csXyz operator*(f32);
|
||||
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 */
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef C_TAG_H
|
||||
#define C_TAG_H
|
||||
|
||||
#include "SSystem/SComponent/c_node.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
typedef struct node_list_class node_list_class;
|
||||
typedef struct node_lists_tree_class node_lists_tree_class;
|
||||
|
||||
typedef struct create_tag_class {
|
||||
node_class mpNode;
|
||||
void* mpTagData;
|
||||
s8 mbIsUse;
|
||||
} create_tag_class;
|
||||
|
||||
int cTg_IsUse(create_tag_class* pTag);
|
||||
int cTg_SingleCutFromTree(create_tag_class* pTag);
|
||||
int cTg_AdditionToTree(node_lists_tree_class* pTree, int listIdx, create_tag_class* pTag);
|
||||
int cTg_InsertToTree(node_lists_tree_class* pTree, int listIdx, create_tag_class* pTag, int idx);
|
||||
node_class* cTg_GetFirst(node_list_class* pTag);
|
||||
int cTg_SingleCut(create_tag_class* pTag);
|
||||
int cTg_Addition(node_list_class* pList, create_tag_class* pTag);
|
||||
void cTg_Create(create_tag_class* pTag, void* pData);
|
||||
|
||||
#endif /* C_TAG_H */
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef C_TAG_ITER_H
|
||||
#define C_TAG_ITER_H
|
||||
|
||||
#include "SSystem/SComponent/c_node_iter.h"
|
||||
|
||||
typedef struct create_tag_class create_tag_class;
|
||||
|
||||
typedef struct method_filter {
|
||||
cNdIt_MethodFunc mpMethodFunc;
|
||||
void* mpUserData;
|
||||
} method_filter;
|
||||
|
||||
typedef struct judge_filter {
|
||||
cNdIt_JudgeFunc mpJudgeFunc;
|
||||
void* mpUserData;
|
||||
} judge_filter;
|
||||
|
||||
int cTgIt_MethodCall(create_tag_class* pTag, method_filter* pMethodFilter);
|
||||
void* cTgIt_JudgeFilter(create_tag_class* pTag, judge_filter* pJudgeFilter);
|
||||
|
||||
#endif /* C_TAG_ITER_H */
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef C_TREE_H
|
||||
#define C_TREE_H
|
||||
|
||||
|
||||
typedef struct node_class node_class;
|
||||
typedef struct node_list_class node_list_class;
|
||||
|
||||
typedef struct node_lists_tree_class {
|
||||
node_list_class* mpLists;
|
||||
int mNumLists;
|
||||
} node_lists_tree_class;
|
||||
|
||||
int cTr_SingleCut(node_class* pNode);
|
||||
int cTr_Addition(node_lists_tree_class* pTree, int listIdx, node_class* pNode);
|
||||
int cTr_Insert(node_lists_tree_class* pTree, int listIdx, node_class* pNode, int idx);
|
||||
void cTr_Create(node_lists_tree_class* pTree, node_list_class* pLists, int numLists);
|
||||
|
||||
#endif /* C_TREE_H */
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef C_TREE_ITER_H
|
||||
#define C_TREE_ITER_H
|
||||
|
||||
#include "SSystem/SComponent/c_node_iter.h"
|
||||
|
||||
typedef struct node_lists_tree_class node_lists_tree_class;
|
||||
|
||||
int cTrIt_Method(node_lists_tree_class* pTree, cNdIt_MethodFunc pJudgeFunc, void* pUserData);
|
||||
void* cTrIt_Judge(node_lists_tree_class* pTree, cNdIt_JudgeFunc pJudgeFunc, void* pUserData);
|
||||
|
||||
#endif /* C_TREE_ITER_H */
|
||||
@@ -0,0 +1,146 @@
|
||||
#ifndef C_XYZ_H
|
||||
#define C_XYZ_H
|
||||
|
||||
#include "MSL_C/math.h"
|
||||
#include "dolphin/mtx/vec.h"
|
||||
|
||||
struct cXy {
|
||||
f32 x;
|
||||
f32 y;
|
||||
};
|
||||
|
||||
struct cXyz : Vec {
|
||||
static const cXyz Zero;
|
||||
static const cXyz BaseX;
|
||||
static const cXyz BaseY;
|
||||
static const cXyz BaseZ;
|
||||
static const cXyz BaseXY;
|
||||
static const cXyz BaseXZ;
|
||||
static const cXyz BaseYZ;
|
||||
static const cXyz BaseXYZ;
|
||||
~cXyz() {}
|
||||
/* inlined */ cXyz() {}
|
||||
cXyz(f32 x, f32 y, f32 z) {
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
}
|
||||
cXyz(const cXyz& vec) {
|
||||
this->x = vec.x;
|
||||
this->y = vec.y;
|
||||
this->z = vec.z;
|
||||
}
|
||||
cXyz(const Vec& vec) {
|
||||
this->x = vec.x;
|
||||
this->y = vec.y;
|
||||
this->z = vec.z;
|
||||
}
|
||||
void operator=(const Vec& vec) {
|
||||
this->x = vec.x;
|
||||
this->y = vec.y;
|
||||
this->z = vec.z;
|
||||
}
|
||||
cXyz operator+(Vec const&) const;
|
||||
cXyz operator-(Vec const&) const;
|
||||
cXyz operator*(f32) const;
|
||||
cXyz operator*(Vec const&) const;
|
||||
cXyz operator/(f32) const;
|
||||
// void operator=(cXyz const&);
|
||||
|
||||
void operator+=(f32 f) {
|
||||
x += f;
|
||||
y += f;
|
||||
z += f;
|
||||
}
|
||||
void operator-=(f32 f) {
|
||||
x -= f;
|
||||
y -= f;
|
||||
z -= f;
|
||||
}
|
||||
void operator-=(const Vec& other) { VECSubtract(this, &other, this); }
|
||||
void operator+=(const Vec& other) { VECAdd(this, &other, this); }
|
||||
void operator*=(f32 scale) { VECScale(this, this, scale); }
|
||||
cXyz getCrossProduct(Vec const&) const;
|
||||
cXyz outprod(Vec const&) const;
|
||||
cXyz norm() const;
|
||||
cXyz normZP() const;
|
||||
cXyz normZC() const;
|
||||
cXyz normalize();
|
||||
cXyz normalizeZP();
|
||||
bool normalizeRS();
|
||||
bool operator==(Vec const&) const;
|
||||
bool operator!=(Vec const&) const;
|
||||
bool isZero() const;
|
||||
s16 atan2sX_Z() const;
|
||||
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) {
|
||||
if (x > other.x) {
|
||||
x = other.x;
|
||||
}
|
||||
if (y > other.y) {
|
||||
y = other.y;
|
||||
}
|
||||
if (z > other.z) {
|
||||
z = other.z;
|
||||
}
|
||||
}
|
||||
|
||||
void setMax(const cXyz& other) {
|
||||
if (x < other.x) {
|
||||
x = other.x;
|
||||
}
|
||||
if (y < other.y) {
|
||||
y = other.y;
|
||||
}
|
||||
if (z < other.z) {
|
||||
z = other.z;
|
||||
}
|
||||
}
|
||||
|
||||
float getSquareMag() const { return VECSquareMag(this); }
|
||||
f32 getSquareDistance(const Vec& other) const { return VECSquareDistance(this, &other); }
|
||||
|
||||
static float getNearZeroValue() { return 8e-11f; }
|
||||
|
||||
bool isNearZeroSquare() const { return (this->getSquareMag() < getNearZeroValue()); }
|
||||
f32 abs2() const { return this->getSquareMag(); }
|
||||
f32 abs2(const Vec& other) const { return this->getSquareDistance(other); }
|
||||
f32 abs2XZ() const {
|
||||
cXyz tmp(this->x, 0, this->z);
|
||||
return tmp.abs2();
|
||||
}
|
||||
f32 abs2XZ(const Vec& other) const {
|
||||
cXyz tmp(this->x, 0, this->z);
|
||||
cXyz tmp2(other.x, 0, other.z);
|
||||
return tmp.abs2(tmp2);
|
||||
}
|
||||
f32 abs() const { return sqrtf(this->abs2()); }
|
||||
f32 abs(const Vec& other) const { return sqrtf(this->abs2(other)); }
|
||||
f32 absXZ() const { return sqrtf(this->abs2XZ()); }
|
||||
f32 absXZ(const Vec& other) const { return sqrtf(this->abs2XZ(other)); }
|
||||
f32 getMagXZ() const { return cXyz(this->x, 0, this->z).getSquareMag(); }
|
||||
|
||||
f32 getDotProduct(const Vec& other) const { return VECDotProduct(this, &other); }
|
||||
f32 inprod(const Vec& other) const { return getDotProduct(other); }
|
||||
};
|
||||
|
||||
#endif /* C_XYZ_H */
|
||||
Reference in New Issue
Block a user