public class MathHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static double[] |
ASINE_TAB |
private static double[] |
COS_TAB |
private static double |
FRAC_BIAS |
private static int[] |
MULTIPLY_DE_BRUIJN_BIT_POSITION |
private static java.util.Random |
RANDOM |
private static float[] |
SIN_TABLE |
static float |
SQRT_2 |
Constructor and Description |
---|
MathHelper() |
Modifier and Type | Method and Description |
---|---|
static float |
abs(float value) |
static int |
abs(int value) |
static int |
absFloor(double value) |
static double |
absMax(double x,
double y) |
static float |
approach(float p_203300_0_,
float p_203300_1_,
float p_203300_2_) |
static float |
approachDegrees(float p_203303_0_,
float p_203303_1_,
float p_203303_2_) |
static double |
atan2(double p_181159_0_,
double p_181159_2_) |
static double |
average(long[] values) |
static int |
binarySearch(int min,
int max,
java.util.function.IntPredicate isTargetBeforeOrAt) |
static int |
ceil(double value) |
static int |
ceil(float value) |
static double |
clamp(double num,
double min,
double max) |
static float |
clamp(float num,
float min,
float max) |
static int |
clamp(int num,
int min,
int max) |
static long |
clamp(long num,
long min,
long max) |
static double |
clampedLerp(double lowerBnd,
double upperBnd,
double slide) |
static float |
cos(float value) |
static float |
degreesDifferenceAbs(float p_203301_0_,
float p_203301_1_) |
static boolean |
epsilonEquals(double x,
double y) |
static boolean |
epsilonEquals(float x,
float y) |
static int |
fastFloor(double value) |
static float |
fastInvCubeRoot(float number) |
static double |
fastInvSqrt(double number) |
static float |
fastInvSqrt(float number) |
static int |
floor(double value) |
static int |
floor(float value) |
static double |
frac(double number) |
static float |
frac(float number) |
static float |
func_219800_b(float p_219800_0_,
float p_219800_1_,
float p_219800_2_) |
static long |
getCoordinateRandom(int x,
int y,
int z) |
static double |
getDouble(java.lang.String value,
double defaultValue) |
static double |
getDouble(java.lang.String value,
double defaultValue,
double max) |
static int |
getInt(java.lang.String value,
int defaultValue) |
static int |
getInt(java.lang.String value,
int defaultValue,
int max) |
static long |
getPositionRandom(Vec3i pos) |
static java.util.UUID |
getRandomUUID() |
static java.util.UUID |
getRandomUUID(java.util.Random rand) |
static int |
hash(int p_188208_0_) |
static int |
hsvToRGB(float hue,
float saturation,
float value) |
static float |
interpolateAngle(float p_219805_0_,
float p_219805_1_,
float p_219805_2_) |
static int |
intFloorDiv(int x,
int y) |
private static boolean |
isPowerOfTwo(int value) |
static double |
lerp(double pct,
double start,
double end) |
static float |
lerp(float pct,
float start,
float end) |
static double |
lerp2(double p_219804_0_,
double p_219804_2_,
double p_219804_4_,
double p_219804_6_,
double p_219804_8_,
double p_219804_10_) |
static double |
lerp3(double p_219807_0_,
double p_219807_2_,
double p_219807_4_,
double p_219807_6_,
double p_219807_8_,
double p_219807_10_,
double p_219807_12_,
double p_219807_14_,
double p_219807_16_,
double p_219807_18_,
double p_219807_20_) |
static long |
lfloor(double value) |
static int |
log2(int value) |
static int |
log2DeBruijn(int value) |
static double |
nextDouble(java.util.Random random,
double minimum,
double maximum) |
static float |
nextFloat(java.util.Random random,
float minimum,
float maximum) |
static int |
nextInt(java.util.Random random,
int minimum,
int maximum) |
static int |
normalizeAngle(int x,
int y) |
static double |
pct(double p_181160_0_,
double p_181160_2_,
double p_181160_4_) |
static double |
perlinFade(double p_219801_0_) |
static double |
positiveModulo(double numerator,
double denominator) |
static float |
positiveModulo(float numerator,
float denominator) |
static int |
rgb(float rIn,
float gIn,
float bIn) |
static int |
rgb(int rIn,
int gIn,
int bIn) |
static float |
rotLerp(float p_226167_0_,
float p_226167_1_,
float p_226167_2_)
Deprecated.
|
static float |
rotWrap(double p_226168_0_)
Deprecated.
|
static int |
roundUp(int number,
int interval) |
static int |
signum(double x) |
static float |
sin(float value) |
static int |
smallestEncompassingPowerOfTwo(int value) |
static float |
sqrt(double value) |
static float |
sqrt(float value) |
static double |
wrapDegrees(double value) |
static float |
wrapDegrees(float value) |
static int |
wrapDegrees(int angle) |
static float |
wrapSubtractDegrees(float p_203302_0_,
float p_203302_1_) |
public static final float SQRT_2
private static final float[] SIN_TABLE
private static final java.util.Random RANDOM
private static final int[] MULTIPLY_DE_BRUIJN_BIT_POSITION
private static final double FRAC_BIAS
private static final double[] ASINE_TAB
private static final double[] COS_TAB
public static float sin(float value)
public static float cos(float value)
public static float sqrt(float value)
public static float sqrt(double value)
public static int floor(float value)
public static int fastFloor(double value)
public static int floor(double value)
public static long lfloor(double value)
public static int absFloor(double value)
public static float abs(float value)
public static int abs(int value)
public static int ceil(float value)
public static int ceil(double value)
public static int clamp(int num, int min, int max)
public static long clamp(long num, long min, long max)
public static float clamp(float num, float min, float max)
public static double clamp(double num, double min, double max)
public static double clampedLerp(double lowerBnd, double upperBnd, double slide)
public static double absMax(double x, double y)
public static int intFloorDiv(int x, int y)
public static int nextInt(java.util.Random random, int minimum, int maximum)
public static float nextFloat(java.util.Random random, float minimum, float maximum)
public static double nextDouble(java.util.Random random, double minimum, double maximum)
public static double average(long[] values)
public static boolean epsilonEquals(float x, float y)
public static boolean epsilonEquals(double x, double y)
public static int normalizeAngle(int x, int y)
public static float positiveModulo(float numerator, float denominator)
public static double positiveModulo(double numerator, double denominator)
public static int wrapDegrees(int angle)
public static float wrapDegrees(float value)
public static double wrapDegrees(double value)
public static float wrapSubtractDegrees(float p_203302_0_, float p_203302_1_)
public static float degreesDifferenceAbs(float p_203301_0_, float p_203301_1_)
public static float func_219800_b(float p_219800_0_, float p_219800_1_, float p_219800_2_)
public static float approach(float p_203300_0_, float p_203300_1_, float p_203300_2_)
public static float approachDegrees(float p_203303_0_, float p_203303_1_, float p_203303_2_)
public static int getInt(java.lang.String value, int defaultValue)
public static int getInt(java.lang.String value, int defaultValue, int max)
public static double getDouble(java.lang.String value, double defaultValue)
public static double getDouble(java.lang.String value, double defaultValue, double max)
public static int smallestEncompassingPowerOfTwo(int value)
private static boolean isPowerOfTwo(int value)
public static int log2DeBruijn(int value)
public static int log2(int value)
public static int roundUp(int number, int interval)
public static int rgb(float rIn, float gIn, float bIn)
public static int rgb(int rIn, int gIn, int bIn)
public static float frac(float number)
public static double frac(double number)
public static long getPositionRandom(Vec3i pos)
public static long getCoordinateRandom(int x, int y, int z)
public static java.util.UUID getRandomUUID(java.util.Random rand)
public static java.util.UUID getRandomUUID()
public static double pct(double p_181160_0_, double p_181160_2_, double p_181160_4_)
public static double atan2(double p_181159_0_, double p_181159_2_)
public static float fastInvSqrt(float number)
public static double fastInvSqrt(double number)
public static float fastInvCubeRoot(float number)
public static int hsvToRGB(float hue, float saturation, float value)
public static int hash(int p_188208_0_)
public static int binarySearch(int min, int max, java.util.function.IntPredicate isTargetBeforeOrAt)
public static float lerp(float pct, float start, float end)
public static double lerp(double pct, double start, double end)
public static double lerp2(double p_219804_0_, double p_219804_2_, double p_219804_4_, double p_219804_6_, double p_219804_8_, double p_219804_10_)
public static double lerp3(double p_219807_0_, double p_219807_2_, double p_219807_4_, double p_219807_6_, double p_219807_8_, double p_219807_10_, double p_219807_12_, double p_219807_14_, double p_219807_16_, double p_219807_18_, double p_219807_20_)
public static double perlinFade(double p_219801_0_)
public static int signum(double x)
public static float interpolateAngle(float p_219805_0_, float p_219805_1_, float p_219805_2_)
@Deprecated public static float rotLerp(float p_226167_0_, float p_226167_1_, float p_226167_2_)
@Deprecated public static float rotWrap(double p_226168_0_)