コード例 #1
0
 private void Split()
 {
     if (subNodes == null)
     {
         subNodes    = new FBQuadTreeNode[4];
         subNodes[0] = new FBQuadTreeNode(TopLeftRectangle, level + 1, capacity, maxLevel);
         subNodes[1] = new FBQuadTreeNode(TopRightRectangle, level + 1, capacity, maxLevel);
         subNodes[2] = new FBQuadTreeNode(BottomLeftRectangle, level + 1, capacity, maxLevel);
         subNodes[3] = new FBQuadTreeNode(BottomRightRectangle, level + 1, capacity, maxLevel);
     }
 }
コード例 #2
0
 public FBQuadTree(Rectangle worldBoundaries, int nodeCapacity, int maxLevel)
 {
     mainNode = new FBQuadTreeNode(worldBoundaries, 1, nodeCapacity, maxLevel);
 }