metaforce/Runtime/Collision/CCollisionActorManager.cpp

51 lines
1.2 KiB
C++
Raw Normal View History

2017-03-01 03:42:06 +00:00
#include "CCollisionActorManager.hpp"
2017-03-26 04:12:06 +00:00
#include "TCastTo.hpp"
#include "World/CActor.hpp"
#include "CStateManager.hpp"
#include "CMaterialList.hpp"
2017-03-01 03:42:06 +00:00
namespace urde
{
CCollisionActorManager::CCollisionActorManager(CStateManager&, TUniqueId, TAreaId,
2017-05-07 06:55:01 +00:00
const std::vector<CJointCollisionDescription>& descs, bool)
: x0_jointDescriptions(descs)
2017-03-01 03:42:06 +00:00
{
}
2017-05-07 06:55:01 +00:00
void CCollisionActorManager::Destroy(CStateManager& mgr) const
{
for (const CJointCollisionDescription& desc : x0_jointDescriptions)
2017-06-04 01:01:09 +00:00
mgr.FreeScriptObject(desc.GetCollisionActorId());
2017-05-07 06:55:01 +00:00
const_cast<CCollisionActorManager&>(*this).x13_ = true;
}
2017-03-26 04:12:06 +00:00
void CCollisionActorManager::SetActive(CStateManager&, bool)
{
}
void CCollisionActorManager::AddMaterial(CStateManager& mgr, const CMaterialList& list)
{
for (const CJointCollisionDescription& jDesc : x0_jointDescriptions)
{
TCastToPtr<CActor> act(mgr.ObjectById(jDesc.GetCollisionActorId()));
if (act)
act->AddMaterial(list);
}
}
u32 CCollisionActorManager::GetNumCollisionActors() const
{
return x0_jointDescriptions.size();
}
CJointCollisionDescription CCollisionActorManager::GetCollisionDescFromIndex(u32 idx) const
{
return x0_jointDescriptions[idx];
}
2017-03-01 03:42:06 +00:00
}