2019-12-22 20:04:07 +00:00
|
|
|
#include "Runtime/World/CScriptGrapplePoint.hpp"
|
|
|
|
|
|
|
|
#include "Runtime/Character/CModelData.hpp"
|
|
|
|
#include "Runtime/Collision/CMaterialList.hpp"
|
|
|
|
#include "Runtime/World/CActorParameters.hpp"
|
|
|
|
|
2019-09-21 13:07:13 +00:00
|
|
|
#include "TCastTo.hpp" // Generated file, do not modify include path
|
2016-04-20 21:07:18 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2017-11-13 06:19:18 +00:00
|
|
|
CScriptGrapplePoint::CScriptGrapplePoint(TUniqueId uid, std::string_view name, const CEntityInfo& info,
|
2018-12-08 05:30:43 +00:00
|
|
|
const zeus::CTransform& transform, bool active,
|
|
|
|
const CGrappleParameters& params)
|
2018-06-21 00:57:57 +00:00
|
|
|
: CActor(uid, active, name, info, transform, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Orbit),
|
2018-12-08 05:30:43 +00:00
|
|
|
CActorParameters::None(), kInvalidUniqueId)
|
|
|
|
, xe8_touchBounds(x34_transform.origin - 0.5f, x34_transform.origin + 0.5f)
|
|
|
|
, x100_parameters(params) {}
|
|
|
|
|
|
|
|
void CScriptGrapplePoint::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
|
|
|
|
|
|
|
void CScriptGrapplePoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr) {
|
|
|
|
switch (msg) {
|
|
|
|
case EScriptObjectMessage::Activate:
|
|
|
|
if (!GetActive()) {
|
|
|
|
AddMaterial(EMaterialTypes::Orbit, mgr);
|
|
|
|
SetActive(true);
|
2018-06-21 00:57:57 +00:00
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
break;
|
|
|
|
case EScriptObjectMessage::Deactivate:
|
|
|
|
if (GetActive()) {
|
|
|
|
RemoveMaterial(EMaterialTypes::Orbit, mgr);
|
|
|
|
SetActive(false);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2018-06-21 00:57:57 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CScriptGrapplePoint::Think(float, CStateManager&) {
|
|
|
|
// Empty
|
2018-06-21 00:57:57 +00:00
|
|
|
}
|
|
|
|
|
2020-04-09 17:28:20 +00:00
|
|
|
void CScriptGrapplePoint::Render(CStateManager&) {
|
2018-12-08 05:30:43 +00:00
|
|
|
// Empty
|
2018-06-21 00:57:57 +00:00
|
|
|
}
|
|
|
|
|
2019-06-12 02:05:17 +00:00
|
|
|
std::optional<zeus::CAABox> CScriptGrapplePoint::GetTouchBounds() const { return {xe8_touchBounds}; }
|
2018-06-21 00:57:57 +00:00
|
|
|
|
2020-04-05 11:54:02 +00:00
|
|
|
void CScriptGrapplePoint::AddToRenderer(const zeus::CFrustum&, CStateManager& mgr) {
|
2018-12-08 05:30:43 +00:00
|
|
|
CActor::EnsureRendered(mgr);
|
2018-06-21 00:57:57 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|