@cesium/engine 21.0.1 → 22.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/ThirdParty/Workers/zip-web-worker.js +10 -7
- package/Build/Workers/chunk-23T2IPHV.js +55 -0
- package/Build/Workers/{chunk-TGJQMEL4.js → chunk-2AM4E2WD.js} +2 -2
- package/Build/Workers/{chunk-4CORGH7N.js → chunk-2MWF4IES.js} +16 -14
- package/Build/Workers/{chunk-3RKX3UFI.js → chunk-2RCIRXNI.js} +1 -1
- package/Build/Workers/{chunk-LV3G32QE.js → chunk-3YTMGEXW.js} +5 -1424
- package/Build/Workers/{chunk-PJAA7QSC.js → chunk-4BHWJWS3.js} +6 -6
- package/Build/Workers/{chunk-FE565QHX.js → chunk-5JKH4AMT.js} +2 -2
- package/Build/Workers/{chunk-KZ7GDSAJ.js → chunk-6HKAPCSO.js} +1 -1
- package/Build/Workers/{chunk-VVALNLSH.js → chunk-A53R2F2L.js} +4 -4
- package/Build/Workers/{chunk-KVB73ECP.js → chunk-A6YFUGJO.js} +7 -7
- package/Build/Workers/{chunk-QNOIRRJK.js → chunk-AJYWXC6I.js} +4 -4
- package/Build/Workers/{chunk-UKA7OISV.js → chunk-AOIO5VUS.js} +282 -2284
- package/Build/Workers/{chunk-OBS5EMZ6.js → chunk-B7JRBTT6.js} +10 -10
- package/Build/Workers/{chunk-5YXA47QD.js → chunk-CHNDJRYA.js} +20 -18
- package/Build/Workers/{chunk-X3ZV3XNO.js → chunk-CJOV55CW.js} +20 -18
- package/Build/Workers/{chunk-W6I3LNPF.js → chunk-COGPE5Z2.js} +10 -8
- package/Build/Workers/{chunk-2QPH5QDK.js → chunk-CW7W27IZ.js} +14 -10
- package/Build/Workers/{chunk-MXOGBWMP.js → chunk-DICY26ID.js} +20 -16
- package/Build/Workers/{chunk-W6KMV4F5.js → chunk-DMEFNTUV.js} +69 -7
- package/Build/Workers/{chunk-T7HU6E7G.js → chunk-DQSJEOZY.js} +1 -1
- package/Build/Workers/{chunk-ASVODZNK.js → chunk-GDU4RZSZ.js} +16 -36
- package/Build/Workers/{chunk-MQPDOWGH.js → chunk-GKWOUMYA.js} +1 -1
- package/Build/Workers/{chunk-A2SP2EJZ.js → chunk-GTY4K4IA.js} +9 -7
- package/Build/Workers/{chunk-KEPPNSBL.js → chunk-H6Q7E4BQ.js} +8 -6
- package/Build/Workers/{chunk-JG3C3LPY.js → chunk-HHGOFZVQ.js} +7 -5
- package/Build/Workers/chunk-HXKUEOOD.js +352 -0
- package/Build/Workers/{chunk-UFSYRVC5.js → chunk-I4REFVXB.js} +4 -4
- package/Build/Workers/{chunk-LU7DLY2L.js → chunk-IL5F6WEE.js} +3 -3
- package/Build/Workers/{chunk-RVRN4KDB.js → chunk-JKXPC5HD.js} +2 -2
- package/Build/Workers/{chunk-CBPNIEGH.js → chunk-KKGD7HAW.js} +13 -11
- package/Build/Workers/{chunk-DTKSVIH5.js → chunk-KROSQJUA.js} +2 -2
- package/Build/Workers/{chunk-42EJCSIV.js → chunk-L4JLDVCM.js} +5 -5
- package/Build/Workers/{chunk-LPKJSIMD.js → chunk-LIYMRHGR.js} +15 -13
- package/Build/Workers/{chunk-J2XQVKVH.js → chunk-MKMZHRB3.js} +74 -35
- package/Build/Workers/{chunk-CSDYSXBI.js → chunk-MO25ZQ2I.js} +14 -12
- package/Build/Workers/{chunk-3YNW5K6O.js → chunk-O6RZEKHZ.js} +12 -12
- package/Build/Workers/{chunk-RR3NCT4R.js → chunk-OOCGX2OD.js} +4 -4
- package/Build/Workers/{chunk-XG54SG4O.js → chunk-OXFU5HNU.js} +13 -5
- package/Build/Workers/{chunk-P2UKEFCK.js → chunk-P5CGIJUY.js} +2 -2
- package/Build/Workers/{chunk-DBHL2UVG.js → chunk-QEANVUGT.js} +2 -2
- package/Build/Workers/{chunk-2SI7DEW5.js → chunk-QFBCIX7J.js} +8 -6
- package/Build/Workers/{chunk-DDXI6UYW.js → chunk-QUAH3XOT.js} +4 -4
- package/Build/Workers/{chunk-PZUZCAX3.js → chunk-RXZDTDIY.js} +13 -9
- package/Build/Workers/{chunk-YZ3RCE45.js → chunk-SPA2KPH3.js} +14 -12
- package/Build/Workers/chunk-TDSVSW5A.js +1460 -0
- package/Build/Workers/{chunk-G3CKZ34K.js → chunk-UG2DPFOL.js} +8 -6
- package/Build/Workers/{chunk-IKUOV6DO.js → chunk-URGEDZBS.js} +7 -7
- package/Build/Workers/{chunk-U2GR5FDL.js → chunk-V35NQOJC.js} +21 -11
- package/Build/Workers/chunk-W4XUEDU5.js +2058 -0
- package/Build/Workers/chunk-WB4TSSBQ.js +3514 -0
- package/Build/Workers/{chunk-EBDZDBJN.js → chunk-WTLYD4FE.js} +19 -15
- package/Build/Workers/{chunk-WQZL6CA2.js → chunk-Y4ALZ4SS.js} +9 -7
- package/Build/Workers/{chunk-DAJKOQW6.js → chunk-YF2NVO5B.js} +19 -13
- package/Build/Workers/{chunk-XJVRYJVZ.js → chunk-YSYSXSHF.js} +1 -1
- package/Build/Workers/{chunk-YNOVMSUX.js → chunk-YX562XOB.js} +15 -11
- package/Build/Workers/{chunk-J3KPR6DJ.js → chunk-YZWA5B4R.js} +15 -13
- package/Build/Workers/{chunk-NYYQZ3LH.js → chunk-Z6DFT4D3.js} +15 -11
- package/Build/Workers/combineGeometry.js +24 -21
- package/Build/Workers/createBoxGeometry.js +18 -15
- package/Build/Workers/createBoxOutlineGeometry.js +16 -13
- package/Build/Workers/createCircleGeometry.js +28 -24
- package/Build/Workers/createCircleOutlineGeometry.js +21 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +35 -31
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -29
- package/Build/Workers/createCorridorGeometry.js +32 -28
- package/Build/Workers/createCorridorOutlineGeometry.js +30 -26
- package/Build/Workers/createCylinderGeometry.js +20 -17
- package/Build/Workers/createCylinderOutlineGeometry.js +20 -16
- package/Build/Workers/createEllipseGeometry.js +28 -24
- package/Build/Workers/createEllipseOutlineGeometry.js +21 -17
- package/Build/Workers/createEllipsoidGeometry.js +19 -16
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -15
- package/Build/Workers/createFrustumGeometry.js +18 -15
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -15
- package/Build/Workers/createGeometry.js +28 -22
- package/Build/Workers/createGroundPolylineGeometry.js +25 -21
- package/Build/Workers/createPlaneGeometry.js +16 -13
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -12
- package/Build/Workers/createPolygonGeometry.js +35 -31
- package/Build/Workers/createPolygonOutlineGeometry.js +32 -28
- package/Build/Workers/createPolylineGeometry.js +27 -23
- package/Build/Workers/createPolylineVolumeGeometry.js +33 -29
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +29 -25
- package/Build/Workers/createRectangleGeometry.js +30 -26
- package/Build/Workers/createRectangleOutlineGeometry.js +23 -19
- package/Build/Workers/createSimplePolylineGeometry.js +25 -21
- package/Build/Workers/createSphereGeometry.js +19 -16
- package/Build/Workers/createSphereOutlineGeometry.js +18 -15
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +16 -13
- package/Build/Workers/createVectorTileGeometries.js +24 -21
- package/Build/Workers/createVectorTilePoints.js +15 -12
- package/Build/Workers/createVectorTilePolygons.js +24 -20
- package/Build/Workers/createVectorTilePolylines.js +16 -13
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +91 -0
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +28 -23
- package/Build/Workers/createVerticesFromHeightmap.js +28 -23
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -279
- package/Build/Workers/createWallGeometry.js +26 -22
- package/Build/Workers/createWallOutlineGeometry.js +25 -21
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +13 -11
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +121 -0
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -20
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +95 -0
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +2 -2
- package/Source/Core/AxisAlignedBoundingBox.js +36 -0
- package/Source/Core/Cesium3DTilesTerrainData.js +932 -0
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +1868 -0
- package/Source/Core/Cesium3DTilesTerrainProvider.js +1052 -0
- package/Source/Core/CesiumTerrainProvider.js +2 -2
- package/Source/Core/Color.js +23 -6
- package/Source/Core/EllipsoidalOccluder.js +2 -2
- package/Source/Core/FeatureDetection.js +0 -2
- package/Source/Core/GoogleEarthEnterpriseMetadata.js +1 -1
- package/Source/Core/GoogleEarthEnterpriseTerrainData.js +2 -1
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -1
- package/Source/Core/HeightmapTerrainData.js +12 -22
- package/Source/Core/HilbertOrder.js +0 -6
- package/Source/Core/ITwinPlatform.js +6 -6
- package/Source/Core/IntersectionTests.js +80 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonResource.js +35 -27
- package/Source/Core/PixelFormat.js +2 -2
- package/Source/Core/QuantizedMeshTerrainData.js +24 -57
- package/Source/Core/Resource.js +15 -11
- package/Source/Core/S2Cell.js +6 -18
- package/Source/Core/TaskProcessor.js +1 -1
- package/Source/Core/TerrainData.js +2 -1
- package/Source/Core/TerrainEncoding.js +215 -38
- package/Source/Core/TerrainMesh.js +215 -8
- package/Source/Core/TerrainPicker.js +607 -0
- package/Source/Core/TerrainProvider.js +151 -0
- package/Source/Core/TexturePacker.js +27 -12
- package/Source/Core/Transforms.js +28 -19
- package/Source/Core/VRTheWorldTerrainProvider.js +2 -2
- package/Source/Core/binarySearch.js +1 -1
- package/Source/Core/createWorldBathymetryAsync.js +2 -2
- package/Source/Core/createWorldTerrainAsync.js +3 -3
- package/Source/Core/loadImageFromTypedArray.js +9 -3
- package/Source/Core/mergeSort.js +1 -1
- package/Source/DataSources/BillboardGraphics.js +1 -1
- package/Source/DataSources/BillboardVisualizer.js +7 -4
- package/Source/DataSources/PropertyArray.js +2 -2
- package/Source/Renderer/AutomaticUniforms.js +61 -0
- package/Source/Renderer/Buffer.js +32 -0
- package/Source/Renderer/BufferUsage.js +3 -1
- package/Source/Renderer/Context.js +98 -14
- package/Source/Renderer/Pass.js +10 -9
- package/Source/Renderer/Sync.js +104 -0
- package/Source/Renderer/TextureAtlas.js +67 -27
- package/Source/Renderer/UniformState.js +12 -0
- package/Source/Renderer/VertexArray.js +1 -1
- package/Source/Scene/ArcGisMapServerImageryProvider.js +1 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Azure2DImageryProvider.js +99 -13
- package/Source/Scene/BatchTable.js +2 -2
- package/Source/Scene/Billboard.js +75 -28
- package/Source/Scene/BillboardCollection.js +24 -15
- package/Source/Scene/BillboardTexture.js +56 -7
- package/Source/Scene/BingMapsImageryProvider.js +1 -1
- package/Source/Scene/BoundingVolumeSemantics.js +54 -62
- package/Source/Scene/Cesium3DTile.js +3 -3
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +1 -1
- package/Source/Scene/Cesium3DTileset.js +1 -1
- package/Source/Scene/EdgeFramebuffer.js +245 -0
- package/Source/Scene/FrameState.js +12 -0
- package/Source/Scene/GaussianSplat3DTileContent.js +12 -16
- package/Source/Scene/GaussianSplatPrimitive.js +12 -8
- package/Source/Scene/GaussianSplatSorter.js +2 -2
- package/Source/Scene/Globe.js +4 -2
- package/Source/Scene/GlobeSurfaceTile.js +28 -70
- package/Source/Scene/GlobeSurfaceTileProvider.js +11 -0
- package/Source/Scene/GltfBufferViewLoader.js +18 -0
- package/Source/Scene/GltfLoader.js +46 -8
- package/Source/Scene/Google2DImageryProvider.js +48 -41
- package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +1 -1
- package/Source/Scene/I3SDataProvider.js +1 -1
- package/Source/Scene/I3SDecoder.js +3 -3
- package/Source/Scene/ITwinData.js +4 -4
- package/Source/Scene/ImageryLayer.js +1 -1
- package/Source/Scene/Implicit3DTileContent.js +18 -7
- package/Source/Scene/ImplicitSubtree.js +3 -3
- package/Source/Scene/ImplicitTileset.js +2 -2
- package/Source/Scene/IonImageryProvider.js +15 -84
- package/Source/Scene/IonImageryProviderFactory.js +194 -0
- package/Source/Scene/LabelCollection.js +54 -36
- package/Source/Scene/MetadataComponentType.js +5 -5
- package/Source/Scene/MetadataTableProperty.js +3 -9
- package/Source/Scene/Model/EdgeDetectionPipelineStage.js +42 -0
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +800 -0
- package/Source/Scene/Model/MetadataPipelineStage.js +7 -7
- package/Source/Scene/Model/ModelDrawCommand.js +69 -0
- package/Source/Scene/Model/ModelImagery.js +4 -0
- package/Source/Scene/Model/ModelRuntimeNode.js +2 -2
- package/Source/Scene/Model/ModelRuntimePrimitive.js +13 -2
- package/Source/Scene/Model/ModelSceneGraph.js +15 -3
- package/Source/Scene/Model/ModelUtility.js +0 -1
- package/Source/Scene/Model/NodeRenderResources.js +1 -1
- package/Source/Scene/Model/PrimitiveRenderResources.js +1 -1
- package/Source/Scene/OIT.js +11 -1
- package/Source/Scene/PickFramebuffer.js +134 -50
- package/Source/Scene/Picking.js +195 -89
- package/Source/Scene/QuadtreePrimitive.js +34 -26
- package/Source/Scene/QuadtreeTile.js +66 -46
- package/Source/Scene/ResourceLoaderState.js +1 -1
- package/Source/Scene/Scene.js +160 -16
- package/Source/Scene/ScreenSpaceCameraController.js +1 -1
- package/Source/Scene/SensorVolumePortionToDisplay.js +6 -6
- package/Source/Scene/SingleTileImageryProvider.js +3 -3
- package/Source/Scene/Terrain.js +5 -5
- package/Source/Scene/TerrainFillMesh.js +1 -0
- package/Source/Scene/TileMapServiceImageryProvider.js +2 -2
- package/Source/Scene/UrlTemplateImageryProvider.js +1 -1
- package/Source/Scene/View.js +3 -0
- package/Source/Scene/VoxelPrimitive.js +196 -189
- package/Source/Scene/VoxelShape.js +2 -0
- package/Source/Scene/createWorldImageryAsync.js +1 -1
- package/Source/Shaders/BillboardCollectionFS.glsl +115 -62
- package/Source/Shaders/BillboardCollectionFS.js +115 -63
- package/Source/Shaders/BillboardCollectionVS.glsl +44 -37
- package/Source/Shaders/BillboardCollectionVS.js +45 -38
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.glsl +10 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.js +12 -0
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
- package/Source/Shaders/GlobeVS.glsl +1 -1
- package/Source/Shaders/GlobeVS.js +1 -1
- package/Source/Shaders/Model/EdgeDetectionStageFS.glsl +58 -0
- package/Source/Shaders/Model/EdgeDetectionStageFS.js +60 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +83 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.js +85 -0
- package/Source/Shaders/Model/ModelFS.glsl +5 -0
- package/Source/Shaders/Model/ModelFS.js +5 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.glsl +0 -1
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +0 -1
- package/Source/Shaders/ShadowVolumeAppearanceFS.glsl +7 -15
- package/Source/Shaders/ShadowVolumeAppearanceFS.js +7 -15
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +46 -0
- package/Source/Workers/incrementallyBuildTerrainPicker.js +108 -0
- package/Source/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +55 -0
- package/index.d.ts +488 -31
- package/index.js +202 -190
- package/package.json +3 -2
package/Source/Scene/Picking.js
CHANGED
|
@@ -8,6 +8,7 @@ import Color from "../Core/Color.js";
|
|
|
8
8
|
import defined from "../Core/defined.js";
|
|
9
9
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
10
10
|
import Matrix4 from "../Core/Matrix4.js";
|
|
11
|
+
import oneTimeWarning from "../Core/oneTimeWarning.js";
|
|
11
12
|
import OrthographicFrustum from "../Core/OrthographicFrustum.js";
|
|
12
13
|
import OrthographicOffCenterFrustum from "../Core/OrthographicOffCenterFrustum.js";
|
|
13
14
|
import PerspectiveFrustum from "../Core/PerspectiveFrustum.js";
|
|
@@ -262,23 +263,21 @@ function computePickingDrawingBufferRectangle(
|
|
|
262
263
|
}
|
|
263
264
|
|
|
264
265
|
/**
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
* potentially be set depending on the type of primitive and may be used to further identify the picked object.
|
|
268
|
-
* <p>
|
|
269
|
-
* When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object.
|
|
270
|
-
* </p>
|
|
266
|
+
* Setup needed before picking.
|
|
267
|
+
*
|
|
271
268
|
* @param {Scene} scene
|
|
272
269
|
* @param {Cartesian2} windowPosition Window coordinates to perform picking on.
|
|
270
|
+
* @param {BoundingRectangle} drawingBufferRectangle The output drawing buffer recangle.
|
|
273
271
|
* @param {number} [width=3] Width of the pick rectangle.
|
|
274
272
|
* @param {number} [height=3] Height of the pick rectangle.
|
|
275
|
-
* @returns {object | undefined} Object containing the picked primitive.
|
|
276
273
|
*/
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
274
|
+
function pickBegin(
|
|
275
|
+
scene,
|
|
276
|
+
windowPosition,
|
|
277
|
+
drawingBufferRectangle,
|
|
278
|
+
width,
|
|
279
|
+
height,
|
|
280
|
+
) {
|
|
282
281
|
const { context, frameState, defaultView } = scene;
|
|
283
282
|
const { viewport, pickFramebuffer } = defaultView;
|
|
284
283
|
|
|
@@ -297,12 +296,12 @@ Picking.prototype.pick = function (scene, windowPosition, width, height) {
|
|
|
297
296
|
windowPosition,
|
|
298
297
|
scratchPosition,
|
|
299
298
|
);
|
|
300
|
-
|
|
299
|
+
computePickingDrawingBufferRectangle(
|
|
301
300
|
context.drawingBufferHeight,
|
|
302
301
|
drawingBufferPosition,
|
|
303
302
|
width,
|
|
304
303
|
height,
|
|
305
|
-
|
|
304
|
+
drawingBufferRectangle,
|
|
306
305
|
);
|
|
307
306
|
|
|
308
307
|
scene.jobScheduler.disableThisFrame();
|
|
@@ -327,10 +326,100 @@ Picking.prototype.pick = function (scene, windowPosition, width, height) {
|
|
|
327
326
|
|
|
328
327
|
scene.updateAndExecuteCommands(passState, scratchColorZero);
|
|
329
328
|
scene.resolveFramebuffers(passState);
|
|
329
|
+
}
|
|
330
330
|
|
|
331
|
-
|
|
331
|
+
/**
|
|
332
|
+
* Teardown needed after picking.
|
|
333
|
+
*
|
|
334
|
+
* @param {Scene} scene
|
|
335
|
+
*/
|
|
336
|
+
function pickEnd(scene) {
|
|
337
|
+
const { context } = scene;
|
|
332
338
|
context.endFrame();
|
|
333
|
-
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Same operation as {@link Picking#pick}, but returns a Promise that resolves asynchronously without blocking the main render thread.
|
|
343
|
+
* Requires WebGL2 else using synchronous fallback.
|
|
344
|
+
*
|
|
345
|
+
* @see Picking#pick
|
|
346
|
+
*
|
|
347
|
+
* @param {Scene} scene
|
|
348
|
+
* @param {Cartesian2} windowPosition Window coordinates to perform picking on.
|
|
349
|
+
* @param {number} [width=3] Width of the pick rectangle.
|
|
350
|
+
* @param {number} [height=3] Height of the pick rectangle.
|
|
351
|
+
* @param {number} [limit=1] If supplied, stop iterating after collecting this many objects.
|
|
352
|
+
* @returns {Promise<object[]>} List of objects containing the picked primitives.
|
|
353
|
+
*
|
|
354
|
+
* @exception {RuntimeError} Async Picking Request Timeout.
|
|
355
|
+
*/
|
|
356
|
+
Picking.prototype.pickAsync = async function (
|
|
357
|
+
scene,
|
|
358
|
+
windowPosition,
|
|
359
|
+
width,
|
|
360
|
+
height,
|
|
361
|
+
limit = 1,
|
|
362
|
+
) {
|
|
363
|
+
//>>includeStart('debug', pragmas.debug);
|
|
364
|
+
Check.defined("windowPosition", windowPosition);
|
|
365
|
+
//>>includeEnd('debug');
|
|
366
|
+
|
|
367
|
+
const { context, frameState, defaultView } = scene;
|
|
368
|
+
const { pickFramebuffer } = defaultView;
|
|
369
|
+
const drawingBufferRectangle = scratchRectangle;
|
|
370
|
+
pickBegin(scene, windowPosition, drawingBufferRectangle, width, height);
|
|
371
|
+
let pickedObjects;
|
|
372
|
+
if (context.webgl2) {
|
|
373
|
+
pickedObjects = pickFramebuffer.endAsync(
|
|
374
|
+
drawingBufferRectangle,
|
|
375
|
+
frameState,
|
|
376
|
+
limit,
|
|
377
|
+
); // Promise<Object[]>
|
|
378
|
+
} else {
|
|
379
|
+
pickedObjects = pickFramebuffer.end(drawingBufferRectangle, limit); // Object[]
|
|
380
|
+
pickedObjects = Promise.resolve(pickedObjects); // Promise<Object[]> Wrap as Promise
|
|
381
|
+
oneTimeWarning(
|
|
382
|
+
"picking-async-fallback",
|
|
383
|
+
"Fallback to synchronous picking because async operation requires WebGL2 context.",
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
pickEnd(scene);
|
|
387
|
+
return pickedObjects;
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Returns a list of objects with a <code>primitive</code> property that contains the first (top) primitives
|
|
392
|
+
* in the scene at a particular window coordinate. Other properties may potentially be set depending on the
|
|
393
|
+
* type of primitive and may be used to further identify the picked object.
|
|
394
|
+
* <p>
|
|
395
|
+
* When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object.
|
|
396
|
+
* </p>
|
|
397
|
+
* @param {Scene} scene
|
|
398
|
+
* @param {Cartesian2} windowPosition Window coordinates to perform picking on.
|
|
399
|
+
* @param {number} [width=3] Width of the pick rectangle.
|
|
400
|
+
* @param {number} [height=3] Height of the pick rectangle.
|
|
401
|
+
* @param {number} [limit=1] If supplied, stop iterating after collecting this many objects.
|
|
402
|
+
* @returns {object[]} List of objects containing the picked primitives.
|
|
403
|
+
*
|
|
404
|
+
*/
|
|
405
|
+
Picking.prototype.pick = function (
|
|
406
|
+
scene,
|
|
407
|
+
windowPosition,
|
|
408
|
+
width,
|
|
409
|
+
height,
|
|
410
|
+
limit = 1,
|
|
411
|
+
) {
|
|
412
|
+
//>>includeStart('debug', pragmas.debug);
|
|
413
|
+
Check.defined("windowPosition", windowPosition);
|
|
414
|
+
//>>includeEnd('debug');
|
|
415
|
+
|
|
416
|
+
const { defaultView } = scene;
|
|
417
|
+
const { pickFramebuffer } = defaultView;
|
|
418
|
+
const drawingBufferRectangle = scratchRectangle;
|
|
419
|
+
pickBegin(scene, windowPosition, drawingBufferRectangle, width, height);
|
|
420
|
+
const pickedObjects = pickFramebuffer.end(drawingBufferRectangle, limit); // Object[]
|
|
421
|
+
pickEnd(scene);
|
|
422
|
+
return pickedObjects;
|
|
334
423
|
};
|
|
335
424
|
|
|
336
425
|
/**
|
|
@@ -711,39 +800,41 @@ Picking.prototype.pickPosition = function (scene, windowPosition, result) {
|
|
|
711
800
|
return result;
|
|
712
801
|
};
|
|
713
802
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
803
|
+
/**
|
|
804
|
+
* @param {object[]} pickedResults the results from the pickCallback
|
|
805
|
+
* @param {number} limit If supplied, stop drilling after collecting this many picks.
|
|
806
|
+
* @param {object[]} results
|
|
807
|
+
* @param {object[]} pickedPrimitives
|
|
808
|
+
* @param {object[]} pickedAttributes
|
|
809
|
+
* @param {object[]} pickedFeatures
|
|
810
|
+
* @returns {boolean} whether picking should end
|
|
811
|
+
*/
|
|
812
|
+
function addDrillPickedResults(
|
|
813
|
+
pickedResults,
|
|
814
|
+
limit,
|
|
815
|
+
results,
|
|
816
|
+
pickedPrimitives,
|
|
817
|
+
pickedAttributes,
|
|
818
|
+
pickedFeatures,
|
|
819
|
+
) {
|
|
820
|
+
for (const pickedResult of pickedResults) {
|
|
730
821
|
const object = pickedResult.object;
|
|
731
822
|
const position = pickedResult.position;
|
|
732
823
|
const exclude = pickedResult.exclude;
|
|
733
824
|
|
|
734
825
|
if (defined(position) && !defined(object)) {
|
|
735
|
-
|
|
736
|
-
|
|
826
|
+
results.push(pickedResult);
|
|
827
|
+
return true;
|
|
737
828
|
}
|
|
738
829
|
|
|
739
830
|
if (!defined(object) || !defined(object.primitive)) {
|
|
740
|
-
|
|
831
|
+
return true;
|
|
741
832
|
}
|
|
742
833
|
|
|
743
834
|
if (!exclude) {
|
|
744
|
-
|
|
745
|
-
if (
|
|
746
|
-
|
|
835
|
+
results.push(pickedResult);
|
|
836
|
+
if (results.length >= limit) {
|
|
837
|
+
return true;
|
|
747
838
|
}
|
|
748
839
|
}
|
|
749
840
|
|
|
@@ -753,7 +844,7 @@ function drillPick(limit, pickCallback) {
|
|
|
753
844
|
// If the picked object has a show attribute, use it.
|
|
754
845
|
if (typeof primitive.getGeometryInstanceAttributes === "function") {
|
|
755
846
|
if (defined(object.id)) {
|
|
756
|
-
attributes = primitive.getGeometryInstanceAttributes(object.id);
|
|
847
|
+
const attributes = primitive.getGeometryInstanceAttributes(object.id);
|
|
757
848
|
if (defined(attributes) && defined(attributes.show)) {
|
|
758
849
|
hasShowAttribute = true;
|
|
759
850
|
attributes.show = ShowGeometryInstanceAttribute.toValue(
|
|
@@ -776,28 +867,61 @@ function drillPick(limit, pickCallback) {
|
|
|
776
867
|
primitive.show = false;
|
|
777
868
|
pickedPrimitives.push(primitive);
|
|
778
869
|
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Drill pick by repeatedly calling a given `pickCallback`, each time stripping away the previously picked objects.
|
|
875
|
+
* @param {function(number): object[]} pickCallback Pick callback to execute each iteration
|
|
876
|
+
* @param {number} [limit=Number.MAX_VALUE] If supplied, stop drilling after collecting this many picks
|
|
877
|
+
* @returns {object[]} List of picked results
|
|
878
|
+
*/
|
|
879
|
+
function drillPick(pickCallback, limit) {
|
|
880
|
+
// PERFORMANCE_IDEA: This function calls each primitive's update for each pass. Instead
|
|
881
|
+
// we could update the primitive once, and then just execute their commands for each pass,
|
|
882
|
+
// and cull commands for picked primitives. e.g., base on the command's owner.
|
|
883
|
+
const results = [];
|
|
884
|
+
const pickedPrimitives = [];
|
|
885
|
+
const pickedAttributes = [];
|
|
886
|
+
const pickedFeatures = [];
|
|
887
|
+
if (!defined(limit)) {
|
|
888
|
+
limit = Number.MAX_VALUE;
|
|
889
|
+
}
|
|
779
890
|
|
|
780
|
-
|
|
891
|
+
let pickedResults = pickCallback(limit);
|
|
892
|
+
while (defined(pickedResults) && pickedResults.length > 0) {
|
|
893
|
+
const complete = addDrillPickedResults(
|
|
894
|
+
pickedResults,
|
|
895
|
+
limit,
|
|
896
|
+
results,
|
|
897
|
+
pickedPrimitives,
|
|
898
|
+
pickedAttributes,
|
|
899
|
+
pickedFeatures,
|
|
900
|
+
);
|
|
901
|
+
if (complete) {
|
|
902
|
+
break;
|
|
903
|
+
}
|
|
904
|
+
pickedResults = pickCallback(limit - results.length);
|
|
781
905
|
}
|
|
782
906
|
|
|
783
907
|
// Unhide everything we hid while drill picking
|
|
784
|
-
for (i = 0; i < pickedPrimitives.length; ++i) {
|
|
908
|
+
for (let i = 0; i < pickedPrimitives.length; ++i) {
|
|
785
909
|
pickedPrimitives[i].show = true;
|
|
786
910
|
}
|
|
787
911
|
|
|
788
|
-
for (i = 0; i < pickedAttributes.length; ++i) {
|
|
789
|
-
attributes = pickedAttributes[i];
|
|
912
|
+
for (let i = 0; i < pickedAttributes.length; ++i) {
|
|
913
|
+
const attributes = pickedAttributes[i];
|
|
790
914
|
attributes.show = ShowGeometryInstanceAttribute.toValue(
|
|
791
915
|
true,
|
|
792
916
|
attributes.show,
|
|
793
917
|
);
|
|
794
918
|
}
|
|
795
919
|
|
|
796
|
-
for (i = 0; i < pickedFeatures.length; ++i) {
|
|
920
|
+
for (let i = 0; i < pickedFeatures.length; ++i) {
|
|
797
921
|
pickedFeatures[i].show = true;
|
|
798
922
|
}
|
|
799
923
|
|
|
800
|
-
return
|
|
924
|
+
return results;
|
|
801
925
|
}
|
|
802
926
|
|
|
803
927
|
Picking.prototype.drillPick = function (
|
|
@@ -807,21 +931,22 @@ Picking.prototype.drillPick = function (
|
|
|
807
931
|
width,
|
|
808
932
|
height,
|
|
809
933
|
) {
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
934
|
+
const pickCallback = (limit) => {
|
|
935
|
+
const pickedObjects = this.pick(
|
|
936
|
+
scene,
|
|
937
|
+
windowPosition,
|
|
938
|
+
width,
|
|
939
|
+
height,
|
|
940
|
+
limit,
|
|
941
|
+
);
|
|
942
|
+
return pickedObjects.map((object) => ({
|
|
943
|
+
object: object,
|
|
944
|
+
position: undefined,
|
|
945
|
+
exclude: false,
|
|
946
|
+
}));
|
|
820
947
|
};
|
|
821
|
-
const objects = drillPick(
|
|
822
|
-
return objects.map(
|
|
823
|
-
return element.object;
|
|
824
|
-
});
|
|
948
|
+
const objects = drillPick(pickCallback, limit);
|
|
949
|
+
return objects.map((element) => element.object);
|
|
825
950
|
};
|
|
826
951
|
|
|
827
952
|
const scratchRight = new Cartesian3();
|
|
@@ -928,7 +1053,7 @@ function getTilesets(primitives, objectsToExclude, tilesets) {
|
|
|
928
1053
|
* @param {Picking} picking
|
|
929
1054
|
* @param {Scene} scene
|
|
930
1055
|
* @param {Ray} ray
|
|
931
|
-
* @param {
|
|
1056
|
+
* @param {object[] | undefined} objectsToExclude
|
|
932
1057
|
* @param {number | undefined} width
|
|
933
1058
|
* @param {Function} callback
|
|
934
1059
|
* @returns {Promise<Cartesian3 | undefined>}
|
|
@@ -1016,7 +1141,8 @@ function getRayIntersection(
|
|
|
1016
1141
|
scene.resolveFramebuffers(passState);
|
|
1017
1142
|
|
|
1018
1143
|
let position;
|
|
1019
|
-
|
|
1144
|
+
// Picking one object, result is either [object] or []
|
|
1145
|
+
const object = view.pickFramebuffer.end(drawingBufferRectangle, 1)[0];
|
|
1020
1146
|
|
|
1021
1147
|
if (scene.context.depthTexture) {
|
|
1022
1148
|
const { frustumCommandsList } = view;
|
|
@@ -1054,7 +1180,7 @@ function getRayIntersection(
|
|
|
1054
1180
|
}
|
|
1055
1181
|
}
|
|
1056
1182
|
|
|
1057
|
-
function
|
|
1183
|
+
function drillPickFromRay(
|
|
1058
1184
|
picking,
|
|
1059
1185
|
scene,
|
|
1060
1186
|
ray,
|
|
@@ -1065,7 +1191,7 @@ function getRayIntersections(
|
|
|
1065
1191
|
mostDetailed,
|
|
1066
1192
|
) {
|
|
1067
1193
|
const pickCallback = function () {
|
|
1068
|
-
|
|
1194
|
+
const pickResult = getRayIntersection(
|
|
1069
1195
|
picking,
|
|
1070
1196
|
scene,
|
|
1071
1197
|
ray,
|
|
@@ -1074,8 +1200,9 @@ function getRayIntersections(
|
|
|
1074
1200
|
requirePosition,
|
|
1075
1201
|
mostDetailed,
|
|
1076
1202
|
);
|
|
1203
|
+
return pickResult ? [pickResult] : undefined;
|
|
1077
1204
|
};
|
|
1078
|
-
return drillPick(
|
|
1205
|
+
return drillPick(pickCallback, limit);
|
|
1079
1206
|
}
|
|
1080
1207
|
|
|
1081
1208
|
function pickFromRay(
|
|
@@ -1087,7 +1214,8 @@ function pickFromRay(
|
|
|
1087
1214
|
requirePosition,
|
|
1088
1215
|
mostDetailed,
|
|
1089
1216
|
) {
|
|
1090
|
-
|
|
1217
|
+
// Use drillPickFromRay rather than getRayIntersection directly to select the first non-excluded object
|
|
1218
|
+
const results = drillPickFromRay(
|
|
1091
1219
|
picking,
|
|
1092
1220
|
scene,
|
|
1093
1221
|
ray,
|
|
@@ -1102,28 +1230,6 @@ function pickFromRay(
|
|
|
1102
1230
|
}
|
|
1103
1231
|
}
|
|
1104
1232
|
|
|
1105
|
-
function drillPickFromRay(
|
|
1106
|
-
picking,
|
|
1107
|
-
scene,
|
|
1108
|
-
ray,
|
|
1109
|
-
limit,
|
|
1110
|
-
objectsToExclude,
|
|
1111
|
-
width,
|
|
1112
|
-
requirePosition,
|
|
1113
|
-
mostDetailed,
|
|
1114
|
-
) {
|
|
1115
|
-
return getRayIntersections(
|
|
1116
|
-
picking,
|
|
1117
|
-
scene,
|
|
1118
|
-
ray,
|
|
1119
|
-
limit,
|
|
1120
|
-
objectsToExclude,
|
|
1121
|
-
width,
|
|
1122
|
-
requirePosition,
|
|
1123
|
-
mostDetailed,
|
|
1124
|
-
);
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
1233
|
function deferPromiseUntilPostRender(scene, promise) {
|
|
1128
1234
|
// Resolve promise after scene's postRender in case entities are created when the promise resolves.
|
|
1129
1235
|
// Entities can't be created between viewer._onTick and viewer._postRender.
|
|
@@ -1365,7 +1471,7 @@ function sampleHeightMostDetailed(
|
|
|
1365
1471
|
* @param {Picking} picking
|
|
1366
1472
|
* @param {Scene} scene
|
|
1367
1473
|
* @param {Cartesian3} cartesian
|
|
1368
|
-
* @param {
|
|
1474
|
+
* @param {object[]} [objectsToExclude]
|
|
1369
1475
|
* @param {number} [width]
|
|
1370
1476
|
* @param {Cartesian3} [result]
|
|
1371
1477
|
* @returns {Promise<Cartesian3 | undefined>}
|
|
@@ -1519,7 +1625,7 @@ Picking.prototype.sampleHeightMostDetailed = function (
|
|
|
1519
1625
|
* @private
|
|
1520
1626
|
* @param {Scene} scene
|
|
1521
1627
|
* @param {Cartesian3[]} cartesians
|
|
1522
|
-
* @param {
|
|
1628
|
+
* @param {object[]} [objectsToExclude]
|
|
1523
1629
|
* @param {number} [width]
|
|
1524
1630
|
* @returns {Promise<Array<Cartesian3 | undefined>>}
|
|
1525
1631
|
*/
|
|
@@ -90,7 +90,6 @@ function QuadtreePrimitive(options) {
|
|
|
90
90
|
this._removeHeightCallbacks = [];
|
|
91
91
|
|
|
92
92
|
this._tileToUpdateHeights = [];
|
|
93
|
-
this._lastTileIndex = 0;
|
|
94
93
|
this._updateHeightsTimeSlice = 2.0;
|
|
95
94
|
|
|
96
95
|
// If a culled tile contains _cameraPositionCartographic or _cameraReferenceFrameOriginCartographic, it will be marked
|
|
@@ -217,10 +216,8 @@ function invalidateAllTiles(primitive) {
|
|
|
217
216
|
for (let i = 0; i < levelZeroTiles.length; ++i) {
|
|
218
217
|
const tile = levelZeroTiles[i];
|
|
219
218
|
const customData = tile.customData;
|
|
220
|
-
const customDataLength = customData.length;
|
|
221
219
|
|
|
222
|
-
for (
|
|
223
|
-
const data = customData[j];
|
|
220
|
+
for (const data of customData) {
|
|
224
221
|
data.level = 0;
|
|
225
222
|
primitive._addHeightCallbacks.push(data);
|
|
226
223
|
}
|
|
@@ -513,7 +510,6 @@ function selectTilesForRendering(primitive, frameState) {
|
|
|
513
510
|
tilesToRender.length = 0;
|
|
514
511
|
|
|
515
512
|
// We can't render anything before the level zero tiles exist.
|
|
516
|
-
let i;
|
|
517
513
|
const tileProvider = primitive._tileProvider;
|
|
518
514
|
if (!defined(primitive._levelZeroTiles)) {
|
|
519
515
|
const tilingScheme = tileProvider.tilingScheme;
|
|
@@ -524,7 +520,7 @@ function selectTilesForRendering(primitive, frameState) {
|
|
|
524
520
|
const numberOfRootTiles = primitive._levelZeroTiles.length;
|
|
525
521
|
if (rootTraversalDetails.length < numberOfRootTiles) {
|
|
526
522
|
rootTraversalDetails = new Array(numberOfRootTiles);
|
|
527
|
-
for (i = 0; i < numberOfRootTiles; ++i) {
|
|
523
|
+
for (let i = 0; i < numberOfRootTiles; ++i) {
|
|
528
524
|
if (rootTraversalDetails[i] === undefined) {
|
|
529
525
|
rootTraversalDetails[i] = new TraversalDetails();
|
|
530
526
|
}
|
|
@@ -537,7 +533,6 @@ function selectTilesForRendering(primitive, frameState) {
|
|
|
537
533
|
|
|
538
534
|
primitive._occluders.ellipsoid.cameraPosition = frameState.camera.positionWC;
|
|
539
535
|
|
|
540
|
-
let tile;
|
|
541
536
|
const levelZeroTiles = primitive._levelZeroTiles;
|
|
542
537
|
const occluders =
|
|
543
538
|
levelZeroTiles.length > 1 ? primitive._occluders : undefined;
|
|
@@ -550,18 +545,28 @@ function selectTilesForRendering(primitive, frameState) {
|
|
|
550
545
|
|
|
551
546
|
const customDataAdded = primitive._addHeightCallbacks;
|
|
552
547
|
const customDataRemoved = primitive._removeHeightCallbacks;
|
|
553
|
-
const frameNumber = frameState.frameNumber;
|
|
554
548
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
549
|
+
customDataAdded.forEach((data) => {
|
|
550
|
+
const tile = levelZeroTiles.find((tile) =>
|
|
551
|
+
Rectangle.contains(tile.rectangle, data.positionCartographic),
|
|
552
|
+
);
|
|
553
|
+
if (tile) {
|
|
554
|
+
tile._addedCustomData.push(data);
|
|
560
555
|
}
|
|
556
|
+
});
|
|
561
557
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
558
|
+
customDataRemoved.forEach((data) => {
|
|
559
|
+
const tile = levelZeroTiles.find((tile) =>
|
|
560
|
+
Rectangle.contains(tile.rectangle, data.positionCartographic),
|
|
561
|
+
);
|
|
562
|
+
if (tile) {
|
|
563
|
+
tile._removedCustomData.push(data);
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
levelZeroTiles.forEach((tile) => tile.updateCustomData());
|
|
568
|
+
customDataAdded.length = 0;
|
|
569
|
+
customDataRemoved.length = 0;
|
|
565
570
|
|
|
566
571
|
const camera = frameState.camera;
|
|
567
572
|
|
|
@@ -577,8 +582,8 @@ function selectTilesForRendering(primitive, frameState) {
|
|
|
577
582
|
);
|
|
578
583
|
|
|
579
584
|
// Traverse in depth-first, near-to-far order.
|
|
580
|
-
for (i = 0
|
|
581
|
-
tile = levelZeroTiles[i];
|
|
585
|
+
for (let i = 0; i < levelZeroTiles.length; ++i) {
|
|
586
|
+
const tile = levelZeroTiles[i];
|
|
582
587
|
primitive._tileReplacementQueue.markTileRendered(tile);
|
|
583
588
|
if (!tile.renderable) {
|
|
584
589
|
queueTileLoad(primitive, primitive._tileLoadQueueHigh, tile, frameState);
|
|
@@ -596,7 +601,7 @@ function selectTilesForRendering(primitive, frameState) {
|
|
|
596
601
|
}
|
|
597
602
|
}
|
|
598
603
|
|
|
599
|
-
primitive._lastSelectionFrameNumber = frameNumber;
|
|
604
|
+
primitive._lastSelectionFrameNumber = frameState.frameNumber;
|
|
600
605
|
}
|
|
601
606
|
|
|
602
607
|
function queueTileLoad(primitive, queue, tile, frameState) {
|
|
@@ -716,7 +721,7 @@ function visitTile(
|
|
|
716
721
|
++debug.tilesVisited;
|
|
717
722
|
|
|
718
723
|
primitive._tileReplacementQueue.markTileRendered(tile);
|
|
719
|
-
tile.
|
|
724
|
+
tile.updateCustomData();
|
|
720
725
|
|
|
721
726
|
if (tile.level > debug.maxDepthVisited) {
|
|
722
727
|
debug.maxDepthVisited = tile.level;
|
|
@@ -1417,15 +1422,18 @@ function updateHeights(primitive, frameState) {
|
|
|
1417
1422
|
// Ensure stale position cache is cleared
|
|
1418
1423
|
tile.clearPositionCache();
|
|
1419
1424
|
tilesToUpdateHeights.shift();
|
|
1420
|
-
primitive._lastTileIndex = 0;
|
|
1421
1425
|
continue;
|
|
1422
1426
|
}
|
|
1423
1427
|
const customData = tile.customData;
|
|
1424
|
-
|
|
1428
|
+
if (!defined(tile._customDataIterator)) {
|
|
1429
|
+
tile._customDataIterator = customData.values();
|
|
1430
|
+
}
|
|
1431
|
+
const customDataIterator = tile._customDataIterator;
|
|
1425
1432
|
|
|
1426
1433
|
let timeSliceMax = false;
|
|
1427
|
-
|
|
1428
|
-
|
|
1434
|
+
let nextData;
|
|
1435
|
+
while (!(nextData = customDataIterator.next()).done) {
|
|
1436
|
+
const data = nextData.value;
|
|
1429
1437
|
|
|
1430
1438
|
// No need to run this code when the tile is upsampled, because the height will be the same as its parent.
|
|
1431
1439
|
const terrainData = tile.data.terrainData;
|
|
@@ -1543,10 +1551,10 @@ function updateHeights(primitive, frameState) {
|
|
|
1543
1551
|
}
|
|
1544
1552
|
|
|
1545
1553
|
if (timeSliceMax) {
|
|
1546
|
-
|
|
1554
|
+
tile._customDataIterator = customDataIterator;
|
|
1547
1555
|
break;
|
|
1548
1556
|
} else {
|
|
1549
|
-
|
|
1557
|
+
tile._customDataIterator = undefined;
|
|
1550
1558
|
tilesToUpdateHeights.shift();
|
|
1551
1559
|
}
|
|
1552
1560
|
}
|