1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +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

@ -19,7 +19,7 @@ void PolySpline2D::AddPt(float x, float y)
mInputPoints.push_back(Point2D(x, y));
mInputPoints.push_back(PointF(x, y));
}
int PolySpline2D::GetLength()
@ -34,11 +34,11 @@ void PolySpline2D::Calculate()
mCoefs = new float[n];
for (int j=0; j<n; j++)
mat[j*n] = mInputPoints[j].mY;
mat[j*n] = mInputPoints[j].y;
for (int i=1; i<n; i++)
{
for (int j=0; j<n-i; j++)
mat[i+j*n]=(mat[(i-1)+j*n]-mat[(i-1)+(j+1)*n])/(mInputPoints[j].mX-mInputPoints[j+i].mX);
mat[i+j*n]=(mat[(i-1)+j*n]-mat[(i-1)+(j+1)*n])/(mInputPoints[j].x-mInputPoints[j+i].x);
}
for (int i=0; i<n; i++)
@ -58,7 +58,7 @@ float PolySpline2D::Evaluate(float x)
{
float add = mCoefs[i];
for (int j = 0; j < i; j++)
add *= (x - mInputPoints[j].mX);
add *= (x - mInputPoints[j].x);
result += add;
}