This commit is contained in:
Jack Andersen 2017-03-25 19:53:42 -10:00
commit 6b8e2dde3c
8 changed files with 42 additions and 6 deletions

View File

@ -32,7 +32,7 @@ class CSortedListManager
{ {
const CActor* x0_actor = nullptr; const CActor* x0_actor = nullptr;
zeus::CAABox x4_box = zeus::CAABox::skNullBox; zeus::CAABox x4_box = zeus::CAABox::skNullBox;
u16 x1c_selfIdxs[6] = {-1, -1, -1, -1, -1, -1}; s16 x1c_selfIdxs[6] = {-1, -1, -1, -1, -1, -1};
TUniqueId x28_next = kInvalidUniqueId; TUniqueId x28_next = kInvalidUniqueId;
bool x2a_populated = false; bool x2a_populated = false;
SNode() = default; SNode() = default;

View File

@ -1,4 +1,8 @@
#include "CCollisionActorManager.hpp" #include "CCollisionActorManager.hpp"
#include "TCastTo.hpp"
#include "World/CActor.hpp"
#include "CStateManager.hpp"
#include "CMaterialList.hpp"
namespace urde 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 u32 CCollisionActorManager::GetNumCollisionActors() const
{ {
return x0_jointDescriptions.size(); return x0_jointDescriptions.size();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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