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

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 (467) 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/arcgisGlobal.d.ts +1 -0
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +1 -0
  12. package/assets/esri/core/workers/chunks/033b9fcd9833db3b6e7d.js +1 -0
  13. package/assets/esri/core/workers/chunks/{6602310c3fcd91fb6a2f.js → 07c8ac092e4b9e8d5b3c.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0978e12dd6a1cbc50b80.js +1 -0
  15. package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +1 -0
  16. package/assets/esri/core/workers/chunks/{db0a7671ab5cbe8afd72.js → 123661019bb69c53f2d3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{e956845255bce0910944.js → 1507297550c3cd1268e2.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{1b41ba050cde068d2860.js → 193a73a2c7f4f8482c21.js} +1 -1
  19. package/assets/esri/core/workers/chunks/1c0f5c42331fb6fc26cb.js +1 -0
  20. package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +1 -0
  21. package/assets/esri/core/workers/chunks/2cd2fcf4a37d180d5d5c.js +1 -0
  22. package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +1 -0
  23. package/assets/esri/core/workers/chunks/{afb4dfb89fbc8a342cc5.js → 3354f1fa90f8ce4c8fde.js} +1 -1
  24. package/assets/esri/core/workers/chunks/3982409149571a827390.js +1 -0
  25. package/assets/esri/core/workers/chunks/{9b458b0d1627f22fdd93.js → 3b11e4d2e69b7aea1d65.js} +1 -1
  26. package/assets/esri/core/workers/chunks/3d851710f7fcc27c5b60.js +2 -0
  27. package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +1 -0
  28. package/assets/esri/core/workers/chunks/41694ee8990e799da225.js +1 -0
  29. package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +1 -0
  30. package/assets/esri/core/workers/chunks/{12add2003631fa314f25.js → 5060be52a380fc4920f8.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{2aa6be0b047a1b25a520.js → 53bbb9aa6e4e4a0a8121.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{c6d82397044e403a1f61.js → 5954f02c3901b28d8e73.js} +1 -1
  33. package/assets/esri/core/workers/chunks/5ba6007c3c49a8153256.js +1 -0
  34. package/assets/esri/core/workers/chunks/5bdd95eeb8f34dbf26f2.js +2 -0
  35. package/assets/esri/core/workers/chunks/{4707aedcc1b3bdf5e987.js → 5c34d49a6c9cc34b7626.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js → 5e47026c681238038955.js} +2 -2
  37. package/assets/esri/core/workers/chunks/{2baf35b1b19482d603b5.js → 5f7505ada0991cfbdd84.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{976303f47c342b9d1cc0.js → 62ddd3a82864e26f009a.js} +1 -1
  39. package/assets/esri/core/workers/chunks/69a09c6acb5ae03c67f6.js +1 -0
  40. package/assets/esri/core/workers/chunks/{542a9c414c99d84d52ab.js → 6a202ef9ba9b89e09153.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{0826feebdca8a31eb630.js → 6ba6fece5c11fe2a6ace.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{5eb69e2895e5aec81051.js → 6fd10891506925560443.js} +1 -1
  43. package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +1 -0
  44. package/assets/esri/core/workers/chunks/7b6fd287e7043ad50f4e.js +1 -0
  45. package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +1 -0
  46. package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +1 -0
  47. package/assets/esri/core/workers/chunks/{c3c0f24a9e0047232ae1.js → 8679dfc0c53355b6feb0.js} +1 -1
  48. package/assets/esri/core/workers/chunks/8a636dc51372e14c98f5.js +1 -0
  49. package/assets/esri/core/workers/chunks/{d14732a57c8e63948c60.js → 9117c9b720c9ba6e7a6e.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{f7e33d37dd11fb08f3f8.js → 97107e64407fa6825620.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{5118c7269b706089c88e.js → a05a2c2aaf0c288f9681.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{944f17e9c9f681b971fb.js → a12e2a345005189c64be.js} +1 -1
  53. package/assets/esri/core/workers/chunks/a22458e5272332d86cb9.js +1 -0
  54. package/assets/esri/core/workers/chunks/{15b3386ad92a0b4149b8.js → a24dc5350af001db417a.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{10967a36c77c5188690d.js → a66d6298236d59a615db.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{3ea480cebf8ee56228a5.js → a7dfca326883384d2751.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{723d8316f5d4b6ce2942.js → a9539393e2f1812a973a.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{ac8d38016e4bee37a77c.js → ab784764ddf9d7f693a1.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{255f5b45c4d32f97f86c.js → ac0861014b3d2f1a1de2.js} +1 -1
  60. package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +1 -0
  61. package/assets/esri/core/workers/chunks/ae48ee283cfa5b3c14b0.js +1 -0
  62. package/assets/esri/core/workers/chunks/b38b6fe08a367e9de4f5.js +1 -0
  63. package/assets/esri/core/workers/chunks/{4e651869e9a196494694.js → b6e628b5d2643af4c19b.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{b37ab6b1cb4cfc85cd9d.js → b7828d7e2c5b75644057.js} +1 -1
  65. package/assets/esri/core/workers/chunks/bbd8fcb0bbba7bde3d9b.js +1 -0
  66. package/assets/esri/core/workers/chunks/{ec465abb0344ad719e9d.js → bd8e329ec74d921d311a.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{56e6e70aa40e51827290.js → c3f94024c6c9eed9f273.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{6d17b45022dfd2548098.js → c5ddf8b347c31fe772a3.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{ee9af58ae202b803bba7.js → c7a0c4ca37ebd1d98cf1.js} +1 -1
  70. package/assets/esri/core/workers/chunks/d0659f1b0495734be4b3.js +1 -0
  71. package/assets/esri/core/workers/chunks/d7763c42754152510e13.js +2 -0
  72. package/assets/esri/core/workers/chunks/{b9a2b05ede02c305e865.js → d8ffb1502def5c85740b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{7dfe1e78d2e66de6be22.js → d9ef244019954d5a8a27.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{95403bb27a4ea0a4b7b1.js → ddbfa664e69612295785.js} +1 -1
  75. package/assets/esri/core/workers/chunks/dfa1b0308e5e82d1ddfe.js +1120 -0
  76. package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +1 -0
  77. package/assets/esri/core/workers/chunks/e74586b074d0fa6abb4b.js +1 -0
  78. package/assets/esri/core/workers/chunks/e7dff025780726d5feae.js +1 -0
  79. package/assets/esri/core/workers/chunks/e96fa029acba59c04e4e.js +2 -0
  80. package/assets/esri/core/workers/chunks/{55d28d3f5b8ced061e39.js → eaf73ce60f39a48ddd2a.js} +1 -1
  81. package/assets/esri/core/workers/chunks/ed2f2a5da830d058e339.js +1 -0
  82. package/assets/esri/core/workers/chunks/{e592f2483db71230e8e5.js → efd6ea0966f60ab19520.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{944cb751c85d3a127f49.js → f52d081bbde5c95265cf.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{1de9be7b65109c207bd5.js → fbd5f3b81cd9f061824d.js} +1 -1
  85. package/assets/esri/core/workers/chunks/fdfbd201be372d3796bf.js +2 -0
  86. package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +1 -0
  87. package/assets/esri/layers/raster/formats/blosc-wasm.wasm +0 -0
  88. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  89. package/basemapGallery/support/basemapCompatibilityUtils.js +1 -1
  90. package/chunks/BlendLayers.glsl.js +1 -1
  91. package/chunks/ColorMaterial.glsl.js +14 -14
  92. package/chunks/Component.glsl.js +37 -37
  93. package/chunks/CypherParser.js +1 -1
  94. package/chunks/DefaultMaterial.glsl.js +15 -15
  95. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  96. package/chunks/HUDMaterial.glsl.js +3 -3
  97. package/chunks/MultiPathImpl.js +1 -1
  98. package/chunks/OperatorGeodesicBuffer.js +1 -1
  99. package/chunks/Path.glsl.js +15 -15
  100. package/chunks/Pattern.glsl.js +20 -20
  101. package/chunks/RasterColorizer.glsl.js +1 -1
  102. package/chunks/ShadowHighlight.glsl.js +1 -1
  103. package/chunks/Terrain.glsl.js +24 -24
  104. package/chunks/UnitFactory.js +1 -1
  105. package/chunks/Water.glsl.js +29 -20
  106. package/chunks/blosc-wasm.js +2 -0
  107. package/chunks/cameraUtilsSpherical.js +1 -1
  108. package/chunks/parquet.js +1 -1
  109. package/chunks/pdf.js +57 -0
  110. package/chunks/text.js +1 -1
  111. package/config.js +1 -1
  112. package/core/accessorSupport/write.js +1 -1
  113. package/core/scheduling.js +1 -1
  114. package/core/sql/SqlInterval.js +1 -1
  115. package/core/urlUtils.js +1 -1
  116. package/geometry/geometryEngine.js +1 -1
  117. package/geometry/operators/gx/operatorOffset.js +1 -1
  118. package/geometry/support/Ellipsoid.js +1 -1
  119. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  120. package/geometry/support/geodesicConstants.js +1 -1
  121. package/geometry/support/meshUtils/primitives.js +1 -1
  122. package/kernel.js +1 -1
  123. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  124. package/layers/VoxelWasmPerSceneView.js +1 -1
  125. package/layers/effects/parser.js +1 -1
  126. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  127. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -56
  128. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  129. package/layers/geospatialPDF/parserUtils.js +2 -0
  130. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  131. package/layers/graphics/data/QueryEngineResult.js +1 -1
  132. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  133. package/layers/parquet.js +1 -1
  134. package/layers/raster/datasets/ZarrRaster.js +1 -1
  135. package/layers/raster/datasets/wcsCoverageParser.js +1 -1
  136. package/layers/raster/formats/RasterCodec.js +1 -1
  137. package/layers/raster/formats/blosc.js +2 -0
  138. package/layers/support/BuildingFilter.js +1 -1
  139. package/layers/support/ControlPoint.js +1 -1
  140. package/layers/support/ControlPointsGeoreference.js +1 -1
  141. package/layers/support/IntegratedMeshSemantics.js +1 -1
  142. package/layers/support/commonProperties.js +1 -1
  143. package/layers/support/fieldUtils.d.ts +23 -87
  144. package/layers/support/fieldUtils.js +1 -1
  145. package/layers/support/geospatialPDFUtils.d.ts +63 -0
  146. package/layers/support/geospatialPDFUtils.js +2 -0
  147. package/layers/support/layersMapping.js +1 -1
  148. package/layers/video/VideoController.js +1 -1
  149. package/legend/ActiveLayerInfo.js +1 -1
  150. package/libs/ajv/ajv.bundle-wrapper.js +1 -1
  151. package/package.json +6 -6
  152. package/renderers/types.d.ts +1 -1
  153. package/rest/knowledgeGraphService.js +1 -1
  154. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  155. package/smartMapping/statistics/support/attributeDensity.js +1 -1
  156. package/smartMapping/support/adapters/support/utils.js +1 -1
  157. package/support/tests/serviceMockDependencies.js +1 -1
  158. package/symbols/CIMSymbol.d.ts +9 -9
  159. package/symbols/PathSymbol3DLayer.d.ts +1 -1
  160. package/symbols/WaterSymbol3DLayer.d.ts +13 -1
  161. package/symbols/WaterSymbol3DLayer.js +1 -1
  162. package/symbols/cim/CIMEffects.js +1 -1
  163. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  164. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  165. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  166. package/symbols/cim/rasterizingUtils.js +1 -1
  167. package/views/2d/PaddedViewState.js +1 -1
  168. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  169. package/views/2d/engine/vectorTiles/constants.js +1 -1
  170. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +1 -1
  171. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  172. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  173. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  174. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  175. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  176. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  177. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  178. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  179. package/views/2d/layers/ParquetLayerView2D.js +1 -1
  180. package/views/2d/layers/features/Processor.js +1 -1
  181. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  182. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  183. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  184. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  185. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  186. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  187. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  188. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  189. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  190. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  191. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  192. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  193. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  194. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
  195. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
  196. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  197. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  198. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  199. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +1 -1
  200. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  201. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  202. package/views/3d/camera/constraintUtils.js +1 -1
  203. package/views/3d/camera/intersectionUtils.js +1 -1
  204. package/views/3d/environment/EnvironmentView.js +1 -1
  205. package/views/3d/focusAreaUtils.js +1 -1
  206. package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
  207. package/views/3d/interactive/Manipulator3D.js +1 -1
  208. package/views/3d/interactive/Manipulator3DBase.js +1 -1
  209. package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
  210. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  211. package/views/3d/interactive/editingTools/manipulations/config.js +1 -1
  212. package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
  213. package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
  214. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  215. package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
  216. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  217. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  218. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  219. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  220. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  221. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  222. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  223. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  224. package/views/3d/layers/DrapedSubView3D.js +1 -1
  225. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  226. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  227. package/views/3d/layers/FlowSubView3D.js +1 -1
  228. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  229. package/views/3d/layers/I3SMeshView3D.js +1 -1
  230. package/views/3d/layers/RouteLayerView3D.js +1 -1
  231. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  232. package/views/3d/layers/TiledLayerView3D.js +1 -1
  233. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  234. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  235. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  236. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  237. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  238. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  239. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  240. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  241. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  242. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  243. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  244. package/views/3d/layers/graphics/Graphics3DSymbolFactory.js +1 -1
  245. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  246. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  247. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  248. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  249. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  250. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  251. package/views/3d/layers/i3s/I3SNode.js +1 -1
  252. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  253. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  254. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  255. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  256. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  257. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  258. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  259. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  260. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  261. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  262. package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
  263. package/views/3d/layers/support/createTileBVHForLayer.js +1 -1
  264. package/views/3d/layers/support/selectTiles3DSpatialReference.js +1 -1
  265. package/views/3d/layers/support/uvUtils.js +1 -1
  266. package/views/3d/state/Constraints.js +1 -1
  267. package/views/3d/state/ConstraintsManager.js +1 -1
  268. package/views/3d/state/NearFarHeuristic.js +1 -1
  269. package/views/3d/state/ViewState.js +1 -1
  270. package/views/3d/state/ViewStateManager.js +1 -1
  271. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  272. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  273. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  274. package/views/3d/state/controllers/RotateController.js +1 -1
  275. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  276. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  277. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  278. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  279. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  280. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  281. package/views/3d/state/utils/navigationUtils.js +1 -1
  282. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  283. package/views/3d/support/QualityProfile.js +1 -1
  284. package/views/3d/support/QualitySettings.js +1 -1
  285. package/views/3d/support/RenderCoordsHelper.js +1 -1
  286. package/views/3d/support/SweptSphereVolume.js +1 -1
  287. package/views/3d/support/cameraUtils.js +1 -1
  288. package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
  289. package/views/3d/support/engineContent/line.js +1 -1
  290. package/views/3d/support/engineContent/marker.js +1 -1
  291. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  292. package/views/3d/support/hitTest.js +1 -1
  293. package/views/3d/support/orientedBoundingBox.js +1 -1
  294. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  295. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  296. package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
  297. package/views/3d/support/sunUtils.js +1 -1
  298. package/views/3d/terrain/BlendLayersTechniqueConfiguration.js +1 -1
  299. package/views/3d/terrain/ExtentHelper.js +1 -1
  300. package/views/3d/terrain/OverlayManager.js +1 -1
  301. package/views/3d/terrain/OverlayRenderer.js +1 -1
  302. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  303. package/views/3d/terrain/RasterColorizerTechniqueConfiguration.js +1 -1
  304. package/views/3d/terrain/TerrainRenderer.js +1 -1
  305. package/views/3d/terrain/TerrainSurface.js +1 -1
  306. package/views/3d/terrain/Tile.js +1 -1
  307. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  308. package/views/3d/terrain/terrainUtils.js +1 -1
  309. package/views/3d/webgl/RenderCamera.js +1 -1
  310. package/views/3d/webgl-engine/Stage.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  312. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  313. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  314. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
  315. package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
  316. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  317. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  318. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  319. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  320. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  321. package/views/3d/webgl-engine/core/shaderLibrary/clampShadowPosition.glsl.js +2 -0
  322. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +14 -14
  323. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
  324. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  325. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -3
  326. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  327. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  328. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  329. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  330. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  331. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
  332. package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
  333. package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
  334. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  335. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  336. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  337. package/views/3d/webgl-engine/lib/Program.js +1 -1
  338. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  339. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  340. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  341. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  342. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  343. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  344. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  345. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  346. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  347. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  348. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  349. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  350. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  351. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  352. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  353. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  354. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  355. package/views/3d/webgl-engine/parts/Model.js +1 -1
  356. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  357. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  358. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  359. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  360. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  361. package/views/Attribution.js +5 -5
  362. package/views/DOMContainer.d.ts +2 -1
  363. package/views/MapView.d.ts +1 -0
  364. package/views/SceneView.js +1 -1
  365. package/views/View2D.js +1 -1
  366. package/views/ViewingMode.js +1 -1
  367. package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
  368. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  369. package/views/draw/DrawAction.js +1 -1
  370. package/views/draw/DrawGraphicTool.js +1 -1
  371. package/views/draw/DrawOperation.js +1 -1
  372. package/views/draw/DrawTool.js +1 -1
  373. package/views/draw/SegmentDrawAction.js +1 -1
  374. package/views/draw/support/Reshape.js +1 -1
  375. package/views/draw/support/helpMessageUtils.js +1 -1
  376. package/views/draw/support/managers/EditSessionManager.js +1 -1
  377. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  378. package/views/interactive/dragEventPipeline.js +1 -1
  379. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  380. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  381. package/views/interactive/editGeometry/operations/AddOrUpdatePart.js +1 -1
  382. package/views/layers/support/editableLayerViews.js +1 -1
  383. package/views/overlay/TextOverlayItem.js +1 -1
  384. package/views/support/DefaultsFromMap.js +1 -1
  385. package/views/support/Scheduler.js +1 -1
  386. package/views/support/spatialReferenceSupport.js +1 -1
  387. package/views/webgl/Program.js +3 -3
  388. package/views/webgl/ShaderBuilder.js +23 -23
  389. package/views/webgl/ShaderTranspiler.js +2 -2
  390. package/webscene/Slide.js +1 -1
  391. package/webscene/VirtualLighting.d.ts +2 -4
  392. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  393. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  394. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +17 -1
  395. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  396. package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +7 -0
  397. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  398. package/widgets/BatchAttributeForm.js +1 -1
  399. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  400. package/widgets/Editor/workflowUtils.js +1 -1
  401. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  402. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  403. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  404. package/widgets/FeatureForm.js +1 -1
  405. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  406. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  407. package/widgets/Measurement.js +1 -1
  408. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  409. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  410. package/widgets/Search/support/layerSearchUtils.js +1 -1
  411. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  412. package/widgets/Sketch/SketchViewModel.js +1 -1
  413. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  414. package/widgets/UtilityNetworkAssociations.js +1 -1
  415. package/widgets/Weather/WeatherViewModel.js +1 -1
  416. package/widgets/Weather/css.js +1 -1
  417. package/widgets/Weather.js +1 -1
  418. package/widgets/support/ContingentValuesManager.js +1 -1
  419. package/widgets/support/forms/types.d.ts +23 -1
  420. package/assets/esri/core/workers/chunks/021bd07b9a3e70598840.js +0 -1
  421. package/assets/esri/core/workers/chunks/032733b863426c5bde00.js +0 -1121
  422. package/assets/esri/core/workers/chunks/144f18a3dd2c8cf07cf7.js +0 -1
  423. package/assets/esri/core/workers/chunks/170e68624b71ac96de4a.js +0 -1
  424. package/assets/esri/core/workers/chunks/23fc1c1ed483ed3b2298.js +0 -1
  425. package/assets/esri/core/workers/chunks/2634927d26cb1139c6d0.js +0 -1
  426. package/assets/esri/core/workers/chunks/2d1b8154ee40afc9d40b.js +0 -1
  427. package/assets/esri/core/workers/chunks/2d3e977f3b75474d7ebc.js +0 -1
  428. package/assets/esri/core/workers/chunks/4a41bf3d1e2e9bb79771.js +0 -2
  429. package/assets/esri/core/workers/chunks/5f324d88785ffcb73ae0.js +0 -1
  430. package/assets/esri/core/workers/chunks/70695e0fb53018d48e7b.js +0 -2
  431. package/assets/esri/core/workers/chunks/723c9ad4c25be2b82476.js +0 -1
  432. package/assets/esri/core/workers/chunks/766a1357be2ed7f4e125.js +0 -1
  433. package/assets/esri/core/workers/chunks/817bf487df056da1e6ec.js +0 -1
  434. package/assets/esri/core/workers/chunks/89e55895683369b5277a.js +0 -1
  435. package/assets/esri/core/workers/chunks/8a820e303941b351de81.js +0 -1
  436. package/assets/esri/core/workers/chunks/8c94e987754b3919181e.js +0 -1
  437. package/assets/esri/core/workers/chunks/90d567e920b6982b402d.js +0 -1
  438. package/assets/esri/core/workers/chunks/919115788da38049aea7.js +0 -2
  439. package/assets/esri/core/workers/chunks/97cdcedfe853280f6258.js +0 -1
  440. package/assets/esri/core/workers/chunks/9ebc6026934400fc1e1f.js +0 -1
  441. package/assets/esri/core/workers/chunks/b33e7e74cf8fa3926617.js +0 -1
  442. package/assets/esri/core/workers/chunks/b4a325dcf50e276751d7.js +0 -1
  443. package/assets/esri/core/workers/chunks/bb2af16e55cb39163827.js +0 -1
  444. package/assets/esri/core/workers/chunks/be5857b0d1b00faf430b.js +0 -1
  445. package/assets/esri/core/workers/chunks/cd9100a7c8309dfa7569.js +0 -1
  446. package/assets/esri/core/workers/chunks/d5bb9f9b7b341c671525.js +0 -1
  447. package/assets/esri/core/workers/chunks/d96e63d66f7b1f4ea54a.js +0 -2
  448. package/assets/esri/core/workers/chunks/e3bcd2e356f75afc316a.js +0 -1
  449. package/assets/esri/core/workers/chunks/e507dfc4788295d9c244.js +0 -1
  450. package/assets/esri/core/workers/chunks/e58f51618251f74aaafd.js +0 -1
  451. package/assets/esri/core/workers/chunks/e80526571f1a34de3278.js +0 -1
  452. package/assets/esri/core/workers/chunks/e83806797979138fd22a.js +0 -1
  453. package/assets/esri/core/workers/chunks/ea71850ba87ae6038000.js +0 -1
  454. package/assets/esri/core/workers/chunks/f537a5e808dc546813c7.js +0 -1
  455. package/assets/esri/core/workers/chunks/fe811d651d201f698b8f.js +0 -2
  456. package/chunks/NativeLine.glsl.js +0 -8
  457. package/layers/geospatialPDF/geospatialPDFParserUtils.js +0 -2
  458. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +0 -2
  459. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +0 -2
  460. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +0 -2
  461. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +0 -2
  462. /package/assets/esri/core/workers/chunks/{919115788da38049aea7.js.LICENSE.txt → 3d851710f7fcc27c5b60.js.LICENSE.txt} +0 -0
  463. /package/assets/esri/core/workers/chunks/{fe811d651d201f698b8f.js.LICENSE.txt → 5bdd95eeb8f34dbf26f2.js.LICENSE.txt} +0 -0
  464. /package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js.LICENSE.txt → 5e47026c681238038955.js.LICENSE.txt} +0 -0
  465. /package/assets/esri/core/workers/chunks/{4a41bf3d1e2e9bb79771.js.LICENSE.txt → d7763c42754152510e13.js.LICENSE.txt} +0 -0
  466. /package/assets/esri/core/workers/chunks/{d96e63d66f7b1f4ea54a.js.LICENSE.txt → e96fa029acba59c04e4e.js.LICENSE.txt} +0 -0
  467. /package/assets/esri/core/workers/chunks/{70695e0fb53018d48e7b.js.LICENSE.txt → fdfbd201be372d3796bf.js.LICENSE.txt} +0 -0
@@ -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 has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";function t(e){return a[e]}function n(){return has(`esri-iPhone`)?`low`:`medium`}const r={reset(){a=o()}},i={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430};let a=o();function o(){return{low:s(`low`),medium:s(`medium`),high:s(`high`)}}function s(t){let n=!!has(`esri-mobile`),r=!has(`ios`),a=e=>e[t];return{graphics3D:{maxTotalNumberOfFeatures:a({low:5e4,medium:15e4,high:3e5}),maxNumberOfDrawCalls:a({low:8e3,medium:17e3,high:17e3}),maxTotalNumberOfVertices:a({low:255e4,medium:625e4,high:125e5}),polygonLodFactor:a({low:.5,medium:n?.8:1,high:n?1.2:2}),polylineLodFactor:a({low:1,medium:n?1.2:1.5,high:n?1.2:2}),snapshotAvailable:a({low:!1,medium:r,high:r}),skipHighSymbolLods:a({low:!0,medium:!1,high:!1})},heatmap:{pixelRatio:a({low:.125,medium:.25,high:.5})},sceneService:{objectLoDFactor:a({low:.2,medium:1,high:1}),pointLoDFactor:a({low:1,medium:1,high:1}),meshLoDFactor:a({low:.6,medium:1,high:1}),pointCloudLoDFactor:a({low:.5,medium:1,high:1})},gaussianSplat:{minimumPixelRadius:a({low:2,medium:1,high:.5}),minimumOpacity:a({low:0,medium:1,high:2}),maximumNumberOfGaussians:a({low:1e6,medium:n?1e6:3e6,high:6e6})},flow:{maxTotalNumberOfStreamlines:a({low:5e3,medium:2e4,high:2e4}),maxTracingResolution:a({low:1024,medium:2048,high:2048}),transitionEnabled:a({low:!1,medium:!0,high:!0})},tiledSurface:{lodBias:a({low:-1,medium:0,high:0}),angledSplitBias:a({low:.5,medium:1,high:1}),vtlContentZoom:a({low:.75,medium:1.5,high:1.5}),elevationLevelDelta:a({low:3,medium:3,high:2}),reduceTileLevelDifferences:a({low:!0,medium:!0,high:!0})},fadeDuration:e(a({low:0,medium:400,high:400})),physicallyBasedRenderingEnabled:a({low:!1,medium:!0,high:!0}),maxTexturePixels:a({low:n?1024**2:2048**2,medium:n?2048**2:4096**2,high:n?4096**2:1/0}),memoryLimit:a({low:200+i.IPhone12Pro,medium:n?600+i.GalaxyS20:750+i.FullHD,high:n?900+i.SurfacePro7:1500+i.FullHDRetina})*1048576,additionalCacheMemory:a({low:0,medium:n?-100:150,high:n?-150:0})*1048576,frameRate:a({low:0,medium:0,high:0}),maximumPixelRatio:a({low:1,medium:1,high:n?1:1/0})}}export{r as QualityProfileTest,n as getDefaultQualityProfileName,t as getQualityProfileSettings};
2
+ import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";function t(e){return a[e]}function n(){return has(`esri-iPhone`)?`low`:`medium`}const r={reset(){a=o()}},i={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430};let a=o();function o(){return{low:s(`low`),medium:s(`medium`),high:s(`high`)}}function s(t){let n=!!has(`esri-mobile`),r=!has(`ios`),a=e=>e[t];return{graphics3D:{maxTotalNumberOfFeatures:a({low:5e4,medium:15e4,high:3e5}),maxNumberOfDrawCalls:a({low:8e3,medium:17e3,high:17e3}),maxTotalNumberOfVertices:a({low:255e4,medium:625e4,high:125e5}),polygonLodFactor:a({low:.5,medium:n?.8:1,high:n?1.2:2}),polylineLodFactor:a({low:1,medium:n?1.2:1.5,high:n?1.2:2}),snapshotAvailable:a({low:!1,medium:r,high:r}),skipHighSymbolLods:a({low:!0,medium:!1,high:!1})},heatmap:{pixelRatio:a({low:.125,medium:.25,high:.5})},sceneService:{objectLoDFactor:a({low:.2,medium:1,high:1}),meshLoDFactor:a({low:.6,medium:1,high:1}),pointCloudLoDFactor:a({low:.5,medium:1,high:1})},gaussianSplat:{minimumPixelRadius:a({low:2,medium:1,high:.5}),minimumOpacity:a({low:0,medium:1,high:2}),maximumNumberOfGaussians:a({low:1e6,medium:n?1e6:3e6,high:6e6})},flow:{maxTotalNumberOfStreamlines:a({low:5e3,medium:2e4,high:2e4}),maxTracingResolution:a({low:1024,medium:2048,high:2048}),transitionEnabled:a({low:!1,medium:!0,high:!0})},tiledSurface:{lodBias:a({low:-1,medium:0,high:0}),angledSplitBias:a({low:.5,medium:1,high:1}),elevationLevelDelta:a({low:3,medium:3,high:2})},fadeDuration:e(a({low:0,medium:400,high:400})),physicallyBasedRenderingEnabled:a({low:!1,medium:!0,high:!0}),maxTexturePixels:a({low:n?1024**2:2048**2,medium:n?2048**2:4096**2,high:n?4096**2:1/0}),memoryLimit:a({low:200+i.IPhone12Pro,medium:n?600+i.GalaxyS20:750+i.FullHD,high:n?900+i.SurfacePro7:1500+i.FullHDRetina})*1048576,additionalCacheMemory:a({low:0,medium:n?-100:150,high:n?-150:0})*1048576,maximumPixelRatio:a({low:1,medium:1,high:n?1:1/0})}}export{r as QualityProfileTest,n as getDefaultQualityProfileName,t as getQualityProfileSettings};
@@ -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,subclass as r}from"../../../core/accessorSupport/decorators.js";import{Milliseconds as i}from"../../../core/time.js";let a=class extends t{constructor(e={}){super(e),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};e([n()],a.prototype,`maxTotalNumberOfFeatures`,void 0),e([n()],a.prototype,`maxNumberOfDrawCalls`,void 0),e([n()],a.prototype,`maxTotalNumberOfVertices`,void 0),e([n()],a.prototype,`snapshotAvailable`,void 0),e([n()],a.prototype,`polygonLodFactor`,void 0),e([n()],a.prototype,`polylineLodFactor`,void 0),e([n()],a.prototype,`skipHighSymbolLods`,void 0),a=e([r(`esri.views.3d.support.QualitySettings.Graphics3DSettings`)],a);let o=class extends t{constructor(e={}){super(e),this.objectLoDFactor=1,this.pointLoDFactor=1,this.meshLoDFactor=1,this.pointCloudLoDFactor=1}};e([n()],o.prototype,`objectLoDFactor`,void 0),e([n()],o.prototype,`pointLoDFactor`,void 0),e([n()],o.prototype,`meshLoDFactor`,void 0),e([n()],o.prototype,`pointCloudLoDFactor`,void 0),o=e([r(`esri.views.3d.support.QualitySettings.SceneServiceSettings`)],o);let s=class extends t{constructor(e={}){super(e),this.lodBias=0,this.angledSplitBias=1,this.vtlContentZoom=1,this.elevationLevelDelta=3,this.reduceTileLevelDifferences=!0}};e([n()],s.prototype,`lodBias`,void 0),e([n()],s.prototype,`angledSplitBias`,void 0),e([n()],s.prototype,`vtlContentZoom`,void 0),e([n()],s.prototype,`elevationLevelDelta`,void 0),e([n()],s.prototype,`reduceTileLevelDifferences`,void 0),s=e([r(`esri.views.3d.support.QualitySettings.TiledSurfaceSettings`)],s);let c=class extends t{constructor(e={}){super(e),this.minimumPixelRadius=1,this.minimumOpacity=1,this.maximumNumberOfGaussians=2e6}};e([n()],c.prototype,`minimumPixelRadius`,void 0),e([n()],c.prototype,`minimumOpacity`,void 0),e([n()],c.prototype,`maximumNumberOfGaussians`,void 0),c=e([r(`esri.views.3d.support.QualitySettings.GaussianSplatSettings`)],c);let l=class extends t{constructor(e={}){super(e),this.pixelRatio=1}};e([n()],l.prototype,`pixelRatio`,void 0),l=e([r(`esri.views.3d.support.QualitySettings.HeatmapSettings`)],l);let u=class extends t{constructor(){super(...arguments),this.maxTotalNumberOfStreamlines=1e5,this.maxTracingResolution=2048,this.transitionEnabled=!0}};e([n()],u.prototype,`maxTotalNumberOfStreamlines`,void 0),e([n()],u.prototype,`maxTracingResolution`,void 0),e([n()],u.prototype,`transitionEnabled`,void 0),u=e([r(`esri.views.3d.support.QualitySettings.FlowSettings`)],u);let d=class extends t{constructor(e){super(e),this.graphics3D=new a,this.sceneService=new o,this.tiledSurface=new s,this.gaussianSplat=new c,this.heatmap=new l,this.flow=new u,this.fadeDuration=i(400),this.physicallyBasedRenderingEnabled=!1,this.maxTexturePixels=1/0,this.memoryLimit=786432e3,this.additionalCacheMemory=0,this.frameRate=0,this.maximumPixelRatio=1/0}};e([n({type:a})],d.prototype,`graphics3D`,void 0),e([n({type:o})],d.prototype,`sceneService`,void 0),e([n({type:s})],d.prototype,`tiledSurface`,void 0),e([n({type:c})],d.prototype,`gaussianSplat`,void 0),e([n({type:l})],d.prototype,`heatmap`,void 0),e([n({type:u})],d.prototype,`flow`,void 0),e([n()],d.prototype,`fadeDuration`,void 0),e([n()],d.prototype,`physicallyBasedRenderingEnabled`,void 0),e([n()],d.prototype,`maxTexturePixels`,void 0),e([n()],d.prototype,`memoryLimit`,void 0),e([n()],d.prototype,`additionalCacheMemory`,void 0),e([n()],d.prototype,`frameRate`,void 0),e([n()],d.prototype,`maximumPixelRatio`,void 0),d=e([r(`esri.views.3d.support.QualitySettings`)],d);const f=d;export{f as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{Milliseconds as i}from"../../../core/time.js";let a=class extends t{constructor(e={}){super(e),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};e([n()],a.prototype,`maxTotalNumberOfFeatures`,void 0),e([n()],a.prototype,`maxNumberOfDrawCalls`,void 0),e([n()],a.prototype,`maxTotalNumberOfVertices`,void 0),e([n()],a.prototype,`snapshotAvailable`,void 0),e([n()],a.prototype,`polygonLodFactor`,void 0),e([n()],a.prototype,`polylineLodFactor`,void 0),e([n()],a.prototype,`skipHighSymbolLods`,void 0),a=e([r(`esri.views.3d.support.QualitySettings.Graphics3DSettings`)],a);let o=class extends t{constructor(e={}){super(e),this.objectLoDFactor=1,this.meshLoDFactor=1,this.pointCloudLoDFactor=1}};e([n()],o.prototype,`objectLoDFactor`,void 0),e([n()],o.prototype,`meshLoDFactor`,void 0),e([n()],o.prototype,`pointCloudLoDFactor`,void 0),o=e([r(`esri.views.3d.support.QualitySettings.SceneServiceSettings`)],o);let s=class extends t{constructor(e={}){super(e),this.lodBias=0,this.angledSplitBias=1,this.elevationLevelDelta=3}};e([n()],s.prototype,`lodBias`,void 0),e([n()],s.prototype,`angledSplitBias`,void 0),e([n()],s.prototype,`elevationLevelDelta`,void 0),s=e([r(`esri.views.3d.support.QualitySettings.TiledSurfaceSettings`)],s);let c=class extends t{constructor(e={}){super(e),this.minimumPixelRadius=1,this.minimumOpacity=1,this.maximumNumberOfGaussians=2e6}};e([n()],c.prototype,`minimumPixelRadius`,void 0),e([n()],c.prototype,`minimumOpacity`,void 0),e([n()],c.prototype,`maximumNumberOfGaussians`,void 0),c=e([r(`esri.views.3d.support.QualitySettings.GaussianSplatSettings`)],c);let l=class extends t{constructor(e={}){super(e),this.pixelRatio=1}};e([n()],l.prototype,`pixelRatio`,void 0),l=e([r(`esri.views.3d.support.QualitySettings.HeatmapSettings`)],l);let u=class extends t{constructor(){super(...arguments),this.maxTotalNumberOfStreamlines=1e5,this.maxTracingResolution=2048,this.transitionEnabled=!0}};e([n()],u.prototype,`maxTotalNumberOfStreamlines`,void 0),e([n()],u.prototype,`maxTracingResolution`,void 0),e([n()],u.prototype,`transitionEnabled`,void 0),u=e([r(`esri.views.3d.support.QualitySettings.FlowSettings`)],u);let d=class extends t{constructor(e){super(e),this.graphics3D=new a,this.sceneService=new o,this.tiledSurface=new s,this.gaussianSplat=new c,this.heatmap=new l,this.flow=new u,this.fadeDuration=i(400),this.physicallyBasedRenderingEnabled=!1,this.maxTexturePixels=1/0,this.memoryLimit=786432e3,this.additionalCacheMemory=0,this.maximumPixelRatio=1/0}};e([n({type:a})],d.prototype,`graphics3D`,void 0),e([n({type:o})],d.prototype,`sceneService`,void 0),e([n({type:s})],d.prototype,`tiledSurface`,void 0),e([n({type:c})],d.prototype,`gaussianSplat`,void 0),e([n({type:l})],d.prototype,`heatmap`,void 0),e([n({type:u})],d.prototype,`flow`,void 0),e([n()],d.prototype,`fadeDuration`,void 0),e([n()],d.prototype,`physicallyBasedRenderingEnabled`,void 0),e([n()],d.prototype,`maxTexturePixels`,void 0),e([n()],d.prototype,`memoryLimit`,void 0),e([n()],d.prototype,`additionalCacheMemory`,void 0),e([n()],d.prototype,`maximumPixelRatio`,void 0),d=e([r(`esri.views.3d.support.QualitySettings`)],d);const f=d;export{f as default};
@@ -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{removeMaybe as e}from"../../../../core/maybe.js";import{TaskPriority as t}from"../../../support/Scheduler.js";import{memoryEstimators as n}from"../../layers/graphics/defaultSymbolComplexity.js";import{BufferObject3D as r}from"../../webgl-engine/lib/BufferObject3D.js";import{WebGLLayer as i}from"../../webgl-engine/lib/WebGLLayer.js";import{streamlinGeometryBatchSize as a}from"./constants.js";import{StreamlineResources3D as o}from"./StreamlineResources3D.js";class s extends o{constructor(e,t,r,i,a){let o=n.LINE_ROUND.bytesPerFeature;super(e,t,r,i,o),this._view=a,this._objects3D=[],this._engineLayer=null,this._frameTask=null}get attached(){return this._engineLayer!=null}async attach(){let{geometries:e}=this;e!=null&&(this.detach(),this._frameTask=this._view.resourceController.scheduler.registerTask(t.FLOW_GENERATOR),await this._frameTask.scheduleGenerator(t=>this._addGeometryToLayer(e,t)))}detach(){this.attached&&(this._engineLayer?.removeMany(this._objects3D),this._objects3D.forEach(e=>e.dispose()),this._engineLayer?.commit(),this._objects3D=[],this._engineLayer=null,this._frameTask=e(this._frameTask))}async*_addGeometryToLayer(e,t){let{stage:n}=this._view,o=new i(n,{pickable:!1,updatePolicy:1});for(let n=0;n<e.length;n+=a){let i=new r({geometries:e.slice(n,n+a),castShadow:!1});o.add(i),this._objects3D.push(i),o.commit(),t.madeProgress(),t.done&&(t=yield)}this._engineLayer=o}}export{s as StreamlineResources3DShape};
2
+ import{removeMaybe as e}from"../../../../core/maybe.js";import{TaskPriority as t}from"../../../support/Scheduler.js";import{memoryEstimators as n}from"../../layers/graphics/defaultSymbolComplexity.js";import{BufferObject3D as r}from"../../webgl-engine/lib/BufferObject3D.js";import{WebGLLayer as i}from"../../webgl-engine/lib/WebGLLayer.js";import{streamlinGeometryBatchSize as a}from"./constants.js";import{StreamlineResources3D as o}from"./StreamlineResources3D.js";class s extends o{constructor(e,t,r,i,a){let o=n.LINE_ROUND.bytesPerFeature;super(e,t,r,i,o),this._view=a,this._objects3D=[],this._engineLayer=null,this._frameTask=null}get attached(){return this._engineLayer!=null}async attach(){let{geometries:e}=this;e!=null&&(this.detach(),this._frameTask=this._view.resourceController.scheduler.registerTask(t.FLOW_GENERATOR),await this._frameTask.scheduleGenerator(t=>this._addGeometryToLayer(e,t)))}detach(){this.attached&&(this._engineLayer?.removeMany(this._objects3D),this._objects3D.forEach(e=>e.dispose()),this._engineLayer?.commit(),this._objects3D=[],this._engineLayer=null,this._frameTask=e(this._frameTask))}async*_addGeometryToLayer(e,t){let{stage:n}=this._view,o=new i(n,{pickable:!1,updatePolicy:1});for(let n=0;n<e.length;n+=a){let i=new r({geometries:e.slice(n,n+a)});o.add(i),this._objects3D.push(i),o.commit(),t.madeProgress(),t.done&&(t=yield)}this._engineLayer=o}}export{s as StreamlineResources3DShape};
@@ -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};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{fromQuat as e,scale as t}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as i,conjugate as a,multiply as o}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as s,create as c}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{transformQuat as l,dot as u,cross as d,len as f,scale as p,distance as m,direction as h,set as g,transformMat3 as _,add as v,transformQuatValues as y,sub as b,abs as x,max as S,min as C,length as w,scaleAndAdd as T,sign as E,multiply as D}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as O,freeze as k,create as A,UNIT_Z as j}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as ee}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{create as te}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as ne}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as re}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as M}from"../../../geometry/projection/projectBuffer.js";import{getProjector as ie}from"../../../geometry/projection/projectors.js";import{getSphericalPCPF as N}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{getNormal as P}from"../../../geometry/support/plane.js";import{isPlateCarree as F}from"../../../geometry/support/spatialReferenceUtils.js";import{Vertices as ae}from"../webgl-engine/lib/Attribute.js";import{computeOBB as oe}from"./dito.js";class I{constructor(e=O,t=ge,n=s){this._data=[e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2],n[3]]}clone(){return I.fromData(this._data)}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(e){let t=new I;return t._copyFromData(e),t}static fromJSON(e){return new I(e.center,e.halfSize,e.quaternion)}copy(e){this._copyFromData(e.data)}_copyFromData(e){for(let t=0;t<10;++t)this._data[t]=e[t]}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(e){return e[0]=this._data[0],e[1]=this._data[1],e[2]=this._data[2],e}setCenter(e){this._data[0]=e[0],this._data[1]=e[1],this._data[2]=e[2]}setCenterFromValues(e,t,n){this._data[0]=e,this._data[1]=t,this._data[2]=n}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(e){return e[0]=this._data[3],e[1]=this._data[4],e[2]=this._data[5],e}setHalfSize(e){this._data[3]=e[0],this._data[4]=e[1],this._data[5]=e[2]}setHalfSizeFromValues(e,t,n){this._data[3]=e,this._data[4]=t,this._data[5]=n}getQuaternion(e){return e[0]=this._data[6],e[1]=this._data[7],e[2]=this._data[8],e[3]=this._data[9],e}getQuaternionConjugate(e){return e[0]=-this._data[6],e[1]=-this._data[7],e[2]=-this._data[8],e[3]=this._data[9],e}setQuaternion(e){this._data[6]=e[0],this._data[7]=e[1],this._data[8]=e[2],this._data[9]=e[3]}get data(){return this._data}getCorners(e){let t=this._data,n=i(L,t[6],t[7],t[8],t[9]);for(let r=0;r<8;++r){let i=e[r];i[0]=(r&1?-1:1)*t[3],i[1]=(r&2?-1:1)*t[4],i[2]=(r&4?-1:1)*t[5],l(i,i,n),i[0]+=t[0],i[1]+=t[1],i[2]+=t[2]}return e}getAxes(e){let t=this._data,n=i(L,t[6],t[7],t[8],t[9]);return l(e[0],[1,0,0],n),l(e[1],[0,1,0],n),l(e[2],[0,0,1],n),e}intersectsFrustum(e){let{centerX:t,centerY:n,centerZ:r}=this,i=e.planes;for(let e of i){let i=P(e),a=this.projectedRadius(i);if(t*i[0]+n*i[1]+r*i[2]+e[3]-a>0)return!1}let a=this.getAxes(ye),o=e.points,s=this.getHalfSize(q);for(let e=0;e<3;++e){let i=a[e],c=-i[0]*t-i[1]*n-i[2]*r,l=s[e],d=!0,f=!0;for(let e of o){let t=u(e,i)+c;d&&=t>l,f&&=t<-l}if(d||f)return!1}if(this.getCorners(X).some(t=>e.intersectsPoint(t)))return!0;let c=xe;for(let e=0;e<3;++e){let i=a[e];c[e]=i[0]*t+i[1]*n+i[2]*r}let l=e=>{for(let t=0;t<3;++t){let n=a[t],r=s[t],i=n[0]*e[0]+n[1]*e[1]+n[2]*e[2]-c[t];if(i>r||i<-r)return!1}return!0};if(e.points.some(e=>l(e)))return!0;let m=e.lines,h=be;for(let e=0;e<8;++e){let i=m[e].direction;for(let e of a){d(h,i,e);let a=f(h);if(a>0)p(h,h,1/a);else continue;let s=this.projectedRadius(h),c=h[0]*t+h[1]*n+h[2]*r,l=c-s,m=c+s,g=!1,_=!1,v=!0;for(let e of o){let t=u(h,e);if(t>m){if(_){v=!1;break}g=!0}else if(t<l){if(g){v=!1;break}_=!0}else{v=!1;break}}if(v)return!1}}return!0}intersectsFrustumConservativeApproximation(e){return this.intersectPlane(e[0])<=0&&this.intersectPlane(e[1])<=0&&this.intersectPlane(e[2])<=0&&this.intersectPlane(e[3])<=0&&this.intersectPlane(e[4])<=0&&this.intersectPlane(e[5])<=0}intersectsFrustumConservativeApproximationWithMargin(e,t){return this.signedDistanceRangePlane(e[0]).min<=t&&this.signedDistanceRangePlane(e[1]).min<=t&&this.signedDistanceRangePlane(e[2]).min<=t&&this.signedDistanceRangePlane(e[3]).min<=t&&this.signedDistanceRangePlane(e[4]).min<=t&&this.signedDistanceRangePlane(e[5]).min<=t}get radius(){let e=this._data[3],t=this._data[4],n=this._data[5];return Math.sqrt(e*e+t*t+n*n)}intersectsPoint(e){let t=this.getAxes(ye),n=this.getHalfSize(q),r=this.getCenter(K);for(let i=0;i<3;++i){let a=t[i],o=n[i],s=u(a,e)-u(a,r);if(s>o||s<-o)return!1}return!0}intersectSphere(e){let{center:t,radius:n}=e,r=this._data,i=r[3],a=r[4],o=r[5],s=i+a+o+n,c=r[0]-t[0];if(Math.abs(c)>s)return!1;let l=r[1]-t[1];if(Math.abs(l)>s)return!1;let u=r[2]-t[2];if(Math.abs(u)>s)return!1;let d=-r[6],f=-r[7],p=-r[8],m=r[9],h=f*u-p*l,g=p*c-d*u,_=d*l-f*c,v=f*_-p*g,y=p*h-d*_,b=d*g-f*h,x=m*2,S=Math.abs(c+h*x+v*2),C=Math.abs(l+g*x+y*2),w=Math.abs(u+_*x+b*2),T=Math.min(S,i),E=Math.min(C,a),D=Math.min(w,o),O=S-T,k=C-E,A=w-D;return O*O+k*k+A*A<=n*n}intersectSphereWithMBS(e,t=this.radius){let n=this._data,{center:r,radius:i}=e,a=t+i,o=n[0]-r[0];if(o>a)return!1;let s=n[1]-r[1];if(s>a)return!1;let c=n[2]-r[2];if(c>a||o*o+s*s+c*c>a*a)return!1;let l=-n[6],u=-n[7],d=-n[8],f=n[9],p=u*c-d*s,m=d*o-l*c,h=l*s-u*o,g=u*h-d*m,_=d*p-l*h,v=l*m-u*p,y=f*2,b=Math.abs(o+p*y+g*2),x=Math.abs(s+m*y+_*2),S=Math.abs(c+h*y+v*2),C=Math.min(b,n[3]),w=Math.min(x,n[4]),T=Math.min(S,n[5]),E=b-C,D=x-w,O=S-T;return E*E+D*D+O*O<i*i}intersectPlane(e){let t=e[0]*this._data[0]+e[1]*this._data[1]+e[2]*this._data[2]+e[3],n=this.projectedRadius(P(e));return t>n?1:t<-n?-1:0}intersectRay(e,t,n=0,r=-1/0,i=1/0){let a=this._data,o=L;o[0]=-a[6],o[1]=-a[7],o[2]=-a[8],o[3]=a[9],z[0]=e[0]-a[0],z[1]=e[1]-a[1],z[2]=e[2]-a[2];let s=l(z,z,L),c=l(ce,t,L),u=r,d=i,f=this.getHalfSize(q);for(let e=0;e<3;e++){let t=s[e],r=c[e],i=f[e]+n;if(Math.abs(r)>1e-6){let e=(i-t)/r,n=(-i-t)/r;u=Math.max(u,Math.min(e,n)),d=Math.min(d,Math.max(e,n))}else if(t>i||t<-i)return!1}return u<=d}intersectSegment(e,t,n=0){let r=m(e,t);return h(U,e,t),this.intersectRay(e,U,n,0,r)}projectedArea(n,r,i,o){let s=this.getQuaternion(R);a(L,s),z[0]=n[0]-this._data[0],z[1]=n[1]-this._data[1],z[2]=n[2]-this._data[2],l(z,z,L);let c=this.getHalfSize(q),u=z[0]<-c[0]?-1:+(z[0]>c[0]),d=z[1]<-c[1]?-1:+(z[1]>c[1]),f=z[2]<-c[2]?-1:+(z[2]>c[2]),p=Math.abs(u)+Math.abs(d)+Math.abs(f);if(p===0)return 1/0;let m=p===1?4:6,h=(u+d*3+f*9+13)*6;e(J,s),t(J,J,c);let y=this.getCenter(K);for(let e=0;e<m;e++){let t=ue[h+e];g(z,((t&1)<<1)-1,(t&2)-1,((t&4)>>1)-1),_(z,z,J),v(B,y,z),B[3]=1,ee(B,B,r);let n=1/Math.max(1e-6,B[3]);V[e*2]=B[0]*n,V[e*2+1]=B[1]*n}let b=m*2-2,x=V[0]*(V[3]-V[b+1])+V[b]*(V[1]-V[b-1]);for(let e=2;e<b;e+=2)x+=V[e]*(V[e+3]-V[e-1]);return Math.abs(x)*i*o*.125}projectedRadius(e){let t=this._data;return y(z,e,-t[6],-t[7],-t[8],t[9]),Math.abs(z[0]*t[3])+Math.abs(z[1]*t[4])+Math.abs(z[2]*t[5])}signedDistancePlane(e,t){let n=this._data,r=e[0]*n[0]+e[1]*n[1]+e[2]*n[2]+t,i=this.projectedRadius(e);return r>i?r-i:r<-i?r+i:0}signedDistanceRangePlane(e){let t=e[0]*this._data[0]+e[1]*this._data[1]+e[2]*this._data[2]+e[3],n=this.projectedRadius(P(e));return{min:t-n,max:t+n}}toAaBoundingBox(t){let n=this.getQuaternion(R),r=e(J,n),i=this._data[3]*Math.abs(r[0])+this._data[4]*Math.abs(r[3])+this._data[5]*Math.abs(r[6]),a=this._data[3]*Math.abs(r[1])+this._data[4]*Math.abs(r[4])+this._data[5]*Math.abs(r[7]),o=this._data[3]*Math.abs(r[2])+this._data[4]*Math.abs(r[5])+this._data[5]*Math.abs(r[8]);t[0]=this._data[0]-i,t[1]=this._data[1]-a,t[2]=this._data[2]-o,t[3]=this._data[0]+i,t[4]=this._data[1]+a,t[5]=this._data[2]+o}transform(e,t,n,r=0,i=N(n),a=N(t),o=ie(t,a)){if(n===i)t.isGeographic?he(this,e,t,r,a):me(this,e,t,r,a,o);else if(t.isGeographic&&(n.isWebMercator||F(n)))fe(t,this,n,e,r);else if(t.isWebMercator&&F(n))pe(t,this,n,e,r);else{let i=this.getCenter(K);i[2]+=r,M(i,t,0,i,n,0),e.setCenter(i),this!==e&&(e.setQuaternion(this.getQuaternion(R)),e.setHalfSize(this.getHalfSize(q)))}}}const L=c(),R=c(),se=c(),z=A(),ce=A(),B=te();function le(e,t=new I){return oe(e,t),t}const V=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],ue=(()=>{let e=new Int8Array(162),t=0,n=n=>{for(let r=0;r<n.length;r++)e[t+r]=n[r];t+=6};return n([6,2,3,1,5,4]),n([0,2,3,1,5,4]),n([0,2,3,7,5,4]),n([0,1,3,2,6,4]),n([0,1,3,2,0,0]),n([0,1,5,7,3,2]),n([0,1,3,7,6,4]),n([0,1,3,7,6,2]),n([0,1,5,7,6,2]),n([0,1,5,4,6,2]),n([0,1,5,4,0,0]),n([0,1,3,7,5,4]),n([0,2,6,4,0,0]),n([0,0,0,0,0,0]),n([1,3,7,5,0,0]),n([2,3,7,6,4,0]),n([2,3,7,6,0,0]),n([2,3,1,5,7,6]),n([0,1,5,7,6,2]),n([0,1,5,7,6,4]),n([0,1,3,7,6,4]),n([4,5,7,6,2,0]),n([4,5,7,6,0,0]),n([4,5,1,3,7,6]),n([0,2,3,7,5,4]),n([6,2,3,7,5,4]),n([6,2,3,1,5,4]),e})();function de(e,t,n,r,i){let o=e.getQuaternion(R);i.setQuaternion(o),a(L,o);let s=e.getCenter(K),c=e.getHalfSize(q);if(r===1){l(Z,s,L),x(Q,Z),C($,Q,c),b($,Q,$);let r=w($);v($,Q,c);let a=w($);if(r<n)i.setCenter(s),g(Z,n,n,n),i.setHalfSize(v(Z,c,Z));else{let o=a>0?1+t/a:1,s=r>0?1+n/r:1,u=(s+o)/2,d=(s-o)/2;p($,Q,d),i.setHalfSize(T($,$,c,u)),p($,Q,u),T($,$,c,d),E(Z,Z),D(Z,$,Z);let f=e.getQuaternion(se);i.setCenter(l(Z,Z,f))}}else{i.setCenter(T(Z,s,j,(n+t)/2));let e=l(Z,j,L);x(e,e),i.setHalfSize(T(Q,c,e,(n-t)/2))}return i}function fe(e,t,n,r,i){let a=t.getCenter(K);a[2]+=i;let o=N(n);M(a,e,0,a,o,0),H(o,t,a,n,r)}function pe(e,t,n,r,i){let a=t.getCenter(K);a[2]+=i,H(e,t,a,n,r)}function H(t,n,r,i,a){let o=n.getQuaternion(R),s=e(J,o),c=n.getHalfSize(q);for(let e=0;e<8;++e){for(let t=0;t<3;++t)G[t]=c[t]*(e&1<<t?-1:1);for(let t=0;t<3;++t){let n=r[t];for(let e=0;e<3;++e)n+=G[e]*s[3*e+t];W[e*3+t]=n}}M(W,t,0,W,i,0,8),le(ve,a)}function me(e,t,n,r,i=N(n),s=ie(n,i)){e.getCorners(X);let c=e.getCenter(K);c[2]+=r,re(n,c,Y,i),t.setCenterFromValues(Y[12],Y[13],Y[14]);let u=Math.sqrt(1+Y[0]+Y[5]+Y[10])*2;L[0]=(Y[6]-Y[9])/u,L[1]=(Y[8]-Y[2])/u,L[2]=(Y[1]-Y[4])/u,L[3]=u*.25;let d=e.getQuaternion(R);t.setQuaternion(o(L,L,d)),a(L,L),g(Q,0,0,0);let f=t.getCenter(K);for(let e of X)e[2]+=r,s(e,0,e,0),b(Z,e,f),l(Z,Z,L),x(Z,Z),S(Q,Q,Z);t.setHalfSize(Q)}function he(e,t,n,r,i=N(n)){let o=ne(n),s=1+Math.max(0,r)/(o.radius+e.centerZ);e.getCenter(G),G[2]+=r,M(G,n,0,G,i,0),t.setCenter(G);let c=e.getQuaternion(R);t.setQuaternion(c),a(L,c),g(Z,0,0,1),l(Z,Z,L);let u=e.getHalfSize(q);g(Z,u[0]*Math.abs(Z[0]),u[1]*Math.abs(Z[1]),u[2]*Math.abs(Z[2])),p(Z,Z,o.inverseFlattening),v(Z,u,Z),t.setHalfSize(p(Z,Z,s))}const ge=k(-1,-1,-1);function _e(e){return Array.from(e)}const U=A(),W=Array(24),ve=new ae(W,3),G=A(),K=A(),q=A(),J=n(),Y=r(),X=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],ye=[A(),A(),A()],Z=A(),Q=A(),$=A(),be=A(),xe=[0,0,0];export{I as Obb,le as compute,de as computeOffsetObb,_e as ensurePackedObbData};
2
+ import{fromQuat as e,scale as t}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as i,conjugate as a,multiply as o}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as s,create as c}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{transformQuat as l,dot as u,cross as d,len as f,scale as p,distance as m,direction as h,set as g,transformMat3 as _,add as v,transformQuatValues as y,sub as b,abs as x,max as S,min as C,length as w,scaleAndAdd as T,sign as E,multiply as D}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as O,freeze as k,create as A,UNIT_Z as j}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as ee}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{create as te}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as ne}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as re}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as M}from"../../../geometry/projection/projectBuffer.js";import{getProjector as ie}from"../../../geometry/projection/projectors.js";import{getSphericalPCPF as N}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{getNormal as P}from"../../../geometry/support/plane.js";import{isPlateCarree as F}from"../../../geometry/support/spatialReferenceUtils.js";import{Vertices as ae}from"../webgl-engine/lib/Attribute.js";import{computeOBB as oe}from"./dito.js";class I{constructor(e=O,t=ge,n=s){this._data=[e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2],n[3]]}clone(){return I.fromData(this._data)}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(e){let t=new I;return t._copyFromData(e),t}static fromJSON(e){return new I(e.center,e.halfSize,e.quaternion)}copy(e){this._copyFromData(e.data)}_copyFromData(e){for(let t=0;t<10;++t)this._data[t]=e[t]}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(e){return e[0]=this._data[0],e[1]=this._data[1],e[2]=this._data[2],e}setCenter(e){this._data[0]=e[0],this._data[1]=e[1],this._data[2]=e[2]}setCenterFromValues(e,t,n){this._data[0]=e,this._data[1]=t,this._data[2]=n}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(e){return e[0]=this._data[3],e[1]=this._data[4],e[2]=this._data[5],e}setHalfSize(e){this._data[3]=e[0],this._data[4]=e[1],this._data[5]=e[2]}setHalfSizeFromValues(e,t,n){this._data[3]=e,this._data[4]=t,this._data[5]=n}getQuaternion(e){return e[0]=this._data[6],e[1]=this._data[7],e[2]=this._data[8],e[3]=this._data[9],e}getQuaternionConjugate(e){return e[0]=-this._data[6],e[1]=-this._data[7],e[2]=-this._data[8],e[3]=this._data[9],e}setQuaternion(e){this._data[6]=e[0],this._data[7]=e[1],this._data[8]=e[2],this._data[9]=e[3]}get data(){return this._data}getCorners(e){let t=this._data,n=i(L,t[6],t[7],t[8],t[9]);for(let r=0;r<8;++r){let i=e[r];i[0]=(r&1?-1:1)*t[3],i[1]=(r&2?-1:1)*t[4],i[2]=(r&4?-1:1)*t[5],l(i,i,n),i[0]+=t[0],i[1]+=t[1],i[2]+=t[2]}return e}getAxes(e){let t=this._data,n=i(L,t[6],t[7],t[8],t[9]);return l(e[0],[1,0,0],n),l(e[1],[0,1,0],n),l(e[2],[0,0,1],n),e}intersectsFrustum(e){let{centerX:t,centerY:n,centerZ:r}=this,i=e.planes;for(let e of i){let i=P(e),a=this.projectedRadius(i);if(t*i[0]+n*i[1]+r*i[2]+e[3]-a>0)return!1}let a=this.getAxes(ye),o=e.points,s=this.getHalfSize(q);for(let e=0;e<3;++e){let i=a[e],c=-i[0]*t-i[1]*n-i[2]*r,l=s[e],d=!0,f=!0;for(let e of o){let t=u(e,i)+c;d&&=t>l,f&&=t<-l}if(d||f)return!1}if(this.getCorners(X).some(t=>e.intersectsPoint(t)))return!0;let c=xe;for(let e=0;e<3;++e){let i=a[e];c[e]=i[0]*t+i[1]*n+i[2]*r}let l=e=>{for(let t=0;t<3;++t){let n=a[t],r=s[t],i=n[0]*e[0]+n[1]*e[1]+n[2]*e[2]-c[t];if(i>r||i<-r)return!1}return!0};if(e.points.some(e=>l(e)))return!0;let m=e.lines,h=be;for(let e=0;e<8;++e){let i=m[e].direction;for(let e of a){d(h,i,e);let a=f(h);if(a>0)p(h,h,1/a);else continue;let s=this.projectedRadius(h),c=h[0]*t+h[1]*n+h[2]*r,l=c-s,m=c+s,g=!1,_=!1,v=!0;for(let e of o){let t=u(h,e);if(t>m){if(_){v=!1;break}g=!0}else if(t<l){if(g){v=!1;break}_=!0}else{v=!1;break}}if(v)return!1}}return!0}intersectsFrustumConservativeApproximation(e){return this.intersectPlane(e[0])<=0&&this.intersectPlane(e[1])<=0&&this.intersectPlane(e[2])<=0&&this.intersectPlane(e[3])<=0&&this.intersectPlane(e[4])<=0&&this.intersectPlane(e[5])<=0}intersectsFrustumConservativeApproximationWithMargin(e,t){return this.signedDistanceRangePlane(e[0]).min<=t&&this.signedDistanceRangePlane(e[1]).min<=t&&this.signedDistanceRangePlane(e[2]).min<=t&&this.signedDistanceRangePlane(e[3]).min<=t&&this.signedDistanceRangePlane(e[4]).min<=t&&this.signedDistanceRangePlane(e[5]).min<=t}get radius(){let e=this._data[3],t=this._data[4],n=this._data[5];return Math.sqrt(e*e+t*t+n*n)}intersectsPoint(e){let t=this.getAxes(ye),n=this.getHalfSize(q),r=this.getCenter(K);for(let i=0;i<3;++i){let a=t[i],o=n[i],s=u(a,e)-u(a,r);if(s>o||s<-o)return!1}return!0}intersectSphere(e){let{center:t,radius:n}=e,r=this._data,i=r[3],a=r[4],o=r[5],s=i+a+o+n,c=r[0]-t[0];if(Math.abs(c)>s)return!1;let l=r[1]-t[1];if(Math.abs(l)>s)return!1;let u=r[2]-t[2];if(Math.abs(u)>s)return!1;let d=-r[6],f=-r[7],p=-r[8],m=r[9],h=f*u-p*l,g=p*c-d*u,_=d*l-f*c,v=f*_-p*g,y=p*h-d*_,b=d*g-f*h,x=m*2,S=Math.abs(c+h*x+v*2),C=Math.abs(l+g*x+y*2),w=Math.abs(u+_*x+b*2),T=Math.min(S,i),E=Math.min(C,a),D=Math.min(w,o),O=S-T,k=C-E,A=w-D;return O*O+k*k+A*A<=n*n}intersectSphereWithMBS(e,t=this.radius){let n=this._data,{center:r,radius:i}=e,a=t+i,o=n[0]-r[0];if(o>a)return!1;let s=n[1]-r[1];if(s>a)return!1;let c=n[2]-r[2];if(c>a||o*o+s*s+c*c>a*a)return!1;let l=-n[6],u=-n[7],d=-n[8],f=n[9],p=u*c-d*s,m=d*o-l*c,h=l*s-u*o,g=u*h-d*m,_=d*p-l*h,v=l*m-u*p,y=f*2,b=Math.abs(o+p*y+g*2),x=Math.abs(s+m*y+_*2),S=Math.abs(c+h*y+v*2),C=Math.min(b,n[3]),w=Math.min(x,n[4]),T=Math.min(S,n[5]),E=b-C,D=x-w,O=S-T;return E*E+D*D+O*O<i*i}intersectPlane(e){let t=e[0]*this._data[0]+e[1]*this._data[1]+e[2]*this._data[2]+e[3],n=this.projectedRadius(P(e));return t>n?1:t<-n?-1:0}intersectRay(e,t,n=0,r=-1/0,i=1/0){let a=this._data,o=L;o[0]=-a[6],o[1]=-a[7],o[2]=-a[8],o[3]=a[9],z[0]=e[0]-a[0],z[1]=e[1]-a[1],z[2]=e[2]-a[2];let s=l(z,z,L),c=l(ce,t,L),u=r,d=i,f=this.getHalfSize(q);for(let e=0;e<3;e++){let t=s[e],r=c[e],i=f[e]+n;if(Math.abs(r)>1e-6){let e=(i-t)/r,n=(-i-t)/r;u=Math.max(u,Math.min(e,n)),d=Math.min(d,Math.max(e,n))}else if(t>i||t<-i)return!1}return u<=d}intersectSegment(e,t,n=0){let r=m(e,t);return h(U,e,t),this.intersectRay(e,U,n,0,r)}projectedArea(n,r,i,o){let s=this.getQuaternion(R);a(L,s),z[0]=n[0]-this._data[0],z[1]=n[1]-this._data[1],z[2]=n[2]-this._data[2],l(z,z,L);let c=this.getHalfSize(q),u=z[0]<-c[0]?-1:+(z[0]>c[0]),d=z[1]<-c[1]?-1:+(z[1]>c[1]),f=z[2]<-c[2]?-1:+(z[2]>c[2]),p=Math.abs(u)+Math.abs(d)+Math.abs(f);if(p===0)return 1/0;let m=p===1?4:6,h=(u+d*3+f*9+13)*6;e(J,s),t(J,J,c);let y=this.getCenter(K);for(let e=0;e<m;e++){let t=ue[h+e];g(z,((t&1)<<1)-1,(t&2)-1,((t&4)>>1)-1),_(z,z,J),v(B,y,z),B[3]=1,ee(B,B,r);let n=1/Math.max(1e-6,B[3]);V[e*2]=B[0]*n,V[e*2+1]=B[1]*n}let b=m*2-2,x=V[0]*(V[3]-V[b+1])+V[b]*(V[1]-V[b-1]);for(let e=2;e<b;e+=2)x+=V[e]*(V[e+3]-V[e-1]);return Math.abs(x)*i*o*.125}projectedRadius(e){let t=this._data;return y(z,e,-t[6],-t[7],-t[8],t[9]),Math.abs(z[0]*t[3])+Math.abs(z[1]*t[4])+Math.abs(z[2]*t[5])}signedDistancePlane(e,t){let n=this._data,r=e[0]*n[0]+e[1]*n[1]+e[2]*n[2]+t,i=this.projectedRadius(e);return r>i?r-i:r<-i?r+i:0}signedDistanceRangePlane(e){let t=e[0]*this._data[0]+e[1]*this._data[1]+e[2]*this._data[2]+e[3],n=this.projectedRadius(P(e));return{min:t-n,max:t+n}}toAaBoundingBox(t){let n=this.getQuaternion(R),r=e(J,n),i=this._data[3]*Math.abs(r[0])+this._data[4]*Math.abs(r[3])+this._data[5]*Math.abs(r[6]),a=this._data[3]*Math.abs(r[1])+this._data[4]*Math.abs(r[4])+this._data[5]*Math.abs(r[7]),o=this._data[3]*Math.abs(r[2])+this._data[4]*Math.abs(r[5])+this._data[5]*Math.abs(r[8]);t[0]=this._data[0]-i,t[1]=this._data[1]-a,t[2]=this._data[2]-o,t[3]=this._data[0]+i,t[4]=this._data[1]+a,t[5]=this._data[2]+o}transform(e,t,n,r=0,i=N(n),a=N(t),o=ie(t,a)){if(n===i)t.isGeographic?he(this,e,t,r,a):me(this,e,t,r,a,o);else if(t.isGeographic&&(n.isWebMercator||F(n)))fe(t,this,n,e,r);else if(t.isWebMercator&&F(n))pe(t,this,n,e,r);else{let i=this.getCenter(K);i[2]+=r,M(i,t,0,i,n,0),e.setCenter(i),this!==e&&(e.setQuaternion(this.getQuaternion(R)),e.setHalfSize(this.getHalfSize(q)))}}}const L=c(),R=c(),se=c(),z=A(),ce=A(),B=te();function le(e,t=new I){return oe(e,t),t}const V=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],ue=(()=>{let e=new Int8Array(162),t=0,n=n=>{for(let r=0;r<n.length;r++)e[t+r]=n[r];t+=6};return n([6,2,3,1,5,4]),n([0,2,3,1,5,4]),n([0,2,3,7,5,4]),n([0,1,3,2,6,4]),n([0,1,3,2,0,0]),n([0,1,5,7,3,2]),n([0,1,3,7,6,4]),n([0,1,3,7,6,2]),n([0,1,5,7,6,2]),n([0,1,5,4,6,2]),n([0,1,5,4,0,0]),n([0,1,3,7,5,4]),n([0,2,6,4,0,0]),n([0,0,0,0,0,0]),n([1,3,7,5,0,0]),n([2,3,7,6,4,0]),n([2,3,7,6,0,0]),n([2,3,1,5,7,6]),n([0,1,5,7,6,2]),n([0,1,5,7,6,4]),n([0,1,3,7,6,4]),n([4,5,7,6,2,0]),n([4,5,7,6,0,0]),n([4,5,1,3,7,6]),n([0,2,3,7,5,4]),n([6,2,3,7,5,4]),n([6,2,3,1,5,4]),e})();function de(e,t,n,r,i){let o=e.getQuaternion(R);i.setQuaternion(o),a(L,o);let s=e.getCenter(K),c=e.getHalfSize(q);if(r){l(Z,s,L),x(Q,Z),C($,Q,c),b($,Q,$);let r=w($);v($,Q,c);let a=w($);if(r<n)i.setCenter(s),g(Z,n,n,n),i.setHalfSize(v(Z,c,Z));else{let o=a>0?1+t/a:1,s=r>0?1+n/r:1,u=(s+o)/2,d=(s-o)/2;p($,Q,d),i.setHalfSize(T($,$,c,u)),p($,Q,u),T($,$,c,d),E(Z,Z),D(Z,$,Z);let f=e.getQuaternion(se);i.setCenter(l(Z,Z,f))}}else{i.setCenter(T(Z,s,j,(n+t)/2));let e=l(Z,j,L);x(e,e),i.setHalfSize(T(Q,c,e,(n-t)/2))}return i}function fe(e,t,n,r,i){let a=t.getCenter(K);a[2]+=i;let o=N(n);M(a,e,0,a,o,0),H(o,t,a,n,r)}function pe(e,t,n,r,i){let a=t.getCenter(K);a[2]+=i,H(e,t,a,n,r)}function H(t,n,r,i,a){let o=n.getQuaternion(R),s=e(J,o),c=n.getHalfSize(q);for(let e=0;e<8;++e){for(let t=0;t<3;++t)G[t]=c[t]*(e&1<<t?-1:1);for(let t=0;t<3;++t){let n=r[t];for(let e=0;e<3;++e)n+=G[e]*s[3*e+t];W[e*3+t]=n}}M(W,t,0,W,i,0,8),le(ve,a)}function me(e,t,n,r,i=N(n),s=ie(n,i)){e.getCorners(X);let c=e.getCenter(K);c[2]+=r,re(n,c,Y,i),t.setCenterFromValues(Y[12],Y[13],Y[14]);let u=Math.sqrt(1+Y[0]+Y[5]+Y[10])*2;L[0]=(Y[6]-Y[9])/u,L[1]=(Y[8]-Y[2])/u,L[2]=(Y[1]-Y[4])/u,L[3]=u*.25;let d=e.getQuaternion(R);t.setQuaternion(o(L,L,d)),a(L,L),g(Q,0,0,0);let f=t.getCenter(K);for(let e of X)e[2]+=r,s(e,0,e,0),b(Z,e,f),l(Z,Z,L),x(Z,Z),S(Q,Q,Z);t.setHalfSize(Q)}function he(e,t,n,r,i=N(n)){let o=ne(n),s=1+Math.max(0,r)/(o.radius+e.centerZ);e.getCenter(G),G[2]+=r,M(G,n,0,G,i,0),t.setCenter(G);let c=e.getQuaternion(R);t.setQuaternion(c),a(L,c),g(Z,0,0,1),l(Z,Z,L);let u=e.getHalfSize(q);g(Z,u[0]*Math.abs(Z[0]),u[1]*Math.abs(Z[1]),u[2]*Math.abs(Z[2])),p(Z,Z,o.inverseFlattening),v(Z,u,Z),t.setHalfSize(p(Z,Z,s))}const ge=k(-1,-1,-1);function _e(e){return Array.from(e)}const U=A(),W=Array(24),ve=new ae(W,3),G=A(),K=A(),q=A(),J=n(),Y=r(),X=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],ye=[A(),A(),A()],Z=A(),Q=A(),$=A(),be=A(),xe=[0,0,0];export{I as Obb,le as compute,de as computeOffsetObb,_e as ensurePackedObbData};
@@ -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{createTask as r}from"../../../../core/asyncUtils.js";import{on as i}from"../../../../core/events.js";import{distance as a,exactEquals as o,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{destroyMaybe as u,abortMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as f,isAbortError as p}from"../../../../core/promiseUtils.js";import m from"../../../../geometry/Point.js";import{PropertiesPool as h}from"../../../support/PropertiesPool.js";import{Yield as g}from"../../../support/Yield.js";import{distanceToScale as _}from"../cameraScaleUtils.js";import{PointOfInterest as v}from"./PointOfInterest.js";let y=class extends v{constructor(e){super(e),this._dirty=!1,this._groundQueryDirty=!0,this._propertiesPool=new h({location:()=>new m,renderLocation:()=>c()},this),this._estimatedSurfaceAltitude=0,this._elevationQueryTask=null,this._lastQueryRenderEye=c(),this.renderLocation=c(),this._tmpPoint=new m}initialize(){this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.surface&&this.addHandles(i(this.surface,`elevation-query-change`,()=>this._invalidateElevationQuery())),this.runTask(),this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=u(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){let e=this._propertiesPool.get(`location`);return e.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e),e}get scale(){let e=this._camera,t=a(e.eye,this.renderLocation),n={renderCoordsHelper:this.renderCoordsHelper,state:{camera:e}};return _(n,t)}get updating(){return this._dirty||this._elevationQueryTask!=null}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||=!0}_cancelPendingRequest(){this._elevationQueryTask=d(this._elevationQueryTask)}get readyToRun(){return!this._elevationQueryTask&&this._dirty&&this._groundQueryReady}runTask(){this._cancelPendingRequest(),this._dirty=!1;let e=l(this._camera.eye);if(this._hasCurrentGroundQuery(e))return g;let t=this.map?.ground;if(!t)return this._updateSurfaceAltitude(0),this._rememberGroundQuery(e),g;if(!this._groundQueryReady)return this._setDirty(),g;let n=this.state.spatialReference;this._tmpPoint.spatialReference=n,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);let i=(this._tmpPoint.z??0)>x&&this.renderCoordsHelper.viewingMode===1&&(n.isWGS84||n.isWebMercator)?S:0,a=null;return a=r(async n=>{try{let r=await t.queryElevation(this._tmpPoint,{signal:n,cache:this.cache,minDemResolution:i,view:this.state.view});if(f(n),this._elevationQueryTask!==a)return;this._updateSurfaceAltitude(r.geometry.z??0),this._rememberGroundQuery(e)}catch(t){if(this._elevationQueryTask!==a||n.aborted||p(t))return;this._updateSurfaceAltitude(0),this._rememberGroundQuery(e)}finally{this._elevationQueryTask===a&&(this._elevationQueryTask=null)}}),this._elevationQueryTask=a,g}get _groundQueryReady(){return this.surface?.elevationQueryReady??!0}_hasCurrentGroundQuery(e){return!this._groundQueryDirty&&o(this._lastQueryRenderEye,e)}_rememberGroundQuery(e){s(this._lastQueryRenderEye,e),this._groundQueryDirty=!1}_invalidateElevationQuery(){this._cancelPendingRequest(),this.cache?.clear(),this._groundQueryDirty=!0,this._setDirty()}_updateSurfaceAltitude(e){this._estimatedSurfaceAltitude!==e&&(this._estimatedSurfaceAltitude=e,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(b,this._estimatedSurfaceAltitude,this._camera.eye),o(this._get(`renderLocation`),b)||(this._set(`renderLocation`,s(this._propertiesPool.get(`renderLocation`),b)),this.notifyChange(`renderLocation`))}};e([t({constructOnly:!0})],y.prototype,`scheduler`,void 0),e([t({constructOnly:!0})],y.prototype,`surface`,void 0),e([t({constructOnly:!0})],y.prototype,`cache`,void 0),e([t({constructOnly:!0})],y.prototype,`map`,void 0),e([t({constructOnly:!0})],y.prototype,`task`,void 0),e([t()],y.prototype,`_dirty`,void 0),e([t()],y.prototype,`_groundQueryDirty`,void 0),e([t()],y.prototype,`_elevationQueryTask`,void 0),e([t()],y.prototype,`location`,null),e([t()],y.prototype,`renderLocation`,void 0),e([t()],y.prototype,`scale`,null),e([t()],y.prototype,`updating`,null),e([t()],y.prototype,`readyToRun`,null),e([t()],y.prototype,`_groundQueryReady`,null),y=e([n(`esri.views.3d.support.pointsOfInterest.CameraOnSurface`)],y);const b=c(),x=1e5,S=1e6;export{y as CameraOnSurface};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{on as i}from"../../../../core/events.js";import{distance as a,exactEquals as o,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{destroyMaybe as u,abortMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as f,isAbortError as p}from"../../../../core/promiseUtils.js";import m from"../../../../geometry/Point.js";import{PropertiesPool as h}from"../../../support/PropertiesPool.js";import{Yield as g}from"../../../support/Yield.js";import{distanceToScale as _}from"../cameraScaleUtils.js";import{PointOfInterest as v}from"./PointOfInterest.js";let y=class extends v{constructor(e){super(e),this._dirty=!1,this._groundQueryDirty=!0,this._propertiesPool=new h({location:()=>new m,renderLocation:()=>c()},this),this._estimatedSurfaceAltitude=0,this._elevationQueryTask=null,this._lastQueryRenderEye=c(),this.renderLocation=c(),this._tmpPoint=new m}initialize(){this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.surface&&this.addHandles(i(this.surface,`elevation-query-change`,()=>this._invalidateElevationQuery())),this.runTask(),this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=u(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){let e=this._propertiesPool.get(`location`);return e.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e),e}get scale(){let e=this._camera,t=a(e.eye,this.renderLocation),n={renderCoordsHelper:this.renderCoordsHelper,state:{camera:e}};return _(n,t)}get updating(){return this._dirty||this._elevationQueryTask!=null}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||=!0}_cancelPendingRequest(){this._elevationQueryTask=d(this._elevationQueryTask)}get readyToRun(){return!this._elevationQueryTask&&this._dirty&&this._groundQueryReady}runTask(){this._cancelPendingRequest(),this._dirty=!1;let e=l(this._camera.eye);if(this._hasCurrentGroundQuery(e))return g;let t=this.map?.ground;if(!t)return this._updateSurfaceAltitude(0),this._rememberGroundQuery(e),g;if(!this._groundQueryReady)return this._setDirty(),g;let n=this.state.spatialReference;this._tmpPoint.spatialReference=n,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);let i=(this._tmpPoint.z??0)>x&&this.renderCoordsHelper.isGlobal&&(n.isWGS84||n.isWebMercator)?S:0,a=null;return a=r(async n=>{try{let r=await t.queryElevation(this._tmpPoint,{signal:n,cache:this.cache,minDemResolution:i,view:this.state.view});if(f(n),this._elevationQueryTask!==a)return;this._updateSurfaceAltitude(r.geometry.z??0),this._rememberGroundQuery(e)}catch(t){if(this._elevationQueryTask!==a||n.aborted||p(t))return;this._updateSurfaceAltitude(0),this._rememberGroundQuery(e)}finally{this._elevationQueryTask===a&&(this._elevationQueryTask=null)}}),this._elevationQueryTask=a,g}get _groundQueryReady(){return this.surface?.elevationQueryReady??!0}_hasCurrentGroundQuery(e){return!this._groundQueryDirty&&o(this._lastQueryRenderEye,e)}_rememberGroundQuery(e){s(this._lastQueryRenderEye,e),this._groundQueryDirty=!1}_invalidateElevationQuery(){this._cancelPendingRequest(),this.cache?.clear(),this._groundQueryDirty=!0,this._setDirty()}_updateSurfaceAltitude(e){this._estimatedSurfaceAltitude!==e&&(this._estimatedSurfaceAltitude=e,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(b,this._estimatedSurfaceAltitude,this._camera.eye),o(this._get(`renderLocation`),b)||(this._set(`renderLocation`,s(this._propertiesPool.get(`renderLocation`),b)),this.notifyChange(`renderLocation`))}};e([t({constructOnly:!0})],y.prototype,`scheduler`,void 0),e([t({constructOnly:!0})],y.prototype,`surface`,void 0),e([t({constructOnly:!0})],y.prototype,`cache`,void 0),e([t({constructOnly:!0})],y.prototype,`map`,void 0),e([t({constructOnly:!0})],y.prototype,`task`,void 0),e([t()],y.prototype,`_dirty`,void 0),e([t()],y.prototype,`_groundQueryDirty`,void 0),e([t()],y.prototype,`_elevationQueryTask`,void 0),e([t()],y.prototype,`location`,null),e([t()],y.prototype,`renderLocation`,void 0),e([t()],y.prototype,`scale`,null),e([t()],y.prototype,`updating`,null),e([t()],y.prototype,`readyToRun`,null),e([t()],y.prototype,`_groundQueryReady`,null),y=e([n(`esri.views.3d.support.pointsOfInterest.CameraOnSurface`)],y);const b=c(),x=1e5,S=1e6;export{y as CameraOnSurface};
@@ -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,subclass as r}from"../../../../core/accessorSupport/decorators.js";import"../../../../core/has.js";import{add as i,exactEquals 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{watch as c,sync as l,initial as u,when as d,on as f}from"../../../../core/reactiveUtils.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import{create as m}from"../../../../geometry/support/ray.js";import{PropertiesPool as h}from"../../../support/PropertiesPool.js";import{TaskPriority as g,noBudget as _}from"../../../support/Scheduler.js";import{Yield as v}from"../../../support/Yield.js";import{Intersector as y}from"../../webgl-engine/lib/Intersector.js";import{terrainId as b}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{debugFlags as x}from"../debugFlags.js";import{DebugPoint as S}from"../debugUtils.js";import{fromRenderAtEye as C}from"../geometryUtils/ray.js";import{CameraOnSurface as w}from"./CameraOnSurface.js";import{CenterOnSurface as T}from"./CenterOnSurface.js";import{ContentGeometryUpdates as E}from"./ContentGeometryUpdates.js";import{Focus as D}from"./Focus.js";import{StableSurfaceCenter as O}from"./StableSurfaceCenter.js";import{SurfaceGeometryUpdates as k}from"./SurfaceGeometryUpdates.js";let A=class extends t{constructor(e){super(e),this.renderPointOfView=s(),this._pois=[],this._updatingHandles=new p,this._debugCenters=null,this._tmpRay=m(),this._centerRayDirty=!0,this._surfaceAltitudeAtCenter=0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenter=0,this._contentAltitudeAtCenterDirty=!0,this._contentChangedSinceLastUpdate=!0,this._geometryPois=[],this._propertiesPool=new h({renderPointOfView:()=>s()},this),this._contentIntersector=new y(e.view.state.viewingMode),this._surfaceIntersector=new y(e.view.state.viewingMode),this._surfaceIntersector.options.invisibleTerrain=!1,this._surfaceIntersector.options.store=0}initialize(){let{state:e,groundView:t,renderCoordsHelper:n,map:r}=this.view,i=this.view.groundAndIMSurface,a=e=>this._estimateSurfaceAltitudeAtCenter(e),o=this.view.resourceController.scheduler,s=t?.elevationQueryCache,p={state:e,scheduler:o,renderCoordsHelper:n},m={...p,surface:t};this._set(`centerOnSurfaceInfrequent`,new T({...m,task:g.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:a})),this._set(`centerOnSurfaceFrequent`,new T({...m,task:g.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:a})),this._set(`centerOnContent`,new T({...m,task:g.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:(e,t)=>this._estimateContentAltitudeAtCenter(e,t)})),this._set(`cameraOnSurface`,new w({...m,cache:s,task:g.POINT_OF_INTEREST_INFREQUENT,map:r})),this._set(`surfaceGeometryUpdates`,new k({...p,surface:i,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set(`contentGeometryUpdates`,new E(this.view.allLayerViews,()=>this.view.graphicsView)),this._set(`surfaceOrigin`,new O({cache:s,view:this.view})),this._set(`focus`,new D({...p,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(e,t,n)=>this._estimateSurfaceIntersectionAtRenderPoint(e,this.view.state.contentCamera,t,n)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus),this._geometryPois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.focus),this.addHandles([c(()=>e.contentCamera,e=>this._cameraChanged(e),l),this._updatingHandles.add(()=>t.groundExtent,()=>this._updateGeometryPointsOfInterest()),this._updatingHandles.add(()=>this.view.map?.ground?.navigationConstraint?.type,e=>{this._surfaceIntersector.options.backfacesTerrain=e===`none`},u),d(()=>!t.updating&&this._contentChangedSinceLastUpdate,()=>{this._updateGeometryPointsOfInterest(),this._contentChangedSinceLastUpdate=!1},l),f(()=>this.surfaceGeometryUpdates.events,`request-update`,()=>this._updateGeometryPointsOfInterest()),f(()=>this.contentGeometryUpdates.events,`request-update`,()=>{this._contentChangedSinceLastUpdate=!0,this._updateCenterOnContent()}),this._updatingHandles.add(()=>x.SHOW_POI,e=>this._setDebug(e),u)]),this._cameraChanged(this.view.state.contentCamera);for(let e of this._pois)e.runTask()}destroy(){this._setDebug(!1),this._propertiesPool.destroy();for(let e of this._pois)e.destroy();this._pois.length=0,this.surfaceOrigin.destroy(),this._updatingHandles.destroy(),this._set(`centerOnSurfaceInfrequent`,null),this._set(`centerOnSurfaceFrequent`,null),this._set(`centerOnContent`,null),this._set(`cameraOnSurface`,null),this._set(`surfaceGeometryUpdates`,null),this._set(`contentGeometryUpdates`,null),this._set(`surfaceOrigin`,null),this._set(`focus`,null)}get updating(){return!!(this.surfaceGeometryUpdates?.updating||this._pois.some(e=>e.updating))||this._updatingHandles.updating}get _centerRay(){return this._centerRayDirty&&=(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),!1),this._centerRayCached}_estimateContentAltitudeAtCenter(e,t){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;let n=this._centerRay;if(n==null)return this._contentAltitudeAtCenter;if(t===1&&this.view.sceneIntersectionHelper.intersectRay(n,this._contentIntersector,j,N))this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(j);else{let t=this._estimateSurfaceAltitudeAtCenter(e);if(t===v)return v;this._contentAltitudeAtCenter=t}return this._contentAltitudeAtCenterDirty=!1,this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(e=_){let{view:t}=this,{groundAndIMSurface:n}=t;if(!n)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;let r=this._centerRay;if(r==null)return this._surfaceAltitudeAtCenter;let a=r.origin,o=i(j,r.origin,r.direction);return this._surfaceIntersector.resetWithRay(r,t.state.contentCamera),n.intersectBudgeted(this._surfaceIntersector,null,a,o,e)?(this._surfaceIntersector.results.min.getIntersectionPoint(j)&&(this._surfaceAltitudeAtCenter=t.renderCoordsHelper.getAltitude(j)),this._surfaceAltitudeAtCenterDirty=!1,this._surfaceAltitudeAtCenter):v}_estimateSurfaceIntersectionAtRenderPoint(e,t,n,r=_){let a=C(t,e,M);if(a==null)return null;let o=a.origin,s=i(j,a.origin,a.direction);return this._surfaceIntersector.resetWithRay(a,t),this.view.groundAndIMSurface.intersectBudgeted(this._surfaceIntersector,null,o,s,r)?this._surfaceIntersector.results.min.getIntersectionPoint(n)?n:null:v}_cameraChanged(e){this._updateAllPointsOfInterest();let t=e.eye;a(this.renderPointOfView,t)||this._set(`renderPointOfView`,o(this._propertiesPool.get(`renderPointOfView`),t))}_updateAllPointsOfInterest(){this._invalidateCenterEstimates();for(let e of this._pois)e.updateRenderLocation()}_updateGeometryPointsOfInterest(){this._invalidateCenterEstimates();for(let e of this._geometryPois)e.updateRenderLocation()}_invalidateCenterEstimates(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)this._debugCenters?.forEach(e=>e.hide()),this.removeHandles(`debug`);else{if(!this._debugCenters){this._debugCenters=new Map;let e=this.view.graphics;this._debugCenters.set(this.centerOnContent,new S(e,`red`,`CenterOnContent`)),this._debugCenters.set(this.centerOnSurfaceFrequent,new S(e,`red`,`CenterOnSurface`)),this._debugCenters.set(this.centerOnSurfaceInfrequent,new S(e,`red`,`CenterOnSurface`)),this._debugCenters.set(this.cameraOnSurface,new S(e,`blue`,`CameraOnSurface`)),this._debugCenters.set(this.focus,new S(e,`green`,`Focus`))}for(let e of this._pois)this.addHandles(this._updatingHandles.add(()=>e.renderLocation,t=>this._debugCenters?.get(e)?.show(t,e.renderCoordsHelper.spatialReference),u),`debug`)}}get test(){}};e([n()],A.prototype,`centerOnContent`,void 0),e([n()],A.prototype,`centerOnSurfaceFrequent`,void 0),e([n()],A.prototype,`centerOnSurfaceInfrequent`,void 0),e([n()],A.prototype,`cameraOnSurface`,void 0),e([n()],A.prototype,`focus`,void 0),e([n()],A.prototype,`renderPointOfView`,void 0),e([n()],A.prototype,`surfaceOrigin`,void 0),e([n()],A.prototype,`contentGeometryUpdates`,void 0),e([n()],A.prototype,`surfaceGeometryUpdates`,void 0),e([n({constructOnly:!0})],A.prototype,`view`,void 0),e([n()],A.prototype,`updating`,null),A=e([r(`esri.views.3d.support.pointsOfInterest.PointsOfInterest`)],A);const j=s(),M=m(),N={exclude:new Set([b])};export{A as PointsOfInterest};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import"../../../../core/has.js";import{add as i,exactEquals 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{watch as c,sync as l,initial as u,when as d,on as f}from"../../../../core/reactiveUtils.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import{create as m}from"../../../../geometry/support/ray.js";import{PropertiesPool as h}from"../../../support/PropertiesPool.js";import{TaskPriority as g,noBudget as _}from"../../../support/Scheduler.js";import{Yield as v}from"../../../support/Yield.js";import{Intersector as y}from"../../webgl-engine/lib/Intersector.js";import{terrainId as b}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{debugFlags as x}from"../debugFlags.js";import{DebugPoint as S}from"../debugUtils.js";import{fromRenderAtEye as C}from"../geometryUtils/ray.js";import{CameraOnSurface as w}from"./CameraOnSurface.js";import{CenterOnSurface as T}from"./CenterOnSurface.js";import{ContentGeometryUpdates as E}from"./ContentGeometryUpdates.js";import{Focus as D}from"./Focus.js";import{StableSurfaceCenter as O}from"./StableSurfaceCenter.js";import{SurfaceGeometryUpdates as k}from"./SurfaceGeometryUpdates.js";let A=class extends t{constructor(e){super(e),this.renderPointOfView=s(),this._pois=[],this._updatingHandles=new p,this._debugCenters=null,this._tmpRay=m(),this._centerRayDirty=!0,this._surfaceAltitudeAtCenter=0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenter=0,this._contentAltitudeAtCenterDirty=!0,this._contentChangedSinceLastUpdate=!0,this._geometryPois=[],this._propertiesPool=new h({renderPointOfView:()=>s()},this),this._contentIntersector=new y(e.view.state.isGlobal),this._surfaceIntersector=new y(e.view.state.isGlobal),this._surfaceIntersector.options.invisibleTerrain=!1,this._surfaceIntersector.options.store=0}initialize(){let{state:e,groundView:t,renderCoordsHelper:n,map:r}=this.view,i=this.view.groundAndIMSurface,a=e=>this._estimateSurfaceAltitudeAtCenter(e),o=this.view.resourceController.scheduler,s=t?.elevationQueryCache,p={state:e,scheduler:o,renderCoordsHelper:n},m={...p,surface:t};this._set(`centerOnSurfaceInfrequent`,new T({...m,task:g.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:a})),this._set(`centerOnSurfaceFrequent`,new T({...m,task:g.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:a})),this._set(`centerOnContent`,new T({...m,task:g.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:(e,t)=>this._estimateContentAltitudeAtCenter(e,t)})),this._set(`cameraOnSurface`,new w({...m,cache:s,task:g.POINT_OF_INTEREST_INFREQUENT,map:r})),this._set(`surfaceGeometryUpdates`,new k({...p,surface:i,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set(`contentGeometryUpdates`,new E(this.view.allLayerViews,()=>this.view.graphicsView)),this._set(`surfaceOrigin`,new O({cache:s,view:this.view})),this._set(`focus`,new D({...p,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(e,t,n)=>this._estimateSurfaceIntersectionAtRenderPoint(e,this.view.state.contentCamera,t,n)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus),this._geometryPois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.focus),this.addHandles([c(()=>e.contentCamera,e=>this._cameraChanged(e),l),this._updatingHandles.add(()=>t.groundExtent,()=>this._updateGeometryPointsOfInterest()),this._updatingHandles.add(()=>this.view.map?.ground?.navigationConstraint?.type,e=>{this._surfaceIntersector.options.backfacesTerrain=e===`none`},u),d(()=>!t.updating&&this._contentChangedSinceLastUpdate,()=>{this._updateGeometryPointsOfInterest(),this._contentChangedSinceLastUpdate=!1},l),f(()=>this.surfaceGeometryUpdates.events,`request-update`,()=>this._updateGeometryPointsOfInterest()),f(()=>this.contentGeometryUpdates.events,`request-update`,()=>{this._contentChangedSinceLastUpdate=!0,this._updateCenterOnContent()}),this._updatingHandles.add(()=>x.SHOW_POI,e=>this._setDebug(e),u)]),this._cameraChanged(this.view.state.contentCamera);for(let e of this._pois)e.runTask()}destroy(){this._setDebug(!1),this._propertiesPool.destroy();for(let e of this._pois)e.destroy();this._pois.length=0,this.surfaceOrigin.destroy(),this._updatingHandles.destroy(),this._set(`centerOnSurfaceInfrequent`,null),this._set(`centerOnSurfaceFrequent`,null),this._set(`centerOnContent`,null),this._set(`cameraOnSurface`,null),this._set(`surfaceGeometryUpdates`,null),this._set(`contentGeometryUpdates`,null),this._set(`surfaceOrigin`,null),this._set(`focus`,null)}get updating(){return!!(this.surfaceGeometryUpdates?.updating||this._pois.some(e=>e.updating))||this._updatingHandles.updating}get _centerRay(){return this._centerRayDirty&&=(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),!1),this._centerRayCached}_estimateContentAltitudeAtCenter(e,t){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;let n=this._centerRay;if(n==null)return this._contentAltitudeAtCenter;if(t===1&&this.view.sceneIntersectionHelper.intersectRay(n,this._contentIntersector,j,N))this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(j);else{let t=this._estimateSurfaceAltitudeAtCenter(e);if(t===v)return v;this._contentAltitudeAtCenter=t}return this._contentAltitudeAtCenterDirty=!1,this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(e=_){let{view:t}=this,{groundAndIMSurface:n}=t;if(!n)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;let r=this._centerRay;if(r==null)return this._surfaceAltitudeAtCenter;let a=r.origin,o=i(j,r.origin,r.direction);return this._surfaceIntersector.resetWithRay(r,t.state.contentCamera),n.intersectBudgeted(this._surfaceIntersector,null,a,o,e)?(this._surfaceIntersector.results.min.getIntersectionPoint(j)&&(this._surfaceAltitudeAtCenter=t.renderCoordsHelper.getAltitude(j)),this._surfaceAltitudeAtCenterDirty=!1,this._surfaceAltitudeAtCenter):v}_estimateSurfaceIntersectionAtRenderPoint(e,t,n,r=_){let a=C(t,e,M);if(a==null)return null;let o=a.origin,s=i(j,a.origin,a.direction);return this._surfaceIntersector.resetWithRay(a,t),this.view.groundAndIMSurface.intersectBudgeted(this._surfaceIntersector,null,o,s,r)?this._surfaceIntersector.results.min.getIntersectionPoint(n)?n:null:v}_cameraChanged(e){this._updateAllPointsOfInterest();let t=e.eye;a(this.renderPointOfView,t)||this._set(`renderPointOfView`,o(this._propertiesPool.get(`renderPointOfView`),t))}_updateAllPointsOfInterest(){this._invalidateCenterEstimates();for(let e of this._pois)e.updateRenderLocation()}_updateGeometryPointsOfInterest(){this._invalidateCenterEstimates();for(let e of this._geometryPois)e.updateRenderLocation()}_invalidateCenterEstimates(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)this._debugCenters?.forEach(e=>e.hide()),this.removeHandles(`debug`);else{if(!this._debugCenters){this._debugCenters=new Map;let e=this.view.graphics;this._debugCenters.set(this.centerOnContent,new S(e,`red`,`CenterOnContent`)),this._debugCenters.set(this.centerOnSurfaceFrequent,new S(e,`red`,`CenterOnSurface`)),this._debugCenters.set(this.centerOnSurfaceInfrequent,new S(e,`red`,`CenterOnSurface`)),this._debugCenters.set(this.cameraOnSurface,new S(e,`blue`,`CameraOnSurface`)),this._debugCenters.set(this.focus,new S(e,`green`,`Focus`))}for(let e of this._pois)this.addHandles(this._updatingHandles.add(()=>e.renderLocation,t=>this._debugCenters?.get(e)?.show(t,e.renderCoordsHelper.spatialReference),u),`debug`)}}get test(){}};e([n()],A.prototype,`centerOnContent`,void 0),e([n()],A.prototype,`centerOnSurfaceFrequent`,void 0),e([n()],A.prototype,`centerOnSurfaceInfrequent`,void 0),e([n()],A.prototype,`cameraOnSurface`,void 0),e([n()],A.prototype,`focus`,void 0),e([n()],A.prototype,`renderPointOfView`,void 0),e([n()],A.prototype,`surfaceOrigin`,void 0),e([n()],A.prototype,`contentGeometryUpdates`,void 0),e([n()],A.prototype,`surfaceGeometryUpdates`,void 0),e([n({constructOnly:!0})],A.prototype,`view`,void 0),e([n()],A.prototype,`updating`,null),A=e([r(`esri.views.3d.support.pointsOfInterest.PointsOfInterest`)],A);const j=s(),M=m(),N={exclude:new Set([b])};export{A as PointsOfInterest};
@@ -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,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{EventEmitter as i}from"../../../../core/Evented.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as o,expand as s,intersects as c}from"../../../../geometry/support/aaBoundingRect.js";import{getInfo as l}from"../../../../geometry/support/spatialReferenceUtils.js";import{TaskPriority as u}from"../../../support/Scheduler.js";import{Yield as d}from"../../../support/Yield.js";import"../elevationUpdateExtentUtils.js";import{intersectsGeographicExtent as f}from"../sphereExtentUtils.js";let p=class extends t{constructor(e){super(e),this._tileGeometryUpdateExtent=o(),this._tileGeometryUpdateSpatialReference=null,this.events=new i,this.updating=!1}initialize(){this.addHandles([this.surface.on(`elevation-change`,e=>this._tileGeometryChanged(e)),this.scheduler.registerTask(u.SURFACE_GEOMETRY_UPDATES,this)])}get readyToRun(){return this.updating}runTask(){return this.updating&&(this._tileGeometryUpdateSpatialReference&&this._centerIntersectsExtent(this._tileGeometryUpdateExtent,this._tileGeometryUpdateSpatialReference)&&this.events.emit(`request-update`,m),o(this._tileGeometryUpdateExtent),this._set(`updating`,!1)),d}_tileGeometryChanged(e){this._tileGeometryUpdateSpatialReference=e.spatialReference,s(this._tileGeometryUpdateExtent,e.extent,this._tileGeometryUpdateExtent),this._set(`updating`,!0)}_furthestCenterOnSurface(){let e=this.centerOnSurfaces[0];for(let t=1;t<this.centerOnSurfaces.length;t++){let n=this.centerOnSurfaces[t];n.distance>e.distance&&(e=n)}return e}_centerIntersectsExtent(e,t){let n=this.state.contentCamera.eye,r=_,i=this._furthestCenterOnSurface();this.renderCoordsHelper.fromRenderCoords(n,h,t),this.renderCoordsHelper.fromRenderCoords(i.renderLocation,g,t);let a=this.renderCoordsHelper.viewingMode===1?l(t)?.valid:null;if(a!=null){let e=a[1]-a[0];g[0]+=Math.round((h[0]-g[0])/e)*e}return h[0]<g[0]?(r[0]=h[0],r[2]=g[0]):(r[0]=g[0],r[2]=h[0]),h[1]<g[1]?(r[1]=h[1],r[3]=g[1]):(r[1]=g[1],r[3]=h[1]),a==null?c(r,e):f(r,e,t)}};e([n({constructOnly:!0})],p.prototype,`state`,void 0),e([n({constructOnly:!0})],p.prototype,`centerOnSurfaces`,void 0),e([n({constructOnly:!0})],p.prototype,`renderCoordsHelper`,void 0),e([n({constructOnly:!0})],p.prototype,`scheduler`,void 0),e([n({constructOnly:!0})],p.prototype,`surface`,void 0),e([n({readOnly:!0})],p.prototype,`updating`,void 0),p=e([r(`esri.views.3d.support.pointsOfInterest.SurfaceGeometryUpdates`)],p);const m={},h=a(),g=a(),_=o();export{p as SurfaceGeometryUpdates};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{EventEmitter as i}from"../../../../core/Evented.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as o,expand as s,intersects as c}from"../../../../geometry/support/aaBoundingRect.js";import{getInfo as l}from"../../../../geometry/support/spatialReferenceUtils.js";import{TaskPriority as u}from"../../../support/Scheduler.js";import{Yield as d}from"../../../support/Yield.js";import"../elevationUpdateExtentUtils.js";import{intersectsGeographicExtent as f}from"../sphereExtentUtils.js";let p=class extends t{constructor(e){super(e),this._tileGeometryUpdateExtent=o(),this._tileGeometryUpdateSpatialReference=null,this.events=new i,this.updating=!1}initialize(){this.addHandles([this.surface.on(`elevation-change`,e=>this._tileGeometryChanged(e)),this.scheduler.registerTask(u.SURFACE_GEOMETRY_UPDATES,this)])}get readyToRun(){return this.updating}runTask(){return this.updating&&(this._tileGeometryUpdateSpatialReference&&this._centerIntersectsExtent(this._tileGeometryUpdateExtent,this._tileGeometryUpdateSpatialReference)&&this.events.emit(`request-update`,m),o(this._tileGeometryUpdateExtent),this._set(`updating`,!1)),d}_tileGeometryChanged(e){this._tileGeometryUpdateSpatialReference=e.spatialReference,s(this._tileGeometryUpdateExtent,e.extent,this._tileGeometryUpdateExtent),this._set(`updating`,!0)}_furthestCenterOnSurface(){let e=this.centerOnSurfaces[0];for(let t=1;t<this.centerOnSurfaces.length;t++){let n=this.centerOnSurfaces[t];n.distance>e.distance&&(e=n)}return e}_centerIntersectsExtent(e,t){let n=this.state.contentCamera.eye,r=_,i=this._furthestCenterOnSurface();this.renderCoordsHelper.fromRenderCoords(n,h,t),this.renderCoordsHelper.fromRenderCoords(i.renderLocation,g,t);let a=this.renderCoordsHelper.isGlobal?l(t)?.valid:null;if(a!=null){let e=a[1]-a[0];g[0]+=Math.round((h[0]-g[0])/e)*e}return h[0]<g[0]?(r[0]=h[0],r[2]=g[0]):(r[0]=g[0],r[2]=h[0]),h[1]<g[1]?(r[1]=h[1],r[3]=g[1]):(r[1]=g[1],r[3]=h[1]),a==null?c(r,e):f(r,e,t)}};e([n({constructOnly:!0})],p.prototype,`state`,void 0),e([n({constructOnly:!0})],p.prototype,`centerOnSurfaces`,void 0),e([n({constructOnly:!0})],p.prototype,`renderCoordsHelper`,void 0),e([n({constructOnly:!0})],p.prototype,`scheduler`,void 0),e([n({constructOnly:!0})],p.prototype,`surface`,void 0),e([n({readOnly:!0})],p.prototype,`updating`,void 0),p=e([r(`esri.views.3d.support.pointsOfInterest.SurfaceGeometryUpdates`)],p);const m={},h=a(),g=a(),_=o();export{p as SurfaceGeometryUpdates};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{identity as e,rotateX as t,rotateY as n,rotateZ as r,fromRotation as i}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as o,lerp as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as c,create as l}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as u,transformMat4 as d,lerp as f,normalize as p,scale as m,add as h,copy as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v,clone as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import b from"../../../core/Logger.js";import{lerp as x,clamp as S}from"../../../core/mathUtils.js";import{S as C}from"../../../chunks/SunCalc.js";import{angle as w}from"./mathUtils.js";const T={local:{altitude:1500,ambientAtNight:.1,ambientAtNoon:.45,ambientAtTwilight:.2,directAtNoon:.65,directAtTwilight:.7},global:{altitude:8e5,ambient:.015,direct:.75},planarDirection:{localAltitude:1e4,globalAltitude:1e6,globalAngles:{azimuth:Math.PI*1.3,altitude:Math.PI*.6}}};class E{constructor(e,t){this.direct=e,this.ambient=t}}function D(e,t,n,r,i,a){u(a.ambient.color,1,1,1),a.ambient.intensity=T.global.ambient,u(a.direct.color,1,1,1),a.direct.intensity=T.global.direct;let o=t[2],s=S((Math.abs(o)-T.local.altitude)/(T.global.altitude-T.local.altitude),0,1);a.globalFactor=s;let c;if(e!=null&&(c=C.getTimes(e,t[1],t[0])),s<1){let t;if(e!=null)t=ce(e,c,r);else{let e=A(r);t={direct:{intensity:T.local.directAtNoon*e.direct,color:v(1,1,1)},ambient:{intensity:T.local.ambientAtNoon*e.ambient,color:v(1,1,1)},timeOfDay:`early afternoon`}}f(a.ambient.color,t.ambient.color,a.ambient.color,s),a.ambient.intensity=x(t.ambient.intensity,a.ambient.intensity,s),f(a.direct.color,t.direct.color,a.direct.color,s),a.direct.intensity=x(t.direct.intensity,a.direct.intensity,s),a.specularStrength=r===`rainy`||r===`snowy`||r===`foggy`?0:1,a.environmentStrength=r===`rainy`?.7:r===`snowy`||r===`foggy`?.75:1}a.noonFactor=e==null?1:oe(e,c),e==null?O(i,n,a.direct.directionToLightSource):k(e,t,n,a.direct.directionToLightSource)}function O(e,t,n){t===1?p(Z,e.eye):u(Z,0,0,1),m(Q,e.viewForward,-1);let r=w(Q,Z),a=Math.max(r-2*$,0),o=.85*a/(a+1),s=Math.max($,r-$-o);i(X,-s,e.viewRight),d(n,Q,X),h(n,n,m(le,e.viewRight,ue)),p(n,n)}function k(i,a,o,s){let c=ae,l=e(ie);if(o===1)C.getPosition(i,0,0,c),u(s,0,0,-1),t(l,l,-c.azimuth),n(l,l,-c.altitude),d(s,s,l);else{let e=T.planarDirection,n=e.globalAngles,o=a[2],f=(Math.abs(o)-e.localAltitude)/(e.globalAltitude-e.localAltitude);f=S(f,0,1),f<1?(C.getPosition(i,a[1],a[0],c),c.azimuth=(1-f)*c.azimuth+f*n.azimuth,c.altitude=(1-f)*c.altitude+f*n.altitude):(c.azimuth=n.azimuth,c.altitude=n.altitude),u(s,0,-1,0),r(l,l,-c.azimuth),t(l,l,-c.altitude),d(s,s,l)}}function ee(e,t){if(t===1)return!0;let n=T.planarDirection;return Math.abs(e)<n.localAltitude}function te(e,t,n,r,i,a){let o=e.getTime(),s=Math.max(0,t.getTime()-o),c=Math.floor(s/n)+1,l=Math.min(a,c),u=Array(l),d=l===1?0:s/(l-1);c>l&&b.getLogger(`esri.views.3d.support.sunUtils`).warnOnce(`computeDirectionsOverTime`,`Requested interval ${n} exceeds maximum supported interval of ${Math.floor(d)} based on the provided time range.`);for(let e=0;e<l;++e)Y.setTime(o+d*e),u[e]=_(),k(Y,r,i,u[e]);return u}const ne=v(.5773502691896258,-.5773502691896258,.5773502691896258);class re{constructor(){this.ambient={color:v(1,1,1),intensity:.55},this.direct={color:v(1,1,1),intensity:.55,directionToLightSource:y(ne)},this.noonFactor=.5,this.globalFactor=0,this.specularStrength=1,this.environmentStrength=1}}const ie=a(),ae={azimuth:0,altitude:0};function oe(e,t){let n=e.valueOf(),r,i;t.polarException===C.PolarException.MIDNIGHT_SUN?(r=n-(e.getHours()+48)*60*60*1e3-e.getMinutes()*60*1e3,i=r+432e6):t.polarException===C.PolarException.POLAR_NIGHT?(r=n-2,i=n-1):(r=t.sunrise.valueOf(),i=t.sunset.valueOf());let a=i-r,o=r+a/2;return 1-S(Math.abs(n-o)/432e5,0,1)}function A(e){switch(e){case`disabled`:case`sunny`:case`cloudy`:return new E(1,1);case`rainy`:return new E(.4,1.2);case`snowy`:return new E(.5,1.3);case`foggy`:return new E(.2,1.6)}}function j(e,t){let n=(e[0]+e[1]+e[2])/3;e[0]+=(n-e[0])*t,e[1]+=(n-e[1])*t,e[2]+=(n-e[2])*t}const M=v(.01,.01,.01),N=v(1,.6,.5),P=v(1,.98,.98),se=v(1,1,1),F=v(.8,.8,1),I=v(.8,.8,1),L=v(.98,.98,1),R=v(1,1,1),z=c(.01,T.local.ambientAtNight),B=c(T.local.directAtTwilight,T.local.ambientAtTwilight),V=c(.9*T.local.directAtNoon,T.local.ambientAtNoon),H=c(T.local.directAtNoon,T.local.ambientAtNoon),U=V,W=P,G=L,K=B,q=N,J=I;function ce(e,t,n){let r=e.valueOf(),i,a;t.polarException===C.PolarException.MIDNIGHT_SUN?(i=r-(e.getHours()+48)*60*60*1e3-e.getMinutes()*60*1e3,a=i+432e6):t.polarException===C.PolarException.POLAR_NIGHT?(i=r-2,a=r-1):(i=t.sunrise.valueOf(),a=t.sunset.valueOf());let c=a-i,u=i+c/2,d=c/4,p=u-d,m=u+d,h=c*.06,v=h,y=i-h/2,b=i+h/2,x=a-v/2,S=a+v/2,w=l(),T=_(),E=_(),D=``;if(r<y||r>S)o(w,z),g(T,M),g(E,F),D=`night`;else if(r<b){let e=(r-y)/(b-y);s(w,z,B,e),f(T,M,N,e),f(E,F,I,e),D=`sun rising`}else if(r<p){let e=(r-b)/(p-b);s(w,B,V,e),f(T,N,P,e),f(E,I,L,e),D=`early morning`}else if(r<u){let e=(r-p)/(u-p);s(w,V,H,e),f(T,P,se,e),f(E,L,R,e),D=`late morning`}else if(r<m){let e=(r-u)/(m-u);s(w,H,U,e),f(T,se,W,e),f(E,R,G,e),D=`early afternoon`}else if(r<x){let e=(r-m)/(x-m);s(w,U,K,e),f(T,W,q,e),f(E,G,J,e),D=`late afternoon`}else if(r<S){let e=(r-x)/(S-x);s(w,K,z,e),f(T,q,M,e),f(E,J,F,e),D=`sun setting`}let O=0;switch(n){case`rainy`:case`foggy`:O=.8;break;case`snowy`:O=.5}O>0&&(j(T,O),j(E,O));let k=A(n);return{direct:{intensity:w[0]*k.direct,color:T},ambient:{intensity:w[1]*k.ambient,color:E},timeOfDay:D}}const Y=new Date(0),X=a(),Z=_(),Q=_(),le=_(),$=.25,ue=.2;export{re as ColorAndIntensity,D as computeColorAndIntensity,te as computeDirectionsOverTime,ee as computeShadowsEnabled,O as computeVirtualLightDirection};
2
+ import{identity as e,rotateX as t,rotateY as n,rotateZ as r,fromRotation as i}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as o,lerp as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as c,create as l}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as u,transformMat4 as d,lerp as f,normalize as p,scale as m,add as h,copy as g}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as v,clone as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import b from"../../../core/Logger.js";import{lerp as x,clamp as S}from"../../../core/mathUtils.js";import{S as C}from"../../../chunks/SunCalc.js";import{angle as w}from"./mathUtils.js";const T={local:{altitude:1500,ambientAtNight:.1,ambientAtNoon:.45,ambientAtTwilight:.2,directAtNoon:.65,directAtTwilight:.7},global:{altitude:8e5,ambient:.015,direct:.75},planarDirection:{localAltitude:1e4,globalAltitude:1e6,globalAngles:{azimuth:Math.PI*1.3,altitude:Math.PI*.6}}};class E{constructor(e,t){this.direct=e,this.ambient=t}}function D(e,t,n,r,i,a){u(a.ambient.color,1,1,1),a.ambient.intensity=T.global.ambient,u(a.direct.color,1,1,1),a.direct.intensity=T.global.direct;let o=t[2],s=S((Math.abs(o)-T.local.altitude)/(T.global.altitude-T.local.altitude),0,1);a.globalFactor=s;let c;if(e!=null&&(c=C.getTimes(e,t[1],t[0])),s<1){let t;if(e!=null)t=ce(e,c,r);else{let e=A(r);t={direct:{intensity:T.local.directAtNoon*e.direct,color:v(1,1,1)},ambient:{intensity:T.local.ambientAtNoon*e.ambient,color:v(1,1,1)},timeOfDay:`early afternoon`}}f(a.ambient.color,t.ambient.color,a.ambient.color,s),a.ambient.intensity=x(t.ambient.intensity,a.ambient.intensity,s),f(a.direct.color,t.direct.color,a.direct.color,s),a.direct.intensity=x(t.direct.intensity,a.direct.intensity,s),a.specularStrength=r===`rainy`||r===`snowy`||r===`foggy`?0:1,a.environmentStrength=r===`rainy`?.7:r===`snowy`||r===`foggy`?.75:1}a.noonFactor=e==null?1:oe(e,c),e==null?O(i,n,a.direct.directionToLightSource):k(e,t,n,a.direct.directionToLightSource)}function O(e,t,n){t?p(Z,e.eye):u(Z,0,0,1),m(Q,e.viewForward,-1);let r=w(Q,Z),a=Math.max(r-2*$,0),o=.85*a/(a+1),s=Math.max($,r-$-o);i(X,-s,e.viewRight),d(n,Q,X),h(n,n,m(le,e.viewRight,ue)),p(n,n)}function k(i,a,o,s){let c=ae,l=e(ie);if(o)C.getPosition(i,0,0,c),u(s,0,0,-1),t(l,l,-c.azimuth),n(l,l,-c.altitude),d(s,s,l);else{let e=T.planarDirection,n=e.globalAngles,o=a[2],f=(Math.abs(o)-e.localAltitude)/(e.globalAltitude-e.localAltitude);f=S(f,0,1),f<1?(C.getPosition(i,a[1],a[0],c),c.azimuth=(1-f)*c.azimuth+f*n.azimuth,c.altitude=(1-f)*c.altitude+f*n.altitude):(c.azimuth=n.azimuth,c.altitude=n.altitude),u(s,0,-1,0),r(l,l,-c.azimuth),t(l,l,-c.altitude),d(s,s,l)}}function ee(e,t){return t?!0:Math.abs(e)<T.planarDirection.localAltitude}function te(e,t,n,r,i,a){let o=e.getTime(),s=Math.max(0,t.getTime()-o),c=Math.floor(s/n)+1,l=Math.min(a,c),u=Array(l),d=l===1?0:s/(l-1);c>l&&b.getLogger(`esri.views.3d.support.sunUtils`).warnOnce(`computeDirectionsOverTime`,`Requested interval ${n} exceeds maximum supported interval of ${Math.floor(d)} based on the provided time range.`);for(let e=0;e<l;++e)Y.setTime(o+d*e),u[e]=_(),k(Y,r,i,u[e]);return u}const ne=v(.5773502691896258,-.5773502691896258,.5773502691896258);class re{constructor(){this.ambient={color:v(1,1,1),intensity:.55},this.direct={color:v(1,1,1),intensity:.55,directionToLightSource:y(ne)},this.noonFactor=.5,this.globalFactor=0,this.specularStrength=1,this.environmentStrength=1}}const ie=a(),ae={azimuth:0,altitude:0};function oe(e,t){let n=e.valueOf(),r,i;t.polarException===C.PolarException.MIDNIGHT_SUN?(r=n-(e.getHours()+48)*60*60*1e3-e.getMinutes()*60*1e3,i=r+432e6):t.polarException===C.PolarException.POLAR_NIGHT?(r=n-2,i=n-1):(r=t.sunrise.valueOf(),i=t.sunset.valueOf());let a=i-r,o=r+a/2;return 1-S(Math.abs(n-o)/432e5,0,1)}function A(e){switch(e){case`disabled`:case`sunny`:case`cloudy`:return new E(1,1);case`rainy`:return new E(.4,1.2);case`snowy`:return new E(.5,1.3);case`foggy`:return new E(.2,1.6)}}function j(e,t){let n=(e[0]+e[1]+e[2])/3;e[0]+=(n-e[0])*t,e[1]+=(n-e[1])*t,e[2]+=(n-e[2])*t}const M=v(.01,.01,.01),N=v(1,.6,.5),P=v(1,.98,.98),se=v(1,1,1),F=v(.8,.8,1),I=v(.8,.8,1),L=v(.98,.98,1),R=v(1,1,1),z=c(.01,T.local.ambientAtNight),B=c(T.local.directAtTwilight,T.local.ambientAtTwilight),V=c(.9*T.local.directAtNoon,T.local.ambientAtNoon),H=c(T.local.directAtNoon,T.local.ambientAtNoon),U=V,W=P,G=L,K=B,q=N,J=I;function ce(e,t,n){let r=e.valueOf(),i,a;t.polarException===C.PolarException.MIDNIGHT_SUN?(i=r-(e.getHours()+48)*60*60*1e3-e.getMinutes()*60*1e3,a=i+432e6):t.polarException===C.PolarException.POLAR_NIGHT?(i=r-2,a=r-1):(i=t.sunrise.valueOf(),a=t.sunset.valueOf());let c=a-i,u=i+c/2,d=c/4,p=u-d,m=u+d,h=c*.06,v=h,y=i-h/2,b=i+h/2,x=a-v/2,S=a+v/2,w=l(),T=_(),E=_(),D=``;if(r<y||r>S)o(w,z),g(T,M),g(E,F),D=`night`;else if(r<b){let e=(r-y)/(b-y);s(w,z,B,e),f(T,M,N,e),f(E,F,I,e),D=`sun rising`}else if(r<p){let e=(r-b)/(p-b);s(w,B,V,e),f(T,N,P,e),f(E,I,L,e),D=`early morning`}else if(r<u){let e=(r-p)/(u-p);s(w,V,H,e),f(T,P,se,e),f(E,L,R,e),D=`late morning`}else if(r<m){let e=(r-u)/(m-u);s(w,H,U,e),f(T,se,W,e),f(E,R,G,e),D=`early afternoon`}else if(r<x){let e=(r-m)/(x-m);s(w,U,K,e),f(T,W,q,e),f(E,G,J,e),D=`late afternoon`}else if(r<S){let e=(r-x)/(S-x);s(w,K,z,e),f(T,q,M,e),f(E,J,F,e),D=`sun setting`}let O=0;switch(n){case`rainy`:case`foggy`:O=.8;break;case`snowy`:O=.5}O>0&&(j(T,O),j(E,O));let k=A(n);return{direct:{intensity:w[0]*k.direct,color:T},ambient:{intensity:w[1]*k.ambient,color:E},timeOfDay:D}}const Y=new Date(0),X=a(),Z=_(),Q=_(),le=_(),$=.25,ue=.2;export{re as ColorAndIntensity,ee as areShadowsEnabled,D as computeColorAndIntensity,te as computeDirectionsOverTime,O as computeVirtualLightDirection};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as t}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TileBlendTechniqueConfiguration as n}from"./TileBlendTechniqueConfiguration.js";class r extends n{constructor(){super(...arguments),this.background=0}}e([t({count:2})],r.prototype,`background`,void 0);export{r as BlendLayersTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as t}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TileBlendTechniqueConfiguration as n}from"./TileBlendTechniqueConfiguration.js";class r extends n{constructor(){super(...arguments),this.background=0}get needsUV(){return this.background!==1||this.output!==2}}e([t({count:2})],r.prototype,`background`,void 0);export{r as BlendLayersTechniqueConfiguration};
@@ -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,subclass as r}from"../../../core/accessorSupport/decorators.js";import{projectWithoutEngine as i}from"../../../geometry/projectionUtils.js";import{empty as a,expand as o,allFinite as s,equals as c}from"../../../geometry/support/aaBoundingRect.js";import{isTiledLayer as l}from"../../../layers/support/layerUtils.js";import{webMercatorWorldExtent as u,geographicWorldExtent as d}from"./TerrainConst.js";import{getTiledLayerInfo as f,isProjectableRasterLayer as p}from"./terrainUtils.js";let m=class extends t{constructor(e){super(e)}destroy(){}get layerViewsExtent(){return this._computeLayerViewsExtent()}get tiledLayersExtent(){return this._computeTiledLayersExtent()}};e([n({readOnly:!0})],m.prototype,`layerViewsExtent`,null),e([n({readOnly:!0})],m.prototype,`tiledLayersExtent`,null),e([n()],m.prototype,`viewSpatialReference`,void 0),e([n()],m.prototype,`tilingScheme`,void 0),e([n()],m.prototype,`defaultTiledLayersExtent`,void 0),e([n({constructOnly:!0})],m.prototype,`layers`,void 0),e([n({constructOnly:!0})],m.prototype,`layerViews`,void 0),m=e([r(`esri.views.3d.terrain.ExtentHelper`)],m);function h(e,t){return e===1?new g(t):new _(t)}let g=class extends m{_computeLayerViewsExtent(){return this._globalExtent}_computeTiledLayersExtent(){return this._globalExtent}get _globalExtent(){return this.viewSpatialReference.isWebMercator?u:d}};g=e([r(`esri.views.3d.terrain.ExtentHelper.ExtentHelperGlobal`)],g);let _=class extends m{_computeLayerViewsExtent(){let e=a(),t=this.viewSpatialReference;this.layerViews.forEach(n=>{let r=n.layer;if(n.isResolved()&&(r.type!==`graphics`||!r.internal)){let r=v(`fullExtentInLocalViewSpatialReference`in n&&n.fullExtentInLocalViewSpatialReference||n.layer.fullExtent,t);o(e,r,e)}});let n=s(e)?e:null,r=this._get(`layerViewsExtent`);return c(n,r)?r:n}_computeTiledLayersExtent(){let e=this.tilingScheme;if(!e)return null;let t=this.viewSpatialReference,n=a();this.layers.forEach(r=>{if(r.loaded&&l(r)){let i=f(r,t,2);if(i==null)return;let{tileInfo:a,fullExtent:s}=i,c=`tilemapCache`in r?r.tilemapCache?.effectiveMaxLOD:void 0;a!=null&&s!=null&&(p(r)||e.compatibleWith(a,c)&&s.spatialReference.equals(e.spatialReference))&&o(n,s,n)}}),o(n,this.defaultTiledLayersExtent,n);let r=s(n)?n:null,i=this._get(`tiledLayersExtent`);return c(r,i)?i:r}};_=e([r(`esri.views.3d.terrain.ExtentHelper.ExtentHelperLocal`)],_);function v(e,t){return e!=null&&!e.spatialReference.equals(t)?i(e,e.spatialReference,t):e}export{m as ExtentHelper,h as create};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{projectWithoutEngine as i}from"../../../geometry/projectionUtils.js";import{empty as a,expand as o,allFinite as s,equals as c}from"../../../geometry/support/aaBoundingRect.js";import{isTiledLayer as l}from"../../../layers/support/layerUtils.js";import{webMercatorWorldExtent as u,geographicWorldExtent as d}from"./TerrainConst.js";import{getTiledLayerInfo as f,isProjectableRasterLayer as p}from"./terrainUtils.js";let m=class extends t{constructor(e){super(e)}destroy(){}get layerViewsExtent(){return this._computeLayerViewsExtent()}get tiledLayersExtent(){return this._computeTiledLayersExtent()}};e([n({readOnly:!0})],m.prototype,`layerViewsExtent`,null),e([n({readOnly:!0})],m.prototype,`tiledLayersExtent`,null),e([n()],m.prototype,`viewSpatialReference`,void 0),e([n()],m.prototype,`tilingScheme`,void 0),e([n()],m.prototype,`defaultTiledLayersExtent`,void 0),e([n({constructOnly:!0})],m.prototype,`layers`,void 0),e([n({constructOnly:!0})],m.prototype,`layerViews`,void 0),m=e([r(`esri.views.3d.terrain.ExtentHelper`)],m);function h(e,t){return e?new g(t):new _(t)}let g=class extends m{_computeLayerViewsExtent(){return this._globalExtent}_computeTiledLayersExtent(){return this._globalExtent}get _globalExtent(){return this.viewSpatialReference.isWebMercator?u:d}};g=e([r(`esri.views.3d.terrain.ExtentHelper.ExtentHelperGlobal`)],g);let _=class extends m{_computeLayerViewsExtent(){let e=a(),t=this.viewSpatialReference;this.layerViews.forEach(n=>{let r=n.layer;if(n.isResolved()&&(r.type!==`graphics`||!r.internal)){let r=v(`fullExtentInLocalViewSpatialReference`in n&&n.fullExtentInLocalViewSpatialReference||n.layer.fullExtent,t);o(e,r,e)}});let n=s(e)?e:null,r=this._get(`layerViewsExtent`);return c(n,r)?r:n}_computeTiledLayersExtent(){let e=this.tilingScheme;if(!e)return null;let t=this.viewSpatialReference,n=a();this.layers.forEach(r=>{if(r.loaded&&l(r)){let i=f(r,t,!1);if(i==null)return;let{tileInfo:a,fullExtent:s}=i,c=`tilemapCache`in r?r.tilemapCache?.effectiveMaxLOD:void 0;a!=null&&s!=null&&(p(r)||e.compatibleWith(a,c)&&s.spatialReference.equals(e.spatialReference))&&o(n,s,n)}}),o(n,this.defaultTiledLayersExtent,n);let r=s(n)?n:null,i=this._get(`tiledLayersExtent`);return c(r,i)?i:r}};_=e([r(`esri.views.3d.terrain.ExtentHelper.ExtentHelperLocal`)],_);function v(e,t){return e!=null&&!e.spatialReference.equals(t)?i(e,e.spatialReference,t):e}export{m as ExtentHelper,h as create};
@@ -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,subclass as r}from"../../../core/accessorSupport/decorators.js";import{cyclicalPI as i}from"../../../core/Cyclical.js";import"../../../core/has.js";import{subtract as a}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{add as o,subtract as s,copy as c,distance as l}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as d,scale as f,add as p}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as m,create as h}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{clamp as g,deg2rad as ee}from"../../../core/mathUtils.js";import{destroyMaybe as _}from"../../../core/maybe.js";import{watch as v,sync as y,on as b}from"../../../core/reactiveUtils.js";import{getReferenceEllipsoid as x}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as S}from"../../../geometry/projection/projectVectorToVector.js";import{create as C,width as w,center as T,copy as E,intersection as D,contains as te,offset as O}from"../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as k}from"../../../geometry/support/normalizeUtils.js";import{create as A,wrap as j}from"../../../geometry/support/ray.js";import{Sphere as M}from"../../../geometry/support/sphere.js";import{angleAroundAxis as N}from"../../../geometry/support/vector.js";import{y2lat as P}from"../../../geometry/support/webMercatorUtils.js";import{TaskPriority as F,noBudget as I}from"../../support/Scheduler.js";import{Yield as L}from"../../support/Yield.js";import{viewAngle as R}from"../state/utils/viewUtils.js";import{debugFlags as z}from"../support/debugFlags.js";import{DebugPoint as B}from"../support/debugUtils.js";import{getPlanarDistanceToGroundRatio as V}from"../support/planarDistanceToGroundRatio.js";import{Intersector as H}from"../webgl-engine/lib/Intersector.js";import{fromValues as U}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as W}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as G,ensureTextureSize as K}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as ne}from"../webgl-engine/parts/renderUtils.js";import{OverlayRenderer as re}from"./OverlayRenderer.js";const q=1.3,ie=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let J,Y=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0,this.groundView=e.view.groundView}initialize(){let{view:e}=this;this.renderer=new re({parent:this}),e.stage.renderer.plugins.add(this.renderer);let t=()=>this.requestRender();this._groundIntersector=new H(e.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([v(()=>this.renderer.hasHighlights,t),this.renderer.events.on(`has-water`,()=>e.stage?.renderer.updateHasFlags()),this.renderer.events.on(`content-changed`,t),v(()=>e.state.camera.pixelRatio,t),v(()=>e.state.alignPixelEnabled,t),this.renderer.events.on(`textures-disposed`,()=>this.groundView.requestRender(1)),v(()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),v(()=>[e.state?.pixelRatio,e.state?.contentPixelRatio],()=>this.setPlacementDirty(),y),b(()=>e.groundAndIMSurface,`elevation-change`,()=>this.setPlacementDirty()),e.on(`resize`,()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(F.OVERLAY,this)]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null,_(this.renderer)),J&&=(J.hide(),null),this.renderer=null}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;let t=this.view.renderSpatialReference;e!=null&&t!=null?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=k(e))):this.renderer.disposeOverlays()}get readyToRun(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||z.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!(this.terrainSurface.enabled&&this.terrainSurface.freeze)&&this.groundView.ready}get _isSpherical(){return this.view.state.isGlobal}get mapUnitsToPlanarDistanceRatio(){return this._spatialReference!=null&&this._spatialReference.isGeographic&&this._isSpherical?x(this._spatialReference).metersPerDegree:1}getPlanarDistanceToGroundRatio(e){return this._spatialReference==null?1:V(this._spatialReference,this._isSpherical,e)}get _overlayStretch(){return q/this.view.resolutionScale}get longitudeCyclical(){return this.renderer.longitudeCyclical}get updating(){return this.readyToRun||!!this.renderer?.updating||this._contentUpdated}render(e){return this._contentUpdated=!1,this.renderer.time=e,this.renderer.processSyncDrapeSources(),this.renderer.precompileShaders(this.view.state)?this._drawOverlays():null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange(`readyToRun`)}registerGeometryDrapeSource(e){let t=new W({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){this.renderer.overlays.length===2&&e.setDrapingExtent!=null&&this._spatialReference!=null&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange(`readyToRun`))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this.updateOverlays(e,this.view.state.contentCamera,1)}updateOverlays(e,t,n){if(!this._spatialReference||!this.view.pointsOfInterest?.centerOnSurfaceFrequent)return L;let r=this._computeOverlayHeight(t),i=this._computeOverlayExtents(t,r,Q,e);this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.overlayStretch=Q.stretch;let a=this._updateOverlay(0,Q.inner,r,1*Q.pixelRatioAdjustment,Q.mapUnitsPerPixel),o=w(Q.inner)/w(Q.outer),s=this._updateOverlay(1,Q.outer,r,o*Q.pixelRatioAdjustment,Q.mapUnitsPerPixel);if((a===1||s===1)&&(this._drapeSources.forEach(e=>this._updateDrapeSourceExtent(e)),this.groundView.updateOverlayParameters(),this.groundView.requestRender(n)),(a!==0||s!==0)&&this.requestRender(),this._placementDirty=!i,e.madeProgress(),this._placementDirty)return L}_computeOverlayHeight(e){let t=this.view.state.contentPixelRatio*this.view.resolutionScale,n=e.fullWidth/e.pixelRatio*t,r=e.fullHeight/e.pixelRatio*t,i=Math.ceil(Math.max(n,r)*1.5),{maxPreferredTexturePixels:a,maxTextureSize:o}=this.view.stage.renderView.renderingContext.parameters,s=o*.5;return G(K({width:i,height:i},{maxPreferredTexturePixels:a*2,maxTextureSize:s})[1],s)}get overlays(){return this.renderer.overlays}_updateOverlay(e,t,n,r,i){if(this.renderer.overlays.length===0)return 0;let a=this.renderer.overlays[e],o=a.mapUnitsPerPixel;if(a.mapUnitsPerPixel=i,a.pixelRatio=r,ae(t,a.extent)&&n===a.resolution)return o===i?0:2;a.setExtent(t),a.resolution=n;let s=T(a.extent);return a.renderLocalOrigin=U(s[0],s[1],0,`OV_${this._latestOriginId++}`),1}overlayPixelSizeInMapUnits(e,t){if(this.renderer.overlays.length===0)return t();let n=this.renderer.overlays[0],r=this.renderer.overlays[1],i=this._pointIsInExtent(e,n.extent)?n:r;return(i.extent[2]-i.extent[0])/i.resolution}reloadShaders(){ne(),this.requestRender(),this.runTask(I)}requestRender(e=1){this.renderer.hasOverlays?(e===1?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,n,r,i,a=I){let s=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,le,t,n);if(s==null)return!1;let c=s.origin,l=o(Z,s.origin,s.direction);if(this._groundIntersector.reset(c,l,e),this._groundIntersector.intersect([]),!this.view.groundAndIMSurface.intersectBudgeted(this._groundIntersector,null,c,l,a))return L;let u=this._groundIntersector.results.min;return u.getIntersectionPoint(i)&&u.withinDistance(r)}_findHorizonBasedPointOfInterest(e,t,n=I){let r=.5,a=.55,o=this.view.renderCoordsHelper.getAltitude(e.eye),c=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,u=g(c.estimatedSurfaceAltitude,e.aboveGround?-1/0:o+l,e.aboveGround?o-l:1/0),f=e.aboveGround;if(this.view.viewingMode===`global`){let t=Z;$.radius=x(this.view.spatialReference).radius+u,$.closestPointOnSilhouette(j(e.eye,e.viewForward),t),s(t,t,e.eye);let n=i.normalize(N(e.viewForward,t,e.viewRight))/e.fovY+.5,o=n<=0||n>=1?.5:a;r=f?o*n:n+o*(1-n)}else{let t=Math.PI*.5-Math.acos(-e.viewForward[2]),n=m(0,Math.tan(t),1,0),i=d(n,n,e.projectionMatrix)[1],o=g(.5+.5*i,0,1);r=o===1||o===0?.5:f?o*a:1-(1-o)*a}return this._intersectGroundFromView(e,.5,r,c.distance,t,n)}_computeOverlayExtents(e,t,n,r=I){let{view:i}=this,o=i.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,s=u(),d=this._findHorizonBasedPointOfInterest(e,s,r);d&&d!==L||c(s,o);let m=this._renderSR;z.OVERLAY_SHOW_CENTER?(J??=new B(i.graphics,`red`),J.show(s,m)):J?.hide();let h=Math.max(.1,l(e.eye,s)),g=R(i.renderCoordsHelper,o,e.eye),_=this._spatialReference;this._overlaySREqualsRenderSR||S(s,m,s,_);let v=this._isSpherical,y=this.groundView.groundExtent,b=!v&&_?.isGeographic,C=b&&_?1/x(_).metersPerDegree:1,T=i.state.contentPixelRatio,O=e.computeScreenPixelSizeAtDistance(h)/T*C;n.mapUnitsPerPixel=b?O:O/this.mapUnitsToPlanarDistanceRatio,n.stretch=this._overlayStretch;let k=t*O/2*n.stretch,A=!1,j=b?90:1/0;v&&y&&_&&(_.isWebMercator?(k/=Math.cos(P(s[1])),j=y[3]):(A=!0,k/=x(_).metersPerDegree,j=90),k>=j&&(k=j,s[1]=0,_.isWebMercator&&(s[0]=0)));let M=1;A&&(M=1/Math.max(.2,Math.cos(Math.abs(ee(s[1])))),k*M>180&&(M=180/k),n.mapUnitsPerPixel*=M);let N=Math.log(2)/12;k=Math.exp(Math.round(Math.log(k)/N)*N);let F=k*M,V=.5*t/(32*F),H=.5*t/(32*k);s[0]=Math.round(s[0]*V)/V,s[1]=Math.round(s[1]*H)/H;let U=n.inner;U[0]=s[0]-F,U[1]=s[1]-k,U[2]=s[0]+F,U[3]=s[1]+k,v&&this._shiftExtentToFitBounds(U,1/0,j);let W=n.outer;if(y&&6*F>w(y))E(W,y);else if(Math.PI/2-Math.abs(g-Math.PI/2)<=.25*Math.PI)W[0]=U[0]-F,W[1]=U[1]-k,W[2]=U[2]+F,W[3]=U[3]+k;else{S(e.eye,m,Z,_),a(X,s,Z);let t=-Math.atan2(X[1],X[0])+Math.PI*.125;t<0&&(t+=2*Math.PI);let n=Math.floor(t/(Math.PI*.25));f(X,ie[n],k*2),X[0]*=M,X[2]*=M,p(W,U,X)}if(v&&this.longitudeCyclical)W[0]=this.longitudeCyclical.clamp(W[0]),W[2]=this.longitudeCyclical.clamp(W[2]),W[1]=Math.max(W[1],-j),W[3]=Math.min(W[3],j);else{let e=D(U,y,se),t=D(W,y,ce);te(e,t)&&(W[2]=W[0],W[3]=W[1])}let G=Math.abs(U[2]-U[0])/t;return n.mapUnitsPerPixel=Math.max(n.mapUnitsPerPixel,G),n.pixelRatioAdjustment=n.mapUnitsPerPixel/G,d!==L}_drawOverlays(e=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;let t=!this._drawTexturesDirty&&this._drawTexturesAnimateDirty?0:1;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;let n=this.renderer.computeValidity();return this.renderer.releaseRenderTargets(t),this.renderer.drawOverlays(e,t),n!==this.renderer.computeValidity()&&(this.groundView.updateOverlayParameters(),this.groundView.requestRender(1)),this.groundView.requestRender(t),t===1&&this.terrainSurface.requestUpdate(),this.renderer}_pointIsInExtent(e,t){if(this.longitudeCyclical)return this.longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];let n=e.x,r=e.y;return n>t[0]&&n<t[2]&&r>t[1]&&r<t[3]}_shiftExtentToFitBounds(e,t,n){let r=0,i=0;e[0]<-t?r=e[0]+t:e[2]>t&&(r=t-e[2]),e[1]<-n?i=e[1]+n:e[3]>n&&(i=n-e[3]),O(e,r,i)}get test(){}};e([n()],Y.prototype,`_spatialReference`,void 0),e([n({readOnly:!0})],Y.prototype,`readyToRun`,null),e([n()],Y.prototype,`_placementDirty`,void 0),e([n()],Y.prototype,`_contentUpdated`,void 0),e([n()],Y.prototype,`_isSpherical`,null),e([n()],Y.prototype,`mapUnitsToPlanarDistanceRatio`,null),e([n()],Y.prototype,`renderer`,void 0),e([n({constructOnly:!0})],Y.prototype,`view`,void 0),e([n({constructOnly:!0})],Y.prototype,`groundView`,void 0),e([n({constructOnly:!0})],Y.prototype,`terrainSurface`,void 0),e([n()],Y.prototype,`updating`,null),Y=e([r(`esri.views.3d.terrain.OverlayManager`)],Y);function ae(e,t){let n=z.ENABLE_OPTIMIZATIONS?1e-5*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]):0;return Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n}class oe{constructor(){this.inner=C(),this.outer=C(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=q}}const X=h(),Z=u(),Q=new oe,se=C(),ce=C(),le=A(),$=new M;export{Y as OverlayManager};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{cyclicalPI as i}from"../../../core/Cyclical.js";import"../../../core/has.js";import{subtract as a}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{add as o,subtract as s,copy as c,distance as l}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as d,scale as f,add as p}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as m,create as h}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{clamp as g,deg2rad as ee}from"../../../core/mathUtils.js";import{destroyMaybe as _}from"../../../core/maybe.js";import{watch as v,sync as y,on as b}from"../../../core/reactiveUtils.js";import{getReferenceEllipsoid as x}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as S}from"../../../geometry/projection/projectVectorToVector.js";import{create as C,width as w,center as T,copy as E,intersection as D,contains as te,offset as O}from"../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as k}from"../../../geometry/support/normalizeUtils.js";import{create as A,wrap as j}from"../../../geometry/support/ray.js";import{Sphere as M}from"../../../geometry/support/sphere.js";import{angleAroundAxis as N}from"../../../geometry/support/vector.js";import{y2lat as P}from"../../../geometry/support/webMercatorUtils.js";import{TaskPriority as F,noBudget as I}from"../../support/Scheduler.js";import{Yield as L}from"../../support/Yield.js";import{viewAngle as R}from"../state/utils/viewUtils.js";import{debugFlags as z}from"../support/debugFlags.js";import{DebugPoint as B}from"../support/debugUtils.js";import{getPlanarDistanceToGroundRatio as V}from"../support/planarDistanceToGroundRatio.js";import{Intersector as H}from"../webgl-engine/lib/Intersector.js";import{fromValues as U}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as W}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as G,ensureTextureSize as K}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as ne}from"../webgl-engine/parts/renderUtils.js";import{OverlayRenderer as re}from"./OverlayRenderer.js";const q=1.3,ie=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let J,Y=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0,this.groundView=e.view.groundView}initialize(){let{view:e}=this;this.renderer=new re({parent:this}),e.stage.renderer.plugins.add(this.renderer);let t=()=>this.requestRender();this._groundIntersector=new H(e.state.isGlobal),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([v(()=>this.renderer.hasHighlights,t),this.renderer.events.on(`has-water`,()=>e.stage?.renderer.updateHasFlags()),this.renderer.events.on(`content-changed`,t),v(()=>e.state.camera.pixelRatio,t),v(()=>e.state.alignPixelEnabled,t),this.renderer.events.on(`textures-disposed`,()=>this.groundView.requestRender(1)),v(()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),v(()=>[e.state?.pixelRatio,e.state?.contentPixelRatio],()=>this.setPlacementDirty(),y),b(()=>e.groundAndIMSurface,`elevation-change`,()=>this.setPlacementDirty()),e.on(`resize`,()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(F.OVERLAY,this)]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null,_(this.renderer)),J&&=(J.hide(),null),this.renderer=null}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;let t=this.view.renderSpatialReference;e!=null&&t!=null?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=k(e))):this.renderer.disposeOverlays()}get readyToRun(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||z.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!(this.terrainSurface.enabled&&this.terrainSurface.freeze)&&this.groundView.ready}get _isSpherical(){return this.view.state.isGlobal}get mapUnitsToPlanarDistanceRatio(){return this._spatialReference!=null&&this._spatialReference.isGeographic&&this._isSpherical?x(this._spatialReference).metersPerDegree:1}getPlanarDistanceToGroundRatio(e){return this._spatialReference==null?1:V(this._spatialReference,this._isSpherical,e)}get _overlayStretch(){return q/this.view.resolutionScale}get longitudeCyclical(){return this.renderer.longitudeCyclical}get updating(){return this.readyToRun||!!this.renderer?.updating||this._contentUpdated}render(e){return this._contentUpdated=!1,this.renderer.time=e,this.renderer.processSyncDrapeSources(),this.renderer.precompileShaders(this.view.state)?this._drawOverlays():null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange(`readyToRun`)}registerGeometryDrapeSource(e){let t=new W({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){this.renderer.overlays.length===2&&e.setDrapingExtent!=null&&this._spatialReference!=null&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange(`readyToRun`))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this.updateOverlays(e,this.view.state.contentCamera,1)}updateOverlays(e,t,n){if(!this._spatialReference||!this.view.pointsOfInterest?.centerOnSurfaceFrequent)return L;let r=this._computeOverlayHeight(t),i=this._computeOverlayExtents(t,r,Q,e);this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.overlayStretch=Q.stretch;let a=this._updateOverlay(0,Q.inner,r,+Q.pixelRatioAdjustment,Q.mapUnitsPerPixel),o=w(Q.inner)/w(Q.outer),s=this._updateOverlay(1,Q.outer,r,o*Q.pixelRatioAdjustment,Q.mapUnitsPerPixel);if((a===1||s===1)&&(this._drapeSources.forEach(e=>this._updateDrapeSourceExtent(e)),this.groundView.updateOverlayParameters(),this.groundView.requestRender(n)),(a!==0||s!==0)&&this.requestRender(),this._placementDirty=!i,e.madeProgress(),this._placementDirty)return L}_computeOverlayHeight(e){let t=this.view.state.contentPixelRatio*this.view.resolutionScale,n=e.fullWidth/e.pixelRatio*t,r=e.fullHeight/e.pixelRatio*t,i=Math.ceil(Math.max(n,r)*1.5),{maxPreferredTexturePixels:a,maxTextureSize:o}=this.view.stage.renderView.renderingContext.parameters,s=o*.5;return G(K({width:i,height:i},{maxPreferredTexturePixels:a*2,maxTextureSize:s})[1],s)}get overlays(){return this.renderer.overlays}_updateOverlay(e,t,n,r,i){if(this.renderer.overlays.length===0)return 0;let a=this.renderer.overlays[e],o=a.mapUnitsPerPixel;if(a.mapUnitsPerPixel=i,a.pixelRatio=r,ae(t,a.extent)&&n===a.resolution)return o===i?0:2;a.setExtent(t),a.resolution=n;let s=T(a.extent);return a.renderLocalOrigin=U(s[0],s[1],0,`OV_${this._latestOriginId++}`),1}overlayPixelSizeInMapUnits(e,t){if(this.renderer.overlays.length===0)return t();let n=this.renderer.overlays[0],r=this.renderer.overlays[1],i=this._pointIsInExtent(e,n.extent)?n:r;return(i.extent[2]-i.extent[0])/i.resolution}reloadShaders(){ne(),this.requestRender(),this.runTask(I)}requestRender(e=1){this.renderer.hasOverlays?(e===1?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,n,r,i,a=I){let s=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,le,t,n);if(s==null)return!1;let c=s.origin,l=o(Z,s.origin,s.direction);if(this._groundIntersector.reset(c,l,e),this._groundIntersector.intersect([]),!this.view.groundAndIMSurface.intersectBudgeted(this._groundIntersector,null,c,l,a))return L;let u=this._groundIntersector.results.min;return u.getIntersectionPoint(i)&&u.withinDistance(r)}_findHorizonBasedPointOfInterest(e,t,n=I){let r=.5,a=.55,o=this.view.renderCoordsHelper.getAltitude(e.eye),c=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,u=g(c.estimatedSurfaceAltitude,e.aboveGround?-1/0:o+l,e.aboveGround?o-l:1/0),f=e.aboveGround;if(this.view.state.isGlobal){let t=Z;$.radius=x(this.view.spatialReference).radius+u,$.closestPointOnSilhouette(j(e.eye,e.viewForward),t),s(t,t,e.eye);let n=i.normalize(N(e.viewForward,t,e.viewRight))/e.fovY+.5,o=n<=0||n>=1?.5:a;r=f?o*n:n+o*(1-n)}else{let t=Math.PI*.5-Math.acos(-e.viewForward[2]),n=m(0,Math.tan(t),1,0),i=d(n,n,e.projectionMatrix)[1],o=g(.5+.5*i,0,1);r=o===1||o===0?.5:f?o*a:1-(1-o)*a}return this._intersectGroundFromView(e,.5,r,c.distance,t,n)}_computeOverlayExtents(e,t,n,r=I){let{view:i}=this,o=i.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,s=u(),d=this._findHorizonBasedPointOfInterest(e,s,r);d&&d!==L||c(s,o);let m=this._renderSR;z.OVERLAY_SHOW_CENTER?(J??=new B(i.graphics,`red`),J.show(s,m)):J?.hide();let h=Math.max(.1,l(e.eye,s)),g=R(i.renderCoordsHelper,o,e.eye),_=this._spatialReference;this._overlaySREqualsRenderSR||S(s,m,s,_);let v=this._isSpherical,y=this.groundView.groundExtent,b=!v&&_?.isGeographic,C=b&&_?1/x(_).metersPerDegree:1,T=i.state.contentPixelRatio,O=e.computeScreenPixelSizeAtDistance(h)/T*C;n.mapUnitsPerPixel=b?O:O/this.mapUnitsToPlanarDistanceRatio,n.stretch=this._overlayStretch;let k=t*O/2*n.stretch,A=!1,j=b?90:1/0;v&&y&&_&&(_.isWebMercator?(k/=Math.cos(P(s[1])),j=y[3]):(A=!0,k/=x(_).metersPerDegree,j=90),k>=j&&(k=j,s[1]=0,_.isWebMercator&&(s[0]=0)));let M=1;A&&(M=1/Math.max(.2,Math.cos(Math.abs(ee(s[1])))),k*M>180&&(M=180/k),n.mapUnitsPerPixel*=M);let N=Math.log(2)/12;k=Math.exp(Math.round(Math.log(k)/N)*N);let F=k*M,V=.5*t/(32*F),H=.5*t/(32*k);s[0]=Math.round(s[0]*V)/V,s[1]=Math.round(s[1]*H)/H;let U=n.inner;U[0]=s[0]-F,U[1]=s[1]-k,U[2]=s[0]+F,U[3]=s[1]+k,v&&this._shiftExtentToFitBounds(U,1/0,j);let W=n.outer;if(y&&6*F>w(y))E(W,y);else if(Math.PI/2-Math.abs(g-Math.PI/2)<=.25*Math.PI)W[0]=U[0]-F,W[1]=U[1]-k,W[2]=U[2]+F,W[3]=U[3]+k;else{S(e.eye,m,Z,_),a(X,s,Z);let t=-Math.atan2(X[1],X[0])+Math.PI*.125;t<0&&(t+=2*Math.PI);let n=Math.floor(t/(Math.PI*.25));f(X,ie[n],k*2),X[0]*=M,X[2]*=M,p(W,U,X)}if(v&&this.longitudeCyclical)W[0]=this.longitudeCyclical.clamp(W[0]),W[2]=this.longitudeCyclical.clamp(W[2]),W[1]=Math.max(W[1],-j),W[3]=Math.min(W[3],j);else{let e=D(U,y,se),t=D(W,y,ce);te(e,t)&&(W[2]=W[0],W[3]=W[1])}let G=Math.abs(U[2]-U[0])/t;return n.mapUnitsPerPixel=Math.max(n.mapUnitsPerPixel,G),n.pixelRatioAdjustment=n.mapUnitsPerPixel/G,d!==L}_drawOverlays(e=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;let t=!this._drawTexturesDirty&&this._drawTexturesAnimateDirty?0:1;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;let n=this.renderer.computeValidity();return this.renderer.releaseRenderTargets(t),this.renderer.drawOverlays(e,t),n!==this.renderer.computeValidity()&&(this.groundView.updateOverlayParameters(),this.groundView.requestRender(1)),this.groundView.requestRender(t),t===1&&this.terrainSurface.requestUpdate(),this.renderer}_pointIsInExtent(e,t){if(this.longitudeCyclical)return this.longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];let n=e.x,r=e.y;return n>t[0]&&n<t[2]&&r>t[1]&&r<t[3]}_shiftExtentToFitBounds(e,t,n){let r=0,i=0;e[0]<-t?r=e[0]+t:e[2]>t&&(r=t-e[2]),e[1]<-n?i=e[1]+n:e[3]>n&&(i=n-e[3]),O(e,r,i)}get test(){}};e([n()],Y.prototype,`_spatialReference`,void 0),e([n({readOnly:!0})],Y.prototype,`readyToRun`,null),e([n()],Y.prototype,`_placementDirty`,void 0),e([n()],Y.prototype,`_contentUpdated`,void 0),e([n()],Y.prototype,`_isSpherical`,null),e([n()],Y.prototype,`mapUnitsToPlanarDistanceRatio`,null),e([n()],Y.prototype,`renderer`,void 0),e([n({constructOnly:!0})],Y.prototype,`view`,void 0),e([n({constructOnly:!0})],Y.prototype,`groundView`,void 0),e([n({constructOnly:!0})],Y.prototype,`terrainSurface`,void 0),e([n()],Y.prototype,`updating`,null),Y=e([r(`esri.views.3d.terrain.OverlayManager`)],Y);function ae(e,t){let n=z.ENABLE_OPTIMIZATIONS?1e-5*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]):0;return Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n}class oe{constructor(){this.inner=C(),this.outer=C(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=q}}const X=h(),Z=u(),Q=new oe,se=C(),ce=C(),le=A(),$=new M;export{Y as OverlayManager};