mirror of https://github.com/AxioDL/metaforce.git
Initial CCollisionActorManager imp
This commit is contained in:
parent
db12dd2ea2
commit
01d7f42524
|
@ -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();
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -8,4 +8,6 @@ CJointCollisionDescription::CJointCollisionDescription(ECollisionType, CSegId, C
|
||||||
const std::string&, float)
|
const std::string&, float)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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));
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue