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);
|
2019-02-18 05:47:46 +00:00
|
|
|
bool GetActive() const { return x12_active; }
|
2018-12-08 05:30:43 +00:00
|
|
|
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-06-12 02:05:17 +00:00
|
|
|
std::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
|