2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CCOLLIDABLEAABOX
|
|
|
|
#define _CCOLLIDABLEAABOX
|
2022-09-18 05:55:13 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "Collision/CCollisionPrimitive.hpp"
|
|
|
|
|
|
|
|
class CCollidableAABox : public CCollisionPrimitive {
|
|
|
|
public:
|
2022-10-05 16:28:37 +00:00
|
|
|
CCollidableAABox();
|
|
|
|
CCollidableAABox(const CAABox& box, const CMaterialList& matList)
|
|
|
|
: CCollisionPrimitive(matList), x10_aabb(box) {}
|
2022-09-18 05:55:13 +00:00
|
|
|
|
2023-10-20 04:15:38 +00:00
|
|
|
static bool CollideMovingAABox(const CInternalCollisionStructure& collision, const CVector3f& dir,
|
|
|
|
double& dOut, CCollisionInfo& infoOut);
|
|
|
|
static bool CollideMovingSphere(const CInternalCollisionStructure& collision,
|
|
|
|
const CVector3f& dir, double& dOut, CCollisionInfo& infoOut);
|
2023-01-10 06:51:58 +00:00
|
|
|
|
|
|
|
uint GetTableIndex() const;
|
|
|
|
CAABox CalculateAABox(const CTransform4f&) const;
|
|
|
|
CAABox CalculateLocalAABox() const;
|
|
|
|
CAABox Transform(const CTransform4f& xf) const;
|
|
|
|
FourCC GetPrimType() const;
|
|
|
|
CRayCastResult CastRayInternal(const CInternalRayCastStructure&) const;
|
|
|
|
|
|
|
|
static void SetStaticTableIndex(uint idx);
|
|
|
|
static CCollisionPrimitive::Type GetType();
|
2022-09-18 05:55:13 +00:00
|
|
|
|
|
|
|
private:
|
2023-01-10 06:51:58 +00:00
|
|
|
static uint sTableIndex;
|
|
|
|
|
2022-09-18 05:55:13 +00:00
|
|
|
CAABox x10_aabb;
|
|
|
|
};
|
|
|
|
CHECK_SIZEOF(CCollidableAABox, 0x28)
|
|
|
|
|
2023-01-10 06:51:58 +00:00
|
|
|
namespace Collide {
|
|
|
|
bool AABox_AABox_Bool(const CInternalCollisionStructure&);
|
|
|
|
bool AABox_AABox(const CInternalCollisionStructure& collision, CCollisionInfoList& list);
|
2023-10-20 04:15:38 +00:00
|
|
|
bool Sphere_AABox(const CInternalCollisionStructure& collision, CCollisionInfoList& list);
|
2023-01-10 06:51:58 +00:00
|
|
|
} // namespace Collide
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CCOLLIDABLEAABOX
|