18 ChangingDirection = 2,
24 virtual void init(f32 t,
u32 idx) = 0;
25 virtual Status calc() = 0;
26 virtual void setCurrVel(f32 speed) = 0;
28 virtual f32 getCurrVel() = 0;
29 virtual void evalCubicBezierOnPath(f32 t,
EGG::Vector3f &currDir,
31 virtual void getPathLocation(f32 t, s16 &idx, f32 &len) = 0;
33 void setPerPointVelocities(
bool isSet) {
34 m_usePerPointVelocities = isSet;
42 [[nodiscard]]
const EGG::Vector3f &floorNrm(
size_t idx)
const;
43 [[nodiscard]] f32 railLength()
const;
46 ASSERT(
static_cast<size_t>(m_currPointIdx) < m_points.size());
47 return m_points[m_currPointIdx];
51 ASSERT(
static_cast<size_t>(m_nextPointIdx) < m_points.size());
52 return m_points[m_nextPointIdx];
55 [[nodiscard]] f32 speed()
const {
64 return m_curTangentDir;
67 [[nodiscard]]
bool isMovementDirectionForward()
const {
68 return m_movementDirectionForward;
71 [[nodiscard]] s16 curPointIdx()
const {
72 return m_currPointIdx;
75 [[nodiscard]] s16 nextPointIdx()
const {
76 return m_nextPointIdx;
81 void calcVelocities();
82 [[nodiscard]]
bool shouldChangeDirection()
const;
83 void calcDirectionChange();
84 void calcNextIndices();
88 std::span<System::MapdataPointInfo::Point> m_points;
91 bool m_usePerPointVelocities;
99 bool m_movementDirectionForward;
136 void init(f32 t,
u32 idx)
override;
137 Status calc()
override;
138 void setCurrVel(f32 speed)
override;
141 [[nodiscard]] f32 getCurrVel()
override {
147 void getPathLocation(f32 t, s16 &idx, f32 &len)
override;
155 [[nodiscard]] f32 calcT(f32 t)
const;
156 void calcNextSegment();
158 std::span<RailSplineTransition> m_transitions;
159 u32 m_estimatorSampleCount;
161 std::span<f32> m_pathPercentages;