metaforce/Runtime/World/CScriptDoor.hpp

61 lines
1.9 KiB
C++
Raw Normal View History

2016-04-19 21:25:26 +00:00
#ifndef __URDE_CSCRIPTDOOR_HPP__
#define __URDE_CSCRIPTDOOR_HPP__
#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;
float x25c_animTime;
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;
2016-04-23 00:29:55 +00:00
zeus::CVector3f x29c_;
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);
std::experimental::optional<zeus::CAABox> GetProjectileBounds() const;
bool IsOpen() const { return x2a8_26_isOpen; }
2016-04-19 21:25:26 +00:00
};
}
#endif // __URDE_CSCRIPTDOOR_HPP__