@arcgis/core 4.29.0 → 4.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arcade/treeAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{b43fde3e25d0c3b020b5.js → 039a872509872ce67ba4.js} +1 -1
- package/assets/esri/core/workers/chunks/{5243f9ff21e768c620c2.js → 23a5d750d93a7829174f.js} +1 -1
- package/assets/esri/core/workers/chunks/{47e6119be4a4a5ed640d.js → 2447a4d5886aeb0ff72a.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f45a9e9bdbcffc2d6e0.js → 348bcc57b99a975902a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c9fb2601488998013ba.js → 3523789a2948a4ab8cc8.js} +1 -1
- package/assets/esri/core/workers/chunks/{24649b410b757599a549.js → 48db6e0bbb1a9c043193.js} +1 -1
- package/assets/esri/core/workers/chunks/{752082be991f1cc8558f.js → 4984e2b79d862114d6a6.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d9736fd15cdb54d9855.js → 5227f9eea6988aadad7f.js} +1 -1
- package/assets/esri/core/workers/chunks/58723274ef657fe212eb.js +1 -0
- package/assets/esri/core/workers/chunks/60ab18c6a04d4b2f1d4c.js +1 -0
- package/assets/esri/core/workers/chunks/647515801d94180b8402.js +1 -0
- package/assets/esri/core/workers/chunks/6c3ae96ec90e9ed7dd50.js +1 -0
- package/assets/esri/core/workers/chunks/7a8bba91769ee18cc39f.js +1 -0
- package/assets/esri/core/workers/chunks/7a98d2e026f63a581b1e.js +1 -0
- package/assets/esri/core/workers/chunks/8c360923cd1850767d3e.js +1 -0
- package/assets/esri/core/workers/chunks/{1a25ba411b89e050fbb7.js → a61f337802ae963d7f65.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0c5318d7ef2e923aad0.js → a8ac511280f873960d46.js} +1 -1
- package/assets/esri/core/workers/chunks/b125ab84b7761e761734.js +1 -0
- package/assets/esri/core/workers/chunks/{b34d6e58b125fe111f91.js → b42a83db83851cb57d44.js} +1 -1
- package/assets/esri/core/workers/chunks/{1497dd943df7eede0704.js → b9c55ff1f21db198ce03.js} +1 -1
- package/assets/esri/core/workers/chunks/bb3322ddb89c0bd444f0.js +1 -0
- package/assets/esri/core/workers/chunks/becfdaeeb07f089d8be7.js +1 -0
- package/assets/esri/core/workers/chunks/{b26e39a399963c176d33.js → c527692694688a5b3b07.js} +2 -2
- package/assets/esri/core/workers/chunks/{210a93e0b96c5bff44a3.js → c556644bb0cf88770939.js} +1 -1
- package/assets/esri/core/workers/chunks/{a5e7b4acae17f88e2208.js → ce93027b6b81428ce9b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8ece275abac93f3dccf.js → d14f16bfa6c12909929c.js} +1 -1
- package/assets/esri/core/workers/chunks/{1594f06a2d7d9439c62e.js → e2147c99cc5839654be1.js} +1 -1
- package/assets/esri/core/workers/chunks/{d33ed3a2a0d4b640bd4a.js → e4c7d8c69e4957c9d27c.js} +1 -1
- package/assets/esri/core/workers/chunks/{7709248f59520aee6f51.js → eceaa46f622f6fa31128.js} +1 -1
- package/assets/esri/core/workers/chunks/{2286db4c83ff1b6fb088.js → ef3e6209e6ac6a56960b.js} +1 -1
- package/assets/esri/core/workers/chunks/f59b5ea05caca8a1a398.js +1 -0
- package/chunks/Laserlines.glsl.js +3 -3
- package/chunks/Precipitation.glsl.js +1 -1
- package/chunks/SSAOBlur.glsl.js +2 -2
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/terrainUtilsPlanar.js +1 -1
- package/chunks/vec32.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/libs/gl-matrix-2/vec3.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/coordinateSystem.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/georeference.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils/scale.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +5 -0
- package/geometry/support/meshVertexSpaceUtils.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/geometry/support/ray.js +1 -1
- package/geometry/support/triangle.js +1 -1
- package/geometry/support/vector.js +1 -1
- package/interfaces.d.ts +6 -6
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/FeatureReductionLayer.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/video/VideoCameraSensorModel.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/layers/voxel/voxelPlaneUtils.js +1 -1
- package/libs/linkchartlayout/LinkChartLayout.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/arcade/callExpressionWithCursor.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/DrillDownTileSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/OverrideChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/PagedTileSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/StreamSourceChunk.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/2d/layers/features/support/Tile.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/tiling/TileKey.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/support/measurementUtils.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/common.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentScale.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/extentUtils.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/support/Segment.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LoDUtil.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/global/ZoomController.js +1 -1
- package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/local/ZoomController.js +1 -1
- package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/state/utils/viewUtils.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/cameraUtilsInternal.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/mathUtils.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
- package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/angularMeasurementUtils.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0e83f3718a0b45652b5e.js +0 -1
- package/assets/esri/core/workers/chunks/1fa5c8af69a09a3730b3.js +0 -1
- package/assets/esri/core/workers/chunks/4736f79b5c94ce103d43.js +0 -1
- package/assets/esri/core/workers/chunks/65f7adaaf1f535310c11.js +0 -1
- package/assets/esri/core/workers/chunks/79c041b292648c5eaecc.js +0 -1
- package/assets/esri/core/workers/chunks/7c4c2c0beddabac672b6.js +0 -1
- package/assets/esri/core/workers/chunks/9307d485a9e5f9fa77d1.js +0 -1
- package/assets/esri/core/workers/chunks/9a758de08dfa57735879.js +0 -1
- package/assets/esri/core/workers/chunks/a4c3da057ec2a07bbbe8.js +0 -1
- package/assets/esri/core/workers/chunks/b252270b100351779f1f.js +0 -1
- package/assets/esri/core/workers/chunks/dc57aa9f2fc69e654559.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{cyclicalPI as i}from"../../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s,createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as a,distance as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{c as h,E as c,l as _,f as p,n as l,g as u,h as g,j as d}from"../../../../../chunks/vec32.js";import{create as P}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as C}from"../../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as v}from"../../../../../geometry/support/axisAngle.js";import{create as w,fromPositionAndNormal as M,getNormal as S}from"../../../../../geometry/support/plane.js";import{d as b,g as f}from"../../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as j,applyAll as E}from"../../../camera/constraintUtils.js";import{ConstraintOptions as O}from"../../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as y}from"../../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as A}from"../../../camera/constraintUtils/InteractionType.js";import{ExponentialFalloff as z}from"../../../input/util.js";import{InteractiveController as R}from"../InteractiveController.js";import{PanPlanarMomentumController as x}from"../momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as k}from"../momentum/PanSphericalMomentumController.js";import{RotationMomentumController as H}from"../momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as F}from"../momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as T}from"../momentum/ZoomSphericalMomentumController.js";import{NavigationMode as U,pickPointAndInitSphere as D,contentIntersectorOptions as I,SpherePickPointFallback as L,decideNavigationMode as Z,sphereOrPlanePointFromScreenPoint as G,panDistanceModifier as N,minHeightLimit as B,screenPixelArea as V,intersectPlaneFromScreenPointAtEye as q,applyZoomOnSphere as J,preserveHeadingThreshold as K,applyPanSphericalPreserveHeading as Q,applyPanSphericalDirectRotation as W,normalizeRotationDelta as X,applyRotation as Y,applyPanPlanar as $,applyZoomToPoint as tt}from"../../utils/navigationUtils.js";import{Camera as it}from"../../../webgl-engine/lib/Camera.js";import{PanPlanarMomentumEstimator as et}from"../../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as nt}from"../../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as st}from"../../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as ot}from"../../../../navigation/ZoomMomentumEstimator.js";let rt=class extends R{constructor(){super(...arguments),this._smoothRotation=new z(.05),this._rotationAxis=P(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=w(),this._beginRadius=0,this._smoothScaling=new z(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new ot,this._rotationMomentumEstimator=new st,this._panSphericalMomentumEstimator=new nt,this._panPlanarMomentumEstimator=new et,this._adjustedSphere=b(),this._tmp3d=P(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=P(),this._screenPickPoint=n(),this._scenePickPoint=P(),this._mode=U.Horizontal,this._sphere=b(),this._pointerCount=0,this._tmpInteractionDirection=P(),this._beginCamera=new it,this._constraintOptions=new O(y.ALL,A.NONE,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),a(this._beginScreenPoint,this._screenPickPoint);const n=C(this.view.spatialReference),o=D(this._intersectionHelper,this.startCamera,this._screenPickPoint,n,L.Silhouette,0===this.view.map.ground.opacity?I:{});null!=o.scenePickPoint&&(this._scenePickPoint=o.scenePickPoint,this._sphere=o.sphere,h(this._beginScenePoint,this._scenePickPoint),this._mode=Z(this.startCamera,this._screenPickPoint,n),this._mode===U.Vertical&&this._preparePlanarPanMode(t,o.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;this._mode===U.Horizontal?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return this._mode===U.Horizontal?new T({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new F({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new H({view:this.view,momentum:e,center:f(this._sphere),axis:this._rotationAxis});if(this._mode===U.Horizontal){const t=this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new k({view:this.view,momentum:t})}else{const t=this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=c(this._tmp3d,this.startCamera.viewForward);M(this._scenePickPoint,e,this._panningPlane);const r=n(this._screenPickPoint[0],0),a=P(),m=_(this.startCamera.eye);this._adjustedSphere[3]=m<this._sphere[3]?m-100:this._sphere[3],G(this._adjustedSphere,this.startCamera,r,a);const C=o();this.startCamera.projectToRenderScreen(a,C);const v=P(),w=P(),b=P();p(v,this._scenePickPoint,this.currentCamera.eye);const f=_(v);l(v,v);const j=N*Math.max(Math.abs(this.view.camera.position.z),B),E=this.view._stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,V);let O=null!=E?E:j;O=i?Math.min(O,f):O,h(b,u(w,this.currentCamera.eye,g(w,v,O))),this._panningPlane[3]=-d(S(this._panningPlane),b),this.startCamera.center=u(w,this.startCamera.eye,g(w,this.startCamera.viewForward,O));const y=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.startCamera,y,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),J(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);G(this._sphere,this.currentCamera,i,this._tmp3d),K(this._beginScenePoint,d(this.currentCamera.up,this._beginScenePoint),this._sphere[3],this._beginHeading,this.view.camera.tilt,this.startCamera)?(Q(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(W(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere[3],this.view.camera.tilt)),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._screenPickPoint,i)),E(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){l(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+X(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),v(this._rotationAxis,s)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*e),E(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.currentCamera,i,this._tmp3d)&&($(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),E(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),tt(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){h(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=X(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),v(this._rotationAxis,o)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*o),E(this.view,this.currentCamera,this._constraintOptions)}};rt=t([r("esri.views.3d.state.controllers.global.PinchAndPanController")],rt);export{rt as PinchAndPanController};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{cyclicalPI as i}from"../../../../../core/Cyclical.js";import{deg2rad as e}from"../../../../../core/mathUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as s,createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as a,distance as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{c as h,F as c,l as _,f as p,n as l,g as u,h as g,k as d}from"../../../../../chunks/vec32.js";import{create as P}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as C}from"../../../../../geometry/ellipsoidUtils.js";import{wrapAxisAngle as v}from"../../../../../geometry/support/axisAngle.js";import{create as w,fromPositionAndNormal as M,getNormal as S}from"../../../../../geometry/support/plane.js";import{d as b,g as f}from"../../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as j,applyAll as E}from"../../../camera/constraintUtils.js";import{ConstraintOptions as O}from"../../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as y}from"../../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as A}from"../../../camera/constraintUtils/InteractionType.js";import{ExponentialFalloff as z}from"../../../input/util.js";import{InteractiveController as R}from"../InteractiveController.js";import{PanPlanarMomentumController as k}from"../momentum/PanPlanarMomentumController.js";import{PanSphericalMomentumController as x}from"../momentum/PanSphericalMomentumController.js";import{RotationMomentumController as H}from"../momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as F}from"../momentum/ZoomPlanarMomentumController.js";import{ZoomSphericalMomentumController as T}from"../momentum/ZoomSphericalMomentumController.js";import{NavigationMode as U,pickPointAndInitSphere as D,contentIntersectorOptions as I,SpherePickPointFallback as L,decideNavigationMode as Z,sphereOrPlanePointFromScreenPoint as G,panDistanceModifier as N,minHeightLimit as B,screenPixelArea as V,intersectPlaneFromScreenPointAtEye as q,applyZoomOnSphere as J,preserveHeadingThreshold as K,applyPanSphericalPreserveHeading as Q,applyPanSphericalDirectRotation as W,normalizeRotationDelta as X,applyRotation as Y,applyPanPlanar as $,applyZoomToPoint as tt}from"../../utils/navigationUtils.js";import{Camera as it}from"../../../webgl-engine/lib/Camera.js";import{PanPlanarMomentumEstimator as et}from"../../../../navigation/PanPlanarMomentumEstimator.js";import{PanSphericalMomentumEstimator as nt}from"../../../../navigation/PanSphericalMomentumEstimator.js";import{RotationMomentumEstimator as st}from"../../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as ot}from"../../../../navigation/ZoomMomentumEstimator.js";let rt=class extends R{constructor(){super(...arguments),this._smoothRotation=new z(.05),this._rotationAxis=P(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=w(),this._beginRadius=0,this._smoothScaling=new z(.05),this._zoomCenterScreen=n(),this._zoomMomentumEstimator=new ot,this._rotationMomentumEstimator=new st,this._panSphericalMomentumEstimator=new nt,this._panPlanarMomentumEstimator=new et,this._adjustedSphere=b(),this._tmp3d=P(),this._tmpScreenPointArray=n(),this._beginScreenPoint=n(),this._beginScenePoint=P(),this._screenPickPoint=n(),this._scenePickPoint=P(),this._mode=U.Horizontal,this._sphere=b(),this._pointerCount=0,this._tmpInteractionDirection=P(),this._beginCamera=new it,this._constraintOptions=new O(y.ALL,A.NONE,0,this._beginCamera)}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;this._zoomMomentumEstimator.enabled=this._rotationMomentumEstimator.enabled=this._panPlanarMomentumEstimator.enabled=this._panSphericalMomentumEstimator.enabled=this.view.navigation.momentumEnabled,this._beginHeading=-i.normalize(e(this.view.camera.heading)),this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._smoothRotation.reset(),s(t.center,this._screenPickPoint),a(this._beginScreenPoint,this._screenPickPoint);const n=C(this.view.spatialReference),o=D(this._intersectionHelper,this.startCamera,this._screenPickPoint,n,L.Silhouette,0===this.view.map.ground.opacity?I:{});null!=o.scenePickPoint&&(this._scenePickPoint=o.scenePickPoint,this._sphere=o.sphere,h(this._beginScenePoint,this._scenePickPoint),this._mode=Z(this.startCamera,this._screenPickPoint,n),this._mode===U.Vertical&&this._preparePlanarPanMode(t,o.hasGeometryIntersection),this._beginCamera.copyFrom(this.startCamera))}update(t){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1;this._mode===U.Horizontal?(i&&this._zoomSpherical(t),this._panningSpherical(t),i&&this._rotateSpherical(t)):(i&&this._zoomPlanar(t),this._panningPlanar(t),i&&this._rotatePlanar(t)),this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return this._mode===U.Horizontal?new T({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new F({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new H({view:this.view,momentum:e,center:f(this._sphere),axis:this._rotationAxis});if(this._mode===U.Horizontal){const t=this._panSphericalMomentumEstimator.evaluateMomentum();if(t)return new x({view:this.view,momentum:t})}else{const t=this._panPlanarMomentumEstimator.evaluateMomentum();if(t)return new k({view:this.view,momentum:t})}return null}_preparePlanarPanMode(t,i){const e=c(this._tmp3d,this.startCamera.viewForward);M(this._scenePickPoint,e,this._panningPlane);const r=n(this._screenPickPoint[0],0),a=P(),m=_(this.startCamera.eye);this._adjustedSphere[3]=m<this._sphere[3]?m-100:this._sphere[3],G(this._adjustedSphere,this.startCamera,r,a);const C=o();this.startCamera.projectToRenderScreen(a,C);const v=P(),w=P(),b=P();p(v,this._scenePickPoint,this.currentCamera.eye);const f=_(v);l(v,v);const j=N*Math.max(Math.abs(this.view.camera.position.z),B),E=this.view._stage.renderView.getMinimalDepthForArea(null,this._screenPickPoint[0],this._screenPickPoint[1],this.view.state.camera,V);let O=null!=E?E:j;O=i?Math.min(O,f):O,h(b,u(w,this.currentCamera.eye,g(w,v,O))),this._panningPlane[3]=-d(S(this._panningPlane),b),this.startCamera.center=u(w,this.startCamera.eye,g(w,this.startCamera.viewForward,O));const y=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.startCamera,y,this._beginScenePoint)}_zoomSpherical(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),J(this._sphere,this.currentCamera,this._smoothScaling.value),s(t.center,this._zoomCenterScreen),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_panningSpherical(t){const i=s(t.center,this._tmpScreenPointArray);G(this._sphere,this.currentCamera,i,this._tmp3d),K(this._beginScenePoint,d(this.currentCamera.up,this._beginScenePoint),this._sphere[3],this._beginHeading,this.view.camera.tilt,this.startCamera)?(Q(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this._beginHeading,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumPreserveHeading(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere,this._beginHeading,this.view.camera.tilt)):(W(this._sphere,this.currentCamera,this._beginScenePoint,this._tmp3d,this.view.camera.tilt,!1),this._panSphericalMomentumEstimator.addMomentumDirectRotation(i,this._tmp3d,.001*t.timestamp,this.startCamera,this._sphere[3],this.view.camera.tilt)),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._screenPickPoint,i)),E(this.view,this.currentCamera,this._constraintOptions)}_rotateSpherical(t){l(this._rotationAxis,this._scenePickPoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value,e=i+X(t.angle-i),n=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=n,this._smoothRotation.update(e);const s=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(s,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),v(this._rotationAxis,s)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*e),E(this.view,this.currentCamera,this._constraintOptions)}_panningPlanar(t){const i=s(t.center,this._tmpScreenPointArray);q(this._panningPlane,this.currentCamera,i,this._tmp3d)&&($(this.currentCamera,this._beginScenePoint,this._tmp3d),this._panPlanarMomentumEstimator.add(i,this._tmp3d,.001*t.timestamp),this._constraintOptions.interactionType=A.PAN,this._constraintOptions.interactionFactor=j(m(this._beginScreenPoint,i)),this._constraintOptions.interactionDirection=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,this._tmpInteractionDirection),E(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null)}_zoomPlanar(t){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._smoothScaling.gain=e,this._smoothScaling.update(i),this._zoomMomentumEstimator.add(this._smoothScaling.value,.001*t.timestamp),tt(this.currentCamera,this._beginScenePoint,this._smoothScaling.value,this.view.state.constraints.minimumPoiDistance),this._constraintOptions.interactionType=A.ZOOM,this._constraintOptions.interactionFactor=j(t.radius-this._beginRadius),E(this.view,this.currentCamera,this._constraintOptions)}_rotatePlanar(t){h(this._rotationAxis,this._beginScenePoint),this.currentCamera.aboveGround||c(this._rotationAxis,this._rotationAxis);const i=this._smoothRotation.value;let e=t.angle-i;e=X(e);const n=i+e,s=.00125*Math.min(Math.max(t.radius,40),120);this._smoothRotation.gain=s,this._smoothRotation.update(n);const o=this._smoothRotation.value-this._beginAngle;this._rotationMomentumEstimator.add(o,.001*t.timestamp),Y(this.currentCamera,f(this._sphere),v(this._rotationAxis,o)),this._constraintOptions.interactionType=A.TUMBLE,this._constraintOptions.interactionFactor=j(t.radius*o),E(this.view,this.currentCamera,this._constraintOptions)}};rt=t([r("esri.views.3d.state.controllers.global.PinchAndPanController")],rt);export{rt as PinchAndPanController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../../core/screenUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{n as o,f as h,l as c,
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../../core/screenUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{n as o,f as h,l as c,k as m,h as p,g as l}from"../../../../../chunks/vec32.js";import{create as _}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../../geometry/ellipsoidUtils.js";import{create as P,fromPoints as C}from"../../../../../geometry/support/axisAngle.js";import{d as y,g as d}from"../../../../../chunks/sphere.js";import{pixelDistanceToInteractionFactor as f,applyAll as g}from"../../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as R}from"../../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as j}from"../../../camera/constraintUtils/InteractionType.js";import{applySurfaceCollisionConstraint as k}from"../../../camera/constraintUtils/surfaceCollision.js";import{InteractiveController as w}from"../InteractiveController.js";import{NavigationMode as D,normalizeCoordinate as A,pickPointAndInitSphere as M,contentIntersectorOptions as b,SpherePickPointFallback as O,decideNavigationMode as U,distanceClampValues as x,pivotDistanceModifier as z,screenPixelArea as H,sphereOrPlanePointFromScreenPoint as L,applyRotation as I}from"../../utils/navigationUtils.js";import{fromScreenAtEye as S}from"../../../support/geometryUtils/ray.js";let B=class extends w{constructor(){super(...arguments),this._pickPoint=_(),this._tmpP0=n(),this._panAxisAngle=P(),this._tmpRayDir=_(),this._tmpRayDirPick=_(),this._targetOnSphere=_(),this._navMode=D.Horizontal,this._tmpRay={origin:_(),direction:_()},this.dragBeginPoint=r(),this._normalizedAnchorPoint=n(),this._constraintOptions=new v(R.ALL_EXCEPT_COLLISION,j.ZOOM,0,this.startCamera),this._sphere=y(),this._hasPickPoint=!1}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;e(this.dragBeginPoint,t),A(this.startCamera,t,this._normalizedAnchorPoint);const r=u(this.view.spatialReference),s=M(this._intersectionHelper,this.startCamera,t,r,O.Ellipsoid,0===this.view.map.ground.opacity?b:{});if(this._navMode=U(this.startCamera,t,r),this._navMode===D.Horizontal)this._hasPickPoint=!!s.scenePickPoint,this._pickPoint=s.scenePickPoint??this._pickPoint,this._sphere=s.sphere;else{let r;S(this.startCamera,t,this._tmpRay),o(this._tmpRay.direction,this._tmpRay.direction),null!=s.scenePickPoint&&(h(this._tmpRayDirPick,this.startCamera.eye,s.scenePickPoint),r=c(this._tmpRayDirPick));const e=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,T);let a=i(Math.min(z,1/Math.abs(m(T,this._tmpRay.direction)))*e,x[0],x[1]);const n=this.view._stage.renderView.getMinimalDepthForArea(null,t[0],t[1],this.view.state.camera,H);a=null!=n?n:a,a=null!=r?Math.min(a,r):a,this._hasPickPoint=!0,p(this._tmpRay.direction,this._tmpRay.direction,a),l(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}}update(t){if(this.active){if(this.currentCamera.eye=this.startCamera.eye,this.currentCamera.center=this.startCamera.center,this.currentCamera.up=this.startCamera.up,this._navMode===D.Horizontal){h(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);const i=c(this._tmpRayDir);A(this.currentCamera,t,this._tmpP0);const r=12*(this._normalizedAnchorPoint[1]-this._tmpP0[1]);let s=i*2**r;const e=this.view.state.constraints.minimumPoiDistance;if(r<0&&s<e&&(s=e),Math.abs(i-s)<1e-6)return;if(this._hasPickPoint&&s<i){const t=1-(1-s/i)*(1-this._sphere[3]/c(this.currentCamera.center));this.currentCamera.center=p(E,this.currentCamera.center,t)}p(this._tmpRayDir,this._tmpRayDir,-s/i),this.currentCamera.eye=l(E,this.currentCamera.center,this._tmpRayDir),this._constraintOptions.interactionFactor=f(a(this.dragBeginPoint,t)),g(this.view,this.currentCamera,this._constraintOptions),this._hasPickPoint&&(L(this._sphere,this.currentCamera,this.dragBeginPoint,this._targetOnSphere),C(this._pickPoint,this._targetOnSphere,this._panAxisAngle),I(this.currentCamera,d(this._sphere),this._panAxisAngle))}else{const i=c(this._tmpRay.direction);A(this.currentCamera,t,this._tmpP0);const r=12*(this._normalizedAnchorPoint[1]-this._tmpP0[1]);let s=i*2**r;const e=this.view.state.constraints.minimumPoiDistance;if(r<0&&s<e&&(s=e),Math.abs(i-s)<1e-6)return;p(this._tmpRayDir,this._tmpRay.direction,1-s/i),this.currentCamera.eye=l(E,this.currentCamera.eye,this._tmpRayDir),this.currentCamera.center=l(E,this.currentCamera.center,this._tmpRayDir)}k(this.view,this.currentCamera),this.commitCamera()}}end(){this.active&&this.finishController()}};B=t([s("esri.views.3d.state.controllers.global.ZoomController")],B);const E=_(),T=_();export{B as ZoomController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../../core/time.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as s,n as o,h as a,
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../../core/time.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as s,n as o,h as a,k as n,l as m,f as h,g as c,a as p}from"../../../../../chunks/vec32.js";import{create as _}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../../../geometry/ellipsoidUtils.js";import{d as y}from"../../../../../chunks/sphere.js";import{applyAll as f}from"../../../camera/constraintUtils.js";import{ConstraintOptions as g}from"../../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as w}from"../../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as C}from"../../../camera/constraintUtils/InteractionType.js";import{applySurfaceCollisionConstraint as d}from"../../../camera/constraintUtils/surfaceCollision.js";import{PointToPointAnimationController as j}from"../PointToPointAnimationController.js";import{contentIntersectorOptions as u,decideNavigationMode as D,zoomMaxDistanceModifier as b,zoomMinDistanceModifier as v,zoomDistanceModifier as R,NavigationMode as L,panToPosition as M}from"../../utils/navigationUtils.js";import{fromScreenAtEye as z}from"../../../support/geometryUtils/ray.js";import{intersectScreen as O}from"../../../support/geometryUtils/sphere.js";import{Camera as U}from"../../../webgl-engine/lib/Camera.js";import{newIntersector as S}from"../../../webgl-engine/lib/Intersector.js";import{outExpo as V}from"../../../../animation/easing.js";const k=.6,x=4,A=60;let F=class extends j{constructor(){super(...arguments),this._zoomLocation=_(),this._tmpCamera=new U,this._tmpViewDir=_(),this._tmpRayDir={origin:_(),direction:_()},this._targetOnSphere=_(),this._tmpCenter=_(),this._beginCamera=new U,this._constraintOptions=new g(w.ALL_EXCEPT_COLLISION,C.ZOOM,null,this._beginCamera),this._sphere=y()}initialize(){this._intersector=S(this.view.state.viewingMode)}zoomStep(t,i){if(!this.active)return;const e=this.view.state;this.animation.finished?this._beginCamera.copyFrom(e.camera):this.animation.cameraAt(1,this._beginCamera);let r=!1,o=!1;this.intersectionHelper.intersectScreen(i,this._zoomLocation,0===this.view.map.ground.opacity?u:{})&&(r=t>0,o=!0),this._tmpCamera.copyFrom(e.camera),r?this.intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this.intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:s(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,t,this._zoomLocation,i,o),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:V}}_updateCamera(t,e,r,s,_){const y=l(this.view.spatialReference),g=D(t,s,y),w=Math.abs(this.view.camera.position.z);o(I,t.eye),a(I,I,-1),z(t,s,this._tmpRayDir),o(this._tmpRayDir.direction,this._tmpRayDir.direction);const C=i(Math.min(R,1/Math.abs(n(I,this._tmpRayDir.direction)))*w,v,b);if(g===L.Horizontal){let i=k**e;this._sphere[3]=m(r),h(this._tmpViewDir,t.center,t.eye);const o=Math.min(m(this._tmpViewDir),C);let n=o*i;if(i<=1&&n<x&&(n=x,i=n/o),Math.abs(o-n)<1e-6)return;const _=m(t.center);if(this._sphere[3]!==_){const e=this._sphere[3]+i*(_-this._sphere[3]);t.center=a(H,t.center,e/_)}a(this._tmpViewDir,this._tmpViewDir,-i),t.eye=c(H,t.center,this._tmpViewDir),f(this.view,t,this._constraintOptions),p(r,t.center)>1e-12&&O(this._sphere,t,s,this._targetOnSphere)&&M(this._sphere,t,r,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let i=k**Math.abs(e);const o=e>0?1:-1;h(this._tmpViewDir,r,t.eye);const n=m(this._tmpViewDir),p=this.view._stage.renderView.getMinimalDepthForArea(null,s[0],s[1],this.view.state.camera,A);let l=null!=p?p:C;l=_&&e>0?Math.min(l,n):l,a(this._tmpRayDir.direction,this._tmpRayDir.direction,l),c(r,this._tmpRayDir.origin,this._tmpRayDir.direction);let y=l*i;const f=Math.max(x,1.01*t.nearFar[0]);if(e>0&&y<f&&(y=f,i=y/l),Math.abs(l-y)<1e-6)return;a(this._tmpRayDir.direction,this._tmpRayDir.direction,o*(1-i)),t.eye=c(H,t.eye,this._tmpRayDir.direction),t.center=c(H,t.center,this._tmpRayDir.direction)}d(this.view,t)}};F=t([r("esri.views.3d.state.controllers.global.ZoomStepController")],F);const H=_(),I=_();export{F as ZoomStepController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{asinClamped as i}from"../../../../../core/mathUtils.js";import{createScreenPointArray as e,screenPointObjectToArray as n}from"../../../../../core/screenUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{distance as s}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{asinClamped as i}from"../../../../../core/mathUtils.js";import{createScreenPointArray as e,screenPointObjectToArray as n}from"../../../../../core/screenUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{distance as s}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{F as a,c as r,k as m,f as h,l,n as c,h as p,g as _}from"../../../../../chunks/vec32.js";import{create as u,fromValues as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrapAxisAngle as g}from"../../../../../geometry/support/axisAngle.js";import{create as C,fromNormalAndOffset as v,setOffsetFromPoint as M,negate as b,getNormal as f}from"../../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as w,applyAll as j}from"../../../camera/constraintUtils.js";import{ConstraintOptions as E}from"../../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as V}from"../../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as P}from"../../../camera/constraintUtils/InteractionType.js";import{ExponentialFalloff as z}from"../../../input/util.js";import{getVoxelWasm as H}from"../../../layers/VoxelWasm.js";import{InteractiveController as S}from"../InteractiveController.js";import{PanPlanarMomentumController as O}from"../momentum/PanPlanarMomentumController.js";import{RotationMomentumController as y}from"../momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as x}from"../momentum/ZoomPlanarMomentumController.js";import{NavigationMode as A,contentIntersectorOptions as F,panDistanceModifier as L,minHeightLimit as R,screenPixelArea as T,centroid as U,applyZoomToPoint as N,applyPanPlanar as D,normalizeRotationDelta as I,applyRotation as k,intersectPlaneFromScreenPointAtEye as G}from"../../utils/navigationUtils.js";import{Camera as Z}from"../../../webgl-engine/lib/Camera.js";import{PanPlanarMomentumEstimator as B}from"../../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as W}from"../../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as q}from"../../../../navigation/ZoomMomentumEstimator.js";const J=d(0,0,1),K={ELEVATION_THRESHOLD:3e4,ANGLE_THRESHOLD:16/180*Math.PI};let Q=class extends S{constructor(){super(...arguments),this._rotationValueSmooth=new z(.05),this._scalingValueSmooth=new z(.05),this._planeHorizontal=C(),this._planeVertical=C(),this._rotationMomentumEstimator=new W,this._panMomentumEstimator=new B(300,12,.9),this._zoomMomentumEstimator=new q,this._beginRadius=0,this._beginCenter=u(),this._beginAngle=0,this._tmpPoints=[],this._panMode=A.Horizontal,this._beginCenterScreen=e(),this._tmpCentroid3d=u(),this._tmpCentroid2d=e(),this._tmp2d=e(),this._pointerCount=0,this._beginCamera=new Z,this._constraintOptions=new E(V.ALL,P.NONE,0,this._beginCamera)}begin(t){if(!this.active)return;const e=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=e,this._rotationMomentumEstimator.enabled=e,this._panMomentumEstimator.enabled=e,this._beginRadius=t.radius,this._pointerCount=t.pointers.size,this._beginAngle=t.angle,this._rotationValueSmooth.reset(),this._scalingValueSmooth.reset(),n(t.center,this._beginCenterScreen),v(J,0,this._planeHorizontal);const o=u(),s=this._intersectionHelper.intersectScreenFreePointFallback(this._beginCenterScreen,o,0===this.view.map.ground.opacity?F:{}),d=u();a(d,this.startCamera.viewForward);const g=u();r(g,J);const C=m(d,g),w=i(C<0?-C:C);this._panMode=w>=K.ANGLE_THRESHOLD?A.Horizontal:A.Vertical;const j=Math.min(L,1/Math.abs(m(g,this.startCamera.viewForward)))*Math.max(Math.abs(this.view.camera.position.z),R);M(this._planeHorizontal,this._planeHorizontal,o),this.startCamera.aboveGround||b(this._planeHorizontal,this._planeHorizontal);const E=u(),V=u(),P=u();h(E,o,this.currentCamera.eye);const z=l(E);if(c(E,E),this._panMode===A.Vertical){p(g,g,C),h(f(this._planeVertical),d,g),c(f(this._planeVertical),f(this._planeVertical)),M(this._planeVertical,this._planeVertical,o);const i=this.view._stage.renderView.getMinimalDepthForArea(H(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,T);let e=null!=i?i:j;e=s?Math.min(e,z):e,r(P,_(V,this.currentCamera.eye,p(V,E,e))),this._planeVertical[3]=-m(f(this._planeVertical),P),this._computePlanePoints(t.pointers,this._planeVertical,this.startCamera,this._tmpPoints),U(this._tmpPoints,this._beginCenter)}else{const i=s?z:j;r(P,_(V,this.currentCamera.eye,p(V,E,i))),this._planeHorizontal[3]=-m(f(this._planeHorizontal),P),this._computePlanePoints(t.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),U(this._tmpPoints,this._beginCenter)}this._beginCamera.copyFrom(this.startCamera)}update(t){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,e=this._panMode===A.Horizontal?this._planeHorizontal:this._planeVertical,o=this._beginCenter;if(i){const i=this._beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this._scalingValueSmooth.gain=e,this._scalingValueSmooth.update(i),N(this.currentCamera,o,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*t.timestamp),this._constraintOptions.interactionType=P.ZOOM,this._constraintOptions.interactionFactor=w(Math.abs(t.radius-this._beginRadius)),j(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(t.pointers,e,this.currentCamera,this._tmpPoints),U(this._tmpPoints,this._tmpCentroid3d),n(t.center,this._tmpCentroid2d),D(this.currentCamera,o,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*t.timestamp),this._constraintOptions.interactionType=P.PAN,this._constraintOptions.interactionFactor=w(s(this._beginCenterScreen,this._tmpCentroid2d)),j(this.view,this.currentCamera,this._constraintOptions),i){const i=o,e=this._rotationValueSmooth.value,n=e+I(t.angle-e),s=.00125*Math.min(Math.max(t.radius,40),120);this._rotationValueSmooth.gain=s,this._rotationValueSmooth.update(n);const a=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(a,.001*t.timestamp);const r=f(this._planeHorizontal);k(this.currentCamera,i,g(r,a)),this._constraintOptions.interactionType=P.TUMBLE,this._constraintOptions.interactionFactor=w(Math.abs(t.radius*a)),j(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(t){t.pointers.size===this._pointerCount&&this.update(t),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return new x({view:this.view,momentum:i,zoomCenter:this._beginCenter});const e=this._rotationMomentumEstimator.evaluateMomentum();if(e)return new y({view:this.view,momentum:e,center:this._beginCenter,axis:f(this._planeHorizontal)});const n=this._panMomentumEstimator.evaluateMomentum();return n?new O({view:this.view,momentum:n}):null}_computePlanePoints(t,i,e,n){n.length=t.size;const o=this._tmp2d;let s=0;return t.forEach((t=>{o[0]=t.x,o[1]=t.y,void 0===n[s]&&(n[s]=u()),G(i,e,o,n[s]),s+=1})),n}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};Q=t([o("esri.views.3d.state.controllers.local.PinchAndPanController")],Q);export{Q as PinchAndPanController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{createScreenPointArray as s}from"../../../../../core/screenUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as n,l as m,n as h,
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{createScreenPointArray as s}from"../../../../../core/screenUtils.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as n,l as m,n as h,k as c,h as p,g as _,F as l,c as C,m as P}from"../../../../../chunks/vec32.js";import{create as f,fromValues as u}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as g,fromPositionAndNormal as D}from"../../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as j,applyAll as v}from"../../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as d}from"../../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as w}from"../../../camera/constraintUtils/InteractionType.js";import{getVoxelWasm as b}from"../../../layers/VoxelWasm.js";import{InteractiveController as M}from"../InteractiveController.js";import{normalizeCoordinate as O,contentIntersectorOptions as N,distanceClampValues as R,pivotDistanceModifier as x,screenPixelArea as U,intersectPlaneFromScreenPoint as A}from"../../utils/navigationUtils.js";let z=class extends M{constructor(){super(...arguments),this._tmpP=f(),this._tmpDir=f(),this._tmpN=f(),this._tmpP0=o(),this._tmpPoi=f(),this._tmpRayDir=f(),this.dragBeginPoint=s(),this._normalizedAnchorPoint=o(),this._constraintOptions=new y(d.ALL,w.ZOOM,0,this.startCamera,f()),this._plane=g()}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;e(this.dragBeginPoint,t),O(this.startCamera,t,this._normalizedAnchorPoint);const s=this._intersectionHelper.intersectScreenFreePointFallback(t,this._tmpP,0===this.view.map.ground.opacity?N:{});n(this._tmpDir,this._tmpP,this.startCamera.eye);const r=m(this._tmpDir);h(this._tmpDir,this._tmpDir);const a=Math.abs(this.view.camera.position.z);let o=i(Math.min(x,1/Math.abs(c(k,this._tmpDir)))*a,R[0],R[1]);const C=this.view._stage.renderView.getMinimalDepthForArea(b(this.view),t[0],t[1],this.view.state.camera,U);o=null!=C?C:o,o=s?Math.min(o,r):o,p(this._tmpDir,this._tmpDir,o),_(this._tmpP,this.startCamera.eye,this._tmpDir),n(this._tmpN,this.startCamera.eye,this.startCamera.center),h(this._tmpN,this._tmpN),this._tmpN[1]<0&&l(this._tmpN,this._tmpN),D(this._tmpP,this._tmpN,this._plane)}update(t){if(!this.active)return;A(this._plane,this.currentCamera,this.dragBeginPoint,this._tmpPoi)||C(this._tmpPoi,this.currentCamera.center),O(this.currentCamera,t,this._tmpP0);let i=4*(this._tmpP0[1]-this._normalizedAnchorPoint[1]);e(this._normalizedAnchorPoint,this._tmpP0),n(this._tmpRayDir,this._tmpPoi,this.currentCamera.eye);const s=m(this._tmpRayDir);let r=s*(1-i);this._constraintOptions.interactionDirection&&(C(this._constraintOptions.interactionDirection,this._tmpRayDir),p(this._constraintOptions.interactionDirection,this._constraintOptions.interactionDirection,Math.sign(i)/s));const o=this.view.state.constraints.minimumPoiDistance;i>=0&&r<o&&(r=o,i=-(r-s)/s),Math.abs(s-r)<1e-6||(p(this._tmpRayDir,this._tmpRayDir,i),this.currentCamera.eye=_(F,this.currentCamera.eye,this._tmpRayDir),P(F,this.currentCamera.center,this._tmpPoi,i),this._tmpPoi[2]>this.startCamera.center[2]?F[2]=Math.max(this.startCamera.center[2],F[2]):F[2]=Math.min(this.startCamera.center[2],F[2]),this.currentCamera.center=F,this._constraintOptions.interactionFactor=j(a(this.dragBeginPoint,t)),v(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}end(){this.active&&this.finishController()}};z=t([r("esri.views.3d.state.controllers.local.ZoomController")],z);const F=f(),k=u(0,0,1);export{z as ZoomController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../../core/time.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as o,f as r,n as a,
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../../core/time.js";import"../../../../../core/Logger.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import"../../../../../core/Error.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as o,f as r,n as a,k as m,l as n,g as c,h,m as p}from"../../../../../chunks/vec32.js";import{create as l,fromValues as _}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as C}from"../../../camera/constraintUtils.js";import{ConstraintOptions as f}from"../../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as g}from"../../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as y}from"../../../camera/constraintUtils/InteractionType.js";import{getVoxelWasm as j}from"../../../layers/VoxelWasm.js";import{PointToPointAnimationController as b}from"../PointToPointAnimationController.js";import{contentIntersectorOptions as w,zoomMaxDistanceModifier as u,zoomMinDistanceModifier as v,zoomDistanceModifier as L}from"../../utils/navigationUtils.js";import{Camera as d}from"../../../webgl-engine/lib/Camera.js";import{newIntersector as z}from"../../../webgl-engine/lib/Intersector.js";import{outExpo as R}from"../../../../animation/easing.js";const M=.6,D=4,F=60;let U=class extends b{constructor(){super(...arguments),this._zoomLocation=l(),this._tmpCamera=new d,this._tmpRayDir=l(),this._tmpCenter=l(),this._beginCamera=new d,this._constraintOptions=new f(g.ALL,y.ZOOM,null,this._beginCamera)}zoomStep(t,e){if(!this.active)return;const s=this.view.state;this.animation.finished?this._beginCamera.copyFrom(s.camera):this.animation.cameraAt(1,this._beginCamera),this._tmpCamera.copyFrom(s.camera);const p=z(this.view.state.viewingMode);let _=!1;t>0?(_=this.intersectionHelper.intersectScreenFreePointFallback(e,this._zoomLocation,0===this.view.map.ground.opacity?w:{}),this.intersectionHelper.intersectRay(this._tmpCamera.ray,p,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this.intersectionHelper.intersectRay(this._tmpCamera.ray,p,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:o(this._zoomLocation,this._tmpCamera.center);const C=M**t;let f=this.view._stage.renderView.getMinimalDepthForArea(j(this.view),e[0],e[1],this.view.state.camera,F);r(S,this._tmpCamera.eye,this._zoomLocation),a(S,S);const g=i(Math.min(L,1/Math.abs(m(O,S)))*Math.abs(this.view.camera.position.z),v,u);if(f=null!=f?f:g,f){const t=l();r(t,this._zoomLocation,this._tmpCamera.eye),(f<n(t)||!_)&&(a(t,t),c(this._zoomLocation,this._tmpCamera.eye,h(t,t,f)))}this._updateCamera(this._tmpCamera,C,this._zoomLocation),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:R}}_updateCamera(t,i,e){r(this._tmpRayDir,e,t.eye);const s=n(this._tmpRayDir);let o=s*i;const a=i<=1,m=Math.max(D,1.01*t.nearFar[0]);0!==o&&(a&&o<m&&(o=m,i=o/s),Math.abs(s-o)<1e-6||(h(this._tmpRayDir,this._tmpRayDir,i),t.eye=r(x,e,this._tmpRayDir),t.center=p(x,t.center,e,1-i),C(this.view,t,this._constraintOptions)))}};U=t([s("esri.views.3d.state.controllers.local.ZoomStepController")],U);const x=l(),O=_(0,0,1),S=l();export{U as ZoomStepController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as e,
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as e,E as s}from"../../../../../chunks/vec32.js";import{clone as i,create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{InteractionType as m}from"../../../camera/constraintUtils/InteractionType.js";import{MomentumController as c}from"./MomentumController.js";import{applyZoomToPoint as a}from"../../utils/navigationUtils.js";let p=class extends c{set zoomCenter(t){this._set("zoomCenter",i(t))}constructor(t){super(t),this.interactionType=m.ZOOM,this.constraintOptions.interactionDirection=n()}momentumStep(t,o){const{interactionDirection:r}=this.constraintOptions;if(!r)return;e(r,o.eye);const i=this.momentum.valueDelta(0,t);a(o,this.zoomCenter,i,this.view.state.constraints.minimumPoiDistance),s(r,o.eye,r)}};t([o({constructOnly:!0})],p.prototype,"momentum",void 0),t([o({constructOnly:!0})],p.prototype,"zoomCenter",null),p=t([r("esri.views.3d.state.controllers.momentum.ZoomPlanarMomentumController")],p);export{p as ZoomPlanarMomentumController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as t,createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/unitUtils.js";import{g as i,n as s,
|
|
5
|
+
import e from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as t,createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/unitUtils.js";import{g as i,n as s,k as o}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,copy as a,negativeInfinity as u,width as h,height as d,expandPointInPlace as p}from"../../../../geometry/support/aaBoundingRect.js";import{create as m}from"../../../../geometry/support/ray.js";import{sv3d as y}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as f}from"../../../../support/elevationInfoUtils.js";import{ViewingMode as g}from"../../../ViewingMode.js";import{computeMapPointFromVec3d as R}from"../../support/hitTest.js";import{fromRenderAtEye as _,fromScreen as I}from"../../support/geometryUtils/ray.js";import{defaultTolerance as v,newIntersector as b}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as w,IntersectorType as P}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as j,sliceFilterPredicate as M}from"../../webgl-engine/lib/intersectorUtils.js";class U{constructor(t,r,n){this.viewingMode=t,this._forEachLayer=r,this._view=n,this._externalIntersectionHandlers=new e,this._tolerance=v,this._tmpRay=m(),this._tmpRegion=c(),this._validateHUDIntersector=b(this.viewingMode),this._validateHUDIntersector.options.hud=!1}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),T(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,T(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,n){return t.options.selectionMode=!1,t.options.store=w.MIN,this.computeIntersection(e,t,n),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,n=.5){return e.getRenderCenter(D,r,n),D[0]+=.0466,D[1]-=.0123,_(e,D,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,r)}intersectToolIntersectorScreen(e,t,r){const n=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(n,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,r);const n=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||j(n)&&n.intersector!==P.TERRAIN||(t.options.selectionMode=!1,this.computeIntersection(e,t,r))}setTolerance(e=v){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}_getPickRay(e,t){const r=this._view.state.camera;return I(r,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==g.Local||null==e||i(t,e.origin,s(y.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,n=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,n)}_intersectElevation(e,r,l=0,c=null){if(null==e)return null;const a=this._view,{renderCoordsHelper:u}=a,h=n(a.spatialReference),d=null!=r?r.mode:"absolute-height",p=f(r)/h,m=("on-the-ground"!==d?p+l:0)*h/u.unitInMeters,{camera:g}=a.state;if("absolute-height"===d){const t=u?.getAltitude(g.eye),r=o(s(F,e.direction),u.worldUpAtPosition(g.eye,S));if(t<m&&r<0||t>=m&&r>0)return null;if(u.intersectInfiniteManifold(e,m,F)){const e=R(a,F);return e.z??=0,e.z-=p,e}return null}const _=t(y.get());g.projectToRenderScreen(e.origin,_);const I=new A(null,this._forEachLayer),{slicePlane:v}=a,j=null!=v?M(v):null,U=b(this.viewingMode);U.options.store=w.MIN,U.options.verticalOffset=m;const x=e.origin,E=i(y.get(),x,e.direction);U.reset(x,E,g),U.point=_;const H=c?"type"in c&&"graphics"===c.type?e=>e.layerUid!==c.uid:e=>e.graphicUid!==c.uid:null;switch(d){case"relative-to-scene":{const e=e=>(!H||H(e))&&!!e.lastValidElevationBB;U.intersect(I.layers,_,this._tolerance,null,e),this._externalIntersectionHandlers.forAll((e=>{if(e.type===P.I3S||e.type===P.TERRAIN||e.type===P.TILES3D){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_)}}));break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll((e=>{if(e.isGround){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_)}}))}if(U.results.min.getIntersectionPoint(F)){const e=R(a,F);return e.z=l,e}return null}computeIntersection(e,r,n,s){if(null==e)return;const o=this._view.state.camera,l=t(y.get());o.projectToRenderScreen(e.origin,l);const c=new A(n,this._forEachLayer);r.options.selectOpaqueTerrainOnly=!n||!("include"in n||"exclude"in n);const a=e.origin,u=i(y.get(),e.origin,e.direction);r.reset(a,u,o),r.intersect(c.layers,l,this._tolerance);const h=this._view.slicePlane,d=null!=h?M(h):null;r.intersect(c.sliceableLayers,l,this._tolerance,d);const p=n&&(n.requiresGroundFeedback||n.enableDraped);this._externalIntersectionHandlers.forAll((e=>{const t=e.layerUid,n=Array.isArray(t),i=n?t:[t];n&&(r.options.filteredLayerUids=[]);let o=!1;for(const s of i){!c.filterLayerUid(s)?n&&r.options.filteredLayerUids.push(s):o=!0}if(r.options.isFiltered=!o,e.isGround&&p||!r.options.isFiltered){const t=e.slicePlaneEnabled?d:null;e.intersect(r,t,a,u,l,s)}}));const m=y.get(),f=this._view.basemapTerrain;if(n&&n.enableDraped&&null!=f.spatialReference&&r.results.ground.getIntersectionPoint(m)){const e=f.overlayManager.renderer,t=this._view.renderCoordsHelper.spatialReference,n=y.get();this._view.renderCoordsHelper.fromRenderCoords(m,n,f.spatialReference),n[2]=this._view.elevationProvider?.getElevation(m[0],m[1],m[2],t,"ground")??0,e.intersect(r,n,r.results.ground,(e=>c.filterRenderGeometry(e)))}r.sortResults(),this._processHUDResults(r)}_processHUDResults(e){const t=e.results.hud;a(this._tmpRegion,u);const r=this._view.state.camera,n=[],i=this._tmpRegion,s=e=>{const t=new H(e);r.projectToRenderScreen(e.target.center,t.screenPoint),t.screenPoint[0]=Math.floor(t.screenPoint[0]),t.screenPoint[1]=Math.floor(t.screenPoint[1]),n.push(t),p(i,t.screenPoint)};e.sortResults(t.all),null!=t.min.dist&&s(t.min);for(const a of t.all)t.min.target.object!==a.target.object&&t.max.target.object!==a.target.object&&s(a);if(null!=t.max.dist&&t.max.target.object!==t.min.target.object&&s(t.max),!n.length)return;i[0]===i[2]&&(i[2]+=1),i[1]===i[3]&&(i[3]+=1);const o=r.fullWidth,l=r.fullHeight,c=Math.max(0,i[0]-x),m=Math.max(0,i[1]-x),y=Math.min(h(i)+2*x,o-c),f=Math.min(d(i)+2*x,l-m);if(y<=0||f<=0)return;const g=new Uint8Array(y*f*4);this._view._stage.renderer.readHUDVisibility(c,m,y,f,g);let R=!0;const _=null==e.results.max.dist;let I=0;for(const a of n)for(const t of E){const r=4*(Math.min(a.screenPoint[0]+t[0],o)-i[0]+(Math.min(a.screenPoint[1]+t[1],l)-i[1])*y);if(!(r<0||r>=g.length)&&g[r]){R&&(e.results.min.copy(a.result),R=!1),_&&e.results.max.copy(a.result),e.options.store===w.ALL&&e.results.all.splice(I++,0,a.result);break}}}}const x=1,E=(()=>{const e=[],t=x;for(let r=-t;r<=t;r++)for(let n=-t;n<=t;n++)e.push([n+t,r+t]);return e})();class H{constructor(e){this.result=e,this.screenPoint=r()}}let L;function T(e){return L&&L.viewingMode===e||(L=b(e)),L}class A{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t((e=>{e.pickable&&this.filterLayerUid(e.apiLayerUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)}))}filterLayerUid(e){const{include:t,exclude:r}=this;return null==e?null==t&&null==r:(null==t||t.has(e))&&(null==r||!r.has(e))}filterRenderGeometry(e){return this.filterLayerUid(e.layerUid)}}function k(e){return"object"==typeof e&&"intersect"in e}const F=l(),S=l(),D=r();export{U as SceneIntersectionHelper,k as isIntersectionHandler};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{fromRotation as i,exactEquals as s,multiply as c,rotate as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as h,e as g,g as M,l as y,h as b,
|
|
5
|
+
import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{fromRotation as i,exactEquals as s,multiply as c,rotate as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as m,create as u}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{f as h,e as g,g as M,l as y,h as b,m as d,s as x,n as j,k as v,a as z,c as P,b as I}from"../../../../chunks/vec32.js";import{create as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as S,axis as k,fromPoints as E,wrapAxisAngle as A}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as H,vectorCoordinates as U}from"../../../../geometry/support/coordinateSystem.js";import{create as G,intersectRay as q,fromNormalAndOffset as C}from"../../../../geometry/support/plane.js";import{j as F,h as R,g as V,d as T}from"../../../../chunks/sphere.js";import{angle as O}from"../../../../geometry/support/vector.js";import{sm4d as W,sv3d as B}from"../../../../geometry/support/vectorStacks.js";import{fromScreen as D,fromScreenAtEye as J}from"../../support/geometryUtils/ray.js";import{intersectScreen as K}from"../../support/geometryUtils/sphere.js";import{Camera as L}from"../../webgl-engine/lib/Camera.js";import{terrainId as N}from"../../webgl-engine/lib/verticalOffsetUtils.js";var Q;!function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"}(Q||(Q={}));const X=30,Y=[1,3e8],Z=80,$=8,_=200,tt=1508e5,et=5,nt=50,ot=5,rt=10,at=90,it={exclude:new Set([N])};function st(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function ct(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function lt(t,e,n){const o=i(W.get(),n[3],k(n));null==o||s(o,m)||(h(re,t.eye,e),g(re,re,o),t.eye=M(re,re,e),h(re,t.center,e),g(re,re,o),t.center=M(re,re,e),t.up=g(re,t.up,o))}function mt(t,e,n,o){return q(t,D(e,n,le),o)}function ut(t,e,n,o){return q(t,J(e,n,le),o)}function pt(t,e,n,o){const r=B.get();let a=1-n;h(r,e,t.eye);const i=y(r);let s=i*(1-a);a>=0&&s<o&&(s=o,a=-(s-i)/i),Math.abs(i-s)<1e-6||(b(r,r,a),t.eye=M(re,t.eye,r),t.center=d(re,t.center,e,a))}function ft(t,e,n){e.getScreenCenter(ht),K(t,e,ht,re)&&(e.center=re);const o=e.distance,r=o*n;if(Math.abs(o-r)<1e-6)return;const a=b(B.get(),e.viewForward,r);e.eye=h(re,e.center,a)}const ht=a();function gt(t,e){x(e,0,0,0);for(const n of t)M(e,e,n);b(e,e,1/t.length)}function Mt(t,e,n,o){return Math.sin(t/y(e))*(n+o.radius)}function yt(t,e,n,o){return Mt(Math.PI/2,e,n,o)+(t-Math.PI/2)}var bt;!function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal"}(bt||(bt={}));const dt={Elevation:3e4,Angle:e(16)},xt={Pole:.95,Angle:e(18),Tilt:45},jt=e(80);function vt(t,e,n,o,r,a){const i=w(),s=T();let c=!0,l=!0;return t.intersectScreen(n,i,a)?s[3]=y(i):(l=!1,e.aboveGround&&r!==Q.Ellipsoid?s[3]=Math.max(y(e.center),.9*o.radius):s[3]=y(e.eye)-e.relativeElevation,r===Q.Silhouette?wt(s,e,n,i):c=K(s,e,n,i)),{sphere:s,scenePickPoint:c?i:null,hasGeometryIntersection:l}}function zt(t,e,n){if(y(t.eye)-n.radius>dt.Elevation)return bt.Horizontal;J(t,e,me);return-Math.sign(t.relativeElevation)*(.5*Math.PI+O(t.eye,me.direction))<dt.Angle?bt.Vertical:bt.Horizontal}function Pt(t,e,n){h(It,n,e),t.eye=h(re,t.eye,It),t.center=h(re,t.center,It)}const It=w();function wt(t,e,n,o){const r=J(e,n,le);return null!=r&&(F(t,r,St),R(t,r,o)?!(z(St,r.origin)<z(o,r.origin))||(P(o,St),!1):(h(kt,e.eye,e.center),j(kt,kt),C(kt,-v(j(kt,kt),St),Et),q(Et,r,o),!1))}const St=w(),kt=w(),Et=G();function At(a,i,s,c,l,m){let u=0;if(I(se,a,i),h(ae,a,i),y(a)<=l||!c.aboveGround){I(s,ae,c.eye);const p=v(a,i)/(y(a)*y(i));if(p<.9999)u=o(p);else{const t=y(I(w(),a,i))/(y(a)*y(i));u=r(t)}const f=Math.cos(n(t.normalize(e(m)),0,jt));u=-u-Math.max(0,y(i)-l)/(f*l)}else h(Ht,c.eye,c.center),I(s,ae,Ht),u=-y(ae)/l;return j(s,s),b(s,s,y(se)),u}const Ht=w();function Ut(r,a,i,s){let c,l;const m=Math.cos(n(t.normalize(e(s)),0,jt));return c=a>i?-(a-i)/(m*i):a<-i?Math.PI-(a+i)/(m*i):o(a/i),l=r>i?-(r-i)/(m*i):r<-i?Math.PI-(r+i)/(m*i):o(r/i),(l-c)*i}function Gt(t,e,n,o,r,a,i,s,c,l){const m=Ut(t[2],e[2],a[3],s),u=c?Ut(t[0],e[0],a[3],180):e[0]-t[0],f=Math.sin(i)*u-Math.cos(i)*m,h=Math.cos(i)*u+Math.sin(i)*m;j(re,r);const g=c?f/Math.sqrt(Math.abs(a[3]**2-v(n,re)**2)):f/a[3],M=h/Math.sqrt(Math.abs(a[3]**2-v(n,o)**2));p(l,g,M)}function qt(t,e,n,o,r,a,i,s,c,l){I(se,t,e),H(a.up,a.eye,Nt,Qt,Xt),H([0,0,1],a.eye,Jt,Kt,Lt),P(n,Kt),P(o,Jt),j(n,n),b(n,n,y(se)),U(t,j(Qt,Qt),j(Xt,Xt),j(Nt,Nt),Yt),U(e,Qt,Xt,Nt,Zt),Gt(Yt,Zt,t,Jt,Kt,i,s,c,l,r)}function Ct(t,e,n,o,r,a,s){i(te,r,o),i(ee,s,a),c(ne,te,ee),h(e,t,n),g(e,e,ne),M(e,e,n)}function Ft(t,e,n,o,r,a){i(te,o,n),i(ee,a,r),c(ne,te,ee),h(re,t.eye,e),g(re,re,ne),t.eye=M(re,re,e),h(re,t.center,e),g(re,re,ne),t.center=M(re,re,e),h(re,t.up,e),g(re,re,ne),t.up=M(re,re,e)}function Rt(t,e,n,o,r,a){return(Math.abs(o)>Math.PI-xt.Angle||Math.abs(o)<xt.Angle)&&(Math.abs(t[2])<n*xt.Pole||Math.abs(e)>n)&&a.aboveGround&&r<xt.Tilt}function Vt(t,e,n,o,r,a){if(a)E(n,o,_t),lt(e,V(t),_t);else{const a=At(n,o,ce,e,t[3],r);lt(e,V(t),A(ce,a))}}function Tt(t,e,n,o,r,a,i){const s=i?20:1,c=1e-12;let l,m;P(oe,o),ie.copyFrom(e);for(let u=0;u<s&&z(n,oe)>c&&(l=z(n,oe),qt(n,oe,Kt,Jt,$t,ie,t,r,a,i),Ft(ie,V(t),Jt,$t[1],Kt,$t[0]),Ct(oe,oe,V(t),Jt,$t[1],Kt,$t[0]),m=z(n,oe),m<l||0===u);u++)e.copyFrom(ie)}function Ot(n,o,r,a,i,s,c){Rt(r,v(o.up,r),n[3],-t.normalize(e(i)),s,o)?Tt(n,o,r,a,-t.normalize(e(i)),s,c):Vt(n,o,r,a,s,c)}function Wt(t,e,n,o,r,a){const{eye:i}=t;H([0,0,1],i,Jt,Kt,Lt);const s=e.translation[0]*n.pan,c="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-v(t.center,Jt)**2/y(t.center)**2)),.5),u=(Math.sin(a)*c+Math.cos(a)*s)/m,p=-Math.cos(a)*c+Math.sin(a)*s;switch(l(o.pan.matrix,o.pan.matrix,u,Jt),o.pan.enabled=!0,r.mode){case"pan":l(o.pan.matrix,o.pan.matrix,p,Kt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Bt(t,e,n,o,r){const{eye:a,viewRight:i}=t,s=I(B.get(),i,a),c=e.translation[0]*n.pan;switch(0!==c&&(l(o.pan.matrix,o.pan.matrix,-c,s),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(l(o.pan.matrix,o.pan.matrix,t,i),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Dt(n,o,r,a,i,s,c,l,m){Rt(n.center,v(n.up,n.center),y(n.center),-t.normalize(e(s)),c,o)?Wt(o,r,a,l,m,-t.normalize(e(i))):Bt(o,r,a,l,m)}const Jt=w(),Kt=w(),Lt=w(),Nt=w(),Qt=w(),Xt=w(),Yt=w(),Zt=w(),$t=f(),_t=S(),te=u(),ee=u(),ne=u(),oe=w(),re=w(),ae=w(),ie=new L,se=w(),ce=w(),le={origin:w(),direction:w()},me={origin:w(),direction:w()};export{bt as NavigationMode,xt as PreservingHeadingThreshold,Q as SpherePickPointFallback,jt as TiltThresholdPanningSpeed,dt as VerticalPanTresholds,Pt as applyPanPlanar,Vt as applyPanSphericalDirectRotation,Tt as applyPanSphericalPreserveHeading,lt as applyRotation,Ft as applyRotationWithTwoAxes,ft as applyZoomOnSphere,pt as applyZoomToPoint,gt as centroid,it as contentIntersectorOptions,zt as decideNavigationMode,Y as distanceClampValues,mt as intersectPlaneFromScreenPoint,ut as intersectPlaneFromScreenPointAtEye,Ut as lengthFromPoints,nt as minHeightLimit,st as normalizeCoordinate,ct as normalizeRotationDelta,yt as offSurfaceTiltToEyeTiltGlobal,Mt as onSurfaceTiltToEyeTiltGlobal,et as panDistanceModifier,Dt as panMotionToRotationMatrix,Ot as panToPosition,vt as pickPointAndInitSphere,X as pivotDistanceModifier,Rt as preserveHeadingThreshold,ot as rotatePivotDistanceModifier,rt as rotatePivotMinDistanceModifier,Ct as rotatePointAroundTwoAxes,at as rotateScreenPixelArea,At as rotationAngleAndAxisDirectRotation,qt as rotationAnglesAndAxesHeadingPreserving,Gt as rotationAnglesHeadingPreserving,Z as screenPixelArea,wt as sphereOrPlanePointFromScreenPoint,$ as zoomDistanceModifier,tt as zoomMaxDistanceModifier,_ as zoomMinDistanceModifier};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{acosClamped as o}from"../../../../core/mathUtils.js";import{f as r,l as t,
|
|
5
|
+
import{acosClamped as o}from"../../../../core/mathUtils.js";import{f as r,l as t,k as s}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";function c(i,c,f){i.worldUpAtPosition(c,m),r(e,f,c);const n=t(e);return 0===n?0:o(s(e,m)/n)}const m=i(),e=i();export{c as viewAngle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{neverReached as t}from"../../../core/compilerUtils.js";import{lerp as e}from"../../../core/mathUtils.js";import{invert as i}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as n,h as o,
|
|
5
|
+
import{neverReached as t}from"../../../core/compilerUtils.js";import{lerp as e}from"../../../core/mathUtils.js";import{invert as i}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as n,h as o,E as s,e as a,s as c,k as l}from"../../../chunks/vec32.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as d}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as m}from"../../../geometry/projection/projectBoundingRect.js";import{projectVectorToVector as _}from"../../../geometry/projection/projectVectorToVector.js";import{create as g,empty as f,expandWithVec3 as u}from"../../../geometry/support/aaBoundingBox.js";import{create as x,center as R}from"../../../geometry/support/aaBoundingRect.js";import{PlaneIndex as y}from"../../../geometry/support/frustum.js";import{create as j,fromPoints as b}from"../../../geometry/support/lineSegment.js";import{create as A,fromVectorsAndPoint as E,copy as S,negate as B,signedDistance as C}from"../../../geometry/support/plane.js";import{wrap as H}from"../../../geometry/support/ray.js";import{ViewingMode as w}from"../../ViewingMode.js";import{frustumLineSegment as G}from"./intersectionUtils.js";const M=.5*Math.PI,F=M/Math.PI*180;class N{constructor(t){this._renderCoordsHelper=t.renderCoordsHelper,this._extent=new Array(4),this._planes=new Array(6),this._maxSpan=0,this._center={origin:p(),direction:p()};for(let e=0;e<4;e++)this._extent[e]={origin:p(),direction:p(),cap:{next:null,direction:p()}},this._planes[e]=A();this._planes[y.NEAR]=A(),this._planes[y.FAR]=A(),this._planesWithoutFar=this._planes.slice(0,5)}update(t,e,i,r=!0){const a=this._extent;this._toRenderBoundingExtent(t,e,i),n(this._center.origin,a[0].origin,a[2].origin),o(this._center.origin,this._center.origin,.5),this._renderCoordsHelper.worldUpAtPosition(this._center.origin,this._center.direction),r||o(this._center.direction,this._center.direction,-1);for(let n=0;n<4;n++){const t=a[n];this._renderCoordsHelper.worldUpAtPosition(t.origin,t.direction);const e=a[3===n?0:n+1];t.cap.next=e.origin,s(t.cap.direction,t.origin,e.origin),E(t.direction,t.cap.direction,t.origin,this._planes[n]),r||o(t.direction,t.direction,-1)}E(a[0].cap.direction,a[1].cap.direction,a[0].origin,this._planes[y.NEAR]),r?B(this._planes[y.NEAR],this._planes[y.FAR]):(S(this._planes[y.FAR],this._planes[y.NEAR]),B(this._planes[y.NEAR],this._planes[y.NEAR])),this._maxSpan=Math.max(Math.abs(t[0]-t[2]),Math.abs(t[1]-t[3])),this._maxSpanSpatialReference=e,this._minGlobalAltitude=.9*h(this._maxSpanSpatialReference).radius}isVisibleInFrustum(t,e,i=!1){if(null==t)return!1;if(this._renderCoordsHelper.viewingMode===w.Global){const i=this._maxSpanSpatialReference.isGeographic?F:M*e;if(this._maxSpan>i)return!0;if(null!=t.altitude&&t.altitude>=this._minGlobalAltitude)return this._isVisibleInFrustumGlobal(t)}if(0===this._maxSpan){const e=this._extent[0];return!(i||!t.intersectsRay(H(e.origin,e.direction)))}for(let n=0;n<this._extent.length;n++){const e=this._extent[n];if(!i&&t.intersectsRay(H(e.origin,e.direction)))return!0;if(t.intersectsLineSegment(b(e.origin,e.cap.next,P),e.cap.direction))return!0}const r=i?this._planes:this._planesWithoutFar;for(let n=0;n<t.lines.length;n++){const e=t.lines[n];if(G(r,e.origin,e.endpoint,e.direction))return!0}return!1}_toRenderBoundingExtentGlobal(t,r,n){const o=5;R(t,V),V[2]=n,d(r,V,v,this._renderCoordsHelper.spatialReference),i(I,v),f(k);for(const{x0:i,x1:s,y0:c,y1:l}of U)for(let p=0;p<o;p++){const h=p/(o-1);V[0]=e(t[i],t[s],h),V[1]=e(t[c],t[l],h),V[2]=n,_(V,r,V,this._renderCoordsHelper.spatialReference),a(V,V,I),u(k,V)}c(this._extent[0].origin,k[0],k[1],k[2]),c(this._extent[1].origin,k[3],k[1],k[2]),c(this._extent[2].origin,k[3],k[4],k[2]),c(this._extent[3].origin,k[0],k[4],k[2]);for(let e=0;e<4;++e)a(this._extent[e].origin,this._extent[e].origin,v)}_toRenderBoundingExtentLocal(t,e,i){m(t,e,L,this._renderCoordsHelper.spatialReference),c(this._extent[0].origin,L[0],L[1],i),c(this._extent[1].origin,L[2],L[1],i),c(this._extent[2].origin,L[2],L[3],i),c(this._extent[3].origin,L[0],L[3],i)}_toRenderBoundingExtent(e,i,r){switch(this._renderCoordsHelper.viewingMode){case w.Global:this._toRenderBoundingExtentGlobal(e,i,r);break;case w.Local:this._toRenderBoundingExtentLocal(e,i,r);break;default:t(this._renderCoordsHelper.viewingMode)}}_isVisibleInFrustumGlobal(t){if(C(t.planes[y.NEAR],this._center.origin)<0&&l(this._center.direction,t.direction)<0)return!0;for(let e=0;e<4;e++){const i=this._extent[e];if(C(t.planes[y.NEAR],i.origin)<0&&l(i.direction,t.direction)<0)return!0}return!1}}const U=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],V=p(),v=r(),I=r(),k=g(),L=x(),P=j();export{N as FrustumExtentIntersection};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../Camera.js";import{Cyclical as n}from"../../../core/Cyclical.js";import t from"../../../core/Logger.js";import{deg2rad as r,rad2deg as o}from"../../../core/mathUtils.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{h as a,g as c,
|
|
5
|
+
import e from"../../../Camera.js";import{Cyclical as n}from"../../../core/Cyclical.js";import t from"../../../core/Logger.js";import{deg2rad as r,rad2deg as o}from"../../../core/mathUtils.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{h as a,g as c,o as l,c as s}from"../../../chunks/vec32.js";import{clone as u,create as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectWithZConversion as d,project as h}from"../../../geometry/projection.js";import g from"../../../geometry/SpatialReference.js";import{projectPointToVector as y,projectPointToVectorAsync as v}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as w,projectVectorToPointAsync as R}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as x}from"../../../geometry/projection/projectVectorToVector.js";import{ViewingMode as M}from"../../ViewingMode.js";import{cameraOnContentAlongViewDirection as S}from"../camera/intersectionUtils.js";import{t as T,c as j}from"../../../chunks/cameraUtilsPlanar.js";import{t as C,c as z}from"../../../chunks/cameraUtilsSpherical.js";import{getGreatCircleSpanAt as b}from"./earthUtils.js";import{getElevationAtPoint as U}from"./ElevationProvider.js";import{isSpatialReferenceSupported as P}from"../../support/spatialReferenceSupport.js";const A=()=>t.getLogger("esri.views.3d.support.cameraUtils"),D=39.37,H=96,L=1,G=8,E=5,O=1,q=f(),I={heading:0,tilt:0},k=f(),J=new n(-20037508.342788905,20037508.342788905),V=new n(-180,180);var F;function W(e){return e.spatialReference??g.WGS84}function X(e){return"global"===e.viewingMode?z:j}function K(e,n,t,r,o){return X(e).headingTiltToDirectionUp(n,t,r,o)}function Y(e,n){if(null==n)return null;const t=e.renderSpatialReference,o=X(e).headingTiltToDirectionUp,i=f();if(!y(n.position,i,t))return null;const l=o(i,n.heading,n.tilt);a(l.direction,l.direction,e.state.camera.distance),c(l.direction,l.direction,i);const s=S(e,i,l.direction,l.up);return s.fov=r(n.fov),s.row=n.layout.row,s.rows=n.layout.rows,s.column=n.layout.column,s.columns=n.layout.columns,s}!function(e){e[e.LOCKED=0]="LOCKED",e[e.ADJUST=1]="ADJUST"}(F||(F={}));const N=f();function Z(n,t,r){const i=n.renderSpatialReference,a=ne(n,t.eye,t.viewForward,t.up,I);let c=W(n);return x(t.eye,i,N,c)||(c=g.WGS84,x(t.eye,i,N,c)),null==r?r=new e(new p(N,c),a.heading,a.tilt,o(t.fov)):(r.position.x=N[0],r.position.y=N[1],r.position.z=N[2],r.position.spatialReference=c,r.heading=a.heading,r.tilt=a.tilt,r.fov=o(t.fov)),r.layout.row=t.row,r.layout.rows=t.rows,r.layout.column=t.column,r.layout.columns=t.columns,r}function B(e,n,t){const o=e.state.camera,i=o.width/2/o.pixelRatio;e.renderCoordsHelper.viewingMode===M.Global&&null!=t&&(n*=Math.cos(r(t))),n/=e.renderCoordsHelper.unitInMeters;return i/(H*D/n)/Math.tan(o.fovX/2)}function Q(e,n,t){const o=e.state.camera,i=n*Math.tan(o.fovX/2),a=o.width/2/o.pixelRatio;let c=H*D/(a/i);return e.renderCoordsHelper.viewingMode===M.Global&&null!=t&&(c/=Math.cos(r(t))),c*e.renderCoordsHelper.unitInMeters}async function $(e,n,t,r,o,i){return ee(e,n,B(e,t,n.latitude),r,o,i)}function _(e,n,t,r,o,i){return Ce(e,ae(e,r.heading,r.tilt,n,t,o),r.fov,i)}async function ee(e,n,t,r,o,a){const c=await ce(e,r.heading,r.tilt,n,t,o,a);return i(a),ze(e,c,r.fov,a)}function ne(e,n,t,r,o){return X(e).directionToHeadingTilt(n,t,r,o)}function te(e,n){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(n,k,e.spatialReference)&&e.elevationProvider&&(U(e.elevationProvider,k)??0)>k[2]-O)}async function re(e,n,t){if(te(e,n))return!0;const{elevationProvider:r,spatialReference:o,renderCoordsHelper:a}=e;if(null==r||!a.fromRenderCoords(n,k,o))return!1;const[c,l,s]=k,u=await r.queryElevation(c,l,s,o,"ground",t)??0;return i(t),u>s-O}async function oe(e,n,t){const r=f();if(null==n)return s(r,e.state.camera.center);if(n instanceof p){const{renderSpatialReference:o,basemapTerrain:a,elevationProvider:c}=e,l=n.spatialReference;if(await v(n,r,o,0,{signal:t}),i(t),null==n.z&&null!=a&&null!=c){const o=await c.queryElevation(n.x,n.y,n.z??0,l,"ground",t);i(t),null!=o&&e.renderCoordsHelper.setAltitude(r,o)}return r}return s(r,n)}function ie(e,n){const t=f();if(null==n)return s(t,e.state.camera.center);if(n instanceof p){if(!y(n,t,e.renderSpatialReference))return null;const{basemapTerrain:r,elevationProvider:o}=e;if(null==n.z&&null!=r&&null!=o){const r=U(o,n);null!=r&&e.renderCoordsHelper.setAltitude(t,r)}return t}return s(t,n)}function ae(e,n,t,r,o,i){return le(e,n,t,r instanceof p?r:null,ie(e,r),o,i)}async function ce(e,n,t,r,o,a,c){const l=r instanceof p?r:null,s=await oe(e,r,c);return i(c),se(e,n,t,l,s,o,a,c)}function le(e,n,t,r,o,i,a){if(null==o)return null;if(!r&&(r=new p({spatialReference:W(e)}),!w(o,e.renderSpatialReference,r)))return null;const c=ue(e,n,t,o,i,a);if(fe(e,t,a)&&te(e,c.eye)){const{tilt:a,mode:c}=me(e,t,o,i);return le(e,n,a,r,o,i,c)}return pe(c,o)}async function se(e,n,t,r,o,a,c,l){r||(r=new p({spatialReference:W(e)}),await R(o,e.renderSpatialReference,r,{signal:l})||(r=null)),i(l);const s=ue(e,n,t,o,a,c);if(fe(e,t,c)&&await re(e,s.eye,l)){i(l);const{tilt:c,mode:s}=me(e,t,o,a);return se(e,n,c,r,o,a,s,l)}return pe(s,o)}function ue(e,n,t,r,o,i){const a=Re(e,n,t,r,o=Math.max(o,e.state.constraints.minimumPoiDistance),i);return(0,X(e).eyeForCenterWithHeadingTilt)(r,o,a.heading,a.tilt)}function fe(e,n,t){const r=e.map.ground.navigationConstraint;return t===F.ADJUST&&"global"===e.viewingMode&&n>0&&(null==r||"stay-above"===r.type)}function me(e,n,t,r){const o=Te(e,t,r,Se(e,r,n,t));return{tilt:o,mode:n-o<1?F.LOCKED:F.ADJUST}}function pe(e,n){return{...e,center:u(n)}}function de(e,n){const{state:t,spatialReference:r}=e,o=n.spatialReference;return t.isGlobal&&P(o,M.Global)||t.isLocal&&r.equals(o)}function he(e,n){let t,r,o;if(e.state.isGlobal){const e=new p(n.xmin,n.ymin,n.spatialReference),i=new p(n.xmax,n.ymax,n.spatialReference),a=n.spatialReference.isGeographic?V:J;t=new p({x:a.center(e.x,i.x),y:(i.y+e.y)/2,z:null!=n.zmax&&null!=n.zmin?(n.zmax+n.zmin)/2:void 0,spatialReference:n.spatialReference});const c=m(n.spatialReference),l=b(t,e,i);r=l.lon,o=l.lat,a.diff(e.x,i.x)>a.range/2&&(r+=c.halfCircumference),r=Math.min(r,c.halfCircumference),o=Math.min(o,c.halfCircumference)}else{const i=e.renderSpatialReference??n.spatialReference;i.equals(n.spatialReference)||(n=h(n,i)),r=n.xmax-n.xmin,o=n.ymax-n.ymin;const a=null!=n.zmax&&null!=n.zmin?(n.zmax+n.zmin)/2:void 0;t=new p({x:n.xmin+.5*r,y:n.ymin+.5*o,z:a,spatialReference:i})}const i=null!=n.zmax&&null!=n.zmin?n.zmax-n.zmin:0,a=e.state.camera,c=1/Math.tan(a.fovX/2),l=1/Math.tan(a.fovY/2),s=1/Math.tan(a.fov/2);return{center:t,distance:Math.max(.5*r*c,.5*o*l,.5*i*s)/L}}async function ge(e,n,t,r,o,a){const c=de(e,n)?n:await d(n,e.spatialReference,{signal:a});i(a);const{center:l,distance:s}=he(e,c),u=await ce(e,t,r,l,s,o,a);return i(a),ze(e,u,e.camera.fov,a)}function ye(e,n,t,r,o,i){let a;try{a=de(e,n)?n:h(n,e.spatialReference)}catch(u){return null}const{center:c,distance:l}=he(e,a),s=ae(e,t,r,c,l,o);return null==s?null:Ce(e,s,e.camera.fov,i)}function ve(e,n,t){const r=e.renderSpatialReference,o=new p({spatialReference:W(e)});if(!w(t,r,o))return null;const i=Math.tan(n.fovX/2),a=Math.tan(n.fovY/2),c=l(n.eye,t),s=2*c*i*L,u=2*c*a*L;return"global"===e.viewingMode?C(e,o,s,u):T(e,o,s,u)}function we(e,n,t){const r=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(t/r)/Math.LN2>G)return!0;const o=e.renderSpatialReference,i=W(e),a=new p({spatialReference:i});if(!w(n,o,a))return!1;const c=new p({spatialReference:i});if(!w(e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,o,c))return!1;const l=Math.tan(.5*e.state.camera.fov)*r;return c.distance(a)/l>E}function Re(e,n,t,r,o,i){let a=0;return i===F.ADJUST&&we(e,r,o)?(n=0,a=Me(e,o,t,r)):a=je(e,r,o,t),a=e.state.constraints.clampTilt(o,a),{heading:n,tilt:t=Te(e,r,o,a)}}const xe=.7;function Me(e,n,t,r){const o=je(e,r,n,t);if(!e.state.constraints.tilt)return o;const i=e.state.constraints.tilt(n);i.max=Math.min(i.max,.5*Math.PI);const a=i.min*(1-xe)+i.max*xe;return Math.min(o,a)}function Se(e,n,t,r){let o=je(e,r,n,t);if(!e.state.constraints.tilt)return o;const i=e.state.constraints.tilt(n);return o=Math.min(o,.5*Math.PI),i.min*(1-xe)+o*xe}function Te(e,n,t,r){return X(e).lookAtTiltToEyeTilt(r,n,t)}function je(e,n,t,r){return X(e).eyeTiltToLookAtTilt(r,n,t)}function Ce(n,t,r,o){if(null==t)return null;const i=n.renderSpatialReference,a=new p({spatialReference:W(n)});return w(t.eye,i,a)?(o??=new e,o.position=a,o.heading=t.heading,o.tilt=t.tilt,o.fov=r,o):null}async function ze(n,t,r,o){const a=n.renderSpatialReference,c=new p({spatialReference:W(n)});return await R(t.eye,a,c,{signal:o}),i(o),new e(c,t.heading,t.tilt,r)}function be(e,n){const t=e.basemapTerrain?.tilingScheme;if(t)return t.levelAtScale(n);A().error("#scaleToZoom()","Cannot compute zoom from scale without a tiling scheme")}function Ue(e,n){const t=e.basemapTerrain?.tilingScheme;if(t)return t.scaleAtLevel(n);A().error("#zoomToScale()","Cannot compute scale from zoom without a tiling scheme")}function Pe(e,n){return x(n.center,e.renderSpatialReference,q,g.WGS84),Q(e,n.distance,q[1])}export{F as OrientationMode,Pe as computeScale,ne as directionToHeadingTilt,Q as distanceToScale,Y as externalToInternal,ee as fromCenterDistanceAsync,_ as fromCenterDistanceSync,$ as fromCenterScale,ge as fromExtentAsync,ye as fromExtentSync,ce as getObserverForPointAtDistanceAsync,ae as getObserverForPointAtDistanceSync,W as getViewSR,K as headingTiltToDirectionUp,Z as internalToExternal,B as scaleToDistance,be as scaleToZoom,ve as toExtent,Ue as zoomToScale};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{rad2deg as t,acosClamped as s}from"../../../core/mathUtils.js";import{n as o,
|
|
5
|
+
import{rad2deg as t,acosClamped as s}from"../../../core/mathUtils.js";import{n as o,k as a,c as i,h as n,f as r,l as c,b as e}from"../../../chunks/vec32.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";const f=l(),m=l();function h(){return{direction:l(),up:l()}}function u(l,h,u,p,b){let d=o(f,l),g=a(d,p);const j=g>0;g=Math.abs(g),g>.99&&(g=Math.abs(a(h,p)),g<.99?(i(d,h),j&&n(d,d,-1)):d=null);let k=0;if(d){n(m,p,a(p,d)),r(d,d,m);const o=a(d,b)/(c(d)*c(b));e(m,d,b);k=(a(m,p)>0?1:-1)*t(s(o))}const v=t(s(-a(p,l)/c(l)));return u?(u.heading=k,u.tilt=v,u):{heading:k,tilt:v}}export{h as createDirectionUp,u as directionToHeadingTilt};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{
|
|
5
|
+
import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{k as n,f as t,g as i,h as e,q as c,c as o,n as u}from"../../../chunks/vec32.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{signedDistance as l,getNormal as s}from"../../../geometry/support/plane.js";function p(r,n,t){return r[0]*n[0]+r[1]*n[1]+r[2]*n[2]+r[3]<t}function a(r,n,t){const i=n[0],e=n[1],c=n[2];return!(r[0][0]*i+r[0][1]*e+r[0][2]*c+r[0][3]>t)&&(!(r[1][0]*i+r[1][1]*e+r[1][2]*c+r[1][3]>t)&&(!(r[2][0]*i+r[2][1]*e+r[2][2]*c+r[2][3]>t)&&(!(r[3][0]*i+r[3][1]*e+r[3][2]*c+r[3][3]>t)&&(!(r[4][0]*i+r[4][1]*e+r[4][2]*c+r[4][3]>t)&&!(r[5][0]*i+r[5][1]*e+r[5][2]*c+r[5][3]>t)))))}function m(r,n,t,i){return x(r,n,null,h(i,n,t,!1))}function d(r,n){for(let t=0;t<6;t++){if(l(r[t],n)>0)return!1}return!0}function g(r,n,t,i){return x(r,n,t,h(i,n,t,!0))}function j(r,c,o,u){const f=n(o,t(r,u,c));return i(r,c,e(r,o,f))}const b={dir:f(),len:0,clip:r()};function h(r,n,i,f){const l=b;return r?(i&&f&&(l.len=c(n,i)),o(l.dir,r)):f?(l.len=c(n,i),t(l.dir,i,n),e(l.dir,l.dir,1/l.len)):(t(l.dir,i,n),u(l.dir,l.dir)),l}function v(r,t,i){const e=n(s(r),i.dir),c=-l(r,t);if(c<0&&e>=0)return!1;if(e>-1e-6&&e<1e-6)return c>0;if((c<0||e<0)&&!(c<0&&e<0))return!0;const o=c/e;return e>0?o<i.clip[1]&&(i.clip[1]=o):o>i.clip[0]&&(i.clip[0]=o),i.clip[0]<=i.clip[1]}function x(r,n,t,i){i.clip[0]=0,i.clip[1]=t?i.len:Number.MAX_VALUE;for(let e=0;e<r.length;e++)if(!v(r[e],n,i))return!1;return!0}export{j as closestPointOnRay,g as frustumLineSegment,d as frustumPoint,m as frustumRay,a as frustumSphere,p as planeSphere};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{acosClamped as t}from"../../../core/mathUtils.js";import{s as n,
|
|
5
|
+
import{acosClamped as t}from"../../../core/mathUtils.js";import{s as n,k as s,n as r,b as o,l as a,h as c,g as i,m as u,f as h}from"../../../chunks/vec32.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";function e(t,n){return t>n?Math.cos(n):Math.cos(t)}function M(t,n,s){return 2*Math.atan(s*Math.tan(.5*t)/n)}function l(t,n,s){return 2*Math.atan(n*Math.tan(.5*t)/s)}function m(t){const n=t[0]*t[0]+t[4]*t[4]+t[8]*t[8],s=t[1]*t[1]+t[5]*t[5]+t[9]*t[9],r=t[2]*t[2]+t[6]*t[6]+t[10]*t[10];return Math.sqrt(Math.max(n,s,r))}function g(t,s){const r=Math.sqrt(s[0]*s[0]+s[4]*s[4]+s[8]*s[8]),o=Math.sqrt(s[1]*s[1]+s[5]*s[5]+s[9]*s[9]),a=Math.sqrt(s[2]*s[2]+s[6]*s[6]+s[10]*s[10]);return n(t,r,o,a),t}function b(t,o,a){a=a||t;const c=s(t,o);n(a,t[0]-c*o[0],t[1]-c*o[1],t[2]-c*o[2]),r(a,a)}function p(t,s,a){Math.abs(t[0])>Math.abs(t[1])?n(s,0,1,0):n(s,1,0,0),o(a,t,s),o(s,a,t),r(a,a),r(s,s)}function q(t,n,s,r,o,a){const c=t+(n-t)*o;return c+(s+(r-s)*o-c)*a}function j(t,n,r,o=f()){const h=a(t),e=a(n),M=s(t,n)/(h*e);if(M<.9999999999999999){const s=Math.acos(M),a=((1-r)*h+r*e)/Math.sin(s),u=a/h*Math.sin((1-r)*s),f=a/e*Math.sin(r*s);return c(A,t,u),c(B,n,f),i(o,A,B)}return u(o,t,n,r)}function x(t,n,o,e=f(),M=f()){const l=a(t),m=a(n),g=s(t,n)/(l*m);if(g<.9999999999999999){const s=Math.acos(g),r=Math.sin(s),a=Math.sin(o*s),u=Math.sin((1-o)*s),h=(1-o)*l+o*m;{const s=h/r,o=s/m*a;c(A,t,s/l*u),c(B,n,o),i(e,A,B)}{const f=1/l*(-Math.cos((1-o)*s)*s*h+u*(-l+m));c(A,t,f);const e=1/m*(Math.cos(o*s)*s*h+a*(-l+m));c(B,n,e),i(M,A,B),c(M,M,1/r)}return M}return u(e,t,n,o),h(M,n,t),r(M,M),M}function k(n,a,c){n=r(A,n),a=r(B,a);const i=t(s(n,a));if(c){const t=o(z,n,a);if(s(t,c)<0)return-i}return i}function v(t){const n=t.length;return s=>{if(s<=t[0][0])return t[0][1];if(s>=t[n-1][0])return t[n-1][1];let r=1;for(;s>t[r][0];)r++;const o=t[r-1][0],a=t[r][0],c=(a-s)/(a-o);return c*t[r-1][1]+(1-c)*t[r][1]}}function U(t,n,a,c){h(w,n,t),h(y,a,t),o(c,w,y),r(c,c),c[3]=-s(t,c)}function d(t,s){if(n(s,0,0,0),t.length>0){for(let n=0;n<t.length;++n)i(s,s,t[n]);c(s,s,1/t.length)}}const w=f(),y=f(),z=f(),A=f(),B=f();export{k as angle,q as bilerp,e as cosCapped,M as fovx2fovy,l as fovy2fovx,b as makeOrthonormal,v as makePiecewiseLinearFunction,m as maxScale,d as midpoint3d,U as planeFromPoints,g as scaleFromMatrix,j as slerp,x as slerpTangent,p as tangentFrame};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{fromQuat as t,scale as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as i,conjugate as r,multiply as n}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as o,create as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{s as c,
|
|
5
|
+
import{fromQuat as t,scale as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as i,conjugate as r,multiply as n}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as o,create as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{s as c,u as d,v as l,w as _,x as m,t as f,g as u,y as g,z as p,l as M,h as b,r as j,A as S,B as z,C as x}from"../../../chunks/vec32.js";import{ZEROS as y,create as C,UNIT_Z as q,fromValues as Q}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as w}from"../../../chunks/vec42.js";import{create as P}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as v}from"../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as R}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as A}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as H}from"../../../geometry/projection/projectBuffer.js";import{getProjector as B}from"../../../geometry/projection/projectors.js";import{getNormal as W}from"../../../geometry/support/plane.js";import{isPlateCarree as k}from"../../../geometry/support/spatialReferenceUtils.js";import{sv3d as D,sq4d as G}from"../../../geometry/support/vectorStacks.js";import{ViewingMode as U}from"../../ViewingMode.js";import{computeOBB as V}from"./dito.js";import{Vertices as Z}from"../webgl-engine/lib/Attribute.js";class O{constructor(t=y,a=gt,e=o){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],e[0],e[1],e[2],e[3]]}clone(){const t=new O;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new O;return a._data=t.slice(),a}static fromJSON(t){return new O(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return c(D.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,e){this._data[0]=t,this._data[1]=a,this._data[2]=e}get halfSize(){return c(D.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return i(G.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=T,e=this._data;a[0]=e[6],a[1]=e[7],a[2]=e[8],a[3]=e[9];for(let s=0;s<8;++s){const i=t[s];i[0]=(1&s?-1:1)*e[3],i[1]=(2&s?-1:1)*e[4],i[2]=(4&s?-1:1)*e[5],d(i,i,a),i[0]+=e[0],i[1]+=e[1],i[2]+=e[2]}}isVisible(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],e=this._data[5];return Math.sqrt(t*t+a*a+e*e)}intersectSphere(t){E[0]=this._data[0]-t[0],E[1]=this._data[1]-t[1],E[2]=this._data[2]-t[2];const a=this.getQuaternion(X);return r(T,a),d(E,E,T),l(E,E),F[0]=Math.min(E[0],this._data[3]),F[1]=Math.min(E[1],this._data[4]),F[2]=Math.min(E[2],this._data[5]),_(F,E)<t[3]*t[3]}intersectSphereWithMBS(t,a=this.radius){const e=this._data;E[0]=e[0]-t[0],E[1]=e[1]-t[1],E[2]=e[2]-t[2];const s=t[3],i=s+a;return!(m(E)>i*i)&&(T[0]=-e[6],T[1]=-e[7],T[2]=-e[8],T[3]=e[9],d(E,E,T),l(E,E),F[0]=Math.min(E[0],e[3]),F[1]=Math.min(E[1],e[4]),F[2]=Math.min(E[2],e[5]),_(F,E)<s*s)}intersectPlane(t){const a=t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3],e=this.projectedRadius(W(t));return a>e?1:a<-e?-1:0}intersectRay(t,a,e=0){const s=this._data,i=T;i[0]=-s[6],i[1]=-s[7],i[2]=-s[8],i[3]=s[9],E[0]=t[0]-s[0],E[1]=t[1]-s[1],E[2]=t[2]-s[2];const r=d(E,E,T),n=d(F,a,T);let o=-1/0,h=1/0;const c=this.getHalfSize(ct);for(let d=0;d<3;d++){const t=r[d],a=n[d],s=c[d]+e;if(Math.abs(a)>1e-6){const e=(s-t)/a,i=(-s-t)/a;o=Math.max(o,Math.min(e,i)),h=Math.min(h,Math.max(e,i))}else if(t>s||t<-s)return!1}return o<=h}projectedArea(e,s,i,n){const o=this.getQuaternion(X);r(T,o),E[0]=e[0]-this._data[0],E[1]=e[1]-this._data[1],E[2]=e[2]-this._data[2],d(E,E,T);const h=this.getHalfSize(ct),l=E[0]<-h[0]?-1:E[0]>h[0]?1:0,_=E[1]<-h[1]?-1:E[1]>h[1]?1:0,m=E[2]<-h[2]?-1:E[2]>h[2]?1:0,g=Math.abs(l)+Math.abs(_)+Math.abs(m);if(0===g)return 1/0;const p=1===g?4:6,M=6*(l+3*_+9*m+13);t(dt,o),a(dt,dt,h);const b=this.getCenter(ot);for(let t=0;t<p;t++){const a=K[M+t];c(E,((1&a)<<1)-1,(2&a)-1,((4&a)>>1)-1),f(E,E,dt),u(I,b,E),I[3]=1,w(I,I,s);const e=1/Math.max(1e-6,I[3]);N[2*t]=I[0]*e,N[2*t+1]=I[1]*e}const j=2*p-2;let S=N[0]*(N[3]-N[j+1])+N[j]*(N[1]-N[j-1]);for(let t=2;t<j;t+=2)S+=N[t]*(N[t+3]-N[t-1]);return Math.abs(S)*i*n*.125}projectedRadius(t){const a=this.getQuaternion(X);return r(T,a),d(E,t,T),Math.abs(E[0]*this._data[3])+Math.abs(E[1]*this._data[4])+Math.abs(E[2]*this._data[5])}minimumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]-this.projectedRadius(W(t))}maximumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]+this.projectedRadius(W(t))}toAaBoundingBox(a){const e=this.getQuaternion(X),s=t(dt,e),i=this._data[3]*Math.abs(s[0])+this._data[4]*Math.abs(s[3])+this._data[5]*Math.abs(s[6]),r=this._data[3]*Math.abs(s[1])+this._data[4]*Math.abs(s[4])+this._data[5]*Math.abs(s[7]),n=this._data[3]*Math.abs(s[2])+this._data[4]*Math.abs(s[5])+this._data[5]*Math.abs(s[8]);a[0]=this._data[0]-i,a[1]=this._data[1]-r,a[2]=this._data[2]-n,a[3]=this._data[0]+i,a[4]=this._data[1]+r,a[5]=this._data[2]+n}transform(t,a,e,s=0,i=R(e),r=R(a),n=B(a,r)){if(e===i)a.isGeographic?st(this,t,a,s,r):et(this,t,a,s,r,n);else if(a.isWGS84&&(e.isWebMercator||k(e)))$(a,this,e,t,s);else if(a.isWebMercator&&k(e))tt(a,this,e,t,s);else{const i=this.getCenter(ot);i[2]+=s,H(i,a,0,i,e,0,1),t.center=i,this!==t&&(t.quaternion=this.getQuaternion(X),t.halfSize=this.getHalfSize(ct))}}}const T=h(),X=h(),Y=h(),E=C(),F=C(),I=P();function J(t,a=new O){return V(t,a),a}const N=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],K=(()=>{const t=new Int8Array(162);let a=0;const e=e=>{for(let s=0;s<e.length;s++)t[a+s]=e[s];a+=6};return e([6,2,3,1,5,4]),e([0,2,3,1,5,4]),e([0,2,3,7,5,4]),e([0,1,3,2,6,4]),e([0,1,3,2,0,0]),e([0,1,5,7,3,2]),e([0,1,3,7,6,4]),e([0,1,3,7,6,2]),e([0,1,5,7,6,2]),e([0,1,5,4,6,2]),e([0,1,5,4,0,0]),e([0,1,3,7,5,4]),e([0,2,6,4,0,0]),e([0,0,0,0,0,0]),e([1,3,7,5,0,0]),e([2,3,7,6,4,0]),e([2,3,7,6,0,0]),e([2,3,1,5,7,6]),e([0,1,5,7,6,2]),e([0,1,5,7,6,4]),e([0,1,3,7,6,4]),e([4,5,7,6,2,0]),e([4,5,7,6,0,0]),e([4,5,1,3,7,6]),e([0,2,3,7,5,4]),e([6,2,3,7,5,4]),e([6,2,3,1,5,4]),t})();function L(t,a,e,s,i){const n=t.getQuaternion(X);i.quaternion=n,r(T,n);const o=t.getCenter(ot),h=t.getHalfSize(ct);if(s===U.Global){d(mt,o,T),l(ft,mt),g(ut,ft,h),p(ut,ft,ut);const s=M(ut);u(ut,ft,h);const r=M(ut);if(s<e)i.center=o,c(mt,e,e,e),i.halfSize=u(mt,h,mt);else{const n=r>0?1+a/r:1,o=s>0?1+e/s:1,c=(o+n)/2,l=(o-n)/2;b(ut,ft,l),i.halfSize=j(ut,ut,h,c),b(ut,ft,c),j(ut,ut,h,l),S(mt,mt),z(mt,ut,mt);const _=t.getQuaternion(Y);i.center=d(mt,mt,_)}}else{i.center=j(mt,o,q,(e+a)/2);const t=d(mt,q,T);l(t,t),i.halfSize=j(ft,h,t,(e-a)/2)}return i}function $(t,a,e,s,i){a.getCenter(ot),ot[2]+=i;const r=R(e);H(ot,t,0,ot,r,0,1),at(r,a,ot,e,s)}function tt(t,a,e,s,i){a.getCenter(ot),ot[2]+=i,at(t,a,ot,e,s)}function at(a,e,s,i,r){const n=e.getQuaternion(X),o=t(dt,n),h=e.getHalfSize(ct);for(let t=0;t<8;++t){for(let a=0;a<3;++a)nt[a]=h[a]*(0!=(t&1<<a)?-1:1);for(let a=0;a<3;++a){let e=s[a];for(let t=0;t<3;++t)e+=nt[t]*o[3*t+a];it[3*t+a]=e}}H(it,a,0,it,i,0,8),J(rt,r)}function et(t,a,e,s,i=R(e),o=B(e,i)){t.getCorners(_t),t.getCenter(nt),nt[2]+=s,A(e,nt,lt,i),a.setCenter(lt[12],lt[13],lt[14]);const h=2*Math.sqrt(1+lt[0]+lt[5]+lt[10]);T[0]=(lt[6]-lt[9])/h,T[1]=(lt[8]-lt[2])/h,T[2]=(lt[1]-lt[4])/h,T[3]=.25*h;const _=t.getQuaternion(X);a.quaternion=n(T,T,_),r(T,T),c(ft,0,0,0);const m=a.getCenter(ht);for(const r of _t)r[2]+=s,o(r,0,r,0),p(mt,r,m),d(mt,mt,T),l(mt,mt),x(ft,ft,mt);a.halfSize=ft}function st(t,a,e,s,i=R(e)){const n=v(e),o=1+Math.max(0,s)/(n.radius+t.centerZ);t.getCenter(nt),nt[2]+=s,H(nt,e,0,nt,i,0,1),a.center=nt;const h=t.getQuaternion(X);a.quaternion=h,r(T,h),c(mt,0,0,1),d(mt,mt,T);const l=t.getHalfSize(ct);c(mt,l[0]*Math.abs(mt[0]),l[1]*Math.abs(mt[1]),l[2]*Math.abs(mt[2])),b(mt,mt,n.inverseFlattening),u(mt,l,mt),a.halfSize=b(mt,mt,o)}const it=new Array(24),rt=new Z(it,3),nt=C(),ot=C(),ht=C(),ct=C(),dt=e(),lt=s(),_t=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],mt=C(),ft=C(),ut=C(),gt=Q(-1,-1,-1);export{O as Obb,J as compute,L as computeOffsetObb};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as o}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as o}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{q as n,j as a,c as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../../geometry/Point.js";import{ViewingMode as p}from"../../../ViewingMode.js";import{distanceToScale as h}from"../cameraUtils.js";import{PropertiesPool as u}from"../PropertiesPool.js";import{PointOfInterest as m}from"./PointOfInterest.js";import{Yield as _}from"../../../support/Yield.js";const g=Array;let y=class extends m{constructor(t){super(t),this._dirty=!1,this._propertiesPool=new u({location:d,renderLocation:g},this),this._estimatedSurfaceAltitude=0,this._pendingElevationQueryController=null,this.renderLocation=c(),this._tmpPoint=new d}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const t=()=>this._setDirty();this.addHandles(o((()=>this.map?.ground?.layers),"change",t,{onListenerAdd:t,onListenerRemove:t}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=e(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}get scale(){const t=this._camera,e=n(t.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:t}};return h(r,e,0)}get updating(){return this._dirty||null!=this._pendingElevationQueryController}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const t=this._pendingElevationQueryController;t&&(this._pendingElevationQueryController=null,t.abort(),this.notifyChange("updating"))}get running(){return!this._pendingElevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map?.ground)return this._updateSurfaceAltitude(0),_;const t=this.state.spatialReference;this._tmpPoint.spatialReference=t,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const e=(this._tmpPoint.z??0)>C&&this.renderCoordsHelper.viewingMode===p.Global&&(t.isWGS84||t.isWebMercator);let o=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:o.signal,cache:this.cache,minDemResolution:e?v:0}).then((t=>this._updateSurfaceAltitude(t.geometry.z??0))).catch((t=>{r(t)||this._updateSurfaceAltitude(0)})).catch((()=>{})).then((()=>{this._pendingElevationQueryController===o&&(this._pendingElevationQueryController=null,this.notifyChange("updating")),o=null})),this._pendingElevationQueryController=o,_}_updateSurfaceAltitude(t){this._estimatedSurfaceAltitude!==t&&(this._estimatedSurfaceAltitude=t,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(f,this._estimatedSurfaceAltitude,this._camera.eye),a(this._get("renderLocation"),f)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),f)),this.notifyChange("renderLocation"))}};t([i({constructOnly:!0})],y.prototype,"scheduler",void 0),t([i({constructOnly:!0})],y.prototype,"cache",void 0),t([i({constructOnly:!0})],y.prototype,"task",void 0),t([i()],y.prototype,"location",null),t([i({constructOnly:!0})],y.prototype,"map",void 0),t([i()],y.prototype,"renderLocation",void 0),t([i()],y.prototype,"scale",null),t([i()],y.prototype,"updating",null),y=t([s("esri.views.3d.support.CameraOnSurface")],y);const f=c(),C=1e5,v=1e6;export{y as CameraOnSurface};
|