metaforce/Runtime/Collision/CCollisionActorManager.hpp

40 lines
1.4 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2017-03-01 03:42:06 +00:00
#include "RetroTypes.hpp"
#include "zeus/CAABox.hpp"
#include "Collision/CJointCollisionDescription.hpp"
2018-12-08 05:30:43 +00:00
namespace urde {
2017-03-26 04:12:06 +00:00
class CMaterialList;
2017-03-01 03:42:06 +00:00
class CAnimData;
class CCollisionActor;
class CStateManager;
2018-12-08 05:30:43 +00:00
class CCollisionActorManager {
2017-03-01 03:42:06 +00:00
public:
2018-12-08 05:30:43 +00:00
enum class EUpdateOptions { ObjectSpace, WorldSpace };
2017-03-01 03:42:06 +00:00
private:
2018-12-08 05:30:43 +00:00
std::vector<CJointCollisionDescription> x0_jointDescriptions;
TUniqueId x10_ownerId;
bool x12_active;
bool x13_destroyed = false;
bool x14_movable = true;
2017-03-01 03:42:06 +00:00
2018-12-08 05:30:43 +00:00
public:
CCollisionActorManager(CStateManager& mgr, TUniqueId owner, TAreaId area,
const std::vector<CJointCollisionDescription>& descs, bool active);
2017-03-01 03:42:06 +00:00
2018-12-08 05:30:43 +00:00
void Update(float dt, CStateManager& mgr, CCollisionActorManager::EUpdateOptions opts);
void Destroy(CStateManager& mgr) const;
void SetActive(CStateManager& mgr, bool active);
void AddMaterial(CStateManager& mgr, const CMaterialList& list);
void SetMovable(CStateManager& mgr, bool movable);
2018-11-17 05:05:57 +00:00
2018-12-08 05:30:43 +00:00
u32 GetNumCollisionActors() const { return x0_jointDescriptions.size(); }
2019-01-29 08:28:35 +00:00
rstl::optional<zeus::CVector3f> GetDeviation(const CStateManager&, CSegId);
2018-12-08 05:30:43 +00:00
const CJointCollisionDescription& GetCollisionDescFromIndex(u32 i) const { return x0_jointDescriptions[i]; }
static zeus::CTransform GetWRLocatorTransform(const CAnimData& animData, CSegId id, const zeus::CTransform& worldXf,
const zeus::CTransform& localXf);
2017-03-01 03:42:06 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace urde