@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.
- package/Build/ThirdParty/Workers/z-worker-pako.js +7 -10
- package/Build/Workers/{chunk-F4HFJMGM.js → chunk-2CSEEWHN.js} +6 -6
- package/Build/Workers/{chunk-7TC63SJW.js → chunk-34DGOKCO.js} +10 -12
- package/Build/Workers/{chunk-7ZFGPDJA.js → chunk-3RZK5NNV.js} +4 -4
- package/Build/Workers/{chunk-M7ERACJJ.js → chunk-3S2MFY4B.js} +13 -13
- package/Build/Workers/{chunk-BROJAZRZ.js → chunk-4AJGCQFX.js} +13 -13
- package/Build/Workers/{chunk-2FWRMUTY.js → chunk-4KIUON73.js} +4 -4
- package/Build/Workers/{chunk-5QULIR53.js → chunk-4PHPQRSH.js} +4 -4
- package/Build/Workers/{chunk-X4356LRH.js → chunk-66E3H2KU.js} +12 -12
- package/Build/Workers/{chunk-G43QFN4Q.js → chunk-6HCAQOVK.js} +6 -6
- package/Build/Workers/{chunk-23UFSGND.js → chunk-7LPEGKOF.js} +7 -7
- package/Build/Workers/{chunk-DDUQAJ4P.js → chunk-7VZNXIKG.js} +7 -7
- package/Build/Workers/{chunk-JURN7NPV.js → chunk-A6NCZSL3.js} +19 -19
- package/Build/Workers/{chunk-ZT7KWISZ.js → chunk-AOFMPKUB.js} +4 -4
- package/Build/Workers/{chunk-BIKA3NRA.js → chunk-AOIKO5Y7.js} +5 -5
- package/Build/Workers/{chunk-YWTJ2B4B.js → chunk-BDUJXBVF.js} +1 -1
- package/Build/Workers/{chunk-OGXZVPPM.js → chunk-C5CE4OG6.js} +469 -6
- package/Build/Workers/{chunk-FNIRWHJB.js → chunk-CE6GTZ4I.js} +11 -13
- package/Build/Workers/{chunk-SH5USDPI.js → chunk-CYAJYEKW.js} +6 -6
- package/Build/Workers/{chunk-Y5UQJLYE.js → chunk-FOZQIHZK.js} +6 -6
- package/Build/Workers/{chunk-2FRVPMCS.js → chunk-G7CJQKKD.js} +7 -7
- package/Build/Workers/{chunk-EERJKOAF.js → chunk-GIFJ77E4.js} +4 -4
- package/Build/Workers/{chunk-FJKNFAKQ.js → chunk-I5TDPPC4.js} +7197 -5096
- package/Build/Workers/{chunk-3VAZEH7M.js → chunk-IBXGK4WV.js} +2 -2
- package/Build/Workers/{chunk-VOXYEYJT.js → chunk-JI2445T5.js} +11 -11
- package/Build/Workers/{chunk-PGSJK77E.js → chunk-KPY4F4BW.js} +6 -6
- package/Build/Workers/{chunk-I46ZRR5W.js → chunk-LVJCR7DH.js} +17 -17
- package/Build/Workers/{chunk-T3XIFPYR.js → chunk-LW7WGHEU.js} +16 -16
- package/Build/Workers/{chunk-HU6N6EXB.js → chunk-MWYZ64MH.js} +12 -11
- package/Build/Workers/chunk-NI2R52QD.js +961 -0
- package/Build/Workers/{chunk-SOWMRMWA.js → chunk-PEABJLCK.js} +1 -1
- package/Build/Workers/{chunk-EG6PTBY2.js → chunk-PK7TEP3J.js} +15 -15
- package/Build/Workers/{chunk-GRC2ZTAF.js → chunk-POLFRINT.js} +14 -14
- package/Build/Workers/{chunk-Z3TIFFGF.js → chunk-PS6AEMBR.js} +7 -7
- package/Build/Workers/{chunk-Y2ME2IJV.js → chunk-PWF3YJJ5.js} +13 -13
- package/Build/Workers/{chunk-2A75IWRS.js → chunk-QKF7XXEQ.js} +7 -7
- package/Build/Workers/{chunk-4H7PY4U5.js → chunk-RL73GOEF.js} +2 -2
- package/Build/Workers/{chunk-MDWEGWPA.js → chunk-RR7EOKGZ.js} +10 -10
- package/Build/Workers/{chunk-F3YA3Y2Z.js → chunk-S4XDCPKD.js} +1 -1
- package/Build/Workers/{chunk-PPH7OFP3.js → chunk-TMMOULW3.js} +5 -5
- package/Build/Workers/{chunk-XGI5BXZY.js → chunk-U4IMCOF5.js} +2 -2
- package/Build/Workers/{chunk-4DO5W5XZ.js → chunk-UAJEGIWA.js} +6 -6
- package/Build/Workers/{chunk-BBWDMCVU.js → chunk-UCPPWV64.js} +1 -1
- package/Build/Workers/{chunk-FZRIVR7Y.js → chunk-V7JB576Q.js} +5 -5
- package/Build/Workers/{chunk-2UPKWTMJ.js → chunk-WEGCQ5DY.js} +6 -6
- package/Build/Workers/{chunk-STW2DGFI.js → chunk-WFICTTOE.js} +2 -2
- package/Build/Workers/{chunk-LPR3YNP2.js → chunk-WWP3I7R5.js} +5 -5
- package/Build/Workers/{chunk-A5DWLWCY.js → chunk-XHLDDE65.js} +10 -10
- package/Build/Workers/{chunk-UEXTBDBE.js → chunk-XWML5Y7N.js} +11 -13
- package/Build/Workers/{chunk-EHWHNOEX.js → chunk-YLZTCEBJ.js} +1 -1
- package/Build/Workers/{chunk-34FXV7D7.js → chunk-ZC4AGBZK.js} +2 -2
- package/Build/Workers/{chunk-GATZHF3K.js → chunk-ZDP32RQI.js} +2 -2
- package/Build/Workers/{chunk-KKCR2YOP.js → chunk-ZWPIM77Q.js} +11 -11
- package/Build/Workers/combineGeometry.js +22 -24
- package/Build/Workers/createBoxGeometry.js +16 -18
- package/Build/Workers/createBoxOutlineGeometry.js +14 -16
- package/Build/Workers/createCircleGeometry.js +24 -26
- package/Build/Workers/createCircleOutlineGeometry.js +17 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -34
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -31
- package/Build/Workers/createCorridorGeometry.js +27 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +26 -28
- package/Build/Workers/createCylinderGeometry.js +18 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +16 -18
- package/Build/Workers/createEllipseGeometry.js +24 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +17 -19
- package/Build/Workers/createEllipsoidGeometry.js +17 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -18
- package/Build/Workers/createFrustumGeometry.js +16 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -19
- package/Build/Workers/createGeometry.js +23 -25
- package/Build/Workers/createGroundPolylineGeometry.js +23 -25
- package/Build/Workers/createPlaneGeometry.js +14 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +13 -15
- package/Build/Workers/createPolygonGeometry.js +33 -35
- package/Build/Workers/createPolygonOutlineGeometry.js +28 -30
- package/Build/Workers/createPolylineGeometry.js +23 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +29 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -27
- package/Build/Workers/createRectangleGeometry.js +27 -29
- package/Build/Workers/createRectangleOutlineGeometry.js +18 -20
- package/Build/Workers/createSimplePolylineGeometry.js +21 -23
- package/Build/Workers/createSphereGeometry.js +17 -19
- package/Build/Workers/createSphereOutlineGeometry.js +16 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -16
- package/Build/Workers/createVectorTileGeometries.js +22 -24
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +20 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -16
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -25
- package/Build/Workers/createVerticesFromHeightmap.js +23 -25
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +19 -22
- package/Build/Workers/createWallGeometry.js +22 -24
- package/Build/Workers/createWallOutlineGeometry.js +21 -23
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -11
- package/Build/Workers/transcodeKTX2.js +8 -8
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -22
- package/Source/Core/Check.d.ts +127 -0
- package/Source/Core/Check.js +0 -1
- package/Source/Core/Geometry.js +1 -1
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/PixelFormat.js +1 -0
- package/Source/Core/PolygonGeometry.js +1 -1
- package/Source/Core/Rectangle.js +89 -0
- package/Source/Core/VerticalExaggeration.js +2 -1
- package/Source/DataSources/DataSourceDisplay.js +5 -0
- package/Source/Renderer/ShaderBuilder.js +6 -3
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +37 -3
- package/Source/Scene/BillboardCollection.js +1 -1
- package/Source/Scene/BingMapsImageryProvider.js +4 -0
- package/Source/Scene/Cesium3DTile.js +65 -0
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +2 -9
- package/Source/Scene/Cesium3DTileset.js +52 -40
- package/Source/Scene/ClippingPolygon.js +212 -0
- package/Source/Scene/ClippingPolygonCollection.js +968 -0
- package/Source/Scene/Globe.js +14 -67
- package/Source/Scene/GlobeSurfaceShaderSet.js +81 -15
- package/Source/Scene/GlobeSurfaceTileProvider.js +81 -1
- package/Source/Scene/Label.js +33 -0
- package/Source/Scene/LabelCollection.js +2 -1
- package/Source/Scene/Model/Model.js +83 -0
- package/Source/Scene/Model/Model3DTileContent.js +21 -0
- package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +92 -0
- package/Source/Scene/Model/ModelSceneGraph.js +5 -0
- package/Source/Scene/Primitive.js +0 -3
- package/Source/Scene/SensorVolumePortionToDisplay.js +1 -1
- package/Source/Scene/Terrain.js +2 -2
- package/Source/Scene/VoxelBoxShape.js +0 -15
- package/Source/Scene/VoxelCylinderShape.js +14 -131
- package/Source/Scene/VoxelEllipsoidShape.js +136 -227
- package/Source/Scene/VoxelPrimitive.js +106 -14
- package/Source/Scene/VoxelRenderResources.js +9 -3
- package/Source/Scene/VoxelShape.js +0 -10
- package/Source/Scene/processVoxelProperties.js +1 -0
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -0
- package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +37 -0
- package/Source/Shaders/Builtin/Functions/clipPolygons.js +39 -0
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +14 -0
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +15 -0
- package/Source/Shaders/GlobeFS.glsl +12 -0
- package/Source/Shaders/GlobeFS.js +12 -0
- package/Source/Shaders/GlobeVS.glsl +32 -0
- package/Source/Shaders/GlobeVS.js +32 -0
- package/Source/Shaders/Model/GeometryStageVS.glsl +1 -1
- package/Source/Shaders/Model/GeometryStageVS.js +1 -1
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +6 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +8 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +27 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +29 -0
- package/Source/Shaders/Model/ModelFS.glsl +6 -0
- package/Source/Shaders/Model/ModelFS.js +7 -1
- package/Source/Shaders/Model/ModelVS.glsl +4 -0
- package/Source/Shaders/Model/ModelVS.js +4 -0
- package/Source/Shaders/PolygonSignedDistanceFS.glsl +100 -0
- package/Source/Shaders/PolygonSignedDistanceFS.js +101 -0
- package/Source/Shaders/Voxels/IntersectBox.glsl +21 -47
- package/Source/Shaders/Voxels/IntersectBox.js +21 -47
- package/Source/Shaders/Voxels/IntersectClippingPlanes.glsl +1 -1
- package/Source/Shaders/Voxels/IntersectClippingPlanes.js +1 -1
- package/Source/Shaders/Voxels/IntersectCylinder.glsl +66 -96
- package/Source/Shaders/Voxels/IntersectCylinder.js +66 -96
- package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +226 -154
- package/Source/Shaders/Voxels/IntersectEllipsoid.js +226 -154
- package/Source/Shaders/Voxels/IntersectionUtils.glsl +33 -11
- package/Source/Shaders/Voxels/IntersectionUtils.js +33 -11
- package/Source/Shaders/Voxels/Megatexture.glsl +1 -2
- package/Source/Shaders/Voxels/Megatexture.js +1 -2
- package/Source/Shaders/Voxels/Octree.glsl +14 -9
- package/Source/Shaders/Voxels/Octree.js +14 -9
- package/Source/Shaders/Voxels/VoxelFS.glsl +93 -43
- package/Source/Shaders/Voxels/VoxelFS.js +93 -43
- package/Source/Shaders/Voxels/VoxelUtils.glsl +31 -0
- package/Source/Shaders/Voxels/VoxelUtils.js +33 -0
- package/Source/Shaders/Voxels/convertUvToBox.glsl +24 -3
- package/Source/Shaders/Voxels/convertUvToBox.js +24 -4
- package/Source/Shaders/Voxels/convertUvToCylinder.glsl +50 -8
- package/Source/Shaders/Voxels/convertUvToCylinder.js +50 -8
- package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +82 -53
- package/Source/Shaders/Voxels/convertUvToEllipsoid.js +82 -53
- package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/Source/Workers/createGeometry.js +1 -1
- package/index.d.ts +478 -35
- package/index.js +61 -52
- package/package.json +2 -2
- package/Build/Workers/chunk-BG4UCVXN.js +0 -73
- package/Build/Workers/chunk-TTUZP4BO.js +0 -501
- 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
|
-
|
|
105
|
+
ellipsoidRenderLatitudeSinMinMax: new Cartesian2(),
|
|
104
106
|
ellipsoidInverseHeightDifferenceUv: 0.0,
|
|
105
|
-
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
//
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
196
|
+
actualMinBounds.z = -Cartesian3.minimumComponent(radii);
|
|
197
|
+
|
|
198
|
+
const shapeMinBounds = Cartesian3.clamp(
|
|
199
|
+
minBounds,
|
|
200
|
+
actualMinBounds,
|
|
201
|
+
DefaultMaxBounds,
|
|
202
|
+
scratchShapeMinBounds
|
|
216
203
|
);
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
204
|
+
const shapeMaxBounds = Cartesian3.clamp(
|
|
205
|
+
maxBounds,
|
|
206
|
+
actualMinBounds,
|
|
207
|
+
DefaultMaxBounds,
|
|
208
|
+
scratchShapeMaxBounds
|
|
221
209
|
);
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
defaultMinLatitude,
|
|
228
|
-
defaultMaxLatitude
|
|
210
|
+
const clampedClipMinBounds = Cartesian3.clamp(
|
|
211
|
+
clipMinBounds,
|
|
212
|
+
actualMinBounds,
|
|
213
|
+
DefaultMaxBounds,
|
|
214
|
+
scratchClipMinBounds
|
|
229
215
|
);
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
216
|
+
const clampedClipMaxBounds = Cartesian3.clamp(
|
|
217
|
+
clipMaxBounds,
|
|
218
|
+
actualMinBounds,
|
|
219
|
+
DefaultMaxBounds,
|
|
220
|
+
scratchClipMaxBounds
|
|
234
221
|
);
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
222
|
+
const renderMinBounds = Cartesian3.maximumByComponent(
|
|
223
|
+
shapeMinBounds,
|
|
224
|
+
clampedClipMinBounds,
|
|
225
|
+
scratchRenderMinBounds
|
|
239
226
|
);
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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 =
|
|
321
|
-
this._maximumHeight =
|
|
283
|
+
this._minimumHeight = shapeMinBounds.z;
|
|
284
|
+
this._maximumHeight = shapeMaxBounds.z;
|
|
322
285
|
|
|
323
286
|
const renderRectangle = Rectangle.fromRadians(
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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
|
-
|
|
334
|
-
|
|
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
|
|
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
|
-
|
|
362
|
-
|
|
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 =
|
|
341
|
+
const shapeIsLongitudeReversed = shapeMaxBounds.x < shapeMinBounds.x;
|
|
377
342
|
const shapeLongitudeRange =
|
|
378
|
-
|
|
379
|
-
|
|
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 =
|
|
360
|
+
const renderIsLatitudeMaxUnderHalf = renderMaxBounds.y < -epsilonLatitudeFlat;
|
|
396
361
|
const renderIsLatitudeMaxHalf =
|
|
397
|
-
|
|
398
|
-
|
|
362
|
+
renderMaxBounds.y >= -epsilonLatitudeFlat &&
|
|
363
|
+
renderMaxBounds.y <= +epsilonLatitudeFlat;
|
|
399
364
|
const renderIsLatitudeMaxOverHalf =
|
|
400
|
-
|
|
401
|
-
|
|
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
|
-
|
|
408
|
-
|
|
372
|
+
renderMinBounds.y > DefaultMinBounds.y + epsilonLatitude &&
|
|
373
|
+
renderMinBounds.y < -epsilonLatitudeFlat;
|
|
409
374
|
const renderIsLatitudeMinHalf =
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
const renderIsLatitudeMinOverHalf =
|
|
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 =
|
|
420
|
-
const shapeIsLatitudeMaxUnderHalf =
|
|
384
|
+
const shapeLatitudeRange = shapeMaxBounds.y - shapeMinBounds.y;
|
|
385
|
+
const shapeIsLatitudeMaxUnderHalf = shapeMaxBounds.y < -epsilonLatitudeFlat;
|
|
421
386
|
const shapeIsLatitudeMaxHalf =
|
|
422
|
-
|
|
423
|
-
|
|
387
|
+
shapeMaxBounds.y >= -epsilonLatitudeFlat &&
|
|
388
|
+
shapeMaxBounds.y <= +epsilonLatitudeFlat;
|
|
424
389
|
const shapeIsLatitudeMaxOverHalf =
|
|
425
|
-
|
|
426
|
-
|
|
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
|
-
|
|
433
|
-
|
|
397
|
+
shapeMinBounds.y > DefaultMinBounds.y + epsilonLatitude &&
|
|
398
|
+
shapeMinBounds.y < -epsilonLatitudeFlat;
|
|
434
399
|
const shapeIsLatitudeMinHalf =
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
const shapeIsLatitudeMinOverHalf =
|
|
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
|
|
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
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
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 = (
|
|
460
|
+
const thickness = (shapeMaxBounds.z - shapeMinBounds.z) / shapeMaxExtent;
|
|
511
461
|
shaderUniforms.ellipsoidInverseHeightDifferenceUv = 1.0 / thickness;
|
|
512
|
-
|
|
513
|
-
shaderUniforms.
|
|
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
|
-
|
|
545
|
-
|
|
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 =
|
|
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
|
-
-(
|
|
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
|
-
|
|
591
|
-
|
|
535
|
+
renderMinBounds.x,
|
|
536
|
+
DefaultMinBounds.x,
|
|
592
537
|
undefined,
|
|
593
538
|
epsilonLongitudeDiscontinuity
|
|
594
539
|
);
|
|
595
540
|
const renderIsMaxLongitudeDiscontinuity = CesiumMath.equalsEpsilon(
|
|
596
|
-
|
|
597
|
-
|
|
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
|
-
(
|
|
558
|
+
(shapeMinBounds.x - DefaultMinBounds.x) / defaultLongitudeRange;
|
|
614
559
|
const uvShapeMaxLongitude =
|
|
615
|
-
(
|
|
560
|
+
(shapeMaxBounds.x - DefaultMinBounds.x) / defaultLongitudeRange;
|
|
616
561
|
|
|
617
562
|
const uvRenderMaxLongitude =
|
|
618
|
-
(
|
|
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
|
-
|
|
684
|
-
Math.
|
|
685
|
-
|
|
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
|
-
(
|
|
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
|
*
|