| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <math/seadVector.h> |
| 4 | |
| 5 | namespace al { |
| 6 | |
| 7 | class LinearCurve { |
| 8 | public: |
| 9 | LinearCurve(); |
| 10 | |
| 11 | void set(const sead::Vector3f& start, const sead::Vector3f& end); |
| 12 | void calcPos(sead::Vector3f* pos, f32 param) const; |
| 13 | void calcVelocity(sead::Vector3f* vel, f32 param) const; |
| 14 | f32 calcLength(f32 param_start, f32 param_end) const; |
| 15 | f32 calcCurveParam(f32 param) const; |
| 16 | f32 calcNearestParam(const sead::Vector3f& pos) const; |
| 17 | f32 calcNearestLength(f32* length, const sead::Vector3f& pos, f32 param) const; |
| 18 | void calcNearestPos(sead::Vector3f* nearest, const sead::Vector3f& pos) const; |
| 19 | void calcStartPos(sead::Vector3f* start) const; |
| 20 | void calcEndPos(sead::Vector3f* end) const; |
| 21 | |
| 22 | f32 getLength() const { return mDistance; } |
| 23 | |
| 24 | private: |
| 25 | sead::Vector3f mStart = sead::Vector3f::zero; |
| 26 | sead::Vector3f mDiff = sead::Vector3f::zero; |
| 27 | f32 mDistance = 0; |
| 28 | }; |
| 29 | |
| 30 | } // namespace al |
| 31 |