@cesium/engine 13.0.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.
Files changed (150) hide show
  1. package/Build/Workers/{chunk-BZMHXDKV.js → chunk-3JBEPBPL.js} +13 -13
  2. package/Build/Workers/{chunk-W2E67GLE.js → chunk-3LYROPON.js} +13 -13
  3. package/Build/Workers/{chunk-3ZMTG4X5.js → chunk-3PIZQT3I.js} +4 -4
  4. package/Build/Workers/{chunk-Q4MTXEB7.js → chunk-3QLSKXKF.js} +6 -6
  5. package/Build/Workers/{chunk-EXDSJZ7J.js → chunk-4CHMVQTQ.js} +4 -4
  6. package/Build/Workers/{chunk-2TSF7N76.js → chunk-5KWRW7YL.js} +2 -2
  7. package/Build/Workers/{chunk-KRCUHV7P.js → chunk-5S5OOA6U.js} +1 -1
  8. package/Build/Workers/{chunk-MSKD73KW.js → chunk-77XPS7ZA.js} +10 -10
  9. package/Build/Workers/{chunk-2IIE2UZ3.js → chunk-7EO56M5R.js} +2 -2
  10. package/Build/Workers/{chunk-H7BML7HH.js → chunk-7UHKH6M3.js} +6 -6
  11. package/Build/Workers/{chunk-KCCTLUKK.js → chunk-7ZB2RVIQ.js} +10 -10
  12. package/Build/Workers/{chunk-OUIF26MQ.js → chunk-B4GSRXE3.js} +6 -6
  13. package/Build/Workers/{chunk-D3VPMNUR.js → chunk-CI2HEJFC.js} +13 -13
  14. package/Build/Workers/{chunk-Z7OYBX6P.js → chunk-D7ZBZPHV.js} +5 -5
  15. package/Build/Workers/{chunk-GJZQSAES.js → chunk-DT5NFR5C.js} +7 -7
  16. package/Build/Workers/{chunk-ZIWULRRD.js → chunk-ED6GLQTK.js} +1 -1
  17. package/Build/Workers/{chunk-CQDSGG3R.js → chunk-EWDGNOJE.js} +7 -7
  18. package/Build/Workers/{chunk-RGZWZ4PP.js → chunk-F4CUH4MR.js} +4 -4
  19. package/Build/Workers/{chunk-6HWW6KNV.js → chunk-FFBJDW4A.js} +6 -6
  20. package/Build/Workers/{chunk-FLPIQK2R.js → chunk-FX4R4MTH.js} +6 -6
  21. package/Build/Workers/{chunk-2OD54CUD.js → chunk-FYGLNDKG.js} +7 -7
  22. package/Build/Workers/{chunk-YDEZMDB7.js → chunk-G3BVMPWG.js} +2 -2
  23. package/Build/Workers/{chunk-YBDL7YPF.js → chunk-HEZHXDYB.js} +1 -1
  24. package/Build/Workers/{chunk-RIQGQMS4.js → chunk-HKHQ3EDR.js} +4 -4
  25. package/Build/Workers/{chunk-PMNQULFU.js → chunk-HUFQVUMY.js} +7 -7
  26. package/Build/Workers/{chunk-6ZOS2ACR.js → chunk-J7IH4EYI.js} +7 -7
  27. package/Build/Workers/{chunk-RR4M3ZGF.js → chunk-JHBPC4LK.js} +7 -7
  28. package/Build/Workers/{chunk-WXJY6NDI.js → chunk-JPDKYBLF.js} +13 -13
  29. package/Build/Workers/{chunk-W2DVQETH.js → chunk-K4AH3TDT.js} +35 -21
  30. package/Build/Workers/{chunk-S4SCKDK4.js → chunk-KHWLAQVA.js} +1 -1
  31. package/Build/Workers/{chunk-XQP37R5E.js → chunk-KM6MITPF.js} +5 -5
  32. package/Build/Workers/{chunk-H4Y7ADFL.js → chunk-KSYBJA4M.js} +5 -5
  33. package/Build/Workers/{chunk-3VHIUS7I.js → chunk-LJBJM6VI.js} +6 -6
  34. package/Build/Workers/{chunk-MMILY4S7.js → chunk-LNSWJ43X.js} +11 -11
  35. package/Build/Workers/{chunk-CUMDCSMT.js → chunk-LOZ4NKY3.js} +11 -11
  36. package/Build/Workers/{chunk-4IM6WQEI.js → chunk-LS3KVHYY.js} +6 -6
  37. package/Build/Workers/{chunk-GBXJIWAZ.js → chunk-MVM4JV5U.js} +9 -9
  38. package/Build/Workers/{chunk-HMMPNR4Z.js → chunk-N2XAJBC6.js} +12 -12
  39. package/Build/Workers/{chunk-FANORJU6.js → chunk-OMXHEJTK.js} +2 -2
  40. package/Build/Workers/{chunk-GNG3V432.js → chunk-PWF4EY5P.js} +4 -4
  41. package/Build/Workers/{chunk-KKVKSTWC.js → chunk-Q4ZVWJXX.js} +5 -5
  42. package/Build/Workers/{chunk-RC5N5SJL.js → chunk-SDIDRZDG.js} +7 -7
  43. package/Build/Workers/{chunk-BLTSMJIP.js → chunk-TVL3F7IU.js} +1 -1
  44. package/Build/Workers/{chunk-22NU5WU5.js → chunk-TY4DKOWR.js} +2 -2
  45. package/Build/Workers/{chunk-DIAH2ZTB.js → chunk-VCNOFQYH.js} +9 -9
  46. package/Build/Workers/{chunk-BFNZUP2C.js → chunk-WEHZP4SE.js} +14 -13
  47. package/Build/Workers/{chunk-PD2MCNV7.js → chunk-WVNLSTOF.js} +2 -2
  48. package/Build/Workers/{chunk-T5H7YWC7.js → chunk-XK4OP6VA.js} +17 -17
  49. package/Build/Workers/{chunk-NVFEDMX4.js → chunk-YJX7X577.js} +15 -15
  50. package/Build/Workers/{chunk-4HS475MU.js → chunk-Z3QWTHI7.js} +14 -14
  51. package/Build/Workers/{chunk-OZZD3VY4.js → chunk-ZGFIT57T.js} +17 -17
  52. package/Build/Workers/{chunk-JISDBAYP.js → chunk-ZMNLEL6W.js} +5 -5
  53. package/Build/Workers/combineGeometry.js +22 -22
  54. package/Build/Workers/createBoxGeometry.js +16 -16
  55. package/Build/Workers/createBoxOutlineGeometry.js +14 -14
  56. package/Build/Workers/createCircleGeometry.js +24 -24
  57. package/Build/Workers/createCircleOutlineGeometry.js +17 -17
  58. package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
  59. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
  60. package/Build/Workers/createCorridorGeometry.js +27 -27
  61. package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
  62. package/Build/Workers/createCylinderGeometry.js +18 -18
  63. package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
  64. package/Build/Workers/createEllipseGeometry.js +24 -24
  65. package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
  66. package/Build/Workers/createEllipsoidGeometry.js +17 -17
  67. package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
  68. package/Build/Workers/createFrustumGeometry.js +16 -16
  69. package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
  70. package/Build/Workers/createGeometry.js +22 -22
  71. package/Build/Workers/createGroundPolylineGeometry.js +20 -20
  72. package/Build/Workers/createPlaneGeometry.js +14 -14
  73. package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
  74. package/Build/Workers/createPolygonGeometry.js +30 -30
  75. package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
  76. package/Build/Workers/createPolylineGeometry.js +23 -23
  77. package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
  78. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
  79. package/Build/Workers/createRectangleGeometry.js +25 -25
  80. package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
  81. package/Build/Workers/createSimplePolylineGeometry.js +21 -21
  82. package/Build/Workers/createSphereGeometry.js +17 -17
  83. package/Build/Workers/createSphereOutlineGeometry.js +16 -16
  84. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  85. package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
  86. package/Build/Workers/createVectorTileGeometries.js +22 -22
  87. package/Build/Workers/createVectorTilePoints.js +12 -12
  88. package/Build/Workers/createVectorTilePolygons.js +20 -20
  89. package/Build/Workers/createVectorTilePolylines.js +13 -13
  90. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
  91. package/Build/Workers/createVerticesFromHeightmap.js +20 -20
  92. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
  93. package/Build/Workers/createWallGeometry.js +22 -22
  94. package/Build/Workers/createWallOutlineGeometry.js +21 -21
  95. package/Build/Workers/decodeDraco.js +15 -14
  96. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  97. package/Build/Workers/decodeI3S.js +10 -10
  98. package/Build/Workers/transcodeKTX2.js +7 -7
  99. package/Build/Workers/transferTypedArrayTest.js +1 -1
  100. package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
  101. package/Source/Core/Check.d.ts +2 -1
  102. package/Source/Core/Color.js +3 -3
  103. package/Source/Core/Credit.js +3 -3
  104. package/Source/Core/DistanceDisplayCondition.js +3 -3
  105. package/Source/Core/ITwinPlatform.js +3 -38
  106. package/Source/Core/Ion.js +1 -1
  107. package/Source/Core/JulianDate.js +14 -7
  108. package/Source/Core/OrientedBoundingBox.js +2 -2
  109. package/Source/Core/Spherical.js +3 -3
  110. package/Source/Core/defined.d.ts +11 -0
  111. package/Source/Core/writeTextToCanvas.js +0 -1
  112. package/Source/DataSources/BoundingSphereState.js +3 -3
  113. package/Source/DataSources/DataSourceClock.js +1 -1
  114. package/Source/DataSources/DataSourceDisplay.js +5 -2
  115. package/Source/DataSources/ModelGraphics.js +23 -1
  116. package/Source/DataSources/ModelVisualizer.js +22 -1
  117. package/Source/Renderer/AutomaticUniforms.js +2 -2
  118. package/Source/Scene/ArcGisMapService.js +1 -1
  119. package/Source/Scene/Billboard.js +1 -1
  120. package/Source/Scene/Cesium3DTile.js +56 -28
  121. package/Source/Scene/Cesium3DTilesVoxelProvider.js +17 -0
  122. package/Source/Scene/Cesium3DTileset.js +1 -1
  123. package/Source/Scene/ClippingPolygon.js +2 -2
  124. package/Source/Scene/DynamicEnvironmentMapManager.js +123 -66
  125. package/Source/Scene/GltfDracoLoader.js +45 -0
  126. package/Source/Scene/GltfIndexBufferLoader.js +5 -0
  127. package/Source/Scene/GltfLoader.js +17 -2
  128. package/Source/Scene/GltfVertexBufferLoader.js +13 -0
  129. package/Source/Scene/ITwinData.js +116 -0
  130. package/Source/Scene/ImageryLayer.js +1 -1
  131. package/Source/Scene/Label.js +1 -1
  132. package/Source/Scene/LabelCollection.js +0 -11
  133. package/Source/Scene/Model/Model.js +1 -1
  134. package/Source/Scene/Multiple3DTileContent.js +21 -8
  135. package/Source/Scene/PointPrimitive.js +1 -1
  136. package/Source/Scene/ResourceCache.js +17 -1
  137. package/Source/Scene/VoxelPrimitive.js +124 -0
  138. package/Source/Scene/VoxelProvider.js +10 -0
  139. package/Source/Scene/VoxelTraversal.js +88 -12
  140. package/Source/Scene/WebMapTileServiceImageryProvider.js +2 -2
  141. package/Source/Scene/createGooglePhotorealistic3DTileset.js +5 -8
  142. package/Source/Shaders/DepthPlaneVS.glsl +1 -1
  143. package/Source/Shaders/DepthPlaneVS.js +1 -1
  144. package/Source/Shaders/PolylineCommon.glsl +1 -1
  145. package/Source/Shaders/PolylineCommon.js +1 -1
  146. package/Source/Widget/CesiumWidget.js +16 -10
  147. package/Source/Workers/decodeDraco.js +4 -4
  148. package/index.d.ts +178 -42
  149. package/index.js +247 -247
  150. package/package.json +1 -1
@@ -107,8 +107,8 @@ Spherical.normalize = function (spherical, result) {
107
107
  /**
108
108
  * Returns true if the first spherical is equal to the second spherical, false otherwise.
109
109
  *
110
- * @param {Spherical} left The first Spherical to be compared.
111
- * @param {Spherical} right The second Spherical to be compared.
110
+ * @param {Spherical} [left] The first Spherical to be compared.
111
+ * @param {Spherical} [right] The second Spherical to be compared.
112
112
  * @returns {boolean} true if the first spherical is equal to the second spherical, false otherwise.
113
113
  */
114
114
  Spherical.equals = function (left, right) {
@@ -145,7 +145,7 @@ Spherical.equalsEpsilon = function (left, right, epsilon) {
145
145
  /**
146
146
  * Returns true if this spherical is equal to the provided spherical, false otherwise.
147
147
  *
148
- * @param {Spherical} other The Spherical to be compared.
148
+ * @param {Spherical} [other] The Spherical to be compared.
149
149
  * @returns {boolean} true if this spherical is equal to the provided spherical, false otherwise.
150
150
  */
151
151
  Spherical.prototype.equals = function (other) {
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @example
3
+ * if (Cesium.defined(positions)) {
4
+ * doSomething();
5
+ * } else {
6
+ * doSomethingElse();
7
+ * }
8
+ * @param value - The object.
9
+ * @returns Returns true if the object is defined, returns false otherwise.
10
+ */
11
+ export default function defined<Type>(value: Type): value is NonNullable<Type>;
@@ -104,7 +104,6 @@ let imageSmoothingEnabledName;
104
104
  * @param {string} text The text to write.
105
105
  * @param {object} [options] Object with the following properties:
106
106
  * @param {string} [options.font='10px sans-serif'] The CSS font to use.
107
- * @param {string} [options.textBaseline='bottom'] The baseline of the text.
108
107
  * @param {boolean} [options.fill=true] Whether to fill the text.
109
108
  * @param {boolean} [options.stroke=false] Whether to stroke the text.
110
109
  * @param {Color} [options.fillColor=Color.WHITE] The fill color.
@@ -3,7 +3,7 @@
3
3
  * @enum {number}
4
4
  * @private
5
5
  */
6
- const BoundingSphereState = {
6
+ const BoundingSphereState = Object.freeze({
7
7
  /**
8
8
  * The BoundingSphere has been computed.
9
9
  * @type BoundingSphereState
@@ -22,5 +22,5 @@ const BoundingSphereState = {
22
22
  * @constant
23
23
  */
24
24
  FAILED: 2,
25
- };
26
- export default Object.freeze(BoundingSphereState);
25
+ });
26
+ export default BoundingSphereState;
@@ -108,7 +108,7 @@ DataSourceClock.prototype.clone = function (result) {
108
108
  /**
109
109
  * Returns true if this DataSourceClock is equivalent to the other
110
110
  *
111
- * @param {DataSourceClock} other The other DataSourceClock to compare to.
111
+ * @param {DataSourceClock} [other] The other DataSourceClock to compare to.
112
112
  * @returns {boolean} <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>.
113
113
  */
114
114
  DataSourceClock.prototype.equals = function (other) {
@@ -330,7 +330,10 @@ DataSourceDisplay.prototype.update = function (time) {
330
330
  if (!this._ready && result) {
331
331
  this._scene.requestRender();
332
332
  }
333
- this._ready = result;
333
+
334
+ // once the DataSourceDisplay is ready it should stay ready to prevent
335
+ // entities from breaking updates when they become "un-ready"
336
+ this._ready = this._ready || result;
334
337
 
335
338
  return result;
336
339
  };
@@ -386,7 +389,7 @@ DataSourceDisplay.prototype.getBoundingSphere = function (
386
389
  Check.defined("result", result);
387
390
  //>>includeEnd('debug');
388
391
 
389
- if (!this._ready && !allowPartial) {
392
+ if (!this._ready) {
390
393
  return BoundingSphereState.PENDING;
391
394
  }
392
395
 
@@ -18,6 +18,10 @@ function createArticulationStagePropertyBag(value) {
18
18
  return new PropertyBag(value);
19
19
  }
20
20
 
21
+ function createEnvironmentMapPropertyBag(value) {
22
+ return new PropertyBag(value);
23
+ }
24
+
21
25
  /**
22
26
  * @typedef {object} ModelGraphics.ConstructorOptions
23
27
  *
@@ -40,6 +44,7 @@ function createArticulationStagePropertyBag(value) {
40
44
  * @property {Property | ColorBlendMode} [colorBlendMode=ColorBlendMode.HIGHLIGHT] An enum Property specifying how the color blends with the model.
41
45
  * @property {Property | number} [colorBlendAmount=0.5] A numeric Property specifying the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.
42
46
  * @property {Property | Cartesian2} [imageBasedLightingFactor=new Cartesian2(1.0, 1.0)] A property specifying the contribution from diffuse and specular image-based lighting.
47
+ * @property {PropertyBag | Object<string, *>} [environmentMapOptions] The properties for managing dynamic environment maps on this entity.
43
48
  * @property {Property | Color} [lightColor] A property specifying the light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
44
49
  * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this model will be displayed.
45
50
  * @property {PropertyBag | Object<string, TranslationRotationScale>} [nodeTransformations] An object, where keys are names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.
@@ -101,6 +106,8 @@ function ModelGraphics(options) {
101
106
  this._colorBlendAmountSubscription = undefined;
102
107
  this._imageBasedLightingFactor = undefined;
103
108
  this._imageBasedLightingFactorSubscription = undefined;
109
+ this._environmentMapOptions = undefined;
110
+ this._environmentMapOptionsSubscription = undefined;
104
111
  this._lightColor = undefined;
105
112
  this._lightColorSubscription = undefined;
106
113
  this._distanceDisplayCondition = undefined;
@@ -279,6 +286,17 @@ Object.defineProperties(ModelGraphics.prototype, {
279
286
  "imageBasedLightingFactor",
280
287
  ),
281
288
 
289
+ /**
290
+ * Gets or sets the {@link DynamicEnvironmentMapManager.ConstructorOptions} to apply to this model. This is represented as an {@link PropertyBag}.
291
+ * @memberof ModelGraphics.prototype
292
+ * @type {PropertyBag}
293
+ */
294
+ environmentMapOptions: createPropertyDescriptor(
295
+ "environmentMapOptions",
296
+ undefined,
297
+ createEnvironmentMapPropertyBag,
298
+ ),
299
+
282
300
  /**
283
301
  * A property specifying the {@link Cartesian3} light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
284
302
  * @memberOf ModelGraphics.prototype
@@ -361,6 +379,7 @@ ModelGraphics.prototype.clone = function (result) {
361
379
  result.colorBlendMode = this.colorBlendMode;
362
380
  result.colorBlendAmount = this.colorBlendAmount;
363
381
  result.imageBasedLightingFactor = this.imageBasedLightingFactor;
382
+ result.environmentMapOptions = this.environmentMapOptions;
364
383
  result.lightColor = this.lightColor;
365
384
  result.distanceDisplayCondition = this.distanceDisplayCondition;
366
385
  result.nodeTransformations = this.nodeTransformations;
@@ -430,7 +449,10 @@ ModelGraphics.prototype.merge = function (source) {
430
449
  this.imageBasedLightingFactor,
431
450
  source.imageBasedLightingFactor,
432
451
  );
433
-
452
+ this.environmentMapOptions = defaultValue(
453
+ this.environmentMapOptions,
454
+ source.environmentMapOptions,
455
+ );
434
456
  this.lightColor = defaultValue(this.lightColor, source.lightColor);
435
457
  this.distanceDisplayCondition = defaultValue(
436
458
  this.distanceDisplayCondition,
@@ -35,6 +35,9 @@ const defaultColor = Color.WHITE;
35
35
  const defaultColorBlendMode = ColorBlendMode.HIGHLIGHT;
36
36
  const defaultColorBlendAmount = 0.5;
37
37
  const defaultImageBasedLightingFactor = new Cartesian2(1.0, 1.0);
38
+ const defaultEnvironmentMapOptions = {
39
+ maximumPositionEpsilon: Number.POSITIVE_INFINITY,
40
+ };
38
41
 
39
42
  const modelMatrixScratch = new Matrix4();
40
43
  const nodeMatrixScratch = new Matrix4();
@@ -76,6 +79,7 @@ async function createModelPrimitive(
76
79
  entity,
77
80
  resource,
78
81
  incrementallyLoadTextures,
82
+ environmentMapOptions,
79
83
  ) {
80
84
  const primitives = visualizer._primitives;
81
85
  const modelHash = visualizer._modelHash;
@@ -85,6 +89,7 @@ async function createModelPrimitive(
85
89
  url: resource,
86
90
  incrementallyLoadTextures: incrementallyLoadTextures,
87
91
  scene: visualizer._scene,
92
+ environmentMapOptions: environmentMapOptions,
88
93
  });
89
94
 
90
95
  if (visualizer.isDestroyed() || !defined(modelHash[entity.id])) {
@@ -176,6 +181,9 @@ ModelVisualizer.prototype.update = function (time) {
176
181
  articulationsScratch: {},
177
182
  loadFailed: false,
178
183
  modelUpdated: false,
184
+ environmentMapOptionsScratch: {
185
+ ...defaultEnvironmentMapOptions,
186
+ },
179
187
  };
180
188
  modelHash[entity.id] = modelData;
181
189
 
@@ -185,7 +193,20 @@ ModelVisualizer.prototype.update = function (time) {
185
193
  defaultIncrementallyLoadTextures,
186
194
  );
187
195
 
188
- createModelPrimitive(this, entity, resource, incrementallyLoadTextures);
196
+ const environmentMapOptions = Property.getValueOrDefault(
197
+ modelGraphics._environmentMapOptions,
198
+ time,
199
+ defaultEnvironmentMapOptions,
200
+ modelData.environmentMapOptionsScratch,
201
+ );
202
+
203
+ createModelPrimitive(
204
+ this,
205
+ entity,
206
+ resource,
207
+ incrementallyLoadTextures,
208
+ environmentMapOptions,
209
+ );
189
210
  }
190
211
 
191
212
  const model = modelData.modelPrimitive;
@@ -1488,11 +1488,11 @@ const AutomaticUniforms = {
1488
1488
  *
1489
1489
  * @example
1490
1490
  * // GLSL declaration
1491
- * uniform sampler2D czm_specularEnvironmentMaps;
1491
+ * uniform samplerCube czm_specularEnvironmentMaps;
1492
1492
  */
1493
1493
  czm_specularEnvironmentMaps: new AutomaticUniform({
1494
1494
  size: 1,
1495
- datatype: WebGLConstants.SAMPLER_2D,
1495
+ datatype: WebGLConstants.SAMPLER_CUBE,
1496
1496
  getValue: function (uniformState) {
1497
1497
  return uniformState.specularEnvironmentMaps;
1498
1498
  },
@@ -4,7 +4,7 @@ import Resource from "../Core/Resource.js";
4
4
 
5
5
  let defaultTokenCredit;
6
6
  const defaultAccessToken =
7
- "AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmSrZYLHFXe7j_lQcsSJKc8-7rwh0IFSNWLGZErkzXRnYjMjURTz-hGiKMEeAJIZBG7uiYEn0Mt1rrwlJGIpirZQC4iO428519DlO3QC9DnRBqLXGTBhirgoU7-Z2209sy87s49kw6NOC8_Eew6nCLf-pZ883DRPRyAYH7LC8cvRLInud0EdndtUFa4y83TamrA.AT1_ahjrWDrq";
7
+ "AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmQqcRjhPIHVEibuj83EgmzqMYMKlkDSXfDI_aVhgS53pQJj5gRndVO3co_eEvHb0zzYJdeBjDAW2_64bW-L6Me4YVq47D8LJswKSJVELWk4g6f3TB8wprt9QrTkB6DlBRIpV-G3oRFCspR8Muj3QGzKWMs-USdfAtfId0Yum55vSTjE2ssMyIRfiNOZaCEpVcs.AT1_aIa2UGdx";
8
8
  /**
9
9
  * Default options for accessing the ArcGIS image tile service.
10
10
  *
@@ -1562,7 +1562,7 @@ Billboard.getScreenSpaceBoundingBox = function (
1562
1562
  * Determines if this billboard equals another billboard. Billboards are equal if all their properties
1563
1563
  * are equal. Billboards in different collections can be equal.
1564
1564
  *
1565
- * @param {Billboard} other The billboard to compare for equality.
1565
+ * @param {Billboard} [other] The billboard to compare for equality.
1566
1566
  * @returns {boolean} <code>true</code> if the billboards are equal; otherwise, <code>false</code>.
1567
1567
  */
1568
1568
  Billboard.prototype.equals = function (other) {
@@ -319,6 +319,24 @@ function Cesium3DTile(tileset, baseResource, header, parent) {
319
319
  */
320
320
  this.hasImplicitContent = false;
321
321
 
322
+ /**
323
+ * Determines whether the tile has renderable content.
324
+ *
325
+ * The loading starts with the assumption that the tile does have
326
+ * renderable content, if the content is not empty.<br>
327
+ * <br>
328
+ * This turns <code>false</code> only when the tile content is loaded
329
+ * and turns out to be a single content that points to an external
330
+ * tileset or implicit content
331
+ * </p>
332
+ *
333
+ * @type {boolean}
334
+ * @readonly
335
+ *
336
+ * @private
337
+ */
338
+ this.hasRenderableContent = !hasEmptyContent;
339
+
322
340
  /**
323
341
  * When <code>true</code>, the tile contains content metadata from implicit tiling. This flag is set
324
342
  * for tiles transcoded by <code>Implicit3DTileContent</code>.
@@ -653,27 +671,6 @@ Object.defineProperties(Cesium3DTile.prototype, {
653
671
  },
654
672
  },
655
673
 
656
- /**
657
- * Determines if the tile's content is renderable. <code>false</code> if the
658
- * tile has empty content or if it points to an external tileset or implicit content
659
- *
660
- * @memberof Cesium3DTile.prototype
661
- *
662
- * @type {boolean}
663
- * @readonly
664
- *
665
- * @private
666
- */
667
- hasRenderableContent: {
668
- get: function () {
669
- return (
670
- !this.hasEmptyContent &&
671
- !this.hasTilesetContent &&
672
- !this.hasImplicitContent
673
- );
674
- },
675
- },
676
-
677
674
  /**
678
675
  * Determines if the tile has available content to render. <code>true</code> if the tile's
679
676
  * content is ready or if it has expired content that renders while new content loads; otherwise,
@@ -1346,10 +1343,12 @@ async function makeContent(tile, arrayBuffer) {
1346
1343
  preprocessed.contentType === Cesium3DTileContentType.IMPLICIT_SUBTREE_JSON
1347
1344
  ) {
1348
1345
  tile.hasImplicitContent = true;
1346
+ tile.hasRenderableContent = false;
1349
1347
  }
1350
1348
 
1351
1349
  if (preprocessed.contentType === Cesium3DTileContentType.EXTERNAL_TILESET) {
1352
1350
  tile.hasTilesetContent = true;
1351
+ tile.hasRenderableContent = false;
1353
1352
  }
1354
1353
 
1355
1354
  let content;
@@ -1729,28 +1728,57 @@ function createBoxFromTransformedRegion(
1729
1728
  }
1730
1729
 
1731
1730
  /**
1731
+ * Creates a TileBoundingVolume from the given region and transform
1732
+ * information.
1733
+ *
1734
+ * This may either be a TileBoundingRegion or a TileOrientedBoundingBox.
1735
+ *
1736
+ * If the given transform is the initial transform, then this will return
1737
+ * a TileBoundingRegion. This will either be the given result parameter,
1738
+ * or a new TileBoundingRegion, if the given result parameter was not
1739
+ * a TileBoundingRegion.
1740
+ *
1741
+ * If the given transform deviates from the initial transform, then this
1742
+ * will return a TileOrientedBoundingBox that was computed by applying
1743
+ * the given transform to the given region. This will either be the
1744
+ * given result parameter, or a new TileOrientedBoundingBox, if the given
1745
+ * result parameter was not a TileOrientedBoundingBox
1746
+ *
1732
1747
  * @private
1733
- * @param {Array} region An array of six numbers that define a bounding geographic region in EPSG:4979 coordinates with the order [west, south, east, north, minimum height, maximum height]
1734
- * @param {Matrix4} transform
1735
- * @param {Matrix4} initialTransform
1736
- * @param {TileBoundingVolume} [result]
1737
- * @returns {TileBoundingVolume}
1748
+ * @param {Array} region An array of six numbers that define a bounding
1749
+ * geographic region in EPSG:4979 coordinates with the order
1750
+ * [west, south, east, north, minimum height, maximum height]
1751
+ * @param {Matrix4} transform The current computedTransform of the tile,
1752
+ * which includes the parent transform (which, in turn, includes the
1753
+ * modelMatrix of the containing tileset)
1754
+ * @param {Matrix4} initialTransform The initial transform of the tile,
1755
+ * before any changes to the modelMatrix of the containing tileset
1756
+ * @param {TileBoundingVolume} [result] An optional result.
1757
+ * @returns {TileBoundingVolume} The resulting bounding volume
1738
1758
  */
1739
1759
  function createRegion(region, transform, initialTransform, result) {
1740
1760
  if (
1741
1761
  !Matrix4.equalsEpsilon(transform, initialTransform, CesiumMath.EPSILON8)
1742
1762
  ) {
1763
+ if (result instanceof TileOrientedBoundingBox) {
1764
+ return createBoxFromTransformedRegion(
1765
+ region,
1766
+ transform,
1767
+ initialTransform,
1768
+ result,
1769
+ );
1770
+ }
1743
1771
  return createBoxFromTransformedRegion(
1744
1772
  region,
1745
1773
  transform,
1746
1774
  initialTransform,
1747
- result,
1775
+ undefined,
1748
1776
  );
1749
1777
  }
1750
1778
 
1751
1779
  const rectangleRegion = Rectangle.unpack(region, 0, scratchRectangle);
1752
1780
 
1753
- if (defined(result)) {
1781
+ if (result instanceof TileBoundingRegion) {
1754
1782
  result.rectangle = Rectangle.clone(rectangleRegion, result.rectangle);
1755
1783
  result.minimumHeight = region[4];
1756
1784
  result.maximumHeight = region[5];
@@ -89,10 +89,26 @@ function Cesium3DTilesVoxelProvider(options) {
89
89
  /** @inheritdoc */
90
90
  this.maximumTileCount = undefined;
91
91
 
92
+ this._availableLevels = undefined;
92
93
  this._implicitTileset = undefined;
93
94
  this._subtreeCache = new ImplicitSubtreeCache();
94
95
  }
95
96
 
97
+ Object.defineProperties(Cesium3DTilesVoxelProvider.prototype, {
98
+ /**
99
+ * The number of levels of detail containing available tiles in the tileset.
100
+ *
101
+ * @memberof VoxelPrimitive.prototype
102
+ * @type {number|undefined}
103
+ * @readonly
104
+ */
105
+ availableLevels: {
106
+ get: function () {
107
+ return this._availableLevels;
108
+ },
109
+ },
110
+ });
111
+
96
112
  /**
97
113
  * Creates a {@link VoxelProvider} that fetches voxel data from a 3D Tiles tileset.
98
114
  *
@@ -161,6 +177,7 @@ Cesium3DTilesVoxelProvider.fromUrl = async function (url) {
161
177
  provider.paddingAfter = paddingAfter;
162
178
 
163
179
  provider._implicitTileset = implicitTileset;
180
+ provider._availableLevels = implicitTileset.availableLevels;
164
181
 
165
182
  ResourceCache.unload(schemaLoader);
166
183
 
@@ -105,7 +105,7 @@ import DynamicEnvironmentMapManager from "./DynamicEnvironmentMapManager.js";
105
105
  * @property {object} [pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
106
106
  * @property {Cartesian3} [lightColor] The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
107
107
  * @property {ImageBasedLighting} [imageBasedLighting] The properties for managing image-based lighting for this tileset.
108
- * @param {DynamicEnvironmentMapManager.ConstructorOptions} [options.environmentMapOptions] The properties for managing dynamic environment maps on this model.
108
+ * @property {DynamicEnvironmentMapManager.ConstructorOptions} [environmentMapOptions] The properties for managing dynamic environment maps on this tileset.
109
109
  * @property {boolean} [backFaceCulling=true] Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled.
110
110
  * @property {boolean} [enableShowOutline=true] Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set to false to avoid the additional processing of geometry at load time. When false, the showOutlines and outlineColor options are ignored.
111
111
  * @property {boolean} [showOutline=true] Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.
@@ -117,8 +117,8 @@ ClippingPolygon.clone = function (polygon, result) {
117
117
  * Compares the provided ClippingPolygons and returns
118
118
  * <code>true</code> if they are equal, <code>false</code> otherwise.
119
119
  *
120
- * @param {Plane} left The first polygon.
121
- * @param {Plane} right The second polygon.
120
+ * @param {ClippingPolygon} left The first polygon.
121
+ * @param {ClippingPolygon} right The second polygon.
122
122
  * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
123
123
  */
124
124
  ClippingPolygon.equals = function (left, right) {