Package net.minecraft.util
Class Mth
java.lang.Object
net.minecraft.util.Mth
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final double[]private static final double[]static final floatstatic final floatprivate static final doubleprivate static final intstatic final floatprivate static final intprivate static final int[]private static final doublestatic final floatstatic final floatprivate static final RandomSourceprivate static final float[]private static final floatstatic final floatstatic final floatprivate static final longprivate static final longprivate static final longprivate static final long - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic floatabs(float p_14155_) static intabs(int p_14041_) static doubleabsMax(double p_14006_, double p_14007_) static floatapproach(float p_14122_, float p_14123_, float p_14124_) static floatapproachDegrees(float p_14149_, float p_14150_, float p_14151_) static doubleatan2(double p_14137_, double p_14138_) static intbinarySearch(int p_14050_, int p_14051_, IntPredicate p_14052_) static floatcatmullrom(float p_216245_, float p_216246_, float p_216247_, float p_216248_, float p_216249_) static intceil(double p_14166_) static intceil(float p_14168_) static intceillog2(int p_14164_) static doubleclamp(double p_14009_, double p_14010_, double p_14011_) static floatclamp(float p_14037_, float p_14038_, float p_14039_) static intclamp(int p_14046_, int p_14047_, int p_14048_) static longclamp(long p_300696_, long p_298059_, long p_299237_) static doubleclampedLerp(double p_14086_, double p_14087_, double p_14088_) static floatclampedLerp(float p_144921_, float p_144922_, float p_144923_) static doubleclampedMap(double p_144852_, double p_144853_, double p_144854_, double p_144855_, double p_144856_) static floatclampedMap(float p_184632_, float p_184633_, float p_184634_, float p_184635_, float p_184636_) static intcolor(float p_14160_, float p_14161_, float p_14162_) static floatcos(float p_14090_) static UUIDstatic UUIDcreateInsecureUUID(RandomSource p_216262_) static floatdegreesDifference(float p_14119_, float p_14120_) static floatdegreesDifferenceAbs(float p_14146_, float p_14147_) static booleanequal(double p_14083_, double p_14084_) static booleanequal(float p_14034_, float p_14035_) static floatfastInvCubeRoot(float p_14200_) static doublefastInvSqrt(double p_14194_) Deprecated.static intfloor(double p_14108_) static intfloor(float p_14144_) static intfloorDiv(int p_14043_, int p_14044_) static doublefrac(double p_14186_) static floatfrac(float p_14188_) static intstatic longgetSeed(int p_14131_, int p_14132_, int p_14133_) Deprecated.static longDeprecated.static inthsvToRgb(float p_14170_, float p_14171_, float p_14172_) static doubleinverseLerp(double p_14113_, double p_14114_, double p_14115_) static floatinverseLerp(float p_184656_, float p_184657_, float p_184658_) static doubleinvSqrt(double p_265088_) static floatinvSqrt(float p_265060_) static booleanisMultipleOf(int p_265754_, int p_265543_) static booleanisPowerOfTwo(int p_14153_) static doublelength(double p_184646_, double p_184647_) static doublelength(double p_184649_, double p_184650_, double p_184651_) static doublelengthSquared(double p_211590_, double p_211591_) static doublelengthSquared(double p_211593_, double p_211594_, double p_211595_) static doublelerp(double p_14140_, double p_14141_, double p_14142_) static floatlerp(float p_14180_, float p_14181_, float p_14182_) static doublelerp2(double p_14013_, double p_14014_, double p_14015_, double p_14016_, double p_14017_, double p_14018_) static doublelerp3(double p_14020_, double p_14021_, double p_14022_, double p_14023_, double p_14024_, double p_14025_, double p_14026_, double p_14027_, double p_14028_, double p_14029_, double p_14030_) static intlerpDiscrete(float p_298397_, int p_298459_, int p_300125_) static intlerpInt(float p_270245_, int p_270597_, int p_270301_) static longlfloor(double p_14135_) static intlog2(int p_14174_) static doublemap(double p_144915_, double p_144916_, double p_144917_, double p_144918_, double p_144919_) static floatmap(float p_184638_, float p_184639_, float p_184640_, float p_184641_, float p_184642_) static intmurmurHash3Mixer(int p_14184_) static doublenextDouble(RandomSource p_216264_, double p_216265_, double p_216266_) static floatnextFloat(RandomSource p_216268_, float p_216269_, float p_216270_) static intnextInt(RandomSource p_216272_, int p_216273_, int p_216274_) static floatnormal(RandomSource p_216292_, float p_216293_, float p_216294_) static IntStreamoutFromOrigin(int p_216296_, int p_216297_, int p_216298_) static IntStreamoutFromOrigin(int p_216251_, int p_216252_, int p_216253_, int p_216254_) static intpositiveCeilDiv(int p_184653_, int p_184654_) static doublepositiveModulo(double p_14110_, double p_14111_) static floatpositiveModulo(float p_14092_, float p_14093_) static intpositiveModulo(int p_14101_, int p_14102_) static intquantize(double p_184629_, int p_184630_) static floatrandomBetween(RandomSource p_216284_, float p_216285_, float p_216286_) static intrandomBetweenInclusive(RandomSource p_216288_, int p_216289_, int p_216290_) static booleanrayIntersectsAABB(Vec3 p_144889_, Vec3 p_144890_, AABB p_144891_) static floatrotateIfNecessary(float p_14095_, float p_14096_, float p_14097_) static doublerotLerp(double p_299352_, double p_301019_, double p_299027_) static floatrotLerp(float p_14190_, float p_14191_, float p_14192_) static introundToward(int p_144942_, int p_144943_) static intsign(double p_14206_) static floatsin(float p_14032_) static intsmallestEncompassingPowerOfTwo(int p_14126_) static doublesmoothstep(double p_14198_) static doublesmoothstepDerivative(double p_144947_) static floatsqrt(float p_14117_) static doublesquare(double p_144953_) static floatsquare(float p_14208_) static intsquare(int p_144945_) static longsquare(long p_184644_) static floattriangleWave(float p_14157_, float p_14158_) static doublewobble(double p_144955_) static doublewrapDegrees(double p_14176_) static floatwrapDegrees(float p_14178_) static intwrapDegrees(int p_14099_)  
- 
Field Details
- 
UUID_VERSION
private static final long UUID_VERSION- See Also:
 
 - 
UUID_VERSION_TYPE_4
private static final long UUID_VERSION_TYPE_4- See Also:
 
 - 
UUID_VARIANT
private static final long UUID_VARIANT- See Also:
 
 - 
UUID_VARIANT_2
private static final long UUID_VARIANT_2- See Also:
 
 - 
PI
public static final float PI- See Also:
 
 - 
HALF_PI
public static final float HALF_PI- See Also:
 
 - 
TWO_PI
public static final float TWO_PI- See Also:
 
 - 
DEG_TO_RAD
public static final float DEG_TO_RAD- See Also:
 
 - 
RAD_TO_DEG
public static final float RAD_TO_DEG- See Also:
 
 - 
EPSILON
public static final float EPSILON- See Also:
 
 - 
SQRT_OF_TWO
public static final float SQRT_OF_TWO - 
SIN_SCALE
private static final float SIN_SCALE- See Also:
 
 - 
SIN
private static final float[] SIN - 
RANDOM
 - 
MULTIPLY_DE_BRUIJN_BIT_POSITION
private static final int[] MULTIPLY_DE_BRUIJN_BIT_POSITION - 
ONE_SIXTH
private static final double ONE_SIXTH- See Also:
 
 - 
FRAC_EXP
private static final int FRAC_EXP- See Also:
 
 - 
LUT_SIZE
private static final int LUT_SIZE- See Also:
 
 - 
FRAC_BIAS
private static final double FRAC_BIAS - 
ASIN_TAB
private static final double[] ASIN_TAB - 
COS_TAB
private static final double[] COS_TAB 
 - 
 - 
Constructor Details
- 
Mth
public Mth() 
 - 
 - 
Method Details
- 
sin
public static float sin(float p_14032_)  - 
cos
public static float cos(float p_14090_)  - 
sqrt
public static float sqrt(float p_14117_)  - 
floor
public static int floor(float p_14144_)  - 
floor
public static int floor(double p_14108_)  - 
lfloor
public static long lfloor(double p_14135_)  - 
abs
public static float abs(float p_14155_)  - 
abs
public static int abs(int p_14041_)  - 
ceil
public static int ceil(float p_14168_)  - 
ceil
public static int ceil(double p_14166_)  - 
clamp
public static int clamp(int p_14046_, int p_14047_, int p_14048_)  - 
clamp
public static long clamp(long p_300696_, long p_298059_, long p_299237_)  - 
clamp
public static float clamp(float p_14037_, float p_14038_, float p_14039_)  - 
clamp
public static double clamp(double p_14009_, double p_14010_, double p_14011_)  - 
clampedLerp
public static double clampedLerp(double p_14086_, double p_14087_, double p_14088_)  - 
clampedLerp
public static float clampedLerp(float p_144921_, float p_144922_, float p_144923_)  - 
absMax
public static double absMax(double p_14006_, double p_14007_)  - 
floorDiv
public static int floorDiv(int p_14043_, int p_14044_)  - 
nextInt
 - 
nextFloat
 - 
nextDouble
 - 
equal
public static boolean equal(float p_14034_, float p_14035_)  - 
equal
public static boolean equal(double p_14083_, double p_14084_)  - 
positiveModulo
public static int positiveModulo(int p_14101_, int p_14102_)  - 
positiveModulo
public static float positiveModulo(float p_14092_, float p_14093_)  - 
positiveModulo
public static double positiveModulo(double p_14110_, double p_14111_)  - 
isMultipleOf
public static boolean isMultipleOf(int p_265754_, int p_265543_)  - 
wrapDegrees
public static int wrapDegrees(int p_14099_)  - 
wrapDegrees
public static float wrapDegrees(float p_14178_)  - 
wrapDegrees
public static double wrapDegrees(double p_14176_)  - 
degreesDifference
public static float degreesDifference(float p_14119_, float p_14120_)  - 
degreesDifferenceAbs
public static float degreesDifferenceAbs(float p_14146_, float p_14147_)  - 
rotateIfNecessary
public static float rotateIfNecessary(float p_14095_, float p_14096_, float p_14097_)  - 
approach
public static float approach(float p_14122_, float p_14123_, float p_14124_)  - 
approachDegrees
public static float approachDegrees(float p_14149_, float p_14150_, float p_14151_)  - 
getInt
 - 
smallestEncompassingPowerOfTwo
public static int smallestEncompassingPowerOfTwo(int p_14126_)  - 
isPowerOfTwo
public static boolean isPowerOfTwo(int p_14153_)  - 
ceillog2
public static int ceillog2(int p_14164_)  - 
log2
public static int log2(int p_14174_)  - 
color
public static int color(float p_14160_, float p_14161_, float p_14162_)  - 
frac
public static float frac(float p_14188_)  - 
frac
public static double frac(double p_14186_)  - 
getSeed
Deprecated. - 
getSeed
Deprecated. - 
createInsecureUUID
 - 
createInsecureUUID
 - 
inverseLerp
public static double inverseLerp(double p_14113_, double p_14114_, double p_14115_)  - 
inverseLerp
public static float inverseLerp(float p_184656_, float p_184657_, float p_184658_)  - 
rayIntersectsAABB
 - 
atan2
public static double atan2(double p_14137_, double p_14138_)  - 
invSqrt
public static float invSqrt(float p_265060_)  - 
invSqrt
public static double invSqrt(double p_265088_)  - 
fastInvSqrt
Deprecated. - 
fastInvCubeRoot
public static float fastInvCubeRoot(float p_14200_)  - 
hsvToRgb
public static int hsvToRgb(float p_14170_, float p_14171_, float p_14172_)  - 
murmurHash3Mixer
public static int murmurHash3Mixer(int p_14184_)  - 
binarySearch
 - 
lerpInt
public static int lerpInt(float p_270245_, int p_270597_, int p_270301_)  - 
lerpDiscrete
public static int lerpDiscrete(float p_298397_, int p_298459_, int p_300125_)  - 
lerp
public static float lerp(float p_14180_, float p_14181_, float p_14182_)  - 
lerp
public static double lerp(double p_14140_, double p_14141_, double p_14142_)  - 
lerp2
public static double lerp2(double p_14013_, double p_14014_, double p_14015_, double p_14016_, double p_14017_, double p_14018_)  - 
lerp3
public static double lerp3(double p_14020_, double p_14021_, double p_14022_, double p_14023_, double p_14024_, double p_14025_, double p_14026_, double p_14027_, double p_14028_, double p_14029_, double p_14030_)  - 
catmullrom
public static float catmullrom(float p_216245_, float p_216246_, float p_216247_, float p_216248_, float p_216249_)  - 
smoothstep
public static double smoothstep(double p_14198_)  - 
smoothstepDerivative
public static double smoothstepDerivative(double p_144947_)  - 
sign
public static int sign(double p_14206_)  - 
rotLerp
public static float rotLerp(float p_14190_, float p_14191_, float p_14192_)  - 
rotLerp
public static double rotLerp(double p_299352_, double p_301019_, double p_299027_)  - 
triangleWave
public static float triangleWave(float p_14157_, float p_14158_)  - 
square
public static float square(float p_14208_)  - 
square
public static double square(double p_144953_)  - 
square
public static int square(int p_144945_)  - 
square
public static long square(long p_184644_)  - 
clampedMap
public static double clampedMap(double p_144852_, double p_144853_, double p_144854_, double p_144855_, double p_144856_)  - 
clampedMap
public static float clampedMap(float p_184632_, float p_184633_, float p_184634_, float p_184635_, float p_184636_)  - 
map
public static double map(double p_144915_, double p_144916_, double p_144917_, double p_144918_, double p_144919_)  - 
map
public static float map(float p_184638_, float p_184639_, float p_184640_, float p_184641_, float p_184642_)  - 
wobble
public static double wobble(double p_144955_)  - 
roundToward
public static int roundToward(int p_144942_, int p_144943_)  - 
positiveCeilDiv
public static int positiveCeilDiv(int p_184653_, int p_184654_)  - 
randomBetweenInclusive
 - 
randomBetween
 - 
normal
 - 
lengthSquared
public static double lengthSquared(double p_211590_, double p_211591_)  - 
length
public static double length(double p_184646_, double p_184647_)  - 
lengthSquared
public static double lengthSquared(double p_211593_, double p_211594_, double p_211595_)  - 
length
public static double length(double p_184649_, double p_184650_, double p_184651_)  - 
quantize
public static int quantize(double p_184629_, int p_184630_)  - 
outFromOrigin
 - 
outFromOrigin
 
 -