@cesium/engine 25.0.0 → 26.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 (187) hide show
  1. package/Build/Workers/{chunk-GPIGURCG.js → chunk-3VFEWOBI.js} +7 -7
  2. package/Build/Workers/{chunk-BTX2NL3P.js → chunk-424RNO3D.js} +18 -18
  3. package/Build/Workers/{chunk-HSVQATK2.js → chunk-4MGMYHOO.js} +6 -6
  4. package/Build/Workers/{chunk-FIBS5S7R.js → chunk-4S7IE3LB.js} +2 -2
  5. package/Build/Workers/{chunk-A7ZBMVFS.js → chunk-52JDLOEM.js} +14 -14
  6. package/Build/Workers/{chunk-ZCCIIBZT.js → chunk-54I6Y66F.js} +6 -6
  7. package/Build/Workers/{chunk-J647NNZW.js → chunk-6YEE6JDR.js} +6 -6
  8. package/Build/Workers/{chunk-HVMG6AG4.js → chunk-7J2HKPRH.js} +9 -9
  9. package/Build/Workers/{chunk-K6NFIRFB.js → chunk-7WM2PX4V.js} +5 -5
  10. package/Build/Workers/{chunk-3LSD7OOA.js → chunk-ACXQXN46.js} +16 -16
  11. package/Build/Workers/{chunk-CZ23Y3RM.js → chunk-AYKR4VBR.js} +2 -2
  12. package/Build/Workers/{chunk-4MTRQFJP.js → chunk-C6J67V5A.js} +1 -1
  13. package/Build/Workers/{chunk-WTQGE7Q6.js → chunk-C6KNZ7T4.js} +17 -17
  14. package/Build/Workers/{chunk-AWFZHD2B.js → chunk-CFQP6LYM.js} +4 -4
  15. package/Build/Workers/{chunk-ST2UWDUU.js → chunk-CXOYE2WM.js} +5 -5
  16. package/Build/Workers/{chunk-H2A4USJR.js → chunk-CZEYZU4N.js} +10 -10
  17. package/Build/Workers/{chunk-DFEI5MAV.js → chunk-DBOEKL43.js} +7 -7
  18. package/Build/Workers/{chunk-A7A433MD.js → chunk-DDWSZVMY.js} +5 -5
  19. package/Build/Workers/{chunk-J7KQEKPK.js → chunk-DOBXCNC3.js} +13 -13
  20. package/Build/Workers/{chunk-URUCCIPS.js → chunk-E7VQ76KE.js} +6 -6
  21. package/Build/Workers/{chunk-ZAPOS52G.js → chunk-EBSIOBXY.js} +8 -8
  22. package/Build/Workers/{chunk-3VDDRF2E.js → chunk-EF2QYXGA.js} +14 -14
  23. package/Build/Workers/{chunk-WN6P5UDH.js → chunk-EPYXRCDB.js} +12 -12
  24. package/Build/Workers/{chunk-EZARA5FJ.js → chunk-F6QDY6HU.js} +13 -13
  25. package/Build/Workers/{chunk-GL7DNVUS.js → chunk-FRQZECAO.js} +5 -5
  26. package/Build/Workers/{chunk-VQKLRBIK.js → chunk-G7PXZRVF.js} +7 -7
  27. package/Build/Workers/{chunk-4QQXGTCE.js → chunk-INUEEEQA.js} +8 -8
  28. package/Build/Workers/{chunk-ITD2IN7N.js → chunk-IRBKFCEJ.js} +2 -2
  29. package/Build/Workers/{chunk-6SDGQI27.js → chunk-IYOUHCZB.js} +1 -1
  30. package/Build/Workers/{chunk-DYT5NR6P.js → chunk-J6BWOHUF.js} +3 -3
  31. package/Build/Workers/{chunk-4GF4MVPY.js → chunk-KFSTQKNM.js} +7 -7
  32. package/Build/Workers/{chunk-4XXHJI6Y.js → chunk-KKOSKAZB.js} +17 -17
  33. package/Build/Workers/{chunk-WC57YYBN.js → chunk-KSSWJIZW.js} +2 -2
  34. package/Build/Workers/{chunk-5T6QQAJW.js → chunk-M3B5JKSM.js} +1 -1
  35. package/Build/Workers/{chunk-QO2CGXMP.js → chunk-MPZHGZU6.js} +6 -6
  36. package/Build/Workers/{chunk-WUBKZFF6.js → chunk-MYP774IS.js} +9 -9
  37. package/Build/Workers/{chunk-WNN5D4W3.js → chunk-O3EA5HS7.js} +10 -10
  38. package/Build/Workers/{chunk-77RL3MBD.js → chunk-P3CK7MCY.js} +25 -4
  39. package/Build/Workers/{chunk-QXNQQYPV.js → chunk-Q3PY526V.js} +8 -8
  40. package/Build/Workers/{chunk-CKQP3DSS.js → chunk-QN67VG36.js} +6 -6
  41. package/Build/Workers/{chunk-ACFFCHHZ.js → chunk-QRWGUWI6.js} +11 -11
  42. package/Build/Workers/{chunk-LH5SF3XV.js → chunk-S4MCOY6I.js} +5 -5
  43. package/Build/Workers/{chunk-FVLVVOBQ.js → chunk-SMQZZOW6.js} +10 -10
  44. package/Build/Workers/{chunk-TA777BGS.js → chunk-TKKIREQ6.js} +1 -1
  45. package/Build/Workers/{chunk-AEAVLYPS.js → chunk-U3ZA64U7.js} +2 -2
  46. package/Build/Workers/{chunk-7LSFAEWF.js → chunk-UA25D5MX.js} +10 -10
  47. package/Build/Workers/{chunk-J3OFS2RD.js → chunk-UOOIQ3KX.js} +12 -12
  48. package/Build/Workers/{chunk-ND3NTTOF.js → chunk-V7VQKN6N.js} +6 -6
  49. package/Build/Workers/{chunk-I3A6DXYZ.js → chunk-VQYETPWC.js} +4 -4
  50. package/Build/Workers/{chunk-35H3UBIO.js → chunk-VWV2IJRB.js} +11 -11
  51. package/Build/Workers/{chunk-QSDY4NS7.js → chunk-XZMBNNDX.js} +9 -9
  52. package/Build/Workers/{chunk-TAI4HLII.js → chunk-Y57HREW5.js} +4 -4
  53. package/Build/Workers/{chunk-3TKLDHV3.js → chunk-Y5BF6AFU.js} +2 -2
  54. package/Build/Workers/{chunk-3XY3MVPG.js → chunk-YLY7NKAB.js} +4 -4
  55. package/Build/Workers/{chunk-BVAIWR7O.js → chunk-ZK3CF7ZD.js} +12 -12
  56. package/Build/Workers/{chunk-DH26SNAB.js → chunk-ZP7JMQV4.js} +1 -1
  57. package/Build/Workers/{chunk-3RFFPH4M.js → chunk-ZZ46LWL6.js} +1 -1
  58. package/Build/Workers/combineGeometry.js +24 -24
  59. package/Build/Workers/createBoxGeometry.js +18 -18
  60. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  61. package/Build/Workers/createCircleGeometry.js +26 -26
  62. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  63. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  64. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  65. package/Build/Workers/createCorridorGeometry.js +29 -29
  66. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  67. package/Build/Workers/createCylinderGeometry.js +20 -20
  68. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  69. package/Build/Workers/createEllipseGeometry.js +26 -26
  70. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  71. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  72. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  73. package/Build/Workers/createFrustumGeometry.js +18 -18
  74. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  75. package/Build/Workers/createGeometry.js +24 -24
  76. package/Build/Workers/createGroundPolylineGeometry.js +22 -22
  77. package/Build/Workers/createPlaneGeometry.js +16 -16
  78. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  79. package/Build/Workers/createPolygonGeometry.js +32 -32
  80. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  81. package/Build/Workers/createPolylineGeometry.js +25 -25
  82. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  83. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  84. package/Build/Workers/createRectangleGeometry.js +27 -27
  85. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  86. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  87. package/Build/Workers/createSphereGeometry.js +19 -19
  88. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  89. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  90. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  91. package/Build/Workers/createVectorTileGeometries.js +24 -24
  92. package/Build/Workers/createVectorTilePoints.js +13 -13
  93. package/Build/Workers/createVectorTilePolygons.js +22 -22
  94. package/Build/Workers/createVectorTilePolylines.js +14 -14
  95. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  96. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
  97. package/Build/Workers/createVerticesFromHeightmap.js +22 -22
  98. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  99. package/Build/Workers/createWallGeometry.js +24 -24
  100. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  101. package/Build/Workers/decodeDraco.js +10 -10
  102. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  103. package/Build/Workers/decodeI3S.js +10 -10
  104. package/Build/Workers/gaussianSplatSorter.js +4 -4
  105. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  106. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  107. package/Build/Workers/transcodeKTX2.js +6 -6
  108. package/Build/Workers/transferTypedArrayTest.js +1 -1
  109. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
  110. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  111. package/Source/Core/Cartesian2.js +1 -1
  112. package/Source/Core/Cartesian3.js +1 -1
  113. package/Source/Core/Cartesian4.js +1 -1
  114. package/Source/Core/ComponentDatatype.js +35 -0
  115. package/Source/Core/Ion.js +1 -1
  116. package/Source/Core/MapProjection.js +1 -0
  117. package/Source/Core/Matrix2.js +1 -1
  118. package/Source/Core/Matrix3.js +1 -1
  119. package/Source/Core/Matrix4.js +1 -1
  120. package/Source/Core/Resource.js +1 -1
  121. package/Source/Core/ScreenSpaceEventHandler.js +51 -41
  122. package/Source/Core/createColorRamp.js +37 -0
  123. package/Source/Core/globalTypes.js +25 -0
  124. package/Source/Renderer/Pass.js +3 -2
  125. package/Source/Renderer/createUniform.js +346 -239
  126. package/Source/Renderer/createUniformArray.js +494 -381
  127. package/Source/Scene/ArcGisMapService.js +1 -1
  128. package/Source/Scene/BufferPoint.js +1 -0
  129. package/Source/Scene/BufferPointCollection.js +14 -1
  130. package/Source/Scene/BufferPolygon.js +3 -2
  131. package/Source/Scene/BufferPolygonCollection.js +10 -0
  132. package/Source/Scene/BufferPolyline.js +1 -0
  133. package/Source/Scene/BufferPolylineCollection.js +2 -0
  134. package/Source/Scene/BufferPrimitiveCollection.js +79 -28
  135. package/Source/Scene/CameraEventAggregator.js +30 -18
  136. package/Source/Scene/Cesium3DTile.js +54 -1
  137. package/Source/Scene/Cesium3DTileContent.js +195 -254
  138. package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
  139. package/Source/Scene/Cesium3DTileset.js +45 -5
  140. package/Source/Scene/Composite3DTileContent.js +254 -292
  141. package/Source/Scene/EdgeDisplayMode.js +50 -0
  142. package/Source/Scene/Empty3DTileContent.js +100 -132
  143. package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
  144. package/Source/Scene/GeoJsonPrimitive.js +874 -0
  145. package/Source/Scene/Geometry3DTileContent.js +151 -185
  146. package/Source/Scene/GltfLoader.js +109 -0
  147. package/Source/Scene/Implicit3DTileContent.js +179 -214
  148. package/Source/Scene/MVTDataProvider.js +147 -0
  149. package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +79 -311
  150. package/Source/Scene/Model/Model.js +34 -0
  151. package/Source/Scene/Model/Model3DTileContent.js +424 -458
  152. package/Source/Scene/Model/ModelDrawCommand.js +31 -3
  153. package/Source/Scene/Model/ModelUtility.js +4 -0
  154. package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +466 -150
  155. package/Source/Scene/ModelComponents.js +39 -1
  156. package/Source/Scene/Multiple3DTileContent.js +291 -334
  157. package/Source/Scene/Scene.js +26 -0
  158. package/Source/Scene/Tileset3DTileContent.js +113 -146
  159. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +499 -0
  160. package/Source/Scene/Vector3DTileContent.js +205 -234
  161. package/Source/Scene/VectorGltf3DTileContent.js +85 -36
  162. package/Source/Scene/VoxelPrimitive.js +159 -175
  163. package/Source/Scene/VoxelProvider.js +64 -91
  164. package/Source/Scene/buildVectorGltfFromMVT.js +1059 -0
  165. package/Source/Scene/buildVoxelCustomShader.js +199 -0
  166. package/Source/Scene/decodeMVT.js +634 -0
  167. package/Source/Scene/renderBufferPointCollection.js +110 -64
  168. package/Source/Scene/renderBufferPolygonCollection.js +102 -55
  169. package/Source/Scene/renderBufferPolylineCollection.js +365 -166
  170. package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
  171. package/Source/Shaders/BufferPointMaterialFS.js +1 -0
  172. package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
  173. package/Source/Shaders/BufferPointMaterialVS.js +20 -10
  174. package/Source/Shaders/BufferPolygonMaterialVS.glsl +13 -4
  175. package/Source/Shaders/BufferPolygonMaterialVS.js +14 -5
  176. package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
  177. package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
  178. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
  179. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
  180. package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
  181. package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
  182. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
  183. package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
  184. package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
  185. package/index.d.ts +253 -35
  186. package/index.js +71 -62
  187. package/package.json +2 -2
@@ -4,7 +4,7 @@ import Resource from "../Core/Resource.js";
4
4
 
5
5
  let defaultTokenCredit;
6
6
  const defaultAccessToken =
7
- "AAPTarorp_WgBbyDABMqDfNsSWg..ykf3buvvbFduVL73NrRrnqBR8lO4ndPrO94nF7-3rfUWF5n3sbUe2Xe0d4rhAGa-sOTDpE-AI5kom4O4ixK3QFkTnjaGpFtDOxyrPXZUj1vRmsZAaIMZlzC5TWfBDr-RYeD9NCRMq8JwaP2Fp9blpXTqYVCWpENJLiCJ3pUlQ7XSrnJYNlPwph4B3k1FAK_j3DTlLDd2xbHwcMRbVYq8iJqt7vGuWHw3otSkmltdnNAgMaVQ366Rf0YUAT1_Hbd2aXK9";
7
+ "AAPTauP-rqeCeHTtrSMga9XbPxQ..ZMIZzf1tcwicoJi5E5T2mG0EO3qlIRkQNe5S-uA95RJKU0YkrwOT0AF-lSIyXXBFakDJIPaxsZ5vpnzlaW3kCYG2Tk53bY6OntMqn1EBYtDPyqz38iM4NU_bbDN3DuxUdkxYDWnxJXxxWe3bEeUANbvhKK76PU7N0wjZgtEYHYocspYXSHxbCEYo_eXrHDkrWpgkzcmQ3WpQqf2XprJ39pbqVSZbxskDh3zBm92XxUaiSmdf7rC1w3VoAT1_UarLJfAQ";
8
8
  /**
9
9
  * Default options for accessing the ArcGIS image tile service.
10
10
  *
@@ -123,6 +123,7 @@ class BufferPoint extends BufferPrimitive {
123
123
  collection._positionView[vertexOffset * 3 + 1] = position.y;
124
124
  collection._positionView[vertexOffset * 3 + 2] = position.z;
125
125
 
126
+ this._dirty = true;
126
127
  collection._makeDirtyBoundingVolume();
127
128
  }
128
129
 
@@ -7,6 +7,9 @@ import Frozen from "../Core/Frozen.js";
7
7
  import renderPoints from "./renderBufferPointCollection.js";
8
8
  import BufferPointMaterial from "./BufferPointMaterial.js";
9
9
 
10
+ /** @import BlendOption from "./BlendOption.js"; */
11
+ /** @import BoundingSphere from "../Core/BoundingSphere.js"; */
12
+ /** @import ComponentDatatype from "../Core/ComponentDatatype.js"; */
10
13
  /** @import Matrix4 from "../Core/Matrix4.js"; */
11
14
  /** @import FrameState from "./FrameState.js"; */
12
15
 
@@ -55,10 +58,18 @@ import BufferPointMaterial from "./BufferPointMaterial.js";
55
58
  class BufferPointCollection extends BufferPrimitiveCollection {
56
59
  /**
57
60
  * @param {object} options
61
+ * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] Transforms geometry from model to world coordinates.
58
62
  * @param {number} [options.primitiveCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
63
+ * @param {ComponentDatatype} [options.positionDatatype=ComponentDatatype.DOUBLE]
64
+ * @param {boolean} [options.positionNormalized=false]
59
65
  * @param {boolean} [options.show=true]
66
+ * @param {boolean} [options.allowPicking=false] When <code>true</code>, primitives are pickable with {@link Scene#pick}. When <code>false</code>, memory and initialization cost are lower.
67
+ * @param {BoundingSphere} [options.boundingVolume] Bounding volume, in world space, for the collection. When
68
+ * unspecified, a bounding volume is computed automatically and updated when primitive positions change. When
69
+ * specified, users are responsible for updating bounding volume as needed. Pre-computing the bounding volume
70
+ * manually, and updating it only as needed, will improve performance for larger dynamic collections.
60
71
  * @param {boolean} [options.debugShowBoundingVolume=false]
61
- * @param {boolean} [options.allowPicking=false]
72
+ * @param {BlendOption} [options.blendOption=BlendOption.TRANSLUCENT]
62
73
  */
63
74
  constructor(options = Frozen.EMPTY_OBJECT) {
64
75
  super({ ...options, vertexCountMax: options.primitiveCountMax });
@@ -88,6 +99,8 @@ class BufferPointCollection extends BufferPrimitiveCollection {
88
99
  static _cloneEmpty(collection) {
89
100
  return new BufferPointCollection({
90
101
  primitiveCountMax: collection.primitiveCountMax,
102
+ positionDatatype: collection.positionDatatype,
103
+ positionNormalized: collection.positionNormalized,
91
104
  });
92
105
  }
93
106
 
@@ -180,6 +180,7 @@ class BufferPolygon extends BufferPrimitive {
180
180
  positionView[(vertexOffset + i) * 3 + 2] = positions[i * 3 + 2];
181
181
  }
182
182
 
183
+ this._dirty = true;
183
184
  collection._makeDirtyBoundingVolume();
184
185
  }
185
186
 
@@ -308,7 +309,7 @@ class BufferPolygon extends BufferPrimitive {
308
309
  holeIndexView[holeOffset + i] = holes[i];
309
310
  }
310
311
 
311
- collection._makeDirtyBoundingVolume();
312
+ this._dirty = true;
312
313
  }
313
314
 
314
315
  /**
@@ -489,7 +490,7 @@ class BufferPolygon extends BufferPrimitive {
489
490
  dstIndices[(triangleOffset + i) * 3 + 2] = indices[i * 3 + 2];
490
491
  }
491
492
 
492
- collection._makeDirtyBoundingVolume();
493
+ this._dirty = true;
493
494
  }
494
495
 
495
496
  /////////////////////////////////////////////////////////////////////////////
@@ -9,6 +9,8 @@ import IndexDatatype from "../Core/IndexDatatype.js";
9
9
  import renderPolygons from "./renderBufferPolygonCollection.js";
10
10
  import BufferPolygonMaterial from "./BufferPolygonMaterial.js";
11
11
 
12
+ /** @import BlendOption from "./BlendOption.js"; */
13
+ /** @import BoundingSphere from "../Core/BoundingSphere.js"; */
12
14
  /** @import { TypedArray } from "../Core/globalTypes.js"; */
13
15
  /** @import Matrix4 from "../Core/Matrix4.js"; */
14
16
  /** @import FrameState from "./FrameState.js" */
@@ -80,9 +82,15 @@ class BufferPolygonCollection extends BufferPrimitiveCollection {
80
82
  * @param {number} [options.holeCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
81
83
  * @param {number} [options.triangleCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
82
84
  * @param {ComponentDatatype} [options.positionDatatype=ComponentDatatype.DOUBLE]
85
+ * @param {boolean} [options.positionNormalized=false]
83
86
  * @param {boolean} [options.show=true]
84
87
  * @param {boolean} [options.allowPicking=true] When <code>true</code>, primitives are pickable with {@link Scene#pick}. When <code>false</code>, memory and initialization cost are lower.
88
+ * @param {BoundingSphere} [options.boundingVolume] Bounding volume, in world space, for the collection. When
89
+ * unspecified, a bounding volume is computed automatically and updated when primitive positions change. When
90
+ * specified, users are responsible for updating bounding volume as needed. Pre-computing the bounding volume
91
+ * manually, and updating it only as needed, will improve performance for larger dynamic collections.
85
92
  * @param {boolean} [options.debugShowBoundingVolume=false]
93
+ * @param {BlendOption} [options.blendOption=BlendOption.TRANSLUCENT]
86
94
  */
87
95
  constructor(options = Frozen.EMPTY_OBJECT) {
88
96
  super(options);
@@ -225,6 +233,8 @@ class BufferPolygonCollection extends BufferPrimitiveCollection {
225
233
  vertexCountMax: collection.vertexCountMax,
226
234
  holeCountMax: collection.holeCountMax,
227
235
  triangleCountMax: collection.triangleCountMax,
236
+ positionDatatype: collection.positionDatatype,
237
+ positionNormalized: collection.positionNormalized,
228
238
  });
229
239
  }
230
240
 
@@ -160,6 +160,7 @@ class BufferPolyline extends BufferPrimitive {
160
160
  positionView[(vertexOffset + i) * 3 + 2] = positions[i * 3 + 2];
161
161
  }
162
162
 
163
+ this._dirty = true;
163
164
  collection._makeDirtyBoundingVolume();
164
165
  }
165
166
 
@@ -82,6 +82,8 @@ class BufferPolylineCollection extends BufferPrimitiveCollection {
82
82
  return new BufferPolylineCollection({
83
83
  primitiveCountMax: collection.primitiveCountMax,
84
84
  vertexCountMax: collection.vertexCountMax,
85
+ positionDatatype: collection.positionDatatype,
86
+ positionNormalized: collection.positionNormalized,
85
87
  });
86
88
  }
87
89
 
@@ -9,8 +9,11 @@ import assert from "../Core/assert.js";
9
9
  import ComponentDatatype from "../Core/ComponentDatatype.js";
10
10
  import defined from "../Core/defined.js";
11
11
  import Check from "../Core/Check.js";
12
+ import AttributeCompression from "../Core/AttributeCompression.js";
12
13
  import SceneMode from "./SceneMode.js";
14
+ import AttributeType from "./AttributeType.js";
13
15
  import oneTimeWarning from "../Core/oneTimeWarning.js";
16
+ import BlendOption from "../Scene/BlendOption.js";
14
17
 
15
18
  /** @import { Destroyable, TypedArray, TypedArrayConstructor } from "../Core/globalTypes.js"; */
16
19
  /** @import Context from "../Renderer/Context.js"; */
@@ -74,8 +77,16 @@ class BufferPrimitiveCollection {
74
77
  * @param {number} [options.vertexCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
75
78
  * @param {boolean} [options.show=true]
76
79
  * @param {ComponentDatatype} [options.positionDatatype=ComponentDatatype.DOUBLE]
80
+ * @param {boolean} [options.positionNormalized=false] When <code>true</code>, integer position values are treated as normalized,
81
+ * where the full integer range maps to [-1, 1] (signed) or [0, 1] (unsigned). Only relevant for integer position datatypes
82
+ * (BYTE, UNSIGNED_BYTE, SHORT, UNSIGNED_SHORT).
77
83
  * @param {boolean} [options.allowPicking=false] When <code>true</code>, primitives are pickable with {@link Scene#pick}. When <code>false</code>, memory and initialization cost are lower.
84
+ * @param {BoundingSphere} [options.boundingVolume] Bounding volume, in world space, for the collection. When
85
+ * unspecified, a bounding volume is computed automatically and updated when primitive positions change. When
86
+ * specified, users are responsible for updating bounding volume as needed. Pre-computing the bounding volume
87
+ * manually, and updating it only as needed, will improve performance for larger dynamic collections.
78
88
  * @param {boolean} [options.debugShowBoundingVolume=false]
89
+ * @param {BlendOption} [options.blendOption=BlendOption.TRANSLUCENT]
79
90
  */
80
91
  constructor(options = Frozen.EMPTY_OBJECT) {
81
92
  /**
@@ -86,6 +97,15 @@ class BufferPrimitiveCollection {
86
97
  this.show = options.show ?? true;
87
98
 
88
99
  /**
100
+ * Collection blend option; must be OPAQUE or TRANSLUCENT.
101
+ * @type {BlendOption}
102
+ * @readonly
103
+ * @ignore
104
+ */
105
+ this._blendOption = options.blendOption ?? BlendOption.TRANSLUCENT;
106
+
107
+ /**
108
+ * Transforms geometry from model to world coordinates.
89
109
  * @type {Matrix4}
90
110
  * @default Matrix4.IDENTITY
91
111
  * @readonly
@@ -98,14 +118,17 @@ class BufferPrimitiveCollection {
98
118
  * @readonly
99
119
  * @protected
100
120
  */
101
- this._boundingVolume = new BoundingSphere();
121
+ this._boundingVolume = BoundingSphere.clone(
122
+ options.boundingVolume ?? new BoundingSphere(),
123
+ new BoundingSphere(),
124
+ );
102
125
 
103
126
  /**
104
- * @type {BoundingSphere}
127
+ * @type {boolean}
105
128
  * @readonly
106
129
  * @protected
107
130
  */
108
- this._boundingVolumeWC = new BoundingSphere();
131
+ this._boundingVolumeAutoUpdate = !defined(options.boundingVolume);
109
132
 
110
133
  /**
111
134
  * When <code>true</code>, primitives are pickable with {@link Scene#pick}.
@@ -183,6 +206,21 @@ class BufferPrimitiveCollection {
183
206
  */
184
207
  this._positionView = null;
185
208
 
209
+ /**
210
+ * @type {ComponentDatatype}
211
+ * @ignore
212
+ */
213
+ this._positionDatatype =
214
+ options.positionDatatype ?? ComponentDatatype.DOUBLE;
215
+
216
+ /**
217
+ * When <code>true</code>, integer position values represent normalized floats
218
+ * in [-1, 1] (signed) or [0, 1] (unsigned). Only applicable to integer datatypes.
219
+ * @type {boolean}
220
+ * @ignore
221
+ */
222
+ this._positionNormalized = options.positionNormalized ?? false;
223
+
186
224
  /**
187
225
  * @type {DataView<ArrayBuffer>}
188
226
  * @ignore
@@ -212,9 +250,7 @@ class BufferPrimitiveCollection {
212
250
  this._dirtyBoundingVolume = false;
213
251
 
214
252
  this._allocatePrimitiveBuffer();
215
- this._allocatePositionBuffer(
216
- options.positionDatatype ?? ComponentDatatype.DOUBLE,
217
- );
253
+ this._allocatePositionBuffer();
218
254
  this._allocateMaterialBuffer();
219
255
  }
220
256
 
@@ -267,14 +303,13 @@ class BufferPrimitiveCollection {
267
303
  }
268
304
 
269
305
  /**
270
- * @param {ComponentDatatype} datatype
271
306
  * @private
272
307
  * @ignore
273
308
  */
274
- _allocatePositionBuffer(datatype) {
275
- // @ts-expect-error Requires https://github.com/CesiumGS/cesium/pull/13203.
309
+ _allocatePositionBuffer() {
310
+ // @ts-expect-error https://github.com/CesiumGS/cesium/issues/13420
276
311
  this._positionView = ComponentDatatype.createTypedArray(
277
- datatype,
312
+ this._positionDatatype,
278
313
  this._positionCountMax * 3,
279
314
  );
280
315
  }
@@ -471,16 +506,19 @@ class BufferPrimitiveCollection {
471
506
  * @ignore
472
507
  */
473
508
  _updateBoundingVolume() {
474
- const TypedArray = /** @type {TypedArrayConstructor} */ (
475
- this._positionView.constructor
476
- );
477
-
478
509
  // Exclude unused space in the position buffer.
479
- const vertices = new TypedArray(
480
- /** @type {ArrayBuffer} */ (this._positionView.buffer),
481
- this._positionView.byteOffset,
482
- this._positionCount * 3,
483
- );
510
+ let vertices = this._positionView.subarray(0, this._positionCount * 3);
511
+
512
+ if (this._positionNormalized) {
513
+ vertices = AttributeCompression.dequantize(
514
+ /** @type {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array} */ (
515
+ vertices
516
+ ),
517
+ this._positionDatatype,
518
+ AttributeType.VEC3,
519
+ this._positionCount,
520
+ );
521
+ }
484
522
 
485
523
  BoundingSphere.fromVertices(
486
524
  vertices,
@@ -491,7 +529,7 @@ class BufferPrimitiveCollection {
491
529
  BoundingSphere.transform(
492
530
  this.boundingVolume,
493
531
  this.modelMatrix,
494
- this.boundingVolumeWC,
532
+ this.boundingVolume,
495
533
  );
496
534
  this._dirtyBoundingVolume = false;
497
535
  }
@@ -623,11 +661,14 @@ class BufferPrimitiveCollection {
623
661
  }
624
662
 
625
663
  /**
626
- * Marks collection bounding volume as 'dirty', to be updated on next render.
664
+ * Marks collection bounding volume as 'dirty', to be updated on next render,
665
+ * if automatic bounding volume updates are enabled.
627
666
  * @ignore
628
667
  */
629
668
  _makeDirtyBoundingVolume() {
630
- this._dirtyBoundingVolume = true;
669
+ if (this._boundingVolumeAutoUpdate) {
670
+ this._dirtyBoundingVolume = true;
671
+ }
631
672
  }
632
673
 
633
674
  /////////////////////////////////////////////////////////////////////////////
@@ -724,7 +765,7 @@ class BufferPrimitiveCollection {
724
765
  }
725
766
 
726
767
  /**
727
- * Local bounding volume for all primitives in the collection, including both
768
+ * World-space bounding volume for all primitives in the collection, including both
728
769
  * shown and hidden primitives.
729
770
  * @type {BoundingSphere}
730
771
  * @readonly
@@ -734,13 +775,23 @@ class BufferPrimitiveCollection {
734
775
  }
735
776
 
736
777
  /**
737
- * World bounding volume for all primitives in the collection, including both
738
- * shown and hidden primitives.
739
- * @type {BoundingSphere}
778
+ * The component datatype used to store position values.
779
+ * @type {ComponentDatatype}
780
+ * @readonly
781
+ */
782
+ get positionDatatype() {
783
+ return this._positionDatatype;
784
+ }
785
+
786
+ /**
787
+ * When <code>true</code>, integer position values are treated as normalized
788
+ * values, where the full integer range maps to [-1, 1] (signed) or [0, 1]
789
+ * (unsigned).
790
+ * @type {boolean}
740
791
  * @readonly
741
792
  */
742
- get boundingVolumeWC() {
743
- return this._boundingVolumeWC;
793
+ get positionNormalized() {
794
+ return this._positionNormalized;
744
795
  }
745
796
 
746
797
  /////////////////////////////////////////////////////////////////////////////
@@ -8,12 +8,29 @@ import ScreenSpaceEventHandler from "../Core/ScreenSpaceEventHandler.js";
8
8
  import ScreenSpaceEventType from "../Core/ScreenSpaceEventType.js";
9
9
  import CameraEventType from "./CameraEventType.js";
10
10
 
11
- function getKey(type, modifier) {
12
- let key = `${type}`;
13
- if (defined(modifier)) {
14
- key += `+${modifier}`;
11
+ const keyboardModifierCombinations = [
12
+ KeyboardEventModifier.SHIFT,
13
+ KeyboardEventModifier.CTRL,
14
+ KeyboardEventModifier.ALT,
15
+ [KeyboardEventModifier.SHIFT, KeyboardEventModifier.CTRL],
16
+ [KeyboardEventModifier.SHIFT, KeyboardEventModifier.ALT],
17
+ [KeyboardEventModifier.CTRL, KeyboardEventModifier.ALT],
18
+ [
19
+ KeyboardEventModifier.SHIFT,
20
+ KeyboardEventModifier.CTRL,
21
+ KeyboardEventModifier.ALT,
22
+ ],
23
+ ];
24
+
25
+ function getKey(type, modifiers) {
26
+ if (!defined(modifiers)) {
27
+ return `${type}`;
15
28
  }
16
- return key;
29
+
30
+ const modifierList = Array.isArray(modifiers)
31
+ ? modifiers.toSorted()
32
+ : [modifiers];
33
+ return `${type}+${modifierList.join("+")}`;
17
34
  }
18
35
 
19
36
  function clonePinchMovement(pinchMovement, result) {
@@ -219,7 +236,7 @@ function listenMouseButtonDownUp(aggregator, modifier, type) {
219
236
  aggregator._eventHandler.setInputAction(
220
237
  function () {
221
238
  cancelMouseDownAction(getKey(type, undefined), aggregator);
222
- for (const modifier of Object.values(KeyboardEventModifier)) {
239
+ for (const modifier of keyboardModifierCombinations) {
223
240
  const cancelKey = getKey(type, modifier);
224
241
  cancelMouseDownAction(cancelKey, aggregator);
225
242
  }
@@ -382,18 +399,13 @@ function CameraEventAggregator(canvas) {
382
399
  listenMouseButtonDownUp(this, undefined, CameraEventType.MIDDLE_DRAG);
383
400
  listenMouseMove(this, undefined);
384
401
 
385
- for (const modifierName in KeyboardEventModifier) {
386
- if (KeyboardEventModifier.hasOwnProperty(modifierName)) {
387
- const modifier = KeyboardEventModifier[modifierName];
388
- if (defined(modifier)) {
389
- listenToWheel(this, modifier);
390
- listenToPinch(this, modifier, canvas);
391
- listenMouseButtonDownUp(this, modifier, CameraEventType.LEFT_DRAG);
392
- listenMouseButtonDownUp(this, modifier, CameraEventType.RIGHT_DRAG);
393
- listenMouseButtonDownUp(this, modifier, CameraEventType.MIDDLE_DRAG);
394
- listenMouseMove(this, modifier);
395
- }
396
- }
402
+ for (const modifiers of keyboardModifierCombinations) {
403
+ listenToWheel(this, modifiers);
404
+ listenToPinch(this, modifiers, canvas);
405
+ listenMouseButtonDownUp(this, modifiers, CameraEventType.LEFT_DRAG);
406
+ listenMouseButtonDownUp(this, modifiers, CameraEventType.RIGHT_DRAG);
407
+ listenMouseButtonDownUp(this, modifiers, CameraEventType.MIDDLE_DRAG);
408
+ listenMouseMove(this, modifiers);
397
409
  }
398
410
  }
399
411
 
@@ -1232,6 +1232,16 @@ async function processArrayBuffer(
1232
1232
  return;
1233
1233
  }
1234
1234
 
1235
+ if (isEmptyTile(tile, error)) {
1236
+ if (expired) {
1237
+ tile.expireDate = undefined;
1238
+ }
1239
+ tile._content = new Empty3DTileContent(tileset, tile);
1240
+ markTileAsEmptyContent(tile);
1241
+ tile._contentState = Cesium3DTileContentState.PROCESSING;
1242
+ return tile._content;
1243
+ }
1244
+
1235
1245
  tile._contentState = Cesium3DTileContentState.FAILED;
1236
1246
  throw error;
1237
1247
  }
@@ -1264,6 +1274,9 @@ async function processArrayBuffer(
1264
1274
  }
1265
1275
 
1266
1276
  tile._content = content;
1277
+ if (content instanceof Empty3DTileContent) {
1278
+ markTileAsEmptyContent(tile);
1279
+ }
1267
1280
  tile._contentState = Cesium3DTileContentState.PROCESSING;
1268
1281
 
1269
1282
  return content;
@@ -1316,6 +1329,35 @@ function requestSingleContent(tile) {
1316
1329
  return processArrayBuffer(tile, tileset, request, expired, promise);
1317
1330
  }
1318
1331
 
1332
+ /**
1333
+ * Determines whether a tile load error should be interpreted as "no content"
1334
+ * (empty tile) rather than a true failure. A missing tile policy specifies
1335
+ * HTTP Status Codes to be interpreted as "no content", allowing tiles to be
1336
+ * statically hosted without generating and serving unnecessary content for
1337
+ * empty tiles.
1338
+ * @ignore
1339
+ */
1340
+ function isEmptyTile(tile, error) {
1341
+ const tileset = tile._tileset;
1342
+ const policy = tileset?._runtimeContentCodec?.missingTilePolicy;
1343
+ if (!defined(policy)) {
1344
+ return false;
1345
+ }
1346
+
1347
+ if (!defined(error.statusCode)) {
1348
+ return false;
1349
+ }
1350
+ return policy.statusCodes.includes(error.statusCode);
1351
+ }
1352
+
1353
+ function markTileAsEmptyContent(tile) {
1354
+ // These flags are mutable instance state initialized in the constructor.
1355
+ tile.hasEmptyContent = true;
1356
+ tile.hasRenderableContent = false;
1357
+ }
1358
+
1359
+ Cesium3DTile._isEmptyTile = isEmptyTile;
1360
+
1319
1361
  /**
1320
1362
  * Given a downloaded content payload, construct a {@link Cesium3DTileContent}.
1321
1363
  * <p>
@@ -1328,10 +1370,21 @@ function requestSingleContent(tile) {
1328
1370
  * @private
1329
1371
  */
1330
1372
  async function makeContent(tile, arrayBuffer) {
1373
+ const tileset = tile._tileset;
1374
+ const codec = tileset?._runtimeContentCodec;
1375
+ if (defined(codec) && typeof codec.createContent === "function") {
1376
+ const content = await Promise.resolve(
1377
+ codec.createContent(tileset, tile, tile._contentResource, arrayBuffer),
1378
+ );
1379
+ if (tile.isDestroyed()) {
1380
+ return;
1381
+ }
1382
+ return content;
1383
+ }
1384
+
1331
1385
  const preprocessed = preprocess3DTileContent(arrayBuffer);
1332
1386
 
1333
1387
  // Vector and Geometry tile rendering do not support the skip LOD optimization.
1334
- const tileset = tile._tileset;
1335
1388
  tileset._disableSkipLevelOfDetail =
1336
1389
  tileset._disableSkipLevelOfDetail ||
1337
1390
  preprocessed.contentType === Cesium3DTileContentType.GEOMETRY ||