public QuadTree(int minSize) {
    size = depth = 1 ;
    while (size < minSize) { size *= 2 ; depth++ ; }
    nodes = new Node[depth][][] ;
    for (int d = 0, s = size ; d < depth ; d++, s /= 2) {
      nodes[d] = new Node[s][s] ;
      for (int x = 0 ; x < s ; x++)
        for (int y = 0 ; y < s ; y++)
          (nodes[d][x][y] = newNode()).setup(this, x, y, d) ;
    }
  }