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-03-13 01:07:03 +00:00
|
|
|
|
2017-05-07 06:55:01 +00:00
|
|
|
void CCollisionActorManager::Destroy(CStateManager& mgr) const
|
|
|
|
{
|
|
|
|
for (const CJointCollisionDescription& desc : x0_jointDescriptions)
|
|
|
|
mgr.DeleteObjectRequest(desc.GetCollisionActorId());
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-13 01:07:03 +00:00
|
|
|
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
|
|
|
}
|