docs.unity3d.com
    Show / Hide Table of Contents

    Interface IInterpolator<T>

    To calculate a value at some distance along a spline, interpolation is required. The IInterpolator interface allows you to define how data is interpreted given a start value, end value, and normalized interpolation value (commonly referred to as 't').

    Namespace: UnityEngine.Splines
    Syntax
    public interface IInterpolator<T>
    Type Parameters
    Name Description
    T

    The data type to interpolate.

    Methods

    Interpolate(T, T, Single)

    Calculate a value between from and to at time interval.

    Declaration
    T Interpolate(T from, T to, float t)
    Parameters
    Type Name Description
    T from

    The starting value. At t = 0 this method should return an unmodified 'from' value.

    T to

    The ending value. At t = 1 this method should return an unmodified 'to' value.

    Single t

    A percentage between 'from' and 'to'. Must be between 0 and 1.

    Returns
    Type Description
    T

    A value between 'from' and 'to'.

    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