@arcgis/core 5.2.0-next.20 → 5.2.0-next.22
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/Graphic.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0eb0ce43b4813cae968f.js +2 -0
- package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js → 162dada6a199d1efdf86.js} +2 -2
- package/assets/esri/core/workers/chunks/1a4bec464daa9662ab2a.js +1 -0
- package/assets/esri/core/workers/chunks/{b375abfb2a2d9c63e20a.js → 2255a21c7b959f04d941.js} +1 -1
- package/assets/esri/core/workers/chunks/292498a9c7d462d215c6.js +1 -0
- package/assets/esri/core/workers/chunks/2ef80e003b4f0393ac2e.js +1 -0
- package/assets/esri/core/workers/chunks/{4517630bf869205bab87.js → 38a76bc4ef5c10ab0488.js} +1 -1
- package/assets/esri/core/workers/chunks/3b4fc67f6cb7393fbd97.js +1 -0
- package/assets/esri/core/workers/chunks/{8ce4fe00328173224ed2.js → 44e32ed3a570593a7245.js} +1 -1
- package/assets/esri/core/workers/chunks/{db26cf2c2735183294b8.js → 50345dfc00380b158c96.js} +1 -1
- package/assets/esri/core/workers/chunks/5468a65698931603656d.js +1 -0
- package/assets/esri/core/workers/chunks/5b42f8aa0247adc2d065.js +1 -0
- package/assets/esri/core/workers/chunks/{d7acbc2ddff4cee8a465.js → 5ee887fc6e1e0e70e02f.js} +1 -1
- package/assets/esri/core/workers/chunks/66c2cfe11161d5dc989a.js +1 -0
- package/assets/esri/core/workers/chunks/6c0c77de1934f35dc45f.js +1 -0
- package/assets/esri/core/workers/chunks/{f7f820483e45c05ab9e4.js → 75df436e6e9773bdcfc2.js} +1 -1
- package/assets/esri/core/workers/chunks/780519b60aa674a61a74.js +1 -0
- package/assets/esri/core/workers/chunks/{a2247f4c3116efb16c4f.js → 7e23de8d9b2d938808f6.js} +1 -1
- package/assets/esri/core/workers/chunks/7fc8516111bd869256fc.js +1 -0
- package/assets/esri/core/workers/chunks/8579eba21f40630d073d.js +1 -0
- package/assets/esri/core/workers/chunks/{72edd08a2ff08970ba38.js → 87011d2fe14c54e296af.js} +1 -1
- package/assets/esri/core/workers/chunks/928b18e13e015330d44b.js +1 -0
- package/assets/esri/core/workers/chunks/93b40245378ced43ca08.js +1 -0
- package/assets/esri/core/workers/chunks/9434c76ad39c936dba90.js +1 -0
- package/assets/esri/core/workers/chunks/98dfe31e8ed9b522eaff.js +1 -0
- package/assets/esri/core/workers/chunks/{4104a0585969f8cd524c.js → a40ede4d3375184f21fe.js} +1 -1
- package/assets/esri/core/workers/chunks/a533d066cac26124c5ce.js +1 -0
- package/assets/esri/core/workers/chunks/a536904fe6f3b16fdbdc.js +1 -0
- package/assets/esri/core/workers/chunks/a54773c9bbc751619b3f.js +2 -0
- package/assets/esri/core/workers/chunks/a8167ab9fd846d699be5.js +1 -0
- package/assets/esri/core/workers/chunks/{dd0c1cf921369e2bc48b.js → a90619adff41658f8057.js} +1 -1
- package/assets/esri/core/workers/chunks/{ac16016964be3b684e98.js → aded4e704e09a28edc8f.js} +1 -1
- package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js → b0b3c67b7d37bd854d95.js} +2 -2
- package/assets/esri/core/workers/chunks/b419fd36337e76e2d4a3.js +680 -0
- package/assets/esri/core/workers/chunks/{05d597dd117766beadd8.js → b91a15522692781560b4.js} +1 -1
- package/assets/esri/core/workers/chunks/be4275a4b8977ec3eb61.js +1 -0
- package/assets/esri/core/workers/chunks/{e8d65900eefff1152207.js → c593539c2cce7a2b9d44.js} +1 -1
- package/assets/esri/core/workers/chunks/c86d388d216adbb15a05.js +1 -0
- package/assets/esri/core/workers/chunks/{0b522e05668bef729b1b.js → ceb5bd9f2afaa2ea0808.js} +1 -1
- package/assets/esri/core/workers/chunks/d07068c44d560e4ce02e.js +1 -0
- package/assets/esri/core/workers/chunks/{595bc41ff36c77324d01.js → d4e0346209fabc58f929.js} +9 -9
- package/assets/esri/core/workers/chunks/{5809e70a8e57e9b05959.js → dd795c95cdc3812b5b49.js} +1 -1
- package/assets/esri/core/workers/chunks/e29c8c10331edfa83277.js +1 -0
- package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js → ef94d25d1cceb25ea9fe.js} +2 -2
- package/assets/esri/core/workers/chunks/f02a9408ba3893484c6c.js +1 -0
- package/assets/esri/core/workers/chunks/f7344d855f1092383abe.js +1 -0
- package/assets/esri/core/workers/chunks/{5f63077ec5ba3560491b.js → fb9f8b6cc2b4ae5b60df.js} +1 -1
- package/assets/esri/core/workers/chunks/{ecbf84a1f42e6188faab.js → fd629872b5c07853f695.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/GaussianSplat.glsl.js +4 -4
- package/chunks/GaussianSplatShadow.glsl.js +1 -1
- package/chunks/Pattern.glsl.js +17 -17
- package/chunks/RibbonLine.glsl.js +45 -43
- package/chunks/bundle2.js +1 -1
- package/config.js +1 -1
- package/core/date.js +1 -1
- package/form/FormTemplate.d.ts +15 -20
- package/form/elements/AttachmentElement.d.ts +38 -11
- package/form/elements/Element.d.ts +9 -6
- package/form/elements/FieldElement.d.ts +0 -1
- package/form/elements/GroupElement.d.ts +4 -6
- package/form/elements/RelationshipElement.d.ts +8 -8
- package/form/elements/inputs/attachments/AttachmentInput.d.ts +34 -18
- package/form/elements/inputs/attachments/AudioInput.d.ts +4 -3
- package/form/elements/inputs/attachments/DocumentInput.d.ts +2 -6
- package/form/elements/inputs/attachments/ImageInput.d.ts +4 -3
- package/form/elements/inputs/attachments/Input.d.ts +6 -3
- package/form/elements/inputs/attachments/SignatureInput.d.ts +3 -3
- package/form/elements/inputs/attachments/VideoInput.d.ts +4 -3
- package/form/elements.d.ts +6 -12
- package/form/types.d.ts +0 -4
- package/geometry/support/geometryUtils.js +1 -1
- package/geometry/support/intersects.js +1 -1
- package/geometry/support/intersectsBase.js +1 -1
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +44 -0
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/DimensionFeatureLayer.d.ts +40 -0
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/DimensionLayer.d.ts +1 -0
- package/layers/FeatureLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.d.ts +9 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/ParquetLayer.d.ts +6 -10
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/data/attributeSupport.js +1 -1
- package/layers/graphics/data/queryValidationUtils.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
- package/layers/graphics/sources/parquet/fileProviderChangedError.js +2 -0
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/raster/datasets/WCSRaster.js +1 -1
- package/layers/support/AnnotationFeatureSublayer.d.ts +5 -3
- package/layers/support/RasterBandInfo.js +1 -1
- package/layers/support/SymbolLayerDrawing.js +1 -1
- package/layers/types.d.ts +1 -0
- package/package.json +2 -2
- package/rest/support/AttachmentQuery.d.ts +13 -1
- package/rest/support/AttachmentQuery.js +1 -1
- package/rest/support/OutDistance.d.ts +5 -1
- package/rest/support/PrintParameters.d.ts +2 -1
- package/rest/support/Query.d.ts +2 -0
- package/support/basemapUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/SimpleMarkerSymbol.d.ts +2 -2
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/views/2d/engine/AFeatureContainer.js +1 -1
- package/views/2d/engine/transitions/FadeTransition.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/TileCpuState.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerViewPerformanceInfo.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatHeaderTexture.js +2 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +11 -11
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +6 -9
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +46 -46
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +46 -18
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +22 -22
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +13 -12
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatShadowRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertexInfo.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferUtils.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTextureBuffer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js +2 -0
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +10 -10
- package/views/View2D.d.ts +2 -2
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/layers/AnnotationFeatureLayerView.d.ts +9 -1
- package/views/layers/DimensionFeatureLayerView.d.ts +9 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/types.d.ts +12 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.d.ts +16 -12
- package/widgets/FeatureForm.d.ts +14 -16
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/types.d.ts +20 -0
- package/widgets/FeatureTable.d.ts +14 -2
- package/widgets/FeatureTable.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
- package/widgets/OrientedImageryViewer/support/panConstraint.js +2 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Print/CustomTemplate.d.ts +7 -0
- package/widgets/Search/LayerSearchSource.d.ts +3 -0
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0a259137932211b80f0e.js +0 -1
- package/assets/esri/core/workers/chunks/26aa8190ac439f634c5b.js +0 -1
- package/assets/esri/core/workers/chunks/3192586ec7fc73ed1165.js +0 -1
- package/assets/esri/core/workers/chunks/35a508a9311689d8df52.js +0 -1
- package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +0 -1
- package/assets/esri/core/workers/chunks/4fdd38d7362bf09a994b.js +0 -1
- package/assets/esri/core/workers/chunks/501fa9b029df2e7b73c3.js +0 -2
- package/assets/esri/core/workers/chunks/5216dd0544e901039c84.js +0 -1
- package/assets/esri/core/workers/chunks/5f0bc019add4aff3130c.js +0 -1
- package/assets/esri/core/workers/chunks/630ad47857de3cf726d1.js +0 -1
- package/assets/esri/core/workers/chunks/6ac09f4e85c664a17365.js +0 -1
- package/assets/esri/core/workers/chunks/6e8b9c03240ec372b587.js +0 -1
- package/assets/esri/core/workers/chunks/74922daaedb479ec6f03.js +0 -1
- package/assets/esri/core/workers/chunks/764c8ba14ab74b66b391.js +0 -1
- package/assets/esri/core/workers/chunks/7ee76504e7fea389a1c9.js +0 -1
- package/assets/esri/core/workers/chunks/912a8743a02f467b63b0.js +0 -2
- package/assets/esri/core/workers/chunks/9def4619d102f1d41578.js +0 -1
- package/assets/esri/core/workers/chunks/a0876a52a3c2ad849370.js +0 -1
- package/assets/esri/core/workers/chunks/a3c5b754a6fa0f4250bf.js +0 -1
- package/assets/esri/core/workers/chunks/a98905bf6050ad3b8721.js +0 -633
- package/assets/esri/core/workers/chunks/bf67e0f6064fb9d94ac8.js +0 -1
- package/assets/esri/core/workers/chunks/c9e5d3f496cefb8e3934.js +0 -1
- package/assets/esri/core/workers/chunks/cd892f429d5ffe8de99e.js +0 -1
- package/assets/esri/core/workers/chunks/d34d41a350facfa9b7c0.js +0 -1
- package/assets/esri/core/workers/chunks/d5a0e3a73df827dc7b06.js +0 -1
- package/assets/esri/core/workers/chunks/e5471373f89fd7cb9844.js +0 -1
- package/assets/esri/core/workers/chunks/ff00ac01f0baaecaa890.js +0 -1
- /package/assets/esri/core/workers/chunks/{912a8743a02f467b63b0.js.LICENSE.txt → 0eb0ce43b4813cae968f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js.LICENSE.txt → 162dada6a199d1efdf86.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js.LICENSE.txt → a54773c9bbc751619b3f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js.LICENSE.txt → b0b3c67b7d37bd854d95.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{501fa9b029df2e7b73c3.js.LICENSE.txt → ef94d25d1cceb25ea9fe.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as r,asinClamped as o}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as a,exactEquals as s,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as u,create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{length as h,dot as M,subtract as g,normalize as y,squaredDistance as d,copy as b,transformMat4 as x,add as j,distance as v,cross as P,scale as
|
|
2
|
+
import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as r,asinClamped as o}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as a,exactEquals as s,rotate as c,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as u,create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{length as h,dot as M,subtract as g,normalize as y,squaredDistance as d,copy as b,transformMat4 as x,add as j,distance as v,cross as P,scale as w,lerp as z,set as I}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as A,axis as H,fromPoints as S,wrapAxisAngle as T}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as U,vectorCoordinates as G}from"../../../../geometry/support/coordinateSystem.js";import{create as k,fromNormalAndOffset as E,intersectRay as F,projectVector as q}from"../../../../geometry/support/plane.js";import{Sphere as C}from"../../../../geometry/support/sphere.js";import{sm4d as O,sv3d as W}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as B,fromScreen as D}from"../../support/geometryUtils/ray.js";import{intersectScreen as J}from"../../support/geometryUtils/sphere.js";import K from"../../webgl/RenderCamera.js";import{terrainId as L}from"../../webgl-engine/lib/verticalOffsetUtils.js";const N=30,Q=[1,3e8],V=8,X=[200,1508e5],Y=5,Z=50,$=5,_=10,tt=80,et=90,nt=1e-6,rt={exclude:new Set([L])};function ot(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function it(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function at(t,e,n){const r=a(O.get(),n[3],H(n));null==r||s(r,u)||(g(ye,t.eye,e),x(ye,ye,r),t.eye=j(ye,ye,e),g(ye,t.center,e),x(ye,ye,r),t.center=j(ye,ye,e),t.up=x(ye,t.up,r))}function st(t,e,n,r){return F(t,D(e,n,Pe),r)}function ct(t,e,n,r){return F(t,B(e,n,Pe),r)}function lt(t,e,n,r){const o=W.get();let i=1-n;g(o,e,t.eye);const a=h(o);let s=a*(1-i);i>=0&&s<r&&(s=r,i=-(s-a)/a),Math.abs(a-s)<nt||(w(o,o,i),t.eye=j(ye,t.eye,o),t.center=z(ye,t.center,e,i))}function ut(t,e,n){e.getScreenCenter(mt),J(t,e,mt,ye)&&(e.center=ye);const r=e.distance,o=r*n;if(Math.abs(r-o)<nt)return;const i=w(W.get(),e.viewForward,o);e.eye=g(ye,e.center,i)}const mt=i();function ft(t,e){I(e,0,0,0);for(const n of t)j(e,e,n);w(e,e,1/t.length)}function pt(t,e,n,r){return Math.sin(t/h(e))*(n+r.radius)}function ht(t,e,n,r){return pt(Math.PI/2,e,n,r)+(t-Math.PI/2)}const Mt={Elevation:3e4,Angle:e(16)},gt=.05,yt=12,dt=12,bt=e(80);function xt(t,e,n,r,o,i){const a=R(),s=new C;let c=!0,l=!0;const{eye:u}=e;return t.intersectScreen(n,a,i)&&ne(u,a,r)?s.radius=h(a):(l=!1,e.aboveGround&&0!==o?s.radius=Math.max(h(e.center),.9*r):s.radius=h(e.eye)-e.relativeElevation,1===o?wt(s,e,n,a):c=J(s,e,n,a)),{sphere:s,scenePickPoint:c?a:null,hasGeometryIntersection:l}}function jt(t,e,n,r){const o=t.relativeElevation;if(o>Mt.Elevation&&"global"===r)return 1;B(t,e,we);const i=Math.sign(o),a=n.worldUpAtPosition(t.eye,ye);return-i*M(a,we.direction)<Math.sin(Mt.Angle)*h(we.direction)?0:1}function vt(t,e,n){g(Pt,n,e),t.eye=g(ye,t.eye,Pt),t.center=g(ye,t.center,Pt)}const Pt=R();function wt(t,e,n,r){const o=B(e,n,Pe);return null!=o&&(t.closestPointOnSilhouette(o,zt),t.intersectRay(o,r)?!(d(zt,o.origin)<d(r,o.origin))||(b(r,zt),!1):(g(It,e.eye,e.center),y(It,It),E(It,-M(y(It,It),zt),Rt),F(Rt,o,r),!1))}const zt=R(),It=R(),Rt=k();function At(t,e){const n=t.fullHeight/t.pixelRatio,r=e(0),o=e(n);if(r||!o)return null;let i=0,a=n;for(let s=0;s<dt;s++){const t=.5*(i+a);e(t)?a=t:i=t}return a}const Ht=R(),St=R(),Tt=i();function Ut(t,e){return q(e,t.viewForward,Ht),j(St,t.eye,Ht),t.projectToScreen(St,Tt),Tt[1]}function Gt(t,e,n){return e?t>n:t<n}function kt(t,e){const n=t.fullHeight/t.pixelRatio,r=Math.max(e,n-e);return Math.max(yt,gt*r)}function Et(t,e){const n=t.fullHeight/t.pixelRatio;return Math.min(n,e+kt(t,e))}function Ft(t,e){return Math.max(0,e-kt(t,e))}function qt(t,e,n,r){return ze[0]=n,ze[1]=r,t.intersectRay(B(e,ze,Pe),ye)}function Ct(t,e,n,r){return ze[0]=n,ze[1]=r,F(t,B(e,ze,Pe),ye)}function Ot(i,a,s,c,l,u){let m=0;if(P(xe,i,a),g(de,i,a),h(i)<=l||!c.aboveGround){P(s,de,c.eye);const f=M(i,a)/(h(i)*h(a));if(f<.9999)m=r(f);else{const t=h(P(R(),i,a))/(h(i)*h(a));m=o(t)}const p=Math.cos(n(t.normalize(e(u)),0,bt));m=-m-Math.max(0,h(a)-l)/(p*l)}else g(Wt,c.eye,c.center),P(s,de,Wt),m=-h(de)/l;return y(s,s),w(s,s,h(xe)),m}const Wt=R();function Bt(o,i,a,s){let c,l;const u=Math.cos(n(t.normalize(e(s)),0,bt));return c=i>a?-(i-a)/(u*a):i<-a?Math.PI-(i+a)/(u*a):r(i/a),l=o>a?-(o-a)/(u*a):o<-a?Math.PI-(o+a)/(u*a):r(o/a),(l-c)*a}function Dt(t,e,n,r,o,i,a,s,c,l){const u=Bt(t[2],e[2],i.radius,s),m=c?Bt(t[0],e[0],i.radius,180):e[0]-t[0],p=Math.sin(a)*m-Math.cos(a)*u,h=Math.cos(a)*m+Math.sin(a)*u;y(ye,o);const g=c?p/Math.sqrt(Math.abs(i.radius**2-M(n,ye)**2)):p/i.radius,d=h/Math.sqrt(Math.abs(i.radius**2-M(n,r)**2));f(l,g,d)}function Jt(t,e,n,r,o,i,a,s,c,l){P(xe,t,e),U(i.up,i.eye,ae,se,ce),U([0,0,1],i.eye,re,oe,ie),b(n,oe),b(r,re),y(n,n),w(n,n,h(xe)),G(t,y(se,se),y(ce,ce),y(ae,ae),le),G(e,se,ce,ae,ue),Dt(le,ue,t,re,oe,a,s,c,l,o)}function Kt(t,e,n,r,o,i,s){a(pe,o,r),a(he,s,i),l(Me,pe,he),g(e,t,n),x(e,e,Me),j(e,e,n)}function Lt(t,e,n,r,o,i){a(pe,r,n),a(he,i,o),l(Me,pe,he),g(ye,t.eye,e),x(ye,ye,Me),t.eye=j(ye,ye,e),g(ye,t.center,e),x(ye,ye,Me),t.center=j(ye,ye,e),g(ye,t.up,e),x(ye,ye,Me),t.up=j(ye,ye,e)}const Nt={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let Qt=!1;function Vt(t,e,n,r,o,i){const a=Math.abs(r)>Math.PI-Nt.Angle||Math.abs(r)<Nt.Angle,s=(Math.abs(t[2])<n*Nt.Pole||Math.abs(e)>n)&&i;return a&&s?!Qt&&o<Nt.Tilt-Nt.TiltHysteresisMargin?Qt=!0:Qt&&o>Nt.Tilt+Nt.TiltHysteresisMargin&&(Qt=!1):Qt=!1,Qt}function Xt(t,e,n,r,o,i){if(i)S(n,r,fe),at(e,t.center,fe);else{const i=Ot(n,r,je,e,t.radius,o);at(e,t.center,T(je,i))}}function Yt(t,e,n,r,o,i,a){const s=a?20:1,c=1e-12;let l,u;b(ge,r),be.copyFrom(e);for(let m=0;m<s&&d(n,ge)>c&&(l=d(n,ge),Jt(n,ge,oe,re,me,be,t,o,i,a),Lt(be,t.center,re,me[1],oe,me[0]),Kt(ge,ge,t.center,re,me[1],oe,me[0]),u=d(n,ge),u<l||0===m);m++)e.copyFrom(be)}function Zt(n,r,o,i,a,s,c){Vt(o,M(r.up,o),n.radius,-t.normalize(e(a)),s,r.aboveGround)?Yt(n,r,o,i,-t.normalize(e(a)),s,c):Xt(n,r,o,i,s,c)}function $t(t,e,n,r,o,i){const{eye:a}=t;U([0,0,1],a,re,oe,ie);const s=e.translation[0]*n.pan,l="zoom"===o.mode?0:e.translation[1]*n.pan,u=Math.max(Math.sqrt(Math.abs(1-M(t.center,re)**2/h(t.center)**2)),.5),m=(Math.sin(i)*l+Math.cos(i)*s)/u,f=-Math.cos(i)*l+Math.sin(i)*s;switch(c(r.pan.matrix,r.pan.matrix,m,re),r.pan.enabled=!0,o.mode){case"pan":c(r.pan.matrix,r.pan.matrix,f,oe),r.pan.enabled=!0;break;case"zoom":r.zoom=-e.translation[1]*n.zoom}}function _t(t,e,n,r,o){const{eye:i,viewRight:a}=t,s=P(W.get(),a,i),l=e.translation[0]*n.pan;switch(0!==l&&(c(r.pan.matrix,r.pan.matrix,-l,s),r.pan.enabled=!0),o.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(r.pan.matrix,r.pan.matrix,t,a),r.pan.enabled=!0);break}case"zoom":r.zoom=-e.translation[1]*n.zoom}}function te(n,r,o,i,a,s,c,l,u){Vt(n.center,M(n.up,n.center),h(n.center),-t.normalize(e(s)),c,r.aboveGround)?$t(r,o,i,l,u,-t.normalize(e(a))):_t(r,o,i,l,u)}function ee(t,e,n=1/0){const r=Math.abs(M(t,e));return Math.min(n,1/r)}function ne(t,e,n){const r=v(t,e),o=h(t);return r<Math.max(o,n)}const re=R(),oe=R(),ie=R(),ae=R(),se=R(),ce=R(),le=R(),ue=R(),me=p(),fe=A(),pe=m(),he=m(),Me=m(),ge=R(),ye=R(),de=R();let be=new K;const xe=R(),je=R();function ve(){be=new K}const Pe={origin:R(),direction:R()},we={origin:R(),direction:R()},ze=i();export{bt as TiltThresholdPanningSpeed,Mt as VerticalPanTresholds,vt as applyPanPlanar,Xt as applyPanSphericalDirectRotation,Yt as applyPanSphericalPreserveHeading,at as applyRotation,Lt as applyRotationWithTwoAxes,ut as applyZoomOnSphere,lt as applyZoomToPoint,ft as centroid,ve as cleanupNavigationUtils,Ft as computeHorizonDownLimitScreenY,kt as computeHorizonPadding,Et as computeHorizonUpLimitScreenY,nt as distanceComparisonTolerance,rt as excludeTerrain,At as findHorizonScreenY,Ut as findPlaneHorizonY,ee as getTiltScaleFactor,jt as inferNavigationMode,st as intersectPlaneFromScreenPoint,ct as intersectPlaneFromScreenPointAtEye,Ct as intersectsPlaneAtScreenPoint,qt as intersectsSphereAtScreenPoint,ne as isHitOnSamePlanetSide,Bt as lengthFromPoints,Y as maxPanDistanceModifier,$ as maxRotatePivotDistanceModifier,N as maxZoomPivotDistanceModifier,V as maxZoomStepDistanceModifier,Z as minPinchAndPanCameraHeight,_ as minRotatePivotDistance,ot as normalizeCoordinate,it as normalizeRotationDelta,ht as offSurfaceTiltToEyeTiltGlobal,pt as onSurfaceTiltToEyeTiltGlobal,te as panMotionToRotationMatrix,Zt as panToPosition,xt as pickPointAndInitSphere,tt as pivotSearchAreaSize,Nt as preservingHeadingThresholds,gt as relativeHorizonPanPadding,et as rotatePivotSearchAreaSize,Kt as rotatePointAroundTwoAxes,Ot as rotationAngleAndAxisDirectRotation,Jt as rotationAnglesAndAxesHeadingPreserving,Dt as rotationAnglesHeadingPreserving,Gt as shouldClampScreenY,Vt as shouldPreserveHeading,wt as sphereOrPlanePointFromScreenPoint,Q as zoomPivotDistanceClamp,X as zoomStepDistanceClamp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const t=4096,s=64,e=
|
|
2
|
+
const t=4096,s=64,e=1024,i=t*s/e,n=4,r=e*n,o=t*s;class h{constructor(t=i){this._pageCount=t;const s=Math.ceil(t/32);this._bitset=new Uint32Array(s)}get pageCount(){return this._pageCount}isAllocated(t){const s=t/32|0,e=t%32;return!!(this._bitset[s]&1<<e)}allocate(t){const s=t/32|0,e=t%32;this._bitset[s]|=1<<e}free(t){const s=t/32|0,e=t%32;this._bitset[s]&=~(1<<e)}findFirstFreePage(){for(let t=0;t<this._bitset.length;t++)if(4294967295!==this._bitset[t])for(let s=0;s<32;s++){const e=32*t+s;if(e>=this._pageCount)break;if(!(this._bitset[t]&1<<s))return e}return null}resize(t){this._pageCount=t;const s=Math.ceil(t/32),e=this._bitset.length;if(s!==e){const t=new Uint32Array(s),i=Math.min(e,s);t.set(this._bitset.subarray(0,i)),this._bitset=t}this._clearExcessBits(this._bitset,t)}_clearExcessBits(t,s){const e=Math.floor((s-1)/32),i=(s-1)%32;if(s>0&&i<31){const s=(1<<i+1)-1;t[e]&=s}e+1<t.length&&t.fill(0,e+1)}}export{h as GaussianSplatAtlasPages,e as gaussiansPerPage,s as initialSplatAtlasTextureHeight,i as initialSplatAtlasTexturePages,o as minExpectedGaussianCount,n as packedGaussianSizeInU32,t as splatAtlasTextureWidth,r as splatPageSizeInU32};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{abortMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as s}from"../../../../core/memoryEstimations.js";import{isAbortError as i}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{Milliseconds as o,now as a}from"../../../../core/time.js";import{exactEquals as n,copy as l,normalize as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,exactEquals as _,intersects as c,copy as p}from"../../../../geometry/support/aaBoundingBox.js";import{makeScheduleFunction as f}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as m}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as g}from"./GaussianSplatFadeTexture.js";import{GaussianSplatOrderTexture as T}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as b}from"./GaussianSplatTextureAtlas.js";import{DepthRange as S}from"../../webgl-engine/lib/DepthRange.js";import{TaskPriority as y}from"../../../support/Scheduler.js";class C{constructor(e,t,s){this._updating=r(!1),this._useDeterministicSort=!1,this._sortBufferMemory=0,this.visibleGaussians=0,this._visibleTileDepthRange=new S,this._previousVisibleTileDepthRangeEye=u(),this._previousVisibleTileDepthRangeViewForward=u(),this._previousVisibleTileDepthRangeClippingBox=d(),this._latestSortedGaussianTilesVersion=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._previousVisibleTileDepthRangeHasClippingBox=!1,this._bufferCapacity=0,this._requestedLyr3dVisibilityChange=0,this._latestCompletedLyr3dVisibilityChange=0,this._latestUpdatedGaussianTiles=new Array,this._latestSortedGaussianTiles=new Array,this._nextCommittedVisibleGaussianTiles=new Array,this._cameraDirectionNormalized=u(),this._frameTask=null,this._workerHandle=null,this._sortAbortController=null,this._isSorting=!1,this._pendingSortTask=!1,this._scheduledSortStartTimeout=null,this._lastSortStartTime=o(-1/0),this._sortInterval=o(80),this._renderer=e,this._onSortComplete=t,this._orderTexture=new T(this._renderer.renderingContext),this._fadingTexture=new g(this._renderer.renderingContext),this._textureAtlas=new b(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache,s);const{resourceController:i}=this._renderer.view;this._workerHandle=new m(f(i)),this._frameTask=i.scheduler.registerTask(y.GAUSSIAN_SPLAT_SORTING)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get textureAtlasMemory(){return this._textureAtlas.usedMemory}get orderTextureMemory(){return this._orderTexture.usedMemory}get fadingTextureMemory(){return this._fadingTexture.usedMemory}get sortBufferMemory(){return this._sortBufferMemory}get usedMemory(){return this.textureAtlasMemory+this.orderTextureMemory+this.fadingTextureMemory+this.sortBufferMemory}queryVisibleTileDepthRange(e,t){if(0===this.visibleGaussians)return null;const{eye:s,viewForward:i}=e,r=s[0],o=s[1],a=s[2],h=i[0],u=i[1],d=i[2],f=this._visibleTileDepthRange;if(this._previousVisibleTileDepthRangeTilesVersion===this._latestSortedGaussianTilesVersion&&n(this._previousVisibleTileDepthRangeEye,s)&&n(this._previousVisibleTileDepthRangeViewForward,i)&&(null==t?!this._previousVisibleTileDepthRangeHasClippingBox:this._previousVisibleTileDepthRangeHasClippingBox&&_(this._previousVisibleTileDepthRangeClippingBox,t)))return f.near<=f.far?f:null;let m=1/0,g=-1/0;const T=this._latestSortedGaussianTiles;for(let n=0;n<T.length;n++){const e=T[n];if(null!=t){const s=e.boundingBox;if(!c(s,t))continue}const s=h*(e.obbCenterX-r)+u*(e.obbCenterY-o)+d*(e.obbCenterZ-a),i=e.paddedMbsRadius,l=s-i;l<m&&(m=l);const _=s+i;_>g&&(g=_)}const b=m<=g;return b?f.set(m,g):f.set(1/0,-1/0),this._previousVisibleTileDepthRangeTilesVersion=this._latestSortedGaussianTilesVersion,this._previousVisibleTileDepthRangeHasClippingBox=null!=t,l(this._previousVisibleTileDepthRangeEye,s),l(this._previousVisibleTileDepthRangeViewForward,i),null!=t&&p(this._previousVisibleTileDepthRangeClippingBox,t),b?f:null}updateGaussianVisibility(e,t){this._latestUpdatedGaussianTiles=e,this._requestedLyr3dVisibilityChange=t,this.requestSort()}get updating(){return this._updating.value}destroy(){this._sortAbortController=t(this._sortAbortController),this._pendingSortTask=!1,this._updating.value=!1,null!=this._scheduledSortStartTimeout&&(clearTimeout(this._scheduledSortStartTimeout),this._scheduledSortStartTimeout=null),this._frameTask.remove(),this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){return this._updating.value=!0,!this._pendingSortTask&&(this._pendingSortTask=!0,this._scheduleSortStart(),!0)}_scheduleSortStart(){if(this._isSorting)return;const e=a()-this._lastSortStartTime,t=this._sortInterval-e;t<=0?this._startSortIfRequired():null==this._scheduledSortStartTimeout&&(this._scheduledSortStartTimeout=setTimeout(()=>{this._scheduledSortStartTimeout=null,this._pendingSortTask&&!this._isSorting&&this._scheduleSortStart()},t))}_startSortIfRequired(){if(this._isSorting||!this._pendingSortTask)return;const e=new AbortController;this._sortAbortController=e,this._isSorting=!0,this._pendingSortTask=!1,this._lastSortStartTime=a(),this._sortOnWorker(e.signal).finally(()=>{this._sortAbortController===e&&(this._sortAbortController=null),this._handleSortComplete()})}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this._scheduleSortStart():this._updating.value=!1}_clearBuffersAndTextures(){this._atlasIndicesBuffer=void 0,this._sortedAtlasIndicesBuffer=void 0,this._distancesBuffer=void 0,this._bufferCapacity=0,this._sortBufferMemory=0,this._orderTexture.clear(),this._textureAtlas.clear()}_computeExpandedCapacity(t,s){let i=Math.max(1,t);for(;i<s;)i=Math.ceil(i*e);return i}_ensureSortBufferCapacities(e){if(this._bufferCapacity<e){const t=this._computeExpandedCapacity(this._bufferCapacity,e);this._atlasIndicesBuffer=new Uint32Array(t),this._sortedAtlasIndicesBuffer=new Uint32Array(t),this._distancesBuffer=new Float64Array(t),this._bufferCapacity=t,this._sortBufferMemory=s(this._atlasIndicesBuffer,this._sortedAtlasIndicesBuffer,this._distancesBuffer)}}_clearAllBuffersAndTextures(){this._clearBuffersAndTextures(),this._latestSortedGaussianTiles.length=0,this._nextCommittedVisibleGaussianTiles.length=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._workerHandle?.clear()}async _sortOnWorker(e){try{if(0===this._latestUpdatedGaussianTiles.length)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=this._requestedLyr3dVisibilityChange,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);this._useDeterministicSort&&this._latestUpdatedGaussianTiles.sort((e,t)=>e.obb.centerX-t.obb.centerX||e.obb.centerY-t.obb.centerY||e.obb.centerZ-t.obb.centerZ);const t=this._latestUpdatedGaussianTiles,s=t.length,i=this._requestedLyr3dVisibilityChange;let r=0;for(let e=0;e<s;e++)r+=t[e].gaussianCount;this._ensureSortBufferCapacities(r),this._textureAtlas.ensureTextureAtlas();const o=this._renderer.camera;h(this._cameraDirectionNormalized,o.ray.direction);const a=this._cameraDirectionNormalized[0],n=this._cameraDirectionNormalized[1],l=this._cameraDirectionNormalized[2];let u=0;const d=this._atlasIndicesBuffer,_=this._distancesBuffer,p=this._renderer.clippingBox,f=this._nextCommittedVisibleGaussianTiles;f.length=0;let m=0;const{frustum:g}=o,T=this._renderer.tileCullingRevision,b=g[0],S=g[1],y=g[2],C=g[3],x=g[4],V=g[5];for(let e=0;e<s;e++){const s=t[e],{gaussianAtlasIndices:i,relativePositions:r,obbCenterX:o,obbCenterY:h,obbCenterZ:g,paddedMbsRadius:v}=s,A=s.gaussianCount;if(s.cullingRevision!==T){let e=null==p||c(s.boundingBox,p);if(e){const t=1.5*v;e=b[0]*o+b[1]*h+b[2]*g+b[3]<t&&S[0]*o+S[1]*h+S[2]*g+S[3]<t&&y[0]*o+y[1]*h+y[2]*g+y[3]<t&&C[0]*o+C[1]*h+C[2]*g+C[3]<t&&x[0]*o+x[1]*h+x[2]*g+x[3]<t&&V[0]*o+V[1]*h+V[2]*g+V[3]<t}s.cullingRevision=T,s.cullingVisible=e}if(!s.cullingVisible)continue;d.set(i,u),f[m++]=s;const B=a*o+n*h+l*g,G=u+A;for(let e=u,t=0;e<G;e++,t+=3){const s=r[t],i=r[t+1],o=r[t+2];_[e]=s*a+i*n+o*l+B}u=G}if(f.length=m,0===u)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=i,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);const v={distances:this._distancesBuffer,atlasIndices:this._atlasIndicesBuffer,sortedAtlasIndices:this._sortedAtlasIndicesBuffer,numGaussians:u,preciseSort:this._useDeterministicSort},A=await(this._workerHandle?.sort(v,e));if(e.aborted)return;A&&(this._distancesBuffer=A.distances,this._atlasIndicesBuffer=A.atlasIndices,this._sortedAtlasIndicesBuffer=A.sortedAtlasIndices);const B=async e=>{this._orderTexture.setData(this._sortedAtlasIndicesBuffer,u);const t=this._latestSortedGaussianTiles;this._latestSortedGaussianTiles=f,this._nextCommittedVisibleGaussianTiles=t,this._latestSortedGaussianTilesVersion++,this._latestCompletedLyr3dVisibilityChange=i,this.visibleGaussians=u,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),this._renderer.requestRender(1),e.madeProgress()};await this._frameTask.schedule(B,e)}catch(t){if(i(t))return}}set useDeterministicSort(e){this._useDeterministicSort=e}}export{C as GaussianSplatDataStore};
|
|
2
|
+
import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{abortMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as s}from"../../../../core/memoryEstimations.js";import{isAbortError as i}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{Milliseconds as a,now as o}from"../../../../core/time.js";import{exactEquals as n,copy as l,normalize as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,exactEquals as _,intersects as c,copy as p}from"../../../../geometry/support/aaBoundingBox.js";import{makeScheduleFunction as f}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as m}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as g}from"./GaussianSplatFadeTexture.js";import{GaussianSplatHeaderTexture as T}from"./GaussianSplatHeaderTexture.js";import{GaussianSplatOrderTexture as b}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as S}from"./GaussianSplatTextureAtlas.js";import{DepthRange as y}from"../../webgl-engine/lib/DepthRange.js";import{TaskPriority as x}from"../../../support/Scheduler.js";class C{constructor(e,t,s){this._updating=r(!1),this._useDeterministicSort=!1,this._sortBufferMemory=0,this.visibleGaussians=0,this._visibleTileDepthRange=new y,this._previousVisibleTileDepthRangeEye=u(),this._previousVisibleTileDepthRangeViewForward=u(),this._previousVisibleTileDepthRangeClippingBox=d(),this._latestSortedGaussianTilesVersion=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._previousVisibleTileDepthRangeHasClippingBox=!1,this._bufferCapacity=0,this._requestedLyr3dVisibilityChange=0,this._latestCompletedLyr3dVisibilityChange=0,this._latestUpdatedGaussianTiles=new Array,this._latestSortedGaussianTiles=new Array,this._nextCommittedVisibleGaussianTiles=new Array,this._cameraDirectionNormalized=u(),this._frameTask=null,this._workerHandle=null,this._sortAbortController=null,this._isSorting=!1,this._pendingSortTask=!1,this._scheduledSortStartTimeout=null,this._lastSortStartTime=a(-1/0),this._sortInterval=a(80),this._renderer=e,this._onSortComplete=t,this._orderTexture=new b(this._renderer.renderingContext),this._fadingTexture=new g(this._renderer.renderingContext),this._headerTexture=new T(this._renderer.renderingContext),this._textureAtlas=new S(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache,s);const{resourceController:i}=this._renderer.view;this._workerHandle=new m(f(i)),this._frameTask=i.scheduler.registerTask(x.GAUSSIAN_SPLAT_SORTING)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get headerTexture(){return this._headerTexture}get textureAtlasMemory(){return this._textureAtlas.usedMemory}get orderTextureMemory(){return this._orderTexture.usedMemory}get fadingTextureMemory(){return this._fadingTexture.usedMemory}get headerTextureMemory(){return this._headerTexture.usedMemory}get sortBufferMemory(){return this._sortBufferMemory}get usedMemory(){return this.textureAtlasMemory+this.headerTextureMemory+this.orderTextureMemory+this.fadingTextureMemory+this.sortBufferMemory}queryVisibleTileDepthRange(e,t){if(0===this.visibleGaussians)return null;const{eye:s,viewForward:i}=e,r=s[0],a=s[1],o=s[2],h=i[0],u=i[1],d=i[2],f=this._visibleTileDepthRange;if(this._previousVisibleTileDepthRangeTilesVersion===this._latestSortedGaussianTilesVersion&&n(this._previousVisibleTileDepthRangeEye,s)&&n(this._previousVisibleTileDepthRangeViewForward,i)&&(null==t?!this._previousVisibleTileDepthRangeHasClippingBox:this._previousVisibleTileDepthRangeHasClippingBox&&_(this._previousVisibleTileDepthRangeClippingBox,t)))return f.near<=f.far?f:null;let m=1/0,g=-1/0;const T=this._latestSortedGaussianTiles;for(let n=0;n<T.length;n++){const e=T[n];if(null!=t){const s=e.boundingBox;if(!c(s,t))continue}const s=h*(e.obbCenterX-r)+u*(e.obbCenterY-a)+d*(e.obbCenterZ-o),i=e.paddedMbsRadius,l=s-i;l<m&&(m=l);const _=s+i;_>g&&(g=_)}const b=m<=g;return b?f.set(m,g):f.set(1/0,-1/0),this._previousVisibleTileDepthRangeTilesVersion=this._latestSortedGaussianTilesVersion,this._previousVisibleTileDepthRangeHasClippingBox=null!=t,l(this._previousVisibleTileDepthRangeEye,s),l(this._previousVisibleTileDepthRangeViewForward,i),null!=t&&p(this._previousVisibleTileDepthRangeClippingBox,t),b?f:null}updateGaussianVisibility(e,t){this._latestUpdatedGaussianTiles=e,this._requestedLyr3dVisibilityChange=t,this.requestSort()}get updating(){return this._updating.value}destroy(){this._sortAbortController=t(this._sortAbortController),this._pendingSortTask=!1,this._updating.value=!1,null!=this._scheduledSortStartTimeout&&(clearTimeout(this._scheduledSortStartTimeout),this._scheduledSortStartTimeout=null),this._frameTask.remove(),this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._headerTexture.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){return this._updating.value=!0,!this._pendingSortTask&&(this._pendingSortTask=!0,this._scheduleSortStart(),!0)}_scheduleSortStart(){if(this._isSorting)return;const e=o()-this._lastSortStartTime,t=this._sortInterval-e;t<=0?this._startSortIfRequired():null==this._scheduledSortStartTimeout&&(this._scheduledSortStartTimeout=setTimeout(()=>{this._scheduledSortStartTimeout=null,this._pendingSortTask&&!this._isSorting&&this._scheduleSortStart()},t))}_startSortIfRequired(){if(this._isSorting||!this._pendingSortTask)return;const e=new AbortController;this._sortAbortController=e,this._isSorting=!0,this._pendingSortTask=!1,this._lastSortStartTime=o(),this._sortOnWorker(e.signal).finally(()=>{this._sortAbortController===e&&(this._sortAbortController=null),this._handleSortComplete()})}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this._scheduleSortStart():this._updating.value=!1}_clearBuffersAndTextures(){this._atlasIndicesBuffer=void 0,this._sortedAtlasIndicesBuffer=void 0,this._distancesBuffer=void 0,this._bufferCapacity=0,this._sortBufferMemory=0,this._orderTexture.clear(),this._textureAtlas.clear(),this._headerTexture.clear()}_computeExpandedCapacity(t,s){let i=Math.max(1,t);for(;i<s;)i=Math.ceil(i*e);return i}_ensureSortBufferCapacities(e){if(this._bufferCapacity<e){const t=this._computeExpandedCapacity(this._bufferCapacity,e);this._atlasIndicesBuffer=new Uint32Array(t),this._sortedAtlasIndicesBuffer=new Uint32Array(t),this._distancesBuffer=new Float64Array(t),this._bufferCapacity=t,this._sortBufferMemory=s(this._atlasIndicesBuffer,this._sortedAtlasIndicesBuffer,this._distancesBuffer)}}_clearAllBuffersAndTextures(){this._clearBuffersAndTextures(),this._latestSortedGaussianTiles.length=0,this._nextCommittedVisibleGaussianTiles.length=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._workerHandle?.clear()}async _sortOnWorker(e){try{if(0===this._latestUpdatedGaussianTiles.length)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=this._requestedLyr3dVisibilityChange,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);this._useDeterministicSort&&this._latestUpdatedGaussianTiles.sort((e,t)=>e.obb.centerX-t.obb.centerX||e.obb.centerY-t.obb.centerY||e.obb.centerZ-t.obb.centerZ);const t=this._latestUpdatedGaussianTiles,s=t.length,i=this._requestedLyr3dVisibilityChange;let r=0;for(let e=0;e<s;e++)r+=t[e].gaussianCount;this._ensureSortBufferCapacities(r),this._textureAtlas.ensureTextureAtlas(),this._headerTexture.ensureCapacity(this._textureAtlas.pageAllocator.pageCount);const a=this._renderer.camera;h(this._cameraDirectionNormalized,a.ray.direction);const o=this._cameraDirectionNormalized[0],n=this._cameraDirectionNormalized[1],l=this._cameraDirectionNormalized[2];let u=0;const d=this._atlasIndicesBuffer,_=this._distancesBuffer,p=this._renderer.clippingBox,f=this._nextCommittedVisibleGaussianTiles;f.length=0;let m=0;const{frustum:g}=a,T=this._renderer.tileCullingRevision,b=g[0],S=g[1],y=g[2],x=g[3],C=g[4],A=g[5];for(let e=0;e<s;e++){const s=t[e],{gaussianAtlasIndices:i,relativePositions:r,obbCenterX:a,obbCenterY:h,obbCenterZ:g,paddedMbsRadius:V}=s,v=s.gaussianCount;if(s.cullingRevision!==T){let e=null==p||c(s.boundingBox,p);if(e){const t=1.5*V;e=b[0]*a+b[1]*h+b[2]*g+b[3]<t&&S[0]*a+S[1]*h+S[2]*g+S[3]<t&&y[0]*a+y[1]*h+y[2]*g+y[3]<t&&x[0]*a+x[1]*h+x[2]*g+x[3]<t&&C[0]*a+C[1]*h+C[2]*g+C[3]<t&&A[0]*a+A[1]*h+A[2]*g+A[3]<t}s.cullingRevision=T,s.cullingVisible=e}if(!s.cullingVisible)continue;d.set(i,u),f[m++]=s;const B=o*a+n*h+l*g,G=u+v;for(let e=u,t=0;e<G;e++,t+=3){const s=r[t],i=r[t+1],a=r[t+2];_[e]=s*o+i*n+a*l+B}u=G}if(f.length=m,0===u)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=i,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);const V={distances:this._distancesBuffer,atlasIndices:this._atlasIndicesBuffer,sortedAtlasIndices:this._sortedAtlasIndicesBuffer,numGaussians:u,preciseSort:this._useDeterministicSort},v=await(this._workerHandle?.sort(V,e));if(e.aborted)return;v&&(this._distancesBuffer=v.distances,this._atlasIndicesBuffer=v.atlasIndices,this._sortedAtlasIndicesBuffer=v.sortedAtlasIndices);const B=async e=>{this._orderTexture.setData(this._sortedAtlasIndicesBuffer,u);const t=this._latestSortedGaussianTiles;this._latestSortedGaussianTiles=f,this._nextCommittedVisibleGaussianTiles=t,this._latestSortedGaussianTilesVersion++,this._latestCompletedLyr3dVisibilityChange=i,this.visibleGaussians=u,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),this._renderer.requestRender(1),e.madeProgress()};await this._frameTask.schedule(B,e)}catch(t){if(i(t))return}}set useDeterministicSort(e){this._useDeterministicSort=e}}export{C as GaussianSplatDataStore};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import s from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import{PixelType as i,SizedPixelFormat as a}from"../../../webgl/enums.js";import"../../../webgl/Util.js";import{initialSplatAtlasTexturePages as o,packedGaussianSizeInU32 as h}from"./GaussianSplatAtlasPages.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class m{constructor(e){this.texture=null,this._headerTextureCapacity=0,this._rctx=e}get usedMemory(){return(this.texture?.usedMemory??0)+t(this._headerBuffer)}ensureCapacity(t){const r=this.texture;if(this._headerTextureCapacity>=t&&r?.hasWebGLTextureObject)return;const m=Math.max(Math.ceil(t*e),o,this._headerTextureCapacity),[c,p]=this._evalTextureSize(m),l=c*p,f=this._headerBuffer,d=new Uint32Array(l*h);f&&d.set(f.subarray(0,Math.min(f.length,d.length))),this._headerBuffer=d,this._headerTextureCapacity=l,this.texture?.dispose();const n=new u;n.width=c,n.height=p,n.pixelFormat=36249,n.dataType=i.UNSIGNED_INT,n.internalFormat=a.RGBA32UI,n.wrapMode=33071,n.samplingMode=9728,n.isImmutable=!0,this.texture=new s(this._rctx,n),this.texture.updateData(0,0,0,c,p,this._headerBuffer)}update(e,t){this.ensureCapacity(e+1);const r=e*h;this._headerBuffer.set(t,r);const s=this.texture,i=s.descriptor.width,a=e%i,o=Math.floor(e/i);s.updateData(0,a,o,1,1,this._headerBuffer.subarray(r,r+4))}clear(){this.texture?.dispose(),this.texture=null}destroy(){this._headerBuffer=void 0,this._headerTextureCapacity=0,this.clear()}_evalTextureSize(e){const t=Math.ceil(Math.sqrt(e)),s=Math.ceil(e/t);return r(t,s)}}export{m as GaussianSplatHeaderTexture};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import{initialSplatAtlasTextureHeight as e,GaussianSplatAtlasPages as s,splatAtlasTextureWidth as r,
|
|
2
|
+
import{has}from"../../../../applications/Components/baUtils.js";import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import{initialSplatAtlasTextureHeight as e,GaussianSplatAtlasPages as s,splatAtlasTextureWidth as r,gaussiansPerPage as a}from"./GaussianSplatAtlasPages.js";import{PixelType as i,SizedPixelFormat as l}from"../../../webgl/enums.js";import{DisposableFramebufferObject as o}from"../../../webgl/FramebufferObject.js";import h from"../../../webgl/Texture.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class c{constructor(t,r,a,i){this._splatAtlasTextureHeight=e,this.texture=null,this._rctx=t,this._fboCache=a,this._onCachedTextureEvicted=i,this.pageAllocator=new s,this._cache=r.newCache("gaussian texture cache",t=>{t.dispose(),this._onCachedTextureEvicted()})}get usedMemory(){return this.texture?.usedMemory??0}ensureTextureAtlas(){if(this.texture?.hasWebGLTextureObject)return;this.texture=null;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new u;e.height=this._splatAtlasTextureHeight,e.width=r,e.pixelFormat=36249,e.dataType=i.UNSIGNED_INT,e.internalFormat=l.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,e.isImmutable=!0,this.texture=new h(this._rctx,e),this._updatePageAllocator()}grow(){if(!this.texture)return this.ensureTextureAtlas(),!1;const e=Math.floor(this._splatAtlasTextureHeight*t);if(e>Math.min(has("esri-mobile")?4096:16384,this._rctx.parameters.maxTextureSize))return!1;const s=new o(this._rctx,this.texture),a=this._fboCache.acquire(r,e,"gaussian splat atlas resize",12);return this._rctx.blitFramebuffer(s,a.fbo,16384,9728,0,0,r,this._splatAtlasTextureHeight,0,0,r,this._splatAtlasTextureHeight),this.texture=a.fbo?.detachColorTexture(),s.dispose(),a.dispose(),this._splatAtlasTextureHeight=e,this._updatePageAllocator(),!0}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&this.grow()&&(t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,s){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,a,1,s)}_updatePageAllocator(){const t=r*this._splatAtlasTextureHeight/a;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this._onCachedTextureEvicted=()=>{},this._cache.destroy(),this.texture?.dispose(),this.texture=null}}export{c as GaussianSplatTextureAtlas};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{clamp as e}from"../../../../core/mathUtils.js";import{removeMaybe as r,destroyMaybe as i}from"../../../../core/maybe.js";import{property as s,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as n,scale as c,add as u,exactEquals as l,squaredLength as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../../geometry/ellipsoidUtils.js";import f from"../../../../geometry/Point.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{create as _}from"../../../../geometry/support/aaBoundingRect.js";import{debugFlags as g}from"../debugFlags.js";import{PointOfInterest as y}from"./PointOfInterest.js";import{PropertiesPool as S}from"../../../support/PropertiesPool.js";import{Yield as A}from"../../../support/Yield.js";let j=class extends y{constructor(t){super(t),this._propertiesPool=new S({location:()=>new f,renderLocation:()=>p()},this),this._currentSurfaceAltitude=0,this._latestSurfaceAltitude=0,this.distance=0,this.renderLocation=p(),this.updating=!1}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this),this.runTask()}destroy(){this._frameWorker=r(this._frameWorker),this._propertiesPool=i(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool?.get("location");return t?(t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t):new f}updateRenderLocation(){this.updating=!0,this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get readyToRun(){return this.updating}runTask(){return this._latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter(),this._updateRenderLocation(),this.updating=!1,A}_updateRenderLocation(){const t=
|
|
2
|
+
import{__decorate as t}from"tslib";import{clamp as e}from"../../../../core/mathUtils.js";import{removeMaybe as r,destroyMaybe as i}from"../../../../core/maybe.js";import{property as s,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as n,scale as c,add as u,exactEquals as l,squaredLength as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../../geometry/ellipsoidUtils.js";import f from"../../../../geometry/Point.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{create as _}from"../../../../geometry/support/aaBoundingRect.js";import{debugFlags as g}from"../debugFlags.js";import{PointOfInterest as y}from"./PointOfInterest.js";import{PropertiesPool as S}from"../../../support/PropertiesPool.js";import{Yield as A}from"../../../support/Yield.js";let j=class extends y{constructor(t){super(t),this._propertiesPool=new S({location:()=>new f,renderLocation:()=>p()},this),this._currentSurfaceAltitude=0,this._latestSurfaceAltitude=0,this.distance=0,this.renderLocation=p(),this.updating=!1}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this),this.runTask()}destroy(){this._frameWorker=r(this._frameWorker),this._propertiesPool=i(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool?.get("location");return t?(t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t):new f}updateRenderLocation(){this.updating=!0,this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get readyToRun(){return this.updating}runTask(){return this._latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter(),this._updateRenderLocation(),this.updating=!1,A}_updateRenderLocation(){const t=R;let e=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,t);const r=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!e&&r&&(e=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,t),e&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude));const i=L;e&&this._latestSurfaceAltitudeChangesDistance(t,i)&&(a(t,i),this._currentSurfaceAltitude=this._latestSurfaceAltitude),e?this.distance=n(this._camera.eye,t):(c(t,this._camera.viewForward,this._get("distance")),u(t,t,this._camera.eye)),l(this._get("renderLocation"),t)||this._set("renderLocation",a(this._propertiesPool.get("renderLocation"),t))}_calculateSurfaceIntersection(t,r){const i=this._camera;if(!this.renderCoordsHelper.intersectInfiniteManifold(i.ray,t,r))return!1;if(this.state.isGlobal){const e=h(this.renderCoordsHelper.spatialReference).radius,s=e+t,o=d(i.eye),a=o<s*s,l=n(i.eye,r);if(a&&l>e/4){const t=s-Math.sqrt(o);return c(r,i.viewForward,t),u(r,r,i.eye),!0}}else{const t=this.surface?.ready?this.surface.groundExtent:null;null!=t&&m(t,this.surface?.spatialReference,v,this.renderCoordsHelper.spatialReference)&&(r[0]=e(r[0],v[0],v[2]),r[1]=e(r[1],v[1],v[3]))}return!0}_latestSurfaceAltitudeChangesDistance(t,e){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||null==t)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude,e)){if(!g.ENABLE_OPTIMIZATIONS)return!0;const r=this._camera.eye;if(n(r,t)!==n(r,e))return!0}return!1}};t([s({constructOnly:!0})],j.prototype,"scheduler",void 0),t([s({constructOnly:!0})],j.prototype,"task",void 0),t([s()],j.prototype,"distance",void 0),t([s({constructOnly:!0})],j.prototype,"estimateSurfaceAltitudeAtCenter",void 0),t([s({readOnly:!0})],j.prototype,"location",null),t([s({readOnly:!0})],j.prototype,"renderLocation",void 0),t([s()],j.prototype,"updating",void 0),j=t([o("esri.views.3d.support.pointsOfInterest.CenterOnSurface")],j);const R=p(),L=p(),v=_();export{j as CenterOnSurface};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as e}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Float4DrawUniform as r}from"../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as t}from"../../../core/shaderModules/FloatDrawUniform.js";import{glsl as
|
|
2
|
+
import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as e}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Float4DrawUniform as r}from"../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as t}from"../../../core/shaderModules/FloatDrawUniform.js";import{glsl as n,If as d}from"../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as a}from"../../../core/shaderModules/IntegerDrawUniform.js";import{Texture2DUintDrawUniform as l}from"../../../core/shaderModules/Texture2DUintDrawUniform.js";import{olidEnabled as i}from"../../../effects/geometry/olidUtils.js";import{componentDataLayout as s,componentDataOlidLayout as c}from"../../../materials/DefaultLayouts.js";import{oitResolution as u}from"../../../shaders/oitResolution.glsl.js";function m(o,e){switch(e.componentDataType){case 1:return p(o,e);case 0:return M(o,e);case 2:return;default:e.componentDataType}}const f=new l("componentTextureBuffer",o=>o.textureBackedBuffer?.texture),v=new e({layout:s,itemIndexExpression:"componentIndex",bufferUniform:f}),x=new e({layout:c,itemIndexExpression:"componentIndex",bufferUniform:f});function C(){return i()?x:v}function p(e,r){const{vertex:t,fragment:a}=e,{output:l,hasEmission:i}=r,s=11===l,c=C().createBuilder(e,r);e.attributes.add("componentIndex","uint"),e.varyings.add("vExternalColorMixMode","mediump float"),e.varyings.add("vExternalColor","vec4"),s&&e.varyings.add("vObjectAndLayerIdColor","vec4"),i&&(e.varyings.add("emissiveStrength","float"),e.varyings.add("emissiveSource","int")),e.include(o),t.include(u,r),t.code.add(n`
|
|
3
3
|
float readElevationOffset() {
|
|
4
|
-
return ${c("elevationOffset")};
|
|
4
|
+
return ${c.getTextureAttribute("elevationOffset")};
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
void forwardEmissiveStrength() {
|
|
8
|
-
${
|
|
9
|
-
emissiveSource = ${c("emissiveSourceMode")} == 0u ? 0 : 1;`)}
|
|
8
|
+
${d(i,n`emissiveStrength = clamp(${c.getTextureAttribute("emissiveStrength")}, 0.0, maxEmissiveStrength);
|
|
9
|
+
emissiveSource = ${c.getTextureAttribute("emissiveSourceMode")} == 0u ? 0 : 1;`)}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
void forwardObjectAndLayerIdColor() {
|
|
13
|
-
${
|
|
13
|
+
${d(s,n`vObjectAndLayerIdColor = vec4(${c.getTextureAttribute("olidColor")})/255.0;`)}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
void decodeColorAndCastShadow(uvec4 colorAndCastShadowEncoded, out vec4 color, out bool castShadow) {
|
|
@@ -22,7 +22,7 @@ import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBa
|
|
|
22
22
|
|
|
23
23
|
vec4 forwardExternalColor(out bool castShadows) {
|
|
24
24
|
vec4 componentColor;
|
|
25
|
-
decodeColorAndCastShadow(${c("colorAndCastShadows")}, componentColor, castShadows);
|
|
25
|
+
decodeColorAndCastShadow(${c.getTextureAttribute("colorAndCastShadows")}, componentColor, castShadows);
|
|
26
26
|
|
|
27
27
|
int decodedColorMixMode;
|
|
28
28
|
vExternalColor = decodeSymbolColor(componentColor, decodedColorMixMode) * 0.003921568627451; // = 1/255;
|
|
@@ -30,16 +30,16 @@ import{DecodeSymbolColor as o}from"./DecodeSymbolColor.glsl.js";import{TextureBa
|
|
|
30
30
|
|
|
31
31
|
return vExternalColor;
|
|
32
32
|
}
|
|
33
|
-
`),a.code.add(
|
|
33
|
+
`),a.code.add(n`
|
|
34
34
|
void readExternalColor(out vec4 externalColor, out int externalColorMixMode) {
|
|
35
35
|
externalColor = vExternalColor;
|
|
36
36
|
externalColorMixMode = int(vExternalColorMixMode);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
void outputObjectAndLayerIdColor() {
|
|
40
|
-
${s?
|
|
40
|
+
${s?n`fragColor = vObjectAndLayerIdColor;`:""}
|
|
41
41
|
}
|
|
42
|
-
`)}function
|
|
42
|
+
`)}function M(o,e){const{vertex:l,fragment:i}=o;o.varyings.add("vExternalColor","vec4"),i.uniforms.add(new t("emissiveStrength",o=>o.componentParameters.emissiveStrength)),l.uniforms.add(new r("externalColor",o=>o.componentParameters.externalColor)).code.add(n`float readElevationOffset() {
|
|
43
43
|
return 0.0;
|
|
44
44
|
}
|
|
45
45
|
void forwardObjectAndLayerIdColor() {}
|
|
@@ -48,13 +48,13 @@ vec4 forwardExternalColor(out bool castShadows) {
|
|
|
48
48
|
vExternalColor = externalColor;
|
|
49
49
|
castShadows = true;
|
|
50
50
|
return externalColor;
|
|
51
|
-
}`);const s=11===e.output;i.uniforms.add(new a("externalColorMixMode",o=>o.componentParameters.externalColorMixMode)).code.add(
|
|
51
|
+
}`);const s=11===e.output;i.uniforms.add(new a("externalColorMixMode",o=>o.componentParameters.externalColorMixMode)).code.add(n`
|
|
52
52
|
void readExternalColor(out vec4 color, out int colorMixMode) {
|
|
53
53
|
color = vExternalColor;
|
|
54
54
|
colorMixMode = externalColorMixMode;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
void outputObjectAndLayerIdColor() {
|
|
58
|
-
${
|
|
58
|
+
${d(s,"fragColor = vec4(0, 0, 0, 0);")}
|
|
59
59
|
}
|
|
60
60
|
`)}export{m as ComponentData};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{generateUID as e}from"../../../../../core/uid.js";import{
|
|
3
|
-
struct ${
|
|
4
|
-
|
|
5
|
-
${
|
|
6
|
-
highp uint
|
|
7
|
-
highp uint rowWidth = uint(textureSize(${f.name}, 0).x);
|
|
2
|
+
import{generateUID as e}from"../../../../../core/uid.js";import{unpackFloat1x32 as t,TextureBufferNaNSupportConfiguration as r,unpackHalf as n,unpackInt1x16 as a,glslType as s,glslDecodeField as i}from"./TextureBackedBufferFields.glsl.js";import{glsl as d}from"../shaderModules/glsl.js";import{assert as o}from"../../lib/Util.js";import{Code as u}from"../../../../webgl/ShaderBuilder.js";const c=new r(!0),h=new r(!1);class l{constructor(e,t){this._shader=e,this._namespace=t,this._used=new Map}getItemSuffix(e){if(0===e)return"";return`${e<0?"Minus":"Plus"}${Math.abs(e)}`}getItemDataName(e=0){return`${this._namespace}ItemData${this.getItemSuffix(e)}`}getStructName(e=0){return`${this._namespace}TextureBackedBufferItemData${this.getItemSuffix(e)}`}getFetchName(e=0){return`${this._namespace}fetchTextureBackedBufferItemData${this.getItemSuffix(e)}`}getStrideName(){return`${this._namespace}tbbStride`}getTextureAttribute(e,t=0){const r=this._used,n=this.getItemDataName(t);let a=r.get(t);return null==a&&(a=new Set,r.set(t,a)),a.add(e),d`${n}.${e}`}generateVertexCode(e){const{_shader:t,_used:r}=this,n=new u(t.vertex);for(const a of r.keys())this._generateFetchFunction(a,n,e);return n.generateSource()}generateVertexMainCode(e){const{_shader:t,_used:r}=this,n=new u(t.vertex);for(const a of r.keys())this._generateFetchFunctionCall(a,n,e);return n.generateSource()}_generateFetchFunctionCall(e,t,r){const{itemIndexExpression:n}=r,a=this._used.get(e);if(null==a||0===a.size)return;const s=this.getItemDataName(e),i=this.getFetchName(e);t.add(d`${s} = ${i}(${n});`)}_getIndexOffset(e=0){if(0===e)return d``;return d`${e<0?"-":"+"}${d.uint(Math.abs(e))}`}_generateFetchFunction(e,t,r){const{bufferUniform:n,layout:a}=r,{texelFormatInfo:o}=a,u=this._used.get(e);if(null==u||0===u.size)return;const c=this.getStrideName(),h=this.getStructName(e),l=this.getItemDataName(e),m=this.getFetchName(e),x=this._getIndexOffset(e),$=new Array;for(const s of a.fields.values())u.has(s.name)&&$.push(s);if(0===$.length)return;const _=[];for(let s=0;s<a.texelStride;++s)_.push(!1);for(const s of $)for(let e=0;e<s.numTexels;++e)_[s.startTexel+e]=!0;t.add(d`
|
|
3
|
+
struct ${h} {`);for(const i of $)t.add(d`\t${s(i)} ${i.name};`);t.add(d`};`),t.add(d`\n${h} ${m}( highp uint baseIndex ) {
|
|
4
|
+
${h} itemData;
|
|
5
|
+
highp uint index = (baseIndex${x}) * ${c};
|
|
6
|
+
highp uint rowWidth = uint(textureSize(${n.name}, 0).x);
|
|
8
7
|
int coordX = int(index % rowWidth);
|
|
9
|
-
int coordY = int(index / rowWidth);
|
|
10
|
-
`);const S=$[I.channels],j=x[I.channels];for(let n=0;n<D.length;++n)!1!==D[n]&&g.code.add(a`highp ${S} texel${a.int(n)} = texelFetch(${f.name}, ivec2(coordX + ${a.int(n)}, coordY), 0)${j};`);for(const n of w)g.code.add(a`itemData.${n.name} = ${r(n,I)};`);g.code.add(a`return itemData;
|
|
11
|
-
}`),g.code.add(a`${B} ${T};`),g.main.add(a`${T} = ${v}(${u});`)}function m(e){const t=h(e);return e=>a`${t}.${e}`}function h(e){return`${e}ItemData`}const $={1:a`uint`,2:a`uvec2`,4:a`uvec4`},x={1:a`.x`,2:a`.xy`,4:""};export{f as TextureBackedBufferModule};
|
|
8
|
+
int coordY = int(index / rowWidth);\n`);const p=f[o.channels],I=g[o.channels];for(let s=0;s<_.length;++s)!1!==_[s]&&t.add(d`highp ${p} texel${d.int(s)} = texelFetch(${n.name}, ivec2(coordX + ${d.int(s)}, coordY), 0)${I};`);for(const s of $)t.add(d`itemData.${s.name} = ${i(s,o)};`);t.add(d`return itemData;\n}`),t.add(d`${h} ${l};`)}}class m{constructor(t){this._parameters=t,this.moduleId=e(),this.namespace=`_tbb_${this.moduleId}_`}createBuilder(e,t){let r=null;const n=e=>{r=this._buildTextureBackedBufferShaderCode(e)};return t?e.include(n,t):e.include(n),o(null!=r,"Valid builder expected."),r}_buildTextureBackedBufferShaderCode(e){const{namespace:r,_parameters:s}=this,{bufferUniform:i,layout:d}=s,u=s.enableNaNSupport?c:h,{vertex:m}=e,f=new l(e,r);m.include(t,u),m.include(n,u),m.include(a);const g=f.getStrideName(),x=f.getStructName(),$=f.getFetchName(),_=f.getItemDataName();for(const t of[g,x,$,_])o(t.length<1024,"Identifiers do not have a valid length");return m.constants.add(g,"uint",d.texelStride),m.uniforms.add(i),m.code.add(()=>f.generateVertexCode(s)),m.main.add(()=>f.generateVertexMainCode(s)),f}}const f={1:d`uint`,2:d`uvec2`,4:d`uvec4`},g={1:d`.x`,2:d`.xy`,4:""};export{m as TextureBackedBufferModule};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{freeze as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumRoundCapExtrusionSubdivisions as t}from"../../../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{PathVertexInfo as
|
|
2
|
+
import{freeze as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumRoundCapExtrusionSubdivisions as t}from"../../../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{PathVertexInfo as r}from"./PathVertexInfo.glsl.js";import{PiUtils as o}from"../shading/PiUtils.glsl.js";import{Float2sPassUniform as a}from"../../shaderModules/Float2sPassUniform.js";import{Float4sPassUniform as i}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as l}from"../../shaderModules/FloatPassUniform.js";import{glsl as n,If as s}from"../../shaderModules/glsl.js";import{IntegerPassUniform as f}from"../../shaderModules/IntegerPassUniform.js";import{IntegersPassUniform as p}from"../../shaderModules/IntegersPassUniform.js";import{pathProfileUniformLayout as c}from"../../../lib/PathProfile.js";function d(e,d){const{vertex:m}=e;e.include(r,d);const u=1===d.upVectorAlignment;m.uniforms.add(new l("angleCutoff",e=>e.cutoffAngle)),m.code.add(n`float reciprocalClamped(float value) {
|
|
3
3
|
float signValue = value < 0.0 ? -1.0 : 1.0;
|
|
4
4
|
return signValue / max(abs(value), 1e-6);
|
|
5
|
-
}`),u?m.code.add(
|
|
5
|
+
}`),u?m.code.add(n`vec2 applyMiterStretch(vec2 vertex, float rotationAngle, vec2 rotationRight) {
|
|
6
6
|
if (rotationAngle == 0.0) {
|
|
7
7
|
return vertex;
|
|
8
8
|
}
|
|
@@ -14,13 +14,13 @@ mat2 miterStretch = mat2(
|
|
|
14
14
|
1. + (k - 1.) * rotationRight.y * rotationRight.y
|
|
15
15
|
);
|
|
16
16
|
return miterStretch * vertex;
|
|
17
|
-
}`):m.code.add(
|
|
17
|
+
}`):m.code.add(n`vec2 applyMiterStretch(vec2 vertex, float rotationAngle) {
|
|
18
18
|
if (rotationAngle == 0.0) {
|
|
19
19
|
return vertex;
|
|
20
20
|
}
|
|
21
21
|
float k = reciprocalClamped(cos(0.5 * rotationAngle));
|
|
22
22
|
return vec2(k, 1.) * vertex;
|
|
23
|
-
}`);const{vertexCount:v,indexCount:h,poleCount:g}=d
|
|
23
|
+
}`);const{vertexCount:v,indexCount:h,poleCount:g}=c[d.pathProfileType];switch(m.uniforms.add(new a("pathProfileVertices",v,e=>e.profile.vertices.flat()),new a("pathProfileNormals",v,e=>e.profile.normals.flat())),m.code.add(n`mat3 mat3FromRotation(float angle, vec3 axis) {
|
|
24
24
|
float x = axis.x;
|
|
25
25
|
float y = axis.y;
|
|
26
26
|
float z = axis.z;
|
|
@@ -32,7 +32,7 @@ x * x * t + c, y * x * t + z * s, z * x * t - y * s,
|
|
|
32
32
|
x * y * t - z * s, y * y * t + c, z * y * t + x * s,
|
|
33
33
|
x * z * t + y * s, y * z * t - x * s, z * z * t + c
|
|
34
34
|
);
|
|
35
|
-
}`),m.code.add(
|
|
35
|
+
}`),m.code.add(n`struct ExtrusionFrame {
|
|
36
36
|
vec3 up;
|
|
37
37
|
vec3 right;
|
|
38
38
|
};
|
|
@@ -45,20 +45,20 @@ float maxDistance;
|
|
|
45
45
|
float capPositionOffset;
|
|
46
46
|
float capNormalOffset;
|
|
47
47
|
bool isCap;
|
|
48
|
-
};`),u?m.code.add(
|
|
48
|
+
};`),u?m.code.add(n`vec2 getPathRotationRight(ExtrusionFrame frame) {
|
|
49
49
|
vec3 rotationUp = getFrameRotationUp();
|
|
50
50
|
float a = dot(rotationUp, frame.up);
|
|
51
51
|
float b = dot(rotationUp, frame.right);
|
|
52
52
|
vec3 vertex = normalize(frame.up * -b + frame.right * a);
|
|
53
53
|
return vec2(dot(vertex, frame.right), dot(vertex, frame.up));
|
|
54
|
-
}`):m.code.add(
|
|
54
|
+
}`):m.code.add(n`vec2 getPathRotationRight() {
|
|
55
55
|
return vec2(1., 0.);
|
|
56
|
-
}`),m.
|
|
57
|
-
ExtrudedVertex evaluateJoinVertex(
|
|
58
|
-
vec2 profileVertex = pathProfileVertices[
|
|
59
|
-
vec2 profileNormal = pathProfileNormals[
|
|
56
|
+
}`),m.uniforms.add(new f("numJoinSubdivisions",e=>e.numJoinSubdivisions)),m.code.add(n`
|
|
57
|
+
ExtrudedVertex evaluateJoinVertex(PathVertexDescriptor vertexDescriptor, ExtrusionFrame frame) {
|
|
58
|
+
vec2 profileVertex = pathProfileVertices[vertexDescriptor.sourceIndex];
|
|
59
|
+
vec2 profileNormal = pathProfileNormals[vertexDescriptor.sourceIndex];
|
|
60
60
|
float profileRotation = getProfileRotation();
|
|
61
|
-
vec2 rotationRight = getPathRotationRight(${
|
|
61
|
+
vec2 rotationRight = getPathRotationRight(${s(u,n`frame`)});
|
|
62
62
|
bool isBevel = abs(profileRotation) >= angleCutoff;
|
|
63
63
|
|
|
64
64
|
// determine if the current profile vertex is on the inside or outside of the rotationAxis
|
|
@@ -69,20 +69,20 @@ return vec2(1., 0.);
|
|
|
69
69
|
bool isBevelBend = isBevel && isBend;
|
|
70
70
|
|
|
71
71
|
if (isBevelBend) {
|
|
72
|
-
float k =
|
|
72
|
+
float k = vertexDescriptor.subdivision;
|
|
73
73
|
// rotate half rotation angle backwards to where the rotation starts
|
|
74
74
|
// and then rotate a couple of times depending on the current subdivision segment
|
|
75
75
|
float bendRotation = -profileRotation * 0.5 + (k * profileRotation) / float(numJoinSubdivisions);
|
|
76
76
|
if (bendRotation != 0.) {
|
|
77
77
|
vec3 rotationUp = getFrameRotationUp();
|
|
78
78
|
mat3 transform = mat3FromRotation(bendRotation, rotationUp);
|
|
79
|
-
${
|
|
79
|
+
${s(u,n`frame.up = normalize(transform * frame.up);`)}
|
|
80
80
|
frame.right = normalize(transform * frame.right);
|
|
81
81
|
}
|
|
82
82
|
} else {
|
|
83
83
|
profileVertex = applyMiterStretch(
|
|
84
84
|
profileVertex,
|
|
85
|
-
profileRotation${
|
|
85
|
+
profileRotation${s(u,n`,
|
|
86
86
|
rotationRight`)}
|
|
87
87
|
);
|
|
88
88
|
}
|
|
@@ -103,12 +103,12 @@ return vec2(1., 0.);
|
|
|
103
103
|
false
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
|
-
`),m.
|
|
107
|
-
ExtrudedVertex evaluateConnectingVertex(
|
|
108
|
-
vec2 profileVertex = pathProfileVertices[
|
|
109
|
-
vec2 profileNormal = pathProfileNormals[
|
|
106
|
+
`),m.code.add(n`
|
|
107
|
+
ExtrudedVertex evaluateConnectingVertex(PathVertexDescriptor vertexDescriptor, ExtrusionFrame frame) {
|
|
108
|
+
vec2 profileVertex = pathProfileVertices[vertexDescriptor.sourceIndex];
|
|
109
|
+
vec2 profileNormal = pathProfileNormals[vertexDescriptor.sourceIndex];
|
|
110
110
|
|
|
111
|
-
float profilePlaneVertexOffset = ${
|
|
111
|
+
float profilePlaneVertexOffset = ${s(2===d.pathCapType,n`vertexDescriptor.isEnd ? 0.5 : -0.5`,n`0.`)};
|
|
112
112
|
|
|
113
113
|
return ExtrudedVertex(
|
|
114
114
|
frame,
|
|
@@ -121,12 +121,12 @@ return vec2(1., 0.);
|
|
|
121
121
|
true
|
|
122
122
|
);
|
|
123
123
|
}
|
|
124
|
-
`),
|
|
125
|
-
ExtrudedVertex evaluateFlatCapVertex(
|
|
126
|
-
vec2 profileVertex = pathProfileVertices[
|
|
127
|
-
bool isEnd =
|
|
124
|
+
`),d.pathCapType){case 1:case 2:m.code.add(n`
|
|
125
|
+
ExtrudedVertex evaluateFlatCapVertex(PathVertexDescriptor vertexDescriptor, ExtrusionFrame frame) {
|
|
126
|
+
vec2 profileVertex = pathProfileVertices[vertexDescriptor.sourceIndex];
|
|
127
|
+
bool isEnd = vertexDescriptor.isEnd;
|
|
128
128
|
float normalOffset = isEnd ? 1. : -1.;
|
|
129
|
-
float profilePlaneOffset = ${
|
|
129
|
+
float profilePlaneOffset = ${s(2===d.pathCapType,n`isEnd ? 0.5 : -0.5`,n`0.0`)};
|
|
130
130
|
vec2 normal = vec2(0.);
|
|
131
131
|
|
|
132
132
|
return ExtrudedVertex(
|
|
@@ -140,11 +140,11 @@ return vec2(1., 0.);
|
|
|
140
140
|
true
|
|
141
141
|
);
|
|
142
142
|
}
|
|
143
|
-
`);break;case 3:m.uniforms.add(new
|
|
144
|
-
bool isEnd =
|
|
143
|
+
`);break;case 3:m.uniforms.add(new i("pathProfilePoles",g,e=>e.profile.poles.flatMap(({position:e,normal:t})=>[...e,...t??x]),{supportsNaN:!0}),new p("pathProfilePoleIndices",h,e=>e.profile.poleIndices)),m.include(o),m.constants.add("pathNumRoundCapExtrusionSubdivisions","float",t),m.code.add(n`ExtrudedVertex evaluateRoundCapPoleVertex(PathVertexDescriptor vertexDescriptor, ExtrusionFrame frame) {
|
|
144
|
+
bool isEnd = vertexDescriptor.isEnd;
|
|
145
145
|
float capSign = isEnd ? 1. : -1.;
|
|
146
146
|
float offsetScale = capSign * 0.5;
|
|
147
|
-
vec4 pole = pathProfilePoles[
|
|
147
|
+
vec4 pole = pathProfilePoles[vertexDescriptor.sourceIndex];
|
|
148
148
|
vec2 polePosition = pole.xy;
|
|
149
149
|
bool hasPoleNormal = !isnan(pole.z);
|
|
150
150
|
vec2 poleNormal = hasPoleNormal ? pole.zw : vec2(0.);
|
|
@@ -160,20 +160,20 @@ normalOffset,
|
|
|
160
160
|
true
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
|
-
ExtrudedVertex evaluateRoundCapInnerVertex(
|
|
164
|
-
bool isEnd =
|
|
163
|
+
ExtrudedVertex evaluateRoundCapInnerVertex(PathVertexDescriptor vertexDescriptor, ExtrusionFrame frame) {
|
|
164
|
+
bool isEnd = vertexDescriptor.isEnd;
|
|
165
165
|
float capSign = isEnd ? 1. : -1.;
|
|
166
166
|
float offsetScale = capSign * 0.5;
|
|
167
|
-
float subdivision =
|
|
167
|
+
float subdivision = vertexDescriptor.subdivision;
|
|
168
168
|
float t = 1. - (subdivision + 1.) / pathNumRoundCapExtrusionSubdivisions;
|
|
169
169
|
float theta = t * HALF_PI;
|
|
170
170
|
float t1 = sin(theta);
|
|
171
171
|
float t2 = cos(theta);
|
|
172
|
-
int poleIndex = pathProfilePoleIndices[
|
|
172
|
+
int poleIndex = pathProfilePoleIndices[vertexDescriptor.sourceIndex];
|
|
173
173
|
vec4 pole = pathProfilePoles[poleIndex];
|
|
174
174
|
vec2 polePosition = pole.xy;
|
|
175
175
|
bool hasPoleNormal = !isnan(pole.z);
|
|
176
|
-
vec2 profileVertex = pathProfileVertices[
|
|
176
|
+
vec2 profileVertex = pathProfileVertices[vertexDescriptor.sourceIndex];
|
|
177
177
|
vec2 poleOffsetScaled = (profileVertex - polePosition) * t1;
|
|
178
178
|
vec2 poleVertex = poleOffsetScaled + polePosition;
|
|
179
179
|
vec2 profileNormal = hasPoleNormal
|
|
@@ -190,31 +190,31 @@ offsetScale * t2,
|
|
|
190
190
|
normalOffset,
|
|
191
191
|
true
|
|
192
192
|
);
|
|
193
|
-
}`)}m.code.add(
|
|
193
|
+
}`)}m.code.add(n`
|
|
194
194
|
ExtrudedVertex evaluateVertex() {
|
|
195
|
-
|
|
195
|
+
PathVertexDescriptor vertexDescriptor = getDescriptor();
|
|
196
196
|
ExtrusionFrame frame = ExtrusionFrame(
|
|
197
197
|
getFrameUp(),
|
|
198
198
|
getFrameRight()
|
|
199
199
|
);
|
|
200
200
|
|
|
201
|
-
switch (
|
|
201
|
+
switch (vertexDescriptor.type) {
|
|
202
202
|
case pathVertexTypeJoin:
|
|
203
|
-
return evaluateJoinVertex(
|
|
203
|
+
return evaluateJoinVertex(vertexDescriptor, frame);
|
|
204
204
|
|
|
205
205
|
case pathVertexTypeCapConnectingProfile:
|
|
206
|
-
return evaluateConnectingVertex(
|
|
206
|
+
return evaluateConnectingVertex(vertexDescriptor, frame);
|
|
207
207
|
|
|
208
|
-
${
|
|
209
|
-
case
|
|
210
|
-
return evaluateFlatCapVertex(
|
|
208
|
+
${s(1===d.pathCapType||2===d.pathCapType,n`
|
|
209
|
+
case pathVertexTypeCapProfile:
|
|
210
|
+
return evaluateFlatCapVertex(vertexDescriptor, frame);
|
|
211
211
|
`)}
|
|
212
212
|
|
|
213
|
-
${
|
|
214
|
-
case
|
|
215
|
-
return evaluateRoundCapPoleVertex(
|
|
213
|
+
${s(3===d.pathCapType,n`
|
|
214
|
+
case pathVertexTypeCapProfile:
|
|
215
|
+
return evaluateRoundCapPoleVertex(vertexDescriptor, frame);
|
|
216
216
|
case pathVertexTypeRoundCapInnerProfile:
|
|
217
|
-
return evaluateRoundCapInnerVertex(
|
|
217
|
+
return evaluateRoundCapInnerVertex(vertexDescriptor, frame);
|
|
218
218
|
`)}
|
|
219
219
|
|
|
220
220
|
default:
|
|
@@ -230,4 +230,4 @@ true
|
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
`)}const
|
|
233
|
+
`)}const x=e(NaN,NaN);export{d as PathEvaluate};
|
|
@@ -1,19 +1,47 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{glsl as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
uint
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
import{If as t,glsl as e}from"../../shaderModules/glsl.js";import{sourceIndexMask as a,descriptorDataShift as r,descriptorDataMask as i,descriptorTypeShift as n,descriptorCapSideShift as p,descriptorCapSubdivisionMask as s,descriptorShift as o,frameIndexMask as d}from"../../../lib/PathVertexInfo.js";function c(c,h){const{attributes:x,vertex:u}=c;x.add("pathVertexInfo","uint"),u.constants.add("pathVertexDescriptorSourceIndexMask","uint",a),u.constants.add("pathVertexDescriptorDataShift","uint",r),u.constants.add("pathVertexDescriptorDataMask","uint",i),u.constants.add("pathVertexDescriptorTypeShift","uint",n),u.constants.add("pathVertexDescriptorCapSideShift","uint",p),u.constants.add("pathVertexDescriptorCapSubdivisionMask","uint",s),u.constants.add("pathVertexInfoDescriptorShift","uint",o),u.constants.add("pathVertexInfoFrameIndexMask","uint",d),u.constants.add("pathVertexCapSideEnd","uint",1),u.constants.add("pathVertexTypeJoin","uint",0),u.constants.add("pathVertexTypeCapConnectingProfile","uint",1),u.constants.add("pathVertexTypeCapProfile","uint",2),3===h.pathCapType&&u.constants.add("pathVertexTypeRoundCapInnerProfile","uint",3),u.code.add(e`
|
|
3
|
+
struct PathVertexDescriptor {
|
|
4
|
+
uint sourceIndex;
|
|
5
|
+
float subdivision;
|
|
6
|
+
uint type;
|
|
7
|
+
bool isEnd;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
uint getFrameIndex() {
|
|
11
|
+
return pathVertexInfo & pathVertexInfoFrameIndexMask;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
PathVertexDescriptor getDescriptor() {
|
|
15
|
+
uint descriptor = pathVertexInfo >> pathVertexInfoDescriptorShift;
|
|
16
|
+
uint sourceIndex = descriptor & pathVertexDescriptorSourceIndexMask;
|
|
17
|
+
uint descriptorData = (descriptor >> pathVertexDescriptorDataShift) & pathVertexDescriptorDataMask;
|
|
18
|
+
uint type = descriptor >> pathVertexDescriptorTypeShift;
|
|
19
|
+
float subdivision = 0.;
|
|
20
|
+
bool isEnd = false;
|
|
21
|
+
|
|
22
|
+
switch (type) {
|
|
23
|
+
case pathVertexTypeJoin:
|
|
24
|
+
subdivision = float(descriptorData);
|
|
25
|
+
break;
|
|
26
|
+
|
|
27
|
+
${t(3===h.pathCapType,e`
|
|
28
|
+
case pathVertexTypeRoundCapInnerProfile:
|
|
29
|
+
subdivision = float(descriptorData & pathVertexDescriptorCapSubdivisionMask);
|
|
30
|
+
`)}
|
|
31
|
+
case pathVertexTypeCapConnectingProfile:
|
|
32
|
+
${t(0!==h.pathCapType,e`
|
|
33
|
+
case pathVertexTypeCapProfile:
|
|
34
|
+
`)}
|
|
35
|
+
isEnd = (descriptorData >> pathVertexDescriptorCapSideShift) == pathVertexCapSideEnd;
|
|
36
|
+
break;
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return PathVertexDescriptor(
|
|
41
|
+
sourceIndex,
|
|
42
|
+
subdivision,
|
|
43
|
+
type,
|
|
44
|
+
isEnd
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
`)}export{c as PathVertexInfo};
|