More refactoring of code.

This commit is contained in:
hondacrx
2019-09-23 21:41:13 -04:00
parent 2418715800
commit 570aebce26
176 changed files with 2261 additions and 2265 deletions
+5 -5
View File
@@ -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;