mirror of https://github.com/AxioDL/metaforce.git
CCollisionActor: Provide parameter names in interface where applicable
Makes the interface more self-documenting at a glance and allows IDEs to do better parameter inspection at call sites.
This commit is contained in:
parent
e8f0d29a3b
commit
f323638fb7
|
@ -13,13 +13,13 @@ constexpr CMaterialList skDefaultCollisionActorMaterials =
|
||||||
CMaterialList(EMaterialTypes::Solid, EMaterialTypes::CollisionActor, EMaterialTypes::ScanPassthrough,
|
CMaterialList(EMaterialTypes::Solid, EMaterialTypes::CollisionActor, EMaterialTypes::ScanPassthrough,
|
||||||
EMaterialTypes::CameraPassthrough);
|
EMaterialTypes::CameraPassthrough);
|
||||||
|
|
||||||
CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, const zeus::CVector3f& extent,
|
CCollisionActor::CCollisionActor(TUniqueId uid, TAreaId areaId, TUniqueId owner, const zeus::CVector3f& extent,
|
||||||
const zeus::CVector3f& center, bool active, float mass, std::string_view name)
|
const zeus::CVector3f& center, bool active, float mass, std::string_view name)
|
||||||
: CPhysicsActor(uid1, active, "CollisionActor", CEntityInfo(aId, CEntity::NullConnectionList),
|
: CPhysicsActor(uid, active, "CollisionActor", CEntityInfo(areaId, CEntity::NullConnectionList),
|
||||||
zeus::CTransform(), CModelData::CModelDataNull(), skDefaultCollisionActorMaterials,
|
zeus::CTransform(), CModelData::CModelDataNull(), skDefaultCollisionActorMaterials,
|
||||||
zeus::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
|
zeus::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
|
||||||
, x258_primitiveType(EPrimitiveType::OBBTreeGroup)
|
, x258_primitiveType(EPrimitiveType::OBBTreeGroup)
|
||||||
, x25c_owner(uid2)
|
, x25c_owner(owner)
|
||||||
, x260_boxSize(extent)
|
, x260_boxSize(extent)
|
||||||
, x26c_center(center)
|
, x26c_center(center)
|
||||||
, x278_obbContainer(std::make_unique<CCollidableOBBTreeGroupContainer>(extent, center))
|
, x278_obbContainer(std::make_unique<CCollidableOBBTreeGroupContainer>(extent, center))
|
||||||
|
@ -32,13 +32,13 @@ CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, co
|
||||||
{EMaterialTypes::Solid}, {EMaterialTypes::CollisionActor, EMaterialTypes::NoStaticCollision}));
|
{EMaterialTypes::Solid}, {EMaterialTypes::CollisionActor, EMaterialTypes::NoStaticCollision}));
|
||||||
}
|
}
|
||||||
|
|
||||||
CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, const zeus::CVector3f& boxSize,
|
CCollisionActor::CCollisionActor(TUniqueId uid, TAreaId areaId, TUniqueId owner, const zeus::CVector3f& boxSize,
|
||||||
bool active, float mass, std::string_view name)
|
bool active, float mass, std::string_view name)
|
||||||
: CPhysicsActor(uid1, active, "CollisionActor", CEntityInfo(aId, CEntity::NullConnectionList),
|
: CPhysicsActor(uid, active, "CollisionActor", CEntityInfo(areaId, CEntity::NullConnectionList),
|
||||||
zeus::CTransform(), CModelData::CModelDataNull(), skDefaultCollisionActorMaterials,
|
zeus::CTransform(), CModelData::CModelDataNull(), skDefaultCollisionActorMaterials,
|
||||||
zeus::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
|
zeus::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
|
||||||
, x258_primitiveType(EPrimitiveType::AABox)
|
, x258_primitiveType(EPrimitiveType::AABox)
|
||||||
, x25c_owner(uid2)
|
, x25c_owner(owner)
|
||||||
, x260_boxSize(boxSize)
|
, x260_boxSize(boxSize)
|
||||||
, x280_aaboxPrimitive(
|
, x280_aaboxPrimitive(
|
||||||
std::make_unique<CCollidableAABox>(zeus::CAABox(-0.5f * boxSize, 0.5f * boxSize),
|
std::make_unique<CCollidableAABox>(zeus::CAABox(-0.5f * boxSize, 0.5f * boxSize),
|
||||||
|
@ -51,13 +51,13 @@ CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, co
|
||||||
{EMaterialTypes::Solid}, {EMaterialTypes::CollisionActor, EMaterialTypes::NoStaticCollision}));
|
{EMaterialTypes::Solid}, {EMaterialTypes::CollisionActor, EMaterialTypes::NoStaticCollision}));
|
||||||
}
|
}
|
||||||
|
|
||||||
CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, bool active, float radius, float mass,
|
CCollisionActor::CCollisionActor(TUniqueId uid, TAreaId areaId, TUniqueId owner, bool active, float radius, float mass,
|
||||||
std::string_view name)
|
std::string_view name)
|
||||||
: CPhysicsActor(uid1, active, "CollisionActor", CEntityInfo(aId, CEntity::NullConnectionList),
|
: CPhysicsActor(uid, active, "CollisionActor", CEntityInfo(areaId, CEntity::NullConnectionList),
|
||||||
zeus::CTransform(), CModelData::CModelDataNull(), skDefaultCollisionActorMaterials,
|
zeus::CTransform(), CModelData::CModelDataNull(), skDefaultCollisionActorMaterials,
|
||||||
zeus::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
|
zeus::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
|
||||||
, x258_primitiveType(EPrimitiveType::Sphere)
|
, x258_primitiveType(EPrimitiveType::Sphere)
|
||||||
, x25c_owner(uid2)
|
, x25c_owner(owner)
|
||||||
, x284_spherePrimitive(std::make_unique<CCollidableSphere>(
|
, x284_spherePrimitive(std::make_unique<CCollidableSphere>(
|
||||||
zeus::CSphere(zeus::skZero3f, radius), CMaterialList(EMaterialTypes::NoStaticCollision, EMaterialTypes::Solid)))
|
zeus::CSphere(zeus::skZero3f, radius), CMaterialList(EMaterialTypes::NoStaticCollision, EMaterialTypes::Solid)))
|
||||||
, x288_sphereRadius(radius) {
|
, x288_sphereRadius(radius) {
|
||||||
|
@ -71,7 +71,7 @@ CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, bo
|
||||||
|
|
||||||
void CCollisionActor::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
void CCollisionActor::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
||||||
|
|
||||||
void CCollisionActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
|
void CCollisionActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr) {
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
case EScriptObjectMessage::Falling:
|
case EScriptObjectMessage::Falling:
|
||||||
case EScriptObjectMessage::Registered:
|
case EScriptObjectMessage::Registered:
|
||||||
|
@ -82,7 +82,7 @@ void CCollisionActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, C
|
||||||
case EScriptObjectMessage::Damage:
|
case EScriptObjectMessage::Damage:
|
||||||
case EScriptObjectMessage::InvulnDamage: {
|
case EScriptObjectMessage::InvulnDamage: {
|
||||||
if (CEntity* ent = mgr.ObjectById(x25c_owner)) {
|
if (CEntity* ent = mgr.ObjectById(x25c_owner)) {
|
||||||
x2fc_lastTouched = uid;
|
x2fc_lastTouched = sender;
|
||||||
mgr.SendScriptMsg(ent, GetUniqueId(), msg);
|
mgr.SendScriptMsg(ent, GetUniqueId(), msg);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
@ -91,7 +91,7 @@ void CCollisionActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, C
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
CActor::AcceptScriptMsg(msg, uid, mgr);
|
CActor::AcceptScriptMsg(msg, sender, mgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHealthInfo* CCollisionActor::HealthInfo(CStateManager&) { return &x28c_healthInfo; }
|
CHealthInfo* CCollisionActor::HealthInfo(CStateManager&) { return &x28c_healthInfo; }
|
||||||
|
@ -157,7 +157,7 @@ std::optional<zeus::CAABox> CCollisionActor::GetTouchBounds() const {
|
||||||
return aabox;
|
return aabox;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCollisionActor::OnScanStateChanged(CActor::EScanState state, CStateManager& mgr) {
|
void CCollisionActor::OnScanStateChanged(EScanState state, CStateManager& mgr) {
|
||||||
TCastToPtr<CActor> actor = mgr.ObjectById(x25c_owner);
|
TCastToPtr<CActor> actor = mgr.ObjectById(x25c_owner);
|
||||||
if (actor)
|
if (actor)
|
||||||
actor->OnScanStateChanged(state, mgr);
|
actor->OnScanStateChanged(state, mgr);
|
||||||
|
|
|
@ -33,24 +33,27 @@ class CCollisionActor : public CPhysicsActor {
|
||||||
zeus::CVector3f x304_extendedTouchBounds = zeus::skZero3f;
|
zeus::CVector3f x304_extendedTouchBounds = zeus::skZero3f;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CCollisionActor(TUniqueId, TAreaId, TUniqueId, const zeus::CVector3f&, const zeus::CVector3f&, bool, float,
|
CCollisionActor(TUniqueId uid, TAreaId areaId, TUniqueId owner, const zeus::CVector3f& extent,
|
||||||
|
const zeus::CVector3f& center, bool active, float mass, std::string_view name);
|
||||||
|
CCollisionActor(TUniqueId uid, TAreaId areaId, TUniqueId owner, const zeus::CVector3f& boxSize, bool active,
|
||||||
|
float mass, std::string_view name);
|
||||||
|
CCollisionActor(TUniqueId uid, TAreaId areaId, TUniqueId owner, bool active, float radius, float mass,
|
||||||
std::string_view name);
|
std::string_view name);
|
||||||
CCollisionActor(TUniqueId, TAreaId, TUniqueId, const zeus::CVector3f&, bool, float, std::string_view name);
|
|
||||||
CCollisionActor(TUniqueId, TAreaId, TUniqueId, bool, float, float, std::string_view name);
|
|
||||||
|
|
||||||
void Accept(IVisitor& visitor) override;
|
void Accept(IVisitor& visitor) override;
|
||||||
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr) override;
|
||||||
CHealthInfo* HealthInfo(CStateManager&) override;
|
CHealthInfo* HealthInfo(CStateManager& mgr) override;
|
||||||
const CDamageVulnerability* GetDamageVulnerability() const override;
|
const CDamageVulnerability* GetDamageVulnerability() const override;
|
||||||
const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f&, const zeus::CVector3f&,
|
const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f& vec1, const zeus::CVector3f& vec2,
|
||||||
const CDamageInfo&) const override;
|
const CDamageInfo& dInfo) const override;
|
||||||
void OnScanStateChanged(EScanState, CStateManager&) override;
|
void OnScanStateChanged(EScanState state, CStateManager& mgr) override;
|
||||||
|
|
||||||
void Touch(CActor&, CStateManager&) override;
|
void Touch(CActor& actor, CStateManager& mgr) override;
|
||||||
zeus::CVector3f GetOrbitPosition(const CStateManager&) const override;
|
zeus::CVector3f GetOrbitPosition(const CStateManager& mgr) const override;
|
||||||
const CCollisionPrimitive* GetCollisionPrimitive() const override;
|
const CCollisionPrimitive* GetCollisionPrimitive() const override;
|
||||||
EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&,
|
EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f& vec1, const zeus::CVector3f& vec2,
|
||||||
const CWeaponMode&, EProjectileAttrib) const override;
|
const CWeaponMode& mode,
|
||||||
|
EProjectileAttrib attribute) const override;
|
||||||
void SetWeaponCollisionResponseType(EWeaponCollisionResponseTypes type) { x300_responseType = type; }
|
void SetWeaponCollisionResponseType(EWeaponCollisionResponseTypes type) { x300_responseType = type; }
|
||||||
zeus::CTransform GetPrimitiveTransform() const override;
|
zeus::CTransform GetPrimitiveTransform() const override;
|
||||||
std::optional<zeus::CAABox> GetTouchBounds() const override;
|
std::optional<zeus::CAABox> GetTouchBounds() const override;
|
||||||
|
@ -58,7 +61,7 @@ public:
|
||||||
const zeus::CVector3f& GetBoxSize() const { return x260_boxSize; }
|
const zeus::CVector3f& GetBoxSize() const { return x260_boxSize; }
|
||||||
TUniqueId GetOwnerId() const { return x25c_owner; }
|
TUniqueId GetOwnerId() const { return x25c_owner; }
|
||||||
TUniqueId GetLastTouchedObject() const { return x2fc_lastTouched; }
|
TUniqueId GetLastTouchedObject() const { return x2fc_lastTouched; }
|
||||||
zeus::CVector3f GetScanObjectIndicatorPosition(const CStateManager&) const override;
|
zeus::CVector3f GetScanObjectIndicatorPosition(const CStateManager& mgr) const override;
|
||||||
void SetExtendedTouchBounds(const zeus::CVector3f& boundExt) { x304_extendedTouchBounds = boundExt; }
|
void SetExtendedTouchBounds(const zeus::CVector3f& boundExt) { x304_extendedTouchBounds = boundExt; }
|
||||||
void SetSphereRadius(float radius);
|
void SetSphereRadius(float radius);
|
||||||
float GetSphereRadius() const { return x288_sphereRadius; }
|
float GetSphereRadius() const { return x288_sphereRadius; }
|
||||||
|
|
Loading…
Reference in New Issue