Class SplinePath<T>
The SplinePath type is an implementation of ISpline that is composed of multiple sections of other splines (see SplineSlice<T>). This is useful when you want to evaluate a path that follows multiple splines, typically in the case where splines share linked knots.
Implements
Inherited Members
Namespace: UnityEngine.Splines
Assembly: solution.dll
Syntax
public class SplinePath<T> : ISpline, IReadOnlyList<BezierKnot>, IReadOnlyCollection<BezierKnot>, IEnumerable<BezierKnot>, IEnumerable, IHasEmptyCurves where T : ISpline
Type Parameters
Name | Description |
---|---|
T | The type of spline to create a path with. |
Constructors
Name | Description |
---|---|
SplinePath(IEnumerable<T>) | Create a new SplinePath<T> from a collection of ISpline. |
Properties
Name | Description |
---|---|
Closed | SplinePathRef does not support Closed splines. |
Count | Returns the number of knots. Note that there are duplicate knots where two ISpline meet. In addition, each closed ISpline have their first knot duplicated. Use GetCurve(int) to access curves rather than construct the curve yourself. |
EmptyCurves | A collection of knot indices that should be considered degenerate curves for the purpose of creating a non-interpolated gap between curves. |
this[int] | Gets the knot at |
this[SplineKnotIndex] | Gets the knot at |
Slices | The ISpline splines that make up this path. |
Methods
Name | Description |
---|---|
GetCurve(int) | Gets a BezierCurve from a knot index. This function returns degenerate (0 length) curves at the overlap points between each ISpline. |
GetCurveInterpolation(int, float) | Returns the interpolation ratio (0 to 1) that corresponds to a distance on a BezierCurve. The distance is relative to the curve. |
GetCurveLength(int) | Returns the length of a curve. This function returns 0 length for knot indices where ISpline segments overlap. |
GetCurveUpVector(int, float) | Return the up vector for a t ratio on the curve. |
GetEnumerator() | Gets an enumerator that iterates through the BezierKnot collection. |
GetLength() | Return the sum of all curve lengths, accounting for Closed state. |