ExtraPlayerRenderer icon indicating copy to clipboard operation
ExtraPlayerRenderer copied to clipboard

Need to 'unwind' player rotation.

Open chaosophy opened this issue 1 year ago • 2 comments

Hi,

I have been playing about with the settings to get a little bit of movement/rotation to the model but came across something that doesn't seem right to me.

If you rotate three full revolutions clockwise, you then need to rotate the same amount anti-clockwise before the model will start to rotate the new direction.

I guess it is just continually upping a degrees rotated variable somewhere?

Where to me it'd make more sense, or at least be preferable to me, to have it clamped, say to the values used in the players settings. Maybe as an extra option?

Hope I've explained this in a way that makes sense.

Thanks.

Settings ...

{ "GENERAL": { "openMenuKey": { "keys": "F8" }, "enabled": true, "spectatorAutoSwitch": true, "playerName": "", "offsetX": 0.1, "offsetY": 0.7, "rotationX": 0.0, "rotationY": 45.0, "rotationZ": 0.0, "size": 0.2, "mirror": false }, "ROTATIONS": { "pitchMin": -180.0, "pitchMax": 180.0, "pitchOffset": 0.0, "headYawMin": -45.0, "headYawMax": 45.0, "bodyYawMin": -22.5, "bodyYawMax": 22.5 }, "POSTURES": { "poseOffsetMethod": "MANUAL", "sneakingYOffset": 0.0, "swimCrawlYOffset": -120.0, "elytraYOffset": -120.0 }, "DETAILS": { "hurtFlash": true, "swingHands": true, "lightDegree": 0.0, "useWorldLight": true, "worldLightMin": 2, "renderVehicle": true } }

chaosophy avatar Jun 22 '23 18:06 chaosophy

Thank you! It is actually an ancient issue and I totally forget about it. Now you can try the latest version of the mod.

In the new 2.3.1 version of the mod, I try to fix it by using relative angle between head and body instead of the raw values in minecraft (the underlying raw variables for rotations can take any value). The downside of the new method is some glitches when your mouse is moving too fast.

The patch is not used for the head's rotation -- that requires a different method and I just do not have enough time.

I'm not sure if this fix works for you. Please give it a try and tell me how it goes.

LucunJi avatar Jul 17 '23 16:07 LucunJi

Hi, thanks for taking a look at this and for the update! Much appreciated.

The head fix would be nice to have but it's not too bad as it is and I certainly prefer the mod this way overall compared to the previous version.

Only had a quick test with it but all good so far.

chaosophy avatar Jul 18 '23 14:07 chaosophy

Close as complete. The remaining visual glitch can't be fixed easily.

We can also have some settings to fix the body while rotating the head (as an improvement). Rotating both simultaneously might be unstable / hard to design.

For my future reference, see

https://github.com/LucunJi/ExtraPlayerRenderer/blob/9580d97e34767bc1ff151f8d87a289e0118c4c32/src/main/java/github/io/lucunji/explayerenderer/client/gui/hud/ExtraPlayerHud.java#L182-L197

LucunJi avatar Jul 28 '24 02:07 LucunJi