@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 2.48 kB
JavaScript
/*
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{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import o from"../../../ViewAnimation.js";import{Animation as s}from"../../animation/pointToPoint/Animation.js";import{AnimationController as r}from"./AnimationController.js";import a from"../../webgl/RenderCamera.js";import{newIntersector as m}from"../../webgl-engine/lib/Intersector.js";import{EasingFunctions as c}from"../../../animation/easing.js";let p=class extends r{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.type="point-to-point",this.mode="interaction",this._hasTarget=!1}initialize(){this.animation=new s(this.view.state.viewingMode),this.viewAnimation="interaction"===this.mode?null:new o}get isInteractive(){return"interaction"===this.mode}begin(t,i){this._hasTarget=!0;const e=this.animationSettings(i);h.copyFrom(this.view.state.camera);const n=m(this.view.state.viewingMode);this._intersectionHelper.intersectRay(h.ray,n,l)&&(h.center=l),this.animation.update(h,t,e),this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time,super.finish()}get steppingFinished(){return this._hasTarget&&this.animation.finished}stepController(t,i){this._hasTarget&&this.animation.step(t,i)}onControllerEnd(t){this._hasTarget&&(this.animation.cameraAt(this.animation.currentTime/this.animation.time,t),this.animation.currentTime=this.animation.time),super.onControllerEnd(t)}animationSettings(t={}){return{apex:{maximumDistance:this.view.state.constraints.clampAltitude(1/0)/6,ascensionFactor:void 0,descensionFactor:void 0},...t,easing:"string"==typeof t.easing?c[t.easing]:t.easing}}};t([i({constructOnly:!0})],p.prototype,"mode",void 0),t([i({readOnly:!0})],p.prototype,"isInteractive",null),p=t([e("esri.views.3d.state.controllers.PointToPointAnimationController")],p);const h=new a,l=n();function g(t){return null!=t&&"type"in t&&"point-to-point"===t.type}export{p as PointToPointAnimationController,g as isPointToPointAnimationController};