Enum Class Easings

java.lang.Object
java.lang.Enum<Easings>
com.github.darksoulq.abyssallib.common.util.Easings
All Implemented Interfaces:
Easing, Serializable, Comparable<Easings>, Constable

public enum Easings extends Enum<Easings> implements Easing
A collection of standard easing functions implemented as an enum.

These functions are based on common animation formulas used to create smooth transitions.

  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Starts by moving slightly backward before accelerating forward.
    Cubic acceleration; starts very slow and speeds up rapidly.
    Cubic acceleration/deceleration; more pronounced than Quadratic In-Out.
    Quadratic acceleration/deceleration; slow start and end, fast in the middle.
    Quadratic acceleration; starts slow and speeds up.
    A simple linear transition where the rate of change is constant.
    Overshoots the target value slightly before settling back to 1.0.
    Cubic deceleration; starts very fast and slows down heavily.
    An oscillating transition that simulates an elastic rubber band effect, bouncing past the end point before settling.
    Quadratic deceleration; starts fast and slows down.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    apply(double t)
    Applies the specific easing formula of this constant to the input.
    static Easings
    Returns the enum constant of this class with the specified name.
    static Easings[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • LINEAR

      public static final Easings LINEAR
      A simple linear transition where the rate of change is constant.
    • IN_QUAD

      public static final Easings IN_QUAD
      Quadratic acceleration; starts slow and speeds up.
    • OUT_QUAD

      public static final Easings OUT_QUAD
      Quadratic deceleration; starts fast and slows down.
    • IN_OUT_QUAD

      public static final Easings IN_OUT_QUAD
      Quadratic acceleration/deceleration; slow start and end, fast in the middle.
    • IN_CUBIC

      public static final Easings IN_CUBIC
      Cubic acceleration; starts very slow and speeds up rapidly.
    • OUT_CUBIC

      public static final Easings OUT_CUBIC
      Cubic deceleration; starts very fast and slows down heavily.
    • IN_OUT_CUBIC

      public static final Easings IN_OUT_CUBIC
      Cubic acceleration/deceleration; more pronounced than Quadratic In-Out.
    • IN_BACK

      public static final Easings IN_BACK
      Starts by moving slightly backward before accelerating forward. Uses a standard overshoot constant of 1.70158.
    • OUT_BACK

      public static final Easings OUT_BACK
      Overshoots the target value slightly before settling back to 1.0.
    • OUT_ELASTIC

      public static final Easings OUT_ELASTIC
      An oscillating transition that simulates an elastic rubber band effect, bouncing past the end point before settling.
  • Method Details

    • values

      public static Easings[] 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

      public static Easings valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • apply

      public double apply(double t)
      Applies the specific easing formula of this constant to the input.
      Specified by:
      apply in interface Easing
      Parameters:
      t - The normalized time input (0.0 to 1.0).
      Returns:
      The interpolated result.