Package icyllis.modernui.animation
Class MotionEasingUtils
java.lang.Object
icyllis.modernui.animation.MotionEasingUtils
Utility class for animations containing motion system interpolators.
- Since:
- 3.12
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TimeInterpolatori.e.static final TimeInterpolatori.e.static final TimeInterpolatori.e.static final TimeInterpolatori.e.static final TimeInterpolatorstatic final TimeInterpolatorstatic final TimeInterpolatorstatic final TimeInterpolatorstatic final TimeInterpolator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floatlerp(float startValue, float endValue, float fraction) Linear interpolation betweenstartValueandendValuebyfraction.static floatlerp(float outputMin, float outputMax, float inputMin, float inputMax, float value) Linear interpolation betweenoutputMinandoutputMaxwhenvalueis betweeninputMinandinputMax.static intlerp(int startValue, int endValue, float fraction) Linear interpolation betweenstartValueandendValuebyfraction.
-
Field Details
-
FAST_OUT_SLOW_IN
i.e. motion_easing_legacy -
FAST_OUT_LINEAR_IN
i.e. motion_easing_legacy_accelerate -
LINEAR_OUT_SLOW_IN
i.e. motion_easing_legacy_decelerate -
MOTION_EASING_STANDARD
-
MOTION_EASING_STANDARD_ACCELERATE
-
MOTION_EASING_STANDARD_DECELERATE
-
MOTION_EASING_EMPHASIZED
i.e. fast_out_extra_slow_in -
MOTION_EASING_EMPHASIZED_ACCELERATE
-
MOTION_EASING_EMPHASIZED_DECELERATE
-
-
Constructor Details
-
MotionEasingUtils
public MotionEasingUtils()
-
-
Method Details
-
lerp
public static float lerp(float startValue, float endValue, float fraction) Linear interpolation betweenstartValueandendValuebyfraction. -
lerp
public static int lerp(int startValue, int endValue, float fraction) Linear interpolation betweenstartValueandendValuebyfraction. -
lerp
public static float lerp(float outputMin, float outputMax, float inputMin, float inputMax, float value) Linear interpolation betweenoutputMinandoutputMaxwhenvalueis betweeninputMinandinputMax.Note that
valuewill be coerced intoinputMinandinputMax.This function can handle input and output ranges that span positive and negative numbers.
-