public class MathHelper
extends java.lang.Object
Constructor and Description |
---|
MathHelper() |
Modifier and Type | Method and Description |
---|---|
static int |
abs_int(int par0)
Returns the unsigned value of an int.
|
static double |
abs_max(double par0,
double par2)
Maximum of the absolute value of two numbers.
|
static float |
abs(float par0) |
static double |
average(long[] par0ArrayOfLong) |
static int |
bucketInt(int par0,
int par1)
Buckets an integer with specifed bucket sizes.
|
static int |
calculateLogBaseTwo(int p_151239_0_)
Efficiently calculates the floor of the base-2 log of an integer value.
|
static int |
ceiling_double_int(double par0) |
static int |
ceiling_float_int(float par0) |
static double |
clamp_double(double p_151237_0_,
double p_151237_2_,
double p_151237_4_) |
static float |
clamp_float(float par0,
float par1,
float par2)
Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and
third parameters
|
static int |
clamp_int(int par0,
int par1,
int par2)
Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and
third parameters.
|
static float |
cos(float par0)
cos looked up in the sin table with the appropriate offset
|
static double |
denormalizeClamp(double p_151238_0_,
double p_151238_2_,
double p_151238_4_) |
static long |
floor_double_long(double par0)
Long version of floor_double
|
static int |
floor_double(double par0)
Returns the greatest integer less than or equal to the double argument
|
static int |
floor_float(float par0)
Returns the greatest integer less than or equal to the float argument
|
static double |
getRandomDoubleInRange(java.util.Random par0Random,
double par1,
double par3) |
static int |
getRandomIntegerInRange(java.util.Random par0Random,
int par1,
int par2) |
static double |
parseDoubleWithDefault(java.lang.String par0Str,
double par1)
parses the string as double or returns the second parameter if it fails.
|
static double |
parseDoubleWithDefaultAndMax(java.lang.String par0Str,
double par1,
double par3) |
static int |
parseIntWithDefault(java.lang.String par0Str,
int par1)
parses the string as integer or returns the second parameter if it fails
|
static int |
parseIntWithDefaultAndMax(java.lang.String par0Str,
int par1,
int par2)
parses the string as integer or returns the second parameter if it fails.
|
static float |
randomFloatClamp(java.util.Random p_151240_0_,
float p_151240_1_,
float p_151240_2_) |
static int |
roundUpToPowerOfTwo(int p_151236_0_)
Returns the input value rounded up to the next highest power of two.
|
static float |
sin(float par0)
sin looked up in a table
|
static float |
sqrt_double(double par0) |
static float |
sqrt_float(float par0) |
static boolean |
stringNullOrLengthZero(java.lang.String par0Str)
Tests if a string is null or of length zero
|
static int |
truncateDoubleToInt(double par0)
returns par0 cast as an int, and no greater than Integer.MAX_VALUE-1024
|
static double |
wrapAngleTo180_double(double par0)
the angle is reduced to an angle between -180 and +180 by mod, and a 360 check
|
static float |
wrapAngleTo180_float(float par0)
the angle is reduced to an angle between -180 and +180 by mod, and a 360 check
|
public static final float sin(float par0)
public static final float cos(float par0)
public static final float sqrt_float(float par0)
public static final float sqrt_double(double par0)
public static int floor_float(float par0)
public static int truncateDoubleToInt(double par0)
public static int floor_double(double par0)
public static long floor_double_long(double par0)
public static float abs(float par0)
public static int abs_int(int par0)
public static int ceiling_float_int(float par0)
public static int ceiling_double_int(double par0)
public static int clamp_int(int par0, int par1, int par2)
public static float clamp_float(float par0, float par1, float par2)
public static double clamp_double(double p_151237_0_, double p_151237_2_, double p_151237_4_)
public static double denormalizeClamp(double p_151238_0_, double p_151238_2_, double p_151238_4_)
public static double abs_max(double par0, double par2)
public static int bucketInt(int par0, int par1)
public static boolean stringNullOrLengthZero(java.lang.String par0Str)
public static int getRandomIntegerInRange(java.util.Random par0Random, int par1, int par2)
public static float randomFloatClamp(java.util.Random p_151240_0_, float p_151240_1_, float p_151240_2_)
public static double getRandomDoubleInRange(java.util.Random par0Random, double par1, double par3)
public static double average(long[] par0ArrayOfLong)
public static float wrapAngleTo180_float(float par0)
public static double wrapAngleTo180_double(double par0)
public static int parseIntWithDefault(java.lang.String par0Str, int par1)
public static int parseIntWithDefaultAndMax(java.lang.String par0Str, int par1, int par2)
public static double parseDoubleWithDefault(java.lang.String par0Str, double par1)
public static double parseDoubleWithDefaultAndMax(java.lang.String par0Str, double par1, double par3)
public static int roundUpToPowerOfTwo(int p_151236_0_)
public static int calculateLogBaseTwo(int p_151239_0_)