fix some spline bugs
continuous-integration/drone/push Build is passing Details

splines
cosmonaut 2020-12-12 04:43:58 -08:00
parent f1120a2572
commit 3db1fee4d0
1 changed files with 4 additions and 4 deletions

View File

@ -8,12 +8,12 @@ namespace MoonTools.Curve
/// </summary> /// </summary>
public struct SplineCurve3D public struct SplineCurve3D
{ {
public ImmutableArray<ICurve3D> Curves { get; } private ICurve3D[] Curves { get; }
public ImmutableArray<float> Times { get; } private float[] Times { get; }
public float TotalTime { get; } public float TotalTime { get; }
public bool Loop { get; } public bool Loop { get; }
public SplineCurve3D(ImmutableArray<ICurve3D> curves, ImmutableArray<float> times, bool loop = false) public SplineCurve3D(ICurve3D[] curves, float[] times, bool loop = false)
{ {
TotalTime = 0; TotalTime = 0;
@ -51,7 +51,7 @@ namespace MoonTools.Curve
} }
index++; index++;
startTime = Times[i]; startTime = incrementalTime;
} }
return Curves[index].Point(t - startTime, 0, Times[index]); return Curves[index].Point(t - startTime, 0, Times[index]);