Initial CCollisionActorManager imp

This commit is contained in:
Phillip Stephens 2017-03-25 21:12:06 -07:00
parent db12dd2ea2
commit 01d7f42524
7 changed files with 41 additions and 5 deletions

View File

@ -1,4 +1,8 @@
#include "CCollisionActorManager.hpp"
#include "TCastTo.hpp"
#include "World/CActor.hpp"
#include "CStateManager.hpp"
#include "CMaterialList.hpp"
namespace urde
{
@ -8,6 +12,22 @@ CCollisionActorManager::CCollisionActorManager(CStateManager&, TUniqueId, TAreaI
{
}
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();

View File

@ -7,6 +7,7 @@
namespace urde
{
class CMaterialList;
class CAnimData;
class CCollisionActor;
class CStateManager;
@ -27,6 +28,7 @@ public:
void Update(float, CStateManager&, EUpdateOptions) const;
void Destroy(CStateManager&) const;
void SetActive(CStateManager&, bool);
void AddMaterial(CStateManager&, const CMaterialList&);
u32 GetNumCollisionActors() const;
CJointCollisionDescription GetCollisionDescFromIndex(u32) const;

View File

@ -8,4 +8,6 @@ CJointCollisionDescription::CJointCollisionDescription(ECollisionType, CSegId, C
const std::string&, float)
{
}
}

View File

@ -27,14 +27,15 @@ private:
zeus::CVector3f x18_;
float x24_;
float x28_;
std::string x2c_;
TUniqueId x3c_;
std::string x2c_name;
TUniqueId x3c_actorId;
float x40_;
public:
CJointCollisionDescription(ECollisionType, CSegId, CSegId, const zeus::CVector3f&, const zeus::CVector3f&, float,
float, EOrientationType, const std::string&, float);
const std::string& GetName() const;
void GetCollisionActorId() const;
const std::string& GetName() const { return x2c_name; }
TUniqueId GetCollisionActorId() const { return x3c_actorId; }
void SphereSubdivideCollision(ECollisionType, CSegId, CSegId, float, float, EOrientationType, const std::string&,
float);
void SphereCollision(CSegId, float, const std::string&, float);

View File

@ -109,6 +109,11 @@ public:
x0_list |= (1ull << u32(type));
}
void Add(const CMaterialList& l)
{
x0_list |= l.x0_list;
}
void Remove(EMaterialTypes type)
{
x0_list &= ~(1ull << u32(type));

View File

@ -215,6 +215,11 @@ void CActor::AddMaterial(EMaterialTypes type, CStateManager& mgr)
mgr.UpdateObjectInLists(*this);
}
void CActor::AddMaterial(const CMaterialList& l)
{
x68_material.Add(l);
}
void CActor::CreateShadow(bool b)
{
if (b)

View File

@ -133,6 +133,7 @@ public:
void AddMaterial(EMaterialTypes, EMaterialTypes, EMaterialTypes, CStateManager&);
void AddMaterial(EMaterialTypes, EMaterialTypes, CStateManager&);
void AddMaterial(EMaterialTypes, CStateManager&);
void AddMaterial(const CMaterialList& l);
void CreateShadow(bool);
void SetCallTouch(bool callTouch);