예제 #1
0
        public static Direction Turn(Direction pDirection, int pDegrees)
        {
            int degrees = (int)IntPoint.DirectionToIntPoint(pDirection).Degrees();

            degrees += pDegrees;
            return(GridMath.DegreesToDirection((int)degrees));
        }
예제 #2
0
        public static Direction RadiansToDirection(float pRadians)
        {
            int dir = (int)(System.Math.Round(pRadians * EIGHTH, 0));

            // cap to eight directions
            return(GridMath.DirectionIndexToDirection(dir & 7));
        }