Interface Easing
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An easing curve: maps linear progress
t in [0, 1] to eased progress, 0 at 0 and 1 at 1. Some curves
overshoot (BACK_OUT, ELASTIC_OUT) and leave [0, 1] in between.
Curves follow the usual names (easings.net): IN starts slow, OUT ends slow.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EasingOvershoots past 1 and settles back.static final EasingBounces at the end like a dropped ball.static final EasingCircular, slow end.static final EasingCubic, slow start.static final EasingCubic, slow start and end.static final EasingCubic, slow end.static final EasingA springy overshoot that oscillates into place.static final EasingExponential, slow end.static final EasingNo easing.static final EasingQuadratic, slow start.static final EasingQuadratic, slow start and end.static final EasingQuadratic, slow end; the classic decelerate.static final EasingQuintic, slow end; a long soft landing.static final EasingSine, slow start and end.static final EasingSine, slow end.static final EasingHermite smoothstep. -
Method Summary
-
Field Details
-
LINEAR
No easing. -
QUAD_IN
Quadratic, slow start. -
QUAD_OUT
Quadratic, slow end; the classic decelerate. -
QUAD_IN_OUT
Quadratic, slow start and end. -
CUBIC_IN
Cubic, slow start. -
CUBIC_OUT
Cubic, slow end. -
CUBIC_IN_OUT
Cubic, slow start and end. -
QUINT_OUT
Quintic, slow end; a long soft landing. -
SINE_OUT
Sine, slow end. -
SINE_IN_OUT
Sine, slow start and end. -
EXPO_OUT
Exponential, slow end. -
CIRC_OUT
Circular, slow end. -
SMOOTHSTEP
Hermite smoothstep. -
BACK_OUT
Overshoots past 1 and settles back. -
ELASTIC_OUT
A springy overshoot that oscillates into place. -
BOUNCE_OUT
Bounces at the end like a dropped ball.
-
-
Method Details
-
apply
double apply(double t) Eases a progress value.- Parameters:
t- linear progress,[0, 1]- Returns:
- eased progress
-
back
An overshooting ease-out.- Parameters:
overshoot- how far past 1 it swings; 1.70158 is the common default- Returns:
- the curve
-
reversed
Plays this curve backwards in time:1 - f(1 - t), turning an ease-out into the matching ease-in.- Returns:
- the reversed curve
-