@cesium/engine 21.0.1 → 22.1.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 (267) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +10 -7
  2. package/Build/Workers/chunk-23T2IPHV.js +55 -0
  3. package/Build/Workers/{chunk-TGJQMEL4.js → chunk-2AM4E2WD.js} +2 -2
  4. package/Build/Workers/{chunk-4CORGH7N.js → chunk-2MWF4IES.js} +16 -14
  5. package/Build/Workers/{chunk-3RKX3UFI.js → chunk-2RCIRXNI.js} +1 -1
  6. package/Build/Workers/{chunk-LV3G32QE.js → chunk-3YTMGEXW.js} +5 -1424
  7. package/Build/Workers/{chunk-PJAA7QSC.js → chunk-4BHWJWS3.js} +6 -6
  8. package/Build/Workers/{chunk-FE565QHX.js → chunk-5JKH4AMT.js} +2 -2
  9. package/Build/Workers/{chunk-KZ7GDSAJ.js → chunk-6HKAPCSO.js} +1 -1
  10. package/Build/Workers/{chunk-VVALNLSH.js → chunk-A53R2F2L.js} +4 -4
  11. package/Build/Workers/{chunk-KVB73ECP.js → chunk-A6YFUGJO.js} +7 -7
  12. package/Build/Workers/{chunk-QNOIRRJK.js → chunk-AJYWXC6I.js} +4 -4
  13. package/Build/Workers/{chunk-UKA7OISV.js → chunk-AOIO5VUS.js} +282 -2284
  14. package/Build/Workers/{chunk-OBS5EMZ6.js → chunk-B7JRBTT6.js} +10 -10
  15. package/Build/Workers/{chunk-5YXA47QD.js → chunk-CHNDJRYA.js} +20 -18
  16. package/Build/Workers/{chunk-X3ZV3XNO.js → chunk-CJOV55CW.js} +20 -18
  17. package/Build/Workers/{chunk-W6I3LNPF.js → chunk-COGPE5Z2.js} +10 -8
  18. package/Build/Workers/{chunk-2QPH5QDK.js → chunk-CW7W27IZ.js} +14 -10
  19. package/Build/Workers/{chunk-MXOGBWMP.js → chunk-DICY26ID.js} +20 -16
  20. package/Build/Workers/{chunk-W6KMV4F5.js → chunk-DMEFNTUV.js} +69 -7
  21. package/Build/Workers/{chunk-T7HU6E7G.js → chunk-DQSJEOZY.js} +1 -1
  22. package/Build/Workers/{chunk-ASVODZNK.js → chunk-GDU4RZSZ.js} +16 -36
  23. package/Build/Workers/{chunk-MQPDOWGH.js → chunk-GKWOUMYA.js} +1 -1
  24. package/Build/Workers/{chunk-A2SP2EJZ.js → chunk-GTY4K4IA.js} +9 -7
  25. package/Build/Workers/{chunk-KEPPNSBL.js → chunk-H6Q7E4BQ.js} +8 -6
  26. package/Build/Workers/{chunk-JG3C3LPY.js → chunk-HHGOFZVQ.js} +7 -5
  27. package/Build/Workers/chunk-HXKUEOOD.js +352 -0
  28. package/Build/Workers/{chunk-UFSYRVC5.js → chunk-I4REFVXB.js} +4 -4
  29. package/Build/Workers/{chunk-LU7DLY2L.js → chunk-IL5F6WEE.js} +3 -3
  30. package/Build/Workers/{chunk-RVRN4KDB.js → chunk-JKXPC5HD.js} +2 -2
  31. package/Build/Workers/{chunk-CBPNIEGH.js → chunk-KKGD7HAW.js} +13 -11
  32. package/Build/Workers/{chunk-DTKSVIH5.js → chunk-KROSQJUA.js} +2 -2
  33. package/Build/Workers/{chunk-42EJCSIV.js → chunk-L4JLDVCM.js} +5 -5
  34. package/Build/Workers/{chunk-LPKJSIMD.js → chunk-LIYMRHGR.js} +15 -13
  35. package/Build/Workers/{chunk-J2XQVKVH.js → chunk-MKMZHRB3.js} +74 -35
  36. package/Build/Workers/{chunk-CSDYSXBI.js → chunk-MO25ZQ2I.js} +14 -12
  37. package/Build/Workers/{chunk-3YNW5K6O.js → chunk-O6RZEKHZ.js} +12 -12
  38. package/Build/Workers/{chunk-RR3NCT4R.js → chunk-OOCGX2OD.js} +4 -4
  39. package/Build/Workers/{chunk-XG54SG4O.js → chunk-OXFU5HNU.js} +13 -5
  40. package/Build/Workers/{chunk-P2UKEFCK.js → chunk-P5CGIJUY.js} +2 -2
  41. package/Build/Workers/{chunk-DBHL2UVG.js → chunk-QEANVUGT.js} +2 -2
  42. package/Build/Workers/{chunk-2SI7DEW5.js → chunk-QFBCIX7J.js} +8 -6
  43. package/Build/Workers/{chunk-DDXI6UYW.js → chunk-QUAH3XOT.js} +4 -4
  44. package/Build/Workers/{chunk-PZUZCAX3.js → chunk-RXZDTDIY.js} +13 -9
  45. package/Build/Workers/{chunk-YZ3RCE45.js → chunk-SPA2KPH3.js} +14 -12
  46. package/Build/Workers/chunk-TDSVSW5A.js +1460 -0
  47. package/Build/Workers/{chunk-G3CKZ34K.js → chunk-UG2DPFOL.js} +8 -6
  48. package/Build/Workers/{chunk-IKUOV6DO.js → chunk-URGEDZBS.js} +7 -7
  49. package/Build/Workers/{chunk-U2GR5FDL.js → chunk-V35NQOJC.js} +21 -11
  50. package/Build/Workers/chunk-W4XUEDU5.js +2058 -0
  51. package/Build/Workers/chunk-WB4TSSBQ.js +3514 -0
  52. package/Build/Workers/{chunk-EBDZDBJN.js → chunk-WTLYD4FE.js} +19 -15
  53. package/Build/Workers/{chunk-WQZL6CA2.js → chunk-Y4ALZ4SS.js} +9 -7
  54. package/Build/Workers/{chunk-DAJKOQW6.js → chunk-YF2NVO5B.js} +19 -13
  55. package/Build/Workers/{chunk-XJVRYJVZ.js → chunk-YSYSXSHF.js} +1 -1
  56. package/Build/Workers/{chunk-YNOVMSUX.js → chunk-YX562XOB.js} +15 -11
  57. package/Build/Workers/{chunk-J3KPR6DJ.js → chunk-YZWA5B4R.js} +15 -13
  58. package/Build/Workers/{chunk-NYYQZ3LH.js → chunk-Z6DFT4D3.js} +15 -11
  59. package/Build/Workers/combineGeometry.js +24 -21
  60. package/Build/Workers/createBoxGeometry.js +18 -15
  61. package/Build/Workers/createBoxOutlineGeometry.js +16 -13
  62. package/Build/Workers/createCircleGeometry.js +28 -24
  63. package/Build/Workers/createCircleOutlineGeometry.js +21 -17
  64. package/Build/Workers/createCoplanarPolygonGeometry.js +35 -31
  65. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -29
  66. package/Build/Workers/createCorridorGeometry.js +32 -28
  67. package/Build/Workers/createCorridorOutlineGeometry.js +30 -26
  68. package/Build/Workers/createCylinderGeometry.js +20 -17
  69. package/Build/Workers/createCylinderOutlineGeometry.js +20 -16
  70. package/Build/Workers/createEllipseGeometry.js +28 -24
  71. package/Build/Workers/createEllipseOutlineGeometry.js +21 -17
  72. package/Build/Workers/createEllipsoidGeometry.js +19 -16
  73. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -15
  74. package/Build/Workers/createFrustumGeometry.js +18 -15
  75. package/Build/Workers/createFrustumOutlineGeometry.js +18 -15
  76. package/Build/Workers/createGeometry.js +28 -22
  77. package/Build/Workers/createGroundPolylineGeometry.js +25 -21
  78. package/Build/Workers/createPlaneGeometry.js +16 -13
  79. package/Build/Workers/createPlaneOutlineGeometry.js +15 -12
  80. package/Build/Workers/createPolygonGeometry.js +35 -31
  81. package/Build/Workers/createPolygonOutlineGeometry.js +32 -28
  82. package/Build/Workers/createPolylineGeometry.js +27 -23
  83. package/Build/Workers/createPolylineVolumeGeometry.js +33 -29
  84. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +29 -25
  85. package/Build/Workers/createRectangleGeometry.js +30 -26
  86. package/Build/Workers/createRectangleOutlineGeometry.js +23 -19
  87. package/Build/Workers/createSimplePolylineGeometry.js +25 -21
  88. package/Build/Workers/createSphereGeometry.js +19 -16
  89. package/Build/Workers/createSphereOutlineGeometry.js +18 -15
  90. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  91. package/Build/Workers/createVectorTileClampedPolylines.js +16 -13
  92. package/Build/Workers/createVectorTileGeometries.js +24 -21
  93. package/Build/Workers/createVectorTilePoints.js +15 -12
  94. package/Build/Workers/createVectorTilePolygons.js +24 -20
  95. package/Build/Workers/createVectorTilePolylines.js +16 -13
  96. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +91 -0
  97. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +28 -23
  98. package/Build/Workers/createVerticesFromHeightmap.js +28 -23
  99. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -279
  100. package/Build/Workers/createWallGeometry.js +26 -22
  101. package/Build/Workers/createWallOutlineGeometry.js +25 -21
  102. package/Build/Workers/decodeDraco.js +10 -10
  103. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  104. package/Build/Workers/decodeI3S.js +13 -11
  105. package/Build/Workers/gaussianSplatSorter.js +4 -4
  106. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  107. package/Build/Workers/incrementallyBuildTerrainPicker.js +121 -0
  108. package/Build/Workers/transcodeKTX2.js +6 -6
  109. package/Build/Workers/transferTypedArrayTest.js +1 -1
  110. package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -20
  111. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +95 -0
  112. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +2 -2
  113. package/Source/Core/AxisAlignedBoundingBox.js +36 -0
  114. package/Source/Core/Cesium3DTilesTerrainData.js +932 -0
  115. package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +1868 -0
  116. package/Source/Core/Cesium3DTilesTerrainProvider.js +1052 -0
  117. package/Source/Core/CesiumTerrainProvider.js +2 -2
  118. package/Source/Core/Color.js +23 -6
  119. package/Source/Core/EllipsoidalOccluder.js +2 -2
  120. package/Source/Core/FeatureDetection.js +0 -2
  121. package/Source/Core/GoogleEarthEnterpriseMetadata.js +1 -1
  122. package/Source/Core/GoogleEarthEnterpriseTerrainData.js +2 -1
  123. package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -1
  124. package/Source/Core/HeightmapTerrainData.js +12 -22
  125. package/Source/Core/HilbertOrder.js +0 -6
  126. package/Source/Core/ITwinPlatform.js +6 -6
  127. package/Source/Core/IntersectionTests.js +80 -0
  128. package/Source/Core/Ion.js +1 -1
  129. package/Source/Core/IonResource.js +35 -27
  130. package/Source/Core/PixelFormat.js +2 -2
  131. package/Source/Core/QuantizedMeshTerrainData.js +24 -57
  132. package/Source/Core/Resource.js +15 -11
  133. package/Source/Core/S2Cell.js +6 -18
  134. package/Source/Core/TaskProcessor.js +1 -1
  135. package/Source/Core/TerrainData.js +2 -1
  136. package/Source/Core/TerrainEncoding.js +215 -38
  137. package/Source/Core/TerrainMesh.js +215 -8
  138. package/Source/Core/TerrainPicker.js +607 -0
  139. package/Source/Core/TerrainProvider.js +151 -0
  140. package/Source/Core/TexturePacker.js +27 -12
  141. package/Source/Core/Transforms.js +28 -19
  142. package/Source/Core/VRTheWorldTerrainProvider.js +2 -2
  143. package/Source/Core/binarySearch.js +1 -1
  144. package/Source/Core/createWorldBathymetryAsync.js +2 -2
  145. package/Source/Core/createWorldTerrainAsync.js +3 -3
  146. package/Source/Core/loadImageFromTypedArray.js +9 -3
  147. package/Source/Core/mergeSort.js +1 -1
  148. package/Source/DataSources/BillboardGraphics.js +1 -1
  149. package/Source/DataSources/BillboardVisualizer.js +7 -4
  150. package/Source/DataSources/PropertyArray.js +2 -2
  151. package/Source/Renderer/AutomaticUniforms.js +61 -0
  152. package/Source/Renderer/Buffer.js +32 -0
  153. package/Source/Renderer/BufferUsage.js +3 -1
  154. package/Source/Renderer/Context.js +98 -14
  155. package/Source/Renderer/Pass.js +10 -9
  156. package/Source/Renderer/Sync.js +104 -0
  157. package/Source/Renderer/TextureAtlas.js +67 -27
  158. package/Source/Renderer/UniformState.js +12 -0
  159. package/Source/Renderer/VertexArray.js +1 -1
  160. package/Source/Scene/ArcGisMapServerImageryProvider.js +1 -1
  161. package/Source/Scene/ArcGisMapService.js +1 -1
  162. package/Source/Scene/Azure2DImageryProvider.js +99 -13
  163. package/Source/Scene/BatchTable.js +2 -2
  164. package/Source/Scene/Billboard.js +75 -28
  165. package/Source/Scene/BillboardCollection.js +24 -15
  166. package/Source/Scene/BillboardTexture.js +56 -7
  167. package/Source/Scene/BingMapsImageryProvider.js +1 -1
  168. package/Source/Scene/BoundingVolumeSemantics.js +54 -62
  169. package/Source/Scene/Cesium3DTile.js +3 -3
  170. package/Source/Scene/Cesium3DTilesVoxelProvider.js +1 -1
  171. package/Source/Scene/Cesium3DTileset.js +1 -1
  172. package/Source/Scene/EdgeFramebuffer.js +245 -0
  173. package/Source/Scene/FrameState.js +12 -0
  174. package/Source/Scene/GaussianSplat3DTileContent.js +12 -16
  175. package/Source/Scene/GaussianSplatPrimitive.js +12 -8
  176. package/Source/Scene/GaussianSplatSorter.js +2 -2
  177. package/Source/Scene/Globe.js +4 -2
  178. package/Source/Scene/GlobeSurfaceTile.js +28 -70
  179. package/Source/Scene/GlobeSurfaceTileProvider.js +11 -0
  180. package/Source/Scene/GltfBufferViewLoader.js +18 -0
  181. package/Source/Scene/GltfLoader.js +46 -8
  182. package/Source/Scene/Google2DImageryProvider.js +48 -41
  183. package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +1 -1
  184. package/Source/Scene/I3SDataProvider.js +1 -1
  185. package/Source/Scene/I3SDecoder.js +3 -3
  186. package/Source/Scene/ITwinData.js +4 -4
  187. package/Source/Scene/ImageryLayer.js +1 -1
  188. package/Source/Scene/Implicit3DTileContent.js +18 -7
  189. package/Source/Scene/ImplicitSubtree.js +3 -3
  190. package/Source/Scene/ImplicitTileset.js +2 -2
  191. package/Source/Scene/IonImageryProvider.js +15 -84
  192. package/Source/Scene/IonImageryProviderFactory.js +194 -0
  193. package/Source/Scene/LabelCollection.js +54 -36
  194. package/Source/Scene/MetadataComponentType.js +5 -5
  195. package/Source/Scene/MetadataTableProperty.js +3 -9
  196. package/Source/Scene/Model/EdgeDetectionPipelineStage.js +42 -0
  197. package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +800 -0
  198. package/Source/Scene/Model/MetadataPipelineStage.js +7 -7
  199. package/Source/Scene/Model/ModelDrawCommand.js +69 -0
  200. package/Source/Scene/Model/ModelImagery.js +4 -0
  201. package/Source/Scene/Model/ModelRuntimeNode.js +2 -2
  202. package/Source/Scene/Model/ModelRuntimePrimitive.js +13 -2
  203. package/Source/Scene/Model/ModelSceneGraph.js +15 -3
  204. package/Source/Scene/Model/ModelUtility.js +0 -1
  205. package/Source/Scene/Model/NodeRenderResources.js +1 -1
  206. package/Source/Scene/Model/PrimitiveRenderResources.js +1 -1
  207. package/Source/Scene/OIT.js +11 -1
  208. package/Source/Scene/PickFramebuffer.js +134 -50
  209. package/Source/Scene/Picking.js +195 -89
  210. package/Source/Scene/QuadtreePrimitive.js +34 -26
  211. package/Source/Scene/QuadtreeTile.js +66 -46
  212. package/Source/Scene/ResourceLoaderState.js +1 -1
  213. package/Source/Scene/Scene.js +160 -16
  214. package/Source/Scene/ScreenSpaceCameraController.js +1 -1
  215. package/Source/Scene/SensorVolumePortionToDisplay.js +6 -6
  216. package/Source/Scene/SingleTileImageryProvider.js +3 -3
  217. package/Source/Scene/Terrain.js +5 -5
  218. package/Source/Scene/TerrainFillMesh.js +1 -0
  219. package/Source/Scene/TileMapServiceImageryProvider.js +2 -2
  220. package/Source/Scene/UrlTemplateImageryProvider.js +1 -1
  221. package/Source/Scene/View.js +3 -0
  222. package/Source/Scene/VoxelPrimitive.js +196 -189
  223. package/Source/Scene/VoxelShape.js +2 -0
  224. package/Source/Scene/createWorldImageryAsync.js +1 -1
  225. package/Source/Shaders/BillboardCollectionFS.glsl +115 -62
  226. package/Source/Shaders/BillboardCollectionFS.js +115 -63
  227. package/Source/Shaders/BillboardCollectionVS.glsl +44 -37
  228. package/Source/Shaders/BillboardCollectionVS.js +45 -38
  229. package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
  230. package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
  231. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
  232. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
  233. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
  234. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
  235. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.glsl +10 -0
  236. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.js +12 -0
  237. package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
  238. package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
  239. package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
  240. package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
  241. package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
  242. package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
  243. package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
  244. package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
  245. package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
  246. package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
  247. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
  248. package/Source/Shaders/GlobeVS.glsl +1 -1
  249. package/Source/Shaders/GlobeVS.js +1 -1
  250. package/Source/Shaders/Model/EdgeDetectionStageFS.glsl +58 -0
  251. package/Source/Shaders/Model/EdgeDetectionStageFS.js +60 -0
  252. package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +83 -0
  253. package/Source/Shaders/Model/EdgeVisibilityStageFS.js +85 -0
  254. package/Source/Shaders/Model/ModelFS.glsl +5 -0
  255. package/Source/Shaders/Model/ModelFS.js +5 -0
  256. package/Source/Shaders/Model/PrimitiveOutlineStageFS.glsl +0 -1
  257. package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +0 -1
  258. package/Source/Shaders/ShadowVolumeAppearanceFS.glsl +7 -15
  259. package/Source/Shaders/ShadowVolumeAppearanceFS.js +7 -15
  260. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  261. package/Source/ThirdParty/zip-module.wasm +0 -0
  262. package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +46 -0
  263. package/Source/Workers/incrementallyBuildTerrainPicker.js +108 -0
  264. package/Source/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +55 -0
  265. package/index.d.ts +488 -31
  266. package/index.js +202 -190
  267. package/package.json +3 -2
@@ -39,7 +39,7 @@ function LayerInformation(layer) {
39
39
  }
40
40
 
41
41
  /**
42
- * @typedef {Object} CesiumTerrainProvider.ConstructorOptions
42
+ * @typedef {object} CesiumTerrainProvider.ConstructorOptions
43
43
  *
44
44
  * Initialization options for the CesiumTerrainProvider constructor
45
45
  *
@@ -1198,7 +1198,7 @@ CesiumTerrainProvider.fromIonAssetId = async function (assetId, options) {
1198
1198
  * <li> {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/heightmap-1.0 Height Map} </li>
1199
1199
  * </ul>
1200
1200
  *
1201
- * @param {Resource|String|Promise<Resource>|Promise<String>} url The URL of the Cesium terrain server.
1201
+ * @param {Resource|string|Promise<Resource>|Promise<string>} url The URL of the Cesium terrain server.
1202
1202
  * @param {CesiumTerrainProvider.ConstructorOptions} [options] An object describing initialization options.
1203
1203
  * @returns {Promise<CesiumTerrainProvider>}
1204
1204
  *
@@ -679,6 +679,23 @@ Color.prototype.toBytes = function (result) {
679
679
  return result;
680
680
  };
681
681
 
682
+ /**
683
+ * Converts RGBA values in bytes to a single numeric unsigned 32-bit RGBA value, using the endianness
684
+ * of the system.
685
+ *
686
+ * @returns {number} A single numeric unsigned 32-bit RGBA value.
687
+ *
688
+ * @see Color.toRgba
689
+ */
690
+ Color.bytesToRgba = function (red, green, blue, alpha) {
691
+ // scratchUint32Array and scratchUint8Array share an underlying array buffer
692
+ scratchUint8Array[0] = red;
693
+ scratchUint8Array[1] = green;
694
+ scratchUint8Array[2] = blue;
695
+ scratchUint8Array[3] = alpha;
696
+ return scratchUint32Array[0];
697
+ };
698
+
682
699
  /**
683
700
  * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness
684
701
  * of the system.
@@ -692,12 +709,12 @@ Color.prototype.toBytes = function (result) {
692
709
  * @see Color.fromRgba
693
710
  */
694
711
  Color.prototype.toRgba = function () {
695
- // scratchUint32Array and scratchUint8Array share an underlying array buffer
696
- scratchUint8Array[0] = Color.floatToByte(this.red);
697
- scratchUint8Array[1] = Color.floatToByte(this.green);
698
- scratchUint8Array[2] = Color.floatToByte(this.blue);
699
- scratchUint8Array[3] = Color.floatToByte(this.alpha);
700
- return scratchUint32Array[0];
712
+ return Color.bytesToRgba(
713
+ Color.floatToByte(this.red),
714
+ Color.floatToByte(this.green),
715
+ Color.floatToByte(this.blue),
716
+ Color.floatToByte(this.alpha),
717
+ );
701
718
  };
702
719
 
703
720
  /**
@@ -247,7 +247,7 @@ EllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid =
247
247
  * A reasonable direction to use is the direction from the center of the ellipsoid to
248
248
  * the center of the bounding sphere computed from the positions. The direction need not
249
249
  * be normalized.
250
- * @param {number[]} vertices The vertices from which to compute the horizon culling point. The positions
250
+ * @param {number[]|Float32Array|Float64Array} vertices The vertices from which to compute the horizon culling point. The positions
251
251
  * must be expressed in a reference frame centered at the ellipsoid and aligned with the
252
252
  * ellipsoid's axes.
253
253
  * @param {number} [stride=3]
@@ -277,7 +277,7 @@ EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices =
277
277
  * A reasonable direction to use is the direction from the center of the ellipsoid to
278
278
  * the center of the bounding sphere computed from the positions. The direction need not
279
279
  * be normalized.
280
- * @param {number[]} vertices The vertices from which to compute the horizon culling point. The positions
280
+ * @param {number[]|Float32Array|Float64Array} vertices The vertices from which to compute the horizon culling point. The positions
281
281
  * must be expressed in a reference frame centered at the ellipsoid and aligned with the
282
282
  * ellipsoid's axes.
283
283
  * @param {number} [stride=3]
@@ -282,12 +282,10 @@ if (typeof ArrayBuffer !== "undefined") {
282
282
  }
283
283
 
284
284
  if (typeof BigInt64Array !== "undefined") {
285
- // eslint-disable-next-line no-undef
286
285
  typedArrayTypes.push(BigInt64Array);
287
286
  }
288
287
 
289
288
  if (typeof BigUint64Array !== "undefined") {
290
- // eslint-disable-next-line no-undef
291
289
  typedArrayTypes.push(BigUint64Array);
292
290
  }
293
291
  }
@@ -140,7 +140,7 @@ Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype, {
140
140
  * Creates a metadata object using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider
141
141
  * and GoogleEarthEnterpriseTerrainProvider to share metadata requests.
142
142
  *
143
- * @param {Resource|String} resourceOrUrl The url of the Google Earth Enterprise server hosting the imagery.
143
+ * @param {Resource|string} resourceOrUrl The url of the Google Earth Enterprise server hosting the imagery.
144
144
  *
145
145
  * @returns {Promise<GoogleEarthEnterpriseMetadata>} A promise which resolves to the created GoogleEarthEnterpriseMetadata instance/
146
146
  */
@@ -210,6 +210,7 @@ GoogleEarthEnterpriseTerrainData.prototype.createMesh = function (options) {
210
210
  result.vertexCountWithoutSkirts,
211
211
  result.minimumHeight,
212
212
  result.maximumHeight,
213
+ rectangleScratch,
213
214
  BoundingSphere.clone(result.boundingSphere3D),
214
215
  Cartesian3.clone(result.occludeePointInScaledSpace),
215
216
  result.numberOfAttributes,
@@ -380,7 +381,7 @@ GoogleEarthEnterpriseTerrainData.prototype.upsample = function (
380
381
 
381
382
  /**
382
383
  * Determines if a given child tile is available, based on the
383
- * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
384
+ * {@link GoogleEarthEnterpriseTerrainData.childTileMask}. The given child tile coordinates are assumed
384
385
  * to be one of the four children of this tile. If non-child tile coordinates are
385
386
  * given, the availability of the southeast child tile is returned.
386
387
  *
@@ -65,7 +65,7 @@ TerrainCache.prototype.tidy = function () {
65
65
  };
66
66
 
67
67
  /**
68
- * @typedef {Object} GoogleEarthEnterpriseTerrainProvider.ConstructorOptions
68
+ * @typedef {object} GoogleEarthEnterpriseTerrainProvider.ConstructorOptions
69
69
  *
70
70
  * Initialization options for GoogleEarthEnterpriseTerrainProvider constructor
71
71
  *
@@ -94,16 +94,12 @@ import TerrainProvider from "./TerrainProvider.js";
94
94
  * @see GoogleEarthEnterpriseTerrainData
95
95
  */
96
96
  function HeightmapTerrainData(options) {
97
+ options = options ?? Frozen.EMPTY_OBJECT;
98
+
97
99
  //>>includeStart('debug', pragmas.debug);
98
- if (!defined(options) || !defined(options.buffer)) {
99
- throw new DeveloperError("options.buffer is required.");
100
- }
101
- if (!defined(options.width)) {
102
- throw new DeveloperError("options.width is required.");
103
- }
104
- if (!defined(options.height)) {
105
- throw new DeveloperError("options.height is required.");
106
- }
100
+ Check.typeOf.object("options.buffer", options.buffer);
101
+ Check.typeOf.number("options.width", options.width);
102
+ Check.typeOf.number("options.height", options.height);
107
103
  //>>includeEnd('debug');
108
104
 
109
105
  this._buffer = options.buffer;
@@ -158,7 +154,7 @@ Object.defineProperties(HeightmapTerrainData.prototype, {
158
154
  * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
159
155
  * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
160
156
  * @memberof HeightmapTerrainData.prototype
161
- * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement|undefined}
157
+ * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement|ImageBitmap|undefined}
162
158
  */
163
159
  waterMask: {
164
160
  get: function () {
@@ -287,6 +283,7 @@ HeightmapTerrainData.prototype.createMesh = function (options) {
287
283
  vertexCountWithoutSkirts,
288
284
  result.minimumHeight,
289
285
  result.maximumHeight,
286
+ rectangle,
290
287
  BoundingSphere.clone(result.boundingSphere3D),
291
288
  Cartesian3.clone(result.occludeePointInScaledSpace),
292
289
  result.numberOfAttributes,
@@ -393,6 +390,7 @@ HeightmapTerrainData.prototype._createMeshSync = function (options) {
393
390
  vertexCountWithoutSkirts,
394
391
  result.minimumHeight,
395
392
  result.maximumHeight,
393
+ rectangle,
396
394
  result.boundingSphere3D,
397
395
  result.occludeePointInScaledSpace,
398
396
  result.encoding.stride,
@@ -645,18 +643,10 @@ HeightmapTerrainData.prototype.isChildAvailable = function (
645
643
  childY,
646
644
  ) {
647
645
  //>>includeStart('debug', pragmas.debug);
648
- if (!defined(thisX)) {
649
- throw new DeveloperError("thisX is required.");
650
- }
651
- if (!defined(thisY)) {
652
- throw new DeveloperError("thisY is required.");
653
- }
654
- if (!defined(childX)) {
655
- throw new DeveloperError("childX is required.");
656
- }
657
- if (!defined(childY)) {
658
- throw new DeveloperError("childY is required.");
659
- }
646
+ Check.typeOf.number("thisX", thisX);
647
+ Check.typeOf.number("thisY", thisY);
648
+ Check.typeOf.number("childX", childX);
649
+ Check.typeOf.number("childY", childY);
660
650
  //>>includeEnd('debug');
661
651
 
662
652
  let bitNumber = 2; // northwest child
@@ -38,13 +38,11 @@ HilbertOrder.encode2D = function (level, x, y) {
38
38
  let rx,
39
39
  ry,
40
40
  s,
41
- // eslint-disable-next-line no-undef
42
41
  index = BigInt(0);
43
42
 
44
43
  for (s = n / 2; s > 0; s /= 2) {
45
44
  rx = (p.x & s) > 0 ? 1 : 0;
46
45
  ry = (p.y & s) > 0 ? 1 : 0;
47
- // eslint-disable-next-line no-undef
48
46
  index += BigInt(((3 * rx) ^ ry) * s * s);
49
47
  rotate(n, p, rx, ry);
50
48
  }
@@ -67,7 +65,6 @@ HilbertOrder.decode2D = function (level, index) {
67
65
  if (level < 1) {
68
66
  throw new DeveloperError("Hilbert level cannot be less than 1.");
69
67
  }
70
- // eslint-disable-next-line no-undef
71
68
  if (index < BigInt(0) || index >= BigInt(Math.pow(4, level))) {
72
69
  throw new DeveloperError(
73
70
  "Hilbert index exceeds valid maximum for given level.",
@@ -83,14 +80,11 @@ HilbertOrder.decode2D = function (level, index) {
83
80
  let rx, ry, s, t;
84
81
 
85
82
  for (s = 1, t = index; s < n; s *= 2) {
86
- // eslint-disable-next-line no-undef
87
83
  rx = 1 & Number(t / BigInt(2));
88
- // eslint-disable-next-line no-undef
89
84
  ry = 1 & Number(t ^ BigInt(rx));
90
85
  rotate(s, p, rx, ry);
91
86
  p.x += s * rx;
92
87
  p.y += s * ry;
93
- // eslint-disable-next-line no-undef
94
88
  t /= BigInt(4);
95
89
  }
96
90
 
@@ -114,7 +114,7 @@ ITwinPlatform.apiEndpoint = new Resource({
114
114
  });
115
115
 
116
116
  /**
117
- * @typedef {Object} ExportRequest
117
+ * @typedef {object} ExportRequest
118
118
  * @private
119
119
  * @property {string} iModelId
120
120
  * @property {string} changesetId
@@ -122,13 +122,13 @@ ITwinPlatform.apiEndpoint = new Resource({
122
122
  */
123
123
 
124
124
  /**
125
- * @typedef {Object} Link
125
+ * @typedef {object} Link
126
126
  * @private
127
127
  * @property {string} href
128
128
  */
129
129
 
130
130
  /**
131
- * @typedef {Object} ExportRepresentation
131
+ * @typedef {object} ExportRepresentation
132
132
  * The export objects from get-exports when using return=representation
133
133
  * @private
134
134
  * @property {string} id Export id
@@ -140,7 +140,7 @@ ITwinPlatform.apiEndpoint = new Resource({
140
140
  */
141
141
 
142
142
  /**
143
- * @typedef {Object} GetExportsResponse
143
+ * @typedef {object} GetExportsResponse
144
144
  * @private
145
145
  * @property {ExportRepresentation[]} exports The list of exports for the current page
146
146
  * @property {{self: Link, next: Link | undefined, prev: Link | undefined}} _links Pagination links
@@ -224,14 +224,14 @@ ITwinPlatform.getExports = async function (iModelId, changesetId) {
224
224
  };
225
225
 
226
226
  /**
227
- * @typedef {Object} RealityDataExtent
227
+ * @typedef {object} RealityDataExtent
228
228
  * @private
229
229
  * @property {{latitude: number, longitude: number}} southWest
230
230
  * @property {{latitude: number, longitude: number}} northEast
231
231
  */
232
232
 
233
233
  /**
234
- * @typedef {Object} RealityDataRepresentation
234
+ * @typedef {object} RealityDataRepresentation
235
235
  * @private
236
236
  * @property {string} id "95d8dccd-d89e-4287-bb5f-3219acbc71ae",
237
237
  * @property {string} displayName "Name of reality data",
@@ -495,6 +495,86 @@ IntersectionTests.rayEllipsoid = function (ray, ellipsoid) {
495
495
  return undefined;
496
496
  };
497
497
 
498
+ const scratchRayIntervalX = new Interval();
499
+ const scratchRayIntervalY = new Interval();
500
+ const scratchRayIntervalZ = new Interval();
501
+
502
+ /**
503
+ * Computes the intersection points of a ray with an axis-aligned bounding box. (axis-aligned in the same space as the ray)
504
+ *
505
+ * @param {Ray} ray The ray.
506
+ * @param {AxisAlignedBoundingBox} box The axis-aligned bounding box.
507
+ * @param {Interval | undefined} result The interval containing scalar points along the ray or undefined if there are no intersections.
508
+ */
509
+ IntersectionTests.rayAxisAlignedBoundingBox = function (ray, box, result) {
510
+ //>>includeStart('debug', pragmas.debug);
511
+ if (!defined(ray)) {
512
+ throw new DeveloperError("ray is required.");
513
+ }
514
+ if (!defined(box)) {
515
+ throw new DeveloperError("box is required.");
516
+ }
517
+ //>>includeEnd('debug');
518
+
519
+ if (!defined(result)) {
520
+ result = new Interval();
521
+ }
522
+
523
+ const tx = rayIntervalAlongAABBAxis(
524
+ ray.origin.x,
525
+ ray.direction.x,
526
+ box.minimum.x,
527
+ box.maximum.x,
528
+ scratchRayIntervalX,
529
+ );
530
+ const ty = rayIntervalAlongAABBAxis(
531
+ ray.origin.y,
532
+ ray.direction.y,
533
+ box.minimum.y,
534
+ box.maximum.y,
535
+ scratchRayIntervalY,
536
+ );
537
+ const tz = rayIntervalAlongAABBAxis(
538
+ ray.origin.z,
539
+ ray.direction.z,
540
+ box.minimum.z,
541
+ box.maximum.z,
542
+ scratchRayIntervalZ,
543
+ );
544
+
545
+ result.start = tx.start > ty.start ? tx.start : ty.start; //Get Greatest Min
546
+ result.stop = tx.stop < ty.stop ? tx.stop : ty.stop; //Get Smallest Max
547
+
548
+ if (tx.start > ty.stop || ty.start > tx.stop) {
549
+ return undefined;
550
+ }
551
+
552
+ if (result.start > tz.stop || tz.start > result.stop) {
553
+ return undefined;
554
+ }
555
+
556
+ if (tz.start > result.start) {
557
+ result.start = tz.start;
558
+ }
559
+ if (tz.stop < result.stop) {
560
+ result.stop = tz.stop;
561
+ }
562
+
563
+ return result;
564
+ };
565
+
566
+ function rayIntervalAlongAABBAxis(origin, direction, min, max, result) {
567
+ result.start = (min - origin) / direction;
568
+ result.stop = (max - origin) / direction;
569
+ if (result.stop < result.start) {
570
+ const tmp = result.stop;
571
+ result.stop = result.start;
572
+ result.start = tmp;
573
+ }
574
+
575
+ return result;
576
+ }
577
+
498
578
  function addWithCancellationCheck(left, right, tolerance) {
499
579
  const difference = left + right;
500
580
  if (
@@ -4,7 +4,7 @@ import Resource from "./Resource.js";
4
4
 
5
5
  let defaultTokenCredit;
6
6
  const defaultAccessToken =
7
- "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNjI5ZTViNy0wY2FhLTQ0ZDUtYTIzMi0wMWEyMzZkYWYwYWYiLCJpZCI6MjU5LCJpYXQiOjE3NTkzNDcyNDZ9.xyOPig1igKFQvOTaXfTE0KQ7dU7jyn_c3OQPaQ1hEiI";
7
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxYTBmZmMzNy02NzcxLTRiMjUtYTllZS1hZmJjY2RkYjVhY2UiLCJpZCI6MjU5LCJpYXQiOjE3NjQ2MDU5OTB9.Nefln7pgRwDffoCJRJ8aaZn5iQzIPQrboLwKD2-ArDU";
8
8
  /**
9
9
  * Default settings for accessing the Cesium ion API.
10
10
  *
@@ -7,6 +7,14 @@ import Ion from "./Ion.js";
7
7
  import Resource from "./Resource.js";
8
8
  import RuntimeError from "./RuntimeError.js";
9
9
 
10
+ /**
11
+ * A function that will be invoked when the access token is refreshed.
12
+ * @callback IonResourceRefreshCallback
13
+ * @param {IonResource} ionResource The root IonResource being refreshed.
14
+ * @param {object} endpoint The result of the Cesium ion asset endpoint service. This may be modified in place by the callback.
15
+ * @private
16
+ */
17
+
10
18
  /**
11
19
  * A {@link Resource} instance that encapsulates Cesium ion asset access.
12
20
  * This object is normally not instantiated directly, use {@link IonResource.fromAssetId}.
@@ -16,7 +24,7 @@ import RuntimeError from "./RuntimeError.js";
16
24
  * @augments Resource
17
25
  *
18
26
  * @param {object} endpoint The result of the Cesium ion asset endpoint service.
19
- * @param {Resource} endpointResource The resource used to retrieve the endpoint.
27
+ * @param {Resource} endpointResource The original resource used to retrieve the endpoint.
20
28
  *
21
29
  * @see Ion
22
30
  * @see IonImageryProvider
@@ -39,12 +47,6 @@ function IonResource(endpoint, endpointResource) {
39
47
  retryAttempts: 1,
40
48
  retryCallback: retryCallback,
41
49
  };
42
- } else if (["GOOGLE_2D_MAPS", "AZURE_MAPS"].includes(externalType)) {
43
- options = {
44
- url: endpoint.options.url,
45
- retryAttempts: 1,
46
- retryCallback: retryCallback,
47
- };
48
50
  } else if (
49
51
  externalType === "3DTILES" ||
50
52
  externalType === "STK_TERRAIN_SERVER"
@@ -76,6 +78,13 @@ function IonResource(endpoint, endpointResource) {
76
78
  this._pendingPromise = undefined;
77
79
  this._credits = undefined;
78
80
  this._isExternal = isExternal;
81
+
82
+ /**
83
+ * A function that, if defined, will be invoked when the access token is refreshed.
84
+ * @private
85
+ * @type {IonResourceRefreshCallback|undefined}
86
+ */
87
+ this.refreshCallback = undefined;
79
88
  }
80
89
 
81
90
  if (defined(Object.create)) {
@@ -205,7 +214,7 @@ IonResource.prototype._makeRequest = function (options) {
205
214
  return Resource.prototype._makeRequest.call(this, options);
206
215
  }
207
216
 
208
- addClientHeaders(options);
217
+ options.headers = addClientHeaders(options.headers);
209
218
  options.headers.Authorization = `Bearer ${this._ionEndpoint.accessToken}`;
210
219
 
211
220
  return Resource.prototype._makeRequest.call(this, options);
@@ -239,20 +248,26 @@ IonResource._createEndpointResource = function (assetId, options) {
239
248
  };
240
249
  }
241
250
 
242
- addClientHeaders(resourceOptions);
251
+ resourceOptions.headers = addClientHeaders(resourceOptions.headers);
243
252
 
244
253
  return server.getDerivedResource(resourceOptions);
245
254
  };
246
255
 
247
- function addClientHeaders(options) {
248
- if (!defined(options.headers)) {
249
- options.headers = {};
250
- }
251
- options.headers["X-Cesium-Client"] = "CesiumJS";
256
+ /**
257
+ * Adds CesiumJS client headers to the provided headers object.
258
+ * @private
259
+ * @param {object} [headers={}] The headers to modify.
260
+ * @returns {object} The modified headers.
261
+ */
262
+ function addClientHeaders(headers = {}) {
263
+ headers["X-Cesium-Client"] = "CesiumJS";
264
+
252
265
  /* global CESIUM_VERSION */
253
266
  if (typeof CESIUM_VERSION !== "undefined") {
254
- options.headers["X-Cesium-Client-Version"] = CESIUM_VERSION;
267
+ headers["X-Cesium-Client-Version"] = CESIUM_VERSION;
255
268
  }
269
+
270
+ return headers;
256
271
  }
257
272
 
258
273
  function retryCallback(that, error) {
@@ -280,20 +295,13 @@ function retryCallback(that, error) {
280
295
  ionRoot._pendingPromise = endpointResource
281
296
  .fetchJson()
282
297
  .then(function (newEndpoint) {
298
+ const refreshCallback = that.refreshCallback ?? ionRoot.refreshCallback;
299
+ if (defined(refreshCallback)) {
300
+ refreshCallback(ionRoot, newEndpoint);
301
+ }
302
+
283
303
  // Set the token for root resource so new derived resources automatically pick it up
284
304
  ionRoot._ionEndpoint = newEndpoint;
285
- // Reset the session token for Google 2D imagery
286
- if (newEndpoint.externalType === "GOOGLE_2D_MAPS") {
287
- ionRoot.setQueryParameters({
288
- session: newEndpoint.options.session,
289
- key: newEndpoint.options.key,
290
- });
291
- }
292
- if (newEndpoint.externalType === "AZURE_MAPS") {
293
- ionRoot.setQueryParameters({
294
- "subscription-key": newEndpoint.options["subscription-key"],
295
- });
296
- }
297
305
  return ionRoot._ionEndpoint;
298
306
  })
299
307
  .finally(function (newEndpoint) {
@@ -464,8 +464,8 @@ PixelFormat.alignmentInBytes = function (pixelFormat, pixelDatatype, width) {
464
464
  * @private
465
465
  * @param {PixelFormat} pixelFormat The pixel format.
466
466
  * @param {PixelDatatype} pixelDatatype The pixel datatype.
467
- * @param {Number} width The width of the texture.
468
- * @param {Number} height The height of the texture.
467
+ * @param {number} width The width of the texture.
468
+ * @param {number} height The height of the texture.
469
469
  * @returns {TypedArray} The typed array.
470
470
  */
471
471
  PixelFormat.createTypedArray = function (
@@ -92,52 +92,26 @@ import TerrainMesh from "./TerrainMesh.js";
92
92
  * @see GoogleEarthEnterpriseTerrainData
93
93
  */
94
94
  function QuantizedMeshTerrainData(options) {
95
+ options = options ?? Frozen.EMPTY_OBJECT;
96
+
95
97
  //>>includeStart('debug', pragmas.debug)
96
- if (!defined(options) || !defined(options.quantizedVertices)) {
97
- throw new DeveloperError("options.quantizedVertices is required.");
98
- }
99
- if (!defined(options.indices)) {
100
- throw new DeveloperError("options.indices is required.");
101
- }
102
- if (!defined(options.minimumHeight)) {
103
- throw new DeveloperError("options.minimumHeight is required.");
104
- }
105
- if (!defined(options.maximumHeight)) {
106
- throw new DeveloperError("options.maximumHeight is required.");
107
- }
108
- if (!defined(options.maximumHeight)) {
109
- throw new DeveloperError("options.maximumHeight is required.");
110
- }
111
- if (!defined(options.boundingSphere)) {
112
- throw new DeveloperError("options.boundingSphere is required.");
113
- }
114
- if (!defined(options.horizonOcclusionPoint)) {
115
- throw new DeveloperError("options.horizonOcclusionPoint is required.");
116
- }
117
- if (!defined(options.westIndices)) {
118
- throw new DeveloperError("options.westIndices is required.");
119
- }
120
- if (!defined(options.southIndices)) {
121
- throw new DeveloperError("options.southIndices is required.");
122
- }
123
- if (!defined(options.eastIndices)) {
124
- throw new DeveloperError("options.eastIndices is required.");
125
- }
126
- if (!defined(options.northIndices)) {
127
- throw new DeveloperError("options.northIndices is required.");
128
- }
129
- if (!defined(options.westSkirtHeight)) {
130
- throw new DeveloperError("options.westSkirtHeight is required.");
131
- }
132
- if (!defined(options.southSkirtHeight)) {
133
- throw new DeveloperError("options.southSkirtHeight is required.");
134
- }
135
- if (!defined(options.eastSkirtHeight)) {
136
- throw new DeveloperError("options.eastSkirtHeight is required.");
137
- }
138
- if (!defined(options.northSkirtHeight)) {
139
- throw new DeveloperError("options.northSkirtHeight is required.");
140
- }
98
+ Check.typeOf.object("options.quantizedVertices", options.quantizedVertices);
99
+ Check.typeOf.object("options.indices", options.indices);
100
+ Check.typeOf.number("options.minimumHeight", options.minimumHeight);
101
+ Check.typeOf.number("options.maximumHeight", options.maximumHeight);
102
+ Check.typeOf.object("options.boundingSphere", options.boundingSphere);
103
+ Check.typeOf.object(
104
+ "options.horizonOcclusionPoint",
105
+ options.horizonOcclusionPoint,
106
+ );
107
+ Check.typeOf.object("options.westIndices", options.westIndices);
108
+ Check.typeOf.object("options.southIndices", options.southIndices);
109
+ Check.typeOf.object("options.eastIndices", options.eastIndices);
110
+ Check.typeOf.object("options.northIndices", options.northIndices);
111
+ Check.typeOf.number("options.westSkirtHeight", options.westSkirtHeight);
112
+ Check.typeOf.number("options.southSkirtHeight", options.southSkirtHeight);
113
+ Check.typeOf.number("options.eastSkirtHeight", options.eastSkirtHeight);
114
+ Check.typeOf.number("options.northSkirtHeight", options.northSkirtHeight);
141
115
  //>>includeEnd('debug');
142
116
 
143
117
  this._quantizedVertices = options.quantizedVertices;
@@ -375,6 +349,7 @@ QuantizedMeshTerrainData.prototype.createMesh = function (options) {
375
349
  vertexCountWithoutSkirts,
376
350
  minimumHeight,
377
351
  maximumHeight,
352
+ rectangle,
378
353
  boundingSphere,
379
354
  occludeePointInScaledSpace,
380
355
  stride,
@@ -729,18 +704,10 @@ QuantizedMeshTerrainData.prototype.isChildAvailable = function (
729
704
  childY,
730
705
  ) {
731
706
  //>>includeStart('debug', pragmas.debug);
732
- if (!defined(thisX)) {
733
- throw new DeveloperError("thisX is required.");
734
- }
735
- if (!defined(thisY)) {
736
- throw new DeveloperError("thisY is required.");
737
- }
738
- if (!defined(childX)) {
739
- throw new DeveloperError("childX is required.");
740
- }
741
- if (!defined(childY)) {
742
- throw new DeveloperError("childY is required.");
743
- }
707
+ Check.typeOf.number("thisX", thisX);
708
+ Check.typeOf.number("thisY", thisY);
709
+ Check.typeOf.number("childX", childX);
710
+ Check.typeOf.number("childY", childY);
744
711
  //>>includeEnd('debug');
745
712
 
746
713
  let bitNumber = 2; // northwest child