protected void addTileOrDescendants(RenderContext rc, TerrainTile tile) { if (!tile.intersectsSector(this.levelSet.sector) || !tile.intersectsFrustum(rc, rc.frustum)) { return; // ignore the tile and its descendants if it's not needed or not visible } if (tile.level.isLastLevel() || !tile.mustSubdivide(rc, this.detailControl)) { this.addTile(rc, tile); return; // use the tile if it does not need to be subdivided } for (Tile child : tile.subdivideToCache(this, this.tileCache, 4)) { // each tile has a cached size of 1 this.addTileOrDescendants(rc, (TerrainTile) child); // recursively process the tile's children } }