@cesium/engine 2.0.0 → 2.2.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 (828) hide show
  1. package/Build/Workers/{ArcType-ce2e50ab.js → ArcType-2d9abbbc.js} +4 -4
  2. package/Build/Workers/{AttributeCompression-b646d393.js → AttributeCompression-8a5a065e.js} +24 -24
  3. package/Build/Workers/{AxisAlignedBoundingBox-47525601.js → AxisAlignedBoundingBox-379015ef.js} +3 -3
  4. package/Build/Workers/{BoundingRectangle-93b263ac.js → BoundingRectangle-57f2b24f.js} +18 -18
  5. package/Build/Workers/{BoxGeometry-8c4b4125.js → BoxGeometry-ecabfc78.js} +9 -9
  6. package/Build/Workers/{Check-666ab1a0.js → Check-6ede7e26.js} +22 -22
  7. package/Build/Workers/{Color-52c60ed7.js → Color-14d1a36d.js} +59 -59
  8. package/Build/Workers/{ComponentDatatype-f7b11d02.js → ComponentDatatype-cf1fa08e.js} +16 -16
  9. package/Build/Workers/{CoplanarPolygonGeometryLibrary-33c4c1f8.js → CoplanarPolygonGeometryLibrary-048c3c14.js} +1 -1
  10. package/Build/Workers/{CorridorGeometryLibrary-5039cd8e.js → CorridorGeometryLibrary-520c8619.js} +1 -1
  11. package/Build/Workers/{CylinderGeometry-3ac44974.js → CylinderGeometry-119068b8.js} +12 -12
  12. package/Build/Workers/{CylinderGeometryLibrary-372c07d8.js → CylinderGeometryLibrary-135b0858.js} +1 -1
  13. package/Build/Workers/{EllipseGeometry-a9c9b3be.js → EllipseGeometry-2dfc3523.js} +20 -20
  14. package/Build/Workers/{EllipseGeometryLibrary-855d4681.js → EllipseGeometryLibrary-0a1e0170.js} +1 -1
  15. package/Build/Workers/{EllipseOutlineGeometry-017a5929.js → EllipseOutlineGeometry-c5251669.js} +15 -15
  16. package/Build/Workers/{EllipsoidGeodesic-98c62a56.js → EllipsoidGeodesic-dcff5cbd.js} +6 -6
  17. package/Build/Workers/{EllipsoidGeometry-826e7bce.js → EllipsoidGeometry-d10a5221.js} +14 -14
  18. package/Build/Workers/{EllipsoidOutlineGeometry-784dcdb5.js → EllipsoidOutlineGeometry-7039a0ae.js} +15 -15
  19. package/Build/Workers/{EllipsoidRhumbLine-19756602.js → EllipsoidRhumbLine-b672d507.js} +9 -9
  20. package/Build/Workers/{EllipsoidTangentPlane-ed9443a1.js → EllipsoidTangentPlane-857186be.js} +1 -1
  21. package/Build/Workers/{EncodedCartesian3-81f70735.js → EncodedCartesian3-e8bbca36.js} +6 -6
  22. package/Build/Workers/{FrustumGeometry-9f1ee4d8.js → FrustumGeometry-400fa1b7.js} +109 -109
  23. package/Build/Workers/{GeometryAttribute-334718f8.js → GeometryAttribute-7a2de5c6.js} +20 -20
  24. package/Build/Workers/{GeometryAttributes-f06a2792.js → GeometryAttributes-ad136444.js} +1 -1
  25. package/Build/Workers/{GeometryInstance-451dc1cd.js → GeometryInstance-3fb607b7.js} +6 -6
  26. package/Build/Workers/{GeometryPipeline-8fb0db69.js → GeometryPipeline-916636fa.js} +22 -22
  27. package/Build/Workers/{IndexDatatype-a55ceaa1.js → IndexDatatype-b8f3e09d.js} +13 -13
  28. package/Build/Workers/{IntersectionTests-27d49265.js → IntersectionTests-b4d02d4d.js} +37 -37
  29. package/Build/Workers/{Math-2dbd6b93.js → Math-dad82b4d.js} +137 -137
  30. package/Build/Workers/{Matrix2-13178034.js → Matrix2-1e403d0e.js} +256 -256
  31. package/Build/Workers/{Matrix3-315394f6.js → Matrix3-fa806b97.js} +150 -150
  32. package/Build/Workers/{OrientedBoundingBox-79ee7cbb.js → OrientedBoundingBox-96fe1752.js} +19 -17
  33. package/Build/Workers/{Plane-900aa728.js → Plane-c27e1ac6.js} +5 -5
  34. package/Build/Workers/{PolygonGeometryLibrary-6b5a29e9.js → PolygonGeometryLibrary-931f1ec6.js} +6 -6
  35. package/Build/Workers/{PolygonPipeline-21668b3f.js → PolygonPipeline-32fc92cc.js} +14 -14
  36. package/Build/Workers/{PolylinePipeline-5e2e1b21.js → PolylinePipeline-6d5c63e5.js} +16 -16
  37. package/Build/Workers/{PolylineVolumeGeometryLibrary-97f0b94e.js → PolylineVolumeGeometryLibrary-f068c1fb.js} +7 -7
  38. package/Build/Workers/{PrimitivePipeline-5640850a.js → PrimitivePipeline-879f996a.js} +6 -6
  39. package/Build/Workers/{RectangleGeometryLibrary-d5457f7b.js → RectangleGeometryLibrary-2d6f36f3.js} +1 -1
  40. package/Build/Workers/{RuntimeError-06c93819.js → RuntimeError-ef395448.js} +5 -5
  41. package/Build/Workers/{TerrainEncoding-bfdf2021.js → TerrainEncoding-82882059.js} +30 -30
  42. package/Build/Workers/{Transforms-a05e5e6e.js → Transforms-9052372a.js} +531 -530
  43. package/Build/Workers/{VertexFormat-6b480673.js → VertexFormat-030f11ff.js} +14 -14
  44. package/Build/Workers/{WallGeometryLibrary-6db0ebb6.js → WallGeometryLibrary-db7a64fb.js} +1 -1
  45. package/Build/Workers/{WebGLConstants-a8cc3e8c.js → WebGLConstants-0b1ce7ba.js} +1 -1
  46. package/Build/Workers/{WebMercatorProjection-13a90d41.js → WebMercatorProjection-76a3fcc0.js} +6 -6
  47. package/Build/Workers/{arrayRemoveDuplicates-c2038105.js → arrayRemoveDuplicates-fac118a8.js} +5 -5
  48. package/Build/Workers/cesiumWorkerBootstrapper.js +5 -5
  49. package/Build/Workers/{combine-ca22a614.js → combine-d9581036.js} +5 -5
  50. package/Build/Workers/combineGeometry.js +1 -1
  51. package/Build/Workers/createBoxGeometry.js +1 -1
  52. package/Build/Workers/createBoxOutlineGeometry.js +9 -9
  53. package/Build/Workers/createCircleGeometry.js +13 -13
  54. package/Build/Workers/createCircleOutlineGeometry.js +13 -13
  55. package/Build/Workers/createCoplanarPolygonGeometry.js +11 -11
  56. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +9 -9
  57. package/Build/Workers/createCorridorGeometry.js +14 -14
  58. package/Build/Workers/createCorridorOutlineGeometry.js +12 -12
  59. package/Build/Workers/createCylinderGeometry.js +1 -1
  60. package/Build/Workers/createCylinderOutlineGeometry.js +13 -13
  61. package/Build/Workers/createEllipseGeometry.js +1 -1
  62. package/Build/Workers/createEllipseOutlineGeometry.js +1 -1
  63. package/Build/Workers/createEllipsoidGeometry.js +1 -1
  64. package/Build/Workers/createEllipsoidOutlineGeometry.js +1 -1
  65. package/Build/Workers/createFrustumGeometry.js +1 -1
  66. package/Build/Workers/createFrustumOutlineGeometry.js +8 -8
  67. package/Build/Workers/createGeometry.js +1 -1
  68. package/Build/Workers/createGroundPolylineGeometry.js +33 -33
  69. package/Build/Workers/createPlaneGeometry.js +8 -8
  70. package/Build/Workers/createPlaneOutlineGeometry.js +6 -6
  71. package/Build/Workers/createPolygonGeometry.js +25 -25
  72. package/Build/Workers/createPolygonOutlineGeometry.js +17 -17
  73. package/Build/Workers/createPolylineGeometry.js +11 -11
  74. package/Build/Workers/createPolylineVolumeGeometry.js +9 -9
  75. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +9 -9
  76. package/Build/Workers/createRectangleGeometry.js +16 -16
  77. package/Build/Workers/createRectangleOutlineGeometry.js +12 -12
  78. package/Build/Workers/createSimplePolylineGeometry.js +10 -10
  79. package/Build/Workers/createSphereGeometry.js +11 -11
  80. package/Build/Workers/createSphereOutlineGeometry.js +12 -12
  81. package/Build/Workers/createTaskProcessorWorker.js +2 -2
  82. package/Build/Workers/createVectorTileClampedPolylines.js +1 -1
  83. package/Build/Workers/createVectorTileGeometries.js +8 -8
  84. package/Build/Workers/createVectorTilePoints.js +1 -1
  85. package/Build/Workers/createVectorTilePolygons.js +1 -1
  86. package/Build/Workers/createVectorTilePolylines.js +1 -1
  87. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
  88. package/Build/Workers/createVerticesFromHeightmap.js +23 -21
  89. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +33 -38
  90. package/Build/Workers/createWallGeometry.js +14 -14
  91. package/Build/Workers/createWallOutlineGeometry.js +14 -14
  92. package/Build/Workers/decodeDraco.js +1 -1
  93. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +15 -15
  94. package/Build/Workers/decodeI3S.js +1 -1
  95. package/Build/Workers/{defaultValue-0a909f67.js → defaultValue-fe22d8c0.js} +2 -2
  96. package/Build/Workers/package.js +1 -1
  97. package/Build/Workers/transcodeKTX2.js +26 -26
  98. package/Build/Workers/transferTypedArrayTest.js +1 -1
  99. package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -24
  100. package/Source/Core/ApproximateTerrainHeights.js +3 -3
  101. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +308 -208
  102. package/Source/Core/ArcType.js +4 -4
  103. package/Source/Core/ArticulationStageType.js +1 -1
  104. package/Source/Core/AssociativeArray.js +7 -7
  105. package/Source/Core/AttributeCompression.js +12 -12
  106. package/Source/Core/AxisAlignedBoundingBox.js +2 -2
  107. package/Source/Core/BingMapsGeocoderService.js +6 -6
  108. package/Source/Core/BoundingRectangle.js +17 -17
  109. package/Source/Core/BoundingSphere.js +25 -25
  110. package/Source/Core/BoxGeometry.js +8 -8
  111. package/Source/Core/BoxOutlineGeometry.js +8 -8
  112. package/Source/Core/Cartesian2.js +38 -38
  113. package/Source/Core/Cartesian3.js +50 -50
  114. package/Source/Core/Cartesian4.js +44 -44
  115. package/Source/Core/Cartographic.js +19 -19
  116. package/Source/Core/CartographicGeocoderService.js +1 -1
  117. package/Source/Core/CatmullRomSpline.js +10 -10
  118. package/Source/Core/CesiumTerrainProvider.js +598 -461
  119. package/Source/Core/Check.js +17 -17
  120. package/Source/Core/CircleGeometry.js +12 -12
  121. package/Source/Core/CircleOutlineGeometry.js +12 -12
  122. package/Source/Core/Clock.js +7 -7
  123. package/Source/Core/ClockRange.js +4 -4
  124. package/Source/Core/ClockStep.js +4 -4
  125. package/Source/Core/Color.js +58 -58
  126. package/Source/Core/ColorGeometryInstanceAttribute.js +7 -7
  127. package/Source/Core/ComponentDatatype.js +15 -15
  128. package/Source/Core/CompressedTextureBuffer.js +7 -7
  129. package/Source/Core/ConstantSpline.js +9 -9
  130. package/Source/Core/CoplanarPolygonGeometry.js +10 -10
  131. package/Source/Core/CoplanarPolygonOutlineGeometry.js +8 -8
  132. package/Source/Core/CornerType.js +4 -4
  133. package/Source/Core/CorridorGeometry.js +13 -13
  134. package/Source/Core/CorridorOutlineGeometry.js +11 -11
  135. package/Source/Core/Credit.js +7 -7
  136. package/Source/Core/CubicRealPolynomial.js +10 -10
  137. package/Source/Core/CullingVolume.js +7 -7
  138. package/Source/Core/CustomHeightmapTerrainProvider.js +40 -28
  139. package/Source/Core/CylinderGeometry.js +11 -11
  140. package/Source/Core/CylinderOutlineGeometry.js +12 -12
  141. package/Source/Core/DefaultProxy.js +3 -3
  142. package/Source/Core/DeveloperError.js +4 -4
  143. package/Source/Core/DistanceDisplayCondition.js +12 -12
  144. package/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js +5 -5
  145. package/Source/Core/DoubleEndedPriorityQueue.js +5 -5
  146. package/Source/Core/EarthOrientationParameters.js +6 -6
  147. package/Source/Core/EarthOrientationParametersSample.js +10 -10
  148. package/Source/Core/EasingFunction.js +2 -2
  149. package/Source/Core/EllipseGeometry.js +19 -19
  150. package/Source/Core/EllipseOutlineGeometry.js +14 -14
  151. package/Source/Core/Ellipsoid.js +20 -20
  152. package/Source/Core/EllipsoidGeodesic.js +5 -5
  153. package/Source/Core/EllipsoidGeometry.js +13 -13
  154. package/Source/Core/EllipsoidOutlineGeometry.js +14 -14
  155. package/Source/Core/EllipsoidRhumbLine.js +8 -8
  156. package/Source/Core/EllipsoidTerrainProvider.js +35 -28
  157. package/Source/Core/EllipsoidalOccluder.js +9 -9
  158. package/Source/Core/EncodedCartesian3.js +5 -5
  159. package/Source/Core/Event.js +4 -4
  160. package/Source/Core/EventHelper.js +1 -1
  161. package/Source/Core/ExtrapolationType.js +4 -4
  162. package/Source/Core/FeatureDetection.js +9 -9
  163. package/Source/Core/FrustumGeometry.js +8 -8
  164. package/Source/Core/FrustumOutlineGeometry.js +7 -7
  165. package/Source/Core/Fullscreen.js +8 -8
  166. package/Source/Core/GeocodeType.js +3 -3
  167. package/Source/Core/GeocoderService.js +3 -3
  168. package/Source/Core/GeographicTilingScheme.js +16 -16
  169. package/Source/Core/Geometry.js +5 -5
  170. package/Source/Core/GeometryAttribute.js +6 -6
  171. package/Source/Core/GeometryInstance.js +5 -5
  172. package/Source/Core/GeometryInstanceAttribute.js +7 -7
  173. package/Source/Core/GeometryPipeline.js +11 -11
  174. package/Source/Core/GoogleEarthEnterpriseMetadata.js +107 -55
  175. package/Source/Core/GoogleEarthEnterpriseTerrainData.js +29 -29
  176. package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +137 -100
  177. package/Source/Core/GoogleEarthEnterpriseTileInformation.js +14 -14
  178. package/Source/Core/GregorianDate.js +16 -16
  179. package/Source/Core/GroundPolylineGeometry.js +13 -13
  180. package/Source/Core/HeadingPitchRange.js +6 -6
  181. package/Source/Core/HeadingPitchRoll.js +18 -18
  182. package/Source/Core/Heap.js +7 -7
  183. package/Source/Core/HeightmapEncoding.js +3 -3
  184. package/Source/Core/HeightmapTerrainData.js +44 -44
  185. package/Source/Core/HeightmapTessellator.js +16 -16
  186. package/Source/Core/HermitePolynomialApproximation.js +17 -17
  187. package/Source/Core/HermiteSpline.js +17 -17
  188. package/Source/Core/HilbertOrder.js +7 -7
  189. package/Source/Core/Iau2006XysData.js +13 -13
  190. package/Source/Core/Iau2006XysSample.js +6 -6
  191. package/Source/Core/IauOrientationParameters.js +4 -4
  192. package/Source/Core/IndexDatatype.js +12 -12
  193. package/Source/Core/InterpolationAlgorithm.js +17 -17
  194. package/Source/Core/InterpolationType.js +1 -1
  195. package/Source/Core/Intersect.js +4 -4
  196. package/Source/Core/IntersectionTests.js +5 -5
  197. package/Source/Core/Intersections2D.js +23 -23
  198. package/Source/Core/Interval.js +4 -4
  199. package/Source/Core/Ion.js +3 -3
  200. package/Source/Core/IonGeocoderService.js +4 -4
  201. package/Source/Core/IonResource.js +20 -9
  202. package/Source/Core/JulianDate.js +27 -27
  203. package/Source/Core/KeyboardEventModifier.js +4 -4
  204. package/Source/Core/LagrangePolynomialApproximation.js +8 -8
  205. package/Source/Core/LeapSecond.js +2 -2
  206. package/Source/Core/LinearApproximation.js +8 -8
  207. package/Source/Core/LinearSpline.js +13 -13
  208. package/Source/Core/ManagedArray.js +8 -8
  209. package/Source/Core/Math.js +136 -136
  210. package/Source/Core/Matrix2.js +44 -44
  211. package/Source/Core/Matrix3.js +59 -59
  212. package/Source/Core/Matrix4.js +91 -91
  213. package/Source/Core/MorphWeightSpline.js +14 -14
  214. package/Source/Core/MortonOrder.js +21 -21
  215. package/Source/Core/NearFarScalar.js +16 -16
  216. package/Source/Core/Occluder.js +5 -5
  217. package/Source/Core/OffsetGeometryInstanceAttribute.js +5 -5
  218. package/Source/Core/OpenCageGeocoderService.js +18 -18
  219. package/Source/Core/OrientedBoundingBox.js +18 -16
  220. package/Source/Core/OrthographicFrustum.js +23 -23
  221. package/Source/Core/OrthographicOffCenterFrustum.js +21 -21
  222. package/Source/Core/Packable.js +7 -7
  223. package/Source/Core/PackableForInterpolation.js +11 -11
  224. package/Source/Core/PeliasGeocoderService.js +2 -2
  225. package/Source/Core/PerspectiveFrustum.js +28 -28
  226. package/Source/Core/PerspectiveOffCenterFrustum.js +21 -21
  227. package/Source/Core/PinBuilder.js +9 -9
  228. package/Source/Core/PixelFormat.js +23 -23
  229. package/Source/Core/Plane.js +4 -4
  230. package/Source/Core/PlaneGeometry.js +7 -7
  231. package/Source/Core/PlaneOutlineGeometry.js +5 -5
  232. package/Source/Core/PolygonGeometry.js +24 -24
  233. package/Source/Core/PolygonGeometryLibrary.js +4 -4
  234. package/Source/Core/PolygonOutlineGeometry.js +16 -16
  235. package/Source/Core/PolygonPipeline.js +10 -10
  236. package/Source/Core/PolylineGeometry.js +10 -10
  237. package/Source/Core/PolylinePipeline.js +15 -15
  238. package/Source/Core/PolylineVolumeGeometry.js +8 -8
  239. package/Source/Core/PolylineVolumeOutlineGeometry.js +8 -8
  240. package/Source/Core/PrimitiveType.js +8 -8
  241. package/Source/Core/Proxy.js +2 -2
  242. package/Source/Core/QuadraticRealPolynomial.js +8 -8
  243. package/Source/Core/QuantizedMeshTerrainData.js +37 -37
  244. package/Source/Core/QuarticRealPolynomial.js +12 -12
  245. package/Source/Core/Quaternion.js +42 -42
  246. package/Source/Core/QuaternionSpline.js +10 -10
  247. package/Source/Core/Queue.js +2 -2
  248. package/Source/Core/Ray.js +1 -1
  249. package/Source/Core/Rectangle.js +38 -38
  250. package/Source/Core/RectangleCollisionChecker.js +3 -3
  251. package/Source/Core/RectangleGeometry.js +15 -15
  252. package/Source/Core/RectangleOutlineGeometry.js +11 -11
  253. package/Source/Core/ReferenceFrame.js +3 -3
  254. package/Source/Core/Request.js +13 -13
  255. package/Source/Core/RequestErrorEvent.js +7 -7
  256. package/Source/Core/RequestScheduler.js +15 -15
  257. package/Source/Core/RequestState.js +7 -7
  258. package/Source/Core/RequestType.js +5 -5
  259. package/Source/Core/Resource.js +225 -225
  260. package/Source/Core/RuntimeError.js +4 -4
  261. package/Source/Core/S2Cell.js +15 -15
  262. package/Source/Core/ScreenSpaceEventHandler.js +7 -7
  263. package/Source/Core/ScreenSpaceEventType.js +16 -16
  264. package/Source/Core/ShowGeometryInstanceAttribute.js +4 -4
  265. package/Source/Core/SimplePolylineGeometry.js +9 -9
  266. package/Source/Core/SphereGeometry.js +10 -10
  267. package/Source/Core/SphereOutlineGeometry.js +11 -11
  268. package/Source/Core/Spherical.js +13 -13
  269. package/Source/Core/Spline.js +14 -14
  270. package/Source/Core/SteppedSpline.js +14 -14
  271. package/Source/Core/TaskProcessor.js +10 -10
  272. package/Source/Core/TerrainData.js +25 -25
  273. package/Source/Core/TerrainEncoding.js +14 -14
  274. package/Source/Core/TerrainExaggeration.js +3 -3
  275. package/Source/Core/TerrainMesh.js +18 -18
  276. package/Source/Core/TerrainProvider.js +32 -37
  277. package/Source/Core/TerrainQuantization.js +3 -3
  278. package/Source/Core/TileAvailability.js +16 -16
  279. package/Source/Core/TileProviderError.js +19 -19
  280. package/Source/Core/TilingScheme.js +13 -13
  281. package/Source/Core/TimeConstants.js +10 -10
  282. package/Source/Core/TimeInterval.js +23 -23
  283. package/Source/Core/TimeIntervalCollection.js +39 -39
  284. package/Source/Core/TimeStandard.js +3 -3
  285. package/Source/Core/Tipsify.js +10 -10
  286. package/Source/Core/Transforms.js +2 -2
  287. package/Source/Core/TranslationRotationScale.js +1 -1
  288. package/Source/Core/TridiagonalSystemSolver.js +3 -3
  289. package/Source/Core/TrustedServers.js +5 -5
  290. package/Source/Core/VRTheWorldTerrainProvider.js +210 -141
  291. package/Source/Core/VertexFormat.js +13 -13
  292. package/Source/Core/VideoSynchronizer.js +4 -4
  293. package/Source/Core/Visibility.js +4 -4
  294. package/Source/Core/VulkanConstants.js +1 -1
  295. package/Source/Core/WallGeometry.js +13 -13
  296. package/Source/Core/WallOutlineGeometry.js +13 -13
  297. package/Source/Core/WebGLConstants.js +1 -1
  298. package/Source/Core/WebMercatorProjection.js +5 -5
  299. package/Source/Core/WebMercatorTilingScheme.js +16 -16
  300. package/Source/Core/WindingOrder.js +3 -3
  301. package/Source/Core/WireframeIndexGenerator.js +3 -3
  302. package/Source/Core/arrayRemoveDuplicates.js +4 -4
  303. package/Source/Core/binarySearch.js +2 -2
  304. package/Source/Core/buildModuleUrl.js +8 -7
  305. package/Source/Core/clone.js +3 -3
  306. package/Source/Core/combine.js +4 -4
  307. package/Source/Core/createGuid.js +1 -1
  308. package/Source/Core/createWorldTerrain.js +23 -5
  309. package/Source/Core/createWorldTerrainAsync.js +48 -0
  310. package/Source/Core/defaultValue.js +1 -1
  311. package/Source/Core/defer.js +1 -1
  312. package/Source/Core/defined.js +1 -1
  313. package/Source/Core/deprecationWarning.js +2 -2
  314. package/Source/Core/destroyObject.js +2 -2
  315. package/Source/Core/formatError.js +1 -1
  316. package/Source/Core/getAbsoluteUri.js +3 -3
  317. package/Source/Core/getBaseUri.js +3 -3
  318. package/Source/Core/getExtensionFromUri.js +2 -2
  319. package/Source/Core/getFilenameFromUri.js +2 -2
  320. package/Source/Core/getImageFromTypedArray.js +2 -2
  321. package/Source/Core/getImagePixels.js +4 -3
  322. package/Source/Core/getJsonFromTypedArray.js +3 -3
  323. package/Source/Core/getStringFromTypedArray.js +3 -3
  324. package/Source/Core/getTimestamp.js +1 -1
  325. package/Source/Core/isBlobUri.js +2 -2
  326. package/Source/Core/isDataUri.js +2 -2
  327. package/Source/Core/isLeapYear.js +2 -2
  328. package/Source/Core/loadKTX2.js +8 -8
  329. package/Source/Core/mergeSort.js +1 -1
  330. package/Source/Core/objectToQuery.js +2 -2
  331. package/Source/Core/oneTimeWarning.js +2 -2
  332. package/Source/Core/parseResponseHeaders.js +2 -2
  333. package/Source/Core/pointInsideTriangle.js +1 -1
  334. package/Source/Core/queryToObject.js +2 -2
  335. package/Source/Core/sampleTerrain.js +16 -17
  336. package/Source/Core/sampleTerrainMostDetailed.js +67 -73
  337. package/Source/Core/scaleToGeodeticSurface.js +1 -1
  338. package/Source/Core/subdivideArray.js +1 -1
  339. package/Source/Core/writeTextToCanvas.js +10 -9
  340. package/Source/DataSources/BillboardGraphics.js +1 -1
  341. package/Source/DataSources/BillboardVisualizer.js +2 -2
  342. package/Source/DataSources/BoundingSphereState.js +1 -1
  343. package/Source/DataSources/BoxGraphics.js +1 -1
  344. package/Source/DataSources/CallbackProperty.js +8 -8
  345. package/Source/DataSources/Cesium3DTilesetGraphics.js +1 -1
  346. package/Source/DataSources/Cesium3DTilesetVisualizer.js +39 -28
  347. package/Source/DataSources/CheckerboardMaterialProperty.js +6 -6
  348. package/Source/DataSources/ColorMaterialProperty.js +5 -5
  349. package/Source/DataSources/CompositeEntityCollection.js +8 -8
  350. package/Source/DataSources/CompositeMaterialProperty.js +5 -5
  351. package/Source/DataSources/CompositePositionProperty.js +2 -2
  352. package/Source/DataSources/CompositeProperty.js +4 -4
  353. package/Source/DataSources/ConstantPositionProperty.js +4 -4
  354. package/Source/DataSources/ConstantProperty.js +5 -5
  355. package/Source/DataSources/CorridorGraphics.js +1 -1
  356. package/Source/DataSources/CustomDataSource.js +5 -5
  357. package/Source/DataSources/CylinderGraphics.js +1 -1
  358. package/Source/DataSources/CzmlDataSource.js +26 -26
  359. package/Source/DataSources/DataSource.js +4 -4
  360. package/Source/DataSources/DataSourceClock.js +2 -2
  361. package/Source/DataSources/DataSourceCollection.js +11 -11
  362. package/Source/DataSources/DataSourceDisplay.js +5 -5
  363. package/Source/DataSources/DynamicGeometryUpdater.js +1 -1
  364. package/Source/DataSources/EllipseGraphics.js +1 -1
  365. package/Source/DataSources/EllipsoidGeometryUpdater.js +2 -2
  366. package/Source/DataSources/EllipsoidGraphics.js +1 -1
  367. package/Source/DataSources/Entity.js +20 -15
  368. package/Source/DataSources/EntityCluster.js +16 -16
  369. package/Source/DataSources/EntityCollection.js +8 -8
  370. package/Source/DataSources/GeoJsonDataSource.js +27 -27
  371. package/Source/DataSources/GeometryUpdater.js +22 -22
  372. package/Source/DataSources/GeometryVisualizer.js +2 -2
  373. package/Source/DataSources/GpxDataSource.js +23 -23
  374. package/Source/DataSources/GridMaterialProperty.js +7 -7
  375. package/Source/DataSources/GroundGeometryUpdater.js +5 -5
  376. package/Source/DataSources/ImageMaterialProperty.js +8 -8
  377. package/Source/DataSources/KmlDataSource.js +32 -32
  378. package/Source/DataSources/KmlTour.js +7 -7
  379. package/Source/DataSources/KmlTourFlyTo.js +6 -6
  380. package/Source/DataSources/KmlTourWait.js +2 -2
  381. package/Source/DataSources/LabelGraphics.js +1 -1
  382. package/Source/DataSources/LabelVisualizer.js +2 -2
  383. package/Source/DataSources/MaterialProperty.js +5 -5
  384. package/Source/DataSources/ModelGraphics.js +3 -3
  385. package/Source/DataSources/ModelVisualizer.js +101 -33
  386. package/Source/DataSources/NodeTransformationProperty.js +3 -3
  387. package/Source/DataSources/PathGraphics.js +1 -1
  388. package/Source/DataSources/PathVisualizer.js +2 -2
  389. package/Source/DataSources/PlaneGraphics.js +1 -1
  390. package/Source/DataSources/PointGraphics.js +1 -1
  391. package/Source/DataSources/PointVisualizer.js +2 -2
  392. package/Source/DataSources/PolygonGraphics.js +4 -4
  393. package/Source/DataSources/PolylineArrowMaterialProperty.js +5 -5
  394. package/Source/DataSources/PolylineDashMaterialProperty.js +8 -8
  395. package/Source/DataSources/PolylineGeometryUpdater.js +13 -13
  396. package/Source/DataSources/PolylineGlowMaterialProperty.js +8 -8
  397. package/Source/DataSources/PolylineGraphics.js +2 -2
  398. package/Source/DataSources/PolylineOutlineMaterialProperty.js +7 -7
  399. package/Source/DataSources/PolylineVisualizer.js +2 -2
  400. package/Source/DataSources/PolylineVolumeGraphics.js +3 -3
  401. package/Source/DataSources/PositionProperty.js +2 -2
  402. package/Source/DataSources/PositionPropertyArray.js +2 -2
  403. package/Source/DataSources/Property.js +4 -4
  404. package/Source/DataSources/PropertyArray.js +2 -2
  405. package/Source/DataSources/PropertyBag.js +10 -10
  406. package/Source/DataSources/RectangleGraphics.js +1 -1
  407. package/Source/DataSources/ReferenceProperty.js +10 -10
  408. package/Source/DataSources/Rotation.js +14 -14
  409. package/Source/DataSources/SampledPositionProperty.js +11 -11
  410. package/Source/DataSources/SampledProperty.js +12 -12
  411. package/Source/DataSources/StripeMaterialProperty.js +8 -8
  412. package/Source/DataSources/StripeOrientation.js +3 -3
  413. package/Source/DataSources/TerrainOffsetProperty.js +1 -1
  414. package/Source/DataSources/TimeIntervalCollectionPositionProperty.js +3 -3
  415. package/Source/DataSources/TimeIntervalCollectionProperty.js +4 -4
  416. package/Source/DataSources/VelocityOrientationProperty.js +2 -2
  417. package/Source/DataSources/VelocityVectorProperty.js +4 -4
  418. package/Source/DataSources/Visualizer.js +2 -2
  419. package/Source/DataSources/WallGraphics.js +4 -4
  420. package/Source/DataSources/exportKml.js +9 -9
  421. package/Source/Renderer/Buffer.js +4 -4
  422. package/Source/Renderer/ClearCommand.js +3 -3
  423. package/Source/Renderer/ComputeCommand.js +3 -3
  424. package/Source/Renderer/Context.js +46 -46
  425. package/Source/Renderer/ContextLimits.js +22 -22
  426. package/Source/Renderer/CubeMapFace.js +11 -11
  427. package/Source/Renderer/DrawCommand.js +15 -15
  428. package/Source/Renderer/Framebuffer.js +4 -4
  429. package/Source/Renderer/FramebufferManager.js +9 -9
  430. package/Source/Renderer/MultisampleFramebuffer.js +1 -1
  431. package/Source/Renderer/PassState.js +2 -2
  432. package/Source/Renderer/PixelDatatype.js +1 -1
  433. package/Source/Renderer/RenderState.js +1 -1
  434. package/Source/Renderer/ShaderBuilder.js +24 -24
  435. package/Source/Renderer/ShaderCache.js +8 -8
  436. package/Source/Renderer/ShaderDestination.js +2 -2
  437. package/Source/Renderer/ShaderFunction.js +3 -3
  438. package/Source/Renderer/ShaderSource.js +8 -8
  439. package/Source/Renderer/ShaderStruct.js +4 -4
  440. package/Source/Renderer/Texture.js +18 -18
  441. package/Source/Renderer/TextureMagnificationFilter.js +4 -4
  442. package/Source/Renderer/TextureMinificationFilter.js +8 -8
  443. package/Source/Renderer/UniformState.js +14 -14
  444. package/Source/Renderer/VertexArray.js +2 -2
  445. package/Source/Renderer/createUniform.js +12 -12
  446. package/Source/Renderer/createUniformArray.js +12 -12
  447. package/Source/Renderer/freezeRenderState.js +2 -2
  448. package/Source/Renderer/loadCubeMap.js +3 -3
  449. package/Source/Scene/AlphaMode.js +4 -4
  450. package/Source/Scene/Appearance.js +14 -14
  451. package/Source/Scene/ArcGisMapServerImageryProvider.js +585 -409
  452. package/Source/Scene/AttributeType.js +11 -11
  453. package/Source/Scene/AutoExposure.js +6 -6
  454. package/Source/Scene/Axis.js +6 -6
  455. package/Source/Scene/B3dmParser.js +2 -2
  456. package/Source/Scene/BatchTable.js +13 -13
  457. package/Source/Scene/BatchTableHierarchy.js +22 -22
  458. package/Source/Scene/BatchTexture.js +14 -14
  459. package/Source/Scene/Billboard.js +17 -17
  460. package/Source/Scene/BillboardCollection.js +13 -13
  461. package/Source/Scene/BingMapsImageryProvider.js +541 -335
  462. package/Source/Scene/BingMapsStyle.js +11 -11
  463. package/Source/Scene/BlendEquation.js +6 -6
  464. package/Source/Scene/BlendFunction.js +16 -16
  465. package/Source/Scene/BlendOption.js +4 -4
  466. package/Source/Scene/BlendingState.js +4 -4
  467. package/Source/Scene/BufferLoader.js +33 -38
  468. package/Source/Scene/Camera.js +57 -57
  469. package/Source/Scene/CameraEventAggregator.js +26 -16
  470. package/Source/Scene/CameraEventType.js +6 -6
  471. package/Source/Scene/Cesium3DContentGroup.js +1 -1
  472. package/Source/Scene/Cesium3DTile.js +409 -272
  473. package/Source/Scene/Cesium3DTileBatchTable.js +3 -3
  474. package/Source/Scene/Cesium3DTileColorBlendMode.js +4 -4
  475. package/Source/Scene/Cesium3DTileContent.js +31 -15
  476. package/Source/Scene/Cesium3DTileContentFactory.js +4 -4
  477. package/Source/Scene/Cesium3DTileContentType.js +17 -17
  478. package/Source/Scene/Cesium3DTileFeature.js +16 -16
  479. package/Source/Scene/Cesium3DTileOptimizationHint.js +1 -1
  480. package/Source/Scene/Cesium3DTileOptimizations.js +1 -1
  481. package/Source/Scene/Cesium3DTilePass.js +8 -11
  482. package/Source/Scene/Cesium3DTilePassState.js +1 -1
  483. package/Source/Scene/Cesium3DTilePointFeature.js +23 -23
  484. package/Source/Scene/Cesium3DTileRefine.js +3 -3
  485. package/Source/Scene/Cesium3DTileStyle.js +17 -17
  486. package/Source/Scene/Cesium3DTileStyleEngine.js +1 -1
  487. package/Source/Scene/Cesium3DTilesVoxelProvider.js +226 -118
  488. package/Source/Scene/Cesium3DTileset.js +817 -543
  489. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +301 -0
  490. package/Source/Scene/Cesium3DTilesetHeatmap.js +4 -4
  491. package/Source/Scene/Cesium3DTilesetMetadata.js +5 -5
  492. package/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js +33 -46
  493. package/Source/Scene/Cesium3DTilesetSkipTraversal.js +421 -0
  494. package/Source/Scene/Cesium3DTilesetTraversal.js +219 -671
  495. package/Source/Scene/CircleEmitter.js +2 -2
  496. package/Source/Scene/ClassificationPrimitive.js +32 -25
  497. package/Source/Scene/ClassificationType.js +4 -4
  498. package/Source/Scene/ClippingPlane.js +2 -2
  499. package/Source/Scene/ClippingPlaneCollection.js +17 -17
  500. package/Source/Scene/CloudCollection.js +16 -16
  501. package/Source/Scene/CloudType.js +3 -3
  502. package/Source/Scene/ColorBlendMode.js +1 -1
  503. package/Source/Scene/Composite3DTileContent.js +69 -26
  504. package/Source/Scene/ConditionsExpression.js +11 -11
  505. package/Source/Scene/ConeEmitter.js +2 -2
  506. package/Source/Scene/ContentMetadata.js +16 -16
  507. package/Source/Scene/CreditDisplay.js +22 -6
  508. package/Source/Scene/CullFace.js +4 -4
  509. package/Source/Scene/CumulusCloud.js +3 -3
  510. package/Source/Scene/DebugAppearance.js +17 -17
  511. package/Source/Scene/DebugCameraPrimitive.js +7 -7
  512. package/Source/Scene/DebugModelMatrixPrimitive.js +9 -9
  513. package/Source/Scene/DepthFunction.js +9 -9
  514. package/Source/Scene/DepthPlane.js +1 -1
  515. package/Source/Scene/DeviceOrientationCameraController.js +1 -1
  516. package/Source/Scene/DirectionalLight.js +3 -3
  517. package/Source/Scene/DiscardEmptyTileImagePolicy.js +2 -2
  518. package/Source/Scene/DiscardMissingTileImagePolicy.js +5 -5
  519. package/Source/Scene/DracoLoader.js +4 -4
  520. package/Source/Scene/EllipsoidPrimitive.js +8 -8
  521. package/Source/Scene/EllipsoidSurfaceAppearance.js +19 -19
  522. package/Source/Scene/Empty3DTileContent.js +31 -1
  523. package/Source/Scene/Expression.js +14 -14
  524. package/Source/Scene/Fog.js +5 -5
  525. package/Source/Scene/FrameRateMonitor.js +14 -14
  526. package/Source/Scene/FrameState.js +36 -36
  527. package/Source/Scene/FrustumCommands.js +2 -2
  528. package/Source/Scene/Geometry3DTileContent.js +47 -7
  529. package/Source/Scene/GetFeatureInfoFormat.js +2 -2
  530. package/Source/Scene/Globe.js +39 -35
  531. package/Source/Scene/GlobeSurfaceTile.js +3 -2
  532. package/Source/Scene/GlobeSurfaceTileProvider.js +56 -33
  533. package/Source/Scene/GlobeTranslucency.js +3 -3
  534. package/Source/Scene/GltfBufferViewLoader.js +52 -96
  535. package/Source/Scene/GltfDracoLoader.js +117 -119
  536. package/Source/Scene/GltfImageLoader.js +77 -84
  537. package/Source/Scene/GltfIndexBufferLoader.js +118 -131
  538. package/Source/Scene/GltfJsonLoader.js +81 -80
  539. package/Source/Scene/GltfLoader.js +413 -301
  540. package/Source/Scene/GltfLoaderUtil.js +11 -11
  541. package/Source/Scene/GltfPipeline/addBuffer.js +2 -2
  542. package/Source/Scene/GltfPipeline/addDefaults.js +2 -2
  543. package/Source/Scene/GltfPipeline/addExtensionsRequired.js +2 -2
  544. package/Source/Scene/GltfPipeline/addExtensionsUsed.js +2 -2
  545. package/Source/Scene/GltfPipeline/addPipelineExtras.js +2 -2
  546. package/Source/Scene/GltfPipeline/addToArray.js +2 -2
  547. package/Source/Scene/GltfPipeline/findAccessorMinMax.js +2 -2
  548. package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +3 -3
  549. package/Source/Scene/GltfPipeline/getAccessorByteStride.js +3 -3
  550. package/Source/Scene/GltfPipeline/getComponentReader.js +5 -5
  551. package/Source/Scene/GltfPipeline/moveTechniqueRenderStates.js +2 -2
  552. package/Source/Scene/GltfPipeline/moveTechniquesToExtension.js +2 -2
  553. package/Source/Scene/GltfPipeline/numberOfComponentsForType.js +2 -2
  554. package/Source/Scene/GltfPipeline/parseGlb.js +1 -1
  555. package/Source/Scene/GltfPipeline/readAccessorPacked.js +2 -2
  556. package/Source/Scene/GltfPipeline/removeExtension.js +2 -2
  557. package/Source/Scene/GltfPipeline/removeExtensionsRequired.js +2 -2
  558. package/Source/Scene/GltfPipeline/removeExtensionsUsed.js +2 -2
  559. package/Source/Scene/GltfPipeline/removePipelineExtras.js +2 -2
  560. package/Source/Scene/GltfPipeline/removeUnusedElements.js +2 -2
  561. package/Source/Scene/GltfPipeline/updateAccessorComponentTypes.js +2 -2
  562. package/Source/Scene/GltfPipeline/updateVersion.js +4 -4
  563. package/Source/Scene/GltfPipeline/usesExtension.js +3 -3
  564. package/Source/Scene/GltfStructuralMetadataLoader.js +117 -118
  565. package/Source/Scene/GltfTextureLoader.js +104 -103
  566. package/Source/Scene/GltfVertexBufferLoader.js +140 -145
  567. package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +377 -249
  568. package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +520 -360
  569. package/Source/Scene/GridImageryProvider.js +292 -129
  570. package/Source/Scene/GroundPolylinePrimitive.js +32 -21
  571. package/Source/Scene/GroundPrimitive.js +34 -27
  572. package/Source/Scene/GroupMetadata.js +17 -17
  573. package/Source/Scene/HeightReference.js +4 -4
  574. package/Source/Scene/HorizontalOrigin.js +4 -4
  575. package/Source/Scene/I3SDataProvider.js +221 -120
  576. package/Source/Scene/I3SFeature.js +8 -7
  577. package/Source/Scene/I3SField.js +5 -5
  578. package/Source/Scene/I3SGeometry.js +8 -8
  579. package/Source/Scene/I3SLayer.js +33 -44
  580. package/Source/Scene/I3SNode.js +65 -72
  581. package/Source/Scene/I3dmParser.js +2 -2
  582. package/Source/Scene/ImageBasedLighting.js +21 -17
  583. package/Source/Scene/Imagery.js +6 -1
  584. package/Source/Scene/ImageryLayer.js +324 -73
  585. package/Source/Scene/ImageryLayerCollection.js +37 -11
  586. package/Source/Scene/ImageryLayerFeatureInfo.js +6 -6
  587. package/Source/Scene/ImageryProvider.js +151 -133
  588. package/Source/Scene/Implicit3DTileContent.js +128 -79
  589. package/Source/Scene/ImplicitAvailabilityBitstream.js +10 -10
  590. package/Source/Scene/ImplicitMetadataView.js +16 -16
  591. package/Source/Scene/ImplicitSubdivisionScheme.js +4 -4
  592. package/Source/Scene/ImplicitSubtree.js +113 -92
  593. package/Source/Scene/ImplicitSubtreeCache.js +6 -6
  594. package/Source/Scene/ImplicitSubtreeMetadata.js +16 -16
  595. package/Source/Scene/ImplicitTileCoordinates.js +27 -27
  596. package/Source/Scene/ImplicitTileset.js +10 -10
  597. package/Source/Scene/InstanceAttributeSemantic.js +5 -5
  598. package/Source/Scene/IonImageryProvider.js +493 -286
  599. package/Source/Scene/IonWorldImageryStyle.js +4 -4
  600. package/Source/Scene/JsonMetadataTable.js +11 -11
  601. package/Source/Scene/KeyframeNode.js +1 -1
  602. package/Source/Scene/Label.js +14 -14
  603. package/Source/Scene/LabelCollection.js +12 -11
  604. package/Source/Scene/LabelStyle.js +4 -4
  605. package/Source/Scene/Light.js +1 -1
  606. package/Source/Scene/MapMode2D.js +3 -3
  607. package/Source/Scene/MapboxImageryProvider.js +301 -141
  608. package/Source/Scene/MapboxStyleImageryProvider.js +301 -142
  609. package/Source/Scene/Material.js +47 -47
  610. package/Source/Scene/MaterialAppearance.js +21 -21
  611. package/Source/Scene/Megatexture.js +15 -15
  612. package/Source/Scene/MetadataClass.js +16 -16
  613. package/Source/Scene/MetadataClassProperty.js +41 -41
  614. package/Source/Scene/MetadataComponentType.js +21 -21
  615. package/Source/Scene/MetadataEntity.js +31 -31
  616. package/Source/Scene/MetadataEnum.js +14 -14
  617. package/Source/Scene/MetadataEnumValue.js +10 -10
  618. package/Source/Scene/MetadataSchema.js +16 -16
  619. package/Source/Scene/MetadataSchemaLoader.js +31 -41
  620. package/Source/Scene/MetadataSemantic.js +17 -17
  621. package/Source/Scene/MetadataTable.js +24 -24
  622. package/Source/Scene/MetadataTableProperty.js +9 -9
  623. package/Source/Scene/MetadataType.js +15 -15
  624. package/Source/Scene/Model/B3dmLoader.js +54 -58
  625. package/Source/Scene/Model/ClassificationModelDrawCommand.js +3 -3
  626. package/Source/Scene/Model/CustomShader.js +18 -18
  627. package/Source/Scene/Model/CustomShaderMode.js +4 -4
  628. package/Source/Scene/Model/CustomShaderTranslucencyMode.js +4 -4
  629. package/Source/Scene/Model/GeoJsonLoader.js +12 -36
  630. package/Source/Scene/Model/I3dmLoader.js +58 -84
  631. package/Source/Scene/Model/LightingModel.js +3 -3
  632. package/Source/Scene/Model/MaterialPipelineStage.js +6 -6
  633. package/Source/Scene/Model/MetadataPipelineStage.js +25 -26
  634. package/Source/Scene/Model/Model.js +531 -193
  635. package/Source/Scene/Model/Model3DTileContent.js +83 -31
  636. package/Source/Scene/Model/ModelAlphaOptions.js +1 -1
  637. package/Source/Scene/Model/ModelAnimation.js +11 -11
  638. package/Source/Scene/Model/ModelAnimationChannel.js +2 -2
  639. package/Source/Scene/Model/ModelAnimationCollection.js +21 -21
  640. package/Source/Scene/Model/ModelArticulation.js +4 -4
  641. package/Source/Scene/Model/ModelArticulationStage.js +5 -5
  642. package/Source/Scene/Model/ModelDrawCommand.js +18 -29
  643. package/Source/Scene/Model/ModelFeature.js +12 -12
  644. package/Source/Scene/Model/ModelFeatureTable.js +5 -5
  645. package/Source/Scene/Model/ModelLightingOptions.js +1 -1
  646. package/Source/Scene/Model/ModelNode.js +3 -3
  647. package/Source/Scene/Model/ModelRenderResources.js +4 -4
  648. package/Source/Scene/Model/ModelRuntimeNode.js +7 -7
  649. package/Source/Scene/Model/ModelRuntimePrimitive.js +3 -3
  650. package/Source/Scene/Model/ModelSceneGraph.js +11 -11
  651. package/Source/Scene/Model/ModelSilhouettePipelineStage.js +1 -1
  652. package/Source/Scene/Model/ModelSkin.js +1 -1
  653. package/Source/Scene/Model/ModelStatistics.js +7 -7
  654. package/Source/Scene/Model/ModelType.js +8 -8
  655. package/Source/Scene/Model/ModelUtility.js +26 -26
  656. package/Source/Scene/Model/NodeRenderResources.js +7 -7
  657. package/Source/Scene/Model/PntsLoader.js +32 -37
  658. package/Source/Scene/Model/PointCloudStylingPipelineStage.js +1 -1
  659. package/Source/Scene/Model/PrimitiveOutlineGenerator.js +28 -28
  660. package/Source/Scene/Model/PrimitiveRenderResources.js +10 -10
  661. package/Source/Scene/Model/StyleCommandsNeeded.js +1 -1
  662. package/Source/Scene/Model/TextureManager.js +3 -3
  663. package/Source/Scene/Model/TextureUniform.js +6 -6
  664. package/Source/Scene/Model/UniformType.js +17 -17
  665. package/Source/Scene/Model/VaryingType.js +8 -8
  666. package/Source/Scene/ModelAnimationLoop.js +4 -4
  667. package/Source/Scene/ModelComponents.js +61 -61
  668. package/Source/Scene/Moon.js +8 -8
  669. package/Source/Scene/Multiple3DTileContent.js +146 -127
  670. package/Source/Scene/NeverTileDiscardPolicy.js +2 -2
  671. package/Source/Scene/OIT.js +9 -9
  672. package/Source/Scene/OctahedralProjectedCubeMap.js +28 -39
  673. package/Source/Scene/OpenStreetMapImageryProvider.js +6 -6
  674. package/Source/Scene/OrderedGroundPrimitiveCollection.js +9 -9
  675. package/Source/Scene/Particle.js +13 -13
  676. package/Source/Scene/ParticleBurst.js +8 -8
  677. package/Source/Scene/ParticleSystem.js +41 -36
  678. package/Source/Scene/PerInstanceColorAppearance.js +18 -18
  679. package/Source/Scene/PerformanceDisplay.js +2 -2
  680. package/Source/Scene/PntsParser.js +1 -1
  681. package/Source/Scene/PointCloud.js +11 -19
  682. package/Source/Scene/PointCloudEyeDomeLighting.js +1 -1
  683. package/Source/Scene/PointCloudShading.js +20 -20
  684. package/Source/Scene/PointPrimitive.js +6 -6
  685. package/Source/Scene/PointPrimitiveCollection.js +11 -11
  686. package/Source/Scene/Polyline.js +9 -9
  687. package/Source/Scene/PolylineCollection.js +11 -11
  688. package/Source/Scene/PolylineColorAppearance.js +13 -13
  689. package/Source/Scene/PolylineMaterialAppearance.js +13 -13
  690. package/Source/Scene/PostProcessStage.js +15 -15
  691. package/Source/Scene/PostProcessStageCollection.js +10 -10
  692. package/Source/Scene/PostProcessStageComposite.js +13 -13
  693. package/Source/Scene/PostProcessStageLibrary.js +8 -8
  694. package/Source/Scene/PostProcessStageSampleMode.js +3 -3
  695. package/Source/Scene/PostProcessStageTextureCache.js +4 -4
  696. package/Source/Scene/Primitive.js +50 -30
  697. package/Source/Scene/PrimitiveCollection.js +20 -20
  698. package/Source/Scene/PrimitiveLoadPlan.js +6 -6
  699. package/Source/Scene/PropertyAttribute.js +9 -9
  700. package/Source/Scene/PropertyAttributeProperty.js +6 -6
  701. package/Source/Scene/PropertyTable.js +34 -34
  702. package/Source/Scene/PropertyTexture.js +9 -9
  703. package/Source/Scene/PropertyTextureProperty.js +8 -8
  704. package/Source/Scene/QuadtreePrimitive.js +11 -9
  705. package/Source/Scene/QuadtreeTile.js +11 -11
  706. package/Source/Scene/QuadtreeTileLoadState.js +1 -1
  707. package/Source/Scene/QuadtreeTileProvider.js +10 -14
  708. package/Source/Scene/ResourceCache.js +85 -143
  709. package/Source/Scene/ResourceCacheKey.js +42 -42
  710. package/Source/Scene/ResourceCacheStatistics.js +26 -60
  711. package/Source/Scene/ResourceLoader.js +9 -21
  712. package/Source/Scene/ResourceLoaderState.js +16 -8
  713. package/Source/Scene/SDFSettings.js +4 -4
  714. package/Source/Scene/Scene.js +153 -88
  715. package/Source/Scene/SceneMode.js +6 -6
  716. package/Source/Scene/SceneTransitioner.js +1 -1
  717. package/Source/Scene/ScreenSpaceCameraController.js +41 -23
  718. package/Source/Scene/ShadowMap.js +22 -22
  719. package/Source/Scene/ShadowMapShader.js +1 -1
  720. package/Source/Scene/ShadowMode.js +5 -5
  721. package/Source/Scene/ShadowVolumeAppearance.js +17 -17
  722. package/Source/Scene/SingleTileImageryProvider.js +403 -230
  723. package/Source/Scene/SkyAtmosphere.js +10 -10
  724. package/Source/Scene/SkyBox.js +6 -6
  725. package/Source/Scene/SpatialNode.js +103 -87
  726. package/Source/Scene/SphereEmitter.js +2 -2
  727. package/Source/Scene/SplitDirection.js +4 -4
  728. package/Source/Scene/Splitter.js +2 -2
  729. package/Source/Scene/StencilFunction.js +9 -9
  730. package/Source/Scene/StencilOperation.js +9 -9
  731. package/Source/Scene/StructuralMetadata.js +11 -11
  732. package/Source/Scene/StyleExpression.js +8 -8
  733. package/Source/Scene/Sun.js +3 -3
  734. package/Source/Scene/SunLight.js +3 -3
  735. package/Source/Scene/SupportedImageFormats.js +3 -3
  736. package/Source/Scene/Terrain.js +196 -0
  737. package/Source/Scene/TextureAtlas.js +16 -16
  738. package/Source/Scene/TileBoundingRegion.js +6 -6
  739. package/Source/Scene/TileBoundingS2Cell.js +6 -6
  740. package/Source/Scene/TileBoundingSphere.js +5 -5
  741. package/Source/Scene/TileBoundingVolume.js +2 -2
  742. package/Source/Scene/TileCoordinatesImageryProvider.js +289 -126
  743. package/Source/Scene/TileDiscardPolicy.js +2 -2
  744. package/Source/Scene/TileImagery.js +3 -3
  745. package/Source/Scene/TileMapServiceImageryProvider.js +185 -93
  746. package/Source/Scene/TileMetadata.js +16 -16
  747. package/Source/Scene/TileOrientedBoundingBox.js +2 -2
  748. package/Source/Scene/TileReplacementQueue.js +1 -1
  749. package/Source/Scene/TileSelectionResult.js +1 -1
  750. package/Source/Scene/Tileset3DTileContent.js +47 -5
  751. package/Source/Scene/TilesetMetadata.js +15 -15
  752. package/Source/Scene/TimeDynamicImagery.js +8 -8
  753. package/Source/Scene/TimeDynamicPointCloud.js +24 -11
  754. package/Source/Scene/Tonemapper.js +5 -5
  755. package/Source/Scene/TranslucentTileClassification.js +1 -1
  756. package/Source/Scene/TweenCollection.js +31 -31
  757. package/Source/Scene/UrlTemplateImageryProvider.js +380 -252
  758. package/Source/Scene/Vector3DTileBatch.js +7 -7
  759. package/Source/Scene/Vector3DTileClampedPolylines.js +105 -93
  760. package/Source/Scene/Vector3DTileContent.js +47 -22
  761. package/Source/Scene/Vector3DTileGeometry.js +65 -60
  762. package/Source/Scene/Vector3DTilePoints.js +79 -75
  763. package/Source/Scene/Vector3DTilePolygons.js +128 -127
  764. package/Source/Scene/Vector3DTilePolylines.js +95 -91
  765. package/Source/Scene/Vector3DTilePrimitive.js +8 -9
  766. package/Source/Scene/VertexAttributeSemantic.js +15 -15
  767. package/Source/Scene/VerticalOrigin.js +5 -5
  768. package/Source/Scene/ViewportQuad.js +2 -2
  769. package/Source/Scene/VoxelBoxShape.js +27 -118
  770. package/Source/Scene/VoxelContent.js +63 -65
  771. package/Source/Scene/VoxelCylinderShape.js +21 -21
  772. package/Source/Scene/VoxelEllipsoidShape.js +13 -13
  773. package/Source/Scene/VoxelPrimitive.js +83 -135
  774. package/Source/Scene/VoxelProvider.js +15 -15
  775. package/Source/Scene/VoxelRenderResources.js +6 -3
  776. package/Source/Scene/VoxelShape.js +9 -9
  777. package/Source/Scene/VoxelShapeType.js +4 -4
  778. package/Source/Scene/VoxelTraversal.js +86 -144
  779. package/Source/Scene/WebMapServiceImageryProvider.js +313 -152
  780. package/Source/Scene/WebMapTileServiceImageryProvider.js +305 -142
  781. package/Source/Scene/buildVoxelDrawCommands.js +1 -0
  782. package/Source/Scene/computeFlyToLocationForRectangle.js +33 -37
  783. package/Source/Scene/createBillboardPointCallback.js +5 -5
  784. package/Source/Scene/createElevationBandMaterial.js +5 -5
  785. package/Source/Scene/createOsmBuildings.js +9 -3
  786. package/Source/Scene/createOsmBuildingsAsync.js +82 -0
  787. package/Source/Scene/createTangentSpaceDebugPrimitive.js +2 -2
  788. package/Source/Scene/createWorldImagery.js +15 -6
  789. package/Source/Scene/createWorldImageryAsync.js +39 -0
  790. package/Source/Scene/findContentMetadata.js +1 -1
  791. package/Source/Scene/findGroupMetadata.js +1 -1
  792. package/Source/Scene/findTileMetadata.js +1 -1
  793. package/Source/Scene/getClipAndStyleCode.js +4 -4
  794. package/Source/Scene/getClippingFunction.js +1 -1
  795. package/Source/Scene/hasExtension.js +3 -3
  796. package/Source/Scene/parseBatchTable.js +14 -14
  797. package/Source/Scene/parseBoundingVolumeSemantics.js +7 -7
  798. package/Source/Scene/parseFeatureMetadataLegacy.js +4 -4
  799. package/Source/Scene/parseStructuralMetadata.js +4 -4
  800. package/Source/Scene/preprocess3DTileContent.js +2 -2
  801. package/Source/Scene/processVoxelProperties.js +8 -7
  802. package/Source/Shaders/Voxels/IntersectBox.glsl +52 -58
  803. package/Source/Shaders/Voxels/IntersectBox.js +52 -58
  804. package/Source/Shaders/Voxels/IntersectClippingPlanes.glsl +38 -30
  805. package/Source/Shaders/Voxels/IntersectClippingPlanes.js +38 -30
  806. package/Source/Shaders/Voxels/IntersectDepth.glsl +1 -1
  807. package/Source/Shaders/Voxels/IntersectDepth.js +1 -1
  808. package/Source/Shaders/Voxels/Intersection.glsl +10 -12
  809. package/Source/Shaders/Voxels/Intersection.js +10 -12
  810. package/Source/Shaders/Voxels/IntersectionUtils.glsl +52 -59
  811. package/Source/Shaders/Voxels/IntersectionUtils.js +52 -59
  812. package/Source/Shaders/Voxels/Octree.glsl +72 -73
  813. package/Source/Shaders/Voxels/Octree.js +72 -73
  814. package/Source/Shaders/Voxels/VoxelFS.glsl +42 -22
  815. package/Source/Shaders/Voxels/VoxelFS.js +42 -22
  816. package/Source/Shaders/Voxels/convertUvToBox.glsl +13 -5
  817. package/Source/Shaders/Voxels/convertUvToBox.js +13 -5
  818. package/Source/ThirdParty/Workers/draco_decoder_nodejs.js +91 -91
  819. package/Source/ThirdParty/draco_decoder.wasm +0 -0
  820. package/Source/Widget/CesiumWidget.js +78 -50
  821. package/Source/Workers/cesiumWorkerBootstrapper.js +18 -18
  822. package/Source/WorkersES6/createTaskProcessorWorker.js +3 -3
  823. package/index.d.ts +2172 -1432
  824. package/index.js +8 -3
  825. package/package.json +1 -1
  826. package/Source/Core/cancelAnimationFrame.js +0 -53
  827. package/Source/Core/requestAnimationFrame.js +0 -83
  828. /package/Build/Workers/{GeometryOffsetAttribute-04332ce7.js → GeometryOffsetAttribute-9ad0019c.js} +0 -0
@@ -10,10 +10,10 @@ import defaultValue from "../Core/defaultValue.js";
10
10
  import defined from "../Core/defined.js";
11
11
  import deprecationWarning from "../Core/deprecationWarning.js";
12
12
  import destroyObject from "../Core/destroyObject.js";
13
- import DeveloperError from "../Core/DeveloperError.js";
14
13
  import Ellipsoid from "../Core/Ellipsoid.js";
15
14
  import Event from "../Core/Event.js";
16
15
  import ImageBasedLighting from "./ImageBasedLighting.js";
16
+ import IonResource from "../Core/IonResource.js";
17
17
  import JulianDate from "../Core/JulianDate.js";
18
18
  import ManagedArray from "../Core/ManagedArray.js";
19
19
  import CesiumMath from "../Core/Math.js";
@@ -52,114 +52,131 @@ import StencilConstants from "./StencilConstants.js";
52
52
  import TileBoundingRegion from "./TileBoundingRegion.js";
53
53
  import TileBoundingSphere from "./TileBoundingSphere.js";
54
54
  import TileOrientedBoundingBox from "./TileOrientedBoundingBox.js";
55
+ import Cesium3DTilesetMostDetailedTraversal from "./Cesium3DTilesetMostDetailedTraversal.js";
56
+ import Cesium3DTilesetBaseTraversal from "./Cesium3DTilesetBaseTraversal.js";
57
+ import Cesium3DTilesetSkipTraversal from "./Cesium3DTilesetSkipTraversal.js";
58
+
59
+ /**
60
+ * @typedef {Object} Cesium3DTileset.ConstructorOptions
61
+ *
62
+ * Initialization options for the Cesium3DTileset constructor
63
+ *
64
+ * @property {Resource|string|Promise<Resource>|Promise<string>} [.url] The url to a tileset JSON file. Deprecated.
65
+ * @property {boolean} [show=true] Determines if the tileset will be shown.
66
+ * @property {Matrix4} [modelMatrix=Matrix4.IDENTITY] A 4x4 transformation matrix that transforms the tileset's root tile.
67
+ * @property {Axis} [modelUpAxis=Axis.Y] Which axis is considered up when loading models for tile contents.
68
+ * @property {Axis} [modelForwardAxis=Axis.X] Which axis is considered forward when loading models for tile contents.
69
+ * @property {ShadowMode} [shadows=ShadowMode.ENABLED] Determines whether the tileset casts or receives shadows from light sources.
70
+ * @property {number} [maximumScreenSpaceError=16] The maximum screen space error used to drive level of detail refinement.
71
+ * @property {number} [maximumMemoryUsage=512] The maximum amount of memory in MB that can be used by the tileset.
72
+ * @property {boolean} [cullWithChildrenBounds=true] Optimization option. Whether to cull tiles using the union of their children bounding volumes.
73
+ * @property {boolean} [cullRequestsWhileMoving=true] Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets.
74
+ * @property {number} [cullRequestsWhileMovingMultiplier=60.0] Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
75
+ * @property {boolean} [preloadWhenHidden=false] Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.
76
+ * @property {boolean} [preloadFlightDestinations=true] Optimization option. Preload tiles at the camera's flight destination while the camera is in flight.
77
+ * @property {boolean} [preferLeaves=false] Optimization option. Prefer loading of leaves first.
78
+ * @property {boolean} [dynamicScreenSpaceError=false] Optimization option. Reduce the screen space error for tiles that are further away from the camera.
79
+ * @property {number} [dynamicScreenSpaceErrorDensity=0.00278] Density used to adjust the dynamic screen space error, similar to fog density.
80
+ * @property {number} [dynamicScreenSpaceErrorFactor=4.0] A factor used to increase the computed dynamic screen space error.
81
+ * @property {number} [dynamicScreenSpaceErrorHeightFalloff=0.25] A ratio of the tileset's height at which the density starts to falloff.
82
+ * @property {number} [progressiveResolutionHeightFraction=0.3] Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.
83
+ * @property {boolean} [foveatedScreenSpaceError=true] Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.
84
+ * @property {number} [foveatedConeSize=0.1] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and their screen space error. This is controlled by {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, disabling the effect.
85
+ * @property {number} [foveatedMinimumScreenSpaceErrorRelaxation=0.0] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with tileset value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.
86
+ * @property {Cesium3DTileset.foveatedInterpolationCallback} [foveatedInterpolationCallback=Math.lerp] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}
87
+ * @property {number} [foveatedTimeDelay=0.2] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view.
88
+ * @property {boolean} [skipLevelOfDetail=false] Optimization option. Determines if level of detail skipping should be applied during the traversal.
89
+ * @property {number} [baseScreenSpaceError=1024] When <code>skipLevelOfDetail</code> is <code>true</code>, the screen space error that must be reached before skipping levels of detail.
90
+ * @property {number} [skipScreenSpaceErrorFactor=16] When <code>skipLevelOfDetail</code> is <code>true</code>, a multiplier defining the minimum screen space error to skip. Used in conjunction with <code>skipLevels</code> to determine which tiles to load.
91
+ * @property {number} [skipLevels=1] When <code>skipLevelOfDetail</code> is <code>true</code>, a constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. Used in conjunction with <code>skipScreenSpaceErrorFactor</code> to determine which tiles to load.
92
+ * @property {boolean} [immediatelyLoadDesiredLevelOfDetail=false] When <code>skipLevelOfDetail</code> is <code>true</code>, only tiles that meet the maximum screen space error will ever be downloaded. Skipping factors are ignored and just the desired tiles are loaded.
93
+ * @property {boolean} [loadSiblings=false] When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal.
94
+ * @property {ClippingPlaneCollection} [clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
95
+ * @property {ClassificationType} [classificationType] Determines whether terrain, 3D Tiles or both will be classified by this tileset. See {@link Cesium3DTileset#classificationType} for details about restrictions and limitations.
96
+ * @property {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid determining the size and shape of the globe.
97
+ * @property {object} [pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
98
+ * @property {Cartesian3} [lightColor] The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
99
+ * @property {ImageBasedLighting} [imageBasedLighting] The properties for managing image-based lighting for this tileset.
100
+ * @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.
101
+ * @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.
102
+ * @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.
103
+ * @property {Color} [outlineColor=Color.BLACK] The color to use when rendering outlines.
104
+ * @property {boolean} [vectorClassificationOnly=false] Indicates that only the tileset's vector tiles should be used for classification.
105
+ * @property {boolean} [vectorKeepDecodedPositions=false] Whether vector tiles should keep decoded positions in memory. This is used with {@link Cesium3DTileFeature.getPolylinePositions}.
106
+ * @property {string|number} [featureIdLabel="featureId_0"] Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or "featureId_N" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled "featureId_N" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string "featureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
107
+ * @property {string|number} [instanceFeatureIdLabel="instanceFeatureId_0"] Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
108
+ * @property {boolean} [showCreditsOnScreen=false] Whether to display the credits of this tileset on screen.
109
+ * @property {SplitDirection} [splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this tileset.
110
+ * @property {boolean} [projectTo2D=false] Whether to accurately project the tileset to 2D. If this is true, the tileset will be projected accurately to 2D, but it will use more memory to do so. If this is false, the tileset will use less memory and will still render in 2D / CV mode, but its projected positions may be inaccurate. This cannot be set after the tileset has loaded.
111
+ * @property {string} [debugHeatmapTilePropertyName] The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's specified variable value.
112
+ * @property {boolean} [debugFreezeFrame=false] For debugging only. Determines if only the tiles from last frame should be used for rendering.
113
+ * @property {boolean} [debugColorizeTiles=false] For debugging only. When true, assigns a random color to each tile.
114
+ * @property {boolean} [enableDebugWireframe] For debugging only. This must be true for debugWireframe to work in WebGL1. This cannot be set after the tileset has loaded.
115
+ * @property {boolean} [debugWireframe=false] For debugging only. When true, render's each tile's content as a wireframe.
116
+ * @property {boolean} [debugShowBoundingVolume=false] For debugging only. When true, renders the bounding volume for each tile.
117
+ * @property {boolean} [debugShowContentBoundingVolume=false] For debugging only. When true, renders the bounding volume for each tile's content.
118
+ * @property {boolean} [debugShowViewerRequestVolume=false] For debugging only. When true, renders the viewer request volume for each tile.
119
+ * @property {boolean} [debugShowGeometricError=false] For debugging only. When true, draws labels to indicate the geometric error of each tile.
120
+ * @property {boolean} [debugShowRenderingStatistics=false] For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile.
121
+ * @property {boolean} [debugShowMemoryUsage=false] For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile.
122
+ * @property {boolean} [debugShowUrl=false] For debugging only. When true, draws labels to indicate the url of each tile.
123
+ */
55
124
 
56
125
  /**
57
126
  * A {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset},
58
127
  * used for streaming massive heterogeneous 3D geospatial datasets.
59
128
  *
129
+ * <div class="notice">
130
+ * This object is normally not instantiated directly, use {@link Cesium3DTileset.fromUrl}.
131
+ * </div>
132
+ *
60
133
  * @alias Cesium3DTileset
61
134
  * @constructor
62
135
  *
63
- * @param {Object} options Object with the following properties:
64
- * @param {Resource|String|Promise<Resource>|Promise<String>} options.url The url to a tileset JSON file.
65
- * @param {Boolean} [options.show=true] Determines if the tileset will be shown.
66
- * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] A 4x4 transformation matrix that transforms the tileset's root tile.
67
- * @param {Axis} [options.modelUpAxis=Axis.Y] Which axis is considered up when loading models for tile contents.
68
- * @param {Axis} [options.modelForwardAxis=Axis.X] Which axis is considered forward when loading models for tile contents.
69
- * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the tileset casts or receives shadows from light sources.
70
- * @param {Number} [options.maximumScreenSpaceError=16] The maximum screen space error used to drive level of detail refinement.
71
- * @param {Number} [options.maximumMemoryUsage=512] The maximum amount of memory in MB that can be used by the tileset.
72
- * @param {Boolean} [options.cullWithChildrenBounds=true] Optimization option. Whether to cull tiles using the union of their children bounding volumes.
73
- * @param {Boolean} [options.cullRequestsWhileMoving=true] Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets.
74
- * @param {Number} [options.cullRequestsWhileMovingMultiplier=60.0] Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
75
- * @param {Boolean} [options.preloadWhenHidden=false] Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.
76
- * @param {Boolean} [options.preloadFlightDestinations=true] Optimization option. Preload tiles at the camera's flight destination while the camera is in flight.
77
- * @param {Boolean} [options.preferLeaves=false] Optimization option. Prefer loading of leaves first.
78
- * @param {Boolean} [options.dynamicScreenSpaceError=false] Optimization option. Reduce the screen space error for tiles that are further away from the camera.
79
- * @param {Number} [options.dynamicScreenSpaceErrorDensity=0.00278] Density used to adjust the dynamic screen space error, similar to fog density.
80
- * @param {Number} [options.dynamicScreenSpaceErrorFactor=4.0] A factor used to increase the computed dynamic screen space error.
81
- * @param {Number} [options.dynamicScreenSpaceErrorHeightFalloff=0.25] A ratio of the tileset's height at which the density starts to falloff.
82
- * @param {Number} [options.progressiveResolutionHeightFraction=0.3] Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.
83
- * @param {Boolean} [options.foveatedScreenSpaceError=true] Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.
84
- * @param {Number} [options.foveatedConeSize=0.1] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and their screen space error. This is controlled by {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, disabling the effect.
85
- * @param {Number} [options.foveatedMinimumScreenSpaceErrorRelaxation=0.0] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with tileset value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.
86
- * @param {Cesium3DTileset.foveatedInterpolationCallback} [options.foveatedInterpolationCallback=Math.lerp] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}
87
- * @param {Number} [options.foveatedTimeDelay=0.2] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view.
88
- * @param {Boolean} [options.skipLevelOfDetail=false] Optimization option. Determines if level of detail skipping should be applied during the traversal.
89
- * @param {Number} [options.baseScreenSpaceError=1024] When <code>skipLevelOfDetail</code> is <code>true</code>, the screen space error that must be reached before skipping levels of detail.
90
- * @param {Number} [options.skipScreenSpaceErrorFactor=16] When <code>skipLevelOfDetail</code> is <code>true</code>, a multiplier defining the minimum screen space error to skip. Used in conjunction with <code>skipLevels</code> to determine which tiles to load.
91
- * @param {Number} [options.skipLevels=1] When <code>skipLevelOfDetail</code> is <code>true</code>, a constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. Used in conjunction with <code>skipScreenSpaceErrorFactor</code> to determine which tiles to load.
92
- * @param {Boolean} [options.immediatelyLoadDesiredLevelOfDetail=false] When <code>skipLevelOfDetail</code> is <code>true</code>, only tiles that meet the maximum screen space error will ever be downloaded. Skipping factors are ignored and just the desired tiles are loaded.
93
- * @param {Boolean} [options.loadSiblings=false] When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal.
94
- * @param {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
95
- * @param {ClassificationType} [options.classificationType] Determines whether terrain, 3D Tiles or both will be classified by this tileset. See {@link Cesium3DTileset#classificationType} for details about restrictions and limitations.
96
- * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid determining the size and shape of the globe.
97
- * @param {Object} [options.pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
98
- * @param {Cartesian3} [options.lightColor] The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
99
- * @param {ImageBasedLighting} [options.imageBasedLighting] The properties for managing image-based lighting for this tileset.
100
- * @param {Boolean} [options.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.
101
- * @param {Boolean} [options.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.
102
- * @param {Boolean} [options.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.
103
- * @param {Color} [options.outlineColor=Color.BLACK] The color to use when rendering outlines.
104
- * @param {Boolean} [options.vectorClassificationOnly=false] Indicates that only the tileset's vector tiles should be used for classification.
105
- * @param {Boolean} [options.vectorKeepDecodedPositions=false] Whether vector tiles should keep decoded positions in memory. This is used with {@link Cesium3DTileFeature.getPolylinePositions}.
106
- * @param {String|Number} [options.featureIdLabel="featureId_0"] Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or "featureId_N" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled "featureId_N" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string "featureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
107
- * @param {String|Number} [options.instanceFeatureIdLabel="instanceFeatureId_0"] Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
108
- * @param {Boolean} [options.showCreditsOnScreen=false] Whether to display the credits of this tileset on screen.
109
- * @param {SplitDirection} [options.splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this tileset.
110
- * @param {Boolean} [options.projectTo2D=false] Whether to accurately project the tileset to 2D. If this is true, the tileset will be projected accurately to 2D, but it will use more memory to do so. If this is false, the tileset will use less memory and will still render in 2D / CV mode, but its projected positions may be inaccurate. This cannot be set after the tileset has loaded.
111
- * @param {String} [options.debugHeatmapTilePropertyName] The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's specified variable value.
112
- * @param {Boolean} [options.debugFreezeFrame=false] For debugging only. Determines if only the tiles from last frame should be used for rendering.
113
- * @param {Boolean} [options.debugColorizeTiles=false] For debugging only. When true, assigns a random color to each tile.
114
- * @param {Boolean} [options.enableDebugWireframe] For debugging only. This must be true for debugWireframe to work in WebGL1. This cannot be set after the tileset has loaded.
115
- * @param {Boolean} [options.debugWireframe=false] For debugging only. When true, render's each tile's content as a wireframe.
116
- * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. When true, renders the bounding volume for each tile.
117
- * @param {Boolean} [options.debugShowContentBoundingVolume=false] For debugging only. When true, renders the bounding volume for each tile's content.
118
- * @param {Boolean} [options.debugShowViewerRequestVolume=false] For debugging only. When true, renders the viewer request volume for each tile.
119
- * @param {Boolean} [options.debugShowGeometricError=false] For debugging only. When true, draws labels to indicate the geometric error of each tile.
120
- * @param {Boolean} [options.debugShowRenderingStatistics=false] For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile.
121
- * @param {Boolean} [options.debugShowMemoryUsage=false] For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile.
122
- * @param {Boolean} [options.debugShowUrl=false] For debugging only. When true, draws labels to indicate the url of each tile.
136
+ * @param {Cesium3DTileset.ConstructorOptions} options An object describing initialization options
123
137
  *
124
138
  * @exception {DeveloperError} The tileset must be 3D Tiles version 0.0 or 1.0.
125
139
  *
126
140
  * @example
127
- * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
128
- * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
129
- * }));
141
+ * try {
142
+ * const tileset = await Cesium.Cesium3DTileset.fromUrl(
143
+ * "http://localhost:8002/tilesets/Seattle/tileset.json"
144
+ * });
145
+ * scene.primitives.add(tileset);
146
+ * } catch (error) {
147
+ * console.error(`Error creating tileset: ${error}`);
148
+ * }
130
149
  *
131
150
  * @example
132
151
  * // Common setting for the skipLevelOfDetail optimization
133
- * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
134
- * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
135
- * skipLevelOfDetail : true,
136
- * baseScreenSpaceError : 1024,
137
- * skipScreenSpaceErrorFactor : 16,
138
- * skipLevels : 1,
139
- * immediatelyLoadDesiredLevelOfDetail : false,
140
- * loadSiblings : false,
141
- * cullWithChildrenBounds : true
142
- * }));
152
+ * const tileset = await Cesium.Cesium3DTileset.fromUrl(
153
+ * "http://localhost:8002/tilesets/Seattle/tileset.json", {
154
+ * skipLevelOfDetail: true,
155
+ * baseScreenSpaceError: 1024,
156
+ * skipScreenSpaceErrorFactor: 16,
157
+ * skipLevels: 1,
158
+ * immediatelyLoadDesiredLevelOfDetail: false,
159
+ * loadSiblings: false,
160
+ * cullWithChildrenBounds: true
161
+ * });
162
+ * scene.primitives.add(tileset);
143
163
  *
144
164
  * @example
145
165
  * // Common settings for the dynamicScreenSpaceError optimization
146
- * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
147
- * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
148
- * dynamicScreenSpaceError : true,
149
- * dynamicScreenSpaceErrorDensity : 0.00278,
150
- * dynamicScreenSpaceErrorFactor : 4.0,
151
- * dynamicScreenSpaceErrorHeightFalloff : 0.25
152
- * }));
166
+ * const tileset = await Cesium.Cesium3DTileset.fromUrl(
167
+ * "http://localhost:8002/tilesets/Seattle/tileset.json", {
168
+ * dynamicScreenSpaceError: true,
169
+ * dynamicScreenSpaceErrorDensity: 0.00278,
170
+ * dynamicScreenSpaceErrorFactor: 4.0,
171
+ * dynamicScreenSpaceErrorHeightFalloff: 0.25
172
+ * });
173
+ * scene.primitives.add(tileset);
153
174
  *
154
175
  * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles specification}
155
176
  */
156
177
  function Cesium3DTileset(options) {
157
178
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
158
179
 
159
- //>>includeStart('debug', pragmas.debug);
160
- Check.defined("options.url", options.url);
161
- //>>includeEnd('debug');
162
-
163
180
  this._url = undefined;
164
181
  this._basePath = undefined;
165
182
  this._root = undefined;
@@ -242,7 +259,7 @@ function Cesium3DTileset(options) {
242
259
  /**
243
260
  * Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets.
244
261
  *
245
- * @type {Boolean}
262
+ * @type {boolean}
246
263
  * @default true
247
264
  */
248
265
  this.cullRequestsWhileMoving = defaultValue(
@@ -254,7 +271,7 @@ function Cesium3DTileset(options) {
254
271
  /**
255
272
  * Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
256
273
  *
257
- * @type {Number}
274
+ * @type {number}
258
275
  * @default 60.0
259
276
  */
260
277
  this.cullRequestsWhileMovingMultiplier = defaultValue(
@@ -265,7 +282,7 @@ function Cesium3DTileset(options) {
265
282
  /**
266
283
  * Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.
267
284
  *
268
- * @type {Number}
285
+ * @type {number}
269
286
  * @default 0.3
270
287
  */
271
288
  this.progressiveResolutionHeightFraction = CesiumMath.clamp(
@@ -277,7 +294,7 @@ function Cesium3DTileset(options) {
277
294
  /**
278
295
  * Optimization option. Prefer loading of leaves first.
279
296
  *
280
- * @type {Boolean}
297
+ * @type {boolean}
281
298
  * @default false
282
299
  */
283
300
  this.preferLeaves = defaultValue(options.preferLeaves, false);
@@ -308,7 +325,7 @@ function Cesium3DTileset(options) {
308
325
  /**
309
326
  * Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.
310
327
  *
311
- * @type {Boolean}
328
+ * @type {boolean}
312
329
  * @default false
313
330
  */
314
331
  this.preloadWhenHidden = defaultValue(options.preloadWhenHidden, false);
@@ -316,7 +333,7 @@ function Cesium3DTileset(options) {
316
333
  /**
317
334
  * Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight.
318
335
  *
319
- * @type {Boolean}
336
+ * @type {boolean}
320
337
  * @default true
321
338
  */
322
339
  this.preloadFlightDestinations = defaultValue(
@@ -332,7 +349,7 @@ function Cesium3DTileset(options) {
332
349
  * The algorithm is biased towards "street views" where the camera is close to the ground plane of the tileset and looking
333
350
  * at the horizon. In addition results are more accurate for tightly fitting bounding volumes like box and region.
334
351
  *
335
- * @type {Boolean}
352
+ * @type {boolean}
336
353
  * @default false
337
354
  */
338
355
  this.dynamicScreenSpaceError = defaultValue(
@@ -345,7 +362,7 @@ function Cesium3DTileset(options) {
345
362
  * screen space error for tiles around the edge of the screen. Screen space error returns to normal once all
346
363
  * the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.
347
364
  *
348
- * @type {Boolean}
365
+ * @type {boolean}
349
366
  * @default true
350
367
  */
351
368
  this.foveatedScreenSpaceError = defaultValue(
@@ -375,7 +392,7 @@ function Cesium3DTileset(options) {
375
392
  * This time delay prevents requesting tiles around the edges of the screen when the camera is moving.
376
393
  * Setting this to 0.0 will immediately request all tiles in any given view.
377
394
  *
378
- * @type {Number}
395
+ * @type {number}
379
396
  * @default 0.2
380
397
  */
381
398
  this.foveatedTimeDelay = defaultValue(options.foveatedTimeDelay, 0.2);
@@ -395,7 +412,7 @@ function Cesium3DTileset(options) {
395
412
  * It is analogous to moving fog closer to the camera.
396
413
  * </p>
397
414
  *
398
- * @type {Number}
415
+ * @type {number}
399
416
  * @default 0.00278
400
417
  */
401
418
  this.dynamicScreenSpaceErrorDensity = 0.00278;
@@ -404,7 +421,7 @@ function Cesium3DTileset(options) {
404
421
  * A factor used to increase the screen space error of tiles for dynamic screen space error. As this value increases less tiles
405
422
  * are requested for rendering and tiles in the distance will have lower detail. If set to zero, the feature will be disabled.
406
423
  *
407
- * @type {Number}
424
+ * @type {number}
408
425
  * @default 4.0
409
426
  */
410
427
  this.dynamicScreenSpaceErrorFactor = 4.0;
@@ -417,7 +434,7 @@ function Cesium3DTileset(options) {
417
434
  * Valid values are between 0.0 and 1.0.
418
435
  * </p>
419
436
  *
420
- * @type {Number}
437
+ * @type {number}
421
438
  * @default 0.25
422
439
  */
423
440
  this.dynamicScreenSpaceErrorHeightFalloff = 0.25;
@@ -441,7 +458,7 @@ function Cesium3DTileset(options) {
441
458
  /**
442
459
  * Determines if the tileset will be shown.
443
460
  *
444
- * @type {Boolean}
461
+ * @type {boolean}
445
462
  * @default true
446
463
  */
447
464
  this.show = defaultValue(options.show, true);
@@ -460,7 +477,7 @@ function Cesium3DTileset(options) {
460
477
  * A value of 0.0 results in the source color while a value of 1.0 results in the feature color, with any value in-between
461
478
  * resulting in a mix of the source color and feature color.
462
479
  *
463
- * @type {Number}
480
+ * @type {number}
464
481
  * @default 0.5
465
482
  */
466
483
  this.colorBlendAmount = 0.5;
@@ -650,11 +667,11 @@ function Cesium3DTileset(options) {
650
667
  * using this optimization.
651
668
  * </p>
652
669
  *
653
- * @type {Boolean}
670
+ * @type {boolean}
654
671
  * @default false
655
672
  */
656
673
  this.skipLevelOfDetail = defaultValue(options.skipLevelOfDetail, false);
657
- this._skipLevelOfDetail = this.skipLevelOfDetail;
674
+
658
675
  this._disableSkipLevelOfDetail = false;
659
676
 
660
677
  /**
@@ -663,7 +680,7 @@ function Cesium3DTileset(options) {
663
680
  * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
664
681
  * </p>
665
682
  *
666
- * @type {Number}
683
+ * @type {number}
667
684
  * @default 1024
668
685
  */
669
686
  this.baseScreenSpaceError = defaultValue(options.baseScreenSpaceError, 1024);
@@ -676,7 +693,7 @@ function Cesium3DTileset(options) {
676
693
  * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
677
694
  * </p>
678
695
  *
679
- * @type {Number}
696
+ * @type {number}
680
697
  * @default 16
681
698
  */
682
699
  this.skipScreenSpaceErrorFactor = defaultValue(
@@ -691,7 +708,7 @@ function Cesium3DTileset(options) {
691
708
  * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
692
709
  * </p>
693
710
  *
694
- * @type {Number}
711
+ * @type {number}
695
712
  * @default 1
696
713
  */
697
714
  this.skipLevels = defaultValue(options.skipLevels, 1);
@@ -703,7 +720,7 @@ function Cesium3DTileset(options) {
703
720
  * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
704
721
  * </p>
705
722
  *
706
- * @type {Boolean}
723
+ * @type {boolean}
707
724
  * @default false
708
725
  */
709
726
  this.immediatelyLoadDesiredLevelOfDetail = defaultValue(
@@ -718,7 +735,7 @@ function Cesium3DTileset(options) {
718
735
  * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
719
736
  * </p>
720
737
  *
721
- * @type {Boolean}
738
+ * @type {boolean}
722
739
  * @default false
723
740
  */
724
741
  this.loadSiblings = defaultValue(options.loadSiblings, false);
@@ -751,7 +768,7 @@ function Cesium3DTileset(options) {
751
768
  * Whether to cull back-facing geometry. When true, back face culling is determined
752
769
  * by the glTF material's doubleSided property; when false, back face culling is disabled.
753
770
  *
754
- * @type {Boolean}
771
+ * @type {boolean}
755
772
  * @default true
756
773
  */
757
774
  this.backFaceCulling = defaultValue(options.backFaceCulling, true);
@@ -763,7 +780,7 @@ function Cesium3DTileset(options) {
763
780
  * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension.
764
781
  * When true, outlines are displayed. When false, outlines are not displayed.
765
782
  *
766
- * @type {Boolean}
783
+ * @type {boolean}
767
784
  * @default true
768
785
  */
769
786
  this.showOutline = defaultValue(options.showOutline, true);
@@ -797,7 +814,7 @@ function Cesium3DTileset(options) {
797
814
  * out and see what was rendered.
798
815
  * </p>
799
816
  *
800
- * @type {Boolean}
817
+ * @type {boolean}
801
818
  * @default false
802
819
  */
803
820
  this.debugFreezeFrame = defaultValue(options.debugFreezeFrame, false);
@@ -810,7 +827,7 @@ function Cesium3DTileset(options) {
810
827
  * from parent tiles may be interleaved with features from child tiles.
811
828
  * </p>
812
829
  *
813
- * @type {Boolean}
830
+ * @type {boolean}
814
831
  * @default false
815
832
  */
816
833
  this.debugColorizeTiles = defaultValue(options.debugColorizeTiles, false);
@@ -826,7 +843,7 @@ function Cesium3DTileset(options) {
826
843
  * When true, renders each tile's content as a wireframe.
827
844
  * </p>
828
845
  *
829
- * @type {Boolean}
846
+ * @type {boolean}
830
847
  * @default false
831
848
  */
832
849
  this.debugWireframe = defaultValue(options.debugWireframe, false);
@@ -847,7 +864,7 @@ function Cesium3DTileset(options) {
847
864
  * screen space error and are still refining to their descendants are yellow.
848
865
  * </p>
849
866
  *
850
- * @type {Boolean}
867
+ * @type {boolean}
851
868
  * @default false
852
869
  */
853
870
  this.debugShowBoundingVolume = defaultValue(
@@ -862,7 +879,7 @@ function Cesium3DTileset(options) {
862
879
  * blue if the tile has a content bounding volume; otherwise it is red.
863
880
  * </p>
864
881
  *
865
- * @type {Boolean}
882
+ * @type {boolean}
866
883
  * @default false
867
884
  */
868
885
  this.debugShowContentBoundingVolume = defaultValue(
@@ -876,7 +893,7 @@ function Cesium3DTileset(options) {
876
893
  * When true, renders the viewer request volume for each tile.
877
894
  * </p>
878
895
  *
879
- * @type {Boolean}
896
+ * @type {boolean}
880
897
  * @default false
881
898
  */
882
899
  this.debugShowViewerRequestVolume = defaultValue(
@@ -884,6 +901,10 @@ function Cesium3DTileset(options) {
884
901
  false
885
902
  );
886
903
 
904
+ /**
905
+ * @private
906
+ * @type {LabelCollection|undefined}
907
+ */
887
908
  this._tileDebugLabels = undefined;
888
909
  this.debugPickedTileLabelOnly = false;
889
910
  this.debugPickedTile = undefined;
@@ -895,7 +916,7 @@ function Cesium3DTileset(options) {
895
916
  * When true, draws labels to indicate the geometric error of each tile.
896
917
  * </p>
897
918
  *
898
- * @type {Boolean}
919
+ * @type {boolean}
899
920
  * @default false
900
921
  */
901
922
  this.debugShowGeometricError = defaultValue(
@@ -909,7 +930,7 @@ function Cesium3DTileset(options) {
909
930
  * When true, draws labels to indicate the number of commands, points, triangles and features of each tile.
910
931
  * </p>
911
932
  *
912
- * @type {Boolean}
933
+ * @type {boolean}
913
934
  * @default false
914
935
  */
915
936
  this.debugShowRenderingStatistics = defaultValue(
@@ -923,7 +944,7 @@ function Cesium3DTileset(options) {
923
944
  * When true, draws labels to indicate the geometry and texture memory usage of each tile.
924
945
  * </p>
925
946
  *
926
- * @type {Boolean}
947
+ * @type {boolean}
927
948
  * @default false
928
949
  */
929
950
  this.debugShowMemoryUsage = defaultValue(options.debugShowMemoryUsage, false);
@@ -934,7 +955,7 @@ function Cesium3DTileset(options) {
934
955
  * When true, draws labels to indicate the url of each tile.
935
956
  * </p>
936
957
  *
937
- * @type {Boolean}
958
+ * @type {boolean}
938
959
  * @default false
939
960
  */
940
961
  this.debugShowUrl = defaultValue(options.debugShowUrl, false);
@@ -970,114 +991,123 @@ function Cesium3DTileset(options) {
970
991
  }
971
992
  this._instanceFeatureIdLabel = instanceFeatureIdLabel;
972
993
 
973
- this._schemaLoader = undefined;
974
-
975
- const that = this;
976
- let resource;
977
- this._readyPromise = Promise.resolve(options.url)
978
- .then(function (url) {
979
- let basePath;
980
- resource = Resource.createIfNeeded(url);
981
- that._resource = resource;
982
-
983
- // ion resources have a credits property we can use for additional attribution.
984
- that._credits = resource.credits;
985
-
986
- if (resource.extension === "json") {
987
- basePath = resource.getBaseUri(true);
988
- } else if (resource.isDataUri) {
989
- basePath = "";
990
- }
994
+ if (defined(options.url)) {
995
+ deprecationWarning(
996
+ "Cesium3DTileset options.url",
997
+ "Cesium3DTileset constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."
998
+ );
999
+ const that = this;
1000
+ let resource;
1001
+ this._readyPromise = Promise.resolve(options.url)
1002
+ .then(function (url) {
1003
+ let basePath;
1004
+ resource = Resource.createIfNeeded(url);
1005
+ that._resource = resource;
1006
+
1007
+ // ion resources have a credits property we can use for additional attribution.
1008
+ that._credits = resource.credits;
1009
+
1010
+ if (resource.extension === "json") {
1011
+ basePath = resource.getBaseUri(true);
1012
+ } else if (resource.isDataUri) {
1013
+ basePath = "";
1014
+ }
991
1015
 
992
- that._url = resource.url;
993
- that._basePath = basePath;
1016
+ that._url = resource.url;
1017
+ that._basePath = basePath;
994
1018
 
995
- return Cesium3DTileset.loadJson(resource);
996
- })
997
- .then(function (tilesetJson) {
998
- if (that.isDestroyed()) {
999
- return;
1000
- }
1001
-
1002
- // This needs to be called before loadTileset() so tile metadata
1003
- // can be initialized synchronously in the Cesium3DTile constructor
1004
- return processMetadataExtension(that, tilesetJson);
1005
- })
1006
- .then(function (tilesetJson) {
1007
- if (that.isDestroyed()) {
1008
- return;
1009
- }
1019
+ return Cesium3DTileset.loadJson(resource);
1020
+ })
1021
+ .then(function (tilesetJson) {
1022
+ if (that.isDestroyed()) {
1023
+ return;
1024
+ }
1010
1025
 
1011
- // Set these before loading the tileset since _geometricError
1012
- // and _scaledGeometricError get accessed during tile creation
1013
- that._geometricError = tilesetJson.geometricError;
1014
- that._scaledGeometricError = tilesetJson.geometricError;
1015
-
1016
- that._root = that.loadTileset(resource, tilesetJson);
1017
-
1018
- // Handle legacy gltfUpAxis option
1019
- const gltfUpAxis = defined(tilesetJson.asset.gltfUpAxis)
1020
- ? Axis.fromName(tilesetJson.asset.gltfUpAxis)
1021
- : Axis.Y;
1022
- const modelUpAxis = defaultValue(options.modelUpAxis, gltfUpAxis);
1023
- const modelForwardAxis = defaultValue(options.modelForwardAxis, Axis.X);
1024
-
1025
- const asset = tilesetJson.asset;
1026
- that._asset = asset;
1027
- that._properties = tilesetJson.properties;
1028
- that._extensionsUsed = tilesetJson.extensionsUsed;
1029
- that._extensions = tilesetJson.extensions;
1030
- that._modelUpAxis = modelUpAxis;
1031
- that._modelForwardAxis = modelForwardAxis;
1032
- that._extras = tilesetJson.extras;
1033
-
1034
- const extras = asset.extras;
1035
- if (
1036
- defined(extras) &&
1037
- defined(extras.cesium) &&
1038
- defined(extras.cesium.credits)
1039
- ) {
1040
- const extraCredits = extras.cesium.credits;
1041
- let credits = that._credits;
1042
- if (!defined(credits)) {
1043
- credits = [];
1044
- that._credits = credits;
1026
+ // This needs to be called before loadTileset() so tile metadata
1027
+ // can be initialized synchronously in the Cesium3DTile constructor
1028
+ return processMetadataExtension(resource, tilesetJson).then(
1029
+ (metadata) => {
1030
+ that._metadataExtension = metadata;
1031
+ return tilesetJson;
1032
+ }
1033
+ );
1034
+ })
1035
+ .then(function (tilesetJson) {
1036
+ if (that.isDestroyed()) {
1037
+ return;
1045
1038
  }
1046
- for (let i = 0; i < extraCredits.length; ++i) {
1047
- const credit = extraCredits[i];
1048
- credits.push(new Credit(credit.html, that._showCreditsOnScreen));
1039
+
1040
+ // Set these before loading the tileset since _geometricError
1041
+ // and _scaledGeometricError get accessed during tile creation
1042
+ that._geometricError = tilesetJson.geometricError;
1043
+ that._scaledGeometricError = tilesetJson.geometricError;
1044
+
1045
+ that._root = that.loadTileset(resource, tilesetJson);
1046
+
1047
+ // Handle legacy gltfUpAxis option
1048
+ const gltfUpAxis = defined(tilesetJson.asset.gltfUpAxis)
1049
+ ? Axis.fromName(tilesetJson.asset.gltfUpAxis)
1050
+ : Axis.Y;
1051
+ const modelUpAxis = defaultValue(options.modelUpAxis, gltfUpAxis);
1052
+ const modelForwardAxis = defaultValue(options.modelForwardAxis, Axis.X);
1053
+
1054
+ const asset = tilesetJson.asset;
1055
+ that._asset = asset;
1056
+ that._properties = tilesetJson.properties;
1057
+ that._extensionsUsed = tilesetJson.extensionsUsed;
1058
+ that._extensions = tilesetJson.extensions;
1059
+ that._modelUpAxis = modelUpAxis;
1060
+ that._modelForwardAxis = modelForwardAxis;
1061
+ that._extras = tilesetJson.extras;
1062
+
1063
+ const extras = asset.extras;
1064
+ if (
1065
+ defined(extras) &&
1066
+ defined(extras.cesium) &&
1067
+ defined(extras.cesium.credits)
1068
+ ) {
1069
+ const extraCredits = extras.cesium.credits;
1070
+ let credits = that._credits;
1071
+ if (!defined(credits)) {
1072
+ credits = [];
1073
+ that._credits = credits;
1074
+ }
1075
+ for (let i = 0; i < extraCredits.length; ++i) {
1076
+ const credit = extraCredits[i];
1077
+ credits.push(new Credit(credit.html, that._showCreditsOnScreen));
1078
+ }
1049
1079
  }
1050
- }
1051
1080
 
1052
- // Save the original, untransformed bounding volume position so we can apply
1053
- // the tile transform and model matrix at run time
1054
- const boundingVolume = that._root.createBoundingVolume(
1055
- tilesetJson.root.boundingVolume,
1056
- Matrix4.IDENTITY
1057
- );
1058
- const clippingPlanesOrigin = boundingVolume.boundingSphere.center;
1059
- // If this origin is above the surface of the earth
1060
- // we want to apply an ENU orientation as our best guess of orientation.
1061
- // Otherwise, we assume it gets its position/orientation completely from the
1062
- // root tile transform and the tileset's model matrix
1063
- const originCartographic = that._ellipsoid.cartesianToCartographic(
1064
- clippingPlanesOrigin
1065
- );
1066
- if (
1067
- defined(originCartographic) &&
1068
- originCartographic.height >
1069
- ApproximateTerrainHeights._defaultMinTerrainHeight
1070
- ) {
1071
- that._initialClippingPlanesOriginMatrix = Transforms.eastNorthUpToFixedFrame(
1081
+ // Save the original, untransformed bounding volume position so we can apply
1082
+ // the tile transform and model matrix at run time
1083
+ const boundingVolume = that._root.createBoundingVolume(
1084
+ tilesetJson.root.boundingVolume,
1085
+ Matrix4.IDENTITY
1086
+ );
1087
+ const clippingPlanesOrigin = boundingVolume.boundingSphere.center;
1088
+ // If this origin is above the surface of the earth
1089
+ // we want to apply an ENU orientation as our best guess of orientation.
1090
+ // Otherwise, we assume it gets its position/orientation completely from the
1091
+ // root tile transform and the tileset's model matrix
1092
+ const originCartographic = that._ellipsoid.cartesianToCartographic(
1072
1093
  clippingPlanesOrigin
1073
1094
  );
1074
- }
1075
- that._clippingPlanesOriginMatrix = Matrix4.clone(
1076
- that._initialClippingPlanesOriginMatrix
1077
- );
1095
+ if (
1096
+ defined(originCartographic) &&
1097
+ originCartographic.height >
1098
+ ApproximateTerrainHeights._defaultMinTerrainHeight
1099
+ ) {
1100
+ that._initialClippingPlanesOriginMatrix = Transforms.eastNorthUpToFixedFrame(
1101
+ clippingPlanesOrigin
1102
+ );
1103
+ }
1104
+ that._clippingPlanesOriginMatrix = Matrix4.clone(
1105
+ that._initialClippingPlanesOriginMatrix
1106
+ );
1078
1107
 
1079
- return that;
1080
- });
1108
+ return that;
1109
+ });
1110
+ }
1081
1111
  }
1082
1112
 
1083
1113
  Object.defineProperties(Cesium3DTileset.prototype, {
@@ -1102,21 +1132,11 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1102
1132
  *
1103
1133
  * @memberof Cesium3DTileset.prototype
1104
1134
  *
1105
- * @type {Object}
1135
+ * @type {object}
1106
1136
  * @readonly
1107
- *
1108
- * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.
1109
1137
  */
1110
1138
  asset: {
1111
1139
  get: function () {
1112
- //>>includeStart('debug', pragmas.debug);
1113
- if (!this.ready) {
1114
- throw new DeveloperError(
1115
- "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
1116
- );
1117
- }
1118
- //>>includeEnd('debug');
1119
-
1120
1140
  return this._asset;
1121
1141
  },
1122
1142
  },
@@ -1126,21 +1146,11 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1126
1146
  *
1127
1147
  * @memberof Cesium3DTileset.prototype
1128
1148
  *
1129
- * @type {Object}
1149
+ * @type {object}
1130
1150
  * @readonly
1131
- *
1132
- * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.
1133
1151
  */
1134
1152
  extensions: {
1135
1153
  get: function () {
1136
- //>>includeStart('debug', pragmas.debug);
1137
- if (!this.ready) {
1138
- throw new DeveloperError(
1139
- "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
1140
- );
1141
- }
1142
- //>>includeEnd('debug');
1143
-
1144
1154
  return this._extensions;
1145
1155
  },
1146
1156
  },
@@ -1170,11 +1180,9 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1170
1180
  *
1171
1181
  * @memberof Cesium3DTileset.prototype
1172
1182
  *
1173
- * @type {Object}
1183
+ * @type {object}
1174
1184
  * @readonly
1175
1185
  *
1176
- * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.
1177
- *
1178
1186
  * @example
1179
1187
  * console.log(`Maximum building height: ${tileset.properties.height.maximum}`);
1180
1188
  * console.log(`Minimum building height: ${tileset.properties.height.minimum}`);
@@ -1184,31 +1192,26 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1184
1192
  */
1185
1193
  properties: {
1186
1194
  get: function () {
1187
- //>>includeStart('debug', pragmas.debug);
1188
- if (!this.ready) {
1189
- throw new DeveloperError(
1190
- "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
1191
- );
1192
- }
1193
- //>>includeEnd('debug');
1194
-
1195
1195
  return this._properties;
1196
1196
  },
1197
1197
  },
1198
1198
 
1199
1199
  /**
1200
1200
  * When <code>true</code>, the tileset's root tile is loaded and the tileset is ready to render.
1201
- * This is set to <code>true</code> right before {@link Cesium3DTileset#readyPromise} is resolved.
1202
1201
  *
1203
1202
  * @memberof Cesium3DTileset.prototype
1204
1203
  *
1205
- * @type {Boolean}
1204
+ * @type {boolean}
1206
1205
  * @readonly
1207
1206
  *
1208
1207
  * @default false
1209
1208
  */
1210
1209
  ready: {
1211
1210
  get: function () {
1211
+ deprecationWarning(
1212
+ "Cesium3DTileset.ready",
1213
+ "Cesium3DTileset.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."
1214
+ );
1212
1215
  return defined(this._root);
1213
1216
  },
1214
1217
  },
@@ -1221,8 +1224,9 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1221
1224
  *
1222
1225
  * @memberof Cesium3DTileset.prototype
1223
1226
  *
1224
- * @type {Promise.<Cesium3DTileset>}
1227
+ * @type {Promise<Cesium3DTileset>}
1225
1228
  * @readonly
1229
+ * @deprecated
1226
1230
  *
1227
1231
  * @example
1228
1232
  * tileset.readyPromise.then(function(tileset) {
@@ -1237,6 +1241,10 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1237
1241
  */
1238
1242
  readyPromise: {
1239
1243
  get: function () {
1244
+ deprecationWarning(
1245
+ "Cesium3DTileset.readyPromise",
1246
+ "Cesium3DTileset.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."
1247
+ );
1240
1248
  return this._readyPromise;
1241
1249
  },
1242
1250
  },
@@ -1247,7 +1255,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1247
1255
  *
1248
1256
  * @memberof Cesium3DTileset.prototype
1249
1257
  *
1250
- * @type {Boolean}
1258
+ * @type {boolean}
1251
1259
  * @readonly
1252
1260
  *
1253
1261
  * @default false
@@ -1279,7 +1287,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1279
1287
  *
1280
1288
  * @memberof Cesium3DTileset.prototype
1281
1289
  *
1282
- * @type {String}
1290
+ * @type {string}
1283
1291
  * @readonly
1284
1292
  * @deprecated
1285
1293
  */
@@ -1369,6 +1377,50 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1369
1377
  },
1370
1378
  },
1371
1379
 
1380
+ /**
1381
+ * Whether the tileset is rendering different levels of detail in the same view.
1382
+ * Only relevant if {@link Cesium3DTileset.isSkippingLevelOfDetail} is true.
1383
+ *
1384
+ * @memberof Cesium3DTileset.prototype
1385
+ *
1386
+ * @type {boolean}
1387
+ * @private
1388
+ */
1389
+ hasMixedContent: {
1390
+ get: function () {
1391
+ return this._hasMixedContent;
1392
+ },
1393
+ set: function (value) {
1394
+ //>>includeStart('debug', pragmas.debug);
1395
+ Check.typeOf.bool("value", value);
1396
+ //>>includeEnd('debug');
1397
+
1398
+ this._hasMixedContent = value;
1399
+ },
1400
+ },
1401
+
1402
+ /**
1403
+ * Whether this tileset is actually skipping levels of detail.
1404
+ * The user option may have been disabled if all tiles are using additive refinement,
1405
+ * or if some tiles have a content type for which rendering does not support skipping
1406
+ *
1407
+ * @memberof Cesium3DTileset.prototype
1408
+ *
1409
+ * @type {boolean}
1410
+ * @private
1411
+ * @readonly
1412
+ */
1413
+ isSkippingLevelOfDetail: {
1414
+ get: function () {
1415
+ return (
1416
+ this.skipLevelOfDetail &&
1417
+ !defined(this._classificationType) &&
1418
+ !this._disableSkipLevelOfDetail &&
1419
+ !this._allTilesAdditive
1420
+ );
1421
+ },
1422
+ },
1423
+
1372
1424
  /**
1373
1425
  * The tileset's schema, groups, tileset metadata and other details from the
1374
1426
  * 3DTILES_metadata extension or a 3D Tiles 1.1 tileset JSON. This getter is
@@ -1445,7 +1497,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1445
1497
  *
1446
1498
  * @memberof Cesium3DTileset.prototype
1447
1499
  *
1448
- * @type {Number}
1500
+ * @type {number}
1449
1501
  * @default 16
1450
1502
  *
1451
1503
  * @exception {DeveloperError} <code>maximumScreenSpaceError</code> must be greater than or equal to zero.
@@ -1488,7 +1540,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1488
1540
  *
1489
1541
  * @memberof Cesium3DTileset.prototype
1490
1542
  *
1491
- * @type {Number}
1543
+ * @type {number}
1492
1544
  * @default 512
1493
1545
  *
1494
1546
  * @exception {DeveloperError} <code>maximumMemoryUsage</code> must be greater than or equal to zero.
@@ -1533,19 +1585,9 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1533
1585
  *
1534
1586
  * @type {Cesium3DTile}
1535
1587
  * @readonly
1536
- *
1537
- * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.
1538
1588
  */
1539
1589
  root: {
1540
1590
  get: function () {
1541
- //>>includeStart('debug', pragmas.debug);
1542
- if (!this.ready) {
1543
- throw new DeveloperError(
1544
- "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
1545
- );
1546
- }
1547
- //>>includeEnd('debug');
1548
-
1549
1591
  return this._root;
1550
1592
  },
1551
1593
  },
@@ -1558,28 +1600,16 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1558
1600
  * @type {BoundingSphere}
1559
1601
  * @readonly
1560
1602
  *
1561
- * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.
1562
- *
1563
1603
  * @example
1564
- * const tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
1565
- * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
1566
- * }));
1604
+ * const tileset = await Cesium.Cesium3DTileset.fromUrl("http://localhost:8002/tilesets/Seattle/tileset.json");
1567
1605
  *
1568
- * tileset.readyPromise.then(function(tileset) {
1569
- * // Set the camera to view the newly added tileset
1570
- * viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
1571
- * });
1606
+ * viewer.scene.primitives.add(tileset);
1607
+ *
1608
+ * // Set the camera to view the newly added tileset
1609
+ * viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
1572
1610
  */
1573
1611
  boundingSphere: {
1574
1612
  get: function () {
1575
- //>>includeStart('debug', pragmas.debug);
1576
- if (!this.ready) {
1577
- throw new DeveloperError(
1578
- "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
1579
- );
1580
- }
1581
- //>>includeEnd('debug');
1582
-
1583
1613
  this._root.updateTransform(this._modelMatrix);
1584
1614
  return this._root.boundingSphere;
1585
1615
  },
@@ -1617,7 +1647,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1617
1647
  *
1618
1648
  * @memberof Cesium3DTileset.prototype
1619
1649
  *
1620
- * @type {Number}
1650
+ * @type {number}
1621
1651
  * @readonly
1622
1652
  */
1623
1653
  timeSinceLoad: {
@@ -1632,7 +1662,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1632
1662
  *
1633
1663
  * @memberof Cesium3DTileset.prototype
1634
1664
  *
1635
- * @type {Number}
1665
+ * @type {number}
1636
1666
  * @readonly
1637
1667
  *
1638
1668
  * @see Cesium3DTileset#maximumMemoryUsage
@@ -1748,7 +1778,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1748
1778
  *
1749
1779
  * @memberof Cesium3DTileset.prototype
1750
1780
  *
1751
- * @type {Number}
1781
+ * @type {number}
1752
1782
  * @default 0.3
1753
1783
  */
1754
1784
  foveatedConeSize: {
@@ -1771,7 +1801,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1771
1801
  *
1772
1802
  * @memberof Cesium3DTileset.prototype
1773
1803
  *
1774
- * @type {Number}
1804
+ * @type {number}
1775
1805
  * @default 0.0
1776
1806
  */
1777
1807
  foveatedMinimumScreenSpaceErrorRelaxation: {
@@ -1802,8 +1832,6 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1802
1832
  *
1803
1833
  * @memberof Cesium3DTileset.prototype
1804
1834
  *
1805
- * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.
1806
- *
1807
1835
  * @type {*}
1808
1836
  * @readonly
1809
1837
  *
@@ -1811,14 +1839,6 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1811
1839
  */
1812
1840
  extras: {
1813
1841
  get: function () {
1814
- //>>includeStart('debug', pragmas.debug);
1815
- if (!this.ready) {
1816
- throw new DeveloperError(
1817
- "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
1818
- );
1819
- }
1820
- //>>includeEnd('debug');
1821
-
1822
1842
  return this._extras;
1823
1843
  },
1824
1844
  },
@@ -1858,7 +1878,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1858
1878
  *
1859
1879
  * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
1860
1880
  *
1861
- * @type {Boolean}
1881
+ * @type {boolean}
1862
1882
  * @default false
1863
1883
  */
1864
1884
  vectorClassificationOnly: {
@@ -1875,7 +1895,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1875
1895
  *
1876
1896
  * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
1877
1897
  *
1878
- * @type {Boolean}
1898
+ * @type {boolean}
1879
1899
  * @default false
1880
1900
  */
1881
1901
  vectorKeepDecodedPositions: {
@@ -1889,7 +1909,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1889
1909
  *
1890
1910
  * @memberof Cesium3DTileset.prototype
1891
1911
  *
1892
- * @type {Boolean}
1912
+ * @type {boolean}
1893
1913
  * @default false
1894
1914
  */
1895
1915
  showCreditsOnScreen: {
@@ -1920,7 +1940,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1920
1940
  *
1921
1941
  * @memberof Cesium3DTileset.prototype
1922
1942
  *
1923
- * @type {String}
1943
+ * @type {string}
1924
1944
  * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
1925
1945
  */
1926
1946
  featureIdLabel: {
@@ -1952,7 +1972,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1952
1972
  *
1953
1973
  * @memberof Cesium3DTileset.prototype
1954
1974
  *
1955
- * @type {String}
1975
+ * @type {string}
1956
1976
  * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
1957
1977
  */
1958
1978
  instanceFeatureIdLabel: {
@@ -1974,11 +1994,189 @@ Object.defineProperties(Cesium3DTileset.prototype, {
1974
1994
  },
1975
1995
  });
1976
1996
 
1997
+ /**
1998
+ * Creates a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset},
1999
+ * used for streaming massive heterogeneous 3D geospatial datasets, from a Cesium ion asset ID.
2000
+ *
2001
+ * @param {number} assetId The Cesium ion asset id.
2002
+ * @param {Cesium3DTileset.ConstructorOptions} options An object describing initialization options
2003
+ * @returns {Promise<Cesium3DTileset>}
2004
+ *
2005
+ * @exception {DeveloperError} The tileset must be 3D Tiles version 0.0 or 1.0.
2006
+ *
2007
+ * @see Cesium3DTileset#fromUrl
2008
+ *
2009
+ * @example
2010
+ * // Load a Cesium3DTileset with a Cesium ion asset ID of 124624234
2011
+ * try {
2012
+ * const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(124624234);
2013
+ * scene.primitives.add(tileset);
2014
+ * } catch (error) {
2015
+ * console.error(`Error creating tileset: ${error}`);
2016
+ * }
2017
+ */
2018
+ Cesium3DTileset.fromIonAssetId = async function (assetId, options) {
2019
+ //>>includeStart('debug', pragmas.debug);
2020
+ Check.defined("assetId", assetId);
2021
+ //>>includeEnd('debug');
2022
+
2023
+ const resource = await IonResource.fromAssetId(assetId);
2024
+ return Cesium3DTileset.fromUrl(resource, options);
2025
+ };
2026
+
2027
+ /**
2028
+ * Creates a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset},
2029
+ * used for streaming massive heterogeneous 3D geospatial datasets.
2030
+ *
2031
+ * @param {Resource|string} url The url to a tileset JSON file.
2032
+ * @param {Cesium3DTileset.ConstructorOptions} options An object describing initialization options
2033
+ * @returns {Promise<Cesium3DTileset>}
2034
+ *
2035
+ * @exception {DeveloperError} The tileset must be 3D Tiles version 0.0 or 1.0.
2036
+ *
2037
+ * @see Cesium3DTileset#fromIonAssetId
2038
+ *
2039
+ * @example
2040
+ * try {
2041
+ * const tileset = await Cesium.Cesium3DTileset.fromUrl(
2042
+ * "http://localhost:8002/tilesets/Seattle/tileset.json"
2043
+ * });
2044
+ * scene.primitives.add(tileset);
2045
+ * } catch (error) {
2046
+ * console.error(`Error creating tileset: ${error}`);
2047
+ * }
2048
+ *
2049
+ * @example
2050
+ * // Common setting for the skipLevelOfDetail optimization
2051
+ * const tileset = await Cesium.Cesium3DTileset.fromUrl(
2052
+ * "http://localhost:8002/tilesets/Seattle/tileset.json", {
2053
+ * skipLevelOfDetail: true,
2054
+ * baseScreenSpaceError: 1024,
2055
+ * skipScreenSpaceErrorFactor: 16,
2056
+ * skipLevels: 1,
2057
+ * immediatelyLoadDesiredLevelOfDetail: false,
2058
+ * loadSiblings: false,
2059
+ * cullWithChildrenBounds: true
2060
+ * });
2061
+ * scene.primitives.add(tileset);
2062
+ *
2063
+ * @example
2064
+ * // Common settings for the dynamicScreenSpaceError optimization
2065
+ * const tileset = await Cesium.Cesium3DTileset.fromUrl(
2066
+ * "http://localhost:8002/tilesets/Seattle/tileset.json", {
2067
+ * dynamicScreenSpaceError: true,
2068
+ * dynamicScreenSpaceErrorDensity: 0.00278,
2069
+ * dynamicScreenSpaceErrorFactor: 4.0,
2070
+ * dynamicScreenSpaceErrorHeightFalloff: 0.25
2071
+ * });
2072
+ * scene.primitives.add(tileset);
2073
+ */
2074
+ Cesium3DTileset.fromUrl = async function (url, options) {
2075
+ //>>includeStart('debug', pragmas.debug);
2076
+ Check.defined("url", url);
2077
+ //>>includeEnd('debug');
2078
+
2079
+ options = defaultValue(options, defaultValue.EMPTY_OBJECT);
2080
+
2081
+ const resource = Resource.createIfNeeded(url);
2082
+ let basePath;
2083
+ if (resource.extension === "json") {
2084
+ basePath = resource.getBaseUri(true);
2085
+ } else if (resource.isDataUri) {
2086
+ basePath = "";
2087
+ }
2088
+
2089
+ const tilesetJson = await Cesium3DTileset.loadJson(resource);
2090
+ const metadataExtension = await processMetadataExtension(
2091
+ resource,
2092
+ tilesetJson
2093
+ );
2094
+
2095
+ const tileset = new Cesium3DTileset(options);
2096
+ tileset._resource = resource;
2097
+ tileset._url = resource.url;
2098
+ tileset._basePath = basePath;
2099
+ tileset._metadataExtension = metadataExtension;
2100
+ // Set these before loading the tileset since _geometricError
2101
+ // and _scaledGeometricError get accessed during tile creation
2102
+ tileset._geometricError = tilesetJson.geometricError;
2103
+ tileset._scaledGeometricError = tilesetJson.geometricError;
2104
+
2105
+ const asset = tilesetJson.asset;
2106
+ tileset._asset = asset;
2107
+ tileset._extras = tilesetJson.extras;
2108
+
2109
+ let credits = resource.credits;
2110
+ if (!defined(credits)) {
2111
+ credits = [];
2112
+ }
2113
+
2114
+ const assetExtras = asset.extras;
2115
+ if (
2116
+ defined(assetExtras) &&
2117
+ defined(assetExtras.cesium) &&
2118
+ defined(assetExtras.cesium.credits)
2119
+ ) {
2120
+ const extraCredits = assetExtras.cesium.credits;
2121
+ for (let i = 0; i < extraCredits.length; ++i) {
2122
+ const credit = extraCredits[i];
2123
+ credits.push(new Credit(credit.html, tileset._showCreditsOnScreen));
2124
+ }
2125
+ }
2126
+ tileset._credits = credits;
2127
+
2128
+ // Handle legacy gltfUpAxis option
2129
+ const gltfUpAxis = defined(tilesetJson.asset.gltfUpAxis)
2130
+ ? Axis.fromName(tilesetJson.asset.gltfUpAxis)
2131
+ : Axis.Y;
2132
+ const modelUpAxis = defaultValue(options.modelUpAxis, gltfUpAxis);
2133
+ const modelForwardAxis = defaultValue(options.modelForwardAxis, Axis.X);
2134
+
2135
+ tileset._properties = tilesetJson.properties;
2136
+ tileset._extensionsUsed = tilesetJson.extensionsUsed;
2137
+ tileset._extensions = tilesetJson.extensions;
2138
+ tileset._modelUpAxis = modelUpAxis;
2139
+ tileset._modelForwardAxis = modelForwardAxis;
2140
+
2141
+ tileset._root = tileset.loadTileset(resource, tilesetJson);
2142
+
2143
+ // Save the original, untransformed bounding volume position so we can apply
2144
+ // the tile transform and model matrix at run time
2145
+ const boundingVolume = tileset._root.createBoundingVolume(
2146
+ tilesetJson.root.boundingVolume,
2147
+ Matrix4.IDENTITY
2148
+ );
2149
+ const clippingPlanesOrigin = boundingVolume.boundingSphere.center;
2150
+ // If this origin is above the surface of the earth
2151
+ // we want to apply an ENU orientation as our best guess of orientation.
2152
+ // Otherwise, we assume it gets its position/orientation completely from the
2153
+ // root tile transform and the tileset's model matrix
2154
+ const originCartographic = tileset._ellipsoid.cartesianToCartographic(
2155
+ clippingPlanesOrigin
2156
+ );
2157
+ if (
2158
+ defined(originCartographic) &&
2159
+ originCartographic.height >
2160
+ ApproximateTerrainHeights._defaultMinTerrainHeight
2161
+ ) {
2162
+ tileset._initialClippingPlanesOriginMatrix = Transforms.eastNorthUpToFixedFrame(
2163
+ clippingPlanesOrigin
2164
+ );
2165
+ }
2166
+ tileset._clippingPlanesOriginMatrix = Matrix4.clone(
2167
+ tileset._initialClippingPlanesOriginMatrix
2168
+ );
2169
+
2170
+ tileset._readyPromise = Promise.resolve(tileset);
2171
+ tileset._ready = true;
2172
+ return tileset;
2173
+ };
2174
+
1977
2175
  /**
1978
2176
  * Provides a hook to override the method used to request the tileset json
1979
2177
  * useful when fetching tilesets from remote servers
1980
- * @param {Resource|String} tilesetUrl The url of the json file to be fetched
1981
- * @returns {Promise.<Object>} A promise that resolves with the fetched json data
2178
+ * @param {Resource|string} tilesetUrl The url of the json file to be fetched
2179
+ * @returns {Promise<object>} A promise that resolves with the fetched json data
1982
2180
  */
1983
2181
  Cesium3DTileset.loadJson = function (tilesetUrl) {
1984
2182
  const resource = Resource.createIfNeeded(tilesetUrl);
@@ -2052,8 +2250,7 @@ Cesium3DTileset.prototype.loadTileset = function (
2052
2250
  this._allTilesAdditive && tile.refine === Cesium3DTileRefine.ADD;
2053
2251
  const children = tile._header.children;
2054
2252
  if (defined(children)) {
2055
- const length = children.length;
2056
- for (let i = 0; i < length; ++i) {
2253
+ for (let i = 0; i < children.length; ++i) {
2057
2254
  const childHeader = children[i];
2058
2255
  const childTile = makeTile(this, resource, childHeader, tile);
2059
2256
  tile.children.push(childTile);
@@ -2077,7 +2274,7 @@ Cesium3DTileset.prototype.loadTileset = function (
2077
2274
  *
2078
2275
  * @param {Cesium3DTileset} tileset The tileset
2079
2276
  * @param {Resource} baseResource The base resource for the tileset
2080
- * @param {Object} tileHeader The JSON header for the tile
2277
+ * @param {object} tileHeader The JSON header for the tile
2081
2278
  * @param {Cesium3DTile} [parentTile] The parent tile of the new tile
2082
2279
  * @returns {Cesium3DTile} The newly created tile
2083
2280
  *
@@ -2088,53 +2285,53 @@ function makeTile(tileset, baseResource, tileHeader, parentTile) {
2088
2285
  defined(tileHeader.implicitTiling) ||
2089
2286
  hasExtension(tileHeader, "3DTILES_implicit_tiling");
2090
2287
 
2091
- if (hasImplicitTiling) {
2092
- const metadataSchema = tileset.schema;
2093
-
2094
- const implicitTileset = new ImplicitTileset(
2095
- baseResource,
2096
- tileHeader,
2097
- metadataSchema
2098
- );
2099
- const rootCoordinates = new ImplicitTileCoordinates({
2100
- subdivisionScheme: implicitTileset.subdivisionScheme,
2101
- subtreeLevels: implicitTileset.subtreeLevels,
2102
- level: 0,
2103
- x: 0,
2104
- y: 0,
2105
- // The constructor will only use this for octrees.
2106
- z: 0,
2107
- });
2288
+ if (!hasImplicitTiling) {
2289
+ return new Cesium3DTile(tileset, baseResource, tileHeader, parentTile);
2290
+ }
2108
2291
 
2109
- // Create a placeholder Cesium3DTile that has an ImplicitTileset
2110
- // object and whose content will resolve to an Implicit3DTileContent
2111
- const contentUri = implicitTileset.subtreeUriTemplate.getDerivedResource({
2112
- templateValues: rootCoordinates.getTemplateValues(),
2113
- }).url;
2292
+ const metadataSchema = tileset.schema;
2114
2293
 
2115
- const deepCopy = true;
2116
- const tileJson = clone(tileHeader, deepCopy);
2117
- // Replace contents with the subtree
2118
- tileJson.contents = [
2119
- {
2120
- uri: contentUri,
2121
- },
2122
- ];
2294
+ const implicitTileset = new ImplicitTileset(
2295
+ baseResource,
2296
+ tileHeader,
2297
+ metadataSchema
2298
+ );
2299
+ const rootCoordinates = new ImplicitTileCoordinates({
2300
+ subdivisionScheme: implicitTileset.subdivisionScheme,
2301
+ subtreeLevels: implicitTileset.subtreeLevels,
2302
+ level: 0,
2303
+ x: 0,
2304
+ y: 0,
2305
+ // The constructor will only use this for octrees.
2306
+ z: 0,
2307
+ });
2123
2308
 
2124
- delete tileJson.content;
2309
+ // Create a placeholder Cesium3DTile that has an ImplicitTileset
2310
+ // object and whose content will resolve to an Implicit3DTileContent
2311
+ const contentUri = implicitTileset.subtreeUriTemplate.getDerivedResource({
2312
+ templateValues: rootCoordinates.getTemplateValues(),
2313
+ }).url;
2314
+
2315
+ const deepCopy = true;
2316
+ const tileJson = clone(tileHeader, deepCopy);
2317
+ // Replace contents with the subtree
2318
+ tileJson.contents = [
2319
+ {
2320
+ uri: contentUri,
2321
+ },
2322
+ ];
2125
2323
 
2126
- // The placeholder tile does not have any extensions. If there are any
2127
- // extensions beyond 3DTILES_implicit_tiling, Implicit3DTileContent will
2128
- // copy them to the transcoded tiles.
2129
- delete tileJson.extensions;
2324
+ delete tileJson.content;
2130
2325
 
2131
- const tile = new Cesium3DTile(tileset, baseResource, tileJson, parentTile);
2132
- tile.implicitTileset = implicitTileset;
2133
- tile.implicitCoordinates = rootCoordinates;
2134
- return tile;
2135
- }
2326
+ // The placeholder tile does not have any extensions. If there are any
2327
+ // extensions beyond 3DTILES_implicit_tiling, Implicit3DTileContent will
2328
+ // copy them to the transcoded tiles.
2329
+ delete tileJson.extensions;
2136
2330
 
2137
- return new Cesium3DTile(tileset, baseResource, tileHeader, parentTile);
2331
+ const tile = new Cesium3DTile(tileset, baseResource, tileJson, parentTile);
2332
+ tile.implicitTileset = implicitTileset;
2333
+ tile.implicitCoordinates = rootCoordinates;
2334
+ return tile;
2138
2335
  }
2139
2336
 
2140
2337
  /**
@@ -2142,41 +2339,41 @@ function makeTile(tileset, baseResource, tileHeader, parentTile) {
2142
2339
  * instance. This is asynchronous since metadata schemas may be external.
2143
2340
  *
2144
2341
  * @param {Cesium3DTileset} tileset The tileset
2145
- * @param {Object} tilesetJson The tileset JSON
2146
- * @return {Promise<Object>} A promise that resolves to tilesetJson for chaining.
2342
+ * @param {object} tilesetJson The tileset JSON
2343
+ * @return {Promise<Cesium3DTilesetMetadata>} The loaded Cesium3DTilesetMetadata
2147
2344
  * @private
2148
2345
  */
2149
- function processMetadataExtension(tileset, tilesetJson) {
2346
+ async function processMetadataExtension(resource, tilesetJson) {
2150
2347
  const metadataJson = hasExtension(tilesetJson, "3DTILES_metadata")
2151
2348
  ? tilesetJson.extensions["3DTILES_metadata"]
2152
2349
  : tilesetJson;
2153
2350
 
2154
2351
  let schemaLoader;
2155
2352
  if (defined(metadataJson.schemaUri)) {
2156
- const resource = tileset._resource.getDerivedResource({
2353
+ resource = resource.getDerivedResource({
2157
2354
  url: metadataJson.schemaUri,
2158
2355
  });
2159
- schemaLoader = ResourceCache.loadSchema({
2356
+ schemaLoader = ResourceCache.getSchemaLoader({
2160
2357
  resource: resource,
2161
2358
  });
2162
2359
  } else if (defined(metadataJson.schema)) {
2163
- schemaLoader = ResourceCache.loadSchema({
2360
+ schemaLoader = ResourceCache.getSchemaLoader({
2164
2361
  schema: metadataJson.schema,
2165
2362
  });
2166
2363
  } else {
2167
- return Promise.resolve(tilesetJson);
2364
+ return;
2168
2365
  }
2169
2366
 
2170
- tileset._schemaLoader = schemaLoader;
2171
-
2172
- return schemaLoader.promise.then(function (schemaLoader) {
2173
- tileset._metadataExtension = new Cesium3DTilesetMetadata({
2174
- schema: schemaLoader.schema,
2175
- metadataJson: metadataJson,
2176
- });
2367
+ await schemaLoader.load();
2177
2368
 
2178
- return tilesetJson;
2369
+ const metadataExtension = new Cesium3DTilesetMetadata({
2370
+ schema: schemaLoader.schema,
2371
+ metadataJson: metadataJson,
2179
2372
  });
2373
+
2374
+ ResourceCache.unload(schemaLoader);
2375
+
2376
+ return metadataExtension;
2180
2377
  }
2181
2378
 
2182
2379
  const scratchPositionNormal = new Cartesian3();
@@ -2186,6 +2383,11 @@ const scratchCenter = new Cartesian3();
2186
2383
  const scratchPosition = new Cartesian3();
2187
2384
  const scratchDirection = new Cartesian3();
2188
2385
 
2386
+ /**
2387
+ * @private
2388
+ * @param {Cesium3DTileset} tileset
2389
+ * @param {FrameState} frameState
2390
+ */
2189
2391
  function updateDynamicScreenSpaceError(tileset, frameState) {
2190
2392
  let up;
2191
2393
  let direction;
@@ -2269,36 +2471,48 @@ function updateDynamicScreenSpaceError(tileset, frameState) {
2269
2471
  );
2270
2472
 
2271
2473
  // Increase density as the camera tilts towards the horizon
2272
- const dot = Math.abs(Cartesian3.dot(direction, up));
2273
- let horizonFactor = 1.0 - dot;
2474
+ let horizonFactor = 1.0 - Math.abs(Cartesian3.dot(direction, up));
2274
2475
 
2275
2476
  // Weaken the horizon factor as the camera height increases, implying the camera is further away from the tileset.
2276
2477
  // The goal is to increase density for the "street view", not when viewing the tileset from a distance.
2277
2478
  horizonFactor = horizonFactor * (1.0 - t);
2278
2479
 
2279
- let density = tileset.dynamicScreenSpaceErrorDensity;
2280
- density *= horizonFactor;
2281
-
2282
- tileset._dynamicScreenSpaceErrorComputedDensity = density;
2480
+ tileset._dynamicScreenSpaceErrorComputedDensity =
2481
+ tileset.dynamicScreenSpaceErrorDensity * horizonFactor;
2283
2482
  }
2284
2483
 
2285
- ///////////////////////////////////////////////////////////////////////////
2286
-
2484
+ /**
2485
+ * @private
2486
+ * @param {Cesium3DTileset} tileset
2487
+ * @param {Cesium3DTile} tile
2488
+ */
2287
2489
  function requestContent(tileset, tile) {
2288
2490
  if (tile.hasEmptyContent) {
2289
2491
  return;
2290
2492
  }
2291
2493
 
2292
- const statistics = tileset._statistics;
2293
- const expired = tile.contentExpired;
2294
- const attemptedRequests = tile.requestContent();
2494
+ const { statistics } = tileset;
2495
+ const contentExpired = tile.contentExpired;
2295
2496
 
2296
- if (attemptedRequests > 0) {
2297
- statistics.numberOfAttemptedRequests += attemptedRequests;
2497
+ const promise = tile.requestContent();
2498
+ if (!defined(promise)) {
2298
2499
  return;
2299
2500
  }
2300
2501
 
2301
- if (expired) {
2502
+ promise
2503
+ .then((content) => {
2504
+ if (!defined(content) || tile.isDestroyed() || tileset.isDestroyed()) {
2505
+ return;
2506
+ }
2507
+
2508
+ tileset._processingQueue.push(tile);
2509
+ ++statistics.numberOfTilesProcessing;
2510
+ })
2511
+ .catch((error) => {
2512
+ handleTileFailure(error, tileset, tile);
2513
+ });
2514
+
2515
+ if (contentExpired) {
2302
2516
  if (tile.hasTilesetContent || tile.hasImplicitContent) {
2303
2517
  destroySubtree(tileset, tile);
2304
2518
  } else {
@@ -2308,15 +2522,6 @@ function requestContent(tileset, tile) {
2308
2522
  }
2309
2523
 
2310
2524
  tileset._requestedTilesInFlight.push(tile);
2311
-
2312
- tile.contentReadyToProcessPromise
2313
- .then(addToProcessingQueue(tileset, tile))
2314
- .catch(function (e) {
2315
- // Any error will propagate through contentReadyPromise and will be handled below
2316
- });
2317
- tile.contentReadyPromise
2318
- .then(handleTileSuccess(tileset, tile))
2319
- .catch(handleTileFailure(tileset, tile));
2320
2525
  }
2321
2526
 
2322
2527
  function sortRequestByPriority(a, b) {
@@ -2326,9 +2531,10 @@ function sortRequestByPriority(a, b) {
2326
2531
  /**
2327
2532
  * Perform any pass invariant tasks here. Called after the render pass.
2328
2533
  * @private
2534
+ * @param {FrameState} frameState
2329
2535
  */
2330
2536
  Cesium3DTileset.prototype.postPassesUpdate = function (frameState) {
2331
- if (!this.ready) {
2537
+ if (!defined(this._root)) {
2332
2538
  return;
2333
2539
  }
2334
2540
 
@@ -2348,9 +2554,10 @@ Cesium3DTileset.prototype.postPassesUpdate = function (frameState) {
2348
2554
  /**
2349
2555
  * Perform any pass invariant tasks here. Called before any passes are executed.
2350
2556
  * @private
2557
+ * @param {FrameState} frameState
2351
2558
  */
2352
2559
  Cesium3DTileset.prototype.prePassesUpdate = function (frameState) {
2353
- if (!this.ready) {
2560
+ if (!defined(this._root)) {
2354
2561
  return;
2355
2562
  }
2356
2563
 
@@ -2371,12 +2578,6 @@ Cesium3DTileset.prototype.prePassesUpdate = function (frameState) {
2371
2578
  0.0
2372
2579
  );
2373
2580
 
2374
- this._skipLevelOfDetail =
2375
- this.skipLevelOfDetail &&
2376
- !defined(this._classificationType) &&
2377
- !this._disableSkipLevelOfDetail &&
2378
- !this._allTilesAdditive;
2379
-
2380
2581
  if (this.dynamicScreenSpaceError) {
2381
2582
  updateDynamicScreenSpaceError(this, frameState);
2382
2583
  }
@@ -2386,11 +2587,15 @@ Cesium3DTileset.prototype.prePassesUpdate = function (frameState) {
2386
2587
  }
2387
2588
  };
2388
2589
 
2590
+ /**
2591
+ * @private
2592
+ * @param {Cesium3DTileset} tileset
2593
+ * @param {FrameState} frameState
2594
+ */
2389
2595
  function cancelOutOfViewRequests(tileset, frameState) {
2390
2596
  const requestedTilesInFlight = tileset._requestedTilesInFlight;
2391
2597
  let removeCount = 0;
2392
- const length = requestedTilesInFlight.length;
2393
- for (let i = 0; i < length; ++i) {
2598
+ for (let i = 0; i < requestedTilesInFlight.length; ++i) {
2394
2599
  const tile = requestedTilesInFlight[i];
2395
2600
 
2396
2601
  // NOTE: This is framerate dependant so make sure the threshold check is small
@@ -2414,78 +2619,62 @@ function cancelOutOfViewRequests(tileset, frameState) {
2414
2619
  requestedTilesInFlight.length -= removeCount;
2415
2620
  }
2416
2621
 
2417
- function requestTiles(tileset, isAsync) {
2418
- // Sort requests by priority before making any requests.
2419
- // This makes it less likely that requests will be cancelled after being issued.
2622
+ /**
2623
+ * Sort requests by priority before making any requests.
2624
+ * This makes it less likely that requests will be cancelled after being issued.
2625
+ * @private
2626
+ * @param {Cesium3DTileset} tileset
2627
+ */
2628
+ function requestTiles(tileset) {
2420
2629
  const requestedTiles = tileset._requestedTiles;
2421
- const length = requestedTiles.length;
2422
2630
  requestedTiles.sort(sortRequestByPriority);
2423
- for (let i = 0; i < length; ++i) {
2631
+ for (let i = 0; i < requestedTiles.length; ++i) {
2424
2632
  requestContent(tileset, requestedTiles[i]);
2425
2633
  }
2426
2634
  }
2427
2635
 
2428
- function addToProcessingQueue(tileset, tile) {
2429
- return function () {
2430
- tileset._processingQueue.push(tile);
2431
-
2432
- ++tileset._statistics.numberOfTilesProcessing;
2433
- };
2434
- }
2435
-
2436
- function handleTileFailure(tileset, tile) {
2437
- return function (error) {
2438
- if (tile._contentState !== Cesium3DTileContentState.FAILED) {
2439
- // If the tile has not failed, the request has been rejected this frame, but will be retried. Do not bubble up the error.
2440
- return;
2441
- }
2442
-
2443
- const url = tile._contentResource.url;
2444
- const message = defined(error.message) ? error.message : error.toString();
2445
- if (tileset.tileFailed.numberOfListeners > 0) {
2446
- tileset.tileFailed.raiseEvent({
2447
- url: url,
2448
- message: message,
2449
- });
2450
- } else {
2451
- console.log(`A 3D tile failed to load: ${url}`);
2452
- console.log(`Error: ${message}`);
2453
- }
2454
- };
2455
- }
2456
-
2457
- function handleTileSuccess(tileset, tile) {
2458
- return function (content) {
2459
- --tileset._statistics.numberOfTilesProcessing;
2460
-
2461
- if (!defined(content)) {
2462
- // A request was cancelled. Do not update successful statistics. The request will be retried.
2463
- return;
2464
- }
2465
-
2466
- if (!tile.hasTilesetContent && !tile.hasImplicitContent) {
2467
- // RESEARCH_IDEA: ability to unload tiles (without content) for an
2468
- // external tileset when all the tiles are unloaded.
2469
- tileset._statistics.incrementLoadCounts(tile.content);
2470
- ++tileset._statistics.numberOfTilesWithContentReady;
2471
- ++tileset._statistics.numberOfLoadedTilesTotal;
2636
+ /**
2637
+ * @private
2638
+ * @param {Error} error
2639
+ * @param {Cesium3DTileset} tileset
2640
+ * @param {Cesium3DTile} tile
2641
+ */
2642
+ function handleTileFailure(error, tileset, tile) {
2643
+ if (tileset.isDestroyed()) {
2644
+ return;
2645
+ }
2472
2646
 
2473
- // Add to the tile cache. Previously expired tiles are already in the cache and won't get re-added.
2474
- tileset._cache.add(tile);
2475
- }
2647
+ let url;
2648
+ if (!tile.isDestroyed()) {
2649
+ url = tile._contentResource.url;
2650
+ }
2476
2651
 
2477
- tileset.tileLoad.raiseEvent(tile);
2478
- };
2652
+ const message = defined(error.message) ? error.message : error.toString();
2653
+ if (tileset.tileFailed.numberOfListeners > 0) {
2654
+ tileset.tileFailed.raiseEvent({
2655
+ url: url,
2656
+ message: message,
2657
+ });
2658
+ } else {
2659
+ console.log(`A 3D tile failed to load: ${url}`);
2660
+ console.log(`Error: ${message}`);
2661
+ }
2479
2662
  }
2480
2663
 
2664
+ /**
2665
+ * @private
2666
+ * @param {Cesium3DTileset} tileset
2667
+ */
2481
2668
  function filterProcessingQueue(tileset) {
2482
2669
  const tiles = tileset._processingQueue;
2483
- const length = tiles.length;
2484
2670
 
2485
2671
  let removeCount = 0;
2486
- for (let i = 0; i < length; ++i) {
2672
+ for (let i = 0; i < tiles.length; ++i) {
2487
2673
  const tile = tiles[i];
2488
- if (tile._contentState !== Cesium3DTileContentState.PROCESSING) {
2674
+ if (
2675
+ tile.isDestroyed() ||
2676
+ tile._contentState !== Cesium3DTileContentState.PROCESSING
2677
+ ) {
2489
2678
  ++removeCount;
2490
2679
  continue;
2491
2680
  }
@@ -2496,24 +2685,44 @@ function filterProcessingQueue(tileset) {
2496
2685
  tiles.length -= removeCount;
2497
2686
  }
2498
2687
 
2688
+ /**
2689
+ * Process tiles in the PROCESSING state so they will eventually move to the READY state.
2690
+ * @private
2691
+ * @param {Cesium3DTileset} tileset
2692
+ * @param {Cesium3DTile} tile
2693
+ */
2499
2694
  function processTiles(tileset, frameState) {
2500
2695
  filterProcessingQueue(tileset);
2501
2696
  const tiles = tileset._processingQueue;
2502
- const length = tiles.length;
2503
- // Process tiles in the PROCESSING state so they will eventually move to the READY state.
2504
- for (let i = 0; i < length; ++i) {
2505
- tiles[i].process(tileset, frameState);
2697
+ const statistics = tileset._statistics;
2698
+ let tile;
2699
+ for (let i = 0; i < tiles.length; ++i) {
2700
+ tile = tiles[i];
2701
+ try {
2702
+ tile.process(tileset, frameState);
2703
+
2704
+ if (tile.contentReady) {
2705
+ --statistics.numberOfTilesProcessing;
2706
+ tileset.tileLoad.raiseEvent(tile);
2707
+ }
2708
+ } catch (error) {
2709
+ --statistics.numberOfTilesProcessing;
2710
+ handleTileFailure(error, tileset, tile);
2711
+ }
2506
2712
  }
2507
2713
  }
2508
2714
 
2509
- ///////////////////////////////////////////////////////////////////////////
2510
-
2511
2715
  const scratchCartesian = new Cartesian3();
2512
2716
 
2513
2717
  const stringOptions = {
2514
2718
  maximumFractionDigits: 3,
2515
2719
  };
2516
2720
 
2721
+ /**
2722
+ * @private
2723
+ * @param {number} memorySizeInBytes
2724
+ * @returns {string}
2725
+ */
2517
2726
  function formatMemoryString(memorySizeInBytes) {
2518
2727
  const memoryInMegabytes = memorySizeInBytes / 1048576;
2519
2728
  if (memoryInMegabytes < 1.0) {
@@ -2522,28 +2731,38 @@ function formatMemoryString(memorySizeInBytes) {
2522
2731
  return Math.round(memoryInMegabytes).toLocaleString();
2523
2732
  }
2524
2733
 
2734
+ /**
2735
+ * @private
2736
+ * @param {Cesium3DTile} tile
2737
+ * @returns {Cartesian3}
2738
+ */
2525
2739
  function computeTileLabelPosition(tile) {
2526
- const boundingVolume = tile.boundingVolume.boundingVolume;
2527
- const halfAxes = boundingVolume.halfAxes;
2528
- const radius = boundingVolume.radius;
2740
+ const { halfAxes, radius, center } = tile.boundingVolume.boundingVolume;
2529
2741
 
2530
- let position = Cartesian3.clone(boundingVolume.center, scratchCartesian);
2742
+ let position = Cartesian3.clone(center, scratchCartesian);
2531
2743
  if (defined(halfAxes)) {
2532
2744
  position.x += 0.75 * (halfAxes[0] + halfAxes[3] + halfAxes[6]);
2533
2745
  position.y += 0.75 * (halfAxes[1] + halfAxes[4] + halfAxes[7]);
2534
2746
  position.z += 0.75 * (halfAxes[2] + halfAxes[5] + halfAxes[8]);
2535
2747
  } else if (defined(radius)) {
2536
- let normal = Cartesian3.normalize(boundingVolume.center, scratchCartesian);
2748
+ let normal = Cartesian3.normalize(center, scratchCartesian);
2537
2749
  normal = Cartesian3.multiplyByScalar(
2538
2750
  normal,
2539
2751
  0.75 * radius,
2540
2752
  scratchCartesian
2541
2753
  );
2542
- position = Cartesian3.add(normal, boundingVolume.center, scratchCartesian);
2754
+ position = Cartesian3.add(normal, center, scratchCartesian);
2543
2755
  }
2544
2756
  return position;
2545
2757
  }
2546
2758
 
2759
+ /**
2760
+ * @private
2761
+ * @param {Cesium3DTile} tile
2762
+ * @param {Cesium3DTileset} tileset
2763
+ * @param {Cartesian3} position
2764
+ * @returns {Label}
2765
+ */
2547
2766
  function addTileDebugLabel(tile, tileset, position) {
2548
2767
  let labelString = "";
2549
2768
  let attributes = 0;
@@ -2609,9 +2828,12 @@ function addTileDebugLabel(tile, tileset, position) {
2609
2828
  return tileset._tileDebugLabels.add(newLabel);
2610
2829
  }
2611
2830
 
2831
+ /**
2832
+ * @private
2833
+ * @param {Cesium3DTileset} tileset
2834
+ * @param {FrameState} frameState
2835
+ */
2612
2836
  function updateTileDebugLabels(tileset, frameState) {
2613
- let i;
2614
- let tile;
2615
2837
  const selectedTiles = tileset._selectedTiles;
2616
2838
  const selectedLength = selectedTiles.length;
2617
2839
  const emptyTiles = tileset._emptyTiles;
@@ -2631,12 +2853,12 @@ function updateTileDebugLabels(tileset, frameState) {
2631
2853
  label.pixelOffset = new Cartesian2(15, -15); // Offset to avoid picking the label.
2632
2854
  }
2633
2855
  } else {
2634
- for (i = 0; i < selectedLength; ++i) {
2635
- tile = selectedTiles[i];
2856
+ for (let i = 0; i < selectedLength; ++i) {
2857
+ const tile = selectedTiles[i];
2636
2858
  addTileDebugLabel(tile, tileset, computeTileLabelPosition(tile));
2637
2859
  }
2638
- for (i = 0; i < emptyLength; ++i) {
2639
- tile = emptyTiles[i];
2860
+ for (let i = 0; i < emptyLength; ++i) {
2861
+ const tile = emptyTiles[i];
2640
2862
  if (tile.hasTilesetContent || tile.hasImplicitContent) {
2641
2863
  addTileDebugLabel(tile, tileset, computeTileLabelPosition(tile));
2642
2864
  }
@@ -2645,27 +2867,25 @@ function updateTileDebugLabels(tileset, frameState) {
2645
2867
  tileset._tileDebugLabels.update(frameState);
2646
2868
  }
2647
2869
 
2870
+ /**
2871
+ * @private
2872
+ * @param {Cesium3DTileset} tileset
2873
+ * @param {FrameState} frameState
2874
+ * @param {object} passOptions
2875
+ */
2648
2876
  function updateTiles(tileset, frameState, passOptions) {
2649
2877
  tileset._styleEngine.applyStyle(tileset);
2650
2878
  tileset._styleApplied = true;
2651
2879
 
2652
- const isRender = passOptions.isRender;
2653
- const statistics = tileset._statistics;
2654
- const commandList = frameState.commandList;
2880
+ const { commandList, context } = frameState;
2655
2881
  const numberOfInitialCommands = commandList.length;
2656
2882
  const selectedTiles = tileset._selectedTiles;
2657
- const selectedLength = selectedTiles.length;
2658
- const emptyTiles = tileset._emptyTiles;
2659
- const emptyLength = emptyTiles.length;
2660
- const tileVisible = tileset.tileVisible;
2661
- let i;
2662
- let tile;
2663
2883
 
2664
2884
  const bivariateVisibilityTest =
2665
- tileset._skipLevelOfDetail &&
2885
+ tileset.isSkippingLevelOfDetail &&
2666
2886
  tileset._hasMixedContent &&
2667
- frameState.context.stencilBuffer &&
2668
- selectedLength > 0;
2887
+ context.stencilBuffer &&
2888
+ selectedTiles.length > 0;
2669
2889
 
2670
2890
  tileset._backfaceCommands.length = 0;
2671
2891
 
@@ -2682,9 +2902,12 @@ function updateTiles(tileset, frameState, passOptions) {
2682
2902
  commandList.push(tileset._stencilClearCommand);
2683
2903
  }
2684
2904
 
2905
+ const { statistics, tileVisible } = tileset;
2906
+ const isRender = passOptions.isRender;
2685
2907
  const lengthBeforeUpdate = commandList.length;
2686
- for (i = 0; i < selectedLength; ++i) {
2687
- tile = selectedTiles[i];
2908
+
2909
+ for (let i = 0; i < selectedTiles.length; ++i) {
2910
+ const tile = selectedTiles[i];
2688
2911
  // Raise the tileVisible event before update in case the tileVisible event
2689
2912
  // handler makes changes that update needs to apply to WebGL resources
2690
2913
  if (isRender) {
@@ -2694,8 +2917,9 @@ function updateTiles(tileset, frameState, passOptions) {
2694
2917
  statistics.incrementSelectionCounts(tile.content);
2695
2918
  ++statistics.selected;
2696
2919
  }
2697
- for (i = 0; i < emptyLength; ++i) {
2698
- tile = emptyTiles[i];
2920
+ const emptyTiles = tileset._emptyTiles;
2921
+ for (let i = 0; i < emptyTiles.length; ++i) {
2922
+ const tile = emptyTiles[i];
2699
2923
  tile.update(tileset, frameState, passOptions);
2700
2924
  }
2701
2925
 
@@ -2734,13 +2958,13 @@ function updateTiles(tileset, frameState, passOptions) {
2734
2958
  commandList.length += backfaceCommandsLength;
2735
2959
 
2736
2960
  // copy commands to the back of the commandList
2737
- for (i = addedCommandsLength - 1; i >= 0; --i) {
2961
+ for (let i = addedCommandsLength - 1; i >= 0; --i) {
2738
2962
  commandList[lengthBeforeUpdate + backfaceCommandsLength + i] =
2739
2963
  commandList[lengthBeforeUpdate + i];
2740
2964
  }
2741
2965
 
2742
2966
  // move backface commands to the front of the commandList
2743
- for (i = 0; i < backfaceCommandsLength; ++i) {
2967
+ for (let i = 0; i < backfaceCommandsLength; ++i) {
2744
2968
  commandList[lengthBeforeUpdate + i] = backfaceCommands[i];
2745
2969
  }
2746
2970
  }
@@ -2749,9 +2973,12 @@ function updateTiles(tileset, frameState, passOptions) {
2749
2973
  addedCommandsLength = commandList.length - numberOfInitialCommands;
2750
2974
  statistics.numberOfCommands = addedCommandsLength;
2751
2975
 
2976
+ if (!isRender) {
2977
+ return;
2978
+ }
2979
+
2752
2980
  // Only run EDL if simple attenuation is on
2753
2981
  if (
2754
- isRender &&
2755
2982
  tileset.pointCloudShading.attenuation &&
2756
2983
  tileset.pointCloudShading.eyeDomeLighting &&
2757
2984
  addedCommandsLength > 0
@@ -2764,26 +2991,29 @@ function updateTiles(tileset, frameState, passOptions) {
2764
2991
  );
2765
2992
  }
2766
2993
 
2767
- if (isRender) {
2768
- if (
2769
- tileset.debugShowGeometricError ||
2770
- tileset.debugShowRenderingStatistics ||
2771
- tileset.debugShowMemoryUsage ||
2772
- tileset.debugShowUrl
2773
- ) {
2774
- if (!defined(tileset._tileDebugLabels)) {
2775
- tileset._tileDebugLabels = new LabelCollection();
2776
- }
2777
- updateTileDebugLabels(tileset, frameState);
2778
- } else {
2779
- tileset._tileDebugLabels =
2780
- tileset._tileDebugLabels && tileset._tileDebugLabels.destroy();
2994
+ if (
2995
+ tileset.debugShowGeometricError ||
2996
+ tileset.debugShowRenderingStatistics ||
2997
+ tileset.debugShowMemoryUsage ||
2998
+ tileset.debugShowUrl
2999
+ ) {
3000
+ if (!defined(tileset._tileDebugLabels)) {
3001
+ tileset._tileDebugLabels = new LabelCollection();
2781
3002
  }
3003
+ updateTileDebugLabels(tileset, frameState);
3004
+ } else {
3005
+ tileset._tileDebugLabels =
3006
+ tileset._tileDebugLabels && tileset._tileDebugLabels.destroy();
2782
3007
  }
2783
3008
  }
2784
3009
 
2785
3010
  const scratchStack = [];
2786
3011
 
3012
+ /**
3013
+ * @private
3014
+ * @param {Cesium3DTileset} tileset
3015
+ * @param {Cesium3DTile} tile
3016
+ */
2787
3017
  function destroySubtree(tileset, tile) {
2788
3018
  const root = tile;
2789
3019
  const stack = scratchStack;
@@ -2791,8 +3021,7 @@ function destroySubtree(tileset, tile) {
2791
3021
  while (stack.length > 0) {
2792
3022
  tile = stack.pop();
2793
3023
  const children = tile.children;
2794
- const length = children.length;
2795
- for (let i = 0; i < length; ++i) {
3024
+ for (let i = 0; i < children.length; ++i) {
2796
3025
  stack.push(children[i]);
2797
3026
  }
2798
3027
  if (tile !== root) {
@@ -2803,6 +3032,11 @@ function destroySubtree(tileset, tile) {
2803
3032
  root.children = [];
2804
3033
  }
2805
3034
 
3035
+ /**
3036
+ * @private
3037
+ * @param {Cesium3DTileset} tileset
3038
+ * @param {Cesium3DTile} tile
3039
+ */
2806
3040
  function unloadTile(tileset, tile) {
2807
3041
  tileset.tileUnload.raiseEvent(tile);
2808
3042
  tileset._statistics.decrementLoadCounts(tile.content);
@@ -2810,6 +3044,11 @@ function unloadTile(tileset, tile) {
2810
3044
  tile.unloadContent();
2811
3045
  }
2812
3046
 
3047
+ /**
3048
+ * @private
3049
+ * @param {Cesium3DTileset} tileset
3050
+ * @param {Cesium3DTile} tile
3051
+ */
2813
3052
  function destroyTile(tileset, tile) {
2814
3053
  tileset._cache.unloadTile(tileset, tile, unloadTile);
2815
3054
  tile.destroy();
@@ -2828,8 +3067,11 @@ Cesium3DTileset.prototype.trimLoadedTiles = function () {
2828
3067
  this._cache.trim();
2829
3068
  };
2830
3069
 
2831
- ///////////////////////////////////////////////////////////////////////////
2832
-
3070
+ /**
3071
+ * @private
3072
+ * @param {Cesium3DTileset} tileset
3073
+ * @param {FrameState} frameState
3074
+ */
2833
3075
  function raiseLoadProgressEvent(tileset, frameState) {
2834
3076
  const statistics = tileset._statistics;
2835
3077
  const statisticsLast = tileset._statisticsLast;
@@ -2863,7 +3105,7 @@ function raiseLoadProgressEvent(tileset, frameState) {
2863
3105
 
2864
3106
  // Events are raised (added to the afterRender queue) here since promises
2865
3107
  // may resolve outside of the update loop that then raise events, e.g.,
2866
- // model's readyPromise.
3108
+ // model's readyEvent
2867
3109
  if (progressChanged && tileset._tilesLoaded) {
2868
3110
  frameState.afterRender.push(function () {
2869
3111
  tileset.allTilesLoaded.raiseEvent();
@@ -2879,6 +3121,10 @@ function raiseLoadProgressEvent(tileset, frameState) {
2879
3121
  }
2880
3122
  }
2881
3123
 
3124
+ /**
3125
+ * @private
3126
+ * @param {Cesium3DTileset} tileset
3127
+ */
2882
3128
  function resetMinimumMaximum(tileset) {
2883
3129
  tileset._heatmap.resetMinimumMaximum();
2884
3130
  tileset._minimumPriority.depth = Number.MAX_VALUE;
@@ -2891,41 +3137,52 @@ function resetMinimumMaximum(tileset) {
2891
3137
  tileset._maximumPriority.reverseScreenSpaceError = -Number.MAX_VALUE;
2892
3138
  }
2893
3139
 
3140
+ /**
3141
+ * @private
3142
+ * @param {Cesium3DTileset} tileset
3143
+ * @param {FrameState} frameState
3144
+ */
2894
3145
  function detectModelMatrixChanged(tileset, frameState) {
2895
3146
  if (
2896
- frameState.frameNumber !== tileset._updatedModelMatrixFrame ||
2897
- !defined(tileset._previousModelMatrix)
3147
+ frameState.frameNumber === tileset._updatedModelMatrixFrame &&
3148
+ defined(tileset._previousModelMatrix)
2898
3149
  ) {
2899
- tileset._updatedModelMatrixFrame = frameState.frameNumber;
2900
- tileset._modelMatrixChanged = !Matrix4.equals(
3150
+ return;
3151
+ }
3152
+
3153
+ tileset._updatedModelMatrixFrame = frameState.frameNumber;
3154
+ tileset._modelMatrixChanged = !Matrix4.equals(
3155
+ tileset.modelMatrix,
3156
+ tileset._previousModelMatrix
3157
+ );
3158
+ if (tileset._modelMatrixChanged) {
3159
+ tileset._previousModelMatrix = Matrix4.clone(
2901
3160
  tileset.modelMatrix,
2902
3161
  tileset._previousModelMatrix
2903
3162
  );
2904
- if (tileset._modelMatrixChanged) {
2905
- tileset._previousModelMatrix = Matrix4.clone(
2906
- tileset.modelMatrix,
2907
- tileset._previousModelMatrix
2908
- );
2909
- }
2910
3163
  }
2911
3164
  }
2912
3165
 
2913
- ///////////////////////////////////////////////////////////////////////////
2914
-
3166
+ /**
3167
+ * @private
3168
+ * @param {Cesium3DTileset} tileset
3169
+ * @param {FrameState} frameState
3170
+ * @param {Cesium3DTilesetStatistics} passStatistics
3171
+ * @param {object} passOptions
3172
+ * @returns {boolean}
3173
+ */
2915
3174
  function update(tileset, frameState, passStatistics, passOptions) {
2916
3175
  if (frameState.mode === SceneMode.MORPHING) {
2917
3176
  return false;
2918
3177
  }
2919
3178
 
2920
- if (!tileset.ready) {
3179
+ if (!defined(tileset._root)) {
2921
3180
  return false;
2922
3181
  }
2923
3182
 
2924
3183
  const statistics = tileset._statistics;
2925
3184
  statistics.clear();
2926
3185
 
2927
- const isRender = passOptions.isRender;
2928
-
2929
3186
  // Resets the visibility check for each pass
2930
3187
  ++tileset._updatedVisibilityFrame;
2931
3188
 
@@ -2936,7 +3193,9 @@ function update(tileset, frameState, passStatistics, passOptions) {
2936
3193
  tileset._cullRequestsWhileMoving =
2937
3194
  tileset.cullRequestsWhileMoving && !tileset._modelMatrixChanged;
2938
3195
 
2939
- const ready = passOptions.traversal.selectTiles(tileset, frameState);
3196
+ const ready = tileset
3197
+ .getTraversal(passOptions)
3198
+ .selectTiles(tileset, frameState);
2940
3199
 
2941
3200
  if (passOptions.requestTiles) {
2942
3201
  requestTiles(tileset);
@@ -2947,11 +3206,10 @@ function update(tileset, frameState, passStatistics, passOptions) {
2947
3206
  // Update pass statistics
2948
3207
  Cesium3DTilesetStatistics.clone(statistics, passStatistics);
2949
3208
 
2950
- if (isRender) {
3209
+ if (passOptions.isRender) {
2951
3210
  const credits = tileset._credits;
2952
3211
  if (defined(credits) && statistics.selected !== 0) {
2953
- const length = credits.length;
2954
- for (let i = 0; i < length; ++i) {
3212
+ for (let i = 0; i < credits.length; ++i) {
2955
3213
  const credit = credits[i];
2956
3214
  credit.showOnScreen = tileset._showCreditsOnScreen;
2957
3215
  frameState.creditDisplay.addCredit(credit);
@@ -2964,6 +3222,25 @@ function update(tileset, frameState, passStatistics, passOptions) {
2964
3222
 
2965
3223
  /**
2966
3224
  * @private
3225
+ * @param {object} passOptions
3226
+ * @returns {Cesium3DTilesetTraversal}
3227
+ */
3228
+ Cesium3DTileset.prototype.getTraversal = function (passOptions) {
3229
+ const { pass } = passOptions;
3230
+ if (
3231
+ pass === Cesium3DTilePass.MOST_DETAILED_PRELOAD ||
3232
+ pass === Cesium3DTilePass.MOST_DETAILED_PICK
3233
+ ) {
3234
+ return Cesium3DTilesetMostDetailedTraversal;
3235
+ }
3236
+ return this.isSkippingLevelOfDetail
3237
+ ? Cesium3DTilesetSkipTraversal
3238
+ : Cesium3DTilesetBaseTraversal;
3239
+ };
3240
+
3241
+ /**
3242
+ * @private
3243
+ * @param {FrameState} frameState
2967
3244
  */
2968
3245
  Cesium3DTileset.prototype.update = function (frameState) {
2969
3246
  this.updateForPass(frameState, frameState.tilesetPassState);
@@ -2971,6 +3248,8 @@ Cesium3DTileset.prototype.update = function (frameState) {
2971
3248
 
2972
3249
  /**
2973
3250
  * @private
3251
+ * @param {FrameState} frameState
3252
+ * @param {object} tilesetPassState
2974
3253
  */
2975
3254
  Cesium3DTileset.prototype.updateForPass = function (
2976
3255
  frameState,
@@ -3040,9 +3319,9 @@ Cesium3DTileset.prototype.updateForPass = function (
3040
3319
 
3041
3320
  /**
3042
3321
  * <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
3043
- * @param {String} extensionName The name of the extension to check.
3322
+ * @param {string} extensionName The name of the extension to check.
3044
3323
  *
3045
- * @returns {Boolean} <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
3324
+ * @returns {boolean} <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
3046
3325
  */
3047
3326
  Cesium3DTileset.prototype.hasExtension = function (extensionName) {
3048
3327
  if (!defined(this._extensionsUsed)) {
@@ -3058,7 +3337,7 @@ Cesium3DTileset.prototype.hasExtension = function (extensionName) {
3058
3337
  * If this object was destroyed, it should not be used; calling any function other than
3059
3338
  * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
3060
3339
  *
3061
- * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
3340
+ * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
3062
3341
  *
3063
3342
  * @see Cesium3DTileset#destroy
3064
3343
  */
@@ -3086,10 +3365,6 @@ Cesium3DTileset.prototype.destroy = function () {
3086
3365
  this._tileDebugLabels && this._tileDebugLabels.destroy();
3087
3366
  this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy();
3088
3367
 
3089
- if (defined(this._schemaLoader)) {
3090
- ResourceCache.unload(this._schemaLoader);
3091
- }
3092
-
3093
3368
  // Traverse the tree and destroy all tiles
3094
3369
  if (defined(this._root)) {
3095
3370
  const stack = scratchStack;
@@ -3100,8 +3375,7 @@ Cesium3DTileset.prototype.destroy = function () {
3100
3375
  tile.destroy();
3101
3376
 
3102
3377
  const children = tile.children;
3103
- const length = children.length;
3104
- for (let i = 0; i < length; ++i) {
3378
+ for (let i = 0; i < children.length; ++i) {
3105
3379
  stack.push(children[i]);
3106
3380
  }
3107
3381
  }
@@ -3134,7 +3408,7 @@ Cesium3DTileset.supportedExtensions = {
3134
3408
  * Checks to see if a given extension is supported by Cesium3DTileset. If
3135
3409
  * the extension is not supported by Cesium3DTileset, it throws a RuntimeError.
3136
3410
  *
3137
- * @param {Object} extensionsRequired The extensions we wish to check
3411
+ * @param {object} extensionsRequired The extensions we wish to check
3138
3412
  *
3139
3413
  * @private
3140
3414
  */
@@ -3155,9 +3429,9 @@ Cesium3DTileset.checkSupportedExtensions = function (extensionsRequired) {
3155
3429
  * @callback Cesium3DTileset.foveatedInterpolationCallback
3156
3430
  * @default Math.lerp
3157
3431
  *
3158
- * @param {Number} p The start value to interpolate.
3159
- * @param {Number} q The end value to interpolate.
3160
- * @param {Number} time The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
3161
- * @returns {Number} The interpolated value.
3432
+ * @param {number} p The start value to interpolate.
3433
+ * @param {number} q The end value to interpolate.
3434
+ * @param {number} time The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
3435
+ * @returns {number} The interpolated value.
3162
3436
  */
3163
3437
  export default Cesium3DTileset;