2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CCOLLIDABLESPHERE
|
|
|
|
#define _CCOLLIDABLESPHERE
|
2022-09-29 23:55:38 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "Collision/CCollisionPrimitive.hpp"
|
|
|
|
|
|
|
|
#include "Kyoto/Math/CSphere.hpp"
|
|
|
|
|
|
|
|
class CCollidableSphere : public CCollisionPrimitive {
|
|
|
|
public:
|
|
|
|
CCollidableSphere(const CSphere& sphere, const CMaterialList& material)
|
|
|
|
: CCollisionPrimitive(material), x10_sphere(sphere) {}
|
2024-10-14 05:00:50 +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);
|
2022-09-29 23:55:38 +00:00
|
|
|
|
2023-02-06 17:01:01 +00:00
|
|
|
uint GetTableIndex() const override;
|
|
|
|
CAABox CalculateAABox(const CTransform4f&) const override;
|
|
|
|
CAABox CalculateLocalAABox() const override;
|
|
|
|
FourCC GetPrimType() const override;
|
2024-10-14 05:00:50 +00:00
|
|
|
CSphere Transform(const CTransform4f& xf) const;
|
2023-02-06 17:01:01 +00:00
|
|
|
~CCollidableSphere() override {}
|
2024-10-14 05:00:50 +00:00
|
|
|
CRayCastResult CastRayInternal(const CInternalRayCastStructure& internalRayCast) const override;
|
|
|
|
|
2022-09-29 23:55:38 +00:00
|
|
|
|
2024-10-14 05:00:50 +00:00
|
|
|
static void SetStaticTableIndex(uint idx);
|
2023-10-20 04:15:38 +00:00
|
|
|
static Type GetType();
|
2024-10-14 05:00:50 +00:00
|
|
|
static bool Sphere_AABox_Bool(const CSphere& sphere, const CAABox& aabox);
|
2023-10-20 04:15:38 +00:00
|
|
|
|
2022-09-29 23:55:38 +00:00
|
|
|
private:
|
2024-10-14 05:00:50 +00:00
|
|
|
static uint sTableIndex;
|
2022-09-29 23:55:38 +00:00
|
|
|
CSphere x10_sphere;
|
|
|
|
};
|
|
|
|
CHECK_SIZEOF(CCollidableSphere, 0x20)
|
|
|
|
|
2023-10-20 04:15:38 +00:00
|
|
|
namespace Collide {
|
|
|
|
bool Sphere_Sphere(const CInternalCollisionStructure& collision, CCollisionInfoList& list);
|
|
|
|
bool Sphere_AABox_Bool(const CInternalCollisionStructure& collision);
|
|
|
|
bool Sphere_Sphere_Bool(const CInternalCollisionStructure& collision);
|
|
|
|
} // namespace Collide
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CCOLLIDABLESPHERE
|