@cesium/engine 8.0.0 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/Build/ThirdParty/Workers/z-worker-pako.js +7 -10
  2. package/Build/Workers/{chunk-F4HFJMGM.js → chunk-2CSEEWHN.js} +6 -6
  3. package/Build/Workers/{chunk-7TC63SJW.js → chunk-34DGOKCO.js} +10 -12
  4. package/Build/Workers/{chunk-7ZFGPDJA.js → chunk-3RZK5NNV.js} +4 -4
  5. package/Build/Workers/{chunk-M7ERACJJ.js → chunk-3S2MFY4B.js} +13 -13
  6. package/Build/Workers/{chunk-BROJAZRZ.js → chunk-4AJGCQFX.js} +13 -13
  7. package/Build/Workers/{chunk-2FWRMUTY.js → chunk-4KIUON73.js} +4 -4
  8. package/Build/Workers/{chunk-5QULIR53.js → chunk-4PHPQRSH.js} +4 -4
  9. package/Build/Workers/{chunk-X4356LRH.js → chunk-66E3H2KU.js} +12 -12
  10. package/Build/Workers/{chunk-G43QFN4Q.js → chunk-6HCAQOVK.js} +6 -6
  11. package/Build/Workers/{chunk-23UFSGND.js → chunk-7LPEGKOF.js} +7 -7
  12. package/Build/Workers/{chunk-DDUQAJ4P.js → chunk-7VZNXIKG.js} +7 -7
  13. package/Build/Workers/{chunk-JURN7NPV.js → chunk-A6NCZSL3.js} +19 -19
  14. package/Build/Workers/{chunk-ZT7KWISZ.js → chunk-AOFMPKUB.js} +4 -4
  15. package/Build/Workers/{chunk-BIKA3NRA.js → chunk-AOIKO5Y7.js} +5 -5
  16. package/Build/Workers/{chunk-YWTJ2B4B.js → chunk-BDUJXBVF.js} +1 -1
  17. package/Build/Workers/{chunk-OGXZVPPM.js → chunk-C5CE4OG6.js} +469 -6
  18. package/Build/Workers/{chunk-FNIRWHJB.js → chunk-CE6GTZ4I.js} +11 -13
  19. package/Build/Workers/{chunk-SH5USDPI.js → chunk-CYAJYEKW.js} +6 -6
  20. package/Build/Workers/{chunk-Y5UQJLYE.js → chunk-FOZQIHZK.js} +6 -6
  21. package/Build/Workers/{chunk-2FRVPMCS.js → chunk-G7CJQKKD.js} +7 -7
  22. package/Build/Workers/{chunk-EERJKOAF.js → chunk-GIFJ77E4.js} +4 -4
  23. package/Build/Workers/{chunk-FJKNFAKQ.js → chunk-I5TDPPC4.js} +7197 -5096
  24. package/Build/Workers/{chunk-3VAZEH7M.js → chunk-IBXGK4WV.js} +2 -2
  25. package/Build/Workers/{chunk-VOXYEYJT.js → chunk-JI2445T5.js} +11 -11
  26. package/Build/Workers/{chunk-PGSJK77E.js → chunk-KPY4F4BW.js} +6 -6
  27. package/Build/Workers/{chunk-I46ZRR5W.js → chunk-LVJCR7DH.js} +17 -17
  28. package/Build/Workers/{chunk-T3XIFPYR.js → chunk-LW7WGHEU.js} +16 -16
  29. package/Build/Workers/{chunk-HU6N6EXB.js → chunk-MWYZ64MH.js} +12 -11
  30. package/Build/Workers/chunk-NI2R52QD.js +961 -0
  31. package/Build/Workers/{chunk-SOWMRMWA.js → chunk-PEABJLCK.js} +1 -1
  32. package/Build/Workers/{chunk-EG6PTBY2.js → chunk-PK7TEP3J.js} +15 -15
  33. package/Build/Workers/{chunk-GRC2ZTAF.js → chunk-POLFRINT.js} +14 -14
  34. package/Build/Workers/{chunk-Z3TIFFGF.js → chunk-PS6AEMBR.js} +7 -7
  35. package/Build/Workers/{chunk-Y2ME2IJV.js → chunk-PWF3YJJ5.js} +13 -13
  36. package/Build/Workers/{chunk-2A75IWRS.js → chunk-QKF7XXEQ.js} +7 -7
  37. package/Build/Workers/{chunk-4H7PY4U5.js → chunk-RL73GOEF.js} +2 -2
  38. package/Build/Workers/{chunk-MDWEGWPA.js → chunk-RR7EOKGZ.js} +10 -10
  39. package/Build/Workers/{chunk-F3YA3Y2Z.js → chunk-S4XDCPKD.js} +1 -1
  40. package/Build/Workers/{chunk-PPH7OFP3.js → chunk-TMMOULW3.js} +5 -5
  41. package/Build/Workers/{chunk-XGI5BXZY.js → chunk-U4IMCOF5.js} +2 -2
  42. package/Build/Workers/{chunk-4DO5W5XZ.js → chunk-UAJEGIWA.js} +6 -6
  43. package/Build/Workers/{chunk-BBWDMCVU.js → chunk-UCPPWV64.js} +1 -1
  44. package/Build/Workers/{chunk-FZRIVR7Y.js → chunk-V7JB576Q.js} +5 -5
  45. package/Build/Workers/{chunk-2UPKWTMJ.js → chunk-WEGCQ5DY.js} +6 -6
  46. package/Build/Workers/{chunk-STW2DGFI.js → chunk-WFICTTOE.js} +2 -2
  47. package/Build/Workers/{chunk-LPR3YNP2.js → chunk-WWP3I7R5.js} +5 -5
  48. package/Build/Workers/{chunk-A5DWLWCY.js → chunk-XHLDDE65.js} +10 -10
  49. package/Build/Workers/{chunk-UEXTBDBE.js → chunk-XWML5Y7N.js} +11 -13
  50. package/Build/Workers/{chunk-EHWHNOEX.js → chunk-YLZTCEBJ.js} +1 -1
  51. package/Build/Workers/{chunk-34FXV7D7.js → chunk-ZC4AGBZK.js} +2 -2
  52. package/Build/Workers/{chunk-GATZHF3K.js → chunk-ZDP32RQI.js} +2 -2
  53. package/Build/Workers/{chunk-KKCR2YOP.js → chunk-ZWPIM77Q.js} +11 -11
  54. package/Build/Workers/combineGeometry.js +22 -24
  55. package/Build/Workers/createBoxGeometry.js +16 -18
  56. package/Build/Workers/createBoxOutlineGeometry.js +14 -16
  57. package/Build/Workers/createCircleGeometry.js +24 -26
  58. package/Build/Workers/createCircleOutlineGeometry.js +17 -19
  59. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -34
  60. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -31
  61. package/Build/Workers/createCorridorGeometry.js +27 -29
  62. package/Build/Workers/createCorridorOutlineGeometry.js +26 -28
  63. package/Build/Workers/createCylinderGeometry.js +18 -20
  64. package/Build/Workers/createCylinderOutlineGeometry.js +16 -18
  65. package/Build/Workers/createEllipseGeometry.js +24 -26
  66. package/Build/Workers/createEllipseOutlineGeometry.js +17 -19
  67. package/Build/Workers/createEllipsoidGeometry.js +17 -19
  68. package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -18
  69. package/Build/Workers/createFrustumGeometry.js +16 -18
  70. package/Build/Workers/createFrustumOutlineGeometry.js +18 -19
  71. package/Build/Workers/createGeometry.js +23 -25
  72. package/Build/Workers/createGroundPolylineGeometry.js +23 -25
  73. package/Build/Workers/createPlaneGeometry.js +14 -16
  74. package/Build/Workers/createPlaneOutlineGeometry.js +13 -15
  75. package/Build/Workers/createPolygonGeometry.js +33 -35
  76. package/Build/Workers/createPolygonOutlineGeometry.js +28 -30
  77. package/Build/Workers/createPolylineGeometry.js +23 -25
  78. package/Build/Workers/createPolylineVolumeGeometry.js +29 -31
  79. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -27
  80. package/Build/Workers/createRectangleGeometry.js +27 -29
  81. package/Build/Workers/createRectangleOutlineGeometry.js +18 -20
  82. package/Build/Workers/createSimplePolylineGeometry.js +21 -23
  83. package/Build/Workers/createSphereGeometry.js +17 -19
  84. package/Build/Workers/createSphereOutlineGeometry.js +16 -18
  85. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  86. package/Build/Workers/createVectorTileClampedPolylines.js +14 -16
  87. package/Build/Workers/createVectorTileGeometries.js +22 -24
  88. package/Build/Workers/createVectorTilePoints.js +12 -12
  89. package/Build/Workers/createVectorTilePolygons.js +20 -22
  90. package/Build/Workers/createVectorTilePolylines.js +14 -16
  91. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -25
  92. package/Build/Workers/createVerticesFromHeightmap.js +23 -25
  93. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +19 -22
  94. package/Build/Workers/createWallGeometry.js +22 -24
  95. package/Build/Workers/createWallOutlineGeometry.js +21 -23
  96. package/Build/Workers/decodeDraco.js +11 -11
  97. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  98. package/Build/Workers/decodeI3S.js +10 -11
  99. package/Build/Workers/transcodeKTX2.js +8 -8
  100. package/Build/Workers/transferTypedArrayTest.js +1 -1
  101. package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -22
  102. package/Source/Core/Check.d.ts +127 -0
  103. package/Source/Core/Check.js +0 -1
  104. package/Source/Core/Geometry.js +1 -1
  105. package/Source/Core/Ion.js +1 -1
  106. package/Source/Core/PixelFormat.js +1 -0
  107. package/Source/Core/PolygonGeometry.js +1 -1
  108. package/Source/Core/Rectangle.js +89 -0
  109. package/Source/Core/VerticalExaggeration.js +2 -1
  110. package/Source/DataSources/DataSourceDisplay.js +5 -0
  111. package/Source/Renderer/ShaderBuilder.js +6 -3
  112. package/Source/Scene/ArcGisMapService.js +1 -1
  113. package/Source/Scene/Billboard.js +37 -3
  114. package/Source/Scene/BillboardCollection.js +1 -1
  115. package/Source/Scene/BingMapsImageryProvider.js +4 -0
  116. package/Source/Scene/Cesium3DTile.js +65 -0
  117. package/Source/Scene/Cesium3DTilesVoxelProvider.js +2 -9
  118. package/Source/Scene/Cesium3DTileset.js +52 -40
  119. package/Source/Scene/ClippingPolygon.js +212 -0
  120. package/Source/Scene/ClippingPolygonCollection.js +968 -0
  121. package/Source/Scene/Globe.js +14 -67
  122. package/Source/Scene/GlobeSurfaceShaderSet.js +81 -15
  123. package/Source/Scene/GlobeSurfaceTileProvider.js +81 -1
  124. package/Source/Scene/Label.js +33 -0
  125. package/Source/Scene/LabelCollection.js +2 -1
  126. package/Source/Scene/Model/Model.js +83 -0
  127. package/Source/Scene/Model/Model3DTileContent.js +21 -0
  128. package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +92 -0
  129. package/Source/Scene/Model/ModelSceneGraph.js +5 -0
  130. package/Source/Scene/Primitive.js +0 -3
  131. package/Source/Scene/SensorVolumePortionToDisplay.js +1 -1
  132. package/Source/Scene/Terrain.js +2 -2
  133. package/Source/Scene/VoxelBoxShape.js +0 -15
  134. package/Source/Scene/VoxelCylinderShape.js +14 -131
  135. package/Source/Scene/VoxelEllipsoidShape.js +136 -227
  136. package/Source/Scene/VoxelPrimitive.js +106 -14
  137. package/Source/Scene/VoxelRenderResources.js +9 -3
  138. package/Source/Scene/VoxelShape.js +0 -10
  139. package/Source/Scene/processVoxelProperties.js +1 -0
  140. package/Source/Shaders/Builtin/CzmBuiltins.js +4 -0
  141. package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +37 -0
  142. package/Source/Shaders/Builtin/Functions/clipPolygons.js +39 -0
  143. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +14 -0
  144. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +15 -0
  145. package/Source/Shaders/GlobeFS.glsl +12 -0
  146. package/Source/Shaders/GlobeFS.js +12 -0
  147. package/Source/Shaders/GlobeVS.glsl +32 -0
  148. package/Source/Shaders/GlobeVS.js +32 -0
  149. package/Source/Shaders/Model/GeometryStageVS.glsl +1 -1
  150. package/Source/Shaders/Model/GeometryStageVS.js +1 -1
  151. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +6 -0
  152. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +8 -0
  153. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +27 -0
  154. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +29 -0
  155. package/Source/Shaders/Model/ModelFS.glsl +6 -0
  156. package/Source/Shaders/Model/ModelFS.js +7 -1
  157. package/Source/Shaders/Model/ModelVS.glsl +4 -0
  158. package/Source/Shaders/Model/ModelVS.js +4 -0
  159. package/Source/Shaders/PolygonSignedDistanceFS.glsl +100 -0
  160. package/Source/Shaders/PolygonSignedDistanceFS.js +101 -0
  161. package/Source/Shaders/Voxels/IntersectBox.glsl +21 -47
  162. package/Source/Shaders/Voxels/IntersectBox.js +21 -47
  163. package/Source/Shaders/Voxels/IntersectClippingPlanes.glsl +1 -1
  164. package/Source/Shaders/Voxels/IntersectClippingPlanes.js +1 -1
  165. package/Source/Shaders/Voxels/IntersectCylinder.glsl +66 -96
  166. package/Source/Shaders/Voxels/IntersectCylinder.js +66 -96
  167. package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +226 -154
  168. package/Source/Shaders/Voxels/IntersectEllipsoid.js +226 -154
  169. package/Source/Shaders/Voxels/IntersectionUtils.glsl +33 -11
  170. package/Source/Shaders/Voxels/IntersectionUtils.js +33 -11
  171. package/Source/Shaders/Voxels/Megatexture.glsl +1 -2
  172. package/Source/Shaders/Voxels/Megatexture.js +1 -2
  173. package/Source/Shaders/Voxels/Octree.glsl +14 -9
  174. package/Source/Shaders/Voxels/Octree.js +14 -9
  175. package/Source/Shaders/Voxels/VoxelFS.glsl +93 -43
  176. package/Source/Shaders/Voxels/VoxelFS.js +93 -43
  177. package/Source/Shaders/Voxels/VoxelUtils.glsl +31 -0
  178. package/Source/Shaders/Voxels/VoxelUtils.js +33 -0
  179. package/Source/Shaders/Voxels/convertUvToBox.glsl +24 -3
  180. package/Source/Shaders/Voxels/convertUvToBox.js +24 -4
  181. package/Source/Shaders/Voxels/convertUvToCylinder.glsl +50 -8
  182. package/Source/Shaders/Voxels/convertUvToCylinder.js +50 -8
  183. package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +82 -53
  184. package/Source/Shaders/Voxels/convertUvToEllipsoid.js +82 -53
  185. package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
  186. package/Source/Workers/createGeometry.js +1 -1
  187. package/index.d.ts +478 -35
  188. package/index.js +61 -52
  189. package/package.json +2 -2
  190. package/Build/Workers/chunk-BG4UCVXN.js +0 -73
  191. package/Build/Workers/chunk-TTUZP4BO.js +0 -501
  192. package/Build/Workers/chunk-YJEBABKH.js +0 -2977
@@ -95,16 +95,16 @@ function VoxelEllipsoidShape() {
95
95
  */
96
96
  this.shaderUniforms = {
97
97
  ellipsoidRadiiUv: new Cartesian3(),
98
+ eccentricitySquared: 0.0,
99
+ evoluteScale: new Cartesian2(),
98
100
  ellipsoidInverseRadiiSquaredUv: new Cartesian3(),
99
101
  ellipsoidRenderLongitudeMinMax: new Cartesian2(),
100
102
  ellipsoidShapeUvLongitudeMinMaxMid: new Cartesian3(),
101
103
  ellipsoidUvToShapeUvLongitude: new Cartesian2(),
102
104
  ellipsoidUvToShapeUvLatitude: new Cartesian2(),
103
- ellipsoidRenderLatitudeCosSqrHalfMinMax: new Cartesian2(),
105
+ ellipsoidRenderLatitudeSinMinMax: new Cartesian2(),
104
106
  ellipsoidInverseHeightDifferenceUv: 0.0,
105
- ellipseInnerRadiiUv: new Cartesian2(),
106
- ellipsoidInverseInnerScaleUv: 0.0,
107
- ellipsoidInverseOuterScaleUv: 0.0,
107
+ clipMinMaxHeight: new Cartesian2(),
108
108
  };
109
109
 
110
110
  /**
@@ -127,10 +127,6 @@ function VoxelEllipsoidShape() {
127
127
  ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF: undefined,
128
128
  ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF: undefined,
129
129
  ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE: undefined,
130
- ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX: undefined,
131
- ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN: undefined,
132
- ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT: undefined,
133
- ELLIPSOID_IS_SPHERE: undefined,
134
130
  ELLIPSOID_INTERSECTION_INDEX_LONGITUDE: undefined,
135
131
  ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX: undefined,
136
132
  ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN: undefined,
@@ -146,11 +142,17 @@ function VoxelEllipsoidShape() {
146
142
  this.shaderMaximumIntersectionsLength = 0; // not known until update
147
143
  }
148
144
 
145
+ const scratchActualMinBounds = new Cartesian3();
146
+ const scratchShapeMinBounds = new Cartesian3();
147
+ const scratchShapeMaxBounds = new Cartesian3();
148
+ const scratchClipMinBounds = new Cartesian3();
149
+ const scratchClipMaxBounds = new Cartesian3();
150
+ const scratchRenderMinBounds = new Cartesian3();
151
+ const scratchRenderMaxBounds = new Cartesian3();
149
152
  const scratchScale = new Cartesian3();
150
153
  const scratchRotationScale = new Matrix3();
151
154
  const scratchShapeOuterExtent = new Cartesian3();
152
155
  const scratchRenderOuterExtent = new Cartesian3();
153
- const scratchRenderInnerExtent = new Cartesian3();
154
156
  const scratchRenderRectangle = new Rectangle();
155
157
 
156
158
  /**
@@ -170,122 +172,83 @@ VoxelEllipsoidShape.prototype.update = function (
170
172
  clipMinBounds,
171
173
  clipMaxBounds
172
174
  ) {
173
- clipMinBounds = defaultValue(
174
- clipMinBounds,
175
- VoxelEllipsoidShape.DefaultMinBounds
176
- );
177
- clipMaxBounds = defaultValue(
178
- clipMaxBounds,
179
- VoxelEllipsoidShape.DefaultMaxBounds
180
- );
175
+ const { DefaultMinBounds, DefaultMaxBounds } = VoxelEllipsoidShape;
176
+ clipMinBounds = defaultValue(clipMinBounds, DefaultMinBounds);
177
+ clipMaxBounds = defaultValue(clipMaxBounds, DefaultMaxBounds);
181
178
  //>>includeStart('debug', pragmas.debug);
182
179
  Check.typeOf.object("modelMatrix", modelMatrix);
183
180
  Check.typeOf.object("minBounds", minBounds);
184
181
  Check.typeOf.object("maxBounds", maxBounds);
185
182
  //>>includeEnd('debug');
186
183
 
187
- const defaultMinLongitude = VoxelEllipsoidShape.DefaultMinBounds.x;
188
- const defaultMaxLongitude = VoxelEllipsoidShape.DefaultMaxBounds.x;
189
- const defaultLongitudeRange = defaultMaxLongitude - defaultMinLongitude;
190
- const defaultLongitudeRangeHalf = 0.5 * defaultLongitudeRange;
191
- const defaultMinLatitude = VoxelEllipsoidShape.DefaultMinBounds.y;
192
- const defaultMaxLatitude = VoxelEllipsoidShape.DefaultMaxBounds.y;
193
- const defaultLatitudeRange = defaultMaxLatitude - defaultMinLatitude;
194
-
195
184
  const epsilonZeroScale = CesiumMath.EPSILON10;
196
185
  const epsilonLongitudeDiscontinuity = CesiumMath.EPSILON3; // 0.001 radians = 0.05729578 degrees
197
186
  const epsilonLongitude = CesiumMath.EPSILON10;
198
187
  const epsilonLatitude = CesiumMath.EPSILON10;
199
188
  const epsilonLatitudeFlat = CesiumMath.EPSILON3; // 0.001 radians = 0.05729578 degrees
200
189
 
201
- // Clamp the longitude / latitude to the valid range
202
- const shapeMinLongitude = CesiumMath.clamp(
203
- minBounds.x,
204
- defaultMinLongitude,
205
- defaultMaxLongitude
206
- );
207
- const shapeMaxLongitude = CesiumMath.clamp(
208
- maxBounds.x,
209
- defaultMinLongitude,
210
- defaultMaxLongitude
190
+ // Don't let the height go below the center of the ellipsoid.
191
+ const radii = Matrix4.getScale(modelMatrix, scratchScale);
192
+ const actualMinBounds = Cartesian3.clone(
193
+ DefaultMinBounds,
194
+ scratchActualMinBounds
211
195
  );
212
- const clipMinLongitude = CesiumMath.clamp(
213
- clipMinBounds.x,
214
- defaultMinLongitude,
215
- defaultMaxLongitude
196
+ actualMinBounds.z = -Cartesian3.minimumComponent(radii);
197
+
198
+ const shapeMinBounds = Cartesian3.clamp(
199
+ minBounds,
200
+ actualMinBounds,
201
+ DefaultMaxBounds,
202
+ scratchShapeMinBounds
216
203
  );
217
- const clipMaxLongitude = CesiumMath.clamp(
218
- clipMaxBounds.x,
219
- defaultMinLongitude,
220
- defaultMaxLongitude
204
+ const shapeMaxBounds = Cartesian3.clamp(
205
+ maxBounds,
206
+ actualMinBounds,
207
+ DefaultMaxBounds,
208
+ scratchShapeMaxBounds
221
209
  );
222
- const renderMinLongitude = Math.max(shapeMinLongitude, clipMinLongitude);
223
- const renderMaxLongitude = Math.min(shapeMaxLongitude, clipMaxLongitude);
224
-
225
- const shapeMinLatitude = CesiumMath.clamp(
226
- minBounds.y,
227
- defaultMinLatitude,
228
- defaultMaxLatitude
210
+ const clampedClipMinBounds = Cartesian3.clamp(
211
+ clipMinBounds,
212
+ actualMinBounds,
213
+ DefaultMaxBounds,
214
+ scratchClipMinBounds
229
215
  );
230
- const shapeMaxLatitude = CesiumMath.clamp(
231
- maxBounds.y,
232
- defaultMinLatitude,
233
- defaultMaxLatitude
216
+ const clampedClipMaxBounds = Cartesian3.clamp(
217
+ clipMaxBounds,
218
+ actualMinBounds,
219
+ DefaultMaxBounds,
220
+ scratchClipMaxBounds
234
221
  );
235
- const clipMinLatitude = CesiumMath.clamp(
236
- clipMinBounds.y,
237
- defaultMinLatitude,
238
- defaultMaxLatitude
222
+ const renderMinBounds = Cartesian3.maximumByComponent(
223
+ shapeMinBounds,
224
+ clampedClipMinBounds,
225
+ scratchRenderMinBounds
239
226
  );
240
- const clipMaxLatitude = CesiumMath.clamp(
241
- clipMaxBounds.y,
242
- defaultMinLatitude,
243
- defaultMaxLatitude
227
+ const renderMaxBounds = Cartesian3.minimumByComponent(
228
+ shapeMaxBounds,
229
+ clampedClipMaxBounds,
230
+ scratchRenderMaxBounds
244
231
  );
245
232
 
246
- const renderMinLatitude = Math.max(shapeMinLatitude, clipMinLatitude);
247
- const renderMaxLatitude = Math.min(shapeMaxLatitude, clipMaxLatitude);
248
-
249
- // Don't let the height go below the center of the ellipsoid.
250
- const radii = Matrix4.getScale(modelMatrix, scratchScale);
251
- const isSphere = radii.x === radii.y && radii.y === radii.z;
252
- const minRadius = Cartesian3.minimumComponent(radii);
253
- const shapeMinHeight = Math.max(minBounds.z, -minRadius);
254
- const shapeMaxHeight = Math.max(maxBounds.z, -minRadius);
255
- const clipMinHeight = Math.max(clipMinBounds.z, -minRadius);
256
- const clipMaxHeight = Math.max(clipMaxBounds.z, -minRadius);
257
- const renderMinHeight = Math.max(shapeMinHeight, clipMinHeight);
258
- const renderMaxHeight = Math.min(shapeMaxHeight, clipMaxHeight);
259
-
260
233
  // Compute the farthest a point can be from the center of the ellipsoid.
261
234
  const shapeOuterExtent = Cartesian3.add(
262
235
  radii,
263
236
  Cartesian3.fromElements(
264
- shapeMaxHeight,
265
- shapeMaxHeight,
266
- shapeMaxHeight,
237
+ shapeMaxBounds.z,
238
+ shapeMaxBounds.z,
239
+ shapeMaxBounds.z,
267
240
  scratchShapeOuterExtent
268
241
  ),
269
242
  scratchShapeOuterExtent
270
243
  );
271
244
  const shapeMaxExtent = Cartesian3.maximumComponent(shapeOuterExtent);
272
245
 
273
- const renderInnerExtent = Cartesian3.add(
274
- radii,
275
- Cartesian3.fromElements(
276
- renderMinHeight,
277
- renderMinHeight,
278
- renderMinHeight,
279
- scratchRenderInnerExtent
280
- ),
281
- scratchRenderInnerExtent
282
- );
283
246
  const renderOuterExtent = Cartesian3.add(
284
247
  radii,
285
248
  Cartesian3.fromElements(
286
- renderMaxHeight,
287
- renderMaxHeight,
288
- renderMaxHeight,
249
+ renderMaxBounds.z,
250
+ renderMaxBounds.z,
251
+ renderMaxBounds.z,
289
252
  scratchRenderOuterExtent
290
253
  ),
291
254
  scratchRenderOuterExtent
@@ -294,10 +257,10 @@ VoxelEllipsoidShape.prototype.update = function (
294
257
  // Exit early if the shape is not visible.
295
258
  // Note that minLongitude may be greater than maxLongitude when crossing the 180th meridian.
296
259
  if (
297
- renderMinLatitude > renderMaxLatitude ||
298
- renderMinLatitude === defaultMaxLatitude ||
299
- renderMaxLatitude === defaultMinLatitude ||
300
- renderMinHeight > renderMaxHeight ||
260
+ renderMinBounds.y > renderMaxBounds.y ||
261
+ renderMinBounds.y === DefaultMaxBounds.y ||
262
+ renderMaxBounds.y === DefaultMinBounds.y ||
263
+ renderMinBounds.z > renderMaxBounds.z ||
301
264
  CesiumMath.equalsEpsilon(
302
265
  renderOuterExtent,
303
266
  Cartesian3.ZERO,
@@ -309,29 +272,29 @@ VoxelEllipsoidShape.prototype.update = function (
309
272
  }
310
273
 
311
274
  this._rectangle = Rectangle.fromRadians(
312
- shapeMinLongitude,
313
- shapeMinLatitude,
314
- shapeMaxLongitude,
315
- shapeMaxLatitude
275
+ shapeMinBounds.x,
276
+ shapeMinBounds.y,
277
+ shapeMaxBounds.x,
278
+ shapeMaxBounds.y
316
279
  );
317
280
  this._translation = Matrix4.getTranslation(modelMatrix, this._translation);
318
281
  this._rotation = Matrix4.getRotation(modelMatrix, this._rotation);
319
282
  this._ellipsoid = Ellipsoid.fromCartesian3(radii, this._ellipsoid);
320
- this._minimumHeight = shapeMinHeight;
321
- this._maximumHeight = shapeMaxHeight;
283
+ this._minimumHeight = shapeMinBounds.z;
284
+ this._maximumHeight = shapeMaxBounds.z;
322
285
 
323
286
  const renderRectangle = Rectangle.fromRadians(
324
- renderMinLongitude,
325
- renderMinLatitude,
326
- renderMaxLongitude,
327
- renderMaxLatitude,
287
+ renderMinBounds.x,
288
+ renderMinBounds.y,
289
+ renderMaxBounds.x,
290
+ renderMaxBounds.y,
328
291
  scratchRenderRectangle
329
292
  );
330
293
 
331
294
  this.orientedBoundingBox = getEllipsoidChunkObb(
332
295
  renderRectangle,
333
- renderMinHeight,
334
- renderMaxHeight,
296
+ renderMinBounds.z,
297
+ renderMaxBounds.z,
335
298
  this._ellipsoid,
336
299
  this._translation,
337
300
  this._rotation,
@@ -356,10 +319,12 @@ VoxelEllipsoidShape.prototype.update = function (
356
319
  );
357
320
 
358
321
  // Longitude
359
- const renderIsLongitudeReversed = renderMaxLongitude < renderMinLongitude;
322
+ const defaultLongitudeRange = DefaultMaxBounds.x - DefaultMinBounds.x;
323
+ const defaultLongitudeRangeHalf = 0.5 * defaultLongitudeRange;
324
+ const renderIsLongitudeReversed = renderMaxBounds.x < renderMinBounds.x;
360
325
  const renderLongitudeRange =
361
- renderMaxLongitude -
362
- renderMinLongitude +
326
+ renderMaxBounds.x -
327
+ renderMinBounds.x +
363
328
  renderIsLongitudeReversed * defaultLongitudeRange;
364
329
  const renderIsLongitudeRangeZero = renderLongitudeRange <= epsilonLongitude;
365
330
  const renderIsLongitudeRangeUnderHalf =
@@ -373,10 +338,10 @@ VoxelEllipsoidShape.prototype.update = function (
373
338
  renderIsLongitudeRangeUnderHalf ||
374
339
  renderIsLongitudeRangeOverHalf;
375
340
 
376
- const shapeIsLongitudeReversed = shapeMaxLongitude < shapeMinLongitude;
341
+ const shapeIsLongitudeReversed = shapeMaxBounds.x < shapeMinBounds.x;
377
342
  const shapeLongitudeRange =
378
- shapeMaxLongitude -
379
- shapeMinLongitude +
343
+ shapeMaxBounds.x -
344
+ shapeMinBounds.x +
380
345
  shapeIsLongitudeReversed * defaultLongitudeRange;
381
346
  const shapeIsLongitudeRangeUnderHalf =
382
347
  shapeLongitudeRange > defaultLongitudeRangeHalf + epsilonLongitude &&
@@ -392,65 +357,55 @@ VoxelEllipsoidShape.prototype.update = function (
392
357
  shapeIsLongitudeRangeOverHalf;
393
358
 
394
359
  // Latitude
395
- const renderIsLatitudeMaxUnderHalf = renderMaxLatitude < -epsilonLatitudeFlat;
360
+ const renderIsLatitudeMaxUnderHalf = renderMaxBounds.y < -epsilonLatitudeFlat;
396
361
  const renderIsLatitudeMaxHalf =
397
- renderMaxLatitude >= -epsilonLatitudeFlat &&
398
- renderMaxLatitude <= +epsilonLatitudeFlat;
362
+ renderMaxBounds.y >= -epsilonLatitudeFlat &&
363
+ renderMaxBounds.y <= +epsilonLatitudeFlat;
399
364
  const renderIsLatitudeMaxOverHalf =
400
- renderMaxLatitude > +epsilonLatitudeFlat &&
401
- renderMaxLatitude < defaultMaxLatitude - epsilonLatitude;
365
+ renderMaxBounds.y > +epsilonLatitudeFlat &&
366
+ renderMaxBounds.y < DefaultMaxBounds.y - epsilonLatitude;
402
367
  const renderHasLatitudeMax =
403
368
  renderIsLatitudeMaxUnderHalf ||
404
369
  renderIsLatitudeMaxHalf ||
405
370
  renderIsLatitudeMaxOverHalf;
406
371
  const renderIsLatitudeMinUnderHalf =
407
- renderMinLatitude > defaultMinLatitude + epsilonLatitude &&
408
- renderMinLatitude < -epsilonLatitudeFlat;
372
+ renderMinBounds.y > DefaultMinBounds.y + epsilonLatitude &&
373
+ renderMinBounds.y < -epsilonLatitudeFlat;
409
374
  const renderIsLatitudeMinHalf =
410
- renderMinLatitude >= -epsilonLatitudeFlat &&
411
- renderMinLatitude <= +epsilonLatitudeFlat;
412
- const renderIsLatitudeMinOverHalf = renderMinLatitude > +epsilonLatitudeFlat;
375
+ renderMinBounds.y >= -epsilonLatitudeFlat &&
376
+ renderMinBounds.y <= +epsilonLatitudeFlat;
377
+ const renderIsLatitudeMinOverHalf = renderMinBounds.y > +epsilonLatitudeFlat;
413
378
  const renderHasLatitudeMin =
414
379
  renderIsLatitudeMinUnderHalf ||
415
380
  renderIsLatitudeMinHalf ||
416
381
  renderIsLatitudeMinOverHalf;
417
382
  const renderHasLatitude = renderHasLatitudeMax || renderHasLatitudeMin;
418
383
 
419
- const shapeLatitudeRange = shapeMaxLatitude - shapeMinLatitude;
420
- const shapeIsLatitudeMaxUnderHalf = shapeMaxLatitude < -epsilonLatitudeFlat;
384
+ const shapeLatitudeRange = shapeMaxBounds.y - shapeMinBounds.y;
385
+ const shapeIsLatitudeMaxUnderHalf = shapeMaxBounds.y < -epsilonLatitudeFlat;
421
386
  const shapeIsLatitudeMaxHalf =
422
- shapeMaxLatitude >= -epsilonLatitudeFlat &&
423
- shapeMaxLatitude <= +epsilonLatitudeFlat;
387
+ shapeMaxBounds.y >= -epsilonLatitudeFlat &&
388
+ shapeMaxBounds.y <= +epsilonLatitudeFlat;
424
389
  const shapeIsLatitudeMaxOverHalf =
425
- shapeMaxLatitude > +epsilonLatitudeFlat &&
426
- shapeMaxLatitude < defaultMaxLatitude - epsilonLatitude;
390
+ shapeMaxBounds.y > +epsilonLatitudeFlat &&
391
+ shapeMaxBounds.y < DefaultMaxBounds.y - epsilonLatitude;
427
392
  const shapeHasLatitudeMax =
428
393
  shapeIsLatitudeMaxUnderHalf ||
429
394
  shapeIsLatitudeMaxHalf ||
430
395
  shapeIsLatitudeMaxOverHalf;
431
396
  const shapeIsLatitudeMinUnderHalf =
432
- shapeMinLatitude > defaultMinLatitude + epsilonLatitude &&
433
- shapeMinLatitude < -epsilonLatitudeFlat;
397
+ shapeMinBounds.y > DefaultMinBounds.y + epsilonLatitude &&
398
+ shapeMinBounds.y < -epsilonLatitudeFlat;
434
399
  const shapeIsLatitudeMinHalf =
435
- shapeMinLatitude >= -epsilonLatitudeFlat &&
436
- shapeMinLatitude <= +epsilonLatitudeFlat;
437
- const shapeIsLatitudeMinOverHalf = shapeMinLatitude > +epsilonLatitudeFlat;
400
+ shapeMinBounds.y >= -epsilonLatitudeFlat &&
401
+ shapeMinBounds.y <= +epsilonLatitudeFlat;
402
+ const shapeIsLatitudeMinOverHalf = shapeMinBounds.y > +epsilonLatitudeFlat;
438
403
  const shapeHasLatitudeMin =
439
404
  shapeIsLatitudeMinUnderHalf ||
440
405
  shapeIsLatitudeMinHalf ||
441
406
  shapeIsLatitudeMinOverHalf;
442
407
  const shapeHasLatitude = shapeHasLatitudeMax || shapeHasLatitudeMin;
443
408
 
444
- // Height
445
- const renderHasMinHeight = !Cartesian3.equals(
446
- renderInnerExtent,
447
- Cartesian3.ZERO
448
- );
449
- const renderHasMaxHeight = !Cartesian3.equals(
450
- renderOuterExtent,
451
- Cartesian3.ZERO
452
- );
453
-
454
409
  const { shaderUniforms, shaderDefines } = this;
455
410
 
456
411
  // To keep things simple, clear the defines every time
@@ -466,6 +421,14 @@ VoxelEllipsoidShape.prototype.update = function (
466
421
  shapeMaxExtent,
467
422
  shaderUniforms.ellipsoidRadiiUv
468
423
  );
424
+ const { x: radiiUvX, z: radiiUvZ } = shaderUniforms.ellipsoidRadiiUv;
425
+ const axisRatio = radiiUvZ / radiiUvX;
426
+ shaderUniforms.eccentricitySquared = 1.0 - axisRatio * axisRatio;
427
+ shaderUniforms.evoluteScale = Cartesian2.fromElements(
428
+ (radiiUvX * radiiUvX - radiiUvZ * radiiUvZ) / radiiUvX,
429
+ (radiiUvZ * radiiUvZ - radiiUvX * radiiUvX) / radiiUvZ,
430
+ shaderUniforms.evoluteScale
431
+ );
469
432
 
470
433
  // Used to compute geodetic surface normal.
471
434
  shaderUniforms.ellipsoidInverseRadiiSquaredUv = Cartesian3.divideComponents(
@@ -481,41 +444,23 @@ VoxelEllipsoidShape.prototype.update = function (
481
444
  // Keep track of how many intersections there are going to be.
482
445
  let intersectionCount = 0;
483
446
 
484
- // Intersects an outer ellipsoid for the max height.
447
+ // Intersects outer and inner ellipsoid for the max and min height.
485
448
  shaderDefines["ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX"] = intersectionCount;
486
449
  intersectionCount += 1;
450
+ shaderDefines["ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN"] = intersectionCount;
451
+ intersectionCount += 1;
487
452
 
488
- if (renderHasMinHeight) {
489
- shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN"] = true;
490
- shaderDefines[
491
- "ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN"
492
- ] = intersectionCount;
493
- intersectionCount += 1;
494
-
495
- // The inverse of the percent of space that is taken up by the inner ellipsoid, relative to the shape bounds
496
- // 1.0 / (1.0 - thickness) // thickness = percent of space that is between the min and max height.
497
- // 1.0 / (1.0 - (shapeMaxHeight - renderMinHeight) / shapeMaxExtent)
498
- // shapeMaxExtent / (shapeMaxExtent - (shapeMaxHeight - renderMinHeight))
499
- shaderUniforms.ellipsoidInverseInnerScaleUv =
500
- shapeMaxExtent / (shapeMaxExtent - (shapeMaxHeight - renderMinHeight));
501
- }
502
-
503
- if (renderHasMaxHeight) {
504
- shaderDefines["ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX"] = true;
505
- shaderUniforms.ellipsoidInverseOuterScaleUv =
506
- shapeMaxExtent / (shapeMaxExtent - (shapeMaxHeight - renderMaxHeight));
507
- }
453
+ shaderUniforms.clipMinMaxHeight = Cartesian2.fromElements(
454
+ (renderMinBounds.z - shapeMaxBounds.z) / shapeMaxExtent,
455
+ (renderMaxBounds.z - shapeMaxBounds.z) / shapeMaxExtent,
456
+ shaderUniforms.clipMinMaxHeight
457
+ );
508
458
 
509
459
  // The percent of space that is between the inner and outer ellipsoid.
510
- const thickness = (shapeMaxHeight - shapeMinHeight) / shapeMaxExtent;
460
+ const thickness = (shapeMaxBounds.z - shapeMinBounds.z) / shapeMaxExtent;
511
461
  shaderUniforms.ellipsoidInverseHeightDifferenceUv = 1.0 / thickness;
512
- shaderUniforms.ellipseInnerRadiiUv = Cartesian2.fromElements(
513
- shaderUniforms.ellipsoidRadiiUv.x * (1.0 - thickness),
514
- shaderUniforms.ellipsoidRadiiUv.z * (1.0 - thickness),
515
- shaderUniforms.ellipseInnerRadiiUv
516
- );
517
- if (shapeMinHeight === shapeMaxHeight) {
518
- shaderDefines["ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT"] = true;
462
+ if (shapeMinBounds.z === shapeMaxBounds.z) {
463
+ shaderUniforms.ellipsoidInverseHeightDifferenceUv = 0.0;
519
464
  }
520
465
 
521
466
  // Intersects a wedge for the min and max longitude.
@@ -541,8 +486,8 @@ VoxelEllipsoidShape.prototype.update = function (
541
486
  }
542
487
 
543
488
  shaderUniforms.ellipsoidRenderLongitudeMinMax = Cartesian2.fromElements(
544
- renderMinLongitude,
545
- renderMaxLongitude,
489
+ renderMinBounds.x,
490
+ renderMaxBounds.x,
546
491
  shaderUniforms.ellipsoidRenderLongitudeMinMax
547
492
  );
548
493
  }
@@ -550,7 +495,7 @@ VoxelEllipsoidShape.prototype.update = function (
550
495
  if (shapeHasLongitude) {
551
496
  shaderDefines["ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE"] = true;
552
497
 
553
- const shapeIsLongitudeReversed = shapeMaxLongitude < shapeMinLongitude;
498
+ const shapeIsLongitudeReversed = shapeMaxBounds.x < shapeMinBounds.x;
554
499
 
555
500
  if (shapeIsLongitudeReversed) {
556
501
  shaderDefines[
@@ -576,7 +521,7 @@ VoxelEllipsoidShape.prototype.update = function (
576
521
  } else {
577
522
  const scale = defaultLongitudeRange / shapeLongitudeRange;
578
523
  const offset =
579
- -(shapeMinLongitude - defaultMinLongitude) / shapeLongitudeRange;
524
+ -(shapeMinBounds.x - DefaultMinBounds.x) / shapeLongitudeRange;
580
525
  shaderUniforms.ellipsoidUvToShapeUvLongitude = Cartesian2.fromElements(
581
526
  scale,
582
527
  offset,
@@ -587,14 +532,14 @@ VoxelEllipsoidShape.prototype.update = function (
587
532
 
588
533
  if (renderHasLongitude) {
589
534
  const renderIsMinLongitudeDiscontinuity = CesiumMath.equalsEpsilon(
590
- renderMinLongitude,
591
- defaultMinLongitude,
535
+ renderMinBounds.x,
536
+ DefaultMinBounds.x,
592
537
  undefined,
593
538
  epsilonLongitudeDiscontinuity
594
539
  );
595
540
  const renderIsMaxLongitudeDiscontinuity = CesiumMath.equalsEpsilon(
596
- renderMaxLongitude,
597
- defaultMaxLongitude,
541
+ renderMaxBounds.x,
542
+ DefaultMaxBounds.x,
598
543
  undefined,
599
544
  epsilonLongitudeDiscontinuity
600
545
  );
@@ -610,12 +555,12 @@ VoxelEllipsoidShape.prototype.update = function (
610
555
  ] = true;
611
556
  }
612
557
  const uvShapeMinLongitude =
613
- (shapeMinLongitude - defaultMinLongitude) / defaultLongitudeRange;
558
+ (shapeMinBounds.x - DefaultMinBounds.x) / defaultLongitudeRange;
614
559
  const uvShapeMaxLongitude =
615
- (shapeMaxLongitude - defaultMinLongitude) / defaultLongitudeRange;
560
+ (shapeMaxBounds.x - DefaultMinBounds.x) / defaultLongitudeRange;
616
561
 
617
562
  const uvRenderMaxLongitude =
618
- (renderMaxLongitude - defaultMinLongitude) / defaultLongitudeRange;
563
+ (renderMaxBounds.x - DefaultMinBounds.x) / defaultLongitudeRange;
619
564
  const uvRenderLongitudeRangeZero =
620
565
  1.0 - renderLongitudeRange / defaultLongitudeRange;
621
566
  const uvRenderLongitudeRangeZeroMid =
@@ -680,18 +625,10 @@ VoxelEllipsoidShape.prototype.update = function (
680
625
  }
681
626
  }
682
627
 
683
- const minCosHalfAngleSqr = Math.pow(
684
- Math.cos(CesiumMath.PI_OVER_TWO - Math.abs(renderMinLatitude)),
685
- 2.0
686
- );
687
- const maxCosHalfAngleSqr = Math.pow(
688
- Math.cos(CesiumMath.PI_OVER_TWO - Math.abs(renderMaxLatitude)),
689
- 2.0
690
- );
691
- shaderUniforms.ellipsoidRenderLatitudeCosSqrHalfMinMax = Cartesian2.fromElements(
692
- minCosHalfAngleSqr,
693
- maxCosHalfAngleSqr,
694
- shaderUniforms.ellipsoidRenderLatitudeCosSqrHalfMinMax
628
+ shaderUniforms.ellipsoidRenderLatitudeSinMinMax = Cartesian2.fromElements(
629
+ Math.sin(renderMinBounds.y),
630
+ Math.sin(renderMaxBounds.y),
631
+ shaderUniforms.ellipsoidRenderLatitudeSinMinMax
695
632
  );
696
633
  }
697
634
 
@@ -715,9 +652,10 @@ VoxelEllipsoidShape.prototype.update = function (
715
652
  shaderUniforms.ellipsoidUvToShapeUvLatitude
716
653
  );
717
654
  } else {
655
+ const defaultLatitudeRange = DefaultMaxBounds.y - DefaultMinBounds.y;
718
656
  const scale = defaultLatitudeRange / shapeLatitudeRange;
719
657
  const offset =
720
- (defaultMinLatitude - shapeMinLatitude) / shapeLatitudeRange;
658
+ (DefaultMinBounds.y - shapeMinBounds.y) / shapeLatitudeRange;
721
659
  shaderUniforms.ellipsoidUvToShapeUvLatitude = Cartesian2.fromElements(
722
660
  scale,
723
661
  offset,
@@ -726,10 +664,6 @@ VoxelEllipsoidShape.prototype.update = function (
726
664
  }
727
665
  }
728
666
 
729
- if (isSphere) {
730
- shaderDefines["ELLIPSOID_IS_SPHERE"] = true;
731
- }
732
-
733
667
  this.shaderMaximumIntersectionsLength = intersectionCount;
734
668
 
735
669
  return true;
@@ -888,31 +822,6 @@ VoxelEllipsoidShape.prototype.computeOrientedBoundingBoxForSample = function (
888
822
  );
889
823
  };
890
824
 
891
- /**
892
- * Computes an approximate step size for raymarching the root tile of a voxel grid.
893
- * The update function must be called before calling this function.
894
- *
895
- * @param {Cartesian3} dimensions The voxel grid dimensions for a tile.
896
- * @returns {number} The step size.
897
- */
898
- VoxelEllipsoidShape.prototype.computeApproximateStepSize = function (
899
- dimensions
900
- ) {
901
- //>>includeStart('debug', pragmas.debug);
902
- Check.typeOf.object("dimensions", dimensions);
903
- //>>includeEnd('debug');
904
-
905
- const ellipsoid = this._ellipsoid;
906
- const ellipsoidMaximumRadius = ellipsoid.maximumRadius;
907
- const minimumHeight = this._minimumHeight;
908
- const maximumHeight = this._maximumHeight;
909
-
910
- const shellToEllipsoidRatio =
911
- (maximumHeight - minimumHeight) / (ellipsoidMaximumRadius + maximumHeight);
912
- const stepSize = (0.5 * shellToEllipsoidRatio) / dimensions.z;
913
- return stepSize;
914
- };
915
-
916
825
  /**
917
826
  * Computes an {@link OrientedBoundingBox} for a subregion of the shape.
918
827
  *