Easing Class

Summary

A set of common easing functions.
Assembly
Animancer.dll
Namespace
Animancer
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["Easing"] class Type type-node

Syntax

public static class Easing

Remarks

There are several different types of functions:
  • In: accelerating from zero velocity.
  • Out: decelerating to zero velocity.
  • InOut: uses the corresponding In function until halfway, then the Out function after that.
  • Normalized: methods with a single parameter ( value) expect values from 0 to 1.
  • Ranged: methods with 3 parameters ( start, end, value) use the specified range instead ot 0 to 1.
  • Derivative: calculates the gradient of their corresponding non-derivative function. The more complex derivative functions were made with 'https://www.derivative-calculator.net'.

Fields

Name Constant Value Summary
FunctionCount 31
The total number of Animancer.Easing.Function values.
static
Ln2 0.6931472
The natural log of 2.
static

Methods

Name Value Summary
GetDelegate(Easing.Function) Func<float, float>
Returns a cached delegate representing the specified `function` with a normalized range.
static
GetDerivativeDelegate(Easing.Function) Func<float, float>
Returns a cached delegate representing the derivative of the specified `function` with a normalized range.
static
GetRangedDelegate(Easing.Function) Easing.RangedDelegate
Returns a cached delegate representing the specified `function` with a custom range.
static
GetRangedDerivativeDelegate(Easing.Function) Easing.RangedDelegate
Returns a cached delegate representing the derivative of the specified `function` with a custom range.
static
Lerp(float, float, float) float
Returns a linearly interpolated value between the `start` and `end` based on a normalized `value`.
static
Linear(float) float
Directly returns the `value`. Interpolates the `value` based on the line y = x.
static
Linear(float, float, float) float
Directly returns the `value`. Interpolates the `value` based on the line y = x.
static
LinearDerivative(float) float
Returns 1. The derivative of Animancer.Easing.Linear(System.Single).
static
LinearDerivative(float, float, float) float
Returns end - start. The derivative of Animancer.Easing.Linear(System.Single,System.Single,System.Single).
static
ReScale(float, float, float, Func<float, float>) float
Re-scales the result of the `function` to use a custom range instead of 0 to 1.
static
UnLerp(float, float, float) float
Returns a normalized value indicating how far the `value` is between the `start` and `end`.
static