mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
tweaks to headYaw rotation, so it should be nearly perfect now
This commit is contained in:
parent
a5a0c0e000
commit
e4d1898613
5 changed files with 26 additions and 16 deletions
|
|
@ -39,12 +39,16 @@ class Utils{
|
|||
return $id;
|
||||
}
|
||||
|
||||
public static function wrapAngleTo180_float($par0)
|
||||
public static function wrapAngleTo360($angle)
|
||||
{
|
||||
$par0 %= 360.0;
|
||||
return $par0 >= 180 ? $par0 - 360 : (($par0 < -180) ? ($par0 + 360) : $par0);
|
||||
$angle %= 360;
|
||||
return $angle < 0 ? $angle + 360 : $angle;
|
||||
}
|
||||
public static function wrapAngleTo180($angle)
|
||||
{
|
||||
$angle = fmod($angle+180, 360);
|
||||
return $angle < 0 ? $angle + 360 : $angle - 180;
|
||||
}
|
||||
|
||||
public static function getSign($v){
|
||||
return $v > 0 ? 1 : ($v < 0 ? -1 : 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue