Package net.minecraft.util.math
Class MathHelper
java.lang.Object
net.minecraft.util.math.MathHelper
Contains math-related helper methods. This includes
float
-specific extensions
to Math
, linear interpolation (lerp), and color-related methods.
Trigonometric functions defined in this class use the "sine table", a pre-calculated
table of sin(N)
(0 <= N < pi * 2
).
- Mappings:
Namespace Name official aoc
intermediary net/minecraft/class_3532
named net/minecraft/util/math/MathHelper
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final double[]
private static final double[]
static final float
private static final float
static final float
private static final int
private static final float
private static final long
private static final long
private static final long
private static final double
private static final int
private static final int
static final float
private static final long
private static final int[]
static final float
static final float
private static final Random
private static final float[]
private static final double
static final float
static final float
Tau is equal to2 * PI
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic float
abs
(float value) static int
abs
(int value) static int
absFloor
(double value) static double
absMax
(double a, double b) static float
angleBetween
(float first, float second) static boolean
approximatelyEquals
(double a, double b) static boolean
approximatelyEquals
(float a, float b) static double
atan2
(double y, double x) static double
average
(long[] array) static int
binarySearch
(int min, int max, IntPredicate predicate) Finds the minimum value in[min, max)
that satisfies the monotonicpredicate
.static float
catmullRom
(float delta, float p0, float p1, float p2, float p3) Interpolates a point on a Catmull-Rom Spline.static int
ceil
(double value) static int
ceil
(float value) static float
ceil
(float value, float digits) static int
ceilDiv
(int a, int b) static int
ceilLog2
(int value) Returns ceil(log2(value
)).static byte
clamp
(byte value, byte min, byte max) static double
clamp
(double value, double min, double max) static float
clamp
(float value, float min, float max) static int
clamp
(int value, int min, int max) static long
clamp
(long value, long min, long max) static float
clampAngle
(float value, float mean, float delta) Clampsvalue
, as an angle, betweenmean - delta
andmean + delta
degrees.static double
clampedLerp
(double start, double end, double delta) static float
clampedLerp
(float start, float end, float delta) static double
clampedMap
(double value, double oldStart, double oldEnd, double newStart, double newEnd) Linearly maps a value from one number range to another and clamps the result.static float
clampedMap
(float value, float oldStart, float oldEnd, float newStart, float newEnd) Linearly maps a value from one number range to another and clamps the result.static float
cos
(float value) static int
fastFloor
(double value) static float
fastInverseCbrt
(float x) Returns an approximation of1 / Math.cbrt(x)
.static double
fastInverseSqrt
(double x) Returns an approximation of1 / Math.sqrt(x)
.static float
fastInverseSqrt
(float x) Returns an approximation of1 / Math.sqrt(x)
.static int
floor
(double value) static int
floor
(float value) static int
floorDiv
(int dividend, int divisor) static int
floorLog2
(int value) Returns floor(log2(value
)).static double
floorMod
(double dividend, double divisor) static float
floorMod
(float dividend, float divisor) static int
floorMod
(int dividend, int divisor) static double
fractionalPart
(double value) static float
fractionalPart
(float value) static float
fwrapDegrees
(double degrees) Deprecated.static double[]
getCumulativeDistribution
(double[] values) static double
getLerpProgress
(double value, double start, double end) Gets the fraction of the way thatvalue
is betweenstart
andend
.static float
getLerpProgress
(float value, float start, float end) static long
hashCode
(int x, int y, int z) static long
static int
hsvToRgb
(float hue, float saturation, float value) static double
hypot
(double a, double b) static int
idealHash
(int value) static boolean
isMultipleOf
(int a, int b) static boolean
isPowerOfTwo
(int value) static double
lerp
(double delta, double start, double end) static float
lerp
(float delta, float start, float end) static double
lerp2
(double deltaX, double deltaY, double x0y0, double x1y0, double x0y1, double x1y1) A two-dimensional lerp between values on the 4 corners of the unit square.static double
lerp3
(double deltaX, double deltaY, double deltaZ, double x0y0z0, double x1y0z0, double x0y1z0, double x1y1z0, double x0y0z1, double x1y0z1, double x0y1z1, double x1y1z1) A three-dimensional lerp between values on the 8 corners of the unit cube.static float
lerpAngle
(float start, float end, float delta) Deprecated.static float
lerpAngleDegrees
(float delta, float start, float end) static long
lfloor
(double value) static double
magnitude
(double a, double b, double c) static float
magnitude
(float n) static double
map
(double value, double oldStart, double oldEnd, double newStart, double newEnd) Linearly maps a value from one number range to another, unclamped.static float
map
(float value, float oldStart, float oldEnd, float newStart, float newEnd) Linearly maps a value from one number range to another, unclamped.static double[]
method_34940
(double double2, double double3, double double4, double double5, double double6, double double7, int int2, int int3) static double[]
method_34941
(double double2, double double3, double double4, int int2, int int3) static double[]
method_34942
(double double2, double double3, int int2, int int3) static boolean
method_34945
(Vec3d vec3d, Vec3d vec3d2, Box box) static Vec3d
method_34946
(Vec3d vec3d, Vec3d vec3d2, Vec3d vec3d3, Vec3d vec3d4, double double2) static int
method_34950
(Random random, double[] double2) static float
method_34955
(float float2, float float3, float float4) static double
method_34957
(double double2) static int
multiplyColors
(int color, float r, float g, float b) static int
multiplyColors
(int a, int b) static long
murmurHash
(long value) static float
nextBetween
(Random random, float min, float max) static int
nextBetween
(Random random, int min, int max) Returns a random, uniformly distributed integer value in[min, max]
.static double
nextDouble
(Random random, double min, double max) static float
static float
nextGaussian
(Random random, float mean, float deviation) static int
Returns a random, uniformly distributed integer value in[min, max]
.static int
packRgb
(float r, float g, float b) static int
packRgb
(int r, int g, int b) static double
parseDouble
(String string, double fallback) static double
parseDouble
(String string, double fallback, double min) Returns the parsed double;fallback
ifstring
is not an double; ormin
if the parsed double is too small.static int
static int
Returns the parsed integer;fallback
ifstring
is not an integer; ormin
if the parsed integer is too small.static double
perlinFade
(double value) static double
perlinFadeDerivative
(double value) static UUID
static UUID
randomUuid
(Random random) static int
roundDownToMultiple
(double a, int b) Returnsa
rounded down to the nearest multiple ofb
.static int
roundUpToMultiple
(int value, int divisor) Returns a value farther than or as far asvalue
from zero that is a multiple ofdivisor
.static int
sign
(double value) static float
sin
(float value) static int
smallestEncompassingPowerOfTwo
(int value) static float
sqrt
(float value) static double
square
(double n) static float
square
(float n) static int
square
(int n) static long
square
(long n) static double
squaredHypot
(double a, double b) static double
squaredMagnitude
(double a, double b, double c) static float
stepTowards
(float from, float to, float step) Steps fromfrom
towardsto
, changing the value by at moststep
.static float
stepUnwrappedAngleTowards
(float from, float to, float step) Steps fromfrom
degrees towardsto
degrees, changing the value by at moststep
degrees.static IntStream
stream
(int seed, int lowerBound, int upperBound) static IntStream
stream
(int seed, int lowerBound, int upperBound, int steps) static float
subtractAngles
(float start, float end) static float
wrap
(float value, float maxDeviation) static double
wrapDegrees
(double degrees) Wraps an angle in degrees to the interval[-180, 180)
.static float
wrapDegrees
(float degrees) Wraps an angle in degrees to the interval[-180, 180)
.static int
wrapDegrees
(int degrees) Wraps an angle in degrees to the interval[-180, 180)
.
-
Field Details
-
field_29850
private static final int field_29850- See Also:
- Mappings:
Namespace Name Mixin selector official h
Laoc;h:I
intermediary field_29850
Lnet/minecraft/class_3532;field_29850:I
named field_29850
Lnet/minecraft/util/math/MathHelper;field_29850:I
-
field_29851
private static final float field_29851- See Also:
- Mappings:
Namespace Name Mixin selector official i
Laoc;i:F
intermediary field_29851
Lnet/minecraft/class_3532;field_29851:F
named field_29851
Lnet/minecraft/util/math/MathHelper;field_29851:F
-
field_29852
private static final long field_29852- See Also:
- Mappings:
Namespace Name Mixin selector official j
Laoc;j:J
intermediary field_29852
Lnet/minecraft/class_3532;field_29852:J
named field_29852
Lnet/minecraft/util/math/MathHelper;field_29852:J
-
HALF_PI_RADIANS_SINE_TABLE_INDEX
private static final long HALF_PI_RADIANS_SINE_TABLE_INDEX- See Also:
- Mappings:
Namespace Name Mixin selector official k
Laoc;k:J
intermediary field_29853
Lnet/minecraft/class_3532;field_29853:J
named HALF_PI_RADIANS_SINE_TABLE_INDEX
Lnet/minecraft/util/math/MathHelper;HALF_PI_RADIANS_SINE_TABLE_INDEX:J
-
field_29854
private static final long field_29854- See Also:
- Mappings:
Namespace Name Mixin selector official l
Laoc;l:J
intermediary field_29854
Lnet/minecraft/class_3532;field_29854:J
named field_29854
Lnet/minecraft/util/math/MathHelper;field_29854:J
-
field_29855
private static final long field_29855- See Also:
- Mappings:
Namespace Name Mixin selector official m
Laoc;m:J
intermediary field_29855
Lnet/minecraft/class_3532;field_29855:J
named field_29855
Lnet/minecraft/util/math/MathHelper;field_29855:J
-
PI
public static final float PI- See Also:
- Mappings:
Namespace Name Mixin selector official a
Laoc;a:F
intermediary field_29844
Lnet/minecraft/class_3532;field_29844:F
named PI
Lnet/minecraft/util/math/MathHelper;PI:F
-
HALF_PI
public static final float HALF_PI- See Also:
- Mappings:
Namespace Name Mixin selector official b
Laoc;b:F
intermediary field_29845
Lnet/minecraft/class_3532;field_29845:F
named HALF_PI
Lnet/minecraft/util/math/MathHelper;HALF_PI:F
-
TAU
public static final float TAUTau is equal to2 * PI
.- See Also:
- Mappings:
Namespace Name Mixin selector official c
Laoc;c:F
intermediary field_29846
Lnet/minecraft/class_3532;field_29846:F
named TAU
Lnet/minecraft/util/math/MathHelper;TAU:F
-
RADIANS_PER_DEGREE
public static final float RADIANS_PER_DEGREE- See Also:
- Mappings:
Namespace Name Mixin selector official d
Laoc;d:F
intermediary field_29847
Lnet/minecraft/class_3532;field_29847:F
named RADIANS_PER_DEGREE
Lnet/minecraft/util/math/MathHelper;RADIANS_PER_DEGREE:F
-
DEGREES_PER_RADIAN
public static final float DEGREES_PER_RADIAN- See Also:
- Mappings:
Namespace Name Mixin selector official e
Laoc;e:F
intermediary field_29848
Lnet/minecraft/class_3532;field_29848:F
named DEGREES_PER_RADIAN
Lnet/minecraft/util/math/MathHelper;DEGREES_PER_RADIAN:F
-
EPSILON
public static final float EPSILON- See Also:
- Mappings:
Namespace Name Mixin selector official f
Laoc;f:F
intermediary field_29849
Lnet/minecraft/class_3532;field_29849:F
named EPSILON
Lnet/minecraft/util/math/MathHelper;EPSILON:F
-
SQUARE_ROOT_OF_TWO
public static final float SQUARE_ROOT_OF_TWO- Mappings:
Namespace Name Mixin selector official g
Laoc;g:F
intermediary field_15724
Lnet/minecraft/class_3532;field_15724:F
named SQUARE_ROOT_OF_TWO
Lnet/minecraft/util/math/MathHelper;SQUARE_ROOT_OF_TWO:F
-
DEGREES_TO_SINE_TABLE_INDEX
private static final float DEGREES_TO_SINE_TABLE_INDEX- See Also:
- Mappings:
Namespace Name Mixin selector official n
Laoc;n:F
intermediary field_29856
Lnet/minecraft/class_3532;field_29856:F
named DEGREES_TO_SINE_TABLE_INDEX
Lnet/minecraft/util/math/MathHelper;DEGREES_TO_SINE_TABLE_INDEX:F
-
SINE_TABLE
private static final float[] SINE_TABLE- Mappings:
Namespace Name Mixin selector official o
Laoc;o:[F
intermediary field_15725
Lnet/minecraft/class_3532;field_15725:[F
named SINE_TABLE
Lnet/minecraft/util/math/MathHelper;SINE_TABLE:[F
-
RANDOM
- Mappings:
Namespace Name Mixin selector official p
Laoc;p:Laoh;
intermediary field_15726
Lnet/minecraft/class_3532;field_15726:Lnet/minecraft/class_5819;
named RANDOM
Lnet/minecraft/util/math/MathHelper;RANDOM:Lnet/minecraft/util/math/random/Random;
-
MULTIPLY_DE_BRUIJN_BIT_POSITION
private static final int[] MULTIPLY_DE_BRUIJN_BIT_POSITION- Mappings:
Namespace Name Mixin selector official q
Laoc;q:[I
intermediary field_15723
Lnet/minecraft/class_3532;field_15723:[I
named MULTIPLY_DE_BRUIJN_BIT_POSITION
Lnet/minecraft/util/math/MathHelper;MULTIPLY_DE_BRUIJN_BIT_POSITION:[I
-
field_29857
private static final double field_29857- See Also:
- Mappings:
Namespace Name Mixin selector official r
Laoc;r:D
intermediary field_29857
Lnet/minecraft/class_3532;field_29857:D
named field_29857
Lnet/minecraft/util/math/MathHelper;field_29857:D
-
field_29858
private static final int field_29858- See Also:
- Mappings:
Namespace Name Mixin selector official s
Laoc;s:I
intermediary field_29858
Lnet/minecraft/class_3532;field_29858:I
named field_29858
Lnet/minecraft/util/math/MathHelper;field_29858:I
-
field_29859
private static final int field_29859- See Also:
- Mappings:
Namespace Name Mixin selector official t
Laoc;t:I
intermediary field_29859
Lnet/minecraft/class_3532;field_29859:I
named field_29859
Lnet/minecraft/util/math/MathHelper;field_29859:I
-
SMALLEST_FRACTION_FREE_DOUBLE
private static final double SMALLEST_FRACTION_FREE_DOUBLE- Mappings:
Namespace Name Mixin selector official u
Laoc;u:D
intermediary field_15728
Lnet/minecraft/class_3532;field_15728:D
named SMALLEST_FRACTION_FREE_DOUBLE
Lnet/minecraft/util/math/MathHelper;SMALLEST_FRACTION_FREE_DOUBLE:D
-
ARCSINE_TABLE
private static final double[] ARCSINE_TABLE- Mappings:
Namespace Name Mixin selector official v
Laoc;v:[D
intermediary field_15727
Lnet/minecraft/class_3532;field_15727:[D
named ARCSINE_TABLE
Lnet/minecraft/util/math/MathHelper;ARCSINE_TABLE:[D
-
COSINE_TABLE
private static final double[] COSINE_TABLE- Mappings:
Namespace Name Mixin selector official w
Laoc;w:[D
intermediary field_15722
Lnet/minecraft/class_3532;field_15722:[D
named COSINE_TABLE
Lnet/minecraft/util/math/MathHelper;COSINE_TABLE:[D
-
-
Constructor Details
-
MathHelper
public MathHelper()
-
-
Method Details
-
ceil
public static float ceil(float value, float digits) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(FF)F
intermediary method_45309
Lnet/minecraft/class_3532;method_45309(FF)F
named ceil
Lnet/minecraft/util/math/MathHelper;ceil(FF)F
-
sin
public static float sin(float value) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(F)F
intermediary method_15374
Lnet/minecraft/class_3532;method_15374(F)F
named sin
Lnet/minecraft/util/math/MathHelper;sin(F)F
-
cos
public static float cos(float value) - Mappings:
Namespace Name Mixin selector official b
Laoc;b(F)F
intermediary method_15362
Lnet/minecraft/class_3532;method_15362(F)F
named cos
Lnet/minecraft/util/math/MathHelper;cos(F)F
-
sqrt
public static float sqrt(float value) - Mappings:
Namespace Name Mixin selector official c
Laoc;c(F)F
intermediary method_15355
Lnet/minecraft/class_3532;method_15355(F)F
named sqrt
Lnet/minecraft/util/math/MathHelper;sqrt(F)F
-
floor
public static int floor(float value) - Mappings:
Namespace Name Mixin selector official d
Laoc;d(F)I
intermediary method_15375
Lnet/minecraft/class_3532;method_15375(F)I
named floor
Lnet/minecraft/util/math/MathHelper;floor(F)I
-
fastFloor
public static int fastFloor(double value) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(D)I
intermediary method_15365
Lnet/minecraft/class_3532;method_15365(D)I
named fastFloor
Lnet/minecraft/util/math/MathHelper;fastFloor(D)I
-
floor
public static int floor(double value) - Mappings:
Namespace Name Mixin selector official b
Laoc;b(D)I
intermediary method_15357
Lnet/minecraft/class_3532;method_15357(D)I
named floor
Lnet/minecraft/util/math/MathHelper;floor(D)I
-
lfloor
public static long lfloor(double value) - Mappings:
Namespace Name Mixin selector official c
Laoc;c(D)J
intermediary method_15372
Lnet/minecraft/class_3532;method_15372(D)J
named lfloor
Lnet/minecraft/util/math/MathHelper;lfloor(D)J
-
absFloor
public static int absFloor(double value) - Mappings:
Namespace Name Mixin selector official d
Laoc;d(D)I
intermediary method_34953
Lnet/minecraft/class_3532;method_34953(D)I
named absFloor
Lnet/minecraft/util/math/MathHelper;absFloor(D)I
-
abs
public static float abs(float value) - Mappings:
Namespace Name Mixin selector official e
Laoc;e(F)F
intermediary method_15379
Lnet/minecraft/class_3532;method_15379(F)F
named abs
Lnet/minecraft/util/math/MathHelper;abs(F)F
-
abs
public static int abs(int value) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(I)I
intermediary method_15382
Lnet/minecraft/class_3532;method_15382(I)I
named abs
Lnet/minecraft/util/math/MathHelper;abs(I)I
-
ceil
public static int ceil(float value) - Mappings:
Namespace Name Mixin selector official f
Laoc;f(F)I
intermediary method_15386
Lnet/minecraft/class_3532;method_15386(F)I
named ceil
Lnet/minecraft/util/math/MathHelper;ceil(F)I
-
ceil
public static int ceil(double value) - Mappings:
Namespace Name Mixin selector official e
Laoc;e(D)I
intermediary method_15384
Lnet/minecraft/class_3532;method_15384(D)I
named ceil
Lnet/minecraft/util/math/MathHelper;ceil(D)I
-
clamp
public static byte clamp(byte value, byte min, byte max) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(BBB)B
intermediary method_34939
Lnet/minecraft/class_3532;method_34939(BBB)B
named clamp
Lnet/minecraft/util/math/MathHelper;clamp(BBB)B
-
clamp
public static int clamp(int value, int min, int max) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(III)I
intermediary method_15340
Lnet/minecraft/class_3532;method_15340(III)I
named clamp
Lnet/minecraft/util/math/MathHelper;clamp(III)I
-
clamp
public static long clamp(long value, long min, long max) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(JJJ)J
intermediary method_24156
Lnet/minecraft/class_3532;method_24156(JJJ)J
named clamp
Lnet/minecraft/util/math/MathHelper;clamp(JJJ)J
-
clamp
public static float clamp(float value, float min, float max) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(FFF)F
intermediary method_15363
Lnet/minecraft/class_3532;method_15363(FFF)F
named clamp
Lnet/minecraft/util/math/MathHelper;clamp(FFF)F
-
clamp
public static double clamp(double value, double min, double max) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(DDD)D
intermediary method_15350
Lnet/minecraft/class_3532;method_15350(DDD)D
named clamp
Lnet/minecraft/util/math/MathHelper;clamp(DDD)D
-
clampedLerp
public static double clampedLerp(double start, double end, double delta) - Mappings:
Namespace Name Mixin selector official b
Laoc;b(DDD)D
intermediary method_15390
Lnet/minecraft/class_3532;method_15390(DDD)D
named clampedLerp
Lnet/minecraft/util/math/MathHelper;clampedLerp(DDD)D
-
clampedLerp
public static float clampedLerp(float start, float end, float delta) - Mappings:
Namespace Name Mixin selector official b
Laoc;b(FFF)F
intermediary method_37166
Lnet/minecraft/class_3532;method_37166(FFF)F
named clampedLerp
Lnet/minecraft/util/math/MathHelper;clampedLerp(FFF)F
-
absMax
public static double absMax(double a, double b) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(DD)D
intermediary method_15391
Lnet/minecraft/class_3532;method_15391(DD)D
named absMax
Lnet/minecraft/util/math/MathHelper;absMax(DD)D
-
floorDiv
public static int floorDiv(int dividend, int divisor) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(II)I
intermediary method_15346
Lnet/minecraft/class_3532;method_15346(II)I
named floorDiv
Lnet/minecraft/util/math/MathHelper;floorDiv(II)I
-
nextInt
Returns a random, uniformly distributed integer value in[min, max]
. If the range is empty (i.e.max < min
), it returnsmin
.- Parameters:
min
- the minimum value, inclusivemax
- the maximum value, inclusive- Returns:
- a random, uniformly distributed integer value in
[min, max]
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(Laoh;II)I
intermediary method_15395
Lnet/minecraft/class_3532;method_15395(Lnet/minecraft/class_5819;II)I
named nextInt
Lnet/minecraft/util/math/MathHelper;nextInt(Lnet/minecraft/util/math/random/Random;II)I
-
nextFloat
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(Laoh;FF)F
intermediary method_15344
Lnet/minecraft/class_3532;method_15344(Lnet/minecraft/class_5819;FF)F
named nextFloat
Lnet/minecraft/util/math/MathHelper;nextFloat(Lnet/minecraft/util/math/random/Random;FF)F
-
nextDouble
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(Laoh;DD)D
intermediary method_15366
Lnet/minecraft/class_3532;method_15366(Lnet/minecraft/class_5819;DD)D
named nextDouble
Lnet/minecraft/util/math/MathHelper;nextDouble(Lnet/minecraft/util/math/random/Random;DD)D
-
average
public static double average(long[] array) - Mappings:
Namespace Name Mixin selector official a
Laoc;a([J)D
intermediary method_15373
Lnet/minecraft/class_3532;method_15373([J)D
named average
Lnet/minecraft/util/math/MathHelper;average([J)D
-
approximatelyEquals
public static boolean approximatelyEquals(float a, float b) - Mappings:
Namespace Name Mixin selector official b
Laoc;b(FF)Z
intermediary method_15347
Lnet/minecraft/class_3532;method_15347(FF)Z
named approximatelyEquals
Lnet/minecraft/util/math/MathHelper;approximatelyEquals(FF)Z
-
approximatelyEquals
public static boolean approximatelyEquals(double a, double b) - Mappings:
Namespace Name Mixin selector official b
Laoc;b(DD)Z
intermediary method_20390
Lnet/minecraft/class_3532;method_20390(DD)Z
named approximatelyEquals
Lnet/minecraft/util/math/MathHelper;approximatelyEquals(DD)Z
-
floorMod
public static int floorMod(int dividend, int divisor) - Mappings:
Namespace Name Mixin selector official b
Laoc;b(II)I
intermediary method_15387
Lnet/minecraft/class_3532;method_15387(II)I
named floorMod
Lnet/minecraft/util/math/MathHelper;floorMod(II)I
-
floorMod
public static float floorMod(float dividend, float divisor) - Mappings:
Namespace Name Mixin selector official c
Laoc;c(FF)F
intermediary method_15341
Lnet/minecraft/class_3532;method_15341(FF)F
named floorMod
Lnet/minecraft/util/math/MathHelper;floorMod(FF)F
-
floorMod
public static double floorMod(double dividend, double divisor) - Mappings:
Namespace Name Mixin selector official c
Laoc;c(DD)D
intermediary method_15367
Lnet/minecraft/class_3532;method_15367(DD)D
named floorMod
Lnet/minecraft/util/math/MathHelper;floorMod(DD)D
-
isMultipleOf
public static boolean isMultipleOf(int a, int b) - Mappings:
Namespace Name Mixin selector official c
Laoc;c(II)Z
intermediary method_45310
Lnet/minecraft/class_3532;method_45310(II)Z
named isMultipleOf
Lnet/minecraft/util/math/MathHelper;isMultipleOf(II)Z
-
wrapDegrees
public static int wrapDegrees(int degrees) Wraps an angle in degrees to the interval[-180, 180)
.- Mappings:
Namespace Name Mixin selector official b
Laoc;b(I)I
intermediary method_15392
Lnet/minecraft/class_3532;method_15392(I)I
named wrapDegrees
Lnet/minecraft/util/math/MathHelper;wrapDegrees(I)I
-
wrapDegrees
public static float wrapDegrees(float degrees) Wraps an angle in degrees to the interval[-180, 180)
.- Mappings:
Namespace Name Mixin selector official g
Laoc;g(F)F
intermediary method_15393
Lnet/minecraft/class_3532;method_15393(F)F
named wrapDegrees
Lnet/minecraft/util/math/MathHelper;wrapDegrees(F)F
-
wrapDegrees
public static double wrapDegrees(double degrees) Wraps an angle in degrees to the interval[-180, 180)
.- Mappings:
Namespace Name Mixin selector official f
Laoc;f(D)D
intermediary method_15338
Lnet/minecraft/class_3532;method_15338(D)D
named wrapDegrees
Lnet/minecraft/util/math/MathHelper;wrapDegrees(D)D
-
subtractAngles
public static float subtractAngles(float start, float end) - Mappings:
Namespace Name Mixin selector official d
Laoc;d(FF)F
intermediary method_15381
Lnet/minecraft/class_3532;method_15381(FF)F
named subtractAngles
Lnet/minecraft/util/math/MathHelper;subtractAngles(FF)F
-
angleBetween
public static float angleBetween(float first, float second) - Mappings:
Namespace Name Mixin selector official e
Laoc;e(FF)F
intermediary method_15356
Lnet/minecraft/class_3532;method_15356(FF)F
named angleBetween
Lnet/minecraft/util/math/MathHelper;angleBetween(FF)F
-
clampAngle
public static float clampAngle(float value, float mean, float delta) Clampsvalue
, as an angle, betweenmean - delta
andmean + delta
degrees.- Parameters:
value
- the value to clampmean
- the mean value of the clamp angle rangedelta
- the maximum difference allowed from the mean, must not be negative- Returns:
- the clamped
value
- Mappings:
Namespace Name Mixin selector official c
Laoc;c(FFF)F
intermediary method_20306
Lnet/minecraft/class_3532;method_20306(FFF)F
named clampAngle
Lnet/minecraft/util/math/MathHelper;clampAngle(FFF)F
-
stepTowards
public static float stepTowards(float from, float to, float step) Steps fromfrom
towardsto
, changing the value by at moststep
.- Mappings:
Namespace Name Mixin selector official d
Laoc;d(FFF)F
intermediary method_15348
Lnet/minecraft/class_3532;method_15348(FFF)F
named stepTowards
Lnet/minecraft/util/math/MathHelper;stepTowards(FFF)F
-
stepUnwrappedAngleTowards
public static float stepUnwrappedAngleTowards(float from, float to, float step) Steps fromfrom
degrees towardsto
degrees, changing the value by at moststep
degrees.- Mappings:
Namespace Name Mixin selector official e
Laoc;e(FFF)F
intermediary method_15388
Lnet/minecraft/class_3532;method_15388(FFF)F
named stepUnwrappedAngleTowards
Lnet/minecraft/util/math/MathHelper;stepUnwrappedAngleTowards(FFF)F
-
parseInt
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(Ljava/lang/String;I)I
intermediary method_15343
Lnet/minecraft/class_3532;method_15343(Ljava/lang/String;I)I
named parseInt
Lnet/minecraft/util/math/MathHelper;parseInt(Ljava/lang/String;I)I
-
parseInt
Returns the parsed integer;fallback
ifstring
is not an integer; ormin
if the parsed integer is too small.- Parameters:
string
- the string to parsefallback
- the fallback for unparsablestring
min
- the minimum if the parsed value is too small- Returns:
- the parsed integer;
fallback
ifstring
is not an integer; ormin
if the parsed integer is too small - Mappings:
Namespace Name Mixin selector official a
Laoc;a(Ljava/lang/String;II)I
intermediary method_34949
Lnet/minecraft/class_3532;method_34949(Ljava/lang/String;II)I
named parseInt
Lnet/minecraft/util/math/MathHelper;parseInt(Ljava/lang/String;II)I
-
parseDouble
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(Ljava/lang/String;D)D
intermediary method_34947
Lnet/minecraft/class_3532;method_34947(Ljava/lang/String;D)D
named parseDouble
Lnet/minecraft/util/math/MathHelper;parseDouble(Ljava/lang/String;D)D
-
parseDouble
Returns the parsed double;fallback
ifstring
is not an double; ormin
if the parsed double is too small.- Parameters:
string
- the string to parsefallback
- the fallback for unparsablestring
min
- the minimum if the parsed value is too small- Returns:
- the parsed double;
fallback
ifstring
is not an double; ormin
if the parsed double is too small - Mappings:
Namespace Name Mixin selector official a
Laoc;a(Ljava/lang/String;DD)D
intermediary method_34948
Lnet/minecraft/class_3532;method_34948(Ljava/lang/String;DD)D
named parseDouble
Lnet/minecraft/util/math/MathHelper;parseDouble(Ljava/lang/String;DD)D
-
smallestEncompassingPowerOfTwo
public static int smallestEncompassingPowerOfTwo(int value) - Mappings:
Namespace Name Mixin selector official c
Laoc;c(I)I
intermediary method_15339
Lnet/minecraft/class_3532;method_15339(I)I
named smallestEncompassingPowerOfTwo
Lnet/minecraft/util/math/MathHelper;smallestEncompassingPowerOfTwo(I)I
-
isPowerOfTwo
public static boolean isPowerOfTwo(int value) - Mappings:
Namespace Name Mixin selector official d
Laoc;d(I)Z
intermediary method_15352
Lnet/minecraft/class_3532;method_15352(I)Z
named isPowerOfTwo
Lnet/minecraft/util/math/MathHelper;isPowerOfTwo(I)Z
-
ceilLog2
public static int ceilLog2(int value) Returns ceil(log2(value
)).The vanilla implementation uses the de Bruijn sequence.
- Parameters:
value
- the input value- Returns:
- ceil(log2(
value
)) - See Also:
- Mappings:
Namespace Name Mixin selector official e
Laoc;e(I)I
intermediary method_15342
Lnet/minecraft/class_3532;method_15342(I)I
named ceilLog2
Lnet/minecraft/util/math/MathHelper;ceilLog2(I)I
-
floorLog2
public static int floorLog2(int value) Returns floor(log2(value
)).The vanilla implementation uses the de Bruijn sequence.
- Parameters:
value
- the input value- Returns:
- floor(log2(
value
)) - See Also:
- Mappings:
Namespace Name Mixin selector official f
Laoc;f(I)I
intermediary method_15351
Lnet/minecraft/class_3532;method_15351(I)I
named floorLog2
Lnet/minecraft/util/math/MathHelper;floorLog2(I)I
-
packRgb
public static int packRgb(float r, float g, float b) - Mappings:
Namespace Name Mixin selector official f
Laoc;f(FFF)I
intermediary method_15353
Lnet/minecraft/class_3532;method_15353(FFF)I
named packRgb
Lnet/minecraft/util/math/MathHelper;packRgb(FFF)I
-
packRgb
public static int packRgb(int r, int g, int b) - Mappings:
Namespace Name Mixin selector official b
Laoc;b(III)I
intermediary method_15383
Lnet/minecraft/class_3532;method_15383(III)I
named packRgb
Lnet/minecraft/util/math/MathHelper;packRgb(III)I
-
multiplyColors
public static int multiplyColors(int a, int b) - Mappings:
Namespace Name Mixin selector official d
Laoc;d(II)I
intermediary method_34952
Lnet/minecraft/class_3532;method_34952(II)I
named multiplyColors
Lnet/minecraft/util/math/MathHelper;multiplyColors(II)I
-
multiplyColors
public static int multiplyColors(int color, float r, float g, float b) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(IFFF)I
intermediary method_34943
Lnet/minecraft/class_3532;method_34943(IFFF)I
named multiplyColors
Lnet/minecraft/util/math/MathHelper;multiplyColors(IFFF)I
-
fractionalPart
public static float fractionalPart(float value) - Mappings:
Namespace Name Mixin selector official h
Laoc;h(F)F
intermediary method_22450
Lnet/minecraft/class_3532;method_22450(F)F
named fractionalPart
Lnet/minecraft/util/math/MathHelper;fractionalPart(F)F
-
fractionalPart
public static double fractionalPart(double value) - Mappings:
Namespace Name Mixin selector official g
Laoc;g(D)D
intermediary method_15385
Lnet/minecraft/class_3532;method_15385(D)D
named fractionalPart
Lnet/minecraft/util/math/MathHelper;fractionalPart(D)D
-
method_34946
public static Vec3d method_34946(Vec3d vec3d, Vec3d vec3d2, Vec3d vec3d3, Vec3d vec3d4, double double2) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(Leae;Leae;Leae;Leae;D)Leae;
intermediary method_34946
Lnet/minecraft/class_3532;method_34946(Lnet/minecraft/class_243;Lnet/minecraft/class_243;Lnet/minecraft/class_243;Lnet/minecraft/class_243;D)Lnet/minecraft/class_243;
named method_34946
Lnet/minecraft/util/math/MathHelper;method_34946(Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Vec3d;D)Lnet/minecraft/util/math/Vec3d;
-
hashCode
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(Lhu;)J
intermediary method_15389
Lnet/minecraft/class_3532;method_15389(Lnet/minecraft/class_2382;)J
named hashCode
Lnet/minecraft/util/math/MathHelper;hashCode(Lnet/minecraft/util/math/Vec3i;)J
-
hashCode
public static long hashCode(int x, int y, int z) - Mappings:
Namespace Name Mixin selector official c
Laoc;c(III)J
intermediary method_15371
Lnet/minecraft/class_3532;method_15371(III)J
named hashCode
Lnet/minecraft/util/math/MathHelper;hashCode(III)J
-
randomUuid
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(Laoh;)Ljava/util/UUID;
intermediary method_15378
Lnet/minecraft/class_3532;method_15378(Lnet/minecraft/class_5819;)Ljava/util/UUID;
named randomUuid
Lnet/minecraft/util/math/MathHelper;randomUuid(Lnet/minecraft/util/math/random/Random;)Ljava/util/UUID;
-
randomUuid
- Mappings:
Namespace Name Mixin selector official a
Laoc;a()Ljava/util/UUID;
intermediary method_15394
Lnet/minecraft/class_3532;method_15394()Ljava/util/UUID;
named randomUuid
Lnet/minecraft/util/math/MathHelper;randomUuid()Ljava/util/UUID;
-
getLerpProgress
public static double getLerpProgress(double value, double start, double end) Gets the fraction of the way thatvalue
is betweenstart
andend
. This is the delta value needed to lerp betweenstart
andend
to getvalue
. In other words,getLerpProgress(lerp(delta, start, end), start, end) == delta
.- Parameters:
value
- the result of the lerp functionstart
- the value interpolated fromend
- the value interpolated to- Mappings:
Namespace Name Mixin selector official c
Laoc;c(DDD)D
intermediary method_15370
Lnet/minecraft/class_3532;method_15370(DDD)D
named getLerpProgress
Lnet/minecraft/util/math/MathHelper;getLerpProgress(DDD)D
-
getLerpProgress
public static float getLerpProgress(float value, float start, float end) - Mappings:
Namespace Name Mixin selector official g
Laoc;g(FFF)F
intermediary method_37960
Lnet/minecraft/class_3532;method_37960(FFF)F
named getLerpProgress
Lnet/minecraft/util/math/MathHelper;getLerpProgress(FFF)F
-
method_34945
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(Leae;Leae;Ldzz;)Z
intermediary method_34945
Lnet/minecraft/class_3532;method_34945(Lnet/minecraft/class_243;Lnet/minecraft/class_243;Lnet/minecraft/class_238;)Z
named method_34945
Lnet/minecraft/util/math/MathHelper;method_34945(Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/math/Box;)Z
-
atan2
public static double atan2(double y, double x) - Mappings:
Namespace Name Mixin selector official d
Laoc;d(DD)D
intermediary method_15349
Lnet/minecraft/class_3532;method_15349(DD)D
named atan2
Lnet/minecraft/util/math/MathHelper;atan2(DD)D
-
fastInverseSqrt
public static float fastInverseSqrt(float x) Returns an approximation of1 / Math.sqrt(x)
.- Returns:
- an approximation of
1 / Math.sqrt(x)
- See Also:
- Mappings:
Namespace Name Mixin selector official i
Laoc;i(F)F
intermediary method_22858
Lnet/minecraft/class_3532;method_22858(F)F
named fastInverseSqrt
Lnet/minecraft/util/math/MathHelper;fastInverseSqrt(F)F
-
fastInverseSqrt
public static double fastInverseSqrt(double x) Returns an approximation of1 / Math.sqrt(x)
.- Returns:
- an approximation of
1 / Math.sqrt(x)
- Mappings:
Namespace Name Mixin selector official h
Laoc;h(D)D
intermediary method_15345
Lnet/minecraft/class_3532;method_15345(D)D
named fastInverseSqrt
Lnet/minecraft/util/math/MathHelper;fastInverseSqrt(D)D
-
fastInverseCbrt
public static float fastInverseCbrt(float x) Returns an approximation of1 / Math.cbrt(x)
.- Returns:
- an approximation of
1 / Math.cbrt(x)
- Mappings:
Namespace Name Mixin selector official j
Laoc;j(F)F
intermediary method_23278
Lnet/minecraft/class_3532;method_23278(F)F
named fastInverseCbrt
Lnet/minecraft/util/math/MathHelper;fastInverseCbrt(F)F
-
hsvToRgb
public static int hsvToRgb(float hue, float saturation, float value) - Mappings:
Namespace Name Mixin selector official h
Laoc;h(FFF)I
intermediary method_15369
Lnet/minecraft/class_3532;method_15369(FFF)I
named hsvToRgb
Lnet/minecraft/util/math/MathHelper;hsvToRgb(FFF)I
-
idealHash
public static int idealHash(int value) - Mappings:
Namespace Name Mixin selector official g
Laoc;g(I)I
intermediary method_15354
Lnet/minecraft/class_3532;method_15354(I)I
named idealHash
Lnet/minecraft/util/math/MathHelper;idealHash(I)I
-
murmurHash
public static long murmurHash(long value) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(J)J
intermediary method_34944
Lnet/minecraft/class_3532;method_34944(J)J
named murmurHash
Lnet/minecraft/util/math/MathHelper;murmurHash(J)J
-
getCumulativeDistribution
public static double[] getCumulativeDistribution(double[] values) - Mappings:
Namespace Name Mixin selector official a
Laoc;a([D)[D
intermediary method_34951
Lnet/minecraft/class_3532;method_34951([D)[D
named getCumulativeDistribution
Lnet/minecraft/util/math/MathHelper;getCumulativeDistribution([D)[D
-
method_34950
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(Laoh;[D)I
intermediary method_34950
Lnet/minecraft/class_3532;method_34950(Lnet/minecraft/class_5819;[D)I
named method_34950
Lnet/minecraft/util/math/MathHelper;method_34950(Lnet/minecraft/util/math/random/Random;[D)I
-
method_34941
public static double[] method_34941(double double2, double double3, double double4, int int2, int int3) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(DDDII)[D
intermediary method_34941
Lnet/minecraft/class_3532;method_34941(DDDII)[D
named method_34941
Lnet/minecraft/util/math/MathHelper;method_34941(DDDII)[D
-
method_34940
public static double[] method_34940(double double2, double double3, double double4, double double5, double double6, double double7, int int2, int int3) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(DDDDDDII)[D
intermediary method_34940
Lnet/minecraft/class_3532;method_34940(DDDDDDII)[D
named method_34940
Lnet/minecraft/util/math/MathHelper;method_34940(DDDDDDII)[D
-
method_34942
public static double[] method_34942(double double2, double double3, int int2, int int3) - Mappings:
Namespace Name Mixin selector official a
Laoc;a(DDII)[D
intermediary method_34942
Lnet/minecraft/class_3532;method_34942(DDII)[D
named method_34942
Lnet/minecraft/util/math/MathHelper;method_34942(DDII)[D
-
binarySearch
Finds the minimum value in[min, max)
that satisfies the monotonicpredicate
.The
predicate
must be monotonic, i.e. if for anya
,predicate.test(a)
istrue
, then for allb > a
,predicate.test(b)
must also betrue
.Examples:
binarySearch(3, 7, x -> true)
returns3
.binarySearch(3, 7, x -> x >= 5)
returns5
.binarySearch(3, 7, x -> false)
returns7
.
- Parameters:
min
- the minimum value (inclusive) to be testedmax
- the maximum value (exclusive) to be testedpredicate
- the predicate that returnstrue
for integers greater than or equal to the value to be searched for- Returns:
- the minimum value if such value is found, otherwise
max
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(IILjava/util/function/IntPredicate;)I
intermediary method_15360
Lnet/minecraft/class_3532;method_15360(IILjava/util/function/IntPredicate;)I
named binarySearch
Lnet/minecraft/util/math/MathHelper;binarySearch(IILjava/util/function/IntPredicate;)I
-
lerp
public static float lerp(float delta, float start, float end) - Mappings:
Namespace Name Mixin selector official i
Laoc;i(FFF)F
intermediary method_16439
Lnet/minecraft/class_3532;method_16439(FFF)F
named lerp
Lnet/minecraft/util/math/MathHelper;lerp(FFF)F
-
lerp
public static double lerp(double delta, double start, double end) - Mappings:
Namespace Name Mixin selector official d
Laoc;d(DDD)D
intermediary method_16436
Lnet/minecraft/class_3532;method_16436(DDD)D
named lerp
Lnet/minecraft/util/math/MathHelper;lerp(DDD)D
-
lerp2
public static double lerp2(double deltaX, double deltaY, double x0y0, double x1y0, double x0y1, double x1y1) A two-dimensional lerp between values on the 4 corners of the unit square. Arbitrary values are specified for the corners and the output is interpolated between them.- Parameters:
deltaX
- the x-coordinate on the unit squaredeltaY
- the y-coordinate on the unit squarex0y0
- the output ifdeltaX
is 0 anddeltaY
is 0x1y0
- the output ifdeltaX
is 1 anddeltaY
is 0x0y1
- the output ifdeltaX
is 0 anddeltaY
is 1x1y1
- the output ifdeltaX
is 1 anddeltaY
is 1- Mappings:
Namespace Name Mixin selector official a
Laoc;a(DDDDDD)D
intermediary method_16437
Lnet/minecraft/class_3532;method_16437(DDDDDD)D
named lerp2
Lnet/minecraft/util/math/MathHelper;lerp2(DDDDDD)D
-
lerp3
public static double lerp3(double deltaX, double deltaY, double deltaZ, double x0y0z0, double x1y0z0, double x0y1z0, double x1y1z0, double x0y0z1, double x1y0z1, double x0y1z1, double x1y1z1) A three-dimensional lerp between values on the 8 corners of the unit cube. Arbitrary values are specified for the corners and the output is interpolated between them.- Parameters:
deltaX
- the x-coordinate on the unit cubedeltaY
- the y-coordinate on the unit cubedeltaZ
- the z-coordinate on the unit cubex0y0z0
- the output ifdeltaX
is 0,deltaY
is 0 anddeltaZ
is 0x1y0z0
- the output ifdeltaX
is 1,deltaY
is 0 anddeltaZ
is 0x0y1z0
- the output ifdeltaX
is 0,deltaY
is 1 anddeltaZ
is 0x1y1z0
- the output ifdeltaX
is 1,deltaY
is 1 anddeltaZ
is 0x0y0z1
- the output ifdeltaX
is 0,deltaY
is 0 anddeltaZ
is 1x1y0z1
- the output ifdeltaX
is 1,deltaY
is 0 anddeltaZ
is 1x0y1z1
- the output ifdeltaX
is 0,deltaY
is 1 anddeltaZ
is 1x1y1z1
- the output ifdeltaX
is 1,deltaY
is 1 anddeltaZ
is 1- Mappings:
Namespace Name Mixin selector official a
Laoc;a(DDDDDDDDDDD)D
intermediary method_16438
Lnet/minecraft/class_3532;method_16438(DDDDDDDDDDD)D
named lerp3
Lnet/minecraft/util/math/MathHelper;lerp3(DDDDDDDDDDD)D
-
catmullRom
public static float catmullRom(float delta, float p0, float p1, float p2, float p3) Interpolates a point on a Catmull-Rom Spline. This spline has a property that if there are two splines with argumentsp0, p1, p2, p3
andp1, p2, p3, p4
, the resulting curve will have a continuous first derivative atp2
, where the two input curves connect. For higher-dimensional curves, the interpolation on the curve is done component-wise: for inputsdelta, (p0x, p0y), (p1x, p1y), (p2x, p2y), (p3x, p3y)
, the output is(catmullRom(delta, p0x, p1x, p2x, p3x), catmullRom(delta, p0y, p1y, p2y, p3y))
.- Parameters:
delta
- the progress along the interpolationp0
- the previous data point to assist in curve-smoothingp1
- the output ifdelta
is 0p2
- the output ifdelta
is 1p3
- the next data point to assist in curve-smoothing- See Also:
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(FFFFF)F
intermediary method_41303
Lnet/minecraft/class_3532;method_41303(FFFFF)F
named catmullRom
Lnet/minecraft/util/math/MathHelper;catmullRom(FFFFF)F
-
perlinFade
public static double perlinFade(double value) - Mappings:
Namespace Name Mixin selector official i
Laoc;i(D)D
intermediary method_16435
Lnet/minecraft/class_3532;method_16435(D)D
named perlinFade
Lnet/minecraft/util/math/MathHelper;perlinFade(D)D
-
perlinFadeDerivative
public static double perlinFadeDerivative(double value) - Mappings:
Namespace Name Mixin selector official j
Laoc;j(D)D
intermediary method_34956
Lnet/minecraft/class_3532;method_34956(D)D
named perlinFadeDerivative
Lnet/minecraft/util/math/MathHelper;perlinFadeDerivative(D)D
-
sign
public static int sign(double value) - Mappings:
Namespace Name Mixin selector official k
Laoc;k(D)I
intermediary method_17822
Lnet/minecraft/class_3532;method_17822(D)I
named sign
Lnet/minecraft/util/math/MathHelper;sign(D)I
-
lerpAngleDegrees
public static float lerpAngleDegrees(float delta, float start, float end) - Mappings:
Namespace Name Mixin selector official j
Laoc;j(FFF)F
intermediary method_17821
Lnet/minecraft/class_3532;method_17821(FFF)F
named lerpAngleDegrees
Lnet/minecraft/util/math/MathHelper;lerpAngleDegrees(FFF)F
-
method_34955
public static float method_34955(float float2, float float3, float float4) - Mappings:
Namespace Name Mixin selector official k
Laoc;k(FFF)F
intermediary method_34955
Lnet/minecraft/class_3532;method_34955(FFF)F
named method_34955
Lnet/minecraft/util/math/MathHelper;method_34955(FFF)F
-
lerpAngle
Deprecated.- Mappings:
Namespace Name Mixin selector official l
Laoc;l(FFF)F
intermediary method_22859
Lnet/minecraft/class_3532;method_22859(FFF)F
named lerpAngle
Lnet/minecraft/util/math/MathHelper;lerpAngle(FFF)F
-
fwrapDegrees
Deprecated.- Mappings:
Namespace Name Mixin selector official l
Laoc;l(D)F
intermediary method_22860
Lnet/minecraft/class_3532;method_22860(D)F
named fwrapDegrees
Lnet/minecraft/util/math/MathHelper;fwrapDegrees(D)F
-
wrap
public static float wrap(float value, float maxDeviation) - Mappings:
Namespace Name Mixin selector official f
Laoc;f(FF)F
intermediary method_24504
Lnet/minecraft/class_3532;method_24504(FF)F
named wrap
Lnet/minecraft/util/math/MathHelper;wrap(FF)F
-
square
public static float square(float n) - Mappings:
Namespace Name Mixin selector official k
Laoc;k(F)F
intermediary method_27285
Lnet/minecraft/class_3532;method_27285(F)F
named square
Lnet/minecraft/util/math/MathHelper;square(F)F
-
square
public static double square(double n) - Mappings:
Namespace Name Mixin selector official m
Laoc;m(D)D
intermediary method_33723
Lnet/minecraft/class_3532;method_33723(D)D
named square
Lnet/minecraft/util/math/MathHelper;square(D)D
-
square
public static int square(int n) - Mappings:
Namespace Name Mixin selector official h
Laoc;h(I)I
intermediary method_34954
Lnet/minecraft/class_3532;method_34954(I)I
named square
Lnet/minecraft/util/math/MathHelper;square(I)I
-
square
public static long square(long n) - Mappings:
Namespace Name Mixin selector official b
Laoc;b(J)J
intermediary method_38652
Lnet/minecraft/class_3532;method_38652(J)J
named square
Lnet/minecraft/util/math/MathHelper;square(J)J
-
magnitude
public static float magnitude(float n) - Mappings:
Namespace Name Mixin selector official l
Laoc;l(F)F
intermediary method_42626
Lnet/minecraft/class_3532;method_42626(F)F
named magnitude
Lnet/minecraft/util/math/MathHelper;magnitude(F)F
-
clampedMap
public static double clampedMap(double value, double oldStart, double oldEnd, double newStart, double newEnd) Linearly maps a value from one number range to another and clamps the result.- Parameters:
value
- the input valueoldStart
- the starting value of the original rangeoldEnd
- the end value of the original rangenewStart
- the starting value of the new rangenewEnd
- the end value of the new range- Returns:
- the mapped value, clamped between
newStart
andnewEnd
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(DDDDD)D
intermediary method_32854
Lnet/minecraft/class_3532;method_32854(DDDDD)D
named clampedMap
Lnet/minecraft/util/math/MathHelper;clampedMap(DDDDD)D
-
clampedMap
public static float clampedMap(float value, float oldStart, float oldEnd, float newStart, float newEnd) Linearly maps a value from one number range to another and clamps the result.- Parameters:
value
- the input valueoldStart
- the starting value of the original rangeoldEnd
- the end value of the original rangenewStart
- the starting value of the new rangenewEnd
- the end value of the new range- Returns:
- the mapped value, clamped between
newStart
andnewEnd
- See Also:
- Mappings:
Namespace Name Mixin selector official b
Laoc;b(FFFFF)F
intermediary method_37958
Lnet/minecraft/class_3532;method_37958(FFFFF)F
named clampedMap
Lnet/minecraft/util/math/MathHelper;clampedMap(FFFFF)F
-
map
public static double map(double value, double oldStart, double oldEnd, double newStart, double newEnd) Linearly maps a value from one number range to another, unclamped.For the return value
result
,getLerpProgress(value, oldStart, oldEnd)
is approximately equal togetLerpProgress(result, newStart, newEnd)
(accounting for floating point errors).- Parameters:
value
- the input valueoldStart
- the starting value of the original rangeoldEnd
- the end value of the original rangenewStart
- the starting value of the new rangenewEnd
- the end value of the new range- Returns:
- the mapped value
- Mappings:
Namespace Name Mixin selector official b
Laoc;b(DDDDD)D
intermediary method_33722
Lnet/minecraft/class_3532;method_33722(DDDDD)D
named map
Lnet/minecraft/util/math/MathHelper;map(DDDDD)D
-
map
public static float map(float value, float oldStart, float oldEnd, float newStart, float newEnd) Linearly maps a value from one number range to another, unclamped.For the return value
result
,getLerpProgress(value, oldStart, oldEnd)
is approximately equal togetLerpProgress(result, newStart, newEnd)
(accounting for floating point errors).- Parameters:
value
- the input valueoldStart
- the starting value of the original rangeoldEnd
- the end value of the original rangenewStart
- the starting value of the new rangenewEnd
- the end value of the new range- Returns:
- the mapped value
- Mappings:
Namespace Name Mixin selector official c
Laoc;c(FFFFF)F
intermediary method_37959
Lnet/minecraft/class_3532;method_37959(FFFFF)F
named map
Lnet/minecraft/util/math/MathHelper;map(FFFFF)F
-
method_34957
public static double method_34957(double double2) - Mappings:
Namespace Name Mixin selector official n
Laoc;n(D)D
intermediary method_34957
Lnet/minecraft/class_3532;method_34957(D)D
named method_34957
Lnet/minecraft/util/math/MathHelper;method_34957(D)D
-
roundUpToMultiple
public static int roundUpToMultiple(int value, int divisor) Returns a value farther than or as far asvalue
from zero that is a multiple ofdivisor
.- Mappings:
Namespace Name Mixin selector official e
Laoc;e(II)I
intermediary method_28139
Lnet/minecraft/class_3532;method_28139(II)I
named roundUpToMultiple
Lnet/minecraft/util/math/MathHelper;roundUpToMultiple(II)I
-
ceilDiv
public static int ceilDiv(int a, int b) - Mappings:
Namespace Name Mixin selector official f
Laoc;f(II)I
intermediary method_38788
Lnet/minecraft/class_3532;method_38788(II)I
named ceilDiv
Lnet/minecraft/util/math/MathHelper;ceilDiv(II)I
-
nextBetween
Returns a random, uniformly distributed integer value in[min, max]
.- Parameters:
min
- the minimum value, inclusivemax
- the maximum value, inclusive- Returns:
- a random, uniformly distributed integer value in
[min, max]
- Throws:
IllegalArgumentException
- if the range is empty (i.e.max < min
)- Mappings:
Namespace Name Mixin selector official b
Laoc;b(Laoh;II)I
intermediary method_32751
Lnet/minecraft/class_3532;method_32751(Lnet/minecraft/class_5819;II)I
named nextBetween
Lnet/minecraft/util/math/MathHelper;nextBetween(Lnet/minecraft/util/math/random/Random;II)I
-
nextBetween
- Mappings:
Namespace Name Mixin selector official b
Laoc;b(Laoh;FF)F
intermediary method_32750
Lnet/minecraft/class_3532;method_32750(Lnet/minecraft/class_5819;FF)F
named nextBetween
Lnet/minecraft/util/math/MathHelper;nextBetween(Lnet/minecraft/util/math/random/Random;FF)F
-
nextGaussian
- Mappings:
Namespace Name Mixin selector official c
Laoc;c(Laoh;FF)F
intermediary method_32855
Lnet/minecraft/class_3532;method_32855(Lnet/minecraft/class_5819;FF)F
named nextGaussian
Lnet/minecraft/util/math/MathHelper;nextGaussian(Lnet/minecraft/util/math/random/Random;FF)F
-
squaredHypot
public static double squaredHypot(double a, double b) - Mappings:
Namespace Name Mixin selector official e
Laoc;e(DD)D
intermediary method_41189
Lnet/minecraft/class_3532;method_41189(DD)D
named squaredHypot
Lnet/minecraft/util/math/MathHelper;squaredHypot(DD)D
-
hypot
public static double hypot(double a, double b) - Mappings:
Namespace Name Mixin selector official f
Laoc;f(DD)D
intermediary method_39241
Lnet/minecraft/class_3532;method_39241(DD)D
named hypot
Lnet/minecraft/util/math/MathHelper;hypot(DD)D
-
squaredMagnitude
public static double squaredMagnitude(double a, double b, double c) - Mappings:
Namespace Name Mixin selector official e
Laoc;e(DDD)D
intermediary method_41190
Lnet/minecraft/class_3532;method_41190(DDD)D
named squaredMagnitude
Lnet/minecraft/util/math/MathHelper;squaredMagnitude(DDD)D
-
magnitude
public static double magnitude(double a, double b, double c) - Mappings:
Namespace Name Mixin selector official f
Laoc;f(DDD)D
intermediary method_33825
Lnet/minecraft/class_3532;method_33825(DDD)D
named magnitude
Lnet/minecraft/util/math/MathHelper;magnitude(DDD)D
-
roundDownToMultiple
public static int roundDownToMultiple(double a, int b) Returnsa
rounded down to the nearest multiple ofb
.- Returns:
a
rounded down to the nearest multiple ofb
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(DI)I
intermediary method_38961
Lnet/minecraft/class_3532;method_38961(DI)I
named roundDownToMultiple
Lnet/minecraft/util/math/MathHelper;roundDownToMultiple(DI)I
-
stream
- Mappings:
Namespace Name Mixin selector official d
Laoc;d(III)Ljava/util/stream/IntStream;
intermediary method_42120
Lnet/minecraft/class_3532;method_42120(III)Ljava/util/stream/IntStream;
named stream
Lnet/minecraft/util/math/MathHelper;stream(III)Ljava/util/stream/IntStream;
-
stream
- Mappings:
Namespace Name Mixin selector official a
Laoc;a(IIII)Ljava/util/stream/IntStream;
intermediary method_42117
Lnet/minecraft/class_3532;method_42117(IIII)Ljava/util/stream/IntStream;
named stream
Lnet/minecraft/util/math/MathHelper;stream(IIII)Ljava/util/stream/IntStream;
-