metaforce/Runtime/World/CScriptPointOfInterest.cpp

56 lines
1.7 KiB
C++
Raw Normal View History

#include "CScriptPointOfInterest.hpp"
#include "CActorParameters.hpp"
#include "CStateManager.hpp"
#include "CPlayerState.hpp"
2017-01-15 03:07:01 +00:00
#include "TCastTo.hpp"
namespace urde
{
2017-11-13 06:19:18 +00:00
CScriptPointOfInterest::CScriptPointOfInterest(TUniqueId uid, std::string_view name, const CEntityInfo info,
const zeus::CTransform& xf, bool active,
const CScannableParameters& parms, float f1)
2016-12-29 21:38:59 +00:00
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(u64(EMaterialTypes::Orbit)),
CActorParameters::None().Scannable(parms), kInvalidUniqueId)
, xe8_pointSize(f1)
{
}
2017-01-15 03:07:01 +00:00
void CScriptPointOfInterest::Accept(IVisitor& visitor)
{
visitor.Visit(this);
}
void CScriptPointOfInterest::Think(float dt, CStateManager& mgr)
{
2017-07-30 01:06:06 +00:00
xe7_31_targetable = mgr.GetPlayerState()->GetCurrentVisor() == CPlayerState::EPlayerVisor::Scan;
CEntity::Think(dt, mgr);
}
void CScriptPointOfInterest::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr)
{
CActor::AcceptScriptMsg(msg, uid, mgr);
}
void CScriptPointOfInterest::AddToRenderer(const zeus::CFrustum&, const CStateManager&) const
{
}
void CScriptPointOfInterest::Render(const CStateManager&) const
{
}
void CScriptPointOfInterest::CalculateRenderBounds()
{
if (xe8_pointSize == 0.f)
CActor::CalculateRenderBounds();
else
2017-08-10 07:05:27 +00:00
x9c_renderBounds = zeus::CAABox(x34_transform.origin - xe8_pointSize, x34_transform.origin + xe8_pointSize);
}
std::experimental::optional<zeus::CAABox> CScriptPointOfInterest::GetTouchBounds() const
{
return {zeus::CAABox{x34_transform.origin, x34_transform.origin}};
}
}