-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yaw exceeding limits #618
Comments
If I'm not mistaken, this behavior is intentional because it's mirroring the actual yaw values the client is giving to the server. I'm also not sure -180 to 180 is the most desirable range. Perhaps 0° ≤ θ < 360° would be more intuitive? |
I looked into the code a bit and you're right that the yaw is set to the values received from the client. The thing that confused me is that the docs for /// The yaw angle in degrees, where:
/// - `-90` is looking east (towards positive x).
/// - `0` is looking south (towards positive z).
/// - `90` is looking west (towards negative x).
/// - `180` is looking north (towards negative z).
///
/// Values -180 to 180 are also valid.
pub yaw: f32, |
I wonder how that is handled in other server implementations like Minestom or Vanilla/Spigot. |
In Spigot they use -180 to 180 as well so I would not recommend messing with that convention. Even in Minecraft itself you can see yaw and pitch in the F3 debug menu in the same way. |
Valence Version
v0.2.0-alpha.1+mc.1.20.1 (#7e91ca0f)
What You Did Do
spin around
https://drive.google.com/file/d/1FSWOni9cGB2K6jDE3VipBOpPVIQJvSt_/view?usp=sharing
What Went Wrong
The yaw in
valence::entity::Look
is not wrapped making it exceed the normal limits if the player spins aroundWhat were you expecting and what actually happened?
The yaw should wrap to stay within -180 and 180
The text was updated successfully, but these errors were encountered: