Comments (4)
Thanks for reporting. While working on some major refactorings lately (see 7128310), I also came across this issue. I wanted to correctly set the camera rotations after a teleport command. Unfortunately, this the problem is a bit more nuanced, as ClientPacketListener.handleMovePlayer
is invoked in the following scenarios:
- Teleport/Ender pearl
- Dimension change
- Mount/Dismount
When in Shoulder Surfing perspective, the camera rotations should not reset when teleporting (or using an ender pearl) or (dis-)mounting, as it can be very disorienting. It is also not always possible to distinguish those cases.
As a possible fix, you could use the new Shoulder Surfing API and set the camera rotations manually, if thats possible in your case:
ShoulderSurfing.getInstance().getCamera().setXRot(xRot);
ShoulderSurfing.getInstance().getCamera().setYRot(yRot);
Note that this API has not been released yet. It will be available for Shoulder Surfing 4.0.0+. For now, you would need to access the implemention directly:
ShoulderRenderer.getInstance().setCameraXRot(xRot);
ShoulderRenderer.getInstance().setCameraYRot(yRot);
from shouldersurfing.
Thank you for the feedback.
As far as I can see after some investigation, I don't think using the API would feasible in my case. I sent a vanilla packet (by invoking vanilla teleport function) handled by vanilla client code.
Sending a custom packet would be possible to adjust the camera angle additionally, however the position and custom angle adjusting packets would not be fully synchronized, likely resulting multiple camera adjustments under a short time.
I understand your concerns your regarding disorienting camera adjustments, and absolutely commend that 🫡, still I think it would be most optimal if Shoulder Surfing would handle the rotation inside the packet.
So I have the following recommendations:
- If rotation data in the packet is only present at teleport cases (not at dismounting), adjusting the camera unconditionally will not cause districation (imo), since the position of the camera is changed by the teleport any way.
- If rotation is always passed by the server (so we cannot ever distinguish), how about adjusting camera rotation if the difference between current and received angles is larger than a certain (configurable) value (for example 20 degrees).
What do you think?
from shouldersurfing.
I implemented it now by checking for rotation changes. I also did this in initial experiments last week, but there I injected into some other teleport function which caused many issues. The only caveat now is that it also resets the camera rotations when changing dimensions, but I'm fine with that. Let me know if it works for your use case!
from shouldersurfing.
Hello!
I tested the topmost commit of 1.20.1 branch. The few scenarios I was able to test it worked perfectly, including shadow step. :)
caveat now is that it also resets the camera rotations when changing
I believe instead of a caveat this is actually the correct behavior.
Thank you for the cooperation!
from shouldersurfing.
Related Issues (20)
- Incompatible with Better Third Person HOT 3
- Can't edit configs in the latest modmenu 10.0.0 HOT 1
- Game crashing with mod HOT 1
- Incompatible with Iris HOT 1
- Incompatible with Capes HOT 6
- When Holding a Ranged Weapon (Armed Crossbow) Or Drawing One (Bow) Zoom In HOT 1
- without decoupled camera, crosshair aiming is not precise HOT 1
- [suggestion] option to move the static crosshair ray adjacent to the player's head
- Bring back disconnected camera option HOT 1
- Incompatibility with Physics Mod Pro
- Incompatible with Bliss Shadev (Developtment Version) HOT 1
- support for midnight controls: allow joysticks to manipulate camera movment HOT 1
- Neoforge 21.0.82 changes crash on launch HOT 1
- [Suggestion] add a config to completely remove the third person back and front perspective HOT 1
- Disable the Crosshair thing HOT 1
- Camera error with MedievalWeapons HOT 1
- Incompatible with Better Third Person. HOT 29
- Incompatible with Create (latest ver) HOT 4
- Any updates on Valkyrien Skies compatibility?
- crash at join server
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shouldersurfing.