mod interpolator¶
InterpolationFunction trait and some interpolation functions.
Traits
An interpolation-function that is parameterized to allow calculating the time it should take to interpolate from
fromtoto.The passed
argumentis the same as for the InterpolationFunction.Functions
Implemented for
An interpolation function which can interpolate values of type
T, using values of typeAas arguments.Variables
The Endpoint of this InterpolationFunction (i.e., whether it will loop back to the start value or not).
Functions
Interpolate between two values based on the passed normalized
fraction.The passed
argumentcan be used by this interpolation-functions.
Implemented for
Enums
Optional argument for Constant to describe when the constant jump should happen.
Jump at start of interpolation
Jump at end of interpolation
The endpoint of an interpolation function
The interpolation-function ends back at the from-point
The interpolation function ends at the to-point (most interpolation functions)
Implementations
Functions
Gets the passed argument based on the value of this Endpoint
Structs and Unions
Implementations
Functions
Gets the average velocity for a 2d move from
sourcetodestinationintime
Component-Wise interpolator for a Position. Interpolates
x- andy-coordinates separately using the same passed interpolator. The components are both interpreted in the same duration.Note that while it is possible to wrap any types here, only wrapped InterpolationFunctions will make this type be an InterpolationFunction.
Traits implemented
Component-Wise interpolator for a Position. Interpolates
x- andy-coordinates separately using the same passed interpolator. The duration must be calculable so that each component may take its specified time. The components therefore only take as long as necessary.Note that while it is possible to wrap any types here, only wrapped InterpolationFunctions will make this type be an InterpolationFunction.
Traits implemented
Constant interpolation
Will switch from
fromtotoat the specified point. The time can be specified by the argument:(): Will jump at start of the interpolation (i.e., always be
true).ConstantTransitionPoint: Will use the ConstantTransitionPoint to decide.
Traits implemented
A ConstantJerkImpl with a constant jerk.
Implementations
Functions
Creates a new ConstantJerk interpolation-function with the specified fixed
jerk.
Traits implemented
A ConstantJerkImpl with a set average velocity. The jerk value is calculated from the average velocity for a given interpolation.
Implementations
Functions
Calculates the jerk for a diagonal move from
fromtotoin the passedduration.
Calculates the jerk for a one-dimensional move from
fromtotoin the passedduration.
Traits implemented
Implementation using AverageVelocity. Use this when needing the correct values..
Implementation using no argument, as the AverageVelocity reduces in the final interpolation. Use this for interpolation in the timeline.
A ConstantJerkImpl with a set maximum velocity. The jerk value is calculated from the maximum velocity for a given interpolation.
Implementations
Functions
Traits implemented
A cubic interpolation
Will interpolate from
fromtotousing cubic functions. Taken from easings.netTraits implemented
Diagonal interpolator for a Position. Interpolates the direct (diagonal) connection between
fromandto.Note that while it is possible to wrap any types here, only wrapped InterpolationFunctions will make this type be an InterpolationFunction.
Traits implemented
A wrapper around a Interpolation-Function that fixes the argument
Note that while it is possible to wrap any types here, only wrapped InterpolationFunctions will make this type be an InterpolationFunction and only wrapped DurationCalculables will make this type be an DurationCalculable.
The fixed argument
The interpolator
Traits implemented
Linear interpolation
Will interpolate linearly from
fromtotoTraits implemented
Triangle interpolation
Will interpolate linearly from
fromtotoin the first half and then back fromtotofromin the second half. This will always cycle back to the initial value.Traits implemented