@loaders.gl/tiles 3.4.0-alpha.2 → 3.4.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.min.js +340 -307
- package/dist/es5/constants.js +0 -2
- package/dist/es5/constants.js.map +1 -1
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/tileset/format-3d-tiles/tileset-3d-traverser.js +0 -2
- package/dist/es5/tileset/format-3d-tiles/tileset-3d-traverser.js.map +1 -1
- package/dist/es5/tileset/format-i3s/i3s-pending-tiles-register.js +3 -8
- package/dist/es5/tileset/format-i3s/i3s-pending-tiles-register.js.map +1 -1
- package/dist/es5/tileset/format-i3s/i3s-tile-manager.js +4 -14
- package/dist/es5/tileset/format-i3s/i3s-tile-manager.js.map +1 -1
- package/dist/es5/tileset/format-i3s/i3s-tileset-traverser.js +19 -25
- package/dist/es5/tileset/format-i3s/i3s-tileset-traverser.js.map +1 -1
- package/dist/es5/tileset/helpers/3d-tiles-options.js.map +1 -1
- package/dist/es5/tileset/helpers/bounding-volume.js +87 -6
- package/dist/es5/tileset/helpers/bounding-volume.js.map +1 -1
- package/dist/es5/tileset/helpers/frame-state.js +4 -14
- package/dist/es5/tileset/helpers/frame-state.js.map +1 -1
- package/dist/es5/tileset/helpers/i3s-lod.js +0 -5
- package/dist/es5/tileset/helpers/i3s-lod.js.map +1 -1
- package/dist/es5/tileset/helpers/tiles-3d-lod.js +0 -7
- package/dist/es5/tileset/helpers/tiles-3d-lod.js.map +1 -1
- package/dist/es5/tileset/helpers/transform-utils.js +0 -7
- package/dist/es5/tileset/helpers/transform-utils.js.map +1 -1
- package/dist/es5/tileset/helpers/zoom.js +0 -4
- package/dist/es5/tileset/helpers/zoom.js.map +1 -1
- package/dist/es5/tileset/tile-3d.js +98 -166
- package/dist/es5/tileset/tile-3d.js.map +1 -1
- package/dist/es5/tileset/tileset-3d.js +86 -142
- package/dist/es5/tileset/tileset-3d.js.map +1 -1
- package/dist/es5/tileset/tileset-cache.js +0 -3
- package/dist/es5/tileset/tileset-cache.js.map +1 -1
- package/dist/es5/tileset/tileset-traverser.js +12 -51
- package/dist/es5/tileset/tileset-traverser.js.map +1 -1
- package/dist/es5/utils/doubly-linked-list-node.js.map +1 -1
- package/dist/es5/utils/doubly-linked-list.js +3 -11
- package/dist/es5/utils/doubly-linked-list.js.map +1 -1
- package/dist/es5/utils/managed-array.js +10 -30
- package/dist/es5/utils/managed-array.js.map +1 -1
- package/dist/esm/bundle.js +0 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/constants.js +0 -5
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tileset/format-3d-tiles/tileset-3d-traverser.js +0 -4
- package/dist/esm/tileset/format-3d-tiles/tileset-3d-traverser.js.map +1 -1
- package/dist/esm/tileset/format-i3s/i3s-pending-tiles-register.js +0 -2
- package/dist/esm/tileset/format-i3s/i3s-pending-tiles-register.js.map +1 -1
- package/dist/esm/tileset/format-i3s/i3s-tile-manager.js +0 -6
- package/dist/esm/tileset/format-i3s/i3s-tile-manager.js.map +1 -1
- package/dist/esm/tileset/format-i3s/i3s-tileset-traverser.js +0 -3
- package/dist/esm/tileset/format-i3s/i3s-tileset-traverser.js.map +1 -1
- package/dist/esm/tileset/helpers/3d-tiles-options.js.map +1 -1
- package/dist/esm/tileset/helpers/bounding-volume.js +81 -8
- package/dist/esm/tileset/helpers/bounding-volume.js.map +1 -1
- package/dist/esm/tileset/helpers/frame-state.js +3 -13
- package/dist/esm/tileset/helpers/frame-state.js.map +1 -1
- package/dist/esm/tileset/helpers/i3s-lod.js +0 -6
- package/dist/esm/tileset/helpers/i3s-lod.js.map +1 -1
- package/dist/esm/tileset/helpers/tiles-3d-lod.js +0 -8
- package/dist/esm/tileset/helpers/tiles-3d-lod.js.map +1 -1
- package/dist/esm/tileset/helpers/transform-utils.js +0 -8
- package/dist/esm/tileset/helpers/transform-utils.js.map +1 -1
- package/dist/esm/tileset/helpers/zoom.js +0 -5
- package/dist/esm/tileset/helpers/zoom.js.map +1 -1
- package/dist/esm/tileset/tile-3d.js +8 -52
- package/dist/esm/tileset/tile-3d.js.map +1 -1
- package/dist/esm/tileset/tileset-3d.js +0 -38
- package/dist/esm/tileset/tileset-3d.js.map +1 -1
- package/dist/esm/tileset/tileset-cache.js +0 -3
- package/dist/esm/tileset/tileset-cache.js.map +1 -1
- package/dist/esm/tileset/tileset-traverser.js +0 -27
- package/dist/esm/tileset/tileset-traverser.js.map +1 -1
- package/dist/esm/utils/doubly-linked-list-node.js +0 -1
- package/dist/esm/utils/doubly-linked-list-node.js.map +1 -1
- package/dist/esm/utils/doubly-linked-list.js +0 -7
- package/dist/esm/utils/doubly-linked-list.js.map +1 -1
- package/dist/esm/utils/managed-array.js +0 -12
- package/dist/esm/utils/managed-array.js.map +1 -1
- package/dist/tileset/helpers/bounding-volume.d.ts +10 -0
- package/dist/tileset/helpers/bounding-volume.d.ts.map +1 -1
- package/dist/tileset/helpers/bounding-volume.js +117 -1
- package/dist/tileset/tile-3d.d.ts +7 -0
- package/dist/tileset/tile-3d.d.ts.map +1 -1
- package/dist/tileset/tile-3d.js +10 -0
- package/package.json +4 -4
- package/src/tileset/helpers/bounding-volume.ts +136 -0
- package/src/tileset/tile-3d.ts +18 -1
|
@@ -25,9 +25,7 @@ var scratchVector = new _core.Vector3();
|
|
|
25
25
|
function defined(x) {
|
|
26
26
|
return x !== undefined && x !== null;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
28
|
var Tile3D = function () {
|
|
30
|
-
|
|
31
29
|
function Tile3D(tileset, header, parentHeader) {
|
|
32
30
|
var extendedId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
33
31
|
(0, _classCallCheck2.default)(this, Tile3D);
|
|
@@ -62,6 +60,7 @@ var Tile3D = function () {
|
|
|
62
60
|
(0, _defineProperty2.default)(this, "_expireDate", void 0);
|
|
63
61
|
(0, _defineProperty2.default)(this, "_expiredContent", void 0);
|
|
64
62
|
(0, _defineProperty2.default)(this, "_shouldRefine", void 0);
|
|
63
|
+
(0, _defineProperty2.default)(this, "_boundingBox", void 0);
|
|
65
64
|
(0, _defineProperty2.default)(this, "_distanceToCamera", void 0);
|
|
66
65
|
(0, _defineProperty2.default)(this, "_centerZDepth", void 0);
|
|
67
66
|
(0, _defineProperty2.default)(this, "_screenSpaceError", void 0);
|
|
@@ -79,34 +78,26 @@ var Tile3D = function () {
|
|
|
79
78
|
(0, _defineProperty2.default)(this, "_viewerRequestVolume", void 0);
|
|
80
79
|
(0, _defineProperty2.default)(this, "_initialTransform", void 0);
|
|
81
80
|
this.header = header;
|
|
82
|
-
|
|
83
81
|
this.tileset = tileset;
|
|
84
82
|
this.id = extendedId || header.id;
|
|
85
83
|
this.url = header.url;
|
|
86
|
-
|
|
87
84
|
this.parent = parentHeader;
|
|
88
85
|
this.refine = this._getRefine(header.refine);
|
|
89
86
|
this.type = header.type;
|
|
90
87
|
this.contentUrl = header.contentUrl;
|
|
91
|
-
|
|
92
88
|
this.lodMetricType = 'geometricError';
|
|
93
89
|
this.lodMetricValue = 0;
|
|
94
|
-
|
|
95
90
|
this.boundingVolume = null;
|
|
96
|
-
|
|
97
91
|
this.content = null;
|
|
98
92
|
this.contentState = _constants.TILE_CONTENT_STATE.UNLOADED;
|
|
99
93
|
this.gpuMemoryUsageInBytes = 0;
|
|
100
|
-
|
|
101
94
|
this.children = [];
|
|
102
95
|
this.hasEmptyContent = false;
|
|
103
96
|
this.hasTilesetContent = false;
|
|
104
97
|
this.depth = 0;
|
|
105
98
|
this.viewportIds = [];
|
|
106
|
-
|
|
107
99
|
this.userData = {};
|
|
108
100
|
this.extensions = null;
|
|
109
|
-
|
|
110
101
|
this._priority = 0;
|
|
111
102
|
this._touchedFrame = 0;
|
|
112
103
|
this._visitedFrame = 0;
|
|
@@ -131,9 +122,7 @@ var Tile3D = function () {
|
|
|
131
122
|
this._initializeBoundingVolumes(header);
|
|
132
123
|
this._initializeContent(header);
|
|
133
124
|
this._initializeRenderingState(header);
|
|
134
|
-
|
|
135
125
|
this._lodJudge = null;
|
|
136
|
-
|
|
137
126
|
this._expireDate = null;
|
|
138
127
|
this._expiredContent = null;
|
|
139
128
|
this.implicitTiling = null;
|
|
@@ -164,81 +153,67 @@ var Tile3D = function () {
|
|
|
164
153
|
get: function get() {
|
|
165
154
|
return this._visible && this._inRequestVolume;
|
|
166
155
|
}
|
|
167
|
-
|
|
168
156
|
}, {
|
|
169
157
|
key: "hasRenderContent",
|
|
170
|
-
get:
|
|
171
|
-
function get() {
|
|
158
|
+
get: function get() {
|
|
172
159
|
return !this.hasEmptyContent && !this.hasTilesetContent;
|
|
173
160
|
}
|
|
174
|
-
|
|
175
161
|
}, {
|
|
176
162
|
key: "hasChildren",
|
|
177
|
-
get:
|
|
178
|
-
function get() {
|
|
163
|
+
get: function get() {
|
|
179
164
|
return this.children.length > 0 || this.header.children && this.header.children.length > 0;
|
|
180
165
|
}
|
|
181
|
-
|
|
182
166
|
}, {
|
|
183
167
|
key: "contentReady",
|
|
184
|
-
get:
|
|
185
|
-
function get() {
|
|
168
|
+
get: function get() {
|
|
186
169
|
return this.contentState === _constants.TILE_CONTENT_STATE.READY || this.hasEmptyContent;
|
|
187
170
|
}
|
|
188
|
-
|
|
189
171
|
}, {
|
|
190
172
|
key: "contentAvailable",
|
|
191
|
-
get:
|
|
192
|
-
function get() {
|
|
173
|
+
get: function get() {
|
|
193
174
|
return Boolean(this.contentReady && this.hasRenderContent || this._expiredContent && !this.contentFailed);
|
|
194
175
|
}
|
|
195
|
-
|
|
196
176
|
}, {
|
|
197
177
|
key: "hasUnloadedContent",
|
|
198
|
-
get:
|
|
199
|
-
function get() {
|
|
178
|
+
get: function get() {
|
|
200
179
|
return this.hasRenderContent && this.contentUnloaded;
|
|
201
180
|
}
|
|
202
|
-
|
|
203
181
|
}, {
|
|
204
182
|
key: "contentUnloaded",
|
|
205
|
-
get:
|
|
206
|
-
function get() {
|
|
183
|
+
get: function get() {
|
|
207
184
|
return this.contentState === _constants.TILE_CONTENT_STATE.UNLOADED;
|
|
208
185
|
}
|
|
209
|
-
|
|
210
186
|
}, {
|
|
211
187
|
key: "contentExpired",
|
|
212
|
-
get:
|
|
213
|
-
function get() {
|
|
188
|
+
get: function get() {
|
|
214
189
|
return this.contentState === _constants.TILE_CONTENT_STATE.EXPIRED;
|
|
215
190
|
}
|
|
216
|
-
|
|
217
191
|
}, {
|
|
218
192
|
key: "contentFailed",
|
|
219
|
-
get:
|
|
220
|
-
function get() {
|
|
193
|
+
get: function get() {
|
|
221
194
|
return this.contentState === _constants.TILE_CONTENT_STATE.FAILED;
|
|
222
195
|
}
|
|
223
|
-
|
|
224
196
|
}, {
|
|
225
197
|
key: "distanceToCamera",
|
|
226
|
-
get:
|
|
227
|
-
function get() {
|
|
198
|
+
get: function get() {
|
|
228
199
|
return this._distanceToCamera;
|
|
229
200
|
}
|
|
230
|
-
|
|
231
201
|
}, {
|
|
232
202
|
key: "screenSpaceError",
|
|
233
|
-
get:
|
|
234
|
-
function get() {
|
|
203
|
+
get: function get() {
|
|
235
204
|
return this._screenSpaceError;
|
|
236
205
|
}
|
|
237
|
-
|
|
206
|
+
}, {
|
|
207
|
+
key: "boundingBox",
|
|
208
|
+
get: function get() {
|
|
209
|
+
if (!this._boundingBox) {
|
|
210
|
+
this._boundingBox = (0, _boundingVolume.getCartographicBounds)(this.header.boundingVolume, this.boundingVolume);
|
|
211
|
+
}
|
|
212
|
+
return this._boundingBox;
|
|
213
|
+
}
|
|
238
214
|
}, {
|
|
239
215
|
key: "getScreenSpaceError",
|
|
240
|
-
value:
|
|
241
|
-
function getScreenSpaceError(frameState, useParentLodMetric) {
|
|
216
|
+
value: function getScreenSpaceError(frameState, useParentLodMetric) {
|
|
242
217
|
switch (this.tileset.type) {
|
|
243
218
|
case _constants.TILESET_TYPE.I3S:
|
|
244
219
|
return (0, _i3sLod.getProjectedRadius)(this, frameState);
|
|
@@ -248,23 +223,17 @@ var Tile3D = function () {
|
|
|
248
223
|
throw new Error('Unsupported tileset type');
|
|
249
224
|
}
|
|
250
225
|
}
|
|
251
|
-
|
|
252
226
|
}, {
|
|
253
227
|
key: "unselect",
|
|
254
|
-
value:
|
|
255
|
-
function unselect() {
|
|
228
|
+
value: function unselect() {
|
|
256
229
|
this._selectedFrame = 0;
|
|
257
230
|
}
|
|
258
|
-
|
|
259
231
|
}, {
|
|
260
232
|
key: "_getPriority",
|
|
261
|
-
value:
|
|
262
|
-
function _getPriority() {
|
|
233
|
+
value: function _getPriority() {
|
|
263
234
|
var traverser = this.tileset._traverser;
|
|
264
235
|
var skipLevelOfDetail = traverser.options.skipLevelOfDetail;
|
|
265
|
-
|
|
266
236
|
var maySkipTile = this.refine === _constants.TILE_REFINEMENT.ADD || skipLevelOfDetail;
|
|
267
|
-
|
|
268
237
|
if (maySkipTile && !this.isVisible && this._visible !== undefined) {
|
|
269
238
|
return -1;
|
|
270
239
|
}
|
|
@@ -274,88 +243,83 @@ var Tile3D = function () {
|
|
|
274
243
|
if (this.contentState === _constants.TILE_CONTENT_STATE.UNLOADED) {
|
|
275
244
|
return -1;
|
|
276
245
|
}
|
|
277
|
-
|
|
278
246
|
var parent = this.parent;
|
|
279
247
|
var useParentScreenSpaceError = parent && (!maySkipTile || this._screenSpaceError === 0.0 || parent.hasTilesetContent);
|
|
280
248
|
var screenSpaceError = useParentScreenSpaceError ? parent._screenSpaceError : this._screenSpaceError;
|
|
281
249
|
var rootScreenSpaceError = traverser.root ? traverser.root._screenSpaceError : 0.0;
|
|
282
|
-
|
|
283
250
|
return Math.max(rootScreenSpaceError - screenSpaceError, 0);
|
|
284
251
|
}
|
|
285
|
-
|
|
286
252
|
}, {
|
|
287
253
|
key: "loadContent",
|
|
288
254
|
value: function () {
|
|
289
255
|
var _loadContent = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
|
|
290
256
|
var expired, requestToken, contentUrl, loader, options;
|
|
291
257
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
292
|
-
while (1) {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
if (!this.tileset.options.contentLoader) {
|
|
334
|
-
_context.next = 23;
|
|
335
|
-
break;
|
|
336
|
-
}
|
|
258
|
+
while (1) switch (_context.prev = _context.next) {
|
|
259
|
+
case 0:
|
|
260
|
+
if (!this.hasEmptyContent) {
|
|
261
|
+
_context.next = 2;
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
return _context.abrupt("return", false);
|
|
265
|
+
case 2:
|
|
266
|
+
if (!this.content) {
|
|
267
|
+
_context.next = 4;
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
return _context.abrupt("return", true);
|
|
271
|
+
case 4:
|
|
272
|
+
expired = this.contentExpired;
|
|
273
|
+
if (expired) {
|
|
274
|
+
this._expireDate = null;
|
|
275
|
+
}
|
|
276
|
+
this.contentState = _constants.TILE_CONTENT_STATE.LOADING;
|
|
277
|
+
_context.next = 9;
|
|
278
|
+
return this.tileset._requestScheduler.scheduleRequest(this.id, this._getPriority.bind(this));
|
|
279
|
+
case 9:
|
|
280
|
+
requestToken = _context.sent;
|
|
281
|
+
if (requestToken) {
|
|
282
|
+
_context.next = 13;
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
this.contentState = _constants.TILE_CONTENT_STATE.UNLOADED;
|
|
286
|
+
return _context.abrupt("return", false);
|
|
287
|
+
case 13:
|
|
288
|
+
_context.prev = 13;
|
|
289
|
+
contentUrl = this.tileset.getTileUrl(this.contentUrl);
|
|
290
|
+
loader = this.tileset.loader;
|
|
291
|
+
options = _objectSpread(_objectSpread({}, this.tileset.loadOptions), {}, (0, _defineProperty2.default)({}, loader.id, _objectSpread(_objectSpread({}, this.tileset.loadOptions[loader.id]), {}, {
|
|
292
|
+
isTileset: this.type === 'json'
|
|
293
|
+
}, this._getLoaderSpecificOptions(loader.id))));
|
|
294
|
+
_context.next = 19;
|
|
295
|
+
return (0, _core2.load)(contentUrl, loader, options);
|
|
296
|
+
case 19:
|
|
297
|
+
this.content = _context.sent;
|
|
298
|
+
if (!this.tileset.options.contentLoader) {
|
|
337
299
|
_context.next = 23;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
this.
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
_context.next = 23;
|
|
303
|
+
return this.tileset.options.contentLoader(this);
|
|
304
|
+
case 23:
|
|
305
|
+
if (this._isTileset()) {
|
|
306
|
+
this.tileset._initializeTileHeaders(this.content, this);
|
|
307
|
+
}
|
|
308
|
+
this.contentState = _constants.TILE_CONTENT_STATE.READY;
|
|
309
|
+
this._onContentLoaded();
|
|
310
|
+
return _context.abrupt("return", true);
|
|
311
|
+
case 29:
|
|
312
|
+
_context.prev = 29;
|
|
313
|
+
_context.t0 = _context["catch"](13);
|
|
314
|
+
this.contentState = _constants.TILE_CONTENT_STATE.FAILED;
|
|
315
|
+
throw _context.t0;
|
|
316
|
+
case 33:
|
|
317
|
+
_context.prev = 33;
|
|
318
|
+
requestToken.done();
|
|
319
|
+
return _context.finish(33);
|
|
320
|
+
case 36:
|
|
321
|
+
case "end":
|
|
322
|
+
return _context.stop();
|
|
359
323
|
}
|
|
360
324
|
}, _callee, this, [[13, 29, 33, 36]]);
|
|
361
325
|
}));
|
|
@@ -366,8 +330,7 @@ var Tile3D = function () {
|
|
|
366
330
|
}()
|
|
367
331
|
}, {
|
|
368
332
|
key: "unloadContent",
|
|
369
|
-
value:
|
|
370
|
-
function unloadContent() {
|
|
333
|
+
value: function unloadContent() {
|
|
371
334
|
if (this.content && this.content.destroy) {
|
|
372
335
|
this.content.destroy();
|
|
373
336
|
}
|
|
@@ -379,11 +342,9 @@ var Tile3D = function () {
|
|
|
379
342
|
this.contentState = _constants.TILE_CONTENT_STATE.UNLOADED;
|
|
380
343
|
return true;
|
|
381
344
|
}
|
|
382
|
-
|
|
383
345
|
}, {
|
|
384
346
|
key: "updateVisibility",
|
|
385
|
-
value:
|
|
386
|
-
function updateVisibility(frameState, viewportIds) {
|
|
347
|
+
value: function updateVisibility(frameState, viewportIds) {
|
|
387
348
|
if (this._frameNumber === frameState.frameNumber) {
|
|
388
349
|
return;
|
|
389
350
|
}
|
|
@@ -401,56 +362,41 @@ var Tile3D = function () {
|
|
|
401
362
|
this._frameNumber = frameState.frameNumber;
|
|
402
363
|
this.viewportIds = viewportIds;
|
|
403
364
|
}
|
|
404
|
-
|
|
405
365
|
}, {
|
|
406
366
|
key: "visibility",
|
|
407
|
-
value:
|
|
408
|
-
function visibility(frameState, parentVisibilityPlaneMask) {
|
|
367
|
+
value: function visibility(frameState, parentVisibilityPlaneMask) {
|
|
409
368
|
var cullingVolume = frameState.cullingVolume;
|
|
410
369
|
var boundingVolume = this.boundingVolume;
|
|
411
|
-
|
|
412
370
|
return cullingVolume.computeVisibilityWithPlaneMask(boundingVolume, parentVisibilityPlaneMask);
|
|
413
371
|
}
|
|
414
|
-
|
|
415
372
|
}, {
|
|
416
373
|
key: "contentVisibility",
|
|
417
|
-
value:
|
|
418
|
-
function contentVisibility() {
|
|
374
|
+
value: function contentVisibility() {
|
|
419
375
|
return true;
|
|
420
|
-
|
|
421
376
|
}
|
|
422
|
-
|
|
423
377
|
}, {
|
|
424
378
|
key: "distanceToTile",
|
|
425
|
-
value:
|
|
426
|
-
function distanceToTile(frameState) {
|
|
379
|
+
value: function distanceToTile(frameState) {
|
|
427
380
|
var boundingVolume = this.boundingVolume;
|
|
428
381
|
return Math.sqrt(Math.max(boundingVolume.distanceSquaredTo(frameState.camera.position), 0));
|
|
429
382
|
}
|
|
430
|
-
|
|
431
383
|
}, {
|
|
432
384
|
key: "cameraSpaceZDepth",
|
|
433
|
-
value:
|
|
434
|
-
function cameraSpaceZDepth(_ref) {
|
|
385
|
+
value: function cameraSpaceZDepth(_ref) {
|
|
435
386
|
var camera = _ref.camera;
|
|
436
387
|
var boundingVolume = this.boundingVolume;
|
|
437
388
|
scratchVector.subVectors(boundingVolume.center, camera.position);
|
|
438
389
|
return camera.direction.dot(scratchVector);
|
|
439
390
|
}
|
|
440
|
-
|
|
441
391
|
}, {
|
|
442
392
|
key: "insideViewerRequestVolume",
|
|
443
|
-
value:
|
|
444
|
-
function insideViewerRequestVolume(frameState) {
|
|
393
|
+
value: function insideViewerRequestVolume(frameState) {
|
|
445
394
|
var viewerRequestVolume = this._viewerRequestVolume;
|
|
446
395
|
return !viewerRequestVolume || viewerRequestVolume.distanceSquaredTo(frameState.camera.position) <= 0;
|
|
447
396
|
}
|
|
448
|
-
|
|
449
397
|
}, {
|
|
450
398
|
key: "updateExpiration",
|
|
451
|
-
value:
|
|
452
|
-
|
|
453
|
-
function updateExpiration() {
|
|
399
|
+
value: function updateExpiration() {
|
|
454
400
|
if (defined(this._expireDate) && this.contentReady && !this.hasEmptyContent) {
|
|
455
401
|
var now = Date.now();
|
|
456
402
|
if (Date.lessThan(this._expireDate, now)) {
|
|
@@ -464,19 +410,15 @@ var Tile3D = function () {
|
|
|
464
410
|
get: function get() {
|
|
465
411
|
return this.header.extras;
|
|
466
412
|
}
|
|
467
|
-
|
|
468
413
|
}, {
|
|
469
414
|
key: "_initializeLodMetric",
|
|
470
|
-
value:
|
|
471
|
-
|
|
472
|
-
function _initializeLodMetric(header) {
|
|
415
|
+
value: function _initializeLodMetric(header) {
|
|
473
416
|
if ('lodMetricType' in header) {
|
|
474
417
|
this.lodMetricType = header.lodMetricType;
|
|
475
418
|
} else {
|
|
476
419
|
this.lodMetricType = this.parent && this.parent.lodMetricType || this.tileset.lodMetricType;
|
|
477
420
|
console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType");
|
|
478
421
|
}
|
|
479
|
-
|
|
480
422
|
if ('lodMetricValue' in header) {
|
|
481
423
|
this.lodMetricValue = header.lodMetricValue;
|
|
482
424
|
} else {
|
|
@@ -511,21 +453,17 @@ var Tile3D = function () {
|
|
|
511
453
|
};
|
|
512
454
|
this.hasEmptyContent = true;
|
|
513
455
|
this.contentState = _constants.TILE_CONTENT_STATE.UNLOADED;
|
|
514
|
-
|
|
515
456
|
this.hasTilesetContent = false;
|
|
516
457
|
if (tileHeader.contentUrl) {
|
|
517
458
|
this.content = null;
|
|
518
459
|
this.hasEmptyContent = false;
|
|
519
460
|
}
|
|
520
461
|
}
|
|
521
|
-
|
|
522
462
|
}, {
|
|
523
463
|
key: "_initializeRenderingState",
|
|
524
|
-
value:
|
|
525
|
-
function _initializeRenderingState(header) {
|
|
464
|
+
value: function _initializeRenderingState(header) {
|
|
526
465
|
this.depth = header.level || (this.parent ? this.parent.depth + 1 : 0);
|
|
527
466
|
this._shouldRefine = false;
|
|
528
|
-
|
|
529
467
|
this._distanceToCamera = 0;
|
|
530
468
|
this._centerZDepth = 0;
|
|
531
469
|
this._screenSpaceError = 0;
|
|
@@ -561,7 +499,6 @@ var Tile3D = function () {
|
|
|
561
499
|
break;
|
|
562
500
|
default:
|
|
563
501
|
}
|
|
564
|
-
|
|
565
502
|
if (this._isTileset()) {
|
|
566
503
|
this.hasTilesetContent = true;
|
|
567
504
|
}
|
|
@@ -574,7 +511,6 @@ var Tile3D = function () {
|
|
|
574
511
|
if (!content) {
|
|
575
512
|
return;
|
|
576
513
|
}
|
|
577
|
-
|
|
578
514
|
if (content.boundingVolume) {
|
|
579
515
|
this._contentBoundingVolume = (0, _boundingVolume.createBoundingVolume)(content.boundingVolume, this.computedTransform, this._contentBoundingVolume);
|
|
580
516
|
}
|
|
@@ -582,11 +518,9 @@ var Tile3D = function () {
|
|
|
582
518
|
this._viewerRequestVolume = (0, _boundingVolume.createBoundingVolume)(header.viewerRequestVolume, this.computedTransform, this._viewerRequestVolume);
|
|
583
519
|
}
|
|
584
520
|
}
|
|
585
|
-
|
|
586
521
|
}, {
|
|
587
522
|
key: "_updateTransform",
|
|
588
|
-
value:
|
|
589
|
-
function _updateTransform() {
|
|
523
|
+
value: function _updateTransform() {
|
|
590
524
|
var parentTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new _core.Matrix4();
|
|
591
525
|
var computedTransform = parentTransform.clone().multiplyRight(this.transform);
|
|
592
526
|
var didTransformChange = !computedTransform.equals(this.computedTransform);
|
|
@@ -596,11 +530,9 @@ var Tile3D = function () {
|
|
|
596
530
|
this.computedTransform = computedTransform;
|
|
597
531
|
this._updateBoundingVolume(this.header);
|
|
598
532
|
}
|
|
599
|
-
|
|
600
533
|
}, {
|
|
601
534
|
key: "_getLoaderSpecificOptions",
|
|
602
|
-
value:
|
|
603
|
-
function _getLoaderSpecificOptions(loaderId) {
|
|
535
|
+
value: function _getLoaderSpecificOptions(loaderId) {
|
|
604
536
|
switch (loaderId) {
|
|
605
537
|
case 'i3s':
|
|
606
538
|
return _objectSpread(_objectSpread({}, this.tileset.options.i3s), {}, {
|