More collision actor work

This commit is contained in:
Phillip Stephens 2017-05-06 23:55:01 -07:00
parent b2d375a1d7
commit c852d63db2
6 changed files with 28 additions and 3 deletions

View File

@ -8,10 +8,19 @@ namespace urde
{
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)
{

View File

@ -21,7 +21,7 @@ public:
private:
std::vector<CJointCollisionDescription> x0_jointDescriptions;
TUniqueId x10_;
bool x13_ = false;
public:
CCollisionActorManager(CStateManager&, TUniqueId, TAreaId, const std::vector<CJointCollisionDescription>&, bool);

View File

@ -48,4 +48,12 @@ CJointCollisionDescription CJointCollisionDescription::OBBCollision(CSegId segId
return CJointCollisionDescription(ECollisionType::OBB, segId, -1, v1, v2, 0.f, 0.f, EOrientationType::Zero, name,
f1);
}
void CJointCollisionDescription::ScaleAllBounds(const zeus::CVector3f& scale)
{
xc_ *= scale;
x24_ *= scale.x;
x28_ *= scale.x;
x18_ *= scale;
}
}

View File

@ -52,7 +52,7 @@ public:
zeus::CVector3f GetPivotPoint() const;
float GetRadius() const;
void SetCollisionActorId(TUniqueId);
EOrientationType GetOrientationType() const;
EOrientationType GetOrientationType() const { return x4_orientType; }
float GetMass() const;
zeus::CAABox GetBounds() const;
void GetType() const;

View File

@ -1,4 +1,5 @@
#include "MP1/World/CActorContraption.hpp"
#include "TCastTo.hpp"
namespace urde
{
@ -12,4 +13,9 @@ MP1::CActorContraption::CActorContraption(TUniqueId uid, const std::string& name
0.f, false, false, false, false)
{
}
void MP1::CActorContraption::Accept(IVisitor& visitor)
{
visitor.Visit(this);
}
}

View File

@ -18,6 +18,8 @@ public:
CActorContraption(TUniqueId, const std::string&, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
const zeus::CAABox&, const CMaterialList&, float, float, const CHealthInfo&,
const CDamageVulnerability&, const CActorParameters&, ResId, const CDamageInfo&, bool);
void Accept(IVisitor &visitor);
};
}
}