More refactoring of code.
This commit is contained in:
@@ -115,8 +115,8 @@ namespace Game.Maps
|
||||
|
||||
SplineRawInitializer initer = new SplineRawInitializer(allPoints);
|
||||
Spline orientationSpline = new Spline();
|
||||
orientationSpline.init_spline_custom(initer);
|
||||
orientationSpline.initLengths();
|
||||
orientationSpline.InitSplineCustom(initer);
|
||||
orientationSpline.InitLengths();
|
||||
|
||||
for (uint i = 0; i < path.Length; ++i)
|
||||
{
|
||||
@@ -204,12 +204,12 @@ namespace Game.Maps
|
||||
int extra = !keyFrames[i - 1].Teleport ? 1 : 0;
|
||||
Spline spline = new Spline();
|
||||
Span<Vector3> span = splinePath.ToArray();
|
||||
spline.Init_Spline(span.Slice(start), i - start + extra, Spline.EvaluationMode.Catmullrom);
|
||||
spline.initLengths();
|
||||
spline.InitSpline(span.Slice(start), i - start + extra, Spline.EvaluationMode.Catmullrom);
|
||||
spline.InitLengths();
|
||||
for (int j = start; j < i + extra; ++j)
|
||||
{
|
||||
keyFrames[j].Index = (uint)(j - start + 1);
|
||||
keyFrames[j].DistFromPrev = spline.length(j - start, j + 1 - start);
|
||||
keyFrames[j].DistFromPrev = spline.Length(j - start, j + 1 - start);
|
||||
if (j > 0)
|
||||
keyFrames[j - 1].NextDistFromPrev = keyFrames[j].DistFromPrev;
|
||||
keyFrames[j].Spline = spline;
|
||||
|
||||
Reference in New Issue
Block a user