UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 2.18 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{_ as t}from"../../../../../chunks/tslib.es6.js";import{createScreenPointArray as e}from"../../../../../core/screenUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{clone as o,create as i}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as n,fromPoints as c}from"../../../../../geometry/support/axisAngle.js";import{c as m,a as p}from"../../../../../chunks/sphere.js";import{applyAll as a}from"../../../camera/constraintUtils.js";import{InteractionType as h}from"../../../camera/constraintUtils/InteractionType.js";import{MomentumController as l}from"./MomentumController.js";import{applyZoomOnSphere as u,sphereOrPlanePointFromScreenPoint as j,applyRotation as y}from"../../utils/navigationUtils.js";let C=class extends l{set screenCenter(t){this._set("screenCenter",e(t[0],t[1]))}set sceneCenter(t){this._set("sceneCenter",o(t))}constructor(t){super(t),this.interactionType=h.ZOOM,this.radius=0,this._tmpSceneCenter=i(),this._tmpZoomAxisAngle=n(),this._sphere=m()}initialize(){this._sphere[3]=this.radius}momentumStep(t,e){const s=this.momentum.valueDelta(0,t);u(this._sphere,e,s),this.constraintOptions.interactionType=h.ZOOM,a(this.view,e,this.constraintOptions),j(this._sphere,e,this.screenCenter,this._tmpSceneCenter),c(this.sceneCenter,this._tmpSceneCenter,this._tmpZoomAxisAngle),y(e,p(this._sphere),this._tmpZoomAxisAngle),this.constraintOptions.interactionType=h.PAN}};t([s({constructOnly:!0})],C.prototype,"momentum",void 0),t([s({constructOnly:!0})],C.prototype,"screenCenter",null),t([s({constructOnly:!0})],C.prototype,"sceneCenter",null),t([s({constructOnly:!0})],C.prototype,"radius",void 0),C=t([r("esri.views.3d.state.controllers.momentum.ZoomSphericalMomentumController")],C);export{C as ZoomSphericalMomentumController};