metaforce/Runtime/World/CScriptPointOfInterest.cpp

45 lines
1.7 KiB
C++
Raw Normal View History

#include "Runtime/World/CScriptPointOfInterest.hpp"
#include "Runtime/CPlayerState.hpp"
#include "Runtime/CStateManager.hpp"
#include "Runtime/World/CActorParameters.hpp"
#include "TCastTo.hpp" // Generated file, do not modify include path
2021-04-10 01:42:06 -07:00
namespace metaforce {
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 13:38:59 -08:00
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(u64(EMaterialTypes::Orbit)),
CActorParameters::None().Scannable(parms), kInvalidUniqueId)
2018-12-07 21:30:43 -08:00
, xe8_pointSize(f1) {}
2018-12-07 21:30:43 -08:00
void CScriptPointOfInterest::Accept(IVisitor& visitor) { visitor.Visit(this); }
2017-01-14 19:07:01 -08:00
2018-12-07 21:30:43 -08:00
void CScriptPointOfInterest::Think(float dt, CStateManager& mgr) {
xe7_31_targetable = mgr.GetPlayerState()->GetCurrentVisor() == CPlayerState::EPlayerVisor::Scan;
CEntity::Think(dt, mgr);
}
2018-12-07 21:30:43 -08:00
void CScriptPointOfInterest::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
CActor::AcceptScriptMsg(msg, uid, mgr);
}
void CScriptPointOfInterest::AddToRenderer(const zeus::CFrustum&, CStateManager&) {}
void CScriptPointOfInterest::Render(CStateManager&) {}
2018-12-07 21:30:43 -08:00
void CScriptPointOfInterest::CalculateRenderBounds() {
if (xe8_pointSize == 0.f) {
2018-12-07 21:30:43 -08:00
CActor::CalculateRenderBounds();
} else {
2018-12-07 21:30:43 -08:00
x9c_renderBounds = zeus::CAABox(x34_transform.origin - xe8_pointSize, x34_transform.origin + xe8_pointSize);
}
}
std::optional<zeus::CAABox> CScriptPointOfInterest::GetTouchBounds() const {
2018-12-07 21:30:43 -08:00
return {zeus::CAABox{x34_transform.origin, x34_transform.origin}};
}
2021-04-10 01:42:06 -07:00
} // namespace metaforce