1#pragma once
2
3#include <math/seadVector.h>
4
5#include "Library/Rail/RailPart.h"
6
7namespace al {
8class PlacementInfo;
9class RailPart;
10
11class Rail {
12public:
13 Rail();
14 void init(const PlacementInfo&);
15 void calcPos(sead::Vector3f*, f32) const;
16 s32 getIncludedSection(const RailPart**, f32*, f32) const;
17 void calcDirection(sead::Vector3f*, f32) const;
18 void calcPosDir(sead::Vector3f*, sead::Vector3f*, f32) const;
19 f32 getTotalLength() const;
20 f32 getPartLength(s32) const;
21 f32 getLengthToPoint(s32) const;
22 void calcRailPointPos(sead::Vector3f*, s32) const;
23 void calcNearestRailPointPosFast(sead::Vector3f*, u32*, const sead::Vector3f&) const;
24 void calcNearestRailPointNo(s32*, const sead::Vector3f&) const;
25 void calcNearestRailPointPos(sead::Vector3f*, const sead::Vector3f&) const;
26 f32 normalizeLength(f32) const;
27 f32 calcNearestRailPosCoord(const sead::Vector3f&, f32) const;
28 f32 calcNearestRailPosCoord(const sead::Vector3f&, f32, f32*) const;
29 f32 calcNearestRailPos(sead::Vector3f*, const sead::Vector3f&, f32) const;
30 bool isNearRailPoint(f32, f32) const;
31 s32 calcRailPointNum(f32, f32) const;
32 f32 getIncludedSectionLength(f32*, f32*, f32) const;
33 s32 getIncludedSectionIndex(f32) const;
34 bool isIncludeBezierRailPart() const;
35 bool isBezierRailPart(s32) const;
36
37private:
38 PlacementInfo** mRailPoints = nullptr;
39 RailPart* mRailPart = nullptr;
40 s32 mRailPartCount = 0;
41 s32 mRailPointsCount = 0;
42 bool mIsClosed = false;
43};
44
45} // namespace al
46