-
Bug
-
Resolution: Unresolved
-
None
-
1.19.3, (17)
23w04a, 1.19.4 Pre-release 2, 1.19.4 Pre-release 3, 1.19.4 Release Candidate 2, 1.19.4, 23w12a, 23w16a, 1.20 Release Candidate 1, 1.20, 1.20.4, 24w09a, 24w10a, 24w11a, 1.20.6, 1.21.1, 1.21.3, 1.21.4 Release Candidate 3 -
None
-
Confirmed
-
Camera
-
Low
-
Platform
Steps to reproduce:
- move your mouse without riding anything, this is expected behavior
- ride something
- move your mouse. now horizontal movement seems to lag behind vertical
In the attached video, a cursor is drawn directly with the X and Y components of the camera rotation matrix to demonstrate the issue. The behavior can be observed without it, albeit less noticeable. It is possible to see the issue without the custom cursor if you focus on a corner of the stone platform. It may be easier to notice when moving the mouse fast in a large circular motion, or flicking the mouse diagonally
I looked at the code a bit, and the `getViewYRot` method inside `net.minecraft.client.player.LocalPlayer` (below) seems to be a cause of this issue (this is 1.21.2-rc1 with mojmap)
When the player is riding an entity, this method returns the result of `AbstractClientPlayer#getViewYRot`, otherwise it returns `LocalPlayer#getYRot`.
One fix could be to make this method always return the result of `LocalPlayer#getYRot`, although this would make mounts like horses no longer visually locked to the player's camera rotation, instead lagging slightly behind when rotating the camera. I tested this by writing a quick fabric mod, and it seemed to work well under a lot of circumstances, including using /rotate while riding entities
Alternatively, it could only return the result of `AbstractClientPlayer#getViewYRot` when riding horses (and similar) as opposed to any entity like it currently does. This would keep the camera locked to the horse's rotation and would remove the lag when riding other entities that the player doesn't have direct control over.
There is probably other ways to fix this, just thought I'd leave some ideas