@cesium/engine 6.2.0 → 8.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-RH4N2ONY.js → chunk-23UFSGND.js} +7 -7
- package/Build/Workers/{chunk-HPP4JLNH.js → chunk-2A75IWRS.js} +7 -7
- package/Build/Workers/{chunk-5IRLXUTA.js → chunk-2FRVPMCS.js} +10 -10
- package/Build/Workers/{chunk-ZQRZBHYI.js → chunk-2FWRMUTY.js} +4 -4
- package/Build/Workers/{chunk-Z2SIPUKB.js → chunk-2UPKWTMJ.js} +6 -6
- package/Build/Workers/{chunk-434ZTTFX.js → chunk-34FXV7D7.js} +2 -2
- package/Build/Workers/{chunk-MW3CJYLX.js → chunk-3VAZEH7M.js} +2 -2
- package/Build/Workers/{chunk-HUPNRBWW.js → chunk-4DO5W5XZ.js} +6 -6
- package/Build/Workers/{chunk-PIXK6KHB.js → chunk-4H7PY4U5.js} +2 -2
- package/Build/Workers/{chunk-BP467WX3.js → chunk-5QULIR53.js} +4 -4
- package/Build/Workers/{chunk-R3HUGXBH.js → chunk-7TC63SJW.js} +8 -8
- package/Build/Workers/{chunk-SQVTYRZY.js → chunk-7ZFGPDJA.js} +4 -4
- package/Build/Workers/{chunk-TIXXVKUY.js → chunk-A5DWLWCY.js} +10 -10
- package/Build/Workers/{chunk-CWJQGBWT.js → chunk-BBWDMCVU.js} +1 -1
- package/Build/Workers/{chunk-4KP73B43.js → chunk-BG4UCVXN.js} +3 -3
- package/Build/Workers/{chunk-Y4OJ4B23.js → chunk-BIKA3NRA.js} +5 -5
- package/Build/Workers/{chunk-DR5XZ6K5.js → chunk-BROJAZRZ.js} +13 -13
- package/Build/Workers/{chunk-FWGNCYP6.js → chunk-DDUQAJ4P.js} +7 -7
- package/Build/Workers/{chunk-QRBRVGZC.js → chunk-EERJKOAF.js} +4 -4
- package/Build/Workers/{chunk-52VSIKEA.js → chunk-EG6PTBY2.js} +15 -15
- package/Build/Workers/{chunk-O43GWBSF.js → chunk-EHWHNOEX.js} +1 -1
- package/Build/Workers/{chunk-MN34FIF5.js → chunk-F3YA3Y2Z.js} +1 -1
- package/Build/Workers/{chunk-GF5TNNKP.js → chunk-F4HFJMGM.js} +6 -6
- package/Build/Workers/{chunk-HOT2SNXP.js → chunk-FJKNFAKQ.js} +133 -553
- package/Build/Workers/{chunk-TMPVBFJQ.js → chunk-FNIRWHJB.js} +10 -10
- package/Build/Workers/{chunk-DMCSY5BU.js → chunk-FZRIVR7Y.js} +5 -5
- package/Build/Workers/{chunk-Z4JUBRHP.js → chunk-G43QFN4Q.js} +6 -6
- package/Build/Workers/{chunk-HPH5HSFE.js → chunk-GATZHF3K.js} +2 -2
- package/Build/Workers/{chunk-CSIZ3BGT.js → chunk-GRC2ZTAF.js} +14 -14
- package/Build/Workers/{chunk-NE4JNU6H.js → chunk-HU6N6EXB.js} +10 -10
- package/Build/Workers/{chunk-GVL5I7TC.js → chunk-I46ZRR5W.js} +17 -17
- package/Build/Workers/{chunk-5GDBZTHX.js → chunk-JURN7NPV.js} +17 -17
- package/Build/Workers/{chunk-H5DUXHCV.js → chunk-KKCR2YOP.js} +11 -11
- package/Build/Workers/{chunk-LX6XV4DK.js → chunk-LPR3YNP2.js} +5 -5
- package/Build/Workers/{chunk-HFKSAB5K.js → chunk-M7ERACJJ.js} +13 -13
- package/Build/Workers/{chunk-BUZDZBUH.js → chunk-MDWEGWPA.js} +10 -10
- package/Build/Workers/{chunk-LGJUI2CE.js → chunk-OGXZVPPM.js} +9 -5
- package/Build/Workers/{chunk-PZ2WJWUG.js → chunk-PGSJK77E.js} +6 -6
- package/Build/Workers/{chunk-ARPTYYKS.js → chunk-PPH7OFP3.js} +5 -5
- package/Build/Workers/{chunk-R4OZKBXH.js → chunk-SH5USDPI.js} +6 -6
- package/Build/Workers/{chunk-SV7DDPAC.js → chunk-SOWMRMWA.js} +1 -1
- package/Build/Workers/{chunk-RIDPF7PO.js → chunk-STW2DGFI.js} +2 -2
- package/Build/Workers/{chunk-CDGHUKQ4.js → chunk-T3XIFPYR.js} +13 -13
- package/Build/Workers/chunk-TTUZP4BO.js +501 -0
- package/Build/Workers/{chunk-QTZQZY2C.js → chunk-UEXTBDBE.js} +34 -10
- package/Build/Workers/{chunk-XUTVA4K5.js → chunk-VOXYEYJT.js} +11 -11
- package/Build/Workers/{chunk-AXFRNOVC.js → chunk-X4356LRH.js} +12 -12
- package/Build/Workers/{chunk-5HLGKKG3.js → chunk-XGI5BXZY.js} +2 -2
- package/Build/Workers/{chunk-SNN7WOC2.js → chunk-Y2ME2IJV.js} +13 -13
- package/Build/Workers/{chunk-LGL4P5KL.js → chunk-Y5UQJLYE.js} +6 -6
- package/Build/Workers/{chunk-3PW6ZBN4.js → chunk-YJEBABKH.js} +7 -7
- package/Build/Workers/{chunk-YBKFS53K.js → chunk-YWTJ2B4B.js} +1 -1
- package/Build/Workers/{chunk-5SK36PU4.js → chunk-Z3TIFFGF.js} +7 -7
- package/Build/Workers/{chunk-JGG36SQV.js → chunk-ZT7KWISZ.js} +4 -4
- package/Build/Workers/combineGeometry.js +24 -23
- package/Build/Workers/createBoxGeometry.js +18 -17
- package/Build/Workers/createBoxOutlineGeometry.js +16 -15
- package/Build/Workers/createCircleGeometry.js +26 -25
- package/Build/Workers/createCircleOutlineGeometry.js +19 -18
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -32
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -30
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -19
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -17
- package/Build/Workers/createEllipseGeometry.js +26 -25
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -18
- package/Build/Workers/createEllipsoidGeometry.js +19 -18
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -17
- package/Build/Workers/createFrustumGeometry.js +18 -17
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -17
- package/Build/Workers/createGeometry.js +54 -33
- package/Build/Workers/createGroundPolylineGeometry.js +22 -21
- package/Build/Workers/createPlaneGeometry.js +16 -15
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -14
- package/Build/Workers/createPolygonGeometry.js +32 -166
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -29
- package/Build/Workers/createPolylineGeometry.js +25 -24
- package/Build/Workers/createPolylineVolumeGeometry.js +32 -33
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -26
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -19
- package/Build/Workers/createSimplePolylineGeometry.js +23 -22
- package/Build/Workers/createSphereGeometry.js +19 -18
- package/Build/Workers/createSphereOutlineGeometry.js +18 -17
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -23
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +22 -21
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -21
- package/Build/Workers/createVerticesFromHeightmap.js +22 -21
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +19 -18
- package/Build/Workers/createWallGeometry.js +24 -23
- package/Build/Workers/createWallOutlineGeometry.js +23 -22
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +601 -92
- package/Build/Workers/transcodeKTX2.js +7 -7
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -21
- package/LICENSE.md +1 -1
- package/Source/Assets/approximateTerrainHeights.json +1 -1
- package/Source/Core/Ellipsoid.js +6 -0
- package/Source/Core/GregorianDate.js +85 -0
- package/Source/Core/HeadingPitchRange.js +2 -2
- package/Source/Core/IntersectionTests.js +6 -3
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/PixelFormat.js +5 -0
- package/Source/Core/PolygonGeometry.js +0 -169
- package/Source/Core/Resource.js +30 -69
- package/Source/Core/Transforms.js +30 -18
- package/Source/Core/createWorldBathymetryAsync.js +45 -0
- package/Source/Core/srgbToLinear.js +32 -0
- package/Source/DataSources/CzmlDataSource.js +51 -23
- package/Source/DataSources/DataSourceDisplay.js +27 -0
- package/Source/DataSources/EllipsoidGeometryUpdater.js +3 -4
- package/Source/DataSources/Entity.js +28 -7
- package/Source/DataSources/EntityCollection.js +1 -2
- package/Source/DataSources/GeometryUpdater.js +1 -2
- package/Source/DataSources/GeometryUpdaterSet.js +114 -0
- package/Source/DataSources/GeometryVisualizer.js +19 -83
- 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 +121 -1
- package/Source/Renderer/Context.js +10 -0
- package/Source/Renderer/ContextLimits.js +2 -0
- package/Source/Renderer/UniformState.js +127 -0
- package/Source/Renderer/demodernizeShader.js +4 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Atmosphere.js +127 -0
- package/Source/Scene/Axis.js +12 -7
- package/Source/Scene/Billboard.js +29 -26
- package/Source/Scene/BillboardCollection.js +3 -3
- package/Source/Scene/Camera.js +47 -5
- package/Source/Scene/Cesium3DTile.js +1 -0
- package/Source/Scene/Cesium3DTileContent.js +14 -0
- package/Source/Scene/Cesium3DTileset.js +364 -45
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +2 -4
- 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 +14 -1
- package/Source/Scene/Geometry3DTileContent.js +4 -0
- package/Source/Scene/Globe.js +3 -2
- package/Source/Scene/GlobeSurfaceTileProvider.js +3 -1
- package/Source/Scene/GlobeTranslucencyState.js +1 -1
- package/Source/Scene/GltfLoader.js +15 -5
- package/Source/Scene/GltfPipeline/updateVersion.js +69 -68
- package/Source/Scene/HeightReference.js +59 -2
- package/Source/Scene/I3SDataProvider.js +270 -53
- package/Source/Scene/I3SDecoder.js +8 -1
- package/Source/Scene/I3SFeature.js +2 -5
- package/Source/Scene/I3SField.js +136 -31
- package/Source/Scene/I3SGeometry.js +70 -2
- package/Source/Scene/I3SLayer.js +55 -10
- package/Source/Scene/I3SNode.js +175 -18
- package/Source/Scene/I3SStatistics.js +94 -0
- package/Source/Scene/I3SSublayer.js +176 -0
- package/Source/Scene/I3SSymbology.js +337 -0
- package/Source/Scene/Implicit3DTileContent.js +4 -0
- package/Source/Scene/KeyframeNode.js +1 -1
- package/Source/Scene/LabelCollection.js +2 -2
- 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 +82 -32
- package/Source/Scene/Model/Model3DTileContent.js +31 -0
- package/Source/Scene/Model/ModelAnimationChannel.js +16 -15
- package/Source/Scene/Model/ModelSceneGraph.js +6 -0
- package/Source/Scene/Model/pickModel.js +426 -0
- package/Source/Scene/Multiple3DTileContent.js +42 -0
- package/Source/Scene/PickFramebuffer.js +37 -2
- package/Source/Scene/Picking.js +113 -39
- package/Source/Scene/Primitive.js +6 -2
- package/Source/Scene/QuadtreePrimitive.js +1 -1
- package/Source/Scene/Scene.js +312 -46
- package/Source/Scene/ScreenSpaceCameraController.js +23 -13
- package/Source/Scene/SensorVolumePortionToDisplay.js +69 -0
- package/Source/Scene/SkyAtmosphere.js +5 -6
- package/Source/Scene/SpatialNode.js +12 -19
- package/Source/Scene/StructuralMetadata.js +1 -1
- package/Source/Scene/Terrain.js +49 -0
- package/Source/Scene/TileBoundingS2Cell.js +2 -2
- package/Source/Scene/Tileset3DTileContent.js +4 -0
- package/Source/Scene/Vector3DTileContent.js +4 -0
- package/Source/Scene/VoxelBoxShape.js +76 -0
- package/Source/Scene/VoxelCell.js +273 -0
- package/Source/Scene/VoxelCylinderShape.js +114 -43
- package/Source/Scene/VoxelEllipsoidShape.js +158 -116
- package/Source/Scene/VoxelPrimitive.js +3 -1
- package/Source/Scene/VoxelRenderResources.js +3 -0
- package/Source/Scene/VoxelShape.js +13 -0
- package/Source/Scene/VoxelTraversal.js +76 -54
- package/Source/Scene/buildVoxelDrawCommands.js +23 -0
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +1 -0
- package/Source/Scene/processVoxelProperties.js +2 -0
- 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 +1 -1
- package/Source/Shaders/GlobeVS.js +1 -1
- 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 +9 -4
- package/Source/Shaders/Model/ModelVS.js +9 -4
- 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/Shaders/Voxels/IntersectCylinder.glsl +14 -111
- package/Source/Shaders/Voxels/IntersectCylinder.js +14 -111
- package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +32 -113
- package/Source/Shaders/Voxels/IntersectEllipsoid.js +32 -113
- package/Source/Shaders/Voxels/IntersectLongitude.glsl +102 -0
- package/Source/Shaders/Voxels/IntersectLongitude.js +104 -0
- package/Source/Shaders/Voxels/VoxelFS.glsl +39 -1
- package/Source/Shaders/Voxels/VoxelFS.js +39 -1
- package/Source/Shaders/Voxels/convertUvToCylinder.glsl +19 -37
- package/Source/Shaders/Voxels/convertUvToCylinder.js +19 -37
- package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +24 -44
- package/Source/Shaders/Voxels/convertUvToEllipsoid.js +24 -44
- package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/Source/ThirdParty/draco_decoder.wasm +0 -0
- package/Source/Workers/createGeometry.js +40 -11
- package/Source/Workers/decodeI3S.js +720 -94
- package/index.d.ts +574 -71
- package/index.js +217 -196
- package/package.json +3 -3
- package/Build/Workers/chunk-ATB2I7OS.js +0 -55
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import Cartesian3 from "../Core/Cartesian3.js";
|
|
2
|
+
import DynamicAtmosphereLightingType from "./DynamicAtmosphereLightingType.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Common atmosphere settings used by 3D Tiles and models for rendering sky atmosphere, ground atmosphere, and fog.
|
|
6
|
+
*
|
|
7
|
+
* <p>
|
|
8
|
+
* This class is not to be confused with {@link SkyAtmosphere}, which is responsible for rendering the sky.
|
|
9
|
+
* </p>
|
|
10
|
+
* <p>
|
|
11
|
+
* While the atmosphere settings affect the color of fog, see {@link Fog} to control how fog is rendered.
|
|
12
|
+
* </p>
|
|
13
|
+
*
|
|
14
|
+
* @alias Atmosphere
|
|
15
|
+
* @constructor
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Turn on dynamic atmosphere lighting using the sun direction
|
|
19
|
+
* scene.atmosphere.dynamicLighting = Cesium.DynamicAtmosphereLightingType.SUNLIGHT;
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Turn on dynamic lighting using whatever light source is in the scene
|
|
23
|
+
* scene.light = new Cesium.DirectionalLight({
|
|
24
|
+
* direction: new Cesium.Cartesian3(1, 0, 0)
|
|
25
|
+
* });
|
|
26
|
+
* scene.atmosphere.dynamicLighting = Cesium.DynamicAtmosphereLightingType.SCENE_LIGHT;
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Adjust the color of the atmosphere effects.
|
|
30
|
+
* scene.atmosphere.hueShift = 0.4; // Cycle 40% around the color wheel
|
|
31
|
+
* scene.atmosphere.brightnessShift = 0.25; // Increase the brightness
|
|
32
|
+
* scene.atmosphere.saturationShift = -0.1; // Desaturate the colors
|
|
33
|
+
*
|
|
34
|
+
* @see SkyAtmosphere
|
|
35
|
+
* @see Globe
|
|
36
|
+
* @see Fog
|
|
37
|
+
*/
|
|
38
|
+
function Atmosphere() {
|
|
39
|
+
/**
|
|
40
|
+
* The intensity of the light that is used for computing the ground atmosphere color.
|
|
41
|
+
*
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @default 10.0
|
|
44
|
+
*/
|
|
45
|
+
this.lightIntensity = 10.0;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The Rayleigh scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
|
|
49
|
+
*
|
|
50
|
+
* @type {Cartesian3}
|
|
51
|
+
* @default Cartesian3(5.5e-6, 13.0e-6, 28.4e-6)
|
|
52
|
+
*/
|
|
53
|
+
this.rayleighCoefficient = new Cartesian3(5.5e-6, 13.0e-6, 28.4e-6);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The Mie scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
|
|
57
|
+
*
|
|
58
|
+
* @type {Cartesian3}
|
|
59
|
+
* @default Cartesian3(21e-6, 21e-6, 21e-6)
|
|
60
|
+
*/
|
|
61
|
+
this.mieCoefficient = new Cartesian3(21e-6, 21e-6, 21e-6);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The Rayleigh scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
|
|
65
|
+
*
|
|
66
|
+
* @type {number}
|
|
67
|
+
* @default 10000.0
|
|
68
|
+
*/
|
|
69
|
+
this.rayleighScaleHeight = 10000.0;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The Mie scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
|
|
73
|
+
*
|
|
74
|
+
* @type {number}
|
|
75
|
+
* @default 3200.0
|
|
76
|
+
*/
|
|
77
|
+
this.mieScaleHeight = 3200.0;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The anisotropy of the medium to consider for Mie scattering.
|
|
81
|
+
* <p>
|
|
82
|
+
* Valid values are between -1.0 and 1.0.
|
|
83
|
+
* </p>
|
|
84
|
+
*
|
|
85
|
+
* @type {number}
|
|
86
|
+
* @default 0.9
|
|
87
|
+
*/
|
|
88
|
+
this.mieAnisotropy = 0.9;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
|
|
92
|
+
* A hue shift of 1.0 indicates a complete rotation of the hues available.
|
|
93
|
+
*
|
|
94
|
+
* @type {number}
|
|
95
|
+
* @default 0.0
|
|
96
|
+
*/
|
|
97
|
+
this.hueShift = 0.0;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
|
|
101
|
+
* A saturation shift of -1.0 is monochrome.
|
|
102
|
+
*
|
|
103
|
+
* @type {number}
|
|
104
|
+
* @default 0.0
|
|
105
|
+
*/
|
|
106
|
+
this.saturationShift = 0.0;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
|
|
110
|
+
* A brightness shift of -1.0 is complete darkness, which will let space show through.
|
|
111
|
+
*
|
|
112
|
+
* @type {number}
|
|
113
|
+
* @default 0.0
|
|
114
|
+
*/
|
|
115
|
+
this.brightnessShift = 0.0;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* When not DynamicAtmosphereLightingType.NONE, the selected light source will
|
|
119
|
+
* be used for dynamically lighting all atmosphere-related rendering effects.
|
|
120
|
+
*
|
|
121
|
+
* @type {DynamicAtmosphereLightingType}
|
|
122
|
+
* @default DynamicAtmosphereLightingType.NONE
|
|
123
|
+
*/
|
|
124
|
+
this.dynamicLighting = DynamicAtmosphereLightingType.NONE;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export default Atmosphere;
|
package/Source/Scene/Axis.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import Check from "../Core/Check.js";
|
|
2
|
-
import CesiumMath from "../Core/Math.js";
|
|
3
2
|
import Matrix3 from "../Core/Matrix3.js";
|
|
4
3
|
import Matrix4 from "../Core/Matrix4.js";
|
|
5
4
|
|
|
@@ -41,7 +40,8 @@ const Axis = {
|
|
|
41
40
|
* @constant
|
|
42
41
|
*/
|
|
43
42
|
Axis.Y_UP_TO_Z_UP = Matrix4.fromRotationTranslation(
|
|
44
|
-
|
|
43
|
+
// Rotation about PI/2 around the X-axis
|
|
44
|
+
Matrix3.fromArray([1, 0, 0, 0, 0, 1, 0, -1, 0])
|
|
45
45
|
);
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -51,7 +51,8 @@ Axis.Y_UP_TO_Z_UP = Matrix4.fromRotationTranslation(
|
|
|
51
51
|
* @constant
|
|
52
52
|
*/
|
|
53
53
|
Axis.Z_UP_TO_Y_UP = Matrix4.fromRotationTranslation(
|
|
54
|
-
|
|
54
|
+
// Rotation about -PI/2 around the X-axis
|
|
55
|
+
Matrix3.fromArray([1, 0, 0, 0, 0, -1, 0, 1, 0])
|
|
55
56
|
);
|
|
56
57
|
|
|
57
58
|
/**
|
|
@@ -61,7 +62,8 @@ Axis.Z_UP_TO_Y_UP = Matrix4.fromRotationTranslation(
|
|
|
61
62
|
* @constant
|
|
62
63
|
*/
|
|
63
64
|
Axis.X_UP_TO_Z_UP = Matrix4.fromRotationTranslation(
|
|
64
|
-
|
|
65
|
+
// Rotation about -PI/2 around the Y-axis
|
|
66
|
+
Matrix3.fromArray([0, 0, 1, 0, 1, 0, -1, 0, 0])
|
|
65
67
|
);
|
|
66
68
|
|
|
67
69
|
/**
|
|
@@ -71,7 +73,8 @@ Axis.X_UP_TO_Z_UP = Matrix4.fromRotationTranslation(
|
|
|
71
73
|
* @constant
|
|
72
74
|
*/
|
|
73
75
|
Axis.Z_UP_TO_X_UP = Matrix4.fromRotationTranslation(
|
|
74
|
-
|
|
76
|
+
// Rotation about PI/2 around the Y-axis
|
|
77
|
+
Matrix3.fromArray([0, 0, -1, 0, 1, 0, 1, 0, 0])
|
|
75
78
|
);
|
|
76
79
|
|
|
77
80
|
/**
|
|
@@ -81,7 +84,8 @@ Axis.Z_UP_TO_X_UP = Matrix4.fromRotationTranslation(
|
|
|
81
84
|
* @constant
|
|
82
85
|
*/
|
|
83
86
|
Axis.X_UP_TO_Y_UP = Matrix4.fromRotationTranslation(
|
|
84
|
-
|
|
87
|
+
// Rotation about PI/2 around the Z-axis
|
|
88
|
+
Matrix3.fromArray([0, 1, 0, -1, 0, 0, 0, 0, 1])
|
|
85
89
|
);
|
|
86
90
|
|
|
87
91
|
/**
|
|
@@ -91,7 +95,8 @@ Axis.X_UP_TO_Y_UP = Matrix4.fromRotationTranslation(
|
|
|
91
95
|
* @constant
|
|
92
96
|
*/
|
|
93
97
|
Axis.Y_UP_TO_X_UP = Matrix4.fromRotationTranslation(
|
|
94
|
-
|
|
98
|
+
// Rotation about -PI/2 around the Z-axis
|
|
99
|
+
Matrix3.fromArray([0, -1, 0, 1, 0, 0, 0, 0, 1])
|
|
95
100
|
);
|
|
96
101
|
|
|
97
102
|
/**
|
|
@@ -10,10 +10,13 @@ import defaultValue from "../Core/defaultValue.js";
|
|
|
10
10
|
import defined from "../Core/defined.js";
|
|
11
11
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
12
12
|
import DistanceDisplayCondition from "../Core/DistanceDisplayCondition.js";
|
|
13
|
+
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
13
14
|
import Matrix4 from "../Core/Matrix4.js";
|
|
14
15
|
import NearFarScalar from "../Core/NearFarScalar.js";
|
|
15
16
|
import Resource from "../Core/Resource.js";
|
|
16
|
-
import HeightReference
|
|
17
|
+
import HeightReference, {
|
|
18
|
+
isHeightReferenceRelative,
|
|
19
|
+
} from "./HeightReference.js";
|
|
17
20
|
import HorizontalOrigin from "./HorizontalOrigin.js";
|
|
18
21
|
import SceneMode from "./SceneMode.js";
|
|
19
22
|
import SceneTransforms from "./SceneTransforms.js";
|
|
@@ -1056,15 +1059,13 @@ Billboard.prototype._updateClamping = function () {
|
|
|
1056
1059
|
};
|
|
1057
1060
|
|
|
1058
1061
|
const scratchCartographic = new Cartographic();
|
|
1059
|
-
const scratchPosition = new Cartesian3();
|
|
1060
|
-
|
|
1061
1062
|
Billboard._updateClamping = function (collection, owner) {
|
|
1062
1063
|
const scene = collection._scene;
|
|
1063
|
-
if (!defined(scene)
|
|
1064
|
+
if (!defined(scene)) {
|
|
1064
1065
|
//>>includeStart('debug', pragmas.debug);
|
|
1065
1066
|
if (owner._heightReference !== HeightReference.NONE) {
|
|
1066
1067
|
throw new DeveloperError(
|
|
1067
|
-
"Height reference is not supported without a scene
|
|
1068
|
+
"Height reference is not supported without a scene."
|
|
1068
1069
|
);
|
|
1069
1070
|
}
|
|
1070
1071
|
//>>includeEnd('debug');
|
|
@@ -1072,8 +1073,7 @@ Billboard._updateClamping = function (collection, owner) {
|
|
|
1072
1073
|
}
|
|
1073
1074
|
|
|
1074
1075
|
const globe = scene.globe;
|
|
1075
|
-
const ellipsoid = globe.
|
|
1076
|
-
const surface = globe._surface;
|
|
1076
|
+
const ellipsoid = defaultValue(globe?.ellipsoid, Ellipsoid.WGS84);
|
|
1077
1077
|
|
|
1078
1078
|
const mode = scene.frameState.mode;
|
|
1079
1079
|
|
|
@@ -1096,45 +1096,48 @@ Billboard._updateClamping = function (collection, owner) {
|
|
|
1096
1096
|
return;
|
|
1097
1097
|
}
|
|
1098
1098
|
|
|
1099
|
+
if (defined(owner._removeCallbackFunc)) {
|
|
1100
|
+
owner._removeCallbackFunc();
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1099
1103
|
const position = ellipsoid.cartesianToCartographic(owner._position);
|
|
1100
1104
|
if (!defined(position)) {
|
|
1101
1105
|
owner._actualClampedPosition = undefined;
|
|
1102
1106
|
return;
|
|
1103
1107
|
}
|
|
1104
1108
|
|
|
1105
|
-
if (defined(owner._removeCallbackFunc)) {
|
|
1106
|
-
owner._removeCallbackFunc();
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
1109
|
function updateFunction(clampedPosition) {
|
|
1110
|
-
|
|
1110
|
+
owner._clampedPosition = ellipsoid.cartographicToCartesian(
|
|
1111
|
+
clampedPosition,
|
|
1112
|
+
owner._clampedPosition
|
|
1113
|
+
);
|
|
1114
|
+
|
|
1115
|
+
if (isHeightReferenceRelative(owner._heightReference)) {
|
|
1111
1116
|
if (owner._mode === SceneMode.SCENE3D) {
|
|
1112
|
-
|
|
1117
|
+
clampedPosition.height += position.height;
|
|
1118
|
+
ellipsoid.cartographicToCartesian(
|
|
1113
1119
|
clampedPosition,
|
|
1114
|
-
|
|
1120
|
+
owner._clampedPosition
|
|
1115
1121
|
);
|
|
1116
|
-
clampedCart.height += position.height;
|
|
1117
|
-
ellipsoid.cartographicToCartesian(clampedCart, clampedPosition);
|
|
1118
1122
|
} else {
|
|
1119
|
-
|
|
1123
|
+
owner._clampedPosition.x += position.height;
|
|
1120
1124
|
}
|
|
1121
1125
|
}
|
|
1122
|
-
owner._clampedPosition = Cartesian3.clone(
|
|
1123
|
-
clampedPosition,
|
|
1124
|
-
owner._clampedPosition
|
|
1125
|
-
);
|
|
1126
1126
|
}
|
|
1127
|
-
|
|
1127
|
+
|
|
1128
|
+
owner._removeCallbackFunc = scene.updateHeight(
|
|
1129
|
+
position,
|
|
1130
|
+
updateFunction,
|
|
1131
|
+
owner._heightReference
|
|
1132
|
+
);
|
|
1128
1133
|
|
|
1129
1134
|
Cartographic.clone(position, scratchCartographic);
|
|
1130
|
-
const height =
|
|
1135
|
+
const height = scene.getHeight(position, owner._heightReference);
|
|
1131
1136
|
if (defined(height)) {
|
|
1132
1137
|
scratchCartographic.height = height;
|
|
1133
1138
|
}
|
|
1134
1139
|
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
updateFunction(scratchPosition);
|
|
1140
|
+
updateFunction(scratchCartographic);
|
|
1138
1141
|
};
|
|
1139
1142
|
|
|
1140
1143
|
Billboard.prototype._loadImage = function () {
|
|
@@ -28,7 +28,7 @@ import BillboardCollectionVS from "../Shaders/BillboardCollectionVS.js";
|
|
|
28
28
|
import Billboard from "./Billboard.js";
|
|
29
29
|
import BlendingState from "./BlendingState.js";
|
|
30
30
|
import BlendOption from "./BlendOption.js";
|
|
31
|
-
import HeightReference from "./HeightReference.js";
|
|
31
|
+
import HeightReference, { isHeightReferenceClamp } from "./HeightReference.js";
|
|
32
32
|
import HorizontalOrigin from "./HorizontalOrigin.js";
|
|
33
33
|
import SceneMode from "./SceneMode.js";
|
|
34
34
|
import SDFSettings from "./SDFSettings.js";
|
|
@@ -1375,7 +1375,7 @@ function writeCompressedAttribute3(
|
|
|
1375
1375
|
|
|
1376
1376
|
let disableDepthTestDistance = billboard.disableDepthTestDistance;
|
|
1377
1377
|
const clampToGround =
|
|
1378
|
-
billboard.heightReference
|
|
1378
|
+
isHeightReferenceClamp(billboard.heightReference) &&
|
|
1379
1379
|
frameState.context.depthTexture;
|
|
1380
1380
|
if (!defined(disableDepthTestDistance)) {
|
|
1381
1381
|
disableDepthTestDistance = clampToGround ? 5000.0 : 0.0;
|
|
@@ -1448,7 +1448,7 @@ function writeTextureCoordinateBoundsOrLabelTranslate(
|
|
|
1448
1448
|
vafWriters,
|
|
1449
1449
|
billboard
|
|
1450
1450
|
) {
|
|
1451
|
-
if (billboard.heightReference
|
|
1451
|
+
if (isHeightReferenceClamp(billboard.heightReference)) {
|
|
1452
1452
|
const scene = billboardCollection._scene;
|
|
1453
1453
|
const context = frameState.context;
|
|
1454
1454
|
const globeTranslucent = frameState.globeTranslucencyState.translucent;
|
package/Source/Scene/Camera.js
CHANGED
|
@@ -197,7 +197,7 @@ function Camera(scene) {
|
|
|
197
197
|
this.defaultZoomAmount = 100000.0;
|
|
198
198
|
/**
|
|
199
199
|
* If set, the camera will not be able to rotate past this axis in either direction.
|
|
200
|
-
* @type {Cartesian3}
|
|
200
|
+
* @type {Cartesian3 | undefined}
|
|
201
201
|
* @default undefined
|
|
202
202
|
*/
|
|
203
203
|
this.constrainedAxis = undefined;
|
|
@@ -217,6 +217,7 @@ function Camera(scene) {
|
|
|
217
217
|
this._changedDirection = undefined;
|
|
218
218
|
this._changedFrustum = undefined;
|
|
219
219
|
this._changedHeading = undefined;
|
|
220
|
+
this._changedRoll = undefined;
|
|
220
221
|
|
|
221
222
|
/**
|
|
222
223
|
* The amount the camera has to change before the <code>changed</code> event is raised. The value is a percentage in the [0, 1] range.
|
|
@@ -380,25 +381,55 @@ Camera.prototype._updateCameraChanged = function () {
|
|
|
380
381
|
|
|
381
382
|
const percentageChanged = camera.percentageChanged;
|
|
382
383
|
|
|
384
|
+
// check heading
|
|
383
385
|
const currentHeading = camera.heading;
|
|
384
386
|
|
|
385
387
|
if (!defined(camera._changedHeading)) {
|
|
386
388
|
camera._changedHeading = currentHeading;
|
|
387
389
|
}
|
|
388
390
|
|
|
389
|
-
let
|
|
391
|
+
let headingDelta =
|
|
390
392
|
Math.abs(camera._changedHeading - currentHeading) % CesiumMath.TWO_PI;
|
|
391
|
-
|
|
393
|
+
headingDelta =
|
|
394
|
+
headingDelta > CesiumMath.PI
|
|
395
|
+
? CesiumMath.TWO_PI - headingDelta
|
|
396
|
+
: headingDelta;
|
|
392
397
|
|
|
393
398
|
// Since delta is computed as the shortest distance between two angles
|
|
394
399
|
// the percentage is relative to the half circle.
|
|
395
|
-
const headingChangedPercentage =
|
|
400
|
+
const headingChangedPercentage = headingDelta / Math.PI;
|
|
396
401
|
|
|
397
402
|
if (headingChangedPercentage > percentageChanged) {
|
|
398
|
-
camera._changed.raiseEvent(headingChangedPercentage);
|
|
399
403
|
camera._changedHeading = currentHeading;
|
|
400
404
|
}
|
|
401
405
|
|
|
406
|
+
// check roll
|
|
407
|
+
const currentRoll = camera.roll;
|
|
408
|
+
|
|
409
|
+
if (!defined(camera._changedRoll)) {
|
|
410
|
+
camera._changedRoll = currentRoll;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
let rollDelta =
|
|
414
|
+
Math.abs(camera._changedRoll - currentRoll) % CesiumMath.TWO_PI;
|
|
415
|
+
rollDelta =
|
|
416
|
+
rollDelta > CesiumMath.PI ? CesiumMath.TWO_PI - rollDelta : rollDelta;
|
|
417
|
+
|
|
418
|
+
// Since delta is computed as the shortest distance between two angles
|
|
419
|
+
// the percentage is relative to the half circle.
|
|
420
|
+
const rollChangedPercentage = rollDelta / Math.PI;
|
|
421
|
+
|
|
422
|
+
if (rollChangedPercentage > percentageChanged) {
|
|
423
|
+
camera._changedRoll = currentRoll;
|
|
424
|
+
}
|
|
425
|
+
if (
|
|
426
|
+
rollChangedPercentage > percentageChanged ||
|
|
427
|
+
headingChangedPercentage > percentageChanged
|
|
428
|
+
) {
|
|
429
|
+
camera._changed.raiseEvent(
|
|
430
|
+
Math.max(rollChangedPercentage, headingChangedPercentage)
|
|
431
|
+
);
|
|
432
|
+
}
|
|
402
433
|
if (camera._mode === SceneMode.SCENE2D) {
|
|
403
434
|
if (!defined(camera._changedFrustum)) {
|
|
404
435
|
camera._changedPosition = Cartesian3.clone(
|
|
@@ -1233,6 +1264,11 @@ const scratchSetViewMatrix3 = new Matrix3();
|
|
|
1233
1264
|
const scratchSetViewCartographic = new Cartographic();
|
|
1234
1265
|
|
|
1235
1266
|
function setView3D(camera, position, hpr) {
|
|
1267
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1268
|
+
if (isNaN(position.x) || isNaN(position.y) || isNaN(position.z)) {
|
|
1269
|
+
throw new DeveloperError("position has a NaN component");
|
|
1270
|
+
}
|
|
1271
|
+
//>>includeEnd('debug');
|
|
1236
1272
|
const currentTransform = Matrix4.clone(
|
|
1237
1273
|
camera.transform,
|
|
1238
1274
|
scratchSetViewTransform1
|
|
@@ -1473,6 +1509,12 @@ Camera.prototype.setView = function (options) {
|
|
|
1473
1509
|
destination,
|
|
1474
1510
|
scratchSetViewCartesian
|
|
1475
1511
|
);
|
|
1512
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1513
|
+
// destination.z may be null in 2D, but .x and .y should be numeric
|
|
1514
|
+
if (isNaN(destination.x) || isNaN(destination.y)) {
|
|
1515
|
+
throw new DeveloperError(`destination has a NaN component`);
|
|
1516
|
+
}
|
|
1517
|
+
//>>includeEnd('debug');
|
|
1476
1518
|
convert = false;
|
|
1477
1519
|
}
|
|
1478
1520
|
|
|
@@ -474,6 +474,7 @@ function Cesium3DTile(tileset, baseResource, header, parent) {
|
|
|
474
474
|
this._touchedFrame = 0;
|
|
475
475
|
this._visitedFrame = 0;
|
|
476
476
|
this._selectedFrame = 0;
|
|
477
|
+
this._wasSelectedLastFrame = false;
|
|
477
478
|
this._requestedFrame = 0;
|
|
478
479
|
this._ancestorWithContent = undefined;
|
|
479
480
|
this._ancestorWithContentAvailable = undefined;
|
|
@@ -350,6 +350,20 @@ Cesium3DTileContent.prototype.update = function (tileset, frameState) {
|
|
|
350
350
|
DeveloperError.throwInstantiationError();
|
|
351
351
|
};
|
|
352
352
|
|
|
353
|
+
/**
|
|
354
|
+
* Find an intersection between a ray and the tile content surface that was rendered. The ray must be given in world coordinates.
|
|
355
|
+
*
|
|
356
|
+
* @param {Ray} ray The ray to test for intersection.
|
|
357
|
+
* @param {FrameState} frameState The frame state.
|
|
358
|
+
* @param {Cartesian3|undefined} [result] The intersection or <code>undefined</code> if none was found.
|
|
359
|
+
* @returns {Cartesian3|undefined} The intersection or <code>undefined</code> if none was found.
|
|
360
|
+
*
|
|
361
|
+
* @private
|
|
362
|
+
*/
|
|
363
|
+
Cesium3DTileContent.prototype.pick = function (ray, frameState, result) {
|
|
364
|
+
DeveloperError.throwInstantiationError();
|
|
365
|
+
};
|
|
366
|
+
|
|
353
367
|
/**
|
|
354
368
|
* Returns true if this object was destroyed; otherwise, false.
|
|
355
369
|
* <br /><br />
|