2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CGAMECOLLISION
|
|
|
|
#define _CGAMECOLLISION
|
2022-09-19 04:19:46 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-11-17 04:56:21 +00:00
|
|
|
#include "MetroidPrime/CStateManager.hpp"
|
|
|
|
|
2022-09-29 23:55:38 +00:00
|
|
|
class CAreaCollisionCache;
|
2022-09-30 00:24:12 +00:00
|
|
|
class CCollisionInfo;
|
2022-09-19 04:19:46 +00:00
|
|
|
class CCollisionPrimitive;
|
|
|
|
class CMaterialFilter;
|
2022-09-29 23:55:38 +00:00
|
|
|
class CStateManager;
|
|
|
|
class CTransform4f;
|
2022-10-30 19:47:50 +00:00
|
|
|
class CRayCastResult;
|
2022-11-15 01:08:30 +00:00
|
|
|
class CPhysicsActor;
|
2022-09-19 04:19:46 +00:00
|
|
|
|
|
|
|
class CGameCollision {
|
|
|
|
public:
|
2022-11-15 01:08:30 +00:00
|
|
|
static void InitCollision();
|
2022-09-19 04:19:46 +00:00
|
|
|
static bool DetectStaticCollisionBoolean(const CStateManager&, const CCollisionPrimitive&,
|
|
|
|
const CTransform4f&, const CMaterialFilter&);
|
2022-09-21 05:18:07 +00:00
|
|
|
static bool DetectDynamicCollisionBoolean(const CCollisionPrimitive&, const CTransform4f&,
|
|
|
|
const TEntityList&, const CStateManager&);
|
2022-09-29 23:55:38 +00:00
|
|
|
static void BuildAreaCollisionCache(const CStateManager& mgr, CAreaCollisionCache& cache);
|
|
|
|
static bool DetectCollisionBoolean_Cached(const CStateManager& mgr, CAreaCollisionCache& cache,
|
|
|
|
const CCollisionPrimitive& prim, const CTransform4f& xf,
|
|
|
|
const CMaterialFilter& filter,
|
|
|
|
const TEntityList& nearList);
|
|
|
|
static bool DetectCollision_Cached_Moving(const CStateManager&, CAreaCollisionCache&,
|
|
|
|
const CCollisionPrimitive&, const CTransform4f&,
|
|
|
|
const CMaterialFilter&, const TEntityList&, CVector3f,
|
2022-10-09 05:37:23 +00:00
|
|
|
TUniqueId&, CCollisionInfo&, double&);
|
2022-10-30 19:47:50 +00:00
|
|
|
static CRayCastResult RayStaticIntersection(const CStateManager&, const CVector3f&,
|
|
|
|
const CVector3f&, float, const CMaterialFilter&);
|
2024-10-01 04:04:55 +00:00
|
|
|
static CRayCastResult RayDynamicIntersection(const CStateManager& mgr, TUniqueId& idOut,
|
|
|
|
const CVector3f& pos, const CVector3f& dir,
|
|
|
|
float mag, const CMaterialFilter& filter,
|
2022-11-17 04:56:21 +00:00
|
|
|
const TEntityList& nearList);
|
2024-10-01 04:04:55 +00:00
|
|
|
static rstl::optional_object< CVector3f >
|
|
|
|
FindNonIntersectingVector(const CStateManager& mgr, CAreaCollisionCache& cache,
|
|
|
|
CPhysicsActor& actor, const CCollisionPrimitive& prim,
|
|
|
|
const TEntityList& nearList); // name?
|
2022-11-07 13:30:53 +00:00
|
|
|
|
|
|
|
static void Move(CStateManager& mgr, CPhysicsActor& actor, float dt, const TEntityList*);
|
2022-09-19 04:19:46 +00:00
|
|
|
};
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CGAMECOLLISION
|