Class AnimationAPI

java.lang.Object
net.frozenblock.lib.math.api.AnimationAPI

@Obsolete(since="Minecraft 1.19") public class AnimationAPI extends Object
This class is used to make animations with easings.

Defining a point A(x,y) and B(x,y) you can create an animation between those two points ( A.getY() won't affect the animation).

Learn more at the README

Since:
4.0
  • Constructor Details

    • AnimationAPI

      public AnimationAPI()
  • Method Details

    • relativeX

      public static double relativeX(Point2D a, Point2D b, double x)
    • rawSeed

      @Deprecated public static double rawSeed(double seed)
      Deprecated.
      Use seed() instead of this!
      Generates a "random" number depending on another number.
    • seed

      public static double seed(double seed)
      Executes rawSeed(double) multiple times to make the number look more "random"
    • seed2D

      public static double seed2D(Point2D seed2d, double seed)
      Convert a 2D position with a seed in a resulting seed
    • legAnimation

      public static double legAnimation(double base, double range, double frequency, double limbAngle, double limbDistance, boolean inverted)
    • legAnimation

      public static double legAnimation(double base, double range, double frequency, double limbAngle, double limbDistance)
    • legAnimation

      public static double legAnimation(double base, double limbAngle, double limbDistance, boolean inverted)
    • legAnimation

      public static double legAnimation(double base, double limbAngle, double limbDistance)
    • sineEaseIn

      public static double sineEaseIn(Point2D a, Point2D b, double x)
      SINE EASING - Generated using Math.sin()
    • sineEaseOut

      public static double sineEaseOut(Point2D a, Point2D b, double x)
    • sineEaseInOut

      public static double sineEaseInOut(Point2D a, Point2D b, double x)
    • polyEaseIn

      public static double polyEaseIn(Point2D a, Point2D b, double x, double c)
      POLYNOMIAL EASING - Generated by elevating x at a "c" value
    • polyEaseOut

      public static double polyEaseOut(Point2D a, Point2D b, double x, double c)
    • polyEaseInOut

      public static double polyEaseInOut(Point2D a, Point2D b, double x, double c)
    • quadraticEaseIn

      public static double quadraticEaseIn(Point2D a, Point2D b, double x)
      QUADRATIC EASING - Generated using Poly and assuming c = 2
    • quadraticEaseOut

      public static double quadraticEaseOut(Point2D a, Point2D b, double x)
    • quadraticEaseInOut

      public static double quadraticEaseInOut(Point2D a, Point2D b, double x)
    • cubicEaseIn

      public static double cubicEaseIn(Point2D a, Point2D b, double x)
      CUBIC EASING - Generated using Poly and assuming c = 3
    • cubicEaseOut

      public static double cubicEaseOut(Point2D a, Point2D b, double x)
    • cubicEaseInOut

      public static double cubicEaseInOut(Point2D a, Point2D b, double x)
    • quarticEaseIn

      public static double quarticEaseIn(Point2D a, Point2D b, double x)
      QUARTIC EASING - Generated using Poly and assuming c = 4
    • quarticEaseOut

      public static double quarticEaseOut(Point2D a, Point2D b, double x)
    • quarticEaseInOut

      public static double quarticEaseInOut(Point2D a, Point2D b, double x)
    • quinticEaseIn

      public static double quinticEaseIn(Point2D a, Point2D b, double x)
      QUINTIC EASING - Generated using Poly and assuming c = 5
    • quinticEaseOut

      public static double quinticEaseOut(Point2D a, Point2D b, double x)
    • quinticEaseInOut

      public static double quinticEaseInOut(Point2D a, Point2D b, double x)
    • expoEaseIn

      public static double expoEaseIn(Point2D a, Point2D b, double x)
      EXPONENTIAL EASING - Generated by 2^x
    • expoEaseOut

      public static double expoEaseOut(Point2D a, Point2D b, double x)
    • expoEaseInOut

      public static double expoEaseInOut(Point2D a, Point2D b, double x)
    • circEaseIn

      public static double circEaseIn(Point2D a, Point2D b, double x, int roundness)
      CICRULAR EASING - Uses Roots and Powers to make curves
    • circEaseOut

      public static double circEaseOut(Point2D a, Point2D b, double x, int roundness)
    • circEaseInOut

      public static double circEaseInOut(Point2D a, Point2D b, double x, int roundness)
    • circEaseIn

      public static double circEaseIn(Point2D a, Point2D b, double x)
    • circEaseOut

      public static double circEaseOut(Point2D a, Point2D b, double x)
    • circEaseInOut

      public static double circEaseInOut(Point2D a, Point2D b, double x)
    • elasticEaseIn

      public static double elasticEaseIn(Point2D a, Point2D b, double x, int c)
      ELASTIC EASING - Generated by Cosine and a variable "c" of the curves intensity
    • elasticEaseOut

      public static double elasticEaseOut(Point2D a, Point2D b, double x, int c)
    • elasticEaseInOut

      public static double elasticEaseInOut(Point2D a, Point2D b, double x, int c)
    • elasticEaseIn

      public static double elasticEaseIn(Point2D a, Point2D b, double x)
    • elasticEaseOut

      public static double elasticEaseOut(Point2D a, Point2D b, double x)
    • elasticEaseInOut

      public static double elasticEaseInOut(Point2D a, Point2D b, double x)
    • bounceEaseIn

      public static double bounceEaseIn(Point2D a, Point2D b, double x, int c)
      BOUNCE EASING - Generated by an elastic absoluted
    • bounceEaseOut

      public static double bounceEaseOut(Point2D a, Point2D b, double x, int c)
    • bounceEaseInOut

      public static double bounceEaseInOut(Point2D a, Point2D b, double x, int c)
    • bounceEaseIn

      public static double bounceEaseIn(Point2D a, Point2D b, double x)
    • bounceEaseOut

      public static double bounceEaseOut(Point2D a, Point2D b, double x)
    • bounceEaseInOut

      public static double bounceEaseInOut(Point2D a, Point2D b, double x)
    • backEaseIn

      public static double backEaseIn(Point2D a, Point2D b, double x, double c1)
      BACK EASING - Generates a curve that comes back a little at the end (defined by an amount a >= 0)
    • backEaseOut

      public static double backEaseOut(Point2D a, Point2D b, double x, double c1)
    • backEaseInOut

      public static double backEaseInOut(Point2D a, Point2D b, double x, double c1)
    • backEaseIn

      public static double backEaseIn(Point2D a, Point2D b, double x)
    • backEaseOut

      public static double backEaseOut(Point2D a, Point2D b, double x)
    • backEaseInOut

      public static double backEaseInOut(Point2D a, Point2D b, double x)
    • line

      public static double line(Point2D a, Point2D b, double x)
      LOOP SYSTEM Loop: defines A and B and always repeat between these two values Boomerang: creates a loop but instead of repeating it from start, it comes back and THEN loop
    • flat

      public static double flat(Point2D a, Point2D b, double x)
    • flat2

      public static double flat2(Point2D a, Point2D b, double x)
    • inverse

      public static double inverse(Point2D a, Point2D b, double x)
    • boomerang

      public static double boomerang(Point2D a, Point2D b, double x)
    • loop

      public static double loop(Point2D a, Point2D b, double x)