diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-03 13:17:11 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-03 13:17:11 +0000 |
| commit | 62e0c9226eb091760bbf92128c44e187f07dab87 (patch) | |
| tree | f1f182eaaacb40d546624e83c7dfb38cd08a4f15 /src | |
| parent | c5aa20f226a2f829b411b7128d939272de822e68 (diff) | |
Up the bezier bake count
Diffstat (limited to 'src')
| -rw-r--r-- | src/helpers/BezierCurve.cpp | 4 | ||||
| -rw-r--r-- | src/helpers/BezierCurve.hpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/helpers/BezierCurve.cpp b/src/helpers/BezierCurve.cpp index f628c24f..440a87c0 100644 --- a/src/helpers/BezierCurve.cpp +++ b/src/helpers/BezierCurve.cpp @@ -61,8 +61,8 @@ float CBezierCurve::getYForPoint(float x) { } // in the name of performance i shall make a hack - const auto LOWERPOINT = &m_aPointsBaked[std::clamp((int)((float)BAKEDPOINTS * lowerT), 0, 199)]; - const auto UPPERPOINT = &m_aPointsBaked[std::clamp((int)((float)BAKEDPOINTS * upperT), 0, 199)]; + const auto LOWERPOINT = &m_aPointsBaked[std::clamp((int)((float)BAKEDPOINTS * lowerT), 0, BAKEDPOINTS - 1)]; + const auto UPPERPOINT = &m_aPointsBaked[std::clamp((int)((float)BAKEDPOINTS * upperT), 0, BAKEDPOINTS - 1)]; const auto PERCINDELTA = (x - LOWERPOINT->x) / (UPPERPOINT->x - LOWERPOINT->x); diff --git a/src/helpers/BezierCurve.hpp b/src/helpers/BezierCurve.hpp index 81cf74b6..540d33a7 100644 --- a/src/helpers/BezierCurve.hpp +++ b/src/helpers/BezierCurve.hpp @@ -3,7 +3,7 @@ #include "../defines.hpp" #include <deque> -constexpr int BAKEDPOINTS = 200; +constexpr int BAKEDPOINTS = 255; constexpr float INVBAKEDPOINTS = 1.f / BAKEDPOINTS; // an implementation of a cubic bezier curve |
