@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ApproximateTerrainHeights from "../Core/ApproximateTerrainHeights.js";
|
|
2
|
+
import BoundingSphere from "../Core/BoundingSphere.js";
|
|
2
3
|
import Cartesian2 from "../Core/Cartesian2.js";
|
|
3
4
|
import Cartesian3 from "../Core/Cartesian3.js";
|
|
4
5
|
import Cartographic from "../Core/Cartographic.js";
|
|
@@ -13,10 +14,13 @@ import destroyObject from "../Core/destroyObject.js";
|
|
|
13
14
|
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
14
15
|
import Event from "../Core/Event.js";
|
|
15
16
|
import ImageBasedLighting from "./ImageBasedLighting.js";
|
|
17
|
+
import Interval from "../Core/Interval.js";
|
|
18
|
+
import IntersectionTests from "../Core/IntersectionTests.js";
|
|
16
19
|
import IonResource from "../Core/IonResource.js";
|
|
17
20
|
import JulianDate from "../Core/JulianDate.js";
|
|
18
21
|
import ManagedArray from "../Core/ManagedArray.js";
|
|
19
22
|
import CesiumMath from "../Core/Math.js";
|
|
23
|
+
import Matrix3 from "../Core/Matrix3.js";
|
|
20
24
|
import Matrix4 from "../Core/Matrix4.js";
|
|
21
25
|
import Resource from "../Core/Resource.js";
|
|
22
26
|
import RuntimeError from "../Core/RuntimeError.js";
|
|
@@ -55,6 +59,7 @@ import TileOrientedBoundingBox from "./TileOrientedBoundingBox.js";
|
|
|
55
59
|
import Cesium3DTilesetMostDetailedTraversal from "./Cesium3DTilesetMostDetailedTraversal.js";
|
|
56
60
|
import Cesium3DTilesetBaseTraversal from "./Cesium3DTilesetBaseTraversal.js";
|
|
57
61
|
import Cesium3DTilesetSkipTraversal from "./Cesium3DTilesetSkipTraversal.js";
|
|
62
|
+
import Ray from "../Core/Ray.js";
|
|
58
63
|
|
|
59
64
|
/**
|
|
60
65
|
* @typedef {Object} Cesium3DTileset.ConstructorOptions
|
|
@@ -75,10 +80,10 @@ import Cesium3DTilesetSkipTraversal from "./Cesium3DTilesetSkipTraversal.js";
|
|
|
75
80
|
* @property {boolean} [preloadWhenHidden=false] Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.
|
|
76
81
|
* @property {boolean} [preloadFlightDestinations=true] Optimization option. Preload tiles at the camera's flight destination while the camera is in flight.
|
|
77
82
|
* @property {boolean} [preferLeaves=false] Optimization option. Prefer loading of leaves first.
|
|
78
|
-
* @property {boolean} [dynamicScreenSpaceError=
|
|
79
|
-
* @property {number} [dynamicScreenSpaceErrorDensity=
|
|
80
|
-
* @property {number} [dynamicScreenSpaceErrorFactor=
|
|
81
|
-
* @property {number} [dynamicScreenSpaceErrorHeightFalloff=0.25] A ratio of the tileset's height
|
|
83
|
+
* @property {boolean} [dynamicScreenSpaceError=true] Optimization option. For street-level horizon views, use lower resolution tiles far from the camera. This reduces the amount of data loaded and improves tileset loading time with a slight drop in visual quality in the distance.
|
|
84
|
+
* @property {number} [dynamicScreenSpaceErrorDensity=2.0e-4] Similar to {@link Fog#density}, this option controls the camera distance at which the {@link Cesium3DTileset#dynamicScreenSpaceError} optimization applies. Larger values will cause tiles closer to the camera to be affected.
|
|
85
|
+
* @property {number} [dynamicScreenSpaceErrorFactor=24.0] A parameter that controls the intensity of the {@link Cesium3DTileset#dynamicScreenSpaceError} optimization for tiles on the horizon. Larger values cause lower resolution tiles to load, improving runtime performance at a slight reduction of visual quality.
|
|
86
|
+
* @property {number} [dynamicScreenSpaceErrorHeightFalloff=0.25] A ratio of the tileset's height that determines where "street level" camera views occur. When the camera is below this height, the {@link Cesium3DTileset#dynamicScreenSpaceError} optimization will have the maximum effect, and it will roll off above this value.
|
|
82
87
|
* @property {number} [progressiveResolutionHeightFraction=0.3] Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.
|
|
83
88
|
* @property {boolean} [foveatedScreenSpaceError=true] Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.
|
|
84
89
|
* @property {number} [foveatedConeSize=0.1] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and their screen space error. This is controlled by {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, disabling the effect.
|
|
@@ -107,11 +112,14 @@ import Cesium3DTilesetSkipTraversal from "./Cesium3DTilesetSkipTraversal.js";
|
|
|
107
112
|
* @property {string|number} [instanceFeatureIdLabel="instanceFeatureId_0"] Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
|
|
108
113
|
* @property {boolean} [showCreditsOnScreen=false] Whether to display the credits of this tileset on screen.
|
|
109
114
|
* @property {SplitDirection} [splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this tileset.
|
|
110
|
-
* @property {boolean} [
|
|
115
|
+
* @property {boolean} [enableCollision=false] When <code>true</code>, enables collisions for camera or CPU picking. While this is <code>true</code> the camera will be prevented from going below the tileset surface if {@link ScreenSpaceCameraController#enableCollisionDetection} is true.
|
|
116
|
+
* @property {boolean} [disableCollision=true] Whether to turn off collisions for camera collisions or picking. While this is <code>true</code> the camera will be allowed to go in or below the tileset surface if {@link ScreenSpaceCameraController#enableCollisionDetection} is true. Deprecated.
|
|
117
|
+
* @property {boolean} [projectTo2D=false] Whether to accurately project the tileset to 2D. If this is true, the tileset will be projected accurately to 2D, but it will use more memory to do so. If this is false, the tileset will use less memory and will still render in 2D / CV mode, but its projected positions may be inaccurate. This cannot be set after the tileset has been created.
|
|
118
|
+
* @property {boolean} [enablePick=false] Whether to allow collision and CPU picking with <code>pick</code> when using WebGL 1. If using WebGL 2 or above, this option will be ignored. If using WebGL 1 and this is true, the <code>pick</code> operation will work correctly, but it will use more memory to do so. If running with WebGL 1 and this is false, the model will use less memory, but <code>pick</code> will always return <code>undefined</code>. This cannot be set after the tileset has loaded.
|
|
111
119
|
* @property {string} [debugHeatmapTilePropertyName] The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's specified variable value.
|
|
112
120
|
* @property {boolean} [debugFreezeFrame=false] For debugging only. Determines if only the tiles from last frame should be used for rendering.
|
|
113
121
|
* @property {boolean} [debugColorizeTiles=false] For debugging only. When true, assigns a random color to each tile.
|
|
114
|
-
* @property {boolean} [enableDebugWireframe] For debugging only. This must be true for debugWireframe to work in WebGL1. This cannot be set after the tileset has
|
|
122
|
+
* @property {boolean} [enableDebugWireframe=false] For debugging only. This must be true for debugWireframe to work in WebGL1. This cannot be set after the tileset has been created.
|
|
115
123
|
* @property {boolean} [debugWireframe=false] For debugging only. When true, render's each tile's content as a wireframe.
|
|
116
124
|
* @property {boolean} [debugShowBoundingVolume=false] For debugging only. When true, renders the bounding volume for each tile.
|
|
117
125
|
* @property {boolean} [debugShowContentBoundingVolume=false] For debugging only. When true, renders the bounding volume for each tile's content.
|
|
@@ -148,6 +156,18 @@ import Cesium3DTilesetSkipTraversal from "./Cesium3DTilesetSkipTraversal.js";
|
|
|
148
156
|
* }
|
|
149
157
|
*
|
|
150
158
|
* @example
|
|
159
|
+
* // Turn on camera collisions with the tileset.
|
|
160
|
+
* try {
|
|
161
|
+
* const tileset = await Cesium.Cesium3DTileset.fromUrl(
|
|
162
|
+
* "http://localhost:8002/tilesets/Seattle/tileset.json",
|
|
163
|
+
* { enableCollision: true }
|
|
164
|
+
* );
|
|
165
|
+
* scene.primitives.add(tileset);
|
|
166
|
+
* } catch (error) {
|
|
167
|
+
* console.error(`Error creating tileset: ${error}`);
|
|
168
|
+
* }
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
151
171
|
* // Common setting for the skipLevelOfDetail optimization
|
|
152
172
|
* const tileset = await Cesium.Cesium3DTileset.fromUrl(
|
|
153
173
|
* "http://localhost:8002/tilesets/Seattle/tileset.json", {
|
|
@@ -166,8 +186,8 @@ import Cesium3DTilesetSkipTraversal from "./Cesium3DTilesetSkipTraversal.js";
|
|
|
166
186
|
* const tileset = await Cesium.Cesium3DTileset.fromUrl(
|
|
167
187
|
* "http://localhost:8002/tilesets/Seattle/tileset.json", {
|
|
168
188
|
* dynamicScreenSpaceError: true,
|
|
169
|
-
* dynamicScreenSpaceErrorDensity:
|
|
170
|
-
* dynamicScreenSpaceErrorFactor:
|
|
189
|
+
* dynamicScreenSpaceErrorDensity: 2.0e-4,
|
|
190
|
+
* dynamicScreenSpaceErrorFactor: 24.0,
|
|
171
191
|
* dynamicScreenSpaceErrorHeightFalloff: 0.25
|
|
172
192
|
* });
|
|
173
193
|
* scene.primitives.add(tileset);
|
|
@@ -248,6 +268,8 @@ function Cesium3DTileset(options) {
|
|
|
248
268
|
? Matrix4.clone(options.modelMatrix)
|
|
249
269
|
: Matrix4.clone(Matrix4.IDENTITY);
|
|
250
270
|
|
|
271
|
+
this._addHeightCallbacks = [];
|
|
272
|
+
|
|
251
273
|
this._statistics = new Cesium3DTilesetStatistics();
|
|
252
274
|
this._statisticsLast = new Cesium3DTilesetStatistics();
|
|
253
275
|
this._statisticsPerPass = new Array(Cesium3DTilePass.NUMBER_OF_PASSES);
|
|
@@ -361,18 +383,18 @@ function Cesium3DTileset(options) {
|
|
|
361
383
|
this._pass = undefined; // Cesium3DTilePass
|
|
362
384
|
|
|
363
385
|
/**
|
|
364
|
-
* Optimization option.
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
*
|
|
386
|
+
* Optimization option. For street-level horizon views, use lower resolution tiles far from the camera. This reduces
|
|
387
|
+
* the amount of data loaded and improves tileset loading time with a slight drop in visual quality in the distance.
|
|
388
|
+
* <p>
|
|
389
|
+
* This optimization is strongest when the camera is close to the ground plane of the tileset and looking at the
|
|
390
|
+
* horizon. Furthermore, the results are more accurate for tightly fitting bounding volumes like box and region.
|
|
369
391
|
*
|
|
370
392
|
* @type {boolean}
|
|
371
|
-
* @default
|
|
393
|
+
* @default true
|
|
372
394
|
*/
|
|
373
395
|
this.dynamicScreenSpaceError = defaultValue(
|
|
374
396
|
options.dynamicScreenSpaceError,
|
|
375
|
-
|
|
397
|
+
true
|
|
376
398
|
);
|
|
377
399
|
|
|
378
400
|
/**
|
|
@@ -416,48 +438,68 @@ function Cesium3DTileset(options) {
|
|
|
416
438
|
this.foveatedTimeDelay = defaultValue(options.foveatedTimeDelay, 0.2);
|
|
417
439
|
|
|
418
440
|
/**
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
* This has the effect of keeping high detail in the closer tiles and lower detail in the further tiles, with all tiles
|
|
423
|
-
* beyond a certain distance all roughly having an error of 1.0.
|
|
441
|
+
* Similar to {@link Fog#density}, this option controls the camera distance at which the {@link Cesium3DTileset#dynamicScreenSpaceError}
|
|
442
|
+
* optimization applies. Larger values will cause tiles closer to the camera to be affected. This value must be
|
|
443
|
+
* non-negative.
|
|
424
444
|
* <p>
|
|
425
|
-
*
|
|
426
|
-
*
|
|
445
|
+
* This optimization works by rolling off the tile screen space error (SSE) with camera distance like a bell curve.
|
|
446
|
+
* This has the effect of selecting lower resolution tiles far from the camera. Near the camera, no adjustment is
|
|
447
|
+
* made. For tiles further away, the SSE is reduced by up to {@link Cesium3DTileset#dynamicScreenSpaceErrorFactor}
|
|
448
|
+
* (measured in pixels of error).
|
|
427
449
|
* </p>
|
|
428
450
|
* <p>
|
|
429
|
-
* Increasing
|
|
430
|
-
*
|
|
451
|
+
* Increasing the density makes the bell curve narrower so tiles closer to the camera are affected. This is analagous
|
|
452
|
+
* to moving fog closer to the camera.
|
|
453
|
+
* </p>
|
|
454
|
+
* <p>
|
|
455
|
+
* When the density is 0, the optimization will have no effect on the tileset.
|
|
431
456
|
* </p>
|
|
432
457
|
*
|
|
433
458
|
* @type {number}
|
|
434
|
-
* @default
|
|
459
|
+
* @default 2.0e-4
|
|
435
460
|
*/
|
|
436
|
-
this.dynamicScreenSpaceErrorDensity =
|
|
461
|
+
this.dynamicScreenSpaceErrorDensity = defaultValue(
|
|
462
|
+
options.dynamicScreenSpaceErrorDensity,
|
|
463
|
+
2.0e-4
|
|
464
|
+
);
|
|
437
465
|
|
|
438
466
|
/**
|
|
439
|
-
* A
|
|
440
|
-
*
|
|
467
|
+
* A parameter that controls the intensity of the {@link Cesium3DTileset#dynamicScreenSpaceError} optimization for
|
|
468
|
+
* tiles on the horizon. Larger values cause lower resolution tiles to load, improving runtime performance at a slight
|
|
469
|
+
* reduction of visual quality. The value must be non-negative.
|
|
470
|
+
* <p>
|
|
471
|
+
* More specifically, this parameter represents the maximum adjustment to screen space error (SSE) in pixels for tiles
|
|
472
|
+
* far away from the camera. See {@link Cesium3DTileset#dynamicScreenSpaceErrorDensity} for more details about how
|
|
473
|
+
* this optimization works.
|
|
474
|
+
* </p>
|
|
475
|
+
* <p>
|
|
476
|
+
* When the SSE factor is set to 0, the optimization will have no effect on the tileset.
|
|
477
|
+
* </p>
|
|
441
478
|
*
|
|
442
479
|
* @type {number}
|
|
443
|
-
* @default
|
|
480
|
+
* @default 24.0
|
|
444
481
|
*/
|
|
445
|
-
this.dynamicScreenSpaceErrorFactor =
|
|
482
|
+
this.dynamicScreenSpaceErrorFactor = defaultValue(
|
|
483
|
+
options.dynamicScreenSpaceErrorFactor,
|
|
484
|
+
24.0
|
|
485
|
+
);
|
|
446
486
|
|
|
447
487
|
/**
|
|
448
|
-
* A ratio of the tileset's height
|
|
449
|
-
*
|
|
450
|
-
*
|
|
488
|
+
* A ratio of the tileset's height that determines "street level" for the {@link Cesium3DTileset#dynamicScreenSpaceError}
|
|
489
|
+
* optimization. When the camera is below this height, the dynamic screen space error optimization will have the maximum
|
|
490
|
+
* effect, and it will roll off above this value. Valid values are between 0.0 and 1.0.
|
|
451
491
|
* <p>
|
|
452
|
-
* Valid values are between 0.0 and 1.0.
|
|
453
|
-
* </p>
|
|
454
492
|
*
|
|
455
493
|
* @type {number}
|
|
456
494
|
* @default 0.25
|
|
457
495
|
*/
|
|
458
|
-
this.dynamicScreenSpaceErrorHeightFalloff =
|
|
496
|
+
this.dynamicScreenSpaceErrorHeightFalloff = defaultValue(
|
|
497
|
+
options.dynamicScreenSpaceErrorHeightFalloff,
|
|
498
|
+
0.25
|
|
499
|
+
);
|
|
459
500
|
|
|
460
|
-
|
|
501
|
+
// Updated based on the camera position and direction
|
|
502
|
+
this._dynamicScreenSpaceErrorComputedDensity = 0.0;
|
|
461
503
|
|
|
462
504
|
/**
|
|
463
505
|
* Determines whether the tileset casts or receives shadows from light sources.
|
|
@@ -822,7 +864,25 @@ function Cesium3DTileset(options) {
|
|
|
822
864
|
SplitDirection.NONE
|
|
823
865
|
);
|
|
824
866
|
|
|
867
|
+
/**
|
|
868
|
+
* If <code>true</code>, allows collisions for camera collisions or picking. While this is <code>true</code> the camera will be prevented from going in or below the tileset surface if {@link ScreenSpaceCameraController#enableCollisionDetection} is true. This can have performance implecations if the tileset contains tile with a larger number of vertices.
|
|
869
|
+
*
|
|
870
|
+
* @type {boolean}
|
|
871
|
+
* @default false
|
|
872
|
+
*/
|
|
873
|
+
this.enableCollision = defaultValue(options.enableCollision, false);
|
|
874
|
+
|
|
875
|
+
if (defined(options.disableCollision)) {
|
|
876
|
+
deprecationWarning(
|
|
877
|
+
"Cesium3DTileset options.disableCollision",
|
|
878
|
+
"Cesium3DTileset options.disableCollision has been deprecated in CesiumJS 1.115. It will be removed in CesiumJS 1.116. Use options.enableCollision instead."
|
|
879
|
+
);
|
|
880
|
+
|
|
881
|
+
this.enableCollision = !options.disableCollision;
|
|
882
|
+
}
|
|
883
|
+
|
|
825
884
|
this._projectTo2D = defaultValue(options.projectTo2D, false);
|
|
885
|
+
this._enablePick = defaultValue(options.enablePick, false);
|
|
826
886
|
|
|
827
887
|
/**
|
|
828
888
|
* This property is for debugging only; it is not optimized for production use.
|
|
@@ -1023,6 +1083,34 @@ Object.defineProperties(Cesium3DTileset.prototype, {
|
|
|
1023
1083
|
},
|
|
1024
1084
|
},
|
|
1025
1085
|
|
|
1086
|
+
/**
|
|
1087
|
+
* Whether to turn off collisions for camera collisions or picking. While this is <code>true</code> the camera will be allowed to go in or below the tileset surface if {@link ScreenSpaceCameraController#enableCollisionDetection} is true.
|
|
1088
|
+
* @memberof Cesium3DTileset.prototype
|
|
1089
|
+
*
|
|
1090
|
+
* @type {boolean}
|
|
1091
|
+
* @default true
|
|
1092
|
+
*
|
|
1093
|
+
* @deprecated
|
|
1094
|
+
*/
|
|
1095
|
+
disableCollision: {
|
|
1096
|
+
get: function () {
|
|
1097
|
+
deprecationWarning(
|
|
1098
|
+
"Cesium3DTileset.disableCollision",
|
|
1099
|
+
"Cesium3DTileset.disableCollision has been deprecated in CesiumJS 1.115. It will be removed in CesiumJS 1.116. Use Cesium3DTileset.enableCollision instead."
|
|
1100
|
+
);
|
|
1101
|
+
|
|
1102
|
+
return !this.enableCollision;
|
|
1103
|
+
},
|
|
1104
|
+
set: function (value) {
|
|
1105
|
+
deprecationWarning(
|
|
1106
|
+
"Cesium3DTileset.disableCollision",
|
|
1107
|
+
"Cesium3DTileset.disableCollision has been deprecated in CesiumJS 1.115. It will be removed in CesiumJS 1.116. Use Cesium3DTileset.enableCollision instead."
|
|
1108
|
+
);
|
|
1109
|
+
|
|
1110
|
+
this.enableCollision = !value;
|
|
1111
|
+
},
|
|
1112
|
+
},
|
|
1113
|
+
|
|
1026
1114
|
/**
|
|
1027
1115
|
* Gets the tileset's asset object property, which contains metadata about the tileset.
|
|
1028
1116
|
* <p>
|
|
@@ -1635,6 +1723,7 @@ Object.defineProperties(Cesium3DTileset.prototype, {
|
|
|
1635
1723
|
* <li>The glTF cannot contain morph targets, skins, or animations.</li>
|
|
1636
1724
|
* <li>The glTF cannot contain the <code>EXT_mesh_gpu_instancing</code> extension.</li>
|
|
1637
1725
|
* <li>Only meshes with TRIANGLES can be used to classify other assets.</li>
|
|
1726
|
+
* <li>The meshes must be watertight.</li>
|
|
1638
1727
|
* <li>The <code>POSITION</code> semantic is required.</li>
|
|
1639
1728
|
* <li>If <code>_BATCHID</code>s and an index buffer are both present, all indices with the same batch id must occupy contiguous sections of the index buffer.</li>
|
|
1640
1729
|
* <li>If <code>_BATCHID</code>s are present with no index buffer, all positions with the same batch id must occupy contiguous sections of the position buffer.</li>
|
|
@@ -1644,6 +1733,9 @@ Object.defineProperties(Cesium3DTileset.prototype, {
|
|
|
1644
1733
|
* Additionally, classification is not supported for points or instanced 3D
|
|
1645
1734
|
* models.
|
|
1646
1735
|
* </p>
|
|
1736
|
+
* <p>
|
|
1737
|
+
* The 3D Tiles or terrain receiving the classification must be opaque.
|
|
1738
|
+
* </p>
|
|
1647
1739
|
*
|
|
1648
1740
|
* @memberof Cesium3DTileset.prototype
|
|
1649
1741
|
*
|
|
@@ -1905,7 +1997,8 @@ Object.defineProperties(Cesium3DTileset.prototype, {
|
|
|
1905
1997
|
* @param {Cesium3DTileset.ConstructorOptions} [options] An object describing initialization options
|
|
1906
1998
|
* @returns {Promise<Cesium3DTileset>}
|
|
1907
1999
|
*
|
|
1908
|
-
* @exception {
|
|
2000
|
+
* @exception {RuntimeError} When the tileset asset version is not 0.0, 1.0, or 1.1,
|
|
2001
|
+
* or when the tileset contains a required extension that is not supported.
|
|
1909
2002
|
*
|
|
1910
2003
|
* @see Cesium3DTileset#fromUrl
|
|
1911
2004
|
*
|
|
@@ -1935,7 +2028,8 @@ Cesium3DTileset.fromIonAssetId = async function (assetId, options) {
|
|
|
1935
2028
|
* @param {Cesium3DTileset.ConstructorOptions} [options] An object describing initialization options
|
|
1936
2029
|
* @returns {Promise<Cesium3DTileset>}
|
|
1937
2030
|
*
|
|
1938
|
-
* @exception {
|
|
2031
|
+
* @exception {RuntimeError} When the tileset asset version is not 0.0, 1.0, or 1.1,
|
|
2032
|
+
* or when the tileset contains a required extension that is not supported.
|
|
1939
2033
|
*
|
|
1940
2034
|
* @see Cesium3DTileset#fromIonAssetId
|
|
1941
2035
|
*
|
|
@@ -1968,8 +2062,8 @@ Cesium3DTileset.fromIonAssetId = async function (assetId, options) {
|
|
|
1968
2062
|
* const tileset = await Cesium.Cesium3DTileset.fromUrl(
|
|
1969
2063
|
* "http://localhost:8002/tilesets/Seattle/tileset.json", {
|
|
1970
2064
|
* dynamicScreenSpaceError: true,
|
|
1971
|
-
* dynamicScreenSpaceErrorDensity:
|
|
1972
|
-
* dynamicScreenSpaceErrorFactor:
|
|
2065
|
+
* dynamicScreenSpaceErrorDensity: 2.0e-4,
|
|
2066
|
+
* dynamicScreenSpaceErrorFactor: 24.0,
|
|
1973
2067
|
* dynamicScreenSpaceErrorHeightFalloff: 0.25
|
|
1974
2068
|
* });
|
|
1975
2069
|
* scene.primitives.add(tileset);
|
|
@@ -2078,6 +2172,9 @@ Cesium3DTileset.prototype.makeStyleDirty = function () {
|
|
|
2078
2172
|
/**
|
|
2079
2173
|
* Loads the main tileset JSON file or a tileset JSON file referenced from a tile.
|
|
2080
2174
|
*
|
|
2175
|
+
* @exception {RuntimeError} When the tileset asset version is not 0.0, 1.0, or 1.1,
|
|
2176
|
+
* or when the tileset contains a required extension that is not supported.
|
|
2177
|
+
*
|
|
2081
2178
|
* @private
|
|
2082
2179
|
*/
|
|
2083
2180
|
Cesium3DTileset.prototype.loadTileset = function (
|
|
@@ -2266,6 +2363,7 @@ const scratchMatrix = new Matrix4();
|
|
|
2266
2363
|
const scratchCenter = new Cartesian3();
|
|
2267
2364
|
const scratchPosition = new Cartesian3();
|
|
2268
2365
|
const scratchDirection = new Cartesian3();
|
|
2366
|
+
const scratchHalfHeight = new Cartesian3();
|
|
2269
2367
|
|
|
2270
2368
|
/**
|
|
2271
2369
|
* @private
|
|
@@ -2330,10 +2428,16 @@ function updateDynamicScreenSpaceError(tileset, frameState) {
|
|
|
2330
2428
|
direction = Cartesian3.normalize(direction, direction);
|
|
2331
2429
|
height = positionLocal.z;
|
|
2332
2430
|
if (tileBoundingVolume instanceof TileOrientedBoundingBox) {
|
|
2333
|
-
// Assuming z-up, the last
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2431
|
+
// Assuming z-up, the last column is the local z direction and
|
|
2432
|
+
// represents the height of the bounding box.
|
|
2433
|
+
const halfHeightVector = Matrix3.getColumn(
|
|
2434
|
+
boundingVolume.halfAxes,
|
|
2435
|
+
2,
|
|
2436
|
+
scratchHalfHeight
|
|
2437
|
+
);
|
|
2438
|
+
const halfHeight = Cartesian3.magnitude(halfHeightVector);
|
|
2439
|
+
minimumHeight = centerLocal.z - halfHeight;
|
|
2440
|
+
maximumHeight = centerLocal.z + halfHeight;
|
|
2337
2441
|
} else if (tileBoundingVolume instanceof TileBoundingSphere) {
|
|
2338
2442
|
const radius = boundingVolume.radius;
|
|
2339
2443
|
minimumHeight = centerLocal.z - radius;
|
|
@@ -2569,6 +2673,55 @@ function filterProcessingQueue(tileset) {
|
|
|
2569
2673
|
tiles.length -= removeCount;
|
|
2570
2674
|
}
|
|
2571
2675
|
|
|
2676
|
+
const scratchUpdateHeightCartographic = new Cartographic();
|
|
2677
|
+
const scratchUpdateHeightCartographic2 = new Cartographic();
|
|
2678
|
+
const scratchUpdateHeightCartesian = new Cartesian3();
|
|
2679
|
+
function processUpdateHeight(tileset, tile, frameState) {
|
|
2680
|
+
const heightCallbackData = tileset._addHeightCallbacks;
|
|
2681
|
+
const boundingSphere = tile.boundingSphere;
|
|
2682
|
+
|
|
2683
|
+
for (const callbackData of heightCallbackData) {
|
|
2684
|
+
// No need to update if the tile was already visible last frame
|
|
2685
|
+
if (callbackData.invoked || tile._wasSelectedLastFrame) {
|
|
2686
|
+
continue;
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
const ellipsoid = callbackData.ellipsoid;
|
|
2690
|
+
const positionCartographic = Cartographic.clone(
|
|
2691
|
+
callbackData.positionCartographic,
|
|
2692
|
+
scratchUpdateHeightCartographic
|
|
2693
|
+
);
|
|
2694
|
+
const centerCartographic = Cartographic.fromCartesian(
|
|
2695
|
+
boundingSphere.center,
|
|
2696
|
+
ellipsoid,
|
|
2697
|
+
scratchUpdateHeightCartographic2
|
|
2698
|
+
);
|
|
2699
|
+
|
|
2700
|
+
// This can be undefined when the bounding sphere is at the origin
|
|
2701
|
+
if (defined(centerCartographic)) {
|
|
2702
|
+
positionCartographic.height = centerCartographic.height;
|
|
2703
|
+
}
|
|
2704
|
+
|
|
2705
|
+
const position = Cartographic.toCartesian(
|
|
2706
|
+
positionCartographic,
|
|
2707
|
+
ellipsoid,
|
|
2708
|
+
scratchUpdateHeightCartesian
|
|
2709
|
+
);
|
|
2710
|
+
if (
|
|
2711
|
+
Cartesian3.distance(position, boundingSphere.center) <=
|
|
2712
|
+
boundingSphere.radius
|
|
2713
|
+
) {
|
|
2714
|
+
frameState.afterRender.push(() => {
|
|
2715
|
+
// Callback can be removed before it actually invoked at the end of the frame
|
|
2716
|
+
if (defined(callbackData.callback)) {
|
|
2717
|
+
callbackData.callback(positionCartographic);
|
|
2718
|
+
}
|
|
2719
|
+
callbackData.invoked = false;
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2572
2725
|
/**
|
|
2573
2726
|
* Process tiles in the PROCESSING state so they will eventually move to the READY state.
|
|
2574
2727
|
* @private
|
|
@@ -2836,6 +2989,7 @@ function updateTiles(tileset, frameState, passOptions) {
|
|
|
2836
2989
|
if (isRender) {
|
|
2837
2990
|
tileVisible.raiseEvent(tile);
|
|
2838
2991
|
}
|
|
2992
|
+
processUpdateHeight(tileset, tile, frameState);
|
|
2839
2993
|
tile.update(tileset, frameState, passOptions);
|
|
2840
2994
|
statistics.incrementSelectionCounts(tile.content);
|
|
2841
2995
|
++statistics.selected;
|
|
@@ -3379,6 +3533,171 @@ Cesium3DTileset.checkSupportedExtensions = function (extensionsRequired) {
|
|
|
3379
3533
|
}
|
|
3380
3534
|
};
|
|
3381
3535
|
|
|
3536
|
+
const scratchGetHeightRay = new Ray();
|
|
3537
|
+
const scratchIntersection = new Cartesian3();
|
|
3538
|
+
const scratchGetHeightCartographic = new Cartographic();
|
|
3539
|
+
|
|
3540
|
+
/**
|
|
3541
|
+
* Get the height of the loaded surface at a given cartographic. This function will only take into account meshes for loaded tiles, not neccisarily the most detailed tiles available for a tileset. This function will always return undefined when sampling a point cloud.
|
|
3542
|
+
*
|
|
3543
|
+
* @param {Cartographic} cartographic The cartographic for which to find the height.
|
|
3544
|
+
* @param {Scene} scene The scene where visualization is taking place.
|
|
3545
|
+
* @returns {number|undefined} The height of the cartographic or undefined if it could not be found.
|
|
3546
|
+
*
|
|
3547
|
+
* @example
|
|
3548
|
+
* const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(124624234);
|
|
3549
|
+
* scene.primitives.add(tileset);
|
|
3550
|
+
*
|
|
3551
|
+
* const height = tileset.getHeight(scene.camera.positionCartographic, scene);
|
|
3552
|
+
*/
|
|
3553
|
+
Cesium3DTileset.prototype.getHeight = function (cartographic, scene) {
|
|
3554
|
+
//>>includeStart('debug', pragmas.debug);
|
|
3555
|
+
Check.typeOf.object("cartographic", cartographic);
|
|
3556
|
+
Check.typeOf.object("scene", scene);
|
|
3557
|
+
//>>includeEnd('debug');
|
|
3558
|
+
|
|
3559
|
+
let ellipsoid = scene.globe?.ellipsoid;
|
|
3560
|
+
if (!defined(ellipsoid)) {
|
|
3561
|
+
ellipsoid = Ellipsoid.WGS84;
|
|
3562
|
+
}
|
|
3563
|
+
|
|
3564
|
+
const ray = scratchGetHeightRay;
|
|
3565
|
+
const position = ellipsoid.cartographicToCartesian(
|
|
3566
|
+
cartographic,
|
|
3567
|
+
ray.direction
|
|
3568
|
+
);
|
|
3569
|
+
Cartesian3.normalize(ray.direction, ray.direction);
|
|
3570
|
+
|
|
3571
|
+
ray.direction = Cartesian3.normalize(position, ray.direction);
|
|
3572
|
+
ray.direction = Cartesian3.negate(position, ray.direction);
|
|
3573
|
+
ray.origin = Cartesian3.multiplyByScalar(
|
|
3574
|
+
ray.direction,
|
|
3575
|
+
-2 * ellipsoid.maximumRadius,
|
|
3576
|
+
ray.origin
|
|
3577
|
+
);
|
|
3578
|
+
|
|
3579
|
+
const intersection = this.pick(ray, scene.frameState, scratchIntersection);
|
|
3580
|
+
if (!defined(intersection)) {
|
|
3581
|
+
return;
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
return ellipsoid.cartesianToCartographic(
|
|
3585
|
+
intersection,
|
|
3586
|
+
scratchGetHeightCartographic
|
|
3587
|
+
)?.height;
|
|
3588
|
+
};
|
|
3589
|
+
|
|
3590
|
+
/**
|
|
3591
|
+
* Calls the callback when a new tile is rendered that contains the given cartographic. The only parameter
|
|
3592
|
+
* is the cartographic position on the tile.
|
|
3593
|
+
*
|
|
3594
|
+
* @private
|
|
3595
|
+
*
|
|
3596
|
+
* @param {Scene} scene The scene where visualization is taking place.
|
|
3597
|
+
* @param {Cartographic} cartographic The cartographic position.
|
|
3598
|
+
* @param {Function} callback The function to be called when a new tile is loaded.
|
|
3599
|
+
* @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.
|
|
3600
|
+
* @returns {Function} The function to remove this callback from the quadtree.
|
|
3601
|
+
*/
|
|
3602
|
+
Cesium3DTileset.prototype.updateHeight = function (
|
|
3603
|
+
cartographic,
|
|
3604
|
+
callback,
|
|
3605
|
+
ellipsoid
|
|
3606
|
+
) {
|
|
3607
|
+
ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
|
|
3608
|
+
|
|
3609
|
+
const object = {
|
|
3610
|
+
positionCartographic: cartographic,
|
|
3611
|
+
ellipsoid: ellipsoid,
|
|
3612
|
+
callback: callback,
|
|
3613
|
+
invoked: false,
|
|
3614
|
+
};
|
|
3615
|
+
|
|
3616
|
+
const removeCallback = () => {
|
|
3617
|
+
const addedCallbacks = this._addHeightCallbacks;
|
|
3618
|
+
const length = addedCallbacks.length;
|
|
3619
|
+
for (let i = 0; i < length; ++i) {
|
|
3620
|
+
if (addedCallbacks[i] === object) {
|
|
3621
|
+
addedCallbacks.splice(i, 1);
|
|
3622
|
+
break;
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
|
|
3626
|
+
if (object.callback) {
|
|
3627
|
+
object.callback = undefined;
|
|
3628
|
+
}
|
|
3629
|
+
};
|
|
3630
|
+
|
|
3631
|
+
this._addHeightCallbacks.push(object);
|
|
3632
|
+
return removeCallback;
|
|
3633
|
+
};
|
|
3634
|
+
|
|
3635
|
+
const scratchSphereIntersection = new Interval();
|
|
3636
|
+
const scratchPickIntersection = new Cartesian3();
|
|
3637
|
+
|
|
3638
|
+
/**
|
|
3639
|
+
* Find an intersection between a ray and the tileset surface that was rendered. The ray must be given in world coordinates.
|
|
3640
|
+
*
|
|
3641
|
+
* @param {Ray} ray The ray to test for intersection.
|
|
3642
|
+
* @param {FrameState} frameState The frame state.
|
|
3643
|
+
* @param {Cartesian3|undefined} [result] The intersection or <code>undefined</code> if none was found.
|
|
3644
|
+
* @returns {Cartesian3|undefined} The intersection or <code>undefined</code> if none was found.
|
|
3645
|
+
*
|
|
3646
|
+
* @private
|
|
3647
|
+
*/
|
|
3648
|
+
Cesium3DTileset.prototype.pick = function (ray, frameState, result) {
|
|
3649
|
+
if (!frameState.context.webgl2 && !this._enablePick) {
|
|
3650
|
+
return;
|
|
3651
|
+
}
|
|
3652
|
+
|
|
3653
|
+
const selectedTiles = this._selectedTiles;
|
|
3654
|
+
const selectedLength = selectedTiles.length;
|
|
3655
|
+
const candidates = [];
|
|
3656
|
+
|
|
3657
|
+
for (let i = 0; i < selectedLength; ++i) {
|
|
3658
|
+
const tile = selectedTiles[i];
|
|
3659
|
+
const boundsIntersection = IntersectionTests.raySphere(
|
|
3660
|
+
ray,
|
|
3661
|
+
tile.contentBoundingVolume.boundingSphere,
|
|
3662
|
+
scratchSphereIntersection
|
|
3663
|
+
);
|
|
3664
|
+
if (!defined(boundsIntersection) || !defined(tile.content)) {
|
|
3665
|
+
continue;
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
candidates.push(tile);
|
|
3669
|
+
}
|
|
3670
|
+
|
|
3671
|
+
const length = candidates.length;
|
|
3672
|
+
candidates.sort((a, b) => {
|
|
3673
|
+
const aDist = BoundingSphere.distanceSquaredTo(
|
|
3674
|
+
a.contentBoundingVolume.boundingSphere,
|
|
3675
|
+
ray.origin
|
|
3676
|
+
);
|
|
3677
|
+
const bDist = BoundingSphere.distanceSquaredTo(
|
|
3678
|
+
b.contentBoundingVolume.boundingSphere,
|
|
3679
|
+
ray.origin
|
|
3680
|
+
);
|
|
3681
|
+
|
|
3682
|
+
return aDist - bDist;
|
|
3683
|
+
});
|
|
3684
|
+
|
|
3685
|
+
let intersection;
|
|
3686
|
+
for (let i = 0; i < length; ++i) {
|
|
3687
|
+
const tile = candidates[i];
|
|
3688
|
+
const candidate = tile.content.pick(
|
|
3689
|
+
ray,
|
|
3690
|
+
frameState,
|
|
3691
|
+
scratchPickIntersection
|
|
3692
|
+
);
|
|
3693
|
+
|
|
3694
|
+
if (defined(candidate)) {
|
|
3695
|
+
intersection = Cartesian3.clone(candidate, result);
|
|
3696
|
+
return intersection;
|
|
3697
|
+
}
|
|
3698
|
+
}
|
|
3699
|
+
};
|
|
3700
|
+
|
|
3382
3701
|
/**
|
|
3383
3702
|
* Optimization option. Used as a callback when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone,
|
|
3384
3703
|
* interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.
|
|
@@ -271,12 +271,10 @@ function executeEmptyTraversal(root, frameState) {
|
|
|
271
271
|
|
|
272
272
|
// Only traverse if the tile is empty - traversal stops at descendants with content
|
|
273
273
|
const traverse = !tile.hasRenderableContent && canTraverse(tile);
|
|
274
|
-
const emptyLeaf = !tile.hasRenderableContent && tile.children.length === 0;
|
|
275
274
|
|
|
276
275
|
// Traversal stops but the tile does not have content yet
|
|
277
276
|
// There will be holes if the parent tries to refine to its children, so don't refine
|
|
278
|
-
|
|
279
|
-
if (!traverse && !tile.contentAvailable && !emptyLeaf) {
|
|
277
|
+
if (!traverse && !tile.contentAvailable) {
|
|
280
278
|
allDescendantsLoaded = false;
|
|
281
279
|
}
|
|
282
280
|
|
|
@@ -295,7 +293,7 @@ function executeEmptyTraversal(root, frameState) {
|
|
|
295
293
|
}
|
|
296
294
|
}
|
|
297
295
|
|
|
298
|
-
return allDescendantsLoaded;
|
|
296
|
+
return root.hasEmptyContent || allDescendantsLoaded;
|
|
299
297
|
}
|
|
300
298
|
|
|
301
299
|
export default Cesium3DTilesetBaseTraversal;
|
|
@@ -79,6 +79,8 @@ Cesium3DTilesetTraversal.selectTile = function (tile, frameState) {
|
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
tile._wasSelectedLastFrame = true;
|
|
83
|
+
|
|
82
84
|
const { content, tileset } = tile;
|
|
83
85
|
if (content.featurePropertiesDirty) {
|
|
84
86
|
// A feature's property in this tile changed, the tile needs to be re-styled.
|
|
@@ -88,7 +90,9 @@ Cesium3DTilesetTraversal.selectTile = function (tile, frameState) {
|
|
|
88
90
|
} else if (tile._selectedFrame < frameState.frameNumber - 1) {
|
|
89
91
|
// Tile is newly selected; it is selected this frame, but was not selected last frame.
|
|
90
92
|
tileset._selectedTilesToStyle.push(tile);
|
|
93
|
+
tile._wasSelectedLastFrame = false;
|
|
91
94
|
}
|
|
95
|
+
|
|
92
96
|
tile._selectedFrame = frameState.frameNumber;
|
|
93
97
|
tileset._selectedTiles.push(tile);
|
|
94
98
|
};
|