mojira.dev
MC-127749

Cape is jittering; movement way sharper than in snapshot 18w03b

Steps To Reproduce:

  • Join any Minecraft world

  • Toggle perspective mode, so you can see your cape

  • Now start walking with sprint and press W+A or W+D 

  • Move your mouse in the direction you're walking (it should look like you're walking in circles)

  • Observe how weirdly the cape behaves

Expected Result: Smooth cape movement animation, just as it was before snapshot 18w05a
Actual Result: Cape animation is jittering

Video demonstrating the issue: YouTube Video 

Additional Information:

After a few checks, I found that the first time when the bug appeared in a game was in a snapshot 18w05a, but before that version, there was a snapshot 18w03b where everything was fine with a cape.

Code Analysis:
Code analysis by @unknown can be found in this comment.

Linked issues

Attachments

Comments 47

Could you explain what's different? I'm not seeing any difference.

Probably caused by the fix of MC-75279

In 1.12.2 animation of cape more smoother, than in 18w11a

Confirmed for 18w30a.

Confirmed for 18w30b.

37 more comments

Can confirm in 1.18.1.

Can confirm in 1.18.2.

Hey, this issue has been around for a while now, so I just want to explain how to fix it.

The cape is simply not interpolated correctly at a certain point in the code.
To fix this you only have to change one line in the following method:
net.minecraft.client.renderer.entity.layers.CapeLayer#render

Add the interpolation to the body rotation by multiplying the rotation with the partialTicks variable.
That's it! You can also take a look at my screenshot of my changes to the code:

!diff.png!

I really hope that helps to fix this issue!

Can confirm in 1.19.2.

A speculation of why the solution proposed by @LabyStudio was not implemented yet, seems like it was caused by another issue.

At that point in code, if the entity is a passenger of another entity, "entity.yBodyRot" have its value clamped at between -360 and 360, while "entity.yBodyRotO" still have its normal value, outside that range.

So by that, doing the linear interpolation (lerp) as proposed, the final result would vary depending on how much the two rotation values differs.

kadosawa

gegy

Confirmed

Normal

Player Animation, Rendering

cape, jitter, strafing, walking

Minecraft 18w11a, Minecraft 1.13, Minecraft 18w30a, Minecraft 18w30b, Minecraft 18w31a, ..., 1.19.2, 22w43a, 1.19.3 Pre-release 1, 1.19.3 Pre-release 3, 1.19.3

23w05a

Retrieved