@arcgis/core 5.2.0-next.33 → 5.2.0-next.35
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/analysis/Viewshed.d.ts +0 -5
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{39c994536ce6c1e5c956.js → 03350a56f840cffe5459.js} +1 -1
- package/assets/esri/core/workers/chunks/{2628136bf9f47d238a24.js → 050aba7089318e1c7d53.js} +1 -1
- package/assets/esri/core/workers/chunks/{dd5dddf7e422216d3806.js → 0a2f08298a3c932614f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{a844c4e031e77db11478.js → 0df978697328b6453c94.js} +1 -1
- package/assets/esri/core/workers/chunks/0f8fcbd0650b6a924f75.js +1 -0
- package/assets/esri/core/workers/chunks/{83ae56c7fa8d84865605.js → 0f976bfb7db98c2c0e05.js} +1 -1
- package/assets/esri/core/workers/chunks/10510f76f8538c2dfb84.js +1 -0
- package/assets/esri/core/workers/chunks/{9508fa53da5f92a0ab70.js → 155940ef3d1888272d73.js} +1 -1
- package/assets/esri/core/workers/chunks/{3f63b14b53b5ca716e3a.js → 18c4c437ded8bfbd3305.js} +1 -1
- package/assets/esri/core/workers/chunks/{b60f24a6c777301803f4.js → 1958facb000b6c16bfe4.js} +1 -1
- package/assets/esri/core/workers/chunks/{1664434dc7a67c8ce453.js → 1ad5fcae6d6a9801cf58.js} +1 -1
- package/assets/esri/core/workers/chunks/{390fda094fa8695d98cf.js → 22c447fcc9a28afeb6e3.js} +1 -1
- package/assets/esri/core/workers/chunks/24aa98cb2021ddd789ce.js +1 -0
- package/assets/esri/core/workers/chunks/{7656900713e55036c3c1.js → 29542a3d7f3fa8d42380.js} +1 -1
- package/assets/esri/core/workers/chunks/{1e386475937e02b3f523.js → 2b669473aa2c7cfb63c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8091e8fd7ca43a4490a.js → 2bb3494659609594c4ca.js} +1 -1
- package/assets/esri/core/workers/chunks/2c00f89030c7a4201033.js +2 -0
- package/assets/esri/core/workers/chunks/{b75a4753cea6544da8bb.js → 2c61bb25578f73ba49bc.js} +1 -1
- package/assets/esri/core/workers/chunks/2d92f0042facb55edcff.js +1 -0
- package/assets/esri/core/workers/chunks/2da797ae5af9d2ede42d.js +1 -0
- package/assets/esri/core/workers/chunks/{34eb22ee13df24271532.js → 2e495a28494c2351837b.js} +1 -1
- package/assets/esri/core/workers/chunks/{a0b78cbeb0e53107d819.js → 367a3031abbeff0c0090.js} +1 -1
- package/assets/esri/core/workers/chunks/{aba7a053015a9738d8a0.js → 368db1420b8520beae05.js} +1 -1
- package/assets/esri/core/workers/chunks/{92458803531fdfe1557a.js → 38a6a7c56c592f336a12.js} +1 -1
- package/assets/esri/core/workers/chunks/{c63b315c6b76b4860fc5.js → 39ff5b2a05a90e1cb214.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a52373c4ba652e0ee0f.js → 3b914ca36e7e2b00cfe6.js} +1 -1
- package/assets/esri/core/workers/chunks/{f6afc597eaf2afa9a4a0.js → 3dd8145ef89f32920177.js} +1 -1
- package/assets/esri/core/workers/chunks/{b289c46ce2dc04d32e81.js → 3e8fa2a7a36881234479.js} +1 -1
- package/assets/esri/core/workers/chunks/406c7723e8db470822bf.js +1 -0
- package/assets/esri/core/workers/chunks/{5bf01e0eff8a78b65e9e.js → 4656a4bf430d7eed1465.js} +1 -1
- package/assets/esri/core/workers/chunks/{43ef6dee2e1d9ed7885e.js → 472ec242cd3070e6acfe.js} +1 -1
- package/assets/esri/core/workers/chunks/{1bbf5f5da5842b93f638.js → 4f08b69f4a33a114c5f7.js} +1 -1
- package/assets/esri/core/workers/chunks/{c60b4f2dd5fccdf362a7.js → 514ab968c0d75062e6ab.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba1c4a8794ac55942e35.js → 51d7145f748b4865de7f.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f40193d1b2e534c5226.js → 570a4725b2a4a19c5148.js} +1 -1
- package/assets/esri/core/workers/chunks/{1305690054214a9cf48d.js → 586ca90e46f5cbdfeece.js} +1 -1
- package/assets/esri/core/workers/chunks/595401947e74a0a67144.js +1 -0
- package/assets/esri/core/workers/chunks/{70cb825bb37f1977d2ab.js → 59c22bab85f9cdbb9948.js} +1 -1
- package/assets/esri/core/workers/chunks/{b624796ff4a9d4c406bf.js → 61efc7f5fab1c2b1f764.js} +1 -1
- package/assets/esri/core/workers/chunks/{c593539c2cce7a2b9d44.js → 6596b12bb286a0b45a68.js} +1 -1
- package/assets/esri/core/workers/chunks/{bb1fad01d9f070e7d795.js → 661f50cb97604453f942.js} +1 -1
- package/assets/esri/core/workers/chunks/{51a53011478e0cf96e0b.js → 6c02493a1c1deff49c7e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7832d94f35b79e27ee51.js → 6c746ac4bd2e57b8cb41.js} +1 -1
- package/assets/esri/core/workers/chunks/{71f09e34d56c9fe5c307.js → 6d72a1bdc2664df62c4c.js} +1 -1
- package/assets/esri/core/workers/chunks/{4ea325c829d3b82854b1.js → 7085b4c655a19694da04.js} +1 -1
- package/assets/esri/core/workers/chunks/{9f3d37e5f42bf1529673.js → 71b672259bac2befd9c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{a536904fe6f3b16fdbdc.js → 757982a73174aa7ab0d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0321dd4b5b2d863eecd.js → 777b16b76db406c99c69.js} +1 -1
- package/assets/esri/core/workers/chunks/{32b5d2537feefe6e94a3.js → 7d65a8ec5e1f871b9321.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe42fa2144691b9186fd.js → 828b64624c76156a6416.js} +1 -1
- package/assets/esri/core/workers/chunks/857532de88f21e8c3466.js +1 -0
- package/assets/esri/core/workers/chunks/85a280ee915010a8da3c.js +1 -0
- package/assets/esri/core/workers/chunks/{3d1e5bfd88771d4a0bf6.js → 866950e9ab96aebc6b32.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c62e2dabd1f1e13d244.js → 86731e276b31453bc235.js} +1 -1
- package/assets/esri/core/workers/chunks/{25932fa010f9a32475c1.js → 88ec63501fa2f6fdadca.js} +1 -1
- package/assets/esri/core/workers/chunks/8a9b2efa0603e9fa4e8b.js +1 -0
- package/assets/esri/core/workers/chunks/{af3b060fdfa3b6174340.js → 8aa5bbf9a9b09815725a.js} +1 -1
- package/assets/esri/core/workers/chunks/{2353fbc1ff4481dcfb1f.js → 8b68a69ab8fb1679e7b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{35b3ff25f5fe24fe15e2.js → 96860b6035e0b06672dd.js} +1 -1
- package/assets/esri/core/workers/chunks/{e2f33945d838183a2192.js → 98685bd149dee1d6dc99.js} +1 -1
- package/assets/esri/core/workers/chunks/{122892f365f5327d290c.js → 9de9cec5c644bc452294.js} +1 -1
- package/assets/esri/core/workers/chunks/{456b77b8f13933a75b68.js → 9fb0431b0628dcb53004.js} +54 -54
- package/assets/esri/core/workers/chunks/{940ebb13618d38c6b459.js → a2a688dd2ed4565e01ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{47f21b65065558d583ca.js → a2e754df3215e8b00a8f.js} +1 -1
- package/assets/esri/core/workers/chunks/{f59b76fde2cbd17f64b3.js → a3ae7c41832c7a8b0570.js} +1 -1
- package/assets/esri/core/workers/chunks/{6dc60afb0c39bbb001a3.js → a3e86830460e52706a4d.js} +1 -1
- package/assets/esri/core/workers/chunks/{c030a974a63155f450e9.js → a58b8903ae17acf117d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{c4a2ec2e5897300163ac.js → ab3d1c00ef514b61ce0b.js} +1 -1
- package/assets/esri/core/workers/chunks/{b324bdb9c74fc3f956db.js → add79af151e3eb560599.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b3f91a61e3f29af1fb2.js → ae5363956b4467208e04.js} +1 -1
- package/assets/esri/core/workers/chunks/{38b69fba9ae4ccbae6b7.js → afaf6874a645854c3357.js} +1 -1
- package/assets/esri/core/workers/chunks/{36913f0f944a9eb82cd3.js → b24b7411a73d1da87c30.js} +1 -1
- package/assets/esri/core/workers/chunks/{a3393780655152102c45.js → b97b83159fec34f383af.js} +1 -1
- package/assets/esri/core/workers/chunks/{977e6f589bd266d6067d.js → bbcb213d20693fcad5be.js} +12 -12
- package/assets/esri/core/workers/chunks/{8ade399db21938822a7c.js → bec660ee2e7828f965e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{6b56971783bf4c31a563.js → c19fe4f31e4ef84bbcf6.js} +1 -1
- package/assets/esri/core/workers/chunks/{5cccb8b06014ccef30f8.js → c228b058dd91bf0e1102.js} +1 -1
- package/assets/esri/core/workers/chunks/c2a02c33462bcdabd39d.js +1 -0
- package/assets/esri/core/workers/chunks/{cb30e8a66d6dcfebd439.js → cda2bae39135e5519d8c.js} +1 -1
- package/assets/esri/core/workers/chunks/{414691f7758c78e2a704.js → cfbbfa5edffa57bd3a8e.js} +1 -1
- package/assets/esri/core/workers/chunks/{de83c177f8a1234a5b2e.js → cffef41791f0cfa6c26c.js} +1 -1
- package/assets/esri/core/workers/chunks/d0217187aed8bb7038f4.js +1 -0
- package/assets/esri/core/workers/chunks/{70c94bcfa20453134037.js → d1928a8c86a8966e5582.js} +1 -1
- package/assets/esri/core/workers/chunks/{58e0e50b6c3abaa4798f.js → d26b1a9f47b4b2744c89.js} +1 -1
- package/assets/esri/core/workers/chunks/{2baee42e1797a709fe4b.js → d4a96f0402172787823a.js} +1 -1
- package/assets/esri/core/workers/chunks/d7e17df1c3675bf3633e.js +1 -0
- package/assets/esri/core/workers/chunks/dd785e595cd08b2d6284.js +1 -0
- package/assets/esri/core/workers/chunks/{bd260798b8de09a1eeb2.js → e3a4695c31d3f9d55213.js} +1 -1
- package/assets/esri/core/workers/chunks/{197b9f8483fad2258650.js → e6263e1983e703befe48.js} +1 -1
- package/assets/esri/core/workers/chunks/{6991ba1b204668e7d4da.js → e67a9f9298d63026e7f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e803d12486c8de4c901.js → ee446250a40e5d89bb5a.js} +42 -42
- package/assets/esri/core/workers/chunks/{6f240fe78b299e6c4fcc.js → eeee7421f64a52074ff4.js} +1 -1
- package/assets/esri/core/workers/chunks/{1e109a521ca8772fdf04.js → eef7e0bee19c4258ba55.js} +1 -1
- package/assets/esri/core/workers/chunks/{49a45083a9a155614c1c.js → ef32e454012f3b0e3f77.js} +1 -1
- package/assets/esri/core/workers/chunks/{83ce38342796bd6d73ce.js → f137e544076482e348ad.js} +1 -1
- package/assets/esri/core/workers/chunks/{4ecc345c3732f7fc130f.js → f1f3fe9d2d96578f4f6b.js} +1 -1
- package/assets/esri/core/workers/chunks/{e181d0f5562878b3dc01.js → f72f38e7609756a7f8ea.js} +1 -1
- package/assets/esri/core/workers/chunks/{ef5d11581a98fb333ad2.js → f83e3ad67b60744afd6d.js} +1 -1
- package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/chunks/FocusAreaColor.glsl.js +1 -10
- package/chunks/GaussianSplatComposition.glsl.js +4 -4
- package/chunks/OITAddEmission.glsl.js +6 -0
- package/chunks/OITFilterOpaque.glsl.js +4 -0
- package/chunks/RibbonLine.glsl.js +22 -22
- package/chunks/lerc-wasm.js +1 -1
- package/config.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/form/elements/inputs/attachments/AttachmentInput.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/geometry/support/triangle.js +1 -1
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +110 -67
- package/layers/CSVLayer.d.ts +144 -175
- package/layers/CatalogLayer.d.ts +129 -132
- package/layers/DimensionFeatureLayer.d.ts +106 -63
- package/layers/FeatureLayer.d.ts +77 -150
- package/layers/GeoJSONLayer.d.ts +111 -168
- package/layers/OrientedImageryLayer.d.ts +125 -79
- package/layers/ParquetLayer.d.ts +116 -75
- package/layers/SubtypeGroupLayer.d.ts +86 -111
- package/layers/WFSLayer.d.ts +157 -127
- package/layers/catalog/CatalogFootprintLayer.d.ts +142 -129
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/pointCloudFilters/PointCloudBitfieldFilter.d.ts +1 -1
- package/layers/raster/datasets/pixelReader.js +1 -1
- package/layers/raster/functions/pixelUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +2 -2
- package/popup/Features.d.ts +2 -2
- package/popup/Features.js +1 -1
- package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/input/MapViewInputManager.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/layers/support/annodime/virtualFields.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
- package/views/3d/analysis/Viewshed/types.d.ts +17 -0
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +3 -14
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/interactive/manipulators/RotateManipulator.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/webgl/ManagedFBO.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/emissionFilter.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColor.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaVisualization.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITAddEmission.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/transparency/OITAddEmissionTechnique.js +2 -0
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITFilterOpaque.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/transparency/OITFilterOpaqueTechnique.js +2 -0
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +3 -3
- package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
- package/views/input/BrowserEventSource.js +1 -1
- package/views/input/handlers/PreventTouchSelection.js +2 -0
- package/views/layers/FeatureLikeLayerView.d.ts +9 -64
- package/views/layers/GraphicsLayerView.d.ts +1 -1
- package/views/layers/ViewshedLayerView.d.ts +0 -10
- package/views/layers/types.d.ts +8 -1
- package/views/support/LayerViewManager.js +1 -1
- package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/VisibleElements.d.ts +14 -1
- package/widgets/FeatureForm.js +1 -1
- package/assets/esri/core/workers/chunks/209460f8aae3f9f8c9b8.js +0 -1
- package/assets/esri/core/workers/chunks/2f02880a7f081eb210cd.js +0 -1
- package/assets/esri/core/workers/chunks/4be31fcc5482a2526d2b.js +0 -1
- package/assets/esri/core/workers/chunks/58acc18b92533166135d.js +0 -1
- package/assets/esri/core/workers/chunks/6162f6735ea4622e54d8.js +0 -1
- package/assets/esri/core/workers/chunks/718d2d430c1a5a940b83.js +0 -1
- package/assets/esri/core/workers/chunks/a6379a8df8c08b729b9c.js +0 -1
- package/assets/esri/core/workers/chunks/b0253fe7b3529bc22270.js +0 -1
- package/assets/esri/core/workers/chunks/bd0829eb79efff5b7223.js +0 -1
- package/assets/esri/core/workers/chunks/c193b4a175a544c4fcd6.js +0 -1
- package/assets/esri/core/workers/chunks/d28169816c768d55aa09.js +0 -1
- package/assets/esri/core/workers/chunks/d7c0ab622caf495dbcef.js +0 -1
- package/assets/esri/core/workers/chunks/f10a339b16d84b650012.js +0 -2
- package/assets/esri/core/workers/chunks/f69d3ff8a69c1985bca3.js +0 -1
- package/assets/esri/core/workers/chunks/f847a4846c427f671455.js +0 -1
- package/chunks/OITBlendEmission.glsl.js +0 -6
- package/chunks/OITDimOpaque.glsl.js +0 -4
- package/views/2d/layers/support/annodime/fields.js +0 -2
- package/views/3d/webgl-engine/core/shaderLibrary/util/EmissionDimming.glsl.js +0 -2
- package/views/3d/webgl-engine/effects/transparency/OITBlendEmission.glsl.js +0 -2
- package/views/3d/webgl-engine/effects/transparency/OITBlendEmissionTechnique.js +0 -2
- package/views/3d/webgl-engine/effects/transparency/OITDimOpaque.glsl.js +0 -2
- package/views/3d/webgl-engine/effects/transparency/OITDimOpaqueTechnique.js +0 -2
- /package/assets/esri/core/workers/chunks/{f10a339b16d84b650012.js.LICENSE.txt → 2c00f89030c7a4201033.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as o}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/FocusAreaColor.glsl.js";import{makePipelineState as t,defaultColorWrite as
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as o}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/FocusAreaColor.glsl.js";import{makePipelineState as t,premultipliedAlpha as c,defaultColorWrite as a}from"../../../../webgl/renderState.js";let l=class extends s{constructor(){super(...arguments),this.shader=new o(i,()=>import("./FocusAreaColor.glsl.js")),this.ignoreUnused=!0}initializePipeline(){return t({colorWrite:a,blending:c})}};l=e([r("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaColorTechnique")],l);export{l as FocusAreaColorTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as t}from"../../../../../core/reactiveUtils.js";import{property as
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t}from"../../../../../core/reactiveUtils.js";import{property as r,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as i}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as o}from"../../../webgl.js";import a from"../../../webgl/RenderNode.js";import{F as n}from"../../../../../chunks/FocusAreaColor.glsl.js";import{FocusAreaColorTechnique as c}from"./FocusAreaColorTechnique.js";import{ColorAttachment0 as m}from"../../../../webgl/enums.js";let u=class extends a{constructor(e){super({...e,view:e.focusAreasView.view}),this.consumes={required:[o.FOCUSAREA_COLOR,o.FOCUSAREA]},this.produces=o.FOCUSAREA_COLOR,this._fadeDirection=0,this._passParameters=new n}fadeOut(e){this.removeAllHandles(),this._startTime=null,this._fadeDirection=1,this.addHandles(t(()=>this._passParameters.fadeFactor.value,t=>{0===t&&(this.removeAllHandles(),e())})),this.requestRender(2)}render(e){const t=this.input,r=this.techniques.getCompiled(c);if(!r)return this.requestRender(1),t;const s=this.focusAreasView.style,a=this.bindParameters;this._startTime??=this.view.stage?.renderer.renderContext.time;const n=this.view.qualitySettings.fadeDuration,u=n>0?Math.min(n,this.view.stage?.renderer.renderContext.time-this._startTime)/n:1,h=e.find(({name:e})=>e===o.FOCUSAREA),f=this.renderingContext,l="bright"===s;this._passParameters.color=l?t.getTexture():f.emptyTexture,this._passParameters.focusArea=h.getTexture(),this._passParameters.effect=d[s],this._passParameters.fadeFactor.value=0===this._fadeDirection?u:1-u;const p=a.camera,A=p.fullViewport[2],w=p.fullViewport[3],g=l?this.fboCache.acquire(A,w,this.produces).moveAttachments(t):t;return f.bindFramebuffer(g.fbo),l&&f.clearBuffer(0,i),f.bindTechnique(r,a,this._passParameters),f.setDrawBuffers([m]),f.screen.draw(),u<1&&this.requestRender(2),g}};e([r()],u.prototype,"consumes",void 0),e([r()],u.prototype,"produces",void 0),e([r({constructOnly:!0})],u.prototype,"focusAreasView",void 0),u=e([s("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaVisualization")],u);const d={bright:0,dark:1};export{u as FocusAreaVisualization,d as styleToEffect};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/util/ColorConversion.glsl.js";import"../../core/shaderLibrary/util/emissionFilter.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./oitBlendFragment.glsl.js";import"../../shaders/oitResolution.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{O as OITAddEmissionPassParameters,b as build}from"../../../../../chunks/OITAddEmission.glsl.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../../chunks/OITAddEmission.glsl.js";import{makePipelineState as t,defaultColorWrite as n,add as c}from"../../../../webgl/renderState.js";let d=class extends i{constructor(){super(...arguments),this.shader=new s(o,()=>import("./OITAddEmission.glsl.js"))}initializePipeline(){return t({blending:c,colorWrite:n})}};d=e([r("esri.views.3d.webgl-engine.effects.transparency.OITAddEmissionTechnique")],d);export{d as OITAddEmissionTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{O as e}from"../../../../../chunks/
|
|
2
|
+
import{O as e}from"../../../../../chunks/OITAddEmission.glsl.js";import{OITAddEmissionTechnique as i}from"./OITAddEmissionTechnique.js";import{OITBlendFragmentTechniqueConfiguration as s}from"./OITBlendFragmentTechniqueConfiguration.js";import{OITBlendTechnique as t}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as n}from"./OITBlendTechniqueConfiguration.js";import{OITFilterOpaqueTechnique as r}from"./OITFilterOpaqueTechnique.js";import{OITResolutionConfiguration as o}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as a,ColorAttachment2 as u,DrawBufferNone as h}from"../../../../webgl/enums.js";class f{constructor(i){this._techniques=i,this._parameters=new e,this._blendConfiguration=new n,this._filterOpaqueConfiguration=new s,this._addEmissionConfiguration=new o}precompile(e,s,n){this._updateConfigurations(e,s,n);const{hasTransparentEmission:o,hasOpaqueEmission:a}=e;a&&1!==n&&this._techniques.precompile(r,this._filterOpaqueConfiguration),this._techniques.precompile(t,this._blendConfiguration),o&&0===n&&this._techniques.precompile(i,this._addEmissionConfiguration)}blend(e,s,n,o,f,m,d){this._updateConfigurations(o,f,m),this._parameters.colorTexture=s.getTexture(),this._parameters.alphaTexture=s.getTexture(a),this._parameters.emissionTexture=s.getTexture(u),this._parameters.frontFaceTexture=n.getTexture(),this._parameters.frontFaceEmissionTexture=n.getTexture(a);const p=e.drawBuffers,{hasOpaqueEmission:c,hasTransparentEmission:l}=o;if(c&&1!==m){const i=this._techniques.get(r,this._filterOpaqueConfiguration);e.bindTechnique(i,o,this._parameters),e.setDrawBuffers([h,a]),e.screen.draw(),d?.("oit opaque emission filter",e.boundFramebuffer)}const _=this._techniques.get(t,this._blendConfiguration);if(e.bindTechnique(_,o,this._parameters),!c&&l){const i=p.slice();i[1]=h,e.setDrawBuffers(i),e.screen.draw()}else e.setDrawBuffers(p),e.screen.draw();if(d?.("oit composited",e.boundFramebuffer),l&&0===m){const s=this._techniques.get(i,this._addEmissionConfiguration);e.bindTechnique(s,o,this._parameters),e.setDrawBuffers([h,a]),e.screen.draw(),d?.("oit transparent emission",e.boundFramebuffer)}e.setDrawBuffers(p)}_updateConfigurations(e,i,s){this._blendConfiguration.useFloatBlend=this._filterOpaqueConfiguration.useFloatBlend=this._addEmissionConfiguration.useFloatBlend=e.useFloatBlend.value,this._blendConfiguration.computeHudOcclusion=i,this._blendConfiguration.hasOpaqueEmission=0===s&&e.hasOpaqueEmission,this._blendConfiguration.hasEmissionAttachment=0===s&&0!==e.emissions,this._blendConfiguration.frontFaceMask=1===s}}export{f as OITBlend};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/util/emissionFilter.glsl.js";import"../../core/shaderModules/glsl.js";import"./oitBlendFragment.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/OITFilterOpaque.glsl.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{O as o}from"../../../../../chunks/OITFilterOpaque.glsl.js";import{makePipelineState as t,defaultColorWrite as a,modulateDestination as l}from"../../../../webgl/renderState.js";let n=class extends s{constructor(){super(...arguments),this.shader=new i(o,()=>import("./OITFilterOpaque.glsl.js"))}initializePipeline(){return t({blending:l,colorWrite:a})}};n=e([r("esri.views.3d.webgl-engine.effects.transparency.OITFilterOpaqueTechnique")],n);export{n as OITFilterOpaqueTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{add as t,transformMat4 as e}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as
|
|
2
|
+
import{add as t,transformMat4 as e,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as r}from"../../../../geometry/support/frustum.js";import{create as n,fromPoints as o,copy as a}from"../../../../geometry/support/ray.js";import l from"../../webgl/RenderCamera.js";import{HUDTarget as c,HUDIntersectorResult as h}from"./HUDIntersectorResult.js";import{IntersectorOptions as f}from"./IntersectorInterfaces.js";import{IntersectorResult as m,compareOrderedIntersectionHits as u}from"./IntersectorResult.js";import{ObjectTarget as d}from"./ObjectTarget.js";import{PolygonIntersectionResults as y}from"./PolygonIntersectionResults.js";import{IntersectorTransform as g,getVerticalOffsetObject3D as _}from"./verticalOffsetUtils.js";const p=1e-5;class v{constructor(t){this.options=new f,this._results=new b,this.polygonResults=new y,this.transform=new g,this.camera=new l,this.screenPolygonPrimitiveProcessor=j,this.tolerance=p,this.verticalOffset=null,this._ray=n(),this._rayEnd=i(),this._rayBeginTransformed=i(),this._rayEndTransformed=i(),this.viewingMode=t??1}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(t,e,s){this.resetWithRay(o(t,e,this._ray),s)}resetWithRay(e,s){this.camera=s,e!==this._ray&&a(e,this._ray),0!==this.options.verticalOffset?2===this.viewingMode?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,t(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray),this.polygonResults.init()}intersect(t=null,e,s,i,r){this.point=e,this.filterPredicate=i,this.tolerance=s??p;const n=_(this.verticalOffset);if(t&&t.length>0){const e=r?t=>{r(t)&&this.intersectObject(t)}:t=>{this.intersectObject(t)};for(const s of t){const t=s.getSpatialQueryAccelerator?.();null!=t?(null!=n?t.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,e,n):t.forEachAlongRay(this._ray.origin,this._ray.direction,e),this.options.selectionMode&&this.options.hud&&t.forEachDegenerateObject(e)):s.objects.forEach(t=>e(t))}}this.sortResults()}*intersectScreenPolygon(t=null,e){if(this.verticalOffset=null,t?.length)for(const s of t){const t=s.getSpatialQueryAccelerator?.();if(null!=t)for(const s of t.intersectingFrustumValues(e.broadPhaseFrustum,t=>t.visible))yield*this._intersectScreenPolygonObject(s,e);else for(const i of s.objects.values())i.visible&&r(e.broadPhaseFrustum,i.boundingVolumeWorldSpace.bounds)&&(yield*this._intersectScreenPolygonObject(i,e))}}*_intersectScreenPolygonObject(t,e){const s=t.geometries;if(!s)return;const i=t.effectiveTransformation;for(const r of s){if(!r.visible)continue;const{material:s,id:n}=r;if(!s.visible||!s.intersectScreenPolygon)continue;this.transform.setAndInvalidateLazyTransforms(i,r.transformation);const o=s.intersectScreenPolygon(r,this.transform.transform,this,e);o?.valid&&this._handleObjectScreenPolygonIntersection(new d(t,n,o.primitiveIndex),o.distance,o.point),yield}}intersectObject(t){const s=t.geometries;if(!s)return;const i=t.effectiveTransformation,r=_(this.verticalOffset);for(const n of s){if(!n.visible)continue;const{material:s,id:o}=n;if(!s.visible)continue;this.transform.setAndInvalidateLazyTransforms(i,n.transformation),e(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),e(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const a=this.transform.transform;null!=r&&(r.objectTransform=this.transform),s.intersectRay(n,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,(e,s,i,r)=>this.handleObjectIntersection({object:t,geometryId:o,primitiveIndex:i},e,s,a,r))}}handleObjectIntersection(t,e,s,i,r){if(e<0||null!=this.filterPredicate&&!this.filterPredicate(this._ray.origin,this._rayEnd,e))return;const n=r?this._results.hud:this._results;t=r?new c(t,r):t;const o=r?i=>i.set(1,t,e,s):r=>r.set(4,t,e,s,i);if((null==n.min.distance||e<n.min.distance)&&o(n.min),0!==this.options.store&&(null==n.max.distance||e>n.max.distance)&&o(n.max),2===this.options.store)if(r){const t=new h(this._ray);o(t),this._results.hud.all.push(t)}else{const t=new m(this._ray);o(t),this._results.all.push(t)}}_handleObjectScreenPolygonIntersection(t,e,s,i){e<0||(null==this.filterPredicate||null!=s&&this.filterPredicate(this.camera.eye,s,1))&&this.polygonResults.add(i?1:4,i?new c(t,i):t,e)}sortResults(t=this._results.all){t.sort(u)}}class b{constructor(){this.min=new m(n()),this.max=new m(n()),this.hud={min:new h(n()),max:new h(n()),all:new Array},this.ground=new m(n()),this.all=[]}init(t){this.min.init(t),this.max.init(t),this.ground.init(t),this.all.length=0,this.hud.min.init(t),this.hud.max.init(t),this.hud.all.length=0}}const j={*processTriangle(t,e){t.list=e,t.count=e.length,yield t},*processLineSegment(t,e,i){s(t[0],e),s(t[1],i),yield t}};export{v as Intersector,j as defaultScreenPolygonPrimitiveProcessor,p as defaultTolerance};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/ObjectPool.js";import t from"../../../../core/PooledArray.js";import{lerp as n,squaredDistance as r,scale as i,add as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as o,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as h}from"../../../../geometry/support/frustum.js";import{wrap as d}from"../../../../geometry/support/ray.js";import{Sphere as c}from"../../../../geometry/support/sphere.js";import{rayBoxTest as u}from"./Util.js";class l{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(e,t){this.objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new f,this._objectCount=0,t&&(void 0!==t.maximumObjectsPerNode&&(this._maximumObjectsPerNode=t.maximumObjectsPerNode),void 0!==t.maximumDepth&&(this._maximumDepth=t.maximumDepth))}destroy(){this._degenerateObjects.clear(),f.clearPool(),D[0]=null,V.prune(),W.prune()}add(e){const t=Array.from(e);this._grow(t);const n=f.acquire();for(const r of t)++this._objectCount,this._isDegenerate(r)?this._degenerateObjects.add(r):(n.init(this._root),this._add(r,n));f.release(n)}remove(e,t=null){this._objectCount-=e.length;const n=f.acquire();for(const r of e){const e=t??this.objectToBoundingSphere(r);v(e.radius)?(n.init(this._root),b(r,e,n)):this._degenerateObjects.delete(r)}f.release(n),this._shrink()}update(e,t){if(!v(t.radius)&&this._isDegenerate(e))return;const n=R(e);this.remove(n,t),this.add(n)}forEachAlongRay(e,t,n){const r=d(e,t);_(this._root,e=>{if(!S(r,e))return!1;const t=e.node;return t.terminals.forAll(e=>{this._intersectsObject(r,e)&&n(e)}),null!==t.residents&&t.residents.forAll(e=>{this._intersectsObject(r,e)&&n(e)}),!0})}forEachAlongRayWithVerticalOffset(e,t,n,r){const i=d(e,t);_(this._root,e=>{if(!j(i,e,r))return!1;const t=e.node;return t.terminals.forAll(e=>{this._intersectsObjectWithOffset(i,e,r)&&n(e)}),null!==t.residents&&t.residents.forAll(e=>{this._intersectsObjectWithOffset(i,e,r)&&n(e)}),!0})}forEach(e){for(const t of this.values())e(t)}*values(){for(const e of this._nodeIteratorValues()){const t=e.node;yield*t.terminals,null!==t.residents&&(yield*t.residents)}yield*this.degenerateObjectValues()}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}*degenerateObjectValues(){yield*this._degenerateObjects.values()}findClosest(e,t,n,r=()=>!0,o=1/0){let a=1/0,d=1/0,c=null;const u=B(e,t),l=i=>{if(--o,!r(i))return;const s=this.objectToBoundingSphere(i);if(!h(n,s))return;const u=N(e,t,s.center),l=u-s.radius,f=u+s.radius;l<a&&(a=l,d=f,c=i)};return p(this._root,r=>{if(o<=0||!h(n,r.bounds))return!1;i(q,u,r.halfSize),s(q,q,r.bounds.center);if(N(e,t,q)>d)return!1;const a=r.node;return a.terminals.forAll(e=>l(e)),null!==a.residents&&a.residents.forAll(e=>l(e)),!0},e,t),c}forEachInDepthRange(e,t,n,r,o,a,d){let c=-1/0,u=1/0;const l={setRange:e=>{1===n?(c=Math.max(c,e.near),u=Math.min(u,e.far)):(c=Math.max(c,-e.far),u=Math.min(u,-e.near))}};l.setRange(r);const f=N(t,n,e),m=B(t,n),_=B(t,-n),b=e=>{if(!d(e))return;const r=this.objectToBoundingSphere(e),i=N(t,n,r.center)-f,s=i-r.radius,m=i+r.radius;s>u||m<c||!h(a,r)||o(e,l)};p(this._root,e=>{if(!h(a,e.bounds))return!1;i(q,m,e.halfSize),s(q,q,e.bounds.center);if(N(t,n,q)-f>u)return!1;i(q,_,e.halfSize),s(q,q,e.bounds.center);if(N(t,n,q)-f<c)return!1;const r=e.node;return r.terminals.forAll(e=>b(e)),null!==r.residents&&r.residents.forAll(e=>b(e)),!0},t,n)}forEachNode(e){_(this._root,t=>e(t.node,t.bounds,t.halfSize,t.depth))}forEachIntersectingFrustum(e,t,n=()=>!0){for(const r of this.intersectingFrustumValues(e,n))t(r)}*intersectingFrustumValues(e,t=()=>!0){for(const n of this._nodeIteratorValues(t=>h(e,t.bounds))){const r=n.node;for(const n of r.terminals)t(n)&&h(e,this.objectToBoundingSphere(n))&&(yield n);if(null!==r.residents)for(const n of r.residents)t(n)&&h(e,this.objectToBoundingSphere(n))&&(yield n)}}*_nodeIteratorValues(e=()=>!0){yield*m(this._root,e)}forEachNeighbor(e,t){const n=t.radius,i=t.center,s=t=>{const s=this.objectToBoundingSphere(t),o=s.radius,a=n+o;return!(r(s.center,i)-a*a<=0)||e(t)};let o=!0;const a=e=>{o&&(o=s(e))};_(this._root,e=>{const t=e.bounds.radius,s=n+t;if(r(e.bounds.center,i)-s*s>0)return!1;const h=e.node;return h.terminals.forAll(a),o&&null!==h.residents&&h.residents.forAll(a),o}),o&&this.forEachDegenerateObject(a)}_intersectsObject(e,t){const n=this.objectToBoundingSphere(t);return!(n.radius>0)||n.intersectRay(e)}_intersectsObjectWithOffset(e,t,n){const r=this.objectToBoundingSphere(t);return!(r.radius>0)||n.applyToBoundingSphere(r).intersectRay(e)}_add(e,t){t.advanceTo(this.objectToBoundingSphere(e))?t.node.terminals.push(e):(t.node.residents.push(e),t.node.residents.length>this._maximumObjectsPerNode&&t.depth<this._maximumDepth&&this._split(t))}_split(e){const t=e.node.residents;e.node.residents=null;for(let n=0;n<t.length;n++){const r=f.acquire().init(e);this._add(t.at(n),r),f.release(r)}}_grow(e){if(T(e,e=>this.objectToBoundingSphere(e),k),v(k.radius)&&!this._fitsInsideTree(k))if(x(this._root.node))this._root.bounds.copyFrom(k),this._root.halfSize=1.25*this._root.bounds.radius,this._root.updateBoundsRadiusFromHalfSize();else{const e=this._rootBoundsForRootAsSubNode(k);this._placingRootViolatesMaxDepth(e)?this._rebuildTree(k,e):this._growRootAsSubNode(e),f.release(e)}}_rebuildTree(e,t){L.center=t.bounds.center,L.radius=t.halfSize,T([e,L],e=>e,C);const n=f.acquire().init(this._root);this._root.initFrom(null,C,C.radius),this._root.increaseHalfSize(1.25),_(n,e=>(this.add(e.node.terminals.data),null!==e.node.residents&&this.add(e.node.residents.data),!0)),f.release(n)}_placingRootViolatesMaxDepth(e){const t=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return _(this._root,e=>(n=Math.max(n,e.depth),n+t<=this._maximumDepth)),n+t>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const t=e.radius,n=e.center;let r=-1/0;const i=this._root.bounds.center,s=this._root.halfSize;for(let a=0;a<3;a++){const e=i[a]-s-(n[a]-t),o=n[a]+t-(i[a]+s),h=Math.max(0,Math.ceil(e/(2*s))),d=Math.max(0,Math.ceil(o/(2*s)))+1,c=2**Math.ceil(Math.log(h+d)*Math.LOG2E);r=Math.max(r,c),H[a].min=h,H[a].max=d}for(let a=0;a<3;a++){let e=H[a].min,t=H[a].max;const n=(r-(e+t))/2;e+=Math.ceil(n),t+=Math.floor(n);const o=i[a]-s-e*s*2;E.center[a]=o+(t+e)*s}const o=r*s;return E.radius=o*F,f.acquire().initFrom(null,E,o,0)}_growRootAsSubNode(e){const t=this._root.node;k.center=this._root.bounds.center,k.radius=this._root.halfSize,this._root.init(e),e.advanceTo(k,null,!0),e.node.children=t.children,e.node.residents=t.residents,e.node.terminals=t.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(-1===e)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let e=null;const t=this._root.node.children;let n=0,r=0;for(;r<t.length&&null==e;)n=r++,e=t[n];for(;r<t.length;)if(t[r++])return-1;return n}_isDegenerate(e){return!v(this.objectToBoundingSphere(e).radius)}_fitsInsideTree(e){const t=this._root.bounds,n=this._root.halfSize;return e.radius<=n&&e.center[0]>=t.center[0]-n&&e.center[0]<=t.center[0]+n&&e.center[1]>=t.center[1]-n&&e.center[1]<=t.center[1]+n&&e.center[2]>=t.center[2]-n&&e.center[2]<=t.center[2]+n}_nodeToJSON(e){const t=e.children.map(e=>e?this._nodeToJSON(e):null),n=e.residents?.map(e=>this.objectToBoundingSphere(e)),r=e.terminals?.map(e=>this.objectToBoundingSphere(e));return{children:t,residents:n,terminals:r}}}class f{constructor(){this.bounds=new c,this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(e,t,n,r=this.depth){return this.node=null!=e?e:f.createEmptyNode(),t&&this.bounds.copyFrom(t),this.halfSize=n,this.depth=r,this}increaseHalfSize(e){this.halfSize*=e,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds.radius=this.halfSize*F}advance(e){let t=this.node.children[e];t||(t=f.createEmptyNode(),this.node.children[e]=t),this.node=t,this.halfSize/=2,this.depth++;const n=w[e];return this.bounds.center[0]+=n[0]*this.halfSize,this.bounds.center[1]+=n[1]*this.halfSize,this.bounds.center[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(e,t,n=!1){for(;;){if(this.isTerminalFor(e))return t?.(this,-1),!0;if(this.isLeaf()){if(!n)return t?.(this,-1),!1;this.node.residents=null}const r=this._childIndex(e);t?.(this,r),this.advance(r)}}isLeaf(){return null!=this.node.residents}isTerminalFor(e){return e.radius>this.halfSize/2}_childIndex(e){const t=this.bounds.center;return(t[0]<e.center[0]?1:0)+(t[1]<e.center[1]?2:0)+(t[2]<e.center[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new t({shrink:!0}),residents:new t({shrink:!0})}}static{this._pool=new e(()=>new f)}static acquire(){return f._pool.acquire()}static release(e){f._pool.release(e)}static clearPool(){f._pool.prune()}}function*m(e,t=()=>!0){const n=[f.acquire().init(e)];for(;0!==n.length;){const e=n.pop();if(t(e)){if(yield e,!e.isLeaf())for(let t=0;t<e.node.children.length;t++){e.node.children[t]&&n.push(f.acquire().init(e).advance(t))}f.release(e)}}}function _(e,t){const n=m(e,t);for(const r of n);}function p(e,t,n,r=1){let i=f.acquire().init(e);const s=[i];for(y(n,r,G);0!==s.length;){if(i=s.pop(),t(i)&&!i.isLeaf())for(let e=7;e>=0;--e){const t=G[e];i.node.children[t]&&s.push(f.acquire().init(i).advance(t))}f.release(i)}}function b(e,t,n){V.clear();const r=n.advanceTo(t,(e,t)=>{V.push(e.node),V.push(t)})?n.node.terminals:n.node.residents;if(r.removeUnordered(e),0===r.length)for(let i=V.length-2;i>=0;i-=2){if(!g(V.data[i],V.data[i+1]))break}}function g(e,n){return n>=0&&(e.children[n]=null),!!x(e)&&(null===e.residents&&(e.residents=new t({shrink:!0})),!0)}function S(e,t){return M(t.bounds.center,2*-t.halfSize,I),M(t.bounds.center,2*t.halfSize,P),u(e.origin,e.direction,I,P)}function j(e,t,n){return M(t.bounds.center,2*-t.halfSize,I),M(t.bounds.center,2*t.halfSize,P),n.applyToMinMax(I,P),u(e.origin,e.direction,I,P)}function x(e){if(0!==e.terminals.length)return!1;if(null!==e.residents)return 0===e.residents.length;for(let t=0;t<e.children.length;t++)if(e.children[t])return!1;return!0}function z(e,t){e[0]=Math.min(e[0],t.center[0]-t.radius),e[1]=Math.min(e[1],t.center[1]-t.radius),e[2]=Math.min(e[2],t.center[2]-t.radius)}function O(e,t){e[0]=Math.max(e[0],t.center[0]+t.radius),e[1]=Math.max(e[1],t.center[1]+t.radius),e[2]=Math.max(e[2],t.center[2]+t.radius)}function M(e,t,n){n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t}function T(e,t,r){I[0]=1/0,I[1]=1/0,I[2]=1/0,P[0]=-1/0,P[1]=-1/0,P[2]=-1/0;for(const n of e){const e=t(n);v(e.radius)&&(z(I,e),O(P,e))}n(r.center,I,P,.5),r.radius=Math.max(P[0]-I[0],P[1]-I[1],P[2]-I[2])/2}function y(e,t,n){if(!W.length)for(let r=0;r<8;++r)W.push({index:0,distance:0});for(let r=0;r<8;++r){const n=w[r];W.data[r].index=r,W.data[r].distance=N(e,t,n)}W.sort((e,t)=>e.distance-t.distance);for(let r=0;r<8;++r)n[r]=W.data[r].index}function B(e,t){let n,r=1/0;for(let i=0;i<8;++i){const s=N(e,t,A[i]);s<r&&(r=s,n=A[i])}return n}function N(e,t,n){return t*(e[0]*n[0]+e[1]*n[1]+e[2]*n[2])}function v(e){return!isNaN(e)&&e!==-1/0&&e!==1/0&&e>0}const w=[o(-1,-1,-1),o(1,-1,-1),o(-1,1,-1),o(1,1,-1),o(-1,-1,1),o(1,-1,1),o(-1,1,1),o(1,1,1)],A=[o(-1,-1,-1),o(-1,-1,1),o(-1,1,-1),o(-1,1,1),o(1,-1,-1),o(1,-1,1),o(1,1,-1),o(1,1,1)],F=Math.sqrt(3),D=[null];function R(e){return D[0]=e,D}const E=new c,q=a(),I=a(),P=a(),V=new t,k=new c,L=new c,C=new c,H=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],W=new t,G=[0,0,0,0,0,0,0,0];export{l as Octree};
|
|
2
|
+
import e from"../../../../core/ObjectPool.js";import t from"../../../../core/PooledArray.js";import{lerp as n,squaredDistance as r,scale as i,add as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as o,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphereCenterRadius as h,intersectsSphere as d}from"../../../../geometry/support/frustum.js";import{wrap as u}from"../../../../geometry/support/ray.js";import{Sphere as c}from"../../../../geometry/support/sphere.js";import{rayBoxTest as l}from"./Util.js";class f{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(e,t){this.objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new m,this._objectCount=0,t&&(void 0!==t.maximumObjectsPerNode&&(this._maximumObjectsPerNode=t.maximumObjectsPerNode),void 0!==t.maximumDepth&&(this._maximumDepth=t.maximumDepth))}destroy(){this._degenerateObjects.clear(),m.clearPool(),R[0]=null,k.prune(),G.prune()}add(e){const t=Array.from(e);this._grow(t);const n=m.acquire();for(const r of t)++this._objectCount,this._isDegenerate(r)?this._degenerateObjects.add(r):(n.init(this._root),this._add(r,n));m.release(n)}remove(e,t=null){this._objectCount-=e.length;const n=m.acquire();for(const r of e){const e=t??this.objectToBoundingSphere(r);w(e.radius)?(n.init(this._root),g(r,e,n)):this._degenerateObjects.delete(r)}m.release(n),this._shrink()}update(e,t){if(!w(t.radius)&&this._isDegenerate(e))return;const n=E(e);this.remove(n,t),this.add(n)}forEachAlongRay(e,t,n){const r=u(e,t);p(this._root,e=>{if(!j(r,e))return!1;const t=e.node;return t.terminals.forAll(e=>{this._intersectsObject(r,e)&&n(e)}),null!==t.residents&&t.residents.forAll(e=>{this._intersectsObject(r,e)&&n(e)}),!0})}forEachAlongRayWithVerticalOffset(e,t,n,r){const i=u(e,t);p(this._root,e=>{if(!x(i,e,r))return!1;const t=e.node;return t.terminals.forAll(e=>{this._intersectsObjectWithOffset(i,e,r)&&n(e)}),null!==t.residents&&t.residents.forAll(e=>{this._intersectsObjectWithOffset(i,e,r)&&n(e)}),!0})}forEach(e){for(const t of this.values())e(t)}*values(){for(const e of this._nodeIteratorValues()){const t=e.node;yield*t.terminals,null!==t.residents&&(yield*t.residents)}yield*this.degenerateObjectValues()}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}*degenerateObjectValues(){yield*this._degenerateObjects.values()}findClosest(e,t,n,r=()=>!0,o=1/0){let a=1/0,u=1/0,c=null;const l=N(e,t),f=i=>{if(--o,!r(i))return;const s=this.objectToBoundingSphere(i);if(!d(n,s))return;const h=v(e,t,s.center),l=h-s.radius,f=h+s.radius;l<a&&(a=l,u=f,c=i)};return b(this._root,r=>{if(o<=0||!h(n,r.bounds.center,2*r.bounds.radius))return!1;i(I,l,2*r.halfSize),s(I,I,r.bounds.center);if(v(e,t,I)>u)return!1;const a=r.node;return a.terminals.forAll(e=>f(e)),null!==a.residents&&a.residents.forAll(e=>f(e)),!0},e,t),c}forEachInDepthRange(e,t,n,r,o,a,u){let c=-1/0,l=1/0;const f={setRange:e=>{1===n?(c=Math.max(c,e.near),l=Math.min(l,e.far)):(c=Math.max(c,-e.far),l=Math.min(l,-e.near))}};f.setRange(r);const m=v(t,n,e),_=N(t,n),p=N(t,-n),g=e=>{if(!u(e))return;const r=this.objectToBoundingSphere(e),i=v(t,n,r.center)-m,s=i-r.radius,h=i+r.radius;s>l||h<c||!d(a,r)||o(e,f)};b(this._root,e=>{if(!h(a,e.bounds.center,2*e.bounds.radius))return!1;i(I,_,2*e.halfSize),s(I,I,e.bounds.center);if(v(t,n,I)-m>l)return!1;i(I,p,2*e.halfSize),s(I,I,e.bounds.center);if(v(t,n,I)-m<c)return!1;const r=e.node;return r.terminals.forAll(e=>g(e)),null!==r.residents&&r.residents.forAll(e=>g(e)),!0},t,n)}forEachNode(e){p(this._root,t=>e(t.node,t.bounds,t.halfSize,t.depth))}forEachIntersectingFrustum(e,t,n=()=>!0){for(const r of this.intersectingFrustumValues(e,n))t(r)}*intersectingFrustumValues(e,t=()=>!0){for(const n of this._nodeIteratorValues(t=>h(e,t.bounds.center,2*t.bounds.radius))){const r=n.node;for(const n of r.terminals)t(n)&&d(e,this.objectToBoundingSphere(n))&&(yield n);if(null!==r.residents)for(const n of r.residents)t(n)&&d(e,this.objectToBoundingSphere(n))&&(yield n)}}*_nodeIteratorValues(e=()=>!0){yield*_(this._root,e)}forEachNeighbor(e,t){const n=t.radius,i=t.center,s=t=>{const s=this.objectToBoundingSphere(t),o=s.radius,a=n+o;return!(r(s.center,i)-a*a<=0)||e(t)};let o=!0;const a=e=>{o&&(o=s(e))};p(this._root,e=>{const t=2*e.bounds.radius,s=n+t;if(r(e.bounds.center,i)-s*s>0)return!1;const h=e.node;return h.terminals.forAll(a),o&&null!==h.residents&&h.residents.forAll(a),o}),o&&this.forEachDegenerateObject(a)}_intersectsObject(e,t){const n=this.objectToBoundingSphere(t);return!(n.radius>0)||n.intersectRay(e)}_intersectsObjectWithOffset(e,t,n){const r=this.objectToBoundingSphere(t);return!(r.radius>0)||n.applyToBoundingSphere(r).intersectRay(e)}_add(e,t){t.advanceTo(this.objectToBoundingSphere(e))?t.node.terminals.push(e):(t.node.residents.push(e),t.node.residents.length>this._maximumObjectsPerNode&&t.depth<this._maximumDepth&&this._split(t))}_split(e){const t=e.node.residents;e.node.residents=null;for(let n=0;n<t.length;n++){const r=m.acquire().init(e);this._add(t.at(n),r),m.release(r)}}_grow(e){if(y(e,e=>this.objectToBoundingSphere(e),L),w(L.radius)&&!this._fitsInsideTree(L))if(z(this._root.node))this._root.bounds.copyFrom(L),this._root.halfSize=1.25*this._root.bounds.radius,this._root.updateBoundsRadiusFromHalfSize();else{const e=this._rootBoundsForRootAsSubNode(L);this._placingRootViolatesMaxDepth(e)?this._rebuildTree(L,e):this._growRootAsSubNode(e),m.release(e)}}_rebuildTree(e,t){C.center=t.bounds.center,C.radius=t.halfSize,y([e,C],e=>e,H);const n=m.acquire().init(this._root);this._root.initFrom(null,H,H.radius),this._root.increaseHalfSize(1.25),p(n,e=>(this.add(e.node.terminals.data),null!==e.node.residents&&this.add(e.node.residents.data),!0)),m.release(n)}_placingRootViolatesMaxDepth(e){const t=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return p(this._root,e=>(n=Math.max(n,e.depth),n+t<=this._maximumDepth)),n+t>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const t=e.radius,n=e.center;let r=-1/0;const i=this._root.bounds.center,s=this._root.halfSize;for(let a=0;a<3;a++){const e=i[a]-s-(n[a]-t),o=n[a]+t-(i[a]+s),h=Math.max(0,Math.ceil(e/(2*s))),d=Math.max(0,Math.ceil(o/(2*s)))+1,u=2**Math.ceil(Math.log(h+d)*Math.LOG2E);r=Math.max(r,u),W[a].min=h,W[a].max=d}for(let a=0;a<3;a++){let e=W[a].min,t=W[a].max;const n=(r-(e+t))/2;e+=Math.ceil(n),t+=Math.floor(n);const o=i[a]-s-e*s*2;q.center[a]=o+(t+e)*s}const o=r*s;return q.radius=o*D,m.acquire().initFrom(null,q,o,0)}_growRootAsSubNode(e){const t=this._root.node;L.center=this._root.bounds.center,L.radius=this._root.halfSize,this._root.init(e),e.advanceTo(L,null,!0),e.node.children=t.children,e.node.residents=t.residents,e.node.terminals=t.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(-1===e)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let e=null;const t=this._root.node.children;let n=0,r=0;for(;r<t.length&&null==e;)n=r++,e=t[n];for(;r<t.length;)if(t[r++])return-1;return n}_isDegenerate(e){return!w(this.objectToBoundingSphere(e).radius)}_fitsInsideTree(e){const t=this._root.bounds,n=this._root.halfSize;return e.radius<=n&&e.center[0]>=t.center[0]-n&&e.center[0]<=t.center[0]+n&&e.center[1]>=t.center[1]-n&&e.center[1]<=t.center[1]+n&&e.center[2]>=t.center[2]-n&&e.center[2]<=t.center[2]+n}_nodeToJSON(e){const t=e.children.map(e=>e?this._nodeToJSON(e):null),n=e.residents?.map(e=>this.objectToBoundingSphere(e)),r=e.terminals?.map(e=>this.objectToBoundingSphere(e));return{children:t,residents:n,terminals:r}}}class m{constructor(){this.bounds=new c,this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(e,t,n,r=this.depth){return this.node=null!=e?e:m.createEmptyNode(),t&&this.bounds.copyFrom(t),this.halfSize=n,this.depth=r,this}increaseHalfSize(e){this.halfSize*=e,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds.radius=this.halfSize*D}advance(e){let t=this.node.children[e];t||(t=m.createEmptyNode(),this.node.children[e]=t),this.node=t,this.halfSize/=2,this.depth++;const n=A[e];return this.bounds.center[0]+=n[0]*this.halfSize,this.bounds.center[1]+=n[1]*this.halfSize,this.bounds.center[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(e,t,n=!1){for(;;){if(this.isTerminalFor(e))return t?.(this,-1),!0;if(this.isLeaf()){if(!n)return t?.(this,-1),!1;this.node.residents=null}const r=this._childIndex(e);t?.(this,r),this.advance(r)}}isLeaf(){return null!=this.node.residents}isTerminalFor(e){return e.radius>this.halfSize/2}_childIndex(e){const t=this.bounds.center;return(t[0]<e.center[0]?1:0)+(t[1]<e.center[1]?2:0)+(t[2]<e.center[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new t({shrink:!0}),residents:new t({shrink:!0})}}static{this._pool=new e(()=>new m)}static acquire(){return m._pool.acquire()}static release(e){m._pool.release(e)}static clearPool(){m._pool.prune()}}function*_(e,t=()=>!0){const n=[m.acquire().init(e)];for(;0!==n.length;){const e=n.pop();if(t(e)){if(yield e,!e.isLeaf())for(let t=0;t<e.node.children.length;t++){e.node.children[t]&&n.push(m.acquire().init(e).advance(t))}m.release(e)}}}function p(e,t){const n=_(e,t);for(const r of n);}function b(e,t,n,r=1){let i=m.acquire().init(e);const s=[i];for(B(n,r,J);0!==s.length;){if(i=s.pop(),t(i)&&!i.isLeaf())for(let e=7;e>=0;--e){const t=J[e];i.node.children[t]&&s.push(m.acquire().init(i).advance(t))}m.release(i)}}function g(e,t,n){k.clear();const r=n.advanceTo(t,(e,t)=>{k.push(e.node),k.push(t)})?n.node.terminals:n.node.residents;if(r.removeUnordered(e),0===r.length)for(let i=k.length-2;i>=0;i-=2){if(!S(k.data[i],k.data[i+1]))break}}function S(e,n){return n>=0&&(e.children[n]=null),!!z(e)&&(null===e.residents&&(e.residents=new t({shrink:!0})),!0)}function j(e,t){return T(t.bounds.center,2*-t.halfSize,P),T(t.bounds.center,2*t.halfSize,V),l(e.origin,e.direction,P,V)}function x(e,t,n){return T(t.bounds.center,2*-t.halfSize,P),T(t.bounds.center,2*t.halfSize,V),n.applyToMinMax(P,V),l(e.origin,e.direction,P,V)}function z(e){if(0!==e.terminals.length)return!1;if(null!==e.residents)return 0===e.residents.length;for(let t=0;t<e.children.length;t++)if(e.children[t])return!1;return!0}function O(e,t){e[0]=Math.min(e[0],t.center[0]-t.radius),e[1]=Math.min(e[1],t.center[1]-t.radius),e[2]=Math.min(e[2],t.center[2]-t.radius)}function M(e,t){e[0]=Math.max(e[0],t.center[0]+t.radius),e[1]=Math.max(e[1],t.center[1]+t.radius),e[2]=Math.max(e[2],t.center[2]+t.radius)}function T(e,t,n){n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t}function y(e,t,r){P[0]=1/0,P[1]=1/0,P[2]=1/0,V[0]=-1/0,V[1]=-1/0,V[2]=-1/0;for(const n of e){const e=t(n);w(e.radius)&&(O(P,e),M(V,e))}n(r.center,P,V,.5),r.radius=Math.max(V[0]-P[0],V[1]-P[1],V[2]-P[2])/2}function B(e,t,n){if(!G.length)for(let r=0;r<8;++r)G.push({index:0,distance:0});for(let r=0;r<8;++r){const n=A[r];G.data[r].index=r,G.data[r].distance=v(e,t,n)}G.sort((e,t)=>e.distance-t.distance);for(let r=0;r<8;++r)n[r]=G.data[r].index}function N(e,t){let n,r=1/0;for(let i=0;i<8;++i){const s=v(e,t,F[i]);s<r&&(r=s,n=F[i])}return n}function v(e,t,n){return t*(e[0]*n[0]+e[1]*n[1]+e[2]*n[2])}function w(e){return!isNaN(e)&&e!==-1/0&&e!==1/0&&e>0}const A=[o(-1,-1,-1),o(1,-1,-1),o(-1,1,-1),o(1,1,-1),o(-1,-1,1),o(1,-1,1),o(-1,1,1),o(1,1,1)],F=[o(-1,-1,-1),o(-1,-1,1),o(-1,1,-1),o(-1,1,1),o(1,-1,-1),o(1,-1,1),o(1,1,-1),o(1,1,1)],D=Math.sqrt(3),R=[null];function E(e){return R[0]=e,R}const q=new c,I=a(),P=a(),V=a(),k=new t,L=new c,C=new c,H=new c,W=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],G=new t,J=[0,0,0,0,0,0,0,0];export{f as Octree};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{sub as t,set as n,
|
|
2
|
+
import{sub as t,set as n,cross as o,normalize as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as c,setMax as s,create as r}from"../../../../geometry/support/aaBoundingBox.js";import{boundingInfoSubdivisionThreshold as u}from"./intersectionConstants.js";import{assert as f}from"./Util.js";class a{constructor(t=0,n=!1,o=!0){this.tolerance=t,this.isVerticalRay=n,this.normalRequired=o}}const l=r();function m(n,o,i,e,c,s){if(!n.visible)return;const r=t(E,e,i),{tolerance:u}=o,l=new a(u,!1,o.options.normalRequired);if(n.boundingInfo)f(0===n.type),h(n.boundingInfo,i,r,u,c,l,s);else{const t=n.positionAttribute,o=n.primitivePositionIndices;T(i,r,0,o.length/3,o,t.data,t.stride,c,l,s)}}const p=e();function h(t,n,o,i,e,r,f){if(null==t)return;const a=w(o,p);if(c(l,t.bbMin),s(l,t.bbMax),null!=e&&e.applyToAabb(l),U(l,n,a,i)){const{primitiveIndices:c,position:s}=t,a=c?c.length:s.indices.length/3;if(a>u){const c=t.getChildren();if(void 0!==c){for(const t of c)h(t,n,o,i,e,r,f);return}}q(n,o,0,a,s.indices,s.data,s.stride,c,e,r,f)}}const d=e();function b(n,o,i,e,c,s,r,u,f){const{data:a,stride:l}=s;T(n,t(E,o,n),i,e,c,a,l,r,u,f)}function M(t,n,o,i){if(!o.visible)return;const{boundingInfo:e}=o;if(e){const{bbMin:o,bbMax:i}=e;if(t<o[0]||t>i[0]||n<o[1]||n>i[1])return}const c=o.positionAttribute,s=o.primitivePositionIndices;x(t,n,0,s.length/3,s,c,i)}function x(t,n,o,i,e,c,s){const{data:r,stride:u}=c;for(let f=o;f<i;++f){const o=3*f,i=u*e[o],c=u*e[o+1],a=u*e[o+2],l=r[i+0]-t,m=r[i+1]-n,p=r[c+0]-t,h=r[c+1]-n,d=r[a+0]-t,b=r[a+1]-n,M=d*h-b*p,x=l*b-m*d,g=p*m-h*l;(M<0||x<0||g<0)&&(M>0||x>0||g>0)||s(0,null,f)}}function g(t,n,o,i,e,c,s,r,u,f=null,a=0){const l=t[0],m=t[1],p=t[2],h=n[0],b=n[1],M=n[2];for(let x=o;x<i;++x){const t=a+(f?.[x]??x),n=3*t,o=s*e[n],i=c[o],g=c[o+1],y=c[o+2],v=s*e[n+1],q=c[v],T=c[v+1],V=c[v+2],I=s*e[n+2],j=q-i,A=T-g,B=V-y,C=c[I]-i,P=c[I+1]-g,w=c[I+2]-y,U=b*w-P*M,k=M*C-w*h,z=h*P-C*b,E=j*U+A*k+B*z,F=E*E;if(F<=D)continue;const G=l-i,H=m-g,J=p-y,K=(G*U+H*k+J*z)*E;if(K<0||K>F)continue;const L=H*B-A*J,N=J*j-B*G,O=G*A-j*H,Q=(h*L+b*N+M*O)*E;if(Q<0||K+Q>F)continue;const S=(C*L+P*N+w*O)/E;if(S>=0){u(S,r?R(j,A,B,C,P,w,d):null,t)}}}function y(t,n,o,i,e,c,s,r){const u=t[0],f=t[1],a=t[2],l=n[0],m=n[1],p=n[2];for(let h=o;h<i;++h){const t=3*h,n=t+1,o=t+2,i=c*t,b=e[i],M=e[i+1],x=e[i+2],g=c*n,y=c*o,v=e[g]-b,q=e[g+1]-M,T=e[g+2]-x,V=e[y]-b,I=e[y+1]-M,j=e[y+2]-x,A=m*j-I*p,B=p*V-j*l,C=l*I-V*m,P=v*A+q*B+T*C,w=P*P;if(w<=D)continue;const U=u-b,k=f-M,z=a-x,E=(U*A+k*B+z*C)*P;if(E<0||E>w)continue;const F=k*T-q*z,G=z*v-T*U,H=U*q-v*k,J=(l*F+m*G+p*H)*P;if(J<0||E+J>w)continue;const K=(V*F+I*G+j*H)/P;if(K>=0){r(K,s?R(v,q,T,V,I,j,d):null,h)}}}function v(t,n,o,i,e,c,s,r,u,f,a,l=null,m=0){const p=t[0],h=t[1],b=t[2],M=n[0],x=n[1],g=n[2];for(let y=o;y<i;++y){const t=m+(l?.[y]??y),n=3*t,o=s*e[n],i=c[o],v=c[o+1],q=c[o+2],T=s*e[n+1],V=c[T],I=c[T+1],j=c[T+2],A=s*e[n+2],B=c[A],C=c[A+1],P=c[A+2],w=q-u,U=r/Math.sqrt(i*i+v*v+w*w),k=i+i*U,z=v+v*U,E=q+w*U,F=j-u,G=r/Math.sqrt(V*V+I*I+F*F),H=V+V*G,J=I+I*G,K=j+F*G,L=P-u,N=r/Math.sqrt(B*B+C*C+L*L),O=H-k,Q=J-z,S=K-E,W=B+B*N-k,X=C+C*N-z,Y=P+L*N-E,Z=x*Y-X*g,$=g*W-Y*M,_=M*X-W*x,tt=O*Z+Q*$+S*_,nt=tt*tt;if(nt<=D)continue;const ot=p-k,it=h-z,et=b-E,ct=(ot*Z+it*$+et*_)*tt;if(ct<0||ct>nt)continue;const st=it*S-Q*et,rt=et*O-S*ot,ut=ot*Q-O*it,ft=(M*st+x*rt+g*ut)*tt;if(ft<0||ct+ft>nt)continue;const at=(W*st+X*rt+Y*ut)/tt;if(at>=0){a(at,f?R(O,Q,S,W,X,Y,d):null,t)}}}function q(t,n,o,i,e,c,s,r,u,f,a){const l=t[0],m=t[1],p=t[2],h=n[0],b=n[1],M=n[2],{normalRequired:x}=f;for(let g=o;g<i;++g){const t=r[g],n=3*t,o=s*e[n];let i=c[o],f=c[o+1],y=c[o+2];const v=s*e[n+1];let q=c[v],T=c[v+1],V=c[v+2];const I=s*e[n+2];let j=c[I],A=c[I+1],B=c[I+2];null!=u&&([i,f,y]=u.applyToVertex(G,i,f,y,g),[q,T,V]=u.applyToVertex(G,q,T,V,g),[j,A,B]=u.applyToVertex(G,j,A,B,g));const C=q-i,P=T-f,w=V-y,U=j-i,k=A-f,z=B-y,E=b*z-k*M,F=M*U-z*h,H=h*k-U*b,J=C*E+P*F+w*H,K=J*J;if(K<=D)continue;const L=l-i,N=m-f,O=p-y,Q=(L*E+N*F+O*H)*J;if(Q<0||Q>K)continue;const S=N*w-P*O,W=O*C-w*L,X=L*P-C*N,Y=(h*S+b*W+M*X)*J;if(Y<0||Q+Y>K)continue;const Z=(U*S+k*W+z*X)/J;if(Z>=0){a(Z,x?R(C,P,w,U,k,z,d):null,t)}}}function T(o,i,e,c,s,r,u,f,a,l){const m=i,p=F,h=Math.abs(m[0]),d=Math.abs(m[1]),b=Math.abs(m[2]),M=h>=d?h>=b?0:2:d>=b?1:2,x=M,g=m[x]<0?2:1,y=(M+g)%3,v=(M+(3-g))%3,q=m[y]/m[x],T=m[v]/m[x],R=1/m[x],B=V,C=I,P=j,{normalRequired:w}=a;for(let V=e;V<c;++V){const i=3*V,e=u*s[i];n(p[0],r[e+0],r[e+1],r[e+2]);const c=u*s[i+1];n(p[1],r[c+0],r[c+1],r[c+2]);const a=u*s[i+2];n(p[2],r[a+0],r[a+1],r[a+2]),f&&(f.applyToVertex(p[0],p[0][0],p[0][1],p[0][2],V),f.applyToVertex(p[1],p[1][0],p[1][1],p[1][2],V),f.applyToVertex(p[2],p[2][0],p[2][1],p[2][2],V)),t(B,p[0],o),t(C,p[1],o),t(P,p[2],o);const m=B[y]-q*B[x],h=B[v]-T*B[x],d=C[y]-q*C[x],b=C[v]-T*C[x],M=P[y]-q*P[x],g=P[v]-T*P[x],I=M*b-g*d,j=m*g-h*M,U=d*h-b*m;if((I<0||j<0||U<0)&&(I>0||j>0||U>0))continue;const k=I+j+U;if(0===k)continue;const z=I*(R*B[x])+j*(R*C[x])+U*(R*P[x]);if(z*Math.sign(k)<0)continue;const D=z/k;if(D>=0){l(D,w?A(p):null,V)}}}const V=e(),I=e(),j=e();function R(t,e,c,s,r,u,f){return n(B,t,e,c),n(C,s,r,u),o(f,B,C),i(f,f),f}function A(n){return t(B,n[1],n[0]),t(C,n[2],n[0]),o(d,B,C),i(d,d),d}const B=e(),C=e();function P(t,o,i){return n(i,1/(o[0]-t[0]),1/(o[1]-t[1]),1/(o[2]-t[2]))}function w(t,o){return n(o,1/t[0],1/t[1],1/t[2])}function U(t,n,o,i){return k(t,n,o,i,1/0)}function k(t,n,o,i,e){const c=(t[0]-i-n[0])*o[0],s=(t[3]+i-n[0])*o[0];let r=Math.min(c,s),u=Math.max(c,s);const f=(t[1]-i-n[1])*o[1],a=(t[4]+i-n[1])*o[1];if(u=Math.min(u,Math.max(f,a)),u<0)return!1;if(r=Math.max(r,Math.min(f,a)),r>u)return!1;const l=(t[2]-i-n[2])*o[2],m=(t[5]+i-n[2])*o[2];return u=Math.min(u,Math.max(l,m)),!(u<0)&&(r=Math.max(r,Math.min(l,m)),!(r>u)&&r<e)}const z=1e-7,D=z*z,E=e(),F=[e(),e(),e()],G=e();export{a as MeshIntersectionOptions,P as computeInvDir,w as computeInvDirFromDirection,R as computeNormalFromBarycentric,U as intersectAabbInvDir,k as intersectAabbInvDirBefore,g as intersectRayTriangles,T as intersectRayTrianglesWithDisplacementWatertight,v as intersectRayTrianglesWithVerticalOffsetENUGlobal,y as intersectRenderGeometryTriangles,m as intersectTriangleGeometry,M as intersectTriangleGeometry2D,b as intersectTriangles,x as intersectTriangles2d,z as triangleRayParallelTolerance};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
class
|
|
2
|
+
class t{constructor(t,e,r,s=0){this.layout=t,this.byteOffset=s,this._bufferViews=new Map,this.buffer="number"==typeof e?new ArrayBuffer(e*t.byteStride):e,this.texelElementBuffer=new r(this.buffer,s);const f=this._bufferViews;for(const[i,n]of this.layout.fields)f.set(i,new n.bufferViewConstructor(this.buffer,s+n.byteOffset,this.layout.byteStride))}get stride(){return this.layout.byteStride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(t,e){const r=this._bufferViews.get(t);return null!=r&&r.elementCount===e.ElementCount&&r.elementType===e.ElementType?r:null}copyItem(t,e){const{buffer:r,layout:s,byteOffset:f}=this,i=new Uint8Array(r),n=s.byteStride,u=f+t*n,y=f+e*n;i.copyWithin(y,u,u+n)}get usedMemory(){return this.byteLength}}export{t as TextureBufferView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{lerp as
|
|
2
|
+
import{copy as i,lerp as s,squaredLength as t,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{h as o}from"../../../../chunks/boundedPlane.js";import{clipPolygon as l,clipLineSegment as r,create as c,fromValues as a}from"../../../../geometry/support/plane.js";function u(i){return(t,n,e)=>!o(i,s(b,t,n,e))}class h{constructor(i,s){this.list=i,this.count=s}}class m{constructor(i){this._remainingA=g(),this._remainingB=g(),this._visible=g(),this._lineRemainingA=p(),this._lineRemainingB=p(),this._lineVisible=p(),this._slicedAwayHalfspaces=f(i)}*processTriangle(s,t){let n=new h(this._remainingA,3),e=new h(this._remainingB,0);i(n.list[0],t[0]),i(n.list[1],t[1]),i(n.list[2],t[2]);const o=new h(this._visible,0);for(const i of this._slicedAwayHalfspaces){if(o.count=l(i,n.list,n.count,o.list,!1),o.count>=3&&(s.list=o.list,s.count=o.count,yield s),e.count=l(i,n.list,n.count,e.list,!0),e.count<3)return;[e,n]=[n,e]}}*processLineSegment(s,t,n){let e=this._lineRemainingA,o=this._lineRemainingB;i(e[0],t),i(e[1],n);for(const l of this._slicedAwayHalfspaces){if(r(l,e[0],e[1],this._lineVisible[0],this._lineVisible[1],!1)&&(i(s[0],this._lineVisible[0]),i(s[1],this._lineVisible[1]),yield s),!r(l,e[0],e[1],o[0],o[1],!0))return;[o,e]=[e,o]}}}function f(i){const s=[c(i.plane),c(),c(),c(),c()];return _(i.basis1,i.origin,s[1],s[2]),_(i.basis2,i.origin,s[3],s[4]),s}function _(i,s,e,o){const l=t(i),r=n(i,s);a(i[0],i[1],i[2],-r+l,e),a(-i[0],-i[1],-i[2],r+l,o)}function g(){return Array.from({length:12},()=>e())}function p(){return[e(),e()]}const b=e();export{m as SliceScreenPolygonPrimitiveProcessor,u as sliceFilterPredicate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{createScreenPointArray as t,createRenderScreenPointArray3 as n}from"../../../../core/screenUtils.js";import{transformMat4 as r,copy as e,distance as o,set as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as s,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{
|
|
2
|
+
import{createScreenPointArray as t,createRenderScreenPointArray3 as n}from"../../../../core/screenUtils.js";import{transformMat4 as r,copy as e,distance as o,set as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as s,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as u,expandPointInPlace as f,clone as a,intersects as p,containsPoint as l,create as m,fromValues as h}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as d,create as g,distance2 as M}from"../../../../geometry/support/lineSegment.js";import{signedDistance as b,intersectLineSegment as j}from"../../../../geometry/support/plane.js";import{containsPoint2dFromValues as x}from"../../../../geometry/support/triangle.js";class I{constructor(t,n,r){this.bounds=t,this.nearestDistance=n,this.nearestPoint=r}}function N(t,n){return t.isRectangle?l(t.bounds,n):O(n,t.points)}function T(t,n){if(!p(t.bounds,n))return!1;if(t.isRectangle)return!0;for(const r of t.points)if(l(n,r))return!0;for(let r=0;r<4;r++)if(O(k(z,n,r),t.points))return!0;for(let r=0;r<t.points.length;r++){const e=t.points[r],o=r===t.points.length-1?t.points[0]:t.points[r+1];for(let t=0;t<4;t++){if(V(e,o,k(z,n,t),k(A,n,(t+1)%4)))return!0}}return!1}function S(t,n,r,e){const o=Math.min(n[0],r[0],e[0]),i=Math.min(n[1],r[1],e[1]),s=Math.max(n[0],r[0],e[0]),c=Math.max(n[1],r[1],e[1]);if(!T(t,h(o,i,s,c,q)))return!1;if(N(t,n)||N(t,r)||N(t,e))return!0;for(const u of t.points)if(x(n,r,e,u,nt))return!0;for(let u=0;u<t.points.length;u++){const o=t.points[u],i=t.points[(u+1)%t.points.length];if(V(n,r,o,i)||V(r,e,o,i)||V(e,n,o,i))return!0}return!1}function R(t,n,r,e){const o=Math.min(n[0],r[0])-e,i=Math.min(n[1],r[1])-e,s=Math.max(n[0],r[0])+e,c=Math.max(n[1],r[1])+e;if(!p(t.bounds,h(o,i,s,c,q)))return!1;if(N(t,n)||N(t,r))return!0;const u=e*e;for(const f of t.points)if(B(f,n,r)<=u)return!0;for(let f=0;f<t.points.length;f++){const e=t.points[f],o=t.points[(f+1)%t.points.length];if(V(n,r,e,o)||Y(n,r,e,o)<=u)return!0}return!1}function y(t,n,r){return _(t,n.bbMin,n.bbMax,r)}function _(t,n,o,i){const c=u(q);tt.reset(t.eye);let p=0;for(let s=0;s<2;s++)for(let u=0;u<2;u++)for(let a=0;a<2;a++)J[0]=0===s?n[0]:o[0],J[1]=0===u?n[1]:o[1],J[2]=0===a?n[2]:o[2],i&&r(J,J,i),e(X[p++],J),F(t,J)||(t.projectToScreen(J,z),f(c,z),tt.addNearestCandidate(J));return v(t,c,X,tt),tt.valid?new I(a(c),tt.distance,s(tt.point)):null}function v(t,n,r,e){for(let o=0;o<r.length;o++)for(const i of Z){const s=o|i;if(s===o)continue;E(t,r[o],r[s],K)&&(t.projectToScreen(K,z),f(n,z),e.addNearestCandidate(K))}}function C(t,n,r,o,i){e(K,n),e(L,r);const s=t.projectToRenderScreen(K,G),c=t.projectToRenderScreen(L,H);if(null==s||null==c)return!1;const u=F(t,K),f=F(t,L);if(u&&f)return!1;if(u!==f){const n=u?K:L,r=u?s:c;if(!w(t,n,u?L:K))return!1;if(!t.projectToRenderScreen(n,r))return!1}return o[0]=s[0],o[1]=s[1],o[2]=0,i[0]=c[0],i[1]=c[1],i[2]=0,!0}function F(t,n){return P(t,n)>0}function P(t,n){return b(t.frustum[4],n)}function w(t,n,r){return E(t,n,r,n)}function E(t,n,r,e){return j(t.frustum[4],d(n,r,W),e)}function O(t,n){let r=!1;for(let e=0,o=n.length-1;e<n.length;o=e++){const i=n[e],s=n[o];if(!(i[1]>t[1]!=s[1]>t[1]))continue;const c=(s[0]-i[0])*(t[1]-i[1])/(s[1]-i[1])+i[0];t[0]<c&&(r=!r)}return r}function V(t,n,r,e){const o=D(t,n,r),i=D(t,n,e),s=D(r,e,t),c=D(r,e,n);return o!==i&&s!==c||(0===o&&U(t,n,r)||0===i&&U(t,n,e)||0===s&&U(r,e,t)||0===c&&U(r,e,n))}function Y(t,n,r,e){return V(t,n,r,e)?0:Math.min(B(t,r,e),B(n,r,e),B(r,t,n),B(e,t,n))}function B(t,n,r){return M(d(i(K,n[0],n[1],0),i(L,r[0],r[1],0),W),i(Q,t[0],t[1],0))}function D(t,n,r){const e=(n[1]-t[1])*(r[0]-n[0])-(n[0]-t[0])*(r[1]-n[1]);return Math.abs(e)<=nt?0:Math.sign(e)}function U(t,n,r){return r[0]>=Math.min(t[0],n[0])-nt&&r[0]<=Math.max(t[0],n[0])+nt&&r[1]>=Math.min(t[1],n[1])-nt&&r[1]<=Math.max(t[1],n[1])+nt}function k(t,n,r){return t[0]=0===r||3===r?n[0]:n[2],t[1]=r<2?n[1]:n[3],t}const q=m(),z=t(),A=t(),G=n(),H=n(),J=c(),K=c(),L=c(),Q=c(),W=g(),X=[c(),c(),c(),c(),c(),c(),c(),c()],Z=[1,2,4];class ${constructor(){this._origin=c(),this.point=c(),this.distance=Number.POSITIVE_INFINITY}get valid(){return Number.isFinite(this.distance)}addNearestCandidate(t){const n=o(this._origin,t);n<this.distance&&(this.distance=n,e(this.point,t))}reset(t){this.distance=Number.POSITIVE_INFINITY,e(this._origin,t)}}const tt=new $,nt=1e-9;export{I as ProjectedScreenBounds,F as isBehindNearPlane,_ as projectAabbToScreenBounds,y as projectBoundingInfoToScreenBounds,C as projectWorldLineSegmentToRenderScreen,N as screenPolygonContainsPoint,T as screenPolygonIntersectsBounds,R as screenPolygonIntersectsBufferedSegment,S as screenPolygonIntersectsTriangle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{copy as
|
|
2
|
+
import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{copy as e,set as n,transformMat4 as o,distance as r,squaredDistance as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as l,setMax as a,getMax as u,getMin as c,create as f}from"../../../../geometry/support/aaBoundingBox.js";import{clipPolygon as m}from"../../../../geometry/support/plane.js";import{normalFromValues as p,closestPointFromValues as d}from"../../../../geometry/support/triangle.js";import{boundingInfoSubdivisionThreshold as I}from"./intersectionConstants.js";import{projectAabbToScreenBounds as h,projectBoundingInfoToScreenBounds as g,screenPolygonIntersectsBounds as b,screenPolygonIntersectsTriangle as v}from"./screenPolygonOverlapUtils.js";class y{constructor(){this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=s(),this.normal=s()}reset(){this.distance=Number.POSITIVE_INFINITY}update(t,n,o,r){this.distance=t,this.primitiveIndex=n,e(this.point,o),this.hasNormal=null!=r,null!=r&&e(this.normal,r)}updateIfCloserFromValues(t,e,n,o){t<this.distance&&this.update(t,e,n,o)}updateIfCloser(t){const{distance:e,primitiveIndex:n,point:o,normal:r}=t;this.updateIfCloserFromValues(e,n,o,t.hasNormal?r:null)}get valid(){return Number.isFinite(this.distance)}}function N(t,e,n,o,r){if(!t.visible||0!==t.type)return null;const i=new y;let s;if(t.boundingInfo)s=x(t.boundingInfo,e,n,o,r);else{const i=t.positionAttribute,l=t.primitivePositionIndices;s=j(e,n,o,0,l.length/3,l,i.data,i.stride,r,null,0)}for(const l of s)i.updateIfCloser(l);return i.valid?i:null}function T(t,e,n,o,r,i,s,l,a){const u=new y;for(const c of j(t,e,n,o,r,i,s,l,a,null,0))u.updateIfCloser(c);return u.valid?u:null}function*j(t,e,n,o,i,s,l,a,u,c=null,f=0){if(null==t.camera)return;const{camera:d,screenPolygonPrimitiveProcessor:I}=t;for(let h=o;h<i;++h){const t=(c?.[h]??h)+f,o=null==c?t:h,i=3*t;C(O[0],s,l,a,i+0,u,o,e),C(O[1],s,l,a,i+1,u,o,e),C(O[2],s,l,a,i+2,u,o,e);const g=Y;let b;B.reset();for(const{list:e,count:s}of I.processTriangle(M,O)){const o=m(d.frustum[4],e,s,S,!1);if(!(o<3)){for(let t=0;t<o;t++)d.projectToScreen(S[t],w[t]);P(n,w,o)&&(F(d.eye,S,o,E),null==b&&(b=p(Y,O[0],O[1],O[2])),B.updateIfCloserFromValues(r(d.eye,E),t,E,b?g:null))}}B.valid&&(yield B)}}function*x(t,e,n,o,r){const i=e.camera,s=null!=r?(l(V,t.bbMin),a(V,t.bbMax),r.applyToAabb(V),h(i,c(V,O[0]),u(V,O[1]),n)):g(i,t,n);if(null==s||!b(o,s.bounds))return;const{primitiveIndices:f,position:m}=t,p=f?f.length:m.indices.length/3;if(p>I){const i=t.getChildren();if(void 0!==i){for(const t of i)yield*x(t,e,n,o,r);return}}yield*j(e,n,o,0,p,m.indices,m.data,m.stride,r,f,0)}function C(t,e,r,i,s,l,a,u){const c=i*e[s],f=r[c+0],m=r[c+1],p=r[c+2];null!=l?l.applyToVertex(t,f,m,p,a):n(t,f,m,p),u&&o(t,t,u)}function P(t,e,n){for(let o=1;o<n-1;o++)if(v(t,e[0],e[o],e[o+1]))return!0;return!1}function F(t,n,o,r){let s=Number.POSITIVE_INFINITY;for(let l=1;l<o-1;l++){d(_,t,n[0],n[l],n[l+1]);const o=i(t,_);o<s&&(s=o,e(r,_))}}const V=f(),A=12,O=[s(),s(),s()],S=Array.from({length:A},()=>s()),w=Array.from({length:A},()=>t()),E=s(),Y=s(),_=s(),B=new y,M={list:[],count:0};export{y as Hit,j as forEachTriangleRangeScreenPolygonHit,N as intersectTriangleGeometryScreenPolygon,T as intersectTriangleRangeScreenPolygon};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{normalFromMat4Legacy as t}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r,transpose as e,copy as i,multiply as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,transformMat4 as
|
|
2
|
+
import{normalFromMat4Legacy as t}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r,transpose as e,copy as i,multiply as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,transformMat4 as f,length as h,scaleAndAdd as l,add as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Sphere as c}from"../../../../geometry/support/sphere.js";import{Obb as _,computeOffsetObb as u}from"../../support/orientedBoundingBox.js";class g{constructor(){this._transform=a(),this._transformInverse=new M({value:this._transform},r,a),this._transformInverseTranspose=new M(this._transformInverse,e,a),this._transformTranspose=new M({value:this._transform},e,a),this._transformInverseRotation=new M({value:this._transform},t,s)}_invalidateLazyTransforms(){this._transformInverse.invalidate(),this._transformInverseTranspose.invalidate(),this._transformTranspose.invalidate(),this._transformInverseRotation.invalidate()}get transform(){return this._transform}get inverse(){return this._transformInverse.value}get inverseTranspose(){return this._transformInverseTranspose.value}get inverseRotation(){return this._transformInverseRotation.value}get transpose(){return this._transformTranspose.value}setTransformMatrix(t){i(this._transform,t)}multiplyTransform(t){o(this._transform,this._transform,t)}set(t){i(this._transform,t),this._invalidateLazyTransforms()}setAndInvalidateLazyTransforms(t,s){this.setTransformMatrix(t),this.multiplyTransform(s),this._invalidateLazyTransforms()}}class M{constructor(t,s,r){this._original=t,this._update=s,this._dirty=!0,this._transform=r()}invalidate(){this._dirty=!0}get value(){return this._dirty&&(this._update(this._transform,this._original.value),this._dirty=!1),this._transform}}class v{constructor(t=0){this.offset=t,this._tmpVertex=p()}applyToVertex(t,s,r,e){const i=n(w,s,r,e),o=m(V,i,this.localOrigin),a=this.offset/h(o);return l(t,i,o,a),t}applyToAabb(t){const s=S,r=q,e=z;for(let n=0;n<3;++n)s[n]=t[0+n]+this.localOrigin[n],r[n]=t[3+n]+this.localOrigin[n],e[n]=s[n];const i=this.applyToVertex(this._tmpVertex,s[0],s[1],s[2]);for(let n=0;n<3;++n)t[n]=i[n],t[n+3]=i[n];const o=s=>{const r=this.applyToVertex(this._tmpVertex,s[0],s[1],s[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],r[e]),t[e+3]=Math.max(t[e+3],r[e])};for(let n=1;n<8;++n){for(let t=0;t<3;++t)e[t]=n&1<<t?r[t]:s[t];o(e)}let a=0;for(let n=0;n<3;++n){s[n]*r[n]<0&&(a|=1<<n)}if(0!==a&&7!==a)for(let n=0;n<8;++n)if(0===(a&n)){for(let t=0;t<3;++t)e[t]=a&1<<t?0:n&1<<t?s[t]:r[t];o(e)}for(let n=0;n<3;++n)t[n]-=this.localOrigin[n],t[n+3]-=this.localOrigin[n];return t}}class b{constructor(t=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpMbs=new c,this._tmpObb=new _,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=h(t)}applyToVertex(t,s,r,e){const i=n(w,s,r,e),o=n(V,s,r,e+this.componentLocalOriginLength),a=this._totalOffset/h(o);return l(t,i,o,a),t}applyToAabb(t){const s=this.componentLocalOriginLength,r=t[0],e=t[1],i=t[2]+s,o=t[3],a=t[4],n=t[5]+s,f=Math.abs(r),h=Math.abs(e),l=Math.abs(i),m=Math.abs(o),p=Math.abs(a),c=Math.abs(n),_=.5*(1+Math.sign(r*o))*Math.min(f,m),u=.5*(1+Math.sign(e*a))*Math.min(h,p),g=.5*(1+Math.sign(i*n))*Math.min(l,c),M=Math.sqrt(_*_+u*u+g*g),v=Math.sign(f+r),b=Math.sign(h+e),T=Math.sign(l+i),O=Math.sign(m+o),d=Math.sign(p+a),x=Math.sign(c+n),y=this._totalOffset;if(M<y)return t[0]-=(1-v)*y,t[1]-=(1-b)*y,t[2]-=(1-T)*y,t[3]+=O*y,t[4]+=d*y,t[5]+=x*y,t;const L=Math.max(f,m),I=Math.max(h,p),j=Math.max(l,c),w=y/Math.sqrt(L*L+I*I+j*j),V=y/M,S=V-w,q=-S;return t[0]+=r*(v*q+V),t[1]+=e*(b*q+V),t[2]+=i*(T*q+V),t[3]+=o*(O*S+w),t[4]+=a*(d*S+w),t[5]+=n*(x*S+w),t}applyToMbs(t){const s=t.center,r=h(s),e=this._totalOffset/r;return l(this._tmpMbs.center,s,s,e),this._tmpMbs.radius=t.radius+t.radius*this._totalOffset/r,this._tmpMbs}applyToObb(t){return u(t,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}}class T{constructor(t=0){this.offset=t,this._tmpSphere=new c}applyToVertex(t,s,r,e){const i=this.objectTransform.transform,o=n(w,s,r,e),a=f(o,o,i),m=this.offset/h(a);l(a,a,a,m);const p=this.objectTransform.inverse;return f(t,a,p),t}applyToMinMax(t,s){const r=this.offset/h(t);l(t,t,t,r);const e=this.offset/h(s);l(s,s,s,e)}applyToAabb(t){const s=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*s,t[1]+=t[1]*s,t[2]+=t[2]*s;const r=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*r,t[4]+=t[4]*r,t[5]+=t[5]*r,t}applyToBoundingSphere(t){const s=t.center,r=h(s),e=this.offset/r;return l(this._tmpSphere.center,s,s,e),this._tmpSphere.radius=t.radius+t.radius*this.offset/r,this._tmpSphere}}const O=new T;function d(t){return null!=t?(O.offset=t,O):null}const x=new b;function y(t){return null!=t?(x.offset=t,x):null}const L=new v;function I(t){return null!=t?(L.offset=t,L):null}const j="terrain",w=p(),V=p(),S=p(),q=p(),z=p();export{b as I3SVerticalOffsetGlobalViewingMode,g as IntersectorTransform,T as Object3DVerticalOffsetGlobalViewingMode,v as TerrainVerticalOffsetGlobalViewingMode,y as getVerticalOffsetI3S,d as getVerticalOffsetObject3D,I as getVerticalOffsetTerrain,j as terrainId};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as
|
|
2
|
+
import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import s from"../lib/GLMaterial.js";import{DefaultBufferWriter as o}from"./DefaultBufferWriter.js";import{PositionUvLayout as i}from"./DefaultLayouts.js";import{TriangleMaterial as a,TriangleMaterialParameters as n}from"./TriangleMaterial.js";import{CheckerBoardTechnique as c}from"../shaders/CheckerBoardTechnique.js";import{CheckerBoardTechniqueConfiguration as p}from"../shaders/CheckerBoardTechniqueConfiguration.js";import{alphaCutoff as u}from"../../../../webscene/support/AlphaCutoff.js";class f extends a{constructor(r){super(r,l),this._configuration=new p,this.produces=new Map([[2,r=>t(r)&&!this.transparent],[8,r=>t(r)&&this.transparent]])}updateConfiguration(r){super.updateConfiguration(r)}get visible(){return this.parameters.color1[3]>=u||this.parameters.color2[3]>=u}get transparent(){return this.parameters.color1[3]<1||this.parameters.color2[3]<1}createGLMaterial(r){return new m(r)}createBufferWriter(){return new o(i)}}class m extends s{beginSlot(r){return this.getTechnique(c,r)}}class l extends n{constructor(){super(...arguments),this.size=r(1,1),this.color1=e(.75,.75,.75,1),this.color2=e(.5,.5,.5,1),this.polygonOffset=4}}export{f as CheckerBoardMaterial,l as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{exactEquals as e,
|
|
2
|
+
import{exactEquals as e,subtract as t,add as r,set as s,copy as i,normalize as a,length as o,scale as n,dot as l,transformMat3 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as u,create as h,fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as p,getMin as f,setMax as d,getMax as x}from"../../../../geometry/support/aaBoundingBox.js";import{is3DGeometryOrShadowLike as T,isColor as g}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as v}from"../lib/GLTextureMaterial.js";import{Material as S}from"../lib/Material.js";import{intersectTriangleGeometry as b}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as M}from"../lib/screenPolygonTriangleIntersections.js";import{getVerticalOffsetObject3D as y}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as O}from"./DefaultBufferWriter.js";import{intersectWithPolygonOffset as C,applyPolygonOffsetToHit as R}from"./intersectWithPolygonOffset.js";import{verticalOffsetAtDistance as w}from"./internal/MaterialUtil.js";import{getLayout as P,DefaultMaterialPassParameters as j,DefaultMaterialTechnique as V}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as I}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as _}from"../shaders/RealisticTreeTechnique.js";import{hasShadowHighlights as A}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as B}from"../../../../webscene/support/AlphaCutoff.js";class D extends S{constructor(e,t){super(e,z),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.produces=new Map([[2,e=>T(e)&&!this.transparent],[4,e=>T(e)&&this.transparent]]),this._layout=P(this.parameters),this._configuration=new I(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:s}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(s[3])?1:s[3])>=B}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get emissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:s,doubleSided:i,doubleSidedType:a}=t;r.hasVertexTangents=!s&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=s?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!s&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=s?2:i&&"normal"===a?1:i&&"winding-order"===a?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,g(e.output)?(r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=A(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&e.globalIlluminationEnabled):r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=!1,r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,r,s,i,a,o){const n=this._getMaterialVerticalOffset(r,s);null!=n&&(i=t(F,i,n),a=t(E,a,n)),o=C(o,this._configuration,i,a),b(e,s,i,a,y(s.verticalOffset),o)}intersectScreenPolygon(e,t,r,s){return R(M(e,r,t,s,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera.eye)}createGLMaterial(e){return new N(e)}createBufferWriter(){return new O(this._layout)}get transparent(){const{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:s,texture:i,textureId:a,textureAlphaMode:o,colorMixMode:n}=this.parameters,l=r[3];return e||t<1&&"replace"!==n||l<1&&"ignore"!==n||s<1||(null!=i||null!=a)&&1!==o&&2!==o&&"replace"!==n}_createScreenPolygonVertexDisplacement(e,t){const s=this._getMaterialVerticalOffset(e,t);return null==s?null:{applyToVertex:(e,t,r,i)=>(e[0]=t+s[0],e[1]=r+s[1],e[2]=i+s[2],e),applyToAabb:e=>(p(e,r(W,f(e,W),s)),d(e,r(W,x(e,W),s)),e)}}_getMaterialVerticalOffset(e,r){if(null==this.parameters.verticalOffset)return null;const u=r.camera;s(G,e[12],e[13],e[14]);let h=null;switch(r.viewingMode){case 1:h=a(k,G);break;case 2:h=i(k,q)}const m=t(H,G,u.eye),p=o(m),f=n(m,m,1/p);let d=null;this.parameters.screenSizePerspective&&(d=l(h,f));const x=w(u,p,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective,null);return n(h,h,x),c(L,h,r.transform.inverseRotation)}}class N extends v{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return s(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?_:V,e)}}class z extends j{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const F=h(),E=h(),q=m(0,0,1),k=h(),G=h(),H=h(),L=h(),W=h();export{N as DefaultGLMaterial,D as DefaultMaterial,z as DefaultMaterialParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ONES as l,fromValues as c,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as f,transformMat4 as u,normalize as h,subtract as m,scale as d,transformMat3 as g,scaleAndAdd as b,copy as v,length as x,distance as S,sub as O,dot as z}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y,fromValues as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as P,ONES as C,create as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as R}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as D}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as w}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as A}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as M,isColor as F,isOIT as U}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as _}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as L,GLTextureMaterial as T}from"../lib/GLTextureMaterial.js";import{Material as B}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as E}from"../lib/screenSizePerspectiveUtils.js";import{assert as I}from"../lib/Util.js";import{writePosition as W,writeNormal as H,writeColor as N,writeBufferVec2 as G,writeBufferFloat as q,writeBufferVec3 as X,writeBufferZeros as Y,writeBufferVec4 as k,writeOlidColor as J}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as K}from"./internal/MaterialUtil.js";import{a as Q}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as Z,getInstanceLayout as $,HUDMaterialTechnique as ee}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as te}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as se}from"../../../../webscene/support/AlphaCutoff.js";class re extends B{constructor(e,t,s=!1){super(e,Ce),this.produces=new Map([[12,e=>M(e)&&!this.parameters.drawAsLabel&&!this._configuration.transparentOccluded],[13,e=>M(e)&&!this.parameters.drawAsLabel&&this._configuration.transparentOccluded],[14,e=>M(e)&&this.parameters.drawAsLabel],[18,e=>this.parameters.draped&&M(e)]]),this._visible=!0,this._configuration=new te(t,s)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:s}=this,r=t.draped;s.enableOITOffset=e.enableOITOffset,s.hasSlicePlane=this.parameters.hasSlicePlane,s.hasVerticalOffset=!!this.parameters.verticalOffset,s.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,s.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,s.polygonOffset=this.parameters.polygonOffset,s.draped=r,s.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,s.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,s.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,s.hasRotation=this.parameters.hasRotation,s.hasVVSize=!!this.parameters.vvSize,s.hasVVColor=!!this.parameters.vvColor,s.occludedFragmentFade=!r&&!!this.parameters.occludedFragmentOpacity,s.hasFocusAreaStyle=null!=this.parameters.focusAreaStyle,s.depthTestEnabled=this.parameters.depthEnabled,s.hasVertexColor=this.parameters.hasVertexColor,s.hasVertexSize=this.parameters.hasVertexSize,s.hasVertexRotation=this.parameters.hasVertexRotation,s.hasVertexUVi=this.parameters.hasVertexUVi,s.hasVertexCenterOffset=this.parameters.hasVertexCenterOffset,F(e.output)&&(s.debugDrawLabelBorder=!!A.LABELS_SHOW_BORDER),s.hasOcclusionTexture=!t.drawAsLabel&&s.transparentOccluded&&U(e.output)}intersectRay(e,t,r,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:p},point:O,camera:z}=r,{parameters:V}=this;if(!l||!c||p&&V.isLabel||!e.visible||!O||!z)return;const C=e.attributes.get("featureAttribute"),j=null==C?null:P(C.data,Se),{scaleX:R,scaleY:D}=Re(j,V,z.pixelRatio),w=e.attributes.get("position"),A=e.attributes.get("size"),M=e.attributes.get("normal"),F=e.attributes.get("rotation"),U=e.attributes.get("centerOffset"),_=this.parameters.size;I(w.size>=3);const L="screen"===this.parameters.centerOffsetUnits;for(let P=0;P<w.data.length/w.size;P++){const e=P*w.size;if(f(ce,w.data[e],w.data[e+1],w.data[e+2]),u(ce,ce,t),u(ce,ce,z.viewMatrix),U){const e=P*U.size;f(ve,U.data[e],U.data[e+1],U.data[e+2])}else f(ve,0,0,0);if(!L&&(ce[0]+=ve[0],ce[1]+=ve[1],0!==ve[2])){const e=ve[2];h(ve,ce),m(ce,ce,d(ve,ve,e))}const a=P*M.size;f(pe,M.data[a],M.data[a+1],M.data[a+2]),g(pe,pe,s(ge,t));const{normal:n,cosAngle:l}=ne(pe,z,Oe),c=we(this.parameters,ce,l,z,le);if(b(ce,ce,n,c),z.applyProjection(ce,fe),fe[0]>-1){if(L&&(ve[0]||ve[1])&&(fe[0]+=ve[0]*z.pixelRatio,0!==ve[1]&&(fe[1]+=le.alignmentEvaluator.apply(ve[1])*z.pixelRatio),z.unapplyProjection(fe,ce)),fe[0]+=this.parameters.screenOffset[0]*z.pixelRatio,fe[1]+=this.parameters.screenOffset[1]*z.pixelRatio,fe[0]=Math.floor(fe[0]),fe[1]=Math.floor(fe[1]),Ve[0]=_[0],Ve[1]=_[1],null!=A){const e=P*A.size;Ve[0]*=A.data[e],Ve[1]*=A.data[e+1]}le.evaluator.applyVec2(Ve,Ve);const e=ze*z.pixelRatio;let t=0;if(V.textureIsSignedDistanceField){t=Math.min(V.outlineSize,.5*Ve[0])*z.pixelRatio/2}Ve[0]*=R,Ve[1]*=D;const s=V.rotation+(null!=F?F.data[P*F.size]:0),a=Q(V);if(oe(O,fe[0],fe[1],Ve,e,t,s,V,a)){const e=r.ray;if(u(he,ce,i(be,z.viewMatrix)),fe[0]=O[0],fe[1]=O[1],z.unprojectFromRenderScreen(fe,ce)){const t=y();v(t,e.direction);const s=1/x(t);d(t,t,s);o(S(e.origin,ce)*s,t,-1,he)}}}}}intersectScreenPolygon(){}intersectRayDraped(e,t,s,r,i){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=l.size,p=e.attributes.get("featureAttribute"),f=null==p?null:P(p.data,Se),{scaleX:u,scaleY:h}=Re(f,l,e.screenToWorldRatio),m=ye*e.screenToWorldRatio;for(let d=0;d<a.data.length/a.size;d++){const t=d*a.size,p=a.data[t],f=a.data[t+1];if(Ve[0]=c[0],Ve[1]=c[1],null!=n){const e=d*n.size;Ve[0]*=n.data[e],Ve[1]*=n.data[e+1]}let g=0;if(l.textureIsSignedDistanceField){g=Math.min(l.outlineSize,.5*Ve[0])*e.screenToWorldRatio/2}Ve[0]*=u,Ve[1]*=h;const b=l.rotation+(null!=o?o.data[d*o.size]:0),v=Q(l);oe(s,p,f,Ve,m,g,b,l,v)&&r(i.distance,i.normal,-1)}}createBufferWriter(){return new je(this.parameters)}applyShaderOffsets(e,t,r,i,a,n,o,l){g(ue,r,s(ge,i));const c=ne(ue,o,Oe),p=De(x(t),o),f=we(this.parameters,t,c.cosAngle,o,l);b(t,t,c.normal,f+p),b(e,e,ue,f+p);const u=n+f;this._applyPolygonOffsetView(t,c,u,o,t),this._applyCenterOffsetView(t,a,t)}applyShaderOffsetsNDC(e,t,s,r,i,a){return this._applyCenterOffsetNDC(e,t,r,i),null!=a&&v(a,i),this._applyPolygonOffsetNDC(i,s,r,i),i}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return v(a,t);const c=e(Math.abs(s.cosAngle),.01,1),p=1-Math.sqrt(1-c*c)/c/i.viewport[2];return d(a,t,l>0?p:1/p),a}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&v(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(h(pe,s),O(s,s,d(pe,pe,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&v(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&v(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t);r[2]-=(a||e)*i}return r}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:s}=this.parameters,r=e[3]>=se||t>=se&&s[3]>=se;return this._visible&&r}createGLMaterial(e){return new ie(e)}calculateRelativeScreenBounds(e,t,s=R()){return ae(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}}class ie extends T{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(ee,e)}}function ae(e,t,s,r){r[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*s,r[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*s}function ne(e,t,s){return u(s.normal,e,t.viewInverseTransposeMatrix),s.cosAngle=z(s.normal,Pe),s}function oe(e,s,r,i,a,l,c,p,f){let u=s-a-i[0]*f[0],h=u+i[0]+2*a,m=r-a-i[1]*f[1],d=m+i[1]+2*a;const g=p.distanceFieldBoundingBox;return p.textureIsSignedDistanceField&&null!=g&&(u+=i[0]*g[0],m+=i[1]*g[1],h-=i[0]*(1-g[2]),d-=i[1]*(1-g[3]),u-=l,h+=l,m-=l,d+=l),n(de,s,r),o(me,e,de,t(c)),me[0]>u&&me[0]<h&&me[1]>m&&me[1]<d}const le=new E,ce=y(),pe=y(),fe=j(),ue=y(),he=y(),me=p(),de=p(),ge=r(),be=a(),ve=y(),xe=y(),Se=j(),Oe={normal:y(),cosAngle:0},ze=1,ye=2,Ve=c(0,0),Pe=V(0,0,1);class Ce extends L{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=C,this.size=l,this.polygonOffset=0,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=C,this.outlineSize=0,this.distanceFieldBoundingBox=j(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.hasVertexColor=!1,this.hasVertexSize=!1,this.hasVertexRotation=!1,this.hasVertexUVi=!1,this.hasVertexCenterOffset=!1,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.focusAreaStyle=null,this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class je{constructor(e){this.baseInstanceLayout=Z,this.layout=$(e)}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,s,r,i){const{buffer:a,offset:n}=i,{position:o,normal:l,color:c,size:p,rotation:f,centerOffset:u,groundDistance:h,featureAttribute:m,uvi:d}=a;W(s.get("position"),e,o,n),H(s.get("normal"),t,l,n);const g=s.get("position").indices.length;if(d){const e=s.get("uvi")?.data;if(e&&e.length>=4){const[t,s,r,i]=e;for(let e=0;e<g;++e){const a=n+e;d.setValues(a,t,s,r,i)}}}if(c&&N(s.get("color"),4,c,n),p&&G(s.get("size"),p,n),f&&q(s.get("rotation"),f,n),u&&(s.get("centerOffset")?X(s.get("centerOffset"),u,n):Y(u,n,g)),s.get("groundDistance")?q(s.get("groundDistance"),h,n):Y(h,n,g),m&&(s.get("featureAttribute")?k(s.get("featureAttribute"),m,n):Y(m,n,g)),null!=r){const e=s.get("position")?.indices;if(e){const t=e.length,s=a.getField("olidColor",D);J(r,s,t,n)}}}writeBaseInstance(e,t){const{uv0:s}=t;G(e.get("uv0"),s,0)}}function Re(e,t,s){return null==e||null==t.vvSize?{scaleX:s,scaleY:s}:(w(xe,t,e),{scaleX:xe[0]*s,scaleY:xe[1]*s})}function De(e,t){const s=t.computeRenderPixelSizeAtDist(e)*_;return(t.aboveGround?1:-1)*s}function we(e,t,s,r,i){if(!e.verticalOffset?.screenLength){const r=x(t);return i.update(s,r,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const a=x(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=K(r,a,e.verticalOffset,s,n,e.screenSizePerspectiveMinPixelReferenceSize);return i.update(s,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{re as HUDMaterial,Ce as Parameters};
|
|
2
|
+
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ONES as l,fromValues as c,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as f,transformMat4 as u,normalize as h,subtract as m,scale as d,transformMat3 as g,scaleAndAdd as b,copy as v,length as x,distance as S,sub as O,dot as z}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y,fromValues as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as P,ONES as C,create as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as R}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as D}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as w}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as A}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as M,isColor as F,isOIT as U}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as _}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as L,GLTextureMaterial as T}from"../lib/GLTextureMaterial.js";import{Material as B}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as E}from"../lib/screenSizePerspectiveUtils.js";import{assert as I}from"../lib/Util.js";import{writePosition as W,writeNormal as H,writeColor as N,writeBufferVec2 as G,writeBufferFloat as q,writeBufferVec3 as X,writeBufferZeros as Y,writeBufferVec4 as k,writeOlidColor as J}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as K}from"./internal/MaterialUtil.js";import{a as Q}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as Z,getInstanceLayout as $,HUDMaterialTechnique as ee}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as te}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as se}from"../../../../webscene/support/AlphaCutoff.js";class re extends B{constructor(e,t,s=!1){super(e,Ce),this.produces=new Map([[12,e=>M(e)&&!this.parameters.drawAsLabel&&!this._configuration.transparentOccluded],[13,e=>M(e)&&!this.parameters.drawAsLabel&&this._configuration.transparentOccluded],[14,e=>M(e)&&this.parameters.drawAsLabel],[18,e=>this.parameters.draped&&M(e)]]),this._visible=!0,this._configuration=new te(t,s)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:s}=this,r=t.draped;s.enableOITOffset=e.enableOITOffset,s.hasSlicePlane=this.parameters.hasSlicePlane,s.hasVerticalOffset=!!this.parameters.verticalOffset,s.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,s.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,s.polygonOffset=this.parameters.polygonOffset,s.draped=r,s.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,s.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,s.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,s.hasRotation=this.parameters.hasRotation,s.hasVVSize=!!this.parameters.vvSize,s.hasVVColor=!!this.parameters.vvColor,s.occludedFragmentFade=!r&&!!this.parameters.occludedFragmentOpacity,s.hasFocusAreaStyle=null!=this.parameters.focusAreaStyle,s.depthTestEnabled=this.parameters.depthEnabled,s.hasVertexColor=this.parameters.hasVertexColor,s.hasVertexSize=this.parameters.hasVertexSize,s.hasVertexRotation=this.parameters.hasVertexRotation,s.hasVertexUVi=this.parameters.hasVertexUVi,s.hasVertexCenterOffset=this.parameters.hasVertexCenterOffset,F(e.output)&&(s.debugDrawLabelBorder=!!A.LABELS_SHOW_BORDER),s.hasOcclusionTexture=!t.drawAsLabel&&s.transparentOccluded&&U(e.output)}intersectRay(e,t,r,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:p},point:O,camera:z}=r,{parameters:V}=this;if(!l||!c||p&&V.isLabel||!e.visible||!O||!z)return;const C=e.attributes.get("featureAttribute"),j=null==C?null:P(C.data,Se),{scaleX:R,scaleY:D}=Re(j,V,z.pixelRatio),w=e.attributes.get("position"),A=e.attributes.get("size"),M=e.attributes.get("normal"),F=e.attributes.get("rotation"),U=e.attributes.get("centerOffset"),_=this.parameters.size;I(w.size>=3);const L="screen"===this.parameters.centerOffsetUnits;for(let P=0;P<w.data.length/w.size;P++){const e=P*w.size;if(f(ce,w.data[e],w.data[e+1],w.data[e+2]),u(ce,ce,t),u(ce,ce,z.viewMatrix),U){const e=P*U.size;f(ve,U.data[e],U.data[e+1],U.data[e+2])}else f(ve,0,0,0);if(!L&&(ce[0]+=ve[0],ce[1]+=ve[1],0!==ve[2])){const e=ve[2];h(ve,ce),m(ce,ce,d(ve,ve,e))}const a=P*M.size;f(pe,M.data[a],M.data[a+1],M.data[a+2]),g(pe,pe,s(ge,t));const{normal:n,cosAngle:l}=ne(pe,z,Oe),c=we(this.parameters,ce,l,z,le);if(b(ce,ce,n,c),z.applyProjection(ce,fe),fe[0]>-1){if(L&&(ve[0]||ve[1])&&(fe[0]+=ve[0]*z.pixelRatio,0!==ve[1]&&(fe[1]+=le.alignmentEvaluator.apply(ve[1])*z.pixelRatio),z.unapplyProjection(fe,ce)),fe[0]+=this.parameters.screenOffset[0]*z.pixelRatio,fe[1]+=this.parameters.screenOffset[1]*z.pixelRatio,fe[0]=Math.floor(fe[0]),fe[1]=Math.floor(fe[1]),Ve[0]=_[0],Ve[1]=_[1],null!=A){const e=P*A.size;Ve[0]*=A.data[e],Ve[1]*=A.data[e+1]}le.evaluator.applyVec2(Ve,Ve);const e=ze*z.pixelRatio;let t=0;if(V.textureIsSignedDistanceField){t=Math.min(V.outlineSize,.5*Ve[0])*z.pixelRatio/2}Ve[0]*=R,Ve[1]*=D;const s=V.rotation+(null!=F?F.data[P*F.size]:0),a=Q(V);if(oe(O,fe[0],fe[1],Ve,e,t,s,V,a)){const e=r.ray;if(u(he,ce,i(be,z.viewMatrix)),fe[0]=O[0],fe[1]=O[1],z.unprojectFromRenderScreen(fe,ce)){const t=y();v(t,e.direction);const s=1/x(t);d(t,t,s);o(S(e.origin,ce)*s,t,-1,he)}}}}}intersectScreenPolygon(){return null}intersectRayDraped(e,t,s,r,i){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=l.size,p=e.attributes.get("featureAttribute"),f=null==p?null:P(p.data,Se),{scaleX:u,scaleY:h}=Re(f,l,e.screenToWorldRatio),m=ye*e.screenToWorldRatio;for(let d=0;d<a.data.length/a.size;d++){const t=d*a.size,p=a.data[t],f=a.data[t+1];if(Ve[0]=c[0],Ve[1]=c[1],null!=n){const e=d*n.size;Ve[0]*=n.data[e],Ve[1]*=n.data[e+1]}let g=0;if(l.textureIsSignedDistanceField){g=Math.min(l.outlineSize,.5*Ve[0])*e.screenToWorldRatio/2}Ve[0]*=u,Ve[1]*=h;const b=l.rotation+(null!=o?o.data[d*o.size]:0),v=Q(l);oe(s,p,f,Ve,m,g,b,l,v)&&r(i.distance,i.normal,-1)}}createBufferWriter(){return new je(this.parameters)}applyShaderOffsets(e,t,r,i,a,n,o,l){g(ue,r,s(ge,i));const c=ne(ue,o,Oe),p=De(x(t),o),f=we(this.parameters,t,c.cosAngle,o,l);b(t,t,c.normal,f+p),b(e,e,ue,f+p);const u=n+f;this._applyPolygonOffsetView(t,c,u,o,t),this._applyCenterOffsetView(t,a,t)}applyShaderOffsetsNDC(e,t,s,r,i,a){return this._applyCenterOffsetNDC(e,t,r,i),null!=a&&v(a,i),this._applyPolygonOffsetNDC(i,s,r,i),i}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return v(a,t);const c=e(Math.abs(s.cosAngle),.01,1),p=1-Math.sqrt(1-c*c)/c/i.viewport[2];return d(a,t,l>0?p:1/p),a}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&v(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(h(pe,s),O(s,s,d(pe,pe,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&v(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&v(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t);r[2]-=(a||e)*i}return r}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:s}=this.parameters,r=e[3]>=se||t>=se&&s[3]>=se;return this._visible&&r}createGLMaterial(e){return new ie(e)}calculateRelativeScreenBounds(e,t,s=R()){return ae(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}}class ie extends T{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(ee,e)}}function ae(e,t,s,r){r[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*s,r[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*s}function ne(e,t,s){return u(s.normal,e,t.viewInverseTransposeMatrix),s.cosAngle=z(s.normal,Pe),s}function oe(e,s,r,i,a,l,c,p,f){let u=s-a-i[0]*f[0],h=u+i[0]+2*a,m=r-a-i[1]*f[1],d=m+i[1]+2*a;const g=p.distanceFieldBoundingBox;return p.textureIsSignedDistanceField&&null!=g&&(u+=i[0]*g[0],m+=i[1]*g[1],h-=i[0]*(1-g[2]),d-=i[1]*(1-g[3]),u-=l,h+=l,m-=l,d+=l),n(de,s,r),o(me,e,de,t(c)),me[0]>u&&me[0]<h&&me[1]>m&&me[1]<d}const le=new E,ce=y(),pe=y(),fe=j(),ue=y(),he=y(),me=p(),de=p(),ge=r(),be=a(),ve=y(),xe=y(),Se=j(),Oe={normal:y(),cosAngle:0},ze=1,ye=2,Ve=c(0,0),Pe=V(0,0,1);class Ce extends L{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=C,this.size=l,this.polygonOffset=0,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=C,this.outlineSize=0,this.distanceFieldBoundingBox=j(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.hasVertexColor=!1,this.hasVertexSize=!1,this.hasVertexRotation=!1,this.hasVertexUVi=!1,this.hasVertexCenterOffset=!1,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.focusAreaStyle=null,this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class je{constructor(e){this.baseInstanceLayout=Z,this.layout=$(e)}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,s,r,i){const{buffer:a,offset:n}=i,{position:o,normal:l,color:c,size:p,rotation:f,centerOffset:u,groundDistance:h,featureAttribute:m,uvi:d}=a;W(s.get("position"),e,o,n),H(s.get("normal"),t,l,n);const g=s.get("position").indices.length;if(d){const e=s.get("uvi")?.data;if(e&&e.length>=4){const[t,s,r,i]=e;for(let e=0;e<g;++e){const a=n+e;d.setValues(a,t,s,r,i)}}}if(c&&N(s.get("color"),4,c,n),p&&G(s.get("size"),p,n),f&&q(s.get("rotation"),f,n),u&&(s.get("centerOffset")?X(s.get("centerOffset"),u,n):Y(u,n,g)),s.get("groundDistance")?q(s.get("groundDistance"),h,n):Y(h,n,g),m&&(s.get("featureAttribute")?k(s.get("featureAttribute"),m,n):Y(m,n,g)),null!=r){const e=s.get("position")?.indices;if(e){const t=e.length,s=a.getField("olidColor",D);J(r,s,t,n)}}}writeBaseInstance(e,t){const{uv0:s}=t;G(e.get("uv0"),s,0)}}function Re(e,t,s){return null==e||null==t.vvSize?{scaleX:s,scaleY:s}:(w(xe,t,e),{scaleX:xe[0]*s,scaleY:xe[1]*s})}function De(e,t){const s=t.computeRenderPixelSizeAtDist(e)*_;return(t.aboveGround?1:-1)*s}function we(e,t,s,r,i){if(!e.verticalOffset?.screenLength){const r=x(t);return i.update(s,r,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const a=x(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=K(r,a,e.verticalOffset,s,n,e.screenSizePerspectiveMinPixelReferenceSize);return i.update(s,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{re as HUDMaterial,Ce as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as
|
|
2
|
+
import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isColor as s}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as a}from"../lib/Material.js";import{writePosition as n,writeBufferFloat as o}from"./internal/bufferWriterUtils.js";import{attributeDrivenInstanceLayout as u,instanceLayout as c,HeatmapDensityPassParameters as l,HeatmapDensityTechnique as f,baseLayout as m}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as p}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class b extends l{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class d extends a{constructor(t){super(t,b),this.visible=!0,this.produces=new Map([[18,t=>s(t)]]),this._configuration=new p}updateConfiguration(t){super.updateConfiguration(t),this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats}createGLMaterial(t){return new g(t)}intersectRay(){}intersectRayDraped(r,s,i,a,n){const o=r.attributes.get("position"),{parameters:u}=this,{searchRadius:c}=u,{screenToWorldRatio:l}=r,f=c*l+h*l,m=f*f,p=o.data.length/o.size;for(let h=0;h<p;h++){const r=h*o.size,s=t(v,o.data[r],o.data[r+1]);e(s,i)<m&&a(n.distance,n.normal,-1)}}intersectScreenPolygon(){return null}createBufferWriter(){return new j(this.parameters.isAttributeDriven?u:c)}}class g extends i{beginSlot(t){return this.getTechnique(f,t)}}class j{constructor(t){this.layout=t,this.baseInstanceLayout=m}elementCount(t){return t.get("position").indices.length}elementCountBaseInstance(){return 4}write(t,e,r,s,i){const{buffer:a,offset:u}=i;n(r.get("position"),t,a.position,u);const c="featureAttribute"in a?a.featureAttribute:null;c&&o(r.get("featureAttribute"),c,u)}writeBaseInstance(t,e){const r=e.uv0;r.setValues(0,-1,-1),r.setValues(1,-1,1),r.setValues(2,1,-1),r.setValues(3,1,1)}}const v=r();export{d as HeatmapDensityMaterial,b as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import
|
|
2
|
+
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import s from"../lib/GLMaterial.js";import{isUpdatableTexture as i}from"../lib/IManagedTexture.js";import{assert as a}from"../lib/Util.js";import{DefaultBufferWriter as o}from"./DefaultBufferWriter.js";import{TriangleMaterialParameters as n,TriangleMaterial as u}from"./TriangleMaterial.js";import{writeBufferFloat as p,writeAttribute as c}from"./internal/bufferWriterUtils.js";import{getLayout as l,ImageMaterialTechnique as m}from"../shaders/ImageMaterialTechnique.js";import{ImageMaterialTechniqueConfiguration as f}from"../shaders/ImageMaterialTechniqueConfiguration.js";class h extends u{constructor(e){super(e,x),this.supportsEdges=!0,this.transparent=!0,this.visible=!0,this.produces=new Map([[2,e=>t(e)],[8,e=>r(e)],[18,e=>r(e)||t(e)]]),this._configuration=new f(e.draped)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=e.hasOccludees,this._configuration.perspectiveInterpolation=this.parameters.perspectiveInterpolation}createGLMaterial(e){return new d(e)}createBufferWriter(){return new g(l(this.parameters))}}class d extends s{constructor(e){super({...e,...e.material.parameters}),this.parameters=e;const t=this._material.parameters.managedTexture;i(t)&&e.textures.updater.add(t)}dispose(){this.parameters.textures.updater.remove(this._material.parameters.managedTexture)}beginSlot(e){return this.getTechnique(m,e)}}class g extends o{write(t,r,s,i,o){const{buffer:n,offset:u}=o;for(const l of this.layout.fields.keys()){const i=s.get(l);if(i)if("perspectiveDivide"===l){a(1===i.size);const t=n.getField(l,e);t&&p(i,t,u)}else c(l,i,t,r,n,u)}}}class x extends n{constructor(e,t){super(),this.managedTexture=e,this.draped=t,this.hasSlicePlane=!1,this.cullFace=0,this.opacity=1,this.perspectiveInterpolation=!1}get texture(){return this.managedTexture.texture}}export{h as ImageMaterial,x as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as s,MaterialParameters as n}from"../lib/Material.js";import{writeBufferVec2 as a,writePosition as o,writeNormal as c,writeBufferVec3 as l,writeBufferFloat as u}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h,layout as f,baseLayout as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class m extends s{constructor(e,t){super(e,$),this.intersectRayDraped=void 0,this.produces=new Map([[15,e=>r(e)],[16,e=>r(e)]]),this._configuration=new d(t),this._uniqueMaterialIdentifier=S(this.parameters)}passParameters(){return this.parameters}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=16===e.slot,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane}get visible(){return this.parameters.color[3]>=g||(this.parameters.borderColor?.[3]??0)>=g}intersectRay(){}intersectScreenPolygon(){}createGLMaterial(e){return new O(e)}createBufferWriter(){return new b}validateParameters(e){this._uniqueMaterialIdentifier=S(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function S({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,shaderPolygonOffset:a,hudDepthAlignStart:o,centerOffsetUnits:c,hasSlicePlane:l,screenSizePerspective:u,verticalOffset:h,borderColor:f}){return e`${t}:${r}:${i}:[${s}]:${n}:${a}:${o}:${c}:${l}:${null!=u}:{${h?.screenLength}:${h?.minWorldLength}:${h?.maxWorldLength}}:[${f}]`}class O extends i{beginSlot(e){return this.getTechnique(h,e)}}class $ extends n{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=t(0,0,0,1),this.size=1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}class b{constructor(){this.layout=f,this.baseInstanceLayout=p}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}writeBaseInstance(e,t){const{uv0:r}=t;a(e.get("uv0"),r,0)}write(e,t,r,i,s){const{buffer:n,offset:a}=s;o(r.get("position"),e,n.position,a),c(r.get("normal"),t,n.normal,a),l(r.get("centerOffset"),n.centerOffset,a),u(r.get("groundDistance"),n.groundDistance,a)}}export{m as LineCalloutMaterial,$ as Parameters,S as uniqueMaterialIdentifier};
|
|
2
|
+
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as s,MaterialParameters as n}from"../lib/Material.js";import{writeBufferVec2 as a,writePosition as o,writeNormal as c,writeBufferVec3 as l,writeBufferFloat as u}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h,layout as f,baseLayout as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class m extends s{constructor(e,t){super(e,$),this.intersectRayDraped=void 0,this.produces=new Map([[15,e=>r(e)],[16,e=>r(e)]]),this._configuration=new d(t),this._uniqueMaterialIdentifier=S(this.parameters)}passParameters(){return this.parameters}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=16===e.slot,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane}get visible(){return this.parameters.color[3]>=g||(this.parameters.borderColor?.[3]??0)>=g}intersectRay(){}intersectScreenPolygon(){return null}createGLMaterial(e){return new O(e)}createBufferWriter(){return new b}validateParameters(e){this._uniqueMaterialIdentifier=S(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function S({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,shaderPolygonOffset:a,hudDepthAlignStart:o,centerOffsetUnits:c,hasSlicePlane:l,screenSizePerspective:u,verticalOffset:h,borderColor:f}){return e`${t}:${r}:${i}:[${s}]:${n}:${a}:${o}:${c}:${l}:${null!=u}:{${h?.screenLength}:${h?.minWorldLength}:${h?.maxWorldLength}}:[${f}]`}class O extends i{beginSlot(e){return this.getTechnique(h,e)}}class $ extends n{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=t(0,0,0,1),this.size=1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}class b{constructor(){this.layout=f,this.baseInstanceLayout=p}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}writeBaseInstance(e,t){const{uv0:r}=t;a(e.get("uv0"),r,0)}write(e,t,r,i,s){const{buffer:n,offset:a}=s;o(r.get("position"),e,n.position,a),c(r.get("normal"),t,n.normal,a),l(r.get("centerOffset"),n.centerOffset,a),u(r.get("groundDistance"),n.groundDistance,a)}}export{m as LineCalloutMaterial,$ as Parameters,S as uniqueMaterialIdentifier};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as s}from"../../../../geometry/support/float16.js";import{isColor as a,isDepth as o,isColorHighlightOLIDOrDepth as
|
|
2
|
+
import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as s}from"../../../../geometry/support/float16.js";import{isColor as a,isDepth as o,isColorHighlightOLIDOrDepth as n}from"../core/shaderLibrary/ShaderOutput.js";import h from"../lib/GLMaterial.js";import{Material as c}from"../lib/Material.js";import{VisualVariablePassParameters as l}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as m}from"./internal/bufferWriterUtils.js";import{getLayout as p,LineMarkerTechnique as u}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as f}from"../../../../webscene/support/AlphaCutoff.js";class g extends c{constructor(e,t){super(e,v),this.produces=new Map([[2,e=>10===e||a(e)&&8===this.parameters.renderOccluded],[3,e=>o(e)],[10,e=>n(e)&&8===this.parameters.renderOccluded],[11,e=>n(e)&&8===this.parameters.renderOccluded],[4,e=>a(e)],[18,e=>a(e)||10===e]]),this.intersectRayDraped=void 0,this._configuration=new d(t)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.space=18===e.slot?0:this.parameters.worldSpace?2:1,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=e.hasOccludees,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective}get visible(){return this.parameters.color[3]>=f}intersectRay(){}intersectScreenPolygon(){return null}createBufferWriter(){return new S(p(this.parameters),this.parameters)}createGLMaterial(e){return new _(e)}}class _ extends h{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(u,e)}}class v extends l{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class S{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,a,o,n,h){const{buffer:c,offset:l}=h,p=o.get("position").data,u=p.length/3;let d=[1,0,0];const f=o.get("normal");this._parameters.worldSpace&&null!=f&&(d=f.data);let g=1,_=0;this._parameters.vvSize?_=o.get("sizeFeatureAttribute").data[0]:o.has("size")&&(g=o.get("size").data[0]);let v=[1,1,1,1],S=0;this._parameters.vvColor?S=o.get("colorFeatureAttribute").data[0]:o.has("color")&&(v=o.get("color").data);let w=0;this._parameters.vvOpacity&&(w=o.get("opacityFeatureAttribute").data[0]);const y=new Float32Array(c.buffer),O=s(c.buffer),T=new Uint8Array(c.buffer);let V=l*(this.layout.stride/4);const k=y.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,j=4/k,M=(e,t,r,i)=>{y[V++]=e[0],y[V++]=e[1],y[V++]=e[2],m(t,e,O,V*k),V+=j;let s=V*k;if(O[s++]=r[0],O[s++]=r[1],V=Math.ceil(s/k),this._parameters.vvColor)y[V++]=S;else{const e=Math.min(4*i,v.length-4),t=4*V++;T[t]=255*v[e],T[t+1]=255*v[e+1],T[t+2]=255*v[e+2],T[t+3]=255*v[e+3]}this._parameters.vvOpacity&&(y[V++]=w),s=V*k,this._parameters.vvSize?(y[V++]=_,s+=2):O[s++]=g,this._parameters.worldSpace&&(O[s++]=d[0],O[s++]=d[1],O[s++]=d[2]),V=Math.ceil(s/k)},x=(s,a)=>{const o=e(b,p[3*s],p[3*s+1],p[3*s+2]),n=P;let h=s+a;do{e(n,p[3*h],p[3*h+1],p[3*h+2]),h+=a}while(t(o,n)&&h>=0&&h<u);i&&(r(o,o,i),r(n,n,i)),M(o,n,[-1,-1],s),M(o,n,[1,-1],s),M(o,n,[1,1],s),M(o,n,[-1,-1],s),M(o,n,[1,1],s),M(o,n,[-1,1],s)},C=this._parameters.placement;"begin"!==C&&"begin-end"!==C||x(0,1),"end"!==C&&"begin-end"!==C||x(u-1,-1)}}const b=i(),P=i();export{g as LineMarkerMaterial,v as Parameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as c}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as
|
|
2
|
+
import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as c}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as u,MaterialParameters as p}from"../lib/Material.js";import{MeasurementArrowTechnique as f,layout as h}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as m}from"../shaders/MeasurementArrowTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class g extends u{constructor(t){super(t,b),this._configuration=new m,this.intersectRayDraped=void 0,this.produces=new Map([[2,t=>!this._transparent&&c(t)],[8,t=>this._transparent&&c(t)]])}updateConfiguration(t){super.updateConfiguration(t),this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.transparent=this._transparent,this._configuration.writeDepth=2===t.slot}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=d||e[3]>=d||r[3]>=d}intersectRay(){}intersectScreenPolygon(){return null}createGLMaterial(t){return new C(t)}createBufferWriter(){return new _}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class C extends l{beginSlot(t){return this.getTechnique(f,t)}}class b extends p{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1}}const w=n(),j=n(),v=n(),M=n(),O=n();class _{constructor(){this.layout=h}elementCount(t){return 2*(t.get("position").indices.length/2+1)}write(n,a,c,l,u){const{buffer:p,offset:f}=u,{data:h,indices:m}=c.get("position"),d=c.get("normal").data,g=h.length/3;m&&m.length!==2*(g-1)&&console.warn("MeasurementArrowMaterial does not support indices");const C=w,b=j,_=v,x=M,y=O,T=p.position,A=p.normal,L=p.uv0;let S=0;for(let w=0;w<g;++w){const c=3*w;if(t(C,h[c],h[c+1],h[c+2]),w<g-1){const o=3*(w+1);t(b,h[o],h[o+1],h[o+2]),t(y,d[o],d[o+1],d[o+2]),e(y,y),r(_,b,C),e(_,_),s(x,y,_),e(x,x)}const l=o(C,b);n&&a&&(i(C,C,n),i(b,b,n),i(x,x,a));const u=f+2*w,p=u+1;T.setVec(u,C),T.setVec(p,C),A.setVec(u,x),A.setVec(p,x),L.set(u,0,S),L.set(u,1,-1),L.set(p,0,S),L.set(p,1,1),w<g-1&&(S+=l)}const V=p.length;for(let t=0;t<2*g;++t)V.set(f+t,S)}}export{g as MeasurementArrowMaterial,b as Parameters};
|