First-person Model (Forge/Fabric)

First-person Model (Forge/Fabric)

4M Downloads

Body offset uses head's (camera's) yaw instead of body's yaw

floral-qua-floral opened this issue ยท 3 comments

commented

The body is offset backwards relative to the head's yaw, rather than its own yaw. As a result, the body can be seen sliding left and right a bit when rotating the head. This is particularly noticeable when the body's yaw is locked, such as with the ladder animation from Not Enough Animations. When the player looks directly left or right, the body is being shifted sideways relative to itself, rather than backwards; as a result, the arms will clip into the camera, completely blinding the player.

first.person.model.using.head.rotation.mp4

It seems to me that it would make a lot more sense for the body to be offset relative to its own yaw rather than the head's. This would prevent the subtle sliding that occurs when turning left and right. In situations where the body's yaw is locked, it would remain motionless rather than shifting around, so when the player is on a ladder their arm would never move to clip into the camera. The only downside the comes to mind is that when the body yaw is locked, looking backwards could result in the player's model getting in the way, since it won't be pushed behind the camera (forward relative to itself). But having a partially obscured view when looking backwards on a ladder seems preferable to me over having a completely obscured view when looking left or right on a ladder.

I suspect this change would also generally improve visibility when looking down, due to the fact that the player model is much wider than it is deep. Consider this screenshot, in which I've configured the standing offset to -20 so as to basically disable the mod's built-in offset:

image

With the way body offset currently works, re-enabling offset moves my body straight down along the image. This moves some of the top face of my body out of the field of view, but it also brings the top face of my left shoulder into the field of view. If body offset was modified to follow the body's yaw, then re-enabling it would instead shift my body down and to the left. This would move some of the top face of my body out of the field of view, without pulling my shoulder into view.
Put another way, moving the body straight down (backwards relative to the head's yaw) would be shifting it backwards & to the right, relative to itself. That rightwards component to the movement is mostly pointless, since the body is so wide that it's just bringing more playermodel into view. Moving the body purely backwards would be more effective.

Hopefully I've explained what I'm thinking adequately. If it's still not clear what I mean, I can try to come up with a better way.

commented

Wow thats a long report :D. I think it has been this way the entire time(also with the slight shifting on the ground), but I guess trying to lock it to the body instead of the head could make sense. I'll try to make a branch with the change to try it.

commented

Welp, it does feel quite a bit more natural. The body will still slide on its own when rotating the camera too far, but the model feels a lot more grounded now. I'll push it into the 1.19 and 1.18 branch, download one of the builds(https://github.com/tr7zw/FirstPersonModel/actions) and give it a try.

commented

Fixed.