Преглед изворни кода

Add 'stopAtEmptyTiles' parameter to main example

Stelios Vitalis пре 4 година
родитељ
комит
146c7f1e22

+ 6 - 2
example/bundle/b3dmExample.d88db709.js

@@ -36413,6 +36413,7 @@ function determineFrustumSet(tile, renderer) {
   var maxDepth = renderer.maxDepth;
   var loadSiblings = renderer.loadSiblings;
   var lruCache = renderer.lruCache;
+  var stopAtEmptyTiles = renderer.stopAtEmptyTiles;
   resetFrameState(tile, frameCount); // Early out if this tile is not within view.
 
   var inFrustum = renderer.tileInView(tile);
@@ -36426,7 +36427,7 @@ function determineFrustumSet(tile, renderer) {
   tile.__inFrustum = true;
   stats.inFrustum++; // Early out if this tile has less error than we're targeting.
 
-  if (!tile.__contentEmpty) {
+  if (stopAtEmptyTiles || !tile.__contentEmpty) {
     var error = renderer.calculateError(tile);
     tile.__error = error;
 
@@ -36729,6 +36730,7 @@ function () {
     this.loadSiblings = true;
     this.displayActiveTiles = false;
     this.maxDepth = Infinity;
+    this.stopAtEmptyTiles = true;
   }
 
   _createClass(TilesRendererBase, [{
@@ -39737,6 +39739,8 @@ function (_B3DMLoaderBase) {
         loader.parse(gltfBuffer, null, function (model) {
           model.batchTable = b3dm.batchTable;
           model.featureTable = b3dm.featureTable;
+          model.scene.batchTable = b3dm.batchTable;
+          model.scene.featureTable = b3dm.featureTable;
           resolve(model);
         }, reject);
       });
@@ -43007,7 +43011,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
example/bundle/b3dmExample.d88db709.js.map


+ 1 - 1
example/bundle/b3dmExample.js

@@ -212,7 +212,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

+ 6 - 2
example/bundle/cmptExample.4b2a3f0d.js

@@ -36413,6 +36413,7 @@ function determineFrustumSet(tile, renderer) {
   var maxDepth = renderer.maxDepth;
   var loadSiblings = renderer.loadSiblings;
   var lruCache = renderer.lruCache;
+  var stopAtEmptyTiles = renderer.stopAtEmptyTiles;
   resetFrameState(tile, frameCount); // Early out if this tile is not within view.
 
   var inFrustum = renderer.tileInView(tile);
@@ -36426,7 +36427,7 @@ function determineFrustumSet(tile, renderer) {
   tile.__inFrustum = true;
   stats.inFrustum++; // Early out if this tile has less error than we're targeting.
 
-  if (!tile.__contentEmpty) {
+  if (stopAtEmptyTiles || !tile.__contentEmpty) {
     var error = renderer.calculateError(tile);
     tile.__error = error;
 
@@ -36729,6 +36730,7 @@ function () {
     this.loadSiblings = true;
     this.displayActiveTiles = false;
     this.maxDepth = Infinity;
+    this.stopAtEmptyTiles = true;
   }
 
   _createClass(TilesRendererBase, [{
@@ -39737,6 +39739,8 @@ function (_B3DMLoaderBase) {
         loader.parse(gltfBuffer, null, function (model) {
           model.batchTable = b3dm.batchTable;
           model.featureTable = b3dm.featureTable;
+          model.scene.batchTable = b3dm.batchTable;
+          model.scene.featureTable = b3dm.featureTable;
           resolve(model);
         }, reject);
       });
@@ -42936,7 +42940,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
example/bundle/cmptExample.4b2a3f0d.js.map


+ 1 - 1
example/bundle/cmptExample.js

@@ -212,7 +212,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

+ 6 - 2
example/bundle/customMaterial.dd39ecee.js

@@ -36413,6 +36413,7 @@ function determineFrustumSet(tile, renderer) {
   var maxDepth = renderer.maxDepth;
   var loadSiblings = renderer.loadSiblings;
   var lruCache = renderer.lruCache;
+  var stopAtEmptyTiles = renderer.stopAtEmptyTiles;
   resetFrameState(tile, frameCount); // Early out if this tile is not within view.
 
   var inFrustum = renderer.tileInView(tile);
@@ -36426,7 +36427,7 @@ function determineFrustumSet(tile, renderer) {
   tile.__inFrustum = true;
   stats.inFrustum++; // Early out if this tile has less error than we're targeting.
 
-  if (!tile.__contentEmpty) {
+  if (stopAtEmptyTiles || !tile.__contentEmpty) {
     var error = renderer.calculateError(tile);
     tile.__error = error;
 
@@ -36729,6 +36730,7 @@ function () {
     this.loadSiblings = true;
     this.displayActiveTiles = false;
     this.maxDepth = Infinity;
+    this.stopAtEmptyTiles = true;
   }
 
   _createClass(TilesRendererBase, [{
@@ -39737,6 +39739,8 @@ function (_B3DMLoaderBase) {
         loader.parse(gltfBuffer, null, function (model) {
           model.batchTable = b3dm.batchTable;
           model.featureTable = b3dm.featureTable;
+          model.scene.batchTable = b3dm.batchTable;
+          model.scene.featureTable = b3dm.featureTable;
           resolve(model);
         }, reject);
       });
@@ -46157,7 +46161,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
example/bundle/customMaterial.dd39ecee.js.map


+ 1 - 1
example/bundle/customMaterial.js

@@ -212,7 +212,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

+ 9 - 2
example/bundle/example.e31bb0bc.js

@@ -36413,6 +36413,7 @@ function determineFrustumSet(tile, renderer) {
   var maxDepth = renderer.maxDepth;
   var loadSiblings = renderer.loadSiblings;
   var lruCache = renderer.lruCache;
+  var stopAtEmptyTiles = renderer.stopAtEmptyTiles;
   resetFrameState(tile, frameCount); // Early out if this tile is not within view.
 
   var inFrustum = renderer.tileInView(tile);
@@ -36426,7 +36427,7 @@ function determineFrustumSet(tile, renderer) {
   tile.__inFrustum = true;
   stats.inFrustum++; // Early out if this tile has less error than we're targeting.
 
-  if (!tile.__contentEmpty) {
+  if (stopAtEmptyTiles || !tile.__contentEmpty) {
     var error = renderer.calculateError(tile);
     tile.__error = error;
 
@@ -36729,6 +36730,7 @@ function () {
     this.loadSiblings = true;
     this.displayActiveTiles = false;
     this.maxDepth = Infinity;
+    this.stopAtEmptyTiles = true;
   }
 
   _createClass(TilesRendererBase, [{
@@ -39737,6 +39739,8 @@ function (_B3DMLoaderBase) {
         loader.parse(gltfBuffer, null, function (model) {
           model.batchTable = b3dm.batchTable;
           model.featureTable = b3dm.featureTable;
+          model.scene.batchTable = b3dm.batchTable;
+          model.scene.featureTable = b3dm.featureTable;
           resolve(model);
         }, reject);
       });
@@ -46940,6 +46944,7 @@ var params = {
   'errorThreshold': 60,
   'maxDepth': 15,
   'loadSiblings': true,
+  'stopAtEmptyTiles': true,
   'displayActiveTiles': false,
   'resolutionScale': 1.0,
   'up': '+Y',
@@ -47080,6 +47085,7 @@ function init() {
   gui.width = 300;
   var tileOptions = gui.addFolder('Tiles Options');
   tileOptions.add(params, 'loadSiblings');
+  tileOptions.add(params, 'stopAtEmptyTiles');
   tileOptions.add(params, 'displayActiveTiles');
   tileOptions.add(params, 'errorTarget').min(0).max(50);
   tileOptions.add(params, 'errorThreshold').min(0).max(1000);
@@ -47252,6 +47258,7 @@ function animate() {
   tiles.errorTarget = params.errorTarget;
   tiles.errorThreshold = params.errorThreshold;
   tiles.loadSiblings = params.loadSiblings;
+  tiles.stopAtEmptyTiles = params.stopAtEmptyTiles;
   tiles.displayActiveTiles = params.displayActiveTiles;
   tiles.maxDepth = params.maxDepth;
   tiles.displayBoxBounds = params.displayBoxBounds;
@@ -47435,7 +47442,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
example/bundle/example.e31bb0bc.js.map


+ 6 - 2
example/bundle/i3dmExample.c6cc930a.js

@@ -36413,6 +36413,7 @@ function determineFrustumSet(tile, renderer) {
   var maxDepth = renderer.maxDepth;
   var loadSiblings = renderer.loadSiblings;
   var lruCache = renderer.lruCache;
+  var stopAtEmptyTiles = renderer.stopAtEmptyTiles;
   resetFrameState(tile, frameCount); // Early out if this tile is not within view.
 
   var inFrustum = renderer.tileInView(tile);
@@ -36426,7 +36427,7 @@ function determineFrustumSet(tile, renderer) {
   tile.__inFrustum = true;
   stats.inFrustum++; // Early out if this tile has less error than we're targeting.
 
-  if (!tile.__contentEmpty) {
+  if (stopAtEmptyTiles || !tile.__contentEmpty) {
     var error = renderer.calculateError(tile);
     tile.__error = error;
 
@@ -36729,6 +36730,7 @@ function () {
     this.loadSiblings = true;
     this.displayActiveTiles = false;
     this.maxDepth = Infinity;
+    this.stopAtEmptyTiles = true;
   }
 
   _createClass(TilesRendererBase, [{
@@ -39737,6 +39739,8 @@ function (_B3DMLoaderBase) {
         loader.parse(gltfBuffer, null, function (model) {
           model.batchTable = b3dm.batchTable;
           model.featureTable = b3dm.featureTable;
+          model.scene.batchTable = b3dm.batchTable;
+          model.scene.featureTable = b3dm.featureTable;
           resolve(model);
         }, reject);
       });
@@ -42964,7 +42968,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
example/bundle/i3dmExample.c6cc930a.js.map


+ 1 - 1
example/bundle/i3dmExample.js

@@ -212,7 +212,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

+ 1 - 1
example/bundle/index.js

@@ -212,7 +212,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

+ 6 - 2
example/bundle/offscreenShadows.ce0529e7.js

@@ -36413,6 +36413,7 @@ function determineFrustumSet(tile, renderer) {
   var maxDepth = renderer.maxDepth;
   var loadSiblings = renderer.loadSiblings;
   var lruCache = renderer.lruCache;
+  var stopAtEmptyTiles = renderer.stopAtEmptyTiles;
   resetFrameState(tile, frameCount); // Early out if this tile is not within view.
 
   var inFrustum = renderer.tileInView(tile);
@@ -36426,7 +36427,7 @@ function determineFrustumSet(tile, renderer) {
   tile.__inFrustum = true;
   stats.inFrustum++; // Early out if this tile has less error than we're targeting.
 
-  if (!tile.__contentEmpty) {
+  if (stopAtEmptyTiles || !tile.__contentEmpty) {
     var error = renderer.calculateError(tile);
     tile.__error = error;
 
@@ -36729,6 +36730,7 @@ function () {
     this.loadSiblings = true;
     this.displayActiveTiles = false;
     this.maxDepth = Infinity;
+    this.stopAtEmptyTiles = true;
   }
 
   _createClass(TilesRendererBase, [{
@@ -39737,6 +39739,8 @@ function (_B3DMLoaderBase) {
         loader.parse(gltfBuffer, null, function (model) {
           model.batchTable = b3dm.batchTable;
           model.featureTable = b3dm.featureTable;
+          model.scene.batchTable = b3dm.batchTable;
+          model.scene.featureTable = b3dm.featureTable;
           resolve(model);
         }, reject);
       });
@@ -46097,7 +46101,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
example/bundle/offscreenShadows.ce0529e7.js.map


+ 1 - 1
example/bundle/offscreenShadows.js

@@ -212,7 +212,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

+ 6 - 2
example/bundle/pntsExample.1cabf3ff.js

@@ -36413,6 +36413,7 @@ function determineFrustumSet(tile, renderer) {
   var maxDepth = renderer.maxDepth;
   var loadSiblings = renderer.loadSiblings;
   var lruCache = renderer.lruCache;
+  var stopAtEmptyTiles = renderer.stopAtEmptyTiles;
   resetFrameState(tile, frameCount); // Early out if this tile is not within view.
 
   var inFrustum = renderer.tileInView(tile);
@@ -36426,7 +36427,7 @@ function determineFrustumSet(tile, renderer) {
   tile.__inFrustum = true;
   stats.inFrustum++; // Early out if this tile has less error than we're targeting.
 
-  if (!tile.__contentEmpty) {
+  if (stopAtEmptyTiles || !tile.__contentEmpty) {
     var error = renderer.calculateError(tile);
     tile.__error = error;
 
@@ -36729,6 +36730,7 @@ function () {
     this.loadSiblings = true;
     this.displayActiveTiles = false;
     this.maxDepth = Infinity;
+    this.stopAtEmptyTiles = true;
   }
 
   _createClass(TilesRendererBase, [{
@@ -39737,6 +39739,8 @@ function (_B3DMLoaderBase) {
         loader.parse(gltfBuffer, null, function (model) {
           model.batchTable = b3dm.batchTable;
           model.featureTable = b3dm.featureTable;
+          model.scene.batchTable = b3dm.batchTable;
+          model.scene.featureTable = b3dm.featureTable;
           resolve(model);
         }, reject);
       });
@@ -42936,7 +42940,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
example/bundle/pntsExample.1cabf3ff.js.map


+ 1 - 1
example/bundle/pntsExample.js

@@ -212,7 +212,7 @@ var parent = module.bundle.parent;
 if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
   var hostname = "" || location.hostname;
   var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
-  var ws = new WebSocket(protocol + '://' + hostname + ':' + "54369" + '/');
+  var ws = new WebSocket(protocol + '://' + hostname + ':' + "59294" + '/');
 
   ws.onmessage = function (event) {
     checkedAssets = {};

+ 3 - 0
example/index.js

@@ -58,6 +58,7 @@ let params = {
 	'errorThreshold': 60,
 	'maxDepth': 15,
 	'loadSiblings': true,
+	'stopAtEmptyTiles': true,
 	'displayActiveTiles': false,
 	'resolutionScale': 1.0,
 
@@ -231,6 +232,7 @@ function init() {
 
 	const tileOptions = gui.addFolder( 'Tiles Options' );
 	tileOptions.add( params, 'loadSiblings' );
+	tileOptions.add( params, 'stopAtEmptyTiles' );
 	tileOptions.add( params, 'displayActiveTiles' );
 	tileOptions.add( params, 'errorTarget' ).min( 0 ).max( 50 );
 	tileOptions.add( params, 'errorThreshold' ).min( 0 ).max( 1000 );
@@ -442,6 +444,7 @@ function animate() {
 	tiles.errorTarget = params.errorTarget;
 	tiles.errorThreshold = params.errorThreshold;
 	tiles.loadSiblings = params.loadSiblings;
+	tiles.stopAtEmptyTiles = params.stopAtEmptyTiles;
 	tiles.displayActiveTiles = params.displayActiveTiles;
 	tiles.maxDepth = params.maxDepth;
 	tiles.displayBoxBounds = params.displayBoxBounds;