|
@@ -39707,10 +39707,10 @@ class TilesRenderer extends _TilesRendererBase.TilesRendererBase {
|
|
|
this.group = new _TilesGroup.TilesGroup(this);
|
|
|
this.cameras = [];
|
|
|
this.cameraMap = new Map();
|
|
|
- this.resolution = new _three.Vector2();
|
|
|
this.cameraInfo = [];
|
|
|
this.activeTiles = new Set();
|
|
|
this.visibleTiles = new Set();
|
|
|
+ this.onLoadModel = null;
|
|
|
}
|
|
|
/* Public API */
|
|
|
|
|
@@ -39733,6 +39733,16 @@ class TilesRenderer extends _TilesRendererBase.TilesRendererBase {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ forEachLoadedModel(callback) {
|
|
|
+ this.traverse(tile => {
|
|
|
+ const scene = tile.cached.scene;
|
|
|
+
|
|
|
+ if (scene) {
|
|
|
+ callback(scene, tile);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
raycast(raycaster, intersects) {
|
|
|
if (!this.root) {
|
|
|
return;
|
|
@@ -40061,6 +40071,10 @@ class TilesRenderer extends _TilesRendererBase.TilesRendererBase {
|
|
|
cached.materials = materials;
|
|
|
cached.geometry = geometry;
|
|
|
cached.textures = textures;
|
|
|
+
|
|
|
+ if (this.onLoadModel) {
|
|
|
+ this.onLoadModel(scene, tile);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -40281,7 +40295,7 @@ exports.SphereHelper = SphereHelper;
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
value: true
|
|
|
});
|
|
|
-exports.DebugTilesRenderer = void 0;
|
|
|
+exports.DebugTilesRenderer = exports.RANDOM_COLOR = exports.IS_LEAF = exports.RELATIVE_DEPTH = exports.DEPTH = exports.DISTANCE = exports.GEOMETRIC_ERROR = exports.SCREEN_ERROR = exports.NONE = void 0;
|
|
|
|
|
|
var _three = require("three");
|
|
|
|
|
@@ -40290,16 +40304,25 @@ var _TilesRenderer = require("./TilesRenderer.js");
|
|
|
var _SphereHelper = require("./SphereHelper.js");
|
|
|
|
|
|
const ORIGINAL_MATERIAL = Symbol('ORIGINAL_MATERIAL');
|
|
|
+
|
|
|
+function emptyRaycast() {}
|
|
|
+
|
|
|
const NONE = 0;
|
|
|
+exports.NONE = NONE;
|
|
|
const SCREEN_ERROR = 1;
|
|
|
+exports.SCREEN_ERROR = SCREEN_ERROR;
|
|
|
const GEOMETRIC_ERROR = 2;
|
|
|
+exports.GEOMETRIC_ERROR = GEOMETRIC_ERROR;
|
|
|
const DISTANCE = 3;
|
|
|
+exports.DISTANCE = DISTANCE;
|
|
|
const DEPTH = 4;
|
|
|
+exports.DEPTH = DEPTH;
|
|
|
const RELATIVE_DEPTH = 5;
|
|
|
+exports.RELATIVE_DEPTH = RELATIVE_DEPTH;
|
|
|
const IS_LEAF = 6;
|
|
|
+exports.IS_LEAF = IS_LEAF;
|
|
|
const RANDOM_COLOR = 7;
|
|
|
-
|
|
|
-function emptyRaycast() {}
|
|
|
+exports.RANDOM_COLOR = RANDOM_COLOR;
|
|
|
|
|
|
class DebugTilesRenderer extends _TilesRenderer.TilesRenderer {
|
|
|
constructor(...args) {
|
|
@@ -40314,11 +40337,11 @@ class DebugTilesRenderer extends _TilesRenderer.TilesRenderer {
|
|
|
this.colorMode = NONE;
|
|
|
this.boxGroup = boxGroup;
|
|
|
this.sphereGroup = sphereGroup;
|
|
|
- this.maxDepth = -1;
|
|
|
- this.maxDistance = -1;
|
|
|
- this.maxError = -1;
|
|
|
- this.extremeDepth = -1;
|
|
|
- this.extremeError = -1;
|
|
|
+ this.maxDebugDepth = -1;
|
|
|
+ this.maxDebugDistance = -1;
|
|
|
+ this.maxDebugError = -1;
|
|
|
+ this.extremeDebugDepth = -1;
|
|
|
+ this.extremeDebugError = -1;
|
|
|
}
|
|
|
|
|
|
initExtremes() {
|
|
@@ -40330,8 +40353,8 @@ class DebugTilesRenderer extends _TilesRenderer.TilesRenderer {
|
|
|
this.traverse(tile => {
|
|
|
maxError = Math.max(maxError, tile.geometricError);
|
|
|
});
|
|
|
- this.extremeDepth = maxDepth;
|
|
|
- this.extremeError = maxError;
|
|
|
+ this.extremeDebugDepth = maxDepth;
|
|
|
+ this.extremeDebugError = maxError;
|
|
|
}
|
|
|
|
|
|
loadTileSet(...args) {
|
|
@@ -40383,26 +40406,26 @@ class DebugTilesRenderer extends _TilesRenderer.TilesRenderer {
|
|
|
this.sphereGroup.visible = this.displaySphereBounds;
|
|
|
let maxDepth = -1;
|
|
|
|
|
|
- if (this.maxDepth === -1) {
|
|
|
- maxDepth = this.extremeDepth;
|
|
|
+ if (this.maxDebugDepth === -1) {
|
|
|
+ maxDepth = this.extremeDebugDepth;
|
|
|
} else {
|
|
|
- maxDepth = this.maxDepth;
|
|
|
+ maxDepth = this.maxDebugDepth;
|
|
|
}
|
|
|
|
|
|
let maxError = -1;
|
|
|
|
|
|
- if (this.maxError === -1) {
|
|
|
- maxError = this.extremeError;
|
|
|
+ if (this.maxDebugError === -1) {
|
|
|
+ maxError = this.extremeDebugError;
|
|
|
} else {
|
|
|
- maxError = this.maxError;
|
|
|
+ maxError = this.maxDebugError;
|
|
|
}
|
|
|
|
|
|
let maxDistance = -1;
|
|
|
|
|
|
- if (this.maxDistance === -1) {
|
|
|
+ if (this.maxDebugDistance === -1) {
|
|
|
maxDistance = this.root.cached.sphere.radius;
|
|
|
} else {
|
|
|
- maxDistance = this.maxDistance;
|
|
|
+ maxDistance = this.maxDebugDistance;
|
|
|
} // TODO: Support i3dm, pnts, cmpt here
|
|
|
|
|
|
|
|
@@ -40589,6 +40612,54 @@ Object.defineProperty(exports, "DebugTilesRenderer", {
|
|
|
return _DebugTilesRenderer.DebugTilesRenderer;
|
|
|
}
|
|
|
});
|
|
|
+Object.defineProperty(exports, "NONE", {
|
|
|
+ enumerable: true,
|
|
|
+ get: function () {
|
|
|
+ return _DebugTilesRenderer.NONE;
|
|
|
+ }
|
|
|
+});
|
|
|
+Object.defineProperty(exports, "SCREEN_ERROR", {
|
|
|
+ enumerable: true,
|
|
|
+ get: function () {
|
|
|
+ return _DebugTilesRenderer.SCREEN_ERROR;
|
|
|
+ }
|
|
|
+});
|
|
|
+Object.defineProperty(exports, "GEOMETRIC_ERROR", {
|
|
|
+ enumerable: true,
|
|
|
+ get: function () {
|
|
|
+ return _DebugTilesRenderer.GEOMETRIC_ERROR;
|
|
|
+ }
|
|
|
+});
|
|
|
+Object.defineProperty(exports, "DISTANCE", {
|
|
|
+ enumerable: true,
|
|
|
+ get: function () {
|
|
|
+ return _DebugTilesRenderer.DISTANCE;
|
|
|
+ }
|
|
|
+});
|
|
|
+Object.defineProperty(exports, "DEPTH", {
|
|
|
+ enumerable: true,
|
|
|
+ get: function () {
|
|
|
+ return _DebugTilesRenderer.DEPTH;
|
|
|
+ }
|
|
|
+});
|
|
|
+Object.defineProperty(exports, "RELATIVE_DEPTH", {
|
|
|
+ enumerable: true,
|
|
|
+ get: function () {
|
|
|
+ return _DebugTilesRenderer.RELATIVE_DEPTH;
|
|
|
+ }
|
|
|
+});
|
|
|
+Object.defineProperty(exports, "IS_LEAF", {
|
|
|
+ enumerable: true,
|
|
|
+ get: function () {
|
|
|
+ return _DebugTilesRenderer.IS_LEAF;
|
|
|
+ }
|
|
|
+});
|
|
|
+Object.defineProperty(exports, "RANDOM_COLOR", {
|
|
|
+ enumerable: true,
|
|
|
+ get: function () {
|
|
|
+ return _DebugTilesRenderer.RANDOM_COLOR;
|
|
|
+ }
|
|
|
+});
|
|
|
Object.defineProperty(exports, "TilesRenderer", {
|
|
|
enumerable: true,
|
|
|
get: function () {
|
|
@@ -45114,10 +45185,10 @@ function init() {
|
|
|
controls.minDistance = 1;
|
|
|
controls.maxDistance = 2000; // lights
|
|
|
|
|
|
- var dirLight = new _three.DirectionalLight(0xffffff);
|
|
|
+ const dirLight = new _three.DirectionalLight(0xffffff);
|
|
|
dirLight.position.set(1, 2, 3);
|
|
|
scene.add(dirLight);
|
|
|
- var ambLight = new _three.AmbientLight(0xffffff, 0.2);
|
|
|
+ const ambLight = new _three.AmbientLight(0xffffff, 0.2);
|
|
|
scene.add(ambLight);
|
|
|
box = new _three.Box3();
|
|
|
offsetParent = new _three.Group();
|
|
@@ -45162,14 +45233,14 @@ function init() {
|
|
|
const debug = gui.addFolder('Debug Options');
|
|
|
debug.add(params, 'displayBoxBounds');
|
|
|
debug.add(params, 'colorMode', {
|
|
|
- DEFAULT: 0,
|
|
|
- SCREEN_ERROR: 1,
|
|
|
- GEOMETRIC_ERROR: 2,
|
|
|
- DISTANCE: 3,
|
|
|
- DEPTH: 4,
|
|
|
- RELATIVE_DEPTH: 5,
|
|
|
- IS_LEAF: 6,
|
|
|
- RANDOM_COLOR: 7
|
|
|
+ NONE: _index.NONE,
|
|
|
+ SCREEN_ERROR: _index.SCREEN_ERROR,
|
|
|
+ GEOMETRIC_ERROR: _index.GEOMETRIC_ERROR,
|
|
|
+ DISTANCE: _index.DISTANCE,
|
|
|
+ DEPTH: _index.DEPTH,
|
|
|
+ RELATIVE_DEPTH: _index.RELATIVE_DEPTH,
|
|
|
+ IS_LEAF: _index.IS_LEAF,
|
|
|
+ RANDOM_COLOR: _index.RANDOM_COLOR
|
|
|
});
|
|
|
debug.open();
|
|
|
const exampleOptions = gui.addFolder('Example Options');
|
|
@@ -45494,7 +45565,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 + ':' + "55296" + '/');
|
|
|
+ var ws = new WebSocket(protocol + '://' + hostname + ':' + "65167" + '/');
|
|
|
|
|
|
ws.onmessage = function (event) {
|
|
|
checkedAssets = {};
|