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
-
Method Summary
Modifier and TypeMethodDescriptionstatic floatbackEaseIn(Point2D a, Point2D b, float x) static floatbackEaseIn(Point2D a, Point2D b, float x, float c1) BACK EASING - Generates a curve that comes back a little at the end (defined by an amount a >= 0)static floatbackEaseInOut(Point2D a, Point2D b, float x) static floatbackEaseInOut(Point2D a, Point2D b, float x, float c1) static floatbackEaseOut(Point2D a, Point2D b, float x) static floatbackEaseOut(Point2D a, Point2D b, float x, float c1) static floatstatic floatbounceEaseIn(Point2D a, Point2D b, float x) static floatbounceEaseIn(Point2D a, Point2D b, float x, int c) BOUNCE EASING - Generated by an elastic absolutedstatic floatbounceEaseInOut(Point2D a, Point2D b, float x) static floatbounceEaseInOut(Point2D a, Point2D b, float x, int c) static floatbounceEaseOut(Point2D a, Point2D b, float x) static floatbounceEaseOut(Point2D a, Point2D b, float x, int c) static floatcircEaseIn(Point2D a, Point2D b, float x) static floatcircEaseIn(Point2D a, Point2D b, float x, int roundness) CICRULAR EASING - Uses Roots and Powers to make curvesstatic floatcircEaseInOut(Point2D a, Point2D b, float x) static floatcircEaseInOut(Point2D a, Point2D b, float x, int roundness) static floatcircEaseOut(Point2D a, Point2D b, float x) static floatcircEaseOut(Point2D a, Point2D b, float x, int roundness) static floatcubicEaseIn(Point2D a, Point2D b, float x) CUBIC EASING - Generated using Poly and assuming c = 3static floatcubicEaseInOut(Point2D a, Point2D b, float x) static floatcubicEaseOut(Point2D a, Point2D b, float x) static floatelasticEaseIn(Point2D a, Point2D b, float x) static floatelasticEaseIn(Point2D a, Point2D b, float x, int c) ELASTIC EASING - Generated by Cosine and a variable "c" of the curves intensitystatic floatelasticEaseInOut(Point2D a, Point2D b, float x) static floatelasticEaseInOut(Point2D a, Point2D b, float x, int c) static floatelasticEaseOut(Point2D a, Point2D b, float x) static floatelasticEaseOut(Point2D a, Point2D b, float x, int c) static floatexpoEaseIn(Point2D a, Point2D b, float x) EXPONENTIAL EASING - Generated by 2^xstatic floatexpoEaseInOut(Point2D a, Point2D b, float x) static floatexpoEaseOut(Point2D a, Point2D b, float x) static floatstatic floatstatic floatstatic floatlegAnimation(float base, float limbAngle, float limbDistance) static floatlegAnimation(float base, float limbAngle, float limbDistance, boolean inverted) static floatlegAnimation(float base, float range, float frequency, float limbAngle, float limbDistance) static floatlegAnimation(float base, float range, float frequency, float limbAngle, float limbDistance, boolean inverted) static floatLOOP 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 floatstatic floatpolyEaseIn(Point2D a, Point2D b, float x, float c) POLYNOMIAL EASING - Generated by elevating x at a "c" valuestatic floatpolyEaseInOut(Point2D a, Point2D b, float x, float c) static floatpolyEaseOut(Point2D a, Point2D b, float x, float c) static floatquadraticEaseIn(Point2D a, Point2D b, float x) QUADRATIC EASING - Generated using Poly and assuming c = 2static floatquadraticEaseInOut(Point2D a, Point2D b, float x) static floatquadraticEaseOut(Point2D a, Point2D b, float x) static floatquarticEaseIn(Point2D a, Point2D b, float x) QUARTIC EASING - Generated using Poly and assuming c = 4static floatquarticEaseInOut(Point2D a, Point2D b, float x) static floatquarticEaseOut(Point2D a, Point2D b, float x) static floatquinticEaseIn(Point2D a, Point2D b, float x) QUINTIC EASING - Generated using Poly and assuming c = 5static floatquinticEaseInOut(Point2D a, Point2D b, float x) static floatquinticEaseOut(Point2D a, Point2D b, float x) static floatrawSeed(float seed) Deprecated.Use seed() instead of this!static floatstatic floatseed(float seed) ExecutesrawSeed(float)multiple times to make the number look more "random"static floatConvert a 2D position with a seed in a resulting seedstatic floatsineEaseIn(Point2D a, Point2D b, float x) SINE EASING - Generated using Math.sin()static floatsineEaseInOut(Point2D a, Point2D b, float x) static floatsineEaseOut(Point2D a, Point2D b, float x)
-
Method Details
-
relativeX
-
rawSeed
Deprecated.Use seed() instead of this!Generates a "random" number depending on another number. -
seed
public static float seed(float seed) ExecutesrawSeed(float)multiple times to make the number look more "random" -
seed2D
Convert a 2D position with a seed in a resulting seed -
legAnimation
public static float legAnimation(float base, float range, float frequency, float limbAngle, float limbDistance, boolean inverted) -
legAnimation
public static float legAnimation(float base, float range, float frequency, float limbAngle, float limbDistance) -
legAnimation
public static float legAnimation(float base, float limbAngle, float limbDistance, boolean inverted) -
legAnimation
public static float legAnimation(float base, float limbAngle, float 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
-