docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method ConvertIndexUnit

    ConvertIndexUnit<T>(T, float, PathIndexUnit)

    Given a normalized interpolation ratio, calculate the associated interpolation value in another PathIndexUnit regarding a specific spline.

    Declaration
    public static float ConvertIndexUnit<T>(this T spline, float t, PathIndexUnit targetPathUnit) where T : ISpline
    Parameters
    Type Name Description
    T spline

    The Spline to use for the conversion.

    float t

    Normalized interpolation ratio (0 to 1).

    PathIndexUnit targetPathUnit

    The PathIndexUnit to which t should be converted.

    Returns
    Type Description
    float

    The interpolation value converted to targetPathUnit.

    Type Parameters
    Name Description
    T

    A type implementing ISpline.

    ConvertIndexUnit<T>(T, float, PathIndexUnit, PathIndexUnit)

    Given an interpolation value using one of the various PathIndexUnit types, calculate the associated interpolation value in another PathIndexUnit regarding a specific spline.

    Declaration
    public static float ConvertIndexUnit<T>(this T spline, float value, PathIndexUnit fromPathUnit, PathIndexUnit targetPathUnit) where T : ISpline
    Parameters
    Type Name Description
    T spline

    The spline to use for the conversion.

    float value

    Interpolation value in the original PathIndexUnit fromPathUnit.

    PathIndexUnit fromPathUnit

    The PathIndexUnit for the original interpolation value type.

    PathIndexUnit targetPathUnit

    The PathIndexUnit to which value should be converted.

    Returns
    Type Description
    float

    The interpolation value converted to targetPathUnit.

    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)