|
|
@@ -9298,6 +9298,8 @@ class TileHeader {
|
|
|
|
|
|
_defineProperty(this, "posCount", 0);//add
|
|
|
_defineProperty(this, "texArea", 0);//add
|
|
|
+ _defineProperty(this, "floorIndex", null);//add
|
|
|
+
|
|
|
|
|
|
this.header = header;
|
|
|
this.tileset = tileset;
|
|
|
@@ -9307,6 +9309,10 @@ class TileHeader {
|
|
|
this.refine = this._getRefine(header.refine);
|
|
|
this.type = header.type;
|
|
|
this.contentUrl = header.contentUrl;
|
|
|
+ //add:-----
|
|
|
+ let floorMatch = header.contentUrl?.match(/floor_([0-9]+)./)
|
|
|
+ this.floorIndex = floorMatch ? parseInt(floorMatch[1]) : null
|
|
|
+ //---------
|
|
|
this.lodMetricType = 'geometricError';
|
|
|
this.lodMetricValue = 0;
|
|
|
this.boundingVolume = null;
|
|
|
@@ -9374,7 +9380,10 @@ class TileHeader {
|
|
|
}
|
|
|
|
|
|
get isVisibleAndInRequestVolume() {
|
|
|
- let v = /* this._visible && */this.tileset.visible && this._inRequestVolume; //用_updateBoundingVolume这个算的在相机靠近时不准确,容易缺块
|
|
|
+
|
|
|
+ let v = /* this._visible && */this.tileset.visible && this._inRequestVolume //用_updateBoundingVolume这个算的在相机靠近时不准确,容易缺块
|
|
|
+ && (this.tileset.options.is4dkkModel ? (this.tileset.currentFloor == 'all' || this.floorIndex == this.tileset.currentFloor || this.floorIndex == void 0 ) : true)
|
|
|
+
|
|
|
if(window.tileVisi2)v = this._visible && v
|
|
|
return v
|
|
|
}
|
|
|
@@ -17654,6 +17663,10 @@ class Loader3DTiles {
|
|
|
const unloadQueue = [];
|
|
|
const root = new Group();
|
|
|
const tileBoxes = new Group();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
tileBoxes.matrixAutoUpdate = false//add
|
|
|
if (!options.debug) {
|
|
|
tileBoxes.visible = false;
|
|
|
@@ -17700,6 +17713,7 @@ class Loader3DTiles {
|
|
|
}
|
|
|
const unlitMaterial = new MeshBasicMaterial({ transparent: options.transparent });
|
|
|
const tileOptions = {
|
|
|
+ is4dkkModel: options.is4dkkModel,//add
|
|
|
maximumMemoryUsage: options.maximumMemoryUsage,
|
|
|
maximumScreenSpaceError: options.maximumScreenSpaceError,
|
|
|
initialMaxSSE: options.maximumScreenSpaceError,
|
|
|
@@ -17731,8 +17745,13 @@ class Loader3DTiles {
|
|
|
|
|
|
changeModelPointCount(tile, 'add')
|
|
|
|
|
|
+ if (options.is4dkkModel) { // !zeg改 addTile
|
|
|
+ //root.addTile(tile.floorIndex, tileContent)//this.floors.getOrMakeFloor(floorIndex).addTile(tileContent)
|
|
|
+ getOrMakeFloor(tile.floorIndex).add(tileContent)
|
|
|
+ } else {
|
|
|
+ root.add(tileContent)
|
|
|
+ }
|
|
|
|
|
|
- root.add(renderMap[tile.id]);
|
|
|
if (options.debug) {
|
|
|
const box = loadersBoundingBoxToMesh(tile);
|
|
|
tileBoxes.add(box);
|
|
|
@@ -17765,6 +17784,32 @@ class Loader3DTiles {
|
|
|
}, '3d-tiles': {
|
|
|
loadGLTF: false
|
|
|
} }) }));
|
|
|
+
|
|
|
+
|
|
|
+ const getOrMakeFloor = function(floorIndex){//xzw add
|
|
|
+ if(!root.floors) root.floors = {}
|
|
|
+
|
|
|
+ var floor = root.floors[floorIndex]
|
|
|
+ if (!floor) {
|
|
|
+ floor = new Group();//new Floor(this.model, floorIndex)
|
|
|
+ floor.name = 'floor_'+floorIndex
|
|
|
+ floor.floorIndex = floorIndex
|
|
|
+ root.add(floor)
|
|
|
+ root.floors[floorIndex] = floor
|
|
|
+ }
|
|
|
+ return floor
|
|
|
+ }
|
|
|
+ if (options.is4dkkModel) {
|
|
|
+ tileset.currentFloor = 'all'
|
|
|
+ root.goFloor = function(floorIndex){
|
|
|
+ tileset.currentFloor = floorIndex
|
|
|
+ root.children.forEach(e=>Potree.Utils.updateVisible(e,'goFloor', floorIndex == 'all' || e.floorIndex == floorIndex))
|
|
|
+ tileset.nextForceUpdate = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
tileset.boxMap = boxMap //add
|
|
|
// transformations
|
|
|
const threeMat = new Matrix4$1();
|