Package net.frozenblock.lib.math.api
Class AnimationAPI
java.lang.Object
net.frozenblock.lib.math.api.AnimationAPI
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublebackEaseIn(Point2D a, Point2D b, double x) static doublebackEaseIn(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)static doublebackEaseInOut(Point2D a, Point2D b, double x) static doublebackEaseInOut(Point2D a, Point2D b, double x, double c1) static doublebackEaseOut(Point2D a, Point2D b, double x) static doublebackEaseOut(Point2D a, Point2D b, double x, double c1) static doublestatic doublebounceEaseIn(Point2D a, Point2D b, double x) static doublebounceEaseIn(Point2D a, Point2D b, double x, int c) BOUNCE EASING - Generated by an elastic absolutedstatic doublebounceEaseInOut(Point2D a, Point2D b, double x) static doublebounceEaseInOut(Point2D a, Point2D b, double x, int c) static doublebounceEaseOut(Point2D a, Point2D b, double x) static doublebounceEaseOut(Point2D a, Point2D b, double x, int c) static doublecircEaseIn(Point2D a, Point2D b, double x) static doublecircEaseIn(Point2D a, Point2D b, double x, int roundness) CICRULAR EASING - Uses Roots and Powers to make curvesstatic doublecircEaseInOut(Point2D a, Point2D b, double x) static doublecircEaseInOut(Point2D a, Point2D b, double x, int roundness) static doublecircEaseOut(Point2D a, Point2D b, double x) static doublecircEaseOut(Point2D a, Point2D b, double x, int roundness) static doublecubicEaseIn(Point2D a, Point2D b, double x) CUBIC EASING - Generated using Poly and assuming c = 3static doublecubicEaseInOut(Point2D a, Point2D b, double x) static doublecubicEaseOut(Point2D a, Point2D b, double x) static doubleelasticEaseIn(Point2D a, Point2D b, double x) static doubleelasticEaseIn(Point2D a, Point2D b, double x, int c) ELASTIC EASING - Generated by Cosine and a variable "c" of the curves intensitystatic doubleelasticEaseInOut(Point2D a, Point2D b, double x) static doubleelasticEaseInOut(Point2D a, Point2D b, double x, int c) static doubleelasticEaseOut(Point2D a, Point2D b, double x) static doubleelasticEaseOut(Point2D a, Point2D b, double x, int c) static doubleexpoEaseIn(Point2D a, Point2D b, double x) EXPONENTIAL EASING - Generated by 2^xstatic doubleexpoEaseInOut(Point2D a, Point2D b, double x) static doubleexpoEaseOut(Point2D a, Point2D b, double x) static doublestatic doublestatic doublestatic doublelegAnimation(double base, double limbAngle, double limbDistance) static doublelegAnimation(double base, double limbAngle, double limbDistance, boolean inverted) static doublelegAnimation(double base, double range, double frequency, double limbAngle, double limbDistance) static doublelegAnimation(double base, double range, double frequency, double limbAngle, double limbDistance, boolean inverted) static doubleLOOP 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 loopstatic doublestatic doublepolyEaseIn(Point2D a, Point2D b, double x, double c) POLYNOMIAL EASING - Generated by elevating x at a "c" valuestatic doublepolyEaseInOut(Point2D a, Point2D b, double x, double c) static doublepolyEaseOut(Point2D a, Point2D b, double x, double c) static doublequadraticEaseIn(Point2D a, Point2D b, double x) QUADRATIC EASING - Generated using Poly and assuming c = 2static doublequadraticEaseInOut(Point2D a, Point2D b, double x) static doublequadraticEaseOut(Point2D a, Point2D b, double x) static doublequarticEaseIn(Point2D a, Point2D b, double x) QUARTIC EASING - Generated using Poly and assuming c = 4static doublequarticEaseInOut(Point2D a, Point2D b, double x) static doublequarticEaseOut(Point2D a, Point2D b, double x) static doublequinticEaseIn(Point2D a, Point2D b, double x) QUINTIC EASING - Generated using Poly and assuming c = 5static doublequinticEaseInOut(Point2D a, Point2D b, double x) static doublequinticEaseOut(Point2D a, Point2D b, double x) static doublerawSeed(double seed) Deprecated.Use seed() instead of this!static doublestatic doubleseed(double seed) ExecutesrawSeed(double)multiple times to make the number look more "random"static doubleConvert a 2D position with a seed in a resulting seedstatic doublesineEaseIn(Point2D a, Point2D b, double x) SINE EASING - Generated using Math.sin()static doublesineEaseInOut(Point2D a, Point2D b, double x) static doublesineEaseOut(Point2D a, Point2D b, double x)
-
Constructor Details
-
AnimationAPI
public AnimationAPI()
-
-
Method Details
-
relativeX
-
rawSeed
Deprecated.Use seed() instead of this!Generates a "random" number depending on another number. -
seed
public static double seed(double seed) ExecutesrawSeed(double)multiple times to make the number look more "random" -
seed2D
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
SINE EASING - Generated using Math.sin() -
sineEaseOut
-
sineEaseInOut
-
polyEaseIn
POLYNOMIAL EASING - Generated by elevating x at a "c" value -
polyEaseOut
-
polyEaseInOut
-
quadraticEaseIn
QUADRATIC EASING - Generated using Poly and assuming c = 2 -
quadraticEaseOut
-
quadraticEaseInOut
-
cubicEaseIn
CUBIC EASING - Generated using Poly and assuming c = 3 -
cubicEaseOut
-
cubicEaseInOut
-
quarticEaseIn
QUARTIC EASING - Generated using Poly and assuming c = 4 -
quarticEaseOut
-
quarticEaseInOut
-
quinticEaseIn
QUINTIC EASING - Generated using Poly and assuming c = 5 -
quinticEaseOut
-
quinticEaseInOut
-
expoEaseIn
EXPONENTIAL EASING - Generated by 2^x -
expoEaseOut
-
expoEaseInOut
-
circEaseIn
CICRULAR EASING - Uses Roots and Powers to make curves -
circEaseOut
-
circEaseInOut
-
circEaseIn
-
circEaseOut
-
circEaseInOut
-
elasticEaseIn
ELASTIC EASING - Generated by Cosine and a variable "c" of the curves intensity -
elasticEaseOut
-
elasticEaseInOut
-
elasticEaseIn
-
elasticEaseOut
-
elasticEaseInOut
-
bounceEaseIn
BOUNCE EASING - Generated by an elastic absoluted -
bounceEaseOut
-
bounceEaseInOut
-
bounceEaseIn
-
bounceEaseOut
-
bounceEaseInOut
-
backEaseIn
BACK EASING - Generates a curve that comes back a little at the end (defined by an amount a >= 0) -
backEaseOut
-
backEaseInOut
-
backEaseIn
-
backEaseOut
-
backEaseInOut
-
line
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
-
flat2
-
inverse
-
boomerang
-
loop
-