docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Evaluate

    Evaluate(float, out float3, out float3, out float3)

    Computes interpolated position, direction and upDirection at ratio t. Calling this method to get the 3 vectors is faster than calling independently EvaluateSplinePosition, EvaluateSplineTangent and EvaluateSplineUpVector for the same time t as it reduces some redundant computation.

    Declaration
    public bool Evaluate(float t, out float3 position, out float3 tangent, out float3 upVector)
    Parameters
    Type Name Description
    float t

    A value between 0 and 1 representing the ratio along the curve.

    float3 position

    The output variable for the float3 position at t.

    float3 tangent

    The output variable for the float3 tangent at t.

    float3 upVector

    The output variable for the float3 up direction at t.

    Returns
    Type Description
    bool

    Boolean value, true if a valid set of output variables as been computed.

    Evaluate(int, float, out float3, out float3, out float3)

    Computes the interpolated position, direction and upDirection at ratio t for the spline at index splineIndex. Calling this method to get the 3 vectors is faster than calling independently EvaluateSplinePosition, EvaluateSplineTangent and EvaluateSplineUpVector for the same time t as it reduces some redundant computation.

    Declaration
    public bool Evaluate(int splineIndex, float t, out float3 position, out float3 tangent, out float3 upVector)
    Parameters
    Type Name Description
    int splineIndex

    The index of the spline to evaluate.

    float t

    A value between 0 and 1 that represents the ratio along the curve.

    float3 position

    The output variable for the float3 position at t.

    float3 tangent

    The output variable for the float3 tangent at t.

    float3 upVector

    The output variable for the float3 up direction at t.

    Returns
    Type Description
    bool

    True if a valid set of output variables is computed and false otherwise.

    Evaluate<T>(T, float, out float3, out float3, out float3)

    Gets the interpolated position, direction, and upDirection at ratio t for a spline. This method gets the three vectors faster than EvaluateSplinePosition, EvaluateSplineTangent and EvaluateSplineUpVector for the same time t, because it reduces some redundant computation.

    Declaration
    public bool Evaluate<T>(T spline, float t, out float3 position, out float3 tangent, out float3 upVector) where T : ISpline
    Parameters
    Type Name Description
    T spline

    The spline to evaluate.

    float t

    A value between 0 and 1 that represents the ratio along the curve.

    float3 position

    The output variable for the float3 position at t.

    float3 tangent

    The output variable for the float3 tangent at t.

    float3 upVector

    The output variable for the float3 up direction at t.

    Returns
    Type Description
    bool

    True if a valid set of output variables is computed and false otherwise.

    Type Parameters
    Name Description
    T

    The spline type.

    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)