Last active
August 29, 2015 14:21
-
-
Save lachlandcp/bd35a26a25e911bcf976 to your computer and use it in GitHub Desktop.
Snippet for calculating correct PE yaw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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