Skip to content

Instantly share code, notes, and snippets.

@lachlandcp
Last active August 29, 2015 14:21
Show Gist options
  • Save lachlandcp/bd35a26a25e911bcf976 to your computer and use it in GitHub Desktop.
Save lachlandcp/bd35a26a25e911bcf976 to your computer and use it in GitHub Desktop.
Snippet for calculating correct PE yaw
/*
MCPE counts the yaw infinitely, which ain't ideal. This calculates the correct yaw, so that it's between 0 and 360
*/
function correctYaw(){ getYaw() % 360 - (360 * Math.floor(getYaw() % 360 / 360)) }
/*
-180 to +180
*/
function correctYaw(){ getYaw() % 180 - (180 * Math.floor(getYaw() % 180 / 180)) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment