Files
Foundry-VTT-Docker/resources/app/node_modules/@pixi/particle-emitter/dist/particle-emitter.min.js

2 lines
37 KiB
JavaScript
Raw Normal View History

2025-01-04 00:34:03 +01:00
this.PIXI=this.PIXI||{},function(t,e,i,s,r,a,n){"use strict";class h{constructor(t,e,i){this.value=t,this.time=e,this.next=null,this.isStepped=!1,this.ease=i?"function"==typeof i?i:g(i):null}static createList(t){if("list"in t){const e=t.list;let i;const{value:s,time:r}=e[0],a=i=new h("string"==typeof s?v(s):s,r,t.ease);if(e.length>2||2===e.length&&e[1].value!==s)for(let t=1;t<e.length;++t){const{value:s,time:r}=e[t];i.next=new h("string"==typeof s?v(s):s,r),i=i.next}return a.isStepped=!!t.isStepped,a}const e=new h("string"==typeof t.start?v(t.start):t.start,0);return t.end!==t.start&&(e.next=new h("string"==typeof t.end?v(t.end):t.end,1)),e}}let o=e.Texture.from;const l=!1,d=Math.PI/180;function c(t,e){if(!t)return;const i=Math.sin(t),s=Math.cos(t),r=e.x*s-e.y*i,a=e.x*i+e.y*s;e.x=r,e.y=a}function p(t,e,i){return t<<16|e<<8|i}function u(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function m(t){const e=1/u(t);t.x*=e,t.y*=e}function f(t,e){t.x*=e,t.y*=e}function v(t,e){let i;return e||(e={}),"#"===t.charAt(0)?t=t.substr(1):0===t.indexOf("0x")&&(t=t.substr(2)),8===t.length&&(i=t.substr(0,2),t=t.substr(2)),e.r=parseInt(t.substr(0,2),16),e.g=parseInt(t.substr(2,2),16),e.b=parseInt(t.substr(4,2),16),i&&(e.a=parseInt(i,16)),e}function g(t){const e=t.length,i=1/e;return function(s){const r=e*s|0,a=(s-r*i)*e,n=t[r]||t[e-1];return n.s+a*(2*(1-a)*(n.cp-n.s)+a*(n.e-n.s))}}function x(t){return t?(t=t.toUpperCase().replace(/ /g,"_"),i.BLEND_MODES[t]||i.BLEND_MODES.NORMAL):i.BLEND_MODES.NORMAL}var C,_={__proto__:null,GetTextureFromString:o,verbose:l,DEG_TO_RADS:d,rotatePoint:c,combineRGBComponents:p,length:u,normalize:m,scaleBy:f,hexToRGB:v,generateEase:g,getBlendMode:x,createSteppedGradient:function(t,e=10){("number"!=typeof e||e<=0)&&(e=10);const i=new h(v(t[0].value),t[0].time);i.isStepped=!0;let s=i,r=t[0],a=1,n=t[a];for(let i=1;i<e;++i){let o=i/e;for(;o>n.time;)r=n,n=t[++a];o=(o-r.time)/(n.time-r.time);const l=v(r.value),d=v(n.value),c={r:(d.r-l.r)*o+l.r,g:(d.g-l.g)*o+l.g,b:(d.b-l.b)*o+l.b};s.next=new h(c,i/e),s=s.next}return i}};class y extends s.Sprite{constructor(t){super(),this.prevChild=this.nextChild=null,this.emitter=t,this.config={},this.anchor.x=this.anchor.y=.5,this.maxLife=0,this.age=0,this.agePercent=0,this.oneOverLife=0,this.next=null,this.prev=null,this.init=this.init,this.kill=this.kill}init(t){this.maxLife=t,this.age=this.agePercent=0,this.rotation=0,this.position.x=this.position.y=0,this.scale.x=this.scale.y=1,this.tint=16777215,this.alpha=1,this.oneOverLife=1/this.maxLife,this.visible=!0}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=this.next=this.prev=null,super.destroy()}}!function(t){t[t.Spawn=0]="Spawn",t[t.Normal=2]="Normal",t[t.Late=5]="Late"}(C||(C={}));const P=a.Ticker.shared,w=Symbol("Position particle per emitter position");class b{constructor(t,e){this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],this.minLifetime=0,this.maxLifetime=0,this.customEase=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=new r.Point,this.particlesPerWave=1,this.rotation=0,this.ownerPos=new r.Point,this._prevEmitterPos=new r.Point,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._autoUpdate=!1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=t,e&&this.init(e),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}static registerBehavior(t){b.knownBehaviors[t.type]=t}get frequency(){return this._frequency}set frequency(t){this._frequency="number"==typeof t&&t>0?t:1}get parent(){return this._parent}set parent(t){this.cleanup(),this._parent=t}init(t){if(!t)return;this.cleanup(),this._origConfig=t,this.minLifetime=t.lifetime.min,this.maxLifetime=t.lifetime.max,t.ease?this.customEase
//# sourceMappingURL=particle-emitter.min.js.map