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 TimeInterpolator
i.e.static final TimeInterpolator
i.e.static final TimeInterpolator
i.e.static final TimeInterpolator
i.e.static final TimeInterpolator
static final TimeInterpolator
static final TimeInterpolator
static final TimeInterpolator
static final TimeInterpolator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic float
lerp
(float startValue, float endValue, float fraction) Linear interpolation betweenstartValue
andendValue
byfraction
.static float
lerp
(float outputMin, float outputMax, float inputMin, float inputMax, float value) Linear interpolation betweenoutputMin
andoutputMax
whenvalue
is betweeninputMin
andinputMax
.static int
lerp
(int startValue, int endValue, float fraction) Linear interpolation betweenstartValue
andendValue
byfraction
.
-
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 betweenstartValue
andendValue
byfraction
. -
lerp
public static int lerp(int startValue, int endValue, float fraction) Linear interpolation betweenstartValue
andendValue
byfraction
. -
lerp
public static float lerp(float outputMin, float outputMax, float inputMin, float inputMax, float value) Linear interpolation betweenoutputMin
andoutputMax
whenvalue
is betweeninputMin
andinputMax
.Note that
value
will be coerced intoinputMin
andinputMax
.This function can handle input and output ranges that span positive and negative numbers.
-