From 162f4c5e208378b539fbc8364e109429d9885500 Mon Sep 17 00:00:00 2001 From: Joseph Burton Date: Wed, 26 Feb 2020 21:43:31 +0000 Subject: [PATCH] minusDiv -> getLerpProgress + other improvements (#1134) * minusDiv -> inverseLerp * Rename parameters and clarify javadoc * Fix javadoc to refer to new parameter names * Rename inverseLerp -> getLerpProgress and other improvements in MathHelper * randomUUID -> randomUuid --- .../minecraft/util/math/MathHelper.mapping | 66 +++++++++++++++---- 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/mappings/net/minecraft/util/math/MathHelper.mapping b/mappings/net/minecraft/util/math/MathHelper.mapping index 6d6d8a7fab..9962fb079d 100644 --- a/mappings/net/minecraft/util/math/MathHelper.mapping +++ b/mappings/net/minecraft/util/math/MathHelper.mapping @@ -29,6 +29,8 @@ CLASS net/minecraft/class_3532 net/minecraft/util/math/MathHelper ARG 0 a ARG 1 b METHOD method_15349 atan2 (DD)D + ARG 0 y + ARG 2 x METHOD method_15350 clamp (DDD)D ARG 0 value ARG 2 min @@ -76,10 +78,16 @@ CLASS net/minecraft/class_3532 net/minecraft/util/math/MathHelper ARG 0 hue ARG 1 saturation ARG 2 value - METHOD method_15370 minusDiv (DDD)D - ARG 0 numerator - ARG 2 delta - ARG 4 denominator + METHOD method_15370 getLerpProgress (DDD)D + COMMENT Gets the fraction of the way that {@code value} is between {@code start} and {@code end}. + COMMENT This is the delta value needed to lerp between {@code start} and {@code end} to get {@code value}. + COMMENT In other words, {@code getLerpProgress(lerp(delta, start, end), start, end) == delta}. + ARG 0 value + COMMENT The result of the lerp function + ARG 2 start + COMMENT The value interpolated from + ARG 4 end + COMMENT The value interpolated to METHOD method_15371 hashCode (III)J ARG 0 x ARG 1 y @@ -109,13 +117,13 @@ CLASS net/minecraft/class_3532 net/minecraft/util/math/MathHelper METHOD method_15389 hashCode (Lnet/minecraft/class_2382;)J ARG 0 vec METHOD method_15390 clampedLerp (DDD)D - ARG 0 first - ARG 2 second + ARG 0 start + ARG 2 end ARG 4 delta METHOD method_15391 absMax (DD)D METHOD method_15392 wrapDegrees (I)I METHOD method_15393 wrapDegrees (F)F - METHOD method_15394 randomUUID ()Ljava/util/UUID; + METHOD method_15394 randomUuid ()Ljava/util/UUID; METHOD method_15395 nextInt (Ljava/util/Random;II)I ARG 0 random ARG 1 min @@ -123,23 +131,54 @@ CLASS net/minecraft/class_3532 net/minecraft/util/math/MathHelper METHOD method_16435 perlinFade (D)D METHOD method_16436 lerp (DDD)D ARG 0 delta - ARG 2 first - ARG 4 second + ARG 2 start + ARG 4 end METHOD method_16437 lerp2 (DDDDDD)D + COMMENT 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. ARG 0 deltaX + COMMENT The x-coordinate on the unit square ARG 2 deltaY + COMMENT The y-coordinate on the unit square + ARG 4 val00 + COMMENT The output if {@code deltaX} is 0 and {@code deltaY} is 0 + ARG 6 val10 + COMMENT The output if {@code deltaX} is 1 and {@code deltaY} is 0 + ARG 8 val01 + COMMENT The output if {@code deltaX} is 0 and {@code deltaY} is 1 + ARG 10 val11 + COMMENT The output if {@code deltaX} is 1 and {@code deltaY} is 1 METHOD method_16438 lerp3 (DDDDDDDDDDD)D + COMMENT 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. ARG 0 deltaX + COMMENT The x-coordinate on the unit cube ARG 2 deltaY + COMMENT The y-coordinate on the unit cube ARG 4 deltaZ + COMMENT The z-coordinate on the unit cube + ARG 6 val000 + COMMENT The output if {@code deltaX} is 0, {@code deltaY} is 0 and {@code deltaZ} is 0 + ARG 8 val100 + COMMENT The output if {@code deltaX} is 1, {@code deltaY} is 0 and {@code deltaZ} is 0 + ARG 10 val010 + COMMENT The output if {@code deltaX} is 0, {@code deltaY} is 1 and {@code deltaZ} is 0 + ARG 12 val110 + COMMENT The output if {@code deltaX} is 1, {@code deltaY} is 1 and {@code deltaZ} is 0 + ARG 14 val001 + COMMENT The output if {@code deltaX} is 0, {@code deltaY} is 0 and {@code deltaZ} is 1 + ARG 16 val101 + COMMENT The output if {@code deltaX} is 1, {@code deltaY} is 0 and {@code deltaZ} is 1 + ARG 18 val011 + COMMENT The output if {@code deltaX} is 0, {@code deltaY} is 1 and {@code deltaZ} is 1 + ARG 20 val111 + COMMENT The output if {@code deltaX} is 1, {@code deltaY} is 1 and {@code deltaZ} is 1 METHOD method_16439 lerp (FFF)F ARG 0 delta - ARG 1 first - ARG 2 second + ARG 1 start + ARG 2 end METHOD method_17821 lerpAngleDegrees (FFF)F ARG 0 delta - ARG 1 first - ARG 2 second + ARG 1 start + ARG 2 end METHOD method_17822 sign (D)I METHOD method_20306 capRotation (FFF)F ARG 0 start @@ -156,6 +195,7 @@ CLASS net/minecraft/class_3532 net/minecraft/util/math/MathHelper ARG 0 start ARG 1 end ARG 2 delta + METHOD method_22860 fwrapDegrees (D)F METHOD method_23278 fastInverseCbrt (F)F ARG 0 x METHOD method_24156 clamp (JJJ)J