// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define(["exports","../../chunks/vec32","../../core/libs/gl-matrix-2/factories/vec3f64","./FilteredFiniteDifference","./Momentum"],function(g,h,l,d,m){class k extends m.Momentum{constructor(a,b,c,e,f){super(a,b,c);this._sceneVelocity=e;this.direction=f}value(a){return super.valueFromInitialVelocity(this._sceneVelocity,a)}}class n{constructor(a=300,b=12,c=.84){this._minimumInitialVelocity=a;this._stopVelocity=b;this._friction=c;this.enabled=!0;this._time=new d.FilteredFiniteDifference(.6);this._screen= [new d.FilteredFiniteDifference(.4),new d.FilteredFiniteDifference(.4)];this._scene=[new d.FilteredFiniteDifference(.6),new d.FilteredFiniteDifference(.6),new d.FilteredFiniteDifference(.6)];this._tmpDirection=l.create()}add(a,b,c){!this.enabled||this._time.hasLastValue()&&.015>this._time.computeDelta(c)||(this._screen[0].update(a[0]),this._screen[1].update(a[1]),this._scene[0].update(b[0]),this._scene[1].update(b[1]),this._scene[2].update(b[2]),this._time.update(c))}reset(){this._screen[0].reset(); this._screen[1].reset();this._scene[0].reset();this._scene[1].reset();this._scene[2].reset();this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;var a=this._screen[0].filteredDelta,b=this._screen[1].filteredDelta;a=null==a||null==b?0:Math.sqrt(a*a+b*b);b=this._time.filteredDelta;a=null==b||null==a?0:a/b;return Math.abs(a)