docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetPointAtLinearDistance

    GetPointAtLinearDistance<T>(T, float, float, out float)

    Given a Spline and interpolation ratio, calculate the 3d point at a linear distance from point at spline.EvaluatePosition(t). Returns the corresponding time associated to this 3d position on the Spline.

    Declaration
    public static float3 GetPointAtLinearDistance<T>(this T spline, float fromT, float relativeDistance, out float resultPointT) where T : ISpline
    Parameters
    Type Name Description
    T spline

    The Spline on which to compute the point.

    float fromT

    The Spline interpolation ratio t (normalized) from which the next position need to be computed.

    float relativeDistance

    The relative distance at which the new point should be placed. A negative value will compute a point at a resultPointTime previous to fromT (backward search).

    float resultPointT

    The normalized interpolation ratio of the resulting point.

    Returns
    Type Description
    float3

    The 3d point from the spline located at a linear distance from the point at t.

    Type Parameters
    Name Description
    T

    A type implementing ISpline.

    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)