|
@@ -9494,7 +9494,7 @@ class TileHeader {
|
|
|
this.content = await load(contentUrl, loader, options);
|
|
this.content = await load(contentUrl, loader, options);
|
|
|
|
|
|
|
|
// !zeg改
|
|
// !zeg改
|
|
|
- if (/* this.tileset.options. */maxDepth < this.depth && this.type == 'scenegraph') {//有的场景depth为1的不是mesh,只是json,即实际最低depth>1
|
|
|
|
|
|
|
+ if (/* this.tileset.options. */maxDepth < this.depth && this.type == 'scenegraph' && this.parent.type == 'scenegraph') {//如果limit2了,就只加载到最低层的mesh
|
|
|
this.unloadContent()
|
|
this.unloadContent()
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
@@ -10426,7 +10426,7 @@ class Tileset3D extends EventDispatcher{//xzw add EventDispatcher
|
|
|
this.stats.get(TILES_GPU_MEMORY, 'memory');
|
|
this.stats.get(TILES_GPU_MEMORY, 'memory');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- _initializeTileHeaders(tilesetJson, parentTileHeader) {
|
|
|
|
|
|
|
+ _initializeTileHeaders(tilesetJson, parentTileHeader) {//初始化该tileset的层级结构?
|
|
|
|
|
|
|
|
const rootTile = new TileHeader(this, tilesetJson.root, parentTileHeader, parentTileHeader == void 0 && 'root_'+tilesetSid++);
|
|
const rootTile = new TileHeader(this, tilesetJson.root, parentTileHeader, parentTileHeader == void 0 && 'root_'+tilesetSid++);
|
|
|
|
|
|
|
@@ -10445,14 +10445,14 @@ class Tileset3D extends EventDispatcher{//xzw add EventDispatcher
|
|
|
const children = tile.header.children || [];
|
|
const children = tile.header.children || [];
|
|
|
|
|
|
|
|
// !zeg改
|
|
// !zeg改
|
|
|
- if(tile.depth < /* this.options. */maxDepth){
|
|
|
|
|
|
|
+ //if(tile.depth < /* this.options. */maxDepth){
|
|
|
for (const childHeader of children) {
|
|
for (const childHeader of children) {
|
|
|
const childTile = new TileHeader(this, childHeader, tile);
|
|
const childTile = new TileHeader(this, childHeader, tile);
|
|
|
tile.children.push(childTile);
|
|
tile.children.push(childTile);
|
|
|
childTile.depth = tile.depth + 1;
|
|
childTile.depth = tile.depth + 1;
|
|
|
stack.push(childTile);
|
|
stack.push(childTile);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ //}
|
|
|
window.maxTileDepth = Math.max(window.maxTileDepth||0, tile.depth)
|
|
window.maxTileDepth = Math.max(window.maxTileDepth||0, tile.depth)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -17647,7 +17647,7 @@ class Loader3DTiles {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (tileContent) {
|
|
if (tileContent) {
|
|
|
- tileContent.visible = false;
|
|
|
|
|
|
|
+ Potree.Utils.updateVisible(tileContent,'self',false)
|
|
|
renderMap[tile.id] = tileContent;
|
|
renderMap[tile.id] = tileContent;
|
|
|
tileContent.name = tile.id //add
|
|
tileContent.name = tile.id //add
|
|
|
tileContent.tile = tile //add
|
|
tileContent.tile = tile //add
|
|
@@ -17833,7 +17833,7 @@ class Loader3DTiles {
|
|
|
// Make sure it's visible
|
|
// Make sure it's visible
|
|
|
if(!renderMap[tile.id].visible){
|
|
if(!renderMap[tile.id].visible){
|
|
|
if(viewer.visiVertexCount<maxVertexVisi){
|
|
if(viewer.visiVertexCount<maxVertexVisi){
|
|
|
- renderMap[tile.id].visible = true;
|
|
|
|
|
|
|
+ Potree.Utils.updateVisible(renderMap[tile.id],'self',true)
|
|
|
viewer.visiVertexCount += tile.posCount //renderMap[tile.id].vertexCount //xzw add
|
|
viewer.visiVertexCount += tile.posCount //renderMap[tile.id].vertexCount //xzw add
|
|
|
options.debug && (boxMap[tile.id].material.opacity = 1 , boxMap[tile.id].children[0].sprite.material.opacity = 1 )
|
|
options.debug && (boxMap[tile.id].material.opacity = 1 , boxMap[tile.id].children[0].sprite.material.opacity = 1 )
|
|
|
}else{
|
|
}else{
|
|
@@ -17849,7 +17849,7 @@ class Loader3DTiles {
|
|
|
else {
|
|
else {
|
|
|
if (renderMap[tile.id]) {
|
|
if (renderMap[tile.id]) {
|
|
|
if(renderMap[tile.id].visible){
|
|
if(renderMap[tile.id].visible){
|
|
|
- renderMap[tile.id].visible = false;
|
|
|
|
|
|
|
+ Potree.Utils.updateVisible(renderMap[tile.id],'self',false)
|
|
|
options.debug && (boxMap[tile.id].material.opacity = 0.1, boxMap[tile.id].children[0].sprite.material.opacity = 0.1)
|
|
options.debug && (boxMap[tile.id].material.opacity = 0.1, boxMap[tile.id].children[0].sprite.material.opacity = 0.1)
|
|
|
|
|
|
|
|
viewer.visiVertexCount -= tile.posCount //renderMap[tile.id].vertexCount //xzw add
|
|
viewer.visiVertexCount -= tile.posCount //renderMap[tile.id].vertexCount //xzw add
|