From 034c8ef3422140294236f99d8639ced6f6232a4a Mon Sep 17 00:00:00 2001 From: Goodlyay Date: Fri, 18 Aug 2017 03:28:51 -0700 Subject: [PATCH] Created Dig animation details (markdown) --- Dig-animation-details.md | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Dig-animation-details.md diff --git a/Dig-animation-details.md b/Dig-animation-details.md new file mode 100644 index 0000000..ead0d5e --- /dev/null +++ b/Dig-animation-details.md @@ -0,0 +1,68 @@ +Found by looking at the decompiled Minecraft Classic source code in ClassiCube client. + +Note: All variable names were made up in the process of deobfuscating the code. + +Relevant variables starting values: +bool applyBreakAnim = false; +int breakAnimTicks = 7; //how many ticks it takes for the block break animation to complete. Never changes +int breakTimer = 0; + + +EVERY TICK: + + Add 1 to breakTimer + If breakTimer is equal to breakAnimTicks, set applyBreakAnim to false and set breakTimer to 0. + + +EVERY TIME YOU CLICK TO START THE ANIMATION (checked on tick): + breakTimer = -1 + applyBreakAnim = true; + + + + + +EVERY FRAME: + +if applyBreakAnim is true... + + creates an elapsedTicks, which is the current breakTimer plus delta + + creates lerp, which is elapsedTicks divided by breakAnimTicks + + creates sinHalfCircle, which is sin(lerp * PI) + + creates sqrtLerpPI, which is the square root(lerp) * PI. + + Then, moves the block on... + X by -sin(sqrtLerpPI) * 0.4 + + Y by sin(sqrtLerpPI * 2) * 0.2 + + Z by -sinHalfCircle * 0.2 + Note: Z should be forward/back in this case, if it isn't already in CS + +end if. + + +Intermission: SET HELD BLOCK POSITION AT THIS POINT + + +if applyBreakAnim is true... + + (There will be variable re-use from the first if statement in here.) + + creates sinHalfCircleWeird, which is sin(lerp * lerp * PI) + + rotates on Y axis by sin(sqrtLerpPI) * 80 + + rotates on X axis by -sinHalfCircleWeird * 20 + +end if. + + +If it's not your hand, scale down by 0.4 + +If it's your hand, set hand position here. + +