Package net.pl3x.map.core.util
Class Mathf
java.lang.Object
net.pl3x.map.core.util.Mathf
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
asLong
(long x, long z) static long
static double
clamp
(double min, double max, double value) static float
clamp
(float min, float max, float value) static int
clamp
(int min, int max, int value) static int
distanceSquared
(int x1, int z1, int x2, int z2) static float
inverseLerp
(float a, float b, float t) static float
lerp
(float a, float b, float t) static int
longToX
(long pos) static int
longToZ
(long pos) static int
pow2
(int value) static int
square
(int n)
-
Constructor Details
-
Mathf
public Mathf()
-
-
Method Details
-
lerp
public static float lerp(float a, float b, float t) -
inverseLerp
public static float inverseLerp(float a, float b, float t) -
clamp
public static double clamp(double min, double max, double value) -
clamp
public static float clamp(float min, float max, float value) -
clamp
public static int clamp(int min, int max, int value) -
distanceSquared
public static int distanceSquared(int x1, int z1, int x2, int z2) -
square
public static int square(int n) -
pow2
public static int pow2(int value) -
asLong
-
asLong
public static long asLong(long x, long z) -
longToX
public static int longToX(long pos) -
longToZ
public static int longToZ(long pos)
-