@arcgis/core 4.31.0-next.20240821 → 4.31.0-next.20240823

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 (376) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{24e38b7d1e9984a1472e.js → 033032715c3b04e0fc7d.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{cfc93bbd35cc4bfde7c0.js → 045336db17aae6eef68f.js} +1 -1
  4. package/assets/esri/core/workers/chunks/04de7b2937d5ca7c23e2.js +1 -0
  5. package/assets/esri/core/workers/chunks/12a4b3706162872c2b41.js +769 -0
  6. package/assets/esri/core/workers/chunks/142b1336533fa2ac470b.js +47 -0
  7. package/assets/esri/core/workers/chunks/185e596f86767c22f951.js +1 -0
  8. package/assets/esri/core/workers/chunks/{cd8d595d577b74817623.js → 1a4b3820136fb615b730.js} +1 -1
  9. package/assets/esri/core/workers/chunks/29b157b41dfa16da886b.js +1 -0
  10. package/assets/esri/core/workers/chunks/300b57846114fedd12be.js +1 -0
  11. package/assets/esri/core/workers/chunks/{3f75b7ed24b440b4508a.js → 3d5f37c2f355260e6dc6.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a9eba26d62b62592cee1.js → 42861d54a336146753d8.js} +1 -1
  13. package/assets/esri/core/workers/chunks/4c8deac4bf72a5e2597a.js +1 -0
  14. package/assets/esri/core/workers/chunks/52107d450c55450f5c04.js +274 -0
  15. package/assets/esri/core/workers/chunks/6d54222301b6d819c904.js +1 -0
  16. package/assets/esri/core/workers/chunks/{eb0f180ed20af220a82e.js → 6ddece9cd94b60efe3d7.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{566844774388a031fd74.js → 7125cff7fd288ff7bd5f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/74de734a20b4cd2d7efb.js +1 -0
  19. package/assets/esri/core/workers/chunks/7712a23dc68220edaa64.js +1 -0
  20. package/assets/esri/core/workers/chunks/{ea561b2460e634a643fc.js → 7f35380809e7de99c302.js} +1 -1
  21. package/assets/esri/core/workers/chunks/7f3d49b667e9b46449e7.js +1 -0
  22. package/assets/esri/core/workers/chunks/8a2faf12938e811a9fc9.js +1 -0
  23. package/assets/esri/core/workers/chunks/{796c64b9caa1303e26ed.js → 8af503fa88c1668872eb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{e2a6f77c05d0818e3f74.js → 8e42ce8305cefba5debc.js} +1 -1
  25. package/assets/esri/core/workers/chunks/93169e55e472fec4bc50.js +1 -0
  26. package/assets/esri/core/workers/chunks/985c1f42aab564008c0d.js +1 -0
  27. package/assets/esri/core/workers/chunks/9a32d9d720cb81abfba2.js +1 -0
  28. package/assets/esri/core/workers/chunks/b171d57b4d0142f687d0.js +1 -0
  29. package/assets/esri/core/workers/chunks/d5e376893cd47605a438.js +1 -0
  30. package/assets/esri/core/workers/chunks/df9daac7ea581e9e5ca4.js +1 -0
  31. package/assets/esri/core/workers/chunks/f11ae249cc8e995bbccc.js +1 -0
  32. package/assets/esri/core/workers/chunks/{65d8011cf756b066cade.js → f218316de8b4635653b2.js} +1 -1
  33. package/assets/esri/libs/linkchartlayout/lclayout.wasm +0 -0
  34. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  35. package/assets/esri/themes/base/_core.scss +2 -0
  36. package/assets/esri/themes/base/widgets/_Grid.scss +0 -8
  37. package/assets/esri/themes/base/widgets/_GridControls.scss +86 -0
  38. package/assets/esri/themes/base/widgets/_Print.scss +13 -15
  39. package/assets/esri/themes/dark/main.css +1 -1
  40. package/assets/esri/themes/light/main.css +1 -1
  41. package/assets/esri/themes/light/view.css +1 -1
  42. package/assets/esri/widgets/Print/t9n/Print.json +1 -1
  43. package/assets/esri/widgets/Print/t9n/Print_ar.json +1 -1
  44. package/assets/esri/widgets/Print/t9n/Print_bg.json +1 -1
  45. package/assets/esri/widgets/Print/t9n/Print_bs.json +1 -1
  46. package/assets/esri/widgets/Print/t9n/Print_ca.json +1 -1
  47. package/assets/esri/widgets/Print/t9n/Print_cs.json +1 -1
  48. package/assets/esri/widgets/Print/t9n/Print_da.json +1 -1
  49. package/assets/esri/widgets/Print/t9n/Print_de.json +1 -1
  50. package/assets/esri/widgets/Print/t9n/Print_el.json +1 -1
  51. package/assets/esri/widgets/Print/t9n/Print_en.json +1 -1
  52. package/assets/esri/widgets/Print/t9n/Print_es.json +1 -1
  53. package/assets/esri/widgets/Print/t9n/Print_et.json +1 -1
  54. package/assets/esri/widgets/Print/t9n/Print_fi.json +1 -1
  55. package/assets/esri/widgets/Print/t9n/Print_fr.json +1 -1
  56. package/assets/esri/widgets/Print/t9n/Print_he.json +1 -1
  57. package/assets/esri/widgets/Print/t9n/Print_hr.json +1 -1
  58. package/assets/esri/widgets/Print/t9n/Print_hu.json +1 -1
  59. package/assets/esri/widgets/Print/t9n/Print_id.json +1 -1
  60. package/assets/esri/widgets/Print/t9n/Print_it.json +1 -1
  61. package/assets/esri/widgets/Print/t9n/Print_ja.json +1 -1
  62. package/assets/esri/widgets/Print/t9n/Print_ko.json +1 -1
  63. package/assets/esri/widgets/Print/t9n/Print_lt.json +1 -1
  64. package/assets/esri/widgets/Print/t9n/Print_lv.json +1 -1
  65. package/assets/esri/widgets/Print/t9n/Print_nb.json +1 -1
  66. package/assets/esri/widgets/Print/t9n/Print_nl.json +1 -1
  67. package/assets/esri/widgets/Print/t9n/Print_pl.json +1 -1
  68. package/assets/esri/widgets/Print/t9n/Print_pt-BR.json +1 -1
  69. package/assets/esri/widgets/Print/t9n/Print_pt-PT.json +1 -1
  70. package/assets/esri/widgets/Print/t9n/Print_ro.json +1 -1
  71. package/assets/esri/widgets/Print/t9n/Print_ru.json +1 -1
  72. package/assets/esri/widgets/Print/t9n/Print_sk.json +1 -1
  73. package/assets/esri/widgets/Print/t9n/Print_sl.json +1 -1
  74. package/assets/esri/widgets/Print/t9n/Print_sr.json +1 -1
  75. package/assets/esri/widgets/Print/t9n/Print_sv.json +1 -1
  76. package/assets/esri/widgets/Print/t9n/Print_th.json +1 -1
  77. package/assets/esri/widgets/Print/t9n/Print_tr.json +1 -1
  78. package/assets/esri/widgets/Print/t9n/Print_uk.json +1 -1
  79. package/assets/esri/widgets/Print/t9n/Print_vi.json +1 -1
  80. package/assets/esri/widgets/Print/t9n/Print_zh-CN.json +1 -1
  81. package/assets/esri/widgets/Print/t9n/Print_zh-HK.json +1 -1
  82. package/assets/esri/widgets/Print/t9n/Print_zh-TW.json +1 -1
  83. package/assets/esri/widgets/support/GridControls/t9n/GridControls.json +1 -0
  84. package/assets/esri/widgets/support/GridControls/t9n/GridControls_en.json +1 -0
  85. package/chunks/CloudsComposition.glsl.js +3 -3
  86. package/chunks/ComponentShader.glsl.js +53 -61
  87. package/chunks/DefaultMaterial.glsl.js +1 -1
  88. package/chunks/FocusAreaColor.glsl.js +12 -0
  89. package/chunks/FocusAreaMask.glsl.js +5 -0
  90. package/chunks/Laserlines.glsl.js +1 -1
  91. package/chunks/Path.glsl.js +22 -17
  92. package/chunks/PointRenderer.glsl.js +3 -3
  93. package/chunks/Precipitation.glsl.js +1 -1
  94. package/chunks/Terrain.glsl.js +1 -1
  95. package/chunks/WaterSurface.glsl.js +18 -18
  96. package/chunks/boundedPlane.js +1 -1
  97. package/chunks/cameraUtilsPlanar.js +1 -1
  98. package/chunks/cameraUtilsSpherical.js +1 -1
  99. package/chunks/sphere.js +1 -1
  100. package/chunks/terrainUtilsPlanar.js +1 -1
  101. package/chunks/vec32.js +1 -1
  102. package/chunks/vxlLayer.js +1 -1
  103. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  104. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  105. package/core/mathUtils.js +1 -1
  106. package/core/perspectiveUtils.js +1 -1
  107. package/exports/csv.js +1 -1
  108. package/geometry/operators/support/converterAPI.js +1 -1
  109. package/geometry/projection/localLinearScaleFactors.js +1 -1
  110. package/geometry/support/buffer/internals/Vec3.js +1 -1
  111. package/geometry/support/clipRay.js +1 -1
  112. package/geometry/support/coordinateSystem.js +1 -1
  113. package/geometry/support/frustum.js +1 -1
  114. package/geometry/support/heightModelInfoUtils.js +1 -1
  115. package/geometry/support/lineSegment.js +1 -1
  116. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  117. package/geometry/support/meshUtils/rotate.js +1 -1
  118. package/geometry/support/meshUtils/scale.js +1 -1
  119. package/geometry/support/plane.js +1 -1
  120. package/geometry/support/polygonUtils.js +1 -1
  121. package/geometry/support/ray.js +1 -1
  122. package/geometry/support/sphere.js +1 -1
  123. package/geometry/support/sphereUtils.js +5 -0
  124. package/geometry/support/triangle.js +1 -1
  125. package/geometry/support/vector.js +1 -1
  126. package/interfaces.d.ts +68 -9
  127. package/layers/FocusAreaLayer.js +5 -0
  128. package/layers/VoxelLayer.js +1 -1
  129. package/layers/VoxelWasmPerSceneView.js +1 -1
  130. package/layers/mixins/operationalLayerModuleMap.js +1 -1
  131. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  132. package/layers/video/VideoCameraSensorModel.js +1 -1
  133. package/package.json +1 -1
  134. package/support/revision.js +1 -1
  135. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  136. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  137. package/symbols/support/Symbol3DMaterial.js +1 -1
  138. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  139. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  140. package/views/2d/grid/GridView2D.js +1 -1
  141. package/views/2d/grid/constants.js +5 -0
  142. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  143. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  144. package/views/2d/layerViewModuleImportUtils.js +1 -1
  145. package/views/2d/support/highlightGroupUtils.js +1 -1
  146. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  147. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  148. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  149. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  150. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  151. package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
  152. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  153. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  154. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  155. package/views/3d/analysis/Viewshed/FieldOfViewManipulation.js +1 -1
  156. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
  157. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  158. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  159. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  160. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  161. package/views/3d/analysis/support/measurementUtils.js +1 -1
  162. package/views/3d/animation/pointToPoint/Animation.js +1 -1
  163. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  164. package/views/3d/camera/constraintUtils/common.js +1 -1
  165. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  166. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  167. package/views/3d/camera/intersectionUtils.js +1 -1
  168. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  169. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  170. package/views/3d/environment/CloudsParameters.js +1 -1
  171. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  172. package/views/3d/environment/Fog.js +1 -1
  173. package/views/3d/environment/MarsAtmosphere.js +1 -1
  174. package/views/3d/interactive/Manipulator3D.js +1 -1
  175. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  176. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  177. package/views/3d/interactive/editingTools/lineObjectVisualElementUtils.js +1 -1
  178. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  179. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  180. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  181. package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
  182. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  183. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  184. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  185. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  186. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  187. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  188. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  189. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  190. package/views/3d/layerViewModuleImportUtils.js +1 -1
  191. package/views/3d/layers/FocusAreaLayerView3D.js +5 -0
  192. package/views/3d/layers/I3SMeshView3D.js +1 -1
  193. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  194. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  195. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  196. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  197. package/views/3d/layers/VoxelGraphic.js +5 -0
  198. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  199. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  200. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  201. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  202. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  203. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  204. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  205. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  207. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  208. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  209. package/views/3d/layers/graphics/labelPlacement.js +1 -1
  210. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  211. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  212. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  213. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  214. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  215. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  216. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  217. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  218. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  219. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  220. package/views/3d/layers/support/uvUtils.js +1 -1
  221. package/views/3d/state/NearFarHeuristic.js +1 -1
  222. package/views/3d/state/ViewStateManager.js +1 -1
  223. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  224. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  225. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  226. package/views/3d/state/controllers/RotateController.js +1 -1
  227. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  228. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  229. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  230. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  231. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  232. package/views/3d/state/utils/navigationUtils.js +1 -1
  233. package/views/3d/state/utils/viewUtils.js +1 -1
  234. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  235. package/views/3d/support/cameraUtilsInternal.js +1 -1
  236. package/views/3d/support/geometryUtils/ray.js +1 -1
  237. package/views/3d/support/intersectionUtils.js +1 -1
  238. package/views/3d/support/mathUtils.js +1 -1
  239. package/views/3d/support/orientedBoundingBox.js +1 -1
  240. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  241. package/views/3d/support/sunUtils.js +1 -1
  242. package/views/3d/support/viewpointUtils.js +1 -1
  243. package/views/3d/terrain/OverlayRenderer.js +1 -1
  244. package/views/3d/terrain/PatchRenderData.js +1 -1
  245. package/views/3d/terrain/SphericalPatch.js +1 -1
  246. package/views/3d/terrain/TerrainRenderer.js +1 -1
  247. package/views/3d/terrain/TerrainSurface.js +1 -1
  248. package/views/3d/terrain/Tile.js +1 -1
  249. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  250. package/views/3d/webgl/RenderCamera.js +1 -1
  251. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  252. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  253. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  254. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  255. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  256. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  257. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  258. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  259. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  260. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  261. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +1 -1
  262. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -6
  263. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +2 -2
  264. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +13 -0
  265. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +1 -1
  266. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +11 -13
  267. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +4 -4
  268. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +1 -4
  269. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +3 -3
  270. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
  271. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +2 -2
  272. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +1 -1
  273. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  274. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorRenderNodeTechnique.js +5 -0
  275. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskRenderNodeTechnique.js +5 -0
  276. package/views/3d/webgl-engine/effects/focusArea/FocusAreaParameters.js +5 -0
  277. package/views/3d/webgl-engine/effects/focusArea/FocusAreaRenderNode.js +5 -0
  278. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  279. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  280. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  281. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  282. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  283. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  284. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  285. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  286. package/views/3d/webgl-engine/lib/Path.js +1 -1
  287. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  288. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  289. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  290. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  291. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  292. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  293. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  294. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  295. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  296. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  297. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  298. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  299. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  300. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  301. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  302. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  303. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  304. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  305. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  306. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  307. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  308. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  309. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  310. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  311. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  312. package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +5 -0
  313. package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.js +5 -0
  314. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +8 -8
  315. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  316. package/views/draw/support/helpMessageUtils3d.js +1 -1
  317. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  318. package/views/input/gamepad/GamepadSource.js +1 -1
  319. package/views/interactive/coordinateHelper.js +1 -1
  320. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  321. package/views/interactive/sketch/constraints.js +1 -1
  322. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  323. package/views/interactive/snapping/GridSnappingEngine.js +5 -0
  324. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  325. package/views/interactive/snapping/SnappingOptions.js +1 -1
  326. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  327. package/views/interactive/snapping/snappingUtils.js +1 -1
  328. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  329. package/views/support/angularMeasurementUtils.js +1 -1
  330. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  331. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  332. package/views/support/geometry3dUtils.js +1 -1
  333. package/webscene/Slide.js +1 -1
  334. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  335. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  336. package/widgets/Feature/FeatureMedia.js +1 -1
  337. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  338. package/widgets/FeatureTable/Grid/Column.js +1 -1
  339. package/widgets/FeatureTable.js +1 -1
  340. package/widgets/GridControls/GridControlsViewModel.d.ts +4 -0
  341. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  342. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  343. package/widgets/Print/CustomTemplate.js +1 -1
  344. package/widgets/Print/PrintViewModel.js +1 -1
  345. package/widgets/Print/TemplateOptions.js +1 -1
  346. package/widgets/Print/utils.js +5 -0
  347. package/widgets/Print.js +1 -1
  348. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  349. package/widgets/support/GridControls/GridControlsViewModel.d.ts +4 -0
  350. package/widgets/support/GridControls/GridControlsViewModel.js +5 -0
  351. package/widgets/support/GridControls/VisibleElements.js +5 -0
  352. package/widgets/support/GridControls/gridUtils.js +5 -0
  353. package/widgets/support/GridControls.d.ts +4 -0
  354. package/widgets/support/GridControls.js +5 -0
  355. package/widgets/support/exportUtils.js +1 -1
  356. package/assets/esri/core/workers/chunks/14dc47896456e3c66b24.js +0 -1
  357. package/assets/esri/core/workers/chunks/2e88af8ab1e2713e7655.js +0 -1
  358. package/assets/esri/core/workers/chunks/3b204e75b613bcfbc8b9.js +0 -1
  359. package/assets/esri/core/workers/chunks/3e57f493d5a9d7aa7a48.js +0 -1
  360. package/assets/esri/core/workers/chunks/4e5ae81c612543130d9a.js +0 -1
  361. package/assets/esri/core/workers/chunks/4e746f8fca1d932dd684.js +0 -1
  362. package/assets/esri/core/workers/chunks/544eec13338b2d71680f.js +0 -1
  363. package/assets/esri/core/workers/chunks/5e7e12863cbed07451d0.js +0 -1
  364. package/assets/esri/core/workers/chunks/6c129767cda74aa672e0.js +0 -1
  365. package/assets/esri/core/workers/chunks/6f7c2d02fbd29870f6ee.js +0 -1
  366. package/assets/esri/core/workers/chunks/7802e70422f4151b95bc.js +0 -1
  367. package/assets/esri/core/workers/chunks/920557db2bd107a3c579.js +0 -1
  368. package/assets/esri/core/workers/chunks/9443b9ec03f25c723c2c.js +0 -47
  369. package/assets/esri/core/workers/chunks/991295637f51e8207efe.js +0 -1
  370. package/assets/esri/core/workers/chunks/ace8b6351ed35b03499b.js +0 -1
  371. package/assets/esri/core/workers/chunks/b1e4896acfae0bf9a9a8.js +0 -1
  372. package/assets/esri/core/workers/chunks/ca12b1c470e67ca7b30e.js +0 -1
  373. package/assets/esri/core/workers/chunks/cd9f48dcee2a1fc261ed.js +0 -774
  374. package/assets/esri/core/workers/chunks/d3626c01d2569d84e01e.js +0 -1
  375. package/assets/esri/core/workers/chunks/e5474bcde5b8fa037b56.js +0 -278
  376. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +0 -31
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s,createRenderScreenPointArray3 as o}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as a,distance as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{c as h,k as c,l as _,f as p,n as l,g as u,j as d,m as g}from"../../../../chunks/vec32.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as v}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as C}from"../../../../geometry/support/axisAngle.js";import{create as M,fromPositionAndNormal as w,getNormal as S}from"../../../../geometry/support/plane.js";import{c as b,g as f}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as j,applyAll as E}from"../../camera/constraintUtils.js";import{ConstraintOptions as O}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as y}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as A}from"../../camera/constraintUtils/InteractionType.js";import{ExponentialFalloff as R}from"../../input/util.js";import{InteractiveController as z}from"./InteractiveController.js";import{PanPlanarMomentumController as k}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as x}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as H}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as F}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as T}from"./momentum/ZoomSphericalMomentumController.js";import{NavigationMode as U,pickPointAndInitSphere as D,contentIntersectorOptions as I,SpherePickPointFallback as L,navigationMode as G,sphereOrPlanePointFromScreenPoint as Z,panDistanceModifier as N,minHeightLimit as B,screenPixelArea as V,intersectPlaneFromScreenPointAtEye as q,applyZoomOnSphere as J,preserveHeadingThreshold as K,applyPanSphericalPreserveHeading as Q,applyPanSphericalDirectRotation as W,normalizeRotationDelta as X,applyRotation as Y,applyPanPlanar as $,applyZoomToPoint as tt}from"../utils/navigationUtils.js";import it from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as et}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as nt}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as st}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as ot}from"../../../navigation/ZoomMomentumEstimator.js";let rt=class extends z{constructor(){super(...arguments),this._smoothRotation=new R(.05),this._rotationAxis=P(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=M(),this._beginRadius=0,this._smoothScaling=new R(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new ot,this._rotationMomentumEstimator=new st,this._panSphericalMomentumEstimator=new nt,this._panPlanarMomentumEstimator=new et,this._adjustedSphere=b(),this._tmp3d=P(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=P(),this._screenPickPoint=n(),this._scenePickPoint=P(),this._navMode=U.Horizontal,this._sphere=b(),this._pointerCount=0,this._tmpInteractionDirection=P(),this._beginCamera=new it,this._constraintOptions=new O(y.ALL,A.NONE,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),a(this._beginScreenPoint,this._screenPickPoint);const n=v(this.view.spatialReference),o=D(this._intersectionHelper,this.startCamera,this._screenPickPoint,n,L.Silhouette,0===this.view.map.ground.opacity?I:{});null!=o.scenePickPoint&&(this._scenePickPoint=o.scenePickPoint,this._sphere=o.sphere,h(this._beginScenePoint,this._scenePickPoint),this._navMode=G(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),this._navMode===U.Vertical&&this._preparePlanarPanMode(t,o.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;this._navMode===U.Horizontal?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return this._navMode===U.Horizontal?new T({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new F({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new H({view:this.view,momentum:e,center:f(this._sphere),axis:this._rotationAxis});if(this._navMode===U.Horizontal){const t=this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}else{const t=this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new k({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=c(this._tmp3d,this.startCamera.viewForward);w(this._scenePickPoint,e,this._panningPlane);const r=n(this._screenPickPoint[0],0),a=P(),m=_(this.startCamera.eye);this._adjustedSphere[3]=m<this._sphere[3]?m-100:this._sphere[3],Z(this._adjustedSphere,this.startCamera,r,a);const v=o();this.startCamera.projectToRenderScreen(a,v);const C=P(),M=P(),b=P();p(C,this._scenePickPoint,this.currentCamera.eye);const f=_(C);l(C,C);const j=N*Math.max(Math.abs(this.view.camera.position.z),B),E=this.view._stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,V);let O=null!=E?E:j;O=i?Math.min(O,f):O,h(b,u(M,this.currentCamera.eye,d(M,C,O))),this._panningPlane[3]=-g(S(this._panningPlane),b),this.startCamera.center=u(M,this.startCamera.eye,d(M,this.startCamera.viewForward,O));const y=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.startCamera,y,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),J(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);Z(this._sphere,this.currentCamera,i,this._tmp3d),K(this._beginScenePoint,g(this.currentCamera.up,this._beginScenePoint),this._sphere[3],this._beginHeading,this.view.camera.tilt,this.startCamera)?(Q(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(W(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere[3],this.view.camera.tilt)),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._screenPickPoint,i)),E(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){l(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+X(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),C(this._rotationAxis,s)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*e),E(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.currentCamera,i,this._tmp3d)&&($(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),E(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),tt(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){h(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=X(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),C(this._rotationAxis,o)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*o),E(this.view,this.currentCamera,this._constraintOptions)}};rt=t([r("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],rt);export{rt as PinchAndPanControllerGlobal};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{cyclicalPI as i}from"../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s,createRenderScreenPointArray3 as o}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as a,distance as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{c as h,k as c,m as _,f as p,n as l,g as u,j as d,l as g}from"../../../../chunks/vec32.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as v}from"../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as C}from"../../../../geometry/support/axisAngle.js";import{create as M,fromPositionAndNormal as w,getNormal as S}from"../../../../geometry/support/plane.js";import{c as b,g as f}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as j,applyAll as E}from"../../camera/constraintUtils.js";import{ConstraintOptions as O}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as y}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as A}from"../../camera/constraintUtils/InteractionType.js";import{ExponentialFalloff as R}from"../../input/util.js";import{InteractiveController as z}from"./InteractiveController.js";import{PanPlanarMomentumController as k}from"./momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as x}from"./momentum/PanSphericalMomentumController.js";import{RotationMomentumController as H}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as F}from"./momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as T}from"./momentum/ZoomSphericalMomentumController.js";import{NavigationMode as U,pickPointAndInitSphere as D,contentIntersectorOptions as I,SpherePickPointFallback as L,navigationMode as G,sphereOrPlanePointFromScreenPoint as Z,panDistanceModifier as N,minHeightLimit as B,screenPixelArea as V,intersectPlaneFromScreenPointAtEye as q,applyZoomOnSphere as J,preserveHeadingThreshold as K,applyPanSphericalPreserveHeading as Q,applyPanSphericalDirectRotation as W,normalizeRotationDelta as X,applyRotation as Y,applyPanPlanar as $,applyZoomToPoint as tt}from"../utils/navigationUtils.js";import it from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as et}from"../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as nt}from"../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as st}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as ot}from"../../../navigation/ZoomMomentumEstimator.js";let rt=class extends z{constructor(){super(...arguments),this._smoothRotation=new R(.05),this._rotationAxis=P(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=M(),this._beginRadius=0,this._smoothScaling=new R(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new ot,this._rotationMomentumEstimator=new st,this._panSphericalMomentumEstimator=new nt,this._panPlanarMomentumEstimator=new et,this._adjustedSphere=b(),this._tmp3d=P(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=P(),this._screenPickPoint=n(),this._scenePickPoint=P(),this._navMode=U.Horizontal,this._sphere=b(),this._pointerCount=0,this._tmpInteractionDirection=P(),this._beginCamera=new it,this._constraintOptions=new O(y.ALL,A.NONE,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),a(this._beginScreenPoint,this._screenPickPoint);const n=v(this.view.spatialReference),o=D(this._intersectionHelper,this.startCamera,this._screenPickPoint,n,L.Silhouette,0===this.view.map.ground.opacity?I:{});null!=o.scenePickPoint&&(this._scenePickPoint=o.scenePickPoint,this._sphere=o.sphere,h(this._beginScenePoint,this._scenePickPoint),this._navMode=G(this.startCamera,this._screenPickPoint,this.view.renderCoordsHelper,this.view.viewingMode),this._navMode===U.Vertical&&this._preparePlanarPanMode(t,o.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;this._navMode===U.Horizontal?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return this._navMode===U.Horizontal?new T({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new F({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new H({view:this.view,momentum:e,center:f(this._sphere),axis:this._rotationAxis});if(this._navMode===U.Horizontal){const t=this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}else{const t=this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new k({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=c(this._tmp3d,this.startCamera.viewForward);w(this._scenePickPoint,e,this._panningPlane);const r=n(this._screenPickPoint[0],0),a=P(),m=_(this.startCamera.eye);this._adjustedSphere[3]=m<this._sphere[3]?m-100:this._sphere[3],Z(this._adjustedSphere,this.startCamera,r,a);const v=o();this.startCamera.projectToRenderScreen(a,v);const C=P(),M=P(),b=P();p(C,this._scenePickPoint,this.currentCamera.eye);const f=_(C);l(C,C);const j=N*Math.max(Math.abs(this.view.camera.position.z),B),E=this.view._stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,V);let O=null!=E?E:j;O=i?Math.min(O,f):O,h(b,u(M,this.currentCamera.eye,d(M,C,O))),this._panningPlane[3]=-g(S(this._panningPlane),b),this.startCamera.center=u(M,this.startCamera.eye,d(M,this.startCamera.viewForward,O));const y=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.startCamera,y,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),J(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);Z(this._sphere,this.currentCamera,i,this._tmp3d),K(this._beginScenePoint,g(this.currentCamera.up,this._beginScenePoint),this._sphere[3],this._beginHeading,this.view.camera.tilt,this.startCamera)?(Q(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(W(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere[3],this.view.camera.tilt)),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._screenPickPoint,i)),E(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){l(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+X(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),C(this._rotationAxis,s)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*e),E(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.currentCamera,i,this._tmp3d)&&($(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),E(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),tt(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){h(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=X(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),C(this._rotationAxis,o)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*o),E(this.view,this.currentCamera,this._constraintOptions)}};rt=t([r("esri.views.3d.state.controllers.PinchAndPanControllerGlobal")],rt);export{rt as PinchAndPanControllerGlobal};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{k as o,c as r,m as a,f as m,l as h,n as l,j as c,g as p}from"../../../../chunks/vec32.js";import{create as _,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as d}from"../../../../geometry/support/axisAngle.js";import{create as C,fromNormalAndOffset as g,setOffsetFromPoint as v,negate as M,getNormal as b}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as w,applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as P}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as V}from"../../camera/constraintUtils/InteractionType.js";import{ExponentialFalloff as z}from"../../input/util.js";import{getVoxelWasm as S}from"../../layers/VoxelWasm.js";import{InteractiveController as E}from"./InteractiveController.js";import{PanPlanarMomentumController as H}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as y}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as O}from"./momentum/ZoomPlanarMomentumController.js";import{NavigationMode as x,contentIntersectorOptions as F,navigationMode as A,panDistanceModifier as R,minHeightLimit as U,screenPixelArea as L,centroid as T,applyZoomToPoint as k,applyPanPlanar as I,normalizeRotationDelta as N,applyRotation as Z,intersectPlaneFromScreenPointAtEye as D}from"../utils/navigationUtils.js";import G from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as B}from"../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as W}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as q}from"../../../navigation/ZoomMomentumEstimator.js";const J=u(0,0,1);let K=class extends E{constructor(){super(...arguments),this._rotationValueSmooth=new z(.05),this._scalingValueSmooth=new z(.05),this._planeHorizontal=C(),this._planeVertical=C(),this._rotationMomentumEstimator=new W,this._panMomentumEstimator=new B(300,12,.9),this._zoomMomentumEstimator=new q,this._beginRadius=0,this._beginCenter=_(),this._beginAngle=0,this._tmpPoints=[],this._navMode=x.Horizontal,this._beginCenterScreen=i(),this._tmpCentroid3d=_(),this._tmpCentroid2d=i(),this._tmp2d=i(),this._pointerCount=0,this._beginCamera=new G,this._constraintOptions=new j(P.ALL,V.NONE,0,this._beginCamera)}begin(t){if(!this.active)return;const i=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=i,this._rotationMomentumEstimator.enabled=i,this._panMomentumEstimator.enabled=i,this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),e(t.center,this._beginCenterScreen),g(J,0,this._planeHorizontal);const n=_(),s=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,n,0===this.view.map.ground.opacity?F:{}),u=_();o(u,this.startCamera.viewForward);const d=_();r(d,J);const C=a(u,d);this._navMode=A(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode);const w=Math.min(R,1/Math.abs(a(d,this.startCamera.viewForward)))*Math.max(Math.abs(this.view.camera.position.z),U);v(this._planeHorizontal,this._planeHorizontal,n),this.startCamera.aboveGround||M(this._planeHorizontal,this._planeHorizontal);const f=_(),j=_(),P=_();m(f,n,this.currentCamera.eye);const V=h(f);if(l(f,f),this._navMode===x.Vertical){c(d,d,C),m(b(this._planeVertical),u,d),l(b(this._planeVertical),b(this._planeVertical)),v(this._planeVertical,this._planeVertical,n);const i=this.view._stage.renderView.getMinimalDepthForArea(S(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,L);let e=null!=i?i:w;e=s?Math.min(e,V):e,r(P,p(j,this.currentCamera.eye,c(j,f,e))),this._planeVertical[3]=-a(b(this._planeVertical),P),this._computePlanePoints(t.pointers,this._planeVertical,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}else{const i=s?V:w;r(P,p(j,this.currentCamera.eye,c(j,f,i))),this._planeHorizontal[3]=-a(b(this._planeHorizontal),P),this._computePlanePoints(t.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(t){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,n=this._navMode===x.Horizontal?this._planeHorizontal:this._planeVertical,o=this._beginCenter;if(i){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._scalingValueSmooth.gain=e,this._scalingValueSmooth.update(i),k(this.currentCamera,o,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*t.timestamp),this._constraintOptions.interactionType=V.ZOOM,this._constraintOptions.interactionFactor=w(Math.abs(t.radius-this._beginRadius)),f(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(t.pointers,n,this.currentCamera,this._tmpPoints),T(this._tmpPoints,this._tmpCentroid3d),e(t.center,this._tmpCentroid2d),I(this.currentCamera,o,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*t.timestamp),this._constraintOptions.interactionType=V.PAN,this._constraintOptions.interactionFactor=w(s(this._beginCenterScreen,this._tmpCentroid2d)),f(this.view,this.currentCamera,this._constraintOptions),i){const i=o,e=this._rotationValueSmooth.value,n=e+N(t.angle-e),s=.00125*Math.min(Math.max(t.radius,40),120);this._rotationValueSmooth.gain=s,this._rotationValueSmooth.update(n);const r=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(r,.001*t.timestamp);const a=b(this._planeHorizontal);Z(this.currentCamera,i,d(a,r)),this._constraintOptions.interactionType=V.TUMBLE,this._constraintOptions.interactionFactor=w(Math.abs(t.radius*r)),f(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return new O({view:this.view,momentum:i,zoomCenter:this._beginCenter});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new y({view:this.view,momentum:e,center:this._beginCenter,axis:b(this._planeHorizontal)});const n=this._panMomentumEstimator.evaluateMomentum();return n?new H({view:this.view,momentum:n}):null}_computePlanePoints(t,i,e,n){n.length=t.size;const s=this._tmp2d;let o=0;return t.forEach((t=>{s[0]=t.x,s[1]=t.y,void 0===n[o]&&(n[o]=_()),D(i,e,s,n[o]),o+=1})),n}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};K=t([n("esri.views.3d.state.controllers.PinchAndPanControllerLocal")],K);export{K as PinchAndPanControllerLocal};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{createScreenPointArray as i,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{k as o,c as r,l as a,f as m,m as h,n as l,j as c,g as p}from"../../../../chunks/vec32.js";import{create as _,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as d}from"../../../../geometry/support/axisAngle.js";import{create as C,fromNormalAndOffset as g,setOffsetFromPoint as v,negate as M,getNormal as b}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as w,applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as P}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as V}from"../../camera/constraintUtils/InteractionType.js";import{ExponentialFalloff as z}from"../../input/util.js";import{getVoxelWasm as S}from"../../layers/VoxelWasm.js";import{InteractiveController as E}from"./InteractiveController.js";import{PanPlanarMomentumController as H}from"./momentum/PanPlanarMomentumController.js";import{RotationMomentumController as y}from"./momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as O}from"./momentum/ZoomPlanarMomentumController.js";import{NavigationMode as x,contentIntersectorOptions as F,navigationMode as A,panDistanceModifier as R,minHeightLimit as U,screenPixelArea as L,centroid as T,applyZoomToPoint as k,applyPanPlanar as I,normalizeRotationDelta as N,applyRotation as Z,intersectPlaneFromScreenPointAtEye as D}from"../utils/navigationUtils.js";import G from"../../webgl/RenderCamera.js";import{PanPlanarMomentumEstimator as B}from"../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as W}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as q}from"../../../navigation/ZoomMomentumEstimator.js";const J=u(0,0,1);let K=class extends E{constructor(){super(...arguments),this._rotationValueSmooth=new z(.05),this._scalingValueSmooth=new z(.05),this._planeHorizontal=C(),this._planeVertical=C(),this._rotationMomentumEstimator=new W,this._panMomentumEstimator=new B(300,12,.9),this._zoomMomentumEstimator=new q,this._beginRadius=0,this._beginCenter=_(),this._beginAngle=0,this._tmpPoints=[],this._navMode=x.Horizontal,this._beginCenterScreen=i(),this._tmpCentroid3d=_(),this._tmpCentroid2d=i(),this._tmp2d=i(),this._pointerCount=0,this._beginCamera=new G,this._constraintOptions=new j(P.ALL,V.NONE,0,this._beginCamera)}begin(t){if(!this.active)return;const i=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=i,this._rotationMomentumEstimator.enabled=i,this._panMomentumEstimator.enabled=i,this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),e(t.center,this._beginCenterScreen),g(J,0,this._planeHorizontal);const n=_(),s=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,n,0===this.view.map.ground.opacity?F:{}),u=_();o(u,this.startCamera.viewForward);const d=_();r(d,J);const C=a(u,d);this._navMode=A(this.startCamera,this._beginCenterScreen,this.view.renderCoordsHelper,this.view.viewingMode);const w=Math.min(R,1/Math.abs(a(d,this.startCamera.viewForward)))*Math.max(Math.abs(this.view.camera.position.z),U);v(this._planeHorizontal,this._planeHorizontal,n),this.startCamera.aboveGround||M(this._planeHorizontal,this._planeHorizontal);const f=_(),j=_(),P=_();m(f,n,this.currentCamera.eye);const V=h(f);if(l(f,f),this._navMode===x.Vertical){c(d,d,C),m(b(this._planeVertical),u,d),l(b(this._planeVertical),b(this._planeVertical)),v(this._planeVertical,this._planeVertical,n);const i=this.view._stage.renderView.getMinimalDepthForArea(S(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,L);let e=null!=i?i:w;e=s?Math.min(e,V):e,r(P,p(j,this.currentCamera.eye,c(j,f,e))),this._planeVertical[3]=-a(b(this._planeVertical),P),this._computePlanePoints(t.pointers,this._planeVertical,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}else{const i=s?V:w;r(P,p(j,this.currentCamera.eye,c(j,f,i))),this._planeHorizontal[3]=-a(b(this._planeHorizontal),P),this._computePlanePoints(t.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),T(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(t){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,n=this._navMode===x.Horizontal?this._planeHorizontal:this._planeVertical,o=this._beginCenter;if(i){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._scalingValueSmooth.gain=e,this._scalingValueSmooth.update(i),k(this.currentCamera,o,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*t.timestamp),this._constraintOptions.interactionType=V.ZOOM,this._constraintOptions.interactionFactor=w(Math.abs(t.radius-this._beginRadius)),f(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(t.pointers,n,this.currentCamera,this._tmpPoints),T(this._tmpPoints,this._tmpCentroid3d),e(t.center,this._tmpCentroid2d),I(this.currentCamera,o,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*t.timestamp),this._constraintOptions.interactionType=V.PAN,this._constraintOptions.interactionFactor=w(s(this._beginCenterScreen,this._tmpCentroid2d)),f(this.view,this.currentCamera,this._constraintOptions),i){const i=o,e=this._rotationValueSmooth.value,n=e+N(t.angle-e),s=.00125*Math.min(Math.max(t.radius,40),120);this._rotationValueSmooth.gain=s,this._rotationValueSmooth.update(n);const r=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(r,.001*t.timestamp);const a=b(this._planeHorizontal);Z(this.currentCamera,i,d(a,r)),this._constraintOptions.interactionType=V.TUMBLE,this._constraintOptions.interactionFactor=w(Math.abs(t.radius*r)),f(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return new O({view:this.view,momentum:i,zoomCenter:this._beginCenter});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new y({view:this.view,momentum:e,center:this._beginCenter,axis:b(this._planeHorizontal)});const n=this._panMomentumEstimator.evaluateMomentum();return n?new H({view:this.view,momentum:n}):null}_computePlanePoints(t,i,e,n){n.length=t.size;const s=this._tmp2d;let o=0;return t.forEach((t=>{s[0]=t.x,s[1]=t.y,void 0===n[o]&&(n[o]=_()),D(i,e,s,n[o]),o+=1})),n}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};K=t([n("esri.views.3d.state.controllers.PinchAndPanControllerLocal")],K);export{K as PinchAndPanControllerLocal};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{acosClamped as i,clamp as s}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as a,rotate as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{c,f as l,l as _,m as v,n as f,g as C,j as P,b as u,h as w}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as E}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as R}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as T}from"../../camera/constraintUtils/InteractionType.js";import{TiltMode as y}from"../../camera/constraintUtils/TiltMode.js";import{getVoxelWasm as g}from"../../layers/VoxelWasm.js";import{TiltRange as M}from"../Constraints.js";import{InteractiveController as U}from"./InteractiveController.js";import{contentIntersectorOptions as x,normalizeCoordinate as O,rotatePivotDistanceModifier as b,rotatePivotMinDistanceModifier as D,navigationMode as A,rotateScreenPixelArea as N,NavigationMode as L}from"../utils/navigationUtils.js";var V;!function(t){t[t.CENTER=0]="CENTER",t[t.EYE=1]="EYE"}(V||(V={}));let H=class extends U{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.pivot=V.CENTER,this._rotScale=0,this._lastPoint=m(),this._tmpWorldUp=d(),this._tmpViewDir=d(),this._tmpRotCurPoint=m(),this._tmpTransf=h(),this._tmpAxis=d(),this._tmpPivotPoint=d(),this._pivotPos=d(),this._constraintOptions=new j(R.ALL,T.TUMBLE,0,this.startCamera)}initialize(){this._rotScale=this.pivot===V.CENTER?3:1.5}begin(t){if(this.active){switch(this.pivot){case V.EYE:c(this._pivotPos,this.startCamera.eye),this._constraintOptions.interactionType=T.LOOK_AROUND,this._constraintOptions.tiltMode=y.LOOK_AROUND,this._constraintOptions.selection=R.NONE;break;case V.CENTER:{const i=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,0===this.view.map.ground.opacity?x:{});i||c(this._pivotPos,this.startCamera.center),this._constrainPivotPoint(t,i),this.startCamera.center=this._pivotPos,this._constraintOptions.interactionType=T.TUMBLE,this._constraintOptions.tiltMode=y.TUMBLE,this._constraintOptions.selection=R.ALL&~R.DISTANCE;break}}O(this.startCamera,t,this._lastPoint)}}_constrainPivotPoint(t,i){const s=this.startCamera,o=d();l(o,this._pivotPos,s.eye);const e=_(o),a=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(s.eye,k);let n=Math.max(Math.min(b,1/Math.abs(v(k,s.viewForward)))*a,D);i&&(n=Math.min(e,n));const h=r(s.width/s.pixelRatio*.5,s.height/s.pixelRatio*.5),p=A(this.startCamera,h,this.view.renderCoordsHelper,this.view.viewingMode);let m=this.view._stage.renderView.getMinimalDepthForArea(g(this.view),s.fullWidth/s.pixelRatio*.5,s.fullHeight/s.pixelRatio*.5,s,2.5*N,N),u=this.view._stage.renderView.getMinimalDepthForArea(g(this.view),t[0],t[1],s,N);null==m&&null==u||(m=m??u??0,u=null==u||p===L.Horizontal?m:u,n=m>u?u:m,n=i?Math.min(n,e):n),f(o,o),c(this._pivotPos,C(this._tmpPivotPoint,s.eye,P(this._tmpPivotPoint,o,n)))}update(t){if(this.active){switch(this.pivot){case V.EYE:this.currentCamera.center=this._applyRotation(this.currentCamera,t,this.currentCamera.center,this._pivotPos);break;case V.CENTER:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,t,this.currentCamera.eye,this._pivotPos)}E(this.view,this.currentCamera,this._constraintOptions),this.commitCamera()}}end(){this.active&&this.finishController()}_applyRotation(t,r,o,e){this.view.renderCoordsHelper.worldUpAtPosition(e,this._tmpWorldUp),O(t,r,this._tmpRotCurPoint);let h=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotScale,m=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotScale;l(this._tmpViewDir,o,e);const c=_(this._tmpViewDir),f=i(v(this._tmpViewDir,this._tmpWorldUp)/c);if(this.pivot===V.EYE){h*=-.5;const t=.5*Math.PI-f,i=.5*Math.PI*.99;h=t-Math.max(-i,Math.min(i,t+h))}return h=s(h+f,M.min,M.max)-f,u(this._tmpAxis,t.up,this._tmpViewDir),this.pivot===V.CENTER&&(m=-m),a(this._tmpTransf,m,this._tmpWorldUp),n(this._tmpTransf,this._tmpTransf,h,this._tmpAxis),w(this._tmpViewDir,this._tmpViewDir,this._tmpTransf),t.up=w(S,t.up,this._tmpTransf),C(S,e,this._tmpViewDir),p(this._lastPoint,this._tmpRotCurPoint),S}};t([o()],H.prototype,"pivot",void 0),H=t([e("esri.views.3d.state.controllers.RotateController")],H);const S=d(),k=d();export{V as PivotPoint,H as RotateController};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{acosClamped as i,clamp as s}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as a,rotate as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{c,f as l,m as _,l as v,n as f,g as C,j as P,b as u,h as w}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as E}from"../../camera/constraintUtils.js";import{ConstraintOptions as j}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as R}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as T}from"../../camera/constraintUtils/InteractionType.js";import{TiltMode as y}from"../../camera/constraintUtils/TiltMode.js";import{getVoxelWasm as g}from"../../layers/VoxelWasm.js";import{TiltRange as M}from"../Constraints.js";import{InteractiveController as U}from"./InteractiveController.js";import{contentIntersectorOptions as x,normalizeCoordinate as O,rotatePivotDistanceModifier as b,rotatePivotMinDistanceModifier as D,navigationMode as A,rotateScreenPixelArea as N,NavigationMode as L}from"../utils/navigationUtils.js";var V;!function(t){t[t.CENTER=0]="CENTER",t[t.EYE=1]="EYE"}(V||(V={}));let H=class extends U{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.pivot=V.CENTER,this._rotScale=0,this._lastPoint=m(),this._tmpWorldUp=d(),this._tmpViewDir=d(),this._tmpRotCurPoint=m(),this._tmpTransf=h(),this._tmpAxis=d(),this._tmpPivotPoint=d(),this._pivotPos=d(),this._constraintOptions=new j(R.ALL,T.TUMBLE,0,this.startCamera)}initialize(){this._rotScale=this.pivot===V.CENTER?3:1.5}begin(t){if(this.active){switch(this.pivot){case V.EYE:c(this._pivotPos,this.startCamera.eye),this._constraintOptions.interactionType=T.LOOK_AROUND,this._constraintOptions.tiltMode=y.LOOK_AROUND,this._constraintOptions.selection=R.NONE;break;case V.CENTER:{const i=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,0===this.view.map.ground.opacity?x:{});i||c(this._pivotPos,this.startCamera.center),this._constrainPivotPoint(t,i),this.startCamera.center=this._pivotPos,this._constraintOptions.interactionType=T.TUMBLE,this._constraintOptions.tiltMode=y.TUMBLE,this._constraintOptions.selection=R.ALL&~R.DISTANCE;break}}O(this.startCamera,t,this._lastPoint)}}_constrainPivotPoint(t,i){const s=this.startCamera,o=d();l(o,this._pivotPos,s.eye);const e=_(o),a=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(s.eye,k);let n=Math.max(Math.min(b,1/Math.abs(v(k,s.viewForward)))*a,D);i&&(n=Math.min(e,n));const h=r(s.width/s.pixelRatio*.5,s.height/s.pixelRatio*.5),p=A(this.startCamera,h,this.view.renderCoordsHelper,this.view.viewingMode);let m=this.view._stage.renderView.getMinimalDepthForArea(g(this.view),s.fullWidth/s.pixelRatio*.5,s.fullHeight/s.pixelRatio*.5,s,2.5*N,N),u=this.view._stage.renderView.getMinimalDepthForArea(g(this.view),t[0],t[1],s,N);null==m&&null==u||(m=m??u??0,u=null==u||p===L.Horizontal?m:u,n=m>u?u:m,n=i?Math.min(n,e):n),f(o,o),c(this._pivotPos,C(this._tmpPivotPoint,s.eye,P(this._tmpPivotPoint,o,n)))}update(t){if(this.active){switch(this.pivot){case V.EYE:this.currentCamera.center=this._applyRotation(this.currentCamera,t,this.currentCamera.center,this._pivotPos);break;case V.CENTER:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,t,this.currentCamera.eye,this._pivotPos)}E(this.view,this.currentCamera,this._constraintOptions),this.commitCamera()}}end(){this.active&&this.finishController()}_applyRotation(t,r,o,e){this.view.renderCoordsHelper.worldUpAtPosition(e,this._tmpWorldUp),O(t,r,this._tmpRotCurPoint);let h=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotScale,m=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotScale;l(this._tmpViewDir,o,e);const c=_(this._tmpViewDir),f=i(v(this._tmpViewDir,this._tmpWorldUp)/c);if(this.pivot===V.EYE){h*=-.5;const t=.5*Math.PI-f,i=.5*Math.PI*.99;h=t-Math.max(-i,Math.min(i,t+h))}return h=s(h+f,M.min,M.max)-f,u(this._tmpAxis,t.up,this._tmpViewDir),this.pivot===V.CENTER&&(m=-m),a(this._tmpTransf,m,this._tmpWorldUp),n(this._tmpTransf,this._tmpTransf,h,this._tmpAxis),w(this._tmpViewDir,this._tmpViewDir,this._tmpTransf),t.up=w(S,t.up,this._tmpTransf),C(S,e,this._tmpViewDir),p(this._lastPoint,this._tmpRotCurPoint),S}};t([o()],H.prototype,"pivot",void 0),H=t([e("esri.views.3d.state.controllers.RotateController")],H);const S=d(),k=d();export{V as PivotPoint,H as RotateController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as s,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{n as o,f as h,l as c,m,j as p,g as l}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../geometry/ellipsoidUtils.js";import{create as P,fromPoints as C}from"../../../../geometry/support/axisAngle.js";import{c as y,g as d}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as f,applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as R}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as j}from"../../camera/constraintUtils/InteractionType.js";import{applySurfaceCollisionConstraint as k}from"../../camera/constraintUtils/surfaceCollision.js";import{InteractiveController as w}from"./InteractiveController.js";import{NavigationMode as D,normalizeCoordinate as A,pickPointAndInitSphere as M,contentIntersectorOptions as b,SpherePickPointFallback as O,navigationMode as U,distanceClampValues as x,pivotDistanceModifier as z,screenPixelArea as H,sphereOrPlanePointFromScreenPoint as L,applyRotation as I}from"../utils/navigationUtils.js";import{fromScreenAtEye as S}from"../../support/geometryUtils/ray.js";let B=class extends w{constructor(){super(...arguments),this._pickPoint=_(),this._tmpP0=n(),this._panAxisAngle=P(),this._tmpRayDir=_(),this._tmpRayDirPick=_(),this._targetOnSphere=_(),this._navMode=D.Horizontal,this._tmpRay={origin:_(),direction:_()},this.dragBeginPoint=r(),this._normalizedAnchorPoint=n(),this._constraintOptions=new v(R.ALL_EXCEPT_COLLISION,j.ZOOM,0,this.startCamera),this._sphere=y(),this._hasPickPoint=!1}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;s(this.dragBeginPoint,t),A(this.startCamera,t,this._normalizedAnchorPoint);const r=u(this.view.spatialReference),e=M(this._intersectionHelper,this.startCamera,t,r,O.Ellipsoid,0===this.view.map.ground.opacity?b:{});if(this._navMode=U(this.startCamera,t,this.view.renderCoordsHelper,this.view.viewingMode),this._navMode===D.Horizontal)this._hasPickPoint=!!e.scenePickPoint,this._pickPoint=e.scenePickPoint??this._pickPoint,this._sphere=e.sphere;else{let r;S(this.startCamera,t,this._tmpRay),o(this._tmpRay.direction,this._tmpRay.direction),null!=e.scenePickPoint&&(h(this._tmpRayDirPick,this.startCamera.eye,e.scenePickPoint),r=c(this._tmpRayDirPick));const s=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,T);let a=i(Math.min(z,1/Math.abs(m(T,this._tmpRay.direction)))*s,x[0],x[1]);const n=this.view._stage.renderView.getMinimalDepthForArea(null,t[0],t[1],this.view.state.camera,H);a=null!=n?n:a,a=null!=r?Math.min(a,r):a,this._hasPickPoint=!0,p(this._tmpRay.direction,this._tmpRay.direction,a),l(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}}update(t){if(this.active){if(this.currentCamera.eye=this.startCamera.eye,this.currentCamera.center=this.startCamera.center,this.currentCamera.up=this.startCamera.up,this._navMode===D.Horizontal){h(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);const i=c(this._tmpRayDir);A(this.currentCamera,t,this._tmpP0);const r=12*(this._normalizedAnchorPoint[1]-this._tmpP0[1]);let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<1e-6)return;if(this._hasPickPoint&&e<i){const t=1-(1-e/i)*(1-this._sphere[3]/c(this.currentCamera.center));this.currentCamera.center=p(E,this.currentCamera.center,t)}p(this._tmpRayDir,this._tmpRayDir,-e/i),this.currentCamera.eye=l(E,this.currentCamera.center,this._tmpRayDir),this._constraintOptions.interactionFactor=f(a(this.dragBeginPoint,t)),g(this.view,this.currentCamera,this._constraintOptions),this._hasPickPoint&&(L(this._sphere,this.currentCamera,this.dragBeginPoint,this._targetOnSphere),C(this._pickPoint,this._targetOnSphere,this._panAxisAngle),I(this.currentCamera,d(this._sphere),this._panAxisAngle))}else{const i=c(this._tmpRay.direction);A(this.currentCamera,t,this._tmpP0);const r=12*(this._normalizedAnchorPoint[1]-this._tmpP0[1]);let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<1e-6)return;p(this._tmpRayDir,this._tmpRay.direction,1-e/i),this.currentCamera.eye=l(E,this.currentCamera.eye,this._tmpRayDir),this.currentCamera.center=l(E,this.currentCamera.center,this._tmpRayDir)}k(this.view,this.currentCamera),this.commitCamera()}}end(){this.active&&this.finishController()}};B=t([e("esri.views.3d.state.controllers.ZoomControllerGlobal")],B);const E=_(),T=_();export{B as ZoomControllerGlobal};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as s,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{n as o,f as h,m as c,l as m,j as p,g as l}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../geometry/ellipsoidUtils.js";import{create as P,fromPoints as C}from"../../../../geometry/support/axisAngle.js";import{c as y,g as d}from"../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as f,applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as R}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as j}from"../../camera/constraintUtils/InteractionType.js";import{applySurfaceCollisionConstraint as k}from"../../camera/constraintUtils/surfaceCollision.js";import{InteractiveController as w}from"./InteractiveController.js";import{NavigationMode as D,normalizeCoordinate as A,pickPointAndInitSphere as M,contentIntersectorOptions as b,SpherePickPointFallback as O,navigationMode as U,distanceClampValues as x,pivotDistanceModifier as z,screenPixelArea as H,sphereOrPlanePointFromScreenPoint as L,applyRotation as I}from"../utils/navigationUtils.js";import{fromScreenAtEye as S}from"../../support/geometryUtils/ray.js";let B=class extends w{constructor(){super(...arguments),this._pickPoint=_(),this._tmpP0=n(),this._panAxisAngle=P(),this._tmpRayDir=_(),this._tmpRayDirPick=_(),this._targetOnSphere=_(),this._navMode=D.Horizontal,this._tmpRay={origin:_(),direction:_()},this.dragBeginPoint=r(),this._normalizedAnchorPoint=n(),this._constraintOptions=new v(R.ALL_EXCEPT_COLLISION,j.ZOOM,0,this.startCamera),this._sphere=y(),this._hasPickPoint=!1}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;s(this.dragBeginPoint,t),A(this.startCamera,t,this._normalizedAnchorPoint);const r=u(this.view.spatialReference),e=M(this._intersectionHelper,this.startCamera,t,r,O.Ellipsoid,0===this.view.map.ground.opacity?b:{});if(this._navMode=U(this.startCamera,t,this.view.renderCoordsHelper,this.view.viewingMode),this._navMode===D.Horizontal)this._hasPickPoint=!!e.scenePickPoint,this._pickPoint=e.scenePickPoint??this._pickPoint,this._sphere=e.sphere;else{let r;S(this.startCamera,t,this._tmpRay),o(this._tmpRay.direction,this._tmpRay.direction),null!=e.scenePickPoint&&(h(this._tmpRayDirPick,this.startCamera.eye,e.scenePickPoint),r=c(this._tmpRayDirPick));const s=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,T);let a=i(Math.min(z,1/Math.abs(m(T,this._tmpRay.direction)))*s,x[0],x[1]);const n=this.view._stage.renderView.getMinimalDepthForArea(null,t[0],t[1],this.view.state.camera,H);a=null!=n?n:a,a=null!=r?Math.min(a,r):a,this._hasPickPoint=!0,p(this._tmpRay.direction,this._tmpRay.direction,a),l(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}}update(t){if(this.active){if(this.currentCamera.eye=this.startCamera.eye,this.currentCamera.center=this.startCamera.center,this.currentCamera.up=this.startCamera.up,this._navMode===D.Horizontal){h(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);const i=c(this._tmpRayDir);A(this.currentCamera,t,this._tmpP0);const r=12*(this._normalizedAnchorPoint[1]-this._tmpP0[1]);let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<1e-6)return;if(this._hasPickPoint&&e<i){const t=1-(1-e/i)*(1-this._sphere[3]/c(this.currentCamera.center));this.currentCamera.center=p(E,this.currentCamera.center,t)}p(this._tmpRayDir,this._tmpRayDir,-e/i),this.currentCamera.eye=l(E,this.currentCamera.center,this._tmpRayDir),this._constraintOptions.interactionFactor=f(a(this.dragBeginPoint,t)),g(this.view,this.currentCamera,this._constraintOptions),this._hasPickPoint&&(L(this._sphere,this.currentCamera,this.dragBeginPoint,this._targetOnSphere),C(this._pickPoint,this._targetOnSphere,this._panAxisAngle),I(this.currentCamera,d(this._sphere),this._panAxisAngle))}else{const i=c(this._tmpRay.direction);A(this.currentCamera,t,this._tmpP0);const r=12*(this._normalizedAnchorPoint[1]-this._tmpP0[1]);let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<1e-6)return;p(this._tmpRayDir,this._tmpRay.direction,1-e/i),this.currentCamera.eye=l(E,this.currentCamera.eye,this._tmpRayDir),this.currentCamera.center=l(E,this.currentCamera.center,this._tmpRayDir)}k(this.view,this.currentCamera),this.commitCamera()}}end(){this.active&&this.finishController()}};B=t([e("esri.views.3d.state.controllers.ZoomControllerGlobal")],B);const E=_(),T=_();export{B as ZoomControllerGlobal};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as s}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as n,l as m,n as h,m as c,j as p,g as _,k as l,c as C,o as P}from"../../../../chunks/vec32.js";import{create as f,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as g,fromPositionAndNormal as D}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as j,applyAll as v}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as d}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as w}from"../../camera/constraintUtils/InteractionType.js";import{getVoxelWasm as b}from"../../layers/VoxelWasm.js";import{InteractiveController as M}from"./InteractiveController.js";import{normalizeCoordinate as O,contentIntersectorOptions as N,distanceClampValues as R,pivotDistanceModifier as x,screenPixelArea as U,intersectPlaneFromScreenPoint as A}from"../utils/navigationUtils.js";let z=class extends M{constructor(){super(...arguments),this._tmpP=f(),this._tmpDir=f(),this._tmpN=f(),this._tmpP0=o(),this._tmpPoi=f(),this._tmpRayDir=f(),this.dragBeginPoint=s(),this._normalizedAnchorPoint=o(),this._constraintOptions=new y(d.ALL,w.ZOOM,0,this.startCamera,f()),this._plane=g()}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;e(this.dragBeginPoint,t),O(this.startCamera,t,this._normalizedAnchorPoint);const s=this._intersectionHelper.intersectScreenFreePointFallback(t,this._tmpP,0===this.view.map.ground.opacity?N:{});n(this._tmpDir,this._tmpP,this.startCamera.eye);const r=m(this._tmpDir);h(this._tmpDir,this._tmpDir);const a=Math.abs(this.view.camera.position.z);let o=i(Math.min(x,1/Math.abs(c(k,this._tmpDir)))*a,R[0],R[1]);const C=this.view._stage.renderView.getMinimalDepthForArea(b(this.view),t[0],t[1],this.view.state.camera,U);o=null!=C?C:o,o=s?Math.min(o,r):o,p(this._tmpDir,this._tmpDir,o),_(this._tmpP,this.startCamera.eye,this._tmpDir),n(this._tmpN,this.startCamera.eye,this.startCamera.center),h(this._tmpN,this._tmpN),this._tmpN[1]<0&&l(this._tmpN,this._tmpN),D(this._tmpP,this._tmpN,this._plane)}update(t){if(!this.active)return;A(this._plane,this.currentCamera,this.dragBeginPoint,this._tmpPoi)||C(this._tmpPoi,this.currentCamera.center),O(this.currentCamera,t,this._tmpP0);let i=4*(this._tmpP0[1]-this._normalizedAnchorPoint[1]);e(this._normalizedAnchorPoint,this._tmpP0),n(this._tmpRayDir,this._tmpPoi,this.currentCamera.eye);const s=m(this._tmpRayDir);let r=s*(1-i);this._constraintOptions.interactionDirection&&(C(this._constraintOptions.interactionDirection,this._tmpRayDir),p(this._constraintOptions.interactionDirection,this._constraintOptions.interactionDirection,Math.sign(i)/s));const o=this.view.state.constraints.minimumPoiDistance;i>=0&&r<o&&(r=o,i=-(r-s)/s),Math.abs(s-r)<1e-6||(p(this._tmpRayDir,this._tmpRayDir,i),this.currentCamera.eye=_(L,this.currentCamera.eye,this._tmpRayDir),P(L,this.currentCamera.center,this._tmpPoi,i),this._tmpPoi[2]>this.startCamera.center[2]?L[2]=Math.max(this.startCamera.center[2],L[2]):L[2]=Math.min(this.startCamera.center[2],L[2]),this.currentCamera.center=L,this._constraintOptions.interactionFactor=j(a(this.dragBeginPoint,t)),v(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}end(){this.active&&this.finishController()}};z=t([r("esri.views.3d.state.controllers.ZoomControllerLocal")],z);const L=f(),k=u(0,0,1);export{z as ZoomControllerLocal};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as s}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as n,m,n as h,l as c,j as p,g as _,k as l,c as C,o as P}from"../../../../chunks/vec32.js";import{create as f,fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as g,fromPositionAndNormal as D}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as j,applyAll as v}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as d}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as w}from"../../camera/constraintUtils/InteractionType.js";import{getVoxelWasm as b}from"../../layers/VoxelWasm.js";import{InteractiveController as M}from"./InteractiveController.js";import{normalizeCoordinate as O,contentIntersectorOptions as N,distanceClampValues as R,pivotDistanceModifier as x,screenPixelArea as U,intersectPlaneFromScreenPoint as A}from"../utils/navigationUtils.js";let z=class extends M{constructor(){super(...arguments),this._tmpP=f(),this._tmpDir=f(),this._tmpN=f(),this._tmpP0=o(),this._tmpPoi=f(),this._tmpRayDir=f(),this.dragBeginPoint=s(),this._normalizedAnchorPoint=o(),this._constraintOptions=new y(d.ALL,w.ZOOM,0,this.startCamera,f()),this._plane=g()}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;e(this.dragBeginPoint,t),O(this.startCamera,t,this._normalizedAnchorPoint);const s=this._intersectionHelper.intersectScreenFreePointFallback(t,this._tmpP,0===this.view.map.ground.opacity?N:{});n(this._tmpDir,this._tmpP,this.startCamera.eye);const r=m(this._tmpDir);h(this._tmpDir,this._tmpDir);const a=Math.abs(this.view.camera.position.z);let o=i(Math.min(x,1/Math.abs(c(k,this._tmpDir)))*a,R[0],R[1]);const C=this.view._stage.renderView.getMinimalDepthForArea(b(this.view),t[0],t[1],this.view.state.camera,U);o=null!=C?C:o,o=s?Math.min(o,r):o,p(this._tmpDir,this._tmpDir,o),_(this._tmpP,this.startCamera.eye,this._tmpDir),n(this._tmpN,this.startCamera.eye,this.startCamera.center),h(this._tmpN,this._tmpN),this._tmpN[1]<0&&l(this._tmpN,this._tmpN),D(this._tmpP,this._tmpN,this._plane)}update(t){if(!this.active)return;A(this._plane,this.currentCamera,this.dragBeginPoint,this._tmpPoi)||C(this._tmpPoi,this.currentCamera.center),O(this.currentCamera,t,this._tmpP0);let i=4*(this._tmpP0[1]-this._normalizedAnchorPoint[1]);e(this._normalizedAnchorPoint,this._tmpP0),n(this._tmpRayDir,this._tmpPoi,this.currentCamera.eye);const s=m(this._tmpRayDir);let r=s*(1-i);this._constraintOptions.interactionDirection&&(C(this._constraintOptions.interactionDirection,this._tmpRayDir),p(this._constraintOptions.interactionDirection,this._constraintOptions.interactionDirection,Math.sign(i)/s));const o=this.view.state.constraints.minimumPoiDistance;i>=0&&r<o&&(r=o,i=-(r-s)/s),Math.abs(s-r)<1e-6||(p(this._tmpRayDir,this._tmpRayDir,i),this.currentCamera.eye=_(L,this.currentCamera.eye,this._tmpRayDir),P(L,this.currentCamera.center,this._tmpPoi,i),this._tmpPoi[2]>this.startCamera.center[2]?L[2]=Math.max(this.startCamera.center[2],L[2]):L[2]=Math.min(this.startCamera.center[2],L[2]),this.currentCamera.center=L,this._constraintOptions.interactionFactor=j(a(this.dragBeginPoint,t)),v(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}end(){this.active&&this.finishController()}};z=t([r("esri.views.3d.state.controllers.ZoomControllerLocal")],z);const L=f(),k=u(0,0,1);export{z as ZoomControllerLocal};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as s,n as o,j as a,m as n,l as m,f as h,g as c,a as p}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as l}from"../../../../chunks/sphere.js";import{applyAll as y}from"../../camera/constraintUtils.js";import{ConstraintOptions as f}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as g}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as w}from"../../camera/constraintUtils/InteractionType.js";import{applySurfaceCollisionConstraint as C}from"../../camera/constraintUtils/surfaceCollision.js";import{PointToPointAnimationController as d}from"./PointToPointAnimationController.js";import{contentIntersectorOptions as j,navigationMode as u,zoomMaxDistanceModifier as D,zoomMinDistanceModifier as v,zoomDistanceModifier as b,NavigationMode as R,panToPosition as M}from"../utils/navigationUtils.js";import{fromScreenAtEye as L}from"../../support/geometryUtils/ray.js";import{intersectScreen as z}from"../../support/geometryUtils/sphere.js";import O from"../../webgl/RenderCamera.js";import{newIntersector as S}from"../../webgl-engine/lib/Intersector.js";import{outExpo as U}from"../../../animation/easing.js";const V=.6,H=4,x=60;let A=class extends d{constructor(){super(...arguments),this._zoomLocation=_(),this._tmpCamera=new O,this._tmpViewDir=_(),this._tmpRayDir={origin:_(),direction:_()},this._targetOnSphere=_(),this._tmpCenter=_(),this._beginCamera=new O,this._constraintOptions=new f(g.ALL_EXCEPT_COLLISION,w.ZOOM,null,this._beginCamera),this._sphere=l()}initialize(){this._intersector=S(this.view.state.viewingMode)}zoomStep(t,i){if(!this.active)return;const e=this.view.state;this.animation.finished?this._beginCamera.copyFrom(e.camera):this.animation.cameraAt(1,this._beginCamera);let r=!1,o=!1;this.intersectionHelper.intersectScreen(i,this._zoomLocation,0===this.view.map.ground.opacity?j:{})&&(r=t>0,o=!0),this._tmpCamera.copyFrom(e.camera),r?this.intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this.intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:s(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,t,this._zoomLocation,i,o),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:U}}_updateCamera(t,e,r,s,_){const l=u(t,s,this.view.renderCoordsHelper,this.view.viewingMode),f=Math.abs(this.view.camera.position.z);o(I,t.eye),a(I,I,-1),L(t,s,this._tmpRayDir),o(this._tmpRayDir.direction,this._tmpRayDir.direction);const g=i(Math.min(b,1/Math.abs(n(I,this._tmpRayDir.direction)))*f,v,D);if(l===R.Horizontal){let i=V**e;this._sphere[3]=m(r),h(this._tmpViewDir,t.center,t.eye);const o=Math.min(m(this._tmpViewDir),g);let n=o*i;if(i<=1&&n<H&&(n=H,i=n/o),Math.abs(o-n)<1e-6)return;const _=m(t.center);if(this._sphere[3]!==_){const e=this._sphere[3]+i*(_-this._sphere[3]);t.center=a(F,t.center,e/_)}a(this._tmpViewDir,this._tmpViewDir,-i),t.eye=c(F,t.center,this._tmpViewDir),y(this.view,t,this._constraintOptions),p(r,t.center)>1e-12&&z(this._sphere,t,s,this._targetOnSphere)&&M(this._sphere,t,r,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let i=V**Math.abs(e);const o=e>0?1:-1;h(this._tmpViewDir,r,t.eye);const n=m(this._tmpViewDir),p=this.view._stage.renderView.getMinimalDepthForArea(null,s[0],s[1],this.view.state.camera,x);let l=null!=p?p:g;l=_&&e>0?Math.min(l,n):l,a(this._tmpRayDir.direction,this._tmpRayDir.direction,l),c(r,this._tmpRayDir.origin,this._tmpRayDir.direction);let y=l*i;const f=Math.max(H,1.01*t.nearFar[0]);if(e>0&&y<f&&(y=f,i=y/l),Math.abs(l-y)<1e-6)return;a(this._tmpRayDir.direction,this._tmpRayDir.direction,o*(1-i)),t.eye=c(F,t.eye,this._tmpRayDir.direction),t.center=c(F,t.center,this._tmpRayDir.direction)}C(this.view,t)}};A=t([r("esri.views.3d.state.controllers.ZoomStepControllerGlobal")],A);const F=_(),I=_();export{A as ZoomStepControllerGlobal};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as s,n as o,j as a,l as n,m,f as h,g as c,s as p}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as l}from"../../../../chunks/sphere.js";import{applyAll as y}from"../../camera/constraintUtils.js";import{ConstraintOptions as f}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as g}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as w}from"../../camera/constraintUtils/InteractionType.js";import{applySurfaceCollisionConstraint as C}from"../../camera/constraintUtils/surfaceCollision.js";import{PointToPointAnimationController as d}from"./PointToPointAnimationController.js";import{contentIntersectorOptions as j,navigationMode as u,zoomMaxDistanceModifier as D,zoomMinDistanceModifier as v,zoomDistanceModifier as b,NavigationMode as R,panToPosition as M}from"../utils/navigationUtils.js";import{fromScreenAtEye as L}from"../../support/geometryUtils/ray.js";import{intersectScreen as z}from"../../support/geometryUtils/sphere.js";import O from"../../webgl/RenderCamera.js";import{newIntersector as S}from"../../webgl-engine/lib/Intersector.js";import{outExpo as U}from"../../../animation/easing.js";const V=.6,H=4,x=60;let A=class extends d{constructor(){super(...arguments),this._zoomLocation=_(),this._tmpCamera=new O,this._tmpViewDir=_(),this._tmpRayDir={origin:_(),direction:_()},this._targetOnSphere=_(),this._tmpCenter=_(),this._beginCamera=new O,this._constraintOptions=new f(g.ALL_EXCEPT_COLLISION,w.ZOOM,null,this._beginCamera),this._sphere=l()}initialize(){this._intersector=S(this.view.state.viewingMode)}zoomStep(t,i){if(!this.active)return;const e=this.view.state;this.animation.finished?this._beginCamera.copyFrom(e.camera):this.animation.cameraAt(1,this._beginCamera);let r=!1,o=!1;this.intersectionHelper.intersectScreen(i,this._zoomLocation,0===this.view.map.ground.opacity?j:{})&&(r=t>0,o=!0),this._tmpCamera.copyFrom(e.camera),r?this.intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this.intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:s(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,t,this._zoomLocation,i,o),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:U}}_updateCamera(t,e,r,s,_){const l=u(t,s,this.view.renderCoordsHelper,this.view.viewingMode),f=Math.abs(this.view.camera.position.z);o(I,t.eye),a(I,I,-1),L(t,s,this._tmpRayDir),o(this._tmpRayDir.direction,this._tmpRayDir.direction);const g=i(Math.min(b,1/Math.abs(n(I,this._tmpRayDir.direction)))*f,v,D);if(l===R.Horizontal){let i=V**e;this._sphere[3]=m(r),h(this._tmpViewDir,t.center,t.eye);const o=Math.min(m(this._tmpViewDir),g);let n=o*i;if(i<=1&&n<H&&(n=H,i=n/o),Math.abs(o-n)<1e-6)return;const _=m(t.center);if(this._sphere[3]!==_){const e=this._sphere[3]+i*(_-this._sphere[3]);t.center=a(F,t.center,e/_)}a(this._tmpViewDir,this._tmpViewDir,-i),t.eye=c(F,t.center,this._tmpViewDir),y(this.view,t,this._constraintOptions),p(r,t.center)>1e-12&&z(this._sphere,t,s,this._targetOnSphere)&&M(this._sphere,t,r,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let i=V**Math.abs(e);const o=e>0?1:-1;h(this._tmpViewDir,r,t.eye);const n=m(this._tmpViewDir),p=this.view._stage.renderView.getMinimalDepthForArea(null,s[0],s[1],this.view.state.camera,x);let l=null!=p?p:g;l=_&&e>0?Math.min(l,n):l,a(this._tmpRayDir.direction,this._tmpRayDir.direction,l),c(r,this._tmpRayDir.origin,this._tmpRayDir.direction);let y=l*i;const f=Math.max(H,1.01*t.nearFar[0]);if(e>0&&y<f&&(y=f,i=y/l),Math.abs(l-y)<1e-6)return;a(this._tmpRayDir.direction,this._tmpRayDir.direction,o*(1-i)),t.eye=c(F,t.eye,this._tmpRayDir.direction),t.center=c(F,t.center,this._tmpRayDir.direction)}C(this.view,t)}};A=t([r("esri.views.3d.state.controllers.ZoomStepControllerGlobal")],A);const F=_(),I=_();export{A as ZoomStepControllerGlobal};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as o,f as r,n as a,m,l as n,g as c,j as h,o as p}from"../../../../chunks/vec32.js";import{create as _,fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as C}from"../../camera/constraintUtils.js";import{ConstraintOptions as f}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as j}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as y}from"../../camera/constraintUtils/InteractionType.js";import{getVoxelWasm as g}from"../../layers/VoxelWasm.js";import{PointToPointAnimationController as w}from"./PointToPointAnimationController.js";import{contentIntersectorOptions as b,zoomMaxDistanceModifier as u,zoomMinDistanceModifier as v,zoomDistanceModifier as L}from"../utils/navigationUtils.js";import d from"../../webgl/RenderCamera.js";import{newIntersector as z}from"../../webgl-engine/lib/Intersector.js";import{outExpo as R}from"../../../animation/easing.js";const M=.6,D=4,F=60;let U=class extends w{constructor(){super(...arguments),this._zoomLocation=_(),this._tmpCamera=new d,this._tmpRayDir=_(),this._tmpCenter=_(),this._beginCamera=new d,this._constraintOptions=new f(j.ALL,y.ZOOM,null,this._beginCamera)}zoomStep(t,e){if(!this.active)return;const s=this.view.state;this.animation.finished?this._beginCamera.copyFrom(s.camera):this.animation.cameraAt(1,this._beginCamera),this._tmpCamera.copyFrom(s.camera);const p=z(this.view.state.viewingMode);let l=!1;t>0?(l=this.intersectionHelper.intersectScreenFreePointFallback(e,this._zoomLocation,0===this.view.map.ground.opacity?b:{}),this.intersectionHelper.intersectRay(this._tmpCamera.ray,p,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this.intersectionHelper.intersectRay(this._tmpCamera.ray,p,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:o(this._zoomLocation,this._tmpCamera.center);const C=M**t;let f=this.view._stage.renderView.getMinimalDepthForArea(g(this.view),e[0],e[1],this.view.state.camera,F);r(S,this._tmpCamera.eye,this._zoomLocation),a(S,S);const j=i(Math.min(L,1/Math.abs(m(O,S)))*Math.abs(this.view.camera.position.z),v,u);if(f=null!=f?f:j,f){const t=_();r(t,this._zoomLocation,this._tmpCamera.eye),(f<n(t)||!l)&&(a(t,t),c(this._zoomLocation,this._tmpCamera.eye,h(t,t,f)))}this._updateCamera(this._tmpCamera,C,this._zoomLocation),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:R}}_updateCamera(t,i,e){r(this._tmpRayDir,e,t.eye);const s=n(this._tmpRayDir);let o=s*i;const a=i<=1,m=Math.max(D,1.01*t.nearFar[0]);0!==o&&(a&&o<m&&(o=m,i=o/s),Math.abs(s-o)<1e-6||(h(this._tmpRayDir,this._tmpRayDir,i),t.eye=r(x,e,this._tmpRayDir),t.center=p(x,t.center,e,1-i),C(this.view,t,this._constraintOptions)))}};U=t([s("esri.views.3d.state.controllers.ZoomStepControllerLocal")],U);const x=_(),O=l(0,0,1),S=_();export{U as ZoomStepControllerLocal};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as o,f as r,n as a,l as m,m as n,g as c,j as h,o as p}from"../../../../chunks/vec32.js";import{create as _,fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as C}from"../../camera/constraintUtils.js";import{ConstraintOptions as f}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as j}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as y}from"../../camera/constraintUtils/InteractionType.js";import{getVoxelWasm as g}from"../../layers/VoxelWasm.js";import{PointToPointAnimationController as w}from"./PointToPointAnimationController.js";import{contentIntersectorOptions as b,zoomMaxDistanceModifier as u,zoomMinDistanceModifier as v,zoomDistanceModifier as L}from"../utils/navigationUtils.js";import d from"../../webgl/RenderCamera.js";import{newIntersector as z}from"../../webgl-engine/lib/Intersector.js";import{outExpo as R}from"../../../animation/easing.js";const M=.6,D=4,F=60;let U=class extends w{constructor(){super(...arguments),this._zoomLocation=_(),this._tmpCamera=new d,this._tmpRayDir=_(),this._tmpCenter=_(),this._beginCamera=new d,this._constraintOptions=new f(j.ALL,y.ZOOM,null,this._beginCamera)}zoomStep(t,e){if(!this.active)return;const s=this.view.state;this.animation.finished?this._beginCamera.copyFrom(s.camera):this.animation.cameraAt(1,this._beginCamera),this._tmpCamera.copyFrom(s.camera);const p=z(this.view.state.viewingMode);let l=!1;t>0?(l=this.intersectionHelper.intersectScreenFreePointFallback(e,this._zoomLocation,0===this.view.map.ground.opacity?b:{}),this.intersectionHelper.intersectRay(this._tmpCamera.ray,p,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this.intersectionHelper.intersectRay(this._tmpCamera.ray,p,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:o(this._zoomLocation,this._tmpCamera.center);const C=M**t;let f=this.view._stage.renderView.getMinimalDepthForArea(g(this.view),e[0],e[1],this.view.state.camera,F);r(S,this._tmpCamera.eye,this._zoomLocation),a(S,S);const j=i(Math.min(L,1/Math.abs(m(O,S)))*Math.abs(this.view.camera.position.z),v,u);if(f=null!=f?f:j,f){const t=_();r(t,this._zoomLocation,this._tmpCamera.eye),(f<n(t)||!l)&&(a(t,t),c(this._zoomLocation,this._tmpCamera.eye,h(t,t,f)))}this._updateCamera(this._tmpCamera,C,this._zoomLocation),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:R}}_updateCamera(t,i,e){r(this._tmpRayDir,e,t.eye);const s=n(this._tmpRayDir);let o=s*i;const a=i<=1,m=Math.max(D,1.01*t.nearFar[0]);0!==o&&(a&&o<m&&(o=m,i=o/s),Math.abs(s-o)<1e-6||(h(this._tmpRayDir,this._tmpRayDir,i),t.eye=r(x,e,this._tmpRayDir),t.center=p(x,t.center,e,1-i),C(this.view,t,this._constraintOptions)))}};U=t([s("esri.views.3d.state.controllers.ZoomStepControllerLocal")],U);const x=_(),O=l(0,0,1),S=_();export{U as ZoomStepControllerLocal};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as t,createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/unitUtils.js";import{g as i,n as s,m as o}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,copy as a,negativeInfinity as u,width as h,height as d,expandPointInPlace as p}from"../../../../geometry/support/aaBoundingRect.js";import{create as m}from"../../../../geometry/support/ray.js";import{sv3d as y}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as f}from"../../../../support/elevationInfoUtils.js";import{ViewingMode as g}from"../../../ViewingMode.js";import{computeMapPointFromVec3d as R}from"../../support/hitTest.js";import{fromRenderAtEye as _,fromScreen as I}from"../../support/geometryUtils/ray.js";import{defaultTolerance as v,newIntersector as b}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as w,IntersectorType as P}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as j,sliceFilterPredicate as M}from"../../webgl-engine/lib/intersectorUtils.js";class U{constructor(t,r,n){this.viewingMode=t,this._forEachLayer=r,this._view=n,this._externalIntersectionHandlers=new e,this._tolerance=v,this._tmpRay=m(),this._tmpRegion=c(),this._validateHUDIntersector=b(this.viewingMode),this._validateHUDIntersector.options.hud=!1}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),T(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,T(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,n){return t.options.selectionMode=!1,t.options.store=w.MIN,this.computeIntersection(e,t,n),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,n=.5){return e.getRenderCenter(D,r,n),D[0]+=.0466,D[1]-=.0123,_(e,D,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,r)}intersectToolIntersectorScreen(e,t,r){const n=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(n,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,r);const n=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||j(n)&&n.intersector!==P.TERRAIN||(t.options.selectionMode=!1,this.computeIntersection(e,t,r))}setTolerance(e=v){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}_getPickRay(e,t){const r=this._view.state.camera;return I(r,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==g.Local||null==e||i(t,e.origin,s(y.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,n=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,n)}_intersectElevation(e,r,l=0,c=null){if(null==e)return null;const a=this._view,{renderCoordsHelper:u}=a,h=n(a.spatialReference),d=null!=r?r.mode:"absolute-height",p=f(r)/h,m=("on-the-ground"!==d?p+l:0)*h/u.unitInMeters,{camera:g}=a.state;if("absolute-height"===d){const t=u?.getAltitude(g.eye),r=o(s(F,e.direction),u.worldUpAtPosition(g.eye,S));if(t<m&&r<0||t>=m&&r>0)return null;if(u.intersectInfiniteManifold(e,m,F)){const e=R(a,F);return e.z??=0,e.z-=p,e}return null}const _=t(y.get());g.projectToRenderScreen(e.origin,_);const I=new A(null,this._forEachLayer),{slicePlane:v}=a,j=null!=v?M(v):null,U=b(this.viewingMode);U.options.store=w.MIN,U.options.verticalOffset=m,U.options.normalRequired=!1;const x=e.origin,E=i(y.get(),x,e.direction);U.reset(x,E,g),U.point=_;const H=c?"type"in c&&"graphics"===c.type?e=>e.layerUid!==c.uid:e=>e.graphicUid!==c.uid:null;switch(d){case"relative-to-scene":{const e=e=>(!H||H(e))&&!!e.lastValidElevationBB;U.intersect(I.layers,_,this._tolerance,null,e),this._externalIntersectionHandlers.forAll((e=>{if(e.type===P.I3S||e.type===P.TERRAIN||e.type===P.TILES3D){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_)}}));break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll((e=>{if(e.isGround){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_)}}))}if(U.results.min.getIntersectionPoint(F)){const e=R(a,F);return e.z=l,e}return null}computeIntersection(e,r,n,s){if(null==e)return;const o=this._view.state.camera,l=t(y.get());o.projectToRenderScreen(e.origin,l);const c=new A(n,this._forEachLayer);r.options.selectOpaqueTerrainOnly=!n||!("include"in n||"exclude"in n);const a=e.origin,u=i(y.get(),e.origin,e.direction);r.reset(a,u,o),r.intersect(c.layers,l,this._tolerance);const h=this._view.slicePlane,d=null!=h?M(h):null;r.intersect(c.sliceableLayers,l,this._tolerance,d);const p=n&&(n.requiresGroundFeedback||n.enableDraped);this._externalIntersectionHandlers.forAll((e=>{const t=e.layerUid,n=Array.isArray(t),i=n?t:[t];n&&(r.options.filteredLayerUids=[]);let o=!1;for(const s of i){!c.filterLayerUid(s)?n&&r.options.filteredLayerUids.push(s):o=!0}if(r.options.isFiltered=!o,e.isGround&&p||!r.options.isFiltered){const t=e.slicePlaneEnabled?d:null;e.intersect(r,t,a,u,l,s)}}));const m=y.get(),f=this._view.basemapTerrain;if(n&&n.enableDraped&&null!=f.spatialReference&&r.results.ground.getIntersectionPoint(m)){const e=f.overlayManager.renderer,t=this._view.renderCoordsHelper.spatialReference,n=y.get();this._view.renderCoordsHelper.fromRenderCoords(m,n,f.spatialReference),n[2]=this._view.elevationProvider?.getElevation(m[0],m[1],m[2],t,"ground")??0,e.intersect(r,n,r.results.ground,(e=>c.filterRenderGeometry(e)))}r.sortResults(),this._processHUDResults(r)}_processHUDResults(e){const t=e.results.hud;a(this._tmpRegion,u);const r=this._view.state.camera,n=[],i=this._tmpRegion,s=e=>{const t=new H(e);r.projectToRenderScreen(e.target.center,t.screenPoint),t.screenPoint[0]=Math.floor(t.screenPoint[0]),t.screenPoint[1]=Math.floor(t.screenPoint[1]),n.push(t),p(i,t.screenPoint)};e.sortResults(t.all),null!=t.min.dist&&s(t.min);for(const a of t.all)t.min.target.object!==a.target.object&&t.max.target.object!==a.target.object&&s(a);if(null!=t.max.dist&&t.max.target.object!==t.min.target.object&&s(t.max),!n.length)return;i[0]===i[2]&&(i[2]+=1),i[1]===i[3]&&(i[3]+=1);const o=r.fullWidth,l=r.fullHeight,c=Math.max(0,i[0]-x),m=Math.max(0,i[1]-x),y=Math.min(h(i)+2*x,o-c),f=Math.min(d(i)+2*x,l-m);if(y<=0||f<=0)return;const g=new Uint8Array(y*f*4);this._view._stage.renderer.readHUDVisibility(c,m,y,f,g);let R=!0;const _=null==e.results.max.dist;let I=0;for(const a of n)for(const t of E){const r=4*(Math.min(a.screenPoint[0]+t[0],o)-i[0]+(Math.min(a.screenPoint[1]+t[1],l)-i[1])*y);if(!(r<0||r>=g.length)&&g[r]){R&&(e.results.min.copy(a.result),R=!1),_&&e.results.max.copy(a.result),e.options.store===w.ALL&&e.results.all.splice(I++,0,a.result);break}}}}const x=1,E=(()=>{const e=[],t=x;for(let r=-t;r<=t;r++)for(let n=-t;n<=t;n++)e.push([n+t,r+t]);return e})();class H{constructor(e){this.result=e,this.screenPoint=r()}}let L;function T(e){return L&&L.viewingMode===e||(L=b(e)),L}class A{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t((e=>{e.pickable&&this.filterLayerUid(e.apiLayerUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)}))}filterLayerUid(e){const{include:t,exclude:r}=this;return null==e?null==t&&null==r:(null==t||t.has(e))&&(null==r||!r.has(e))}filterRenderGeometry(e){return this.filterLayerUid(e.layerUid)}}function k(e){return"object"==typeof e&&"intersect"in e}const F=l(),S=l(),D=r();export{U as SceneIntersectionHelper,k as isIntersectionHandler};
5
+ import e from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as t,createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/unitUtils.js";import{g as i,n as s,l as o}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,copy as a,negativeInfinity as u,width as h,height as d,expandPointInPlace as p}from"../../../../geometry/support/aaBoundingRect.js";import{create as m}from"../../../../geometry/support/ray.js";import{sv3d as y}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as f}from"../../../../support/elevationInfoUtils.js";import{ViewingMode as g}from"../../../ViewingMode.js";import{computeMapPointFromVec3d as R}from"../../support/hitTest.js";import{fromRenderAtEye as _,fromScreen as I}from"../../support/geometryUtils/ray.js";import{defaultTolerance as v,newIntersector as b}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as w,IntersectorType as P}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as j,sliceFilterPredicate as M}from"../../webgl-engine/lib/intersectorUtils.js";class U{constructor(t,r,n){this.viewingMode=t,this._forEachLayer=r,this._view=n,this._externalIntersectionHandlers=new e,this._tolerance=v,this._tmpRay=m(),this._tmpRegion=c(),this._validateHUDIntersector=b(this.viewingMode),this._validateHUDIntersector.options.hud=!1}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),T(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,T(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,n){return t.options.selectionMode=!1,t.options.store=w.MIN,this.computeIntersection(e,t,n),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,n=.5){return e.getRenderCenter(D,r,n),D[0]+=.0466,D[1]-=.0123,_(e,D,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,r)}intersectToolIntersectorScreen(e,t,r){const n=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(n,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,r);const n=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||j(n)&&n.intersector!==P.TERRAIN||(t.options.selectionMode=!1,this.computeIntersection(e,t,r))}setTolerance(e=v){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}_getPickRay(e,t){const r=this._view.state.camera;return I(r,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==g.Local||null==e||i(t,e.origin,s(y.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,n=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,n)}_intersectElevation(e,r,l=0,c=null){if(null==e)return null;const a=this._view,{renderCoordsHelper:u}=a,h=n(a.spatialReference),d=null!=r?r.mode:"absolute-height",p=f(r)/h,m=("on-the-ground"!==d?p+l:0)*h/u.unitInMeters,{camera:g}=a.state;if("absolute-height"===d){const t=u?.getAltitude(g.eye),r=o(s(F,e.direction),u.worldUpAtPosition(g.eye,S));if(t<m&&r<0||t>=m&&r>0)return null;if(u.intersectInfiniteManifold(e,m,F)){const e=R(a,F);return e.z??=0,e.z-=p,e}return null}const _=t(y.get());g.projectToRenderScreen(e.origin,_);const I=new A(null,this._forEachLayer),{slicePlane:v}=a,j=null!=v?M(v):null,U=b(this.viewingMode);U.options.store=w.MIN,U.options.verticalOffset=m,U.options.normalRequired=!1;const x=e.origin,E=i(y.get(),x,e.direction);U.reset(x,E,g),U.point=_;const H=c?"type"in c&&"graphics"===c.type?e=>e.layerUid!==c.uid:e=>e.graphicUid!==c.uid:null;switch(d){case"relative-to-scene":{const e=e=>(!H||H(e))&&!!e.lastValidElevationBB;U.intersect(I.layers,_,this._tolerance,null,e),this._externalIntersectionHandlers.forAll((e=>{if(e.type===P.I3S||e.type===P.TERRAIN||e.type===P.TILES3D){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_)}}));break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll((e=>{if(e.isGround){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_)}}))}if(U.results.min.getIntersectionPoint(F)){const e=R(a,F);return e.z=l,e}return null}computeIntersection(e,r,n,s){if(null==e)return;const o=this._view.state.camera,l=t(y.get());o.projectToRenderScreen(e.origin,l);const c=new A(n,this._forEachLayer);r.options.selectOpaqueTerrainOnly=!n||!("include"in n||"exclude"in n);const a=e.origin,u=i(y.get(),e.origin,e.direction);r.reset(a,u,o),r.intersect(c.layers,l,this._tolerance);const h=this._view.slicePlane,d=null!=h?M(h):null;r.intersect(c.sliceableLayers,l,this._tolerance,d);const p=n&&(n.requiresGroundFeedback||n.enableDraped);this._externalIntersectionHandlers.forAll((e=>{const t=e.layerUid,n=Array.isArray(t),i=n?t:[t];n&&(r.options.filteredLayerUids=[]);let o=!1;for(const s of i){!c.filterLayerUid(s)?n&&r.options.filteredLayerUids.push(s):o=!0}if(r.options.isFiltered=!o,e.isGround&&p||!r.options.isFiltered){const t=e.slicePlaneEnabled?d:null;e.intersect(r,t,a,u,l,s)}}));const m=y.get(),f=this._view.basemapTerrain;if(n&&n.enableDraped&&null!=f.spatialReference&&r.results.ground.getIntersectionPoint(m)){const e=f.overlayManager.renderer,t=this._view.renderCoordsHelper.spatialReference,n=y.get();this._view.renderCoordsHelper.fromRenderCoords(m,n,f.spatialReference),n[2]=this._view.elevationProvider?.getElevation(m[0],m[1],m[2],t,"ground")??0,e.intersect(r,n,r.results.ground,(e=>c.filterRenderGeometry(e)))}r.sortResults(),this._processHUDResults(r)}_processHUDResults(e){const t=e.results.hud;a(this._tmpRegion,u);const r=this._view.state.camera,n=[],i=this._tmpRegion,s=e=>{const t=new H(e);r.projectToRenderScreen(e.target.center,t.screenPoint),t.screenPoint[0]=Math.floor(t.screenPoint[0]),t.screenPoint[1]=Math.floor(t.screenPoint[1]),n.push(t),p(i,t.screenPoint)};e.sortResults(t.all),null!=t.min.dist&&s(t.min);for(const a of t.all)t.min.target.object!==a.target.object&&t.max.target.object!==a.target.object&&s(a);if(null!=t.max.dist&&t.max.target.object!==t.min.target.object&&s(t.max),!n.length)return;i[0]===i[2]&&(i[2]+=1),i[1]===i[3]&&(i[3]+=1);const o=r.fullWidth,l=r.fullHeight,c=Math.max(0,i[0]-x),m=Math.max(0,i[1]-x),y=Math.min(h(i)+2*x,o-c),f=Math.min(d(i)+2*x,l-m);if(y<=0||f<=0)return;const g=new Uint8Array(y*f*4);this._view._stage.renderer.readHUDVisibility(c,m,y,f,g);let R=!0;const _=null==e.results.max.dist;let I=0;for(const a of n)for(const t of E){const r=4*(Math.min(a.screenPoint[0]+t[0],o)-i[0]+(Math.min(a.screenPoint[1]+t[1],l)-i[1])*y);if(!(r<0||r>=g.length)&&g[r]){R&&(e.results.min.copy(a.result),R=!1),_&&e.results.max.copy(a.result),e.options.store===w.ALL&&e.results.all.splice(I++,0,a.result);break}}}}const x=1,E=(()=>{const e=[],t=x;for(let r=-t;r<=t;r++)for(let n=-t;n<=t;n++)e.push([n+t,r+t]);return e})();class H{constructor(e){this.result=e,this.screenPoint=r()}}let L;function T(e){return L&&L.viewingMode===e||(L=b(e)),L}class A{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t((e=>{e.pickable&&this.filterLayerUid(e.apiLayerUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)}))}filterLayerUid(e){const{include:t,exclude:r}=this;return null==e?null==t&&null==r:(null==t||t.has(e))&&(null==r||!r.has(e))}filterRenderGeometry(e){return this.filterLayerUid(e.layerUid)}}function k(e){return"object"==typeof e&&"intersect"in e}const F=l(),S=l(),D=r();export{U as SceneIntersectionHelper,k as isIntersectionHandler};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{fromRotation as i,exactEquals as s,multiply as c,rotate as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as h,h as M,g,l as y,j as b,o as d,s as x,m as j,n as v,a as z,c as P,b as w}from"../../../../chunks/vec32.js";import{create as I}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as S,axis as A,fromPoints as E,wrapAxisAngle as k}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as U,vectorCoordinates as H}from"../../../../geometry/support/coordinateSystem.js";import{create as G,intersectRay as R,fromNormalAndOffset as q}from"../../../../geometry/support/plane.js";import{j as C,i as F,g as V,c as T}from"../../../../chunks/sphere.js";import{sm4d as O,sv3d as W}from"../../../../geometry/support/vectorStacks.js";import{fromScreen as B,fromScreenAtEye as D}from"../../support/geometryUtils/ray.js";import{intersectScreen as J}from"../../support/geometryUtils/sphere.js";import K from"../../webgl/RenderCamera.js";import{terrainId as L}from"../../webgl-engine/lib/verticalOffsetUtils.js";var N;!function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"}(N||(N={}));const Q=30,X=[1,3e8],Y=80,Z=8,$=200,_=1508e5,tt=5,et=50,nt=5,ot=10,rt=90,at={exclude:new Set([L])};function it(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function st(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function ct(t,e,n){const o=i(O.get(),n[3],A(n));null==o||s(o,m)||(h(oe,t.eye,e),M(oe,oe,o),t.eye=g(oe,oe,e),h(oe,t.center,e),M(oe,oe,o),t.center=g(oe,oe,e),t.up=M(oe,t.up,o))}function lt(t,e,n,o){return R(t,B(e,n,ce),o)}function mt(t,e,n,o){return R(t,D(e,n,ce),o)}function ut(t,e,n,o){const r=W.get();let a=1-n;h(r,e,t.eye);const i=y(r);let s=i*(1-a);a>=0&&s<o&&(s=o,a=-(s-i)/i),Math.abs(i-s)<1e-6||(b(r,r,a),t.eye=g(oe,t.eye,r),t.center=d(oe,t.center,e,a))}function ft(t,e,n){e.getScreenCenter(pt),J(t,e,pt,oe)&&(e.center=oe);const o=e.distance,r=o*n;if(Math.abs(o-r)<1e-6)return;const a=b(W.get(),e.viewForward,r);e.eye=h(oe,e.center,a)}const pt=a();function ht(t,e){x(e,0,0,0);for(const n of t)g(e,e,n);b(e,e,1/t.length)}function Mt(t,e,n,o){return Math.sin(t/y(e))*(n+o.radius)}function gt(t,e,n,o){return Mt(Math.PI/2,e,n,o)+(t-Math.PI/2)}var yt;!function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal"}(yt||(yt={}));const bt={Elevation:3e4,Angle:e(16)},dt={Pole:.95,Angle:e(18),Tilt:45},xt=e(80);function jt(t,e,n,o,r,a){const i=I(),s=T();let c=!0,l=!0;return t.intersectScreen(n,i,a)?s[3]=y(i):(l=!1,e.aboveGround&&r!==N.Ellipsoid?s[3]=Math.max(y(e.center),.9*o.radius):s[3]=y(e.eye)-e.relativeElevation,r===N.Silhouette?wt(s,e,n,i):c=J(s,e,n,i)),{sphere:s,scenePickPoint:c?i:null,hasGeometryIntersection:l}}function vt(t,e,n,o){const r=t.relativeElevation;if(r>bt.Elevation&&"global"===o)return yt.Horizontal;D(t,e,le);const a=Math.sign(r),i=n.worldUpAtPosition(t.eye,oe);return-a*j(i,le.direction)<Math.sin(bt.Angle)*y(le.direction)?yt.Vertical:yt.Horizontal}function zt(t,e,n){h(Pt,n,e),t.eye=h(oe,t.eye,Pt),t.center=h(oe,t.center,Pt)}const Pt=I();function wt(t,e,n,o){const r=D(e,n,ce);return null!=r&&(C(t,r,It),F(t,r,o)?!(z(It,r.origin)<z(o,r.origin))||(P(o,It),!1):(h(St,e.eye,e.center),v(St,St),q(St,-j(v(St,St),It),At),R(At,r,o),!1))}const It=I(),St=I(),At=G();function Et(a,i,s,c,l,m){let u=0;if(w(ie,a,i),h(re,a,i),y(a)<=l||!c.aboveGround){w(s,re,c.eye);const f=j(a,i)/(y(a)*y(i));if(f<.9999)u=o(f);else{const t=y(w(I(),a,i))/(y(a)*y(i));u=r(t)}const p=Math.cos(n(t.normalize(e(m)),0,xt));u=-u-Math.max(0,y(i)-l)/(p*l)}else h(kt,c.eye,c.center),w(s,re,kt),u=-y(re)/l;return v(s,s),b(s,s,y(ie)),u}const kt=I();function Ut(r,a,i,s){let c,l;const m=Math.cos(n(t.normalize(e(s)),0,xt));return c=a>i?-(a-i)/(m*i):a<-i?Math.PI-(a+i)/(m*i):o(a/i),l=r>i?-(r-i)/(m*i):r<-i?Math.PI-(r+i)/(m*i):o(r/i),(l-c)*i}function Ht(t,e,n,o,r,a,i,s,c,l){const m=Ut(t[2],e[2],a[3],s),u=c?Ut(t[0],e[0],a[3],180):e[0]-t[0],p=Math.sin(i)*u-Math.cos(i)*m,h=Math.cos(i)*u+Math.sin(i)*m;v(oe,r);const M=c?p/Math.sqrt(Math.abs(a[3]**2-j(n,oe)**2)):p/a[3],g=h/Math.sqrt(Math.abs(a[3]**2-j(n,o)**2));f(l,M,g)}function Gt(t,e,n,o,r,a,i,s,c,l){w(ie,t,e),U(a.up,a.eye,Lt,Nt,Qt),U([0,0,1],a.eye,Dt,Jt,Kt),P(n,Jt),P(o,Dt),v(n,n),b(n,n,y(ie)),H(t,v(Nt,Nt),v(Qt,Qt),v(Lt,Lt),Xt),H(e,Nt,Qt,Lt,Yt),Ht(Xt,Yt,t,Dt,Jt,i,s,c,l,r)}function Rt(t,e,n,o,r,a,s){i(_t,r,o),i(te,s,a),c(ee,_t,te),h(e,t,n),M(e,e,ee),g(e,e,n)}function qt(t,e,n,o,r,a){i(_t,o,n),i(te,a,r),c(ee,_t,te),h(oe,t.eye,e),M(oe,oe,ee),t.eye=g(oe,oe,e),h(oe,t.center,e),M(oe,oe,ee),t.center=g(oe,oe,e),h(oe,t.up,e),M(oe,oe,ee),t.up=g(oe,oe,e)}function Ct(t,e,n,o,r,a){return(Math.abs(o)>Math.PI-dt.Angle||Math.abs(o)<dt.Angle)&&(Math.abs(t[2])<n*dt.Pole||Math.abs(e)>n)&&a.aboveGround&&r<dt.Tilt}function Ft(t,e,n,o,r,a){if(a)E(n,o,$t),ct(e,V(t),$t);else{const a=Et(n,o,se,e,t[3],r);ct(e,V(t),k(se,a))}}function Vt(t,e,n,o,r,a,i){const s=i?20:1,c=1e-12;let l,m;P(ne,o),ae.copyFrom(e);for(let u=0;u<s&&z(n,ne)>c&&(l=z(n,ne),Gt(n,ne,Jt,Dt,Zt,ae,t,r,a,i),qt(ae,V(t),Dt,Zt[1],Jt,Zt[0]),Rt(ne,ne,V(t),Dt,Zt[1],Jt,Zt[0]),m=z(n,ne),m<l||0===u);u++)e.copyFrom(ae)}function Tt(n,o,r,a,i,s,c){Ct(r,j(o.up,r),n[3],-t.normalize(e(i)),s,o)?Vt(n,o,r,a,-t.normalize(e(i)),s,c):Ft(n,o,r,a,s,c)}function Ot(t,e,n,o,r,a){const{eye:i}=t;U([0,0,1],i,Dt,Jt,Kt);const s=e.translation[0]*n.pan,c="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-j(t.center,Dt)**2/y(t.center)**2)),.5),u=(Math.sin(a)*c+Math.cos(a)*s)/m,f=-Math.cos(a)*c+Math.sin(a)*s;switch(l(o.pan.matrix,o.pan.matrix,u,Dt),o.pan.enabled=!0,r.mode){case"pan":l(o.pan.matrix,o.pan.matrix,f,Jt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Wt(t,e,n,o,r){const{eye:a,viewRight:i}=t,s=w(W.get(),i,a),c=e.translation[0]*n.pan;switch(0!==c&&(l(o.pan.matrix,o.pan.matrix,-c,s),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(l(o.pan.matrix,o.pan.matrix,t,i),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Bt(n,o,r,a,i,s,c,l,m){Ct(n.center,j(n.up,n.center),y(n.center),-t.normalize(e(s)),c,o)?Ot(o,r,a,l,m,-t.normalize(e(i))):Wt(o,r,a,l,m)}const Dt=I(),Jt=I(),Kt=I(),Lt=I(),Nt=I(),Qt=I(),Xt=I(),Yt=I(),Zt=p(),$t=S(),_t=u(),te=u(),ee=u(),ne=I(),oe=I(),re=I(),ae=new K,ie=I(),se=I(),ce={origin:I(),direction:I()},le={origin:I(),direction:I()};export{yt as NavigationMode,dt as PreservingHeadingThreshold,N as SpherePickPointFallback,xt as TiltThresholdPanningSpeed,bt as VerticalPanTresholds,zt as applyPanPlanar,Ft as applyPanSphericalDirectRotation,Vt as applyPanSphericalPreserveHeading,ct as applyRotation,qt as applyRotationWithTwoAxes,ft as applyZoomOnSphere,ut as applyZoomToPoint,ht as centroid,at as contentIntersectorOptions,X as distanceClampValues,lt as intersectPlaneFromScreenPoint,mt as intersectPlaneFromScreenPointAtEye,Ut as lengthFromPoints,et as minHeightLimit,vt as navigationMode,it as normalizeCoordinate,st as normalizeRotationDelta,gt as offSurfaceTiltToEyeTiltGlobal,Mt as onSurfaceTiltToEyeTiltGlobal,tt as panDistanceModifier,Bt as panMotionToRotationMatrix,Tt as panToPosition,jt as pickPointAndInitSphere,Q as pivotDistanceModifier,Ct as preserveHeadingThreshold,nt as rotatePivotDistanceModifier,ot as rotatePivotMinDistanceModifier,Rt as rotatePointAroundTwoAxes,rt as rotateScreenPixelArea,Et as rotationAngleAndAxisDirectRotation,Gt as rotationAnglesAndAxesHeadingPreserving,Ht as rotationAnglesHeadingPreserving,Y as screenPixelArea,wt as sphereOrPlanePointFromScreenPoint,Z as zoomDistanceModifier,_ as zoomMaxDistanceModifier,$ as zoomMinDistanceModifier};
5
+ import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{fromRotation as i,exactEquals as s,multiply as c,rotate as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as h,h as M,g,m as y,j as b,o as d,a as x,l as j,n as v,s as z,c as P,b as w}from"../../../../chunks/vec32.js";import{create as I}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as S,axis as A,fromPoints as E,wrapAxisAngle as k}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as U,vectorCoordinates as H}from"../../../../geometry/support/coordinateSystem.js";import{create as G,intersectRay as R,fromNormalAndOffset as q}from"../../../../geometry/support/plane.js";import{j as C,i as F,g as V,c as T}from"../../../../chunks/sphere.js";import{sm4d as O,sv3d as W}from"../../../../geometry/support/vectorStacks.js";import{fromScreen as B,fromScreenAtEye as D}from"../../support/geometryUtils/ray.js";import{intersectScreen as J}from"../../support/geometryUtils/sphere.js";import K from"../../webgl/RenderCamera.js";import{terrainId as L}from"../../webgl-engine/lib/verticalOffsetUtils.js";var N;!function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"}(N||(N={}));const Q=30,X=[1,3e8],Y=80,Z=8,$=200,_=1508e5,tt=5,et=50,nt=5,ot=10,rt=90,at={exclude:new Set([L])};function it(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function st(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function ct(t,e,n){const o=i(O.get(),n[3],A(n));null==o||s(o,m)||(h(oe,t.eye,e),M(oe,oe,o),t.eye=g(oe,oe,e),h(oe,t.center,e),M(oe,oe,o),t.center=g(oe,oe,e),t.up=M(oe,t.up,o))}function lt(t,e,n,o){return R(t,B(e,n,ce),o)}function mt(t,e,n,o){return R(t,D(e,n,ce),o)}function ut(t,e,n,o){const r=W.get();let a=1-n;h(r,e,t.eye);const i=y(r);let s=i*(1-a);a>=0&&s<o&&(s=o,a=-(s-i)/i),Math.abs(i-s)<1e-6||(b(r,r,a),t.eye=g(oe,t.eye,r),t.center=d(oe,t.center,e,a))}function ft(t,e,n){e.getScreenCenter(pt),J(t,e,pt,oe)&&(e.center=oe);const o=e.distance,r=o*n;if(Math.abs(o-r)<1e-6)return;const a=b(W.get(),e.viewForward,r);e.eye=h(oe,e.center,a)}const pt=a();function ht(t,e){x(e,0,0,0);for(const n of t)g(e,e,n);b(e,e,1/t.length)}function Mt(t,e,n,o){return Math.sin(t/y(e))*(n+o.radius)}function gt(t,e,n,o){return Mt(Math.PI/2,e,n,o)+(t-Math.PI/2)}var yt;!function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal"}(yt||(yt={}));const bt={Elevation:3e4,Angle:e(16)},dt={Pole:.95,Angle:e(18),Tilt:45},xt=e(80);function jt(t,e,n,o,r,a){const i=I(),s=T();let c=!0,l=!0;return t.intersectScreen(n,i,a)?s[3]=y(i):(l=!1,e.aboveGround&&r!==N.Ellipsoid?s[3]=Math.max(y(e.center),.9*o.radius):s[3]=y(e.eye)-e.relativeElevation,r===N.Silhouette?wt(s,e,n,i):c=J(s,e,n,i)),{sphere:s,scenePickPoint:c?i:null,hasGeometryIntersection:l}}function vt(t,e,n,o){const r=t.relativeElevation;if(r>bt.Elevation&&"global"===o)return yt.Horizontal;D(t,e,le);const a=Math.sign(r),i=n.worldUpAtPosition(t.eye,oe);return-a*j(i,le.direction)<Math.sin(bt.Angle)*y(le.direction)?yt.Vertical:yt.Horizontal}function zt(t,e,n){h(Pt,n,e),t.eye=h(oe,t.eye,Pt),t.center=h(oe,t.center,Pt)}const Pt=I();function wt(t,e,n,o){const r=D(e,n,ce);return null!=r&&(C(t,r,It),F(t,r,o)?!(z(It,r.origin)<z(o,r.origin))||(P(o,It),!1):(h(St,e.eye,e.center),v(St,St),q(St,-j(v(St,St),It),At),R(At,r,o),!1))}const It=I(),St=I(),At=G();function Et(a,i,s,c,l,m){let u=0;if(w(ie,a,i),h(re,a,i),y(a)<=l||!c.aboveGround){w(s,re,c.eye);const f=j(a,i)/(y(a)*y(i));if(f<.9999)u=o(f);else{const t=y(w(I(),a,i))/(y(a)*y(i));u=r(t)}const p=Math.cos(n(t.normalize(e(m)),0,xt));u=-u-Math.max(0,y(i)-l)/(p*l)}else h(kt,c.eye,c.center),w(s,re,kt),u=-y(re)/l;return v(s,s),b(s,s,y(ie)),u}const kt=I();function Ut(r,a,i,s){let c,l;const m=Math.cos(n(t.normalize(e(s)),0,xt));return c=a>i?-(a-i)/(m*i):a<-i?Math.PI-(a+i)/(m*i):o(a/i),l=r>i?-(r-i)/(m*i):r<-i?Math.PI-(r+i)/(m*i):o(r/i),(l-c)*i}function Ht(t,e,n,o,r,a,i,s,c,l){const m=Ut(t[2],e[2],a[3],s),u=c?Ut(t[0],e[0],a[3],180):e[0]-t[0],p=Math.sin(i)*u-Math.cos(i)*m,h=Math.cos(i)*u+Math.sin(i)*m;v(oe,r);const M=c?p/Math.sqrt(Math.abs(a[3]**2-j(n,oe)**2)):p/a[3],g=h/Math.sqrt(Math.abs(a[3]**2-j(n,o)**2));f(l,M,g)}function Gt(t,e,n,o,r,a,i,s,c,l){w(ie,t,e),U(a.up,a.eye,Lt,Nt,Qt),U([0,0,1],a.eye,Dt,Jt,Kt),P(n,Jt),P(o,Dt),v(n,n),b(n,n,y(ie)),H(t,v(Nt,Nt),v(Qt,Qt),v(Lt,Lt),Xt),H(e,Nt,Qt,Lt,Yt),Ht(Xt,Yt,t,Dt,Jt,i,s,c,l,r)}function Rt(t,e,n,o,r,a,s){i(_t,r,o),i(te,s,a),c(ee,_t,te),h(e,t,n),M(e,e,ee),g(e,e,n)}function qt(t,e,n,o,r,a){i(_t,o,n),i(te,a,r),c(ee,_t,te),h(oe,t.eye,e),M(oe,oe,ee),t.eye=g(oe,oe,e),h(oe,t.center,e),M(oe,oe,ee),t.center=g(oe,oe,e),h(oe,t.up,e),M(oe,oe,ee),t.up=g(oe,oe,e)}function Ct(t,e,n,o,r,a){return(Math.abs(o)>Math.PI-dt.Angle||Math.abs(o)<dt.Angle)&&(Math.abs(t[2])<n*dt.Pole||Math.abs(e)>n)&&a.aboveGround&&r<dt.Tilt}function Ft(t,e,n,o,r,a){if(a)E(n,o,$t),ct(e,V(t),$t);else{const a=Et(n,o,se,e,t[3],r);ct(e,V(t),k(se,a))}}function Vt(t,e,n,o,r,a,i){const s=i?20:1,c=1e-12;let l,m;P(ne,o),ae.copyFrom(e);for(let u=0;u<s&&z(n,ne)>c&&(l=z(n,ne),Gt(n,ne,Jt,Dt,Zt,ae,t,r,a,i),qt(ae,V(t),Dt,Zt[1],Jt,Zt[0]),Rt(ne,ne,V(t),Dt,Zt[1],Jt,Zt[0]),m=z(n,ne),m<l||0===u);u++)e.copyFrom(ae)}function Tt(n,o,r,a,i,s,c){Ct(r,j(o.up,r),n[3],-t.normalize(e(i)),s,o)?Vt(n,o,r,a,-t.normalize(e(i)),s,c):Ft(n,o,r,a,s,c)}function Ot(t,e,n,o,r,a){const{eye:i}=t;U([0,0,1],i,Dt,Jt,Kt);const s=e.translation[0]*n.pan,c="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-j(t.center,Dt)**2/y(t.center)**2)),.5),u=(Math.sin(a)*c+Math.cos(a)*s)/m,f=-Math.cos(a)*c+Math.sin(a)*s;switch(l(o.pan.matrix,o.pan.matrix,u,Dt),o.pan.enabled=!0,r.mode){case"pan":l(o.pan.matrix,o.pan.matrix,f,Jt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Wt(t,e,n,o,r){const{eye:a,viewRight:i}=t,s=w(W.get(),i,a),c=e.translation[0]*n.pan;switch(0!==c&&(l(o.pan.matrix,o.pan.matrix,-c,s),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(l(o.pan.matrix,o.pan.matrix,t,i),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Bt(n,o,r,a,i,s,c,l,m){Ct(n.center,j(n.up,n.center),y(n.center),-t.normalize(e(s)),c,o)?Ot(o,r,a,l,m,-t.normalize(e(i))):Wt(o,r,a,l,m)}const Dt=I(),Jt=I(),Kt=I(),Lt=I(),Nt=I(),Qt=I(),Xt=I(),Yt=I(),Zt=p(),$t=S(),_t=u(),te=u(),ee=u(),ne=I(),oe=I(),re=I(),ae=new K,ie=I(),se=I(),ce={origin:I(),direction:I()},le={origin:I(),direction:I()};export{yt as NavigationMode,dt as PreservingHeadingThreshold,N as SpherePickPointFallback,xt as TiltThresholdPanningSpeed,bt as VerticalPanTresholds,zt as applyPanPlanar,Ft as applyPanSphericalDirectRotation,Vt as applyPanSphericalPreserveHeading,ct as applyRotation,qt as applyRotationWithTwoAxes,ft as applyZoomOnSphere,ut as applyZoomToPoint,ht as centroid,at as contentIntersectorOptions,X as distanceClampValues,lt as intersectPlaneFromScreenPoint,mt as intersectPlaneFromScreenPointAtEye,Ut as lengthFromPoints,et as minHeightLimit,vt as navigationMode,it as normalizeCoordinate,st as normalizeRotationDelta,gt as offSurfaceTiltToEyeTiltGlobal,Mt as onSurfaceTiltToEyeTiltGlobal,tt as panDistanceModifier,Bt as panMotionToRotationMatrix,Tt as panToPosition,jt as pickPointAndInitSphere,Q as pivotDistanceModifier,Ct as preserveHeadingThreshold,nt as rotatePivotDistanceModifier,ot as rotatePivotMinDistanceModifier,Rt as rotatePointAroundTwoAxes,rt as rotateScreenPixelArea,Et as rotationAngleAndAxisDirectRotation,Gt as rotationAnglesAndAxesHeadingPreserving,Ht as rotationAnglesHeadingPreserving,Y as screenPixelArea,wt as sphereOrPlanePointFromScreenPoint,Z as zoomDistanceModifier,_ as zoomMaxDistanceModifier,$ as zoomMinDistanceModifier};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{acosClamped as o}from"../../../../core/mathUtils.js";import{f as r,l as t,m as s}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";function c(i,c,f){i.worldUpAtPosition(c,m),r(e,f,c);const n=t(e);return 0===n?0:o(s(e,m)/n)}const m=i(),e=i();export{c as viewAngle};
5
+ import{acosClamped as o}from"../../../../core/mathUtils.js";import{f as r,m as t,l as s}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";function c(i,c,f){i.worldUpAtPosition(c,m),r(e,f,c);const n=t(e);return 0===n?0:o(s(e,m)/n)}const m=i(),e=i();export{c as viewAngle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as t}from"../../../core/compilerUtils.js";import{lerp as e}from"../../../core/mathUtils.js";import{invert as i}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as n,j as o,E as s,h as a,s as c,m as l}from"../../../chunks/vec32.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as d}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as m}from"../../../geometry/projection/projectBoundingRect.js";import{projectVectorToVector as _}from"../../../geometry/projection/projectVectorToVector.js";import{create as g,empty as f,expandWithVec3 as u}from"../../../geometry/support/aaBoundingBox.js";import{create as x,center as R}from"../../../geometry/support/aaBoundingRect.js";import{PlaneIndex as y}from"../../../geometry/support/frustum.js";import{create as j,fromPoints as b}from"../../../geometry/support/lineSegment.js";import{create as A,fromVectorsAndPoint as E,copy as S,negate as B,signedDistance as C}from"../../../geometry/support/plane.js";import{wrap as H}from"../../../geometry/support/ray.js";import{ViewingMode as w}from"../../ViewingMode.js";import{frustumLineSegment as G}from"./intersectionUtils.js";const M=.5*Math.PI,F=M/Math.PI*180;class N{constructor(t){this._renderCoordsHelper=t.renderCoordsHelper,this._extent=new Array(4),this._planes=new Array(6),this._maxSpan=0,this._center={origin:p(),direction:p()};for(let e=0;e<4;e++)this._extent[e]={origin:p(),direction:p(),cap:{next:null,direction:p()}},this._planes[e]=A();this._planes[y.NEAR]=A(),this._planes[y.FAR]=A(),this._planesWithoutFar=this._planes.slice(0,5)}update(t,e,i,r=!0){const a=this._extent;this._toRenderBoundingExtent(t,e,i),n(this._center.origin,a[0].origin,a[2].origin),o(this._center.origin,this._center.origin,.5),this._renderCoordsHelper.worldUpAtPosition(this._center.origin,this._center.direction),r||o(this._center.direction,this._center.direction,-1);for(let n=0;n<4;n++){const t=a[n];this._renderCoordsHelper.worldUpAtPosition(t.origin,t.direction);const e=a[3===n?0:n+1];t.cap.next=e.origin,s(t.cap.direction,t.origin,e.origin),E(t.direction,t.cap.direction,t.origin,this._planes[n]),r||o(t.direction,t.direction,-1)}E(a[0].cap.direction,a[1].cap.direction,a[0].origin,this._planes[y.NEAR]),r?B(this._planes[y.NEAR],this._planes[y.FAR]):(S(this._planes[y.FAR],this._planes[y.NEAR]),B(this._planes[y.NEAR],this._planes[y.NEAR])),this._maxSpan=Math.max(Math.abs(t[0]-t[2]),Math.abs(t[1]-t[3])),this._maxSpanSpatialReference=e,this._minGlobalAltitude=.9*h(this._maxSpanSpatialReference).radius}isVisibleInFrustum(t,e,i=!1){if(null==t)return!1;if(this._renderCoordsHelper.viewingMode===w.Global){const i=this._maxSpanSpatialReference.isGeographic?F:M*e;if(this._maxSpan>i)return!0;if(null!=t.altitude&&t.altitude>=this._minGlobalAltitude)return this._isVisibleInFrustumGlobal(t)}if(0===this._maxSpan){const e=this._extent[0];return!(i||!t.intersectsRay(H(e.origin,e.direction)))}for(let n=0;n<this._extent.length;n++){const e=this._extent[n];if(!i&&t.intersectsRay(H(e.origin,e.direction)))return!0;if(t.intersectsLineSegment(b(e.origin,e.cap.next,k),e.cap.direction))return!0}const r=i?this._planes:this._planesWithoutFar;for(let n=0;n<t.lines.length;n++){const e=t.lines[n];if(G(r,e.origin,e.endpoint,e.direction))return!0}return!1}_toRenderBoundingExtentGlobal(t,r,n){const o=5;R(t,V),V[2]=n,d(r,V,v,this._renderCoordsHelper.spatialReference),i(I,v),f(L);for(const{x0:i,x1:s,y0:c,y1:l}of U)for(let p=0;p<o;p++){const h=p/(o-1);V[0]=e(t[i],t[s],h),V[1]=e(t[c],t[l],h),V[2]=n,_(V,r,V,this._renderCoordsHelper.spatialReference),a(V,V,I),u(L,V)}c(this._extent[0].origin,L[0],L[1],L[2]),c(this._extent[1].origin,L[3],L[1],L[2]),c(this._extent[2].origin,L[3],L[4],L[2]),c(this._extent[3].origin,L[0],L[4],L[2]);for(let e=0;e<4;++e)a(this._extent[e].origin,this._extent[e].origin,v)}_toRenderBoundingExtentLocal(t,e,i){m(t,e,P,this._renderCoordsHelper.spatialReference),c(this._extent[0].origin,P[0],P[1],i),c(this._extent[1].origin,P[2],P[1],i),c(this._extent[2].origin,P[2],P[3],i),c(this._extent[3].origin,P[0],P[3],i)}_toRenderBoundingExtent(e,i,r){switch(this._renderCoordsHelper.viewingMode){case w.Global:this._toRenderBoundingExtentGlobal(e,i,r);break;case w.Local:this._toRenderBoundingExtentLocal(e,i,r);break;default:t(this._renderCoordsHelper.viewingMode)}}_isVisibleInFrustumGlobal(t){if(C(t.planes[y.NEAR],this._center.origin)<0&&l(this._center.direction,t.direction)<0)return!0;for(let e=0;e<4;e++){const i=this._extent[e];if(C(t.planes[y.NEAR],i.origin)<0&&l(i.direction,t.direction)<0)return!0}return!1}}const U=[{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}],V=p(),v=r(),I=r(),L=g(),P=x(),k=j();export{N as FrustumExtentIntersection};
5
+ import{neverReached as t}from"../../../core/compilerUtils.js";import{lerp as e}from"../../../core/mathUtils.js";import{invert as i}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as n,j as o,E as s,h as a,a as c,l}from"../../../chunks/vec32.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as d}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as m}from"../../../geometry/projection/projectBoundingRect.js";import{projectVectorToVector as _}from"../../../geometry/projection/projectVectorToVector.js";import{create as g,empty as f,expandWithVec3 as u}from"../../../geometry/support/aaBoundingBox.js";import{create as x,center as R}from"../../../geometry/support/aaBoundingRect.js";import{PlaneIndex as y}from"../../../geometry/support/frustum.js";import{create as j,fromPoints as b}from"../../../geometry/support/lineSegment.js";import{create as A,fromVectorsAndPoint as E,copy as S,negate as B,signedDistance as C}from"../../../geometry/support/plane.js";import{wrap as H}from"../../../geometry/support/ray.js";import{ViewingMode as w}from"../../ViewingMode.js";import{frustumLineSegment as G}from"./intersectionUtils.js";const M=.5*Math.PI,F=M/Math.PI*180;class N{constructor(t){this._renderCoordsHelper=t.renderCoordsHelper,this._extent=new Array(4),this._planes=new Array(6),this._maxSpan=0,this._center={origin:p(),direction:p()};for(let e=0;e<4;e++)this._extent[e]={origin:p(),direction:p(),cap:{next:null,direction:p()}},this._planes[e]=A();this._planes[y.NEAR]=A(),this._planes[y.FAR]=A(),this._planesWithoutFar=this._planes.slice(0,5)}update(t,e,i,r=!0){const a=this._extent;this._toRenderBoundingExtent(t,e,i),n(this._center.origin,a[0].origin,a[2].origin),o(this._center.origin,this._center.origin,.5),this._renderCoordsHelper.worldUpAtPosition(this._center.origin,this._center.direction),r||o(this._center.direction,this._center.direction,-1);for(let n=0;n<4;n++){const t=a[n];this._renderCoordsHelper.worldUpAtPosition(t.origin,t.direction);const e=a[3===n?0:n+1];t.cap.next=e.origin,s(t.cap.direction,t.origin,e.origin),E(t.direction,t.cap.direction,t.origin,this._planes[n]),r||o(t.direction,t.direction,-1)}E(a[0].cap.direction,a[1].cap.direction,a[0].origin,this._planes[y.NEAR]),r?B(this._planes[y.NEAR],this._planes[y.FAR]):(S(this._planes[y.FAR],this._planes[y.NEAR]),B(this._planes[y.NEAR],this._planes[y.NEAR])),this._maxSpan=Math.max(Math.abs(t[0]-t[2]),Math.abs(t[1]-t[3])),this._maxSpanSpatialReference=e,this._minGlobalAltitude=.9*h(this._maxSpanSpatialReference).radius}isVisibleInFrustum(t,e,i=!1){if(null==t)return!1;if(this._renderCoordsHelper.viewingMode===w.Global){const i=this._maxSpanSpatialReference.isGeographic?F:M*e;if(this._maxSpan>i)return!0;if(null!=t.altitude&&t.altitude>=this._minGlobalAltitude)return this._isVisibleInFrustumGlobal(t)}if(0===this._maxSpan){const e=this._extent[0];return!(i||!t.intersectsRay(H(e.origin,e.direction)))}for(let n=0;n<this._extent.length;n++){const e=this._extent[n];if(!i&&t.intersectsRay(H(e.origin,e.direction)))return!0;if(t.intersectsLineSegment(b(e.origin,e.cap.next,k),e.cap.direction))return!0}const r=i?this._planes:this._planesWithoutFar;for(let n=0;n<t.lines.length;n++){const e=t.lines[n];if(G(r,e.origin,e.endpoint,e.direction))return!0}return!1}_toRenderBoundingExtentGlobal(t,r,n){const o=5;R(t,V),V[2]=n,d(r,V,v,this._renderCoordsHelper.spatialReference),i(I,v),f(L);for(const{x0:i,x1:s,y0:c,y1:l}of U)for(let p=0;p<o;p++){const h=p/(o-1);V[0]=e(t[i],t[s],h),V[1]=e(t[c],t[l],h),V[2]=n,_(V,r,V,this._renderCoordsHelper.spatialReference),a(V,V,I),u(L,V)}c(this._extent[0].origin,L[0],L[1],L[2]),c(this._extent[1].origin,L[3],L[1],L[2]),c(this._extent[2].origin,L[3],L[4],L[2]),c(this._extent[3].origin,L[0],L[4],L[2]);for(let e=0;e<4;++e)a(this._extent[e].origin,this._extent[e].origin,v)}_toRenderBoundingExtentLocal(t,e,i){m(t,e,P,this._renderCoordsHelper.spatialReference),c(this._extent[0].origin,P[0],P[1],i),c(this._extent[1].origin,P[2],P[1],i),c(this._extent[2].origin,P[2],P[3],i),c(this._extent[3].origin,P[0],P[3],i)}_toRenderBoundingExtent(e,i,r){switch(this._renderCoordsHelper.viewingMode){case w.Global:this._toRenderBoundingExtentGlobal(e,i,r);break;case w.Local:this._toRenderBoundingExtentLocal(e,i,r);break;default:t(this._renderCoordsHelper.viewingMode)}}_isVisibleInFrustumGlobal(t){if(C(t.planes[y.NEAR],this._center.origin)<0&&l(this._center.direction,t.direction)<0)return!0;for(let e=0;e<4;e++){const i=this._extent[e];if(C(t.planes[y.NEAR],i.origin)<0&&l(i.direction,t.direction)<0)return!0}return!1}}const U=[{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}],V=p(),v=r(),I=r(),L=g(),P=x(),k=j();export{N as FrustumExtentIntersection};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{rad2deg as t,acosClamped as o}from"../../../core/mathUtils.js";import{n as s,m as r,c as n,j as e,f as i,l as a,b as c}from"../../../chunks/vec32.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrap as f}from"../../../geometry/support/lineSegment.js";import{intersectLineSegment as l}from"../../../geometry/support/plane.js";const p=m(),u=m();function g(){return{direction:m(),up:m()}}function h(m,f,l,g,h){let j=s(p,m),b=r(j,g);const d=b>0;b=Math.abs(b),b>.99&&(b=Math.abs(r(f,g)),b<.99?(n(j,f),d&&e(j,j,-1)):j=null);let v=0;if(j){e(u,g,r(g,j)),i(j,j,u);const s=r(j,h)/(a(j)*a(h));c(u,j,h);v=(r(u,g)>0?1:-1)*t(o(s))}const x=t(o(-r(g,m)/a(m)));return l?(l.heading=v,l.tilt=x,l):{heading:v,tilt:x}}function j(t,o,s,r){i(b,s,o),l(r,f(o,b),t)||t===s||n(t,s)}const b=m();export{j as clampLineSegmentToPlane,g as createDirectionUp,h as directionToHeadingTilt};
5
+ import{rad2deg as t,acosClamped as o}from"../../../core/mathUtils.js";import{n as s,l as r,c as n,j as e,f as i,m as a,b as c}from"../../../chunks/vec32.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrap as f}from"../../../geometry/support/lineSegment.js";import{intersectLineSegment as l}from"../../../geometry/support/plane.js";const p=m(),u=m();function g(){return{direction:m(),up:m()}}function h(m,f,l,g,h){let j=s(p,m),b=r(j,g);const d=b>0;b=Math.abs(b),b>.99&&(b=Math.abs(r(f,g)),b<.99?(n(j,f),d&&e(j,j,-1)):j=null);let v=0;if(j){e(u,g,r(g,j)),i(j,j,u);const s=r(j,h)/(a(j)*a(h));c(u,j,h);v=(r(u,g)>0?1:-1)*t(o(s))}const x=t(o(-r(g,m)/a(m)));return l?(l.heading=v,l.tilt=x,l):{heading:v,tilt:x}}function j(t,o,s,r){i(b,s,o),l(r,f(o,b),t)||t===s||n(t,s)}const b=m();export{j as clampLineSegmentToPlane,g as createDirectionUp,h as directionToHeadingTilt};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{screenPointObjectToArray as r,castRenderScreenPointArray3 as e}from"../../../../core/screenUtils.js";import{copy as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{n as t,f as o,c,s as i}from"../../../../chunks/vec32.js";import{create as s}from"../../../../geometry/support/ray.js";import{sv3d as u}from"../../../../geometry/support/vectorStacks.js";function m(e,n,o=s()){return g(e,r(n),o),t(o.direction,o.direction),o}function g(r,n,t){return l(r,r.screenToRender(n,e(u.get())),t)}function l(r,t,c){const i=e(n(u.get(),t));if(i[2]=0,!r.unprojectFromRenderScreen(i,c.origin))return null;const s=e(n(u.get(),t));s[2]=1;const m=r.unprojectFromRenderScreen(s,u.get());return null==m?null:(o(c.direction,m,c.origin),c)}function p(r,n,t){return f(r,r.screenToRender(n,e(u.get())),t)}function f(r,e,n){c(n.origin,r.eye);const t=i(u.get(),e[0],e[1],1),s=r.unprojectFromRenderScreen(t,u.get());return null==s?null:(o(n.direction,s,n.origin),n)}export{l as fromRender,f as fromRenderAtEye,g as fromScreen,p as fromScreenAtEye,m as fromScreenNormalized};
5
+ import{screenPointObjectToArray as r,castRenderScreenPointArray3 as e}from"../../../../core/screenUtils.js";import{copy as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{n as t,f as o,c,a as i}from"../../../../chunks/vec32.js";import{create as s}from"../../../../geometry/support/ray.js";import{sv3d as u}from"../../../../geometry/support/vectorStacks.js";function m(e,n,o=s()){return g(e,r(n),o),t(o.direction,o.direction),o}function g(r,n,t){return l(r,r.screenToRender(n,e(u.get())),t)}function l(r,t,c){const i=e(n(u.get(),t));if(i[2]=0,!r.unprojectFromRenderScreen(i,c.origin))return null;const s=e(n(u.get(),t));s[2]=1;const m=r.unprojectFromRenderScreen(s,u.get());return null==m?null:(o(c.direction,m,c.origin),c)}function p(r,n,t){return f(r,r.screenToRender(n,e(u.get())),t)}function f(r,e,n){c(n.origin,r.eye);const t=i(u.get(),e[0],e[1],1),s=r.unprojectFromRenderScreen(t,u.get());return null==s?null:(o(n.direction,s,n.origin),n)}export{l as fromRender,f as fromRenderAtEye,g as fromScreen,p as fromScreenAtEye,m as fromScreenNormalized};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{m as n,f as t,g as i,j as e,p as c,c as o,n as u}from"../../../chunks/vec32.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{signedDistance as l,getNormal as s}from"../../../geometry/support/plane.js";function p(r,n,t){return r[0]*n[0]+r[1]*n[1]+r[2]*n[2]+r[3]<t}function a(r,n,t){const i=n[0],e=n[1],c=n[2];return!(r[0][0]*i+r[0][1]*e+r[0][2]*c+r[0][3]>t)&&(!(r[1][0]*i+r[1][1]*e+r[1][2]*c+r[1][3]>t)&&(!(r[2][0]*i+r[2][1]*e+r[2][2]*c+r[2][3]>t)&&(!(r[3][0]*i+r[3][1]*e+r[3][2]*c+r[3][3]>t)&&(!(r[4][0]*i+r[4][1]*e+r[4][2]*c+r[4][3]>t)&&!(r[5][0]*i+r[5][1]*e+r[5][2]*c+r[5][3]>t)))))}function m(r,n,t,i){return h(r,n,null,v(i,n,t,!1))}function d(r,n){for(let t=0;t<6;t++){if(l(r[t],n)>0)return!1}return!0}function g(r,n,t,i){return h(r,n,t,v(i,n,t,!0))}function j(r,c,o,u){const f=n(o,t(r,u,c));return i(r,c,e(r,o,f))}const b={dir:f(),len:0,clip:r()};function v(r,n,i,f){const l=b;return r?(i&&f&&(l.len=c(n,i)),o(l.dir,r)):f?(l.len=c(n,i),t(l.dir,i,n),e(l.dir,l.dir,1/l.len)):(t(l.dir,i,n),u(l.dir,l.dir)),l}function x(r,t,i){const e=n(s(r),i.dir),c=-l(r,t);if(c<0&&e>=0)return!1;if(e>-1e-6&&e<1e-6)return c>0;if((c<0||e<0)&&!(c<0&&e<0))return!0;const o=c/e;return e>0?o<i.clip[1]&&(i.clip[1]=o):o>i.clip[0]&&(i.clip[0]=o),i.clip[0]<=i.clip[1]}function h(r,n,t,i){i.clip[0]=0,i.clip[1]=t?i.len:Number.MAX_VALUE;for(let e=0;e<r.length;e++)if(!x(r[e],n,i))return!1;return!0}export{j as closestPointOnRay,g as frustumLineSegment,d as frustumPoint,m as frustumRay,a as frustumSphere,p as planeSphere};
5
+ import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{l as n,f as t,g as i,j as e,p as c,c as o,n as u}from"../../../chunks/vec32.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{signedDistance as l,getNormal as s}from"../../../geometry/support/plane.js";function p(r,n,t){return r[0]*n[0]+r[1]*n[1]+r[2]*n[2]+r[3]<t}function a(r,n,t){const i=n[0],e=n[1],c=n[2];return!(r[0][0]*i+r[0][1]*e+r[0][2]*c+r[0][3]>t)&&(!(r[1][0]*i+r[1][1]*e+r[1][2]*c+r[1][3]>t)&&(!(r[2][0]*i+r[2][1]*e+r[2][2]*c+r[2][3]>t)&&(!(r[3][0]*i+r[3][1]*e+r[3][2]*c+r[3][3]>t)&&(!(r[4][0]*i+r[4][1]*e+r[4][2]*c+r[4][3]>t)&&!(r[5][0]*i+r[5][1]*e+r[5][2]*c+r[5][3]>t)))))}function m(r,n,t,i){return h(r,n,null,v(i,n,t,!1))}function d(r,n){for(let t=0;t<6;t++){if(l(r[t],n)>0)return!1}return!0}function g(r,n,t,i){return h(r,n,t,v(i,n,t,!0))}function j(r,c,o,u){const f=n(o,t(r,u,c));return i(r,c,e(r,o,f))}const b={dir:f(),len:0,clip:r()};function v(r,n,i,f){const l=b;return r?(i&&f&&(l.len=c(n,i)),o(l.dir,r)):f?(l.len=c(n,i),t(l.dir,i,n),e(l.dir,l.dir,1/l.len)):(t(l.dir,i,n),u(l.dir,l.dir)),l}function x(r,t,i){const e=n(s(r),i.dir),c=-l(r,t);if(c<0&&e>=0)return!1;if(e>-1e-6&&e<1e-6)return c>0;if((c<0||e<0)&&!(c<0&&e<0))return!0;const o=c/e;return e>0?o<i.clip[1]&&(i.clip[1]=o):o>i.clip[0]&&(i.clip[0]=o),i.clip[0]<=i.clip[1]}function h(r,n,t,i){i.clip[0]=0,i.clip[1]=t?i.len:Number.MAX_VALUE;for(let e=0;e<r.length;e++)if(!x(r[e],n,i))return!1;return!0}export{j as closestPointOnRay,g as frustumLineSegment,d as frustumPoint,m as frustumRay,a as frustumSphere,p as planeSphere};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{acosClamped as t}from"../../../core/mathUtils.js";import{s as n,m as s,n as o,b as r,l as a,j as c,g as i,o as u,f}from"../../../chunks/vec32.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";function e(t,n){return t>n?Math.cos(n):Math.cos(t)}function M(t,n,s){return 2*Math.atan(s*Math.tan(.5*t)/n)}function l(t,n,s){return 2*Math.atan(n*Math.tan(.5*t)/s)}function m(t){const n=t[0]*t[0]+t[4]*t[4]+t[8]*t[8],s=t[1]*t[1]+t[5]*t[5]+t[9]*t[9],o=t[2]*t[2]+t[6]*t[6]+t[10]*t[10];return Math.sqrt(Math.max(n,s,o))}function g(t,s){const o=Math.sqrt(s[0]*s[0]+s[4]*s[4]+s[8]*s[8]),r=Math.sqrt(s[1]*s[1]+s[5]*s[5]+s[9]*s[9]),a=Math.sqrt(s[2]*s[2]+s[6]*s[6]+s[10]*s[10]);return n(t,o,r,a),t}function b(t,r,a){a=a||t;const c=s(t,r);n(a,t[0]-c*r[0],t[1]-c*r[1],t[2]-c*r[2]),o(a,a)}function j(t,s,a){Math.abs(t[0])>Math.abs(t[1])?n(s,0,1,0):n(s,1,0,0),r(a,t,s),r(s,a,t),o(a,a),o(s,s)}function p(t,n,s,o,r,a){const c=t+(n-t)*r;return c+(s+(o-s)*r-c)*a}function q(t,n,o,r=h()){const f=a(t),e=a(n),M=s(t,n)/(f*e);if(M<.9999999999999999){const s=Math.acos(M),a=((1-o)*f+o*e)/Math.sin(s),u=a/f*Math.sin((1-o)*s),h=a/e*Math.sin(o*s);return c(A,t,u),c(B,n,h),i(r,A,B)}return u(r,t,n,o)}function x(t,n,r,e=h(),M=h()){const l=a(t),m=a(n),g=s(t,n)/(l*m);if(g<.9999999999999999){const s=Math.acos(g),o=Math.sin(s),a=Math.sin(r*s),u=Math.sin((1-r)*s),f=(1-r)*l+r*m;{const s=f/o,r=s/m*a;c(A,t,s/l*u),c(B,n,r),i(e,A,B)}{const h=1/l*(-Math.cos((1-r)*s)*s*f+u*(-l+m));c(A,t,h);const e=1/m*(Math.cos(r*s)*s*f+a*(-l+m));c(B,n,e),i(M,A,B),c(M,M,1/o)}return M}return u(e,t,n,r),f(M,n,t),o(M,M),M}function v(n,a,c){n=o(A,n),a=o(B,a);const i=t(s(n,a));if(c){const t=r(z,n,a);if(s(t,c)<0)return-i}return i}function k(t){const n=t.length;return s=>{if(s<=t[0][0])return t[0][1];if(s>=t[n-1][0])return t[n-1][1];let o=1;for(;s>t[o][0];)o++;const r=t[o-1][0],a=t[o][0],c=(a-s)/(a-r);return c*t[o-1][1]+(1-c)*t[o][1]}}function U(t,n,a,c){f(w,n,t),f(y,a,t),r(c,w,y),o(c,c),c[3]=-s(t,c)}function d(t,s){if(n(s,0,0,0),t.length>0){for(let n=0;n<t.length;++n)i(s,s,t[n]);c(s,s,1/t.length)}}const w=h(),y=h(),z=h(),A=h(),B=h();export{v as angle,p as bilerp,e as cosCapped,M as fovx2fovy,l as fovy2fovx,b as makeOrthonormal,k as makePiecewiseLinearFunction,m as maxScale,d as midpoint3d,U as planeFromPoints,g as scaleFromMatrix,q as slerp,x as slerpTangent,j as tangentFrame};
5
+ import{acosClamped as t}from"../../../core/mathUtils.js";import{a as n,l as s,n as o,b as r,m as a,j as c,g as i,o as u,f}from"../../../chunks/vec32.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";function e(t,n){return t>n?Math.cos(n):Math.cos(t)}function M(t,n,s){return 2*Math.atan(s*Math.tan(.5*t)/n)}function l(t,n,s){return 2*Math.atan(n*Math.tan(.5*t)/s)}function m(t){const n=t[0]*t[0]+t[4]*t[4]+t[8]*t[8],s=t[1]*t[1]+t[5]*t[5]+t[9]*t[9],o=t[2]*t[2]+t[6]*t[6]+t[10]*t[10];return Math.sqrt(Math.max(n,s,o))}function g(t,s){const o=Math.sqrt(s[0]*s[0]+s[4]*s[4]+s[8]*s[8]),r=Math.sqrt(s[1]*s[1]+s[5]*s[5]+s[9]*s[9]),a=Math.sqrt(s[2]*s[2]+s[6]*s[6]+s[10]*s[10]);return n(t,o,r,a),t}function b(t,r,a){a=a||t;const c=s(t,r);n(a,t[0]-c*r[0],t[1]-c*r[1],t[2]-c*r[2]),o(a,a)}function j(t,s,a){Math.abs(t[0])>Math.abs(t[1])?n(s,0,1,0):n(s,1,0,0),r(a,t,s),r(s,a,t),o(a,a),o(s,s)}function p(t,n,s,o,r,a){const c=t+(n-t)*r;return c+(s+(o-s)*r-c)*a}function q(t,n,o,r=h()){const f=a(t),e=a(n),M=s(t,n)/(f*e);if(M<.9999999999999999){const s=Math.acos(M),a=((1-o)*f+o*e)/Math.sin(s),u=a/f*Math.sin((1-o)*s),h=a/e*Math.sin(o*s);return c(A,t,u),c(B,n,h),i(r,A,B)}return u(r,t,n,o)}function x(t,n,r,e=h(),M=h()){const l=a(t),m=a(n),g=s(t,n)/(l*m);if(g<.9999999999999999){const s=Math.acos(g),o=Math.sin(s),a=Math.sin(r*s),u=Math.sin((1-r)*s),f=(1-r)*l+r*m;{const s=f/o,r=s/m*a;c(A,t,s/l*u),c(B,n,r),i(e,A,B)}{const h=1/l*(-Math.cos((1-r)*s)*s*f+u*(-l+m));c(A,t,h);const e=1/m*(Math.cos(r*s)*s*f+a*(-l+m));c(B,n,e),i(M,A,B),c(M,M,1/o)}return M}return u(e,t,n,r),f(M,n,t),o(M,M),M}function v(n,a,c){n=o(A,n),a=o(B,a);const i=t(s(n,a));if(c){const t=r(z,n,a);if(s(t,c)<0)return-i}return i}function k(t){const n=t.length;return s=>{if(s<=t[0][0])return t[0][1];if(s>=t[n-1][0])return t[n-1][1];let o=1;for(;s>t[o][0];)o++;const r=t[o-1][0],a=t[o][0],c=(a-s)/(a-r);return c*t[o-1][1]+(1-c)*t[o][1]}}function U(t,n,a,c){f(w,n,t),f(y,a,t),r(c,w,y),o(c,c),c[3]=-s(t,c)}function d(t,s){if(n(s,0,0,0),t.length>0){for(let n=0;n<t.length;++n)i(s,s,t[n]);c(s,s,1/t.length)}}const w=h(),y=h(),z=h(),A=h(),B=h();export{v as angle,p as bilerp,e as cosCapped,M as fovx2fovy,l as fovy2fovx,b as makeOrthonormal,k as makePiecewiseLinearFunction,m as maxScale,d as midpoint3d,U as planeFromPoints,g as scaleFromMatrix,q as slerp,x as slerpTangent,j as tangentFrame};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{fromQuat as t,scale as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as i,conjugate as r,multiply as n}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as o,create as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{s as c,u as d,v as _,w as l,x as m,t as f,g as u,y as g,z as p,l as M,j as b,r as j,A as S,B as z,C as x}from"../../../chunks/vec32.js";import{ZEROS as C,create as y,UNIT_Z as q,fromValues as Q}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as v}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as P}from"../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as A}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as R}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as H}from"../../../geometry/projection/projectBuffer.js";import{getProjector as B}from"../../../geometry/projection/projectors.js";import{getNormal as W}from"../../../geometry/support/plane.js";import{isPlateCarree as k}from"../../../geometry/support/spatialReferenceUtils.js";import{sv3d as D,sq4d as G}from"../../../geometry/support/vectorStacks.js";import{ViewingMode as U}from"../../ViewingMode.js";import{computeOBB as Z}from"./dito.js";import{Vertices as F}from"../webgl-engine/lib/Attribute.js";class I{constructor(t=C,a=gt,e=o){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],e[0],e[1],e[2],e[3]]}clone(){const t=new I;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new I;return a._data=t.slice(),a}static fromJSON(t){return new I(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return c(D.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,e){this._data[0]=t,this._data[1]=a,this._data[2]=e}get halfSize(){return c(D.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return i(G.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=O,e=this._data;a[0]=e[6],a[1]=e[7],a[2]=e[8],a[3]=e[9];for(let s=0;s<8;++s){const i=t[s];i[0]=(1&s?-1:1)*e[3],i[1]=(2&s?-1:1)*e[4],i[2]=(4&s?-1:1)*e[5],d(i,i,a),i[0]+=e[0],i[1]+=e[1],i[2]+=e[2]}}doesIntersectFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],e=this._data[5];return Math.sqrt(t*t+a*a+e*e)}intersectSphere(t){X[0]=this._data[0]-t[0],X[1]=this._data[1]-t[1],X[2]=this._data[2]-t[2];const a=this.getQuaternion(T);return r(O,a),d(X,X,O),_(X,X),Y[0]=Math.min(X[0],this._data[3]),Y[1]=Math.min(X[1],this._data[4]),Y[2]=Math.min(X[2],this._data[5]),l(Y,X)<t[3]*t[3]}intersectSphereWithMBS(t,a=this.radius){const e=this._data;X[0]=e[0]-t[0],X[1]=e[1]-t[1],X[2]=e[2]-t[2];const s=t[3],i=s+a;return!(m(X)>i*i)&&(O[0]=-e[6],O[1]=-e[7],O[2]=-e[8],O[3]=e[9],d(X,X,O),_(X,X),Y[0]=Math.min(X[0],e[3]),Y[1]=Math.min(X[1],e[4]),Y[2]=Math.min(X[2],e[5]),l(Y,X)<s*s)}intersectPlane(t){const a=t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3],e=this.projectedRadius(W(t));return a>e?1:a<-e?-1:0}intersectRay(t,a,e=0){const s=this._data,i=O;i[0]=-s[6],i[1]=-s[7],i[2]=-s[8],i[3]=s[9],X[0]=t[0]-s[0],X[1]=t[1]-s[1],X[2]=t[2]-s[2];const r=d(X,X,O),n=d(Y,a,O);let o=-1/0,h=1/0;const c=this.getHalfSize(ct);for(let d=0;d<3;d++){const t=r[d],a=n[d],s=c[d]+e;if(Math.abs(a)>1e-6){const e=(s-t)/a,i=(-s-t)/a;o=Math.max(o,Math.min(e,i)),h=Math.min(h,Math.max(e,i))}else if(t>s||t<-s)return!1}return o<=h}projectedArea(e,s,i,n){const o=this.getQuaternion(T);r(O,o),X[0]=e[0]-this._data[0],X[1]=e[1]-this._data[1],X[2]=e[2]-this._data[2],d(X,X,O);const h=this.getHalfSize(ct),_=X[0]<-h[0]?-1:X[0]>h[0]?1:0,l=X[1]<-h[1]?-1:X[1]>h[1]?1:0,m=X[2]<-h[2]?-1:X[2]>h[2]?1:0,g=Math.abs(_)+Math.abs(l)+Math.abs(m);if(0===g)return 1/0;const p=1===g?4:6,M=6*(_+3*l+9*m+13);t(dt,o),a(dt,dt,h);const b=this.getCenter(ot);for(let t=0;t<p;t++){const a=K[M+t];c(X,((1&a)<<1)-1,(2&a)-1,((4&a)>>1)-1),f(X,X,dt),u(E,b,X),E[3]=1,v(E,E,s);const e=1/Math.max(1e-6,E[3]);N[2*t]=E[0]*e,N[2*t+1]=E[1]*e}const j=2*p-2;let S=N[0]*(N[3]-N[j+1])+N[j]*(N[1]-N[j-1]);for(let t=2;t<j;t+=2)S+=N[t]*(N[t+3]-N[t-1]);return Math.abs(S)*i*n*.125}projectedRadius(t){const a=this.getQuaternion(T);return r(O,a),d(X,t,O),Math.abs(X[0]*this._data[3])+Math.abs(X[1]*this._data[4])+Math.abs(X[2]*this._data[5])}minimumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]-this.projectedRadius(W(t))}maximumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]+this.projectedRadius(W(t))}toAaBoundingBox(a){const e=this.getQuaternion(T),s=t(dt,e),i=this._data[3]*Math.abs(s[0])+this._data[4]*Math.abs(s[3])+this._data[5]*Math.abs(s[6]),r=this._data[3]*Math.abs(s[1])+this._data[4]*Math.abs(s[4])+this._data[5]*Math.abs(s[7]),n=this._data[3]*Math.abs(s[2])+this._data[4]*Math.abs(s[5])+this._data[5]*Math.abs(s[8]);a[0]=this._data[0]-i,a[1]=this._data[1]-r,a[2]=this._data[2]-n,a[3]=this._data[0]+i,a[4]=this._data[1]+r,a[5]=this._data[2]+n}transform(t,a,e,s=0,i=A(e),r=A(a),n=B(a,r)){if(e===i)a.isGeographic?st(this,t,a,s,r):et(this,t,a,s,r,n);else if(a.isWGS84&&(e.isWebMercator||k(e)))$(a,this,e,t,s);else if(a.isWebMercator&&k(e))tt(a,this,e,t,s);else{const i=this.getCenter(ot);i[2]+=s,H(i,a,0,i,e,0,1),t.center=i,this!==t&&(t.quaternion=this.getQuaternion(T),t.halfSize=this.getHalfSize(ct))}}}const O=h(),T=h(),V=h(),X=y(),Y=y(),E=w();function J(t,a=new I){return Z(t,a),a}const N=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],K=(()=>{const t=new Int8Array(162);let a=0;const e=e=>{for(let s=0;s<e.length;s++)t[a+s]=e[s];a+=6};return e([6,2,3,1,5,4]),e([0,2,3,1,5,4]),e([0,2,3,7,5,4]),e([0,1,3,2,6,4]),e([0,1,3,2,0,0]),e([0,1,5,7,3,2]),e([0,1,3,7,6,4]),e([0,1,3,7,6,2]),e([0,1,5,7,6,2]),e([0,1,5,4,6,2]),e([0,1,5,4,0,0]),e([0,1,3,7,5,4]),e([0,2,6,4,0,0]),e([0,0,0,0,0,0]),e([1,3,7,5,0,0]),e([2,3,7,6,4,0]),e([2,3,7,6,0,0]),e([2,3,1,5,7,6]),e([0,1,5,7,6,2]),e([0,1,5,7,6,4]),e([0,1,3,7,6,4]),e([4,5,7,6,2,0]),e([4,5,7,6,0,0]),e([4,5,1,3,7,6]),e([0,2,3,7,5,4]),e([6,2,3,7,5,4]),e([6,2,3,1,5,4]),t})();function L(t,a,e,s,i){const n=t.getQuaternion(T);i.quaternion=n,r(O,n);const o=t.getCenter(ot),h=t.getHalfSize(ct);if(s===U.Global){d(mt,o,O),_(ft,mt),g(ut,ft,h),p(ut,ft,ut);const s=M(ut);u(ut,ft,h);const r=M(ut);if(s<e)i.center=o,c(mt,e,e,e),i.halfSize=u(mt,h,mt);else{const n=r>0?1+a/r:1,o=s>0?1+e/s:1,c=(o+n)/2,_=(o-n)/2;b(ut,ft,_),i.halfSize=j(ut,ut,h,c),b(ut,ft,c),j(ut,ut,h,_),S(mt,mt),z(mt,ut,mt);const l=t.getQuaternion(V);i.center=d(mt,mt,l)}}else{i.center=j(mt,o,q,(e+a)/2);const t=d(mt,q,O);_(t,t),i.halfSize=j(ft,h,t,(e-a)/2)}return i}function $(t,a,e,s,i){a.getCenter(ot),ot[2]+=i;const r=A(e);H(ot,t,0,ot,r,0,1),at(r,a,ot,e,s)}function tt(t,a,e,s,i){a.getCenter(ot),ot[2]+=i,at(t,a,ot,e,s)}function at(a,e,s,i,r){const n=e.getQuaternion(T),o=t(dt,n),h=e.getHalfSize(ct);for(let t=0;t<8;++t){for(let a=0;a<3;++a)nt[a]=h[a]*(t&1<<a?-1:1);for(let a=0;a<3;++a){let e=s[a];for(let t=0;t<3;++t)e+=nt[t]*o[3*t+a];it[3*t+a]=e}}H(it,a,0,it,i,0,8),J(rt,r)}function et(t,a,e,s,i=A(e),o=B(e,i)){t.getCorners(lt),t.getCenter(nt),nt[2]+=s,R(e,nt,_t,i),a.setCenter(_t[12],_t[13],_t[14]);const h=2*Math.sqrt(1+_t[0]+_t[5]+_t[10]);O[0]=(_t[6]-_t[9])/h,O[1]=(_t[8]-_t[2])/h,O[2]=(_t[1]-_t[4])/h,O[3]=.25*h;const l=t.getQuaternion(T);a.quaternion=n(O,O,l),r(O,O),c(ft,0,0,0);const m=a.getCenter(ht);for(const r of lt)r[2]+=s,o(r,0,r,0),p(mt,r,m),d(mt,mt,O),_(mt,mt),x(ft,ft,mt);a.halfSize=ft}function st(t,a,e,s,i=A(e)){const n=P(e),o=1+Math.max(0,s)/(n.radius+t.centerZ);t.getCenter(nt),nt[2]+=s,H(nt,e,0,nt,i,0,1),a.center=nt;const h=t.getQuaternion(T);a.quaternion=h,r(O,h),c(mt,0,0,1),d(mt,mt,O);const _=t.getHalfSize(ct);c(mt,_[0]*Math.abs(mt[0]),_[1]*Math.abs(mt[1]),_[2]*Math.abs(mt[2])),b(mt,mt,n.inverseFlattening),u(mt,_,mt),a.halfSize=b(mt,mt,o)}const it=new Array(24),rt=new F(it,3),nt=y(),ot=y(),ht=y(),ct=y(),dt=e(),_t=s(),lt=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],mt=y(),ft=y(),ut=y(),gt=Q(-1,-1,-1);export{I as Obb,J as compute,L as computeOffsetObb};
5
+ import{fromQuat as t,scale as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as i,conjugate as r,multiply as n}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as o,create as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{a as c,u as d,v as _,w as l,x as m,t as f,g as u,y as g,z as p,m as M,j as b,r as j,A as S,B as z,C as x}from"../../../chunks/vec32.js";import{ZEROS as C,create as y,UNIT_Z as q,fromValues as Q}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as v}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as P}from"../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as A}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as R}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as H}from"../../../geometry/projection/projectBuffer.js";import{getProjector as B}from"../../../geometry/projection/projectors.js";import{getNormal as W}from"../../../geometry/support/plane.js";import{isPlateCarree as k}from"../../../geometry/support/spatialReferenceUtils.js";import{sv3d as D,sq4d as G}from"../../../geometry/support/vectorStacks.js";import{ViewingMode as U}from"../../ViewingMode.js";import{computeOBB as Z}from"./dito.js";import{Vertices as F}from"../webgl-engine/lib/Attribute.js";class I{constructor(t=C,a=gt,e=o){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],e[0],e[1],e[2],e[3]]}clone(){const t=new I;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new I;return a._data=t.slice(),a}static fromJSON(t){return new I(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return c(D.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,e){this._data[0]=t,this._data[1]=a,this._data[2]=e}get halfSize(){return c(D.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return i(G.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=O,e=this._data;a[0]=e[6],a[1]=e[7],a[2]=e[8],a[3]=e[9];for(let s=0;s<8;++s){const i=t[s];i[0]=(1&s?-1:1)*e[3],i[1]=(2&s?-1:1)*e[4],i[2]=(4&s?-1:1)*e[5],d(i,i,a),i[0]+=e[0],i[1]+=e[1],i[2]+=e[2]}}doesIntersectFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],e=this._data[5];return Math.sqrt(t*t+a*a+e*e)}intersectSphere(t){X[0]=this._data[0]-t[0],X[1]=this._data[1]-t[1],X[2]=this._data[2]-t[2];const a=this.getQuaternion(T);return r(O,a),d(X,X,O),_(X,X),Y[0]=Math.min(X[0],this._data[3]),Y[1]=Math.min(X[1],this._data[4]),Y[2]=Math.min(X[2],this._data[5]),l(Y,X)<t[3]*t[3]}intersectSphereWithMBS(t,a=this.radius){const e=this._data;X[0]=e[0]-t[0],X[1]=e[1]-t[1],X[2]=e[2]-t[2];const s=t[3],i=s+a;return!(m(X)>i*i)&&(O[0]=-e[6],O[1]=-e[7],O[2]=-e[8],O[3]=e[9],d(X,X,O),_(X,X),Y[0]=Math.min(X[0],e[3]),Y[1]=Math.min(X[1],e[4]),Y[2]=Math.min(X[2],e[5]),l(Y,X)<s*s)}intersectPlane(t){const a=t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3],e=this.projectedRadius(W(t));return a>e?1:a<-e?-1:0}intersectRay(t,a,e=0){const s=this._data,i=O;i[0]=-s[6],i[1]=-s[7],i[2]=-s[8],i[3]=s[9],X[0]=t[0]-s[0],X[1]=t[1]-s[1],X[2]=t[2]-s[2];const r=d(X,X,O),n=d(Y,a,O);let o=-1/0,h=1/0;const c=this.getHalfSize(ct);for(let d=0;d<3;d++){const t=r[d],a=n[d],s=c[d]+e;if(Math.abs(a)>1e-6){const e=(s-t)/a,i=(-s-t)/a;o=Math.max(o,Math.min(e,i)),h=Math.min(h,Math.max(e,i))}else if(t>s||t<-s)return!1}return o<=h}projectedArea(e,s,i,n){const o=this.getQuaternion(T);r(O,o),X[0]=e[0]-this._data[0],X[1]=e[1]-this._data[1],X[2]=e[2]-this._data[2],d(X,X,O);const h=this.getHalfSize(ct),_=X[0]<-h[0]?-1:X[0]>h[0]?1:0,l=X[1]<-h[1]?-1:X[1]>h[1]?1:0,m=X[2]<-h[2]?-1:X[2]>h[2]?1:0,g=Math.abs(_)+Math.abs(l)+Math.abs(m);if(0===g)return 1/0;const p=1===g?4:6,M=6*(_+3*l+9*m+13);t(dt,o),a(dt,dt,h);const b=this.getCenter(ot);for(let t=0;t<p;t++){const a=K[M+t];c(X,((1&a)<<1)-1,(2&a)-1,((4&a)>>1)-1),f(X,X,dt),u(E,b,X),E[3]=1,v(E,E,s);const e=1/Math.max(1e-6,E[3]);N[2*t]=E[0]*e,N[2*t+1]=E[1]*e}const j=2*p-2;let S=N[0]*(N[3]-N[j+1])+N[j]*(N[1]-N[j-1]);for(let t=2;t<j;t+=2)S+=N[t]*(N[t+3]-N[t-1]);return Math.abs(S)*i*n*.125}projectedRadius(t){const a=this.getQuaternion(T);return r(O,a),d(X,t,O),Math.abs(X[0]*this._data[3])+Math.abs(X[1]*this._data[4])+Math.abs(X[2]*this._data[5])}minimumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]-this.projectedRadius(W(t))}maximumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]+this.projectedRadius(W(t))}toAaBoundingBox(a){const e=this.getQuaternion(T),s=t(dt,e),i=this._data[3]*Math.abs(s[0])+this._data[4]*Math.abs(s[3])+this._data[5]*Math.abs(s[6]),r=this._data[3]*Math.abs(s[1])+this._data[4]*Math.abs(s[4])+this._data[5]*Math.abs(s[7]),n=this._data[3]*Math.abs(s[2])+this._data[4]*Math.abs(s[5])+this._data[5]*Math.abs(s[8]);a[0]=this._data[0]-i,a[1]=this._data[1]-r,a[2]=this._data[2]-n,a[3]=this._data[0]+i,a[4]=this._data[1]+r,a[5]=this._data[2]+n}transform(t,a,e,s=0,i=A(e),r=A(a),n=B(a,r)){if(e===i)a.isGeographic?st(this,t,a,s,r):et(this,t,a,s,r,n);else if(a.isWGS84&&(e.isWebMercator||k(e)))$(a,this,e,t,s);else if(a.isWebMercator&&k(e))tt(a,this,e,t,s);else{const i=this.getCenter(ot);i[2]+=s,H(i,a,0,i,e,0,1),t.center=i,this!==t&&(t.quaternion=this.getQuaternion(T),t.halfSize=this.getHalfSize(ct))}}}const O=h(),T=h(),V=h(),X=y(),Y=y(),E=w();function J(t,a=new I){return Z(t,a),a}const N=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],K=(()=>{const t=new Int8Array(162);let a=0;const e=e=>{for(let s=0;s<e.length;s++)t[a+s]=e[s];a+=6};return e([6,2,3,1,5,4]),e([0,2,3,1,5,4]),e([0,2,3,7,5,4]),e([0,1,3,2,6,4]),e([0,1,3,2,0,0]),e([0,1,5,7,3,2]),e([0,1,3,7,6,4]),e([0,1,3,7,6,2]),e([0,1,5,7,6,2]),e([0,1,5,4,6,2]),e([0,1,5,4,0,0]),e([0,1,3,7,5,4]),e([0,2,6,4,0,0]),e([0,0,0,0,0,0]),e([1,3,7,5,0,0]),e([2,3,7,6,4,0]),e([2,3,7,6,0,0]),e([2,3,1,5,7,6]),e([0,1,5,7,6,2]),e([0,1,5,7,6,4]),e([0,1,3,7,6,4]),e([4,5,7,6,2,0]),e([4,5,7,6,0,0]),e([4,5,1,3,7,6]),e([0,2,3,7,5,4]),e([6,2,3,7,5,4]),e([6,2,3,1,5,4]),t})();function L(t,a,e,s,i){const n=t.getQuaternion(T);i.quaternion=n,r(O,n);const o=t.getCenter(ot),h=t.getHalfSize(ct);if(s===U.Global){d(mt,o,O),_(ft,mt),g(ut,ft,h),p(ut,ft,ut);const s=M(ut);u(ut,ft,h);const r=M(ut);if(s<e)i.center=o,c(mt,e,e,e),i.halfSize=u(mt,h,mt);else{const n=r>0?1+a/r:1,o=s>0?1+e/s:1,c=(o+n)/2,_=(o-n)/2;b(ut,ft,_),i.halfSize=j(ut,ut,h,c),b(ut,ft,c),j(ut,ut,h,_),S(mt,mt),z(mt,ut,mt);const l=t.getQuaternion(V);i.center=d(mt,mt,l)}}else{i.center=j(mt,o,q,(e+a)/2);const t=d(mt,q,O);_(t,t),i.halfSize=j(ft,h,t,(e-a)/2)}return i}function $(t,a,e,s,i){a.getCenter(ot),ot[2]+=i;const r=A(e);H(ot,t,0,ot,r,0,1),at(r,a,ot,e,s)}function tt(t,a,e,s,i){a.getCenter(ot),ot[2]+=i,at(t,a,ot,e,s)}function at(a,e,s,i,r){const n=e.getQuaternion(T),o=t(dt,n),h=e.getHalfSize(ct);for(let t=0;t<8;++t){for(let a=0;a<3;++a)nt[a]=h[a]*(t&1<<a?-1:1);for(let a=0;a<3;++a){let e=s[a];for(let t=0;t<3;++t)e+=nt[t]*o[3*t+a];it[3*t+a]=e}}H(it,a,0,it,i,0,8),J(rt,r)}function et(t,a,e,s,i=A(e),o=B(e,i)){t.getCorners(lt),t.getCenter(nt),nt[2]+=s,R(e,nt,_t,i),a.setCenter(_t[12],_t[13],_t[14]);const h=2*Math.sqrt(1+_t[0]+_t[5]+_t[10]);O[0]=(_t[6]-_t[9])/h,O[1]=(_t[8]-_t[2])/h,O[2]=(_t[1]-_t[4])/h,O[3]=.25*h;const l=t.getQuaternion(T);a.quaternion=n(O,O,l),r(O,O),c(ft,0,0,0);const m=a.getCenter(ht);for(const r of lt)r[2]+=s,o(r,0,r,0),p(mt,r,m),d(mt,mt,O),_(mt,mt),x(ft,ft,mt);a.halfSize=ft}function st(t,a,e,s,i=A(e)){const n=P(e),o=1+Math.max(0,s)/(n.radius+t.centerZ);t.getCenter(nt),nt[2]+=s,H(nt,e,0,nt,i,0,1),a.center=nt;const h=t.getQuaternion(T);a.quaternion=h,r(O,h),c(mt,0,0,1),d(mt,mt,O);const _=t.getHalfSize(ct);c(mt,_[0]*Math.abs(mt[0]),_[1]*Math.abs(mt[1]),_[2]*Math.abs(mt[2])),b(mt,mt,n.inverseFlattening),u(mt,_,mt),a.halfSize=b(mt,mt,o)}const it=new Array(24),rt=new F(it,3),nt=y(),ot=y(),ht=y(),ct=y(),dt=e(),_t=s(),lt=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],mt=y(),ft=y(),ut=y(),gt=Q(-1,-1,-1);export{I as Obb,J as compute,L as computeOffsetObb};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{clamp as t}from"../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{m as c,H as a,c as p,o as d,f as l,n as u}from"../../../../chunks/vec32.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{wrap as f}from"../../../../geometry/support/ray.js";import{PointOfInterest as g}from"./PointOfInterest.js";import{PaddingSide as y}from"../../webgl-engine/lib/rendererUtils.js";import{PropertiesPool as P}from"../../../support/PropertiesPool.js";import{TaskPriority as _}from"../../../support/Scheduler.js";import{Yield as j}from"../../../support/Yield.js";const L=Array;let O=class extends g{constructor(e){super(e),this._propertiesPool=new P({location:m,renderLocation:L},this),this._dirty=!0,this.renderLocation=this._propertiesPool.get("renderLocation")}initialize(){this.addHandles([o((()=>this.centerOnSurface.renderLocation),(()=>this.updateRenderLocation())),o((()=>this.state.contentCamera),(()=>this.updateRenderLocation()))]),this.scheduler&&this.addHandles(this.scheduler.registerTask(_.POINT_OF_INTEREST_FREQUENT,this))}destroy(){this._propertiesPool=r(this._propertiesPool)}get updating(){return this._dirty||this.centerOnSurface.updating}get location(){const e=this._propertiesPool.get("location");return e.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e),e}get worldUnitsPerContentPixel(){const{camera:e,contentPixelRatio:t}=this.state;return e.computeRenderPixelSizeAt(this.renderLocation)*(e.pixelRatio/t)}get running(){return this._dirty}runTask(){const e=this._get("renderLocation"),r=this.centerOnSurface.renderLocation,o=this.renderCoordsHelper,i=this.state.contentCamera;this._dirty=!1,o.worldUpAtPosition(r,S);const s=Math.max(0,(Math.acos(c(S,i.viewForward))-.5*Math.PI)*(i.aboveGround?1:-1));if(Number.isNaN(s)){if(!e||!a(e,r)){const e=this._propertiesPool.get("renderLocation");p(e,r),this._set("renderLocation",e)}return j}const n=1-t(s/(.5*Math.PI),0,1),l=n*n*n;this._calculateScreenHorizontalEdgeOnSurface(C);const u=this._propertiesPool.get("renderLocation");return d(u,r,C,l),e&&a(e,u)||this._set("renderLocation",u),j}_calculateScreenHorizontalEdgeOnSurface(e){const t=this.state.contentCamera,r=t.getRenderCenter(i());if(r[1]=t.aboveGround?t.padding[y.BOTTOM]:t.fullHeight-t.padding[y.TOP],this.estimateSurfaceIntersectionAtRenderPoint(r,e))return e;const o=this.renderCoordsHelper.getAltitude(this.centerOnSurface.renderLocation);if(t.unprojectFromRenderScreen(r,R)){l(R,R,t.eye);const r=u(R,R);if(this.renderCoordsHelper.intersectInfiniteManifold(f(t.eye,r),o,e))return e}return this.renderCoordsHelper.setAltitude(e,o,t.eye)}updateRenderLocation(){this._dirty=!0}};e([s()],O.prototype,"_dirty",void 0),e([s({constructOnly:!0})],O.prototype,"scheduler",void 0),e([s({constructOnly:!0})],O.prototype,"centerOnSurface",void 0),e([s({constructOnly:!0})],O.prototype,"estimateSurfaceIntersectionAtRenderPoint",void 0),e([s()],O.prototype,"updating",null),e([s()],O.prototype,"location",null),e([s()],O.prototype,"renderLocation",void 0),e([s()],O.prototype,"worldUnitsPerContentPixel",null),O=e([n("esri.views.3d.support.pointsOfInterest.Focus")],O);const S=h(),R=h(),C=h();export{O as Focus};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{clamp as t}from"../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{l as c,H as a,c as p,o as d,f as l,n as u}from"../../../../chunks/vec32.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{wrap as f}from"../../../../geometry/support/ray.js";import{PointOfInterest as g}from"./PointOfInterest.js";import{PaddingSide as y}from"../../webgl-engine/lib/rendererUtils.js";import{PropertiesPool as P}from"../../../support/PropertiesPool.js";import{TaskPriority as _}from"../../../support/Scheduler.js";import{Yield as j}from"../../../support/Yield.js";const L=Array;let O=class extends g{constructor(e){super(e),this._propertiesPool=new P({location:m,renderLocation:L},this),this._dirty=!0,this.renderLocation=this._propertiesPool.get("renderLocation")}initialize(){this.addHandles([o((()=>this.centerOnSurface.renderLocation),(()=>this.updateRenderLocation())),o((()=>this.state.contentCamera),(()=>this.updateRenderLocation()))]),this.scheduler&&this.addHandles(this.scheduler.registerTask(_.POINT_OF_INTEREST_FREQUENT,this))}destroy(){this._propertiesPool=r(this._propertiesPool)}get updating(){return this._dirty||this.centerOnSurface.updating}get location(){const e=this._propertiesPool.get("location");return e.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e),e}get worldUnitsPerContentPixel(){const{camera:e,contentPixelRatio:t}=this.state;return e.computeRenderPixelSizeAt(this.renderLocation)*(e.pixelRatio/t)}get running(){return this._dirty}runTask(){const e=this._get("renderLocation"),r=this.centerOnSurface.renderLocation,o=this.renderCoordsHelper,i=this.state.contentCamera;this._dirty=!1,o.worldUpAtPosition(r,S);const s=Math.max(0,(Math.acos(c(S,i.viewForward))-.5*Math.PI)*(i.aboveGround?1:-1));if(Number.isNaN(s)){if(!e||!a(e,r)){const e=this._propertiesPool.get("renderLocation");p(e,r),this._set("renderLocation",e)}return j}const n=1-t(s/(.5*Math.PI),0,1),l=n*n*n;this._calculateScreenHorizontalEdgeOnSurface(C);const u=this._propertiesPool.get("renderLocation");return d(u,r,C,l),e&&a(e,u)||this._set("renderLocation",u),j}_calculateScreenHorizontalEdgeOnSurface(e){const t=this.state.contentCamera,r=t.getRenderCenter(i());if(r[1]=t.aboveGround?t.padding[y.BOTTOM]:t.fullHeight-t.padding[y.TOP],this.estimateSurfaceIntersectionAtRenderPoint(r,e))return e;const o=this.renderCoordsHelper.getAltitude(this.centerOnSurface.renderLocation);if(t.unprojectFromRenderScreen(r,R)){l(R,R,t.eye);const r=u(R,R);if(this.renderCoordsHelper.intersectInfiniteManifold(f(t.eye,r),o,e))return e}return this.renderCoordsHelper.setAltitude(e,o,t.eye)}updateRenderLocation(){this._dirty=!0}};e([s()],O.prototype,"_dirty",void 0),e([s({constructOnly:!0})],O.prototype,"scheduler",void 0),e([s({constructOnly:!0})],O.prototype,"centerOnSurface",void 0),e([s({constructOnly:!0})],O.prototype,"estimateSurfaceIntersectionAtRenderPoint",void 0),e([s()],O.prototype,"updating",null),e([s()],O.prototype,"location",null),e([s()],O.prototype,"renderLocation",void 0),e([s()],O.prototype,"worldUnitsPerContentPixel",null),O=e([n("esri.views.3d.support.pointsOfInterest.Focus")],O);const S=h(),R=h(),C=h();export{O as Focus};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{lerp as t,clamp as e}from"../../../core/mathUtils.js";import{fromRotation as i,identity as o,rotateX as n,rotateY as a,rotateZ as l}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as c,lerp as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as u,create as m}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s as g,o as f,n as d,j as h,h as b,g as y,c as p}from"../../../chunks/vec32.js";import{fromValues as A,create as w,clone as x}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as N}from"../../ViewingMode.js";import{S as v}from"../../../chunks/SunCalc.js";import{angle as T}from"./mathUtils.js";const M={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:1.3*Math.PI,altitude:.6*Math.PI}}};class j{constructor(t,e){this.direct=t,this.ambient=e}}function S(i,o,n,a,l,r){g(r.ambient.color,1,1,1),r.ambient.intensity=M.global.ambient,g(r.direct.color,1,1,1),r.direct.intensity=M.global.direct;const c=o[2],s=e((Math.abs(c)-M.local.altitude)/(M.global.altitude-M.local.altitude),0,1);let u;if(r.globalFactor=s,null!=i&&(u=v.getTimes(i,o[1],o[0])),s<1){let e;if(null!=i)e=ot(i,u,a);else{const t=L(a);e={direct:{intensity:M.local.directAtNoon*t.direct,color:A(1,1,1)},ambient:{intensity:M.local.ambientAtNoon*t.ambient,color:A(1,1,1)},timeOfDay:"early afternoon"}}f(r.ambient.color,e.ambient.color,r.ambient.color,s),r.ambient.intensity=t(e.ambient.intensity,r.ambient.intensity,s),f(r.direct.color,e.direct.color,r.direct.color,s),r.direct.intensity=t(e.direct.intensity,r.direct.intensity,s),r.specularStrength="rainy"===a||"snowy"===a||"foggy"===a?0:1,r.environmentStrength="rainy"===a?.7:"snowy"===a||"foggy"===a?.75:1}r.noonFactor=null!=i?F(i,u):1,null!=i?P(i,o,n,r.direct.directionToLightSource):O(l,n,r.direct.directionToLightSource)}function O(t,e,o){e===N.Global?d(lt,t.eye):g(lt,0,0,1),h(rt,t.viewForward,-1);const n=T(rt,lt),a=Math.max(n-2*st,0),l=.85*a/(a+1),r=Math.max(st,n-st-l);i(at,-r,t.viewRight),b(o,rt,at),y(o,o,h(ct,t.viewRight,ut)),d(o,o)}function P(t,i,r,c){const s=H,u=o(G);if(r===N.Global)v.getPosition(t,0,0,s),g(c,0,0,-1),n(u,u,-s.azimuth),a(u,u,-s.altitude),b(c,c,u);else{const o=M.planarDirection,a=o.globalAngles,r=i[2];let m=(Math.abs(r)-o.localAltitude)/(o.globalAltitude-o.localAltitude);m=e(m,0,1),m<1?(v.getPosition(t,i[1],i[0],s),s.azimuth=(1-m)*s.azimuth+m*a.azimuth,s.altitude=(1-m)*s.altitude+m*a.altitude):(s.azimuth=a.azimuth,s.altitude=a.altitude),g(c,0,-1,0),l(u,u,-s.azimuth),n(u,u,-s.altitude),b(c,c,u)}}function z(t,e){if(e===N.Global)return!0;const i=M.planarDirection;return Math.abs(t)<i.localAltitude}function D(t,e,i,o,n){const a=t.getTime(),l=e.getTime()-a,r=Math.floor(l/i)+1,c=new Array(r);for(let s=0;s<r;++s)nt.setTime(a+i*s),c[s]=w(),P(nt,o,n,c[s]);return c}const E=A(.5773502691896258,-.5773502691896258,.5773502691896258);class I{constructor(){this.ambient={color:A(1,1,1),intensity:.55},this.direct={color:A(1,1,1),intensity:.55,directionToLightSource:x(E)},this.noonFactor=.5,this.globalFactor=0,this.specularStrength=1,this.environmentStrength=1}}const G=r(),H={azimuth:0,altitude:0};function F(t,i){const o=t.valueOf();let n,a;i.polarException===v.PolarException.MIDNIGHT_SUN?(n=o-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=n+432e6):i.polarException===v.PolarException.POLAR_NIGHT?(n=o-2,a=o-1):(n=i.sunrise.valueOf(),a=i.sunset.valueOf());const l=n+(a-n)/2;return 1-e(Math.abs(o-l)/432e5,0,1)}function L(t){switch(t){case"disabled":case"sunny":case"cloudy":return new j(1,1);case"rainy":return new j(.4,1.2);case"snowy":return new j(.5,1.3);case"foggy":return new j(.2,1.6)}}function R(t,e){const i=(t[0]+t[1]+t[2])/3;t[0]+=(i-t[0])*e,t[1]+=(i-t[1])*e,t[2]+=(i-t[2])*e}const U=A(.01,.01,.01),_=A(1,.6,.5),k=A(1,.98,.98),V=A(1,1,1),C=A(.8,.8,1),q=A(.8,.8,1),B=A(.98,.98,1),J=A(1,1,1),K=u(.01,M.local.ambientAtNight),Q=u(M.local.directAtTwilight,M.local.ambientAtTwilight),W=u(.9*M.local.directAtNoon,M.local.ambientAtNoon),X=u(M.local.directAtNoon,M.local.ambientAtNoon),Y=W,Z=k,$=B,tt=Q,et=_,it=q;function ot(t,e,i){const o=t.valueOf();let n,a;e.polarException===v.PolarException.MIDNIGHT_SUN?(n=o-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=n+432e6):e.polarException===v.PolarException.POLAR_NIGHT?(n=o-2,a=o-1):(n=e.sunrise.valueOf(),a=e.sunset.valueOf());const l=a-n,r=n+l/2,u=l/4,g=r-u,d=r+u,h=.06*l,b=n-h/2,y=n+h/2,A=a-h/2,x=a+h/2,N=m(),T=w(),M=w();let j="";if(o<b||o>x)c(N,K),p(T,U),p(M,C),j="night";else if(o<y){const t=(o-b)/(y-b);s(N,K,Q,t),f(T,U,_,t),f(M,C,q,t),j="sun rising"}else if(o<g){const t=(o-y)/(g-y);s(N,Q,W,t),f(T,_,k,t),f(M,q,B,t),j="early morning"}else if(o<r){const t=(o-g)/(r-g);s(N,W,X,t),f(T,k,V,t),f(M,B,J,t),j="late morning"}else if(o<d){const t=(o-r)/(d-r);s(N,X,Y,t),f(T,V,Z,t),f(M,J,$,t),j="early afternoon"}else if(o<A){const t=(o-d)/(A-d);s(N,Y,tt,t),f(T,Z,et,t),f(M,$,it,t),j="late afternoon"}else if(o<x){const t=(o-A)/(x-A);s(N,tt,K,t),f(T,et,U,t),f(M,it,C,t),j="sun setting"}let S=0;switch(i){case"rainy":case"foggy":S=.8;break;case"snowy":S=.5}S>0&&(R(T,S),R(M,S));const O=L(i);return{direct:{intensity:N[0]*O.direct,color:T},ambient:{intensity:N[1]*O.ambient,color:M},timeOfDay:j}}const nt=new Date(0),at=r(),lt=w(),rt=w(),ct=w(),st=.25,ut=.2;export{I as ColorAndIntensity,S as computeColorAndIntensity,D as computeDirectionsOverTime,z as computeShadowsEnabled,O as computeVirtualLightDirection};
5
+ import{lerp as t,clamp as e}from"../../../core/mathUtils.js";import{fromRotation as i,identity as o,rotateX as n,rotateY as a,rotateZ as l}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as c,lerp as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as u,create as m}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as g,o as f,n as d,j as h,h as b,g as y,c as p}from"../../../chunks/vec32.js";import{fromValues as A,create as w,clone as x}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as N}from"../../ViewingMode.js";import{S as v}from"../../../chunks/SunCalc.js";import{angle as T}from"./mathUtils.js";const M={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:1.3*Math.PI,altitude:.6*Math.PI}}};class j{constructor(t,e){this.direct=t,this.ambient=e}}function S(i,o,n,a,l,r){g(r.ambient.color,1,1,1),r.ambient.intensity=M.global.ambient,g(r.direct.color,1,1,1),r.direct.intensity=M.global.direct;const c=o[2],s=e((Math.abs(c)-M.local.altitude)/(M.global.altitude-M.local.altitude),0,1);let u;if(r.globalFactor=s,null!=i&&(u=v.getTimes(i,o[1],o[0])),s<1){let e;if(null!=i)e=ot(i,u,a);else{const t=L(a);e={direct:{intensity:M.local.directAtNoon*t.direct,color:A(1,1,1)},ambient:{intensity:M.local.ambientAtNoon*t.ambient,color:A(1,1,1)},timeOfDay:"early afternoon"}}f(r.ambient.color,e.ambient.color,r.ambient.color,s),r.ambient.intensity=t(e.ambient.intensity,r.ambient.intensity,s),f(r.direct.color,e.direct.color,r.direct.color,s),r.direct.intensity=t(e.direct.intensity,r.direct.intensity,s),r.specularStrength="rainy"===a||"snowy"===a||"foggy"===a?0:1,r.environmentStrength="rainy"===a?.7:"snowy"===a||"foggy"===a?.75:1}r.noonFactor=null!=i?F(i,u):1,null!=i?P(i,o,n,r.direct.directionToLightSource):O(l,n,r.direct.directionToLightSource)}function O(t,e,o){e===N.Global?d(lt,t.eye):g(lt,0,0,1),h(rt,t.viewForward,-1);const n=T(rt,lt),a=Math.max(n-2*st,0),l=.85*a/(a+1),r=Math.max(st,n-st-l);i(at,-r,t.viewRight),b(o,rt,at),y(o,o,h(ct,t.viewRight,ut)),d(o,o)}function P(t,i,r,c){const s=H,u=o(G);if(r===N.Global)v.getPosition(t,0,0,s),g(c,0,0,-1),n(u,u,-s.azimuth),a(u,u,-s.altitude),b(c,c,u);else{const o=M.planarDirection,a=o.globalAngles,r=i[2];let m=(Math.abs(r)-o.localAltitude)/(o.globalAltitude-o.localAltitude);m=e(m,0,1),m<1?(v.getPosition(t,i[1],i[0],s),s.azimuth=(1-m)*s.azimuth+m*a.azimuth,s.altitude=(1-m)*s.altitude+m*a.altitude):(s.azimuth=a.azimuth,s.altitude=a.altitude),g(c,0,-1,0),l(u,u,-s.azimuth),n(u,u,-s.altitude),b(c,c,u)}}function z(t,e){if(e===N.Global)return!0;const i=M.planarDirection;return Math.abs(t)<i.localAltitude}function D(t,e,i,o,n){const a=t.getTime(),l=e.getTime()-a,r=Math.floor(l/i)+1,c=new Array(r);for(let s=0;s<r;++s)nt.setTime(a+i*s),c[s]=w(),P(nt,o,n,c[s]);return c}const E=A(.5773502691896258,-.5773502691896258,.5773502691896258);class I{constructor(){this.ambient={color:A(1,1,1),intensity:.55},this.direct={color:A(1,1,1),intensity:.55,directionToLightSource:x(E)},this.noonFactor=.5,this.globalFactor=0,this.specularStrength=1,this.environmentStrength=1}}const G=r(),H={azimuth:0,altitude:0};function F(t,i){const o=t.valueOf();let n,a;i.polarException===v.PolarException.MIDNIGHT_SUN?(n=o-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=n+432e6):i.polarException===v.PolarException.POLAR_NIGHT?(n=o-2,a=o-1):(n=i.sunrise.valueOf(),a=i.sunset.valueOf());const l=n+(a-n)/2;return 1-e(Math.abs(o-l)/432e5,0,1)}function L(t){switch(t){case"disabled":case"sunny":case"cloudy":return new j(1,1);case"rainy":return new j(.4,1.2);case"snowy":return new j(.5,1.3);case"foggy":return new j(.2,1.6)}}function R(t,e){const i=(t[0]+t[1]+t[2])/3;t[0]+=(i-t[0])*e,t[1]+=(i-t[1])*e,t[2]+=(i-t[2])*e}const U=A(.01,.01,.01),_=A(1,.6,.5),k=A(1,.98,.98),V=A(1,1,1),C=A(.8,.8,1),q=A(.8,.8,1),B=A(.98,.98,1),J=A(1,1,1),K=u(.01,M.local.ambientAtNight),Q=u(M.local.directAtTwilight,M.local.ambientAtTwilight),W=u(.9*M.local.directAtNoon,M.local.ambientAtNoon),X=u(M.local.directAtNoon,M.local.ambientAtNoon),Y=W,Z=k,$=B,tt=Q,et=_,it=q;function ot(t,e,i){const o=t.valueOf();let n,a;e.polarException===v.PolarException.MIDNIGHT_SUN?(n=o-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=n+432e6):e.polarException===v.PolarException.POLAR_NIGHT?(n=o-2,a=o-1):(n=e.sunrise.valueOf(),a=e.sunset.valueOf());const l=a-n,r=n+l/2,u=l/4,g=r-u,d=r+u,h=.06*l,b=n-h/2,y=n+h/2,A=a-h/2,x=a+h/2,N=m(),T=w(),M=w();let j="";if(o<b||o>x)c(N,K),p(T,U),p(M,C),j="night";else if(o<y){const t=(o-b)/(y-b);s(N,K,Q,t),f(T,U,_,t),f(M,C,q,t),j="sun rising"}else if(o<g){const t=(o-y)/(g-y);s(N,Q,W,t),f(T,_,k,t),f(M,q,B,t),j="early morning"}else if(o<r){const t=(o-g)/(r-g);s(N,W,X,t),f(T,k,V,t),f(M,B,J,t),j="late morning"}else if(o<d){const t=(o-r)/(d-r);s(N,X,Y,t),f(T,V,Z,t),f(M,J,$,t),j="early afternoon"}else if(o<A){const t=(o-d)/(A-d);s(N,Y,tt,t),f(T,Z,et,t),f(M,$,it,t),j="late afternoon"}else if(o<x){const t=(o-A)/(x-A);s(N,tt,K,t),f(T,et,U,t),f(M,it,C,t),j="sun setting"}let S=0;switch(i){case"rainy":case"foggy":S=.8;break;case"snowy":S=.5}S>0&&(R(T,S),R(M,S));const O=L(i);return{direct:{intensity:N[0]*O.direct,color:T},ambient:{intensity:N[1]*O.ambient,color:M},timeOfDay:j}}const nt=new Date(0),at=r(),lt=w(),rt=w(),ct=w(),st=.25,ut=.2;export{I as ColorAndIntensity,S as computeColorAndIntensity,D as computeDirectionsOverTime,z as computeShadowsEnabled,O as computeVirtualLightDirection};