Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private byte adjust(PlayerPositionEvent OldBotPos, ushort newX, ushort newY)
- {
- double angle = (float)Math.Atan2(BotVehicle.forward().z, BotVehicle.forward().x);
- // angle += 1.57079633;
- angle = RadianToDegree(angle);
- angle = angle < 0 ? 360 + angle % 360 : angle % 360;
- if (angle < 90) return (byte)Math.Floor((angle + 90) / 9);
- if (angle < 180) return (byte)Math.Floor((angle + 90) / 9);
- if (angle < 270) return (byte)Math.Floor((angle + 90) / 9);
- if (angle < 360) return (byte)Math.Floor((angle + 90) / 9);
- throw new NotImplementedException();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement