1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

BeefySysLib point/rect updates, async pipe fixes

This commit is contained in:
Brian Fiete 2025-03-28 08:08:33 -04:00
parent 81a9478e77
commit fe1aa3c26e
32 changed files with 282 additions and 120 deletions

View file

@ -72,7 +72,7 @@ void CubicSpline2D::AddPt(float x, float y)
delete mYCubicArray;
mYCubicArray = NULL;
mInputPoints.push_back(Point2D(x, y));
mInputPoints.push_back(PointF(x, y));
}
int CubicSpline2D::GetLength()
@ -86,15 +86,15 @@ void CubicSpline2D::Calculate()
std::vector<float> yVals;
for (int i = 0; i < (int) mInputPoints.size(); i++)
{
xVals.push_back(mInputPoints[i].mX);
yVals.push_back(mInputPoints[i].mY);
xVals.push_back(mInputPoints[i].x);
yVals.push_back(mInputPoints[i].y);
}
mXCubicArray = SolveCubic(xVals);
mYCubicArray = SolveCubic(yVals);
}
Point2D CubicSpline2D::Evaluate(float t)
PointF CubicSpline2D::Evaluate(float t)
{
if (mXCubicArray == NULL)
Calculate();
@ -105,5 +105,5 @@ Point2D CubicSpline2D::Evaluate(float t)
if (idx >= (int) mInputPoints.size() - 1)
return mInputPoints[mInputPoints.size() - 1];
return Point2D(mXCubicArray[idx].Evaluate(frac), mYCubicArray[idx].Evaluate(frac));
return PointF(mXCubicArray[idx].Evaluate(frac), mYCubicArray[idx].Evaluate(frac));
}