@cesium/engine 9.2.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/Build/Workers/{chunk-WOYQB5HM.js → chunk-2J3JKXCP.js} +5 -5
  2. package/Build/Workers/{chunk-IXYFH7DV.js → chunk-3WUV74WM.js} +2 -2
  3. package/Build/Workers/{chunk-3PV5HQ2R.js → chunk-4BAE4PWO.js} +6 -6
  4. package/Build/Workers/{chunk-WHDEZSAL.js → chunk-4MSUJ4I7.js} +8 -8
  5. package/Build/Workers/{chunk-ZHJDE6JN.js → chunk-4YSNMHZ4.js} +6 -6
  6. package/Build/Workers/{chunk-LZFFO4KB.js → chunk-5S7OLEPK.js} +12 -12
  7. package/Build/Workers/{chunk-GX2BWBN2.js → chunk-7XGC6YB2.js} +14 -14
  8. package/Build/Workers/{chunk-IF2OX6R4.js → chunk-AA4GZKOT.js} +1 -1
  9. package/Build/Workers/{chunk-26NE4LRW.js → chunk-AD5HBJ2F.js} +11 -8
  10. package/Build/Workers/{chunk-4RG6WOXH.js → chunk-AVI4IUWC.js} +11 -11
  11. package/Build/Workers/{chunk-3VDHTBY5.js → chunk-BCL4PHHT.js} +10 -10
  12. package/Build/Workers/{chunk-WP3LCUOE.js → chunk-BDFNKFOE.js} +13 -13
  13. package/Build/Workers/{chunk-KTZK2UDR.js → chunk-BJF5LOWE.js} +7 -7
  14. package/Build/Workers/{chunk-W4OS542B.js → chunk-C2CGMAIU.js} +13 -13
  15. package/Build/Workers/{chunk-EJZVBTX4.js → chunk-COYFZ5VA.js} +6 -6
  16. package/Build/Workers/{chunk-PHT53MCH.js → chunk-DGS5QNIO.js} +13 -13
  17. package/Build/Workers/{chunk-UYKG3UFK.js → chunk-DKVHRNFY.js} +5 -5
  18. package/Build/Workers/{chunk-7PFZ4Z7C.js → chunk-DOXCPOG4.js} +11 -9
  19. package/Build/Workers/{chunk-A5CSB5ZE.js → chunk-FXIHSF7O.js} +9 -9
  20. package/Build/Workers/{chunk-GOQEANLM.js → chunk-G3YR53LY.js} +13 -13
  21. package/Build/Workers/{chunk-7HLZRYGD.js → chunk-GR3CDLCP.js} +7 -7
  22. package/Build/Workers/{chunk-YGNQJ4YI.js → chunk-GRAT5GE7.js} +5 -5
  23. package/Build/Workers/{chunk-SC3TBKST.js → chunk-I2RC4XVN.js} +4 -4
  24. package/Build/Workers/{chunk-26XJDV3D.js → chunk-JYAHOGGL.js} +15 -15
  25. package/Build/Workers/{chunk-RRUO4QEK.js → chunk-KUN2ZA5X.js} +4 -4
  26. package/Build/Workers/{chunk-BBBTT36L.js → chunk-L6RTJ3RE.js} +14 -14
  27. package/Build/Workers/{chunk-RDR4KVPA.js → chunk-LCLJJ2MZ.js} +18 -18
  28. package/Build/Workers/{chunk-BNT2SNWU.js → chunk-LEABCTLP.js} +4 -4
  29. package/Build/Workers/{chunk-I6CW7ZE5.js → chunk-MDHQR3ZS.js} +10 -8
  30. package/Build/Workers/{chunk-ETC45PHH.js → chunk-MSKXMXJI.js} +4 -4
  31. package/Build/Workers/{chunk-QZIWFSRM.js → chunk-NTXTUNEF.js} +4 -4
  32. package/Build/Workers/{chunk-GUFV24F4.js → chunk-O3JCMSS3.js} +17 -17
  33. package/Build/Workers/{chunk-UICVDDCQ.js → chunk-OOK53QUQ.js} +1 -1
  34. package/Build/Workers/{chunk-G7IAO7CW.js → chunk-OORVMGDU.js} +7 -7
  35. package/Build/Workers/{chunk-OYP23VAL.js → chunk-PCP4YQST.js} +11 -11
  36. package/Build/Workers/{chunk-GX5LMUGZ.js → chunk-PYHLO636.js} +42 -13
  37. package/Build/Workers/{chunk-TDIGL45B.js → chunk-Q55ECN3Y.js} +1 -1
  38. package/Build/Workers/{chunk-5OK5JFDP.js → chunk-QD4KM3GO.js} +5 -5
  39. package/Build/Workers/{chunk-CVCVMOQA.js → chunk-QMLTCCYG.js} +1 -1
  40. package/Build/Workers/{chunk-AROLUUGS.js → chunk-QX5XS4LC.js} +2 -2
  41. package/Build/Workers/{chunk-TP4FFUAH.js → chunk-R6B7UCQB.js} +2 -2
  42. package/Build/Workers/{chunk-U6MTSO6A.js → chunk-RJYML24O.js} +11 -11
  43. package/Build/Workers/{chunk-DIVFF6DK.js → chunk-S3PI2KFM.js} +2 -2
  44. package/Build/Workers/{chunk-PUQR43HZ.js → chunk-STBBMQGG.js} +6 -6
  45. package/Build/Workers/{chunk-CFBGPZU6.js → chunk-SYCPRK3D.js} +10 -10
  46. package/Build/Workers/{chunk-U2LSTOMA.js → chunk-T77JILCU.js} +2 -2
  47. package/Build/Workers/{chunk-RTIT7UDN.js → chunk-TO2PVHKI.js} +2 -2
  48. package/Build/Workers/{chunk-EODIOQ35.js → chunk-VE7BFUIX.js} +1 -1
  49. package/Build/Workers/{chunk-K5F23SZO.js → chunk-VFBNELXB.js} +7 -7
  50. package/Build/Workers/{chunk-YGTWKLFY.js → chunk-VO3ACQB2.js} +19 -19
  51. package/Build/Workers/{chunk-UKJCFXVV.js → chunk-X23FRWHJ.js} +6 -6
  52. package/Build/Workers/{chunk-2TRB253J.js → chunk-XD445VDH.js} +7 -7
  53. package/Build/Workers/combineGeometry.js +22 -22
  54. package/Build/Workers/createBoxGeometry.js +16 -16
  55. package/Build/Workers/createBoxOutlineGeometry.js +14 -14
  56. package/Build/Workers/createCircleGeometry.js +29 -25
  57. package/Build/Workers/createCircleOutlineGeometry.js +17 -17
  58. package/Build/Workers/createCoplanarPolygonGeometry.js +32 -32
  59. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
  60. package/Build/Workers/createCorridorGeometry.js +29 -29
  61. package/Build/Workers/createCorridorOutlineGeometry.js +27 -27
  62. package/Build/Workers/createCylinderGeometry.js +18 -18
  63. package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
  64. package/Build/Workers/createEllipseGeometry.js +24 -24
  65. package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
  66. package/Build/Workers/createEllipsoidGeometry.js +17 -17
  67. package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
  68. package/Build/Workers/createFrustumGeometry.js +16 -16
  69. package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
  70. package/Build/Workers/createGeometry.js +22 -22
  71. package/Build/Workers/createGroundPolylineGeometry.js +24 -24
  72. package/Build/Workers/createPlaneGeometry.js +14 -14
  73. package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
  74. package/Build/Workers/createPolygonGeometry.js +32 -32
  75. package/Build/Workers/createPolygonOutlineGeometry.js +29 -29
  76. package/Build/Workers/createPolylineGeometry.js +24 -24
  77. package/Build/Workers/createPolylineVolumeGeometry.js +30 -30
  78. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +26 -26
  79. package/Build/Workers/createRectangleGeometry.js +27 -27
  80. package/Build/Workers/createRectangleOutlineGeometry.js +19 -19
  81. package/Build/Workers/createSimplePolylineGeometry.js +22 -22
  82. package/Build/Workers/createSphereGeometry.js +17 -17
  83. package/Build/Workers/createSphereOutlineGeometry.js +16 -16
  84. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  85. package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
  86. package/Build/Workers/createVectorTileGeometries.js +22 -22
  87. package/Build/Workers/createVectorTilePoints.js +12 -12
  88. package/Build/Workers/createVectorTilePolygons.js +20 -20
  89. package/Build/Workers/createVectorTilePolylines.js +13 -13
  90. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
  91. package/Build/Workers/createVerticesFromHeightmap.js +21 -21
  92. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
  93. package/Build/Workers/createWallGeometry.js +23 -23
  94. package/Build/Workers/createWallOutlineGeometry.js +22 -22
  95. package/Build/Workers/decodeDraco.js +11 -11
  96. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  97. package/Build/Workers/decodeI3S.js +10 -10
  98. package/Build/Workers/transcodeKTX2.js +7 -7
  99. package/Build/Workers/transferTypedArrayTest.js +1 -1
  100. package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
  101. package/Source/Core/ApproximateTerrainHeights.js +4 -4
  102. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +12 -8
  103. package/Source/Core/BoundingRectangle.js +2 -0
  104. package/Source/Core/BoundingSphere.js +4 -2
  105. package/Source/Core/Cartesian3.js +13 -10
  106. package/Source/Core/Cartographic.js +11 -8
  107. package/Source/Core/CesiumTerrainProvider.js +3 -2
  108. package/Source/Core/CircleGeometry.js +6 -2
  109. package/Source/Core/CircleOutlineGeometry.js +1 -1
  110. package/Source/Core/CoplanarPolygonGeometry.js +3 -3
  111. package/Source/Core/CorridorGeometry.js +4 -4
  112. package/Source/Core/CorridorOutlineGeometry.js +2 -2
  113. package/Source/Core/Credit.js +3 -2
  114. package/Source/Core/CustomHeightmapTerrainProvider.js +17 -3
  115. package/Source/Core/EllipseGeometry.js +4 -4
  116. package/Source/Core/EllipseOutlineGeometry.js +2 -2
  117. package/Source/Core/Ellipsoid.js +34 -0
  118. package/Source/Core/EllipsoidGeodesic.js +2 -2
  119. package/Source/Core/EllipsoidRhumbLine.js +4 -4
  120. package/Source/Core/EllipsoidTangentPlane.js +3 -3
  121. package/Source/Core/EllipsoidTerrainProvider.js +3 -3
  122. package/Source/Core/GeographicProjection.js +4 -3
  123. package/Source/Core/GeographicTilingScheme.js +3 -3
  124. package/Source/Core/GeometryPipeline.js +2 -2
  125. package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -1
  126. package/Source/Core/GoogleMaps.js +1 -1
  127. package/Source/Core/GroundPolylineGeometry.js +1 -1
  128. package/Source/Core/HeightmapTessellator.js +2 -2
  129. package/Source/Core/Ion.js +1 -1
  130. package/Source/Core/Occluder.js +3 -3
  131. package/Source/Core/OrientedBoundingBox.js +2 -2
  132. package/Source/Core/PolygonGeometry.js +4 -4
  133. package/Source/Core/PolygonGeometryLibrary.js +1 -1
  134. package/Source/Core/PolygonOutlineGeometry.js +3 -3
  135. package/Source/Core/PolygonPipeline.js +2 -2
  136. package/Source/Core/PolylineGeometry.js +2 -2
  137. package/Source/Core/PolylinePipeline.js +6 -6
  138. package/Source/Core/PolylineVolumeGeometry.js +2 -2
  139. package/Source/Core/PolylineVolumeOutlineGeometry.js +2 -2
  140. package/Source/Core/Rectangle.js +6 -6
  141. package/Source/Core/RectangleGeometry.js +6 -6
  142. package/Source/Core/RectangleGeometryLibrary.js +3 -0
  143. package/Source/Core/RectangleOutlineGeometry.js +2 -2
  144. package/Source/Core/Simon1994PlanetaryPositions.js +3 -2
  145. package/Source/Core/SimplePolylineGeometry.js +2 -2
  146. package/Source/Core/Stereographic.js +2 -2
  147. package/Source/Core/Transforms.js +17 -17
  148. package/Source/Core/VRTheWorldTerrainProvider.js +2 -2
  149. package/Source/Core/WallGeometry.js +3 -3
  150. package/Source/Core/WallOutlineGeometry.js +3 -3
  151. package/Source/Core/WebMercatorTilingScheme.js +3 -3
  152. package/Source/Core/createWorldTerrainAsync.js +2 -0
  153. package/Source/DataSources/BoxGeometryUpdater.js +2 -2
  154. package/Source/DataSources/CylinderGeometryUpdater.js +2 -2
  155. package/Source/DataSources/CzmlDataSource.js +8 -8
  156. package/Source/DataSources/EllipsoidGeometryUpdater.js +3 -3
  157. package/Source/DataSources/EntityCluster.js +1 -1
  158. package/Source/DataSources/EntityView.js +2 -2
  159. package/Source/DataSources/KmlDataSource.js +4 -4
  160. package/Source/DataSources/ModelVisualizer.js +1 -2
  161. package/Source/DataSources/PolygonGeometryUpdater.js +1 -1
  162. package/Source/DataSources/PolylineGeometryUpdater.js +3 -2
  163. package/Source/DataSources/RectangleGeometryUpdater.js +1 -1
  164. package/Source/DataSources/ScaledPositionProperty.js +2 -2
  165. package/Source/DataSources/TerrainOffsetProperty.js +3 -7
  166. package/Source/DataSources/VelocityOrientationProperty.js +2 -2
  167. package/Source/DataSources/exportKml.js +2 -2
  168. package/Source/Renderer/UniformState.js +1 -1
  169. package/Source/Scene/ArcGisMapServerImageryProvider.js +2 -2
  170. package/Source/Scene/ArcGisMapService.js +1 -1
  171. package/Source/Scene/Billboard.js +6 -4
  172. package/Source/Scene/BingMapsImageryProvider.js +1 -1
  173. package/Source/Scene/Camera.js +16 -10
  174. package/Source/Scene/Cesium3DTileset.js +1 -1
  175. package/Source/Scene/ClippingPolygon.js +2 -2
  176. package/Source/Scene/ClippingPolygonCollection.js +1 -1
  177. package/Source/Scene/CreditDisplay.js +94 -104
  178. package/Source/Scene/Globe.js +16 -13
  179. package/Source/Scene/GltfLoaderUtil.js +2 -4
  180. package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +1 -1
  181. package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +1 -1
  182. package/Source/Scene/GridImageryProvider.js +2 -2
  183. package/Source/Scene/ImageryLayerCollection.js +2 -2
  184. package/Source/Scene/MapboxImageryProvider.js +1 -1
  185. package/Source/Scene/MapboxStyleImageryProvider.js +1 -1
  186. package/Source/Scene/MetadataSemantic.js +4 -4
  187. package/Source/Scene/Model/InstancingPipelineStage.js +3 -3
  188. package/Source/Scene/Model/MaterialPipelineStage.js +49 -0
  189. package/Source/Scene/Model/Model.js +7 -4
  190. package/Source/Scene/Model/ModelSceneGraph.js +1 -1
  191. package/Source/Scene/Model/SceneMode2DPipelineStage.js +3 -3
  192. package/Source/Scene/Model/pickModel.js +2 -2
  193. package/Source/Scene/ModelComponents.js +9 -0
  194. package/Source/Scene/Picking.js +4 -13
  195. package/Source/Scene/PointPrimitive.js +5 -2
  196. package/Source/Scene/Scene.js +39 -31
  197. package/Source/Scene/SceneTransforms.js +78 -20
  198. package/Source/Scene/SceneTransitioner.js +2 -2
  199. package/Source/Scene/ScreenSpaceCameraController.js +29 -19
  200. package/Source/Scene/SkyBox.js +26 -0
  201. package/Source/Scene/Sun.js +1 -1
  202. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -2
  203. package/Source/Shaders/Builtin/Functions/ellipsoidTextureCoordinates.glsl +10 -0
  204. package/Source/Shaders/Builtin/Functions/{ellipsoidWgs84TextureCoordinates.js → ellipsoidTextureCoordinates.js} +3 -3
  205. package/Source/Shaders/Builtin/Structs/materialInput.glsl +1 -1
  206. package/Source/Shaders/Builtin/Structs/materialInput.js +1 -1
  207. package/Source/Shaders/Builtin/Structs/modelMaterial.glsl +2 -0
  208. package/Source/Shaders/Builtin/Structs/modelMaterial.js +2 -0
  209. package/Source/Shaders/EllipsoidFS.glsl +1 -1
  210. package/Source/Shaders/EllipsoidFS.js +1 -1
  211. package/Source/Shaders/GlobeFS.glsl +2 -2
  212. package/Source/Shaders/GlobeFS.js +2 -2
  213. package/Source/Shaders/Model/MaterialStageFS.glsl +21 -12
  214. package/Source/Shaders/Model/MaterialStageFS.js +21 -12
  215. package/Source/Widget/CesiumWidget.css +0 -5
  216. package/Source/Widget/CesiumWidget.js +29 -28
  217. package/index.d.ts +181 -113
  218. package/index.js +208 -208
  219. package/package.json +2 -2
  220. package/Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.glsl +0 -10
@@ -28,6 +28,7 @@ import ImageryLayerCollection from "./ImageryLayerCollection.js";
28
28
  import QuadtreePrimitive from "./QuadtreePrimitive.js";
29
29
  import SceneMode from "./SceneMode.js";
30
30
  import ShadowMode from "./ShadowMode.js";
31
+ import CesiumMath from "../Core/Math.js";
31
32
 
32
33
  /**
33
34
  * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})
@@ -36,11 +37,11 @@ import ShadowMode from "./ShadowMode.js";
36
37
  * @alias Globe
37
38
  * @constructor
38
39
  *
39
- * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] Determines the size and shape of the
40
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] Determines the size and shape of the
40
41
  * globe.
41
42
  */
42
43
  function Globe(ellipsoid) {
43
- ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
44
+ ellipsoid = defaultValue(ellipsoid, Ellipsoid.default);
44
45
  const terrainProvider = new EllipsoidTerrainProvider({
45
46
  ellipsoid: ellipsoid,
46
47
  });
@@ -191,9 +192,9 @@ function Globe(ellipsoid) {
191
192
  * Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between <code>lightingFadeInDistance</code> and <code>lightingFadeOutDistance</code>.
192
193
  *
193
194
  * @type {boolean}
194
- * @default true
195
+ * @default true when using the WGS84 ellipsoid, false otherwise
195
196
  */
196
- this.showGroundAtmosphere = true;
197
+ this.showGroundAtmosphere = Ellipsoid.WGS84.equals(ellipsoid);
197
198
 
198
199
  /**
199
200
  * The intensity of the light that is used for computing the ground atmosphere color.
@@ -250,18 +251,19 @@ function Globe(ellipsoid) {
250
251
  * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
251
252
  *
252
253
  * @type {number}
253
- * @default 10000000.0
254
+ * @default 1/2 * pi * ellipsoid.minimumRadius
254
255
  */
255
- this.lightingFadeOutDistance = 1.0e7;
256
+ this.lightingFadeOutDistance =
257
+ CesiumMath.PI_OVER_TWO * ellipsoid.minimumRadius;
256
258
 
257
259
  /**
258
260
  * The distance where lighting resumes. This only takes effect
259
261
  * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
260
262
  *
261
263
  * @type {number}
262
- * @default 20000000.0
264
+ * @default pi * ellipsoid.minimumRadius
263
265
  */
264
- this.lightingFadeInDistance = 2.0e7;
266
+ this.lightingFadeInDistance = CesiumMath.PI * ellipsoid.minimumRadius;
265
267
 
266
268
  /**
267
269
  * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere.
@@ -269,9 +271,9 @@ function Globe(ellipsoid) {
269
271
  * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
270
272
  *
271
273
  * @type {number}
272
- * @default 10000000.0
274
+ * @default 1/2 * pi * ellipsoid.minimumRadius
273
275
  */
274
- this.nightFadeOutDistance = 1.0e7;
276
+ this.nightFadeOutDistance = CesiumMath.PI_OVER_TWO * ellipsoid.minimumRadius;
275
277
 
276
278
  /**
277
279
  * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere.
@@ -279,9 +281,10 @@ function Globe(ellipsoid) {
279
281
  * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
280
282
  *
281
283
  * @type {number}
282
- * @default 50000000.0
284
+ * @default 5/2 * pi * ellipsoid.minimumRadius
283
285
  */
284
- this.nightFadeInDistance = 5.0e7;
286
+ this.nightFadeInDistance =
287
+ 5.0 * CesiumMath.PI_OVER_TWO * ellipsoid.minimumRadius;
285
288
 
286
289
  /**
287
290
  * True if an animated wave effect should be shown in areas of the globe
@@ -809,7 +812,7 @@ Globe.prototype.pick = function (ray, scene, result) {
809
812
  if (defined(result) && scene.mode !== SceneMode.SCENE3D) {
810
813
  result = Cartesian3.fromElements(result.y, result.z, result.x, result);
811
814
  const carto = scene.mapProjection.unproject(result, cartoScratch);
812
- result = scene.globe.ellipsoid.cartographicToCartesian(carto, result);
815
+ result = this._ellipsoid.cartographicToCartesian(carto, result);
813
816
  }
814
817
 
815
818
  return result;
@@ -142,10 +142,7 @@ GltfLoaderUtil.createModelTextureReader = function (options) {
142
142
  let texCoord = defaultValue(textureInfo.texCoord, 0);
143
143
  let transform;
144
144
 
145
- const textureTransform = defaultValue(
146
- textureInfo.extensions,
147
- defaultValue.EMPTY_OBJECT
148
- ).KHR_texture_transform;
145
+ const textureTransform = textureInfo.extensions?.KHR_texture_transform;
149
146
 
150
147
  if (defined(textureTransform)) {
151
148
  texCoord = defaultValue(textureTransform.texCoord, texCoord);
@@ -177,6 +174,7 @@ GltfLoaderUtil.createModelTextureReader = function (options) {
177
174
  modelTextureReader.index = textureInfo.index;
178
175
  modelTextureReader.texture = texture;
179
176
  modelTextureReader.texCoord = texCoord;
177
+ modelTextureReader.scale = textureInfo.scale;
180
178
  modelTextureReader.transform = transform;
181
179
  modelTextureReader.channels = channels;
182
180
 
@@ -45,7 +45,7 @@ GoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage = function (
45
45
  *
46
46
  * Initialization options for the GoogleEarthEnterpriseImageryProvider constructor
47
47
  *
48
- * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
48
+ * @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
49
49
  * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile
50
50
  * is invalid and should be discarded. If this value is not specified, a default
51
51
  * is to discard tiles that fail to download.
@@ -41,7 +41,7 @@ import ImageryProvider from "./ImageryProvider.js";
41
41
  * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile
42
42
  * is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass
43
43
  * a {@link NeverTileDiscardPolicy} for this parameter.
44
- * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
44
+ * @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
45
45
  */
46
46
 
47
47
  /**
@@ -14,9 +14,9 @@ const defaultBackgroundColor = new Color(0.0, 0.5, 0.0, 0.2);
14
14
  * Initialization options for the GridImageryProvider constructor
15
15
  *
16
16
  * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles.
17
- * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,
17
+ * @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If the tilingScheme is specified,
18
18
  * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
19
- * parameter is specified, the WGS84 ellipsoid is used.
19
+ * parameter is specified, the default ellipsoid is used.
20
20
  * @property {number} [cells=8] The number of grids cells.
21
21
  * @property {Color} [color=Color(1.0, 1.0, 1.0, 0.4)] The color to draw grid lines.
22
22
  * @property {Color} [glowColor=Color(0.0, 1.0, 0.0, 0.05)] The color to draw glow for grid lines.
@@ -436,7 +436,7 @@ ImageryLayerCollection.prototype.pickImageryLayers = function (ray, scene) {
436
436
  return;
437
437
  }
438
438
 
439
- const pickedLocation = scene.globe.ellipsoid.cartesianToCartographic(
439
+ const pickedLocation = scene.ellipsoid.cartesianToCartographic(
440
440
  pickedPosition
441
441
  );
442
442
 
@@ -491,7 +491,7 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function (
491
491
  return;
492
492
  }
493
493
 
494
- const pickedLocation = scene.globe.ellipsoid.cartesianToCartographic(
494
+ const pickedLocation = scene.ellipsoid.cartesianToCartographic(
495
495
  pickedPosition
496
496
  );
497
497
 
@@ -19,7 +19,7 @@ const defaultCredit = new Credit(
19
19
  * @property {string} mapId The Mapbox Map ID.
20
20
  * @property {string} accessToken The public access token for the imagery.
21
21
  * @property {string} [format='png'] The format of the image request.
22
- * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
22
+ * @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
23
23
  * @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
24
24
  * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
25
25
  * to result in rendering problems.
@@ -21,7 +21,7 @@ const defaultCredit = new Credit(
21
21
  * @property {string} accessToken The public access token for the imagery.
22
22
  * @property {number} [tilesize=512] The size of the image tiles.
23
23
  * @property {boolean} [scaleFactor] Determines if tiles are rendered at a @2x scale factor.
24
- * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
24
+ * @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
25
25
  * @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
26
26
  * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
27
27
  * to result in rendering problems.
@@ -65,7 +65,7 @@ const MetadataSemantic = {
65
65
  */
66
66
  TILE_BOUNDING_SPHERE: "TILE_BOUNDING_SPHERE",
67
67
  /**
68
- * The minimum height of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to tighten bounding regions implicitly calculated in implicit tiling.
68
+ * The minimum height of a tile above (or below) the ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to tighten bounding regions implicitly calculated in implicit tiling.
69
69
  *
70
70
  * @type {string}
71
71
  * @constant
@@ -73,7 +73,7 @@ const MetadataSemantic = {
73
73
  */
74
74
  TILE_MINIMUM_HEIGHT: "TILE_MINIMUM_HEIGHT",
75
75
  /**
76
- * The maximum height of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to tighten bounding regions implicitly calculated in implicit tiling.
76
+ * The maximum height of a tile above (or below) the ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to tighten bounding regions implicitly calculated in implicit tiling.
77
77
  *
78
78
  * @type {string}
79
79
  * @constant
@@ -123,7 +123,7 @@ const MetadataSemantic = {
123
123
  */
124
124
  CONTENT_BOUNDING_SPHERE: "CONTENT_BOUNDING_SPHERE",
125
125
  /**
126
- * The minimum height of the content of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>
126
+ * The minimum height of the content of a tile above (or below) the ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>
127
127
  *
128
128
  * @type {string}
129
129
  * @constant
@@ -131,7 +131,7 @@ const MetadataSemantic = {
131
131
  */
132
132
  CONTENT_MINIMUM_HEIGHT: "CONTENT_MINIMUM_HEIGHT",
133
133
  /**
134
- * The maximum height of the content of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>
134
+ * The maximum height of the content of a tile above (or below) the ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>
135
135
  *
136
136
  * @type {string}
137
137
  * @constant
@@ -276,7 +276,7 @@ function projectPositionTo2D(
276
276
  projectedPositionScratch
277
277
  );
278
278
 
279
- result = SceneTransforms.computeActualWgs84Position(
279
+ result = SceneTransforms.computeActualEllipsoidPosition(
280
280
  frameState,
281
281
  finalPosition,
282
282
  result
@@ -432,7 +432,7 @@ function computeReferencePoint2D(renderResources, frameState) {
432
432
  scratchProjectedMin
433
433
  );
434
434
 
435
- const projectedMin = SceneTransforms.computeActualWgs84Position(
435
+ const projectedMin = SceneTransforms.computeActualEllipsoidPosition(
436
436
  frameState,
437
437
  transformedPositionMin,
438
438
  transformedPositionMin
@@ -444,7 +444,7 @@ function computeReferencePoint2D(renderResources, frameState) {
444
444
  scratchProjectedMax
445
445
  );
446
446
 
447
- const projectedMax = SceneTransforms.computeActualWgs84Position(
447
+ const projectedMax = SceneTransforms.computeActualEllipsoidPosition(
448
448
  frameState,
449
449
  transformedPositionMax,
450
450
  transformedPositionMax
@@ -216,6 +216,44 @@ function processTextureTransform(
216
216
  };
217
217
  }
218
218
 
219
+ /**
220
+ * Process a single texture scale and add it to the shader and uniform map.
221
+ *
222
+ * @param {ShaderBuilder} shaderBuilder The shader builder to modify
223
+ * @param {Object<string, Function>} uniformMap The uniform map to modify.
224
+ * @param {ModelComponents.TextureReader} textureReader The texture to add to the shader
225
+ * @param {string} uniformName The name of the sampler uniform such as <code>u_baseColorTexture</code>
226
+ * @param {string} defineName The name of the texture for use in the defines, minus any prefix or suffix. For example, "BASE_COLOR" or "EMISSIVE"
227
+ *
228
+ * @private
229
+ */
230
+ function processTextureScale(
231
+ shaderBuilder,
232
+ uniformMap,
233
+ textureReader,
234
+ uniformName,
235
+ defineName
236
+ ) {
237
+ // Add a define to enable the texture transformation code in the shader.
238
+ const transformDefine = `HAS_${defineName}_TEXTURE_SCALE`;
239
+ shaderBuilder.addDefine(
240
+ transformDefine,
241
+ undefined,
242
+ ShaderDestination.FRAGMENT
243
+ );
244
+
245
+ // Add a uniform for the transformation matrix
246
+ const scaleUniformName = `${uniformName}Scale`;
247
+ shaderBuilder.addUniform(
248
+ "float",
249
+ scaleUniformName,
250
+ ShaderDestination.FRAGMENT
251
+ );
252
+ uniformMap[scaleUniformName] = function () {
253
+ return textureReader.scale;
254
+ };
255
+ }
256
+
219
257
  /**
220
258
  * Process a single texture and add it to the shader and uniform map.
221
259
  *
@@ -274,6 +312,17 @@ function processTexture(
274
312
  defineName
275
313
  );
276
314
  }
315
+
316
+ const { scale } = textureReader;
317
+ if (defined(scale) && scale !== 1.0) {
318
+ processTextureScale(
319
+ shaderBuilder,
320
+ uniformMap,
321
+ textureReader,
322
+ uniformName,
323
+ defineName
324
+ );
325
+ }
277
326
  }
278
327
 
279
328
  function processMaterialUniforms(
@@ -2123,8 +2123,7 @@ function updateClamping(model) {
2123
2123
  return;
2124
2124
  }
2125
2125
 
2126
- const globe = scene.globe;
2127
- const ellipsoid = defaultValue(globe?.ellipsoid, Ellipsoid.WGS84);
2126
+ const ellipsoid = defaultValue(scene.ellipsoid, Ellipsoid.default);
2128
2127
 
2129
2128
  // Compute cartographic position so we don't recompute every update
2130
2129
  const modelMatrix = model.modelMatrix;
@@ -2206,7 +2205,7 @@ function updateComputedScale(model, modelMatrix, frameState) {
2206
2205
  Matrix4.getTranslation(modelMatrix, scratchPosition);
2207
2206
 
2208
2207
  if (model._sceneMode !== SceneMode.SCENE3D) {
2209
- SceneTransforms.computeActualWgs84Position(
2208
+ SceneTransforms.computeActualEllipsoidPosition(
2210
2209
  frameState,
2211
2210
  scratchPosition,
2212
2211
  scratchPosition
@@ -2465,7 +2464,11 @@ function passesDistanceDisplayCondition(model, frameState) {
2465
2464
 
2466
2465
  // This will project the position if the scene is in Columbus View,
2467
2466
  // but leave the position as-is in 3D mode.
2468
- SceneTransforms.computeActualWgs84Position(frameState, position, position);
2467
+ SceneTransforms.computeActualEllipsoidPosition(
2468
+ frameState,
2469
+ position,
2470
+ position
2471
+ );
2469
2472
 
2470
2473
  distanceSquared = Cartesian3.distanceSquared(
2471
2474
  position,
@@ -351,7 +351,7 @@ function computeModelMatrix2D(sceneGraph, frameState) {
351
351
  );
352
352
  } else {
353
353
  const center = sceneGraph.boundingSphere.center;
354
- const to2D = Transforms.wgs84To2DModelMatrix(
354
+ const to2D = Transforms.ellipsoidTo2DModelMatrix(
355
355
  frameState.mapProjection,
356
356
  center,
357
357
  sceneGraph._computedModelMatrix2D
@@ -145,7 +145,7 @@ function computeBoundingSphere2D(renderResources, modelMatrix, frameState) {
145
145
  scratchProjectedMin
146
146
  );
147
147
 
148
- const projectedMin = SceneTransforms.computeActualWgs84Position(
148
+ const projectedMin = SceneTransforms.computeActualEllipsoidPosition(
149
149
  frameState,
150
150
  transformedPositionMin,
151
151
  transformedPositionMin
@@ -157,7 +157,7 @@ function computeBoundingSphere2D(renderResources, modelMatrix, frameState) {
157
157
  scratchProjectedMax
158
158
  );
159
159
 
160
- const projectedMax = SceneTransforms.computeActualWgs84Position(
160
+ const projectedMax = SceneTransforms.computeActualEllipsoidPosition(
161
161
  frameState,
162
162
  transformedPositionMax,
163
163
  transformedPositionMax
@@ -244,7 +244,7 @@ function createPositionsTypedArrayFor2D(
244
244
  initialPosition
245
245
  );
246
246
 
247
- const projectedPosition = SceneTransforms.computeActualWgs84Position(
247
+ const projectedPosition = SceneTransforms.computeActualEllipsoidPosition(
248
248
  frameState,
249
249
  transformedPosition,
250
250
  transformedPosition
@@ -35,7 +35,7 @@ const scratchBoundingSphere = new BoundingSphere();
35
35
  * @param {FrameState} frameState The frame state.
36
36
  * @param {number} [verticalExaggeration=1.0] A scalar used to exaggerate the height of a position relative to the ellipsoid. If the value is 1.0 there will be no effect.
37
37
  * @param {number} [relativeHeight=0.0] The ellipsoid height relative to which a position is exaggerated. If the value is 0.0 the position will be exaggerated relative to the ellipsoid surface.
38
- * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to which the exaggerated position is relative.
38
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid to which the exaggerated position is relative.
39
39
  * @param {Cartesian3|undefined} [result] The intersection or <code>undefined</code> if none was found.
40
40
  * @returns {Cartesian3|undefined} The intersection or <code>undefined</code> if none was found.
41
41
  *
@@ -280,7 +280,7 @@ export default function pickModel(
280
280
  return;
281
281
  }
282
282
 
283
- ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
283
+ ellipsoid = defaultValue(ellipsoid, Ellipsoid.default);
284
284
  verticalExaggeration = defaultValue(verticalExaggeration, 1.0);
285
285
  relativeHeight = defaultValue(relativeHeight, 0.0);
286
286
 
@@ -1187,6 +1187,15 @@ function TextureReader() {
1187
1187
  */
1188
1188
  this.transform = Matrix3.clone(Matrix3.IDENTITY);
1189
1189
 
1190
+ /**
1191
+ * Scale to apply to texture values.
1192
+ *
1193
+ * @type {number}
1194
+ * @default 1.0
1195
+ * @private
1196
+ */
1197
+ this.scale = 1.0;
1198
+
1190
1199
  /**
1191
1200
  * The texture channels to read from. When undefined all channels are read.
1192
1201
  *
@@ -525,7 +525,7 @@ Picking.prototype.pickPositionWorldCoordinates = function (
525
525
  uniformState.updateFrustum(frustum);
526
526
  }
527
527
 
528
- result = SceneTransforms.drawingBufferToWgs84Coordinates(
528
+ result = SceneTransforms.drawingBufferToWorldCoordinates(
529
529
  scene,
530
530
  drawingBufferPosition,
531
531
  depth,
@@ -1112,10 +1112,7 @@ const scratchSurfaceRay = new Ray();
1112
1112
  const scratchCartographic = new Cartographic();
1113
1113
 
1114
1114
  function getRayForSampleHeight(scene, cartographic) {
1115
- const globe = scene.globe;
1116
- const ellipsoid = defined(globe)
1117
- ? globe.ellipsoid
1118
- : scene.mapProjection.ellipsoid;
1115
+ const ellipsoid = scene.ellipsoid;
1119
1116
  const height = ApproximateTerrainHeights._defaultMaxTerrainHeight;
1120
1117
  const surfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(
1121
1118
  cartographic,
@@ -1136,10 +1133,7 @@ function getRayForSampleHeight(scene, cartographic) {
1136
1133
  }
1137
1134
 
1138
1135
  function getRayForClampToHeight(scene, cartesian) {
1139
- const globe = scene.globe;
1140
- const ellipsoid = defined(globe)
1141
- ? globe.ellipsoid
1142
- : scene.mapProjection.ellipsoid;
1136
+ const ellipsoid = scene.ellipsoid;
1143
1137
  const cartographic = Cartographic.fromCartesian(
1144
1138
  cartesian,
1145
1139
  ellipsoid,
@@ -1149,10 +1143,7 @@ function getRayForClampToHeight(scene, cartesian) {
1149
1143
  }
1150
1144
 
1151
1145
  function getHeightFromCartesian(scene, cartesian) {
1152
- const globe = scene.globe;
1153
- const ellipsoid = defined(globe)
1154
- ? globe.ellipsoid
1155
- : scene.mapProjection.ellipsoid;
1146
+ const ellipsoid = scene.ellipsoid;
1156
1147
  const cartographic = Cartographic.fromCartesian(
1157
1148
  cartesian,
1158
1149
  ellipsoid,
@@ -520,7 +520,10 @@ PointPrimitive._computeActualPosition = function (
520
520
  }
521
521
 
522
522
  Matrix4.multiplyByPoint(modelMatrix, position, tempCartesian3);
523
- return SceneTransforms.computeActualWgs84Position(frameState, tempCartesian3);
523
+ return SceneTransforms.computeActualEllipsoidPosition(
524
+ frameState,
525
+ tempCartesian3
526
+ );
524
527
  };
525
528
 
526
529
  const scratchCartesian4 = new Cartesian4();
@@ -544,7 +547,7 @@ PointPrimitive._computeScreenSpacePosition = function (
544
547
  ),
545
548
  scratchCartesian4
546
549
  );
547
- const positionWC = SceneTransforms.wgs84ToWindowCoordinates(
550
+ const positionWC = SceneTransforms.worldToWindowCoordinates(
548
551
  scene,
549
552
  positionWorld,
550
553
  result
@@ -13,6 +13,7 @@ import defaultValue from "../Core/defaultValue.js";
13
13
  import defined from "../Core/defined.js";
14
14
  import destroyObject from "../Core/destroyObject.js";
15
15
  import DeveloperError from "../Core/DeveloperError.js";
16
+ import Ellipsoid from "../Core/Ellipsoid.js";
16
17
  import EllipsoidGeometry from "../Core/EllipsoidGeometry.js";
17
18
  import Event from "../Core/Event.js";
18
19
  import GeographicProjection from "../Core/GeographicProjection.js";
@@ -29,6 +30,7 @@ import OrthographicFrustum from "../Core/OrthographicFrustum.js";
29
30
  import OrthographicOffCenterFrustum from "../Core/OrthographicOffCenterFrustum.js";
30
31
  import PerspectiveFrustum from "../Core/PerspectiveFrustum.js";
31
32
  import PerspectiveOffCenterFrustum from "../Core/PerspectiveOffCenterFrustum.js";
33
+ import Rectangle from "../Core/Rectangle.js";
32
34
  import RequestScheduler from "../Core/RequestScheduler.js";
33
35
  import TaskProcessor from "../Core/TaskProcessor.js";
34
36
  import Transforms from "../Core/Transforms.js";
@@ -96,7 +98,8 @@ const requestRenderAfterFrame = function (scene) {
96
98
  * @param {ContextOptions} [options.contextOptions] Context and WebGL creation properties.
97
99
  * @param {Element} [options.creditContainer] The HTML element in which the credits will be displayed.
98
100
  * @param {Element} [options.creditViewport] The HTML element in which to display the credit popup. If not specified, the viewport will be a added as a sibling of the canvas.
99
- * @param {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes.
101
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.default] The default ellipsoid. If not specified, the default ellipsoid is used.
102
+ * @param {MapProjection} [options.mapProjection=new GeographicProjection(options.ellipsoid)] The map projection to use in 2D and Columbus View modes.
100
103
  * @param {boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency.
101
104
  * @param {boolean} [options.scene3DOnly=false] If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View.
102
105
  * @param {boolean} [options.shadows=false] Determines if shadows are cast by light sources.
@@ -153,7 +156,7 @@ function Scene(options) {
153
156
  this._jobScheduler = new JobScheduler();
154
157
  this._frameState = new FrameState(
155
158
  context,
156
- new CreditDisplay(creditContainer, " ", creditViewport),
159
+ new CreditDisplay(creditContainer, "•", creditViewport),
157
160
  this._jobScheduler
158
161
  );
159
162
  this._frameState.scene3DOnly = defaultValue(options.scene3DOnly, false);
@@ -163,6 +166,8 @@ function Scene(options) {
163
166
  this._canvas = canvas;
164
167
  this._context = context;
165
168
  this._computeEngine = new ComputeEngine(context);
169
+
170
+ this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.default);
166
171
  this._globe = undefined;
167
172
  this._globeTranslucencyState = new GlobeTranslucencyState();
168
173
  this._primitives = new PrimitiveCollection();
@@ -316,7 +321,7 @@ function Scene(options) {
316
321
 
317
322
  this._mapProjection = defined(options.mapProjection)
318
323
  ? options.mapProjection
319
- : new GeographicProjection();
324
+ : new GeographicProjection(this._ellipsoid);
320
325
 
321
326
  /**
322
327
  * The current morph transition time between 2D/Columbus View and 3D,
@@ -530,9 +535,21 @@ function Scene(options) {
530
535
  /**
531
536
  * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
532
537
  * performance improvements by rendering less geometry and dispatching less terrain requests.
538
+ *
539
+ * Disbaled by default if an ellipsoid other than WGS84 is used.
533
540
  * @type {Fog}
534
541
  */
535
542
  this.fog = new Fog();
543
+ this.fog.enabled = Ellipsoid.WGS84.equals(this._ellipsoid);
544
+
545
+ if (!Ellipsoid.WGS84.equals(this._ellipsoid)) {
546
+ Camera.DEFAULT_VIEW_RECTANGLE = Rectangle.fromDegrees(
547
+ -45.0,
548
+ -45.0,
549
+ 45.0,
550
+ 45.0
551
+ );
552
+ }
536
553
 
537
554
  this._shadowMapCamera = new Camera(this);
538
555
 
@@ -914,6 +931,19 @@ Object.defineProperties(Scene.prototype, {
914
931
  },
915
932
  },
916
933
 
934
+ /**
935
+ * The ellipsoid. If not specified, the default ellipsoid is used.
936
+ * @memberof Scene.prototype
937
+ *
938
+ * @type {Ellipsoid}
939
+ * @readonly
940
+ */
941
+ ellipsoid: {
942
+ get: function () {
943
+ return this._ellipsoid;
944
+ },
945
+ },
946
+
917
947
  /**
918
948
  * Gets or sets the depth-test ellipsoid.
919
949
  * @memberof Scene.prototype
@@ -1853,7 +1883,7 @@ function getOccluder(scene) {
1853
1883
  !scene._cameraUnderground &&
1854
1884
  !scene._globeTranslucencyState.translucent
1855
1885
  ) {
1856
- const ellipsoid = globe.ellipsoid;
1886
+ const ellipsoid = scene.ellipsoid;
1857
1887
  const minimumTerrainHeight = scene.frameState.minimumTerrainHeight;
1858
1888
  scratchOccluderBoundingSphere.radius =
1859
1889
  ellipsoid.minimumRadius + minimumTerrainHeight;
@@ -3745,7 +3775,7 @@ Scene.prototype.updateHeight = function (
3745
3775
  }
3746
3776
 
3747
3777
  let tilesetRemoveCallbacks = {};
3748
- const ellipsoid = this.globe?.ellipsoid;
3778
+ const ellipsoid = this._ellipsoid;
3749
3779
  const createPrimitiveEventListener = (primitive) => {
3750
3780
  if (
3751
3781
  ignore3dTiles ||
@@ -4607,7 +4637,6 @@ Scene.prototype.clampToHeightMostDetailed = function (
4607
4637
  * @example
4608
4638
  * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves.
4609
4639
  * const scene = widget.scene;
4610
- * const ellipsoid = scene.globe.ellipsoid;
4611
4640
  * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
4612
4641
  * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
4613
4642
  * handler.setInputAction(function(movement) {
@@ -4615,7 +4644,7 @@ Scene.prototype.clampToHeightMostDetailed = function (
4615
4644
  * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
4616
4645
  */
4617
4646
  Scene.prototype.cartesianToCanvasCoordinates = function (position, result) {
4618
- return SceneTransforms.wgs84ToWindowCoordinates(this, position, result);
4647
+ return SceneTransforms.worldToWindowCoordinates(this, position, result);
4619
4648
  };
4620
4649
 
4621
4650
  /**
@@ -4630,15 +4659,8 @@ Scene.prototype.completeMorph = function () {
4630
4659
  * @param {number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.
4631
4660
  */
4632
4661
  Scene.prototype.morphTo2D = function (duration) {
4633
- let ellipsoid;
4634
- const globe = this.globe;
4635
- if (defined(globe)) {
4636
- ellipsoid = globe.ellipsoid;
4637
- } else {
4638
- ellipsoid = this.mapProjection.ellipsoid;
4639
- }
4640
4662
  duration = defaultValue(duration, 2.0);
4641
- this._transitioner.morphTo2D(duration, ellipsoid);
4663
+ this._transitioner.morphTo2D(duration, this._ellipsoid);
4642
4664
  };
4643
4665
 
4644
4666
  /**
@@ -4646,15 +4668,8 @@ Scene.prototype.morphTo2D = function (duration) {
4646
4668
  * @param {number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.
4647
4669
  */
4648
4670
  Scene.prototype.morphToColumbusView = function (duration) {
4649
- let ellipsoid;
4650
- const globe = this.globe;
4651
- if (defined(globe)) {
4652
- ellipsoid = globe.ellipsoid;
4653
- } else {
4654
- ellipsoid = this.mapProjection.ellipsoid;
4655
- }
4656
4671
  duration = defaultValue(duration, 2.0);
4657
- this._transitioner.morphToColumbusView(duration, ellipsoid);
4672
+ this._transitioner.morphToColumbusView(duration, this._ellipsoid);
4658
4673
  };
4659
4674
 
4660
4675
  /**
@@ -4662,15 +4677,8 @@ Scene.prototype.morphToColumbusView = function (duration) {
4662
4677
  * @param {number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.
4663
4678
  */
4664
4679
  Scene.prototype.morphTo3D = function (duration) {
4665
- let ellipsoid;
4666
- const globe = this.globe;
4667
- if (defined(globe)) {
4668
- ellipsoid = globe.ellipsoid;
4669
- } else {
4670
- ellipsoid = this.mapProjection.ellipsoid;
4671
- }
4672
4680
  duration = defaultValue(duration, 2.0);
4673
- this._transitioner.morphTo3D(duration, ellipsoid);
4681
+ this._transitioner.morphTo3D(duration, this._ellipsoid);
4674
4682
  };
4675
4683
 
4676
4684
  function setTerrain(scene, terrain) {