mirror of https://github.com/AxioDL/metaforce.git
More collision actor work
This commit is contained in:
parent
b2d375a1d7
commit
c852d63db2
|
@ -8,10 +8,19 @@ namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
CCollisionActorManager::CCollisionActorManager(CStateManager&, TUniqueId, TAreaId,
|
CCollisionActorManager::CCollisionActorManager(CStateManager&, TUniqueId, TAreaId,
|
||||||
const std::vector<CJointCollisionDescription>&, bool)
|
const std::vector<CJointCollisionDescription>& descs, bool)
|
||||||
|
: x0_jointDescriptions(descs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCollisionActorManager::Destroy(CStateManager& mgr) const
|
||||||
|
{
|
||||||
|
for (const CJointCollisionDescription& desc : x0_jointDescriptions)
|
||||||
|
mgr.DeleteObjectRequest(desc.GetCollisionActorId());
|
||||||
|
|
||||||
|
const_cast<CCollisionActorManager&>(*this).x13_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
void CCollisionActorManager::SetActive(CStateManager&, bool)
|
void CCollisionActorManager::SetActive(CStateManager&, bool)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ public:
|
||||||
private:
|
private:
|
||||||
std::vector<CJointCollisionDescription> x0_jointDescriptions;
|
std::vector<CJointCollisionDescription> x0_jointDescriptions;
|
||||||
TUniqueId x10_;
|
TUniqueId x10_;
|
||||||
|
bool x13_ = false;
|
||||||
public:
|
public:
|
||||||
CCollisionActorManager(CStateManager&, TUniqueId, TAreaId, const std::vector<CJointCollisionDescription>&, bool);
|
CCollisionActorManager(CStateManager&, TUniqueId, TAreaId, const std::vector<CJointCollisionDescription>&, bool);
|
||||||
|
|
||||||
|
|
|
@ -48,4 +48,12 @@ CJointCollisionDescription CJointCollisionDescription::OBBCollision(CSegId segId
|
||||||
return CJointCollisionDescription(ECollisionType::OBB, segId, -1, v1, v2, 0.f, 0.f, EOrientationType::Zero, name,
|
return CJointCollisionDescription(ECollisionType::OBB, segId, -1, v1, v2, 0.f, 0.f, EOrientationType::Zero, name,
|
||||||
f1);
|
f1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CJointCollisionDescription::ScaleAllBounds(const zeus::CVector3f& scale)
|
||||||
|
{
|
||||||
|
xc_ *= scale;
|
||||||
|
x24_ *= scale.x;
|
||||||
|
x28_ *= scale.x;
|
||||||
|
x18_ *= scale;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ public:
|
||||||
zeus::CVector3f GetPivotPoint() const;
|
zeus::CVector3f GetPivotPoint() const;
|
||||||
float GetRadius() const;
|
float GetRadius() const;
|
||||||
void SetCollisionActorId(TUniqueId);
|
void SetCollisionActorId(TUniqueId);
|
||||||
EOrientationType GetOrientationType() const;
|
EOrientationType GetOrientationType() const { return x4_orientType; }
|
||||||
float GetMass() const;
|
float GetMass() const;
|
||||||
zeus::CAABox GetBounds() const;
|
zeus::CAABox GetBounds() const;
|
||||||
void GetType() const;
|
void GetType() const;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "MP1/World/CActorContraption.hpp"
|
#include "MP1/World/CActorContraption.hpp"
|
||||||
|
#include "TCastTo.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
@ -12,4 +13,9 @@ MP1::CActorContraption::CActorContraption(TUniqueId uid, const std::string& name
|
||||||
0.f, false, false, false, false)
|
0.f, false, false, false, false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MP1::CActorContraption::Accept(IVisitor& visitor)
|
||||||
|
{
|
||||||
|
visitor.Visit(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@ public:
|
||||||
CActorContraption(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
|
CActorContraption(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
|
||||||
const zeus::CAABox&, const CMaterialList&, float, float, const CHealthInfo&,
|
const zeus::CAABox&, const CMaterialList&, float, float, const CHealthInfo&,
|
||||||
const CDamageVulnerability&, const CActorParameters&, ResId, const CDamageInfo&, bool);
|
const CDamageVulnerability&, const CActorParameters&, ResId, const CDamageInfo&, bool);
|
||||||
|
|
||||||
|
void Accept(IVisitor &visitor);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue