@arcgis/core 4.33.0-next.20250212 → 4.33.0-next.20250214
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/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeEnvironment.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/OrderBy.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetgeom.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/fieldStats.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/geometry/functions.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01f8f52a3f9e6fb72f64.js +1 -0
- package/assets/esri/core/workers/chunks/{8191dd3d7451b2e7b95e.js → 041eebac192855fbf919.js} +1 -1
- package/assets/esri/core/workers/chunks/09cbf45dc7b026957d3e.js +1 -0
- package/assets/esri/core/workers/chunks/{1a286d43daa3b811c30d.js → 1661ac4e1b6c6af6ee0f.js} +1 -1
- package/assets/esri/core/workers/chunks/197dc75a1c10c0fbf65a.js +1 -0
- package/assets/esri/core/workers/chunks/219b06cca6aa1e041f40.js +1 -0
- package/assets/esri/core/workers/chunks/238bcf6514a1f214cc8a.js +1 -0
- package/assets/esri/core/workers/chunks/{efded84870064c3d8210.js → 23a045fccc005079bd58.js} +1 -1
- package/assets/esri/core/workers/chunks/2dc35c1c5d83174a2c06.js +1 -0
- package/assets/esri/core/workers/chunks/{e4651d577d297386268e.js → 32035bc69ee18b19623d.js} +1 -1
- package/assets/esri/core/workers/chunks/32fee5446ee0b0a6c4bd.js +1 -0
- package/assets/esri/core/workers/chunks/{f429d95eb986f3d215f3.js → 391c200274bbeb92404c.js} +1 -1
- package/assets/esri/core/workers/chunks/39c595734a9e9cd67e41.js +1 -0
- package/assets/esri/core/workers/chunks/3c44b4bf7fe407ec1d70.js +1 -0
- package/assets/esri/core/workers/chunks/3eacb4d1275f2d87825f.js +1 -0
- package/assets/esri/core/workers/chunks/{c0af54cc5938176ce764.js → 3fe7be535affae31de7e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c061cad8323f0469e7e4.js → 42f21349f488a14198e4.js} +1 -1
- package/assets/esri/core/workers/chunks/48eb5cbb4555acc56984.js +1 -0
- package/assets/esri/core/workers/chunks/4927b33f7e9daf059765.js +1 -0
- package/assets/esri/core/workers/chunks/50bab11c32bf4001edd7.js +1 -0
- package/assets/esri/core/workers/chunks/544ad8fa4777ba8ec177.js +1 -0
- package/assets/esri/core/workers/chunks/5c9a7b1dedd146cc65d2.js +1 -0
- package/assets/esri/core/workers/chunks/5d8120c84e5a164cb1bc.js +1 -0
- package/assets/esri/core/workers/chunks/{7a9e1696dc6120df15b0.js → 60ca6a2e9f1e2c969aab.js} +1 -1
- package/assets/esri/core/workers/chunks/679cc23be07ededb3992.js +1 -0
- package/assets/esri/core/workers/chunks/{9f122278e917c9ce5f95.js → 67c1e2c17ea3ca27248c.js} +1 -1
- package/assets/esri/core/workers/chunks/69b55259f90e8e4bc2aa.js +1 -0
- package/assets/esri/core/workers/chunks/69e0ff74e44962d97049.js +1 -0
- package/assets/esri/core/workers/chunks/6c64ccf5f64b5025b239.js +1 -0
- package/assets/esri/core/workers/chunks/6ca4b5d1a076c6079472.js +1 -0
- package/assets/esri/core/workers/chunks/{7058001bf66f9f3d5d45.js → 6d02d66234a7b74e5c14.js} +1 -1
- package/assets/esri/core/workers/chunks/{77bfd4f819096cb754ae.js → 6e92569a4a82592b95dc.js} +1 -1
- package/assets/esri/core/workers/chunks/6f007703662e714b2f0a.js +1 -0
- package/assets/esri/core/workers/chunks/744bdf2bb0cc38e6a7b1.js +1 -0
- package/assets/esri/core/workers/chunks/7bf9ebff90bb02bec8e7.js +1 -0
- package/assets/esri/core/workers/chunks/{8b6580329e1e35ea4190.js → 7c03489438f51a5170f3.js} +1 -1
- package/assets/esri/core/workers/chunks/7e77e4288ed205128b87.js +1 -0
- package/assets/esri/core/workers/chunks/80c3e933b43ea79b30de.js +1 -0
- package/assets/esri/core/workers/chunks/830844f7fb7557d30f34.js +1 -0
- package/assets/esri/core/workers/chunks/8a66d06132c8803033c9.js +1 -0
- package/assets/esri/core/workers/chunks/{e9993d4f2bfdc434fbcc.js → 8f4bcca8b0525e19374f.js} +1 -1
- package/assets/esri/core/workers/chunks/95047f145ebda65c3d8e.js +1 -0
- package/assets/esri/core/workers/chunks/9968c6654d048c9add0c.js +1 -0
- package/assets/esri/core/workers/chunks/{b50176897ffadc53573e.js → 9bbfa8dc4124b5273d28.js} +1 -1
- package/assets/esri/core/workers/chunks/9be12d0df67e2c4c3787.js +1 -0
- package/assets/esri/core/workers/chunks/a2b548fbfa2eb5e6f2a7.js +1 -0
- package/assets/esri/core/workers/chunks/a37825705e49b60e5d4b.js +1 -0
- package/assets/esri/core/workers/chunks/a80c3ada9e09b8832e9b.js +1 -0
- package/assets/esri/core/workers/chunks/a8457210711b663059f0.js +1 -0
- package/assets/esri/core/workers/chunks/aebbaa7ab7a6b3b1579c.js +314 -0
- package/assets/esri/core/workers/chunks/b90b7ffc1e9363ed18e0.js +1 -0
- package/assets/esri/core/workers/chunks/{a39977478a6c57d2e8fb.js → bd2dcc55ac3418421ee5.js} +1 -1
- package/assets/esri/core/workers/chunks/{83fe9a8002a4fc96e534.js → bd38717780fffa49d36c.js} +1 -1
- package/assets/esri/core/workers/chunks/{c77ade444aa2f3f2b599.js → bdc9dec6a359d2e3705c.js} +1 -1
- package/assets/esri/core/workers/chunks/bf127fe767174e2715b5.js +1 -0
- package/assets/esri/core/workers/chunks/c3806be4a760735e6082.js +1 -0
- package/assets/esri/core/workers/chunks/cb3148cf11a420d6e9ab.js +1 -0
- package/assets/esri/core/workers/chunks/{8d8f5f08d730270e1165.js → cb9a27176bd5de2c34ca.js} +1 -1
- package/assets/esri/core/workers/chunks/cbba0b6bd41d16eacb5c.js +1 -0
- package/assets/esri/core/workers/chunks/cdf942020b7054628dc9.js +1 -0
- package/assets/esri/core/workers/chunks/d6c3df07cfaa6bb639e9.js +1 -0
- package/assets/esri/core/workers/chunks/ea4c7560e64335f155f9.js +1 -0
- package/assets/esri/core/workers/chunks/eac791e3a0bb056a28f3.js +1 -0
- package/assets/esri/core/workers/chunks/ed89a108b032b982b12f.js +1 -0
- package/assets/esri/core/workers/chunks/ee5b82873ff80cb4ba34.js +1 -0
- package/assets/esri/core/workers/chunks/{08980b1ad3d5d67c6390.js → f419aaf3bab086060894.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0656e9d30eb3a66a8db.js → f976233ad5e5b718ba83.js} +1 -1
- package/assets/esri/themes/base/widgets/_Directions.scss +30 -9
- package/assets/esri/themes/base/widgets/_Editor.scss +1 -0
- 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/ComponentShader.glsl.js +6 -6
- package/chunks/arcade.js +1 -1
- package/chunks/array.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/copyright.txt +26 -19
- package/core/colorUtils.js +1 -1
- package/core/deprecate.js +1 -1
- package/core/libs/gl-matrix-2/factories/mat2df32.js +1 -1
- package/core/libs/gl-matrix-2/factories/mat2df64.js +1 -1
- package/core/libs/gl-matrix-2/factories/mat2f32.js +1 -1
- package/core/libs/gl-matrix-2/factories/mat2f64.js +1 -1
- package/core/libs/gl-matrix-2/factories/mat3f32.js +1 -1
- package/core/libs/gl-matrix-2/factories/mat3f64.js +1 -1
- package/core/libs/gl-matrix-2/factories/mat4f32.js +1 -1
- package/core/libs/gl-matrix-2/factories/mat4f64.js +1 -1
- package/core/libs/gl-matrix-2/factories/quat2f64.js +1 -1
- package/core/libs/gl-matrix-2/factories/vec2f32.js +1 -1
- package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
- package/core/libs/gl-matrix-2/factories/vec3f32.js +1 -1
- package/core/libs/gl-matrix-2/factories/vec3f64.js +1 -1
- package/core/libs/gl-matrix-2/factories/vec4f32.js +1 -1
- package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
- package/editing/templateUtils.js +1 -1
- package/geohash/geohashUtils.js +1 -1
- package/interfaces.d.ts +634 -129
- package/intl/locale.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/OGCFeatureLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/WFSLayer.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/TrackableLayer.d.ts +4 -0
- package/layers/save/imageryUtils.js +1 -1
- package/layers/support/ExportImageServiceParameters.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/TitleCreator.js +5 -0
- package/layers/support/TrackInfo.d.ts +4 -0
- package/layers/support/TrackInfo.js +1 -1
- package/layers/support/TrackPartInfo.d.ts +4 -0
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterDatasets/datasetUtils.js +5 -0
- package/layers/support/rasterFormats/RasterCodec.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
- package/layers/support/rasterFunctions/creators/createLocalFunctions.js +1 -1
- package/layers/support/rasterFunctions/creators/createStatisticsFunctions.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/networkFieldUtils.js +5 -0
- package/package.json +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/rest/query/executeForIds.js +1 -1
- package/rest/support/BinParametersBase.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/cim/rasterizingUtils.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/i3s/BuildingFilterUtil.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/SymbologyInfo.js +5 -0
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +14 -14
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassIdentifier.js +5 -0
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/lib/AnimationTimer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/support/RequiredFieldsOptions.js +5 -0
- package/views/webgl/Texture.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
- package/widgets/Compass/CompassViewModel.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList/ListItem.js +1 -1
- package/widgets/LayerList/support/layerListUtils.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DigitizationAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/symbols.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList/ListItem.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/Track.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/support/GoTo.js +1 -1
- package/widgets/support/goToUtils.js +5 -0
- package/assets/esri/core/workers/chunks/03f51ea011ffbcfb7c7d.js +0 -1
- package/assets/esri/core/workers/chunks/122ed10cac9f192e1eec.js +0 -1
- package/assets/esri/core/workers/chunks/1249fd2f83caeaefd8ce.js +0 -1
- package/assets/esri/core/workers/chunks/144e534d4ac1aafab60d.js +0 -1
- package/assets/esri/core/workers/chunks/177d4c2c10ef7369006f.js +0 -1
- package/assets/esri/core/workers/chunks/1d282700e76285a1684c.js +0 -1
- package/assets/esri/core/workers/chunks/35392bf8f21005ad6170.js +0 -1
- package/assets/esri/core/workers/chunks/37cfd102b6ab5b959f9d.js +0 -1
- package/assets/esri/core/workers/chunks/3ba85f1d660b8887f963.js +0 -314
- package/assets/esri/core/workers/chunks/3c8e5b5fb52611e30ed6.js +0 -1
- package/assets/esri/core/workers/chunks/5eceedac9b2b4d1ef133.js +0 -1
- package/assets/esri/core/workers/chunks/6a9a1cd8134a903dd05a.js +0 -1
- package/assets/esri/core/workers/chunks/73d03c208242778e67bf.js +0 -1
- package/assets/esri/core/workers/chunks/7485588bd24217669578.js +0 -1
- package/assets/esri/core/workers/chunks/74e0116ae84def626c87.js +0 -1
- package/assets/esri/core/workers/chunks/7e3b374f906441cd7fb0.js +0 -1
- package/assets/esri/core/workers/chunks/80d3aa3f27ad5b2b969b.js +0 -1
- package/assets/esri/core/workers/chunks/84c1c3336011a1b79669.js +0 -1
- package/assets/esri/core/workers/chunks/8939479cd433cc53f6c1.js +0 -1
- package/assets/esri/core/workers/chunks/8a2f3ce46eeac853b3a9.js +0 -1
- package/assets/esri/core/workers/chunks/8f31fbb1d549230ee3db.js +0 -1
- package/assets/esri/core/workers/chunks/91384398f01485631f70.js +0 -1
- package/assets/esri/core/workers/chunks/9421ae38fdf986b9b107.js +0 -1
- package/assets/esri/core/workers/chunks/94225d92afbdb10dfedb.js +0 -1
- package/assets/esri/core/workers/chunks/99c136b800e5fc7e04f4.js +0 -1
- package/assets/esri/core/workers/chunks/9b74635d80d029498da1.js +0 -1
- package/assets/esri/core/workers/chunks/9e7895e8201127ffe0a8.js +0 -1
- package/assets/esri/core/workers/chunks/a5e9ea13e844a62b2a7f.js +0 -1
- package/assets/esri/core/workers/chunks/a6ec3665bde2af8a96e6.js +0 -1
- package/assets/esri/core/workers/chunks/a9274c9132e7a2691abb.js +0 -1
- package/assets/esri/core/workers/chunks/af917f69d9c6e9937263.js +0 -1
- package/assets/esri/core/workers/chunks/bf0bf2b912d668575a9b.js +0 -1
- package/assets/esri/core/workers/chunks/ca6180e572e69540c183.js +0 -1
- package/assets/esri/core/workers/chunks/cccd215b0a4890551957.js +0 -1
- package/assets/esri/core/workers/chunks/d074c916b414432a7b6a.js +0 -1
- package/assets/esri/core/workers/chunks/d7b260d6187f29e0c136.js +0 -1
- package/assets/esri/core/workers/chunks/de638753a30c9aa41bad.js +0 -1
- package/assets/esri/core/workers/chunks/debfb75a94b66b58cbbc.js +0 -1
- package/assets/esri/core/workers/chunks/e490f70f192780d7ad50.js +0 -1
- package/assets/esri/core/workers/chunks/e6633f0326a44477f630.js +0 -1
- package/assets/esri/core/workers/chunks/e71b780d1e6a32f303b7.js +0 -1
- package/assets/esri/core/workers/chunks/eb0ce7937813d1be1284.js +0 -1
- package/assets/esri/core/workers/chunks/f285ed5425b31123d2bc.js +0 -1
- package/assets/esri/core/workers/chunks/f2cf05fbbb51d657d300.js +0 -1
- package/assets/esri/core/workers/chunks/f4ba823c8acd60c7c82d.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s,createRenderScreenPointArray3 as o}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as a,distance as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{c as h,v as c,l as _,d as p,n as l,g as u,h as d,f as g}from"../../../../chunks/vec32.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as v}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as C}from"../../../../geometry/support/axisAngle.js";import{create as M,fromPositionAndNormal as w,getNormal as S}from"../../../../geometry/support/plane.js";import{c as b,a as f}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as j,applyAll as E}from"../../camera/constraintUtils.js";import{ConstraintOptions as O}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as y}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as A}from"../../camera/constraintUtils/InteractionType.js";import{ExponentialFalloff as R}from"../../input/util.js";import{InteractiveController as z}from"./InteractiveController.js";import{PanPlanarMomentumController as x}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as k}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as H}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as F}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as T}from"./momentum/ZoomSphericalMomentumController.js";import{NavigationMode as U,pickPointAndInitSphere as D,contentIntersectorOptions as I,SpherePickPointFallback as L,navigationMode as G,sphereOrPlanePointFromScreenPoint as Z,panDistanceModifier as N,minHeightLimit as B,screenPixelArea as V,intersectPlaneFromScreenPointAtEye as q,applyZoomOnSphere as J,preserveHeadingThreshold as K,applyPanSphericalPreserveHeading as Q,applyPanSphericalDirectRotation as W,normalizeRotationDelta as X,applyRotation as Y,applyPanPlanar as $,applyZoomToPoint as tt}from"../utils/navigationUtils.js";import it from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as et}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as nt}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as st}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as ot}from"../../../navigation/ZoomMomentumEstimator.js";let rt=class extends z{constructor(){super(...arguments),this._smoothRotation=new R(.05),this._rotationAxis=P(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=M(),this._beginRadius=0,this._smoothScaling=new R(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new ot,this._rotationMomentumEstimator=new st,this._panSphericalMomentumEstimator=new nt,this._panPlanarMomentumEstimator=new et,this._adjustedSphere=b(),this._tmp3d=P(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=P(),this._screenPickPoint=n(),this._scenePickPoint=P(),this._navMode=U.Horizontal,this._sphere=b(),this._pointerCount=0,this._tmpInteractionDirection=P(),this._beginCamera=new it,this._constraintOptions=new O(y.ALL,A.NONE,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),a(this._beginScreenPoint,this._screenPickPoint);const n=v(this.view.spatialReference),o=D(this._intersectionHelper,this.startCamera,this._screenPickPoint,n,L.Silhouette,0===this.view.map.ground.opacity?I:{});null!=o.scenePickPoint&&(this._scenePickPoint=o.scenePickPoint,this._sphere=o.sphere,h(this._beginScenePoint,this._scenePickPoint),this._navMode=G(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),this._navMode===U.Vertical&&this._preparePlanarPanMode(t,o.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;this._navMode===U.Horizontal?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return this._navMode===U.Horizontal?new T({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new F({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new H({view:this.view,momentum:e,center:f(this._sphere),axis:this._rotationAxis});if(this._navMode===U.Horizontal){const t=this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new k({view:this.view,momentum:t})}else{const t=this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=c(this._tmp3d,this.startCamera.viewForward);w(this._scenePickPoint,e,this._panningPlane);const r=n(this._screenPickPoint[0],0),a=P(),m=_(this.startCamera.eye);this._adjustedSphere[3]=m<this._sphere[3]?m-100:this._sphere[3],Z(this._adjustedSphere,this.startCamera,r,a);const v=o();this.startCamera.projectToRenderScreen(a,v);const C=P(),M=P(),b=P();p(C,this._scenePickPoint,this.currentCamera.eye);const f=_(C);l(C,C);const j=N*Math.max(Math.abs(this.view.camera.position.z),B),E=this.view._stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,V);let O=null!=E?E:j;O=i?Math.min(O,f):O,h(b,u(M,this.currentCamera.eye,d(M,C,O))),this._panningPlane[3]=-g(S(this._panningPlane),b),this.startCamera.center=u(M,this.startCamera.eye,d(M,this.startCamera.viewForward,O));const y=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.startCamera,y,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),J(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);Z(this._sphere,this.currentCamera,i,this._tmp3d),K(this._beginScenePoint,g(this.currentCamera.up,this._beginScenePoint),this._sphere[3],this._beginHeading,this.view.camera.tilt,this.startCamera)?(Q(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(W(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere[3],this.view.camera.tilt)),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._screenPickPoint,i)),E(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){l(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+X(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),C(this._rotationAxis,s)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*e),E(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.currentCamera,i,this._tmp3d)&&($(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),E(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),tt(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){h(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=X(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),C(this._rotationAxis,o)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*o),E(this.view,this.currentCamera,this._constraintOptions)}};rt=t([r("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],rt);export{rt as PinchAndPanControllerGlobal};
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s,createRenderScreenPointArray3 as o}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as a,distance as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{c as h,v as c,l as _,d as p,n as l,g as u,h as d,f as g}from"../../../../chunks/vec32.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as v}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as C}from"../../../../geometry/support/axisAngle.js";import{create as M,fromPositionAndNormal as w,getNormal as S}from"../../../../geometry/support/plane.js";import{c as b,a as f}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as j,applyAll as E}from"../../camera/constraintUtils.js";import{ConstraintOptions as O}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as y}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as A}from"../../camera/constraintUtils/InteractionType.js";import{ExponentialFalloff as R}from"../../input/util.js";import{InteractiveController as z}from"./InteractiveController.js";import{PanPlanarMomentumController as x}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as k}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as H}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as F}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as T}from"./momentum/ZoomSphericalMomentumController.js";import{NavigationMode as U,pickPointAndInitSphere as D,contentIntersectorOptions as G,SpherePickPointFallback as I,navigationMode as L,sphereOrPlanePointFromScreenPoint as Z,panDistanceModifier as N,minHeightLimit as B,screenPixelArea as V,intersectPlaneFromScreenPointAtEye as q,applyZoomOnSphere as J,shouldPreserveHeading as K,applyPanSphericalPreserveHeading as Q,applyPanSphericalDirectRotation as W,normalizeRotationDelta as X,applyRotation as Y,applyPanPlanar as $,applyZoomToPoint as tt}from"../utils/navigationUtils.js";import it from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as et}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as nt}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as st}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as ot}from"../../../navigation/ZoomMomentumEstimator.js";let rt=class extends z{constructor(){super(...arguments),this._smoothRotation=new R(.05),this._rotationAxis=P(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=M(),this._beginRadius=0,this._smoothScaling=new R(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new ot,this._rotationMomentumEstimator=new st,this._panSphericalMomentumEstimator=new nt,this._panPlanarMomentumEstimator=new et,this._adjustedSphere=b(),this._tmp3d=P(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=P(),this._screenPickPoint=n(),this._scenePickPoint=P(),this._navMode=U.Horizontal,this._sphere=b(),this._pointerCount=0,this._tmpInteractionDirection=P(),this._beginCamera=new it,this._constraintOptions=new O(y.ALL,A.NONE,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),a(this._beginScreenPoint,this._screenPickPoint);const n=v(this.view.spatialReference),o=D(this._intersectionHelper,this.startCamera,this._screenPickPoint,n,I.Silhouette,0===this.view.map.ground.opacity?G:{});null!=o.scenePickPoint&&(this._scenePickPoint=o.scenePickPoint,this._sphere=o.sphere,h(this._beginScenePoint,this._scenePickPoint),this._navMode=L(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),this._navMode===U.Vertical&&this._preparePlanarPanMode(t,o.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;this._navMode===U.Horizontal?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return this._navMode===U.Horizontal?new T({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new F({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new H({view:this.view,momentum:e,center:f(this._sphere),axis:this._rotationAxis});if(this._navMode===U.Horizontal){const t=this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new k({view:this.view,momentum:t})}else{const t=this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=c(this._tmp3d,this.startCamera.viewForward);w(this._scenePickPoint,e,this._panningPlane);const r=n(this._screenPickPoint[0],0),a=P(),m=_(this.startCamera.eye);this._adjustedSphere[3]=m<this._sphere[3]?m-100:this._sphere[3],Z(this._adjustedSphere,this.startCamera,r,a);const v=o();this.startCamera.projectToRenderScreen(a,v);const C=P(),M=P(),b=P();p(C,this._scenePickPoint,this.currentCamera.eye);const f=_(C);l(C,C);const j=N*Math.max(Math.abs(this.view.camera.position.z),B),E=this.view._stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,V);let O=null!=E?E:j;O=i?Math.min(O,f):O,h(b,u(M,this.currentCamera.eye,d(M,C,O))),this._panningPlane[3]=-g(S(this._panningPlane),b),this.startCamera.center=u(M,this.startCamera.eye,d(M,this.startCamera.viewForward,O));const y=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.startCamera,y,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),J(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);Z(this._sphere,this.currentCamera,i,this._tmp3d),K(this._beginScenePoint,g(this.currentCamera.up,this._beginScenePoint),this._sphere[3],this._beginHeading,this.view.camera.tilt,this.startCamera.aboveGround)?(Q(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(W(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere[3],this.view.camera.tilt)),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._screenPickPoint,i)),E(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){l(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+X(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),C(this._rotationAxis,s)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*e),E(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.currentCamera,i,this._tmp3d)&&($(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),E(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),tt(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){h(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=X(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),C(this._rotationAxis,o)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*o),E(this.view,this.currentCamera,this._constraintOptions)}};rt=t([r("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],rt);export{rt as PinchAndPanControllerGlobal};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{fromRotation as i,exactEquals as s,multiply as c,rotate as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}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{d as h,t as M,g,l as y,h as b,m as d,i as x,f as
|
|
5
|
+
import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{fromRotation as i,exactEquals as s,multiply as c,rotate as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}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{d as h,t as M,g,l as y,h as b,m as d,i as x,f as v,n as j,s as z,c as P,e as w}from"../../../../chunks/vec32.js";import{create as I}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as H,axis as S,fromPoints as k,wrapAxisAngle as A}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as E,vectorCoordinates as T}from"../../../../geometry/support/coordinateSystem.js";import{create as U,intersectRay as G,fromNormalAndOffset as R}from"../../../../geometry/support/plane.js";import{k as q,j as C,a as F,c as V}from"../../../../chunks/sphere.js";import{sm4d as O,sv3d as W}from"../../../../geometry/support/vectorStacks.js";import{fromScreen as B,fromScreenAtEye 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";var N;!function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"}(N||(N={}));const Q=30,X=[1,3e8],Y=80,Z=8,$=200,_=1508e5,tt=5,et=50,nt=5,ot=10,rt=90,at={exclude:new Set([L])};function it(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function st(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function ct(t,e,n){const o=i(O.get(),n[3],S(n));null==o||s(o,m)||(h(re,t.eye,e),M(re,re,o),t.eye=g(re,re,e),h(re,t.center,e),M(re,re,o),t.center=g(re,re,e),t.up=M(re,t.up,o))}function lt(t,e,n,o){return G(t,B(e,n,le),o)}function mt(t,e,n,o){return G(t,D(e,n,le),o)}function ut(t,e,n,o){const r=W.get();let a=1-n;h(r,e,t.eye);const i=y(r);let s=i*(1-a);a>=0&&s<o&&(s=o,a=-(s-i)/i),Math.abs(i-s)<1e-6||(b(r,r,a),t.eye=g(re,t.eye,r),t.center=d(re,t.center,e,a))}function ft(t,e,n){e.getScreenCenter(pt),J(t,e,pt,re)&&(e.center=re);const o=e.distance,r=o*n;if(Math.abs(o-r)<1e-6)return;const a=b(W.get(),e.viewForward,r);e.eye=h(re,e.center,a)}const pt=a();function ht(t,e){x(e,0,0,0);for(const n of t)g(e,e,n);b(e,e,1/t.length)}function Mt(t,e,n,o){return Math.sin(t/y(e))*(n+o.radius)}function gt(t,e,n,o){return Mt(Math.PI/2,e,n,o)+(t-Math.PI/2)}var yt;!function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal"}(yt||(yt={}));const bt={Elevation:3e4,Angle:e(16)},dt=e(80);function xt(t,e,n,o,r,a){const i=I(),s=V();let c=!0,l=!0;return t.intersectScreen(n,i,a)?s[3]=y(i):(l=!1,e.aboveGround&&r!==N.Ellipsoid?s[3]=Math.max(y(e.center),.9*o.radius):s[3]=y(e.eye)-e.relativeElevation,r===N.Silhouette?Pt(s,e,n,i):c=J(s,e,n,i)),{sphere:s,scenePickPoint:c?i:null,hasGeometryIntersection:l}}function vt(t,e,n,o){const r=t.relativeElevation;if(r>bt.Elevation&&"global"===o)return yt.Horizontal;D(t,e,me);const a=Math.sign(r),i=n.worldUpAtPosition(t.eye,re);return-a*v(i,me.direction)<Math.sin(bt.Angle)*y(me.direction)?yt.Vertical:yt.Horizontal}function jt(t,e,n){h(zt,n,e),t.eye=h(re,t.eye,zt),t.center=h(re,t.center,zt)}const zt=I();function Pt(t,e,n,o){const r=D(e,n,le);return null!=r&&(q(t,r,wt),C(t,r,o)?!(z(wt,r.origin)<z(o,r.origin))||(P(o,wt),!1):(h(It,e.eye,e.center),j(It,It),R(It,-v(j(It,It),wt),Ht),G(Ht,r,o),!1))}const wt=I(),It=I(),Ht=U();function St(a,i,s,c,l,m){let u=0;if(w(se,a,i),h(ae,a,i),y(a)<=l||!c.aboveGround){w(s,ae,c.eye);const f=v(a,i)/(y(a)*y(i));if(f<.9999)u=o(f);else{const t=y(w(I(),a,i))/(y(a)*y(i));u=r(t)}const p=Math.cos(n(t.normalize(e(m)),0,dt));u=-u-Math.max(0,y(i)-l)/(p*l)}else h(kt,c.eye,c.center),w(s,ae,kt),u=-y(ae)/l;return j(s,s),b(s,s,y(se)),u}const kt=I();function At(r,a,i,s){let c,l;const m=Math.cos(n(t.normalize(e(s)),0,dt));return c=a>i?-(a-i)/(m*i):a<-i?Math.PI-(a+i)/(m*i):o(a/i),l=r>i?-(r-i)/(m*i):r<-i?Math.PI-(r+i)/(m*i):o(r/i),(l-c)*i}function Et(t,e,n,o,r,a,i,s,c,l){const m=At(t[2],e[2],a[3],s),u=c?At(t[0],e[0],a[3],180):e[0]-t[0],p=Math.sin(i)*u-Math.cos(i)*m,h=Math.cos(i)*u+Math.sin(i)*m;j(re,r);const M=c?p/Math.sqrt(Math.abs(a[3]**2-v(n,re)**2)):p/a[3],g=h/Math.sqrt(Math.abs(a[3]**2-v(n,o)**2));f(l,M,g)}function Tt(t,e,n,o,r,a,i,s,c,l){w(se,t,e),E(a.up,a.eye,Nt,Qt,Xt),E([0,0,1],a.eye,Jt,Kt,Lt),P(n,Kt),P(o,Jt),j(n,n),b(n,n,y(se)),T(t,j(Qt,Qt),j(Xt,Xt),j(Nt,Nt),Yt),T(e,Qt,Xt,Nt,Zt),Et(Yt,Zt,t,Jt,Kt,i,s,c,l,r)}function Ut(t,e,n,o,r,a,s){i(te,r,o),i(ee,s,a),c(ne,te,ee),h(e,t,n),M(e,e,ne),g(e,e,n)}function Gt(t,e,n,o,r,a){i(te,o,n),i(ee,a,r),c(ne,te,ee),h(re,t.eye,e),M(re,re,ne),t.eye=g(re,re,e),h(re,t.center,e),M(re,re,ne),t.center=g(re,re,e),h(re,t.up,e),M(re,re,ne),t.up=g(re,re,e)}const Rt={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let qt=!1;function Ct(t,e,n,o,r,a){const i=Math.abs(o)>Math.PI-Rt.Angle||Math.abs(o)<Rt.Angle,s=(Math.abs(t[2])<n*Rt.Pole||Math.abs(e)>n)&&a;return i&&s?!qt&&r<Rt.Tilt-Rt.TiltHysteresisMargin?qt=!0:qt&&r>Rt.Tilt+Rt.TiltHysteresisMargin&&(qt=!1):qt=!1,qt}function Ft(t,e,n,o,r,a){if(a)k(n,o,_t),ct(e,F(t),_t);else{const a=St(n,o,ce,e,t[3],r);ct(e,F(t),A(ce,a))}}function Vt(t,e,n,o,r,a,i){const s=i?20:1,c=1e-12;let l,m;P(oe,o),ie.copyFrom(e);for(let u=0;u<s&&z(n,oe)>c&&(l=z(n,oe),Tt(n,oe,Kt,Jt,$t,ie,t,r,a,i),Gt(ie,F(t),Jt,$t[1],Kt,$t[0]),Ut(oe,oe,F(t),Jt,$t[1],Kt,$t[0]),m=z(n,oe),m<l||0===u);u++)e.copyFrom(ie)}function Ot(n,o,r,a,i,s,c){Ct(r,v(o.up,r),n[3],-t.normalize(e(i)),s,o.aboveGround)?Vt(n,o,r,a,-t.normalize(e(i)),s,c):Ft(n,o,r,a,s,c)}function Wt(t,e,n,o,r,a){const{eye:i}=t;E([0,0,1],i,Jt,Kt,Lt);const s=e.translation[0]*n.pan,c="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-v(t.center,Jt)**2/y(t.center)**2)),.5),u=(Math.sin(a)*c+Math.cos(a)*s)/m,f=-Math.cos(a)*c+Math.sin(a)*s;switch(l(o.pan.matrix,o.pan.matrix,u,Jt),o.pan.enabled=!0,r.mode){case"pan":l(o.pan.matrix,o.pan.matrix,f,Kt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Bt(t,e,n,o,r){const{eye:a,viewRight:i}=t,s=w(W.get(),i,a),c=e.translation[0]*n.pan;switch(0!==c&&(l(o.pan.matrix,o.pan.matrix,-c,s),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(l(o.pan.matrix,o.pan.matrix,t,i),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Dt(n,o,r,a,i,s,c,l,m){Ct(n.center,v(n.up,n.center),y(n.center),-t.normalize(e(s)),c,o.aboveGround)?Wt(o,r,a,l,m,-t.normalize(e(i))):Bt(o,r,a,l,m)}const Jt=I(),Kt=I(),Lt=I(),Nt=I(),Qt=I(),Xt=I(),Yt=I(),Zt=I(),$t=p(),_t=H(),te=u(),ee=u(),ne=u(),oe=I(),re=I(),ae=I(),ie=new K,se=I(),ce=I(),le={origin:I(),direction:I()},me={origin:I(),direction:I()};export{yt as NavigationMode,N as SpherePickPointFallback,dt as TiltThresholdPanningSpeed,bt as VerticalPanTresholds,jt as applyPanPlanar,Ft as applyPanSphericalDirectRotation,Vt as applyPanSphericalPreserveHeading,ct as applyRotation,Gt as applyRotationWithTwoAxes,ft as applyZoomOnSphere,ut as applyZoomToPoint,ht as centroid,at as contentIntersectorOptions,X as distanceClampValues,lt as intersectPlaneFromScreenPoint,mt as intersectPlaneFromScreenPointAtEye,At as lengthFromPoints,et as minHeightLimit,vt as navigationMode,it as normalizeCoordinate,st as normalizeRotationDelta,gt as offSurfaceTiltToEyeTiltGlobal,Mt as onSurfaceTiltToEyeTiltGlobal,tt as panDistanceModifier,Dt as panMotionToRotationMatrix,Ot as panToPosition,xt as pickPointAndInitSphere,Q as pivotDistanceModifier,Rt as preservingHeadingThresholds,nt as rotatePivotDistanceModifier,ot as rotatePivotMinDistanceModifier,Ut as rotatePointAroundTwoAxes,rt as rotateScreenPixelArea,St as rotationAngleAndAxisDirectRotation,Tt as rotationAnglesAndAxesHeadingPreserving,Et as rotationAnglesHeadingPreserving,Y as screenPixelArea,Ct as shouldPreserveHeading,Pt as sphereOrPlanePointFromScreenPoint,Z as zoomDistanceModifier,_ as zoomMaxDistanceModifier,$ as zoomMinDistanceModifier};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import{ComponentRangeRunLengthEncoded as e}from"./IndexRange/ComponentRangeRunLengthEncoded.js";class
|
|
5
|
+
import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import{ComponentRangeRunLengthEncoded as e}from"./IndexRange/ComponentRangeRunLengthEncoded.js";import{defaultHighlightName as h}from"../../../../support/HighlightDefaults.js";class i{constructor(t,h){this.offsets=h,this._highlightsInOrder=[],this.pickability=null,this.componentHighlights=new Map,this.verticalOffsets=null,this.cachedGeometryRanges=null,this.cachedHighlightRangesMap=null,this.cachedShadowmapRanges=null;const i=this.count;this.visibility=new e(i),this.materialDataBuffer=t.getBuffer(i),this.materialDataIndices=new Uint16Array(i);for(let e=0;e<i;e++)this.materialDataIndices[e]=this.materialDataBuffer.acquireIndex()}destroy(){for(let t=0;t<this.count;t++)this.materialDataBuffer.releaseIndex(this.materialDataIndices[t])}get count(){return this.offsets.length-1}get geometryRanges(){return null==this.cachedGeometryRanges&&(this.cachedGeometryRanges=this.visibility.computeOffsetRanges(this.offsets)),this.cachedGeometryRanges}get highlightRangesMap(){return 0===this.componentHighlights.size?null:(this._updateCachedHighlightRanges(),this.cachedHighlightRangesMap)}get shadowmapRanges(){return 0===this.componentHighlights.size?this.geometryRanges:(this._updateCachedHighlightRanges(),this.cachedShadowmapRanges)}markHighlightsDirty(){this.cachedHighlightRangesMap=null,this.cachedShadowmapRanges=null}markVisibilityDirty(){this.cachedGeometryRanges=null,this.markHighlightsDirty()}updateHighlights(t){this._updateHighlightOrder(t)&&(this.markHighlightsDirty(),this._updateCachedHighlightRanges())}_updateHighlightOrder(t){const{_highlightsInOrder:e}=this;let h=e.length!==t.length;e.length=Math.min(t.length,8);for(let i=0;i<t.length;++i){const s=t.at(i).name;e.length<i?(h=!0,e.push(s)):e[i]!==s&&(e[i]=s,h=!0)}return h}_updateCachedHighlightRanges(){if(null==this.cachedHighlightRangesMap||null==this.cachedShadowmapRanges){const{highlightRangesMap:t,shadowmapRangesMap:e}=s(this.componentHighlights,this.visibility,this.offsets,this._highlightsInOrder);this.cachedHighlightRangesMap=t,this.cachedShadowmapRanges=e}}}function s(e,i,s,a){const n=new Map,g=[];if(e.size>0){let l=s.length;i.forEachComponent((i=>{let r=!1;for(let g=a.length-1;g>=0;--g){const l=a[g],c=e.get(l);if((c?.[i]??0)>0){const e=t(n,l,(()=>[])),a=s[i],g=s[i+1];e.push(a),e.push(g-a),r||=l===h;break}}return r||(l!==i-1&&(g.length>0&&g.push(s[l+1]-g[g.length-1]),g.push(s[i])),l=i),!0})),g.length>0&&g.push(s[l+1]-g[g.length-1])}return{highlightRangesMap:n,shadowmapRangesMap:g}}export{i as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../core/Logger.js";import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import i from"../../../../../core/PooledArray.js";import{isTypedArray as o}from"../../../../../core/typedArrayUtil.js";import{s as n}from"../../../../../chunks/vec32.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as s}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as a}from"../../../../../geometry/support/Indices.js";import{c as l}from"../../../../../chunks/vec3.js";import{c}from"../../../../../chunks/vec33.js";import{ViewingMode as m}from"../../../../ViewingMode.js";import{ColorMixModeEnum as p,encodeSymbolColor as f}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as h}from"../../../support/orientedBoundingBox.js";import{glLayout as g}from"../../../support/buffer/glUtil.js";import{newLayout as d}from"../../../support/buffer/InterleavedLayout.js";import u from"./ComponentData.js";import{ComponentObject as b}from"./ComponentObject.js";import{IntersectionGeometry as y}from"./IntersectionGeometry.js";import{Renderable as v}from"./Renderable.js";import{RenderGeometry as _}from"./RenderGeometry.js";import{RenderSubmitSystem as C}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as M}from"./SourceGeometry.js";import{UniformComponentParameters as j}from"./UniformComponentParameters.js";import{ComponentParametersVarying as w,ComponentParametersUniform as O,ComponentParameterSummary as x,ComponentMaterial as D}from"./Material/ComponentMaterial.js";import{vertexAttributeLocations as A}from"./Material/ComponentTechnique.js";import{encodeElevationOffset as R}from"./Material/shader/ComponentData.glsl.js";import{olidEnabled as S}from"../../effects/geometry/olidUtils.js";import{getVisibility as E,updateVisibilityWithCount as I}from"../../lib/ComponentUtils.js";import{assert as H}from"../../lib/Util.js";import{VertexAttribute as V}from"../../lib/VertexAttribute.js";import{getVerticalOffsetI3S as U}from"../../lib/verticalOffsetUtils.js";import{BufferManager as B}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as P}from"../../../../webgl/BufferObject.js";import{Usage as N,PrimitiveType as T}from"../../../../webgl/enums.js";import{VertexArrayObject as k}from"../../../../webgl/VertexArrayObject.js";const L=()=>e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class G{constructor(e,t){this._renderManager=e,this._viewingMode=t,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._activeHighlightOptions=new Map,this._visible=new i,this._hidden=new i,this._renderSubmit=new C(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new B(e.rctx,2+(S()?1:0))}destroy(){H(0===this._hidden.length&&0===this._visible.length,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy(),this._visible.forAll((e=>e.destroy())),this._hidden.forAll((e=>e.destroy())),this._visible.clear(),this._hidden.clear()}createObject(e){const t=e.geometry,i=new u(this._componentBufferManager,a(t.componentOffsets)),o=this._createRenderable(e,i),n=new y(this._viewingMode,t.positionData,i),r=new b(e.transform,e.toMapSpace,e.obb.clone(),i,o,n);return(r.visible?this._visible:this._hidden).push(r),r}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._notifyDirty()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll((e=>e.renderable.meta.cameraDepthSquared=n(t,e.obb.center)))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const i=e.renderable.material;t(i),i.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,i=t.componentData.visibility.componentCount;return{visible:i,invisible:t.componentData.count-i}}setComponentData(e,t){const i=e,o=i.renderable.material,n=i.componentData,r=n.materialDataBuffer,s=n.materialDataIndices,a=new j,l=r.textureBuffer,c=new Uint8Array(4),m=new Uint32Array(c.buffer);let g=0,d=0,u=0,b=n.verticalOffsets,y=1/0,v=-1/0,_=!1,C=!1,M=0;for(let h=0;h<n.count;h++){t(h,a),g+=+(a.externalColor[3]<1),d+=+(a.externalColorMixMode===p.Replace&&1===a.externalColor[3]),u+=+a.castShadows,f(a.externalColor,a.externalColorMixMode,c),c[2]=254&c[2]|+a.castShadows,l.setData(s[h],0,c[0],c[1],c[2],c[3]),_||=h>0&&M!==m[0],M=m[0],C||=0!==a.elevationOffset,C&&null==b&&(b=new Array(h).fill(0)),null!=b&&(b[h]=a.elevationOffset),y=Math.min(y,a.elevationOffset),v=Math.max(v,a.elevationOffset),R(a.elevationOffset,c),l.setData(s[h],1,c[0],c[1],c[2],c[3]);const e=a.objectAndLayerIdColor;null!=e&&l.setData(s[h],2,e[0],e[1],e[2],e[3]),a.pickable!==E(n.pickability,h)&&(n.pickability=I(n.pickability,n.count,h,a.pickable))}n.verticalOffsets=C?b:null,i.offsetObb=C?h(i.obb,y,v,this._viewingMode,i.offsetObb??i.obb.clone()):null,_||C||S()?(o.componentParameters=new w,o.componentParameters.castShadows=W(u,n.count),o.componentParameters.transparent=W(g,n.count),o.componentParameters.opaqueOverride=W(d,n.count),o.componentParameters.texture=l,l.updateTexture()):(o.componentParameters=new O,o.componentParameters.castShadows=a.castShadows?x.All:x.None,o.componentParameters.externalColor=a.externalColor,o.componentParameters.externalColorMixMode=a.externalColorMixMode),this._elevationRangeCacheVerticalOffset=NaN,this._notifyDirty()}getComponentAabb(e,t,i,o=!1){e.intersectionGeometry.getComponentAabb(t,i);const n=e,r=n.componentData.verticalOffsets;if(o||null==r)return i;const s=r[t];if(this._viewingMode===m.Local||0===s)return i[2]+=s,i[5]+=s,i;const a=U(s);return a.localOrigin=n.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}expandRangeWithComponentObjectElevationRange(e,t,i,o){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||o.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const n=e,r=n.componentData,s=r.count,a=r.verticalOffsets,l=n.intersectionGeometry,c=this._viewingMode===m.Local,p=l.getComponentAabbs(),f=z;let h=1/0,g=-1/0;for(let m=0;m<s;m++){const e=6*m,r=a?.[m]??0;let s=1/0,l=-1/0;if(c)s=p[e+2]+r+t,l=p[e+5]+r+t;else{if(f[0]=p[e],f[1]=p[e+1],f[2]=p[e+2],f[3]=p[e+3],f[4]=p[e+4],f[5]=p[e+5],0!==r){const e=U(r);e.localOrigin=n.transform.position,e.applyToAabb(f)}const s=Math.max(Math.abs(f[3]),Math.abs(f[0])),a=Math.max(Math.abs(f[4]),Math.abs(f[1])),l=t+f[5]+i;o.expandElevationRangeValues(t+f[2],Math.sqrt(s*s+a*a+l*l)-i)}o.expandElevationRangeValues(s,l),h=Math.min(h,s),g=Math.max(g,l)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=h,this._elevationRangeCacheMax=g}intersect(e,t,i,o,n,r,s){const a=e,{transform:l}=a,{position:c}=l;return null!=n&&(n.localOrigin=c),a.intersectionGeometry.intersect(t,i,o,n,a.componentData.verticalOffsets,l,r,s)}addEdges(e,t,i,o,n){const r=e,{indices:s,positions:a}=r.intersectionGeometry,l=r.componentData.offsets;return t.addComponentObject(r,a,s,l,i,o,n)}async extractEdgeInformation(e,t,i){const o=e,n=o.componentData.visibility;if(n.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await import("../../lib/edgeRendering/edgeProcessing.js");return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:s,positions:a}=o.intersectionGeometry,m=o.componentData.offsets,{EdgeInputBufferLayout:p}=await import("../../lib/edgeRendering/bufferLayouts.js"),f=p.createBuffer(a.length/3);c(f.position.typedBuffer,a,f.position.typedBufferStride,3),l(f.position,f.position,o.transform.rotationScale),this._setComponentIndices(f.componentIndex,s,m);const h=f.count,g=this._computeVisibilityIndices(s,n,m,h);return{origin:r(o.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:g,indicesLength:g.length,skipDeduplicate:!0,data:f,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let o=0;for(let n=0;n<i.length-1;n++){const r=i[n],s=i[n+1];for(let i=r;i<s;i++){const n=t?t[i]:i;e.set(n,o)}o++}}_computeVisibilityIndices(e,t,i,n){if(e&&t.allVisible())return e;let r=0;t.forEachComponentRange(((e,t)=>(r+=i[t]-i[e],!0)));const s=o(e)?2===e?.BYTES_PER_ELEMENT||n<=65536?new Uint16Array(r):new Uint32Array(r):new Array(r);let a=0;return t.forEachComponentRange(((t,o)=>{const n=i[t],r=i[o];for(let i=n;i<r;i++)s[a++]=e?e[i]:i;return!0})),s}addComponentHighlight(e,i,o){const n=e.componentData,r=t(n.componentHighlights,o,(()=>new Uint32Array(n.count+1)));{const e=this._activeHighlightOptions.get(o)??0;this._activeHighlightOptions.set(o,e+1)}0===r[i]++&&(n.markHighlightsDirty(),this._notifyDirty()),r[n.count]++}removeComponentHighlight(e,t,i){const{componentData:o}=e,n=o.componentHighlights.get(i);if(void 0===n)return void L().warn("Removing non-existing highlight.");const r=n[t];if(0===r)return void L().warn("Removing non-existing highlight.");this._removeActiveHighlight(i);const s=n[o.count];if(r>1)return n[t]=r-1,void(n[o.count]=s-1);n[t]=0,1===s?o.componentHighlights.delete(i):n[o.count]=s-1,o.markHighlightsDirty(),this._notifyDirty()}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)L().warn("Removing non-existing highlight.");else{const o=i-t;o<0&&L().warn("Removing non-existing highlight."),o<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,o)}}clearHighlights(e){const{componentData:t}=e,{componentHighlights:i}=t;if(i.size>0){for(const e of i)this._removeActiveHighlight(e[0],e[1][t.count]);i.clear(),t.markHighlightsDirty(),this._notifyDirty()}}hasHighlightOptions(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t){const i=this._renderManager.rctx,o=e.geometry,n=o.vertices.layoutParameters,r=P.createVertex(i,N.STATIC_DRAW,o.vertices.data),s=o.indices?P.createIndex(i,N.STATIC_DRAW,o.indices):null,a=g(M(n)),l=new Uint16Array(o.vertices.count);for(let g=0;g<t.count;g++){const e=t.offsets[g],i=t.offsets[g+1],n=t.materialDataIndices[g];if(null!=o.indices)for(let t=e;t<i;t++){l[o.indices[t]]=n}else for(let t=e;t<i;t++)l[t]=n}const c=P.createVertex(i,N.STATIC_DRAW,l.buffer),m=new D(e.transform,e.toMapSpace),p=new k(i,A,new Map([["data",a],["componentIndices",q]]),new Map([["data",r],["componentIndices",c]]),s),f=new _(p,T.TRIANGLES,n,null!=s),h={cameraDepthSquared:.5,gpuMemoryEstimate:r.usedMemory+c.usedMemory+(null!=s?s.usedMemory:0)};return new v(m,f,h)}_notifyDirty(){this._renderManager.notifyDirty()}}const q=g(d().u16(V.COMPONENTINDEX));function W(e,t){return e===t?x.All:0===e?x.None:x.Some}const z=s();export{G as ComponentObjectCollection};
|
|
5
|
+
import e from"../../../../../core/Logger.js";import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import i from"../../../../../core/PooledArray.js";import{isTypedArray as o}from"../../../../../core/typedArrayUtil.js";import{s as n}from"../../../../../chunks/vec32.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as s}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as a}from"../../../../../geometry/support/Indices.js";import{c as l}from"../../../../../chunks/vec3.js";import{c}from"../../../../../chunks/vec33.js";import{ViewingMode as m}from"../../../../ViewingMode.js";import{ColorMixModeEnum as p,encodeSymbolColor as f}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as h}from"../../../support/orientedBoundingBox.js";import{glLayout as g}from"../../../support/buffer/glUtil.js";import{newLayout as d}from"../../../support/buffer/InterleavedLayout.js";import u from"./ComponentData.js";import{ComponentObject as b}from"./ComponentObject.js";import{IntersectionGeometry as y}from"./IntersectionGeometry.js";import{Renderable as v}from"./Renderable.js";import{RenderGeometry as _}from"./RenderGeometry.js";import{RenderSubmitSystem as C}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as M}from"./SourceGeometry.js";import{UniformComponentParameters as j}from"./UniformComponentParameters.js";import{ComponentParametersVarying as w,ComponentParametersUniform as O,ComponentParameterSummary as x,ComponentMaterial as D}from"./Material/ComponentMaterial.js";import{vertexAttributeLocations as A}from"./Material/ComponentTechnique.js";import{encodeElevationOffset as R}from"./Material/shader/ComponentData.glsl.js";import{olidEnabled as S}from"../../effects/geometry/olidUtils.js";import{getVisibility as E,updateVisibilityWithCount as I}from"../../lib/ComponentUtils.js";import{assert as H}from"../../lib/Util.js";import{VertexAttribute as V}from"../../lib/VertexAttribute.js";import{getVerticalOffsetI3S as U}from"../../lib/verticalOffsetUtils.js";import{BufferManager as B}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as P}from"../../../../webgl/BufferObject.js";import{Usage as N,PrimitiveType as T}from"../../../../webgl/enums.js";import{VertexArrayObject as k}from"../../../../webgl/VertexArrayObject.js";const L=()=>e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class G{constructor(e,t){this._renderManager=e,this._viewingMode=t,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._activeHighlightOptions=new Map,this._visible=new i,this._hidden=new i,this._renderSubmit=new C(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new B(e.rctx,2+(S()?1:0))}destroy(){H(0===this._hidden.length&&0===this._visible.length,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy(),this._visible.forAll((e=>e.destroy())),this._hidden.forAll((e=>e.destroy())),this._visible.clear(),this._hidden.clear()}createObject(e){const t=e.geometry,i=new u(this._componentBufferManager,a(t.componentOffsets)),o=this._createRenderable(e,i),n=new y(this._viewingMode,t.positionData,i),r=new b(e.transform,e.toMapSpace,e.obb.clone(),i,o,n);return(r.visible?this._visible:this._hidden).push(r),r}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._notifyDirty()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll((e=>e.renderable.meta.cameraDepthSquared=n(t,e.obb.center)))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const i=e.renderable.material;t(i),i.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,i=t.componentData.visibility.componentCount;return{visible:i,invisible:t.componentData.count-i}}setComponentData(e,t){const i=e,{renderable:o,componentData:n}=i,r=o.material,s=n.materialDataBuffer,a=n.materialDataIndices,l=new j,c=s.textureBuffer,m=new Uint8Array(4),g=new Uint32Array(m.buffer);let d=0,u=0,b=0,y=n.verticalOffsets,v=1/0,_=-1/0,C=!1,M=!1,D=0;for(let h=0;h<n.count;h++){t(h,l),d+=+(l.externalColor[3]<1),u+=+(l.externalColorMixMode===p.Replace&&1===l.externalColor[3]),b+=+l.castShadows,f(l.externalColor,l.externalColorMixMode,m),m[2]=254&m[2]|+l.castShadows,c.setData(a[h],0,m[0],m[1],m[2],m[3]),C||=h>0&&D!==g[0],D=g[0],M||=0!==l.elevationOffset,M&&null==y&&(y=new Array(h).fill(0)),null!=y&&(y[h]=l.elevationOffset),v=Math.min(v,l.elevationOffset),_=Math.max(_,l.elevationOffset),R(l.elevationOffset,m),c.setData(a[h],1,m[0],m[1],m[2],m[3]);const e=l.objectAndLayerIdColor;null!=e&&c.setData(a[h],2,e[0],e[1],e[2],e[3]),l.pickable!==E(n.pickability,h)&&(n.pickability=I(n.pickability,n.count,h,l.pickable))}n.verticalOffsets=M?y:null,i.offsetObb=M?h(i.obb,v,_,this._viewingMode,i.offsetObb??i.obb.clone()):null,C||M||S()?(r.componentParameters=new w,r.componentParameters.castShadows=W(b,n.count),r.componentParameters.transparent=W(d,n.count),r.componentParameters.opaqueOverride=W(u,n.count),r.componentParameters.texture=c,c.updateTexture()):(r.componentParameters=new O,r.componentParameters.castShadows=l.castShadows?x.All:x.None,r.componentParameters.externalColor=l.externalColor,r.componentParameters.externalColorMixMode=l.externalColorMixMode),this._elevationRangeCacheVerticalOffset=NaN,this._notifyDirty()}getComponentAabb(e,t,i,o=!1){e.intersectionGeometry.getComponentAabb(t,i);const n=e,r=n.componentData.verticalOffsets;if(o||null==r)return i;const s=r[t];if(this._viewingMode===m.Local||0===s)return i[2]+=s,i[5]+=s,i;const a=U(s);return a.localOrigin=n.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}expandRangeWithComponentObjectElevationRange(e,t,i,o){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||o.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const n=e,r=n.componentData,s=r.count,a=r.verticalOffsets,l=n.intersectionGeometry,c=this._viewingMode===m.Local,p=l.getComponentAabbs(),f=z;let h=1/0,g=-1/0;for(let m=0;m<s;m++){const e=6*m,r=a?.[m]??0;let s=1/0,l=-1/0;if(c)s=p[e+2]+r+t,l=p[e+5]+r+t;else{if(f[0]=p[e],f[1]=p[e+1],f[2]=p[e+2],f[3]=p[e+3],f[4]=p[e+4],f[5]=p[e+5],0!==r){const e=U(r);e.localOrigin=n.transform.position,e.applyToAabb(f)}const s=Math.max(Math.abs(f[3]),Math.abs(f[0])),a=Math.max(Math.abs(f[4]),Math.abs(f[1])),l=t+f[5]+i;o.expandElevationRangeValues(t+f[2],Math.sqrt(s*s+a*a+l*l)-i)}o.expandElevationRangeValues(s,l),h=Math.min(h,s),g=Math.max(g,l)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=h,this._elevationRangeCacheMax=g}intersect(e,t,i,o,n,r,s){const a=e,{transform:l}=a,{position:c}=l;return null!=n&&(n.localOrigin=c),a.intersectionGeometry.intersect(t,i,o,n,a.componentData.verticalOffsets,l,r,s)}addEdges(e,t,i,o,n){const r=e,{indices:s,positions:a}=r.intersectionGeometry,l=r.componentData.offsets;return t.addComponentObject(r,a,s,l,i,o,n)}async extractEdgeInformation(e,t,i){const o=e,n=o.componentData.visibility;if(n.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await import("../../lib/edgeRendering/edgeProcessing.js");return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:s,positions:a}=o.intersectionGeometry,m=o.componentData.offsets,{EdgeInputBufferLayout:p}=await import("../../lib/edgeRendering/bufferLayouts.js"),f=p.createBuffer(a.length/3);c(f.position.typedBuffer,a,f.position.typedBufferStride,3),l(f.position,f.position,o.transform.rotationScale),this._setComponentIndices(f.componentIndex,s,m);const h=f.count,g=this._computeVisibilityIndices(s,n,m,h);return{origin:r(o.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:g,indicesLength:g.length,skipDeduplicate:!0,data:f,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let o=0;for(let n=0;n<i.length-1;n++){const r=i[n],s=i[n+1];for(let i=r;i<s;i++){const n=t?t[i]:i;e.set(n,o)}o++}}_computeVisibilityIndices(e,t,i,n){if(e&&t.allVisible())return e;let r=0;t.forEachComponentRange(((e,t)=>(r+=i[t]-i[e],!0)));const s=o(e)?2===e?.BYTES_PER_ELEMENT||n<=65536?new Uint16Array(r):new Uint32Array(r):new Array(r);let a=0;return t.forEachComponentRange(((t,o)=>{const n=i[t],r=i[o];for(let i=n;i<r;i++)s[a++]=e?e[i]:i;return!0})),s}addComponentHighlight(e,i,o){const n=e.componentData,r=t(n.componentHighlights,o,(()=>new Uint32Array(n.count+1)));{const e=this._activeHighlightOptions.get(o)??0;this._activeHighlightOptions.set(o,e+1)}0===r[i]++&&(n.markHighlightsDirty(),this._notifyDirty()),r[n.count]++}removeComponentHighlight(e,t,i){const{componentData:o}=e,n=o.componentHighlights.get(i);if(void 0===n)return void L().warn("Removing non-existing highlight.");const r=n[t];if(0===r)return void L().warn("Removing non-existing highlight.");this._removeActiveHighlight(i);const s=n[o.count];if(r>1)return n[t]=r-1,void(n[o.count]=s-1);n[t]=0,1===s?o.componentHighlights.delete(i):n[o.count]=s-1,o.markHighlightsDirty(),this._notifyDirty()}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)L().warn("Removing non-existing highlight.");else{const o=i-t;o<0&&L().warn("Removing non-existing highlight."),o<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,o)}}clearHighlights(e){const{componentData:t}=e,{componentHighlights:i}=t;if(i.size>0){for(const e of i)this._removeActiveHighlight(e[0],e[1][t.count]);i.clear(),t.markHighlightsDirty(),this._notifyDirty()}}hasHighlightOptions(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t){const i=this._renderManager.rctx,o=e.geometry,n=o.vertices.layoutParameters,r=P.createVertex(i,N.STATIC_DRAW,o.vertices.data),s=o.indices?P.createIndex(i,N.STATIC_DRAW,o.indices):null,a=g(M(n)),l=new Uint16Array(o.vertices.count);for(let g=0;g<t.count;g++){const e=t.offsets[g],i=t.offsets[g+1],n=t.materialDataIndices[g];if(null!=o.indices)for(let t=e;t<i;t++){l[o.indices[t]]=n}else for(let t=e;t<i;t++)l[t]=n}const c=P.createVertex(i,N.STATIC_DRAW,l.buffer),m=new D(e.transform,e.toMapSpace),p=new k(i,A,new Map([["data",a],["componentIndices",q]]),new Map([["data",r],["componentIndices",c]]),s),f=new _(p,T.TRIANGLES,n,null!=s),h={cameraDepthSquared:.5,gpuMemoryEstimate:r.usedMemory+c.usedMemory+(null!=s?s.usedMemory:0)};return new v(m,f,h)}_notifyDirty(){this._renderManager.notifyDirty()}}const q=g(d().u16(V.COMPONENTINDEX));function W(e,t){return e===t?x.All:0===e?x.None:x.Some}const z=s();export{G as ComponentObjectCollection};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{p as s,J as a}from"../../../../../../chunks/vec32.js";import{freeze as i,ZEROS as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as n}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ColorMixModeEnum as p}from"../../../../layers/support/symbolColorUtils.js";import{OverlayContent as d}from"../../../../terrain/OverlayContent.js";import{ComponentTechnique as c}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as m,IntegratedMeshMode as g}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as x}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as f}from"./shader/VertexDiscardMode.js";import{MaterialBase as v,parameter as b,parameterBlock as M,MaterialParameterBlock as y}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as T}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as w}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as O}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as C}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as S}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as P}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as N}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as j}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as D,CullFaceOptions as A}from"../../../lib/basicInterfaces.js";import{OITPass as q}from"../../../lib/OITPass.js";import{advancedMRRFactors as R}from"../../../materials/pbrUtils.js";import{alphaCutoff as F}from"../../../../../../webscene/support/AlphaCutoff.js";class I extends v{constructor(e,s){super(),this.toMapSpace=s,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=R,this.emissiveFactor=i(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.objectOpacity=1,this.commonMaterialParameters=new k,this.componentParameters=new L,this.textureAlphaCutoff=F,this.alphaDiscardMode=D.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=N.Earth,this.hasOccludees=!1;const a=new j(e.position),l=o(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l,this.transformWorldFromModelTL=a.low,this.transformWorldFromModelTH=a.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return this.baseColorTexture?.glTexture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.glTexture}get textureEmissive(){return this.emissionTexture?.glTexture}get hasEmissions(){return null!=this.emissionTexture||!s(this.emissiveFactor,l)}get textureOcclusion(){return this.occlusionTexture?.glTexture}get textureNormal(){return this.normalTexture?.glTexture}acquireTechnique(e,t,r,o){const s=new m(e.context.spherical,e.context.doublePrecisionRequiresObfuscation);s.hasVertexColors=o.colors,s.hasNormals=o.hasNormals,s.textureCoordinateType=o.textureCoordinates,s.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,s.hasOcclusionTexture=null!=this.occlusionTexture,s.hasNormalTexture=null!=this.normalTexture,s.oitPass=t.identifier===T.Material&&null!=r.oitPass?r.oitPass:q.NONE,s.terrainDepthTest=t.identifier===T.Material&&r.terrainDepthTest,s.cullAboveTerrain=t.identifier===T.Material&&r.cullAboveTerrain,s.ellipsoidMode=this.ellipsoidMode,s.componentData=this.componentParameters.type,s.cullFace=this.commonMaterialParameters.cullFace,s.doubleSidedMode=this.commonMaterialParameters.doubleSided?S.View:S.None,s.hasColorTexture=null!=this.baseColorTexture;const a=this._computeWhichMaterialPass();if(s.blendingEnabled=a===E.Transparent||a===E.OpaqueAndTransparent,s.alphaDiscardMode=this.alphaDiscardMode,s.integratedMeshMode=this.isIntegratedMesh?_(r)?H(r)?g.ColorOverlayWithWater:g.ColorOverlay:g.NoOverlay:g.None,s.hasPolygonOffset=this.polygonOffsetEnabled,s.pbrMode=s.integratedMeshMode===g.ColorOverlayWithWater?P.WaterOnIntegratedMesh:this.usePBR?this.hasParametersFromSource?o.shadeNormals&&this.isIntegratedMesh?P.Disabled:P.Schematic:P.Normal:P.Disabled,s.emissionSource=null!=this.emissionTexture?C.Texture:s.pbrMode===P.Normal?C.Value:C.None,s.shadeNormals=o.shadeNormals,s.normalType=s.hasNormals?O.Compressed:O.ScreenDerivative,s.hasSlicePlane=null!=r.slicePlane&&this.commonMaterialParameters.hasSlicePlane,t.identifier===T.ShadowMap)s.output=w.Shadow,s.vertexDiscardMode=f.None;else if(t.identifier===T.ViewshedShadowMap)s.output=w.ViewshedShadow,s.vertexDiscardMode=f.None;else if(t.identifier===T.Highlight)s.output=w.Highlight,s.vertexDiscardMode=f.None;else{switch(a===E.OpaqueAndTransparent?s.vertexDiscardMode=t.transparent?f.Opaque:f.Transparent:s.vertexDiscardMode=f.None,s.output=t.output,s.receiveAmbientOcclusion=s.receiveShadows=!1,t.output){case w.Color:case w.ColorEmission:s.receiveAmbientOcclusion=o.applySSAO&&null!=r.ssao,s.hasOccludees=r.hasOccludees,s.receiveShadows=r.shadowMap.ready,s.screenSpaceReflections=null!=r.ssr.lastFrameColor,s.cloudReflections=null!=r.clouds.data;break;case w.ObjectAndLayerIdColor:s.objectAndLayerIdColor=!0}s.snowCover=this.hasSnowCover(r)}const i=e.get(c,s);return this._setClean(),i}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}submit(e,t,r){if(0===this.objectOpacity)return;const{componentData:o,renderable:s}=r,{geometry:a}=s,i=s.meta.cameraDepthSquared;o.updateHighlights(t.highlights);const{geometryRanges:l,highlightRangesMap:n,shadowmapRanges:h}=o;switch(this._computeWhichMaterialPass()){case E.Opaque:e.materialOpaque.submitDraw(this,a,l,i);break;case E.Transparent:e.materialTransparent.submitDraw(this,a,l,i);break;case E.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,a,l,i),e.materialTransparent.submitDraw(this,a,l,i);break;case E.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,a,l,i),B(t)&&e.highlightIntegratedMesh.submitDraw(this,a,l,i)}const u=this.componentParameters.castShadows!==W.None;if(u&&e.shadowMap.submitDraw(this,a,l,i),null!=n)for(const p of n)e.highlight.submitDraw(this,a,p[1],i,p[0]),u&&e.highlightShadowMap.submitDraw(this,a,p[1],i,p[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,a,l,i),u&&null!=h&&e.defaultShadowMap.submitDraw(this,a,h,i)}_computeWhichMaterialPass(){return this.isIntegratedMesh?E.IntegratedMesh:this.objectOpacity<1?E.Transparent:this.componentParameters.opaqueOverride===W.All?E.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===D.Blend||this.alphaDiscardMode===D.MaskBlend?E.Transparent:this.componentParameters.transparent===W.None?E.Opaque:this.componentParameters.transparent===W.All?E.Transparent:E.OpaqueAndTransparent}}var E,W;e([b({vectorOps:n})],I.prototype,"baseColor",void 0),e([b()],I.prototype,"usePBR",void 0),e([b()],I.prototype,"hasParametersFromSource",void 0),e([b({vectorOps:a})],I.prototype,"mrrFactors",void 0),e([b({vectorOps:a})],I.prototype,"emissiveFactor",void 0),e([b({dispose:!0})],I.prototype,"baseColorTexture",void 0),e([b({dispose:!0})],I.prototype,"metallicRoughnessTexture",void 0),e([b({dispose:!0})],I.prototype,"emissionTexture",void 0),e([b({dispose:!0})],I.prototype,"occlusionTexture",void 0),e([b({dispose:!0})],I.prototype,"normalTexture",void 0),e([b()],I.prototype,"objectOpacity",void 0),e([M()],I.prototype,"commonMaterialParameters",void 0),e([M()],I.prototype,"componentParameters",void 0),e([b()],I.prototype,"textureAlphaCutoff",void 0),e([b()],I.prototype,"alphaDiscardMode",void 0),e([b()],I.prototype,"isIntegratedMesh",void 0),e([b()],I.prototype,"polygonOffsetEnabled",void 0),e([b()],I.prototype,"ellipsoidMode",void 0),e([b()],I.prototype,"hasOccludees",void 0),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(E||(E={}));class k extends y{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=A.Back,this.hasSlicePlane=!0}}e([b()],k.prototype,"doubleSided",void 0),e([b()],k.prototype,"cullFace",void 0),e([b()],k.prototype,"hasSlicePlane",void 0);class L extends y{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=p.Multiply,this.castShadows=W.All}get transparent(){return this.externalColor[3]<1?W.All:W.None}get opaqueOverride(){return this.externalColorMixMode===p.Replace&&1===this.externalColor[3]?W.All:W.None}get visible(){return this.externalColor[3]>0?W.All:W.None}get type(){return x.Uniform}}e([b({vectorOps:n})],L.prototype,"externalColor",void 0),e([b()],L.prototype,"externalColorMixMode",void 0),e([b()],L.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(W||(W={}));class V extends y{constructor(){super(...arguments),this.texture=null,this.transparent=W.None,this.opaqueOverride=W.None,this.castShadows=W.None}get type(){return x.Varying}}function B(e){return null!=e.overlay?.getTexture(d.Highlight)}function H(e){return null!=e.overlay?.getTexture(d.WaterNormal)}function _(e){return null!=e.overlay?.getTexture(d.ColorNoRasterImage)}e([b()],V.prototype,"texture",void 0),e([b()],V.prototype,"transparent",void 0),e([b()],V.prototype,"opaqueOverride",void 0),e([b()],V.prototype,"castShadows",void 0);export{k as CommonMaterialParameters,I as ComponentMaterial,W as ComponentParameterSummary,L as ComponentParametersUniform,V as ComponentParametersVarying};
|
|
5
|
+
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{p as s,J as a}from"../../../../../../chunks/vec32.js";import{freeze as i,ZEROS as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as n}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ColorMixModeEnum as p}from"../../../../layers/support/symbolColorUtils.js";import{OverlayContent as c}from"../../../../terrain/OverlayContent.js";import{ComponentTechnique as d}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as m,IntegratedMeshMode as g}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as f}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as x}from"./shader/VertexDiscardMode.js";import{MaterialBase as v,parameter as b,parameterBlock as M,MaterialParameterBlock as y}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as T}from"../../../core/renderPasses/RenderPassIdentifier.js";import{ShaderOutput as w}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalType as O}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as C}from"../../../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as S}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as P}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as N}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as j}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as D,CullFaceOptions as q}from"../../../lib/basicInterfaces.js";import{OITPass as A}from"../../../lib/OITPass.js";import{advancedMRRFactors as R}from"../../../materials/pbrUtils.js";import{defaultHighlightName as F}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as I}from"../../../../../../webscene/support/AlphaCutoff.js";class E extends v{constructor(e,s){super(),this.toMapSpace=s,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=R,this.emissiveFactor=i(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.commonMaterialParameters=new L,this.componentParameters=new V,this.objectOpacity=1,this.textureAlphaCutoff=I,this.alphaDiscardMode=D.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=N.Earth,this.hasOccludees=!1;const a=new j(e.position),l=o(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l,this.transformWorldFromModelTL=a.low,this.transformWorldFromModelTH=a.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return this.baseColorTexture?.glTexture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.glTexture}get textureEmissive(){return this.emissionTexture?.glTexture}get hasEmissions(){return null!=this.emissionTexture||!s(this.emissiveFactor,l)}get textureOcclusion(){return this.occlusionTexture?.glTexture}get textureNormal(){return this.normalTexture?.glTexture}acquireTechnique(e,t,r,o){const s=new m(e.context.spherical,e.context.doublePrecisionRequiresObfuscation);s.hasVertexColors=o.colors,s.hasNormals=o.hasNormals,s.textureCoordinateType=o.textureCoordinates,s.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,s.hasOcclusionTexture=null!=this.occlusionTexture,s.hasNormalTexture=null!=this.normalTexture,s.oitPass=t.identifier===T.Material&&null!=r.oitPass?r.oitPass:A.NONE,s.terrainDepthTest=t.identifier===T.Material&&r.terrainDepthTest,s.cullAboveTerrain=t.identifier===T.Material&&r.cullAboveTerrain,s.ellipsoidMode=this.ellipsoidMode,s.componentData=this.componentParameters.type,s.cullFace=this.commonMaterialParameters.cullFace,s.doubleSidedMode=this.commonMaterialParameters.doubleSided?S.View:S.None,s.hasColorTexture=null!=this.baseColorTexture;const a=this._computeWhichMaterialPass();if(s.blendingEnabled=a===W.Transparent||a===W.OpaqueAndTransparent,s.alphaDiscardMode=this.alphaDiscardMode,s.integratedMeshMode=this.isIntegratedMesh?U(r)?_(r)?g.ColorOverlayWithWater:g.ColorOverlay:g.NoOverlay:g.None,s.hasPolygonOffset=this.polygonOffsetEnabled,s.pbrMode=s.integratedMeshMode===g.ColorOverlayWithWater?P.WaterOnIntegratedMesh:this.usePBR?this.hasParametersFromSource?o.shadeNormals&&this.isIntegratedMesh?P.Disabled:P.Schematic:P.Normal:P.Disabled,s.emissionSource=null!=this.emissionTexture?C.Texture:s.pbrMode===P.Normal?C.Value:C.None,s.shadeNormals=o.shadeNormals,s.normalType=s.hasNormals?O.Compressed:O.ScreenDerivative,s.hasSlicePlane=null!=r.slicePlane&&this.commonMaterialParameters.hasSlicePlane,t.identifier===T.ShadowMap)s.output=w.Shadow,s.vertexDiscardMode=x.None;else if(t.identifier===T.ViewshedShadowMap)s.output=w.ViewshedShadow,s.vertexDiscardMode=x.None;else if(t.identifier===T.Highlight)s.output=w.Highlight,s.vertexDiscardMode=x.None;else{switch(a===W.OpaqueAndTransparent?s.vertexDiscardMode=t.transparent?x.Opaque:x.Transparent:s.vertexDiscardMode=x.None,s.output=t.output,s.receiveAmbientOcclusion=s.receiveShadows=!1,t.output){case w.Color:case w.ColorEmission:s.receiveAmbientOcclusion=o.applySSAO&&null!=r.ssao,s.hasOccludees=r.hasOccludees,s.receiveShadows=r.shadowMap.ready,s.screenSpaceReflections=null!=r.ssr.lastFrameColor,s.cloudReflections=null!=r.clouds.data;break;case w.ObjectAndLayerIdColor:s.objectAndLayerIdColor=!0}s.snowCover=this.hasSnowCover(r)}const i=e.get(d,s);return this._setClean(),i}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:o,renderable:s}=r,{geometry:a}=s,i=s.meta.cameraDepthSquared;o.updateHighlights(t.highlights);const{geometryRanges:l,highlightRangesMap:n,shadowmapRanges:h}=o;switch(this._computeWhichMaterialPass()){case W.Opaque:e.opaque.submitDraw(this,a,l,i);break;case W.Transparent:e.transparent.submitDraw(this,a,l,i);break;case W.OpaqueAndTransparent:e.opaque.submitDraw(this,a,l,i),e.transparent.submitDraw(this,a,l,i);break;case W.IntegratedMesh:e.integratedMesh.submitDraw(this,a,l,i),H(t)&&e.highlightIntegratedMesh.submitDraw(this,a,l,i)}if(this.componentParameters.castShadows!==k.None){if(null!=n)for(const t of n)t[0]===F&&e.highlightShadowMap.submitDraw(this,a,t[1],i,t[0]);null!=h&&e.nonHighlightShadowMap.submitDraw(this,a,h,i),e.shadowMap.submitDraw(this,a,l,i)}if(null!=n)for(const u of n)e.highlight.submitDraw(this,a,u[1],i,u[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,a,l,i)}_computeWhichMaterialPass(){if(this.isIntegratedMesh)return W.IntegratedMesh;if(this.objectOpacity<1)return W.Transparent;if(this.componentParameters.opaqueOverride===k.All)return W.Opaque;if(this.baseColor[3]<1||this.alphaDiscardMode===D.Blend||this.alphaDiscardMode===D.MaskBlend)return W.Transparent;switch(this.componentParameters.transparent){case k.None:return W.Opaque;case k.All:return W.Transparent;case k.Some:return W.OpaqueAndTransparent}}}var W,k;e([b({vectorOps:n})],E.prototype,"baseColor",void 0),e([b()],E.prototype,"usePBR",void 0),e([b()],E.prototype,"hasParametersFromSource",void 0),e([b({vectorOps:a})],E.prototype,"mrrFactors",void 0),e([b({vectorOps:a})],E.prototype,"emissiveFactor",void 0),e([b({dispose:!0})],E.prototype,"baseColorTexture",void 0),e([b({dispose:!0})],E.prototype,"metallicRoughnessTexture",void 0),e([b({dispose:!0})],E.prototype,"emissionTexture",void 0),e([b({dispose:!0})],E.prototype,"occlusionTexture",void 0),e([b({dispose:!0})],E.prototype,"normalTexture",void 0),e([M()],E.prototype,"commonMaterialParameters",void 0),e([M()],E.prototype,"componentParameters",void 0),e([b()],E.prototype,"objectOpacity",void 0),e([b()],E.prototype,"textureAlphaCutoff",void 0),e([b()],E.prototype,"alphaDiscardMode",void 0),e([b()],E.prototype,"isIntegratedMesh",void 0),e([b()],E.prototype,"polygonOffsetEnabled",void 0),e([b()],E.prototype,"ellipsoidMode",void 0),e([b()],E.prototype,"hasOccludees",void 0),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(W||(W={}));class L extends y{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=q.Back,this.hasSlicePlane=!0}}e([b()],L.prototype,"doubleSided",void 0),e([b()],L.prototype,"cullFace",void 0),e([b()],L.prototype,"hasSlicePlane",void 0);class V extends y{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=p.Multiply,this.castShadows=k.All}get transparent(){return this.externalColor[3]<1?k.All:k.None}get opaqueOverride(){return this.externalColorMixMode===p.Replace&&1===this.externalColor[3]?k.All:k.None}get visible(){return this.externalColor[3]>0?k.All:k.None}get type(){return f.Uniform}}e([b({vectorOps:n})],V.prototype,"externalColor",void 0),e([b()],V.prototype,"externalColorMixMode",void 0),e([b()],V.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(k||(k={}));class B extends y{constructor(){super(...arguments),this.texture=null,this.transparent=k.None,this.opaqueOverride=k.None,this.castShadows=k.None}get type(){return f.Varying}}function H(e){return null!=e.overlay?.getTexture(c.Highlight)}function _(e){return null!=e.overlay?.getTexture(c.WaterNormal)}function U(e){return null!=e.overlay?.getTexture(c.ColorNoRasterImage)}e([b()],B.prototype,"texture",void 0),e([b()],B.prototype,"transparent",void 0),e([b()],B.prototype,"opaqueOverride",void 0),e([b()],B.prototype,"castShadows",void 0);export{L as CommonMaterialParameters,E as ComponentMaterial,k as ComponentParameterSummary,V as ComponentParametersUniform,B as ComponentParametersVarying};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{neverReached as o}from"../../../../../../../core/compilerUtils.js";import{packFloatRGBA as e}from"../../../../../../../core/floatRGBA.js";import{DecodeSymbolColor as r}from"./DecodeSymbolColor.glsl.js";import{ShaderOutput as t}from"../../../../core/shaderLibrary/ShaderOutput.js";import{RgbaFloatEncoding as n}from"../../../../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float4DrawUniform as a}from"../../../../core/shaderModules/Float4DrawUniform.js";import{glsl as d}from"../../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as
|
|
5
|
+
import{neverReached as o}from"../../../../../../../core/compilerUtils.js";import{packFloatRGBA as e}from"../../../../../../../core/floatRGBA.js";import{DecodeSymbolColor as r}from"./DecodeSymbolColor.glsl.js";import{ShaderOutput as t}from"../../../../core/shaderLibrary/ShaderOutput.js";import{RgbaFloatEncoding as n}from"../../../../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float4DrawUniform as a}from"../../../../core/shaderModules/Float4DrawUniform.js";import{glsl as d,If as l}from"../../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as c}from"../../../../core/shaderModules/IntegerDrawUniform.js";import{Texture2DDrawUniform as i}from"../../../../core/shaderModules/Texture2DDrawUniform.js";import{olidEnabled as s}from"../../../../effects/geometry/olidUtils.js";import{VertexAttribute as x}from"../../../../lib/VertexAttribute.js";var C;!function(o){o[o.Uniform=0]="Uniform",o[o.Varying=1]="Varying",o[o.COUNT=2]="COUNT"}(C||(C={}));const m=429496.7296;function f(o,r){e(o/m*.5+.5,r)}function u(e,r){switch(r.componentData){case C.Varying:return v(e,r);case C.Uniform:return p(e,r);case C.COUNT:return;default:o(r.componentData)}}function v(o,e){const{vertex:a,fragment:l}=o;a.include(n),a.uniforms.add(new i("componentColorTex",(o=>o.componentParameters.texture.texture))),o.attributes.add(x.COMPONENTINDEX,"float"),o.varyings.add("vExternalColorMixMode","mediump float"),o.varyings.add("vExternalColor","vec4");const c=e.output===t.ObjectAndLayerIdColor;c&&o.varyings.add("vObjectAndLayerIdColor","vec4"),o.include(r),a.constants.add("stride","float",s()?3:2),a.code.add(d`vec2 getComponentTextureCoordinates(float componentIndex, float typeOffset) {
|
|
6
6
|
float index = componentIndex * stride + typeOffset;
|
|
7
7
|
float texSize = float(textureSize(componentColorTex, 0).x);
|
|
8
8
|
float coordX = mod(index, texSize);
|
|
@@ -17,10 +17,10 @@ return vec2(coordX, coordY) + 0.5;
|
|
|
17
17
|
float readElevationOffset() {
|
|
18
18
|
vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 1.0);
|
|
19
19
|
vec4 encodedElevation = texelFetch(componentColorTex, ivec2(textureCoordinates), 0);
|
|
20
|
-
return uninterpolatedRGBAToFloat(encodedElevation) * ${d.float(
|
|
20
|
+
return uninterpolatedRGBAToFloat(encodedElevation) * ${d.float(m)};
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
${
|
|
23
|
+
${c?d`
|
|
24
24
|
void forwardObjectAndLayerIdColor() {
|
|
25
25
|
vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 2.0);
|
|
26
26
|
vObjectAndLayerIdColor = texelFetch(componentColorTex, ivec2(textureCoordinates), 0);
|
|
@@ -46,9 +46,9 @@ return vec2(coordX, coordY) + 0.5;
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
void outputObjectAndLayerIdColor() {
|
|
49
|
-
${
|
|
49
|
+
${c?d`fragColor = vObjectAndLayerIdColor;`:""}
|
|
50
50
|
}
|
|
51
|
-
`)}function
|
|
51
|
+
`)}function p(o,e){const{vertex:r,fragment:n}=o;o.varyings.add("vExternalColor","vec4"),r.uniforms.add(new a("externalColor",(o=>o.componentParameters.externalColor))).code.add(d`float readElevationOffset() {
|
|
52
52
|
return 0.0;
|
|
53
53
|
}
|
|
54
54
|
void forwardObjectAndLayerIdColor() {}
|
|
@@ -56,13 +56,13 @@ vec4 forwardExternalColor(out bool castShadows) {
|
|
|
56
56
|
vExternalColor = externalColor;
|
|
57
57
|
castShadows = true;
|
|
58
58
|
return externalColor;
|
|
59
|
-
}`);const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
}`);const i=e.output===t.ObjectAndLayerIdColor;n.uniforms.add(new c("externalColorMixMode",(o=>o.componentParameters.externalColorMixMode))).code.add(d`
|
|
60
|
+
void readExternalColor(out vec4 color, out int colorMixMode) {
|
|
61
|
+
color = vExternalColor;
|
|
62
|
+
colorMixMode = externalColorMixMode;
|
|
63
|
+
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
`)}export{
|
|
65
|
+
void outputObjectAndLayerIdColor() {
|
|
66
|
+
${l(i,"fragColor = vec4(0, 0, 0, 0);")}
|
|
67
|
+
}
|
|
68
|
+
`)}export{u as ComponentData,C as ComponentDataType,f as encodeElevationOffset,m as maxElevationOffset};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{create as
|
|
5
|
+
import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderPass as s,RenderPassSorting as e}from"./RenderPass.js";import{RenderPassIdentifier as i}from"./RenderPassIdentifier.js";import{ShaderOutput as r}from"../shaderLibrary/ShaderOutput.js";import{VertexNormalPassParameters as n,VertexNormalDrawParameters as o}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class a{constructor(t){const i=t.renderContext.rctx,r=t.techniques;this.opaque=new s(i,r),this.transparent=new s(i,r,e.BackToFront),this.integratedMesh=new s(i,r),this.shadowMap=new s(i,r),this.highlight=new s(i,r),this.highlightIntegratedMesh=new s(i,r),this.highlightShadowMap=new s(i,r),this.viewshedShadowMap=new s(i,r),this.nonHighlightShadowMap=new s(i,r)}}class h extends n{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin,this.modelTransformation=null}}class c extends o{}class d extends h{constructor(){super(...arguments),this.identifier=i.Material,this.output=r.Color,this.transparent=!1}}class l extends h{constructor(){super(...arguments),this.identifier=i.ShadowMap}}class p extends h{constructor(){super(...arguments),this.identifier=i.Highlight}}class u extends h{constructor(){super(...arguments),this.identifier=i.ViewshedShadowMap}}export{a as AllRenderPasses,c as DrawParameters,p as HighlightPassParameters,d as MaterialPassParameters,h as PassParameters,l as ShadowMapPassParameters,u as ViewshedShadowMapPassParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../core/PooledArray.js";import{RenderPassIdentifier as t}from"./
|
|
5
|
+
import e from"../../../../../core/PooledArray.js";import{RenderPassIdentifier as t}from"./RenderPassIdentifier.js";import{OITPass as r}from"../../lib/OITPass.js";import{DataType as i}from"../../../../webgl/enums.js";var s;!function(e){e[e.FrontToBack=0]="FrontToBack",e[e.BackToFront=1]="BackToFront"}(s||(s={}));class n{constructor(t,r,i=s.FrontToBack){this._rctx=t,this._techniques=r,this._sorting=i,this._draws=new e({allocator:e=>e??{material:null,geometry:null,geometryRanges:null,bindDrawParams:null,depthSquaredHint:0,indexType:0}}),this._previouslyBoundDraw=new Map}submitDraw(e,t,r,i,s){const n=this._draws.pushNew();n.geometry=t,n.geometryRanges=r,n.material=e,n.depthSquaredHint=i,n.indexType=(t.indexed?t.vao.indexBuffer.indexType:null)??0,n.highlightName=s}acquire(e,t){return this._draws.map((r=>r.material.acquireTechnique(this._techniques,e,t,r.geometry.parameters)))}dispatch(e,i,s){const n=this._rctx;this._previouslyBoundDraw.clear();let a=null;const h=this._draws.length,l=i.highlight?.name;for(let c=0;c<h;c++){const h=this._draws.data[c];if(e.identifier===t.Highlight){const e=h.highlightName;if(e){if(e!==l)continue}else if(!l||!i.overlay?.hasHighlightOptions(l))continue}const d=s[c];d===a&&i.oitPass===r.NONE||(n.bindTechnique(d,i,e),a=d);const{geometryRanges:u,indexType:m,geometry:g,material:p}=h;n.bindVAO(g.vao),this._previouslyBoundDraw.get(d)!==p&&(d.program.bindDraw(i,e,p),this._previouslyBoundDraw.set(d,p));const y=u.length,{primitiveType:w}=g;for(let e=0;e<y;e+=2){const t=u[e],r=u[e+1];if(0!==m){const e=o.get(m);n.drawElements(w,r,m,t*e)}else n.drawArrays(w,t,r)}}}prepareSubmit(){this._draws.clear()}finishSubmit(){const e=this._sorting===s.FrontToBack?1:-1;this._draws.sort(((t,r)=>{const i=e*(t.depthSquaredHint-r.depthSquaredHint);return 0!==i?i:t.geometry.vao.byteSize-r.geometry.vao.byteSize}))}get count(){return this._draws.length}}const o=new Map;o.set(i.UNSIGNED_BYTE,1),o.set(i.UNSIGNED_SHORT,2),o.set(i.UNSIGNED_INT,4);export{n as RenderPass,s as RenderPassSorting};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
var a;!function(a){a[a.Material=0]="Material",a[a.ShadowMap=1]="ShadowMap",a[a.Highlight=2]="Highlight",a[a.ViewshedShadowMap=3]="ViewshedShadowMap"}(a||(a={}));export{a as RenderPassIdentifier};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as s}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as e}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as t,transpose as
|
|
5
|
+
import{_ as s}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as e}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as t,transpose as r,invert as a}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as o}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{i as h,c as n}from"../../../../../chunks/vec32.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as c,ShadowMapPassParameters as l,HighlightPassParameters as p,ViewshedShadowMapPassParameters as u,AllRenderPasses as d}from"./AllRenderPasses.js";import{RenderPassIdentifier as _}from"./RenderPassIdentifier.js";import{ShaderOutput as P}from"../shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as g}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as w}from"../../effects/RenderPlugin.js";import{DepthRange as f}from"../../lib/DepthRange.js";import{RenderSlot as R}from"../../lib/RenderSlot.js";let E=class extends w{constructor(){super({}),this.produces=new Map([[R.OPAQUE_MATERIAL,s=>this._produces(s,R.OPAQUE_MATERIAL)],[R.TRANSPARENT_MATERIAL,s=>this._produces(s,R.TRANSPARENT_MATERIAL)],[R.INTEGRATED_MESH,s=>this._produces(s,R.INTEGRATED_MESH)]]),this._materialPassParameters=new c,this._shadowPassParameters=new l,this._highlightPassParameters=new p,this._viewshedPassParameters=new u,this._systems=new Set}initializeRenderContext(s){this._context=s,this._passes=new d(s)}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.clear()}register(s){this._systems.add(s)}_produces(s,e){return!!this._invoke(s,e,(s=>s.count>0))}prepareRender(s){if(0!==this._systems.size&&null!=this._passes){for(const s of Object.values(this._passes))s.prepareSubmit();this._systems.forEach((e=>e.submit(this._passes,s.bind)));for(const s of Object.values(this._passes))s.finishSubmit()}}acquireTechniques(s){if(0===this._systems.size)return null;const e=s.output===P.Shadow||s.output===P.ShadowHighlight||s.output===P.ShadowExcludeHighlight?this._shadowPassParameters:s.output===P.ViewshedShadow?this._viewshedPassParameters:s.output===P.Highlight?this._highlightPassParameters:this._materialPassParameters,t=s.bind;return this._updateParameters(t.camera,e,t.slot===R.TRANSPARENT_MATERIAL),this._materialPassParameters.output=s.output,this._invoke(s.output,s.bind.slot,((e,t)=>e.acquire(t,s.bind)))}render(s,e){this._invoke(s.output,s.bind.slot,((t,r)=>t.dispatch(r,s.bind,e)))}_invoke(s,e,t){if(null==this._passes)return null;switch(e){case R.OPAQUE_MATERIAL:switch(s){case P.Color:case P.ColorEmission:case P.Depth:case P.Normal:case P.ObjectAndLayerIdColor:return t(this._passes.opaque,this._materialPassParameters);case P.Highlight:return t(this._passes.highlight,this._highlightPassParameters);case P.Shadow:return t(this._passes.shadowMap,this._shadowPassParameters);case P.ShadowHighlight:return t(this._passes.highlightShadowMap,this._shadowPassParameters);case P.ShadowExcludeHighlight:return t(this._passes.nonHighlightShadowMap,this._shadowPassParameters);case P.ViewshedShadow:return t(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case R.TRANSPARENT_MATERIAL:switch(s){case P.Color:case P.ColorEmission:case P.Depth:case P.Normal:case P.ObjectAndLayerIdColor:return t(this._passes.transparent,this._materialPassParameters)}break;case R.INTEGRATED_MESH:switch(s){case P.Color:case P.ColorEmission:case P.Depth:case P.Normal:case P.ObjectAndLayerIdColor:return t(this._passes.integratedMesh,this._materialPassParameters);case P.Highlight:return t(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(s){const e=new f;return this._systems.forEach((t=>e.union(t.queryDepthRange(s)))),e}get hasEmissions(){let s=!1;return this._systems.forEach((e=>s=e.hasEmissions||s)),s}_updateParameters(s,e,i){const m=s.viewInverseTransposeMatrix;h(A,m[3],m[7],m[11]),S.set(A),n(e.transformWorldFromViewTH,S.high),n(e.transformWorldFromViewTL,S.low),n(e.slicePlaneLocalOrigin,A),t(e.transformViewFromCameraRelativeRS,s.viewMatrix),o(e.transformProjFromView,s.projectionMatrix),e.identifier===_.Material&&(this._materialPassParameters.transparent=i,r(b,e.transformViewFromCameraRelativeRS),a(e.transformNormalViewFromGlobal,b))}hasHighlightOptions(s){for(const e of this._systems)if(e.hasHighlightOptions(s))return!0;return!1}};E=s([e("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],E);const A=m(),b=i(),S=new g;export{E as RenderPassManager};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{OverlayIndex as a}from"../../../../terrain/interfaces.js";import{OverlayContent as l}from"../../../../terrain/OverlayContent.js";import{RenderPassIdentifier as i}from"../../renderPasses/
|
|
5
|
+
import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{OverlayIndex as a}from"../../../../terrain/interfaces.js";import{OverlayContent as l}from"../../../../terrain/OverlayContent.js";import{RenderPassIdentifier as i}from"../../renderPasses/RenderPassIdentifier.js";import{isColorOrColorEmission as n,ShaderOutput as v}from"../ShaderOutput.js";import{addMainLightDirection as d,addMainLightIntensity as s}from"../shading/MainLighting.glsl.js";import{PBRMode as c}from"../shading/PhysicallyBasedRenderingParameters.glsl.js";import{Water as x}from"../shading/Water.glsl.js";import{Float4DrawUniform as u}from"../../shaderModules/Float4DrawUniform.js";import{FloatPassUniform as y}from"../../shaderModules/FloatPassUniform.js";import{glsl as m}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as p}from"../../shaderModules/Texture2DPassUniform.js";import{Uniform as f}from"../../../../../webgl/Uniform.js";var C;function g(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new u("overlayTexOffset",((e,o)=>b(e,o))),new u("overlayTexScale",((e,o)=>V(e,o)))),t.constants.add("overlayOpacity","float",1),t.uniforms.add(new p("ovColorTex",((e,o)=>T(e,o)))),h(e,o)}function O(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new w("overlayTexOffset"),new w("overlayTexScale")),t.uniforms.add(new y("overlayOpacity",(e=>e.overlayOpacity)),new p("ovColorTex",((e,o)=>o.overlay?.getTexture(e.overlayContent)))),h(e,o)}function h(e,o){const r=o.pbrMode===c.Water||o.pbrMode===c.WaterOnIntegratedMesh||o.pbrMode===c.TerrainWithWater;r&&e.include(x,o);const{vertex:t,fragment:a}=e;e.varyings.add("vtcOverlay","vec4"),t.code.add(m`void setOverlayVTC(in vec2 uv) {
|
|
6
6
|
vtcOverlay = vec4(uv, uv) * overlayTexScale + overlayTexOffset;
|
|
7
7
|
}`),a.code.add(m`bool isValid(vec2 uv, vec2 dxdy) {
|
|
8
8
|
return (uv.x >= 0.0 + dxdy.x) && (uv.x <= 1.0 - dxdy.x) && (uv.y >= 0.0 + dxdy.y) && (uv.y <= 1.0 - dxdy.y);
|
|
@@ -38,7 +38,7 @@ return
|
|
|
38
38
|
isValidInner ? texelValueInner :
|
|
39
39
|
isValidOuter ? texelValueOuter :
|
|
40
40
|
vec2(0.0);
|
|
41
|
-
}`),r&&(
|
|
41
|
+
}`),r&&(d(a),s(a),a.code.add(m`vec4 getOverlayWaterColor(vec4 maskInput, vec4 colorInput, vec3 vposEyeDir,
|
|
42
42
|
float shadow, vec3 localUp, mat3 tbn, vec3 position, vec3 positionWorld) {
|
|
43
43
|
vec3 n = normalize(tbn * (2.0 * maskInput.rgb - vec3(1.0)));
|
|
44
44
|
vec3 v = vposEyeDir;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{Milliseconds as t}from"../../../../core/time.js";class e{constructor(e,
|
|
5
|
+
import{Milliseconds as t}from"../../../../core/time.js";class e{constructor(e,s){this._camera=e,this._dt=t(0),this._time=t(0),this._lastUpdate=t(0),this._lastUpdate=s,this._time=s}advance(e,s,i){const a=t(s-this._lastUpdate);this._dt=t(a/i),this._time=t(this._time+a),this._lastUpdate=s,this._camera=e}get camera(){return this._camera}get dt(){return this._dt}get time(){return this._time}}export{e as AnimationTimer};
|