UNPKG

@animech-public/playcanvas

Version:
2 lines (1 loc) 779 B
import{AnimEvents as t}from"./anim-events.js";var e;class s{constructor(e,s,n,i,u,r=new t([])){this._name=e,this._duration=s,this._inputs=n,this._outputs=i,this._curves=u,this._animEvents=r}get name(){return this._name}get duration(){return this._duration}get inputs(){return this._inputs}get outputs(){return this._outputs}get curves(){return this._curves}set events(t){this._animEvents=t}get events(){return this._animEvents.events}eval(t,e){e._time=t;const s=this._inputs,n=this._outputs,i=this._curves,u=e._cache,r=e._results;for(let e=0;e<s.length;++e)u[e].update(t,s[e]._data);for(let t=0;t<i.length;++t){const e=i[t],s=n[e._output],_=r[t];u[e._input].eval(_,e._interpolation,s)}}}e=s,s.EMPTY=Object.freeze(new e("empty",Number.MAX_VALUE,[],[],[]));export{s as AnimTrack};