Advertisement
PsyOps

rotation

Mar 29th, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1.         private byte adjust(PlayerPositionEvent OldBotPos, ushort newX, ushort newY)
  2.         {
  3.  
  4.  
  5.             double angle = (float)Math.Atan2(BotVehicle.forward().z, BotVehicle.forward().x);
  6.             //  angle += 1.57079633;
  7.             angle = RadianToDegree(angle);
  8.  
  9.             angle = angle < 0 ? 360 + angle % 360 : angle % 360;
  10.  
  11.  
  12.             if (angle < 90) return (byte)Math.Floor((angle + 90) / 9);
  13.             if (angle < 180) return (byte)Math.Floor((angle + 90) / 9);
  14.             if (angle < 270) return (byte)Math.Floor((angle + 90) / 9);
  15.             if (angle < 360) return (byte)Math.Floor((angle + 90) / 9);
  16.  
  17.             throw new NotImplementedException();
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement