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 17:01:01 +00:00
|
|
|
~CCollisionActor() override;
|
|
|
|
void Accept(IVisitor& visitor) override;
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
|
2022-11-26 04:02:24 +00:00
|
|
|
|
|
|
|
// CActor
|
2023-02-06 17:01:01 +00:00
|
|
|
CHealthInfo* HealthInfo(CStateManager&) override;
|
|
|
|
const CDamageVulnerability* GetDamageVulnerability() const override;
|
2022-11-26 04:02:24 +00:00
|
|
|
const CDamageVulnerability* GetDamageVulnerability(const CVector3f&, const CVector3f&,
|
2023-02-06 17:01:01 +00:00
|
|
|
const CDamageInfo&) const override;
|
|
|
|
rstl::optional_object< CAABox > GetTouchBounds() const override;
|
|
|
|
void Touch(CActor&, CStateManager&) override;
|
|
|
|
CVector3f GetOrbitPosition(const CStateManager&) const override;
|
|
|
|
CVector3f GetScanObjectIndicatorPosition(const CStateManager&) const override;
|
2022-11-26 04:02:24 +00:00
|
|
|
EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&,
|
|
|
|
const CWeaponMode&,
|
2024-09-30 06:02:23 +00:00
|
|
|
int) const override;
|
2023-02-06 17:01:01 +00:00
|
|
|
void OnScanStateChange(EScanState, CStateManager&) override;
|
2022-11-26 04:02:24 +00:00
|
|
|
|
|
|
|
// CPhysicsActor
|
2023-02-06 17:01:01 +00:00
|
|
|
CTransform4f GetPrimitiveTransform() const override;
|
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
|