docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    SplinePath<T>
    SplinePath
    Implements
    ISpline
    IReadOnlyList<BezierKnot>
    IReadOnlyCollection<BezierKnot>
    IEnumerable<BezierKnot>
    IEnumerable
    IHasEmptyCurves
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    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 index. If the ISpline section that contains this knot has a SplineRange with Backward, the in and out tangents are reversed.

    this[SplineKnotIndex]

    Gets the knot at index. If the ISpline segment that contains this knot has a SplineRange with Backward, the in and out tangents are reversed.

    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.

    Extension Methods

    SplineDataHandles.DataPointHandles<TSpline, TData>(TSpline, SplineData<TData>, bool)
    SplineDataHandles.DataPointHandles<TSpline, TData>(TSpline, SplineData<TData>, bool, int)
    SplineUtility.CalculateLength<T>(T, float4x4)
    SplineUtility.CalculateUpVector<T>(T, float)
    SplineUtility.ConvertIndexUnit<T>(T, float, PathIndexUnit)
    SplineUtility.ConvertIndexUnit<T>(T, float, PathIndexUnit, PathIndexUnit)
    SplineUtility.CurveToSplineT<T>(T, float)
    SplineUtility.EvaluateAcceleration<T>(T, float)
    SplineUtility.EvaluateCurvatureCenter<T>(T, float)
    SplineUtility.EvaluateCurvature<T>(T, float)
    SplineUtility.EvaluatePosition<T>(T, float)
    SplineUtility.EvaluateTangent<T>(T, float)
    SplineUtility.EvaluateUpVector<T>(T, float)
    SplineUtility.Evaluate<T>(T, float, out float3, out float3, out float3)
    SplineUtility.GetBounds<T>(T)
    SplineUtility.GetBounds<T>(T, float4x4)
    SplineUtility.GetCurveCount<T>(T)
    SplineUtility.GetPointAtLinearDistance<T>(T, float, float, out float)
    SplineUtility.NextIndex<T>(T, int)
    SplineUtility.Next<T>(T, int)
    SplineUtility.PreviousIndex<T>(T, int)
    SplineUtility.Previous<T>(T, int)
    SplineUtility.SplineToCurveT<T>(T, float, out float)

    See Also

    SplineRange
    KnotLinkCollection
    SplineKnotIndex
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)