@cesium/engine 13.1.0 → 14.0.0
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/Build/Workers/{chunk-R2KGFZBA.js → chunk-3JBEPBPL.js} +13 -13
- package/Build/Workers/{chunk-NQDKNE7V.js → chunk-3LYROPON.js} +13 -13
- package/Build/Workers/{chunk-CNPP6TQ2.js → chunk-3PIZQT3I.js} +4 -4
- package/Build/Workers/{chunk-MGABCOOH.js → chunk-3QLSKXKF.js} +6 -6
- package/Build/Workers/{chunk-THDHWSEJ.js → chunk-4CHMVQTQ.js} +4 -4
- package/Build/Workers/{chunk-SAKQO5NX.js → chunk-5KWRW7YL.js} +2 -2
- package/Build/Workers/{chunk-EHGQQA7C.js → chunk-5S5OOA6U.js} +1 -1
- package/Build/Workers/{chunk-LFUFGHL3.js → chunk-77XPS7ZA.js} +10 -10
- package/Build/Workers/{chunk-GIOZHX7U.js → chunk-7EO56M5R.js} +2 -2
- package/Build/Workers/{chunk-PM76TX2X.js → chunk-7UHKH6M3.js} +6 -6
- package/Build/Workers/{chunk-GSLKQJM2.js → chunk-7ZB2RVIQ.js} +10 -10
- package/Build/Workers/{chunk-2SRHVCFD.js → chunk-B4GSRXE3.js} +6 -6
- package/Build/Workers/{chunk-J7BMSSY7.js → chunk-CI2HEJFC.js} +13 -13
- package/Build/Workers/{chunk-BMFWWTD7.js → chunk-D7ZBZPHV.js} +5 -5
- package/Build/Workers/{chunk-5JY4LYO3.js → chunk-DT5NFR5C.js} +7 -7
- package/Build/Workers/{chunk-AXYZUG4N.js → chunk-ED6GLQTK.js} +1 -1
- package/Build/Workers/{chunk-APCS5YJI.js → chunk-EWDGNOJE.js} +7 -7
- package/Build/Workers/{chunk-TOHDFUJM.js → chunk-F4CUH4MR.js} +4 -4
- package/Build/Workers/{chunk-EYZFEJX3.js → chunk-FFBJDW4A.js} +6 -6
- package/Build/Workers/{chunk-K6SQV4IS.js → chunk-FX4R4MTH.js} +6 -6
- package/Build/Workers/{chunk-B6IJY6AN.js → chunk-FYGLNDKG.js} +7 -7
- package/Build/Workers/{chunk-OARMSJUU.js → chunk-G3BVMPWG.js} +2 -2
- package/Build/Workers/{chunk-EJ5DT5BP.js → chunk-HEZHXDYB.js} +1 -1
- package/Build/Workers/{chunk-YVGU235V.js → chunk-HKHQ3EDR.js} +4 -4
- package/Build/Workers/{chunk-CBE4HRBH.js → chunk-HUFQVUMY.js} +7 -7
- package/Build/Workers/{chunk-S3UM4OKP.js → chunk-J7IH4EYI.js} +7 -7
- package/Build/Workers/{chunk-IP7F2MVW.js → chunk-JHBPC4LK.js} +7 -7
- package/Build/Workers/{chunk-ZWSWJYJP.js → chunk-JPDKYBLF.js} +13 -13
- package/Build/Workers/{chunk-5ICYLS6B.js → chunk-K4AH3TDT.js} +10 -10
- package/Build/Workers/{chunk-OGRXNUR2.js → chunk-KHWLAQVA.js} +1 -1
- package/Build/Workers/{chunk-KRVALCCI.js → chunk-KM6MITPF.js} +5 -5
- package/Build/Workers/{chunk-B34JXFHF.js → chunk-KSYBJA4M.js} +5 -5
- package/Build/Workers/{chunk-OZTFRHA2.js → chunk-LJBJM6VI.js} +6 -6
- package/Build/Workers/{chunk-M2AA2ARJ.js → chunk-LNSWJ43X.js} +11 -11
- package/Build/Workers/{chunk-PBJQFLKS.js → chunk-LOZ4NKY3.js} +11 -11
- package/Build/Workers/{chunk-54I6VSRP.js → chunk-LS3KVHYY.js} +6 -6
- package/Build/Workers/{chunk-3SCCWLZS.js → chunk-MVM4JV5U.js} +9 -9
- package/Build/Workers/{chunk-PTFIVVLX.js → chunk-N2XAJBC6.js} +12 -12
- package/Build/Workers/{chunk-FNCXBBCF.js → chunk-OMXHEJTK.js} +2 -2
- package/Build/Workers/{chunk-IXNXKVOB.js → chunk-PWF4EY5P.js} +4 -4
- package/Build/Workers/{chunk-DWIKWWEE.js → chunk-Q4ZVWJXX.js} +5 -5
- package/Build/Workers/{chunk-WUIDEXAN.js → chunk-SDIDRZDG.js} +7 -7
- package/Build/Workers/{chunk-UBAHTE4Q.js → chunk-TVL3F7IU.js} +1 -1
- package/Build/Workers/{chunk-KO232FLP.js → chunk-TY4DKOWR.js} +2 -2
- package/Build/Workers/{chunk-WE4KF4AM.js → chunk-VCNOFQYH.js} +9 -9
- package/Build/Workers/{chunk-2ONAV62A.js → chunk-WEHZP4SE.js} +7 -7
- package/Build/Workers/{chunk-HI73PIPQ.js → chunk-WVNLSTOF.js} +2 -2
- package/Build/Workers/{chunk-LQT2ZK7D.js → chunk-XK4OP6VA.js} +17 -17
- package/Build/Workers/{chunk-K62EHZFT.js → chunk-YJX7X577.js} +15 -15
- package/Build/Workers/{chunk-T34EOLFR.js → chunk-Z3QWTHI7.js} +14 -14
- package/Build/Workers/{chunk-WAJNX74N.js → chunk-ZGFIT57T.js} +17 -17
- package/Build/Workers/{chunk-5I3LPAS7.js → chunk-ZMNLEL6W.js} +5 -5
- package/Build/Workers/combineGeometry.js +22 -22
- package/Build/Workers/createBoxGeometry.js +16 -16
- package/Build/Workers/createBoxOutlineGeometry.js +14 -14
- package/Build/Workers/createCircleGeometry.js +24 -24
- package/Build/Workers/createCircleOutlineGeometry.js +17 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createCorridorGeometry.js +27 -27
- package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
- package/Build/Workers/createCylinderGeometry.js +18 -18
- package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipseGeometry.js +24 -24
- package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
- package/Build/Workers/createEllipsoidGeometry.js +17 -17
- package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
- package/Build/Workers/createFrustumGeometry.js +16 -16
- package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
- package/Build/Workers/createGeometry.js +22 -22
- package/Build/Workers/createGroundPolylineGeometry.js +20 -20
- package/Build/Workers/createPlaneGeometry.js +14 -14
- package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
- package/Build/Workers/createPolygonGeometry.js +30 -30
- package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
- package/Build/Workers/createPolylineGeometry.js +23 -23
- package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
- package/Build/Workers/createRectangleGeometry.js +25 -25
- package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
- package/Build/Workers/createSimplePolylineGeometry.js +21 -21
- package/Build/Workers/createSphereGeometry.js +17 -17
- package/Build/Workers/createSphereOutlineGeometry.js +16 -16
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
- package/Build/Workers/createVectorTileGeometries.js +22 -22
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +20 -20
- package/Build/Workers/createVectorTilePolylines.js +13 -13
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
- package/Build/Workers/createVerticesFromHeightmap.js +20 -20
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
- package/Build/Workers/createWallGeometry.js +22 -22
- package/Build/Workers/createWallOutlineGeometry.js +21 -21
- package/Build/Workers/decodeDraco.js +15 -14
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/transcodeKTX2.js +7 -7
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
- package/Source/Core/Color.js +3 -3
- package/Source/Core/Credit.js +3 -3
- package/Source/Core/DistanceDisplayCondition.js +3 -3
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/OrientedBoundingBox.js +2 -2
- package/Source/Core/Spherical.js +3 -3
- package/Source/Core/writeTextToCanvas.js +0 -1
- package/Source/DataSources/BoundingSphereState.js +3 -3
- package/Source/DataSources/DataSourceClock.js +1 -1
- package/Source/DataSources/DataSourceDisplay.js +5 -2
- package/Source/Renderer/AutomaticUniforms.js +2 -2
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +1 -1
- package/Source/Scene/Cesium3DTile.js +56 -28
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +17 -0
- package/Source/Scene/ClippingPolygon.js +2 -2
- package/Source/Scene/GltfDracoLoader.js +45 -0
- package/Source/Scene/GltfIndexBufferLoader.js +5 -0
- package/Source/Scene/GltfLoader.js +17 -2
- package/Source/Scene/GltfVertexBufferLoader.js +13 -0
- package/Source/Scene/ITwinData.js +47 -1
- package/Source/Scene/ImageryLayer.js +1 -1
- package/Source/Scene/Label.js +1 -1
- package/Source/Scene/LabelCollection.js +0 -11
- package/Source/Scene/Multiple3DTileContent.js +21 -8
- package/Source/Scene/PointPrimitive.js +1 -1
- package/Source/Scene/ResourceCache.js +17 -1
- package/Source/Scene/VoxelPrimitive.js +124 -0
- package/Source/Scene/VoxelProvider.js +10 -0
- package/Source/Scene/VoxelTraversal.js +88 -12
- package/Source/Scene/WebMapTileServiceImageryProvider.js +2 -2
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +5 -8
- package/Source/Shaders/PolylineCommon.glsl +1 -1
- package/Source/Shaders/PolylineCommon.js +1 -1
- package/Source/Widget/CesiumWidget.js +16 -10
- package/Source/Workers/decodeDraco.js +4 -4
- package/index.d.ts +152 -38
- package/index.js +299 -299
- package/package.json +1 -1
|
@@ -25,6 +25,7 @@ import CustomShader from "./Model/CustomShader.js";
|
|
|
25
25
|
import Cartographic from "../Core/Cartographic.js";
|
|
26
26
|
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
27
27
|
import VerticalExaggeration from "../Core/VerticalExaggeration.js";
|
|
28
|
+
import Cesium3DTilesetStatistics from "./Cesium3DTilesetStatistics.js";
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* A primitive that renders voxel data from a {@link VoxelProvider}.
|
|
@@ -70,6 +71,12 @@ function VoxelPrimitive(options) {
|
|
|
70
71
|
*/
|
|
71
72
|
this._traversal = undefined;
|
|
72
73
|
|
|
74
|
+
/**
|
|
75
|
+
* @type {Cesium3DTilesetStatistics}
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
this._statistics = new Cesium3DTilesetStatistics();
|
|
79
|
+
|
|
73
80
|
/**
|
|
74
81
|
* This member is not created until the provider is ready.
|
|
75
82
|
*
|
|
@@ -450,6 +457,123 @@ function VoxelPrimitive(options) {
|
|
|
450
457
|
}
|
|
451
458
|
}
|
|
452
459
|
|
|
460
|
+
/**
|
|
461
|
+
* The event fired to indicate that a tile's content was loaded.
|
|
462
|
+
* <p>
|
|
463
|
+
* This event is fired during the tileset traversal while the frame is being rendered
|
|
464
|
+
* so that updates to the tile take effect in the same frame. Do not create or modify
|
|
465
|
+
* Cesium entities or primitives during the event listener.
|
|
466
|
+
* </p>
|
|
467
|
+
*
|
|
468
|
+
* @type {Event}
|
|
469
|
+
*
|
|
470
|
+
* @example
|
|
471
|
+
* voxelPrimitive.tileLoad.addEventListener(function() {
|
|
472
|
+
* console.log('A tile was loaded.');
|
|
473
|
+
* });
|
|
474
|
+
*/
|
|
475
|
+
this.tileLoad = new Event();
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* This event fires once for each visible tile in a frame.
|
|
479
|
+
* <p>
|
|
480
|
+
* This event is fired during the traversal while the frame is being rendered.
|
|
481
|
+
*
|
|
482
|
+
* @type {Event}
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* voxelPrimitive.tileVisible.addEventListener(function() {
|
|
486
|
+
* console.log('A tile is visible.');
|
|
487
|
+
* });
|
|
488
|
+
*
|
|
489
|
+
*/
|
|
490
|
+
this.tileVisible = new Event();
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* The event fired to indicate that a tile's content failed to load.
|
|
494
|
+
*
|
|
495
|
+
* @type {Event}
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
* voxelPrimitive.tileFailed.addEventListener(function() {
|
|
499
|
+
* console.log('An error occurred loading tile.');
|
|
500
|
+
* });
|
|
501
|
+
*/
|
|
502
|
+
this.tileFailed = new Event();
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* The event fired to indicate that a tile's content was unloaded.
|
|
506
|
+
*
|
|
507
|
+
* @type {Event}
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* voxelPrimitive.tileUnload.addEventListener(function() {
|
|
511
|
+
* console.log('A tile was unloaded from the cache.');
|
|
512
|
+
* });
|
|
513
|
+
*
|
|
514
|
+
*/
|
|
515
|
+
this.tileUnload = new Event();
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* The event fired to indicate progress of loading new tiles. This event is fired when a new tile
|
|
519
|
+
* is requested, when a requested tile is finished downloading, and when a downloaded tile has been
|
|
520
|
+
* processed and is ready to render.
|
|
521
|
+
* <p>
|
|
522
|
+
* The number of pending tile requests, <code>numberOfPendingRequests</code>, and number of tiles
|
|
523
|
+
* processing, <code>numberOfTilesProcessing</code> are passed to the event listener.
|
|
524
|
+
* </p>
|
|
525
|
+
* <p>
|
|
526
|
+
* This event is fired at the end of the frame after the scene is rendered.
|
|
527
|
+
* </p>
|
|
528
|
+
*
|
|
529
|
+
* @type {Event}
|
|
530
|
+
*
|
|
531
|
+
* @example
|
|
532
|
+
* voxelPrimitive.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {
|
|
533
|
+
* if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {
|
|
534
|
+
* console.log('Finished loading');
|
|
535
|
+
* return;
|
|
536
|
+
* }
|
|
537
|
+
*
|
|
538
|
+
* console.log(`Loading: requests: ${numberOfPendingRequests}, processing: ${numberOfTilesProcessing}`);
|
|
539
|
+
* });
|
|
540
|
+
*/
|
|
541
|
+
this.loadProgress = new Event();
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The voxel
|
|
545
|
+
* primitive is completely loaded for this view.
|
|
546
|
+
* <p>
|
|
547
|
+
* This event is fired at the end of the frame after the scene is rendered.
|
|
548
|
+
* </p>
|
|
549
|
+
*
|
|
550
|
+
* @type {Event}
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
* voxelPrimitive.allTilesLoaded.addEventListener(function() {
|
|
554
|
+
* console.log('All tiles are loaded');
|
|
555
|
+
* });
|
|
556
|
+
*/
|
|
557
|
+
this.allTilesLoaded = new Event();
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event
|
|
561
|
+
* is fired once when all tiles in the initial view are loaded.
|
|
562
|
+
* <p>
|
|
563
|
+
* This event is fired at the end of the frame after the scene is rendered.
|
|
564
|
+
* </p>
|
|
565
|
+
*
|
|
566
|
+
* @type {Event}
|
|
567
|
+
*
|
|
568
|
+
* @example
|
|
569
|
+
* voxelPrimitive.initialTilesLoaded.addEventListener(function() {
|
|
570
|
+
* console.log('Initial tiles are loaded');
|
|
571
|
+
* });
|
|
572
|
+
*
|
|
573
|
+
* @see Cesium3DTileset#allTilesLoaded
|
|
574
|
+
*/
|
|
575
|
+
this.initialTilesLoaded = new Event();
|
|
576
|
+
|
|
453
577
|
// If the provider fails to initialize the primitive will fail too.
|
|
454
578
|
const provider = this._provider;
|
|
455
579
|
initialize(this, provider);
|
|
@@ -186,6 +186,16 @@ Object.defineProperties(VoxelProvider.prototype, {
|
|
|
186
186
|
get: DeveloperError.throwInstantiationError,
|
|
187
187
|
},
|
|
188
188
|
|
|
189
|
+
/**
|
|
190
|
+
* The number of levels of detail containing available tiles in the tileset.
|
|
191
|
+
*
|
|
192
|
+
* @type {number|undefined}
|
|
193
|
+
* @readonly
|
|
194
|
+
*/
|
|
195
|
+
availableLevels: {
|
|
196
|
+
get: DeveloperError.throwInstantiationError,
|
|
197
|
+
},
|
|
198
|
+
|
|
189
199
|
/**
|
|
190
200
|
* Gets the number of keyframes in the dataset.
|
|
191
201
|
* This should not be called before {@link VoxelProvider#ready} returns true.
|
|
@@ -143,6 +143,12 @@ function VoxelTraversal(
|
|
|
143
143
|
*/
|
|
144
144
|
this._binaryTreeKeyframeWeighting = new Array(keyframeCount);
|
|
145
145
|
|
|
146
|
+
/**
|
|
147
|
+
* @type {boolean}
|
|
148
|
+
* @private
|
|
149
|
+
*/
|
|
150
|
+
this._initialTilesLoaded = false;
|
|
151
|
+
|
|
146
152
|
const binaryTreeKeyframeWeighting = this._binaryTreeKeyframeWeighting;
|
|
147
153
|
binaryTreeKeyframeWeighting[0] = 0;
|
|
148
154
|
binaryTreeKeyframeWeighting[keyframeCount - 1] = 0;
|
|
@@ -316,13 +322,17 @@ VoxelTraversal.prototype.update = function (
|
|
|
316
322
|
const timestamp1 = getTimestamp();
|
|
317
323
|
generateOctree(this, sampleCount, levelBlendFactor);
|
|
318
324
|
const timestamp2 = getTimestamp();
|
|
319
|
-
|
|
320
|
-
|
|
325
|
+
const checkEventListeners =
|
|
326
|
+
primitive.loadProgress.numberOfListeners > 0 ||
|
|
327
|
+
primitive.allTilesLoaded.numberOfListeners > 0 ||
|
|
328
|
+
primitive.initialTilesLoaded.numberOfListeners > 0;
|
|
329
|
+
if (this._debugPrint || checkEventListeners) {
|
|
321
330
|
const loadAndUnloadTimeMs = timestamp1 - timestamp0;
|
|
322
331
|
const generateOctreeTimeMs = timestamp2 - timestamp1;
|
|
323
332
|
const totalTimeMs = timestamp2 - timestamp0;
|
|
324
|
-
|
|
333
|
+
postPassesUpdate(
|
|
325
334
|
this,
|
|
335
|
+
frameState,
|
|
326
336
|
loadAndUnloadTimeMs,
|
|
327
337
|
generateOctreeTimeMs,
|
|
328
338
|
totalTimeMs,
|
|
@@ -418,6 +428,21 @@ function requestData(that, keyframeNode) {
|
|
|
418
428
|
}
|
|
419
429
|
|
|
420
430
|
const provider = that._primitive._provider;
|
|
431
|
+
const { keyframe, spatialNode } = keyframeNode;
|
|
432
|
+
if (
|
|
433
|
+
defined(provider.availableLevels) &&
|
|
434
|
+
spatialNode.level >= provider.availableLevels
|
|
435
|
+
) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
const requestOptions = {
|
|
440
|
+
tileLevel: spatialNode.level,
|
|
441
|
+
tileX: spatialNode.x,
|
|
442
|
+
tileY: spatialNode.y,
|
|
443
|
+
tileZ: spatialNode.z,
|
|
444
|
+
keyframe: keyframe,
|
|
445
|
+
};
|
|
421
446
|
|
|
422
447
|
function postRequestSuccess(result) {
|
|
423
448
|
that._simultaneousRequestCount--;
|
|
@@ -443,27 +468,25 @@ function requestData(that, keyframeNode) {
|
|
|
443
468
|
keyframeNode.metadata[i] = data;
|
|
444
469
|
// State is received only when all metadata requests have been received
|
|
445
470
|
keyframeNode.state = KeyframeNode.LoadState.RECEIVED;
|
|
471
|
+
that._primitive.tileLoad.raiseEvent();
|
|
446
472
|
} else {
|
|
447
473
|
keyframeNode.state = KeyframeNode.LoadState.FAILED;
|
|
448
474
|
break;
|
|
449
475
|
}
|
|
450
476
|
}
|
|
451
477
|
}
|
|
478
|
+
if (keyframeNode.state === KeyframeNode.LoadState.FAILED) {
|
|
479
|
+
that._primitive.tileFailed.raiseEvent();
|
|
480
|
+
}
|
|
452
481
|
}
|
|
453
482
|
|
|
454
483
|
function postRequestFailure() {
|
|
455
484
|
that._simultaneousRequestCount--;
|
|
456
485
|
keyframeNode.state = KeyframeNode.LoadState.FAILED;
|
|
486
|
+
that._primitive.tileFailed.raiseEvent();
|
|
457
487
|
}
|
|
458
488
|
|
|
459
|
-
const
|
|
460
|
-
const promise = provider.requestData({
|
|
461
|
-
tileLevel: spatialNode.level,
|
|
462
|
-
tileX: spatialNode.x,
|
|
463
|
-
tileY: spatialNode.y,
|
|
464
|
-
tileZ: spatialNode.z,
|
|
465
|
-
keyframe: keyframe,
|
|
466
|
-
});
|
|
489
|
+
const promise = provider.requestData(requestOptions);
|
|
467
490
|
|
|
468
491
|
if (defined(promise)) {
|
|
469
492
|
that._simultaneousRequestCount++;
|
|
@@ -471,6 +494,7 @@ function requestData(that, keyframeNode) {
|
|
|
471
494
|
promise.then(postRequestSuccess).catch(postRequestFailure);
|
|
472
495
|
} else {
|
|
473
496
|
keyframeNode.state = KeyframeNode.LoadState.FAILED;
|
|
497
|
+
that._primitive.tileFailed.raiseEvent();
|
|
474
498
|
}
|
|
475
499
|
}
|
|
476
500
|
|
|
@@ -645,6 +669,7 @@ function loadAndUnload(that, frameState) {
|
|
|
645
669
|
destroyedCount++;
|
|
646
670
|
|
|
647
671
|
const discardNode = keyframeNodesInMegatexture[addNodeIndex];
|
|
672
|
+
that._primitive.tileUnload.raiseEvent();
|
|
648
673
|
discardNode.spatialNode.destroyKeyframeNode(
|
|
649
674
|
discardNode,
|
|
650
675
|
that.megatextures,
|
|
@@ -703,8 +728,9 @@ function keyframePriority(previousKeyframe, keyframe, nextKeyframe, traversal) {
|
|
|
703
728
|
*
|
|
704
729
|
* @private
|
|
705
730
|
*/
|
|
706
|
-
function
|
|
731
|
+
function postPassesUpdate(
|
|
707
732
|
that,
|
|
733
|
+
frameState,
|
|
708
734
|
loadAndUnloadTimeMs,
|
|
709
735
|
generateOctreeTimeMs,
|
|
710
736
|
totalTimeMs,
|
|
@@ -758,6 +784,55 @@ function printDebugInformation(
|
|
|
758
784
|
}
|
|
759
785
|
traverseRecursive(rootNode);
|
|
760
786
|
|
|
787
|
+
const numberOfPendingRequests =
|
|
788
|
+
loadStateByCount[KeyframeNode.LoadState.RECEIVING];
|
|
789
|
+
const numberOfTilesProcessing =
|
|
790
|
+
loadStateByCount[KeyframeNode.LoadState.RECEIVED];
|
|
791
|
+
|
|
792
|
+
const progressChanged =
|
|
793
|
+
numberOfPendingRequests !==
|
|
794
|
+
that._primitive._statistics.numberOfPendingRequests ||
|
|
795
|
+
numberOfTilesProcessing !==
|
|
796
|
+
that._primitive._statistics.numberOfTilesProcessing;
|
|
797
|
+
|
|
798
|
+
if (progressChanged) {
|
|
799
|
+
frameState.afterRender.push(function () {
|
|
800
|
+
that._primitive.loadProgress.raiseEvent(
|
|
801
|
+
numberOfPendingRequests,
|
|
802
|
+
numberOfTilesProcessing,
|
|
803
|
+
);
|
|
804
|
+
|
|
805
|
+
return true;
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
that._primitive._statistics.numberOfPendingRequests = numberOfPendingRequests;
|
|
810
|
+
that._primitive._statistics.numberOfTilesProcessing = numberOfTilesProcessing;
|
|
811
|
+
|
|
812
|
+
const tilesLoaded =
|
|
813
|
+
numberOfPendingRequests === 0 && numberOfTilesProcessing === 0;
|
|
814
|
+
|
|
815
|
+
// Events are raised (added to the afterRender queue) here since promises
|
|
816
|
+
// may resolve outside of the update loop that then raise events, e.g.,
|
|
817
|
+
// model's readyEvent
|
|
818
|
+
if (progressChanged && tilesLoaded) {
|
|
819
|
+
frameState.afterRender.push(function () {
|
|
820
|
+
that._primitive.allTilesLoaded.raiseEvent();
|
|
821
|
+
return true;
|
|
822
|
+
});
|
|
823
|
+
if (!that._initialTilesLoaded) {
|
|
824
|
+
that._initialTilesLoaded = true;
|
|
825
|
+
frameState.afterRender.push(function () {
|
|
826
|
+
that._primitive.initialTilesLoaded.raiseEvent();
|
|
827
|
+
return true;
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
if (!that._debugPrint) {
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
|
|
761
836
|
const loadedKeyframeStatistics = `KEYFRAMES: ${
|
|
762
837
|
loadStatesByKeyframe[KeyframeNode.LoadState.LOADED]
|
|
763
838
|
}`;
|
|
@@ -892,6 +967,7 @@ function generateOctree(that, sampleCount, levelBlendFactor) {
|
|
|
892
967
|
} else {
|
|
893
968
|
// Store the leaf node information instead
|
|
894
969
|
// Recursion stops here because there are no renderable children
|
|
970
|
+
that._primitive.tileVisible.raiseEvent();
|
|
895
971
|
if (useLeafNodes) {
|
|
896
972
|
const baseIdx = leafNodeCount * 5;
|
|
897
973
|
const keyframeNode = node.renderableKeyframeNodePrevious;
|
|
@@ -57,7 +57,7 @@ const defaultParameters = Object.freeze({
|
|
|
57
57
|
* @example
|
|
58
58
|
* // Example 1. USGS shaded relief tiles (KVP)
|
|
59
59
|
* const shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({
|
|
60
|
-
* url : '
|
|
60
|
+
* url : 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS',
|
|
61
61
|
* layer : 'USGSShadedReliefOnly',
|
|
62
62
|
* style : 'default',
|
|
63
63
|
* format : 'image/jpeg',
|
|
@@ -71,7 +71,7 @@ const defaultParameters = Object.freeze({
|
|
|
71
71
|
* @example
|
|
72
72
|
* // Example 2. USGS shaded relief tiles (RESTful)
|
|
73
73
|
* const shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({
|
|
74
|
-
* url : '
|
|
74
|
+
* url : 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',
|
|
75
75
|
* layer : 'USGSShadedReliefOnly',
|
|
76
76
|
* style : 'default',
|
|
77
77
|
* format : 'image/jpeg',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import Cesium3DTileset from "./Cesium3DTileset.js";
|
|
2
|
+
import Check from "../Core/Check.js";
|
|
2
3
|
import defaultValue from "../Core/defaultValue.js";
|
|
3
4
|
import defined from "../Core/defined.js";
|
|
4
5
|
import IonResource from "../Core/IonResource.js";
|
|
5
6
|
import GoogleMaps from "../Core/GoogleMaps.js";
|
|
6
7
|
import Resource from "../Core/Resource.js";
|
|
7
8
|
import oneTimeWarning from "../Core/oneTimeWarning.js";
|
|
8
|
-
import deprecationWarning from "../Core/deprecationWarning.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Creates a {@link Cesium3DTileset} instance for the Google Photorealistic 3D
|
|
@@ -73,13 +73,10 @@ async function createGooglePhotorealistic3DTileset(apiOptions, tilesetOptions) {
|
|
|
73
73
|
);
|
|
74
74
|
|
|
75
75
|
apiOptions = defaultValue(apiOptions, defaultValue.EMPTY_OBJECT);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
);
|
|
81
|
-
apiOptions = { key: apiOptions };
|
|
82
|
-
}
|
|
76
|
+
//>>includeStart('debug', pragmas.debug);
|
|
77
|
+
Check.typeOf.object("apiOptions", apiOptions);
|
|
78
|
+
//>>includeEnd('debug');
|
|
79
|
+
|
|
83
80
|
if (!apiOptions.onlyUsingWithGoogleGeocoder) {
|
|
84
81
|
oneTimeWarning(
|
|
85
82
|
"google-tiles-with-google-geocoder",
|
|
@@ -160,7 +160,7 @@ vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, f
|
|
|
160
160
|
vec2 u = -thisSegmentForwardWC;
|
|
161
161
|
vec2 v = leftWC;
|
|
162
162
|
float sinAngle = abs(u.x * v.y - u.y * v.x);
|
|
163
|
-
expandWidth = clamp(expandWidth / sinAngle, 0.0, width *
|
|
163
|
+
expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 0.5);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;
|
|
@@ -161,7 +161,7 @@ vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, f
|
|
|
161
161
|
vec2 u = -thisSegmentForwardWC;\n\
|
|
162
162
|
vec2 v = leftWC;\n\
|
|
163
163
|
float sinAngle = abs(u.x * v.y - u.y * v.x);\n\
|
|
164
|
-
expandWidth = clamp(expandWidth / sinAngle, 0.0, width *
|
|
164
|
+
expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 0.5);\n\
|
|
165
165
|
}\n\
|
|
166
166
|
\n\
|
|
167
167
|
vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;\n\
|
|
@@ -1134,8 +1134,6 @@ CesiumWidget.prototype._updateCanAnimate = function (isUpdated) {
|
|
|
1134
1134
|
this._clock.canAnimate = isUpdated;
|
|
1135
1135
|
};
|
|
1136
1136
|
|
|
1137
|
-
const boundingSphereScratch = new BoundingSphere();
|
|
1138
|
-
|
|
1139
1137
|
/**
|
|
1140
1138
|
* @private
|
|
1141
1139
|
*/
|
|
@@ -1148,15 +1146,15 @@ CesiumWidget.prototype._onTick = function (clock) {
|
|
|
1148
1146
|
}
|
|
1149
1147
|
|
|
1150
1148
|
const entityView = this._entityView;
|
|
1151
|
-
if (defined(entityView)) {
|
|
1149
|
+
if (defined(entityView) && defined(entityView.boundingSphere)) {
|
|
1152
1150
|
const trackedEntity = this._trackedEntity;
|
|
1153
1151
|
const trackedState = this._dataSourceDisplay.getBoundingSphere(
|
|
1154
1152
|
trackedEntity,
|
|
1155
|
-
|
|
1156
|
-
|
|
1153
|
+
false,
|
|
1154
|
+
entityView.boundingSphere,
|
|
1157
1155
|
);
|
|
1158
1156
|
if (trackedState === BoundingSphereState.DONE) {
|
|
1159
|
-
entityView.update(time,
|
|
1157
|
+
entityView.update(time, entityView.boundingSphere);
|
|
1160
1158
|
}
|
|
1161
1159
|
}
|
|
1162
1160
|
};
|
|
@@ -1414,6 +1412,8 @@ CesiumWidget.prototype._postRender = function () {
|
|
|
1414
1412
|
updateTrackedEntity(this);
|
|
1415
1413
|
};
|
|
1416
1414
|
|
|
1415
|
+
const zoomTargetBoundingSphereScratch = new BoundingSphere();
|
|
1416
|
+
|
|
1417
1417
|
function updateZoomTarget(widget) {
|
|
1418
1418
|
const target = widget._zoomTarget;
|
|
1419
1419
|
if (!defined(target) || widget.scene.mode === SceneMode.MORPHING) {
|
|
@@ -1511,13 +1511,15 @@ function updateZoomTarget(widget) {
|
|
|
1511
1511
|
const state = widget._dataSourceDisplay.getBoundingSphere(
|
|
1512
1512
|
entities[i],
|
|
1513
1513
|
false,
|
|
1514
|
-
|
|
1514
|
+
zoomTargetBoundingSphereScratch,
|
|
1515
1515
|
);
|
|
1516
1516
|
|
|
1517
1517
|
if (state === BoundingSphereState.PENDING) {
|
|
1518
1518
|
return;
|
|
1519
1519
|
} else if (state !== BoundingSphereState.FAILED) {
|
|
1520
|
-
boundingSpheres.push(
|
|
1520
|
+
boundingSpheres.push(
|
|
1521
|
+
BoundingSphere.clone(zoomTargetBoundingSphereScratch),
|
|
1522
|
+
);
|
|
1521
1523
|
}
|
|
1522
1524
|
}
|
|
1523
1525
|
|
|
@@ -1552,6 +1554,8 @@ function updateZoomTarget(widget) {
|
|
|
1552
1554
|
}
|
|
1553
1555
|
}
|
|
1554
1556
|
|
|
1557
|
+
const trackedEntityBoundingSphereScratch = new BoundingSphere();
|
|
1558
|
+
|
|
1555
1559
|
function updateTrackedEntity(widget) {
|
|
1556
1560
|
if (!widget._needTrackedEntityUpdate) {
|
|
1557
1561
|
return;
|
|
@@ -1577,7 +1581,7 @@ function updateTrackedEntity(widget) {
|
|
|
1577
1581
|
const state = widget._dataSourceDisplay.getBoundingSphere(
|
|
1578
1582
|
trackedEntity,
|
|
1579
1583
|
false,
|
|
1580
|
-
|
|
1584
|
+
trackedEntityBoundingSphereScratch,
|
|
1581
1585
|
);
|
|
1582
1586
|
if (state === BoundingSphereState.PENDING) {
|
|
1583
1587
|
return;
|
|
@@ -1599,7 +1603,9 @@ function updateTrackedEntity(widget) {
|
|
|
1599
1603
|
}
|
|
1600
1604
|
|
|
1601
1605
|
const bs =
|
|
1602
|
-
state !== BoundingSphereState.FAILED
|
|
1606
|
+
state !== BoundingSphereState.FAILED
|
|
1607
|
+
? trackedEntityBoundingSphereScratch
|
|
1608
|
+
: undefined;
|
|
1603
1609
|
widget._entityView = new EntityView(trackedEntity, scene, scene.ellipsoid);
|
|
1604
1610
|
widget._entityView.update(currentTime, bs);
|
|
1605
1611
|
widget._needTrackedEntityUpdate = false;
|
|
@@ -295,11 +295,11 @@ function decodePointCloud(parameters) {
|
|
|
295
295
|
function decodePrimitive(parameters) {
|
|
296
296
|
const dracoDecoder = new draco.Decoder();
|
|
297
297
|
|
|
298
|
-
// Skip all parameter types except generic
|
|
299
|
-
const attributesToSkip = ["POSITION", "NORMAL", "COLOR", "TEX_COORD"];
|
|
300
298
|
if (parameters.dequantizeInShader) {
|
|
301
|
-
for (let i = 0; i <
|
|
302
|
-
dracoDecoder.SkipAttributeTransform(
|
|
299
|
+
for (let i = 0; i < parameters.attributesToSkipTransform.length; ++i) {
|
|
300
|
+
dracoDecoder.SkipAttributeTransform(
|
|
301
|
+
draco[parameters.attributesToSkipTransform[i]],
|
|
302
|
+
);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
|