Beispiel #1
0
 public void SelfCollide()
 {
     if (isLeaf)
     {
         return;
     }
     child1.SelfCollide();
     child2.SelfCollide();
     child1.Collide(child2);
 }
Beispiel #2
0
 public void Collide(BVHN b)
 {
     if (!box.Overlaps(b.box))
     {
         return;
     }
     if (this.isLeaf && b.isLeaf)
     {
         Element e1 = box.elem;
         Element e2 = b.box.elem;
         broad_list.Add(e1);
         broad_list.Add(e2);
     }
     else if (this.isLeaf)
     {
         Collide(b.child1);
         Collide(b.child2);
     }
     else
     {
         b.Collide(child1);
         b.Collide(child2);
     }
 }