/******************************************************************************
* Copyright (C) Ultraleap, Inc. 2011-2021. *
* *
* Use subject to the terms of the Apache License 2.0 available at *
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
* between Ultraleap and you, your company or other organization. *
******************************************************************************/
using System;
namespace Leap.Unity.Animation
{
///
/// Implement this interface to add your own interpolators to Tween!
///
public interface IInterpolator : IPoolable, IDisposable
{
///
/// Called to trigger the interpolation of this interpolator. Use
/// this callback to do whatever work your interpolator needs to do.
///
void Interpolate(float percent);
///
/// Returns the 'length' of this interpolator, in whatever units
/// make sense for this interpolator. If you are interpolating
/// from one point to another, you would return the distance
/// between the points.
///
/// The only current use of this function is to drive the
/// Tween.AtRate function.
///
float length { get; }
///
/// Returns whether or not this interpolator is currently considered
/// valid. Any invalid interpolators will be removed from a tween.
///
bool isValid { get; }
}
}