| 1 | #pragma once |
| 2 | |
| 3 | #include <math/seadVector.h> |
| 4 | |
| 5 | namespace al { |
| 6 | class BezierCurve; |
| 7 | class LinearCurve; |
| 8 | |
| 9 | class RailPart { |
| 10 | public: |
| 11 | RailPart(); |
| 12 | void init(const sead::Vector3f&, const sead::Vector3f&, const sead::Vector3f&, |
| 13 | const sead::Vector3f&); |
| 14 | void calcPos(sead::Vector3f*, f32) const; |
| 15 | void calcVelocity(sead::Vector3f*, f32) const; |
| 16 | void calcDir(sead::Vector3f*, f32) const; |
| 17 | void calcStartPos(sead::Vector3f*) const; |
| 18 | void calcEndPos(sead::Vector3f*) const; |
| 19 | f32 calcLength(f32, f32, s32) const; |
| 20 | f32 calcCurveParam(f32) const; |
| 21 | f32 calcNearestParam(const sead::Vector3f&, f32) const; |
| 22 | void calcNearestPos(sead::Vector3f*, const sead::Vector3f&, f32) const; |
| 23 | f32 calcNearestLength(f32*, const sead::Vector3f&, f32, f32) const; |
| 24 | f32 getPartLength() const; |
| 25 | |
| 26 | void setTotalDistance(f32 len) { mTotalDistance = len; } |
| 27 | |
| 28 | f32 getTotalDistance() const { return mTotalDistance; } |
| 29 | |
| 30 | bool isBezierCurve() const { return mBezierCurve != nullptr; } |
| 31 | |
| 32 | private: |
| 33 | BezierCurve* mBezierCurve = nullptr; |
| 34 | LinearCurve* mLinearCurve = nullptr; |
| 35 | f32 mTotalDistance = 0; |
| 36 | }; |
| 37 | |
| 38 | } // namespace al |
| 39 | |