@arcgis/core 6.0.0-next.54 → 6.0.0-next.55

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.
Files changed (300) hide show
  1. package/WebScene.js +2 -2
  2. package/applications/Components/OrientedImageryViewer/shared/constants.js +1 -1
  3. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  4. package/arcade/arcadeAsyncRuntime.js +1 -1
  5. package/arcade/arcadeCompiler.js +1 -1
  6. package/arcade/arcadeRuntime.js +1 -1
  7. package/arcade/featureset/support/sqlUtils.js +1 -1
  8. package/arcade/validation/arcadeValidator.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +1 -0
  11. package/assets/esri/core/workers/chunks/{6602310c3fcd91fb6a2f.js → 07c8ac092e4b9e8d5b3c.js} +1 -1
  12. package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +1 -0
  13. package/assets/esri/core/workers/chunks/{db0a7671ab5cbe8afd72.js → 123661019bb69c53f2d3.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{d14732a57c8e63948c60.js → 14259910f44c08fd5bbd.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{1b41ba050cde068d2860.js → 193a73a2c7f4f8482c21.js} +1 -1
  16. package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +1 -0
  17. package/assets/esri/core/workers/chunks/{e507dfc4788295d9c244.js → 249a687ce1b6d0815242.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{afb4dfb89fbc8a342cc5.js → 3354f1fa90f8ce4c8fde.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{9b458b0d1627f22fdd93.js → 3b11e4d2e69b7aea1d65.js} +1 -1
  20. package/assets/esri/core/workers/chunks/41694ee8990e799da225.js +1 -0
  21. package/assets/esri/core/workers/chunks/{e592f2483db71230e8e5.js → 4401b3f8ebb658abe789.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{12add2003631fa314f25.js → 5060be52a380fc4920f8.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{2aa6be0b047a1b25a520.js → 53bbb9aa6e4e4a0a8121.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{4707aedcc1b3bdf5e987.js → 5c34d49a6c9cc34b7626.js} +1 -1
  25. package/assets/esri/core/workers/chunks/69a09c6acb5ae03c67f6.js +1 -0
  26. package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +1 -0
  27. package/assets/esri/core/workers/chunks/{e83806797979138fd22a.js → 844c593754b2692257f4.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{2d3e977f3b75474d7ebc.js → 846248697c398468d8e6.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{f7e33d37dd11fb08f3f8.js → 97107e64407fa6825620.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{032733b863426c5bde00.js → 9e508f930086d2ef5f22.js} +3 -3
  31. package/assets/esri/core/workers/chunks/{5118c7269b706089c88e.js → a05a2c2aaf0c288f9681.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{817bf487df056da1e6ec.js → a116dd204921e7464944.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{944f17e9c9f681b971fb.js → a12e2a345005189c64be.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{15b3386ad92a0b4149b8.js → a24dc5350af001db417a.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{10967a36c77c5188690d.js → a66d6298236d59a615db.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{255f5b45c4d32f97f86c.js → ac0861014b3d2f1a1de2.js} +1 -1
  37. package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +1 -0
  38. package/assets/esri/core/workers/chunks/ae48ee283cfa5b3c14b0.js +1 -0
  39. package/assets/esri/core/workers/chunks/bbd8fcb0bbba7bde3d9b.js +1 -0
  40. package/assets/esri/core/workers/chunks/{ac8d38016e4bee37a77c.js → be0b8bb4f09aae6ff5de.js} +1 -1
  41. package/assets/esri/core/workers/chunks/d0659f1b0495734be4b3.js +1 -0
  42. package/assets/esri/core/workers/chunks/{b9a2b05ede02c305e865.js → d8ffb1502def5c85740b.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{7dfe1e78d2e66de6be22.js → d9ef244019954d5a8a27.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{95403bb27a4ea0a4b7b1.js → ddbfa664e69612295785.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c6d82397044e403a1f61.js → e61082f56c08abe54b3a.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{55d28d3f5b8ced061e39.js → eaf73ce60f39a48ddd2a.js} +1 -1
  47. package/assets/esri/core/workers/chunks/ed2f2a5da830d058e339.js +1 -0
  48. package/assets/esri/core/workers/chunks/{944cb751c85d3a127f49.js → f52d081bbde5c95265cf.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{1de9be7b65109c207bd5.js → fbd5f3b81cd9f061824d.js} +1 -1
  50. package/assets/esri/layers/raster/formats/blosc-wasm.wasm +0 -0
  51. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  52. package/basemapGallery/support/basemapCompatibilityUtils.js +1 -1
  53. package/chunks/CypherParser.js +1 -1
  54. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  55. package/chunks/MultiPathImpl.js +1 -1
  56. package/chunks/OperatorGeodesicBuffer.js +1 -1
  57. package/chunks/UnitFactory.js +1 -1
  58. package/chunks/blosc-wasm.js +2 -0
  59. package/chunks/cameraUtilsSpherical.js +1 -1
  60. package/chunks/parquet.js +1 -1
  61. package/chunks/text.js +1 -1
  62. package/config.js +1 -1
  63. package/core/sql/SqlInterval.js +1 -1
  64. package/core/urlUtils.js +1 -1
  65. package/geometry/geometryEngine.js +1 -1
  66. package/geometry/operators/gx/operatorOffset.js +1 -1
  67. package/geometry/support/Ellipsoid.js +1 -1
  68. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  69. package/geometry/support/geodesicConstants.js +1 -1
  70. package/geometry/support/meshUtils/primitives.js +1 -1
  71. package/kernel.js +1 -1
  72. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  73. package/layers/VoxelWasmPerSceneView.js +1 -1
  74. package/layers/effects/parser.js +1 -1
  75. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
  76. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  77. package/layers/graphics/data/QueryEngineResult.js +1 -1
  78. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  79. package/layers/parquet.js +1 -1
  80. package/layers/raster/datasets/ZarrRaster.js +1 -1
  81. package/layers/raster/datasets/wcsCoverageParser.js +1 -1
  82. package/layers/raster/formats/RasterCodec.js +1 -1
  83. package/layers/raster/formats/blosc.js +2 -0
  84. package/layers/support/BuildingFilter.js +1 -1
  85. package/layers/support/IntegratedMeshSemantics.js +1 -1
  86. package/layers/support/fieldUtils.d.ts +23 -87
  87. package/layers/support/fieldUtils.js +1 -1
  88. package/layers/support/layersMapping.js +1 -1
  89. package/layers/video/VideoController.js +1 -1
  90. package/legend/ActiveLayerInfo.js +1 -1
  91. package/libs/ajv/ajv.bundle-wrapper.js +1 -1
  92. package/package.json +4 -4
  93. package/renderers/types.d.ts +1 -1
  94. package/rest/knowledgeGraphService.js +1 -1
  95. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  96. package/smartMapping/statistics/support/attributeDensity.js +1 -1
  97. package/smartMapping/support/adapters/support/utils.js +1 -1
  98. package/support/tests/serviceMockDependencies.js +1 -1
  99. package/symbols/cim/CIMEffects.js +1 -1
  100. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  101. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  102. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  103. package/symbols/cim/rasterizingUtils.js +1 -1
  104. package/views/2d/PaddedViewState.js +1 -1
  105. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  106. package/views/2d/engine/vectorTiles/constants.js +1 -1
  107. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +1 -1
  108. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  109. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  110. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  111. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  112. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  113. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  114. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  115. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  116. package/views/2d/layers/ParquetLayerView2D.js +1 -1
  117. package/views/2d/layers/features/Processor.js +1 -1
  118. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  119. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  120. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  121. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  122. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  123. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  124. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  125. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  126. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  127. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  128. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  129. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  130. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  131. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
  132. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
  133. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  134. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  135. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  136. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +1 -1
  137. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  138. package/views/3d/camera/constraintUtils.js +1 -1
  139. package/views/3d/camera/intersectionUtils.js +1 -1
  140. package/views/3d/environment/EnvironmentView.js +1 -1
  141. package/views/3d/focusAreaUtils.js +1 -1
  142. package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
  143. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  144. package/views/3d/interactive/editingTools/manipulations/config.js +1 -1
  145. package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
  146. package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
  147. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  148. package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
  149. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  150. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  151. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  152. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  153. package/views/3d/layers/I3SMeshView3D.js +1 -1
  154. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  155. package/views/3d/layers/TiledLayerView3D.js +1 -1
  156. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  157. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  158. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  159. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  160. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  161. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  162. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  163. package/views/3d/layers/graphics/Graphics3DSymbolFactory.js +1 -1
  164. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  165. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  166. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  167. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  168. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  169. package/views/3d/layers/i3s/I3SNode.js +1 -1
  170. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  171. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  172. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  173. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  174. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  175. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  176. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  177. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  178. package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
  179. package/views/3d/layers/support/selectTiles3DSpatialReference.js +1 -1
  180. package/views/3d/layers/support/uvUtils.js +1 -1
  181. package/views/3d/state/Constraints.js +1 -1
  182. package/views/3d/state/ConstraintsManager.js +1 -1
  183. package/views/3d/state/NearFarHeuristic.js +1 -1
  184. package/views/3d/state/ViewState.js +1 -1
  185. package/views/3d/state/ViewStateManager.js +1 -1
  186. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  187. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  188. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  189. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  190. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  191. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  192. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  193. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  194. package/views/3d/state/utils/navigationUtils.js +1 -1
  195. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  196. package/views/3d/support/RenderCoordsHelper.js +1 -1
  197. package/views/3d/support/SweptSphereVolume.js +1 -1
  198. package/views/3d/support/cameraUtils.js +1 -1
  199. package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
  200. package/views/3d/support/engineContent/line.js +1 -1
  201. package/views/3d/support/engineContent/marker.js +1 -1
  202. package/views/3d/support/hitTest.js +1 -1
  203. package/views/3d/support/orientedBoundingBox.js +1 -1
  204. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  205. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  206. package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
  207. package/views/3d/support/sunUtils.js +1 -1
  208. package/views/3d/terrain/ExtentHelper.js +1 -1
  209. package/views/3d/terrain/OverlayManager.js +1 -1
  210. package/views/3d/terrain/OverlayRenderer.js +1 -1
  211. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  212. package/views/3d/terrain/TerrainRenderer.js +1 -1
  213. package/views/3d/terrain/TerrainSurface.js +1 -1
  214. package/views/3d/terrain/Tile.js +1 -1
  215. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  216. package/views/3d/terrain/terrainUtils.js +1 -1
  217. package/views/3d/webgl/RenderCamera.js +1 -1
  218. package/views/3d/webgl-engine/Stage.js +1 -1
  219. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  220. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  221. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  222. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
  223. package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
  224. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  225. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  226. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  227. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  228. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  229. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  230. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  231. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  232. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  233. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
  234. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  235. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  236. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  237. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  238. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  239. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  240. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  241. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  242. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  243. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  244. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  245. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  246. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  247. package/views/MapView.d.ts +1 -0
  248. package/views/SceneView.js +1 -1
  249. package/views/View2D.js +1 -1
  250. package/views/ViewingMode.js +1 -1
  251. package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
  252. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  253. package/views/draw/DrawAction.js +1 -1
  254. package/views/draw/DrawOperation.js +1 -1
  255. package/views/draw/DrawTool.js +1 -1
  256. package/views/draw/SegmentDrawAction.js +1 -1
  257. package/views/draw/support/Reshape.js +1 -1
  258. package/views/draw/support/helpMessageUtils.js +1 -1
  259. package/views/draw/support/managers/EditSessionManager.js +1 -1
  260. package/views/interactive/dragEventPipeline.js +1 -1
  261. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  262. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  263. package/views/interactive/editGeometry/operations/AddOrUpdatePart.js +1 -1
  264. package/views/layers/support/editableLayerViews.js +1 -1
  265. package/views/overlay/TextOverlayItem.js +1 -1
  266. package/views/support/DefaultsFromMap.js +1 -1
  267. package/views/support/Scheduler.js +1 -1
  268. package/views/support/spatialReferenceSupport.js +1 -1
  269. package/views/webgl/ShaderTranspiler.js +2 -2
  270. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  271. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  272. package/widgets/BatchAttributeForm.js +1 -1
  273. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  274. package/widgets/Editor/workflowUtils.js +1 -1
  275. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  276. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  277. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  278. package/widgets/FeatureForm.js +1 -1
  279. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  280. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  281. package/widgets/Measurement.js +1 -1
  282. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  283. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  284. package/widgets/Search/support/layerSearchUtils.js +1 -1
  285. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  286. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  287. package/widgets/UtilityNetworkAssociations.js +1 -1
  288. package/widgets/Weather/WeatherViewModel.js +1 -1
  289. package/widgets/Weather/css.js +1 -1
  290. package/widgets/Weather.js +1 -1
  291. package/assets/esri/core/workers/chunks/021bd07b9a3e70598840.js +0 -1
  292. package/assets/esri/core/workers/chunks/170e68624b71ac96de4a.js +0 -1
  293. package/assets/esri/core/workers/chunks/8a820e303941b351de81.js +0 -1
  294. package/assets/esri/core/workers/chunks/90d567e920b6982b402d.js +0 -1
  295. package/assets/esri/core/workers/chunks/97cdcedfe853280f6258.js +0 -1
  296. package/assets/esri/core/workers/chunks/9ebc6026934400fc1e1f.js +0 -1
  297. package/assets/esri/core/workers/chunks/b4a325dcf50e276751d7.js +0 -1
  298. package/assets/esri/core/workers/chunks/be5857b0d1b00faf430b.js +0 -1
  299. package/assets/esri/core/workers/chunks/cd9100a7c8309dfa7569.js +0 -1
  300. package/assets/esri/core/workers/chunks/e58f51618251f74aaafd.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{distance as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{negate as r,copy as i,dot as a,subtract as o,length as s,normalize as c,scale as l,add as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d,fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as p,screenPointObjectToArray as m}from"../../../../core/screenUtils.js";import{wrapAxisAngle as h}from"../../../../geometry/support/axisAngle.js";import{create as g,fromNormalAndOffset as _,setOffsetFromPoint as v,negate as y,getNormal as b}from"../../../../geometry/support/plane.js";import{PanPlanarMomentumEstimator as x}from"../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as S}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as C}from"../../../navigation/ZoomMomentumEstimator.js";import{pixelDistanceToInteractionFactor as w,applyAll as T}from"../../camera/constraintUtils.js";import{ConstraintOptions as E}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as D}from"../../input/util.js";import{getVoxelWasm as O}from"../../layers/VoxelWasm.js";import k from"../../webgl/RenderCamera.js";import{inferNavigationMode as A,excludeTerrain as j,getTiltScaleFactor as M,maxPanDistanceModifier as N,minPinchAndPanCameraHeight as P,searchAreaSize as F,centroid as I,applyZoomToPoint as L,applyPanPlanar as R,normalizeRotationDelta as z,applyRotation as B,intersectPlaneFromScreenPointAtEye as V}from"../utils/navigationUtils.js";import{InteractiveController as H}from"./InteractiveController.js";import{PanPlanarMomentumController as U}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as W}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as G}from"./momentum/ZoomPlanarMomentumController.js";const K=f(0,0,1);let q=class extends H{constructor(e){super(e),this._rotationValueSmooth=new D(.05),this._scalingValueSmooth=new D(.05),this._planeHorizontal=g(),this._planeVertical=g(),this._rotationMomentumEstimator=new S,this._panMomentumEstimator=new x(300,12,.9),this._zoomMomentumEstimator=new C,this._beginRadius=0,this._beginCenter=d(),this._beginAngle=0,this._tmpPoints=[],this._navigationMode=1,this._beginCenterScreen=p(),this._tmpCentroid3d=d(),this._tmpCentroid2d=p(),this._tmp2d=p(),this._pointerCount=0,this._beginCamera=new k,this._constraintOptions=new E(15,0,0,this._beginCamera)}begin(e){if(!this.running)return;let t=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=t,this._rotationMomentumEstimator.enabled=t,this._panMomentumEstimator.enabled=t,this._beginRadius=e.radius,this._pointerCount=e.pointers.size,this._beginAngle=e.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),m(e.center,this._beginCenterScreen),_(K,0,this._planeHorizontal);let n=d();r(n,this.startCamera.viewForward);let f=d();i(f,K);let p=a(n,f);this._navigationMode=A(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode);let h=d(),g=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,h,this.view.groundView.invisible?j:{}),x=M(f,this.startCamera.viewForward,N)*Math.max(Math.abs(this.view.camera.position.z),P);v(this._planeHorizontal,this._planeHorizontal,h),this.startCamera.aboveGround||y(this._planeHorizontal,this._planeHorizontal);let S=d(),C=d(),w=d();o(S,h,this.currentCamera.eye);let T=s(S);if(c(S,S),this._navigationMode===0){l(f,f,p),o(b(this._planeVertical),n,f),c(b(this._planeVertical),b(this._planeVertical)),v(this._planeVertical,this._planeVertical,h);let t=this.view.stage.renderView.getMinimalDepthForArea(O(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,F)??x;g&&(t=Math.min(t,T)),i(w,u(C,this.currentCamera.eye,l(C,S,t))),this._planeVertical[3]=-a(b(this._planeVertical),w),this._computePlanePoints(e.pointers,this._planeVertical,this.startCamera,this._tmpPoints),I(this._tmpPoints,this._beginCenter)}else{let t=g?T:x;i(w,u(C,this.currentCamera.eye,l(C,S,t))),this._planeHorizontal[3]=-a(b(this._planeHorizontal),w),this._computePlanePoints(e.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),I(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(e){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);let t=e.pointers.size>1,r=this._navigationMode===1?this._planeHorizontal:this._planeVertical,i=this._beginCenter;if(t){let t=this._beginRadius/e.radius,n=Math.min(Math.max(e.radius,40),120)*(.075/40);this._scalingValueSmooth.gain=n,this._scalingValueSmooth.update(t),L(this.currentCamera,i,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,e.timestamp*.001),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=w(Math.abs(e.radius-this._beginRadius)),T(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(e.pointers,r,this.currentCamera,this._tmpPoints),I(this._tmpPoints,this._tmpCentroid3d),m(e.center,this._tmpCentroid2d),R(this.currentCamera,i,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,e.timestamp*.001),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=w(n(this._beginCenterScreen,this._tmpCentroid2d)),T(this.view,this.currentCamera,this._constraintOptions),t){let t=i,n=this._rotationValueSmooth.value,r=n+z(e.angle-n),a=Math.min(Math.max(e.radius,40),120)*(.05/40);this._rotationValueSmooth.gain=a,this._rotationValueSmooth.update(r);let o=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(o,e.timestamp*.001);let s=b(this._planeHorizontal);B(this.currentCamera,t,h(s,o)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=w(Math.abs(e.radius*o)),T(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(e){e.pointers.size===this._pointerCount&&this.update(e),this.finishController();let t=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(t)return new G({view:this.view,momentum:t,zoomCenter:this._beginCenter});let n=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(n)return new W({view:this.view,momentum:n,center:this._beginCenter,axis:b(this._planeHorizontal)});let r=this.view.animationsEnabled&&this._panMomentumEstimator.evaluateMomentum();return r?new U({view:this.view,momentum:r}):null}_computePlanePoints(e,t,n,r){r.length=e.size;let i=this._tmp2d,a=0;return e.forEach(e=>{i[0]=e.x,i[1]=e.y,r[a]===void 0&&(r[a]=d()),V(t,n,i,r[a]),a+=1}),r}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};q=e([t(`esri.views.3d.state.controllers.PinchAndPanControllerLocal`)],q);export{q as PinchAndPanControllerLocal};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{distance as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{negate as r,copy as i,dot as a,subtract as o,length as s,normalize as c,scale as l,add as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d,fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as p,screenPointObjectToArray as m}from"../../../../core/screenUtils.js";import{wrapAxisAngle as h}from"../../../../geometry/support/axisAngle.js";import{create as g,fromNormalAndOffset as _,setOffsetFromPoint as v,negate as y,getNormal as b}from"../../../../geometry/support/plane.js";import{PanPlanarMomentumEstimator as x}from"../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as S}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as C}from"../../../navigation/ZoomMomentumEstimator.js";import{pixelDistanceToInteractionFactor as w,applyAll as T}from"../../camera/constraintUtils.js";import{ConstraintOptions as E}from"../../camera/constraintUtils/ConstraintOptions.js";import{ExponentialFalloff as D}from"../../input/util.js";import{getVoxelWasm as O}from"../../layers/VoxelWasm.js";import k from"../../webgl/RenderCamera.js";import{inferNavigationMode as A,excludeTerrain as j,getTiltScaleFactor as M,maxPanDistanceModifier as N,minPinchAndPanCameraHeight as P,searchAreaSize as F,centroid as I,applyZoomToPoint as L,applyPanPlanar as R,normalizeRotationDelta as z,applyRotation as B,intersectPlaneFromScreenPointAtEye as V}from"../utils/navigationUtils.js";import{InteractiveController as H}from"./InteractiveController.js";import{PanPlanarMomentumController as U}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as W}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as G}from"./momentum/ZoomPlanarMomentumController.js";const K=f(0,0,1);let q=class extends H{constructor(e){super(e),this._rotationValueSmooth=new D(.05),this._scalingValueSmooth=new D(.05),this._planeHorizontal=g(),this._planeVertical=g(),this._rotationMomentumEstimator=new S,this._panMomentumEstimator=new x(300,12,.9),this._zoomMomentumEstimator=new C,this._beginRadius=0,this._beginCenter=d(),this._beginAngle=0,this._tmpPoints=[],this._navigationMode=1,this._beginCenterScreen=p(),this._tmpCentroid3d=d(),this._tmpCentroid2d=p(),this._tmp2d=p(),this._pointerCount=0,this._beginCamera=new k,this._constraintOptions=new E(15,0,0,this._beginCamera)}begin(e){if(!this.running)return;let t=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=t,this._rotationMomentumEstimator.enabled=t,this._panMomentumEstimator.enabled=t,this._beginRadius=e.radius,this._pointerCount=e.pointers.size,this._beginAngle=e.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),m(e.center,this._beginCenterScreen),_(K,0,this._planeHorizontal);let n=d();r(n,this.startCamera.viewForward);let f=d();i(f,K);let p=a(n,f);this._navigationMode=A(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode);let h=d(),g=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,h,this.view.groundView.invisible?j:{}),x=M(f,this.startCamera.viewForward,N)*Math.max(Math.abs(this.view.camera.position.z),P);v(this._planeHorizontal,this._planeHorizontal,h),this.startCamera.aboveGround||y(this._planeHorizontal,this._planeHorizontal);let S=d(),C=d(),w=d();o(S,h,this.currentCamera.eye);let T=s(S);if(c(S,S),this._navigationMode===0){l(f,f,p),o(b(this._planeVertical),n,f),c(b(this._planeVertical),b(this._planeVertical)),v(this._planeVertical,this._planeVertical,h);let t=this.view.stage.renderView.getMinimalDepthForArea(O(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,F)??x;g&&(t=Math.min(t,T)),i(w,u(C,this.currentCamera.eye,l(C,S,t))),this._planeVertical[3]=-a(b(this._planeVertical),w),this._computePlanePoints(e.pointers,this._planeVertical,this.startCamera,this._tmpPoints),I(this._tmpPoints,this._beginCenter)}else{let t=g?T:x;i(w,u(C,this.currentCamera.eye,l(C,S,t))),this._planeHorizontal[3]=-a(b(this._planeHorizontal),w),this._computePlanePoints(e.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),I(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(e){if(!this.running)return;this.currentCamera.copyFrom(this.startCamera);let t=e.pointers.size>1,r=this._navigationMode===1?this._planeHorizontal:this._planeVertical,i=this._beginCenter;if(t){let t=this._beginRadius/e.radius,n=Math.min(Math.max(e.radius,40),120)*.001875;this._scalingValueSmooth.gain=n,this._scalingValueSmooth.update(t),L(this.currentCamera,i,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,e.timestamp*.001),this._constraintOptions.interactionType=1,this._constraintOptions.interactionFactor=w(Math.abs(e.radius-this._beginRadius)),T(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(e.pointers,r,this.currentCamera,this._tmpPoints),I(this._tmpPoints,this._tmpCentroid3d),m(e.center,this._tmpCentroid2d),R(this.currentCamera,i,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,e.timestamp*.001),this._constraintOptions.interactionType=4,this._constraintOptions.interactionFactor=w(n(this._beginCenterScreen,this._tmpCentroid2d)),T(this.view,this.currentCamera,this._constraintOptions),t){let t=i,n=this._rotationValueSmooth.value,r=n+z(e.angle-n),a=Math.min(Math.max(e.radius,40),120)*.00125;this._rotationValueSmooth.gain=a,this._rotationValueSmooth.update(r);let o=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(o,e.timestamp*.001);let s=b(this._planeHorizontal);B(this.currentCamera,t,h(s,o)),this._constraintOptions.interactionType=2,this._constraintOptions.interactionFactor=w(Math.abs(e.radius*o)),T(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(e){e.pointers.size===this._pointerCount&&this.update(e),this.finishController();let t=this.view.animationsEnabled&&this._zoomMomentumEstimator.evaluateMomentum();if(t)return new G({view:this.view,momentum:t,zoomCenter:this._beginCenter});let n=this.view.animationsEnabled&&this._rotationMomentumEstimator.evaluateMomentum();if(n)return new W({view:this.view,momentum:n,center:this._beginCenter,axis:b(this._planeHorizontal)});let r=this.view.animationsEnabled&&this._panMomentumEstimator.evaluateMomentum();return r?new U({view:this.view,momentum:r}):null}_computePlanePoints(e,t,n,r){r.length=e.size;let i=this._tmp2d,a=0;return e.forEach(e=>{i[0]=e.x,i[1]=e.y,r[a]===void 0&&(r[a]=d()),V(t,n,i,r[a]),a+=1}),r}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};q=e([t(`esri.views.3d.state.controllers.PinchAndPanControllerLocal`)],q);export{q as PinchAndPanControllerLocal};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{distance as r,add as i,scale as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{EasingFunctions as s}from"../../../animation/easing.js";import c from"../../../ViewAnimation.js";import{Animation as l}from"../../animation/pointToPoint/Animation.js";import{Intersector as u}from"../../webgl-engine/lib/Intersector.js";import d from"../../webgl/RenderCamera.js";import{searchAreaSize as f}from"../utils/navigationUtils.js";import{AnimationController as p}from"./AnimationController.js";let m=class extends p{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(e){super(e),this.type=`point-to-point`,this.mode=`interaction`,this._target=null}initialize(){this.animation=new l(this.view.state.viewingMode),this.viewAnimation=this.mode===`interaction`?null:new c}get isInteractive(){return this.mode===`interaction`}begin(e,t){this._target=e.clone(),this.stepController=(e,t)=>{this.animation.step(e,t),this.animation.finished&&this.finishController()};let n=this.animationSettings(t);h.copyFrom(this.view.state.camera);let o=this.view.stage.renderView.getMinimalDepthForArea(null,h.fullWidth/h.pixelRatio*.5,h.fullHeight/h.pixelRatio*.5,h,f),s=new u(this.view.state.viewingMode),c;this._intersectionHelper.intersectRay(h.ray,s,g)&&(c=r(h.eye,g));let l=o!=null&&c!=null?Math.min(o,c):o??c;l!=null&&(i(g,h.eye,a(g,h.viewForward,l)),h.center=g),this.animation.update(h,e,n),this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time,super.finish()}onControllerEnd(e){this.stepController&&(this.animation.currentTime/this.animation.time>=1&&this._target?e.copyFrom(this._target):this.animation.cameraAt(this.animation.currentTime/this.animation.time,e),this.animation.currentTime=this.animation.time),super.onControllerEnd(e),this.stepController=void 0}animationSettings(e={}){return{apex:e.liftOffDisabled?void 0:{maximumDistance:this.view.state.constraints.clampAltitude(1/0)/6,ascensionFactor:void 0,descensionFactor:void 0},...e,easing:typeof e.easing==`string`?s[e.easing]:e.easing}}};e([t({constructOnly:!0})],m.prototype,`mode`,void 0),e([t({readOnly:!0})],m.prototype,`isInteractive`,null),m=e([n(`esri.views.3d.state.controllers.PointToPointAnimationController`)],m);let h=new d;const g=o();function _(){h=new d}function v(e){return e!=null&&`type`in e&&e.type===`point-to-point`}export{m as PointToPointAnimationController,_ as cleanupPointToPointAnimationController,v as isPointToPointAnimationController};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{distance as r,add as i,scale as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{EasingFunctions as s}from"../../../animation/easing.js";import c from"../../../ViewAnimation.js";import{Animation as l}from"../../animation/pointToPoint/Animation.js";import{Intersector as u}from"../../webgl-engine/lib/Intersector.js";import d from"../../webgl/RenderCamera.js";import{searchAreaSize as f}from"../utils/navigationUtils.js";import{AnimationController as p}from"./AnimationController.js";let m=class extends p{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(e){super(e),this.type=`point-to-point`,this.mode=`interaction`,this._target=null}initialize(){this.animation=new l(this.view.state.isGlobal),this.viewAnimation=this.mode===`interaction`?null:new c}get isInteractive(){return this.mode===`interaction`}begin(e,t){this._target=e.clone(),this.stepController=(e,t)=>{this.animation.step(e,t),this.animation.finished&&this.finishController()};let n=this.animationSettings(t);h.copyFrom(this.view.state.camera);let o=this.view.stage.renderView.getMinimalDepthForArea(null,h.fullWidth/h.pixelRatio*.5,h.fullHeight/h.pixelRatio*.5,h,f),s=new u(this.view.state.isGlobal),c;this._intersectionHelper.intersectRay(h.ray,s,g)&&(c=r(h.eye,g));let l=o!=null&&c!=null?Math.min(o,c):o??c;l!=null&&(i(g,h.eye,a(g,h.viewForward,l)),h.center=g),this.animation.update(h,e,n),this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time,super.finish()}onControllerEnd(e){this.stepController&&(this.animation.currentTime/this.animation.time>=1&&this._target?e.copyFrom(this._target):this.animation.cameraAt(this.animation.currentTime/this.animation.time,e),this.animation.currentTime=this.animation.time),super.onControllerEnd(e),this.stepController=void 0}animationSettings(e={}){return{apex:e.liftOffDisabled?void 0:{maximumDistance:this.view.state.constraints.clampAltitude(1/0)/6,ascensionFactor:void 0,descensionFactor:void 0},...e,easing:typeof e.easing==`string`?s[e.easing]:e.easing}}};e([t({constructOnly:!0})],m.prototype,`mode`,void 0),e([t({readOnly:!0})],m.prototype,`isInteractive`,null),m=e([n(`esri.views.3d.state.controllers.PointToPointAnimationController`)],m);let h=new d;const g=o();function _(){h=new d}function v(e){return e!=null&&`type`in e&&e.type===`point-to-point`}export{m as PointToPointAnimationController,_ as cleanupPointToPointAnimationController,v as isPointToPointAnimationController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{copy as n,squaredDistance as r,normalize as i,scale as a,length as o,subtract as s,add as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clamp as u}from"../../../../core/mathUtils.js";import{Milliseconds as d}from"../../../../core/time.js";import{getReferenceEllipsoid as f}from"../../../../geometry/ellipsoidUtils.js";import{create as p}from"../../../../geometry/support/ray.js";import{Sphere as m}from"../../../../geometry/support/sphere.js";import{outExpo as h}from"../../../animation/easing.js";import{applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as _}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as v}from"../../camera/constraintUtils/surfaceCollision.js";import{fromScreenAtEye as y}from"../../support/geometryUtils/ray.js";import{intersectScreen as b}from"../../support/geometryUtils/sphere.js";import{Intersector as x}from"../../webgl-engine/lib/Intersector.js";import S from"../../webgl/RenderCamera.js";import{excludeTerrain as C,isHitOnSamePlanetSide as w,inferNavigationMode as T,zoomStepDistanceClamp as E,getTiltScaleFactor as D,maxZoomStepDistanceModifier as O,distanceComparisonTolerance as k,panToPosition as A}from"../utils/navigationUtils.js";import{PointToPointAnimationController as j}from"./PointToPointAnimationController.js";const M=.6;let N=class extends j{constructor(){super(...arguments),this._zoomLocation=l(),this._tmpCamera=new S,this._tmpViewDir=l(),this._tmpRayDir=p(),this._targetOnSphere=l(),this._tmpCenter=l(),this._beginCamera=new S,this._constraintOptions=new _(7,1,null,this._beginCamera),this._sphere=new m}initialize(){this._intersector=new x(this.view.state.viewingMode)}step(e,t){if(!this.running)return;let r=this.view.state;this.animation.finished?this._beginCamera.copyFrom(r.camera):this.animation.cameraAt(1,this._beginCamera);let i=!1,a=!1;this._intersectionHelper.intersectScreen(t,this._zoomLocation,this.view.map.ground.opacity===0?C:{})&&w(r.camera.eye,this._zoomLocation,f(this.view.spatialReference).radius)&&(i=e>0,a=!0),this._tmpCamera.copyFrom(r.camera),i?this._intersectsValidTarget(this._tmpCamera,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this._intersectsValidTarget(this._tmpCamera,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:n(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,e,t,a),this.begin(this._tmpCamera)}_intersectsValidTarget(e,t){return this._intersectionHelper.intersectRay(e.ray,this._intersector,t)?r(e.eye,t)>=16:!1}animationSettings(){return{duration:d(600),easing:h}}_updateCamera(e,t,n,l){let d=T(e,n,this.view.renderCoordsHelper,this.view.viewingMode),f=Math.abs(this.view.camera.position.z),p=this._zoomLocation;i(F,e.eye),a(F,F,-1),y(e,n,this._tmpRayDir),i(this._tmpRayDir.direction,this._tmpRayDir.direction);let m=u(D(F,this._tmpRayDir.direction,O)*f,E[0],E[1]);if(d===1){let i=M**t;this._sphere.radius=o(p),s(this._tmpViewDir,e.center,e.eye);let l=Math.min(o(this._tmpViewDir),m),u=l*i;if(i<=1&&u<4&&(u=4,i=u/l),Math.abs(l-u)<k)return;let d=o(e.center);if(this._sphere.radius!==d){let t=this._sphere.radius+i*(d-this._sphere.radius);e.center=a(P,e.center,t/d)}a(this._tmpViewDir,this._tmpViewDir,-i),e.eye=c(P,e.center,this._tmpViewDir),g(this.view,e,this._constraintOptions),r(p,e.center)>1e-12&&b(this._sphere,e,n,this._targetOnSphere)&&A(this._sphere,e,p,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let r=M**Math.abs(t),u=t>0?1:-1;s(this._tmpViewDir,p,e.eye);let d=o(this._tmpViewDir),f=this.view.stage.renderView.getMinimalDepthForArea(null,n[0],n[1],this.view.state.camera,60)??m;l&&t>0&&(f=Math.min(f,d)),a(this._tmpRayDir.direction,this._tmpRayDir.direction,f),c(p,this._tmpRayDir.origin,this._tmpRayDir.direction);let h=f*r,_=Math.max(4,e.nearFar[0]*1.01);if(t>0&&h<_&&(h=_,r=h/f),Math.abs(f-h)<k)return;a(this._tmpRayDir.direction,this._tmpRayDir.direction,u*(1-r)),e.eye=c(P,e.eye,this._tmpRayDir.direction),e.center=c(P,e.center,this._tmpRayDir.direction),i(this._tmpRayDir.direction,this._tmpRayDir.direction),this._constraintOptions.interactionDirection=this._tmpRayDir.direction,g(this.view,e,this._constraintOptions),this._constraintOptions.interactionDirection=null}v(this.view,null,e)}};N=e([t(`esri.views.3d.state.controllers.ZoomStepControllerGlobal`)],N);const P=l(),F=l();export{N as ZoomStepControllerGlobal};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{copy as n,squaredDistance as r,normalize as i,scale as a,length as o,subtract as s,add as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clamp as u}from"../../../../core/mathUtils.js";import{Milliseconds as d}from"../../../../core/time.js";import{getReferenceEllipsoid as f}from"../../../../geometry/ellipsoidUtils.js";import{create as p}from"../../../../geometry/support/ray.js";import{Sphere as m}from"../../../../geometry/support/sphere.js";import{outExpo as h}from"../../../animation/easing.js";import{applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as _}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as v}from"../../camera/constraintUtils/surfaceCollision.js";import{fromScreenAtEye as y}from"../../support/geometryUtils/ray.js";import{intersectScreen as b}from"../../support/geometryUtils/sphere.js";import{Intersector as x}from"../../webgl-engine/lib/Intersector.js";import S from"../../webgl/RenderCamera.js";import{excludeTerrain as C,isHitOnSamePlanetSide as w,inferNavigationMode as T,zoomStepDistanceClamp as E,getTiltScaleFactor as D,maxZoomStepDistanceModifier as O,distanceComparisonTolerance as k,panToPosition as A}from"../utils/navigationUtils.js";import{PointToPointAnimationController as j}from"./PointToPointAnimationController.js";const M=.6;let N=class extends j{constructor(){super(...arguments),this._zoomLocation=l(),this._tmpCamera=new S,this._tmpViewDir=l(),this._tmpRayDir=p(),this._targetOnSphere=l(),this._tmpCenter=l(),this._beginCamera=new S,this._constraintOptions=new _(7,1,null,this._beginCamera),this._sphere=new m}initialize(){this._intersector=new x(this.view.state.isGlobal)}step(e,t){if(!this.running)return;let r=this.view.state;this.animation.finished?this._beginCamera.copyFrom(r.camera):this.animation.cameraAt(1,this._beginCamera);let i=!1,a=!1;this._intersectionHelper.intersectScreen(t,this._zoomLocation,this.view.map.ground.opacity===0?C:{})&&w(r.camera.eye,this._zoomLocation,f(this.view.spatialReference).radius)&&(i=e>0,a=!0),this._tmpCamera.copyFrom(r.camera),i?this._intersectsValidTarget(this._tmpCamera,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this._intersectsValidTarget(this._tmpCamera,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:n(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,e,t,a),this.begin(this._tmpCamera)}_intersectsValidTarget(e,t){return this._intersectionHelper.intersectRay(e.ray,this._intersector,t)?r(e.eye,t)>=16:!1}animationSettings(){return{duration:d(600),easing:h}}_updateCamera(e,t,n,l){let d=T(e,n,this.view.renderCoordsHelper,this.view.viewingMode),f=Math.abs(this.view.camera.position.z),p=this._zoomLocation;i(F,e.eye),a(F,F,-1),y(e,n,this._tmpRayDir),i(this._tmpRayDir.direction,this._tmpRayDir.direction);let m=u(D(F,this._tmpRayDir.direction,O)*f,E[0],E[1]);if(d===1){let i=M**t;this._sphere.radius=o(p),s(this._tmpViewDir,e.center,e.eye);let l=Math.min(o(this._tmpViewDir),m),u=l*i;if(i<=1&&u<4&&(u=4,i=u/l),Math.abs(l-u)<k)return;let d=o(e.center);if(this._sphere.radius!==d){let t=this._sphere.radius+i*(d-this._sphere.radius);e.center=a(P,e.center,t/d)}a(this._tmpViewDir,this._tmpViewDir,-i),e.eye=c(P,e.center,this._tmpViewDir),g(this.view,e,this._constraintOptions),r(p,e.center)>1e-12&&b(this._sphere,e,n,this._targetOnSphere)&&A(this._sphere,e,p,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let r=M**Math.abs(t),u=t>0?1:-1;s(this._tmpViewDir,p,e.eye);let d=o(this._tmpViewDir),f=this.view.stage.renderView.getMinimalDepthForArea(null,n[0],n[1],this.view.state.camera,60)??m;l&&t>0&&(f=Math.min(f,d)),a(this._tmpRayDir.direction,this._tmpRayDir.direction,f),c(p,this._tmpRayDir.origin,this._tmpRayDir.direction);let h=f*r,_=Math.max(4,e.nearFar[0]*1.01);if(t>0&&h<_&&(h=_,r=h/f),Math.abs(f-h)<k)return;a(this._tmpRayDir.direction,this._tmpRayDir.direction,u*(1-r)),e.eye=c(P,e.eye,this._tmpRayDir.direction),e.center=c(P,e.center,this._tmpRayDir.direction),i(this._tmpRayDir.direction,this._tmpRayDir.direction),this._constraintOptions.interactionDirection=this._tmpRayDir.direction,g(this.view,e,this._constraintOptions),this._constraintOptions.interactionDirection=null}v(this.view,null,e)}};N=e([t(`esri.views.3d.state.controllers.ZoomStepControllerGlobal`)],N);const P=l(),F=l();export{N as ZoomStepControllerGlobal};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{copy as n,subtract as r,normalize as i,length as a,add as o,scale as s,squaredDistance as c,lerp as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,fromValues as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clamp as f}from"../../../../core/mathUtils.js";import{Milliseconds as p}from"../../../../core/time.js";import{outExpo as m}from"../../../animation/easing.js";import{applyAll as h}from"../../camera/constraintUtils.js";import{ConstraintOptions as g}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as _}from"../../layers/VoxelWasm.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import y from"../../webgl/RenderCamera.js";import{excludeTerrain as b,zoomStepDistanceClamp as x,getTiltScaleFactor as S,maxZoomStepDistanceModifier as C,distanceComparisonTolerance as w}from"../utils/navigationUtils.js";import{PointToPointAnimationController as T}from"./PointToPointAnimationController.js";let E=class extends T{constructor(){super(...arguments),this._zoomLocation=u(),this._tmpCamera=new y,this._tmpRayDir=u(),this._tmpCenter=u(),this._beginCamera=new y,this._constraintOptions=new g(15,1,null,this._beginCamera)}initialize(){this._intersector=new v(this.view.state.viewingMode)}step(e,t){if(!this.running)return;let c=this.view.state;this.animation.finished?this._beginCamera.copyFrom(c.camera):this.animation.cameraAt(1,this._beginCamera),this._tmpCamera.copyFrom(c.camera);let l=!1;e>0?(l=this._intersectionHelper.intersectScreenFreePointFallback(t,this._zoomLocation,this.view.groundView.invisible?b:{}),this._intersectsValidTarget(this._tmpCamera,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this._intersectsValidTarget(this._tmpCamera,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:n(this._zoomLocation,this._tmpCamera.center);let d=.6**e,p=this.view.stage.renderView.getMinimalDepthForArea(_(this.view),t[0],t[1],this.view.state.camera,60);r(k,this._tmpCamera.eye,this._zoomLocation),i(k,k);let m=Math.abs(this.view.camera.position.z),h=f(S(O,k,C)*m,x[0],x[1]);p??=h;let g=u();r(g,this._zoomLocation,this._tmpCamera.eye),(p<a(g)||!l)&&(i(g,g),o(this._zoomLocation,this._tmpCamera.eye,s(g,g,p))),this._updateCamera(this._tmpCamera,d,this._zoomLocation),this.begin(this._tmpCamera)}_intersectsValidTarget(e,t){return this._intersectionHelper.intersectRay(e.ray,this._intersector,t)?c(e.eye,t)>=16:!1}animationSettings(){return{duration:p(600),easing:m}}_updateCamera(e,t,n){r(this._tmpRayDir,n,e.eye);let i=a(this._tmpRayDir),o=i*t,c=t<=1,u=Math.max(4,e.nearFar[0]*1.01);o!==0&&(c&&o<u&&(o=u,t=o/i),Math.abs(i-o)<w||(s(this._tmpRayDir,this._tmpRayDir,t),e.eye=r(D,n,this._tmpRayDir),e.center=l(D,e.center,n,1-t),h(this.view,e,this._constraintOptions)))}};E=e([t(`esri.views.3d.state.controllers.ZoomStepControllerLocal`)],E);const D=u(),O=d(0,0,1),k=u();export{E as ZoomStepControllerLocal};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{copy as n,subtract as r,normalize as i,length as a,add as o,scale as s,squaredDistance as c,lerp as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,fromValues as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clamp as f}from"../../../../core/mathUtils.js";import{Milliseconds as p}from"../../../../core/time.js";import{outExpo as m}from"../../../animation/easing.js";import{applyAll as h}from"../../camera/constraintUtils.js";import{ConstraintOptions as g}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as _}from"../../layers/VoxelWasm.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import y from"../../webgl/RenderCamera.js";import{excludeTerrain as b,zoomStepDistanceClamp as x,getTiltScaleFactor as S,maxZoomStepDistanceModifier as C,distanceComparisonTolerance as w}from"../utils/navigationUtils.js";import{PointToPointAnimationController as T}from"./PointToPointAnimationController.js";let E=class extends T{constructor(){super(...arguments),this._zoomLocation=u(),this._tmpCamera=new y,this._tmpRayDir=u(),this._tmpCenter=u(),this._beginCamera=new y,this._constraintOptions=new g(15,1,null,this._beginCamera)}initialize(){this._intersector=new v(this.view.state.isGlobal)}step(e,t){if(!this.running)return;let c=this.view.state;this.animation.finished?this._beginCamera.copyFrom(c.camera):this.animation.cameraAt(1,this._beginCamera),this._tmpCamera.copyFrom(c.camera);let l=!1;e>0?(l=this._intersectionHelper.intersectScreenFreePointFallback(t,this._zoomLocation,this.view.groundView.invisible?b:{}),this._intersectsValidTarget(this._tmpCamera,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this._intersectsValidTarget(this._tmpCamera,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:n(this._zoomLocation,this._tmpCamera.center);let d=.6**e,p=this.view.stage.renderView.getMinimalDepthForArea(_(this.view),t[0],t[1],this.view.state.camera,60);r(k,this._tmpCamera.eye,this._zoomLocation),i(k,k);let m=Math.abs(this.view.camera.position.z),h=f(S(O,k,C)*m,x[0],x[1]);p??=h;let g=u();r(g,this._zoomLocation,this._tmpCamera.eye),(p<a(g)||!l)&&(i(g,g),o(this._zoomLocation,this._tmpCamera.eye,s(g,g,p))),this._updateCamera(this._tmpCamera,d,this._zoomLocation),this.begin(this._tmpCamera)}_intersectsValidTarget(e,t){return this._intersectionHelper.intersectRay(e.ray,this._intersector,t)?c(e.eye,t)>=16:!1}animationSettings(){return{duration:p(600),easing:m}}_updateCamera(e,t,n){r(this._tmpRayDir,n,e.eye);let i=a(this._tmpRayDir),o=i*t,c=t<=1,u=Math.max(4,e.nearFar[0]*1.01);o!==0&&(c&&o<u&&(o=u,t=o/i),Math.abs(i-o)<w||(s(this._tmpRayDir,this._tmpRayDir,t),e.eye=r(D,n,this._tmpRayDir),e.center=l(D,e.center,n,1-t),h(this.view,e,this._constraintOptions)))}};E=e([t(`esri.views.3d.state.controllers.ZoomStepControllerLocal`)],E);const D=u(),O=d(0,0,1),k=u();export{E as ZoomStepControllerLocal};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{add as n,normalize as r,dot as i,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o,clone as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lerp as c}from"../../../../core/mathUtils.js";import l from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as u,createRenderScreenPointArray3 as d,createScreenPointArray as f}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as p}from"../../../../core/units.js";import{create as m,copy as h,negativeInfinity as g,expandWithNestedArray as _}from"../../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as v}from"../../../../geometry/support/normalizeUtils.js";import{create as y}from"../../../../geometry/support/ray.js";import{sv3d as b}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as x}from"../../../../support/elevationInfoUtils.js";import{TaskPriority as S}from"../../../support/Scheduler.js";import{g as C}from"../../../../chunks/cameraUtilsSpherical.js";import{fromRenderAtEye as w,fromScreen as T}from"../../support/geometryUtils/ray.js";import{computeMapPointFromVec3d as E}from"../../support/hitTest.js";import{defaultTolerance as D,Intersector as O,defaultScreenPolygonPrimitiveProcessor as k}from"../../webgl-engine/lib/Intersector.js";import{RayIntersectionQuery as A,DrapedScreenPolygonIntersectionQuery as j}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as M}from"../../webgl-engine/lib/IntersectorResult.js";import{SliceScreenPolygonPrimitiveProcessor as N,createSliceExtrusionHalfspacePlanes as P,clipPolygonAgainstSlicedAwayHalfspaces as F,sliceFilterPredicate as I}from"../../webgl-engine/lib/intersectorUtils.js";import{prepareScreenPolygonIntersectionQuery as L}from"../../webgl-engine/lib/screenPolygonIntersectionUtils.js";class R{constructor(e,t,n){this.viewingMode=e,this._forEachLayer=t,this._view=n,this._externalIntersectionHandlers=new l,this._tolerance=D,this._tmpRay=y(),this._tmpRegion=m(),this._validateHUDIntersector=new O(this.viewingMode),this._validateHUDIntersector.options.hud=!1,this._screenPolygonIntersectionTask=this._view.resourceController.scheduler.registerTask(S.SCREEN_POLYGON_INTERSECTION)}destroy(){this._screenPolygonIntersectionTask.remove(),this._externalIntersectionHandlers.prune()}get screenPolygonIntersectionTask(){return this._screenPolygonIntersectionTask}intersectScreen(e,t,n){return this.intersectRay(this._getPickRay(e,this._tmpRay),H(this.viewingMode),t,n)}intersectScreenFreePointFallback(e,t,n){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,n)}intersectRayFreePointFallback(e,t,n){return this.intersectRay(e,H(this.viewingMode),t,n)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,n,r){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,r),t.results.min?t.results.min.getIntersectionPoint(n):!1}getCenterRayWithSubpixelOffset(e,t,n=.5,r=.5){return e.getRenderCenter(Z,n,r),Z[0]+=.0466,Z[1]-=.0123,w(e,Z,t)}intersectIntersectorScreen(e,t,n){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,n)}async intersectIntersectorScreenPolygon(e,t,n){t.polygonResults.init();let r=this._view.state.camera,i=await L(r,e);i!=null&&await this._screenPolygonIntersectionTask.scheduleGenerator(e=>this._intersectIntersectorScreenPolygon(r,t,i,n,e))}*_intersectIntersectorScreenPolygon(e,t,n,r,i){let a=new U(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r),t.camera=e,t.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,t.point=null,t.screenPolygonPrimitiveProcessor=k,yield*t.intersectScreenPolygon(a.layers,n);let o=this._view.slice.plane,s=o?new N(o):null;t.screenPolygonPrimitiveProcessor=s??k,yield*t.intersectScreenPolygon(a.sliceableLayers,n),t.screenPolygonPrimitiveProcessor=k,yield*this._intersectPolygonHandlersGenerator(t,a,n,null,s,void 0,!0,i),yield*this._intersectDrapedScreenPolygon(t,a,n,r),yield*t.intersectHUDScreenPolygon(a.layers,n),t.screenPolygonPrimitiveProcessor=s??k,yield*t.intersectHUDScreenPolygon(a.sliceableLayers,n),t.polygonResults.sortResults()}intersectToolIntersectorScreen(e,t,n){let r=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(r,t,n)}intersectToolIntersectorRay(e,t,n){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,n);let r=t.results.min;this._view.groundView.opaque||M(r)&&r.intersector!==7||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,n))}setTolerance(e=D){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}removeIntersectionHandler(e){this._externalIntersectionHandlers.removeUnordered(e)!=null&&this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}_getPickRay(e,t){let n=this._view.state.camera;return T(n,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==2||e==null||n(t,e.origin,r(b.get(),e.direction)),!1}intersectElevationFromScreen(e,t,n=0,r=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,n,r)}_intersectElevation(e,t,n=0,a=null){if(e==null)return null;let o=this._view,{renderCoordsHelper:s}=o,c=p(o.spatialReference),l=t==null?`absolute-height`:t.mode,d=x(t)/c,f=(l===`on-the-ground`?0:d+n)*c/s.unitInMeters,{camera:m}=o.state;if(l===`absolute-height`){let t=s.getAltitude(m.eye),n=i(r(K,e.direction),s.worldUpAtPosition(m.eye,q));if(t<f&&n<0||t>=f&&n>0)return null;if(s.intersectInfiniteManifold(e,f,K)){let e=E(o,K);return e.z??=0,e.z-=d,e}return null}let h=m.projectToRenderScreen(e.origin,u(b.get())),g=new U(null,this._forEachLayer),_=o.slice.plane,v=_?I(_):null,y=new O(this.viewingMode);y.options.store=0,y.options.verticalOffset=f,y.options.normalRequired=!1;let S=this._createRayIntersectionQuery(e,h,!1);y.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,y.reset(S.beginPoint,S.endPoint,m),y.point=h;let C=null;if(a&&`type`in a&&a.type===`graphics`){let e=o.allLayerViews.find(e=>e.layer===a)?.uid;C=e?t=>t.layerViewUid===e:null}else a&&(C=e=>e.graphicUid!==a.uid);switch(l){case`relative-to-scene`:y.intersect(g.layers,S.screenPoint,this._tolerance,null,e=>(!C||C(e))&&!!e.lastValidElevationBB),this._intersectRayHandlers(y,g,S,v,!1,e=>e.type===2||e.type===7||e.type===8,!1);break;case`on-the-ground`:case`relative-to-ground`:this._intersectRayHandlers(y,g,S,v,!1,e=>e.isGround,!1)}if(y.results.min.getIntersectionPoint(K)){let e=E(o,K);return e.z=n,e}return null}computeIntersection(e,t,n,r){if(e==null)return;let i=this._view.state.camera,a=i.projectToRenderScreen(e.origin,u(b.get())),o=new U(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r);let s=this._createRayIntersectionQuery(e,a,n);t.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,t.reset(s.beginPoint,s.endPoint,i),t.intersect(o.layers,s.screenPoint,this._tolerance,null,o.objectFilter);let c=this._view.slice.plane,l=c?I(c):null;t.intersect(o.sliceableLayers,s.screenPoint,this._tolerance,l,o.objectFilter);let d=r&&(r.requiresGroundFeedback||r.enableDraped);this._intersectRayHandlers(t,o,s,l,!!d,e=>o.allowedIntersectorTypes==null||o.allowedIntersectorTypes.has(e.type));let f=b.get(),p=this._view,m=p.groundView.spatialReference;if(r&&r.enableDraped&&m!=null&&t.results.ground.getIntersectionPoint(f)){let e=p.overlayManager.renderer,n=p.renderCoordsHelper.spatialReference,r=b.get();p.renderCoordsHelper.fromRenderCoords(f,r,m),r[2]=p.elevationProvider?.getElevation(f[0],f[1],f[2],n,`ground`)??0,e.intersectRay(t,r,t.results.ground,e=>o.filterRenderGeometry(e))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){let t=e.results.hud;h(this._tmpRegion,g);let n=[],r=this._tmpRegion,i=e=>{n.push(new z(e))};e.sortResults(t.all),t.min.distance!=null&&i(t.min);for(let e of t.all)t.min.target.object!==e.target.object&&t.max.target.object!==e.target.object&&i(e);if(t.max.distance!=null&&t.max.target.object!==t.min.target.object&&i(t.max),!n.length)return;r[0]===r[2]&&(r[2]+=1),r[1]===r[3]&&(r[3]+=1);let a=!0,o=e.results.max.distance==null,s=0;for(let t of n)a&&=(e.results.min.copy(t.result),!1),o&&e.results.max.copy(t.result),e.options.store===2&&e.results.all.splice(s++,0,t.result)}_createRayIntersectionQuery(e,t,r){return new A(e.origin,n(o(),e.origin,e.direction),t,r)}_intersectRayHandlers(e,t,n,r,i,a=()=>!0,o=!0){let{options:s}=e,c=s.isFiltered,l=s.filteredLayerViewUids;for(let{handler:c,filterPredicate:l,isFiltered:u,filteredLayerViewUids:d}of this._getFilteredIntersectionHandlers(t,r,null,a,o))(!u||c.isGround&&i)&&(s.isFiltered=u,s.filteredLayerViewUids=d,c.intersectRay(e,l,e.rayBegin,e.rayEnd,n.screenPoint,n.isVerticalRay));s.isFiltered=c,s.filteredLayerViewUids=l}*_intersectPolygonHandlersGenerator(e,t,n,r,i,a=()=>!0,o=!0,s){let{options:c}=e,l=c.isFiltered,u=c.filteredLayerViewUids,d=e.screenPolygonPrimitiveProcessor;for(let{handler:l,screenPolygonPrimitiveProcessor:u,isFiltered:d,filteredLayerViewUids:f}of this._getFilteredIntersectionHandlers(t,r,i,a,o))d||l.intersectScreenPolygon==null||(c.isFiltered=d,c.filteredLayerViewUids=f,e.screenPolygonPrimitiveProcessor=u??k,yield*l.intersectScreenPolygon(e,n,s));c.isFiltered=l,c.filteredLayerViewUids=u,e.screenPolygonPrimitiveProcessor=d}*_intersectDrapedScreenPolygon(e,t,n,r){let{basemapTerrain:i,overlayManager:a}=this._view,o=this._view.groundView.spatialReference!=null&&!a.renderer.isEmpty;if(!e.options.selectionMode||!r?.enableDraped||!o)return;let s=yield*this._createDrapedPolygonIntersectionQueries(n,i.slicePlaneEnabled?this._view.slice.plane:null);s!=null&&(yield*this._view.overlayManager.renderer.intersectScreenPolygon(e,s,e=>t.filterRenderGeometry(e)))}*_createDrapedPolygonIntersectionQueries(n,r){let{state:{camera:{eye:i}},pointsOfInterest:o}=this._view,l=this._view.groundView.spatialReference,u=[],d=r?[]:null,f=C(this._view,o.focus.renderLocation),p=v(l),m=1/0,h=null,g=K,_=q,y=e=>{if(!this._intersectDrapedScreenPolygonPoint(g,_,e))return!1;let n=h!=null&&p?h+p.shortestSignedDiff(h,g[0]):g[0];return h=n,u.push(t(n,g[1])),d&&d.push(s(_)),m=Math.min(m,a(i,_)),!0},{points:b}=n,{length:x}=b;for(let t=0;t<x;t++){let n=b[t],r=b[(t+1)%x];for(let t=0;t<f;t++){let i=t/f;if(!y(t===0?n:e(Y,c(n[0],r[0],i),c(n[1],r[1],i))))return null;yield}}if(!Number.isFinite(m))return null;if(r==null||!d)return[G(u,m)];let S=this._clipDrapedScreenPolygonIntersectionQueries(d,r,p,i);return S.length>0?S:null}_clipDrapedScreenPolygonIntersectionQueries(e,t,n,r){let i=[],a=P(t);for(let t of F(a,e)){let e=this._createDrapedQueryFromRenderPolygon(t,n,r);e!=null&&i.push(e)}return i.sort((e,t)=>e.distance-t.distance),i}_createDrapedQueryFromRenderPolygon(e,n,r){let{renderCoordsHelper:i}=this._view,o=this._view.groundView.spatialReference,s=[],c=1/0,l=null;for(let u of e){if(!i.fromRenderCoords(u,X,o))return null;let e=l!=null&&n?l+n.shortestSignedDiff(l,X[0]):X[0];l=e,s.push(t(e,X[1])),c=Math.min(c,a(r,u))}return s.length>=3&&Number.isFinite(c)?G(s,c):null}_intersectDrapedScreenPolygonPoint(e,t,n){let r=this._getPickRay(n,this._tmpRay);if(r==null)return!1;let{renderCoordsHelper:i}=this._view;this._intersectGroundPoint(t,r,n)||i.intersectManifoldClosestSilhouette(r,0,t);let a=this._view.groundView.spatialReference;return!!i.fromRenderCoords(t,e,a)}_intersectGroundPoint(e,t,n){let r=this._view.state.camera,i=new U(null,this._forEachLayer),a=new O(this.viewingMode);J[0]=n[0],J[1]=n[1],J[2]=0;let o=this._createRayIntersectionQuery(t,J,!1);return a.options.selectionMode=!0,a.options.store=0,a.options.normalRequired=!1,a.options.selectOpaqueTerrainOnly=!1,a.reset(o.beginPoint,o.endPoint,r),this._intersectRayHandlers(a,i,o,null,!0,e=>e.isGround,!1),a.results.ground.getIntersectionPoint(e)}*_getFilteredIntersectionHandlers(e,t,n,r=()=>!0,i=!0){for(let a of this._externalIntersectionHandlers){if(!r(a))continue;let o=!1,s=[];if(i){let t=a.layerViewUid,n=a.sublayerId,r=Array.isArray(t),i=r?t:[t],c=!1;for(let t of i)e.filterLayerViewUid(t,n)?c=!0:r&&s.push(t);o=!c}yield new B(a,a.slicePlaneEnabled?t:null,a.slicePlaneEnabled?n:null,o,s)}}}class z{constructor(e){this.result=e,this.screenPoint=d()}}class B{constructor(e,t,n,r,i){this.handler=e,this.filterPredicate=t,this.screenPolygonPrimitiveProcessor=n,this.isFiltered=r,this.filteredLayerViewUids=i}}let V;function H(e){return V&&V.viewingMode===e||(V=new O(e)),V}class U{constructor(e,t){this.layers=[],this.sliceableLayers=[],this.include=e?.include,this.exclude=e?.exclude,this.objectFilter=e?.objectFilter,this.allowedIntersectorTypes=e?.allowedIntersectorTypes,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){let{include:n,exclude:r}=this;if(e==null)return n==null&&r==null;let i=n instanceof Map?n.get(e)??!1:n?.has(e),a=r instanceof Map?r.get(e)??!1:r?.has(e);return(i==null||(typeof i==`boolean`?i:t!=null&&i.has(t)))&&(a==null||!(typeof a==`boolean`?a:t!=null&&a.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function W(e){return typeof e==`object`&&!!e&&`intersectRay`in e}function G(e,t){return new j(e,_(m(g),e),t)}const K=o(),q=o(),J=d(),Y=f(),X=o(),Z=d();export{R as SceneIntersectionHelper,W as isIntersectionHandler};
2
+ import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{add as n,normalize as r,dot as i,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o,clone as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lerp as c}from"../../../../core/mathUtils.js";import l from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as u,createRenderScreenPointArray3 as d,createScreenPointArray as f}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as p}from"../../../../core/units.js";import{create as m,copy as h,negativeInfinity as g,expandWithNestedArray as _}from"../../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as v}from"../../../../geometry/support/normalizeUtils.js";import{create as y}from"../../../../geometry/support/ray.js";import{sv3d as b}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as x}from"../../../../support/elevationInfoUtils.js";import{TaskPriority as S}from"../../../support/Scheduler.js";import{g as C}from"../../../../chunks/cameraUtilsSpherical.js";import{fromRenderAtEye as w,fromScreen as T}from"../../support/geometryUtils/ray.js";import{computeMapPointFromVec3d as E}from"../../support/hitTest.js";import{defaultTolerance as D,Intersector as O,defaultScreenPolygonPrimitiveProcessor as k}from"../../webgl-engine/lib/Intersector.js";import{RayIntersectionQuery as A,DrapedScreenPolygonIntersectionQuery as j}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as M}from"../../webgl-engine/lib/IntersectorResult.js";import{SliceScreenPolygonPrimitiveProcessor as N,createSliceExtrusionHalfspacePlanes as P,clipPolygonAgainstSlicedAwayHalfspaces as F,sliceFilterPredicate as I}from"../../webgl-engine/lib/intersectorUtils.js";import{prepareScreenPolygonIntersectionQuery as L}from"../../webgl-engine/lib/screenPolygonIntersectionUtils.js";class R{constructor(e,t,n){this.isGlobal=e,this._forEachLayer=t,this._view=n,this._externalIntersectionHandlers=new l,this._tolerance=D,this._tmpRay=y(),this._tmpRegion=m(),this._validateHUDIntersector=new O(this.isGlobal),this._validateHUDIntersector.options.hud=!1,this._screenPolygonIntersectionTask=this._view.resourceController.scheduler.registerTask(S.SCREEN_POLYGON_INTERSECTION)}destroy(){this._screenPolygonIntersectionTask.remove(),this._externalIntersectionHandlers.prune()}get screenPolygonIntersectionTask(){return this._screenPolygonIntersectionTask}intersectScreen(e,t,n){return this.intersectRay(this._getPickRay(e,this._tmpRay),H(this.isGlobal),t,n)}intersectScreenFreePointFallback(e,t,n){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,n)}intersectRayFreePointFallback(e,t,n){return this.intersectRay(e,H(this.isGlobal),t,n)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,n,r){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,r),t.results.min?t.results.min.getIntersectionPoint(n):!1}getCenterRayWithSubpixelOffset(e,t,n=.5,r=.5){return e.getRenderCenter(Z,n,r),Z[0]+=.0466,Z[1]-=.0123,w(e,Z,t)}intersectIntersectorScreen(e,t,n){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,n)}async intersectIntersectorScreenPolygon(e,t,n){t.polygonResults.init();let r=this._view.state.camera,i=await L(r,e);i!=null&&await this._screenPolygonIntersectionTask.scheduleGenerator(e=>this._intersectIntersectorScreenPolygon(r,t,i,n,e))}*_intersectIntersectorScreenPolygon(e,t,n,r,i){let a=new U(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r),t.camera=e,t.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,t.point=null,t.screenPolygonPrimitiveProcessor=k,yield*t.intersectScreenPolygon(a.layers,n);let o=this._view.slice.plane,s=o?new N(o):null;t.screenPolygonPrimitiveProcessor=s??k,yield*t.intersectScreenPolygon(a.sliceableLayers,n),t.screenPolygonPrimitiveProcessor=k,yield*this._intersectPolygonHandlersGenerator(t,a,n,null,s,void 0,!0,i),yield*this._intersectDrapedScreenPolygon(t,a,n,r),yield*t.intersectHUDScreenPolygon(a.layers,n),t.screenPolygonPrimitiveProcessor=s??k,yield*t.intersectHUDScreenPolygon(a.sliceableLayers,n),t.polygonResults.sortResults()}intersectToolIntersectorScreen(e,t,n){let r=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(r,t,n)}intersectToolIntersectorRay(e,t,n){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,n);let r=t.results.min;this._view.groundView.opaque||M(r)&&r.intersector!==7||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,n))}setTolerance(e=D){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}removeIntersectionHandler(e){this._externalIntersectionHandlers.removeUnordered(e)!=null&&this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}_getPickRay(e,t){let n=this._view.state.camera;return T(n,e,t)}_intersectRayFreePointLocal(e,t){return this.isGlobal||e==null||n(t,e.origin,r(b.get(),e.direction)),!1}intersectElevationFromScreen(e,t,n=0,r=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,n,r)}_intersectElevation(e,t,n=0,a=null){if(e==null)return null;let o=this._view,{renderCoordsHelper:s}=o,c=p(o.spatialReference),l=t==null?`absolute-height`:t.mode,d=x(t)/c,f=(l===`on-the-ground`?0:d+n)*c/s.unitInMeters,{camera:m}=o.state;if(l===`absolute-height`){let t=s.getAltitude(m.eye),n=i(r(K,e.direction),s.worldUpAtPosition(m.eye,q));if(t<f&&n<0||t>=f&&n>0)return null;if(s.intersectInfiniteManifold(e,f,K)){let e=E(o,K);return e.z??=0,e.z-=d,e}return null}let h=m.projectToRenderScreen(e.origin,u(b.get())),g=new U(null,this._forEachLayer),_=o.slice.plane,v=_?I(_):null,y=new O(this.isGlobal);y.options.store=0,y.options.verticalOffset=f,y.options.normalRequired=!1;let S=this._createRayIntersectionQuery(e,h,!1);y.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,y.reset(S.beginPoint,S.endPoint,m),y.point=h;let C=null;if(a&&`type`in a&&a.type===`graphics`){let e=o.allLayerViews.find(e=>e.layer===a)?.uid;C=e?t=>t.layerViewUid===e:null}else a&&(C=e=>e.graphicUid!==a.uid);switch(l){case`relative-to-scene`:y.intersect(g.layers,S.screenPoint,this._tolerance,null,e=>(!C||C(e))&&!!e.lastValidElevationBB),this._intersectRayHandlers(y,g,S,v,!1,e=>e.type===2||e.type===7||e.type===8,!1);break;case`on-the-ground`:case`relative-to-ground`:this._intersectRayHandlers(y,g,S,v,!1,e=>e.isGround,!1)}if(y.results.min.getIntersectionPoint(K)){let e=E(o,K);return e.z=n,e}return null}computeIntersection(e,t,n,r){if(e==null)return;let i=this._view.state.camera,a=i.projectToRenderScreen(e.origin,u(b.get())),o=new U(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r);let s=this._createRayIntersectionQuery(e,a,n);t.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,t.reset(s.beginPoint,s.endPoint,i),t.intersect(o.layers,s.screenPoint,this._tolerance,null,o.objectFilter);let c=this._view.slice.plane,l=c?I(c):null;t.intersect(o.sliceableLayers,s.screenPoint,this._tolerance,l,o.objectFilter);let d=r&&(r.requiresGroundFeedback||r.enableDraped);this._intersectRayHandlers(t,o,s,l,!!d,e=>o.allowedIntersectorTypes==null||o.allowedIntersectorTypes.has(e.type));let f=b.get(),p=this._view,m=p.groundView.spatialReference;if(r&&r.enableDraped&&m!=null&&t.results.ground.getIntersectionPoint(f)){let e=p.overlayManager.renderer,n=p.renderCoordsHelper.spatialReference,r=b.get();p.renderCoordsHelper.fromRenderCoords(f,r,m),r[2]=p.elevationProvider?.getElevation(f[0],f[1],f[2],n,`ground`)??0,e.intersectRay(t,r,t.results.ground,e=>o.filterRenderGeometry(e))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){let t=e.results.hud;h(this._tmpRegion,g);let n=[],r=this._tmpRegion,i=e=>{n.push(new z(e))};e.sortResults(t.all),t.min.distance!=null&&i(t.min);for(let e of t.all)t.min.target.object!==e.target.object&&t.max.target.object!==e.target.object&&i(e);if(t.max.distance!=null&&t.max.target.object!==t.min.target.object&&i(t.max),!n.length)return;r[0]===r[2]&&(r[2]+=1),r[1]===r[3]&&(r[3]+=1);let a=!0,o=e.results.max.distance==null,s=0;for(let t of n)a&&=(e.results.min.copy(t.result),!1),o&&e.results.max.copy(t.result),e.options.store===2&&e.results.all.splice(s++,0,t.result)}_createRayIntersectionQuery(e,t,r){return new A(e.origin,n(o(),e.origin,e.direction),t,r)}_intersectRayHandlers(e,t,n,r,i,a=()=>!0,o=!0){let{options:s}=e,c=s.isFiltered,l=s.filteredLayerViewUids;for(let{handler:c,filterPredicate:l,isFiltered:u,filteredLayerViewUids:d}of this._getFilteredIntersectionHandlers(t,r,null,a,o))(!u||c.isGround&&i)&&(s.isFiltered=u,s.filteredLayerViewUids=d,c.intersectRay(e,l,e.rayBegin,e.rayEnd,n.screenPoint,n.isVerticalRay));s.isFiltered=c,s.filteredLayerViewUids=l}*_intersectPolygonHandlersGenerator(e,t,n,r,i,a=()=>!0,o=!0,s){let{options:c}=e,l=c.isFiltered,u=c.filteredLayerViewUids,d=e.screenPolygonPrimitiveProcessor;for(let{handler:l,screenPolygonPrimitiveProcessor:u,isFiltered:d,filteredLayerViewUids:f}of this._getFilteredIntersectionHandlers(t,r,i,a,o))d||l.intersectScreenPolygon==null||(c.isFiltered=d,c.filteredLayerViewUids=f,e.screenPolygonPrimitiveProcessor=u??k,yield*l.intersectScreenPolygon(e,n,s));c.isFiltered=l,c.filteredLayerViewUids=u,e.screenPolygonPrimitiveProcessor=d}*_intersectDrapedScreenPolygon(e,t,n,r){let{basemapTerrain:i,overlayManager:a}=this._view,o=this._view.groundView.spatialReference!=null&&!a.renderer.isEmpty;if(!e.options.selectionMode||!r?.enableDraped||!o)return;let s=yield*this._createDrapedPolygonIntersectionQueries(n,i.slicePlaneEnabled?this._view.slice.plane:null);s!=null&&(yield*this._view.overlayManager.renderer.intersectScreenPolygon(e,s,e=>t.filterRenderGeometry(e)))}*_createDrapedPolygonIntersectionQueries(n,r){let{state:{camera:{eye:i}},pointsOfInterest:o}=this._view,l=this._view.groundView.spatialReference,u=[],d=r?[]:null,f=C(this._view,o.focus.renderLocation),p=v(l),m=1/0,h=null,g=K,_=q,y=e=>{if(!this._intersectDrapedScreenPolygonPoint(g,_,e))return!1;let n=h!=null&&p?h+p.shortestSignedDiff(h,g[0]):g[0];return h=n,u.push(t(n,g[1])),d&&d.push(s(_)),m=Math.min(m,a(i,_)),!0},{points:b}=n,{length:x}=b;for(let t=0;t<x;t++){let n=b[t],r=b[(t+1)%x];for(let t=0;t<f;t++){let i=t/f;if(!y(t===0?n:e(Y,c(n[0],r[0],i),c(n[1],r[1],i))))return null;yield}}if(!Number.isFinite(m))return null;if(r==null||!d)return[G(u,m)];let S=this._clipDrapedScreenPolygonIntersectionQueries(d,r,p,i);return S.length>0?S:null}_clipDrapedScreenPolygonIntersectionQueries(e,t,n,r){let i=[],a=P(t);for(let t of F(a,e)){let e=this._createDrapedQueryFromRenderPolygon(t,n,r);e!=null&&i.push(e)}return i.sort((e,t)=>e.distance-t.distance),i}_createDrapedQueryFromRenderPolygon(e,n,r){let{renderCoordsHelper:i}=this._view,o=this._view.groundView.spatialReference,s=[],c=1/0,l=null;for(let u of e){if(!i.fromRenderCoords(u,X,o))return null;let e=l!=null&&n?l+n.shortestSignedDiff(l,X[0]):X[0];l=e,s.push(t(e,X[1])),c=Math.min(c,a(r,u))}return s.length>=3&&Number.isFinite(c)?G(s,c):null}_intersectDrapedScreenPolygonPoint(e,t,n){let r=this._getPickRay(n,this._tmpRay);if(r==null)return!1;let{renderCoordsHelper:i}=this._view;this._intersectGroundPoint(t,r,n)||i.intersectManifoldClosestSilhouette(r,0,t);let a=this._view.groundView.spatialReference;return!!i.fromRenderCoords(t,e,a)}_intersectGroundPoint(e,t,n){let r=this._view.state.camera,i=new U(null,this._forEachLayer),a=new O(this.isGlobal);J[0]=n[0],J[1]=n[1],J[2]=0;let o=this._createRayIntersectionQuery(t,J,!1);return a.options.selectionMode=!0,a.options.store=0,a.options.normalRequired=!1,a.options.selectOpaqueTerrainOnly=!1,a.reset(o.beginPoint,o.endPoint,r),this._intersectRayHandlers(a,i,o,null,!0,e=>e.isGround,!1),a.results.ground.getIntersectionPoint(e)}*_getFilteredIntersectionHandlers(e,t,n,r=()=>!0,i=!0){for(let a of this._externalIntersectionHandlers){if(!r(a))continue;let o=!1,s=[];if(i){let t=a.layerViewUid,n=a.sublayerId,r=Array.isArray(t),i=r?t:[t],c=!1;for(let t of i)e.filterLayerViewUid(t,n)?c=!0:r&&s.push(t);o=!c}yield new B(a,a.slicePlaneEnabled?t:null,a.slicePlaneEnabled?n:null,o,s)}}}class z{constructor(e){this.result=e,this.screenPoint=d()}}class B{constructor(e,t,n,r,i){this.handler=e,this.filterPredicate=t,this.screenPolygonPrimitiveProcessor=n,this.isFiltered=r,this.filteredLayerViewUids=i}}let V;function H(e){return V&&V.isGlobal===e||(V=new O(e)),V}class U{constructor(e,t){this.layers=[],this.sliceableLayers=[],this.include=e?.include,this.exclude=e?.exclude,this.objectFilter=e?.objectFilter,this.allowedIntersectorTypes=e?.allowedIntersectorTypes,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){let{include:n,exclude:r}=this;if(e==null)return n==null&&r==null;let i=n instanceof Map?n.get(e)??!1:n?.has(e),a=r instanceof Map?r.get(e)??!1:r?.has(e);return(i==null||(typeof i==`boolean`?i:t!=null&&i.has(t)))&&(a==null||!(typeof a==`boolean`?a:t!=null&&a.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function W(e){return typeof e==`object`&&!!e&&`intersectRay`in e}function G(e,t){return new j(e,_(m(g),e),t)}const K=o(),q=o(),J=d(),Y=f(),X=o(),Z=d();export{R as SceneIntersectionHelper,W as isIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{dot as e,distance as t,subtract as n,scale as r,add as i,copy as a,normalize as o,cross as s,scaleAndAdd as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,clone as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clamp as d}from"../../../../core/mathUtils.js";import{create as f}from"../../../../geometry/support/ray.js";import{applyConstraintsAndUpdateCenterRenderCamera as p}from"../../camera/constraintUtils.js";import{Intersector as m}from"../../webgl-engine/lib/Intersector.js";const h=.5,g=new Set([0,2,8]),_=new Set(g).add(7);class v{constructor(e){this._view=e,this._tmpRay=f(),this._tmpWorldUp=l(),this._tmpScaledUp=l(),this._tmpCorrectionOffset=l(),this._tmpUpdatedCameraPos=l(),this._tmpCenterDiff=l(),this._tmpMovementDelta=l(),this._tmpPerpendicularMovementDelta=l(),this._tmpGroundIntersections=[l(),l(),l()],this._tmpGroundIntersectionHits=[!1,!1,!1],this._tmpRayOrigins=[l(),l(),l()],this._tmpRayDirection=l(),this._previousCameraPosition=null,this._intersector=new m(this._view.state.viewingMode),this._intersector.options.invisibleTerrain=!0}smoothlyCorrectGroundElevation(t){let{camera:n,deltaTime:r,constraintOptions:i,navigationModeOverride:a}=t,o=this._prepareMode(a);if(!o||!r)return 0;let s=this._view.renderCoordsHelper.worldUpAtPosition(n.eye,this._tmpWorldUp),c=this._prepareCameraAndPreviousIterationPosition(n,s,this._previousCameraPosition),l=this._prepareRays(n,s,c),d=this._intersectRays(o,s,l);if(!d.hasIntersection){let e=this._adjustCameraElevation(n,s,0,i);return this._previousCameraPosition=u(e),0}let f=this._filterRayResults(s,c,d),p=this._getSmoothedElevationCorrection(o,f,n,s,c,r),m=this._adjustCameraElevation(n,s,p,i);return this._previousCameraPosition=u(m),Math.abs(f-e(m,s))}immediatelyCorrectGroundElevation(r){let{camera:i,constraintOptions:a,navigationModeOverride:o,correctionLimit:s}=r,c=this._prepareMode(o);if(!c)return;let l=this._view.renderCoordsHelper.worldUpAtPosition(i.eye,this._tmpWorldUp),u=this._prepareRays(i,l),d=this._intersectRays(c,l,u),f=d.intersections[0];!d.hasIntersection||t(i.eye,f)>(s??1/0)?this._adjustCameraElevation(i,l,0,a):this._adjustCameraElevation(i,l,e(l,n(this._tmpCorrectionOffset,f,i.eye)),a)}_prepareMode(e){let t=e??this._view.navigation.mode;return t.type!==`ground`||!t.offset?null:t}_prepareCameraAndPreviousIterationPosition(t,n,a){if(a){let o=e(n,t.eye),s=e(n,a);return r(this._tmpCorrectionOffset,n,s-o),t.eye=i(this._tmpUpdatedCameraPos,t.eye,this._tmpCorrectionOffset),t.center=i(this._tmpUpdatedCameraPos,t.center,this._tmpCorrectionOffset),a}return t.eye}_prepareRays(e,t,n){let i=r(this._tmpRayDirection,t,-1e5);if(a(this._tmpRayOrigins[0],e.eye),!n)return{origins:this._tmpRayOrigins,direction:i,count:1};let{forwardMovementDirection:o,rightMovementDirection:s}=this._getMovementDirections(e.eye,n,t);return this._getLeftRayOrigin(e.eye,o,s,this._tmpRayOrigins[1]),this._getRightRayOrigin(e.eye,o,s,this._tmpRayOrigins[2]),{origins:this._tmpRayOrigins,direction:i,count:this._tmpRayOrigins.length}}_getMovementDirections(t,i,a){let c=n(this._tmpMovementDelta,t,i);return n(c,c,r(this._tmpScaledUp,a,e(a,c))),o(c,c),{forwardMovementDirection:c,rightMovementDirection:s(this._tmpPerpendicularMovementDelta,c,a)}}_getLeftRayOrigin(e,t,n,r){return c(r,e,t,h),c(r,r,n,-.5),r}_getRightRayOrigin(e,t,n,r){return c(r,e,t,h),c(r,r,n,h),r}_intersectRays(e,n,r){let i=e.offset,o=this._view.sceneIntersectionHelper,s=y(e,this._view.groundView.baseOpacity===0);a(this._tmpRay.direction,r.direction);for(let e=0;e<r.count;e++)a(this._tmpRay.origin,r.origins[e]),this._tmpGroundIntersectionHits[e]=o.intersectRay(this._tmpRay,this._intersector,this._tmpGroundIntersections[e],s),this._tmpGroundIntersectionHits[e]&&t(this._tmpGroundIntersections[e],this._tmpRay.origin)>1e5&&(this._tmpGroundIntersectionHits[e]=!1),this._tmpGroundIntersectionHits[e]&&c(this._tmpGroundIntersections[e],this._tmpGroundIntersections[e],n,i);let l=this._tmpGroundIntersectionHits.some((e,t)=>t<r.count&&e);return{intersections:this._tmpGroundIntersections,hits:this._tmpGroundIntersectionHits,count:r.count,hasIntersection:l}}_filterRayResults(t,n,r){let i=e(n,t),a=null;for(let n=0;n<r.count;n++){if(!r.hits[n])continue;let o=r.intersections[n],s=e(o,t);(a==null||Math.abs(s-i)<Math.abs(a-i))&&(a=s)}return a}_getSmoothedElevationCorrection(n,r,i,a,o,s){let c=t(i.eye,o)/s,l=1+Math.max(0,(c-5)*.03),u=(l*1e-5)**s,f=e(o,a)*u+r*(1-u),p=e(i.eye,a),m=l*5*s*(n.offset??0),h=f-p;return d(h,-m,m)}_adjustCameraElevation(e,t,r,a){return r!==0&&(c(this._tmpUpdatedCameraPos,e.eye,t,r),n(this._tmpCenterDiff,e.center,e.eye),e.eye=this._tmpUpdatedCameraPos,e.center=i(this._tmpUpdatedCameraPos,this._tmpUpdatedCameraPos,this._tmpCenterDiff)),p(this._view,e,a),e.eye}reset(){this._previousCameraPosition=null}}function y(e,t){return b(e.include)?{include:e.include,exclude:e.exclude}:{exclude:e.exclude,objectFilter:e=>!!e.lastValidElevationBB,allowedIntersectorTypes:t?g:_}}function b(e){return e!=null&&e.size>0}export{v as OffsetCorrectionController};
2
+ import{dot as e,distance as t,subtract as n,scale as r,add as i,copy as a,normalize as o,cross as s,scaleAndAdd as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,clone as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clamp as d}from"../../../../core/mathUtils.js";import{create as f}from"../../../../geometry/support/ray.js";import{applyConstraintsAndUpdateCenterRenderCamera as p}from"../../camera/constraintUtils.js";import{Intersector as m}from"../../webgl-engine/lib/Intersector.js";const h=.5,g=new Set([0,2,8]),_=new Set(g).add(7);class v{constructor(e){this._view=e,this._tmpRay=f(),this._tmpWorldUp=l(),this._tmpScaledUp=l(),this._tmpCorrectionOffset=l(),this._tmpUpdatedCameraPos=l(),this._tmpCenterDiff=l(),this._tmpMovementDelta=l(),this._tmpPerpendicularMovementDelta=l(),this._tmpGroundIntersections=[l(),l(),l()],this._tmpGroundIntersectionHits=[!1,!1,!1],this._tmpRayOrigins=[l(),l(),l()],this._tmpRayDirection=l(),this._previousCameraPosition=null,this._intersector=new m(this._view.state.isGlobal),this._intersector.options.invisibleTerrain=!0}smoothlyCorrectGroundElevation(t){let{camera:n,deltaTime:r,constraintOptions:i,navigationModeOverride:a}=t,o=this._prepareMode(a);if(!o||!r)return 0;let s=this._view.renderCoordsHelper.worldUpAtPosition(n.eye,this._tmpWorldUp),c=this._prepareCameraAndPreviousIterationPosition(n,s,this._previousCameraPosition),l=this._prepareRays(n,s,c),d=this._intersectRays(o,s,l);if(!d.hasIntersection){let e=this._adjustCameraElevation(n,s,0,i);return this._previousCameraPosition=u(e),0}let f=this._filterRayResults(s,c,d),p=this._getSmoothedElevationCorrection(o,f,n,s,c,r),m=this._adjustCameraElevation(n,s,p,i);return this._previousCameraPosition=u(m),Math.abs(f-e(m,s))}immediatelyCorrectGroundElevation(r){let{camera:i,constraintOptions:a,navigationModeOverride:o,correctionLimit:s}=r,c=this._prepareMode(o);if(!c)return;let l=this._view.renderCoordsHelper.worldUpAtPosition(i.eye,this._tmpWorldUp),u=this._prepareRays(i,l),d=this._intersectRays(c,l,u),f=d.intersections[0];!d.hasIntersection||t(i.eye,f)>(s??1/0)?this._adjustCameraElevation(i,l,0,a):this._adjustCameraElevation(i,l,e(l,n(this._tmpCorrectionOffset,f,i.eye)),a)}_prepareMode(e){let t=e??this._view.navigation.mode;return t.type!==`ground`||!t.offset?null:t}_prepareCameraAndPreviousIterationPosition(t,n,a){if(a){let o=e(n,t.eye),s=e(n,a);return r(this._tmpCorrectionOffset,n,s-o),t.eye=i(this._tmpUpdatedCameraPos,t.eye,this._tmpCorrectionOffset),t.center=i(this._tmpUpdatedCameraPos,t.center,this._tmpCorrectionOffset),a}return t.eye}_prepareRays(e,t,n){let i=r(this._tmpRayDirection,t,-1e5);if(a(this._tmpRayOrigins[0],e.eye),!n)return{origins:this._tmpRayOrigins,direction:i,count:1};let{forwardMovementDirection:o,rightMovementDirection:s}=this._getMovementDirections(e.eye,n,t);return this._getLeftRayOrigin(e.eye,o,s,this._tmpRayOrigins[1]),this._getRightRayOrigin(e.eye,o,s,this._tmpRayOrigins[2]),{origins:this._tmpRayOrigins,direction:i,count:this._tmpRayOrigins.length}}_getMovementDirections(t,i,a){let c=n(this._tmpMovementDelta,t,i);return n(c,c,r(this._tmpScaledUp,a,e(a,c))),o(c,c),{forwardMovementDirection:c,rightMovementDirection:s(this._tmpPerpendicularMovementDelta,c,a)}}_getLeftRayOrigin(e,t,n,r){return c(r,e,t,h),c(r,r,n,-.5),r}_getRightRayOrigin(e,t,n,r){return c(r,e,t,h),c(r,r,n,h),r}_intersectRays(e,n,r){let i=e.offset,o=this._view.sceneIntersectionHelper,s=y(e,this._view.groundView.baseOpacity===0);a(this._tmpRay.direction,r.direction);for(let e=0;e<r.count;e++)a(this._tmpRay.origin,r.origins[e]),this._tmpGroundIntersectionHits[e]=o.intersectRay(this._tmpRay,this._intersector,this._tmpGroundIntersections[e],s),this._tmpGroundIntersectionHits[e]&&t(this._tmpGroundIntersections[e],this._tmpRay.origin)>1e5&&(this._tmpGroundIntersectionHits[e]=!1),this._tmpGroundIntersectionHits[e]&&c(this._tmpGroundIntersections[e],this._tmpGroundIntersections[e],n,i);let l=this._tmpGroundIntersectionHits.some((e,t)=>t<r.count&&e);return{intersections:this._tmpGroundIntersections,hits:this._tmpGroundIntersectionHits,count:r.count,hasIntersection:l}}_filterRayResults(t,n,r){let i=e(n,t),a=null;for(let n=0;n<r.count;n++){if(!r.hits[n])continue;let o=r.intersections[n],s=e(o,t);(a==null||Math.abs(s-i)<Math.abs(a-i))&&(a=s)}return a}_getSmoothedElevationCorrection(n,r,i,a,o,s){let c=t(i.eye,o)/s,l=1+Math.max(0,(c-5)*.03),u=(l*1e-5)**s,f=e(o,a)*u+r*(1-u),p=e(i.eye,a),m=l*5*s*(n.offset??0),h=f-p;return d(h,-m,m)}_adjustCameraElevation(e,t,r,a){return r!==0&&(c(this._tmpUpdatedCameraPos,e.eye,t,r),n(this._tmpCenterDiff,e.center,e.eye),e.eye=this._tmpUpdatedCameraPos,e.center=i(this._tmpUpdatedCameraPos,this._tmpUpdatedCameraPos,this._tmpCenterDiff)),p(this._view,e,a),e.eye}reset(){this._previousCameraPosition=null}}function y(e,t){return b(e.include)?{include:e.include,exclude:e.exclude}:{exclude:e.exclude,objectFilter:e=>!!e.lastValidElevationBB,allowedIntersectorTypes:t?g:_}}function b(e){return e!=null&&e.size>0}export{v as OffsetCorrectionController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{crossAndNormalize as e,copy as t,scale as n,subtract as r,add as i,distance as a,normalize as o,cross as s,dot as c,scaleAndAdd as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as f}from"../../../../core/screenUtils.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import{fromValues as m}from"../../../../geometry/support/lineSegment.js";import{create as h,fromPositionAndNormal as g,distance as _,projectPoint as v,projectVector as y,intersectLineSegment as b}from"../../../../geometry/support/plane.js";import{create as x}from"../../../../geometry/support/ray.js";import{Sphere as S}from"../../../../geometry/support/sphere.js";import{getVoxelWasm as ee}from"../../layers/VoxelWasm.js";import{fromScreenAtEye as te}from"../../support/geometryUtils/ray.js";import{fromRenderCamera as C}from"../../webgl.js";import{Intersector as w}from"../../webgl-engine/lib/Intersector.js";import T from"../../webgl/RenderCamera.js";import{pickPointAndInitSphere as E,sphereOrPlanePointFromScreenPoint as D,intersectPlaneFromScreenPoint as O,searchAreaSize as k}from"./navigationUtils.js";import{OffsetCorrectionController as ne}from"./OffsetCorrectionController.js";const A=1.5,j={xSpeedMultiplier:A,ySpeedMultiplier:A,maxElevation:1e4,relativeHorizonPadding:.1,minimumHorizonPadding:12,i3sNodeDownwardCheckDistanceInMeters:5},M=d(),N=d(),P=f(),F=d(),I=h(),L=d(),R=d(),z=d(),B=d(),V=d(),re=d(),H=d(),U=d(),W=d(),G=d(),K=f(),q=x(),J=new S,Y=d(),ie=h(),X=d(),ae=d();function oe(e,t){return y(t,e.viewForward,M),i(N,e.eye,M),e.projectToScreen(N,P),P[1]}function se(t,u,d){let f=t.eye;if(a(u.center,f)<u.radius)return o(V,f),s(re,V,t.viewRight),i(N,f,re),t.projectToScreen(N,K),K[1];let p=t.up;te(t,d,q);let m=u.radius;if(e(F,p,q.direction),g(f,F,I),_(I,u.center)>m)return null;v(I,u.center,L);let h=a(u.center,L),y=Math.sqrt(m**2-h**2);r(R,f,L),o(z,R),e(B,F,z);let b=c(R,z),x=c(R,B),S=Math.sqrt(b**2+x**2),ee=Math.sqrt(S**2-y**2),C=y**2/S**2,w=y/S**2*ee,T=C*b,E=w*-x,D=C*x,O=w*b,k=T+E,ne=T-E,A=D+O,j=D-O;return i(H,L,l(H,n(H,z,k),B,A)),i(U,L,l(U,n(U,z,ne),B,j)),r(W,H,f),o(W,W),r(G,U,f),o(G,G),c(t.viewForward,W)>=c(t.viewForward,G)?t.projectToScreen(H,K):t.projectToScreen(U,K),K[1]}function ce(e,t,n=!0){return n?e<t:e<=t}function Z(e,t,n=!0){return n?e>t:e>=t}function le(e,t,n){return t?e>n:e<n}function Q(e,t){let n=e.fullHeight/e.pixelRatio,r=Math.max(t,n-t);return Math.max(j.minimumHorizonPadding,j.relativeHorizonPadding*r)}function ue(e,t){return[de(e,t),fe(e,t)]}function de(e,t){let n=e.fullHeight/e.pixelRatio;return Math.min(n,t+Q(e,t))}function fe(e,t){return Math.max(0,t-Q(e,t))}function pe(e,t,n){let r={translation:e,location:t};return n&&(r.normal=n),r}function me(e){let{view:t}=e;return t.viewingMode===`global`?he(e):ge(e)}function he(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:l,outGrabNormal:u,intersectionOptions:d,depthSearchSize:f}=e,m=n.state.camera,h=pe(c,l,u);J.radius=p(n.spatialReference).radius;let g=E(n,m,r,J.radius,1,d);if(g.scenePickPoint==null)return!1;let _=g.hasGeometryIntersection;t(Y,g.scenePickPoint),t(h.location,Y);let v=g.sphere;h.normal&&g.normal&&t(h.normal,g.normal);let y=ve(r,i,s,_),b=_?a(Y,m.eye):1/0;return y.wasAdjusted&&ye({view:n,screenAdjustment:y,intersector:$(n),fallbackCheck:(e,t,n)=>{let r=D(v,m,e,t);return r&&n&&o(n,t),r},output:h,intersectionOptions:d}),xe({view:n,screenPoint:y.adjustedScreenPoint,camera:m,initialDistance:b,depthSearchSize:f??k,output:h}),!0}function ge(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:u,outGrabNormal:d,intersectionOptions:f,depthSearchSize:p}=e,m=n.sceneIntersectionHelper,h=n.state.camera,_=$(n),v=pe(c,u,d);m.intersectIntersectorScreen(r,_,f);let y=_.results.min.getIntersectionPoint(Y),b=y?a(Y,h.eye):1/0;y&&(t(v.location,Y),v.normal&&t(v.normal,_.results.min.normal)),n.renderCoordsHelper.worldUpAtPosition(h.eye,V),l(X,h.eye,V,-h.relativeElevation),g(X,V,ie);let x=ve(r,i,s,y);return x.wasAdjusted&&ye({view:n,screenAdjustment:x,intersector:_,fallbackCheck:(e,t,n)=>{let r=O(ie,h,e,t);return r&&n&&o(n,V),r},output:v,intersectionOptions:f}),xe({view:n,screenPoint:x.adjustedScreenPoint,camera:h,initialDistance:b,depthSearchSize:p??k,output:v}),!0}function _e(e,t,n,r){return!r&&ce(e,t)||r&&le(e,!1,n[0])?n[0]:!r&&Z(e,t,!1)?n[1]:null}function ve(e,t,n,r){let i=_e(e[1],t,n,r);return{originalScreenPoint:e,adjustedScreenPoint:f(e[0],i??e[1]),horizonY:t,horizonPadding:n,wasAdjusted:i!==null}}function $(e){let t=new w(e.state.viewingMode);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function ye(e){let{view:n,screenAdjustment:r,fallbackCheck:i,intersector:a,output:o,intersectionOptions:s}=e,c=n.sceneIntersectionHelper;c.intersectIntersectorScreen(r.adjustedScreenPoint,a,{...s,requiresGroundFeedback:!0});let l=a.results.min.getIntersectionPoint(o.location);if(l){o.normal&&t(o.normal,a.results.min.normal);return}let u=be(r);c.intersectIntersectorScreen(u,a,{...s,requiresGroundFeedback:!0}),l=a.results.min.getIntersectionPoint(o.location),l?o.normal&&t(o.normal,a.results.min.normal):(l=i(r.adjustedScreenPoint,o.location,o.normal),l||i(u,o.location,o.normal))}function be(e){let{originalScreenPoint:t,adjustedScreenPoint:n,horizonY:r,horizonPadding:i}=e,a=Z(n[1],r)?Math.min(i[1],t[1]):Math.max(i[0],t[1]);return f(n[0],a)}function xe(e){Se(e),Ce(e)}function Se(e){let{view:n,camera:i,output:a}=e,{offset:o}=n.navigation.mode;if(!o)return;let{translation:s,location:c}=a;n.renderCoordsHelper.worldUpAtPosition(i.eye,V),l(X,i.eye,V,-o),g(X,V,I),b(I,m(i.eye,r(M,c,i.eye)),X)&&(t(c,X),r(s,c,i.eye))}function Ce(e){let{view:t,screenPoint:a,camera:s,initialDistance:c,depthSearchSize:l,output:d}=e,f=l>0?t.stage.renderView.getMinimalDepthForArea(ee(t),a[0],a[1],s,l):null;r(d.translation,d.location,s.eye);let p=Math.min(u(d.translation),c);f&&f<=p&&(p=f),o(d.translation,d.translation),n(d.translation,d.translation,p),i(d.location,d.translation,s.eye)}async function we(e,t,n,r,i){let a=new T().copyFrom(e.state.camera);if(Te({view:e,camera:a,forwardDirection:t,forwardDistance:n,detectCollisions:!0}))return r?r.smoothlyCorrectGroundElevation({camera:a,deltaTime:i}):new ne(e).immediatelyCorrectGroundElevation({camera:a,correctionLimit:100}),e.goTo(C(e,a),{duration:500,liftOffDisabled:!0})}function Te(o){let{view:s,camera:c,forwardDirection:l,forwardDistance:d,detectCollisions:f}=o,p=s.navigation.mode;if(p.type!==`ground`)return!1;s.renderCoordsHelper.worldUpAtPosition(c.eye,V);let m=s.sceneIntersectionHelper,h=$(s),g=e(M,V,e(M,l,V));t(q.origin,c.eye),n(q.direction,g,d);let _=m.intersectRay(q,h,Y,{include:p.include,exclude:p.exclude}),v=r(ae,c.center,c.eye);return!f||!_||a(Y,c.eye)>Math.abs(d)?c.eye=i(M,q.origin,q.direction):(r(M,Y,c.eye),u(M)>2&&(Ee(M,M,.25,2),c.eye=i(M,c.eye,M))),c.center=i(M,c.eye,v),!0}function Ee(e,t,r,i){let a=u(e),o=Math.min(r,Math.max(a-i,0)/a);n(t,e,o)}export{Te as advanceGroundNavigationCamera,Q as computeHorizonPadding,ue as computeHorizonPaddingLimits,me as findGroundNavigationGrabLocation,oe as findPlaneHorizonY,se as findSphereHorizonY,we as groundNavigationAdvance,j as groundNavigationConstants,ce as isAboveHorizon,Z as isBelowHorizon,Ee as shortenTranslation,le as shouldClampScreenY};
2
+ import{crossAndNormalize as e,copy as t,scale as n,subtract as r,add as i,distance as a,normalize as o,cross as s,dot as c,scaleAndAdd as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as f}from"../../../../core/screenUtils.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import{fromValues as m}from"../../../../geometry/support/lineSegment.js";import{create as h,fromPositionAndNormal as g,distance as _,projectPoint as v,projectVector as y,intersectLineSegment as b}from"../../../../geometry/support/plane.js";import{create as x}from"../../../../geometry/support/ray.js";import{Sphere as S}from"../../../../geometry/support/sphere.js";import{getVoxelWasm as ee}from"../../layers/VoxelWasm.js";import{fromScreenAtEye as te}from"../../support/geometryUtils/ray.js";import{fromRenderCamera as C}from"../../webgl.js";import{Intersector as w}from"../../webgl-engine/lib/Intersector.js";import T from"../../webgl/RenderCamera.js";import{pickPointAndInitSphere as E,sphereOrPlanePointFromScreenPoint as D,intersectPlaneFromScreenPoint as O,searchAreaSize as k}from"./navigationUtils.js";import{OffsetCorrectionController as ne}from"./OffsetCorrectionController.js";const A=1.5,j={xSpeedMultiplier:A,ySpeedMultiplier:A,maxElevation:1e4,relativeHorizonPadding:.1,minimumHorizonPadding:12,i3sNodeDownwardCheckDistanceInMeters:5},M=d(),N=d(),P=f(),F=d(),I=h(),L=d(),R=d(),z=d(),B=d(),V=d(),re=d(),H=d(),U=d(),W=d(),G=d(),K=f(),q=x(),J=new S,Y=d(),ie=h(),X=d(),ae=d();function oe(e,t){return y(t,e.viewForward,M),i(N,e.eye,M),e.projectToScreen(N,P),P[1]}function se(t,u,d){let f=t.eye;if(a(u.center,f)<u.radius)return o(V,f),s(re,V,t.viewRight),i(N,f,re),t.projectToScreen(N,K),K[1];let p=t.up;te(t,d,q);let m=u.radius;if(e(F,p,q.direction),g(f,F,I),_(I,u.center)>m)return null;v(I,u.center,L);let h=a(u.center,L),y=Math.sqrt(m**2-h**2);r(R,f,L),o(z,R),e(B,F,z);let b=c(R,z),x=c(R,B),S=Math.sqrt(b**2+x**2),ee=Math.sqrt(S**2-y**2),C=y**2/S**2,w=y/S**2*ee,T=C*b,E=w*-x,D=C*x,O=w*b,k=T+E,ne=T-E,A=D+O,j=D-O;return i(H,L,l(H,n(H,z,k),B,A)),i(U,L,l(U,n(U,z,ne),B,j)),r(W,H,f),o(W,W),r(G,U,f),o(G,G),c(t.viewForward,W)>=c(t.viewForward,G)?t.projectToScreen(H,K):t.projectToScreen(U,K),K[1]}function ce(e,t,n=!0){return n?e<t:e<=t}function Z(e,t,n=!0){return n?e>t:e>=t}function le(e,t,n){return t?e>n:e<n}function Q(e,t){let n=e.fullHeight/e.pixelRatio,r=Math.max(t,n-t);return Math.max(j.minimumHorizonPadding,j.relativeHorizonPadding*r)}function ue(e,t){return[de(e,t),fe(e,t)]}function de(e,t){let n=e.fullHeight/e.pixelRatio;return Math.min(n,t+Q(e,t))}function fe(e,t){return Math.max(0,t-Q(e,t))}function pe(e,t,n){let r={translation:e,location:t};return n&&(r.normal=n),r}function me(e){let{view:t}=e;return t.viewingMode===`global`?he(e):ge(e)}function he(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:l,outGrabNormal:u,intersectionOptions:d,depthSearchSize:f}=e,m=n.state.camera,h=pe(c,l,u);J.radius=p(n.spatialReference).radius;let g=E(n,m,r,J.radius,1,d);if(g.scenePickPoint==null)return!1;let _=g.hasGeometryIntersection;t(Y,g.scenePickPoint),t(h.location,Y);let v=g.sphere;h.normal&&g.normal&&t(h.normal,g.normal);let y=ve(r,i,s,_),b=_?a(Y,m.eye):1/0;return y.wasAdjusted&&ye({view:n,screenAdjustment:y,intersector:$(n),fallbackCheck:(e,t,n)=>{let r=D(v,m,e,t);return r&&n&&o(n,t),r},output:h,intersectionOptions:d}),xe({view:n,screenPoint:y.adjustedScreenPoint,camera:m,initialDistance:b,depthSearchSize:f??k,output:h}),!0}function ge(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:u,outGrabNormal:d,intersectionOptions:f,depthSearchSize:p}=e,m=n.sceneIntersectionHelper,h=n.state.camera,_=$(n),v=pe(c,u,d);m.intersectIntersectorScreen(r,_,f);let y=_.results.min.getIntersectionPoint(Y),b=y?a(Y,h.eye):1/0;y&&(t(v.location,Y),v.normal&&t(v.normal,_.results.min.normal)),n.renderCoordsHelper.worldUpAtPosition(h.eye,V),l(X,h.eye,V,-h.relativeElevation),g(X,V,ie);let x=ve(r,i,s,y);return x.wasAdjusted&&ye({view:n,screenAdjustment:x,intersector:_,fallbackCheck:(e,t,n)=>{let r=O(ie,h,e,t);return r&&n&&o(n,V),r},output:v,intersectionOptions:f}),xe({view:n,screenPoint:x.adjustedScreenPoint,camera:h,initialDistance:b,depthSearchSize:p??k,output:v}),!0}function _e(e,t,n,r){return!r&&ce(e,t)||r&&le(e,!1,n[0])?n[0]:!r&&Z(e,t,!1)?n[1]:null}function ve(e,t,n,r){let i=_e(e[1],t,n,r);return{originalScreenPoint:e,adjustedScreenPoint:f(e[0],i??e[1]),horizonY:t,horizonPadding:n,wasAdjusted:i!==null}}function $(e){let t=new w(e.state.isGlobal);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function ye(e){let{view:n,screenAdjustment:r,fallbackCheck:i,intersector:a,output:o,intersectionOptions:s}=e,c=n.sceneIntersectionHelper;c.intersectIntersectorScreen(r.adjustedScreenPoint,a,{...s,requiresGroundFeedback:!0});let l=a.results.min.getIntersectionPoint(o.location);if(l){o.normal&&t(o.normal,a.results.min.normal);return}let u=be(r);c.intersectIntersectorScreen(u,a,{...s,requiresGroundFeedback:!0}),l=a.results.min.getIntersectionPoint(o.location),l?o.normal&&t(o.normal,a.results.min.normal):(l=i(r.adjustedScreenPoint,o.location,o.normal),l||i(u,o.location,o.normal))}function be(e){let{originalScreenPoint:t,adjustedScreenPoint:n,horizonY:r,horizonPadding:i}=e,a=Z(n[1],r)?Math.min(i[1],t[1]):Math.max(i[0],t[1]);return f(n[0],a)}function xe(e){Se(e),Ce(e)}function Se(e){let{view:n,camera:i,output:a}=e,{offset:o}=n.navigation.mode;if(!o)return;let{translation:s,location:c}=a;n.renderCoordsHelper.worldUpAtPosition(i.eye,V),l(X,i.eye,V,-o),g(X,V,I),b(I,m(i.eye,r(M,c,i.eye)),X)&&(t(c,X),r(s,c,i.eye))}function Ce(e){let{view:t,screenPoint:a,camera:s,initialDistance:c,depthSearchSize:l,output:d}=e,f=l>0?t.stage.renderView.getMinimalDepthForArea(ee(t),a[0],a[1],s,l):null;r(d.translation,d.location,s.eye);let p=Math.min(u(d.translation),c);f&&f<=p&&(p=f),o(d.translation,d.translation),n(d.translation,d.translation,p),i(d.location,d.translation,s.eye)}async function we(e,t,n,r,i){let a=new T().copyFrom(e.state.camera);if(Te({view:e,camera:a,forwardDirection:t,forwardDistance:n,detectCollisions:!0}))return r?r.smoothlyCorrectGroundElevation({camera:a,deltaTime:i}):new ne(e).immediatelyCorrectGroundElevation({camera:a,correctionLimit:100}),e.goTo(C(e,a),{duration:500,liftOffDisabled:!0})}function Te(o){let{view:s,camera:c,forwardDirection:l,forwardDistance:d,detectCollisions:f}=o,p=s.navigation.mode;if(p.type!==`ground`)return!1;s.renderCoordsHelper.worldUpAtPosition(c.eye,V);let m=s.sceneIntersectionHelper,h=$(s),g=e(M,V,e(M,l,V));t(q.origin,c.eye),n(q.direction,g,d);let _=m.intersectRay(q,h,Y,{include:p.include,exclude:p.exclude}),v=r(ae,c.center,c.eye);return!f||!_||a(Y,c.eye)>Math.abs(d)?c.eye=i(M,q.origin,q.direction):(r(M,Y,c.eye),u(M)>2&&(Ee(M,M,.25,2),c.eye=i(M,c.eye,M))),c.center=i(M,c.eye,v),!0}function Ee(e,t,r,i){let a=u(e),o=Math.min(r,Math.max(a-i,0)/a);n(t,e,o)}export{Te as advanceGroundNavigationCamera,Q as computeHorizonPadding,ue as computeHorizonPaddingLimits,me as findGroundNavigationGrabLocation,oe as findPlaneHorizonY,se as findSphereHorizonY,we as groundNavigationAdvance,j as groundNavigationConstants,ce as isAboveHorizon,Z as isBelowHorizon,Ee as shortenTranslation,le as shouldClampScreenY};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{cyclicalPI as e}from"../../../../core/Cyclical.js";import{IDENTITY as t,create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromRotation as r,exactEquals as i,multiply as a,rotate as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as l,length as u,dot as d,subtract as f,normalize as p,squaredDistance as m,copy as h,transformMat4 as g,add as _,distance as ee,cross as v,scale as y,lerp as te,set as ne}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as re,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{deg2rad as x,clamp as ie,acosClamped as S,asinClamped as ae}from"../../../../core/mathUtils.js";import{createScreenPointArray as oe}from"../../../../core/screenUtils.js";import{create as se,axis as ce,fromPoints as le,wrapAxisAngle as ue}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as C,vectorCoordinates as de}from"../../../../geometry/support/coordinateSystem.js";import{create as fe,fromNormalAndOffset as pe,intersectRay as w}from"../../../../geometry/support/plane.js";import{Sphere as me}from"../../../../geometry/support/sphere.js";import{sm4d as he,sv3d as T}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as E,fromScreen as ge}from"../../support/geometryUtils/ray.js";import{intersectScreen as _e}from"../../support/geometryUtils/sphere.js";import{Intersector as ve}from"../../webgl-engine/lib/Intersector.js";import{terrainId as ye}from"../../webgl-engine/lib/verticalOffsetUtils.js";import be from"../../webgl/RenderCamera.js";const xe=30,Se=[1,3e8],Ce=8,we=[200,1508e5],Te=5,Ee=50,De=5,Oe=10,ke=90,D=1e-6,Ae={exclude:new Set([ye])};function je(e,t,n){return n[0]=t[0]/(e.fullWidth/e.pixelRatio),n[1]=t[1]/(e.fullHeight/e.pixelRatio),n}function Me(e){for(;e>Math.PI;)e-=2*Math.PI;for(;e<-Math.PI;)e+=2*Math.PI;return e}function O(e,n,a){let o=r(he.get(),a[3],ce(a));o==null||i(o,t)||(f(J,e.eye,n),g(J,J,o),e.eye=_(J,J,n),f(J,e.center,n),g(J,J,o),e.center=_(J,J,n),e.up=g(J,e.up,o))}function Ne(e,t,n,r){return w(e,ge(t,n,Q),r)}function Pe(e,t,n,r){return w(e,E(t,n,Q),r)}function Fe(e,t,n,r){let i=T.get(),a=1-n;f(i,t,e.eye);let o=u(i),s=o*(1-a);a>=0&&s<r&&(s=r,a=-(s-o)/o),Math.abs(o-s)<D||(y(i,i,a),e.eye=_(J,e.eye,i),e.center=te(J,e.center,t,a))}function Ie(e,t,n){t.getScreenCenter(Le),_e(e,t,Le,J)&&(t.center=J);let r=t.distance,i=r*n;if(Math.abs(r-i)<D)return;let a=y(T.get(),t.viewForward,i);t.eye=f(J,t.center,a)}const Le=oe();function Re(e,t){ne(t,0,0,0);for(let n of e)_(t,t,n);y(t,t,1/e.length)}function ze(e,t,n,r){return Math.sin(e/u(t))*(n+r.radius)}function Be(e,t,n,r){return ze(Math.PI/2,t,n,r)+(e-Math.PI/2)}const k={Elevation:3e4,Angle:x(16)},A=x(80);function Ve(e,t,n,r,i,a){let o=e.sceneIntersectionHelper,s=new ve(e.state.viewingMode);s.options.selectionMode=!1,s.options.store=0,s.options.hud=!1,s.options.normalRequired=!0;let c=null,d=b(),f=new me,p=!0,m=!0,{eye:h}=t;o.intersectIntersectorScreen(n,s,a);let g=s.results.min;return g.getIntersectionPoint(d)&&!l(h,d)&&at(h,d,r)?(c=re(g.normal),f.radius=u(d)):(m=!1,f.radius=!t.aboveGround||i===0?u(t.eye)-t.relativeElevation:Math.max(u(t.center),.9*r),i===1?We(f,t,n,d):p=_e(f,t,n,d)),{sphere:f,scenePickPoint:p?d:null,hasGeometryIntersection:m,intersectorType:g.intersector,normal:c}}function He(e,t,n,r){let i=e.relativeElevation;if(i>k.Elevation&&r===`global`)return 1;E(e,t,$);let a=Math.sign(i),o=n.worldUpAtPosition(e.eye,J);return-a*d(o,$.direction)<Math.sin(k.Angle)*u($.direction)?0:1}function Ue(e,t,n){f(j,n,t),e.eye=f(J,e.eye,j),e.center=f(J,e.center,j)}const j=b();function We(e,t,n,r){let i=E(t,n,Q);return i!=null&&(e.closestPointOnSilhouette(i,M),e.intersectRay(i,r)?m(M,i.origin)<m(r,i.origin)?(h(r,M),!1):!0:(f(N,t.eye,t.center),p(N,N),pe(N,-d(p(N,N),M),Ge),w(Ge,i,r),!1))}const M=b(),N=b(),Ge=fe();function Ke(t,n,r,i,a,o){let s=0;if(v(Z,t,n),f(Y,t,n),u(t)<=a||!i.aboveGround){v(r,Y,i.eye);let c=d(t,n)/(u(t)*u(n));if(c<.9999)s=S(c);else{let e=u(v(b(),t,n))/(u(t)*u(n));s=ae(e)}let l=Math.cos(ie(e.normalize(x(o)),0,A));s=-s-Math.max(0,u(n)-a)/(l*a)}else f(qe,i.eye,i.center),v(r,Y,qe),s=-u(Y)/a;return p(r,r),y(r,r,u(Z)),s}const qe=b();function P(t,n,r,i){let a,o,s=Math.cos(ie(e.normalize(x(i)),0,A));return a=n>r?-(n-r)/(s*r):n<-r?Math.PI-(n+r)/(s*r):S(n/r),o=t>r?-(t-r)/(s*r):t<-r?Math.PI-(t+r)/(s*r):S(t/r),(o-a)*r}function Je(e,t,n,r,i,a,o,c,l,u){let f=P(e[2],t[2],a.radius,c),m=l?P(e[0],t[0],a.radius,180):t[0]-e[0],h=Math.sin(o)*m-Math.cos(o)*f,g=Math.cos(o)*m+Math.sin(o)*f;p(J,i);let _=l?h/Math.sqrt(Math.abs(a.radius**2-d(n,J)**2)):h/a.radius,ee=g/Math.sqrt(Math.abs(a.radius**2-d(n,r)**2));s(u,_,ee)}function Ye(e,t,n,r,i,a,o,s,c,l){v(Z,e,t),C(a.up,a.eye,B,V,H),C([0,0,1],a.eye,R,z,ot),h(n,z),h(r,R),p(n,n),y(n,n,u(Z)),de(e,p(V,V),p(H,H),p(B,B),st),de(t,V,H,B,ct),Je(st,ct,e,R,z,o,s,c,l,i)}function Xe(e,t,n,i,o,s,c){r(W,o,i),r(G,c,s),a(K,W,G),f(t,e,n),g(t,t,K),_(t,t,n)}function Ze(e,t,n,i,o,s){r(W,i,n),r(G,s,o),a(K,W,G),f(J,e.eye,t),g(J,J,K),e.eye=_(J,J,t),f(J,e.center,t),g(J,J,K),e.center=_(J,J,t),f(J,e.up,t),g(J,J,K),e.up=_(J,J,t)}const F={Pole:.95,Angle:x(18),Tilt:45,TiltHysteresisMargin:1e-7};let I=!1;function L(e,t,n,r,i,a){let o=Math.abs(r)>Math.PI-F.Angle||Math.abs(r)<F.Angle,s=(Math.abs(e[2])<n*F.Pole||Math.abs(t)>n)&&a;return o&&s?!I&&i<F.Tilt-F.TiltHysteresisMargin?I=!0:I&&i>F.Tilt+F.TiltHysteresisMargin&&(I=!1):I=!1,I}function Qe(e,t,n,r,i,a){if(a)le(n,r,lt),O(t,e.center,lt);else{let a=Ke(n,r,ut,t,e.radius,i);O(t,e.center,ue(ut,a))}}function $e(e,t,n,r,i,a,o){let s=o?20:1;h(q,r),X.copyFrom(t);let c,l;for(let r=0;r<s&&m(n,q)>1e-12&&(c=m(n,q),Ye(n,q,z,R,U,X,e,i,a,o),Ze(X,e.center,R,U[1],z,U[0]),Xe(q,q,e.center,R,U[1],z,U[0]),l=m(n,q),l<c||r===0);r++)t.copyFrom(X)}function et(t,n,r,i,a,o,s){L(r,d(n.up,r),t.radius,-e.normalize(x(a)),o,n.aboveGround)?$e(t,n,r,i,-e.normalize(x(a)),o,s):Qe(t,n,r,i,o,s)}function tt(e,t,n,r,i,a){let{eye:s}=e;C([0,0,1],s,R,z,ot);let c=t.translation[0]*n.pan,l=i.mode===`zoom`?0:t.translation[1]*n.pan,f=Math.max(Math.sqrt(Math.abs(1-d(e.center,R)**2/u(e.center)**2)),.5),p=(Math.sin(a)*l+Math.cos(a)*c)/f,m=-Math.cos(a)*l+Math.sin(a)*c;switch(o(r.pan.matrix,r.pan.matrix,p,R),r.pan.enabled=!0,i.mode){case`pan`:o(r.pan.matrix,r.pan.matrix,m,z),r.pan.enabled=!0;break;case`zoom`:r.zoom=-t.translation[1]*n.zoom}}function nt(e,t,n,r,i){let{eye:a,viewRight:s}=e,c=v(T.get(),s,a),l=t.translation[0]*n.pan;switch(l!==0&&(o(r.pan.matrix,r.pan.matrix,-l,c),r.pan.enabled=!0),i.mode){case`pan`:{let e=t.translation[1]*n.pan;e!==0&&(o(r.pan.matrix,r.pan.matrix,e,s),r.pan.enabled=!0);break}case`zoom`:r.zoom=-t.translation[1]*n.zoom}}function rt(t,n,r,i,a,o,s,c,l){L(t.center,d(t.up,t.center),u(t.center),-e.normalize(x(o)),s,n.aboveGround)?tt(n,r,i,c,l,-e.normalize(x(a))):nt(n,r,i,c,l)}function it(e,t,n=1/0){let r=Math.abs(d(e,t));return Math.min(n,1/r)}function at(e,t,n){let r=ee(e,t),i=u(e);return r<Math.max(i,n)}const R=b(),z=b(),ot=b(),B=b(),V=b(),H=b(),st=b(),ct=b(),U=c(),lt=se(),W=n(),G=n(),K=n(),q=b(),J=b(),Y=b();let X=new be;const Z=b(),ut=b();function dt(){X=new be}const Q={origin:b(),direction:b()},$={origin:b(),direction:b()};export{A as TiltThresholdPanningSpeed,k as VerticalPanTresholds,Ue as applyPanPlanar,Qe as applyPanSphericalDirectRotation,$e as applyPanSphericalPreserveHeading,O as applyRotation,Ze as applyRotationWithTwoAxes,Ie as applyZoomOnSphere,Fe as applyZoomToPoint,Re as centroid,dt as cleanupNavigationUtils,D as distanceComparisonTolerance,Ae as excludeTerrain,it as getTiltScaleFactor,He as inferNavigationMode,Ne as intersectPlaneFromScreenPoint,Pe as intersectPlaneFromScreenPointAtEye,at as isHitOnSamePlanetSide,P as lengthFromPoints,Te as maxPanDistanceModifier,De as maxRotatePivotDistanceModifier,xe as maxZoomPivotDistanceModifier,Ce as maxZoomStepDistanceModifier,Ee as minPinchAndPanCameraHeight,Oe as minRotatePivotDistance,je as normalizeCoordinate,Me as normalizeRotationDelta,Be as offSurfaceTiltToEyeTiltGlobal,ze as onSurfaceTiltToEyeTiltGlobal,rt as panMotionToRotationMatrix,et as panToPosition,Ve as pickPointAndInitSphere,F as preservingHeadingThresholds,Xe as rotatePointAroundTwoAxes,Ke as rotationAngleAndAxisDirectRotation,Ye as rotationAnglesAndAxesHeadingPreserving,Je as rotationAnglesHeadingPreserving,ke as searchAreaSize,L as shouldPreserveHeading,We as sphereOrPlanePointFromScreenPoint,Se as zoomPivotDistanceClamp,we as zoomStepDistanceClamp};
2
+ import{cyclicalPI as e}from"../../../../core/Cyclical.js";import{IDENTITY as t,create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromRotation as r,exactEquals as i,multiply as a,rotate as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as l,length as u,dot as d,subtract as f,normalize as p,squaredDistance as m,copy as h,transformMat4 as g,add as _,distance as ee,cross as v,scale as y,lerp as te,set as ne}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as re,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{deg2rad as x,clamp as ie,acosClamped as S,asinClamped as ae}from"../../../../core/mathUtils.js";import{createScreenPointArray as oe}from"../../../../core/screenUtils.js";import{create as se,axis as ce,fromPoints as le,wrapAxisAngle as ue}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as C,vectorCoordinates as de}from"../../../../geometry/support/coordinateSystem.js";import{create as fe,fromNormalAndOffset as pe,intersectRay as w}from"../../../../geometry/support/plane.js";import{Sphere as me}from"../../../../geometry/support/sphere.js";import{sm4d as he,sv3d as T}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as E,fromScreen as ge}from"../../support/geometryUtils/ray.js";import{intersectScreen as _e}from"../../support/geometryUtils/sphere.js";import{Intersector as ve}from"../../webgl-engine/lib/Intersector.js";import{terrainId as ye}from"../../webgl-engine/lib/verticalOffsetUtils.js";import be from"../../webgl/RenderCamera.js";const xe=30,Se=[1,3e8],Ce=8,we=[200,1508e5],Te=5,Ee=50,De=5,Oe=10,ke=90,D=1e-6,Ae={exclude:new Set([ye])};function je(e,t,n){return n[0]=t[0]/(e.fullWidth/e.pixelRatio),n[1]=t[1]/(e.fullHeight/e.pixelRatio),n}function Me(e){for(;e>Math.PI;)e-=2*Math.PI;for(;e<-Math.PI;)e+=2*Math.PI;return e}function O(e,n,a){let o=r(he.get(),a[3],ce(a));o==null||i(o,t)||(f(J,e.eye,n),g(J,J,o),e.eye=_(J,J,n),f(J,e.center,n),g(J,J,o),e.center=_(J,J,n),e.up=g(J,e.up,o))}function Ne(e,t,n,r){return w(e,ge(t,n,Q),r)}function Pe(e,t,n,r){return w(e,E(t,n,Q),r)}function Fe(e,t,n,r){let i=T.get(),a=1-n;f(i,t,e.eye);let o=u(i),s=o*(1-a);a>=0&&s<r&&(s=r,a=-(s-o)/o),Math.abs(o-s)<D||(y(i,i,a),e.eye=_(J,e.eye,i),e.center=te(J,e.center,t,a))}function Ie(e,t,n){t.getScreenCenter(Le),_e(e,t,Le,J)&&(t.center=J);let r=t.distance,i=r*n;if(Math.abs(r-i)<D)return;let a=y(T.get(),t.viewForward,i);t.eye=f(J,t.center,a)}const Le=oe();function Re(e,t){ne(t,0,0,0);for(let n of e)_(t,t,n);y(t,t,1/e.length)}function ze(e,t,n,r){return Math.sin(e/u(t))*(n+r.radius)}function Be(e,t,n,r){return ze(Math.PI/2,t,n,r)+(e-Math.PI/2)}const k={Elevation:3e4,Angle:x(16)},A=x(80);function Ve(e,t,n,r,i,a){let o=e.sceneIntersectionHelper,s=new ve(e.state.isGlobal);s.options.selectionMode=!1,s.options.store=0,s.options.hud=!1,s.options.normalRequired=!0;let c=null,d=b(),f=new me,p=!0,m=!0,{eye:h}=t;o.intersectIntersectorScreen(n,s,a);let g=s.results.min;return g.getIntersectionPoint(d)&&!l(h,d)&&at(h,d,r)?(c=re(g.normal),f.radius=u(d)):(m=!1,f.radius=!t.aboveGround||i===0?u(t.eye)-t.relativeElevation:Math.max(u(t.center),.9*r),i===1?We(f,t,n,d):p=_e(f,t,n,d)),{sphere:f,scenePickPoint:p?d:null,hasGeometryIntersection:m,intersectorType:g.intersector,normal:c}}function He(e,t,n,r){let i=e.relativeElevation;if(i>k.Elevation&&r===`global`)return 1;E(e,t,$);let a=Math.sign(i),o=n.worldUpAtPosition(e.eye,J);return-a*d(o,$.direction)<Math.sin(k.Angle)*u($.direction)?0:1}function Ue(e,t,n){f(j,n,t),e.eye=f(J,e.eye,j),e.center=f(J,e.center,j)}const j=b();function We(e,t,n,r){let i=E(t,n,Q);return i!=null&&(e.closestPointOnSilhouette(i,M),e.intersectRay(i,r)?m(M,i.origin)<m(r,i.origin)?(h(r,M),!1):!0:(f(N,t.eye,t.center),p(N,N),pe(N,-d(p(N,N),M),Ge),w(Ge,i,r),!1))}const M=b(),N=b(),Ge=fe();function Ke(t,n,r,i,a,o){let s=0;if(v(Z,t,n),f(Y,t,n),u(t)<=a||!i.aboveGround){v(r,Y,i.eye);let c=d(t,n)/(u(t)*u(n));if(c<.9999)s=S(c);else{let e=u(v(b(),t,n))/(u(t)*u(n));s=ae(e)}let l=Math.cos(ie(e.normalize(x(o)),0,A));s=-s-Math.max(0,u(n)-a)/(l*a)}else f(qe,i.eye,i.center),v(r,Y,qe),s=-u(Y)/a;return p(r,r),y(r,r,u(Z)),s}const qe=b();function P(t,n,r,i){let a,o,s=Math.cos(ie(e.normalize(x(i)),0,A));return a=n>r?-(n-r)/(s*r):n<-r?Math.PI-(n+r)/(s*r):S(n/r),o=t>r?-(t-r)/(s*r):t<-r?Math.PI-(t+r)/(s*r):S(t/r),(o-a)*r}function Je(e,t,n,r,i,a,o,c,l,u){let f=P(e[2],t[2],a.radius,c),m=l?P(e[0],t[0],a.radius,180):t[0]-e[0],h=Math.sin(o)*m-Math.cos(o)*f,g=Math.cos(o)*m+Math.sin(o)*f;p(J,i);let _=l?h/Math.sqrt(Math.abs(a.radius**2-d(n,J)**2)):h/a.radius,ee=g/Math.sqrt(Math.abs(a.radius**2-d(n,r)**2));s(u,_,ee)}function Ye(e,t,n,r,i,a,o,s,c,l){v(Z,e,t),C(a.up,a.eye,B,V,H),C([0,0,1],a.eye,R,z,ot),h(n,z),h(r,R),p(n,n),y(n,n,u(Z)),de(e,p(V,V),p(H,H),p(B,B),st),de(t,V,H,B,ct),Je(st,ct,e,R,z,o,s,c,l,i)}function Xe(e,t,n,i,o,s,c){r(W,o,i),r(G,c,s),a(K,W,G),f(t,e,n),g(t,t,K),_(t,t,n)}function Ze(e,t,n,i,o,s){r(W,i,n),r(G,s,o),a(K,W,G),f(J,e.eye,t),g(J,J,K),e.eye=_(J,J,t),f(J,e.center,t),g(J,J,K),e.center=_(J,J,t),f(J,e.up,t),g(J,J,K),e.up=_(J,J,t)}const F={Pole:.95,Angle:x(18),Tilt:45,TiltHysteresisMargin:1e-7};let I=!1;function L(e,t,n,r,i,a){let o=Math.abs(r)>Math.PI-F.Angle||Math.abs(r)<F.Angle,s=(Math.abs(e[2])<n*F.Pole||Math.abs(t)>n)&&a;return o&&s?!I&&i<F.Tilt-F.TiltHysteresisMargin?I=!0:I&&i>F.Tilt+F.TiltHysteresisMargin&&(I=!1):I=!1,I}function Qe(e,t,n,r,i,a){if(a)le(n,r,lt),O(t,e.center,lt);else{let a=Ke(n,r,ut,t,e.radius,i);O(t,e.center,ue(ut,a))}}function $e(e,t,n,r,i,a,o){let s=o?20:1;h(q,r),X.copyFrom(t);let c,l;for(let r=0;r<s&&m(n,q)>1e-12&&(c=m(n,q),Ye(n,q,z,R,U,X,e,i,a,o),Ze(X,e.center,R,U[1],z,U[0]),Xe(q,q,e.center,R,U[1],z,U[0]),l=m(n,q),l<c||r===0);r++)t.copyFrom(X)}function et(t,n,r,i,a,o,s){L(r,d(n.up,r),t.radius,-e.normalize(x(a)),o,n.aboveGround)?$e(t,n,r,i,-e.normalize(x(a)),o,s):Qe(t,n,r,i,o,s)}function tt(e,t,n,r,i,a){let{eye:s}=e;C([0,0,1],s,R,z,ot);let c=t.translation[0]*n.pan,l=i.mode===`zoom`?0:t.translation[1]*n.pan,f=Math.max(Math.sqrt(Math.abs(1-d(e.center,R)**2/u(e.center)**2)),.5),p=(Math.sin(a)*l+Math.cos(a)*c)/f,m=-Math.cos(a)*l+Math.sin(a)*c;switch(o(r.pan.matrix,r.pan.matrix,p,R),r.pan.enabled=!0,i.mode){case`pan`:o(r.pan.matrix,r.pan.matrix,m,z),r.pan.enabled=!0;break;case`zoom`:r.zoom=-t.translation[1]*n.zoom}}function nt(e,t,n,r,i){let{eye:a,viewRight:s}=e,c=v(T.get(),s,a),l=t.translation[0]*n.pan;switch(l!==0&&(o(r.pan.matrix,r.pan.matrix,-l,c),r.pan.enabled=!0),i.mode){case`pan`:{let e=t.translation[1]*n.pan;e!==0&&(o(r.pan.matrix,r.pan.matrix,e,s),r.pan.enabled=!0);break}case`zoom`:r.zoom=-t.translation[1]*n.zoom}}function rt(t,n,r,i,a,o,s,c,l){L(t.center,d(t.up,t.center),u(t.center),-e.normalize(x(o)),s,n.aboveGround)?tt(n,r,i,c,l,-e.normalize(x(a))):nt(n,r,i,c,l)}function it(e,t,n=1/0){let r=Math.abs(d(e,t));return Math.min(n,1/r)}function at(e,t,n){let r=ee(e,t),i=u(e);return r<Math.max(i,n)}const R=b(),z=b(),ot=b(),B=b(),V=b(),H=b(),st=b(),ct=b(),U=c(),lt=se(),W=n(),G=n(),K=n(),q=b(),J=b(),Y=b();let X=new be;const Z=b(),ut=b();function dt(){X=new be}const Q={origin:b(),direction:b()},$={origin:b(),direction:b()};export{A as TiltThresholdPanningSpeed,k as VerticalPanTresholds,Ue as applyPanPlanar,Qe as applyPanSphericalDirectRotation,$e as applyPanSphericalPreserveHeading,O as applyRotation,Ze as applyRotationWithTwoAxes,Ie as applyZoomOnSphere,Fe as applyZoomToPoint,Re as centroid,dt as cleanupNavigationUtils,D as distanceComparisonTolerance,Ae as excludeTerrain,it as getTiltScaleFactor,He as inferNavigationMode,Ne as intersectPlaneFromScreenPoint,Pe as intersectPlaneFromScreenPointAtEye,at as isHitOnSamePlanetSide,P as lengthFromPoints,Te as maxPanDistanceModifier,De as maxRotatePivotDistanceModifier,xe as maxZoomPivotDistanceModifier,Ce as maxZoomStepDistanceModifier,Ee as minPinchAndPanCameraHeight,Oe as minRotatePivotDistance,je as normalizeCoordinate,Me as normalizeRotationDelta,Be as offSurfaceTiltToEyeTiltGlobal,ze as onSurfaceTiltToEyeTiltGlobal,rt as panMotionToRotationMatrix,et as panToPosition,Ve as pickPointAndInitSphere,F as preservingHeadingThresholds,Xe as rotatePointAroundTwoAxes,Ke as rotationAngleAndAxisDirectRotation,Ye as rotationAnglesAndAxesHeadingPreserving,Je as rotationAnglesHeadingPreserving,ke as searchAreaSize,L as shouldPreserveHeading,We as sphereOrPlanePointFromScreenPoint,Se as zoomPivotDistanceClamp,we as zoomStepDistanceClamp};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{invert as e}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{add as n,scale as r,direction as i,transformMat4 as a,set as o,dot as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lerp as l}from"../../../core/mathUtils.js";import{getReferenceEllipsoid as u}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as d}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as f}from"../../../geometry/projection/projectBoundingRect.js";import{projectVectorToVector as p}from"../../../geometry/projection/projectVectorToVector.js";import{empty as m,expandWithVec3 as h,create as g}from"../../../geometry/support/aaBoundingBox.js";import{center as _,create as v}from"../../../geometry/support/aaBoundingRect.js";import{fromPoints as y,create as b}from"../../../geometry/support/lineSegment.js";import{create as x,fromVectorsAndPoint as S,copy as C,negate as w,signedDistance as T}from"../../../geometry/support/plane.js";import{wrap as E}from"../../../geometry/support/ray.js";import{frustumLineSegment as D}from"./intersectionUtils.js";const O=.5*Math.PI,k=O/Math.PI*180;class A{constructor(e){this._extent=[,,,,],this._planes=[,,,,,,],this._maxSpan=0,this._center={origin:c(),direction:c()},this._renderCoordsHelper=e.renderCoordsHelper;for(let e=0;e<4;e++)this._extent[e]={origin:c(),direction:c(),cap:{next:null,direction:c()}},this._planes[e]=x();this._planes[4]=x(),this._planes[5]=x(),this._planesWithoutFar=this._planes.slice(0,5)}update(e,t,a,o=!0){let s=this._extent;this._toRenderBoundingExtent(e,t,a),n(this._center.origin,s[0].origin,s[2].origin),r(this._center.origin,this._center.origin,.5),this._renderCoordsHelper.worldUpAtPosition(this._center.origin,this._center.direction),o||r(this._center.direction,this._center.direction,-1);for(let e=0;e<4;e++){let t=s[e];this._renderCoordsHelper.worldUpAtPosition(t.origin,t.direction);let n=s[e===3?0:e+1];t.cap.next=n.origin,i(t.cap.direction,t.origin,n.origin),S(t.direction,t.cap.direction,t.origin,this._planes[e]),o||r(t.direction,t.direction,-1)}S(s[0].cap.direction,s[1].cap.direction,s[0].origin,this._planes[4]),o?w(this._planes[4],this._planes[5]):(C(this._planes[5],this._planes[4]),w(this._planes[4],this._planes[4])),this._maxSpan=Math.max(Math.abs(e[0]-e[2]),Math.abs(e[1]-e[3])),this._maxSpanSpatialReference=t,this._minGlobalAltitude=.9*u(this._maxSpanSpatialReference).radius}isVisibleInFrustum(e,t,n=!1){if(e==null)return!1;if(this._renderCoordsHelper.viewingMode===1){let n=this._maxSpanSpatialReference.isGeographic?k:O*t;if(this._maxSpan>n)return!0;if(e.altitude!=null&&e.altitude>=this._minGlobalAltitude)return this._isVisibleInFrustumGlobal(e)}if(this._maxSpan===0){let t=this._extent[0];return!(n||!e.intersectsRay(E(t.origin,t.direction)))}for(let t=0;t<this._extent.length;t++){let r=this._extent[t];if(!n&&e.intersectsRay(E(r.origin,r.direction))||e.intersectsLineSegment(y(r.origin,r.cap.next,L),r.cap.direction))return!0}let r=n?this._planes:this._planesWithoutFar;for(let t=0;t<e.lines.length;t++){let n=e.lines[t];if(D(r,n.origin,n.endpoint,n.direction))return!0}return!1}_toRenderBoundingExtentGlobal(t,n,r){_(t,M),M[2]=r,d(n,M,N,this._renderCoordsHelper.spatialReference),e(P,N),m(F);for(let{x0:e,x1:i,y0:o,y1:s}of j)for(let c=0;c<5;c++){let u=c/4;M[0]=l(t[e],t[i],u),M[1]=l(t[o],t[s],u),M[2]=r,p(M,n,M,this._renderCoordsHelper.spatialReference),a(M,M,P),h(F,M)}o(this._extent[0].origin,F[0],F[1],F[2]),o(this._extent[1].origin,F[3],F[1],F[2]),o(this._extent[2].origin,F[3],F[4],F[2]),o(this._extent[3].origin,F[0],F[4],F[2]);for(let e=0;e<4;++e)a(this._extent[e].origin,this._extent[e].origin,N)}_toRenderBoundingExtentLocal(e,t,n){f(e,t,I,this._renderCoordsHelper.spatialReference),o(this._extent[0].origin,I[0],I[1],n),o(this._extent[1].origin,I[2],I[1],n),o(this._extent[2].origin,I[2],I[3],n),o(this._extent[3].origin,I[0],I[3],n)}_toRenderBoundingExtent(e,t,n){switch(this._renderCoordsHelper.viewingMode){case 1:this._toRenderBoundingExtentGlobal(e,t,n);break;case 2:this._toRenderBoundingExtentLocal(e,t,n);break;default:this._renderCoordsHelper.viewingMode}}_isVisibleInFrustumGlobal(e){if(T(e.planes[4],this._center.origin)<0&&s(this._center.direction,e.direction)<0)return!0;for(let t=0;t<4;t++){let n=this._extent[t];if(T(e.planes[4],n.origin)<0&&s(n.direction,e.direction)<0)return!0}return!1}}const j=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],M=c(),N=t(),P=t(),F=g(),I=v(),L=b();export{A as FrustumExtentIntersection};
2
+ import{invert as e}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{add as n,scale as r,direction as i,transformMat4 as a,set as o,dot as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lerp as l}from"../../../core/mathUtils.js";import{getReferenceEllipsoid as u}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as d}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as f}from"../../../geometry/projection/projectBoundingRect.js";import{projectVectorToVector as p}from"../../../geometry/projection/projectVectorToVector.js";import{empty as m,expandWithVec3 as h,create as g}from"../../../geometry/support/aaBoundingBox.js";import{center as _,create as v}from"../../../geometry/support/aaBoundingRect.js";import{fromPoints as y,create as b}from"../../../geometry/support/lineSegment.js";import{create as x,fromVectorsAndPoint as S,copy as C,negate as w,signedDistance as T}from"../../../geometry/support/plane.js";import{wrap as E}from"../../../geometry/support/ray.js";import{frustumLineSegment as D}from"./intersectionUtils.js";const O=.5*Math.PI,k=O/Math.PI*180;class A{constructor(e){this._extent=[,,,,],this._planes=[,,,,,,],this._maxSpan=0,this._center={origin:c(),direction:c()},this._renderCoordsHelper=e.renderCoordsHelper;for(let e=0;e<4;e++)this._extent[e]={origin:c(),direction:c(),cap:{next:null,direction:c()}},this._planes[e]=x();this._planes[4]=x(),this._planes[5]=x(),this._planesWithoutFar=this._planes.slice(0,5)}update(e,t,a,o=!0){let s=this._extent;this._toRenderBoundingExtent(e,t,a),n(this._center.origin,s[0].origin,s[2].origin),r(this._center.origin,this._center.origin,.5),this._renderCoordsHelper.worldUpAtPosition(this._center.origin,this._center.direction),o||r(this._center.direction,this._center.direction,-1);for(let e=0;e<4;e++){let t=s[e];this._renderCoordsHelper.worldUpAtPosition(t.origin,t.direction);let n=s[e===3?0:e+1];t.cap.next=n.origin,i(t.cap.direction,t.origin,n.origin),S(t.direction,t.cap.direction,t.origin,this._planes[e]),o||r(t.direction,t.direction,-1)}S(s[0].cap.direction,s[1].cap.direction,s[0].origin,this._planes[4]),o?w(this._planes[4],this._planes[5]):(C(this._planes[5],this._planes[4]),w(this._planes[4],this._planes[4])),this._maxSpan=Math.max(Math.abs(e[0]-e[2]),Math.abs(e[1]-e[3])),this._maxSpanSpatialReference=t,this._minGlobalAltitude=.9*u(this._maxSpanSpatialReference).radius}isVisibleInFrustum(e,t,n=!1){if(e==null)return!1;if(this._renderCoordsHelper.isGlobal){let n=this._maxSpanSpatialReference.isGeographic?k:O*t;if(this._maxSpan>n)return!0;if(e.altitude!=null&&e.altitude>=this._minGlobalAltitude)return this._isVisibleInFrustumGlobal(e)}if(this._maxSpan===0){let t=this._extent[0];return!(n||!e.intersectsRay(E(t.origin,t.direction)))}for(let t=0;t<this._extent.length;t++){let r=this._extent[t];if(!n&&e.intersectsRay(E(r.origin,r.direction))||e.intersectsLineSegment(y(r.origin,r.cap.next,L),r.cap.direction))return!0}let r=n?this._planes:this._planesWithoutFar;for(let t=0;t<e.lines.length;t++){let n=e.lines[t];if(D(r,n.origin,n.endpoint,n.direction))return!0}return!1}_toRenderBoundingExtentGlobal(t,n,r){_(t,M),M[2]=r,d(n,M,N,this._renderCoordsHelper.spatialReference),e(P,N),m(F);for(let{x0:e,x1:i,y0:o,y1:s}of j)for(let c=0;c<5;c++){let u=c/4;M[0]=l(t[e],t[i],u),M[1]=l(t[o],t[s],u),M[2]=r,p(M,n,M,this._renderCoordsHelper.spatialReference),a(M,M,P),h(F,M)}o(this._extent[0].origin,F[0],F[1],F[2]),o(this._extent[1].origin,F[3],F[1],F[2]),o(this._extent[2].origin,F[3],F[4],F[2]),o(this._extent[3].origin,F[0],F[4],F[2]);for(let e=0;e<4;++e)a(this._extent[e].origin,this._extent[e].origin,N)}_toRenderBoundingExtentLocal(e,t,n){f(e,t,I,this._renderCoordsHelper.spatialReference),o(this._extent[0].origin,I[0],I[1],n),o(this._extent[1].origin,I[2],I[1],n),o(this._extent[2].origin,I[2],I[3],n),o(this._extent[3].origin,I[0],I[3],n)}_toRenderBoundingExtent(e,t,n){return this._renderCoordsHelper.isGlobal?this._toRenderBoundingExtentGlobal(e,t,n):this._toRenderBoundingExtentLocal(e,t,n)}_isVisibleInFrustumGlobal(e){if(T(e.planes[4],this._center.origin)<0&&s(this._center.direction,e.direction)<0)return!0;for(let t=0;t<4;t++){let n=this._extent[t];if(T(e.planes[4],n.origin)<0&&s(n.direction,e.direction)<0)return!0}return!1}}const j=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],M=c(),N=t(),P=t(),F=g(),I=v(),L=b();export{A as FrustumExtentIntersection};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{set as i}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as a,copy as o}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{rad2deg as c}from"../../../core/mathUtils.js";import{watch as l,syncAndInitial as u}from"../../../core/reactiveUtils.js";import{getMetersPerCartesianUnitForSR as d,getMetersPerUnitForSR as f}from"../../../core/units.js";import{getReferenceEllipsoid as p}from"../../../geometry/ellipsoidUtils.js";import{projectPointToVector as m}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as h}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as g}from"../../../geometry/projection/projectVectorToVector.js";import _ from"../../../geometry/SpatialReference.js";import{getSphericalPCPF as v}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{create as y}from"../../../geometry/support/aaBoundingRect.js";import{GlobalCoordinateSystem as b}from"../../../geometry/support/GlobalCoordinateSystem.js";import{LocalCoordinateSystem as x}from"../../../geometry/support/LocalCoordinateSystem.js";import{intersectRay as S}from"../../../geometry/support/plane.js";import{angleAroundAxis as C}from"../../../geometry/support/vector.js";import{sv3d as w}from"../../../geometry/support/vectorStacks.js";import{isDehydratedPoint as T}from"../../../layers/graphics/dehydratedFeatureUtils.js";let E=class extends t{constructor(e){super(e),this.viewingMode=2,this.spatialReference=_.WebMercator,this._coordinateSystem=new x,this._tmpCoordinateSystem=this._coordinateSystem.clone(),this.addHandles(l(()=>[this.viewingMode,this.spatialReference],([e,t])=>this._setup(e,t),u))}_setup(e,t){this._coordinateSystem=e===2?new x:new b(t),this._tmpCoordinateSystem=this._coordinateSystem.clone()}set extent(e){this._coordinateSystem.setExtent(e)}get extent(){return this._coordinateSystem.getExtent(y())}getAltitude(e){return this._coordinateSystem.altitudeAt(e)}setAltitude(e,t,n=e){return this._coordinateSystem.setAltitudeAt(n,t,e),e}setAltitudeOfTransformation(e,t){a(D,t[12],t[13],t[14]),this._coordinateSystem.setAltitudeAt(D,e,D),t[12]=D[0],t[13]=D[1],t[14]=D[2]}worldUpAtPosition(e,t){return this._coordinateSystem.worldBasisAtPosition(e,2,t),t}worldBasisAtPosition(e,t,n){return this._coordinateSystem.worldBasisAtPosition(e,t,n),n}basisMatrixAtPosition(e,t){let n=this.worldBasisAtPosition(e,0,w.get()),r=this.worldBasisAtPosition(e,1,w.get()),a=this.worldBasisAtPosition(e,2,w.get());return i(t,n[0],n[1],n[2],0,r[0],r[1],r[2],0,a[0],a[1],a[2],0,0,0,0,1),t}headingAtPosition(e,t){let n=this.worldUpAtPosition(e,w.get()),r=this.worldBasisAtPosition(e,1,w.get()),i=C(t,r,n);return c(i)}intersectManifoldClosestSilhouette(e,t,n){return this._coordinateSystem.elevate(t,this._tmpCoordinateSystem),this._tmpCoordinateSystem.intersectRayClosestSilhouette(e,n),n}intersectManifold(e,t,n){this._coordinateSystem.elevate(t,this._tmpCoordinateSystem);let r=w.get();return this._tmpCoordinateSystem.intersectRay(e,r)?o(n,r):null}intersectInfiniteManifold(e,t,n){if(this.viewingMode===1)return this.intersectManifold(e,t,n);this._coordinateSystem.elevate(t,this._tmpCoordinateSystem);let r=this._tmpCoordinateSystem.plane,i=w.get();return S(r,e,i)?o(n,i):null}toRenderCoords(e,t,n){return T(e)?m(e,t,this.spatialReference):g(e,t,n,this.spatialReference)}fromRenderCoords(e,t,n=null){return T(t)?(n!=null&&(t.spatialReference=n),h(e,this.spatialReference,t)?t:null):g(e,this.spatialReference,t,n)?t:null}static renderUnitScaleFactor(e,t){return d(e)/d(t)}get unitInMeters(){return f(this.spatialReference)}get referenceEllipsoid(){return p(this.spatialReference)}get sphericalPCPF(){return v(this.spatialReference)}};e([n()],E.prototype,`unitInMeters`,null),e([n()],E.prototype,`referenceEllipsoid`,null),e([n()],E.prototype,`sphericalPCPF`,null),e([n()],E.prototype,`viewingMode`,void 0),e([n()],E.prototype,`spatialReference`,void 0),E=e([r(`esri.views.3d.support.RenderCoordsHelper`)],E);const D=s();export{E as RenderCoordsHelper};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{set as i}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as a,copy as o}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{rad2deg as c}from"../../../core/mathUtils.js";import{watch as l,syncAndInitial as u}from"../../../core/reactiveUtils.js";import{getMetersPerCartesianUnitForSR as d,getMetersPerUnitForSR as f}from"../../../core/units.js";import{getReferenceEllipsoid as p}from"../../../geometry/ellipsoidUtils.js";import{projectPointToVector as m}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as h}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as g}from"../../../geometry/projection/projectVectorToVector.js";import _ from"../../../geometry/SpatialReference.js";import{getSphericalPCPF as v}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{create as y}from"../../../geometry/support/aaBoundingRect.js";import{GlobalCoordinateSystem as b}from"../../../geometry/support/GlobalCoordinateSystem.js";import{LocalCoordinateSystem as x}from"../../../geometry/support/LocalCoordinateSystem.js";import{intersectRay as S}from"../../../geometry/support/plane.js";import{angleAroundAxis as C}from"../../../geometry/support/vector.js";import{sv3d as w}from"../../../geometry/support/vectorStacks.js";import{isDehydratedPoint as T}from"../../../layers/graphics/dehydratedFeatureUtils.js";let E=class extends t{constructor(e){super(e),this.isGlobal=!1,this.spatialReference=_.WebMercator,this._coordinateSystem=new x,this._tmpCoordinateSystem=this._coordinateSystem.clone(),this.addHandles(l(()=>[this.isGlobal,this.spatialReference],([e,t])=>this._setup(e,t),u))}_setup(e,t){this._coordinateSystem=e?new b(t):new x,this._tmpCoordinateSystem=this._coordinateSystem.clone()}set extent(e){this._coordinateSystem.setExtent(e)}get extent(){return this._coordinateSystem.getExtent(y())}getAltitude(e){return this._coordinateSystem.altitudeAt(e)}setAltitude(e,t,n=e){return this._coordinateSystem.setAltitudeAt(n,t,e),e}setAltitudeOfTransformation(e,t){a(D,t[12],t[13],t[14]),this._coordinateSystem.setAltitudeAt(D,e,D),t[12]=D[0],t[13]=D[1],t[14]=D[2]}worldUpAtPosition(e,t){return this._coordinateSystem.worldBasisAtPosition(e,2,t),t}worldBasisAtPosition(e,t,n){return this._coordinateSystem.worldBasisAtPosition(e,t,n),n}basisMatrixAtPosition(e,t){let n=this.worldBasisAtPosition(e,0,w.get()),r=this.worldBasisAtPosition(e,1,w.get()),a=this.worldBasisAtPosition(e,2,w.get());return i(t,n[0],n[1],n[2],0,r[0],r[1],r[2],0,a[0],a[1],a[2],0,0,0,0,1),t}headingAtPosition(e,t){let n=this.worldUpAtPosition(e,w.get()),r=this.worldBasisAtPosition(e,1,w.get()),i=C(t,r,n);return c(i)}intersectManifoldClosestSilhouette(e,t,n){return this._coordinateSystem.elevate(t,this._tmpCoordinateSystem),this._tmpCoordinateSystem.intersectRayClosestSilhouette(e,n),n}intersectManifold(e,t,n){this._coordinateSystem.elevate(t,this._tmpCoordinateSystem);let r=w.get();return this._tmpCoordinateSystem.intersectRay(e,r)?o(n,r):null}intersectInfiniteManifold(e,t,n){if(this.isGlobal)return this.intersectManifold(e,t,n);this._coordinateSystem.elevate(t,this._tmpCoordinateSystem);let r=this._tmpCoordinateSystem.plane,i=w.get();return S(r,e,i)?o(n,i):null}toRenderCoords(e,t,n){return T(e)?m(e,t,this.spatialReference):g(e,t,n,this.spatialReference)}fromRenderCoords(e,t,n=null){return T(t)?(n!=null&&(t.spatialReference=n),h(e,this.spatialReference,t)?t:null):g(e,this.spatialReference,t,n)?t:null}static renderUnitScaleFactor(e,t){return d(e)/d(t)}get unitInMeters(){return f(this.spatialReference)}get referenceEllipsoid(){return p(this.spatialReference)}get sphericalPCPF(){return v(this.spatialReference)}};e([n()],E.prototype,`unitInMeters`,null),e([n()],E.prototype,`referenceEllipsoid`,null),e([n()],E.prototype,`sphericalPCPF`,null),e([n()],E.prototype,`isGlobal`,void 0),e([n()],E.prototype,`spatialReference`,void 0),E=e([r(`esri.views.3d.support.RenderCoordsHelper`)],E);const D=s();export{E as RenderCoordsHelper};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{distance as e,length as t,normalize as n,scale as r,dot as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as a,create as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";function s(e,t,n,a,o){let s=i(e,a);return r(o,e,Math.max(t,Math.min(n,s))),o}function c(e,t,n,r,i){let a=Math.max(t,Math.min(n,r[2]));return i[0]=e[0],i[1]=e[1],i[2]=a,i}class l{constructor(e,t){if(this.lowerCenterHeight=e,this.upperCenterHeight=t,!(e<t))throw Error(`Invalid elevated sphere: ${e}..${t}`)}}class u extends l{constructor(e,i,s){if(super(i,s),this.baseSphere=e,i<=0)throw Error(`Invalid elevated sphere: ${i}..${s}`);let c=t(e.center);this._radialAxis=c===0?a(0,0,1):n(o(),e.center),c===0?(this._surfaceCenter=a(0,0,0),this._surfaceRadius=s+e.radius):(this._surfaceCenter=r(o(),this._radialAxis,s),this._surfaceRadius=e.radius*s/c)}clone(){return new u(this.baseSphere,this.lowerCenterHeight,this.upperCenterHeight)}calculateSurfaceDistanceFromPoint(t){return Math.max(0,e(this._surfaceCenter,t)-this._surfaceRadius)}calculateCenterDistanceFromPoint(t){return this.calculateClosestCenterToPoint(t,p),e(t,p)}calculateClosestCenterToPoint(e,n){return t(this.baseSphere.center)===0?(n[0]=0,n[1]=0,n[2]=0,n):s(this._radialAxis,this.lowerCenterHeight,this.upperCenterHeight,e,n)}}class d extends l{constructor(e,r,i){if(super(r,i),this.baseSphere=e,r<=0)throw Error(`Invalid elevated sphere: ${r}..${i}`);let a=t(e.center),s=e.radius;if(a<=s)throw Error(`Invalid sphere cone: base sphere contains the planet center`);let c=r-a,l=i-a,u=a+s+Math.max(Math.abs(c),Math.abs(l));this._radialAxis=n(o(),e.center);let d=s/a,f=Math.sqrt(1-d**2),p=a+Math.min(c/(1-d),c/f),m=a+Math.max(l/(1+d),l/f);p<=0||p>=m?(this._lowerEnvelopeCenterHeight=r,this._upperEnvelopeCenterHeight=i,this._enclosingSphereRadius=u):(this._lowerEnvelopeCenterHeight=p,this._upperEnvelopeCenterHeight=m,this._enclosingSphereRadius=null)}clone(){return new d(this.baseSphere,this.lowerCenterHeight,this.upperCenterHeight)}calculateSurfaceDistanceFromPoint(n){let a=t(this.baseSphere.center),s=this.baseSphere.radius;if(this._enclosingSphereRadius!=null)return Math.max(0,t(n)-this._enclosingSphereRadius);let c=this._lowerEnvelopeCenterHeight,l=this._upperEnvelopeCenterHeight,u=this._radialAxis,d=s*c/a,f=s*l/a,p=a**2-s**2,m=p/a,h=c/a*m,g=l/a*m,_=i(u,n);if(_<=h-d)return this._calculateCapSphereSurfaceDistance(n,c,d);if(_>=g)return this._calculateCapSphereSurfaceDistance(n,l,f);let v=Math.sqrt(p),y=s*v/a,b=r(o(),u,_),x=e(b,n),S=y*_/m;if(x<=S)return 0;let C=c/a*v,w=l/a*v,T=_/m*v;return T<=C?this._calculateCapSphereSurfaceDistance(n,c,d):T>=w?this._calculateCapSphereSurfaceDistance(n,l,f):(x-S)*m/v}calculateCenterDistanceFromPoint(t){return this.calculateClosestCenterToPoint(t,p),e(t,p)}calculateClosestCenterToPoint(e,n){return t(this.baseSphere.center)===0?(n[0]=0,n[1]=0,n[2]=0,n):s(this._radialAxis,this.lowerCenterHeight,this.upperCenterHeight,e,n)}_calculateCapSphereSurfaceDistance(t,n,i){let a=r(o(),this._radialAxis,n),s=e(a,t);return s<i?0:s-i}}class f extends l{constructor(e,t,n){super(t,n),this.baseSphere=e}clone(){return new f(this.baseSphere,this.lowerCenterHeight,this.upperCenterHeight)}calculateSurfaceDistanceFromPoint(e){let{center:t,radius:n}=this.baseSphere,r=e[2],i=(e[0]-t[0])**2+(e[1]-t[1])**2,{lowerCenterHeight:a,upperCenterHeight:o}=this;return r<=a?Math.max(0,Math.sqrt(i+(r-a)**2)-n):r>=o?Math.max(0,Math.sqrt(i+(r-o)**2)-n):Math.max(0,Math.sqrt(i)-n)}calculateCenterDistanceFromPoint(t){return this.calculateClosestCenterToPoint(t,p),e(t,p)}calculateClosestCenterToPoint(e,t){return c(this.baseSphere.center,this.lowerCenterHeight,this.upperCenterHeight,e,t)}}const p=o();export{u as SphereGlobal,d as SweptSphereConicalVolume,f as SweptSphereCylindricalVolume,l as SweptSphereVolume,s as calculateClosestCenterOnRadialRange,c as calculateClosestCenterOnVerticalRange};
2
+ import{length as e,normalize as t,scale as n,distance as r,dot as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as a,create as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";function s(e,t,r,a,o){let s=i(e,a);return n(o,e,Math.max(t,Math.min(r,s))),o}function c(e,t,n,r,i){let a=Math.max(t,Math.min(n,r[2]));return i[0]=e[0],i[1]=e[1],i[2]=a,i}class l{constructor(e,t){if(this.lowerCenterHeight=e,this.upperCenterHeight=t,!(e<t))throw Error(`Invalid elevated sphere: ${e}..${t}`)}}class u extends l{constructor(r,i,s){if(super(i,s),this.baseSphere=r,i<=0)throw Error(`Invalid elevated sphere: ${i}..${s}`);let c=e(r.center);this._radialAxis=c===0?a(0,0,1):t(o(),r.center),c===0?(this._surfaceCenter=a(0,0,0),this._surfaceRadius=s+r.radius):(this._surfaceCenter=n(o(),this._radialAxis,s),this._surfaceRadius=r.radius*s/c)}clone(){return new u(this.baseSphere,this.lowerCenterHeight,this.upperCenterHeight)}calculateSurfaceDistanceFromPoint(e){return Math.max(0,r(this._surfaceCenter,e)-this._surfaceRadius)}calculateCenterDistanceFromPoint(e){return this.calculateClosestCenterToPoint(e,p),r(e,p)}calculateClosestCenterToPoint(t,n){return e(this.baseSphere.center)===0?(n[0]=0,n[1]=0,n[2]=0,n):s(this._radialAxis,this.lowerCenterHeight,this.upperCenterHeight,t,n)}}class d extends l{constructor(n,r,i){if(super(r,i),this.baseSphere=n,r<=0)throw Error(`Invalid elevated sphere: ${r}..${i}`);let a=e(n.center),s=n.radius;if(a<=s)throw Error(`Invalid sphere cone: base sphere contains the planet center`);let c=r-a,l=i-a,u=a+s+Math.max(Math.abs(c),Math.abs(l));this._radialAxis=t(o(),n.center);let d=s/a,f=Math.sqrt(1-d**2),p=a+Math.min(c/(1-d),c/f),m=a+Math.max(l/(1+d),l/f);p<=0||p>=m?(this._lowerEnvelopeCenterHeight=r,this._upperEnvelopeCenterHeight=i,this._enclosingSphereRadius=u):(this._lowerEnvelopeCenterHeight=p,this._upperEnvelopeCenterHeight=m,this._enclosingSphereRadius=null)}clone(){return new d(this.baseSphere,this.lowerCenterHeight,this.upperCenterHeight)}calculateSurfaceDistanceFromPoint(t){let a=e(this.baseSphere.center),s=this.baseSphere.radius;if(this._enclosingSphereRadius!=null)return Math.max(0,e(t)-this._enclosingSphereRadius);let c=this._lowerEnvelopeCenterHeight,l=this._upperEnvelopeCenterHeight,u=this._radialAxis,d=s*c/a,f=s*l/a,p=a**2-s**2,m=p/a,h=c/a*m,g=l/a*m,_=i(u,t);if(_<=h-d)return this._calculateCapSphereSurfaceDistance(t,c,d);if(_>=g)return this._calculateCapSphereSurfaceDistance(t,l,f);let v=Math.sqrt(p),y=s*v/a,b=n(o(),u,_),x=r(b,t),S=y*_/m;if(x<=S)return 0;let C=c/a*v,w=l/a*v,T=_/m*v;return T<=C?this._calculateCapSphereSurfaceDistance(t,c,d):T>=w?this._calculateCapSphereSurfaceDistance(t,l,f):(x-S)*m/v}calculateCenterDistanceFromPoint(e){return this.calculateClosestCenterToPoint(e,p),r(e,p)}calculateClosestCenterToPoint(t,n){return e(this.baseSphere.center)===0?(n[0]=0,n[1]=0,n[2]=0,n):s(this._radialAxis,this.lowerCenterHeight,this.upperCenterHeight,t,n)}_calculateCapSphereSurfaceDistance(e,t,i){let a=n(o(),this._radialAxis,t),s=r(a,e);return s<i?0:s-i}}class f extends l{constructor(e,t,n){super(t,n),this.baseSphere=e}clone(){return new f(this.baseSphere,this.lowerCenterHeight,this.upperCenterHeight)}calculateSurfaceDistanceFromPoint(e){let{center:t,radius:n}=this.baseSphere,r=e[2],i=(e[0]-t[0])**2+(e[1]-t[1])**2,{lowerCenterHeight:a,upperCenterHeight:o}=this;return r<=a?Math.max(0,Math.sqrt(i+(r-a)**2)-n):r>=o?Math.max(0,Math.sqrt(i+(r-o)**2)-n):Math.max(0,Math.sqrt(i)-n)}calculateCenterDistanceFromPoint(e){return this.calculateClosestCenterToPoint(e,p),r(e,p)}calculateClosestCenterToPoint(e,t){return c(this.baseSphere.center,this.lowerCenterHeight,this.upperCenterHeight,e,t)}}const p=o();export{u as SphereGlobal,d as SweptSphereConicalVolume,f as SweptSphereCylindricalVolume,l as SweptSphereVolume,s as calculateClosestCenterOnRadialRange,c as calculateClosestCenterOnVerticalRange};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../Camera.js";import{copy as t,distance as n,dist as r,length as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a,clone as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../core/Logger.js";import{deg2rad as c,rad2deg as l,asinClamped as u}from"../../../core/mathUtils.js";import{throwIfAborted as d}from"../../../core/promiseUtils.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectPointToVectorAsync as m,projectPointToVector as h}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as g,projectVectorToPoint as _}from"../../../geometry/projection/projectVectorToPoint.js";import{projectAsync as v,project as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{gcsCyclical as x,webMercatorCyclical as S}from"../../../geometry/support/normalizeUtils.js";import{isSpatialReferenceSupported as C}from"../../support/spatialReferenceSupport.js";import{toRenderCamera as w}from"../webgl.js";import{scaleToDistance as T,distanceToScale as E}from"./cameraScaleUtils.js";import{getGreatCircleSpanAt as D}from"./earthUtils.js";import{getElevationAtPoint as O}from"./ElevationProvider.js";import{viewModeDependentUtil as k,directionToHeadingTilt as A}from"./viewingModeUtils.js";const j=()=>s.getLogger(`esri.views.3d.support.cameraUtils`),M=a();function N(e){return e.spatialReference??b.WGS84}function ee(e,t,n,r,i){return k(e).headingTiltToDirectionUp(t,n,r,i)}function P(e,t,n,r){let i=r.levelAtScale(t),a=I(A(e,n.eye,n.viewForward,n.up).tilt),o=Math.max(i-a,0);return r.scaleAtLevel(o)}function F(e,t,n){let r=n.levelAtScale(e),i=I(t);return n.scaleAtLevel(r+i)}function I(e){return 2*((e>90?180-e:e)/90)**2}function te(e,t,n=0){let r=e.basemapTerrain?.tilingScheme;if(!r)return 0;let a=f(e.spatialReference).radius,o=e.state.viewingMode===2?t.eye[2]:i(t.eye)-a,s=Math.abs(o-n);return P(e,E(e,s),t,r)}function ne(e,t,n=0){let r=w(e,t);return r?te(e,r,n):0}const re=1;function ie(e,t,r,a){if(t===0)return 0;let o=e.state.contentCamera,s=n(o.eye,r),d=e.basemapTerrain?.tilingScheme;if(!d)return j().error(`#scaleToTargetDistance()`,`Cannot compute distance from scale without a tiling scheme`),s;let p=s,m=A(e,o.eye,o.viewForward,o.up),h=m.tilt>90;if(e.state.isLocal){let n=F(t,m.tilt,d),r=(T(e,n)-Math.abs(o.eye[2]-a[2]))/Math.cos(c(m.tilt));return p=h?p-r:p+r,p}let g=1/0,_=0,v=z(e,m.heading,m.tilt,r,s,1);if(!v)return p;let y=i(a);for(;g>1&&_<100;){let a=i(v.eye),s=h?180-v.tilt:v.tilt,b=c(s),x=Math.sin(b)*a,S=Math.cos(b)*a,C=F(t,v.tilt,d),w=T(e,C),E=h?y-w:y+w,D=u(x/E),O=Math.cos(D)*E-S,k=n(v.eye,r);p=h?k-O:k+O,v=z(e,m.heading,m.tilt,r,p,1);let A=Q(e,v,l(o.fov));if(!v||!A)return p;let j=ne(e,A,y-f(e.spatialReference).radius);g=Math.abs(t-j),++_}return p}async function ae(e,t,n,r,i,a){return L(e,t,T(e,n),r,i,a)}function oe(e,t,n,r,i,a){return Q(e,z(e,r.heading,r.tilt,t,n,i),r.fov,a)}async function L(e,t,n,r,i,a){let o=await B(e,r.heading,r.tilt,t,n,i,a);return d(a),$(e,o,r.fov,a)}function R(e,t){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(t,M,e.spatialReference)&&e.elevationProvider&&(O(e.elevationProvider,M)??0)>M[2]-1)}async function se(e,t,n){if(R(e,t))return!0;let{elevationProvider:r,spatialReference:i,renderCoordsHelper:a}=e;if(r==null||!a.fromRenderCoords(t,M,i))return!1;let[o,s,c]=M,l=await r.queryElevation(o,s,c,i,`ground`,n)??0;return d(n),l>c-1}async function ce(e,n,r){let i=a();if(n==null)return t(i,e.state.camera.center);if(n instanceof p){let{renderSpatialReference:t,basemapTerrain:a,elevationProvider:o}=e,s=n.spatialReference;if(await m(n,i,t,{signal:r}),d(r),n.z==null&&a!=null&&o!=null){let t=await o.queryElevation(n.x,n.y,n.z??0,s,`ground`,r);d(r),t!=null&&e.renderCoordsHelper.setAltitude(i,t)}return i}return t(i,n)}function le(e,n){let r=a();if(n==null)return t(r,e.state.camera.center);if(n instanceof p){if(!h(n,r,e.renderSpatialReference))return null;let{basemapTerrain:t,elevationProvider:i}=e;if(n.z==null&&t!=null&&i!=null){let t=O(i,n);t!=null&&e.renderCoordsHelper.setAltitude(r,t)}return r}return t(r,n)}function z(e,t,n,r,i,a){return V(e,t,n,r instanceof p?r:null,le(e,r),i,a)}async function B(e,t,n,r,i,a,o){let s=r instanceof p?r:null,c=await ce(e,r,o);return d(o),H(e,t,n,s,c,i,a,o)}function V(e,t,n,r,i,a,o){if(i==null||!r&&(r=new p({spatialReference:N(e)}),!_(i,e.renderSpatialReference,r)))return null;let s=U(e,t,n,i,a,o);if(W(e,n,o)&&R(e,s.eye)){let{tilt:o,mode:s}=G(e,n,i,a);return V(e,t,o,r,i,a,s)}return K(s,i)}async function H(e,t,n,r,i,a,o,s){r||(r=new p({spatialReference:N(e)}),await g(i,e.renderSpatialReference,r,{signal:s})||(r=null)),d(s);let c=U(e,t,n,i,a,o);if(W(e,n,o)&&await se(e,c.eye,s)){d(s);let{tilt:o,mode:c}=G(e,n,i,a);return H(e,t,o,r,i,a,c,s)}return K(c,i)}function U(e,t,n,r,i,a){i=Math.max(i,e.state.constraints.minimumPoiDistance);let o=he(e,t,n,r,i,a);return(0,k(e).eyeForCenterWithHeadingTilt)(r,i,o.heading,o.tilt)}function W(e,t,n){let r=e.map.ground.navigationConstraint;return n===1&&e.state.isGlobal&&t>0&&(r==null||r.type===`stay-above`)}function G(e,t,n,r){let i=X(e,n,r,_e(e,r,t,n));return{tilt:i,mode:t-i<1?0:1}}function K(e,t){return{...e,center:o(t)}}function q(e,t){let{state:n,spatialReference:r}=e,i=t.spatialReference;return n.isGlobal&&C(i,1)||n.isLocal&&r.equals(i)}function J(e,t){let n,r,i;if(e.state.isGlobal){let e=new p({x:t.xmin,y:t.ymin,spatialReference:t.spatialReference}),a=new p({x:t.xmax,y:t.ymax,spatialReference:t.spatialReference}),o=t.spatialReference.isGeographic?x:S;n=new p({x:o.center(e.x,a.x),y:(a.y+e.y)/2,z:t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0,spatialReference:t.spatialReference});let s=f(t.spatialReference),c=D(n,e,a);r=c.lon,i=c.lat,o.diff(e.x,a.x)>o.range/2&&(r+=s.halfCircumference),r=Math.min(r,s.halfCircumference),i=Math.min(i,s.halfCircumference)}else{let a=e.renderSpatialReference??t.spatialReference;a.equals(t.spatialReference)||(t=y(t,a)),r=t.xmax-t.xmin,i=t.ymax-t.ymin;let o=t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0;n=new p({x:t.xmin+.5*r,y:t.ymin+.5*i,z:o,spatialReference:a})}let a=t.zmax!=null&&t.zmin!=null?t.zmax-t.zmin:0,o=e.state.camera,s=1/Math.tan(o.fovX/2),c=1/Math.tan(o.fovY/2),l=1/Math.tan(o.fov/2),u=Math.max(.5*r*s,.5*i*c,.5*a*l)/1;return{center:n,distance:u}}async function ue(e,t,n,r,i,a){let o=q(e,t)?t:await v(t,e.spatialReference,{signal:a});d(a);let{center:s,distance:c}=J(e,o),l=await B(e,n,r,s,c,i,a);return d(a),$(e,l,e.camera.fov,a)}function de(e,t,n,r,i,a){let o;try{o=q(e,t)?t:y(t,e.spatialReference)}catch{return null}let{center:s,distance:c}=J(e,o),l=z(e,n,r,s,c,i);return l==null?null:Q(e,l,e.camera.fov,a)}function fe(e,t,n){let i=e.renderSpatialReference,a=new p({spatialReference:N(e)});if(!_(n,i,a))return null;let o=Math.tan(t.fovX/2),s=Math.tan(t.fovY/2),c=r(t.eye,n),l=2*c*o*1,u=2*c*s*1;return k(e).toExtent(e,a,l,u)}function pe(e,t){return k(e).toArea(e,t)}function me(e,t,r){let i=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(r/i)/Math.LN2>8)return!0;let a=t,o=e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;return n(a,o)/(Math.tan(e.state.camera.fov*.5)*i)>5}function he(e,t,n,r,i,a){let o=0;return a===1&&me(e,r,i)?(t=0,o=ge(e,i,n,r)):o=Z(e,r,i,n),o=e.state.constraints.clampTilt(i,o),n=X(e,r,i,o),{heading:t,tilt:n}}const Y=.7;function ge(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);a.max=Math.min(a.max,Math.PI*.5);let o=a.min*.30000000000000004+a.max*Y;return Math.min(i,o)}function _e(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);return i=Math.min(i,Math.PI*.5),a.min*.30000000000000004+i*Y}function X(e,t,n,r){return k(e).lookAtTiltToEyeTilt(r,t,n)}function Z(e,t,n,r){return k(e).eyeTiltToLookAtTilt(r,t,n)}function Q(t,n,r,i){if(n==null)return null;let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return _(n.eye,a,o)?(i??=new e,i.position=o,i.heading=n.heading,i.tilt=n.tilt,i.fov=r,i):null}async function $(t,n,r,i){let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return await g(n.eye,a,o,{signal:i}),d(i),new e({position:o,heading:n.heading,tilt:n.tilt,fov:r})}function ve(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#scaleToZoom()`,`Cannot compute zoom from scale without a tiling scheme`);else return n.levelAtScale(t)}function ye(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#zoomToScale()`,`Cannot compute scale from zoom without a tiling scheme`);else return n.scaleAtLevel(t)}export{P as applyTiltAdjustToScale,L as fromCenterDistanceAsync,oe as fromCenterDistanceSync,ae as fromCenterScale,ue as fromExtentAsync,de as fromExtentSync,B as getObserverForPointAtDistanceAsync,z as getObserverForPointAtDistanceSync,N as getViewSR,ee as headingTiltToDirectionUp,F as removeTiltAdjustFromScale,re as scaleErrorThreshold,ve as scaleToZoom,pe as toArea,fe as toExtent,ie as viewScaleToCameraDistance,ye as zoomToScale};
2
+ import e from"../../../Camera.js";import{copy as t,distance as n,dist as r,length as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a,clone as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../core/Logger.js";import{deg2rad as c,rad2deg as l,asinClamped as u}from"../../../core/mathUtils.js";import{throwIfAborted as d}from"../../../core/promiseUtils.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectPointToVectorAsync as m,projectPointToVector as h}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as g,projectVectorToPoint as _}from"../../../geometry/projection/projectVectorToPoint.js";import{projectAsync as v,project as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{gcsCyclical as x,webMercatorCyclical as S}from"../../../geometry/support/normalizeUtils.js";import{isSpatialReferenceSupported as C}from"../../support/spatialReferenceSupport.js";import{toRenderCamera as w}from"../webgl.js";import{scaleToDistance as T,distanceToScale as E}from"./cameraScaleUtils.js";import{getGreatCircleSpanAt as D}from"./earthUtils.js";import{getElevationAtPoint as O}from"./ElevationProvider.js";import{viewModeDependentUtil as k,directionToHeadingTilt as A}from"./viewingModeUtils.js";const j=()=>s.getLogger(`esri.views.3d.support.cameraUtils`),M=a();function N(e){return e.spatialReference??b.WGS84}function ee(e,t,n,r,i){return k(e).headingTiltToDirectionUp(t,n,r,i)}function P(e,t,n,r){let i=r.levelAtScale(t),a=I(A(e,n.eye,n.viewForward,n.up).tilt),o=Math.max(i-a,0);return r.scaleAtLevel(o)}function F(e,t,n){let r=n.levelAtScale(e),i=I(t);return n.scaleAtLevel(r+i)}function I(e){return 2*((e>90?180-e:e)/90)**2}function te(e,t,n=0){let r=e.basemapTerrain?.tilingScheme;if(!r)return 0;let a=f(e.spatialReference).radius,o=e.state.isLocal?t.eye[2]:i(t.eye)-a,s=Math.abs(o-n);return P(e,E(e,s),t,r)}function ne(e,t,n=0){let r=w(e,t);return r?te(e,r,n):0}const re=1;function ie(e,t,r,a){if(t===0)return 0;let o=e.state.contentCamera,s=n(o.eye,r),d=e.basemapTerrain?.tilingScheme;if(!d)return j().error(`#scaleToTargetDistance()`,`Cannot compute distance from scale without a tiling scheme`),s;let p=s,m=A(e,o.eye,o.viewForward,o.up),h=m.tilt>90;if(e.state.isLocal){let n=F(t,m.tilt,d),r=(T(e,n)-Math.abs(o.eye[2]-a[2]))/Math.cos(c(m.tilt));return p=h?p-r:p+r,p}let g=1/0,_=0,v=z(e,m.heading,m.tilt,r,s,1);if(!v)return p;let y=i(a);for(;g>1&&_<100;){let a=i(v.eye),s=h?180-v.tilt:v.tilt,b=c(s),x=Math.sin(b)*a,S=Math.cos(b)*a,C=F(t,v.tilt,d),w=T(e,C),E=h?y-w:y+w,D=u(x/E),O=Math.cos(D)*E-S,k=n(v.eye,r);p=h?k-O:k+O,v=z(e,m.heading,m.tilt,r,p,1);let A=Q(e,v,l(o.fov));if(!v||!A)return p;let j=ne(e,A,y-f(e.spatialReference).radius);g=Math.abs(t-j),++_}return p}async function ae(e,t,n,r,i,a){return L(e,t,T(e,n),r,i,a)}function oe(e,t,n,r,i,a){return Q(e,z(e,r.heading,r.tilt,t,n,i),r.fov,a)}async function L(e,t,n,r,i,a){let o=await B(e,r.heading,r.tilt,t,n,i,a);return d(a),$(e,o,r.fov,a)}function R(e,t){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(t,M,e.spatialReference)&&e.elevationProvider&&(O(e.elevationProvider,M)??0)>M[2]-1)}async function se(e,t,n){if(R(e,t))return!0;let{elevationProvider:r,spatialReference:i,renderCoordsHelper:a}=e;if(r==null||!a.fromRenderCoords(t,M,i))return!1;let[o,s,c]=M,l=await r.queryElevation(o,s,c,i,`ground`,n)??0;return d(n),l>c-1}async function ce(e,n,r){let i=a();if(n==null)return t(i,e.state.camera.center);if(n instanceof p){let{renderSpatialReference:t,basemapTerrain:a,elevationProvider:o}=e,s=n.spatialReference;if(await m(n,i,t,{signal:r}),d(r),n.z==null&&a!=null&&o!=null){let t=await o.queryElevation(n.x,n.y,n.z??0,s,`ground`,r);d(r),t!=null&&e.renderCoordsHelper.setAltitude(i,t)}return i}return t(i,n)}function le(e,n){let r=a();if(n==null)return t(r,e.state.camera.center);if(n instanceof p){if(!h(n,r,e.renderSpatialReference))return null;let{basemapTerrain:t,elevationProvider:i}=e;if(n.z==null&&t!=null&&i!=null){let t=O(i,n);t!=null&&e.renderCoordsHelper.setAltitude(r,t)}return r}return t(r,n)}function z(e,t,n,r,i,a){return V(e,t,n,r instanceof p?r:null,le(e,r),i,a)}async function B(e,t,n,r,i,a,o){let s=r instanceof p?r:null,c=await ce(e,r,o);return d(o),H(e,t,n,s,c,i,a,o)}function V(e,t,n,r,i,a,o){if(i==null||!r&&(r=new p({spatialReference:N(e)}),!_(i,e.renderSpatialReference,r)))return null;let s=U(e,t,n,i,a,o);if(W(e,n,o)&&R(e,s.eye)){let{tilt:o,mode:s}=G(e,n,i,a);return V(e,t,o,r,i,a,s)}return K(s,i)}async function H(e,t,n,r,i,a,o,s){r||(r=new p({spatialReference:N(e)}),await g(i,e.renderSpatialReference,r,{signal:s})||(r=null)),d(s);let c=U(e,t,n,i,a,o);if(W(e,n,o)&&await se(e,c.eye,s)){d(s);let{tilt:o,mode:c}=G(e,n,i,a);return H(e,t,o,r,i,a,c,s)}return K(c,i)}function U(e,t,n,r,i,a){i=Math.max(i,e.state.constraints.minimumPoiDistance);let o=he(e,t,n,r,i,a);return(0,k(e).eyeForCenterWithHeadingTilt)(r,i,o.heading,o.tilt)}function W(e,t,n){let r=e.map.ground.navigationConstraint;return n===1&&e.state.isGlobal&&t>0&&(r==null||r.type===`stay-above`)}function G(e,t,n,r){let i=X(e,n,r,_e(e,r,t,n));return{tilt:i,mode:t-i<1?0:1}}function K(e,t){return{...e,center:o(t)}}function q(e,t){let{state:n,spatialReference:r}=e,i=t.spatialReference;return n.isGlobal&&C(i,n.isGlobal)||n.isLocal&&r.equals(i)}function J(e,t){let n,r,i;if(e.state.isGlobal){let e=new p({x:t.xmin,y:t.ymin,spatialReference:t.spatialReference}),a=new p({x:t.xmax,y:t.ymax,spatialReference:t.spatialReference}),o=t.spatialReference.isGeographic?x:S;n=new p({x:o.center(e.x,a.x),y:(a.y+e.y)/2,z:t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0,spatialReference:t.spatialReference});let s=f(t.spatialReference),c=D(n,e,a);r=c.lon,i=c.lat,o.diff(e.x,a.x)>o.range/2&&(r+=s.halfCircumference),r=Math.min(r,s.halfCircumference),i=Math.min(i,s.halfCircumference)}else{let a=e.renderSpatialReference??t.spatialReference;a.equals(t.spatialReference)||(t=y(t,a)),r=t.xmax-t.xmin,i=t.ymax-t.ymin;let o=t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0;n=new p({x:t.xmin+.5*r,y:t.ymin+.5*i,z:o,spatialReference:a})}let a=t.zmax!=null&&t.zmin!=null?t.zmax-t.zmin:0,o=e.state.camera,s=1/Math.tan(o.fovX/2),c=1/Math.tan(o.fovY/2),l=1/Math.tan(o.fov/2),u=+Math.max(.5*r*s,.5*i*c,.5*a*l);return{center:n,distance:u}}async function ue(e,t,n,r,i,a){let o=q(e,t)?t:await v(t,e.spatialReference,{signal:a});d(a);let{center:s,distance:c}=J(e,o),l=await B(e,n,r,s,c,i,a);return d(a),$(e,l,e.camera.fov,a)}function de(e,t,n,r,i,a){let o;try{o=q(e,t)?t:y(t,e.spatialReference)}catch{return null}let{center:s,distance:c}=J(e,o),l=z(e,n,r,s,c,i);return l==null?null:Q(e,l,e.camera.fov,a)}function fe(e,t,n){let i=e.renderSpatialReference,a=new p({spatialReference:N(e)});if(!_(n,i,a))return null;let o=Math.tan(t.fovX/2),s=Math.tan(t.fovY/2),c=r(t.eye,n),l=2*c*o,u=2*c*s;return k(e).toExtent(e,a,l,u)}function pe(e,t){return k(e).toArea(e,t)}function me(e,t,r){let i=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(r/i)/Math.LN2>8)return!0;let a=t,o=e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;return n(a,o)/(Math.tan(e.state.camera.fov*.5)*i)>5}function he(e,t,n,r,i,a){let o=0;return a===1&&me(e,r,i)?(t=0,o=ge(e,i,n,r)):o=Z(e,r,i,n),o=e.state.constraints.clampTilt(i,o),n=X(e,r,i,o),{heading:t,tilt:n}}const Y=.7;function ge(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);a.max=Math.min(a.max,Math.PI*.5);let o=a.min*.30000000000000004+a.max*Y;return Math.min(i,o)}function _e(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);return i=Math.min(i,Math.PI*.5),a.min*.30000000000000004+i*Y}function X(e,t,n,r){return k(e).lookAtTiltToEyeTilt(r,t,n)}function Z(e,t,n,r){return k(e).eyeTiltToLookAtTilt(r,t,n)}function Q(t,n,r,i){if(n==null)return null;let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return _(n.eye,a,o)?(i??=new e,i.position=o,i.heading=n.heading,i.tilt=n.tilt,i.fov=r,i):null}async function $(t,n,r,i){let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return await g(n.eye,a,o,{signal:i}),d(i),new e({position:o,heading:n.heading,tilt:n.tilt,fov:r})}function ve(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#scaleToZoom()`,`Cannot compute zoom from scale without a tiling scheme`);else return n.levelAtScale(t)}function ye(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#zoomToScale()`,`Cannot compute scale from zoom without a tiling scheme`);else return n.scaleAtLevel(t)}export{P as applyTiltAdjustToScale,L as fromCenterDistanceAsync,oe as fromCenterDistanceSync,ae as fromCenterScale,ue as fromExtentAsync,de as fromExtentSync,B as getObserverForPointAtDistanceAsync,z as getObserverForPointAtDistanceSync,N as getViewSR,ee as headingTiltToDirectionUp,F as removeTiltAdjustFromScale,re as scaleErrorThreshold,ve as scaleToZoom,pe as toArea,fe as toExtent,ie as viewScaleToCameraDistance,ye as zoomToScale};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{len as e,lerp as t}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n,fromValues as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{asinClamped as i}from"../../../core/mathUtils.js";import{projectBoundingRect as a}from"../../../geometry/projection/projectBoundingRect.js";import{projectBuffer as o}from"../../../geometry/projection/projectBuffer.js";import{wgs84ToWebMercator as s}from"../../../geometry/projection/projectors.js";import c from"../../../geometry/SpatialReference.js";import{empty as l,expand as u,copy as d,create as f,fromValues as p}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as m,isWebMercator as h,isGeographic as g}from"../../../geometry/support/spatialReferenceUtils.js";export{intersectsGeographicExtent as intersectsElevationUpdateExtent,sphereToGeographicExtent}from"./sphereExtentUtils.js";const _=1;function v(e,t,n,r){let i=e[1],s=e[3];if(t==null||r==null||!a(e,t,n,r))return!1;if(!h(t)||h(r))return!0;if(i<=-x[1]){if(!o(y,c.WGS84,0,S,r,0))return!1;n[1]=S[1]}if(s>=x[1]){if(!o(b,c.WGS84,0,S,r,0))return!1;n[3]=S[1]}return!0}const y=r(0,-90,0),b=r(0,90,0),x=n();s(b,0,x,0);const S=n();function C(e,t,n,r){if(n<e[1]||n>e[3])return!1;if(t>=e[0]&&t<=e[2])return!0;let i=m(r);if(i==null)return!1;let a=i.valid[1]-i.valid[0];return Math.ceil((e[0]-t)/a)<=Math.floor((e[2]-t)/a)}function w(e,t){let n=t.valid,r=g(e)?90:n[1];return h(e)&&(r=x[1]),p(n[0],-r,n[1],r)}function T(e,t){let n=m(t);if(t==null||n==null){if(e.length===0)return[];let t=f();return O(e,t),[t]}return e.length===0?[w(t,n)]:D(e,n)}class E{constructor(e){this._renderCoordsHelper=e,this.extent=l(),this._mapCenterX=NaN,this._worldXWidth=0}reset(t,n,r){l(this.extent),this._mapCenterX=NaN;let a=m(r);if(this._renderCoordsHelper.viewingMode!==1||r==null||a==null)return;let o=e(t);if(n>=o){this._setFullWorldExtent(r,a);return}let s=Math.asin(n/o),c=i(t[2]/o);if(s>A||Math.abs(c)+s>=Math.PI/2){this._setFullWorldExtent(r,a);return}if(this._renderCoordsHelper.fromRenderCoords(t,j,r)==null)return;this._mapCenterX=j[0];let u=a.valid;this._worldXWidth=u[1]-u[0]}addRenderPoint(e,t){return this._renderCoordsHelper.fromRenderCoords(e,j,t)==null?null:(Number.isFinite(this._mapCenterX)&&(j[0]+=Math.round((this._mapCenterX-j[0])/this._worldXWidth)*this._worldXWidth),u(this.extent,j,this.extent),j)}addRenderEdge(e,n,r){if(this._renderCoordsHelper.viewingMode!==1)return!0;let i=n[0]-e[0],a=n[1]-e[1],o=n[2]-e[2],s=e[0]*e[0]+e[1]*e[1],c=e[0]*i+e[1]*a,l=i*i+a*a,u=o*c-e[2]*l,d=(e[2]*c-o*s)/u;return d>0&&d<1?(t(M,e,n,d),this.addRenderPoint(M,r)!=null):!0}_setFullWorldExtent(e,t){d(this.extent,w(e,t))}}function D(e,t){let n=t.valid,r=n[1]-n[0],i=e[0],a=1/0,o=1/0,s=-1/0,c=-1/0,l=1/0,u=-1/0;for(let t=0;t<e.length;t+=4){let n=e[t],d=e[t+1],f=e[t+2],p=e[t+3];a=Math.min(a,n),s=Math.max(s,f),o=Math.min(o,d),c=Math.max(c,p);let m=Math.round((i-n)/r),h=n+m*r,g=f+m*r;l=Math.min(l,h),u=Math.max(u,g)}let d=p(a,o,s,c),f=a,m=s;if(u-l<m-f&&(f=l,m=u),m-f>=r)return d[0]=n[0],d[2]=n[1],[d];let h=k(f,n[0],r);return f+=h*r,m+=h*r,m<=n[1]?(d[0]=f,d[2]=m,[d]):(d[0]=n[0],d[2]=m-r,[d,p(f,o,n[1],c)])}function O(e,t){let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let t=0;t<e.length;t+=4){let o=e[t],s=e[t+1],c=e[t+2],l=e[t+3];n=Math.min(n,o),r=Math.min(r,s),i=Math.max(i,c),a=Math.max(a,l)}p(n,r,i,a,t)}function k(e,t,n){return Math.ceil((t-e)/n)}const A=Math.PI/4,j=n(),M=n();export{E as ProjectedElevationUpdateExtent,T as calculateElevationUpdateExtents,C as containsElevationUpdatePoint,w as fullWorldElevationUpdateExtent,_ as planetCenterProximityToleranceMeters,v as projectElevationUpdateExtent};
2
+ import{len as e,lerp as t}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n,fromValues as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{asinClamped as i}from"../../../core/mathUtils.js";import{projectBoundingRect as a}from"../../../geometry/projection/projectBoundingRect.js";import{projectBuffer as o}from"../../../geometry/projection/projectBuffer.js";import{wgs84ToWebMercator as s}from"../../../geometry/projection/projectors.js";import c from"../../../geometry/SpatialReference.js";import{empty as l,expand as u,copy as d,create as f,fromValues as p}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as m,isWebMercator as h,isGeographic as g}from"../../../geometry/support/spatialReferenceUtils.js";export{intersectsGeographicExtent as intersectsElevationUpdateExtent,sphereToGeographicExtent}from"./sphereExtentUtils.js";const _=1;function v(e,t,n,r){let i=e[1],s=e[3];if(t==null||r==null||!a(e,t,n,r))return!1;if(!h(t)||h(r))return!0;if(i<=-x[1]){if(!o(y,c.WGS84,0,S,r,0))return!1;n[1]=S[1]}if(s>=x[1]){if(!o(b,c.WGS84,0,S,r,0))return!1;n[3]=S[1]}return!0}const y=r(0,-90,0),b=r(0,90,0),x=n();s(b,0,x,0);const S=n();function C(e,t,n,r){if(n<e[1]||n>e[3])return!1;if(t>=e[0]&&t<=e[2])return!0;let i=m(r);if(i==null)return!1;let a=i.valid[1]-i.valid[0];return Math.ceil((e[0]-t)/a)<=Math.floor((e[2]-t)/a)}function w(e,t){let n=t.valid,r=g(e)?90:n[1];return h(e)&&(r=x[1]),p(n[0],-r,n[1],r)}function T(e,t){let n=m(t);if(t==null||n==null){if(e.length===0)return[];let t=f();return O(e,t),[t]}return e.length===0?[w(t,n)]:D(e,n)}class E{constructor(e){this._renderCoordsHelper=e,this.extent=l(),this._mapCenterX=NaN,this._worldXWidth=0}reset(t,n,r){l(this.extent),this._mapCenterX=NaN;let a=m(r);if(!this._renderCoordsHelper.isGlobal||r==null||a==null)return;let o=e(t);if(n>=o){this._setFullWorldExtent(r,a);return}let s=Math.asin(n/o),c=i(t[2]/o);if(s>A||Math.abs(c)+s>=Math.PI/2){this._setFullWorldExtent(r,a);return}if(this._renderCoordsHelper.fromRenderCoords(t,j,r)==null)return;this._mapCenterX=j[0];let u=a.valid;this._worldXWidth=u[1]-u[0]}addRenderPoint(e,t){return this._renderCoordsHelper.fromRenderCoords(e,j,t)==null?null:(Number.isFinite(this._mapCenterX)&&(j[0]+=Math.round((this._mapCenterX-j[0])/this._worldXWidth)*this._worldXWidth),u(this.extent,j,this.extent),j)}addRenderEdge(e,n,r){if(!this._renderCoordsHelper.isGlobal)return!0;let i=n[0]-e[0],a=n[1]-e[1],o=n[2]-e[2],s=e[0]*e[0]+e[1]*e[1],c=e[0]*i+e[1]*a,l=i*i+a*a,u=o*c-e[2]*l,d=(e[2]*c-o*s)/u;return d>0&&d<1?(t(M,e,n,d),this.addRenderPoint(M,r)!=null):!0}_setFullWorldExtent(e,t){d(this.extent,w(e,t))}}function D(e,t){let n=t.valid,r=n[1]-n[0],i=e[0],a=1/0,o=1/0,s=-1/0,c=-1/0,l=1/0,u=-1/0;for(let t=0;t<e.length;t+=4){let n=e[t],d=e[t+1],f=e[t+2],p=e[t+3];a=Math.min(a,n),s=Math.max(s,f),o=Math.min(o,d),c=Math.max(c,p);let m=Math.round((i-n)/r),h=n+m*r,g=f+m*r;l=Math.min(l,h),u=Math.max(u,g)}let d=p(a,o,s,c),f=a,m=s;if(u-l<m-f&&(f=l,m=u),m-f>=r)return d[0]=n[0],d[2]=n[1],[d];let h=k(f,n[0],r);return f+=h*r,m+=h*r,m<=n[1]?(d[0]=f,d[2]=m,[d]):(d[0]=n[0],d[2]=m-r,[d,p(f,o,n[1],c)])}function O(e,t){let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let t=0;t<e.length;t+=4){let o=e[t],s=e[t+1],c=e[t+2],l=e[t+3];n=Math.min(n,o),r=Math.min(r,s),i=Math.max(i,c),a=Math.max(a,l)}p(n,r,i,a,t)}function k(e,t,n){return Math.ceil((t-e)/n)}const A=Math.PI/4,j=n(),M=n();export{E as ProjectedElevationUpdateExtent,T as calculateElevationUpdateExtents,C as containsElevationUpdatePoint,w as fullWorldElevationUpdateExtent,_ as planetCenterProximityToleranceMeters,v as projectElevationUpdateExtent};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{translateAffine as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as t,create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as r,dist as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{negate as o,set as s,transformMat4 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as d}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as f}from"../../../../geometry/projection/projectors.js";import{center as p,fromBuffer as m,setEmpty as h,expandWithVec3 as g,create as _}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as v}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as y}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as b}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as x}from"../../../../geometry/support/Indices.js";import{addOlidAttribute as ee}from"../../layers/graphics/olidUtils.js";import{Attribute as S}from"../../webgl-engine/lib/Attribute.js";import{BufferGeometry as te}from"../../webgl-engine/lib/BufferGeometry.js";import{Buffers as ne}from"../../webgl-engine/lib/Buffers.js";import{Geometry as C}from"../../webgl-engine/lib/Geometry.js";import{createVerticesView as w}from"../../webgl-engine/lib/VerticesView.js";import{isClosed as T,ribbonLineVertexCount as E,writeRibbonLineTextureBuffer as D,writeRibbonLineVertices as re}from"../../webgl-engine/materials/internal/ribbonLineBufferUtils.js";import{isImagePattern as ie}from"../../webgl-engine/materials/lineStippleUtils.js";import{getLayout as ae,getTextureBufferLayout as oe}from"../../webgl-engine/shaders/RibbonLineLayouts.js";import{getPlanarDistanceToGroundRatio as O}from"../planarDistanceToGroundRatio.js";function k(e,t,n=null){let r=[],i=t.mapPositions,a=P(t,r),o=a.data,s=a.indices.length,c=x(s);return F(t,r,c),R(t,r,c),I(t,r,c),L(t,r,a.indices,c),z(t,r,a.indices,c),B(t,r),V(t,r,a.indices,c),H(e,t,r,o),n!=null&&ee(r,n,c),new C(e,r,i)}function A(n,r,i,a,s=null){let{attributeData:c,removeDuplicateStartEnd:l}=r,u=G(c.position,l),d=w({data:u,size:3,stride:3},3),f=T(n.parameters,d.count),p=ae(n.parameters).createBuffer(E(d.count,f,n.parameters)),m=oe(n.parameters).createBuffer(d.count+(f?3:2)),h=m.layout.fields.has(`u0`)?U(n.parameters,r.overlayInfo,u):null;return o(Q,i.vec3),e($,s??t,Q),D({...c,position:d,distancesToStart:h,olidColor:a},f,{buffer:m,offset:0},$),re(d.count,f,n.parameters,{buffer:p,offset:0},0),new te(n,new ne(p,m),i,r.mapPositions)}function j(n,r,i,a=null){let s=w({data:r,size:3,stride:3},3),c=T(n.material.parameters,s.count);o(Q,n.localOrigin.vec3),e($,a??t,Q),D({position:s,color:i},c,{buffer:n.getMutableBuffers().storage,offset:0},$)}function M(e,t,n=null){let r=Y(X,e,n);return p(r,Z),t.getOrigin(Z)}function N(e,t,n,r=null){let i=Y(X,n,r);return p(i,Z),t.needsOriginUpdate(e,Z,0)}function P(e,t){let{attributeData:{position:n},removeDuplicateStartEnd:r}=e,i=G(n,r),a=i.length/3,o=Array(2*(a-1)),s=0;for(let e=0;e<a-1;e++)o[s++]=e,o[s++]=e+1;let c=new S(i,o,3,i!==n);return t.push([`position`,c]),c}function F(e,t,n){if(e.attributeData.colorFeature!=null)return;let r=e.attributeData.color;t.push([`color`,new S(r??u,n,4)])}function I(e,t,n){e.attributeData.normal&&t.push([`normal`,new S(e.attributeData.normal,n,3)])}function L(e,t,n,r){let i=e.attributeData.colorFeature;i!=null&&(typeof i==`number`?t.push([`colorFeatureAttribute`,new S([i],r,1,!0)]):t.push([`colorFeatureAttribute`,new S(i,n,1,!0)]))}function R(e,t,n){e.attributeData.sizeFeature??t.push([`size`,new S([e.attributeData.size??1],n,1,!0)])}function z(e,t,n,r){let i=e.attributeData.sizeFeature;i!=null&&(typeof i==`number`?t.push([`sizeFeatureAttribute`,new S([i],r,1,!0)]):t.push([`sizeFeatureAttribute`,new S(i,n,1,!0)]))}function B(e,t){let{attributeData:{position:n,timeStamps:r}}=e;if(!r)return;let i=n.length/3,a=Array(2*(i-1)),o=0;for(let e=0;e<i-1;e++)a[o++]=e,a[o++]=e+1;t.push([`timeStamps`,new S(r,a,q,!0)])}function V(e,t,n,r){let i=e.attributeData.opacityFeature;i!=null&&(typeof i==`number`?t.push([`opacityFeatureAttribute`,new S([i],r,1,!0)]):t.push([`opacityFeatureAttribute`,new S(i,n,1,!0)]))}function H(e,{overlayInfo:t},n,r){let i=U(e.parameters,t,r);i!=null&&n.push([`distanceToStart`,new S(i,n[0][1].indices,1,!0)])}function U(e,t,n){if(t==null||!K(e)||e.stipplePattern==null)return null;let{renderCoordsHelper:a,spatialReference:o}=t,s=o.isGeographic&&a.viewingMode===1,c=e.worldSized||ie(e.stipplePattern);if(!c&&!s)return null;let l=n;if(s){let e=v(n.length),t=d(o);for(let r=0;r<e.length;r+=3)f(n,r,e,r,t);l=e}let u=n.length/3,p=y(u+1),m=a.viewingMode===1,h=se,g=ce,_=0,b=0,x=0;r(h,l[b++],l[b++]),b++,p[0]=0;for(let e=1;e<u+1;++e){e===u&&(b=0);let t=b;r(g,l[b++],l[b++]),b++;let a=(n[x+1]+n[t+1])/2,s=c?O(o,m,a):1;_+=i(h,g)*s,p[e]=_,[h,g]=[g,h],x=t}return p}function W(e){let t=e.length;return e[0]===e[t-3]&&e[1]===e[t-2]&&e[2]===e[t-1]}function G(e,t){return t&&e.length>6&&W(e)?e.slice(0,-3):e}function K(e){return`stipplePattern`in e}const se=a(),ce=a(),q=4;function le(e,t,n,r,i,a){if(e==null||e.length===0)return[];let o=[];for(let s=0;s<e.length;s++){let c=e[s];if(c.length<2)continue;let l=c.length,u=v(l*3);for(let e=0;e<l;e++){let t=c[e];u[e*3]=t[0],u[e*3+1]=t[1],u[e*3+2]=t[2]}let d=a?.[s];o.push({attributeData:{position:u,normal:t,colorFeature:n?.[s],opacityFeature:r?.[s],sizeFeature:i?.[s],timeStamps:d==null?void 0:J(d.timeStamps,d.stage)},removeDuplicateStartEnd:!1})}return o}function ue(e,t=0,n=.01){let r=b(e.length);r[0]=0;for(let t=1;t<e.length;t++){let n=e[t-1],i=e[t],a=Math.sqrt((i[0]-n[0])**2+(i[1]-n[1])**2+(i[2]-n[2])**2);r[t]=r[t-1]+a}let i=r.map(e=>e*n);if(t!==0&&t<i.length){let e=i[t];for(let t=0;t<i.length;t++)i[t]-=e}return i}function J(e,t){let n=b(e.length*4),r=e[0],i=e[e.length-1];for(let a=0;a<e.length;a++)n[a*4]=e[a],n[a*4+1]=r,n[a*4+2]=i,n[a*4+3]=t+.5;return n}function Y(e,t,n){if(n==null)return m(t,e);h(e);for(let r=0;r<t.length;r+=3)s(Z,t[r],t[r+1],t[r+2]),c(Z,Z,n),g(e,Z);return e}const X=_(),Z=l(),Q=l(),$=n();export{U as computeLineDistances,A as createBufferGeometry,k as createGeometry,ue as getLinearTimeStamps,le as lineStripsToParameters,N as needsBufferGeometryOriginUpdate,q as numTimeStampValuesPerVertex,M as selectLocalOrigin,J as timeStampsToAttribute,j as updateBufferGeometry};
2
+ import{translateAffine as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as t,create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as r,dist as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{negate as o,set as s,transformMat4 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as d}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as f}from"../../../../geometry/projection/projectors.js";import{center as p,fromBuffer as m,setEmpty as h,expandWithVec3 as g,create as _}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as v}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as y}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as b}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as x}from"../../../../geometry/support/Indices.js";import{addOlidAttribute as ee}from"../../layers/graphics/olidUtils.js";import{Attribute as S}from"../../webgl-engine/lib/Attribute.js";import{BufferGeometry as te}from"../../webgl-engine/lib/BufferGeometry.js";import{Buffers as ne}from"../../webgl-engine/lib/Buffers.js";import{Geometry as C}from"../../webgl-engine/lib/Geometry.js";import{createVerticesView as w}from"../../webgl-engine/lib/VerticesView.js";import{isClosed as T,ribbonLineVertexCount as E,writeRibbonLineTextureBuffer as D,writeRibbonLineVertices as re}from"../../webgl-engine/materials/internal/ribbonLineBufferUtils.js";import{isImagePattern as ie}from"../../webgl-engine/materials/lineStippleUtils.js";import{getLayout as ae,getTextureBufferLayout as oe}from"../../webgl-engine/shaders/RibbonLineLayouts.js";import{getPlanarDistanceToGroundRatio as O}from"../planarDistanceToGroundRatio.js";function k(e,t,n=null){let r=[],i=t.mapPositions,a=P(t,r),o=a.data,s=a.indices.length,c=x(s);return F(t,r,c),R(t,r,c),I(t,r,c),L(t,r,a.indices,c),z(t,r,a.indices,c),B(t,r),V(t,r,a.indices,c),H(e,t,r,o),n!=null&&ee(r,n,c),new C(e,r,i)}function A(n,r,i,a,s=null){let{attributeData:c,removeDuplicateStartEnd:l}=r,u=G(c.position,l),d=w({data:u,size:3,stride:3},3),f=T(n.parameters,d.count),p=ae(n.parameters).createBuffer(E(d.count,f,n.parameters)),m=oe(n.parameters).createBuffer(d.count+(f?3:2)),h=m.layout.fields.has(`u0`)?U(n.parameters,r.overlayInfo,u):null;return o(Q,i.vec3),e($,s??t,Q),D({...c,position:d,distancesToStart:h,olidColor:a},f,{buffer:m,offset:0},$),re(d.count,f,n.parameters,{buffer:p,offset:0},0),new te(n,new ne(p,m),i,r.mapPositions)}function j(n,r,i,a=null){let s=w({data:r,size:3,stride:3},3),c=T(n.material.parameters,s.count);o(Q,n.localOrigin.vec3),e($,a??t,Q),D({position:s,color:i},c,{buffer:n.getMutableBuffers().storage,offset:0},$)}function M(e,t,n=null){let r=Y(X,e,n);return p(r,Z),t.getOrigin(Z)}function N(e,t,n,r=null){let i=Y(X,n,r);return p(i,Z),t.needsOriginUpdate(e,Z,0)}function P(e,t){let{attributeData:{position:n},removeDuplicateStartEnd:r}=e,i=G(n,r),a=i.length/3,o=Array(2*(a-1)),s=0;for(let e=0;e<a-1;e++)o[s++]=e,o[s++]=e+1;let c=new S(i,o,3,i!==n);return t.push([`position`,c]),c}function F(e,t,n){if(e.attributeData.colorFeature!=null)return;let r=e.attributeData.color;t.push([`color`,new S(r??u,n,4)])}function I(e,t,n){e.attributeData.normal&&t.push([`normal`,new S(e.attributeData.normal,n,3)])}function L(e,t,n,r){let i=e.attributeData.colorFeature;i!=null&&(typeof i==`number`?t.push([`colorFeatureAttribute`,new S([i],r,1,!0)]):t.push([`colorFeatureAttribute`,new S(i,n,1,!0)]))}function R(e,t,n){e.attributeData.sizeFeature??t.push([`size`,new S([e.attributeData.size??1],n,1,!0)])}function z(e,t,n,r){let i=e.attributeData.sizeFeature;i!=null&&(typeof i==`number`?t.push([`sizeFeatureAttribute`,new S([i],r,1,!0)]):t.push([`sizeFeatureAttribute`,new S(i,n,1,!0)]))}function B(e,t){let{attributeData:{position:n,timeStamps:r}}=e;if(!r)return;let i=n.length/3,a=Array(2*(i-1)),o=0;for(let e=0;e<i-1;e++)a[o++]=e,a[o++]=e+1;t.push([`timeStamps`,new S(r,a,q,!0)])}function V(e,t,n,r){let i=e.attributeData.opacityFeature;i!=null&&(typeof i==`number`?t.push([`opacityFeatureAttribute`,new S([i],r,1,!0)]):t.push([`opacityFeatureAttribute`,new S(i,n,1,!0)]))}function H(e,{overlayInfo:t},n,r){let i=U(e.parameters,t,r);i!=null&&n.push([`distanceToStart`,new S(i,n[0][1].indices,1,!0)])}function U(e,t,n){if(t==null||!K(e)||e.stipplePattern==null)return null;let{renderCoordsHelper:a,spatialReference:o}=t,s=o.isGeographic&&a.isGlobal,c=e.worldSized||ie(e.stipplePattern);if(!c&&!s)return null;let l=n;if(s){let e=v(n.length),t=d(o);for(let r=0;r<e.length;r+=3)f(n,r,e,r,t);l=e}let u=n.length/3,p=y(u+1),m=a.isGlobal,h=se,g=ce,_=0,b=0,x=0;r(h,l[b++],l[b++]),b++,p[0]=0;for(let e=1;e<u+1;++e){e===u&&(b=0);let t=b;r(g,l[b++],l[b++]),b++;let a=(n[x+1]+n[t+1])/2,s=c?O(o,m,a):1;_+=i(h,g)*s,p[e]=_,[h,g]=[g,h],x=t}return p}function W(e){let t=e.length;return e[0]===e[t-3]&&e[1]===e[t-2]&&e[2]===e[t-1]}function G(e,t){return t&&e.length>6&&W(e)?e.slice(0,-3):e}function K(e){return`stipplePattern`in e}const se=a(),ce=a(),q=4;function le(e,t,n,r,i,a){if(e==null||e.length===0)return[];let o=[];for(let s=0;s<e.length;s++){let c=e[s];if(c.length<2)continue;let l=c.length,u=v(l*3);for(let e=0;e<l;e++){let t=c[e];u[e*3]=t[0],u[e*3+1]=t[1],u[e*3+2]=t[2]}let d=a?.[s];o.push({attributeData:{position:u,normal:t,colorFeature:n?.[s],opacityFeature:r?.[s],sizeFeature:i?.[s],timeStamps:d==null?void 0:J(d.timeStamps,d.stage)},removeDuplicateStartEnd:!1})}return o}function ue(e,t=0,n=.01){let r=b(e.length);r[0]=0;for(let t=1;t<e.length;t++){let n=e[t-1],i=e[t],a=Math.sqrt((i[0]-n[0])**2+(i[1]-n[1])**2+(i[2]-n[2])**2);r[t]=r[t-1]+a}let i=r.map(e=>e*n);if(t!==0&&t<i.length){let e=i[t];for(let t=0;t<i.length;t++)i[t]-=e}return i}function J(e,t){let n=b(e.length*4),r=e[0],i=e[e.length-1];for(let a=0;a<e.length;a++)n[a*4]=e[a],n[a*4+1]=r,n[a*4+2]=i,n[a*4+3]=t+.5;return n}function Y(e,t,n){if(n==null)return m(t,e);h(e);for(let r=0;r<t.length;r+=3)s(Z,t[r],t[r+1],t[r+2]),c(Z,Z,n),g(e,Z);return e}const X=_(),Z=l(),Q=l(),$=n();export{U as computeLineDistances,A as createBufferGeometry,k as createGeometry,ue as getLinearTimeStamps,le as lineStripsToParameters,N as needsBufferGeometryOriginUpdate,q as numTimeStampValuesPerVertex,M as selectLocalOrigin,J as timeStampsToAttribute,j as updateBufferGeometry};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{SizedPixelFormat as e,PixelType as t}from"../../../webgl/enums.js";import{Texture as n}from"../../../webgl/Texture.js";import{TextureDescriptor as r}from"../../../webgl/TextureDescriptor.js";import{createPrimitive as i}from"./sdfPrimitives.js";const a=64,o=32,s=32/5,c=64/s,l=.25;function u(a,o){let c=i(a,64,32,s),l=new r(64);return l.internalFormat=e.R16F,l.dataType=t.FLOAT,l.pixelFormat=6403,l.wrapMode=33071,new n(o,l,c)}export{u as createMarkerTexture,c as markerSizePerLineWidth,o as markerSymbolSize,a as markerTextureSize,s as markerThickness,l as markerTipThicknessFactor};
2
+ import{SizedPixelFormat as e,PixelType as t}from"../../../webgl/enums.js";import{Texture as n}from"../../../webgl/Texture.js";import{TextureDescriptor as r}from"../../../webgl/TextureDescriptor.js";import{createPrimitive as i}from"./sdfPrimitives.js";const a=64,o=32,s=6.4,c=64/s,l=.25;function u(a,o){let c=i(a,64,32,s),l=new r(64);return l.internalFormat=e.R16F,l.dataType=t.FLOAT,l.pixelFormat=6403,l.wrapMode=33071,new n(o,l,c)}export{u as createMarkerTexture,c as markerSizePerLineWidth,o as markerSymbolSize,a as markerTextureSize,s as markerThickness,l as markerTipThicknessFactor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{isIterable as e}from"../../../core/iteratorUtils.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{screenPointObjectToArray as n,isScreenPolygon as r,isScreenRect as i,createScreenPointArray as a,createScreenPoint as o}from"../../../core/screenUtils.js";import s from"../../../geometry/Point.js";import{projectVectorToVector as c}from"../../../geometry/projection/projectVectorToVector.js";import l from"../../../geometry/SpatialReference.js";import{Sphere as u}from"../../../geometry/support/sphere.js";import d from"../../../Graphic.js";import{fallbackObjectIDAttribute as f}from"../../../layers/LayerConstants.js";import{IntegratedMeshSemantics as p}from"../../../layers/support/IntegratedMeshSemantics.js";import{isIntegratedMeshLayer as m}from"../../../layers/support/layerUtils.js";import{Intersector as h}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResultRay as g}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as _,toOwner as v}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as y}from"../webgl-engine/lib/verticalOffsetUtils.js";import{debugFlags as b}from"./debugFlags.js";import{getElevationAtPoint as x}from"./ElevationProvider.js";import{getGraphicHitDedupeKey as S,resolveOrderedIntersectionHits as C}from"./intersectionHitUtils.js";async function w(e,t,n,o){let s=n?I(e,n):o;if(r(t))return T(e,t,s,n?.excludeLabels);if(i(t))return T(e,O(t),s,n?.excludeLabels);let c=t,l=a(c.x,c.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;let u=new h(e.state.viewingMode);u.options.selectionMode=!0,u.options.store=2,u.options.excludeLabels=n?.excludeLabels??!1,e.sceneIntersectionHelper.intersectIntersectorScreen(l,u,s);let d=await Array.fromAsync(A(e,u.results.all,s.graphics,{getDistance:e=>e.distanceInRenderSpace,getMapPoint:t=>j(e,t),stopAtSupportSurface:!0})),f=u.results.ground,_=v(f,e),y=_!=null&&`type`in _&&m(_)&&p.shouldIntersectAsGround(_)?_:null,x={screenPoint:c,results:d,ground:{mapPoint:j(e,f),distance:g(f)?f.distanceInRenderSpace:0,layer:y}};return b.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(x.intersector=u),x}async function T(e,t,r,i){r.enableDraped=!0;let a=new h(e.state.viewingMode);a.options.selectionMode=!0,a.options.store=2,a.options.excludeLabels=i??!1,await e.sceneIntersectionHelper.intersectIntersectorScreenPolygon(t.map(e=>n(e)),a,r);let o=[];await e.sceneIntersectionHelper.screenPolygonIntersectionTask.scheduleGenerator(async function*(t){for await(let n of A(e,E(e,a.polygonResults.all),r.graphics,{getDistance:e=>e.distance,getMapPoint:()=>null}))o.push(n),t.madeProgress()&&(t=yield)});let s={screenPoint:null,results:o,ground:{mapPoint:null,distance:0,layer:null}};return b.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(s.intersector=a),s}function*E(e,t){let n=D(e);if(n==null)yield*t;else for(let e of t)e.distance!=null&&e.distance<=n&&(yield e)}function D(e){let t=e.basemapTerrain,n=e.state.camera;return e.state.viewingMode!==1||!n.aboveGround||!t?.opaque?null:(G.radius=t.getLowerBoundRadius(),G.distanceToSilhouette(n.eye)*K)}function O(e){return[o(e.x,e.y),o(e.x+e.width,e.y),o(e.x+e.width,e.y+e.height),o(e.x,e.y+e.height)]}function k(e,t,r,i){let a=r?I(e,r):i,o=!!(a.graphics?.include||a.graphics?.exclude),s=!!(a.mediaElements?.include||a.mediaElements?.exclude),c=n(t);a.enableDraped=a.include&&!a.include.has(y)||a.exclude?.has(y);let l=e.sceneIntersectionHelper,u=new h(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=o||s?2:0,u.options.excludeLabels=r?.excludeLabels??!1,l.intersectIntersectorScreen(c,u,a),o||s){for(let t of u.results.all){let n=_(t,e);if(n==null||o&&(n.type!==`graphic`||N(a.graphics,n.graphic))||s&&(n.type!==`media`||P(a.mediaElements,n.element)))return j(e,t)}return null}return j(e,u.results.min)}async function*A(e,t,n,r){let i=C(e,r.stopAtSupportSurface?(function*(){for(let n of t){yield n;let t=v(n,e);if(t!=null&&(t===e.map.ground||`type`in t&&m(t)&&p.shouldIntersectAsGround(t)))break}})():t,{getDedupeKey:e=>e.type===`graphic`?M(e.graphic):null,filterHit:e=>e.type!==`graphic`||N(n,e.graphic)});for await(let{input:e,hit:t}of i){let n=r.getMapPoint(e),i=r.getDistance(e);if(t.type===`media`){let e=n?t.element.toSource(n):null;yield{...t,mapPoint:n,distance:i,sourcePoint:e}}else yield{...t,mapPoint:n,distance:i}}}function j(e,t,n){return t.getIntersectionPoint(W)?(n=F(e,W,n),t.intersector===7&&e.basemapTerrain&&(n.z=x(e.basemapTerrain,n)??0),n):null}function M(e){let t=e.getObjectId()??e.attributes?.[f];return e.origin&&t!=null?`o-${e.origin.id}-${t}`:`u-${S(e)}`}function N(e,t){return P(e,M(t))}function P(e,t){return e==null||(e.include==null||e.include.has(t))&&(e.exclude==null||!e.exclude.has(t))}function F(e,t,n){let r=e.spatialReference||l.WGS84;return c(t,e.renderSpatialReference,W,r)?t=W:(r=l.WGS84,c(t,e.renderSpatialReference,W,r)&&(t=W)),n?(n.x=t[0],n.y=t[1],n.z=t[2],n.spatialReference=r):n=new s({x:t[0],y:t[1],z:t[2],m:t[3],spatialReference:r}),n}function I(e,t){let n=L(e,t.include,0),r=L(e,t.exclude,1);return{include:n.layerViewUids,exclude:r.layerViewUids,graphics:{include:n.graphicUids,exclude:r.graphicUids},mediaElements:{include:n.mediaElements,exclude:r.mediaElements}}}function L(t,n,r,i=new R){if(!n)return i;if(n instanceof d)H(i,M(n)),r===0&&(t.graphicsView!=null&&n.layer===t?B(i,t.graphicsView.uid):n.layer&&z(i,t,n.layer.uid));else if(`layer`in n&&`element`in n)U(i,n.element),r===0&&z(i,t,n.layer.uid);else if(!e(n))`layer`in n&&V(i,t,n),`uid`in n&&z(i,t,n.uid);else for(let e of n)if(e===t.graphics&&t.graphicsView!=null)B(i,t.graphicsView.uid);else if(e===t.map.ground){B(i,y);for(let e of t.map.ground.allIntegratedMeshGround)z(i,t,e.uid)}else L(t,e,r,i);return i}class R{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function z(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n);r&&B(e,r.uid)}function B(e,t){e.layerViewUids??=new Map,e.layerViewUids.set(t,!0)}function V(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n.layer.uid);if(!r)return;e.layerViewUids??=new Map;let i=e.layerViewUids.get(r.uid);i!==!0&&(i?i.add(n.id):e.layerViewUids.set(r.uid,new Set([n.id])))}function H(e,t){e.graphicUids??=new Set,e.graphicUids.add(t)}function U(e,t){e.mediaElements??=new Set,e.mediaElements.add(t)}const W=t(),G=new u,K=1.2;export{F as computeMapPointFromVec3d,I as externalToInternalIntersectOptions,w as hitTest,j as intersectResultToMapPoint,N as testGraphicUidFilter,k as toMap};
2
+ import{isIterable as e}from"../../../core/iteratorUtils.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{screenPointObjectToArray as n,isScreenPolygon as r,isScreenRect as i,createScreenPointArray as a,createScreenPoint as o}from"../../../core/screenUtils.js";import s from"../../../geometry/Point.js";import{projectVectorToVector as c}from"../../../geometry/projection/projectVectorToVector.js";import l from"../../../geometry/SpatialReference.js";import{Sphere as u}from"../../../geometry/support/sphere.js";import d from"../../../Graphic.js";import{fallbackObjectIDAttribute as f}from"../../../layers/LayerConstants.js";import{IntegratedMeshSemantics as p}from"../../../layers/support/IntegratedMeshSemantics.js";import{isIntegratedMeshLayer as m}from"../../../layers/support/layerUtils.js";import{Intersector as h}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResultRay as g}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as _,toOwner as v}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as y}from"../webgl-engine/lib/verticalOffsetUtils.js";import{debugFlags as b}from"./debugFlags.js";import{getElevationAtPoint as x}from"./ElevationProvider.js";import{getGraphicHitDedupeKey as S,resolveOrderedIntersectionHits as C}from"./intersectionHitUtils.js";async function w(e,t,n,o){let s=n?I(e,n):o;if(r(t))return T(e,t,s,n?.excludeLabels);if(i(t))return T(e,O(t),s,n?.excludeLabels);let c=t,l=a(c.x,c.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;let u=new h(e.state.isGlobal);u.options.selectionMode=!0,u.options.store=2,u.options.excludeLabels=n?.excludeLabels??!1,e.sceneIntersectionHelper.intersectIntersectorScreen(l,u,s);let d=await Array.fromAsync(A(e,u.results.all,s.graphics,{getDistance:e=>e.distanceInRenderSpace,getMapPoint:t=>j(e,t),stopAtSupportSurface:!0})),f=u.results.ground,_=v(f,e),y=_!=null&&`type`in _&&m(_)&&p.shouldIntersectAsGround(_)?_:null,x={screenPoint:c,results:d,ground:{mapPoint:j(e,f),distance:g(f)?f.distanceInRenderSpace:0,layer:y}};return b.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(x.intersector=u),x}async function T(e,t,r,i){r.enableDraped=!0;let a=new h(e.state.isGlobal);a.options.selectionMode=!0,a.options.store=2,a.options.excludeLabels=i??!1,await e.sceneIntersectionHelper.intersectIntersectorScreenPolygon(t.map(e=>n(e)),a,r);let o=[];await e.sceneIntersectionHelper.screenPolygonIntersectionTask.scheduleGenerator(async function*(t){for await(let n of A(e,E(e,a.polygonResults.all),r.graphics,{getDistance:e=>e.distance,getMapPoint:()=>null}))o.push(n),t.madeProgress()&&(t=yield)});let s={screenPoint:null,results:o,ground:{mapPoint:null,distance:0,layer:null}};return b.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(s.intersector=a),s}function*E(e,t){let n=D(e);if(n==null)yield*t;else for(let e of t)e.distance!=null&&e.distance<=n&&(yield e)}function D(e){let t=e.basemapTerrain,n=e.state.camera;return e.state.isLocal||!n.aboveGround||!t?.opaque?null:(G.radius=t.getLowerBoundRadius(),G.distanceToSilhouette(n.eye)*K)}function O(e){return[o(e.x,e.y),o(e.x+e.width,e.y),o(e.x+e.width,e.y+e.height),o(e.x,e.y+e.height)]}function k(e,t,r,i){let a=r?I(e,r):i,o=!!(a.graphics?.include||a.graphics?.exclude),s=!!(a.mediaElements?.include||a.mediaElements?.exclude),c=n(t);a.enableDraped=a.include&&!a.include.has(y)||a.exclude?.has(y);let l=e.sceneIntersectionHelper,u=new h(e.state.isGlobal);if(u.options.selectionMode=!0,u.options.store=o||s?2:0,u.options.excludeLabels=r?.excludeLabels??!1,l.intersectIntersectorScreen(c,u,a),o||s){for(let t of u.results.all){let n=_(t,e);if(n==null||o&&(n.type!==`graphic`||N(a.graphics,n.graphic))||s&&(n.type!==`media`||P(a.mediaElements,n.element)))return j(e,t)}return null}return j(e,u.results.min)}async function*A(e,t,n,r){let i=C(e,r.stopAtSupportSurface?(function*(){for(let n of t){yield n;let t=v(n,e);if(t!=null&&(t===e.map.ground||`type`in t&&m(t)&&p.shouldIntersectAsGround(t)))break}})():t,{getDedupeKey:e=>e.type===`graphic`?M(e.graphic):null,filterHit:e=>e.type!==`graphic`||N(n,e.graphic)});for await(let{input:e,hit:t}of i){let n=r.getMapPoint(e),i=r.getDistance(e);if(t.type===`media`){let e=n?t.element.toSource(n):null;yield{...t,mapPoint:n,distance:i,sourcePoint:e}}else yield{...t,mapPoint:n,distance:i}}}function j(e,t,n){return t.getIntersectionPoint(W)?(n=F(e,W,n),t.intersector===7&&e.basemapTerrain&&(n.z=x(e.basemapTerrain,n)??0),n):null}function M(e){let t=e.getObjectId()??e.attributes?.[f];return e.origin&&t!=null?`o-${e.origin.id}-${t}`:`u-${S(e)}`}function N(e,t){return P(e,M(t))}function P(e,t){return e==null||(e.include==null||e.include.has(t))&&(e.exclude==null||!e.exclude.has(t))}function F(e,t,n){let r=e.spatialReference||l.WGS84;return c(t,e.renderSpatialReference,W,r)?t=W:(r=l.WGS84,c(t,e.renderSpatialReference,W,r)&&(t=W)),n?(n.x=t[0],n.y=t[1],n.z=t[2],n.spatialReference=r):n=new s({x:t[0],y:t[1],z:t[2],m:t[3],spatialReference:r}),n}function I(e,t){let n=L(e,t.include,0),r=L(e,t.exclude,1);return{include:n.layerViewUids,exclude:r.layerViewUids,graphics:{include:n.graphicUids,exclude:r.graphicUids},mediaElements:{include:n.mediaElements,exclude:r.mediaElements}}}function L(t,n,r,i=new R){if(!n)return i;if(n instanceof d)H(i,M(n)),r===0&&(t.graphicsView!=null&&n.layer===t?B(i,t.graphicsView.uid):n.layer&&z(i,t,n.layer.uid));else if(`layer`in n&&`element`in n)U(i,n.element),r===0&&z(i,t,n.layer.uid);else if(!e(n))`layer`in n&&V(i,t,n),`uid`in n&&z(i,t,n.uid);else for(let e of n)if(e===t.graphics&&t.graphicsView!=null)B(i,t.graphicsView.uid);else if(e===t.map.ground){B(i,y);for(let e of t.map.ground.allIntegratedMeshGround)z(i,t,e.uid)}else L(t,e,r,i);return i}class R{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function z(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n);r&&B(e,r.uid)}function B(e,t){e.layerViewUids??=new Map,e.layerViewUids.set(t,!0)}function V(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n.layer.uid);if(!r)return;e.layerViewUids??=new Map;let i=e.layerViewUids.get(r.uid);i!==!0&&(i?i.add(n.id):e.layerViewUids.set(r.uid,new Set([n.id])))}function H(e,t){e.graphicUids??=new Set,e.graphicUids.add(t)}function U(e,t){e.mediaElements??=new Set,e.mediaElements.add(t)}const W=t(),G=new u,K=1.2;export{F as computeMapPointFromVec3d,I as externalToInternalIntersectOptions,w as hitTest,j as intersectResultToMapPoint,N as testGraphicUidFilter,k as toMap};