Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math helper consts / Animation mappings update #3285

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
CLASS net/minecraft/class_7179 net/minecraft/client/render/entity/animation/BoneAnimation
COMMENT An animation applied to a single bone within a timeline.
COMMENT
COMMENT A bone animation consists of a series of keyframes at defined points in time that
COMMENT are then interlated between to form smooth motion.
CLASS class_7180 Interpolation
METHOD apply (Lnet/minecraft/class_1160;F[Lnet/minecraft/class_7186;IIF)Lnet/minecraft/class_1160;
ARG 1 outputVector
COMMENT The vector to write the interpolated result into
ARG 2 delta
COMMENT Current tick delta used to interpolate between frames
ARG 3 keyframes
COMMENT Keyframes of the animation being interpolated
ARG 4 start
COMMENT Index of the starting keyframe
ARG 5 end
COMMENT Index of the ending ketframe
ARG 6 magnitude
COMMENT Magnitude of the animation function
CLASS class_7181 Interpolations
FIELD field_37884 LINEAR Lnet/minecraft/class_7179$class_7180;
COMMENT Interpolates an animation between two points at a constant (linear) rate.
FIELD field_37885 EASE Lnet/minecraft/class_7179$class_7180;
COMMENT Interpolates an animation between two points at a rate dependant on the
COMMENT gradient formed by the keyframes around at those two points.
METHOD method_41815 (Lnet/minecraft/class_1160;F[Lnet/minecraft/class_7186;IIF)Lnet/minecraft/class_1160;
ARG 0 outputVector
ARG 1 delta
ARG 2 keyframes
ARG 3 start
ARG 4 end
ARG 5 magnitude
METHOD method_41816 (Lnet/minecraft/class_1160;F[Lnet/minecraft/class_7186;IIF)Lnet/minecraft/class_1160;
ARG 0 outputVector
ARG 1 delta
ARG 2 keyframes
ARG 3 start
ARG 4 end
ARG 5 magnitude
CLASS class_7182 Target
COMMENT A target of the animation.
COMMENT
COMMENT Defines how a interpolated vector is to be applied to a target model part.
COMMENT
COMMENT @see BoneAnimation.Targets
METHOD apply (Lnet/minecraft/class_630;Lnet/minecraft/class_1160;)V
COMMENT Applied a transformed vector to a destination model part
ARG 1 modelPart
ARG 2 vector
CLASS class_7183 Targets
FIELD field_37886 TRANSLATE Lnet/minecraft/class_7179$class_7182;
FIELD field_37887 ROTATE Lnet/minecraft/class_7179$class_7182;
FIELD field_37888 SCALE Lnet/minecraft/class_7179$class_7182;
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
CLASS net/minecraft/class_7184 net/minecraft/client/render/entity/animation/Animation
CLASS net/minecraft/class_7184 net/minecraft/client/render/entity/animation/Timeline
COMMENT Represents a scripted sequence of animations that play out over a preset duration of time.
CLASS class_7185 Builder
FIELD field_37889 lengthInSeconds F
FIELD field_37890 transformations Ljava/util/Map;
FIELD field_37890 boneAnimations Ljava/util/Map;
FIELD field_37891 looping Z
METHOD <init> (F)V
ARG 1 lengthInSeconds
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
CLASS net/minecraft/class_7187 net/minecraft/client/render/entity/animation/TimelineHelper
METHOD method_41822 scale (DDD)Lnet/minecraft/class_1160;
COMMENT Creates a vector for use with a scaling keyframe.
COMMENT
COMMENT Scaling is performed by addition, so the parameters (0,0,0) results
COMMENT in a contraction of 1. Parameters of (1,1,1) is thus the unit vector,
COMMENT which results in no change, and (2,2,2) would produce an expansion.
COMMENT
COMMENT In effect returns a vector for which all coordinates have had -1 added to them.
COMMENT
COMMENT @return a new scale vector
ARG 0 x
ARG 2 y
ARG 4 z
METHOD method_41823 translation (FFF)Lnet/minecraft/class_1160;
COMMENT Creates a vector for use with a translation keyframe.
COMMENT
COMMENT In effect simply returns a vector with the y coordinate inverted.
COMMENT
COMMENT @return a new translation vector
ARG 0 x
ARG 1 y
ARG 2 z
METHOD method_41824 (FLnet/minecraft/class_1160;FLnet/minecraft/class_630;Lnet/minecraft/class_7179;)V
ARG 4 transformation
METHOD method_41825 (F[Lnet/minecraft/class_7186;I)Z
ARG 2 index
METHOD method_41826 getDuration (Lnet/minecraft/class_7184;J)F
ARG 0 timeline
ARG 1 runningTime
METHOD method_41827 playAnimation (Lnet/minecraft/class_5597;Lnet/minecraft/class_7184;JFLnet/minecraft/class_1160;)V
ARG 0 model
ARG 1 timeline
ARG 2 runningTime
ARG 4 magnitude
ARG 5 outputVector
METHOD method_41828 (Ljava/util/List;FLnet/minecraft/class_1160;FLnet/minecraft/class_630;)V
ARG 4 part
METHOD method_41829 rotation (FFF)Lnet/minecraft/class_1160;
COMMENT Creates a vector for use with a rotation keyframe.
COMMENT
COMMENT Accepts pitch, yaw, and roll as degrees and returns an equivalent vector
COMMENT where all components are expressed as radians.
COMMENT
COMMENT @return a new rotation vector
ARG 0 pitchDegrees
ARG 1 yawDegrees
ARG 2 rollDegrees

This file was deleted.

48 changes: 48 additions & 0 deletions mappings/net/minecraft/util/math/MathHelper.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ CLASS net/minecraft/class_3532 net/minecraft/util/math/MathHelper
FIELD field_29847 RADIANS_PER_DEGREE F
FIELD field_29848 DEGREES_PER_RADIAN F
FIELD field_29849 EPSILON F
FIELD field_29850 FLOOR_DOWNSHIFT I
FIELD field_29851 FLOOR_UPSHIFT F
FIELD field_29853 HALF_PI_RADIANS_SINE_TABLE_INDEX J
FIELD field_29856 DEGREES_TO_SINE_TABLE_INDEX F
FIELD field_29859 SINE_TABLE_SIZE I
Sollace marked this conversation as resolved.
Show resolved Hide resolved
METHOD method_15338 wrapDegrees (D)D
COMMENT Wraps an angle in degrees to the interval {@code [-180, 180)}.
ARG 0 degrees
Expand Down Expand Up @@ -360,6 +363,31 @@ CLASS net/minecraft/class_3532 net/minecraft/util/math/MathHelper
ARG 0 value
ARG 1 min
ARG 2 max
METHOD method_34940 generateInverseExponents (DDDDDDII)[D
Sollace marked this conversation as resolved.
Show resolved Hide resolved
ARG 0 scale1
ARG 2 normalization1
ARG 4 exponent1
ARG 6 scale2
ARG 8 normalization2
ARG 10 exponent2
ARG 12 startIndex
ARG 13 endIndex
METHOD method_34941 generateInverseExponents (DDDII)[D
Sollace marked this conversation as resolved.
Show resolved Hide resolved
ARG 0 scale
ARG 2 normalization
ARG 4 exponent
ARG 6 startIndex
ARG 7 endIndex
METHOD method_34942 generateLogs (DDII)[D
COMMENT Batch-generates an array of log(n) values from a n=start to n=end.
ARG 0 scale
COMMENT The Y scale factor used to dilate or compress the function
ARG 2 offset
COMMENT The X offset used to shift the function left or right
ARG 4 start
COMMENT The starting X value for the log function
ARG 5 end
COMMENT The ending X value for the log function
METHOD method_34943 multiplyColors (IFFF)I
ARG 0 color
ARG 1 r
Expand Down Expand Up @@ -388,6 +416,12 @@ CLASS net/minecraft/class_3532 net/minecraft/util/math/MathHelper
COMMENT the fallback for unparsable {@code string}
ARG 2 min
COMMENT the minimum if the parsed value is too small
METHOD method_34950 getRandomIndex (Lnet/minecraft/class_5819;[D)I
COMMENT Picks a random value from a list
COMMENT
COMMENT @return The index of the random pick.
ARG 0 random
ARG 1 values
Sollace marked this conversation as resolved.
Show resolved Hide resolved
METHOD method_34951 getCumulativeDistribution ([D)[D
ARG 0 values
METHOD method_34952 multiplyColors (II)I
Expand All @@ -399,6 +433,11 @@ CLASS net/minecraft/class_3532 net/minecraft/util/math/MathHelper
ARG 0 n
METHOD method_34956 perlinFadeDerivative (D)D
ARG 0 value
METHOD method_34957 deviate (D)D
COMMENT Creates a random small, positive deviation from the passed in value.
Sollace marked this conversation as resolved.
Show resolved Hide resolved
COMMENT
COMMENT @return The passed in value + some random amount < 0.01
Sollace marked this conversation as resolved.
Show resolved Hide resolved
ARG 0 initialValue
METHOD method_37166 clampedLerp (FFF)F
ARG 0 start
ARG 1 end
Expand Down Expand Up @@ -460,6 +499,15 @@ CLASS net/minecraft/class_3532 net/minecraft/util/math/MathHelper
ARG 0 a
ARG 2 b
ARG 4 c
METHOD method_41303 ease (FFFFF)F
COMMENT Performs an easing interpolation between a start and end value
COMMENT allows for a smooth transition to a state before and after the
COMMENT transition's start and end values.
ARG 0 delta
ARG 1 before
ARG 2 start
ARG 3 end
ARG 4 after
METHOD method_42117 stream (IIII)Ljava/util/stream/IntStream;
ARG 0 seed
ARG 1 lowerBound
Expand Down