Up the bezier bake count

This commit is contained in:
vaxerski 2023-03-03 13:17:11 +00:00
parent c5aa20f226
commit 62e0c9226e
2 changed files with 3 additions and 3 deletions

View file

@ -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);

View file

@ -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