UNPKG

@shopware-ag/dive

Version:

Shopware Spatial Framework

2 lines (1 loc) 1.18 kB
"use strict";var m=Object.defineProperty;var u=(a,t,e)=>t in a?m(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var i=(a,t,e)=>u(a,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tweenjs/tween.js"),c=require("three/webgpu");class l{constructor(){i(this,"uuid",c.MathUtils.generateUUID());i(this,"Easing",o.Easing);i(this,"_animators",new Map)}dispose(){for(const t of this._animators.values())t.dispose();this._animators.clear()}tick(t){for(const e of this._animators.values())e.update(t)}async fromTargets(t,e,n){const{TargetAnimator:s}=await Promise.resolve().then(()=>require("../../chunks/TargetAnimator-D37bWNKD.cjs")),r=new s(t,e,n);return this._animators.set(r.uuid,r),r}async fromClips(t,e){const{ClipAnimator:n}=await Promise.resolve().then(()=>require("../../chunks/ClipAnimator-SdDq2wk1.cjs")),s=new n(t,e);return this._animators.set(s.uuid,s),s}remove(t){const e=this._animators.get(t);if(!e){console.warn(`Animator with uuid ${t} not found`);return}e.dispose(),this._animators.delete(t)}}Object.defineProperty(exports,"Easing",{enumerable:!0,get:()=>o.Easing});exports.AnimationSystem=l;