/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../core/time","../../../../chunks/vec3","../../../../chunks/vec3f64","./Camera","../../webgl-engine/lib/Camera","../../../animation/pointToPoint/Animation"],(function(t,e,i,n,r,o,s,a){"use strict";const c=r.create();let m=function(){function t(t){this.currentTime=i.Milliseconds(0),this._animation=new a.Animation((()=>new o(t))),this._current=new o(t)}var r=t.prototype;return r.update=function(t,e,r){const o=this._animation.definition.source,s=this._animation.definition.target,a=n.subtract(c,e.center,t.center),m=n.length(a);m>=1e-5?(a[0]/=m,a[1]/=m,a[2]/=m):(a[0]=0,a[1]=1,a[0]=0),n.copy(o.lookAtDirection,a),n.copy(s.lookAtDirection,a),o.copyFromRenderCamera(t),s.copyFromRenderCamera(e),this._current.copyFrom(o),this._animation.update(o,s,r),this.currentTime=i.Milliseconds(0),t.almostEquals(e)&&(this.currentTime=this._animation.time)},r.cameraAt=function(t,e){return this._animation.cameraAt(t,this._current),e=e||new s.Camera,this._current.copyToRenderCamera(e),e},r.step=function(t,e){return this.finished||(this.currentTime=i.Milliseconds(this.currentTime+i.millisecondsFromSeconds(t)),this.currentTime>=this.time&&(this.currentTime=this.time)),this.cameraAt(this.currentTime/this.time,e)},e._createClass(t,[{key:"finished",get:function(){return this.currentTime>=this._animation.time}},{key:"time",get:function(){return this._animation.time}}]),t}();t.Animation=m,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
