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;
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;
bool x2a_populated = false;
SNode() = default;

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,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;

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);