Class Animations
java.lang.Object
com.github.darksoulq.abyssallib.world.particle.timeline.Animations
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 TypeMethodDescriptionstatic Transformerbreathe(double minScale, double maxScale, long duration) Creates a cyclical "breathing" animation that pulses the scale using a sine wave.static TransformerScales the particle coordinates from a starting multiplier to an ending multiplier.static TransformerCreates an animation that rotates particles around the X-axis over time.static TransformerCreates an animation that rotates particles around the Y-axis over time.static TransformerCreates an animation that rotates particles around the Z-axis over time.static TransformerTranslates (moves) the particles toward a target offset vector.
-
Method Details
-
spinY
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- TheEasingfunction used to determine the rotation curve.- Returns:
- A
Transformerthat applies eased Y-axis rotation based on current tick.
-
spinX
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- TheEasingfunction used to determine the rotation curve.- Returns:
- A
Transformerthat applies eased X-axis rotation based on current tick.
-
spinZ
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- TheEasingfunction used to determine the rotation curve.- Returns:
- A
Transformerthat applies eased Z-axis rotation based on current tick.
-
scale
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- TheEasingfunction controlling the interpolation speed.- Returns:
- A
Transformerthat 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 finalVectoroffset 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- TheEasingfunction controlling the movement interpolation.- Returns:
- A
Transformerthat shifts coordinates over time.
-
breathe
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
Transformerthat applies a cyclical scaling effect.
-