Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I've been trying to create a remote controlled entity, it's been going pretty well so far, though I have a single issue. To move the camera I've opted for how AbstractHorseEntity does it, copying the player's yaw and pitch values. This works fine until the yaw value reaches 360, upon which it abruptly snaps to about -90 and then returns to 0. Can anyone tell me what's causing this? The code for the entity can be found here.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

4 hours ago, Novârch said:

Can anyone tell me what's causing this?

Try moving the line

prevRotationYaw = rotationYaw;

below the line

setRotation(rotationYaw, rotationPitch);

 

You could also try overriding getYaw() to simply return rotationYaw, since getYaw() is what is used to determine the viewport yaw.

  • Author
15 minutes ago, vemerion said:

You could also try overriding getYaw() to simply return rotationYaw, since getYaw() is what is used to determine the viewport yaw.

This works, though it makes the rotation a heck of a lot less smooth. Nonetheless, thank you.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

  • Novârch changed the title to [SOLVED] [1.15.2] Camera yaw issues
14 minutes ago, Novârch said:

This works, though it makes the rotation a heck of a lot less smooth. Nonetheless, thank you.

Yes, the unfortunate side-effect of this solution is that it effectively reduces the update rate of the yaw rotation to 20 fps. A more sophisticated method might call super.getYaw() in most cases, and only resort to returning rotationYaw in the case when the rotation goes from 360 -> 0, or similar.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.