Exemplo n.º 1
0
 protected override IEdge Generate()
 {
     for (int i = 0; i < a.Resolution; i++)
     {
         IEdge ea = a.GetEdge(i);
         for (int j = 0; j < b.Resolution; j++)
         {
             IEdge eb = b.GetEdge(j);
             if (ea.CompareLine(eb) && Vector3.Dot(ea.Direction(), eb.Direction()) < 0)
             {
                 return(ea.GetIntersecting(eb));
             }
         }
     }
     throw new IEdgeSplitException("Failed to find intersection.", a, b);
 }
Exemplo n.º 2
0
 public static bool HasIntersection(IPoly a, IPoly b)
 {
     //This logic is just wrong
     //Needs to be recoded
     throw new NotImplementedException();
     for (int i = 0; i < a.Resolution; i++)
     {
         IEdge ea = a.GetEdge(i);
         for (int j = 0; j < b.Resolution; j++)
         {
             IEdge eb = b.GetEdge(j);
             if (ea.CompareLine(eb) && Vector3.Dot(ea.Direction(), eb.Direction()) < 0)
             {
                 return(ea.GetIntersecting(eb) != null);
             }
         }
     }
     return(false);
 }