private void DrawBounds(IBounded bounds, float thickness)
 {
     foreach (Line v in bounds.GetLines())
     {
         DrawLine(v, thickness);
     }
 }
Exemple #2
0
        public static List <Intersection> GetIntersections(IBounded bounds1, IBounded bounds2)
        {
            List <Intersection> intersections = new List <Intersection>();

            foreach (Line line in bounds1.GetLines())
            {
                intersections.AddRange(GetIntersections(line, bounds2));
            }

            return(intersections);
        }
Exemple #3
0
        // INTERSECTION

        public static bool HasIntersection(IBounded bounds1, IBounded bounds2)
        {
            foreach (Line line in bounds1.GetLines())
            {
                if (HasIntersection(line, bounds2))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #4
0
        public static List <Intersection> GetIntersections(Line line, IBounded bounds)
        {
            List <Intersection> intersections = new List <Intersection>();

            foreach (Line otherLine in bounds.GetLines())
            {
                Intersection intersection = GetIntersection(line, otherLine);

                if (intersection != null)
                {
                    intersections.Add(intersection);
                }
            }

            return(intersections);
        }
Exemple #5
0
        public static bool HasIntersection(Line line, IBounded bounds)
        {
            List <Vector2> intersections = new List <Vector2>();

            foreach (Line otherLine in bounds.GetLines())
            {
                Intersection intersection = GetIntersection(line, otherLine);

                if (intersection != null)
                {
                    return(true);
                }
            }

            return(false);
        }