docs.unity3d.com
    Show / Hide Table of Contents

    Interface ISpline

    ISpline defines the interface from which Spline types inherit.

    Inherited Members
    IReadOnlyList<BezierKnot>.Item[Int32]
    IReadOnlyCollection<BezierKnot>.Count
    IEnumerable<BezierKnot>.GetEnumerator()
    Namespace: UnityEngine.Splines
    Syntax
    public interface ISpline : IReadOnlyList<BezierKnot>, IReadOnlyCollection<BezierKnot>, IEnumerable<BezierKnot>, IEnumerable

    Properties

    Closed

    Whether the spline is open (has a start and end point) or closed (forms an unbroken loop).

    Declaration
    bool Closed { get; }
    Property Value
    Type Description
    Boolean

    Methods

    GetCurve(Int32)

    Get a BezierCurve from a knot index.

    Declaration
    BezierCurve GetCurve(int index)
    Parameters
    Type Name Description
    Int32 index

    The knot index that serves as the first control point for this curve.

    Returns
    Type Description
    BezierCurve

    A BezierCurve formed by the knot at index and the next knot.

    GetCurveInterpolation(Int32, Single)

    Return the interpolation ratio (0 to 1) corresponding to a distance on a BezierCurve. Distance is relative to the curve.

    Declaration
    float GetCurveInterpolation(int curveIndex, float curveDistance)
    Parameters
    Type Name Description
    Int32 curveIndex

    The zero-based index of the curve.

    Single curveDistance

    The distance (measuring from the knot at curveIndex) to convert to a normalized interpolation ratio.

    Returns
    Type Description
    Single

    The normalized interpolation ratio matching distance on the designated curve.

    GetCurveLength(Int32)

    Return the length of a curve.

    Declaration
    float GetCurveLength(int index)
    Parameters
    Type Name Description
    Int32 index

    The index of the curve for which the length needs to be retrieved

    Returns
    Type Description
    Single

    Returns the length of the curve of index 'index' in the spline.

    See Also
    GetLength()

    GetLength()

    Return the sum of all curve lengths, accounting for Closed state.

    Declaration
    float GetLength()
    Returns
    Type Description
    Single

    Returns the sum length of all curves composing this spline, accounting for closed state.

    Extension Methods

    SplineUtility.Evaluate<T>(T, Single, out float3, out float3, out float3)
    SplineUtility.EvaluatePosition<T>(T, Single)
    SplineUtility.EvaluateTangent<T>(T, Single)
    SplineUtility.EvaluateUpVector<T>(T, Single)
    SplineUtility.EvaluateAcceleration<T>(T, Single)
    SplineUtility.EvaluateCurvature<T>(T, Single)
    SplineUtility.EvaluateCurvatureCenter<T>(T, Single)
    SplineUtility.SplineToCurveT<T>(T, Single, out Single)
    SplineUtility.CurveToSplineT<T>(T, Single)
    SplineUtility.CalculateLength<T>(T, float4x4)
    SplineUtility.GetCurveCount<T>(T)
    SplineUtility.GetBounds<T>(T)
    SplineUtility.GetBounds<T>(T, float4x4)
    SplineUtility.GetPointAtLinearDistance<T>(T, Single, Single, out Single)
    SplineUtility.ConvertIndexUnit<T>(T, Single, PathIndexUnit)
    SplineUtility.ConvertIndexUnit<T>(T, Single, PathIndexUnit, PathIndexUnit)
    SplineUtility.PreviousIndex<T>(T, Int32)
    SplineUtility.NextIndex<T>(T, Int32)
    SplineUtility.Previous<T>(T, Int32)
    SplineUtility.Next<T>(T, Int32)
    SplineDataHandles.DataPointHandles<TSpline, TData>(TSpline, SplineData<TData>, Boolean)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023