metaforce/Runtime/World/CScriptDoor.hpp

60 lines
1.9 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2016-04-19 21:25:26 +00:00
#include "CPhysicsActor.hpp"
namespace urde
{
class CScriptDoor : public CPhysicsActor
{
2016-04-22 20:22:45 +00:00
public:
enum class EDoorAnimType
{
2016-04-23 18:04:49 +00:00
Open,
Close,
Ready,
2016-04-22 20:22:45 +00:00
};
float x258_animLen;
2018-05-22 07:51:08 +00:00
float x25c_animTime = 0.f;
2016-04-23 18:04:49 +00:00
EDoorAnimType x260_doorState = EDoorAnimType::Open;
2016-04-22 20:22:45 +00:00
zeus::CAABox x264_;
TUniqueId x27c_partner1 = kInvalidUniqueId;
TUniqueId x27e_partner2 = kInvalidUniqueId;
TUniqueId x280_prevDoor = kInvalidUniqueId;
2016-04-23 00:29:55 +00:00
TUniqueId x282_dockId = kInvalidUniqueId;
2016-04-23 18:04:49 +00:00
zeus::CAABox x284_modelBounds;
2018-05-22 07:51:08 +00:00
zeus::CVector3f x29c_orbitPos;
2016-04-22 20:22:45 +00:00
bool x2a8_24_closing : 1;
bool x2a8_25_wasOpen : 1;
bool x2a8_26_isOpen : 1;
bool x2a8_27_conditionsMet : 1;
bool x2a8_28_projectilesCollide : 1;
bool x2a8_29_ballDoor : 1;
bool x2a8_30_doClose : 1;
2016-04-19 21:25:26 +00:00
public:
2017-11-13 06:19:18 +00:00
CScriptDoor(TUniqueId, std::string_view name, const CEntityInfo& info,
2016-04-22 20:22:45 +00:00
const zeus::CTransform&, CModelData&&, const CActorParameters&,
2016-04-19 21:25:26 +00:00
const zeus::CVector3f&, const zeus::CAABox&,
2016-12-29 21:38:59 +00:00
bool active, bool open, bool, float, bool ballDoor);
2016-04-22 20:22:45 +00:00
2016-04-23 00:29:55 +00:00
zeus::CVector3f GetOrbitPosition(const CStateManager& mgr) const;
2017-01-15 03:07:01 +00:00
void Accept(IVisitor& visitor);
2016-04-23 00:29:55 +00:00
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr);
2016-04-24 02:46:13 +00:00
void Think(float, CStateManager& mgr);
void AddToRenderer(const zeus::CFrustum&, const CStateManager& mgr) const;
void Render(const CStateManager&) const {}
2016-04-22 20:22:45 +00:00
void ForceClosed(CStateManager&);
2016-04-23 00:29:55 +00:00
bool IsConnectedToArea(const CStateManager& mgr, TAreaId area);
2016-04-22 20:22:45 +00:00
void OpenDoor(TUniqueId, CStateManager&);
2016-04-23 00:29:55 +00:00
u32 GetDoorOpenCondition(CStateManager& mgr);
2016-04-22 20:22:45 +00:00
void SetDoorAnimation(EDoorAnimType);
2018-06-28 06:47:34 +00:00
std::experimental::optional<zeus::CAABox> GetTouchBounds() const;
std::experimental::optional<zeus::CAABox> GetProjectileBounds() const;
bool IsOpen() const { return x2a8_26_isOpen; }
2016-04-19 21:25:26 +00:00
};
}