2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2017-08-08 15:12:14 -07:00
|
|
|
|
2019-09-23 12:00:23 -07:00
|
|
|
#include <optional>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/World/CActor.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CAABox.hpp>
|
2017-08-08 15:12:14 -07:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2018-12-07 21:30:43 -08:00
|
|
|
class CScriptSpiderBallWaypoint : public CActor {
|
|
|
|
enum class ECheckActiveWaypoint { Check, SkipCheck };
|
|
|
|
u32 xe8_;
|
|
|
|
std::vector<TUniqueId> xec_waypoints;
|
2019-06-11 19:05:17 -07:00
|
|
|
std::optional<zeus::CAABox> xfc_aabox;
|
2018-12-07 21:30:43 -08:00
|
|
|
|
2017-08-08 15:12:14 -07:00
|
|
|
public:
|
2021-05-26 07:00:57 -07:00
|
|
|
DEFINE_ENTITY
|
2018-12-07 21:30:43 -08:00
|
|
|
CScriptSpiderBallWaypoint(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, bool, u32);
|
2019-08-09 05:45:18 -07:00
|
|
|
void Accept(IVisitor&) override;
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
2020-04-09 10:28:20 -07:00
|
|
|
void Render(CStateManager& mgr) override { CActor::Render(mgr); }
|
2020-04-05 04:54:02 -07:00
|
|
|
void AddToRenderer(const zeus::CFrustum&, CStateManager&) override {}
|
2019-08-09 05:45:18 -07:00
|
|
|
std::optional<zeus::CAABox> GetTouchBounds() const override { return xfc_aabox; }
|
2018-12-07 21:30:43 -08:00
|
|
|
void AccumulateBounds(const zeus::CVector3f& v);
|
|
|
|
void BuildWaypointListAndBounds(CStateManager& mgr);
|
|
|
|
void AddPreviousWaypoint(TUniqueId uid);
|
|
|
|
TUniqueId PreviousWaypoint(const CStateManager& mgr, ECheckActiveWaypoint checkActive) const;
|
|
|
|
TUniqueId NextWaypoint(const CStateManager& mgr, ECheckActiveWaypoint checkActive) const;
|
|
|
|
void GetClosestPointAlongWaypoints(CStateManager& mgr, const zeus::CVector3f& ballPos, float maxPointToBallDist,
|
|
|
|
const CScriptSpiderBallWaypoint*& closestWaypoint, zeus::CVector3f& closestPoint,
|
|
|
|
zeus::CVector3f& deltaBetweenPoints, float deltaBetweenInterpDist,
|
|
|
|
zeus::CVector3f& interpDeltaBetweenPoints) const;
|
2021-04-18 20:11:18 -07:00
|
|
|
void ClearWaypoints() {
|
|
|
|
xfc_aabox.reset();
|
|
|
|
xec_waypoints.clear();
|
|
|
|
}
|
2017-08-08 15:12:14 -07:00
|
|
|
};
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|