Click or drag to resize
Ab4d.SharpEngine logo

KeyframesTrackTEasingFunction Property

Gets or sets a Func that gets a double and returns a double and can be specified to provide custom interpolation between first and last key frame. This defines the speed of the animation. When null (by default), linear interpolation is used.

Namespace: Ab4d.SharpEngine.Animation
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public Func<float, float>? EasingFunction { get; set; }

Property Value

FuncSingle, Single
Remarks

Gets or sets a Func that gets a double and returns a double and can be specified to provide custom interpolation between first and last key frame. This defines the speed of the animation. When null (by default), linear interpolation is used.

The function gets a double parameter value between 0 and 1 and should return a value between 0 and 1.

Standard easing function are defined in EasingFunctions class.

If linear interpolation is used (when set to null - by default), then animation speed is constant. If Ease in is used, then animation starts slowly and then accelerates and finishes with constant speed.

This property is different from the [!:KeyFrameBase.EasingFunction]. This property affects the animation speed of the whole Track, where the [!:KeyFrameBase.EasingFunction] changes only animation around the specified Key.

NOTE:
All derived class need to call InterpolateTime(Single) method to adjust the frame number based on the TrackInterpolation property value before the data for the frame are calculated.

See Also