diff --git a/Runtime/Collision/CCollisionActorManager.cpp b/Runtime/Collision/CCollisionActorManager.cpp index 63316d683..e31af3e69 100644 --- a/Runtime/Collision/CCollisionActorManager.cpp +++ b/Runtime/Collision/CCollisionActorManager.cpp @@ -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 act(mgr.ObjectById(jDesc.GetCollisionActorId())); + + if (act) + act->AddMaterial(list); + } +} + u32 CCollisionActorManager::GetNumCollisionActors() const { return x0_jointDescriptions.size(); diff --git a/Runtime/Collision/CCollisionActorManager.hpp b/Runtime/Collision/CCollisionActorManager.hpp index 056f5a0a7..2e2d34473 100644 --- a/Runtime/Collision/CCollisionActorManager.hpp +++ b/Runtime/Collision/CCollisionActorManager.hpp @@ -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; diff --git a/Runtime/Collision/CJointCollisionDescription.cpp b/Runtime/Collision/CJointCollisionDescription.cpp index 36fe9fe77..536c669b7 100644 --- a/Runtime/Collision/CJointCollisionDescription.cpp +++ b/Runtime/Collision/CJointCollisionDescription.cpp @@ -8,4 +8,6 @@ CJointCollisionDescription::CJointCollisionDescription(ECollisionType, CSegId, C const std::string&, float) { } + + } diff --git a/Runtime/Collision/CJointCollisionDescription.hpp b/Runtime/Collision/CJointCollisionDescription.hpp index eb20f6a0a..bcf8d8383 100644 --- a/Runtime/Collision/CJointCollisionDescription.hpp +++ b/Runtime/Collision/CJointCollisionDescription.hpp @@ -27,18 +27,19 @@ 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); - void AABoxCollision(CSegId, zeus::CVector3f const &, const std::string&, float); + void AABoxCollision(CSegId, zeus::CVector3f const&, const std::string&, float); void OBBAutoSizeCollision(CSegId, CSegId, const zeus::CVector3f&, EOrientationType, const std::string&, float); void OBBCollision(CSegId, const zeus::CVector3f&, const zeus::CVector3f&, const std::string&, float); zeus::CVector3f GetPivotPoint() const; diff --git a/Runtime/Collision/CMaterialList.hpp b/Runtime/Collision/CMaterialList.hpp index 32069a195..bec7210f4 100644 --- a/Runtime/Collision/CMaterialList.hpp +++ b/Runtime/Collision/CMaterialList.hpp @@ -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)); diff --git a/Runtime/World/CActor.cpp b/Runtime/World/CActor.cpp index 27577ab05..0d6eaf1e4 100644 --- a/Runtime/World/CActor.cpp +++ b/Runtime/World/CActor.cpp @@ -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) diff --git a/Runtime/World/CActor.hpp b/Runtime/World/CActor.hpp index 707910d86..99b2a7cf0 100644 --- a/Runtime/World/CActor.hpp +++ b/Runtime/World/CActor.hpp @@ -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);