mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
headYaw rot changes
This commit is contained in:
parent
1b0366802f
commit
447638816e
5 changed files with 26 additions and 16 deletions
|
|
@ -39,10 +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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue