/// <summary>
        /// Checks if a Rectangle collides with the Arc.
        /// </summary>
        /// <param name="rect">Rectangle to check</param>
        /// <returns>On collision, true is returned, false otherwise</returns>
        private bool InterceptRectWith(AARectangle rect, double tolerance = GeometrySettings.DEFAULT_TOLERANCE)
        {
            var borderLines = LineSegment2.FromRectangle(rect); //get 4 borderlines from rect

            if (borderLines != null)
            {
                return(InterceptLinesWith(borderLines, tolerance));
            }
            return(false);
        }
        /// <summary>Checks if a Rectangle collides with the Arc.
        ///
        /// </summary>
        /// <param name="rect">Rectangle to check</param>
        /// <returns>On collision, a List of interception Points is returned</returns>
        private List <Vector2> InterceptRect(AARectangle rect, double tolerance = GeometrySettings.DEFAULT_TOLERANCE)
        {
            var intersections = new List <Vector2>();
            var borderLines   = LineSegment2.FromRectangle(rect); //get 4 borderlines from rect

            if (borderLines != null)
            {
                intersections.AddRange(InterceptLines(borderLines, tolerance));
            }
            return(intersections);
        }
Ejemplo n.º 3
0
 public LineSegment2[] ToLines()
 {
     return(LineSegment2.FromRectangle(ToAARectangle()));
 }