2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CCOLLISIONACTOR
|
|
|
|
#define _CCOLLISIONACTOR
|
2022-09-21 05:18:07 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-11-26 04:02:24 +00:00
|
|
|
#include "MetroidPrime/CDamageVulnerability.hpp"
|
|
|
|
#include "MetroidPrime/CHealthInfo.hpp"
|
2022-09-21 05:18:07 +00:00
|
|
|
#include "MetroidPrime/CPhysicsActor.hpp"
|
|
|
|
|
2022-11-26 04:02:24 +00:00
|
|
|
#include "rstl/single_ptr.hpp"
|
|
|
|
|
|
|
|
class CCollidableOBBTreeGroupContainer;
|
|
|
|
class CCollidableOBBTreeGroup;
|
|
|
|
class CCollidableAABox;
|
|
|
|
class CCollidableSphere;
|
|
|
|
|
2022-09-21 05:18:07 +00:00
|
|
|
class CCollisionActor : public CPhysicsActor {
|
|
|
|
public:
|
2022-11-26 04:02:24 +00:00
|
|
|
enum EPrimitiveType {
|
|
|
|
kPT_OBBTreeGroup,
|
|
|
|
kPT_AABox,
|
|
|
|
kPT_Sphere,
|
|
|
|
};
|
|
|
|
|
|
|
|
CCollisionActor(TUniqueId uid, TAreaId areaId, TUniqueId owner, const CVector3f& extent,
|
|
|
|
const CVector3f& center, bool active, float mass);
|
|
|
|
CCollisionActor(TUniqueId uid, TAreaId areaId, TUniqueId owner, const CVector3f& boxSize,
|
|
|
|
bool active, float mass);
|
|
|
|
CCollisionActor(TUniqueId uid, TAreaId areaId, TUniqueId owner, bool active, float radius,
|
|
|
|
float mass);
|
|
|
|
|
|
|
|
// CEntity
|
2023-02-06 07:21:28 +00:00
|
|
|
~CCollisionActor();
|
|
|
|
void Accept(IVisitor& visitor);
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr);
|
2022-11-26 04:02:24 +00:00
|
|
|
|
|
|
|
// CActor
|
2023-02-06 07:21:28 +00:00
|
|
|
CHealthInfo* HealthInfo(CStateManager&);
|
|
|
|
const CDamageVulnerability* GetDamageVulnerability() const;
|
2022-11-26 04:02:24 +00:00
|
|
|
const CDamageVulnerability* GetDamageVulnerability(const CVector3f&, const CVector3f&,
|
2023-02-06 07:21:28 +00:00
|
|
|
const CDamageInfo&) const;
|
|
|
|
rstl::optional_object< CAABox > GetTouchBounds() const;
|
|
|
|
void Touch(CActor&, CStateManager&);
|
|
|
|
CVector3f GetOrbitPosition(const CStateManager&) const;
|
|
|
|
CVector3f GetScanObjectIndicatorPosition(const CStateManager&) const;
|
2022-11-26 04:02:24 +00:00
|
|
|
EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&,
|
|
|
|
const CWeaponMode&,
|
2023-02-06 07:21:28 +00:00
|
|
|
int /*EProjectileAttrib?*/) const;
|
|
|
|
void OnScanStateChange(EScanState, CStateManager&);
|
2022-11-26 04:02:24 +00:00
|
|
|
|
|
|
|
// CPhysicsActor
|
2023-02-06 07:21:28 +00:00
|
|
|
CTransform4f GetPrimitiveTransform() const;
|
2022-09-21 05:18:07 +00:00
|
|
|
|
|
|
|
private:
|
2022-11-26 04:02:24 +00:00
|
|
|
EPrimitiveType x258_primitiveType;
|
|
|
|
TUniqueId x25c_owner;
|
|
|
|
CVector3f x260_boxSize;
|
|
|
|
CVector3f x26c_center;
|
|
|
|
rstl::single_ptr< CCollidableOBBTreeGroupContainer > x278_obbContainer;
|
|
|
|
rstl::single_ptr< CCollidableOBBTreeGroup > x27c_obbTreeGroupPrimitive;
|
|
|
|
rstl::single_ptr< CCollidableAABox > x280_aaboxPrimitive;
|
|
|
|
rstl::single_ptr< CCollidableSphere > x284_spherePrimitive;
|
|
|
|
float x288_sphereRadius;
|
|
|
|
CHealthInfo x28c_healthInfo;
|
|
|
|
CDamageVulnerability x294_damageVuln;
|
|
|
|
TUniqueId x2fc_lastTouched;
|
|
|
|
EWeaponCollisionResponseTypes x300_responseType;
|
|
|
|
CVector3f x304_extendedTouchBounds;
|
2022-09-21 05:18:07 +00:00
|
|
|
};
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CCOLLISIONACTOR
|