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 p_76132_0_,
double p_76132_2_) |
static double |
atan2(double p_181159_0_,
double p_181159_2_) |
static double |
average(long[] values) |
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 double |
clampedLerp(double lowerBnd,
double upperBnd,
double slide) |
static float |
cos(float value) |
static boolean |
epsilonEquals(float p_180185_0_,
float p_180185_1_) |
static int |
fastFloor(double value) |
static double |
fastInvSqrt(double p_181161_0_) |
static int |
floor(double value) |
static int |
floor(float value) |
static double |
frac(double number) |
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.util.Random random,
int minimum,
int maximum) |
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 int |
intFloorDiv(int p_76137_0_,
int p_76137_1_) |
private static boolean |
isPowerOfTwo(int value) |
static long |
lfloor(double value) |
static int |
log2(int value) |
static int |
log2DeBruijn(int value) |
static int |
multiplyColor(int p_180188_0_,
int p_180188_1_) |
static double |
nextDouble(java.util.Random random,
double minimum,
double maximum) |
static float |
nextFloat(java.util.Random random,
float minimum,
float maximum) |
static int |
normalizeAngle(int p_180184_0_,
int p_180184_1_) |
static double |
pct(double p_181160_0_,
double p_181160_2_,
double p_181160_4_) |
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 int |
roundUp(int number,
int interval) |
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) |
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 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 p_76132_0_, double p_76132_2_)
public static int intFloorDiv(int p_76137_0_, int p_76137_1_)
public static int getInt(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 p_180185_0_, float p_180185_1_)
public static int normalizeAngle(int p_180184_0_, int p_180184_1_)
public static float positiveModulo(float numerator, float denominator)
public static double positiveModulo(double numerator, double denominator)
public static float wrapDegrees(float value)
public static double wrapDegrees(double value)
public static int wrapDegrees(int angle)
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 long getCoordinateRandom(int x, int y, int z)
public static int rgb(float rIn, float gIn, float bIn)
public static int rgb(int rIn, int gIn, int bIn)
public static int multiplyColor(int p_180188_0_, int p_180188_1_)
public static double frac(double number)
public static long getPositionRandom(Vec3i pos)
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 double fastInvSqrt(double p_181161_0_)
public static int hsvToRGB(float hue, float saturation, float value)
public static int hash(int p_188208_0_)