Beispiel #1
0
 public OctTreeNode findLeaf(OctTreeNode children, Vector3 pos)
 {
     foreach(OctTreeNode child in children.childNode)
     {
         if (child.Contains(pos.X, pos.Y, pos.Z))
         {
             if (child.AllItems.Count != 0)
             {
                 possibleLeaf = child;
                 findLeaf(child, pos);
             }
         }
     }
     return possibleLeaf;
 }
Beispiel #2
0
 public List<IOctTreeElement> getObjectsToCompareWith(Vector3 pos)
 {
     List<IOctTreeElement> ret = new List<IOctTreeElement>();
     List<OctTreeNode> children = root.childNode;
     possibleLeaf = null;
     foreach(OctTreeNode child in children)
     {
         if (child.Contains(pos.X, pos.Y, pos.Z))
         {
             if (child.AllItems.Count != 0)
             {
                 findLeaf(child, pos);
             }
         }
     }
     if (possibleLeaf == null)
     {
         return ret;
     }
     else
     {
         return possibleLeaf.AllItems;
     }
 }
Beispiel #3
0
 public OctTree(float xMin, float yMin, float zMin, float xMax, float yMax, float zMax)
 {
     root = new OctTreeNode(xMin, yMin,zMin, xMax, yMax, zMax);
 }