Enum Class Easing
- All Implemented Interfaces:
Serializable,Comparable<Easing>,Constable
Easing functions used to convert animation tick progress into smoothed interpolation
progress.
Easing is used by animation transforms to control how movement, growth, or other
time-based values progress over a fixed duration. The input progress is calculated from
the current tick and total tick duration, clamped to the range 0.0F to
1.0F, passed through the selected easing function, and then clamped again before
being returned.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfloatapply(int currentTick, int totalTicks) Applies this easing function to the current animation progress.static EasingReturns the enum constant of this class with the specified name.static Easing[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LINEAR
Linear easing with a constant rate of change. -
EASE_IN
Ease-in interpolation that starts slowly and accelerates over time. -
EASE_OUT
Ease-out interpolation that starts quickly and decelerates over time.
-
-
Field Details
-
CODEC
Codec for encoding and decoding easing functions by enum name.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
apply
public float apply(int currentTick, int totalTicks) Applies this easing function to the current animation progress.The current progress is derived from
currentTick / totalTicks. Values outside the valid range are clamped, and a non-positivetotalTicksvalue is treated as complete progress.- Parameters:
currentTick- the current animation ticktotalTicks- the total duration of the animation section in ticks- Returns:
- the eased progress value, clamped between
0.0Fand1.0F
-