Class Animations

java.lang.Object
com.github.darksoulq.abyssallib.world.particle.timeline.Animations

public class Animations extends Object
A utility class providing factory methods for time-aware Transformer animations. These animations utilize Easing functions to interpolate spatial properties such as rotation, scale, and translation over a defined duration.
  • Method Summary

    Modifier and Type
    Method
    Description
    breathe(double minScale, double maxScale, long duration)
    Creates a cyclical "breathing" animation that pulses the scale using a sine wave.
    scale(double startScale, double endScale, long duration, Easing easing)
    Scales the particle coordinates from a starting multiplier to an ending multiplier.
    spinX(double totalDegrees, long duration, Easing easing)
    Creates an animation that rotates particles around the X-axis over time.
    spinY(double totalDegrees, long duration, Easing easing)
    Creates an animation that rotates particles around the Y-axis over time.
    spinZ(double totalDegrees, long duration, Easing easing)
    Creates an animation that rotates particles around the Z-axis over time.
    translate(org.bukkit.util.Vector totalOffset, long duration, Easing easing)
    Translates (moves) the particles toward a target offset vector.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • spinY

      public static Transformer spinY(double totalDegrees, long duration, Easing easing)
      Creates an animation that rotates particles around the Y-axis over time.
      Parameters:
      totalDegrees - The total amount of rotation to perform (e.g., 360 for a full spin).
      duration - The lifespan of the animation in server ticks.
      easing - The Easing function used to determine the rotation curve.
      Returns:
      A Transformer that applies eased Y-axis rotation based on current tick.
    • spinX

      public static Transformer spinX(double totalDegrees, long duration, Easing easing)
      Creates an animation that rotates particles around the X-axis over time.
      Parameters:
      totalDegrees - The total amount of rotation in degrees.
      duration - The lifespan of the animation in server ticks.
      easing - The Easing function used to determine the rotation curve.
      Returns:
      A Transformer that applies eased X-axis rotation based on current tick.
    • spinZ

      public static Transformer spinZ(double totalDegrees, long duration, Easing easing)
      Creates an animation that rotates particles around the Z-axis over time.
      Parameters:
      totalDegrees - The total amount of rotation in degrees.
      duration - The lifespan of the animation in server ticks.
      easing - The Easing function used to determine the rotation curve.
      Returns:
      A Transformer that applies eased Z-axis rotation based on current tick.
    • scale

      public static Transformer scale(double startScale, double endScale, long duration, Easing easing)
      Scales the particle coordinates from a starting multiplier to an ending multiplier.
      Parameters:
      startScale - The initial scale factor applied at tick 0.
      endScale - The final scale factor applied at the end of the duration.
      duration - The total time in ticks for the scaling process to complete.
      easing - The Easing function controlling the interpolation speed.
      Returns:
      A Transformer that modifies the vector magnitude over time.
    • translate

      public static Transformer translate(org.bukkit.util.Vector totalOffset, long duration, Easing easing)
      Translates (moves) the particles toward a target offset vector.
      Parameters:
      totalOffset - The final Vector offset that will be applied by the end of the duration.
      duration - The total time in ticks for the translation to reach the final offset.
      easing - The Easing function controlling the movement interpolation.
      Returns:
      A Transformer that shifts coordinates over time.
    • breathe

      public static Transformer breathe(double minScale, double maxScale, long duration)
      Creates a cyclical "breathing" animation that pulses the scale using a sine wave. Unlike other animations in this class, this does not use an external Easing function as the harmonic motion is inherently defined by the sine curve.
      Parameters:
      minScale - The minimum scale factor at the bottom of the pulse.
      maxScale - The maximum scale factor at the peak of the pulse.
      duration - The number of ticks required to complete one full oscillation (inhale and exhale).
      Returns:
      A Transformer that applies a cyclical scaling effect.