mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-22 09:01:57 -05:00
Page:
Dig animation details
Pages
Analysing performance (Webclient)
Classic sounds
Dig animation details
Directional blocks and auto rotate
Home
Launcher documentation WIP
MC Fire animation
Minecraft Classic lava animation algorithm
Minecraft Classic map generation algorithm
Physics
Position of the player's arm in 1st person, from Survival Test
Seeing why the game is frozen
No results
1
Dig animation details
Goodlyay edited this page 2017-08-18 03:28:51 -07:00
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.
Wiki & Documentation
Users (WIP)
- Frequently Asked Questions
- Setting up a MC Classic Server
Developers
- MC Classic Lava Animation
- Dig Animation Detail
- MC Classic Map Generation
- Physics
- Position of the player's arm
- Directional Blocks & Auto Rotate