@arcgis/core 5.0.0-next.36 → 5.0.0-next.37

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 (230) hide show
  1. package/WebLinkChart.js +1 -1
  2. package/analysis/ShadowCast/types.d.ts +2 -0
  3. package/applications/Components/analysisUtils.d.ts +1 -0
  4. package/applications/Components/analysisUtils.js +1 -1
  5. package/arcade/arcadeAsyncRuntime.js +1 -1
  6. package/arcade/arcadeCompiler.js +1 -1
  7. package/arcade/featureSetUtils.js +1 -1
  8. package/arcade/featureset/actions/Adapted.js +1 -1
  9. package/arcade/featureset/actions/AttributeFilter.js +1 -1
  10. package/arcade/featureset/actions/GroupBy.js +1 -1
  11. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  12. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  13. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  14. package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
  15. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  16. package/arcade/featureset/support/FeatureSet.js +1 -1
  17. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  18. package/assets/esri/core/workers/RemoteClient.js +1 -1
  19. package/assets/esri/core/workers/chunks/014dbe6fa93a277b08f7.js +1 -0
  20. package/assets/esri/core/workers/chunks/{51355866a0dcf41cfded.js → 0a5427127634738aa239.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{c7c721de93bc8688e13c.js → 1d4ea8db272655c0608c.js} +1 -1
  22. package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +1 -0
  23. package/assets/esri/core/workers/chunks/1de216d9850c39c1735d.js +1 -0
  24. package/assets/esri/core/workers/chunks/262232437d37a7460b11.js +1 -0
  25. package/assets/esri/core/workers/chunks/{1817cf11e85afca947d3.js → 328106e181e5957ceaa5.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{d3db7244fac7398cc700.js → 4b6a44c6265c8959abd8.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{f1ac1c8b1331ec79e898.js → 59ce992d3a5e7c32b9fb.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{8a946cbc816f373c136b.js → 5e30acfda04f7fc2b676.js} +1 -1
  29. package/assets/esri/core/workers/chunks/6330d8767ba1d5329daa.js +1 -0
  30. package/assets/esri/core/workers/chunks/{3f03165487c1c2340fff.js → 690a40d2eef52bfc149f.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{dd34d56caafa38d4b8e4.js → 7aa730e5ac7b268e3c98.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{1fa55d4c4b092a98bdd7.js → b56c07c0b43cb1999070.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{24a3c6f0154787968724.js → c5967133f3ba34a883f8.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{bfb9cbe59d36d18f9157.js → cda5c95fd49b8901f7d4.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{b451dc416eebd0931ef8.js → ce8fc1ca229d53a4b68d.js} +6 -6
  36. package/assets/esri/core/workers/chunks/{c9e7cc5d853908ab5b2f.js → ce99abfdcd71ff9e4e36.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{726a797f5df7eeee0b3d.js → d786b17cc9062b1450ac.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{2e76fbd3c874300fc4a7.js → de3da4d31a7529761565.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{eb6218634a492667506a.js → e501d68a1464805c4b4e.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{33431e8131f6017de2f9.js → e7f4d135ef9665de1468.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{d8623f5f13a084e439c2.js → e9bc3c6482ba778c9349.js} +37 -37
  42. package/assets/esri/core/workers/chunks/{7420fa18ba12014b22ea.js → ee67c8a7c1f8b482cd99.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{abb05a903440d97a6a74.js → f441fc74451330384fb0.js} +1 -1
  44. package/assets/esri/core/workers/chunks/f609b256df9eb3803464.js +1 -0
  45. package/assets/esri/core/workers/chunks/f97a7cb367634353177d.js +1 -0
  46. package/chunks/CloudsComposition.glsl.js +1 -1
  47. package/chunks/ComponentShader.glsl.js +2 -2
  48. package/chunks/DefaultMaterial.glsl.js +1 -1
  49. package/chunks/GaussianSplat.glsl.js +2 -2
  50. package/chunks/Laserlines.glsl.js +1 -1
  51. package/chunks/Path.glsl.js +1 -1
  52. package/chunks/RealisticTree.glsl.js +1 -1
  53. package/chunks/Terrain.glsl.js +34 -36
  54. package/chunks/WaterSurface.glsl.js +1 -1
  55. package/chunks/boundedPlane.js +1 -1
  56. package/chunks/cameraUtilsSpherical.js +1 -1
  57. package/chunks/vec32.js +1 -1
  58. package/config.js +1 -1
  59. package/core/has.js +1 -1
  60. package/core/iteratorUtils.js +1 -1
  61. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  62. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  63. package/geometry/support/lineSegment.js +1 -1
  64. package/geometry/support/meshUtils/merge.js +1 -1
  65. package/geometry/support/sphere.js +1 -1
  66. package/interfaces.d.ts +35 -5
  67. package/kernel.js +1 -1
  68. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  69. package/layers/VoxelWasmPerSceneView.js +1 -1
  70. package/layers/knowledgeGraph/layerUtils.js +1 -1
  71. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  72. package/layers/support/csvUtils.js +1 -1
  73. package/layers/video/VideoController.js +1 -1
  74. package/layers/voxel/VoxelVolume.js +1 -1
  75. package/package.json +5 -5
  76. package/support/revision.js +1 -1
  77. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  78. package/views/2d/interactive/SegmentLabels2D.js +1 -1
  79. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  80. package/views/3d/FocusAreasView.js +1 -1
  81. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  82. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  83. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  84. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  85. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  86. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  87. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  88. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  89. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  90. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  91. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  92. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  93. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  94. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  95. package/views/3d/camera/constraintUtils/distance.js +1 -1
  96. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  97. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  98. package/views/3d/environment/CloudsParameters.js +1 -1
  99. package/views/3d/environment/EnvironmentManager.js +1 -1
  100. package/views/3d/environment/MarsAtmosphere.js +1 -1
  101. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  102. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  103. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  104. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  105. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  106. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  107. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  108. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  109. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  110. package/views/3d/layers/I3SMeshView3D.js +1 -1
  111. package/views/3d/layers/ImagerySubView3D.js +1 -1
  112. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  113. package/views/3d/layers/RouteLayerView3D.js +1 -1
  114. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  115. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  116. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  117. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  118. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  119. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  120. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  121. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  122. package/views/3d/state/Frustum.js +1 -1
  123. package/views/3d/state/ViewStateManager.js +1 -1
  124. package/views/3d/state/controllers/FovController.js +1 -1
  125. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  126. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  127. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  128. package/views/3d/support/cameraUtils.js +1 -1
  129. package/views/3d/support/intersectionUtils.js +1 -1
  130. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  131. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  132. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  133. package/views/3d/support/viewpointUtils.js +1 -1
  134. package/views/3d/terrain/OverlayManager.js +1 -1
  135. package/views/3d/terrain/OverlayRenderer.js +1 -1
  136. package/views/3d/terrain/PatchRenderData.js +1 -1
  137. package/views/3d/terrain/SphericalPatch.js +1 -1
  138. package/views/3d/terrain/TerrainRenderer.js +1 -1
  139. package/views/3d/terrain/Tile.js +1 -1
  140. package/views/3d/terrain/TileCompositor.js +1 -1
  141. package/views/3d/webgl/RenderCamera.js +1 -1
  142. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  143. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  144. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  145. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  146. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +4 -7
  147. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +6 -6
  148. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +4 -4
  149. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +19 -15
  150. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
  151. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  152. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +5 -5
  153. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +14 -14
  154. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +16 -37
  155. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  156. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  157. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  158. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  159. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  160. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  161. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  162. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  163. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  164. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  165. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  166. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  167. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  168. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  169. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  170. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  171. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  172. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  173. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  174. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  175. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  176. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  177. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  178. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  179. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  180. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  181. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  182. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  183. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  184. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  185. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  186. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  187. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  188. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  189. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  190. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  191. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  192. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  193. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  194. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  195. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  196. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  197. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +9 -10
  198. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  199. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  200. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  201. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  202. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  203. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  204. package/views/GroundView.js +1 -1
  205. package/views/SceneView.js +1 -1
  206. package/views/analysis/ElevationProfile/elevationProfileVisualizationUtils.js +1 -1
  207. package/views/interactive/GraphicManipulator.js +1 -1
  208. package/views/interactive/coordinateHelper.js +1 -1
  209. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  210. package/views/interactive/sketch/constraints.js +1 -1
  211. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  212. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  213. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  214. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  215. package/views/layers/LayerView.js +1 -1
  216. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  217. package/views/support/LayerViewManager.js +1 -1
  218. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  219. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  220. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  221. package/views/support/geometry3dUtils.js +1 -1
  222. package/webmap/utils.js +1 -1
  223. package/widgets/Sketch/SketchViewModel.js +1 -1
  224. package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +0 -1
  225. package/assets/esri/core/workers/chunks/15c1a48e8cd2a8882d85.js +0 -1
  226. package/assets/esri/core/workers/chunks/1b9e7d416c9f00e020bb.js +0 -1
  227. package/assets/esri/core/workers/chunks/5000a37fba27464d10ca.js +0 -1
  228. package/assets/esri/core/workers/chunks/b075d3714fab0591d67c.js +0 -1
  229. package/assets/esri/core/workers/chunks/d8975dd7b85b5d065ee4.js +0 -1
  230. package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +0 -1
@@ -2,6 +2,6 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ZEROS as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as n}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{terrainDepthTest as a}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ComputeCovariance as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/ComputeCovariance.glsl.js";import{FastApproximateTrigonometry as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js";import{GaussianSplatUnpacking as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2PassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as u,If as p}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerBindUniform as f}from"../views/3d/webgl-engine/core/shaderModules/IntegerBindUniform.js";import{IntegerPassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Matrix4BindUniform as h}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{getGaussianSplatAlphaCutoffValue as g}from"../views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js";import{NoParameters as x}from"../views/webgl/NoParameters.js";import{ShaderBuilder as w}from"../views/webgl/ShaderBuilder.js";class y extends x{constructor(){super(...arguments),this.totalGaussians=-1,this.focalLength=-1,this.minSplatRadius=-1,this.tanFov=e,this.cameraDelta=n,this.cameraPos8k=n}}function b(e){const n=new w;n.varyings.add("vColor","vec4"),n.varyings.add("conicOpacity","vec4"),n.varyings.add("depth","float"),n.varyings.add("gaussianCenterScreenPos","vec2"),n.varyings.add("fragScreenPos","vec2"),n.varyings.add("offsetFromCenter","vec2"),n.outputs.add("fragColor","vec4",0),n.vertex.uniforms.add(new m("splatOrderTexture",e=>e.splatOrder),new m("splatFadingTexture",e=>e.splatFading),new m("splatAtlasTexture",e=>e.splatAtlas),new v("numSplats",e=>e.totalGaussians),new d("focalLength",e=>e.focalLength),new d("minSplatRadius",e=>e.minSplatRadius),new s("tanFov",e=>e.tanFov),new l("cameraDelta",e=>e.cameraDelta),new l("cameraPos8k",e=>e.cameraPos8k),new f("fullWidth",({camera:e})=>e.viewport[2]),new f("fullHeight",({camera:e})=>e.viewport[3]),new h("proj",e=>e.camera.projectionMatrix),new h("view",e=>e.camera.viewMatrix),new c("cameraPosition",e=>e.camera.eye)),n.vertex.include(o),n.vertex.include(r),n.vertex.include(i),n.vertex.include(t),n.include(a,e);const x=e.depthPass,y=g(e.alphaCutoff),b=Math.log(y),P=-2*b;return n.vertex.code.add(u`float ndcToPixel(float ndcCoord, float screenSize) {
5
+ import{ZEROS as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as n}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{EvaluateSceneLighting as a,addAmbientBoostFactor as i,addLightingGlobalFactor as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{NormalUtils as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{terrainDepthTest as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ComputeCovariance as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/ComputeCovariance.glsl.js";import{FastApproximateTrigonometry as c}from"../views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js";import{GaussianSplatUnpacking as l}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2BindUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{Float2PassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as f,If as h}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerBindUniform as x}from"../views/3d/webgl-engine/core/shaderModules/IntegerBindUniform.js";import{IntegerPassUniform as w}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Matrix4BindUniform as y}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as b}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{getGaussianSplatAlphaCutoffValue as P}from"../views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js";import{NoParameters as D}from"../views/webgl/NoParameters.js";import{ShaderBuilder as C}from"../views/webgl/ShaderBuilder.js";class S extends D{constructor(){super(...arguments),this.totalGaussians=-1,this.focalLength=-1,this.minSplatRadius=-1,this.tanFov=e,this.cameraDelta=n,this.cameraPos8k=n}}function F(e){const n=new C;n.varyings.add("vColor","vec4"),n.varyings.add("conicOpacity","vec4"),n.varyings.add("depth","float"),n.varyings.add("gaussianCenterScreenPos","vec2"),n.varyings.add("fragScreenPos","vec2"),n.varyings.add("offsetFromCenter","vec2"),n.outputs.add("fragColor","vec4",0),n.vertex.uniforms.add(new b("splatOrderTexture",e=>e.splatOrder),new b("splatFadingTexture",e=>e.splatFading),new b("splatAtlasTexture",e=>e.splatAtlas),new w("numSplats",e=>e.totalGaussians),new m("focalLength",e=>e.focalLength),new m("minSplatRadius",e=>e.minSplatRadius),new g("tanFov",e=>e.tanFov),new v("cameraDelta",e=>e.cameraDelta),new v("cameraPos8k",e=>e.cameraPos8k),new x("fullWidth",({camera:e})=>e.viewport[2]),new x("fullHeight",({camera:e})=>e.viewport[3]),new y("proj",e=>e.camera.projectionMatrix),new y("view",e=>e.camera.viewMatrix),new u("nearFar",e=>e.camera.nearFar),new p("cameraPosition",e=>e.camera.eye)),n.vertex.include(l),n.vertex.include(d),n.vertex.include(s),n.vertex.include(c),n.vertex.include(a,e),n.include(o,e),i(n.vertex),t(n.vertex),n.include(r,e);const D=e.depthPass,S=P(e.alphaCutoff),F=Math.log(S),T=-2*F;return n.vertex.code.add(f`float ndcToPixel(float ndcCoord, float screenSize) {
6
6
  return ((ndcCoord + 1.0) * screenSize - 1.0) * 0.5;
7
- }`),n.vertex.main.add(`\n uint instanceID = uint(gl_InstanceID);\n\n // Transform the instanceID into 2D coordinates\n uint orderTextureWidth = uint(textureSize(splatOrderTexture, 0).x);\n uint x = instanceID % orderTextureWidth;\n uint y = instanceID / orderTextureWidth;\n\n // Fetch the index of the remaining frontmost Gaussian\n uint gaussianIndex = texelFetch(splatOrderTexture, ivec2(x, y), 0).r;\n\n uint splatAtlasWidth = uint(textureSize(splatAtlasTexture, 0).x);\n\n // Fetch the packed Gaussian according to the index\n uint gaussianIndexX = gaussianIndex % splatAtlasWidth;\n uint gaussianIndexY = gaussianIndex / splatAtlasWidth;\n uvec4 packedGaussian = texelFetch(splatAtlasTexture, ivec2(gaussianIndexX, gaussianIndexY), 0);\n\n // Fetch the header associated with the packed Gaussian (contains tile origin and number of fractional bits)\n uint pageNum = gaussianIndex / 1024u;\n uint headerIndex = (pageNum + 1u) * 1024u - 1u;\n uint headerIndexX = headerIndex % splatAtlasWidth;\n uint headerIndexY = headerIndex / splatAtlasWidth;\n uvec4 packedHeader = texelFetch(splatAtlasTexture, ivec2(headerIndexX, headerIndexY), 0);\n\n // Unpack the Gaussian\n vColor = unpackColor(packedGaussian);\n\n // Handle fading\n ${p(e.fadingEnabled,"\n uint fadingTextureWidth = uint(textureSize(splatFadingTexture, 0).x);\n uint fadeX = pageNum % fadingTextureWidth;\n uint fadeY = pageNum / fadingTextureWidth;\n uint opacityModifierByte = texelFetch(splatFadingTexture, ivec2(fadeX , fadeY), 0).r;\n float opacityModifier = float(opacityModifierByte) / 255.0;\n vColor.a *= opacityModifier;\n ")}\n \n\n if(vColor.a < ${y}) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n vec3 scale = unpackScale(packedGaussian);\n vec4 quaternion = unpackQuaternion(packedGaussian);\n mat3 rotation = quaternionToRotationMatrix(quaternion);\n vec3 tileOriginRelativePosition = unpackTileOriginRelativePosition(packedGaussian);\n\n vec3 cameraRelativePosition = unpackCameraRelativeGaussianPosition(packedHeader, tileOriginRelativePosition, cameraPosition, cameraPos8k, cameraDelta);\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1);\n\n if (viewPos.z > 1.0) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n forwardViewPosDepth(viewPos.xyz);\n\n vec3 covarianceA;\n vec3 covarianceB;\n computeCovariance3D(rotation, scale.xyz, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec3 covariance2D = computeCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);\n\n // Invert covariance (EWA algorithm)\n float determinant = (covariance2D.x * covariance2D.z - covariance2D.y * covariance2D.y);\n if (determinant == 0.) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n float invDeterminant = 1. / determinant;\n\n\n vec4 projPos = proj * viewPos;\n float invW = 1. / (projPos.w + 1e-7);\n vec3 ndcPos = projPos.xyz * invW;\n\n // Compute extent in screen space (by finding the eigenvalues of the 2D covariance matrix).\n // Use the extent to compute the bounding rectangle of the Gaussian in screen space.\n float mid = 0.5 * (covariance2D.x + covariance2D.z);\n float delta = sqrt(max(0.1, mid * mid - determinant));\n float lambda1 = mid + delta;\n float lambda2 = mid - delta;\n // Compute principal radii (a and b)\n float a = sqrt(${P} * lambda1); // Semi-major axis\n float b = sqrt(${P} * lambda2); // Semi-minor axis\n\n // Compute rotation angle phi from covariance\n float delta_angle = covariance2D.x - covariance2D.z;\n float phi = 0.5 * fastAtan2(2.0 * covariance2D.y, delta_angle);\n\n // Compute projected axis-aligned extents\n float cos_phi = fastCos(phi);\n float sin_phi = fastSin(phi);\n float radius_x = ceil(sqrt(a * a * cos_phi * cos_phi + b * b * sin_phi * sin_phi));\n float radius_y = ceil(sqrt(a * a * sin_phi * sin_phi + b * b * cos_phi * cos_phi));\n gaussianCenterScreenPos = vec2(ndcToPixel(ndcPos.x, float(fullWidth)), ndcToPixel(ndcPos.y, float(fullHeight)));\n\n // Ignore gaussians with very small contribution, with tolerance based on the quality profile\n if(minSplatRadius > 0.0) {\n float effectiveSize = max(radius_x, radius_y) * vColor.a;\n if(effectiveSize < minSplatRadius) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n }\n\n // This maps vertex IDs 0, 1, 2, 3 to (-1,-1), (1,-1), (-1,1), (1,1)\n vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.0;\n\n // Vertex (corner) position in screen space\n fragScreenPos = gaussianCenterScreenPos + vec2(radius_x * corner.x, radius_y * corner.y);\n\n // We use a conic function to derive the opacity\n vec3 conic = vec3(covariance2D.z, -covariance2D.y, covariance2D.x) * invDeterminant;\n conicOpacity = vec4(conic, vColor.a);\n\n depth = ndcPos.z;\n\n // Convert from screen-space to clip-space\n vec2 clipPos = fragScreenPos / vec2(fullWidth, fullHeight) * 2. - 1.;\n\n offsetFromCenter = gaussianCenterScreenPos - fragScreenPos;\n\n gl_Position = vec4(clipPos, depth, 1.0);\n\n `),n.fragment.main.add(`\n discardByTerrainDepth();\n\n // Evaluate the 2D elliptical Gaussian exponent using the general conic form: Ax^2+2Bxy+Cy^2\n float x = offsetFromCenter.x;\n float y = offsetFromCenter.y;\n float conic = dot(conicOpacity.xyz, vec3(x * x, 2.0 * x * y, y * y));\n float gaussianExponent = -0.5 * conic;\n\n // A positive exponent indicates alpha > 1, this should not happen\n // We also early check the alphaCutoff (i.e., ln(alphaCutoff)), to avoid unnecessary exp()\n if (gaussianExponent > 0.0 || gaussianExponent < ${b}) {\n discard;\n }\n\n float gaussianFalloff = exp(gaussianExponent);\n\n // cap at 0.99 to avoid blending issues, such as seams between overlapping Gaussians\n float alpha = min(.99f, conicOpacity.w * gaussianFalloff);\n\n // We cannot write color and depth in the same pass, as they require different blend modes.\n // Regular depth writing based on first hit is not precise enough due to the inherently\n // transparent nature of Gaussian Splats (especially at the borders of the Splat).\n // We thus use a blended depth that computes a non-linear average using\n // the splat order and opacity with geometric decay.\n // This means the depth is averaged based on the order and opacity of the Gaussians,\n // with the frontmost Gaussians contributing the most.\n ${p(x,"fragColor = vec4(depth, 0, 0, alpha);","fragColor = vec4(vColor.rgb * alpha, alpha);")}\n `),n}const P=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatPassParameters:y,build:b},Symbol.toStringTag,{value:"Module"}));export{y as G,P as a,b};
7
+ }`),n.vertex.main.add(`\n uint instanceID = uint(gl_InstanceID);\n\n // Transform the instanceID into 2D coordinates\n uint orderTextureWidth = uint(textureSize(splatOrderTexture, 0).x);\n uint x = instanceID % orderTextureWidth;\n uint y = instanceID / orderTextureWidth;\n\n // Fetch the index of the remaining frontmost Gaussian\n uint gaussianIndex = texelFetch(splatOrderTexture, ivec2(x, y), 0).r;\n\n uint splatAtlasWidth = uint(textureSize(splatAtlasTexture, 0).x);\n\n // Fetch the packed Gaussian according to the index\n uint gaussianIndexX = gaussianIndex % splatAtlasWidth;\n uint gaussianIndexY = gaussianIndex / splatAtlasWidth;\n uvec4 packedGaussian = texelFetch(splatAtlasTexture, ivec2(gaussianIndexX, gaussianIndexY), 0);\n\n // Fetch the header associated with the packed Gaussian (contains tile origin and number of fractional bits)\n uint pageNum = gaussianIndex / 1024u;\n uint headerIndex = (pageNum + 1u) * 1024u - 1u;\n uint headerIndexX = headerIndex % splatAtlasWidth;\n uint headerIndexY = headerIndex / splatAtlasWidth;\n uvec4 packedHeader = texelFetch(splatAtlasTexture, ivec2(headerIndexX, headerIndexY), 0);\n\n // Unpack the Gaussian\n vColor = unpackColor(packedGaussian);\n\n // Handle fading\n ${h(e.fadingEnabled,"\n uint fadingTextureWidth = uint(textureSize(splatFadingTexture, 0).x);\n uint fadeX = pageNum % fadingTextureWidth;\n uint fadeY = pageNum / fadingTextureWidth;\n uint opacityModifierByte = texelFetch(splatFadingTexture, ivec2(fadeX , fadeY), 0).r;\n float opacityModifier = float(opacityModifierByte) / 255.0;\n vColor.a *= opacityModifier;\n ")}\n\n if(vColor.a < ${S}) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n vec3 scale = unpackScale(packedGaussian);\n vec4 quaternion = unpackQuaternion(packedGaussian);\n mat3 rotation = quaternionToRotationMatrix(quaternion);\n vec3 tileOriginRelativePosition = unpackTileOriginRelativePosition(packedGaussian);\n\n vec3 cameraRelativePosition = unpackCameraRelativeGaussianPosition(packedHeader, tileOriginRelativePosition, cameraPosition, cameraPos8k, cameraDelta);\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1);\n\n // Handle environment (scene lighting)\n ${h(!D,`\n vec3 groundNormal = ${e.spherical?f`normalize(cameraRelativePosition + cameraPosition)`:f`vec3(0.0, 0.0, 1.0)`};\n\n float groundLightAlignment = dot(groundNormal, mainLightDirection);\n float additionalAmbientScale = additionalDirectedAmbientLight(groundLightAlignment);\n vec3 additionalLight = mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\n \n vColor.rgb = evaluateSceneLighting(groundNormal, vColor.rgb, 0.0, 0.0, mainLightIntensity);\n `)};\n\n if (viewPos.z > -nearFar.x || viewPos.z < -nearFar.y) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n forwardViewPosDepth(viewPos.xyz);\n\n vec3 covarianceA;\n vec3 covarianceB;\n computeCovariance3D(rotation, scale.xyz, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec3 covariance2D = computeCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);\n\n // Invert covariance (EWA algorithm)\n float determinant = (covariance2D.x * covariance2D.z - covariance2D.y * covariance2D.y);\n if (determinant == 0.) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n float invDeterminant = 1. / determinant;\n\n\n vec4 projPos = proj * viewPos;\n float invW = 1. / (projPos.w + 1e-7);\n vec3 ndcPos = projPos.xyz * invW;\n\n // Compute extent in screen space (by finding the eigenvalues of the 2D covariance matrix).\n // Use the extent to compute the bounding rectangle of the Gaussian in screen space.\n float mid = 0.5 * (covariance2D.x + covariance2D.z);\n float delta = sqrt(max(0.1, mid * mid - determinant));\n float lambda1 = mid + delta;\n float lambda2 = mid - delta;\n \n // Compute principal radii (a and b)\n float a = sqrt(${T} * lambda1); // Semi-major axis\n float b = sqrt(${T} * lambda2); // Semi-minor axis\n\n // Compute rotation angle phi from covariance\n float delta_angle = covariance2D.x - covariance2D.z;\n float phi = 0.5 * fastAtan2(2.0 * covariance2D.y, delta_angle);\n\n // Compute projected axis-aligned extents\n float cos_phi = fastCos(phi);\n float sin_phi = fastSin(phi);\n\n float a2 = a * a;\n float b2 = b * b;\n float cos2 = cos_phi * cos_phi;\n float sin2 = sin_phi * sin_phi;\n\n float radius_x = ceil(sqrt(a2 * cos2 + b2 * sin2));\n float radius_y = ceil(sqrt(a2 * sin2 + b2 * cos2));\n gaussianCenterScreenPos = vec2(ndcToPixel(ndcPos.x, float(fullWidth)), ndcToPixel(ndcPos.y, float(fullHeight)));\n\n float maxRadius = max(radius_x, radius_y);\n\n // Ignore gaussians with very small contribution, with tolerance based on the quality profile\n if(minSplatRadius > 0.0) {\n float effectiveSize = maxRadius * vColor.a;\n if(effectiveSize < minSplatRadius) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n }\n\n // Screen space frustum culling\n vec2 radiusNDC = vec2(\n maxRadius * 2.0 / float(fullWidth),\n maxRadius * 2.0 / float(fullHeight)\n );\n\n if (any(greaterThan(abs(ndcPos.xy) - radiusNDC, vec2(1.0)))) {\n gl_Position = vec4(1e038, 1e038, 1e038, 1.0);\n return;\n }\n\n // This maps vertex IDs 0, 1, 2, 3 to (-1,-1), (1,-1), (-1,1), (1,1)\n vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.0;\n\n // Vertex (corner) position in screen space\n fragScreenPos = gaussianCenterScreenPos + vec2(radius_x * corner.x, radius_y * corner.y);\n\n // We use a conic function to derive the opacity\n vec3 conic = vec3(covariance2D.z, -covariance2D.y, covariance2D.x) * invDeterminant;\n conicOpacity = vec4(conic, vColor.a);\n\n depth = ndcPos.z;\n\n // Convert from screen-space to clip-space\n vec2 clipPos = fragScreenPos / vec2(fullWidth, fullHeight) * 2. - 1.;\n\n offsetFromCenter = gaussianCenterScreenPos - fragScreenPos;\n\n gl_Position = vec4(clipPos, depth, 1.0);\n\n `),n.fragment.main.add(`\n discardByTerrainDepth();\n\n // Evaluate the 2D elliptical Gaussian exponent using the general conic form: Ax^2+2Bxy+Cy^2\n float x = offsetFromCenter.x;\n float y = offsetFromCenter.y;\n float conic = dot(conicOpacity.xyz, vec3(x * x, 2.0 * x * y, y * y));\n float gaussianExponent = -0.5 * conic;\n\n // A positive exponent indicates alpha > 1, this should not happen\n // We also early check the alphaCutoff (i.e., ln(alphaCutoff)), to avoid unnecessary exp()\n if (gaussianExponent > 0.0 || gaussianExponent < ${F}) {\n discard;\n }\n\n float gaussianFalloff = exp(gaussianExponent);\n\n // cap at 0.99 to avoid blending issues, such as seams between overlapping Gaussians\n float alpha = min(.99f, conicOpacity.w * gaussianFalloff);\n\n // We cannot write color and depth in the same pass, as they require different blend modes.\n // Regular depth writing based on first hit is not precise enough due to the inherently\n // transparent nature of Gaussian Splats (especially at the borders of the Splat).\n // We thus use a blended depth that computes a non-linear average using\n // the splat order and opacity with geometric decay.\n // This means the depth is averaged based on the order and opacity of the Gaussians,\n // with the frontmost Gaussians contributing the most.\n ${h(D,"fragColor = vec4(depth, 0, 0, alpha);","fragColor = vec4(vColor.rgb * alpha, alpha);")}\n `),n}const T=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatPassParameters:S,build:F},Symbol.toStringTag,{value:"Module"}));export{S as G,T as a,F as b};
@@ -2,7 +2,7 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{deg2rad as e}from"../core/mathUtils.js";import{set as i}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as n,e as a,n as o,b as r,D as l,d as s,f as c,i as d}from"./vec32.js";import{create as f}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as p}from"./vec42.js";import{create as g}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{pointAt as h}from"../geometry/support/lineSegment.js";import{fromPositionAndNormal as m,create as u}from"../geometry/support/plane.js";import{Laserline as w}from"../views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js";import{ScreenSpacePass as x}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{Float2PassUniform as b}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as P}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as D}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatBindUniform as M}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as S}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as C}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{ShaderBuilder as L}from"../views/webgl/ShaderBuilder.js";const A=e(6);function j(e){const i=new L;i.include(x),i.include(w,e);const t=i.fragment;if(e.lineVerticalPlaneEnabled||e.heightManifoldEnabled)if(t.uniforms.add(new S("maxPixelDistance",(i,t)=>e.heightManifoldEnabled?2*t.camera.computeScreenPixelSizeAt(i.heightManifoldTarget):2*t.camera.computeScreenPixelSizeAt(i.lineVerticalPlaneSegment.origin))),t.code.add(C`float planeDistancePixels(vec4 plane, vec3 pos) {
5
+ import{deg2rad as e}from"../core/mathUtils.js";import{set as i}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as n,e as a,n as o,b as r,C as l,d as s,f as c,i as d}from"./vec32.js";import{create as f}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as p}from"./vec42.js";import{create as g}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{pointAt as h}from"../geometry/support/lineSegment.js";import{fromPositionAndNormal as m,create as u}from"../geometry/support/plane.js";import{Laserline as w}from"../views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js";import{ScreenSpacePass as x}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{Float2PassUniform as b}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3BindUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float3PassUniform as P}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as D}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatBindUniform as M}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as S}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as C}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{ShaderBuilder as L}from"../views/webgl/ShaderBuilder.js";const A=e(6);function j(e){const i=new L;i.include(x),i.include(w,e);const t=i.fragment;if(e.lineVerticalPlaneEnabled||e.heightManifoldEnabled)if(t.uniforms.add(new S("maxPixelDistance",(i,t)=>e.heightManifoldEnabled?2*t.camera.computeScreenPixelSizeAt(i.heightManifoldTarget):2*t.camera.computeScreenPixelSizeAt(i.lineVerticalPlaneSegment.origin))),t.code.add(C`float planeDistancePixels(vec4 plane, vec3 pos) {
6
6
  float dist = dot(plane.xyz, pos) + plane.w;
7
7
  float width = fwidth(dist);
8
8
  dist /= min(width, maxPixelDistance);
@@ -8,7 +8,7 @@ forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
8
8
  gl_Position = transformPosition(proj, view, vpos);
9
9
  forwardObjectAndLayerIdColor();
10
10
  vcolor = getColor();
11
- forwardLinearDepthToReadShadowMap();`)),V){case 0:I.include(w,B),I.include(t,B),_.include(d,B),I.include(v,B),_.include(o,B),I.include(A,B),L(_,B),c(_),m(_),_.uniforms.add(M.uniforms.get("localOrigin"),new j("ambient",e=>e.ambient),new j("diffuse",e=>e.diffuse),new P("opacity",e=>e.opacity)),_.include(b),_.include(C,B),g(_),_.main.add(S`
11
+ forwardLinearDepthToReadShadowMap();`)),V){case 0:I.include(w,B),_.include(t,B),_.include(d,B),I.include(v,B),_.include(o,B),I.include(A,B),L(_,B),c(_),m(_),_.uniforms.add(M.uniforms.get("localOrigin"),new j("ambient",e=>e.ambient),new j("diffuse",e=>e.diffuse),new P("opacity",e=>e.opacity)),_.include(b),_.include(C,B),g(_),_.main.add(S`
12
12
  discardBySlice(vpos);
13
13
  discardByTerrainDepth();
14
14
 
@@ -25,7 +25,7 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
25
25
  forwardLinearDepthToReadShadowMap();
26
26
  gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
27
27
  ${V(J,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
28
- `);const{hasColorTexture:Z,hasColorTextureTransform:ee}=_;return z.include(w,_),H.include(b,_),z.include(O,_),H.include(r,_),z.include(k,_),S(H,_),f(H),p(H),u(H),H.uniforms.add(W.uniforms.get("localOrigin"),W.uniforms.get("view"),new A("ambient",e=>e.ambient),new A("diffuse",e=>e.diffuse),new D("opacity",e=>e.opacity),new D("layerOpacity",e=>e.layerOpacity)),Z&&H.uniforms.add(new T("tex",e=>e.texture)),z.include(x,_),H.include(y,_),H.include(N),H.include($,_),h(H),H.main.add(F`
28
+ `);const{hasColorTexture:Z,hasColorTextureTransform:ee}=_;return H.include(w,_),H.include(b,_),z.include(O,_),H.include(r,_),z.include(k,_),S(H,_),f(H),p(H),u(H),H.uniforms.add(W.uniforms.get("localOrigin"),W.uniforms.get("view"),new A("ambient",e=>e.ambient),new A("diffuse",e=>e.diffuse),new D("opacity",e=>e.opacity),new D("layerOpacity",e=>e.layerOpacity)),Z&&H.uniforms.add(new T("tex",e=>e.texture)),z.include(x,_),H.include(y,_),H.include(N),H.include($,_),h(H),H.main.add(F`
29
29
  discardBySlice(vpos);
30
30
  discardByTerrainDepth();
31
31
  vec4 texColor = ${Z?`texture(tex, ${ee?"colorUV":"vuv0"})`:" vec4(1.0)"};
@@ -2,12 +2,12 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as o,h as a}from"./vec32.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{addLinearDepth as l}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{addNearFar as t}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import{SliceDraw as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as s}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{NormalAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttribute as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexTangent as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js";import{OutputDepth as v}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as g}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{OutputHighlightOverlay as p}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js";import{EvaluateAmbientOcclusion as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as w,addAmbientBoostFactor as f,addLightingGlobalFactor as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightDirection as h,addMainLightIntensity as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{NormalUtils as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{ReadShadowMapDraw as O}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{OverlayTerrain as j}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{OverlayTerrainPassParameters as L,TerrainTexture as x}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js";import{addProjViewLocalOrigin as T,addViewNormal as M,addCameraPosition as P}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3BindUniform as $}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{glsl as S,If as z}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4DrawUniform as F}from"../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js";import{Texture2DBindUniform as D}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{ShaderBuilder as _}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as A}from"../webscene/support/AlphaCutoff.js";class V extends L{}function N(r){const i=new _,{attributes:L,vertex:V,fragment:N,varyings:B}=i;L.add("position","vec3"),i.include(d,r),i.include(c,r);const H=()=>{i.include(C,r),V.code.add(S`vec3 getNormal() {
5
+ import{translate as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as r,h as i}from"./vec32.js";import{create as a}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{addLinearDepth as l}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{addNearFar as t}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import{SliceDraw as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as s}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{NormalAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttribute as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexTangent as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js";import{OutputDepth as v}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as g}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{OutputHighlightOverlay as u}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js";import{EvaluateAmbientOcclusion as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as w,addAmbientBoostFactor as f,addLightingGlobalFactor as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightDirection as b,addMainLightIntensity as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{NormalUtils as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{ReadShadowMapDraw as O}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{OverlayTerrain as L}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{OverlayTerrainPassParameters as j,TerrainTexture as x}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js";import{addProjViewLocalOrigin as T,addViewNormal as M,addCameraPosition as P}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3BindUniform as $}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{glsl as S,If as z}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4DrawUniform as D}from"../views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js";import{Texture2DBindUniform as A}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{outputColorHighlightOLID as F}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as _}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as V}from"../webscene/support/AlphaCutoff.js";class N extends j{}function W(o){const a=new _,{attributes:j,vertex:N,fragment:W,varyings:H}=a;j.add("position","vec3"),a.include(d,o),a.include(c,o);const U=()=>{a.include(C,o),N.code.add(S`vec3 getNormal() {
6
6
  float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y);
7
7
  vec3 n = vec3(normalCompressed + vec2(normalCompressed.x >= 0.0 ? 1.0 : -1.0,
8
8
  normalCompressed.y >= 0.0 ? 1.0 : -1.0) * min(z, 0.0), z);
9
9
  return normalize(n);
10
- }`)};T(V,r),i.include(s);const{output:U,overlayMode:E,tileBorders:q,transparencyMode:I,overlayEnabled:R}=r,G=2===I||3===I,J=0!==r.pbrMode,K=R&&G;switch(U){case 0:{i.include(x,r),i.include(w,r),R&&i.include(j,r);const l=2===E;l&&i.include(m,r),B.add("vnormal","vec3"),B.add("vpos","vec3",{invariant:!0}),B.add("vup","vec3"),H(),V.main.add(S`
10
+ }`)};T(N,o),a.include(s);const{output:E,overlayMode:I,tileBorders:q,transparencyMode:R,overlayEnabled:G}=o,J=2===R||3===R,K=0!==o.pbrMode,Q=G&&J;switch(E){case 0:{a.include(x,o),W.include(w,o),G&&a.include(L,o);const l=2===I;l&&a.include(m,o),H.add("vnormal","vec3"),H.add("vpos","vec3",{invariant:!0}),H.add("vup","vec3"),U(),N.main.add(S`
11
11
  vpos = position;
12
12
  vec3 positionWorld = position + localOrigin;
13
13
  gl_Position = transformPosition(proj, view, vpos);
@@ -16,26 +16,24 @@ return normalize(n);
16
16
  ${z(l,S`forwardVertexTangent(vnormal);`)}
17
17
 
18
18
  forwardTextureCoordinatesWithTransform(uv0);
19
- ${z(R,"setOverlayVTC(uv0);")}
19
+ ${z(G,"setOverlayVTC(uv0);")}
20
20
  ${z(q,"forwardTextureCoordinates();")}
21
- forwardLinearDepthToReadShadowMap();`),i.include(O,r),N.include(n,r),i.include(w,r),N.include(u,r),P(N,r),f(N),b(N),N.uniforms.add(V.uniforms.get("localOrigin"),new $("viewDirection",({camera:e})=>o(k,a(k,e.viewMatrix[12],e.viewMatrix[13],e.viewMatrix[14])))),l&&N.uniforms.add(new D("ovWaterTex",e=>e.overlay?.getTexture(3)),new F("view",({origin:r},{camera:o})=>e(W,o.viewMatrix,r))),h(N),y(N),N.main.add(S`
21
+ forwardLinearDepthToReadShadowMap();`),a.include(O,o),W.include(n,o),W.include(w,o),W.include(p,o),a.include(F,o),P(W,o),f(W),h(W),W.uniforms.add(N.uniforms.get("localOrigin"),new $("viewDirection",({camera:e})=>r(B,i(B,e.viewMatrix[12],e.viewMatrix[13],e.viewMatrix[14])))),l&&W.uniforms.add(new A("ovWaterTex",e=>e.overlay?.getTexture(3)),new D("view",({origin:o},{camera:r})=>e(k,r.viewMatrix,o))),b(W),y(W),W.main.add(S`
22
22
  vec3 normal = normalize(vnormal);
23
- float vndl = dot(normal, mainLightDirection);
23
+ float lightAlignment = dot(normal, mainLightDirection);
24
24
 
25
- float additionalAmbientScale = smoothstep(0.0, 1.0, clamp(vndl*2.5, 0.0, 1.0));
25
+ float additionalAmbientScale = additionalDirectedAmbientLight(lightAlignment);
26
26
  float shadow = readShadow(additionalAmbientScale, vpos);
27
27
  float ssao = evaluateAmbientOcclusionInverse();
28
28
  vec4 tileColor = getTileColor();
29
29
 
30
- ${z(R,S`vec4 overlayColorOpaque = getOverlayColor(ovColorTex, vtcOverlay);
30
+ ${z(G,S`vec4 overlayColorOpaque = getOverlayColor(ovColorTex, vtcOverlay);
31
31
  vec4 overlayColor = overlayOpacity * overlayColorOpaque;
32
- ${z(G,`if (overlayColor.a < ${S.float(A)}) { discard; }`)}
32
+ ${z(J,`if (overlayColor.a < ${S.float(V)}) { discard; }`)}
33
33
  vec4 groundColor = tileColor;
34
34
  tileColor = tileColor * (1.0 - overlayColor.a) + overlayColor;`)}
35
35
 
36
- // If combined alpha is 0 we can discard pixel. The performance impact by having a discard here
37
- // is neglectable because terrain typically renders first into the framebuffer.
38
- if(tileColor.a < ${S.float(A)}) {
36
+ if(tileColor.a < ${S.float(V)}) {
39
37
  discard;
40
38
  }
41
39
 
@@ -49,38 +47,38 @@ return normalize(n);
49
47
  // heuristic shading function used in the old terrain, now used to add ambient lighting
50
48
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
51
49
 
52
- ${J?S`fragColor = vec4(evaluatePBRSimplifiedLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight, normalize(vpos - cameraPosition), vup), tileColor.a);`:S`fragColor = vec4(evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight), tileColor.a);`}
50
+ ${K?S`vec4 finalColor = vec4(evaluatePBRSimplifiedLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight, normalize(vpos - cameraPosition), vup), tileColor.a);`:S`vec4 finalColor = vec4(evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight), tileColor.a);`}
53
51
  ${z(l,S`vec4 overlayWaterMask = getOverlayColor(ovWaterTex, vtcOverlay);
54
- float waterNormalLength = length(overlayWaterMask);
55
- if (waterNormalLength > 0.95) {
56
- mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, vnormal);
57
- vec4 waterOverlayColor = vec4(overlayColor.w > 0.0 ? overlayColorOpaque.xyz/overlayColor.w : vec3(1.0), overlayColor.w);
58
- vec4 viewPosition = view*vec4(vpos, 1.0);
59
- vec4 waterColorLinear = getOverlayWaterColor(overlayWaterMask, waterOverlayColor, -normalize(vpos - cameraPosition), shadow, vnormal, tbnMatrix, viewPosition.xyz, vpos + localOrigin);
60
- vec4 waterColorNonLinear = delinearizeGamma(vec4(waterColorLinear.xyz, 1.0));
61
- float opacity = sliced ? groundSliceOpacity : 1.0;
62
- // un-gamma the ground color to mix in linear space
63
- fragColor = mix(groundColor, waterColorNonLinear, waterColorLinear.w) * opacity;
64
- }`)}
52
+ float waterNormalLength = length(overlayWaterMask);
53
+ if (waterNormalLength > 0.95) {
54
+ mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, vnormal);
55
+ vec4 waterOverlayColor = vec4(overlayColor.w > 0.0 ? overlayColorOpaque.xyz/overlayColor.w : vec3(1.0), overlayColor.w);
56
+ vec4 viewPosition = view*vec4(vpos, 1.0);
57
+ vec4 waterColorLinear = getOverlayWaterColor(overlayWaterMask, waterOverlayColor, -normalize(vpos - cameraPosition), shadow, vnormal, tbnMatrix, viewPosition.xyz, vpos + localOrigin);
58
+ vec4 waterColorNonLinear = delinearizeGamma(vec4(waterColorLinear.xyz, 1.0));
59
+ float opacity = sliced ? groundSliceOpacity : 1.0;
60
+ // un-gamma the ground color to mix in linear space
61
+ finalColor = mix(groundColor, waterColorNonLinear, waterColorLinear.w) * opacity;
62
+ }`)}
65
63
  ${z(q,S`vec2 dVuv = fwidth(vuv0);
66
64
  vec2 edgeFactors = smoothstep(vec2(0.0), 1.5 * dVuv, min(vuv0, 1.0 - vuv0));
67
65
  float edgeFactor = 1.0 - min(edgeFactors.x, edgeFactors.y);
68
- fragColor = mix(fragColor, vec4(1.0, 0.0, 0.0, 1.0), edgeFactor);`)}
69
- fragColor = applySlice(fragColor, vpos);`)}break;case 1:K&&i.include(j,r),V.main.add(S`
70
- ${z(K,"setOverlayVTC(uv0);")}
71
- gl_Position = transformPosition(proj, view, position);`),N.main.add(`${z(K,`if (getCombinedOverlayColor().a < ${S.float(A)}) discard;`)}`);break;case 3:case 4:case 5:case 6:case 7:i.include(v,r),l(i),t(i),V.main.add(S`gl_Position = transformPositionWithDepth(proj, view, position, nearFar, linearDepth);`),N.main.add(S`outputDepth(linearDepth);`);break;case 2:K&&i.include(j,r),B.add("vnormal","vec3"),M(V),H(),V.main.add(S`
72
- ${z(K,"setOverlayVTC(uv0);")}
66
+ finalColor = mix(finalColor, vec4(1.0, 0.0, 0.0, 1.0), edgeFactor);`)}
67
+ outputColorHighlightOLID(finalColor, vpos, finalColor.rgb);`)}break;case 1:Q&&a.include(L,o),N.main.add(S`
68
+ ${z(Q,"setOverlayVTC(uv0);")}
69
+ gl_Position = transformPosition(proj, view, position);`),W.main.add(`${z(Q,`if (getCombinedOverlayColor().a < ${S.float(V)}) discard;`)}`);break;case 3:case 4:case 5:case 6:case 7:a.include(v,o),l(a),t(a),N.main.add(S`gl_Position = transformPositionWithDepth(proj, view, position, nearFar, linearDepth);`),W.main.add(S`outputDepth(linearDepth);`);break;case 2:Q&&a.include(L,o),H.add("vnormal","vec3"),M(N),U(),N.main.add(S`
70
+ ${z(Q,"setOverlayVTC(uv0);")}
73
71
  gl_Position = transformPosition(proj, view, position);
74
- vnormal = normalize((viewNormal * vec4(getNormal(), 1.0)).xyz);`),N.main.add(S`
75
- ${z(K,`if (getCombinedOverlayColor().a < ${S.float(A)}) discard;`)}
72
+ vnormal = normalize((viewNormal * vec4(getNormal(), 1.0)).xyz);`),W.main.add(S`
73
+ ${z(Q,`if (getCombinedOverlayColor().a < ${S.float(V)}) discard;`)}
76
74
  vec3 normal = normalize(vnormal);
77
75
  if (gl_FrontFacing == false) {
78
76
  normal = -normal;
79
77
  }
80
- fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);`);break;case 8:R&&(i.include(j,r),i.include(p,r)),V.main.add(S`
81
- ${z(R,"setOverlayVTC(uv0);")}
82
- gl_Position = transformPosition(proj, view, position);`),i.include(g,r),N.main.add(S`
83
- ${z(R,S`
78
+ fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);`);break;case 8:G&&(a.include(L,o),a.include(u,o)),N.main.add(S`
79
+ ${z(G,"setOverlayVTC(uv0);")}
80
+ gl_Position = transformPosition(proj, view, position);`),a.include(g,o),W.main.add(S`
81
+ ${z(G,S`
84
82
  calculateOcclusionAndOutputHighlight(getAllOverlayHighlightValuesEncoded());`,"calculateOcclusionAndOutputHighlight();")}
85
- `);break;case 9:if(R)i.include(j,r),V.main.add(S`gl_Position = transformPosition(proj, view, position);
86
- setOverlayVTC(uv0);`),N.main.add(S`fragColor = getOverlayColorTexel();`);else{const e=0===I;V.main.add(S`${z(e,"gl_Position = transformPosition(proj, view, position);")}`),N.main.add(S`fragColor = vec4(0.0);`)}}return i}const W=r(),k=i(),B=Object.freeze(Object.defineProperty({__proto__:null,TerrainPassParameters:V,build:N},Symbol.toStringTag,{value:"Module"}));export{V as T,B as a,N as b};
83
+ `);break;case 9:if(G)a.include(L,o),N.main.add(S`gl_Position = transformPosition(proj, view, position);
84
+ setOverlayVTC(uv0);`),W.main.add(S`fragColor = getOverlayColorTexel();`);else{const e=0===R;N.main.add(S`${z(e,"gl_Position = transformPosition(proj, view, position);")}`),W.main.add(S`fragColor = vec4(0.0);`)}}return a}const k=o(),B=a(),H=Object.freeze(Object.defineProperty({__proto__:null,TerrainPassParameters:N,build:W},Symbol.toStringTag,{value:"Module"}));export{N as T,H as a,W as b};
@@ -25,7 +25,7 @@ import{isColor as e}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutpu
25
25
  forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
26
26
 
27
27
  gl_Position = transformPosition(proj, view, vpos);
28
- forwardLinearDepthToReadShadowMap();`)}switch(C.include(d,L),C.include(g,L),O){case 0:C.include(t,{pbrMode:0,lightingSphericalHarmonicsOrder:2}),C.include(v),C.include(m,L),x.include(r,L),C.include(b,L),x.include(c),w(x,L),n(x),s(x),x.uniforms.add(_,new f("timeElapsed",({timeElapsed:e})=>e),P.uniforms.get("view"),P.uniforms.get("localOrigin")).main.add(h`
28
+ forwardLinearDepthToReadShadowMap();`)}switch(C.include(d,L),C.include(g,L),O){case 0:x.include(t,{pbrMode:0,lightingSphericalHarmonicsOrder:2}),C.include(v),C.include(m,L),x.include(r,L),C.include(b,L),x.include(c),w(x,L),n(x),s(x),x.uniforms.add(_,new f("timeElapsed",({timeElapsed:e})=>e),P.uniforms.get("view"),P.uniforms.get("localOrigin")).main.add(h`
29
29
  discardBySlice(vpos);
30
30
  discardByTerrainDepth();
31
31
  vec3 localUp = vnormal;
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../core/has.js";import s from"../core/Logger.js";import{acosClamped as t}from"../core/mathUtils.js";import{ObjectStack as i}from"../core/ObjectStack.js";import{invert as n,transpose as r,fromRotation as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as a,j as c,i as u,h as g,D as b,b as f,E as p,g as l,e as m,m as d,p as j,F as h,n as I}from"./vec32.js";import{fromValues as y,clone as v,create as P}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as N}from"../geometry/support/aaBoundingRect.js";import{projectPointClamp as w,distance2 as x,create as M}from"../geometry/support/lineSegment.js";import{create as S,wrap as T,copy as V,fromVectorsAndPoint as A,fromValues as E,intersectRay as _,intersectLineSegment as O,intersectLineSegmentClamp as F,isPointInside as k,projectPoint as R,getNormal as q,setOffsetFromPoint as B}from"../geometry/support/plane.js";import{distance2 as C}from"../geometry/support/ray.js";import{projectPointSignedLength as Y}from"../geometry/support/vector.js";import{sv3d as L}from"../geometry/support/vectorStacks.js";const U=()=>s.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function z(s=Ns){return{plane:S(s.plane),origin:v(s.origin),basis1:v(s.basis1),basis2:v(s.basis2)}}function D(s,t,i){const n=Ss.get();return n.origin=s,n.basis1=t,n.basis2=i,n.plane=T(0,0,0,0),J(n),n}function G(s,t=z()){return H(s.origin,s.basis1,s.basis2,t)}function W(s,t){a(t.origin,s.origin),a(t.basis1,s.basis1),a(t.basis2,s.basis2),V(t.plane,s.plane)}function H(s,t,i,n=z()){return a(n.origin,s),a(n.basis1,t),a(n.basis2,i),J(n),vs(n,"fromValues()"),n}function J(s){A(s.basis2,s.basis1,s.origin,s.plane)}function K(s,t,i){s!==i&&G(s,i);const n=c(L.get(),ds(s),t);return u(i.origin,i.origin,n),i.plane[3]-=t,i}function Q(s,t,i){return Z(t,i),K(i,bs(s,s.origin),i),i}function X(s,t){const i=s.basis1[0],n=s.basis2[1],[r,e]=s.origin;return N(r-i,e-n,r+i,e+n,t)}function Z(s,t=z()){const i=(s[2]-s[0])/2,n=(s[3]-s[1])/2;return g(t.origin,s[0]+i,s[1]+n,0),g(t.basis1,i,0,0),g(t.basis2,0,n,0),E(0,0,1,0,t.plane),t}function $(s,t,i){return!!_(s.plane,t,i)&&hs(s,i)}function ss(s,t,i){if($(s,t,i))return i;const n=ts(s,t,L.get());return u(i,t.origin,c(L.get(),t.direction,b(t.origin,n)/f(t.direction))),i}function ts(s,i,n){const r=ws.get();Ps(s,i,r,ws.get());let e=Number.POSITIVE_INFINITY;for(const o of Ts){const c=ys(s,o,xs.get()),u=L.get();if(O(r,c,u)){const s=p(L.get(),i.origin,u),r=Math.abs(t(l(i.direction,s)));r<e&&(e=r,a(n,u))}}return e===Number.POSITIVE_INFINITY?ns(s,i,n):n}function is(s,t){return(t-s)/t}function ns(s,t,i){if($(s,t,i))return i;const n=ws.get(),r=ws.get();Ps(s,t,n,r);let e=Number.POSITIVE_INFINITY;for(const o of Ts){const c=ys(s,o,xs.get()),u=L.get();if(F(n,c,u)){const s=C(t,u);if(!k(r,u))continue;s<e&&(e=s,a(i,u))}}return os(s,t.origin)<e&&rs(s,t.origin,i),i}function rs(s,t,i){const n=R(s.plane,t,L.get()),r=w(Is(s,s.basis1),n,-1,1,L.get()),e=w(Is(s,s.basis2),n,-1,1,L.get());return m(i,u(L.get(),r,e),s.origin),i}function es(s,t,i){const{origin:n,basis1:r,basis2:e}=s,o=m(L.get(),t,n),a=Y(r,o),c=Y(e,o),u=Y(ds(s),o);return g(i,a,c,u)}function os(s,t){const i=es(s,t,L.get()),{basis1:n,basis2:r}=s,e=f(n),o=f(r),a=Math.max(Math.abs(i[0])-e,0),c=Math.max(Math.abs(i[1])-o,0),u=i[2];return a*a+c*c+u*u}function as(s,t){return Math.sqrt(os(s,t))}function cs(s,t){let i=Number.NEGATIVE_INFINITY;for(const n of Ts){const r=ys(s,n,xs.get()),e=x(r,t);e>i&&(i=e)}return Math.sqrt(i)}function us(s,t){return k(s.plane,t)&&hs(s,t)}function gs(s,t,i,n){return js(s,i,n)}function bs(s,t){const i=-s.plane[3];return Y(ds(s),t)-i}function fs(s,t,i,n){const r=bs(s,t),e=c(Ms,ds(s),i-r);return u(n,t,e),n}function ps(s,t){return d(s.basis1,t.basis1)&&d(s.basis2,t.basis2)&&d(s.origin,t.origin)}function ls(s,t,i){return s!==i&&G(s,i),n(Vs,t),r(Vs,Vs),j(i.basis1,s.basis1,Vs),j(i.basis2,s.basis2,Vs),j(q(i.plane),q(s.plane),Vs),j(i.origin,s.origin,t),B(i.plane,i.plane,i.origin),i}function ms(s,t,i,n){return s!==n&&G(s,n),e(As,t,i),j(n.basis1,s.basis1,As),j(n.basis2,s.basis2,As),J(n),n}function ds(s){return q(s.plane)}function js(s,t,i){switch(t){case 0:a(i,s.basis1),I(i,i);break;case 1:a(i,s.basis2),I(i,i);break;case 2:a(i,ds(s))}return i}function hs(s,t){const i=m(L.get(),t,s.origin),n=h(s.basis1),r=h(s.basis2),e=l(s.basis1,i),o=l(s.basis2,i);return-e-n<0&&e-n<0&&-o-r<0&&o-r<0}function Is(s,t){const i=xs.get();return a(i.origin,s.origin),a(i.vector,t),i}function ys(s,t,i){const{basis1:n,basis2:r,origin:e}=s,o=c(L.get(),n,t.origin[0]),a=c(L.get(),r,t.origin[1]);u(i.origin,o,a),u(i.origin,i.origin,e);const g=c(L.get(),n,t.direction[0]),b=c(L.get(),r,t.direction[1]);return c(i.vector,u(g,g,b),2),i}function vs(s,t){Math.abs(l(s.basis1,s.basis2)/(f(s.basis1)*f(s.basis2)))>1e-6&&U().warn(t,"Provided basis vectors are not perpendicular"),Math.abs(l(s.basis1,ds(s)))>1e-6&&U().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-l(ds(s),s.origin)-s.plane[3])>1e-6&&U().warn(t,"Plane offset is not consistent with plane origin")}function Ps(s,t,i,n){const r=ds(s);A(r,t.direction,t.origin,i),A(q(i),r,t.origin,n)}const Ns={plane:S(),origin:y(0,0,0),basis1:y(1,0,0),basis2:y(0,1,0)},ws=new i(S),xs=new i(M),Ms=P(),Ss=new i(()=>z()),Ts=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],Vs=o(),As=o(),Es=Object.freeze(Object.defineProperty({__proto__:null,altitudeAt:bs,axisAt:gs,cameraFrustumCoverage:is,closestPoint:ns,closestPointOnSilhouette:ts,copy:G,copyWithoutVerify:W,create:z,distance:as,distance2:os,distanceToSilhouette:cs,elevate:K,equals:ps,extrusionContainsPoint:us,fromAABoundingRect:Z,fromValues:H,getExtent:X,intersectRay:$,intersectRayClosestSilhouette:ss,normal:ds,projectPoint:rs,projectPointLocal:es,rotate:ms,setAltitudeAt:fs,setExtent:Q,transform:ls,up:Ns,updateUnboundedPlane:J,wrap:D},Symbol.toStringTag,{value:"Module"}));export{gs as A,bs as B,fs as C,Ns as D,z as a,Es as b,is as c,G as d,us as e,H as f,ps as g,Z as h,$ as i,as as j,W as k,K as l,X as m,ds as n,ss as o,ts as p,ns as q,ms as r,Q as s,ls as t,J as u,rs as v,D as w,es as x,os as y,cs as z};
5
+ import"../core/has.js";import s from"../core/Logger.js";import{acosClamped as t}from"../core/mathUtils.js";import{ObjectStack as i}from"../core/ObjectStack.js";import{invert as n,transpose as r,fromRotation as e}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as a,j as c,i as u,h as g,C as b,b as f,D as p,g as l,e as m,m as d,p as j,E as h,n as I}from"./vec32.js";import{fromValues as y,clone as v,create as P}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as N}from"../geometry/support/aaBoundingRect.js";import{projectPointClamp as w,distance2 as x,create as M}from"../geometry/support/lineSegment.js";import{create as S,wrap as T,copy as V,fromVectorsAndPoint as A,fromValues as E,intersectRay as _,intersectLineSegment as O,intersectLineSegmentClamp as k,isPointInside as C,projectPoint as F,getNormal as R,setOffsetFromPoint as q}from"../geometry/support/plane.js";import{distance2 as B}from"../geometry/support/ray.js";import{projectPointSignedLength as Y}from"../geometry/support/vector.js";import{sv3d as L}from"../geometry/support/vectorStacks.js";const U=()=>s.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function z(s=Ns){return{plane:S(s.plane),origin:v(s.origin),basis1:v(s.basis1),basis2:v(s.basis2)}}function D(s,t,i){const n=Ss.get();return n.origin=s,n.basis1=t,n.basis2=i,n.plane=T(0,0,0,0),J(n),n}function G(s,t=z()){return H(s.origin,s.basis1,s.basis2,t)}function W(s,t){a(t.origin,s.origin),a(t.basis1,s.basis1),a(t.basis2,s.basis2),V(t.plane,s.plane)}function H(s,t,i,n=z()){return a(n.origin,s),a(n.basis1,t),a(n.basis2,i),J(n),vs(n,"fromValues()"),n}function J(s){A(s.basis2,s.basis1,s.origin,s.plane)}function K(s,t,i){s!==i&&G(s,i);const n=c(L.get(),ds(s),t);return u(i.origin,i.origin,n),i.plane[3]-=t,i}function Q(s,t,i){return Z(t,i),K(i,bs(s,s.origin),i),i}function X(s,t){const i=s.basis1[0],n=s.basis2[1],[r,e]=s.origin;return N(r-i,e-n,r+i,e+n,t)}function Z(s,t=z()){const i=(s[2]-s[0])/2,n=(s[3]-s[1])/2;return g(t.origin,s[0]+i,s[1]+n,0),g(t.basis1,i,0,0),g(t.basis2,0,n,0),E(0,0,1,0,t.plane),t}function $(s,t,i){return!!_(s.plane,t,i)&&hs(s,i)}function ss(s,t,i){if($(s,t,i))return i;const n=ts(s,t,L.get());return u(i,t.origin,c(L.get(),t.direction,b(t.origin,n)/f(t.direction))),i}function ts(s,i,n){const r=ws.get();Ps(s,i,r,ws.get());let e=Number.POSITIVE_INFINITY;for(const o of Ts){const c=ys(s,o,xs.get()),u=L.get();if(O(r,c,u)){const s=p(L.get(),i.origin,u),r=Math.abs(t(l(i.direction,s)));r<e&&(e=r,a(n,u))}}return e===Number.POSITIVE_INFINITY?ns(s,i,n):n}function is(s,t){return(t-s)/t}function ns(s,t,i){if($(s,t,i))return i;const n=ws.get(),r=ws.get();Ps(s,t,n,r);let e=Number.POSITIVE_INFINITY;for(const o of Ts){const c=ys(s,o,xs.get()),u=L.get();if(k(n,c,u)){const s=B(t,u);if(!C(r,u))continue;s<e&&(e=s,a(i,u))}}return os(s,t.origin)<e&&rs(s,t.origin,i),i}function rs(s,t,i){const n=F(s.plane,t,L.get()),r=w(Is(s,s.basis1),n,-1,1,L.get()),e=w(Is(s,s.basis2),n,-1,1,L.get());return m(i,u(L.get(),r,e),s.origin),i}function es(s,t,i){const{origin:n,basis1:r,basis2:e}=s,o=m(L.get(),t,n),a=Y(r,o),c=Y(e,o),u=Y(ds(s),o);return g(i,a,c,u)}function os(s,t){const i=es(s,t,L.get()),{basis1:n,basis2:r}=s,e=f(n),o=f(r),a=Math.max(Math.abs(i[0])-e,0),c=Math.max(Math.abs(i[1])-o,0),u=i[2];return a*a+c*c+u*u}function as(s,t){return Math.sqrt(os(s,t))}function cs(s,t){let i=Number.NEGATIVE_INFINITY;for(const n of Ts){const r=ys(s,n,xs.get()),e=x(r,t);e>i&&(i=e)}return Math.sqrt(i)}function us(s,t){return C(s.plane,t)&&hs(s,t)}function gs(s,t,i,n){return js(s,i,n)}function bs(s,t){const i=-s.plane[3];return Y(ds(s),t)-i}function fs(s,t,i,n){const r=bs(s,t),e=c(Ms,ds(s),i-r);return u(n,t,e),n}function ps(s,t){return d(s.basis1,t.basis1)&&d(s.basis2,t.basis2)&&d(s.origin,t.origin)}function ls(s,t,i){return s!==i&&G(s,i),n(Vs,t),r(Vs,Vs),j(i.basis1,s.basis1,Vs),j(i.basis2,s.basis2,Vs),j(R(i.plane),R(s.plane),Vs),j(i.origin,s.origin,t),q(i.plane,i.plane,i.origin),i}function ms(s,t,i,n){return s!==n&&G(s,n),e(As,t,i),j(n.basis1,s.basis1,As),j(n.basis2,s.basis2,As),J(n),n}function ds(s){return R(s.plane)}function js(s,t,i){switch(t){case 0:a(i,s.basis1),I(i,i);break;case 1:a(i,s.basis2),I(i,i);break;case 2:a(i,ds(s))}return i}function hs(s,t){const i=m(L.get(),t,s.origin),n=h(s.basis1),r=h(s.basis2),e=l(s.basis1,i),o=l(s.basis2,i);return-e-n<0&&e-n<0&&-o-r<0&&o-r<0}function Is(s,t){const i=xs.get();return a(i.origin,s.origin),a(i.vector,t),i}function ys(s,t,i){const{basis1:n,basis2:r,origin:e}=s,o=c(L.get(),n,t.origin[0]),a=c(L.get(),r,t.origin[1]);u(i.origin,o,a),u(i.origin,i.origin,e);const g=c(L.get(),n,t.direction[0]),b=c(L.get(),r,t.direction[1]);return c(i.vector,u(g,g,b),2),i}function vs(s,t){Math.abs(l(s.basis1,s.basis2)/(f(s.basis1)*f(s.basis2)))>1e-6&&U().warn(t,"Provided basis vectors are not perpendicular"),Math.abs(l(s.basis1,ds(s)))>1e-6&&U().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-l(ds(s),s.origin)-s.plane[3])>1e-6&&U().warn(t,"Plane offset is not consistent with plane origin")}function Ps(s,t,i,n){const r=ds(s);A(r,t.direction,t.origin,i),A(R(i),r,t.origin,n)}const Ns={plane:S(),origin:y(0,0,0),basis1:y(1,0,0),basis2:y(0,1,0)},ws=new i(S),xs=new i(M),Ms=P(),Ss=new i(()=>z()),Ts=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],Vs=o(),As=o(),Es=Object.freeze(Object.defineProperty({__proto__:null,altitudeAt:bs,axisAt:gs,cameraFrustumCoverage:is,closestPoint:ns,closestPointOnSilhouette:ts,copy:G,copyWithoutVerify:W,create:z,distance:as,distance2:os,distanceToSilhouette:cs,elevate:K,equals:ps,extrusionContainsPoint:us,fromAABoundingRect:Z,fromValues:H,getExtent:X,intersectRay:$,intersectRayClosestSilhouette:ss,normal:ds,projectPoint:rs,projectPointLocal:es,rotate:ms,setAltitudeAt:fs,setExtent:Q,transform:ls,up:Ns,updateUnboundedPlane:J,wrap:D},Symbol.toStringTag,{value:"Module"}));export{gs as A,bs as B,fs as C,Ns as D,z as a,Es as b,is as c,G as d,us as e,H as f,ps as g,Z as h,$ as i,as as j,W as k,K as l,X as m,ds as n,ss as o,ts as p,ns as q,ms as r,Q as s,ls as t,J as u,rs as v,D as w,es as x,os as y,cs as z};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{cyclical2PI as e}from"../core/Cyclical.js";import{deg2rad as t,rad2deg as r,asinClamped as o,lerp as s,clamp as n}from"../core/mathUtils.js";import{fromRotation as a,rotate as i}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as l,g as m,n as p,p as u,q as f,b as h,j as g,D as d,l as y,v as M,c as j}from"./vec32.js";import{fromValues as b,create as v,ZEROS as x,clone as T}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as w,d as C}from"./vec42.js";import{create as R}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as S}from"../core/libs/gl-matrix-2/math/common.js";import{getReferenceEllipsoid as U}from"../geometry/ellipsoidUtils.js";import P from"../geometry/Extent.js";import q from"../geometry/Polygon.js";import H from"../geometry/SpatialReference.js";import{isClockwise as I}from"../geometry/support/coordsUtils.js";import{fromPoints as A,create as E}from"../geometry/support/lineSegment.js";import{gcsCyclical as k}from"../geometry/support/normalizeUtils.js";import{fromPositionAndNormal as F,create as _,isPointInside as z,intersectLineOrRay as G,getNormal as W}from"../geometry/support/plane.js";import{wrap as D}from"../geometry/support/ray.js";import{Sphere as O}from"../geometry/support/sphere.js";import{geographicToWebMercator as L}from"../geometry/support/webMercatorUtils.js";import{Frustum as N}from"../views/3d/state/Frustum.js";import{minNearDistanceInMeters as B}from"../views/3d/state/NearFarHeuristic.js";import{createDirectionUp as J,directionToHeadingTilt as K,clampLineSegmentToPlane as Q}from"../views/3d/support/cameraUtilsInternal.js";import{getLonDeltaForDistance as V}from"../views/3d/support/earthUtils.js";import{slerp as X}from"../views/3d/support/mathUtils.js";const Y=b(0,0,1),Z=p(v(),b(1,1,1)),$=c(),ee=v(),te=v();function re(e,r,o,s=J()){l(ee,e,Y),0===m(ee,ee)&&l(ee,e,Z),a($,-t(r),e),i($,$,-t(o),ee);const{up:n,direction:c}=s;return l(n,ee,e),p(n,n),u(n,n,$),p(c,e),f(c,c),u(c,c,$),s}function oe(e,t,r,o){const s=ee,n=te;return p(s,e),l(te,s,Y),0===m(te,te)&&l(te,s,Z),l(n,te,s),K(t,r,o,s,n)}function se(e,r,s,n){const a={eye:v(),up:null,tilt:n,heading:s},i=ee;i[0]=e[0],i[1]=e[2],i[2]=-e[1];const c=r,l=t(s),m=t(n),p=Math.sin(l),u=Math.cos(l),f=Math.sin(m),d=Math.cos(m),y=h(i);let M;if(Math.abs(m)<1e-8)M=c+y;else{const e=y/f,t=o(c/e),r=Math.PI-m-t;M=e*Math.sin(r)}const j=d*c,b=c*c*(f*f),x=u*u*b,T=M-j,w=T*T,C=x*(x+w-i[1]*i[1]);if(C<0)return g(a.eye,i,M/y),a.tilt=0,ae(a,e);const R=Math.sqrt(C),S=i[1]*T,U=x+w;let P;if(P=u>0?-R+S:R+S,Math.abs(U)<1e-8)return y<1e-8?(a.eye[0]=0,a.eye[1]=0,a.eye[2]=c):g(a.eye,i,M/y),a.tilt=0,ne(a.eye),ae(a,e);a.eye[1]=P/U;const q=p*p*b,H=f*c,I=u*H*a.eye[1],A=a.eye[1]*a.eye[1],E=1-A,k=Math.sqrt(E),F=x*A+q-2*I*k*T+E*w;return Math.abs(F)<1e-8?(g(a.eye,i,M/y),a.tilt=0,ne(a.eye),ae(a,e)):(a.eye[0]=(E*(M*i[0]-j*i[0])-H*k*(i[0]*a.eye[1]*u+i[2]*p))/F,a.eye[2]=(E*(M*i[2]-j*i[2])-H*k*(i[2]*a.eye[1]*u-i[0]*p))/F,g(a.eye,a.eye,M),ne(a.eye),ae(a,e))}function ne(e){const t=e[1];e[1]=-e[2],e[2]=t}function ae(e,t){const r=re(t,e.heading,e.tilt);return e.up=r.up,e}function ie(e,t,s){const n=h(t),a=Math.sqrt(s*s+n*n-2*s*n*Math.cos(Math.PI-e)),i=o(s/(a/Math.sin(e)));return r(e-i)}function ce(e,r,s){const n=t(e),a=h(r);return o(s/(a/Math.sin(n)))+n}function le(o,s,n,a,i){let c,l,m,p;const u=s.latitude,f=U(o.spatialReference).radius,h=s.longitude,g=V(u,n,f)/2;c=h-g,l=h+g;const d=t(u),y=(1+Math.sin(d))/(1-Math.sin(d)),M=(y+1)*Math.tan(a/f/2),j=M*M;function b(t){const r=Math.PI/2;return(t=e.normalize(t,-r))>r&&(t=Math.PI-t),t}if(m=1.5*Math.PI-2*Math.atan(.5*(M+Math.sqrt(4*y+j))),p=m+a/f,m=b(m),p=b(p),p<m){const e=p;p=m,m=e}if(m=Math.max(r(m),-90),p=Math.min(r(p),90),l=k.monotonic(c,l),l-c>180){const e=(l-c-180)/2;c+=e,l-=e}const v=o.spatialReference&&o.spatialReference.isGeographic?o.spatialReference:H.WGS84;return i?(i.xmin=c,i.ymin=m,i.xmax=l,i.ymax=p,i.spatialReference=v):i=new P(c,m,l,p,v),o.spatialReference&&o.spatialReference.isWebMercator&&L(i,!1,i),i}function me(e,t){const{renderCoordsHelper:r}=e,o=e.state.camera.clone(),a=new N(r);o.near=B,a.update(o);const i=r.getAltitude(t),c=e.spatialReference,l=r.referenceEllipsoid.radius,m=o.eye,p=1+d(m,t)/(l+i),u=Math.sqrt(p*p-1),{minCurvature:f,maxCurvature:h,minSamples:g,maxSamples:j}=ge,b=he(e),v=n((u-f)/(h-f),0,1),R=Math.round(s(g,j,v)),S=o.aboveGround,U=a.planes[5],P=[],H=F(x,de,_()),I=F(x,ye,_());w(Te,0,0,0,0);const A=e=>{};for(let n=0;n<4;n++){const e=1===n&&!S||3===n&&S?1-b:0,t=1===n&&S||3===n&&!S?b:1,o=a.lines[n],c=a.lines[3===n?0:n+1];for(let a=0;a<R;a++){const l=a/R,p=0===a?0:s(e,t,1===n?1-(1-l)**2:3===n?l**2:l),u=y(je,o.origin,c.origin,p),f=X(o.direction,c.direction,p,Me);r.intersectManifoldClosestSilhouette(D(u,f),i,be),Q(be,m,be,U),P.push(T(be)),0!==P.length&&A(M(P.at(-1),be));const h=(z(H,be)?1:0)|(z(I,be)?2:0);Te[h]=1}}P.length>2&&A(M(P[0],P.at(-1)));const E=pe(C(Te)>1?ue(fe(P,H),I):[P],r,c);return new q({rings:E,spatialReference:c})}function pe(e,t,r){const o=2*S();return e.map(e=>{const s=[];let n=!1;for(const a of e)t.fromRenderCoords(a,be,r),Math.abs(a[0])<o&&Math.abs(a[1])<o?(s.push([null,be[1]]),s.push([null,be[1]]),n=!0):s.push([be[0],be[1]]);if(n)for(let t=0;t<s.length;t++){const e=s[t];if(null!=e[0])continue;const r=s[t+1],o=s.at(0===t?-1:t-1);e[0]=o[0],t++;const n=s.at(t===s.length-1?0:t+1);r[0]=n[0]}return s.push(s[0]),I(s)||s.reverse(),s})}function ue(e,t){const r=[];for(const o of e)r.push(...fe(o,t));return r}function fe(e,t){const r=[],o=[],s=S();for(let a=0;a<e.length;a++){const n=e[a],i=a===e.length-1?e[0]:e[a+1],c=A(n,i,xe),l=G(t,c.origin,c.vector,0,be);switch(l){case 2:r.push(n);break;case 3:o.push(n);break;case 0:case 1:{const[e,a,i]=0===l?[1,r,o]:[-1,o,r],c=W(t),m=j(v(),be,c,e*s),p=j(v(),be,c,e*-s);a.push(n),a.push(m),i.push(p)}}}const n=[];return r.length&&n.push(r),o.length&&n.push(o),n}function he(e){const{renderCoordsHelper:t,state:r}=e,o=Math.abs(t.getAltitude(r.camera.center));return ve.radius=t.referenceEllipsoid.radius+o,r.camera.sphereFrustumCoverage(ve,t)}const ge={minCurvature:t(5),maxCurvature:t(50),minSamples:1,maxSamples:6},de=b(1,0,0),ye=b(0,1,0),Me=v(),je=v(),be=v(),ve=new O,xe=E(),Te=R(),we=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:oe,eyeForCenterWithHeadingTilt:se,eyeTiltToLookAtTilt:ce,headingTiltToDirectionUp:re,lookAtTiltToEyeTilt:ie,toArea:me,toExtent:le},Symbol.toStringTag,{value:"Module"}));export{ce as a,me as b,we as c,oe as d,se as e,re as h,ie as l,le as t};
5
+ import{cyclical2PI as e}from"../core/Cyclical.js";import{deg2rad as t,rad2deg as r,asinClamped as o,lerp as s,clamp as n}from"../core/mathUtils.js";import{fromRotation as a,rotate as i}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as l,g as m,n as p,p as u,q as f,b as h,j as g,C as d,l as y,v as M,c as j}from"./vec32.js";import{fromValues as b,create as v,ZEROS as x,clone as T}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as C,d as w}from"./vec42.js";import{create as R}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as S}from"../core/libs/gl-matrix-2/math/common.js";import{getReferenceEllipsoid as U}from"../geometry/ellipsoidUtils.js";import P from"../geometry/Extent.js";import q from"../geometry/Polygon.js";import H from"../geometry/SpatialReference.js";import{isClockwise as I}from"../geometry/support/coordsUtils.js";import{fromPoints as A,create as E}from"../geometry/support/lineSegment.js";import{gcsCyclical as k}from"../geometry/support/normalizeUtils.js";import{fromPositionAndNormal as F,create as _,isPointInside as z,intersectLineOrRay as G,getNormal as W}from"../geometry/support/plane.js";import{wrap as O}from"../geometry/support/ray.js";import{Sphere as D}from"../geometry/support/sphere.js";import{geographicToWebMercator as L}from"../geometry/support/webMercatorUtils.js";import{Frustum as N}from"../views/3d/state/Frustum.js";import{minNearDistanceInMeters as B}from"../views/3d/state/NearFarHeuristic.js";import{createDirectionUp as J,directionToHeadingTilt as K,clampLineSegmentToPlane as Q}from"../views/3d/support/cameraUtilsInternal.js";import{getLonDeltaForDistance as V}from"../views/3d/support/earthUtils.js";import{slerp as X}from"../views/3d/support/mathUtils.js";const Y=b(0,0,1),Z=p(v(),b(1,1,1)),$=c(),ee=v(),te=v();function re(e,r,o,s=J()){l(ee,e,Y),0===m(ee,ee)&&l(ee,e,Z),a($,-t(r),e),i($,$,-t(o),ee);const{up:n,direction:c}=s;return l(n,ee,e),p(n,n),u(n,n,$),p(c,e),f(c,c),u(c,c,$),s}function oe(e,t,r,o){const s=ee,n=te;return p(s,e),l(te,s,Y),0===m(te,te)&&l(te,s,Z),l(n,te,s),K(t,r,o,s,n)}function se(e,r,s,n){const a={eye:v(),up:null,tilt:n,heading:s},i=ee;i[0]=e[0],i[1]=e[2],i[2]=-e[1];const c=r,l=t(s),m=t(n),p=Math.sin(l),u=Math.cos(l),f=Math.sin(m),d=Math.cos(m),y=h(i);let M;if(Math.abs(m)<1e-8)M=c+y;else{const e=y/f,t=o(c/e),r=Math.PI-m-t;M=e*Math.sin(r)}const j=d*c,b=c*c*(f*f),x=u*u*b,T=M-j,C=T*T,w=x*(x+C-i[1]*i[1]);if(w<0)return g(a.eye,i,M/y),a.tilt=0,ae(a,e);const R=Math.sqrt(w),S=i[1]*T,U=x+C;let P;if(P=u>0?-R+S:R+S,Math.abs(U)<1e-8)return y<1e-8?(a.eye[0]=0,a.eye[1]=0,a.eye[2]=c):g(a.eye,i,M/y),a.tilt=0,ne(a.eye),ae(a,e);a.eye[1]=P/U;const q=p*p*b,H=f*c,I=u*H*a.eye[1],A=a.eye[1]*a.eye[1],E=1-A,k=Math.sqrt(E),F=x*A+q-2*I*k*T+E*C;return Math.abs(F)<1e-8?(g(a.eye,i,M/y),a.tilt=0,ne(a.eye),ae(a,e)):(a.eye[0]=(E*(M*i[0]-j*i[0])-H*k*(i[0]*a.eye[1]*u+i[2]*p))/F,a.eye[2]=(E*(M*i[2]-j*i[2])-H*k*(i[2]*a.eye[1]*u-i[0]*p))/F,g(a.eye,a.eye,M),ne(a.eye),ae(a,e))}function ne(e){const t=e[1];e[1]=-e[2],e[2]=t}function ae(e,t){const r=re(t,e.heading,e.tilt);return e.up=r.up,e}function ie(e,t,s){const n=h(t),a=Math.sqrt(s*s+n*n-2*s*n*Math.cos(Math.PI-e)),i=o(s/(a/Math.sin(e)));return r(e-i)}function ce(e,r,s){const n=t(e),a=h(r);return o(s/(a/Math.sin(n)))+n}function le(o,s,n,a,i){let c,l,m,p;const u=s.latitude,f=U(o.spatialReference).radius,h=s.longitude,g=V(u,n,f)/2;c=h-g,l=h+g;const d=t(u),y=(1+Math.sin(d))/(1-Math.sin(d)),M=(y+1)*Math.tan(a/f/2),j=M*M;function b(t){const r=Math.PI/2;return(t=e.normalize(t,-r))>r&&(t=Math.PI-t),t}if(m=1.5*Math.PI-2*Math.atan(.5*(M+Math.sqrt(4*y+j))),p=m+a/f,m=b(m),p=b(p),p<m){const e=p;p=m,m=e}if(m=Math.max(r(m),-90),p=Math.min(r(p),90),l=k.monotonic(c,l),l-c>180){const e=(l-c-180)/2;c+=e,l-=e}const v=o.spatialReference&&o.spatialReference.isGeographic?o.spatialReference:H.WGS84;return i?(i.xmin=c,i.ymin=m,i.xmax=l,i.ymax=p,i.spatialReference=v):i=new P(c,m,l,p,v),o.spatialReference&&o.spatialReference.isWebMercator&&L(i,!1,i),i}function me(e,t){const{renderCoordsHelper:r}=e,o=e.state.camera.clone(),a=new N(r);o.near=B,a.update(o);const i=r.getAltitude(t),c=e.spatialReference,l=r.referenceEllipsoid.radius,m=o.eye,p=1+d(m,t)/(l+i),u=Math.sqrt(p*p-1),{minCurvature:f,maxCurvature:h,minSamples:g,maxSamples:j}=ge,b=he(e),v=n((u-f)/(h-f),0,1),R=Math.round(s(g,j,v)),S=o.aboveGround,U=a.planes[5],P=[],H=F(x,de,_()),I=F(x,ye,_());C(Te,0,0,0,0);const A=e=>{};for(let n=0;n<4;n++){const e=1===n&&!S||3===n&&S?1-b:0,t=1===n&&S||3===n&&!S?b:1,o=a.lines[n],c=a.lines[3===n?0:n+1];for(let a=0;a<R;a++){const l=a/R,p=0===a?0:s(e,t,1===n?1-(1-l)**2:3===n?l**2:l),u=y(je,o.origin,c.origin,p),f=X(o.direction,c.direction,p,Me);r.intersectManifoldClosestSilhouette(O(u,f),i,be),Q(be,m,be,U),P.push(T(be)),0!==P.length&&A(M(P.at(-1),be));const h=(z(H,be)?1:0)|(z(I,be)?2:0);Te[h]=1}}P.length>2&&A(M(P[0],P.at(-1)));const E=pe(w(Te)>1?ue(fe(P,H),I):[P],r,c);return new q({rings:E,spatialReference:c})}function pe(e,t,r){const o=2*S();return e.map(e=>{const s=[];let n=!1;for(const a of e)t.fromRenderCoords(a,be,r),Math.abs(a[0])<o&&Math.abs(a[1])<o?(s.push([null,be[1]]),s.push([null,be[1]]),n=!0):s.push([be[0],be[1]]);if(n)for(let t=0;t<s.length;t++){const e=s[t];if(null!=e[0])continue;const r=s[t+1],o=s.at(0===t?-1:t-1);e[0]=o[0],t++;const n=s.at(t===s.length-1?0:t+1);r[0]=n[0]}return s.push(s[0]),I(s)||s.reverse(),s})}function ue(e,t){const r=[];for(const o of e)r.push(...fe(o,t));return r}function fe(e,t){const r=[],o=[],s=S();for(let a=0;a<e.length;a++){const n=e[a],i=a===e.length-1?e[0]:e[a+1],c=A(n,i,xe),l=G(t,c.origin,c.vector,0,be);switch(l){case 2:r.push(n);break;case 3:o.push(n);break;case 0:case 1:{const[e,a,i]=0===l?[1,r,o]:[-1,o,r],c=W(t),m=j(v(),be,c,e*s),p=j(v(),be,c,e*-s);a.push(n),a.push(m),i.push(p)}}}const n=[];return r.length&&n.push(r),o.length&&n.push(o),n}function he(e){const{renderCoordsHelper:t,state:r}=e,o=Math.abs(t.getAltitude(r.camera.center));return ve.radius=t.referenceEllipsoid.radius+o,r.camera.sphereFrustumCoverage(ve,t)}const ge={minCurvature:t(5),maxCurvature:t(50),minSamples:1,maxSamples:6},de=b(1,0,0),ye=b(0,1,0),Me=v(),je=v(),be=v(),ve=new D,xe=E(),Te=R(),Ce=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:oe,eyeForCenterWithHeadingTilt:se,eyeTiltToLookAtTilt:ce,headingTiltToDirectionUp:re,lookAtTiltToEyeTilt:ie,toArea:me,toExtent:le},Symbol.toStringTag,{value:"Module"}));export{ce as a,me as b,Ce as c,oe as d,se as e,re as h,ie as l,le as t};
package/chunks/vec32.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as n,RANDOM as a}from"../core/libs/gl-matrix-2/math/common.js";function r(t){const n=t[0],a=t[1],r=t[2];return Math.sqrt(n*n+a*a+r*r)}function s(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function o(t,n,a,r){return t[0]=n,t[1]=a,t[2]=r,t}function u(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t}function c(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t}function e(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t}function i(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t}function h(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function M(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function f(t,n){return t[0]=Math.abs(n[0]),t[1]=Math.abs(n[1]),t[2]=Math.abs(n[2]),t}function m(t,n){return t[0]=Math.sign(n[0]),t[1]=Math.sign(n[1]),t[2]=Math.sign(n[2]),t}function l(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t}function d(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t}function b(t,n=0,a=1){return t[0]=Math.min(Math.max(t[0],n),a),t[1]=Math.min(Math.max(t[1],n),a),t[2]=Math.min(Math.max(t[2],n),a),t}function x(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function g(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t}function q(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t}function p(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2];return Math.sqrt(a*a+r*r+s*s)}function v(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2];return a*a+r*r+s*s}function j(t){const n=t[0],a=t[1],r=t[2];return n*n+a*a+r*r}function y(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function z(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function A(t,n){const a=n[0],r=n[1],s=n[2];let o=a*a+r*r+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=n[0]*o,t[1]=n[1]*o,t[2]=n[2]*o),t}function P(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function _(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],c=a[1],e=a[2];return t[0]=s*e-o*c,t[1]=o*u-r*e,t[2]=r*c-s*u,t}function D(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],c=a[1],e=a[2],i=s*e-o*c,h=o*u-r*e,M=r*c-s*u,f=Math.sqrt(i*i+h*h+M*M);return t[0]=i/f,t[1]=h/f,t[2]=M/f,t}function I(t,n,a,r){const s=n[0],o=n[1],u=n[2];return t[0]=s+r*(a[0]-s),t[1]=o+r*(a[1]-o),t[2]=u+r*(a[2]-u),t}function L(t,n,a,r,s,o){const u=o*o,c=u*(2*o-3)+1,e=u*(o-2)+o,i=u*(o-1),h=u*(3-2*o);return t[0]=n[0]*c+a[0]*e+r[0]*i+s[0]*h,t[1]=n[1]*c+a[1]*e+r[1]*i+s[1]*h,t[2]=n[2]*c+a[2]*e+r[2]*i+s[2]*h,t}function O(t,n,a,r,s,o){const u=1-o,c=u*u,e=o*o,i=c*u,h=3*o*c,M=3*e*u,f=e*o;return t[0]=n[0]*i+a[0]*h+r[0]*M+s[0]*f,t[1]=n[1]*i+a[1]*h+r[1]*M+s[1]*f,t[2]=n[2]*i+a[2]*h+r[2]*M+s[2]*f,t}function S(t,n=1){const r=a,s=2*r()*Math.PI,o=2*r()-1,u=Math.sqrt(1-o*o)*n;return t[0]=Math.cos(s)*u,t[1]=Math.sin(s)*u,t[2]=o*n,t}function E(t,n,a){const r=n[0],s=n[1],o=n[2];return t[0]=a[0]*r+a[4]*s+a[8]*o+a[12],t[1]=a[1]*r+a[5]*s+a[9]*o+a[13],t[2]=a[2]*r+a[6]*s+a[10]*o+a[14],t}function N(t,n,a){const r=n[0],s=n[1],o=n[2];return t[0]=r*a[0]+s*a[3]+o*a[6],t[1]=r*a[1]+s*a[4]+o*a[7],t[2]=r*a[2]+s*a[5]+o*a[8],t}function Q(t,n,a){const r=a[0],s=a[1],o=a[2],u=a[3],c=n[0],e=n[1],i=n[2],h=s*i-o*e,M=o*c-r*i,f=r*e-s*c,m=s*f-o*M,l=o*h-r*f,d=r*M-s*h,b=2*u;return t[0]=c+h*b+2*m,t[1]=e+M*b+2*l,t[2]=i+f*b+2*d,t}function T(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[0],o[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),o[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function k(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),o[1]=s[1],o[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function w(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),o[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),o[2]=s[2],t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function B(t,n){A(C,t),A(F,n);const a=P(C,F);return a>1?0:a<-1?Math.PI:Math.acos(a)}const C=t(),F=t();function G(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function H(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function J(t,a){if(t===a)return!0;const r=t[0],s=t[1],o=t[2],u=a[0],c=a[1],e=a[2],i=n();return Math.abs(r-u)<=i*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(o-e)<=i*Math.max(1,Math.abs(o),Math.abs(e))}function K(t,n,a){const r=a[0]-n[0],s=a[1]-n[1],o=a[2]-n[2];let u=r*r+s*s+o*o;return u>0?(u=1/Math.sqrt(u),t[0]=r*u,t[1]=s*u,t[2]=o*u,t):(t[0]=0,t[1]=0,t[2]=0,t)}const R=c,U=e,V=i,W=p,X=v,Y=r,Z=j,$=Object.freeze(Object.defineProperty({__proto__:null,abs:f,add:u,angle:B,bezier:O,ceil:h,clamp:b,copy:s,cross:_,crossAndNormalize:D,direction:K,dist:W,distance:p,div:V,divide:i,dot:P,equals:J,exactEquals:H,floor:M,hermite:L,inverse:z,len:Y,length:r,lerp:I,max:d,min:l,mul:U,multiply:e,negate:y,normalize:A,random:S,rotateX:T,rotateY:k,rotateZ:w,round:x,scale:g,scaleAndAdd:q,set:o,sign:m,sqrDist:X,sqrLen:Z,squaredDistance:v,squaredLength:j,str:G,sub:R,subtract:c,transformMat3:N,transformMat4:E,transformQuat:Q},Symbol.toStringTag,{value:"Module"}));export{e as A,Y as B,i as C,p as D,K as E,j as F,J as G,W as H,$ as I,M as J,w as K,h as L,b as M,x as N,D as O,L as P,O as Q,S as R,T as S,k as T,G as U,U as V,V as W,R as a,r as b,q as c,s as d,c as e,_ as f,P as g,o as h,u as i,g as j,B as k,I as l,H as m,A as n,z as o,E as p,y as q,Q as r,v as s,N as t,f as u,X as v,Z as w,d as x,l as y,m as z};
5
+ import{create as t}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as n,RANDOM as a}from"../core/libs/gl-matrix-2/math/common.js";function r(t){const n=t[0],a=t[1],r=t[2];return Math.sqrt(n*n+a*a+r*r)}function s(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function o(t,n,a,r){return t[0]=n,t[1]=a,t[2]=r,t}function u(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t}function c(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t}function e(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t}function i(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t}function h(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function M(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function f(t,n){return t[0]=Math.abs(n[0]),t[1]=Math.abs(n[1]),t[2]=Math.abs(n[2]),t}function m(t,n){return t[0]=Math.sign(n[0]),t[1]=Math.sign(n[1]),t[2]=Math.sign(n[2]),t}function l(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t}function d(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t}function b(t,n=0,a=1){return t[0]=Math.min(Math.max(t[0],n),a),t[1]=Math.min(Math.max(t[1],n),a),t[2]=Math.min(Math.max(t[2],n),a),t}function x(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function g(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t}function q(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t}function p(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2];return Math.sqrt(a*a+r*r+s*s)}function v(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2];return a*a+r*r+s*s}function j(t){const n=t[0],a=t[1],r=t[2];return n*n+a*a+r*r}function y(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function z(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function A(t,n){const a=n[0],r=n[1],s=n[2];let o=a*a+r*r+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=n[0]*o,t[1]=n[1]*o,t[2]=n[2]*o),t}function P(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function _(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],c=a[1],e=a[2];return t[0]=s*e-o*c,t[1]=o*u-r*e,t[2]=r*c-s*u,t}function D(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],c=a[1],e=a[2],i=s*e-o*c,h=o*u-r*e,M=r*c-s*u,f=Math.sqrt(i*i+h*h+M*M);return t[0]=i/f,t[1]=h/f,t[2]=M/f,t}function I(t,n,a,r){const s=n[0],o=n[1],u=n[2];return t[0]=s+r*(a[0]-s),t[1]=o+r*(a[1]-o),t[2]=u+r*(a[2]-u),t}function L(t,n,a,r,s,o){const u=o*o,c=u*(2*o-3)+1,e=u*(o-2)+o,i=u*(o-1),h=u*(3-2*o);return t[0]=n[0]*c+a[0]*e+r[0]*i+s[0]*h,t[1]=n[1]*c+a[1]*e+r[1]*i+s[1]*h,t[2]=n[2]*c+a[2]*e+r[2]*i+s[2]*h,t}function O(t,n,a,r,s,o){const u=1-o,c=u*u,e=o*o,i=c*u,h=3*o*c,M=3*e*u,f=e*o;return t[0]=n[0]*i+a[0]*h+r[0]*M+s[0]*f,t[1]=n[1]*i+a[1]*h+r[1]*M+s[1]*f,t[2]=n[2]*i+a[2]*h+r[2]*M+s[2]*f,t}function S(t,n=1){const r=a,s=2*r()*Math.PI,o=2*r()-1,u=Math.sqrt(1-o*o)*n;return t[0]=Math.cos(s)*u,t[1]=Math.sin(s)*u,t[2]=o*n,t}function E(t,n,a){const r=n[0],s=n[1],o=n[2];return t[0]=a[0]*r+a[4]*s+a[8]*o+a[12],t[1]=a[1]*r+a[5]*s+a[9]*o+a[13],t[2]=a[2]*r+a[6]*s+a[10]*o+a[14],t}function N(t,n,a){const r=n[0],s=n[1],o=n[2];return t[0]=r*a[0]+s*a[3]+o*a[6],t[1]=r*a[1]+s*a[4]+o*a[7],t[2]=r*a[2]+s*a[5]+o*a[8],t}function Q(t,n,a){const r=a[0],s=a[1],o=a[2],u=a[3],c=n[0],e=n[1],i=n[2],h=s*i-o*e,M=o*c-r*i,f=r*e-s*c,m=s*f-o*M,l=o*h-r*f,d=r*M-s*h,b=2*u;return t[0]=c+h*b+2*m,t[1]=e+M*b+2*l,t[2]=i+f*b+2*d,t}function T(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[0],o[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),o[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function k(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),o[1]=s[1],o[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function w(t,n,a,r){const s=[],o=[];return s[0]=n[0]-a[0],s[1]=n[1]-a[1],s[2]=n[2]-a[2],o[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),o[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),o[2]=s[2],t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function B(t,n){A(C,t),A(F,n);const a=P(C,F);return a>1?0:a<-1?Math.PI:Math.acos(a)}const C=t(),F=t();function G(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function H(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function J(t,a){if(t===a)return!0;const r=t[0],s=t[1],o=t[2],u=a[0],c=a[1],e=a[2],i=n();return Math.abs(r-u)<=i*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(o-e)<=i*Math.max(1,Math.abs(o),Math.abs(e))}function K(t,n,a){const r=a[0]-n[0],s=a[1]-n[1],o=a[2]-n[2];let u=r*r+s*s+o*o;return u>0?(u=1/Math.sqrt(u),t[0]=r*u,t[1]=s*u,t[2]=o*u,t):(t[0]=0,t[1]=0,t[2]=0,t)}const R=c,U=e,V=i,W=p,X=v,Y=r,Z=j,$=Object.freeze(Object.defineProperty({__proto__:null,abs:f,add:u,angle:B,bezier:O,ceil:h,clamp:b,copy:s,cross:_,crossAndNormalize:D,direction:K,dist:W,distance:p,div:V,divide:i,dot:P,equals:J,exactEquals:H,floor:M,hermite:L,inverse:z,len:Y,length:r,lerp:I,max:d,min:l,mul:U,multiply:e,negate:y,normalize:A,random:S,rotateX:T,rotateY:k,rotateZ:w,round:x,scale:g,scaleAndAdd:q,set:o,sign:m,sqrDist:X,sqrLen:Z,squaredDistance:v,squaredLength:j,str:G,sub:R,subtract:c,transformMat3:N,transformMat4:E,transformQuat:Q},Symbol.toStringTag,{value:"Module"}));export{e as A,i as B,p as C,K as D,j as E,J as F,W as G,Y as H,$ as I,M as J,w as K,h as L,b as M,x as N,D as O,L as P,O as Q,S as R,T as S,k as T,G as U,U as V,V as W,R as a,r as b,q as c,s as d,c as e,_ as f,P as g,o as h,u as i,g as j,B as k,I as l,H as m,A as n,z as o,E as p,y as q,Q as r,v as s,N as t,f as u,X as v,Z as w,d as x,l as y,m as z};
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.36";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.37";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
package/core/has.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("workers-pool-size",8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-fast-triangulation-enabled",!0),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("parquetlayer-full-query-feature-count",2e4),has.add("parquetlayer-hittest-max-feature-count",1),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",50),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",4),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:basemap-groundlayers",!0),!has("host-webworker")&&has("host-browser")&&(has.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),has.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();export{has as default};
5
+ const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("workers-pool-size",8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-fast-triangulation-enabled",!0),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("parquetlayer-full-query-feature-count",2e4),has.add("parquetlayer-hittest-max-feature-count",1),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",50),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",4),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:basemap-groundlayers",!0),has.add("enable-feature:oit-ground",!1),!has("host-webworker")&&has("host-browser")&&(has.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),has.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();export{has as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- function n(n){const t=[];return function*(){yield*t;let e,l=t.length;for(;!(e=n.next()).done;)for(t.push(e.value),yield e.value;++l<t.length;)yield t[l]}}const t=Object.freeze({done:!0,value:void 0});function e(n){const e=[];let l=null,o=null,u=!1;async function r(){if(u)return t;if(null!=o)return o;o=n.next();try{const n=await o;return o=null,n.done?(u=!0,t):(e.push(n.value),n)}catch(r){throw u=!0,o=null,l=r,r}}return async function*(){yield*e;let n,t=e.length;for(;!(n=await r()).done;)for(yield n.value;++t<e.length;)yield e[t];if(null!=l)throw l}}function l(n,t){for(const e of n)if(null!=e&&t(e))return e}function o(n){return null!=n&&"function"==typeof n[Symbol.iterator]}export{n as cache,e as cacheAsync,l as find,o as isIterable};
5
+ function n(n){const t=[];return function*(){yield*t;let e,l=t.length;for(;!(e=n.next()).done;)for(t.push(e.value),yield e.value;++l<t.length;)yield t[l]}}const t=Object.freeze({done:!0,value:void 0});function e(n){const e=[];let l=null,o=null,u=!1;async function r(){if(u)return t;if(null!=o)return o;o=n.next();try{const n=await o;return o=null,n.done?(u=!0,t):(e.push(n.value),n)}catch(r){throw u=!0,o=null,l=r,r}}return async function*(){yield*e;let n,t=e.length;for(;!(n=await r()).done;)for(yield n.value;++t<e.length;)yield e[t];if(null!=l)throw l}}function l(n,t){for(const e of n)if(null!=e&&t(e))return e}function o(n){return null!=n&&"function"==typeof n[Symbol.iterator]}function u(n){return n.done?void 0:n.value}export{n as cache,e as cacheAsync,l as find,u as getYieldedValue,o as isIterable};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../factories/mat3f64.js";import{create as n}from"../factories/quatf64.js";import{fromValues as s,create as o}from"../factories/vec3f64.js";import{getEpsilon as a,RANDOM as r}from"./common.js";import{g as e,f as c,B as i,n as u}from"../../../../chunks/vec32.js";import{c as h,a as M,n as f,f as l,i as m,s as p,h as q,l as j,j as d,d as g,e as P}from"../../../../chunks/vec42.js";function I(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function v(t,n,s){s*=.5;const o=Math.sin(s);return t[0]=o*n[0],t[1]=o*n[1],t[2]=o*n[2],t[3]=Math.cos(s),t}function x(t,n){const s=2*Math.acos(n[3]),o=Math.sin(s/2);return o>a()?(t[0]=n[0]/o,t[1]=n[1]/o,t[2]=n[2]/o):(t[0]=1,t[1]=0,t[2]=0),s}function y(t,n,s){const o=n[0],a=n[1],r=n[2],e=n[3],c=s[0],i=s[1],u=s[2],h=s[3];return t[0]=o*h+e*c+a*u-r*i,t[1]=a*h+e*i+r*c-o*u,t[2]=r*h+e*u+o*i-a*c,t[3]=e*h-o*c-a*i-r*u,t}function A(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+e*c,t[1]=a*i+r*c,t[2]=r*i-a*c,t[3]=e*i-o*c,t}function b(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i-r*c,t[1]=a*i+e*c,t[2]=r*i+o*c,t[3]=e*i-a*c,t}function _(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+a*c,t[1]=a*i-o*c,t[2]=r*i+e*c,t[3]=e*i-r*c,t}function k(t,n){const s=n[0],o=n[1],a=n[2];return t[0]=s,t[1]=o,t[2]=a,t[3]=Math.sqrt(Math.abs(1-s*s-o*o-a*a)),t}function z(t,n,s,o){const r=n[0],e=n[1],c=n[2],i=n[3];let u,h,M,f,l,m=s[0],p=s[1],q=s[2],j=s[3];return h=r*m+e*p+c*q+i*j,h<0&&(h=-h,m=-m,p=-p,q=-q,j=-j),1-h>a()?(u=Math.acos(h),M=Math.sin(u),f=Math.sin((1-o)*u)/M,l=Math.sin(o*u)/M):(f=1-o,l=o),t[0]=f*r+l*m,t[1]=f*e+l*p,t[2]=f*c+l*q,t[3]=f*i+l*j,t}function E(t){const n=r,s=n(),o=n(),a=n(),e=Math.sqrt(1-s),c=Math.sqrt(s);return t[0]=e*Math.sin(2*Math.PI*o),t[1]=e*Math.cos(2*Math.PI*o),t[2]=c*Math.sin(2*Math.PI*a),t[3]=c*Math.cos(2*Math.PI*a),t}function L(t,n){const s=n[0],o=n[1],a=n[2],r=n[3],e=s*s+o*o+a*a+r*r,c=e?1/e:0;return t[0]=-s*c,t[1]=-o*c,t[2]=-a*c,t[3]=r*c,t}function O(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function S(t,n){const s=n[0]+n[4]+n[8];let o;if(s>0)o=Math.sqrt(s+1),t[3]=.5*o,o=.5/o,t[0]=(n[5]-n[7])*o,t[1]=(n[6]-n[2])*o,t[2]=(n[1]-n[3])*o;else{let s=0;n[4]>n[0]&&(s=1),n[8]>n[3*s+s]&&(s=2);const a=(s+1)%3,r=(s+2)%3;o=Math.sqrt(n[3*s+s]-n[3*a+a]-n[3*r+r]+1),t[s]=.5*o,o=.5/o,t[3]=(n[3*a+r]-n[3*r+a])*o,t[a]=(n[3*a+s]+n[3*s+a])*o,t[r]=(n[3*r+s]+n[3*s+r])*o}return t}function T(t,n,s,o){const a=.5*Math.PI/180;n*=a,s*=a,o*=a;const r=Math.sin(n),e=Math.cos(n),c=Math.sin(s),i=Math.cos(s),u=Math.sin(o),h=Math.cos(o);return t[0]=r*i*h-e*c*u,t[1]=e*c*h+r*i*u,t[2]=e*i*u-r*c*h,t[3]=e*i*h+r*c*u,t}function B(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}const W=l,X=h,Y=m,Z=y,w=p,C=q,D=j,F=d,G=F,H=g,J=H,K=f,N=M,Q=P;function R(t,n,s){const o=e(n,s);return o<-.999999?(c(U,V,n),i(U)<1e-6&&c(U,$,n),u(U,U),v(t,U,Math.PI),t):o>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(c(U,n,s),t[0]=U[0],t[1]=U[1],t[2]=U[2],t[3]=1+o,K(t,t))}const U=o(),V=s(1,0,0),$=s(0,1,0);function tt(t,n,s,o,a,r){return z(nt,n,a,r),z(st,s,o,r),z(t,nt,st,2*r*(1-r)),t}const nt=n(),st=n();function ot(t,n,s,o){const a=at;return a[0]=s[0],a[3]=s[1],a[6]=s[2],a[1]=o[0],a[4]=o[1],a[7]=o[2],a[2]=-n[0],a[5]=-n[1],a[8]=-n[2],K(t,S(t,a))}const at=t(),rt=Object.freeze(Object.defineProperty({__proto__:null,add:Y,calculateW:k,conjugate:O,copy:W,dot:C,equals:Q,exactEquals:N,fromEuler:T,fromMat3:S,getAxisAngle:x,identity:I,invert:L,len:G,length:F,lerp:D,mul:Z,multiply:y,normalize:K,random:E,rotateX:A,rotateY:b,rotateZ:_,rotationTo:R,scale:w,set:X,setAxes:ot,setAxisAngle:v,slerp:z,sqlerp:tt,sqrLen:J,squaredLength:H,str:B},Symbol.toStringTag,{value:"Module"}));export{Y as add,k as calculateW,O as conjugate,W as copy,C as dot,Q as equals,N as exactEquals,T as fromEuler,S as fromMat3,x as getAxisAngle,I as identity,L as invert,G as len,F as length,D as lerp,Z as mul,y as multiply,K as normalize,rt as q,E as random,A as rotateX,b as rotateY,_ as rotateZ,R as rotationTo,w as scale,X as set,ot as setAxes,v as setAxisAngle,z as slerp,tt as sqlerp,J as sqrLen,H as squaredLength,B as str};
5
+ import{create as t}from"../factories/mat3f64.js";import{create as n}from"../factories/quatf64.js";import{fromValues as s,create as o}from"../factories/vec3f64.js";import{getEpsilon as a,RANDOM as r}from"./common.js";import{g as e,f as c,H as i,n as u}from"../../../../chunks/vec32.js";import{c as h,a as M,n as f,f as l,i as m,s as p,h as q,l as j,j as d,d as g,e as P}from"../../../../chunks/vec42.js";function I(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function v(t,n,s){s*=.5;const o=Math.sin(s);return t[0]=o*n[0],t[1]=o*n[1],t[2]=o*n[2],t[3]=Math.cos(s),t}function x(t,n){const s=2*Math.acos(n[3]),o=Math.sin(s/2);return o>a()?(t[0]=n[0]/o,t[1]=n[1]/o,t[2]=n[2]/o):(t[0]=1,t[1]=0,t[2]=0),s}function y(t,n,s){const o=n[0],a=n[1],r=n[2],e=n[3],c=s[0],i=s[1],u=s[2],h=s[3];return t[0]=o*h+e*c+a*u-r*i,t[1]=a*h+e*i+r*c-o*u,t[2]=r*h+e*u+o*i-a*c,t[3]=e*h-o*c-a*i-r*u,t}function A(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+e*c,t[1]=a*i+r*c,t[2]=r*i-a*c,t[3]=e*i-o*c,t}function b(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i-r*c,t[1]=a*i+e*c,t[2]=r*i+o*c,t[3]=e*i-a*c,t}function _(t,n,s){s*=.5;const o=n[0],a=n[1],r=n[2],e=n[3],c=Math.sin(s),i=Math.cos(s);return t[0]=o*i+a*c,t[1]=a*i-o*c,t[2]=r*i+e*c,t[3]=e*i-r*c,t}function k(t,n){const s=n[0],o=n[1],a=n[2];return t[0]=s,t[1]=o,t[2]=a,t[3]=Math.sqrt(Math.abs(1-s*s-o*o-a*a)),t}function z(t,n,s,o){const r=n[0],e=n[1],c=n[2],i=n[3];let u,h,M,f,l,m=s[0],p=s[1],q=s[2],j=s[3];return h=r*m+e*p+c*q+i*j,h<0&&(h=-h,m=-m,p=-p,q=-q,j=-j),1-h>a()?(u=Math.acos(h),M=Math.sin(u),f=Math.sin((1-o)*u)/M,l=Math.sin(o*u)/M):(f=1-o,l=o),t[0]=f*r+l*m,t[1]=f*e+l*p,t[2]=f*c+l*q,t[3]=f*i+l*j,t}function E(t){const n=r,s=n(),o=n(),a=n(),e=Math.sqrt(1-s),c=Math.sqrt(s);return t[0]=e*Math.sin(2*Math.PI*o),t[1]=e*Math.cos(2*Math.PI*o),t[2]=c*Math.sin(2*Math.PI*a),t[3]=c*Math.cos(2*Math.PI*a),t}function L(t,n){const s=n[0],o=n[1],a=n[2],r=n[3],e=s*s+o*o+a*a+r*r,c=e?1/e:0;return t[0]=-s*c,t[1]=-o*c,t[2]=-a*c,t[3]=r*c,t}function O(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function S(t,n){const s=n[0]+n[4]+n[8];let o;if(s>0)o=Math.sqrt(s+1),t[3]=.5*o,o=.5/o,t[0]=(n[5]-n[7])*o,t[1]=(n[6]-n[2])*o,t[2]=(n[1]-n[3])*o;else{let s=0;n[4]>n[0]&&(s=1),n[8]>n[3*s+s]&&(s=2);const a=(s+1)%3,r=(s+2)%3;o=Math.sqrt(n[3*s+s]-n[3*a+a]-n[3*r+r]+1),t[s]=.5*o,o=.5/o,t[3]=(n[3*a+r]-n[3*r+a])*o,t[a]=(n[3*a+s]+n[3*s+a])*o,t[r]=(n[3*r+s]+n[3*s+r])*o}return t}function T(t,n,s,o){const a=.5*Math.PI/180;n*=a,s*=a,o*=a;const r=Math.sin(n),e=Math.cos(n),c=Math.sin(s),i=Math.cos(s),u=Math.sin(o),h=Math.cos(o);return t[0]=r*i*h-e*c*u,t[1]=e*c*h+r*i*u,t[2]=e*i*u-r*c*h,t[3]=e*i*h+r*c*u,t}function H(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}const W=l,X=h,Y=m,Z=y,w=p,B=q,C=j,D=d,F=D,G=g,J=G,K=f,N=M,Q=P;function R(t,n,s){const o=e(n,s);return o<-.999999?(c(U,V,n),i(U)<1e-6&&c(U,$,n),u(U,U),v(t,U,Math.PI),t):o>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(c(U,n,s),t[0]=U[0],t[1]=U[1],t[2]=U[2],t[3]=1+o,K(t,t))}const U=o(),V=s(1,0,0),$=s(0,1,0);function tt(t,n,s,o,a,r){return z(nt,n,a,r),z(st,s,o,r),z(t,nt,st,2*r*(1-r)),t}const nt=n(),st=n();function ot(t,n,s,o){const a=at;return a[0]=s[0],a[3]=s[1],a[6]=s[2],a[1]=o[0],a[4]=o[1],a[7]=o[2],a[2]=-n[0],a[5]=-n[1],a[8]=-n[2],K(t,S(t,a))}const at=t(),rt=Object.freeze(Object.defineProperty({__proto__:null,add:Y,calculateW:k,conjugate:O,copy:W,dot:B,equals:Q,exactEquals:N,fromEuler:T,fromMat3:S,getAxisAngle:x,identity:I,invert:L,len:F,length:D,lerp:C,mul:Z,multiply:y,normalize:K,random:E,rotateX:A,rotateY:b,rotateZ:_,rotationTo:R,scale:w,set:X,setAxes:ot,setAxisAngle:v,slerp:z,sqlerp:tt,sqrLen:J,squaredLength:G,str:H},Symbol.toStringTag,{value:"Module"}));export{Y as add,k as calculateW,O as conjugate,W as copy,B as dot,Q as equals,N as exactEquals,T as fromEuler,S as fromMat3,x as getAxisAngle,I as identity,L as invert,F as len,D as length,C as lerp,Z as mul,y as multiply,K as normalize,rt as q,E as random,A as rotateX,b as rotateY,_ as rotateZ,R as rotationTo,w as scale,X as set,ot as setAxes,v as setAxisAngle,z as slerp,tt as sqlerp,J as sqrLen,G as squaredLength,H as str};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../factories/vec3f64.js";import"./common.js";export{u as abs,i as add,k as angle,Q as bezier,L as ceil,M as clamp,d as copy,f as cross,O as crossAndNormalize,E as direction,H as dist,D as distance,W as div,C as divide,g as dot,G as equals,m as exactEquals,J as floor,P as hermite,o as inverse,B as len,b as length,l as lerp,x as max,y as min,V as mul,A as multiply,q as negate,n as normalize,R as random,S as rotateX,T as rotateY,K as rotateZ,N as round,j as scale,c as scaleAndAdd,h as set,z as sign,v as sqrDist,w as sqrLen,s as squaredDistance,F as squaredLength,U as str,a as sub,e as subtract,t as transformMat3,p as transformMat4,r as transformQuat}from"../../../../chunks/vec32.js";
5
+ import"../factories/vec3f64.js";import"./common.js";export{u as abs,i as add,k as angle,Q as bezier,L as ceil,M as clamp,d as copy,f as cross,O as crossAndNormalize,D as direction,G as dist,C as distance,W as div,B as divide,g as dot,F as equals,m as exactEquals,J as floor,P as hermite,o as inverse,H as len,b as length,l as lerp,x as max,y as min,V as mul,A as multiply,q as negate,n as normalize,R as random,S as rotateX,T as rotateY,K as rotateZ,N as round,j as scale,c as scaleAndAdd,h as set,z as sign,v as sqrDist,w as sqrLen,s as squaredDistance,E as squaredLength,U as str,a as sub,e as subtract,t as transformMat3,p as transformMat4,r as transformQuat}from"../../../../chunks/vec32.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../core/mathUtils.js";import{ObjectStack as r}from"../../core/ObjectStack.js";import{d as n,e as o,g as e,F as i,j as c,i as s,s as u}from"../../chunks/vec32.js";import{create as a,clone as g}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as f}from"./vectorStacks.js";function v(t){return t?{origin:g(t.origin),vector:g(t.vector)}:{origin:a(),vector:a()}}function m(t,r){const n=S.get();return n.origin=t,n.vector=r,n}function p(t,r=v()){return b(t.origin,t.vector,r)}function b(t,r,o=v()){return n(o.origin,t),n(o.vector,r),o}function h(t,r,e=v()){return n(e.origin,t),o(e.vector,r,t),e}function j(r,n){const i=o(f.get(),n,r.origin),s=e(r.vector,i),u=e(r.vector,r.vector),a=t(s/u,0,1),g=o(f.get(),c(f.get(),r.vector,a),i);return e(g,g)}function M(t,r,n){return A(t,r,0,1,n)}function l(t,r,n){return s(n,t.origin,c(n,t.vector,r))}function A(r,n,u,a,g){const{vector:v,origin:m}=r,p=o(f.get(),n,m),b=e(v,p)/i(v);return c(g,v,t(b,u,a)),s(g,g,r.origin)}function d(t,r){if(k(t,m(r.origin,r.direction),!1,x)){const{tA:r,pB:n,distance2:o}=x;if(r>=0&&r<=1)return o;if(r<0)return u(t.origin,n);if(r>1)return u(s(f.get(),t.origin,t.vector),n)}return null}function B(t,r,o){return!!k(t,r,!0,x)&&(n(o,x.pA),!0)}function k(r,n,o,e){const i=1e-6,c=r.origin,a=s(f.get(),c,r.vector),g=n.origin,v=s(f.get(),g,n.vector),m=f.get(),p=f.get();if(m[0]=c[0]-g[0],m[1]=c[1]-g[1],m[2]=c[2]-g[2],p[0]=v[0]-g[0],p[1]=v[1]-g[1],p[2]=v[2]-g[2],Math.abs(p[0])<i&&Math.abs(p[1])<i&&Math.abs(p[2])<i)return!1;const b=f.get();if(b[0]=a[0]-c[0],b[1]=a[1]-c[1],b[2]=a[2]-c[2],Math.abs(b[0])<i&&Math.abs(b[1])<i&&Math.abs(b[2])<i)return!1;const h=m[0]*p[0]+m[1]*p[1]+m[2]*p[2],j=p[0]*b[0]+p[1]*b[1]+p[2]*b[2],M=m[0]*b[0]+m[1]*b[1]+m[2]*b[2],l=p[0]*p[0]+p[1]*p[1]+p[2]*p[2],A=(b[0]*b[0]+b[1]*b[1]+b[2]*b[2])*l-j*j;if(Math.abs(A)<i)return!1;let d=(h*j-M*l)/A,B=(h+j*d)/l;o&&(d=t(d,0,1),B=t(B,0,1));const k=f.get(),x=f.get();return k[0]=c[0]+d*b[0],k[1]=c[1]+d*b[1],k[2]=c[2]+d*b[2],x[0]=g[0]+B*p[0],x[1]=g[1]+B*p[1],x[2]=g[2]+B*p[2],e.tA=d,e.tB=B,e.pA=k,e.pB=x,e.distance2=u(k,x),!0}const x={tA:0,tB:0,pA:a(),pB:a(),distance2:0},S=new r(()=>v());export{B as closestLineSegmentPoint,d as closestRayDistance2,p as copy,v as create,j as distance2,h as fromPoints,b as fromValues,l as pointAt,M as projectPoint,A as projectPointClamp,m as wrap};
5
+ import{clamp as t}from"../../core/mathUtils.js";import{ObjectStack as r}from"../../core/ObjectStack.js";import{d as n,e as o,g as e,E as i,j as c,i as s,s as u}from"../../chunks/vec32.js";import{create as a,clone as g}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as f}from"./vectorStacks.js";function v(t){return t?{origin:g(t.origin),vector:g(t.vector)}:{origin:a(),vector:a()}}function m(t,r){const n=S.get();return n.origin=t,n.vector=r,n}function p(t,r=v()){return b(t.origin,t.vector,r)}function b(t,r,o=v()){return n(o.origin,t),n(o.vector,r),o}function h(t,r,e=v()){return n(e.origin,t),o(e.vector,r,t),e}function j(r,n){const i=o(f.get(),n,r.origin),s=e(r.vector,i),u=e(r.vector,r.vector),a=t(s/u,0,1),g=o(f.get(),c(f.get(),r.vector,a),i);return e(g,g)}function M(t,r,n){return A(t,r,0,1,n)}function l(t,r,n){return s(n,t.origin,c(n,t.vector,r))}function A(r,n,u,a,g){const{vector:v,origin:m}=r,p=o(f.get(),n,m),b=e(v,p)/i(v);return c(g,v,t(b,u,a)),s(g,g,r.origin)}function d(t,r){if(k(t,m(r.origin,r.direction),!1,x)){const{tA:r,pB:n,distance2:o}=x;if(r>=0&&r<=1)return o;if(r<0)return u(t.origin,n);if(r>1)return u(s(f.get(),t.origin,t.vector),n)}return null}function B(t,r,o){return!!k(t,r,!0,x)&&(n(o,x.pA),!0)}function k(r,n,o,e){const i=1e-6,c=r.origin,a=s(f.get(),c,r.vector),g=n.origin,v=s(f.get(),g,n.vector),m=f.get(),p=f.get();if(m[0]=c[0]-g[0],m[1]=c[1]-g[1],m[2]=c[2]-g[2],p[0]=v[0]-g[0],p[1]=v[1]-g[1],p[2]=v[2]-g[2],Math.abs(p[0])<i&&Math.abs(p[1])<i&&Math.abs(p[2])<i)return!1;const b=f.get();if(b[0]=a[0]-c[0],b[1]=a[1]-c[1],b[2]=a[2]-c[2],Math.abs(b[0])<i&&Math.abs(b[1])<i&&Math.abs(b[2])<i)return!1;const h=m[0]*p[0]+m[1]*p[1]+m[2]*p[2],j=p[0]*b[0]+p[1]*b[1]+p[2]*b[2],M=m[0]*b[0]+m[1]*b[1]+m[2]*b[2],l=p[0]*p[0]+p[1]*p[1]+p[2]*p[2],A=(b[0]*b[0]+b[1]*b[1]+b[2]*b[2])*l-j*j;if(Math.abs(A)<i)return!1;let d=(h*j-M*l)/A,B=(h+j*d)/l;o&&(d=t(d,0,1),B=t(B,0,1));const k=f.get(),x=f.get();return k[0]=c[0]+d*b[0],k[1]=c[1]+d*b[1],k[2]=c[2]+d*b[2],x[0]=g[0]+B*p[0],x[1]=g[1]+B*p[1],x[2]=g[2]+B*p[2],e.tA=d,e.tB=B,e.pA=k,e.pB=x,e.distance2=u(k,x),!0}const x={tA:0,tB:0,pA:a(),pB:a(),distance2:0},S=new r(()=>v());export{B as closestLineSegmentPoint,d as closestRayDistance2,p as copy,v as create,j as distance2,h as fromPoints,b as fromValues,l as pointAt,M as projectPoint,A as projectPointClamp,m as wrap};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Logger.js";import{G as t,i as r,j as o}from"../../../chunks/vec32.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../MeshComponent.js";import{MeshVertexAttributes as i}from"../MeshVertexAttributes.js";import{addMeshMaterialCloneContext as l,addMeshTextureCloneContext as a,getMeshMaterialCloneContext as c}from"./meshCloneUtils.js";import{convertVertexSpace as u}from"./vertexSpaceConversion.js";const f=()=>e.getLogger("esri.geometry.support.triangleMeshMerge");function p(e,t){if(0===e.length)return f().error("merge()","Must specify one more geometries to merge"),null;const r=e[0].spatialReference;for(const l of e){if(!l.spatialReference.equals(r))return f().error("merge()","Geometries must all be in the same spatial reference"),null;if(!l.loaded)return f().error("merge()","Geometries must all be loaded before merging"),null}const o=m(e);if(null==o)return null;const n=w(e),s=[],i={position:0,uv:0,normal:0,tangent:0,color:0},p=l(a()),g=c(p);for(const l of e){const e=o.rebake?u(l,o.vertexSpace,{allowBufferReuse:!0}):l.vertexAttributes;if(!e)return f().error("merge()","Failed to convert vertex space due to projection errors"),null;if(t&&t.reuseMaterials&&l.components)for(const t of l.components)t.material&&g?.materialMap?.set(t.material,t.material);h(l,i,p,s),x("position",e,n,i,0),x("normal",e,n,i,0),x("tangent",e,n,i,0),x("uv",l.vertexAttributes,n,i,0),x("color",l.vertexAttributes,n,i,255)}return{vertexAttributes:n,components:s,vertexSpace:o.vertexSpace,transform:o.rebake?null:o.transform,spatialReference:r}}function m(e){let s=null,i=null,l=!0,a=!0,c=null;const u=n();let p=0;for(const o of e){const{vertexSpace:e,transform:n}=o;if(null==i){i=e;const t=i.origin;t&&(c=t)}if(i.type!==e.type)return f().error("merge()",`Inconsistent mesh vertex space for provided geometries. One was ${i.type} while another is ${e.type}. Unable to merge geometries.`),null;null==s||null!=n&&n.equals(s)||(l=!1),null!=n&&null==s&&(s=n);const m=e.origin;m&&(c&&!t(m,c)&&(a=!1),p++,r(u,u,m))}if(null==i)throw new Error;const m=i.clone();if(null==m.origin)return{rebake:!1,vertexSpace:m};if(a&&l)return{rebake:!1,vertexSpace:m,transform:s?.clone()};const g=o(u,u,1/p);return m.origin=g,{rebake:!0,vertexSpace:m}}function g(e,t){return t.normal>0&&!e.vertexAttributes.normal}function v(e,t,r){g(e,t)&&"source"===r.shading&&(r.shading="flat")}function h(e,t,r,o){if(e.components)for(const n of e.components){const s=n.clone(r),i=t.position/3;if(s.faces)for(let e=0;e<s.faces.length;e++)s.faces[e]+=i;else{s.faces=new Uint32Array(e.vertexAttributes.position.length/3);for(let e=0;e<s.faces.length;e++)s.faces[e]=e+i}v(e,t,s),o.push(s)}else if(e.vertexAttributes&&e.vertexAttributes.position){const r=e.vertexAttributes.position.length/3,n=new Uint32Array(r),i=t.position/3;for(let e=0;e<r;e++)n[e]=e+i;const l=new s({faces:n});v(e,t,l),o.push(l)}}function x(e,t,r,o,n){if(!t)return;const s=t.position;if(!s)return;const i=t[e],l=r[e];if(null==i){let t=o[e];const r=y[e];if(null!=l){for(let e=0;e<s.length;e+=3)for(let o=0;o<r;o++)l[t++]=n;o[e]=t}}else null!=l&&null!=i&&(b(i,0,l,o[e],i.length),o[e]+=i.length)}function b(e,t,r,o,n){for(let s=0;s<n;s++)r[o++]=e[t++];return r}function A(e){let t=!1,r=!1,o=!1,n=!1;for(const s of e){const e=s.vertexAttributes;if(e?.position&&(e.uv&&(t=!0),e.normal&&(r=!0),e.tangent&&(n=!0),e.color&&(o=!0),r&&t&&o&&n))break}return{normal:r,uv:t,color:o,tangent:n}}function w(e){let t=0,r=0,o=0,n=0,s=0;const l=A(e);for(const i of e){const e=i.vertexAttributes;e?.position&&(t+=e.position.length,l.uv&&(r+=e.position.length/y.position*y.uv),l.normal&&(o+=e.position.length/y.position*y.normal),l.color&&(n+=e.position.length/y.position*y.color),l.tangent&&(s+=e.position.length/y.position*y.tangent))}return new i({position:new Float64Array(t),uv:r?new Float32Array(r):null,normal:o?new Float32Array(o):null,tangent:s?new Float32Array(s):null,color:n?new Uint8Array(n):null})}const y={position:3,normal:3,tangent:4,uv:2,color:4};export{p as merge};
5
+ import e from"../../../core/Logger.js";import{F as t,i as r,j as o}from"../../../chunks/vec32.js";import{create as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../MeshComponent.js";import{MeshVertexAttributes as i}from"../MeshVertexAttributes.js";import{addMeshMaterialCloneContext as l,addMeshTextureCloneContext as a,getMeshMaterialCloneContext as c}from"./meshCloneUtils.js";import{convertVertexSpace as u}from"./vertexSpaceConversion.js";const f=()=>e.getLogger("esri.geometry.support.triangleMeshMerge");function p(e,t){if(0===e.length)return f().error("merge()","Must specify one more geometries to merge"),null;const r=e[0].spatialReference;for(const l of e){if(!l.spatialReference.equals(r))return f().error("merge()","Geometries must all be in the same spatial reference"),null;if(!l.loaded)return f().error("merge()","Geometries must all be loaded before merging"),null}const o=m(e);if(null==o)return null;const n=w(e),s=[],i={position:0,uv:0,normal:0,tangent:0,color:0},p=l(a()),g=c(p);for(const l of e){const e=o.rebake?u(l,o.vertexSpace,{allowBufferReuse:!0}):l.vertexAttributes;if(!e)return f().error("merge()","Failed to convert vertex space due to projection errors"),null;if(t&&t.reuseMaterials&&l.components)for(const t of l.components)t.material&&g?.materialMap?.set(t.material,t.material);h(l,i,p,s),x("position",e,n,i,0),x("normal",e,n,i,0),x("tangent",e,n,i,0),x("uv",l.vertexAttributes,n,i,0),x("color",l.vertexAttributes,n,i,255)}return{vertexAttributes:n,components:s,vertexSpace:o.vertexSpace,transform:o.rebake?null:o.transform,spatialReference:r}}function m(e){let s=null,i=null,l=!0,a=!0,c=null;const u=n();let p=0;for(const o of e){const{vertexSpace:e,transform:n}=o;if(null==i){i=e;const t=i.origin;t&&(c=t)}if(i.type!==e.type)return f().error("merge()",`Inconsistent mesh vertex space for provided geometries. One was ${i.type} while another is ${e.type}. Unable to merge geometries.`),null;null==s||null!=n&&n.equals(s)||(l=!1),null!=n&&null==s&&(s=n);const m=e.origin;m&&(c&&!t(m,c)&&(a=!1),p++,r(u,u,m))}if(null==i)throw new Error;const m=i.clone();if(null==m.origin)return{rebake:!1,vertexSpace:m};if(a&&l)return{rebake:!1,vertexSpace:m,transform:s?.clone()};const g=o(u,u,1/p);return m.origin=g,{rebake:!0,vertexSpace:m}}function g(e,t){return t.normal>0&&!e.vertexAttributes.normal}function v(e,t,r){g(e,t)&&"source"===r.shading&&(r.shading="flat")}function h(e,t,r,o){if(e.components)for(const n of e.components){const s=n.clone(r),i=t.position/3;if(s.faces)for(let e=0;e<s.faces.length;e++)s.faces[e]+=i;else{s.faces=new Uint32Array(e.vertexAttributes.position.length/3);for(let e=0;e<s.faces.length;e++)s.faces[e]=e+i}v(e,t,s),o.push(s)}else if(e.vertexAttributes&&e.vertexAttributes.position){const r=e.vertexAttributes.position.length/3,n=new Uint32Array(r),i=t.position/3;for(let e=0;e<r;e++)n[e]=e+i;const l=new s({faces:n});v(e,t,l),o.push(l)}}function x(e,t,r,o,n){if(!t)return;const s=t.position;if(!s)return;const i=t[e],l=r[e];if(null==i){let t=o[e];const r=y[e];if(null!=l){for(let e=0;e<s.length;e+=3)for(let o=0;o<r;o++)l[t++]=n;o[e]=t}}else null!=l&&null!=i&&(b(i,0,l,o[e],i.length),o[e]+=i.length)}function b(e,t,r,o,n){for(let s=0;s<n;s++)r[o++]=e[t++];return r}function A(e){let t=!1,r=!1,o=!1,n=!1;for(const s of e){const e=s.vertexAttributes;if(e?.position&&(e.uv&&(t=!0),e.normal&&(r=!0),e.tangent&&(n=!0),e.color&&(o=!0),r&&t&&o&&n))break}return{normal:r,uv:t,color:o,tangent:n}}function w(e){let t=0,r=0,o=0,n=0,s=0;const l=A(e);for(const i of e){const e=i.vertexAttributes;e?.position&&(t+=e.position.length,l.uv&&(r+=e.position.length/y.position*y.uv),l.normal&&(o+=e.position.length/y.position*y.normal),l.color&&(n+=e.position.length/y.position*y.color),l.tangent&&(s+=e.position.length/y.position*y.tangent))}return new i({position:new Float64Array(t),uv:r?new Float32Array(r):null,normal:o?new Float32Array(o):null,tangent:s?new Float32Array(s):null,color:n?new Uint8Array(n):null})}const y={position:3,normal:3,tangent:4,uv:2,color:4};export{p as merge};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import"../../core/Logger.js";import{acosClamped as t}from"../../core/mathUtils.js";import{getEpsilon as e}from"../../core/libs/gl-matrix-2/math/common.js";import{fromRotation as r}from"../../core/libs/gl-matrix-2/math/mat4.js";import{d as s,G as i,s as n,e as o,j as c,b as a,i as h,f as u,p as l,D as m,l as d,c as g,F as f,n as p,h as M}from"../../chunks/vec32.js";import{fromValues as j,fromArray as y,clone as _,create as x}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as b}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isVec3 as S}from"../../core/libs/gl-matrix-2/types/vec3.js";import{isVec4 as v}from"../../core/libs/gl-matrix-2/types/vec4.js";import{fromPoints as P,closestPoint as A}from"./ray.js";import{cartesianToSpherical as R}from"./sphereUtils.js";import{angle as q}from"./vector.js";import{sv3d as O,sm4d as w}from"./vectorStacks.js";class E{constructor(t=0,e=0,r=0,s=0){this.radius=s,"number"==typeof t?this._center=j(t,e,r):S(t)||v(t)?(this._center=y(t),this.radius=4===t.length?t[3]:e):(this._center=_(t.center),this.radius=t.radius)}get center(){return this._center}set center(t){s(this.center,t)}exactEquals(t){return i(this._center,t.center)&&this.radius===t.radius}copy(t){return t!==this&&(s(this._center,t.center),this.radius=t.radius),this}clone(){return new E(this.center,this.radius)}toVec4(){return b(this.center[0],this.center[1],this.center[2],this.radius)}contains(t){return n(this.center,t)<=this.radius**2}intersectRay(t,e){if(null==t)return!1;if(!this._intersect(t,C))return!1;let{t0:r,t1:s}=C;if((r<0||s<r&&s>0)&&(r=s),r<0)return!1;if(e){const{origin:s,direction:i}=t;e[0]=s[0]+i[0]*r,e[1]=s[1]+i[1]*r,e[2]=s[2]+i[2]*r}return!0}intersectLine(t,r){const s=P(t,r);if(!this._intersect(s,C))return[];const{origin:i,direction:n}=s,{t0:o,t1:c}=C,a=t=>{const e=x();return g(e,i,n,t),this.projectPoint(e,e)};return Math.abs(o-c)<e()?[a(o)]:[a(o),a(c)]}_intersect(t,e){const{origin:r,direction:s}=t,i=L;i[0]=r[0]-this.center[0],i[1]=r[1]-this.center[1],i[2]=r[2]-this.center[2];const n=s[0]*s[0]+s[1]*s[1]+s[2]*s[2];if(0===n)return!1;const o=2*(s[0]*i[0]+s[1]*i[1]+s[2]*i[2]),c=o*o-4*n*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-this.radius**2);if(c<0)return!1;const a=Math.sqrt(c);return e.t0=(-o-a)/(2*n),e.t1=(-o+a)/(2*n),!0}projectPoint(t,e){const r=o(O.get(),t,this.center),s=c(O.get(),r,this.radius/a(r));return h(e,s,this.center)}closestPointOnSilhouette(t,e){const s=O.get(),i=w.get();u(s,t.origin,t.direction),u(e,s,t.origin),c(e,e,1/a(e)*this.radius);const n=this._angleToSilhouette(t.origin),o=q(t.origin,e);return r(i,o+n,s),l(e,e,i),e}frustumCoverage(t,e,r){const s=this.radius,i=s*s,n=t+.5*Math.PI,o=e*e+i-2*Math.cos(n)*e*s,c=Math.sqrt(o),a=o-i;if(a<=0)return.5;const h=Math.sqrt(a),u=Math.acos(h/c)-Math.asin(s/(c/Math.sin(n)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const r=o(O.get(),e,this.center),s=a(r),i=this.radius,n=i+Math.abs(i-s);return t(i/n)}union(t){const e=m(this._center,t.center),r=this.radius,s=t.radius;return e+s<r?this:e+r<s?(this.copy(t),this):(d(this._center,this._center,t.center,(e+s-r)/(2*e)),this.radius=(e+r+s)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}}const T={create:t=>new E(t),copy:(t,e)=>e.copy(t),setExtent:(t,e,r)=>r.copy(t),getExtent:(t,e)=>e,elevate:(t,e,r)=>(r.copy(t),r.radius+=e,r),axisAt(t,e,r,s){const i=o(U,e,t.center);switch(r){case 0:{const t=R(i,U)[2];return M(s,-Math.sin(t),Math.cos(t),0)}case 1:{const t=R(i,U),e=t[1],r=t[2],n=Math.sin(e);return M(s,-n*Math.cos(r),-n*Math.sin(r),Math.cos(e))}case 2:return p(s,i);default:return}},altitudeAt(t,e){const r=o(V,e,t.center);return a(r)-t.radius},setAltitudeAt(t,e,r,s){const i=T.altitudeAt(t,e),n=T.axisAt(t,e,2,V),o=c(V,n,r-i);return h(s,e,o)},intersectRay:(t,e,r)=>t.intersectRay(e,r),closestPoint:(t,e,r)=>t.intersectRay(e,r)?r:(A(e,t.center,r),t.projectPoint(r,r)),intersectRayClosestSilhouette(t,e,r){if(t.intersectRay(e,r))return r;const s=t.closestPointOnSilhouette(e,O.get());return h(r,e.origin,c(O.get(),e.direction,m(e.origin,s)/a(e.direction))),r},closestPointOnSilhouette:(t,e,r)=>t.closestPointOnSilhouette(e,r),distanceToSilhouette(t,e){const r=o(O.get(),e,t.center),s=f(r),i=t.radius**2;return Math.sqrt(Math.abs(s-i))}},k=new E,C={t0:0,t1:0},L=x(),U=x(),V=x();export{k as NullSphere,E as Sphere,T as sphereCSO};
5
+ import"../../core/has.js";import"../../core/Logger.js";import{acosClamped as t}from"../../core/mathUtils.js";import{getEpsilon as e}from"../../core/libs/gl-matrix-2/math/common.js";import{fromRotation as r}from"../../core/libs/gl-matrix-2/math/mat4.js";import{d as s,F as i,s as n,e as o,j as c,b as a,i as h,f as u,p as l,C as m,l as d,c as g,E as f,n as p,h as M}from"../../chunks/vec32.js";import{fromValues as j,fromArray as y,clone as _,create as x}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as b}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isVec3 as S}from"../../core/libs/gl-matrix-2/types/vec3.js";import{isVec4 as v}from"../../core/libs/gl-matrix-2/types/vec4.js";import{fromPoints as P,closestPoint as A}from"./ray.js";import{cartesianToSpherical as R}from"./sphereUtils.js";import{angle as q}from"./vector.js";import{sv3d as O,sm4d as w}from"./vectorStacks.js";class E{constructor(t=0,e=0,r=0,s=0){this.radius=s,"number"==typeof t?this._center=j(t,e,r):S(t)||v(t)?(this._center=y(t),this.radius=4===t.length?t[3]:e):(this._center=_(t.center),this.radius=t.radius)}get center(){return this._center}set center(t){s(this.center,t)}exactEquals(t){return i(this._center,t.center)&&this.radius===t.radius}copy(t){return t!==this&&(s(this._center,t.center),this.radius=t.radius),this}clone(){return new E(this.center,this.radius)}toVec4(){return b(this.center[0],this.center[1],this.center[2],this.radius)}contains(t){return n(this.center,t)<=this.radius**2}intersectRay(t,e){if(null==t)return!1;if(!this._intersect(t,k))return!1;let{t0:r,t1:s}=k;if((r<0||s<r&&s>0)&&(r=s),r<0)return!1;if(e){const{origin:s,direction:i}=t;e[0]=s[0]+i[0]*r,e[1]=s[1]+i[1]*r,e[2]=s[2]+i[2]*r}return!0}intersectLine(t,r){const s=P(t,r);if(!this._intersect(s,k))return[];const{origin:i,direction:n}=s,{t0:o,t1:c}=k,a=t=>{const e=x();return g(e,i,n,t),this.projectPoint(e,e)};return Math.abs(o-c)<e()?[a(o)]:[a(o),a(c)]}_intersect(t,e){const{origin:r,direction:s}=t,i=L;i[0]=r[0]-this.center[0],i[1]=r[1]-this.center[1],i[2]=r[2]-this.center[2];const n=s[0]*s[0]+s[1]*s[1]+s[2]*s[2];if(0===n)return!1;const o=2*(s[0]*i[0]+s[1]*i[1]+s[2]*i[2]),c=o*o-4*n*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-this.radius**2);if(c<0)return!1;const a=Math.sqrt(c);return e.t0=(-o-a)/(2*n),e.t1=(-o+a)/(2*n),!0}projectPoint(t,e){const r=o(O.get(),t,this.center),s=c(O.get(),r,this.radius/a(r));return h(e,s,this.center)}closestPointOnSilhouette(t,e){const s=O.get(),i=w.get();u(s,t.origin,t.direction),u(e,s,t.origin),c(e,e,1/a(e)*this.radius);const n=this._angleToSilhouette(t.origin),o=q(t.origin,e);return r(i,o+n,s),l(e,e,i),e}frustumCoverage(t,e,r){const s=this.radius,i=s*s,n=t+.5*Math.PI,o=e*e+i-2*Math.cos(n)*e*s,c=Math.sqrt(o),a=o-i;if(a<=0)return.5;const h=Math.sqrt(a),u=Math.acos(h/c)-Math.asin(s/(c/Math.sin(n)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const r=o(O.get(),e,this.center),s=a(r),i=this.radius,n=i+Math.abs(i-s);return t(i/n)}union(t){const e=m(this._center,t.center),r=this.radius,s=t.radius;return e+s<r?this:e+r<s?(this.copy(t),this):(d(this._center,this._center,t.center,(e+s-r)/(2*e)),this.radius=(e+r+s)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}}const C={create:t=>new E(t),copy:(t,e)=>e.copy(t),setExtent:(t,e,r)=>r.copy(t),getExtent:(t,e)=>e,elevate:(t,e,r)=>(r.copy(t),r.radius+=e,r),axisAt(t,e,r,s){const i=o(U,e,t.center);switch(r){case 0:{const t=R(i,U)[2];return M(s,-Math.sin(t),Math.cos(t),0)}case 1:{const t=R(i,U),e=t[1],r=t[2],n=Math.sin(e);return M(s,-n*Math.cos(r),-n*Math.sin(r),Math.cos(e))}case 2:return p(s,i);default:return}},altitudeAt(t,e){const r=o(V,e,t.center);return a(r)-t.radius},setAltitudeAt(t,e,r,s){const i=C.altitudeAt(t,e),n=C.axisAt(t,e,2,V),o=c(V,n,r-i);return h(s,e,o)},intersectRay:(t,e,r)=>t.intersectRay(e,r),closestPoint:(t,e,r)=>t.intersectRay(e,r)?r:(A(e,t.center,r),t.projectPoint(r,r)),intersectRayClosestSilhouette(t,e,r){if(t.intersectRay(e,r))return r;const s=t.closestPointOnSilhouette(e,O.get());return h(r,e.origin,c(O.get(),e.direction,m(e.origin,s)/a(e.direction))),r},closestPointOnSilhouette:(t,e,r)=>t.closestPointOnSilhouette(e,r),distanceToSilhouette(t,e){const r=o(O.get(),e,t.center),s=f(r),i=t.radius**2;return Math.sqrt(Math.abs(s-i))}},T=new E,k={t0:0,t1:0},L=x(),U=x(),V=x();export{T as NullSphere,E as Sphere,C as sphereCSO};