Ejemplo n.º 1
0
        /// <summary>
        ///   Computes the direction which is closest to the specified vector.
        /// </summary>
        /// <param name="vector">Vector to get direction for.</param>
        /// <returns>Direction which is closest to the specified vector.</returns>
        public static DirectionType ComputeCardinalDirection(Vector2F vector)
        {
            // Compute angle.
            float angle = Vector2F.CalculateAngle(Vector2F.Forward, vector);

            return(ComputeCardinalDirection(angle));
        }