2021-03-28 22:49:05 +02:00
|
|
|
#ifndef C_M3D_G_AAB_H
|
|
|
|
|
#define C_M3D_G_AAB_H
|
|
|
|
|
|
2023-08-23 18:40:37 +03:00
|
|
|
#include "SSystem/SComponent/c_m3d_g_lin.h"
|
|
|
|
|
#include "SSystem/SComponent/c_m3d.h"
|
2023-05-12 12:10:14 -07:00
|
|
|
#include "global.h"
|
2021-03-31 00:50:18 +02:00
|
|
|
|
|
|
|
|
// Axis aligned bounding box
|
|
|
|
|
class cM3dGAab {
|
|
|
|
|
private:
|
|
|
|
|
public:
|
2021-06-13 00:20:45 +02:00
|
|
|
/* 0x00 */ cXyz mMin;
|
|
|
|
|
/* 0x0C */ cXyz mMax;
|
|
|
|
|
/* 0x18 vtable */
|
2021-03-31 00:50:18 +02:00
|
|
|
|
2021-06-13 00:20:45 +02:00
|
|
|
virtual ~cM3dGAab() {}
|
2021-03-31 00:50:18 +02:00
|
|
|
void Set(const cXyz*, const cXyz*);
|
|
|
|
|
bool CrossY(const cXyz*) const;
|
|
|
|
|
bool UnderPlaneYUnder(f32) const;
|
|
|
|
|
bool TopPlaneYUnder(f32) const;
|
|
|
|
|
void ClearForMinMax(void);
|
|
|
|
|
void SetMinMax(const cXyz&);
|
|
|
|
|
void SetMinMax(const cM3dGAab&);
|
|
|
|
|
void SetMin(const cXyz&);
|
|
|
|
|
void SetMax(const cXyz&);
|
|
|
|
|
void CalcCenter(cXyz*) const;
|
|
|
|
|
void PlusR(f32);
|
2023-08-13 21:08:32 -07:00
|
|
|
const cXyz* GetMaxP(void) const { return &mMax; }
|
2025-07-11 11:11:21 +03:00
|
|
|
cXyz* GetMaxP(void) { return &mMax; }
|
2023-08-13 21:08:32 -07:00
|
|
|
const cXyz* GetMinP(void) const { return &mMin; }
|
2025-07-11 11:11:21 +03:00
|
|
|
cXyz* GetMinP(void) { return &mMin; }
|
2022-11-11 10:09:48 -08:00
|
|
|
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; }
|
2023-08-23 18:40:37 +03:00
|
|
|
bool Cross(const cM3dGLin *param_1) {
|
|
|
|
|
return cM3d_Cross_MinMaxBoxLine(GetMinP(), GetMaxP(), (Vec*)¶m_1->GetStartP(), (Vec*)¶m_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);
|
|
|
|
|
}
|
2021-06-13 00:20:45 +02:00
|
|
|
}; // Size = 0x1C
|
|
|
|
|
|
|
|
|
|
STATIC_ASSERT(0x1C == sizeof(cM3dGAab));
|
2021-03-28 22:49:05 +02:00
|
|
|
|
|
|
|
|
#endif /* C_M3D_G_AAB_H */
|