@cesium/engine 6.1.1 → 7.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.
- package/Build/ThirdParty/Workers/z-worker-pako.js +568 -407
- package/Build/Workers/{chunk-FRG2Z7DE.js → chunk-2HJWSU7B.js} +4 -4
- package/Build/Workers/{chunk-ZTYE74E2.js → chunk-46UD5ABS.js} +4 -4
- package/Build/Workers/{chunk-VODWDCX6.js → chunk-4EBHOMFX.js} +18 -20
- package/Build/Workers/{chunk-N7TYCDTR.js → chunk-5HDYHG3F.js} +13 -13
- package/Build/Workers/{chunk-C53JYYKX.js → chunk-5M3U6ZMA.js} +1 -1
- package/Build/Workers/{chunk-GTEXWEAP.js → chunk-5WQ523AW.js} +5 -5
- package/Build/Workers/{chunk-SEFDWMCW.js → chunk-5YLJ77FF.js} +31 -21
- package/Build/Workers/{chunk-VNRUVNIK.js → chunk-6HZQPRUS.js} +1 -1
- package/Build/Workers/{chunk-PB7BIXHI.js → chunk-6VJVYK2V.js} +2 -2
- package/Build/Workers/{chunk-PHQVHDVI.js → chunk-72SANQJV.js} +325 -5
- package/Build/Workers/{chunk-D325WRAY.js → chunk-7XEAYGZK.js} +35 -11
- package/Build/Workers/{chunk-FGUP2QEP.js → chunk-AIPU2VSX.js} +6 -6
- package/Build/Workers/{chunk-QUXSQQEF.js → chunk-AR5DNBJ4.js} +6 -6
- package/Build/Workers/{chunk-ZVUAJKAL.js → chunk-BZP4T2JJ.js} +11 -13
- package/Build/Workers/{chunk-K6Q5IRBK.js → chunk-DTAIXKTO.js} +6 -6
- package/Build/Workers/{chunk-D4YHO4NZ.js → chunk-F6SE42BK.js} +133 -101
- package/Build/Workers/{chunk-QY2WY5XJ.js → chunk-FP6GYBFX.js} +11 -11
- package/Build/Workers/{chunk-Z6LPXA7S.js → chunk-GEJTYLCO.js} +5 -5
- package/Build/Workers/{chunk-VKTKOIYG.js → chunk-GV56Q4LU.js} +11 -11
- package/Build/Workers/{chunk-KUB2HQXR.js → chunk-IQBYFRVW.js} +8 -8
- package/Build/Workers/{chunk-235MRXLH.js → chunk-IX2JCCNM.js} +1 -1
- package/Build/Workers/{chunk-3FCUUN6M.js → chunk-JCNXK6EL.js} +11 -11
- package/Build/Workers/{chunk-364TQORK.js → chunk-JJ4VBOQ3.js} +5 -7
- package/Build/Workers/{chunk-66CXKODF.js → chunk-JXDC723O.js} +2 -2
- package/Build/Workers/{chunk-OTBRPBCC.js → chunk-JY5YEZFA.js} +9 -9
- package/Build/Workers/{chunk-LSGUCCKJ.js → chunk-L2ZN645J.js} +6 -6
- package/Build/Workers/{chunk-VLDDXYKI.js → chunk-LZ7JIV3K.js} +18 -18
- package/Build/Workers/{chunk-36ESDRIZ.js → chunk-LZGHD6NY.js} +16 -16
- package/Build/Workers/{chunk-PXLFBN2Q.js → chunk-MY3VNFGQ.js} +7 -7
- package/Build/Workers/{chunk-W7F5VTH6.js → chunk-NKPBIX7F.js} +1 -1
- package/Build/Workers/{chunk-XBZSOW3F.js → chunk-NY3K4IM3.js} +12 -12
- package/Build/Workers/{chunk-AI3KSNM6.js → chunk-ODW7WYM4.js} +2 -2
- package/Build/Workers/{chunk-6PWSSCRA.js → chunk-OVLG3FRS.js} +6 -6
- package/Build/Workers/{chunk-MOLGJDJV.js → chunk-PNBGBETF.js} +11 -11
- package/Build/Workers/{chunk-T73B27DG.js → chunk-PTQQUQC3.js} +13 -13
- package/Build/Workers/{chunk-RSWBNJPT.js → chunk-QZAD5O7I.js} +8 -304
- package/Build/Workers/{chunk-I6TVJ6T7.js → chunk-R5X4OQT4.js} +8 -8
- package/Build/Workers/{chunk-DTNN3ODA.js → chunk-RAEV7K66.js} +5 -5
- package/Build/Workers/{chunk-IZED7ODV.js → chunk-RV7ZYPFT.js} +4 -4
- package/Build/Workers/{chunk-7FEGZO3D.js → chunk-S4MAZ3SS.js} +2 -2
- package/Build/Workers/{chunk-J3U6Z5YQ.js → chunk-S6SKF6DT.js} +5 -5
- package/Build/Workers/{chunk-CHDJ66UM.js → chunk-U2VCRRQW.js} +6 -6
- package/Build/Workers/{chunk-R22RQAAM.js → chunk-UAEW6HKG.js} +13 -13
- package/Build/Workers/{chunk-S7IBK36I.js → chunk-UDO6BFSF.js} +14 -16
- package/Build/Workers/{chunk-YS4KPNLC.js → chunk-UGK3FCDY.js} +1 -1
- package/Build/Workers/{chunk-SJDXMQSP.js → chunk-VK3EJHWI.js} +2 -2
- package/Build/Workers/{chunk-HEROVJML.js → chunk-VRGFV2UO.js} +7 -7
- package/Build/Workers/{chunk-VOAZN4IP.js → chunk-WBQCVXR3.js} +4 -4
- package/Build/Workers/{chunk-HSW63JN4.js → chunk-WZU2YLWG.js} +3 -3
- package/Build/Workers/{chunk-4EYB62WJ.js → chunk-XWXM2O2R.js} +6 -6
- package/Build/Workers/{chunk-ZGMOBRTG.js → chunk-YUCVWAY6.js} +7 -7
- package/Build/Workers/{chunk-CLVEIRXT.js → chunk-ZK5JOS3D.js} +15 -17
- package/Build/Workers/{chunk-5NZTU5YL.js → chunk-ZUA2UUNV.js} +2 -2
- package/Build/Workers/combineGeometry.js +23 -23
- package/Build/Workers/createBoxGeometry.js +17 -17
- package/Build/Workers/createBoxOutlineGeometry.js +15 -15
- package/Build/Workers/createCircleGeometry.js +25 -25
- package/Build/Workers/createCircleOutlineGeometry.js +18 -18
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -34
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createCorridorGeometry.js +28 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +27 -28
- package/Build/Workers/createCylinderGeometry.js +19 -19
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -19
- package/Build/Workers/createEllipseGeometry.js +25 -25
- package/Build/Workers/createEllipseOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipsoidGeometry.js +18 -18
- package/Build/Workers/createEllipsoidOutlineGeometry.js +17 -17
- package/Build/Workers/createFrustumGeometry.js +17 -17
- package/Build/Workers/createFrustumOutlineGeometry.js +17 -17
- package/Build/Workers/createGeometry.js +23 -23
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +15 -15
- package/Build/Workers/createPlaneOutlineGeometry.js +14 -14
- package/Build/Workers/createPolygonGeometry.js +32 -167
- package/Build/Workers/createPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createPolylineGeometry.js +24 -24
- package/Build/Workers/createPolylineVolumeGeometry.js +32 -35
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -29
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +21 -23
- package/Build/Workers/createSimplePolylineGeometry.js +22 -22
- package/Build/Workers/createSphereGeometry.js +18 -18
- package/Build/Workers/createSphereOutlineGeometry.js +17 -17
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +23 -23
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +21 -21
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +19 -19
- package/Build/Workers/createWallGeometry.js +23 -23
- package/Build/Workers/createWallOutlineGeometry.js +22 -22
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +9 -9
- package/Build/Workers/transcodeKTX2.js +7 -7
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/LICENSE.md +1 -1
- package/Source/Assets/approximateTerrainHeights.json +1 -1
- package/Source/Core/Ellipsoid.js +45 -0
- package/Source/Core/GregorianDate.js +85 -0
- package/Source/Core/HeadingPitchRange.js +2 -2
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/PolygonGeometry.js +0 -169
- package/Source/Core/Quaternion.js +6 -2
- package/Source/Core/RectangleOutlineGeometry.js +2 -4
- package/Source/Core/RequestScheduler.js +3 -9
- package/Source/Core/Resource.js +30 -69
- package/Source/Core/TerrainEncoding.js +2 -2
- package/Source/Core/Transforms.js +27 -18
- package/Source/Core/VerticalExaggeration.js +69 -0
- package/Source/Core/createWorldBathymetryAsync.js +45 -0
- package/Source/DataSources/EllipsoidGeometryUpdater.js +3 -4
- package/Source/DataSources/Entity.js +8 -5
- package/Source/DataSources/EntityCollection.js +1 -2
- package/Source/DataSources/GeometryUpdater.js +1 -2
- package/Source/DataSources/GroundGeometryUpdater.js +6 -3
- package/Source/DataSources/ModelVisualizer.js +19 -98
- package/Source/DataSources/PolygonGeometryUpdater.js +14 -2
- package/Source/DataSources/PolylineGeometryUpdater.js +9 -8
- package/Source/DataSources/TerrainOffsetProperty.js +15 -23
- package/Source/Renderer/AutomaticUniforms.js +173 -0
- package/Source/Renderer/UniformState.js +246 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Atmosphere.js +127 -0
- package/Source/Scene/Billboard.js +29 -26
- package/Source/Scene/BillboardCollection.js +3 -3
- package/Source/Scene/Camera.js +1 -1
- package/Source/Scene/Cesium3DTile.js +123 -10
- package/Source/Scene/Cesium3DTileContent.js +14 -0
- package/Source/Scene/Cesium3DTileset.js +326 -45
- package/Source/Scene/Cesium3DTilesetTraversal.js +4 -0
- package/Source/Scene/Composite3DTileContent.js +42 -0
- package/Source/Scene/DynamicAtmosphereLightingType.js +56 -0
- package/Source/Scene/Empty3DTileContent.js +4 -0
- package/Source/Scene/Fog.js +1 -0
- package/Source/Scene/FrameState.js +13 -5
- package/Source/Scene/Geometry3DTileContent.js +4 -0
- package/Source/Scene/Globe.js +69 -21
- package/Source/Scene/GlobeSurfaceTile.js +4 -4
- package/Source/Scene/GlobeSurfaceTileProvider.js +24 -22
- package/Source/Scene/GltfLoader.js +15 -5
- package/Source/Scene/GroundPrimitive.js +5 -5
- package/Source/Scene/HeightReference.js +59 -2
- package/Source/Scene/ImageryLayer.js +3 -3
- package/Source/Scene/Implicit3DTileContent.js +4 -0
- package/Source/Scene/LabelCollection.js +2 -2
- package/Source/Scene/MapboxImageryProvider.js +2 -2
- package/Source/Scene/Megatexture.js +1 -1
- package/Source/Scene/Model/AtmospherePipelineStage.js +59 -0
- package/Source/Scene/Model/B3dmLoader.js +4 -0
- package/Source/Scene/Model/FeatureIdPipelineStage.js +25 -2
- package/Source/Scene/Model/I3dmLoader.js +4 -0
- package/Source/Scene/Model/InstancingPipelineStage.js +24 -6
- package/Source/Scene/Model/MetadataPipelineStage.js +31 -3
- package/Source/Scene/Model/Model.js +93 -32
- package/Source/Scene/Model/Model3DTileContent.js +31 -0
- package/Source/Scene/Model/ModelAnimationChannel.js +16 -15
- package/Source/Scene/Model/ModelRuntimePrimitive.js +6 -0
- package/Source/Scene/Model/ModelSceneGraph.js +6 -0
- package/Source/Scene/Model/VerticalExaggerationPipelineStage.js +60 -0
- package/Source/Scene/Model/pickModel.js +408 -0
- package/Source/Scene/Multiple3DTileContent.js +42 -0
- package/Source/Scene/QuadtreePrimitive.js +1 -1
- package/Source/Scene/Scene.js +226 -19
- package/Source/Scene/ScreenSpaceCameraController.js +14 -25
- package/Source/Scene/SkyAtmosphere.js +5 -6
- package/Source/Scene/Terrain.js +49 -0
- package/Source/Scene/TerrainFillMesh.js +2 -2
- package/Source/Scene/TileBoundingS2Cell.js +2 -2
- package/Source/Scene/TileOrientedBoundingBox.js +1 -1
- package/Source/Scene/Tileset3DTileContent.js +4 -0
- package/Source/Scene/Vector3DTileContent.js +4 -0
- package/Source/Scene/VoxelPrimitive.js +73 -2
- package/Source/Shaders/AtmosphereCommon.glsl +3 -11
- package/Source/Shaders/AtmosphereCommon.js +3 -11
- package/Source/Shaders/Builtin/CzmBuiltins.js +12 -0
- package/Source/Shaders/Builtin/Functions/applyHSBShift.glsl +32 -0
- package/Source/Shaders/Builtin/Functions/applyHSBShift.js +34 -0
- package/Source/Shaders/Builtin/Functions/approximateTanh.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/approximateTanh.js +12 -0
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.glsl +44 -0
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.js +46 -0
- package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.js +32 -0
- package/Source/Shaders/Builtin/Functions/computeScattering.glsl +150 -0
- package/Source/Shaders/Builtin/Functions/computeScattering.js +152 -0
- package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.js +24 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.glsl +5 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.js +5 -0
- package/Source/Shaders/GlobeFS.glsl +16 -25
- package/Source/Shaders/GlobeFS.js +16 -25
- package/Source/Shaders/GlobeVS.glsl +4 -4
- package/Source/Shaders/GlobeVS.js +4 -4
- package/Source/Shaders/Model/AtmosphereStageFS.glsl +111 -0
- package/Source/Shaders/Model/AtmosphereStageFS.js +113 -0
- package/Source/Shaders/Model/AtmosphereStageVS.glsl +12 -0
- package/Source/Shaders/Model/AtmosphereStageVS.js +14 -0
- package/Source/Shaders/Model/GeometryStageFS.glsl +1 -1
- package/Source/Shaders/Model/GeometryStageFS.js +1 -1
- package/Source/Shaders/Model/GeometryStageVS.glsl +4 -4
- package/Source/Shaders/Model/GeometryStageVS.js +4 -4
- package/Source/Shaders/Model/ModelColorStageFS.glsl +1 -1
- package/Source/Shaders/Model/ModelColorStageFS.js +2 -1
- package/Source/Shaders/Model/ModelFS.glsl +4 -0
- package/Source/Shaders/Model/ModelFS.js +4 -0
- package/Source/Shaders/Model/ModelVS.glsl +13 -4
- package/Source/Shaders/Model/ModelVS.js +13 -4
- package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +39 -0
- package/Source/Shaders/Model/VerticalExaggerationStageVS.js +41 -0
- package/Source/Shaders/SkyAtmosphereCommon.glsl +3 -13
- package/Source/Shaders/SkyAtmosphereCommon.js +3 -13
- package/Source/Shaders/SkyAtmosphereFS.glsl +5 -10
- package/Source/Shaders/SkyAtmosphereFS.js +5 -10
- package/Source/Shaders/SkyAtmosphereVS.glsl +3 -2
- package/Source/Shaders/SkyAtmosphereVS.js +3 -2
- package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/Source/ThirdParty/draco_decoder.wasm +0 -0
- package/index.d.ts +318 -83
- package/index.js +77 -62
- package/package.json +3 -3
- package/Build/Workers/chunk-7ONRI7T4.js +0 -55
- package/Source/Core/TerrainExaggeration.js +0 -49
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atmosphere lighting effects (sky atmosphere, ground atmosphere, fog) can be
|
|
3
|
+
* further modified with dynamic lighting from the sun or other light source
|
|
4
|
+
* that changes over time. This enum determines which light source to use.
|
|
5
|
+
*
|
|
6
|
+
* @enum {number}
|
|
7
|
+
*/
|
|
8
|
+
const DynamicAtmosphereLightingType = {
|
|
9
|
+
/**
|
|
10
|
+
* Do not use dynamic atmosphere lighting. Atmosphere lighting effects will
|
|
11
|
+
* be lit from directly above rather than using the scene's light source.
|
|
12
|
+
*
|
|
13
|
+
* @type {number}
|
|
14
|
+
* @constant
|
|
15
|
+
*/
|
|
16
|
+
NONE: 0,
|
|
17
|
+
/**
|
|
18
|
+
* Use the scene's current light source for dynamic atmosphere lighting.
|
|
19
|
+
*
|
|
20
|
+
* @type {number}
|
|
21
|
+
* @constant
|
|
22
|
+
*/
|
|
23
|
+
SCENE_LIGHT: 1,
|
|
24
|
+
/**
|
|
25
|
+
* Force the dynamic atmosphere lighting to always use the sunlight direction,
|
|
26
|
+
* even if the scene uses a different light source.
|
|
27
|
+
*
|
|
28
|
+
* @type {number}
|
|
29
|
+
* @constant
|
|
30
|
+
*/
|
|
31
|
+
SUNLIGHT: 2,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get the lighting enum from the older globe flags
|
|
36
|
+
*
|
|
37
|
+
* @param {Globe} globe The globe
|
|
38
|
+
* @return {DynamicAtmosphereLightingType} The corresponding enum value
|
|
39
|
+
*
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
42
|
+
DynamicAtmosphereLightingType.fromGlobeFlags = function (globe) {
|
|
43
|
+
const lightingOn = globe.enableLighting && globe.dynamicAtmosphereLighting;
|
|
44
|
+
if (!lightingOn) {
|
|
45
|
+
return DynamicAtmosphereLightingType.NONE;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Force sunlight
|
|
49
|
+
if (globe.dynamicAtmosphereLightingFromSun) {
|
|
50
|
+
return DynamicAtmosphereLightingType.SUNLIGHT;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return DynamicAtmosphereLightingType.SCENE_LIGHT;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default Object.freeze(DynamicAtmosphereLightingType);
|
|
@@ -150,6 +150,10 @@ Empty3DTileContent.prototype.applyStyle = function (style) {};
|
|
|
150
150
|
|
|
151
151
|
Empty3DTileContent.prototype.update = function (tileset, frameState) {};
|
|
152
152
|
|
|
153
|
+
Empty3DTileContent.prototype.pick = function (ray, frameState, result) {
|
|
154
|
+
return undefined;
|
|
155
|
+
};
|
|
156
|
+
|
|
153
157
|
Empty3DTileContent.prototype.isDestroyed = function () {
|
|
154
158
|
return false;
|
|
155
159
|
};
|
package/Source/Scene/Fog.js
CHANGED
|
@@ -254,7 +254,8 @@ function FrameState(context, creditDisplay, jobScheduler) {
|
|
|
254
254
|
/**
|
|
255
255
|
* @typedef FrameState.Fog
|
|
256
256
|
* @type {object}
|
|
257
|
-
* @property {boolean} enabled <code>true</code> if fog is enabled, <code>false</code> otherwise.
|
|
257
|
+
* @property {boolean} enabled <code>true</code> if fog is enabled, <code>false</code> otherwise. This affects both fog culling and rendering.
|
|
258
|
+
* @property {boolean} renderable <code>true</code> if fog should be rendered, <code>false</code> if not. This flag should be checked in combination with fog.enabled.
|
|
258
259
|
* @property {number} density A positive number used to mix the color and fog color based on camera distance.
|
|
259
260
|
* @property {number} sse A scalar used to modify the screen space error of geometry partially in fog.
|
|
260
261
|
* @property {number} minimumBrightness The minimum brightness of terrain with fog applied.
|
|
@@ -269,24 +270,31 @@ function FrameState(context, creditDisplay, jobScheduler) {
|
|
|
269
270
|
* @default false
|
|
270
271
|
*/
|
|
271
272
|
enabled: false,
|
|
273
|
+
renderable: false,
|
|
272
274
|
density: undefined,
|
|
273
275
|
sse: undefined,
|
|
274
276
|
minimumBrightness: undefined,
|
|
275
277
|
};
|
|
276
278
|
|
|
277
279
|
/**
|
|
278
|
-
*
|
|
280
|
+
* The current Atmosphere
|
|
281
|
+
* @type {Atmosphere}
|
|
282
|
+
*/
|
|
283
|
+
this.atmosphere = undefined;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* A scalar used to vertically exaggerate the scene
|
|
279
287
|
* @type {number}
|
|
280
288
|
* @default 1.0
|
|
281
289
|
*/
|
|
282
|
-
this.
|
|
290
|
+
this.verticalExaggeration = 1.0;
|
|
283
291
|
|
|
284
292
|
/**
|
|
285
|
-
* The height relative to which
|
|
293
|
+
* The height relative to which the scene is vertically exaggerated.
|
|
286
294
|
* @type {number}
|
|
287
295
|
* @default 0.0
|
|
288
296
|
*/
|
|
289
|
-
this.
|
|
297
|
+
this.verticalExaggerationRelativeHeight = 0.0;
|
|
290
298
|
|
|
291
299
|
/**
|
|
292
300
|
* @typedef FrameState.ShadowState
|
|
@@ -525,6 +525,10 @@ Geometry3DTileContent.prototype.update = function (tileset, frameState) {
|
|
|
525
525
|
}
|
|
526
526
|
};
|
|
527
527
|
|
|
528
|
+
Geometry3DTileContent.prototype.pick = function (ray, frameState, result) {
|
|
529
|
+
return undefined;
|
|
530
|
+
};
|
|
531
|
+
|
|
528
532
|
Geometry3DTileContent.prototype.isDestroyed = function () {
|
|
529
533
|
return false;
|
|
530
534
|
};
|
package/Source/Scene/Globe.js
CHANGED
|
@@ -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 deprecationWarning from "../Core/deprecationWarning.js";
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})
|
|
@@ -340,25 +341,9 @@ function Globe(ellipsoid) {
|
|
|
340
341
|
*/
|
|
341
342
|
this.atmosphereBrightnessShift = 0.0;
|
|
342
343
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
* A value of <code>0.0</code> makes the terrain completely flat.
|
|
347
|
-
* Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
|
|
348
|
-
* @type {number}
|
|
349
|
-
* @default 1.0
|
|
350
|
-
*/
|
|
351
|
-
this.terrainExaggeration = 1.0;
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* The height from which terrain is exaggerated. Defaults to <code>0.0</code> (scaled relative to ellipsoid surface).
|
|
355
|
-
* Terrain that is above this height will scale upwards and terrain that is below this height will scale downwards.
|
|
356
|
-
* Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
|
|
357
|
-
* If {@link Globe#terrainExaggeration} is <code>1.0</code> this value will have no effect.
|
|
358
|
-
* @type {number}
|
|
359
|
-
* @default 0.0
|
|
360
|
-
*/
|
|
361
|
-
this.terrainExaggerationRelativeHeight = 0.0;
|
|
344
|
+
this._terrainExaggerationChanged = false;
|
|
345
|
+
this._terrainExaggeration = 1.0;
|
|
346
|
+
this._terrainExaggerationRelativeHeight = 0.0;
|
|
362
347
|
|
|
363
348
|
/**
|
|
364
349
|
* Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles.
|
|
@@ -538,6 +523,68 @@ Object.defineProperties(Globe.prototype, {
|
|
|
538
523
|
return this._terrainProviderChanged;
|
|
539
524
|
},
|
|
540
525
|
},
|
|
526
|
+
/**
|
|
527
|
+
* A scalar used to exaggerate the terrain. Defaults to <code>1.0</code> (no exaggeration).
|
|
528
|
+
* A value of <code>2.0</code> scales the terrain by 2x.
|
|
529
|
+
* A value of <code>0.0</code> makes the terrain completely flat.
|
|
530
|
+
* Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
|
|
531
|
+
*
|
|
532
|
+
* @memberof Globe.prototype
|
|
533
|
+
* @type {number}
|
|
534
|
+
* @default 1.0
|
|
535
|
+
*
|
|
536
|
+
* @deprecated
|
|
537
|
+
*/
|
|
538
|
+
terrainExaggeration: {
|
|
539
|
+
get: function () {
|
|
540
|
+
deprecationWarning(
|
|
541
|
+
"Globe.terrainExaggeration",
|
|
542
|
+
"Globe.terrainExaggeration was deprecated in CesiumJS 1.113. It will be removed in CesiumJS 1.116. Use Scene.verticalExaggeration instead."
|
|
543
|
+
);
|
|
544
|
+
return this._terrainExaggeration;
|
|
545
|
+
},
|
|
546
|
+
set: function (value) {
|
|
547
|
+
deprecationWarning(
|
|
548
|
+
"Globe.terrainExaggeration",
|
|
549
|
+
"Globe.terrainExaggeration was deprecated in CesiumJS 1.113. It will be removed in CesiumJS 1.116. Use Scene.verticalExaggeration instead."
|
|
550
|
+
);
|
|
551
|
+
if (value !== this._terrainExaggeration) {
|
|
552
|
+
this._terrainExaggeration = value;
|
|
553
|
+
this._terrainExaggerationChanged = true;
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
/**
|
|
558
|
+
* The height from which terrain is exaggerated. Defaults to <code>0.0</code> (scaled relative to ellipsoid surface).
|
|
559
|
+
* Terrain that is above this height will scale upwards and terrain that is below this height will scale downwards.
|
|
560
|
+
* Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
|
|
561
|
+
* If {@link Globe#terrainExaggeration} is <code>1.0</code> this value will have no effect.
|
|
562
|
+
*
|
|
563
|
+
* @memberof Globe.prototype
|
|
564
|
+
* @type {number}
|
|
565
|
+
* @default 0.0
|
|
566
|
+
*
|
|
567
|
+
* @deprecated
|
|
568
|
+
*/
|
|
569
|
+
terrainExaggerationRelativeHeight: {
|
|
570
|
+
get: function () {
|
|
571
|
+
deprecationWarning(
|
|
572
|
+
"Globe.terrainExaggerationRelativeHeight",
|
|
573
|
+
"Globe.terrainExaggerationRelativeHeight was deprecated in CesiumJS 1.113. It will be removed in CesiumJS 1.116. Use Scene.verticalExaggerationRelativeHeight instead."
|
|
574
|
+
);
|
|
575
|
+
return this._terrainExaggerationRelativeHeight;
|
|
576
|
+
},
|
|
577
|
+
set: function (value) {
|
|
578
|
+
deprecationWarning(
|
|
579
|
+
"Globe.terrainExaggerationRelativeHeight",
|
|
580
|
+
"Globe.terrainExaggerationRelativeHeight was deprecated in CesiumJS 1.113. It will be removed in CesiumJS 1.116. Use Scene.verticalExaggerationRelativeHeight instead."
|
|
581
|
+
);
|
|
582
|
+
if (value !== this._terrainExaggerationRelativeHeight) {
|
|
583
|
+
this._terrainExaggerationRelativeHeight = value;
|
|
584
|
+
this._terrainExaggerationChanged = true;
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
},
|
|
541
588
|
/**
|
|
542
589
|
* Gets an event that's raised when the length of the tile load queue has changed since the last render frame. When the load queue is empty,
|
|
543
590
|
* all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.
|
|
@@ -644,8 +691,8 @@ function makeShadersDirty(globe) {
|
|
|
644
691
|
|
|
645
692
|
const requireNormals =
|
|
646
693
|
defined(globe._material) &&
|
|
647
|
-
(globe._material.shaderSource.match(/slope/) ||
|
|
648
|
-
globe._material.shaderSource.match("normalEC"));
|
|
694
|
+
(defined(globe._material.shaderSource.match(/slope/)) ||
|
|
695
|
+
defined(globe._material.shaderSource.match("normalEC")));
|
|
649
696
|
|
|
650
697
|
const fragmentSources = [AtmosphereCommon, GroundAtmosphere];
|
|
651
698
|
if (
|
|
@@ -1059,6 +1106,7 @@ Globe.prototype.beginFrame = function (frameState) {
|
|
|
1059
1106
|
tileProvider.undergroundColor = this._undergroundColor;
|
|
1060
1107
|
tileProvider.undergroundColorAlphaByDistance = this._undergroundColorAlphaByDistance;
|
|
1061
1108
|
tileProvider.lambertDiffuseMultiplier = this.lambertDiffuseMultiplier;
|
|
1109
|
+
|
|
1062
1110
|
surface.beginFrame(frameState);
|
|
1063
1111
|
}
|
|
1064
1112
|
};
|
|
@@ -463,9 +463,9 @@ GlobeSurfaceTile.prototype.updateExaggeration = function (
|
|
|
463
463
|
}
|
|
464
464
|
|
|
465
465
|
// Check the tile's terrain encoding to see if it has been exaggerated yet
|
|
466
|
-
const exaggeration = frameState.
|
|
466
|
+
const exaggeration = frameState.verticalExaggeration;
|
|
467
467
|
const exaggerationRelativeHeight =
|
|
468
|
-
frameState.
|
|
468
|
+
frameState.verticalExaggerationRelativeHeight;
|
|
469
469
|
const hasExaggerationScale = exaggeration !== 1.0;
|
|
470
470
|
|
|
471
471
|
const encoding = mesh.encoding;
|
|
@@ -790,9 +790,9 @@ function transform(surfaceTile, frameState, terrainProvider, x, y, level) {
|
|
|
790
790
|
createMeshOptions.x = x;
|
|
791
791
|
createMeshOptions.y = y;
|
|
792
792
|
createMeshOptions.level = level;
|
|
793
|
-
createMeshOptions.exaggeration = frameState.
|
|
793
|
+
createMeshOptions.exaggeration = frameState.verticalExaggeration;
|
|
794
794
|
createMeshOptions.exaggerationRelativeHeight =
|
|
795
|
-
frameState.
|
|
795
|
+
frameState.verticalExaggerationRelativeHeight;
|
|
796
796
|
createMeshOptions.throttle = true;
|
|
797
797
|
|
|
798
798
|
const terrainData = surfaceTile.terrainData;
|
|
@@ -25,7 +25,7 @@ import OrthographicFrustum from "../Core/OrthographicFrustum.js";
|
|
|
25
25
|
import PrimitiveType from "../Core/PrimitiveType.js";
|
|
26
26
|
import Rectangle from "../Core/Rectangle.js";
|
|
27
27
|
import SphereOutlineGeometry from "../Core/SphereOutlineGeometry.js";
|
|
28
|
-
import
|
|
28
|
+
import VerticalExaggeration from "../Core/VerticalExaggeration.js";
|
|
29
29
|
import TerrainQuantization from "../Core/TerrainQuantization.js";
|
|
30
30
|
import Visibility from "../Core/Visibility.js";
|
|
31
31
|
import WebMercatorProjection from "../Core/WebMercatorProjection.js";
|
|
@@ -179,8 +179,8 @@ function GlobeSurfaceTileProvider(options) {
|
|
|
179
179
|
this._hasLoadedTilesThisFrame = false;
|
|
180
180
|
this._hasFillTilesThisFrame = false;
|
|
181
181
|
|
|
182
|
-
this.
|
|
183
|
-
this.
|
|
182
|
+
this._oldVerticalExaggeration = undefined;
|
|
183
|
+
this._oldVerticalExaggerationRelativeHeight = undefined;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
Object.defineProperties(GlobeSurfaceTileProvider.prototype, {
|
|
@@ -448,7 +448,7 @@ GlobeSurfaceTileProvider.prototype.endUpdate = function (frameState) {
|
|
|
448
448
|
);
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
-
// When
|
|
451
|
+
// When vertical exaggeration changes, all of the loaded tiles need to generate
|
|
452
452
|
// geodetic surface normals so they can scale properly when rendered.
|
|
453
453
|
// When exaggeration is reset, geodetic surface normals are removed to decrease
|
|
454
454
|
// memory usage. Some tiles might have been constructed with the correct
|
|
@@ -460,16 +460,16 @@ GlobeSurfaceTileProvider.prototype.endUpdate = function (frameState) {
|
|
|
460
460
|
// exaggeration changes.
|
|
461
461
|
|
|
462
462
|
const quadtree = this.quadtree;
|
|
463
|
-
const exaggeration = frameState.
|
|
463
|
+
const exaggeration = frameState.verticalExaggeration;
|
|
464
464
|
const exaggerationRelativeHeight =
|
|
465
|
-
frameState.
|
|
465
|
+
frameState.verticalExaggerationRelativeHeight;
|
|
466
466
|
const exaggerationChanged =
|
|
467
|
-
this.
|
|
468
|
-
this.
|
|
467
|
+
this._oldVerticalExaggeration !== exaggeration ||
|
|
468
|
+
this._oldVerticalExaggerationRelativeHeight !== exaggerationRelativeHeight;
|
|
469
469
|
|
|
470
470
|
// Keep track of the next time there is a change in exaggeration
|
|
471
|
-
this.
|
|
472
|
-
this.
|
|
471
|
+
this._oldVerticalExaggeration = exaggeration;
|
|
472
|
+
this._oldVerticalExaggerationRelativeHeight = exaggerationRelativeHeight;
|
|
473
473
|
|
|
474
474
|
if (exaggerationChanged) {
|
|
475
475
|
quadtree.forEachLoadedTile(function (tile) {
|
|
@@ -1258,18 +1258,18 @@ function updateTileBoundingRegion(tile, tileProvider, frameState) {
|
|
|
1258
1258
|
|
|
1259
1259
|
// Update bounding regions from the min and max heights
|
|
1260
1260
|
if (sourceTile !== undefined) {
|
|
1261
|
-
const exaggeration = frameState.
|
|
1261
|
+
const exaggeration = frameState.verticalExaggeration;
|
|
1262
1262
|
const exaggerationRelativeHeight =
|
|
1263
|
-
frameState.
|
|
1263
|
+
frameState.verticalExaggerationRelativeHeight;
|
|
1264
1264
|
const hasExaggeration = exaggeration !== 1.0;
|
|
1265
1265
|
if (hasExaggeration) {
|
|
1266
1266
|
hasBoundingVolumesFromMesh = false;
|
|
1267
|
-
tileBoundingRegion.minimumHeight =
|
|
1267
|
+
tileBoundingRegion.minimumHeight = VerticalExaggeration.getHeight(
|
|
1268
1268
|
tileBoundingRegion.minimumHeight,
|
|
1269
1269
|
exaggeration,
|
|
1270
1270
|
exaggerationRelativeHeight
|
|
1271
1271
|
);
|
|
1272
|
-
tileBoundingRegion.maximumHeight =
|
|
1272
|
+
tileBoundingRegion.maximumHeight = VerticalExaggeration.getHeight(
|
|
1273
1273
|
tileBoundingRegion.maximumHeight,
|
|
1274
1274
|
exaggeration,
|
|
1275
1275
|
exaggerationRelativeHeight
|
|
@@ -1625,8 +1625,8 @@ function createTileUniformMap(frameState, globeSurfaceTileProvider) {
|
|
|
1625
1625
|
u_center3D: function () {
|
|
1626
1626
|
return this.properties.center3D;
|
|
1627
1627
|
},
|
|
1628
|
-
|
|
1629
|
-
return this.properties.
|
|
1628
|
+
u_verticalExaggerationAndRelativeHeight: function () {
|
|
1629
|
+
return this.properties.verticalExaggerationAndRelativeHeight;
|
|
1630
1630
|
},
|
|
1631
1631
|
u_tileRectangle: function () {
|
|
1632
1632
|
return this.properties.tileRectangle;
|
|
@@ -1808,7 +1808,7 @@ function createTileUniformMap(frameState, globeSurfaceTileProvider) {
|
|
|
1808
1808
|
modifiedModelView: new Matrix4(),
|
|
1809
1809
|
tileRectangle: new Cartesian4(),
|
|
1810
1810
|
|
|
1811
|
-
|
|
1811
|
+
verticalExaggerationAndRelativeHeight: new Cartesian2(1.0, 0.0),
|
|
1812
1812
|
|
|
1813
1813
|
dayTextures: [],
|
|
1814
1814
|
dayTextureTranslationAndScale: [],
|
|
@@ -2174,9 +2174,9 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) {
|
|
|
2174
2174
|
const encoding = mesh.encoding;
|
|
2175
2175
|
const tileBoundingRegion = surfaceTile.tileBoundingRegion;
|
|
2176
2176
|
|
|
2177
|
-
const exaggeration = frameState.
|
|
2177
|
+
const exaggeration = frameState.verticalExaggeration;
|
|
2178
2178
|
const exaggerationRelativeHeight =
|
|
2179
|
-
frameState.
|
|
2179
|
+
frameState.verticalExaggerationRelativeHeight;
|
|
2180
2180
|
const hasExaggeration = exaggeration !== 1.0;
|
|
2181
2181
|
const hasGeodeticSurfaceNormals = encoding.hasGeodeticSurfaceNormals;
|
|
2182
2182
|
|
|
@@ -2431,8 +2431,8 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) {
|
|
|
2431
2431
|
);
|
|
2432
2432
|
}
|
|
2433
2433
|
|
|
2434
|
-
uniformMapProperties.
|
|
2435
|
-
uniformMapProperties.
|
|
2434
|
+
uniformMapProperties.verticalExaggerationAndRelativeHeight.x = exaggeration;
|
|
2435
|
+
uniformMapProperties.verticalExaggerationAndRelativeHeight.y = exaggerationRelativeHeight;
|
|
2436
2436
|
|
|
2437
2437
|
uniformMapProperties.center3D = mesh.center;
|
|
2438
2438
|
Cartesian3.clone(rtc, uniformMapProperties.rtc);
|
|
@@ -2502,7 +2502,9 @@ function addDrawCommandsForTile(tileProvider, tile, frameState) {
|
|
|
2502
2502
|
uniformMapProperties.localizedTranslucencyRectangle
|
|
2503
2503
|
);
|
|
2504
2504
|
|
|
2505
|
-
// For performance,
|
|
2505
|
+
// For performance, render fog only when fog is enabled and the effect of
|
|
2506
|
+
// fog would be non-negligible. This prevents the shader from running when
|
|
2507
|
+
// the camera is in space, for example.
|
|
2506
2508
|
const applyFog =
|
|
2507
2509
|
enableFog &&
|
|
2508
2510
|
CesiumMath.fog(tile._distance, frameState.fog.density) >
|
|
@@ -179,6 +179,7 @@ const GltfLoaderState = {
|
|
|
179
179
|
* @param {Axis} [options.forwardAxis=Axis.Z] The forward-axis of the glTF model.
|
|
180
180
|
* @param {boolean} [options.loadAttributesAsTypedArray=false] Load all attributes and indices as typed arrays instead of GPU buffers. If the attributes are interleaved in the glTF they will be de-interleaved in the typed array.
|
|
181
181
|
* @param {boolean} [options.loadAttributesFor2D=false] If <code>true</code>, load the positions buffer and any instanced attribute buffers as typed arrays for accurately projecting models to 2D.
|
|
182
|
+
* @param {boolean} [options.enablePick=false] If <code>true</code>, load the positions buffer, any instanced attribute buffers, and index buffer as typed arrays for CPU-enabled picking in WebGL1.
|
|
182
183
|
* @param {boolean} [options.loadIndicesForWireframe=false] If <code>true</code>, load the index buffer as both a buffer and typed array. The latter is useful for creating wireframe indices in WebGL1.
|
|
183
184
|
* @param {boolean} [options.loadPrimitiveOutline=true] If <code>true</code>, load outlines from the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set false to avoid post-processing geometry at load time.
|
|
184
185
|
* @param {boolean} [options.loadForClassification=false] If <code>true</code> and if the model has feature IDs, load the feature IDs and indices as typed arrays. This is useful for batching features for classification.
|
|
@@ -203,6 +204,7 @@ function GltfLoader(options) {
|
|
|
203
204
|
false
|
|
204
205
|
);
|
|
205
206
|
const loadAttributesFor2D = defaultValue(options.loadAttributesFor2D, false);
|
|
207
|
+
const enablePick = defaultValue(options.enablePick);
|
|
206
208
|
const loadIndicesForWireframe = defaultValue(
|
|
207
209
|
options.loadIndicesForWireframe,
|
|
208
210
|
false
|
|
@@ -234,6 +236,7 @@ function GltfLoader(options) {
|
|
|
234
236
|
this._forwardAxis = forwardAxis;
|
|
235
237
|
this._loadAttributesAsTypedArray = loadAttributesAsTypedArray;
|
|
236
238
|
this._loadAttributesFor2D = loadAttributesFor2D;
|
|
239
|
+
this._enablePick = enablePick;
|
|
237
240
|
this._loadIndicesForWireframe = loadIndicesForWireframe;
|
|
238
241
|
this._loadPrimitiveOutline = loadPrimitiveOutline;
|
|
239
242
|
this._loadForClassification = loadForClassification;
|
|
@@ -1241,6 +1244,8 @@ function loadVertexAttribute(
|
|
|
1241
1244
|
!hasInstances &&
|
|
1242
1245
|
loader._loadAttributesFor2D &&
|
|
1243
1246
|
!frameState.scene3DOnly;
|
|
1247
|
+
const loadTypedArrayForPicking =
|
|
1248
|
+
isPositionAttribute && loader._enablePick && !frameState.context.webgl2;
|
|
1244
1249
|
|
|
1245
1250
|
const loadTypedArrayForClassification =
|
|
1246
1251
|
loader._loadForClassification && isFeatureIdAttribute;
|
|
@@ -1252,6 +1257,7 @@ function loadVertexAttribute(
|
|
|
1252
1257
|
const outputTypedArray =
|
|
1253
1258
|
outputTypedArrayOnly ||
|
|
1254
1259
|
loadTypedArrayFor2D ||
|
|
1260
|
+
loadTypedArrayForPicking ||
|
|
1255
1261
|
loadTypedArrayForClassification;
|
|
1256
1262
|
|
|
1257
1263
|
// Determine what to load right now:
|
|
@@ -1319,6 +1325,8 @@ function loadInstancedAttribute(
|
|
|
1319
1325
|
loader._loadAttributesAsTypedArray ||
|
|
1320
1326
|
(hasRotation && isTransformAttribute) ||
|
|
1321
1327
|
!frameState.context.instancedArrays;
|
|
1328
|
+
const loadTypedArrayForPicking =
|
|
1329
|
+
loader._enablePick && !frameState.context.webgl2;
|
|
1322
1330
|
|
|
1323
1331
|
const loadBuffer = !loadAsTypedArrayOnly;
|
|
1324
1332
|
|
|
@@ -1328,7 +1336,8 @@ function loadInstancedAttribute(
|
|
|
1328
1336
|
// - the model will be projected to 2D.
|
|
1329
1337
|
const loadFor2D = loader._loadAttributesFor2D && !frameState.scene3DOnly;
|
|
1330
1338
|
const loadTranslationAsTypedArray =
|
|
1331
|
-
isTranslationAttribute &&
|
|
1339
|
+
isTranslationAttribute &&
|
|
1340
|
+
(!hasTranslationMinMax || loadFor2D || loadTypedArrayForPicking);
|
|
1332
1341
|
|
|
1333
1342
|
const loadTypedArray = loadAsTypedArrayOnly || loadTranslationAsTypedArray;
|
|
1334
1343
|
|
|
@@ -1365,9 +1374,10 @@ function loadIndices(
|
|
|
1365
1374
|
indices.count = accessor.count;
|
|
1366
1375
|
|
|
1367
1376
|
const loadAttributesAsTypedArray = loader._loadAttributesAsTypedArray;
|
|
1368
|
-
// Load the index buffer as a typed array to generate wireframes in WebGL1.
|
|
1369
|
-
const
|
|
1370
|
-
loader._loadIndicesForWireframe
|
|
1377
|
+
// Load the index buffer as a typed array to generate wireframes or pick in WebGL1.
|
|
1378
|
+
const loadForCpuOperations =
|
|
1379
|
+
(loader._loadIndicesForWireframe || loader._enablePick) &&
|
|
1380
|
+
!frameState.context.webgl2;
|
|
1371
1381
|
|
|
1372
1382
|
// Load the index buffer as a typed array to batch features together for classification.
|
|
1373
1383
|
const loadForClassification = loader._loadForClassification && hasFeatureIds;
|
|
@@ -1377,7 +1387,7 @@ function loadIndices(
|
|
|
1377
1387
|
const outputTypedArrayOnly = loadAttributesAsTypedArray;
|
|
1378
1388
|
const outputBuffer = !outputTypedArrayOnly;
|
|
1379
1389
|
const outputTypedArray =
|
|
1380
|
-
loadAttributesAsTypedArray ||
|
|
1390
|
+
loadAttributesAsTypedArray || loadForCpuOperations || loadForClassification;
|
|
1381
1391
|
|
|
1382
1392
|
// Determine what to load right now:
|
|
1383
1393
|
//
|
|
@@ -10,7 +10,7 @@ import DeveloperError from "../Core/DeveloperError.js";
|
|
|
10
10
|
import GeometryInstance from "../Core/GeometryInstance.js";
|
|
11
11
|
import OrientedBoundingBox from "../Core/OrientedBoundingBox.js";
|
|
12
12
|
import Rectangle from "../Core/Rectangle.js";
|
|
13
|
-
import
|
|
13
|
+
import VerticalExaggeration from "../Core/VerticalExaggeration.js";
|
|
14
14
|
import ClassificationPrimitive from "./ClassificationPrimitive.js";
|
|
15
15
|
import ClassificationType from "./ClassificationType.js";
|
|
16
16
|
import PerInstanceColorAppearance from "./PerInstanceColorAppearance.js";
|
|
@@ -763,15 +763,15 @@ GroundPrimitive.prototype.update = function (frameState) {
|
|
|
763
763
|
|
|
764
764
|
// Now compute the min/max heights for the primitive
|
|
765
765
|
setMinMaxTerrainHeights(this, rectangle, ellipsoid);
|
|
766
|
-
const exaggeration = frameState.
|
|
766
|
+
const exaggeration = frameState.verticalExaggeration;
|
|
767
767
|
const exaggerationRelativeHeight =
|
|
768
|
-
frameState.
|
|
769
|
-
this._minHeight =
|
|
768
|
+
frameState.verticalExaggerationRelativeHeight;
|
|
769
|
+
this._minHeight = VerticalExaggeration.getHeight(
|
|
770
770
|
this._minTerrainHeight,
|
|
771
771
|
exaggeration,
|
|
772
772
|
exaggerationRelativeHeight
|
|
773
773
|
);
|
|
774
|
-
this._maxHeight =
|
|
774
|
+
this._maxHeight = VerticalExaggeration.getHeight(
|
|
775
775
|
this._maxTerrainHeight,
|
|
776
776
|
exaggeration,
|
|
777
777
|
exaggerationRelativeHeight
|
|
@@ -12,17 +12,74 @@ const HeightReference = {
|
|
|
12
12
|
NONE: 0,
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* The position is clamped to the terrain.
|
|
15
|
+
* The position is clamped to the terrain and 3D Tiles.
|
|
16
16
|
* @type {number}
|
|
17
17
|
* @constant
|
|
18
18
|
*/
|
|
19
19
|
CLAMP_TO_GROUND: 1,
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* The position height is the height above the terrain.
|
|
22
|
+
* The position height is the height above the terrain and 3D Tiles.
|
|
23
23
|
* @type {number}
|
|
24
24
|
* @constant
|
|
25
25
|
*/
|
|
26
26
|
RELATIVE_TO_GROUND: 2,
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The position is clamped to terain.
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @constant
|
|
32
|
+
*/
|
|
33
|
+
CLAMP_TO_TERRAIN: 3,
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The position height is the height above terrain.
|
|
37
|
+
* @type {number}
|
|
38
|
+
* @constant
|
|
39
|
+
*/
|
|
40
|
+
RELATIVE_TO_TERRAIN: 4,
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The position is clamped to 3D Tiles.
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @constant
|
|
46
|
+
*/
|
|
47
|
+
CLAMP_TO_3D_TILE: 5,
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The position height is the height above 3D Tiles.
|
|
51
|
+
* @type {number}
|
|
52
|
+
* @constant
|
|
53
|
+
*/
|
|
54
|
+
RELATIVE_TO_3D_TILE: 6,
|
|
27
55
|
};
|
|
56
|
+
|
|
28
57
|
export default Object.freeze(HeightReference);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Returns true if the height should be clamped to the surface
|
|
61
|
+
* @param {HeightReference} heightReference
|
|
62
|
+
* @returns true if the height should be clamped to the surface
|
|
63
|
+
* @private
|
|
64
|
+
*/
|
|
65
|
+
export function isHeightReferenceClamp(heightReference) {
|
|
66
|
+
return (
|
|
67
|
+
heightReference === HeightReference.CLAMP_TO_GROUND ||
|
|
68
|
+
heightReference === HeightReference.CLAMP_TO_3D_TILE ||
|
|
69
|
+
heightReference === HeightReference.CLAMP_TO_TERRAIN
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns true if the height should be offset relative to the surface
|
|
75
|
+
* @param {HeightReference} heightReference
|
|
76
|
+
* @returns true if the height should be offset relative to the surface
|
|
77
|
+
* @private
|
|
78
|
+
*/
|
|
79
|
+
export function isHeightReferenceRelative(heightReference) {
|
|
80
|
+
return (
|
|
81
|
+
heightReference === HeightReference.RELATIVE_TO_GROUND ||
|
|
82
|
+
heightReference === HeightReference.RELATIVE_TO_3D_TILE ||
|
|
83
|
+
heightReference === HeightReference.RELATIVE_TO_TERRAIN
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -132,8 +132,8 @@ import TileImagery from "./TileImagery.js";
|
|
|
132
132
|
* @alias ImageryLayer
|
|
133
133
|
* @constructor
|
|
134
134
|
*
|
|
135
|
-
* @param {ImageryProvider} imageryProvider The imagery provider to use.
|
|
136
|
-
* @param {ImageryLayer.ConstructorOptions} options An object describing initialization options
|
|
135
|
+
* @param {ImageryProvider} [imageryProvider] The imagery provider to use.
|
|
136
|
+
* @param {ImageryLayer.ConstructorOptions} [options] An object describing initialization options
|
|
137
137
|
*
|
|
138
138
|
* @see ImageryLayer.fromProviderAsync
|
|
139
139
|
* @see ImageryLayer.fromWorldImagery
|
|
@@ -142,7 +142,7 @@ import TileImagery from "./TileImagery.js";
|
|
|
142
142
|
* // Add an OpenStreetMaps layer
|
|
143
143
|
* const imageryLayer = new Cesium.ImageryLayer(new Cesium.OpenStreetMapImageryProvider({
|
|
144
144
|
* url: "https://tile.openstreetmap.org/"
|
|
145
|
-
* }))
|
|
145
|
+
* }));
|
|
146
146
|
* scene.imageryLayers.add(imageryLayer);
|
|
147
147
|
*
|
|
148
148
|
* @example
|
|
@@ -1177,6 +1177,10 @@ Implicit3DTileContent.prototype.applyStyle = function (style) {};
|
|
|
1177
1177
|
|
|
1178
1178
|
Implicit3DTileContent.prototype.update = function (tileset, frameState) {};
|
|
1179
1179
|
|
|
1180
|
+
Implicit3DTileContent.prototype.pick = function (ray, frameState, result) {
|
|
1181
|
+
return undefined;
|
|
1182
|
+
};
|
|
1183
|
+
|
|
1180
1184
|
Implicit3DTileContent.prototype.isDestroyed = function () {
|
|
1181
1185
|
return false;
|
|
1182
1186
|
};
|
|
@@ -10,7 +10,7 @@ import writeTextToCanvas from "../Core/writeTextToCanvas.js";
|
|
|
10
10
|
import bitmapSDF from "bitmap-sdf";
|
|
11
11
|
import BillboardCollection from "./BillboardCollection.js";
|
|
12
12
|
import BlendOption from "./BlendOption.js";
|
|
13
|
-
import
|
|
13
|
+
import { isHeightReferenceClamp } from "./HeightReference.js";
|
|
14
14
|
import HorizontalOrigin from "./HorizontalOrigin.js";
|
|
15
15
|
import Label from "./Label.js";
|
|
16
16
|
import LabelStyle from "./LabelStyle.js";
|
|
@@ -510,7 +510,7 @@ function repositionAllGlyphs(label) {
|
|
|
510
510
|
);
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
-
if (label.heightReference
|
|
513
|
+
if (isHeightReferenceClamp(label.heightReference)) {
|
|
514
514
|
for (glyphIndex = 0; glyphIndex < glyphLength; ++glyphIndex) {
|
|
515
515
|
glyph = glyphs[glyphIndex];
|
|
516
516
|
const billboard = glyph.billboard;
|
|
@@ -43,8 +43,8 @@ const defaultCredit = new Credit(
|
|
|
43
43
|
* accessToken: 'thisIsMyAccessToken'
|
|
44
44
|
* });
|
|
45
45
|
*
|
|
46
|
-
* @see {@link https://
|
|
47
|
-
* @see {@link https://
|
|
46
|
+
* @see {@link https://docs.mapbox.com/api/maps/raster-tiles/}
|
|
47
|
+
* @see {@link https://docs.mapbox.com/api/accounts/tokens/}
|
|
48
48
|
*/
|
|
49
49
|
function MapboxImageryProvider(options) {
|
|
50
50
|
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
|