From 5dcd915ebb4acd8aa21d9a17ff66d5f07538ea4d Mon Sep 17 00:00:00 2001 From: drawcall Date: Mon, 5 Oct 2020 18:54:40 +0800 Subject: [PATCH] Added typescript support Added typescript support --- build/proton.min.js | 6 +++--- build/proton.min.js.map | 2 +- package.json | 2 +- src/index.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/proton.min.js b/build/proton.min.js index f9a0c79..1cee51b 100755 --- a/build/proton.min.js +++ b/build/proton.min.js @@ -1,11 +1,11 @@ /*! -* Proton v4.1.5 +* Proton v4.2.0 * https://github.com/drawcall/Proton * -* Copyright 2013-2019, A-JIE +* Copyright 2013-2020, A-JIE * Licensed under the MIT license * http://www.opensource.org/licenses/mit-license * */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Proton=e()}(this,function(){"use strict";function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var e=3.1415926,h={PI:e,PIx2:2*e,PI_2:e/2,PI_180:e/180,N180_PI:180/e,Infinity:-999,isInfinity:function(t){return t===this.Infinity||t===1/0},randomAToB:function(t,e,i){return 2>e;return t+1},d=function(t,e){return[1,0,0,0,1,0,t,e,1]},y=function(t){var e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},p=function(t,e){return[t,0,0,0,e,0,0,0,1]},f=function(t,e){var i=t[0],a=t[1],r=t[2],n=t[3],s=t[4],o=t[5],h=t[6],l=t[7],u=t[8],c=e[0],d=e[1],y=e[2],p=e[3],f=e[4],v=e[5],g=e[6],m=e[7],b=e[8];return[i*c+a*p+r*g,i*d+a*f+r*m,i*y+a*v+r*b,n*c+s*p+o*g,n*d+s*f+o*m,n*y+s*v+o*b,h*c+l*p+u*g,h*d+l*f+u*m,h*y+l*v+u*b]},v={createCanvas:function(t,e,i,a){var r=3",i&&(r+="em speed:"+i.emitSpeed+"
"),i&&(r+="pos:"+this.getEmitterPos(i));break;case 3:i&&(r+="initializes:"+i.initializes.length+"
"),i&&(r+=''+this.concatArr(i.initializes)+"
"),i&&(r+="behaviours:"+i.behaviours.length+"
"),i&&(r+=''+this.concatArr(i.behaviours)+"
");break;case 4:a&&(r+=a.name+"
"),a&&(r+="body:"+this.getCreatedNumber(a)+"
");break;default:r+="particles:"+this.proton.getCount()+"
",r+="pool:"+this.proton.pool.getCount()+"
",r+="total:"+this.proton.pool.total}this.container.innerHTML=r}},{key:"add",value:function(t,e){var i=this;if(!this.container){this.type=1,this.container=document.createElement("div"),this.container.style.cssText=["position:absolute;bottom:0px;left:0;cursor:pointer;","opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;","width:120px;height:50px;background-color:#002;color:#0ff;"].join(""),this.container.addEventListener("click",function(t){i.type++,4this._interval&&(this.dispatchEvent(M.PROTON_UPDATE),this.emittersUpdate(this._interval),this.then=this.now-this.elapsed%this._interval*1e3,this.dispatchEvent(M.PROTON_UPDATE_AFTER)))}},{key:"emittersUpdate",value:function(t){for(var e=this.emitters.length;e--;)this.emitters[e].update(t)}},{key:"amendChangeTabsBug",value:function(){M.amendChangeTabsBug&&.5=this.x&&e<=this.bottom&&e>=this.y}}]),Q);function Q(t,e,i,a){s(this,Q),this.x=t,this.y=e,this.width=i,this.height=a,this.bottom=this.y+this.height,this.right=this.x+this.width}var K=(t(J,[{key:"init",value:function(){this.startTime=0,this.nextTime=this.timePan.getValue()}},{key:"getValue",value:function(t){return this.startTime+=t,this.startTime>=this.nextTime?(this.startTime=0,this.nextTime=this.timePan.getValue(),1===this.numPan.b?.5=this.life||this.dead)this.energy=0,this.dead=!0,this.destroy();else{var i=this.easing(t.age/t.life);this.energy=Math.max(1-i,0)}}},{key:"destroy",value:function(){for(var t=this.parents.length;t--;)this.parents[t].removeBehaviour(this);this.parents.length=0}}]),mt);function mt(t,e){s(this,mt),this.life=P.initValue(t,1/0),this.easing=U.getEasing(e),this.age=0,this.energy=1,this.dead=!1,this.parents=[],this.id="Behaviour_"+mt.id++,this.name="Behaviour"}gt.id=0;var bt=(r(_t,gt),t(_t,[{key:"reset",value:function(t,e,i,a){this.force=this.normalizeForce(new F(t,e)),i&&o(_t.prototype.__proto__||Object.getPrototypeOf(_t.prototype),"reset",this).call(this,i,a)}},{key:"applyBehaviour",value:function(t,e,i){this.calculate(t,e,i),t.a.add(this.force)}}]),_t);function _t(t,e,i,a){s(this,_t);var r=l(this,(_t.__proto__||Object.getPrototypeOf(_t)).call(this,i,a));return r.force=r.normalizeForce(new F(t,e)),r.name="Force",r}var xt=(r(kt,gt),t(kt,[{key:"reset",value:function(t,e,i,a,r){this.targetPosition=P.initValue(t,new F),this.radius=P.initValue(i,1e3),this.force=P.initValue(this.normalizeValue(e),100),this.radiusSq=this.radius*this.radius,this.attractionForce=new F,this.lengthSq=0,a&&o(kt.prototype.__proto__||Object.getPrototypeOf(kt.prototype),"reset",this).call(this,a,r)}},{key:"applyBehaviour",value:function(t,e,i){this.calculate(t,e,i),this.attractionForce.copy(this.targetPosition),this.attractionForce.sub(t.p),this.lengthSq=this.attractionForce.lengthSq(),4e-5=this.delay&&(t.a.addXY(h.randomAToB(-this.panFoce.x,this.panFoce.x),h.randomAToB(-this.panFoce.y,this.panFoce.y)),t.data.time=0)}}]),Et);function Et(t,e,i,a,r){s(this,Et);var n=l(this,(Et.__proto__||Object.getPrototypeOf(Et)).call(this,a,r));return n.reset(t,e,i),n.time=0,n.name="RandomDrift",n}var At=(r(Tt,bt),t(Tt,[{key:"reset",value:function(t,e,i){o(Tt.prototype.__proto__||Object.getPrototypeOf(Tt.prototype),"reset",this).call(this,0,t,e,i)}}]),Tt);function Tt(t,e,i){s(this,Tt);var a=l(this,(Tt.__proto__||Object.getPrototypeOf(Tt)).call(this,0,t,e,i));return a.name="Gravity",a}var Rt=(r(Ot,gt),t(Ot,[{key:"reset",value:function(t,e,i,a,r){this.emitter=P.initValue(t,null),this.mass=P.initValue(e,!0),this.callback=P.initValue(i,null),this.collisionPool=[],this.delta=new F,a&&o(Ot.prototype.__proto__||Object.getPrototypeOf(Ot.prototype),"reset",this).call(this,a,r)}},{key:"applyBehaviour",value:function(t,e,i){var a=this.emitter?this.emitter.particles.slice(i):this.pool.slice(i),r=a.length,n=void 0,s=void 0,o=void 0,h=void 0,l=void 0,u=void 0,c=void 0;for(c=0;c=this.life||this.dead)&&this.destroy(),this.emitting(t),this.integrate(t)}},{key:"integrate",value:function(t){if(this.parent){var e=1-this.damping;this.parent.integrator.calculate(this,t,e);var i=void 0,a=void 0;for(i=this.particles.length-1;0<=i;i--)(a=this.particles[i]).update(t,i),this.parent.integrator.calculate(a,t,e),this.dispatch("PARTICLE_UPDATE",a),a.dead&&(this.dispatch("PARTICLE_DEAD",a),this.parent.pool.expire(a),this.particles.splice(i,1))}}},{key:"dispatch",value:function(t,e){this.parent&&this.parent.dispatchEvent(t,e),this.bindEvent&&this.dispatchEvent(t,e)}},{key:"emitting",value:function(t){if("once"===this.totalTime){var e=void 0,i=this.rate.getValue(99999);for(0this.element.width||i<0||i>this.elementwidth)){var n=4*((i>>0)*t.width+(e>>0));t.data[n]=r.r,t.data[1+n]=r.g,t.data[2+n]=r.b,t.data[3+n]=255*a.alpha}}},{key:"onParticleDead",value:function(){}}]),he);function he(t,e){s(this,he);var i=l(this,(he.__proto__||Object.getPrototypeOf(he)).call(this,t));return i.context=i.element.getContext("2d"),i.imageData=null,i.rectangle=null,i.rectangle=e,i.createImageData(e),i.name="PixelRenderer",i}var le=void 0,ue=(r(ce,$t),t(ce,[{key:"setPIXI",value:function(t){try{le=t||{Sprite:{}},this.createFromImage=le.Sprite.from||le.Sprite.fromImage}catch(t){}}},{key:"onProtonUpdate",value:function(){}},{key:"onParticleCreated",value:function(t){t.body?t.body=this.pool.get(t.body,t):t.body=this.pool.get(this.circleConf,t),this.blendMode&&(t.body.blendMode=this.blendMode),this.element.addChild(t.body)}},{key:"onParticleUpdate",value:function(t){this.transform(t,t.body),!0!==this.setColor&&!0!==this.color||(t.body.tint=H.getHex16FromParticle(t))}},{key:"onParticleDead",value:function(t){this.element.removeChild(t.body),this.pool.expire(t.body),t.body=null}},{key:"destroy",value:function(t){o(ce.prototype.__proto__||Object.getPrototypeOf(ce.prototype),"destroy",this).call(this),this.pool.destroy();for(var e=t.length;e--;){var i=t[e];i.body&&this.element.removeChild(i.body)}}},{key:"transform",value:function(t,e){e.x=t.p.x,e.y=t.p.y,e.alpha=t.alpha,e.scale.x=t.scale,e.scale.y=t.scale,e.rotation=t.rotation*h.PI_180}},{key:"createBody",value:function(t,e){return t.isCircle?this.createCircle(e):this.createSprite(t)}},{key:"createSprite",value:function(t){var e=t.isInner?this.createFromImage(t.src):new le.Sprite(t);return e.anchor.x=.5,e.anchor.y=.5,e}},{key:"createCircle",value:function(t){var e=new le.Graphics;if(this.stroke){var i=this.stroke instanceof String?this.stroke:0;e.beginStroke(i)}return e.beginFill(t.color||36077),e.drawCircle(0,0,t.radius),e.endFill(),e}}]),ce);function ce(t,e){s(this,ce);var i=l(this,(ce.__proto__||Object.getPrototypeOf(ce)).call(this,t));return i.stroke=e,i.color=!1,i.setColor=!1,i.blendMode=null,i.pool.create=function(t,e){return i.createBody(t,e)},i.setPIXI(window.PIXI),i.name="PixiRenderer",i}var de=(t(ye,[{key:"set",value:function(t,e){0===e?X.set(t,this.mats[0]):X.multiply(this.mats[e-1],t,this.mats[e]),this.size=Math.max(this.size,e+1)}},{key:"push",value:function(t){0===this.size?X.set(t,this.mats[0]):X.multiply(this.mats[this.size-1],t,this.mats[this.size]),this.size++}},{key:"pop",value:function(){0=this.minx)return!0}else if(t.p.y<=this.maxy&&t.p.y>=this.miny)return!0;return!1}},{key:"getLength",value:function(){return Math.sqrt(this.dx*this.dx+this.dy*this.dy)}},{key:"crossing",value:function(t){if("dead"===this.crossType)if(">"===this.direction||"R"===this.direction||"right"===this.direction||"down"===this.direction){if(!this.rangeOut(t))return;this.getDirection(t.p.x,t.p.y)&&(t.dead=!0)}else{if(!this.rangeOut(t))return;this.getDirection(t.p.x,t.p.y)||(t.dead=!0)}else if("bound"===this.crossType){if(!this.rangeOut(t))return;this.getDistance(t.p.x,t.p.y)<=t.radius&&(0===this.dx?t.v.x*=-1:0===this.dy?t.v.y*=-1:this.getSymmetric(t.v))}else"cross"===this.crossType&&this.alert&&(console.error("Sorry, LineZone does not support cross method!"),this.alert=!1)}}]),be);function be(t,e,i,a,r){s(this,be);var n=l(this,(be.__proto__||Object.getPrototypeOf(be)).call(this));return 0<=i-t?(n.x1=t,n.y1=e,n.x2=i,n.y2=a):(n.x1=i,n.y1=a,n.x2=t,n.y2=e),n.dx=n.x2-n.x1,n.dy=n.y2-n.y1,n.minx=Math.min(n.x1,n.x2),n.miny=Math.min(n.y1,n.y2),n.maxx=Math.max(n.x1,n.x2),n.maxy=Math.max(n.y1,n.y2),n.dot=n.x2*n.y1-n.x1*n.y2,n.xxyy=n.dx*n.dx+n.dy*n.dy,n.gradient=n.getGradient(),n.length=n.getLength(),n.direction=P.initValue(r,">"),n}var _e=(r(xe,at),t(xe,[{key:"getPosition",value:function(){return this.angle=h.PIx2*Math.random(),this.randomRadius=Math.random()*this.radius,this.vector.x=this.x+this.randomRadius*Math.cos(this.angle),this.vector.y=this.y+this.randomRadius*Math.sin(this.angle),this.vector}},{key:"setCenter",value:function(t,e){this.center.x=t,this.center.y=e}},{key:"crossing",value:function(t){var e=t.p.distanceTo(this.center);"dead"===this.crossType?e-t.radius>this.radius&&(t.dead=!0):"bound"===this.crossType?e+t.radius>=this.radius&&this.getSymmetric(t):"cross"===this.crossType&&this.alert&&(console.error("Sorry, CircleZone does not support cross method!"),this.alert=!1)}},{key:"getSymmetric",value:function(t){var e=t.v.getGradient(),i=2*(this.getGradient(t)-e),a=t.v.x,r=t.v.y;t.v.x=a*Math.cos(i)-r*Math.sin(i),t.v.y=a*Math.sin(i)+r*Math.cos(i)}},{key:"getGradient",value:function(t){return-h.PI_2+Math.atan2(t.p.y-this.center.y,t.p.x-this.center.x)}}]),xe);function xe(t,e,i){s(this,xe);var a=l(this,(xe.__proto__||Object.getPrototypeOf(xe)).call(this));return a.x=t,a.y=e,a.radius=i,a.angle=0,a.center={x:t,y:e},a}var ke=(r(Pe,at),t(Pe,[{key:"getPosition",value:function(){return this.vector.x=this.x+Math.random()*this.width,this.vector.y=this.y+Math.random()*this.height,this.vector}},{key:"crossing",value:function(t){"dead"===this.crossType?(t.p.x+t.radiusthis.x+this.width&&(t.dead=!0),t.p.y+t.radiusthis.y+this.height&&(t.dead=!0)):"bound"===this.crossType?(t.p.x-t.radiusthis.x+this.width&&(t.p.x=this.x+this.width-t.radius,t.v.x*=-1),t.p.y-t.radiusthis.y+this.height&&(t.p.y=this.y+this.height-t.radius,t.v.y*=-1)):"cross"===this.crossType&&(t.p.x+t.radiusthis.x+this.width&&0<=t.v.x&&(t.p.x=this.x-t.radius),t.p.y+t.radiusthis.y+this.height&&0<=t.v.y&&(t.p.y=this.y-t.radius))}}]),Pe);function Pe(t,e,i,a){s(this,Pe);var r=l(this,(Pe.__proto__||Object.getPrototypeOf(Pe)).call(this));return r.x=t,r.y=e,r.width=i,r.height=a,r}var Ee=(r(Ae,at),t(Ae,[{key:"reset",value:function(t,e,i,a){this.imageData=t,this.x=P.initValue(e,0),this.y=P.initValue(i,0),this.d=P.initValue(a,2),this.vectors=[],this.setVectors()}},{key:"setVectors",value:function(){var t=void 0,e=void 0,i=this.imageData.width,a=this.imageData.height;for(t=0;t>0)*i+(t>>0));0>0)*this.imageData.width+(t>>0));return 0>0)*this.imageData.width+(t>>0));return{r:this.imageData.data[i],g:this.imageData.data[1+i],b:this.imageData.data[2+i],a:this.imageData.data[3+i]}}},{key:"crossing",value:function(t){"dead"===this.crossType?this.getBound(t.p.x-this.x,t.p.y-this.y)?t.dead=!0:t.dead=!1:"bound"===this.crossType&&(this.getBound(t.p.x-this.x,t.p.y-this.y)||t.v.negate())}}]),Ae);function Ae(t,e,i,a){s(this,Ae);var r=l(this,(Ae.__proto__||Object.getPrototypeOf(Ae)).call(this));return r.reset(t,e,i,a),r}var Te={addEventListener:function(t,e){t.addEventListener("PROTON_UPDATE_AFTER",function(){return e()})},getStyle:function(t){var e=H.hexToRgb(0>e;return t+1},d=function(t,e){return[1,0,0,0,1,0,t,e,1]},y=function(t){var e=Math.cos(t),t=Math.sin(t);return[e,-t,0,t,e,0,0,0,1]},p=function(t,e){return[t,0,0,0,e,0,0,0,1]},f=function(t,e){var i=t[0],a=t[1],r=t[2],n=t[3],s=t[4],o=t[5],h=t[6],l=t[7],u=t[8],c=e[0],d=e[1],y=e[2],p=e[3],f=e[4],v=e[5],g=e[6],t=e[7],e=e[8];return[i*c+a*p+r*g,i*d+a*f+r*t,i*y+a*v+r*e,n*c+s*p+o*g,n*d+s*f+o*t,n*y+s*v+o*e,h*c+l*p+u*g,h*d+l*f+u*t,h*y+l*v+u*e]},v={createCanvas:function(t,e,i,a){var r=3",i&&(e+="em speed:"+i.emitSpeed+"
"),i&&(e+="pos:"+this.getEmitterPos(i));break;case 3:i&&(e+="initializes:"+i.initializes.length+"
"),i&&(e+=''+this.concatArr(i.initializes)+"
"),i&&(e+="behaviours:"+i.behaviours.length+"
"),i&&(e+=''+this.concatArr(i.behaviours)+"
");break;case 4:t&&(e+=t.name+"
"),t&&(e+="body:"+this.getCreatedNumber(t)+"
");break;default:e+="particles:"+this.proton.getCount()+"
",e+="pool:"+this.proton.pool.getCount()+"
",e+="total:"+this.proton.pool.total}this.container.innerHTML=e}},{key:"add",value:function(t,e){var i=this;if(!this.container){this.type=1,this.container=document.createElement("div"),this.container.style.cssText=["position:absolute;bottom:0px;left:0;cursor:pointer;","opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;","width:120px;height:50px;background-color:#002;color:#0ff;"].join(""),this.container.addEventListener("click",function(t){i.type++,4this._interval&&(this.dispatchEvent(M.PROTON_UPDATE),this.emittersUpdate(this._interval),this.then=this.now-this.elapsed%this._interval*1e3,this.dispatchEvent(M.PROTON_UPDATE_AFTER)))}},{key:"emittersUpdate",value:function(t){for(var e=this.emitters.length;e--;)this.emitters[e].update(t)}},{key:"amendChangeTabsBug",value:function(){M.amendChangeTabsBug&&.5=this.x&&e<=this.bottom&&e>=this.y}}]),Q);function Q(t,e,i,a){o(this,Q),this.x=t,this.y=e,this.width=i,this.height=a,this.bottom=this.y+this.height,this.right=this.x+this.width}var K=(t(J,[{key:"init",value:function(){this.startTime=0,this.nextTime=this.timePan.getValue()}},{key:"getValue",value:function(t){return this.startTime+=t,this.startTime>=this.nextTime?(this.startTime=0,this.nextTime=this.timePan.getValue(),1===this.numPan.b?.5=this.life||this.dead?(this.energy=0,this.dead=!0,this.destroy()):(t=this.easing(t.age/t.life),this.energy=Math.max(1-t,0))}},{key:"destroy",value:function(){for(var t=this.parents.length;t--;)this.parents[t].removeBehaviour(this);this.parents.length=0}}]),mt);function mt(t,e){o(this,mt),this.life=P.initValue(t,1/0),this.easing=U.getEasing(e),this.age=0,this.energy=1,this.dead=!1,this.parents=[],this.id="Behaviour_"+mt.id++,this.name="Behaviour"}gt.id=0;var bt=(r(_t,gt),t(_t,[{key:"reset",value:function(t,e,i,a){this.force=this.normalizeForce(new F(t,e)),i&&n(_t.prototype.__proto__||Object.getPrototypeOf(_t.prototype),"reset",this).call(this,i,a)}},{key:"applyBehaviour",value:function(t,e,i){this.calculate(t,e,i),t.a.add(this.force)}}]),_t);function _t(t,e,i,a){o(this,_t);a=h(this,(_t.__proto__||Object.getPrototypeOf(_t)).call(this,i,a));return a.force=a.normalizeForce(new F(t,e)),a.name="Force",a}var xt=(r(kt,gt),t(kt,[{key:"reset",value:function(t,e,i,a,r){this.targetPosition=P.initValue(t,new F),this.radius=P.initValue(i,1e3),this.force=P.initValue(this.normalizeValue(e),100),this.radiusSq=this.radius*this.radius,this.attractionForce=new F,this.lengthSq=0,a&&n(kt.prototype.__proto__||Object.getPrototypeOf(kt.prototype),"reset",this).call(this,a,r)}},{key:"applyBehaviour",value:function(t,e,i){this.calculate(t,e,i),this.attractionForce.copy(this.targetPosition),this.attractionForce.sub(t.p),this.lengthSq=this.attractionForce.lengthSq(),4e-5=this.delay&&(t.a.addXY(s.randomAToB(-this.panFoce.x,this.panFoce.x),s.randomAToB(-this.panFoce.y,this.panFoce.y)),t.data.time=0)}}]),Et);function Et(t,e,i,a,r){o(this,Et);r=h(this,(Et.__proto__||Object.getPrototypeOf(Et)).call(this,a,r));return r.reset(t,e,i),r.time=0,r.name="RandomDrift",r}var At=(r(Tt,bt),t(Tt,[{key:"reset",value:function(t,e,i){n(Tt.prototype.__proto__||Object.getPrototypeOf(Tt.prototype),"reset",this).call(this,0,t,e,i)}}]),Tt);function Tt(t,e,i){o(this,Tt);i=h(this,(Tt.__proto__||Object.getPrototypeOf(Tt)).call(this,0,t,e,i));return i.name="Gravity",i}var Rt=(r(Ot,gt),t(Ot,[{key:"reset",value:function(t,e,i,a,r){this.emitter=P.initValue(t,null),this.mass=P.initValue(e,!0),this.callback=P.initValue(i,null),this.collisionPool=[],this.delta=new F,a&&n(Ot.prototype.__proto__||Object.getPrototypeOf(Ot.prototype),"reset",this).call(this,a,r)}},{key:"applyBehaviour",value:function(t,e,i){for(var a,r,n,s,o,h,l=(this.emitter?this.emitter.particles:this.pool).slice(i),u=l.length,c=void 0,d=void 0,d=0;d=this.life||this.dead)&&this.destroy(),this.emitting(t),this.integrate(t)}},{key:"integrate",value:function(t){if(this.parent){var e=1-this.damping;this.parent.integrator.calculate(this,t,e);for(var i=void 0,a=void 0,i=this.particles.length-1;0<=i;i--)(a=this.particles[i]).update(t,i),this.parent.integrator.calculate(a,t,e),this.dispatch("PARTICLE_UPDATE",a),a.dead&&(this.dispatch("PARTICLE_DEAD",a),this.parent.pool.expire(a),this.particles.splice(i,1))}}},{key:"dispatch",value:function(t,e){this.parent&&this.parent.dispatchEvent(t,e),this.bindEvent&&this.dispatchEvent(t,e)}},{key:"emitting",value:function(t){if("once"===this.totalTime){var e=void 0,i=this.rate.getValue(99999);for(0this.element.width||i<0||i>this.elementwidth||(e=4*((i>>0)*t.width+(e>>0)),t.data[e]=r.r,t.data[1+e]=r.g,t.data[2+e]=r.b,t.data[3+e]=255*a.alpha)}},{key:"onParticleDead",value:function(){}}]),he);function he(t,e){o(this,he);t=h(this,(he.__proto__||Object.getPrototypeOf(he)).call(this,t));return t.context=t.element.getContext("2d"),t.imageData=null,t.rectangle=null,t.rectangle=e,t.createImageData(e),t.name="PixelRenderer",t}var le=void 0,ue=(r(ce,$t),t(ce,[{key:"setPIXI",value:function(t){try{le=t||{Sprite:{}},this.createFromImage=le.Sprite.from||le.Sprite.fromImage}catch(t){}}},{key:"onProtonUpdate",value:function(){}},{key:"onParticleCreated",value:function(t){t.body?t.body=this.pool.get(t.body,t):t.body=this.pool.get(this.circleConf,t),this.blendMode&&(t.body.blendMode=this.blendMode),this.element.addChild(t.body)}},{key:"onParticleUpdate",value:function(t){this.transform(t,t.body),!0!==this.setColor&&!0!==this.color||(t.body.tint=H.getHex16FromParticle(t))}},{key:"onParticleDead",value:function(t){this.element.removeChild(t.body),this.pool.expire(t.body),t.body=null}},{key:"destroy",value:function(t){n(ce.prototype.__proto__||Object.getPrototypeOf(ce.prototype),"destroy",this).call(this),this.pool.destroy();for(var e=t.length;e--;){var i=t[e];i.body&&this.element.removeChild(i.body)}}},{key:"transform",value:function(t,e){e.x=t.p.x,e.y=t.p.y,e.alpha=t.alpha,e.scale.x=t.scale,e.scale.y=t.scale,e.rotation=t.rotation*s.PI_180}},{key:"createBody",value:function(t,e){return t.isCircle?this.createCircle(e):this.createSprite(t)}},{key:"createSprite",value:function(t){t=t.isInner?this.createFromImage(t.src):new le.Sprite(t);return t.anchor.x=.5,t.anchor.y=.5,t}},{key:"createCircle",value:function(t){var e,i=new le.Graphics;return this.stroke&&(e=this.stroke instanceof String?this.stroke:0,i.beginStroke(e)),i.beginFill(t.color||36077),i.drawCircle(0,0,t.radius),i.endFill(),i}}]),ce);function ce(t,e){o(this,ce);var i=h(this,(ce.__proto__||Object.getPrototypeOf(ce)).call(this,t));return i.stroke=e,i.color=!1,i.setColor=!1,i.blendMode=null,i.pool.create=function(t,e){return i.createBody(t,e)},i.setPIXI(window.PIXI),i.name="PixiRenderer",i}var de=(t(ye,[{key:"set",value:function(t,e){0===e?X.set(t,this.mats[0]):X.multiply(this.mats[e-1],t,this.mats[e]),this.size=Math.max(this.size,e+1)}},{key:"push",value:function(t){0===this.size?X.set(t,this.mats[0]):X.multiply(this.mats[this.size-1],t,this.mats[this.size]),this.size++}},{key:"pop",value:function(){0=this.minx)return!0}else if(t.p.y<=this.maxy&&t.p.y>=this.miny)return!0;return!1}},{key:"getLength",value:function(){return Math.sqrt(this.dx*this.dx+this.dy*this.dy)}},{key:"crossing",value:function(t){"dead"===this.crossType?">"===this.direction||"R"===this.direction||"right"===this.direction||"down"===this.direction?this.rangeOut(t)&&this.getDirection(t.p.x,t.p.y)&&(t.dead=!0):this.rangeOut(t)&&(this.getDirection(t.p.x,t.p.y)||(t.dead=!0)):"bound"===this.crossType?this.rangeOut(t)&&this.getDistance(t.p.x,t.p.y)<=t.radius&&(0===this.dx?t.v.x*=-1:0===this.dy?t.v.y*=-1:this.getSymmetric(t.v)):"cross"===this.crossType&&this.alert&&(console.error("Sorry, LineZone does not support cross method!"),this.alert=!1)}}]),ge);function ge(t,e,i,a,r){o(this,ge);var n=h(this,(ge.__proto__||Object.getPrototypeOf(ge)).call(this));return 0<=i-t?(n.x1=t,n.y1=e,n.x2=i,n.y2=a):(n.x1=i,n.y1=a,n.x2=t,n.y2=e),n.dx=n.x2-n.x1,n.dy=n.y2-n.y1,n.minx=Math.min(n.x1,n.x2),n.miny=Math.min(n.y1,n.y2),n.maxx=Math.max(n.x1,n.x2),n.maxy=Math.max(n.y1,n.y2),n.dot=n.x2*n.y1-n.x1*n.y2,n.xxyy=n.dx*n.dx+n.dy*n.dy,n.gradient=n.getGradient(),n.length=n.getLength(),n.direction=P.initValue(r,">"),n}var me=(r(be,at),t(be,[{key:"getPosition",value:function(){return this.angle=s.PIx2*Math.random(),this.randomRadius=Math.random()*this.radius,this.vector.x=this.x+this.randomRadius*Math.cos(this.angle),this.vector.y=this.y+this.randomRadius*Math.sin(this.angle),this.vector}},{key:"setCenter",value:function(t,e){this.center.x=t,this.center.y=e}},{key:"crossing",value:function(t){var e=t.p.distanceTo(this.center);"dead"===this.crossType?e-t.radius>this.radius&&(t.dead=!0):"bound"===this.crossType?e+t.radius>=this.radius&&this.getSymmetric(t):"cross"===this.crossType&&this.alert&&(console.error("Sorry, CircleZone does not support cross method!"),this.alert=!1)}},{key:"getSymmetric",value:function(t){var e=t.v.getGradient(),i=2*(this.getGradient(t)-e),a=t.v.x,e=t.v.y;t.v.x=a*Math.cos(i)-e*Math.sin(i),t.v.y=a*Math.sin(i)+e*Math.cos(i)}},{key:"getGradient",value:function(t){return-s.PI_2+Math.atan2(t.p.y-this.center.y,t.p.x-this.center.x)}}]),be);function be(t,e,i){o(this,be);var a=h(this,(be.__proto__||Object.getPrototypeOf(be)).call(this));return a.x=t,a.y=e,a.radius=i,a.angle=0,a.center={x:t,y:e},a}var _e=(r(xe,at),t(xe,[{key:"getPosition",value:function(){return this.vector.x=this.x+Math.random()*this.width,this.vector.y=this.y+Math.random()*this.height,this.vector}},{key:"crossing",value:function(t){"dead"===this.crossType?((t.p.x+t.radiusthis.x+this.width)&&(t.dead=!0),(t.p.y+t.radiusthis.y+this.height)&&(t.dead=!0)):"bound"===this.crossType?(t.p.x-t.radiusthis.x+this.width&&(t.p.x=this.x+this.width-t.radius,t.v.x*=-1),t.p.y-t.radiusthis.y+this.height&&(t.p.y=this.y+this.height-t.radius,t.v.y*=-1)):"cross"===this.crossType&&(t.p.x+t.radiusthis.x+this.width&&0<=t.v.x&&(t.p.x=this.x-t.radius),t.p.y+t.radiusthis.y+this.height&&0<=t.v.y&&(t.p.y=this.y-t.radius))}}]),xe);function xe(t,e,i,a){o(this,xe);var r=h(this,(xe.__proto__||Object.getPrototypeOf(xe)).call(this));return r.x=t,r.y=e,r.width=i,r.height=a,r}r(ke,at),t(ke,[{key:"reset",value:function(t,e,i,a){this.imageData=t,this.x=P.initValue(e,0),this.y=P.initValue(i,0),this.d=P.initValue(a,2),this.vectors=[],this.setVectors()}},{key:"setVectors",value:function(){for(var t=void 0,e=void 0,i=this.imageData.width,a=this.imageData.height,t=0;t>0)*i+(t>>0));0>0)*this.imageData.width+(t>>0));return 0>0)*this.imageData.width+(t>>0));return{r:this.imageData.data[t],g:this.imageData.data[1+t],b:this.imageData.data[2+t],a:this.imageData.data[3+t]}}},{key:"crossing",value:function(t){"dead"===this.crossType?this.getBound(t.p.x-this.x,t.p.y-this.y)?t.dead=!0:t.dead=!1:"bound"===this.crossType&&(this.getBound(t.p.x-this.x,t.p.y-this.y)||t.v.negate())}}]),r=ke;function ke(t,e,i,a){o(this,ke);var r=h(this,(ke.__proto__||Object.getPrototypeOf(ke)).call(this));return r.reset(t,e,i,a),r}t={addEventListener:function(t,e){t.addEventListener("PROTON_UPDATE_AFTER",function(){return e()})},getStyle:function(t){t=H.hexToRgb(0> i);\n }\n\n return length + 1;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeTranslation\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} tx either 0 or 1\n * @param {Number} ty either 0 or 1\n *\n * @return {Object}\n */\n makeTranslation(tx, ty) {\n return [1, 0, 0, 0, 1, 0, tx, ty, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeRotation\n *\n * @todo add description\n * @todo add return description\n *\n * @param {Number} angleInRadians\n *\n * @return {Object}\n */\n makeRotation(angleInRadians) {\n let c = Math.cos(angleInRadians);\n let s = Math.sin(angleInRadians);\n\n return [c, -s, 0, s, c, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeScale\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} sx either 0 or 1\n * @param {Number} sy either 0 or 1\n *\n * @return {Object}\n */\n makeScale(sx, sy) {\n return [sx, 0, 0, 0, sy, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method matrixMultiply\n *\n * @todo add description\n * @todo add a, b description\n * @todo add return description\n *\n * @param {Object} a\n * @param {Object} b\n *\n * @return {Object}\n */\n matrixMultiply(a, b) {\n let a00 = a[0 * 3 + 0];\n let a01 = a[0 * 3 + 1];\n let a02 = a[0 * 3 + 2];\n let a10 = a[1 * 3 + 0];\n let a11 = a[1 * 3 + 1];\n let a12 = a[1 * 3 + 2];\n let a20 = a[2 * 3 + 0];\n let a21 = a[2 * 3 + 1];\n let a22 = a[2 * 3 + 2];\n let b00 = b[0 * 3 + 0];\n let b01 = b[0 * 3 + 1];\n let b02 = b[0 * 3 + 2];\n let b10 = b[1 * 3 + 0];\n let b11 = b[1 * 3 + 1];\n let b12 = b[1 * 3 + 2];\n let b20 = b[2 * 3 + 0];\n let b21 = b[2 * 3 + 1];\n let b22 = b[2 * 3 + 2];\n\n return [\n a00 * b00 + a01 * b10 + a02 * b20,\n a00 * b01 + a01 * b11 + a02 * b21,\n a00 * b02 + a01 * b12 + a02 * b22,\n a10 * b00 + a11 * b10 + a12 * b20,\n a10 * b01 + a11 * b11 + a12 * b21,\n a10 * b02 + a11 * b12 + a12 * b22,\n a20 * b00 + a21 * b10 + a22 * b20,\n a20 * b01 + a21 * b11 + a22 * b21,\n a20 * b02 + a21 * b12 + a22 * b22\n ];\n }\n};\n","export default {\n /**\n * Creates and returns a new canvas. The opacity is by default set to 0\n *\n * @memberof Proton#Proton.DomUtil\n * @method createCanvas\n *\n * @param {String} $id the canvas' id\n * @param {Number} $width the canvas' width\n * @param {Number} $height the canvas' height\n * @param {String} [$position=absolute] the canvas' position, default is 'absolute'\n *\n * @return {Object}\n */\n createCanvas(id, width, height, position = \"absolute\") {\n const dom = document.createElement(\"canvas\");\n\n dom.id = id;\n dom.width = width;\n dom.height = height;\n dom.style.opacity = 0;\n dom.style.position = position;\n this.transform(dom, -500, -500, 0, 0);\n\n return dom;\n },\n\n createDiv(id, width, height) {\n const dom = document.createElement(\"div\");\n\n dom.id = id;\n dom.style.position = \"absolute\";\n this.resize(dom, width, height);\n\n return dom;\n },\n\n resize(dom, width, height) {\n dom.style.width = width + \"px\";\n dom.style.height = height + \"px\";\n dom.style.marginLeft = -width / 2 + \"px\";\n dom.style.marginTop = -height / 2 + \"px\";\n },\n\n /**\n * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers\n *\n * @memberof Proton#Proton.DomUtil\n * @method transform\n *\n * @param {HTMLDivElement} div\n * @param {Number} $x\n * @param {Number} $y\n * @param {Number} $scale\n * @param {Number} $rotate\n */\n transform(div, x, y, scale, rotate) {\n div.style.willChange = \"transform\";\n const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`;\n this.css3(div, \"transform\", transform);\n },\n\n transform3d(div, x, y, scale, rotate) {\n div.style.willChange = \"transform\";\n const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;\n this.css3(div, \"backfaceVisibility\", \"hidden\");\n this.css3(div, \"transform\", transform);\n },\n\n css3(div, key, val) {\n const bkey = key.charAt(0).toUpperCase() + key.substr(1);\n\n div.style[`Webkit${bkey}`] = val;\n div.style[`Moz${bkey}`] = val;\n div.style[`O${bkey}`] = val;\n div.style[`ms${bkey}`] = val;\n div.style[`${key}`] = val;\n }\n};\n","import WebGLUtil from \"./WebGLUtil\";\nimport DomUtil from \"./DomUtil\";\n\nconst imgsCache = {};\nconst canvasCache = {};\nlet canvasId = 0;\n\nexport default {\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n context.drawImage(image, rect.x, rect.y);\n const imagedata = context.getImageData(\n rect.x,\n rect.y,\n rect.width,\n rect.height\n );\n context.clearRect(rect.x, rect.y, rect.width, rect.height);\n\n return imagedata;\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method getImgFromCache\n *\n * @todo add description\n * @todo describe func\n *\n * @param {Mixed} img\n * @param {Proton.Particle} particle\n * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.data.canvas\n * @param {Boolean} func\n */\n getImgFromCache(img, callback, param) {\n const src = typeof img === \"string\" ? img : img.src;\n\n if (imgsCache[src]) {\n callback(imgsCache[src], param);\n } else {\n const image = new Image();\n image.onload = e => {\n imgsCache[src] = e.target;\n callback(imgsCache[src], param);\n };\n\n image.src = src;\n }\n },\n\n getCanvasFromCache(img, callback, param) {\n const src = img.src;\n\n if (!canvasCache[src]) {\n const width = WebGLUtil.nhpot(img.width);\n const height = WebGLUtil.nhpot(img.height);\n\n const canvas = DomUtil.createCanvas(\n `proton_canvas_cache_${++canvasId}`,\n width,\n height\n );\n const context = canvas.getContext(\"2d\");\n context.drawImage(img, 0, 0, img.width, img.height);\n\n canvasCache[src] = canvas;\n }\n\n callback && callback(canvasCache[src], param);\n\n return canvasCache[src];\n }\n};\n","import Span from \"../math/Span\";\nimport ImgUtil from \"./ImgUtil\";\n\nexport default {\n /**\n * Returns the default if the value is null or undefined\n *\n * @memberof Proton#Proton.Util\n * @method initValue\n *\n * @param {Mixed} value a specific value, could be everything but null or undefined\n * @param {Mixed} defaults the default if the value is null or undefined\n */\n initValue(value, defaults) {\n value = value !== null && value !== undefined ? value : defaults;\n return value;\n },\n\n /**\n * Checks if the value is a valid array\n *\n * @memberof Proton#Proton.Util\n * @method isArray\n *\n * @param {Array} value Any array\n *\n * @returns {Boolean}\n */\n isArray(value) {\n return Object.prototype.toString.call(value) === \"[object Array]\";\n },\n\n /**\n * Destroyes the given array\n *\n * @memberof Proton#Proton.Util\n * @method emptyArray\n *\n * @param {Array} array Any array\n */\n emptyArray(arr) {\n if (arr) arr.length = 0;\n },\n\n toArray(arr) {\n return this.isArray(arr) ? arr : [arr];\n },\n\n getRandFromArray(arr) {\n if (!arr) return null;\n return arr[Math.floor(arr.length * Math.random())];\n },\n\n /**\n * Destroyes the given object\n *\n * @memberof Proton#Proton.Util\n * @method emptyObject\n *\n * @param {Object} obj Any object\n */\n emptyObject(obj, ignore = null) {\n for (let key in obj) {\n if (ignore && ignore.indexOf(key) > -1) continue;\n delete obj[key];\n }\n },\n\n /**\n * Makes an instance of a class and binds the given array\n *\n * @memberof Proton#Proton.Util\n * @method classApply\n *\n * @param {Function} constructor A class to make an instance from\n * @param {Array} [args] Any array to bind it to the constructor\n *\n * @return {Object} The instance of constructor, optionally bind with args\n */\n classApply(constructor, args = null) {\n if (!args) {\n return new constructor();\n } else {\n const FactoryFunc = constructor.bind.apply(\n constructor,\n [null].concat(args)\n );\n return new FactoryFunc();\n }\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method setVectorVal\n *\n * @todo add description for param `target`\n * @todo add description for param `conf`\n * @todo add description for function\n *\n * @param {Object} target\n * @param {Object} conf\n */\n setVectorVal(particle, conf = null) {\n if (!conf) return;\n\n if (this.hasProp(conf, \"x\")) particle.p.x = conf[\"x\"];\n if (this.hasProp(conf, \"y\")) particle.p.y = conf[\"y\"];\n\n if (this.hasProp(conf, \"vx\")) particle.v.x = conf[\"vx\"];\n if (this.hasProp(conf, \"vy\")) particle.v.y = conf[\"vy\"];\n\n if (this.hasProp(conf, \"ax\")) particle.a.x = conf[\"ax\"];\n if (this.hasProp(conf, \"ay\")) particle.a.y = conf[\"ay\"];\n\n if (this.hasProp(conf, \"p\")) particle.p.copy(conf[\"p\"]);\n if (this.hasProp(conf, \"v\")) particle.v.copy(conf[\"v\"]);\n if (this.hasProp(conf, \"a\")) particle.a.copy(conf[\"a\"]);\n\n if (this.hasProp(conf, \"position\")) particle.p.copy(conf[\"position\"]);\n if (this.hasProp(conf, \"velocity\")) particle.v.copy(conf[\"velocity\"]);\n if (this.hasProp(conf, \"accelerate\")) particle.a.copy(conf[\"accelerate\"]);\n },\n\n hasProp(target, key) {\n if (!target) return false;\n return target[key] !== undefined;\n // return obj.hasOwnProperty(key);\n },\n\n /**\n * set the prototype in a given prototypeObject\n *\n * @memberof Proton#Proton.Util\n * @method setProp\n *\n * @todo add description for param `target`\n * @todo translate desription from chinese to english\n *\n * @param {Object} target\n * @param {Object} prototypeObject An object of single prototypes\n *\n * @return {Object} target\n */\n setProp(target, props) {\n for (let prop in props) {\n if (target.hasOwnProperty(prop)) {\n target[prop] = Span.getSpanValue(props[prop]);\n }\n }\n\n return target;\n },\n\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n return ImgUtil.getImageData(context, image, rect);\n },\n\n destroyAll(arr, param = null) {\n let i = arr.length;\n\n while (i--) {\n try {\n arr[i].destroy(param);\n } catch (e) {}\n\n delete arr[i];\n }\n\n arr.length = 0;\n },\n\n assign(target, source) {\n if (typeof Object.assign !== \"function\") {\n for (let key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n\n return target;\n } else {\n return Object.assign(target, source);\n }\n }\n};\n","const idsMap = {};\n\nconst Puid = {\n _index: 0,\n _cache: {},\n\n id(type) {\n if (idsMap[type] === undefined || idsMap[type] === null) idsMap[type] = 0;\n return `${type}_${idsMap[type]++}`;\n },\n\n getId(target) {\n let uid = this.getIdFromCache(target);\n if (uid) return uid;\n\n uid = `PUID_${this._index++}`;\n this._cache[uid] = target;\n\n return uid;\n },\n\n getIdFromCache(target) {\n let obj, id;\n\n for (id in this._cache) {\n obj = this._cache[id];\n\n if (obj === target) return id;\n if (this.isBody(obj, target) && obj.src === target.src) return id;\n }\n\n return null;\n },\n\n isBody(obj, target) {\n return (\n typeof obj === \"object\" &&\n typeof target === \"object\" &&\n obj.isInner &&\n target.isInner\n );\n },\n\n getTarget(uid) {\n return this._cache[uid];\n }\n};\n\nexport default Puid;\n","/**\n * Pool is the cache pool of the proton engine, it is very important.\n *\n * get(target, params, uid)\n * Class\n * uid = Puid.getId -> Puid save target cache\n * target.__puid = uid\n *\n * body\n * uid = Puid.getId -> Puid save target cache\n *\n *\n * expire(target)\n * cache[target.__puid] push target\n *\n */\nimport Util from \"../utils/Util\";\nimport Puid from \"../utils/Puid\";\n\nexport default class Pool {\n /**\n * @memberof! Proton#\n * @constructor\n * @alias Proton.Pool\n *\n * @todo add description\n * @todo add description of properties\n *\n * @property {Number} total\n * @property {Object} cache\n */\n constructor(num) {\n this.total = 0;\n this.cache = {};\n }\n\n /**\n * @todo add description\n *\n * @method get\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n get(target, params, uid) {\n let p;\n uid = uid || target.__puid || Puid.getId(target);\n\n if (this.cache[uid] && this.cache[uid].length > 0) {\n p = this.cache[uid].pop();\n } else {\n p = this.createOrClone(target, params);\n }\n\n p.__puid = target.__puid || uid;\n return p;\n }\n\n /**\n * @todo add description\n *\n * @method set\n * @memberof Proton#Proton.Pool\n *\n * @param {Object} target\n *\n * @return {Object}\n */\n expire(target) {\n return this.getCache(target.__puid).push(target);\n }\n\n /**\n * Creates a new class instance\n *\n * @todo add more documentation\n *\n * @method create\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target any Object or Function\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n createOrClone(target, params) {\n this.total++;\n\n if (this.create) {\n return this.create(target, params);\n } else if (typeof target === \"function\") {\n return Util.classApply(target, params);\n } else {\n return target.clone();\n }\n }\n\n /**\n * @todo add description - what is in the cache?\n *\n * @method getCount\n * @memberof Proton#Proton.Pool\n *\n * @return {Number}\n */\n getCount() {\n let count = 0;\n for (let id in this.cache) count += this.cache[id].length;\n return count++;\n }\n\n /**\n * Destroyes all items from Pool.cache\n *\n * @method destroy\n * @memberof Proton#Proton.Pool\n */\n destroy() {\n for (let id in this.cache) {\n this.cache[id].length = 0;\n delete this.cache[id];\n }\n }\n\n /**\n * Returns Pool.cache\n *\n * @method getCache\n * @memberof Proton#Proton.Pool\n * @private\n *\n * @param {Number} uid the unique id\n *\n * @return {Object}\n */\n getCache(uid = \"default\") {\n if (!this.cache[uid]) this.cache[uid] = [];\n return this.cache[uid];\n }\n}\n","export default class Stats {\n constructor(proton) {\n this.proton = proton;\n this.container = null;\n this.type = 1;\n\n this.emitterIndex = 0;\n this.rendererIndex = 0;\n }\n\n update(style, body) {\n this.add(style, body);\n\n const emitter = this.getEmitter();\n const renderer = this.getRenderer();\n let str = \"\";\n\n switch (this.type) {\n case 2:\n str += \"emitter:\" + this.proton.emitters.length + \"
\";\n if (emitter) str += \"em speed:\" + emitter.emitSpeed + \"
\";\n if (emitter) str += \"pos:\" + this.getEmitterPos(emitter);\n break;\n\n case 3:\n if (emitter)\n str += \"initializes:\" + emitter.initializes.length + \"
\";\n if (emitter)\n str +=\n '' +\n this.concatArr(emitter.initializes) +\n \"
\";\n if (emitter) str += \"behaviours:\" + emitter.behaviours.length + \"
\";\n if (emitter)\n str +=\n '' +\n this.concatArr(emitter.behaviours) +\n \"
\";\n break;\n\n case 4:\n if (renderer) str += renderer.name + \"
\";\n if (renderer) str += \"body:\" + this.getCreatedNumber(renderer) + \"
\";\n break;\n\n default:\n str += \"particles:\" + this.proton.getCount() + \"
\";\n str += \"pool:\" + this.proton.pool.getCount() + \"
\";\n str += \"total:\" + this.proton.pool.total;\n }\n\n this.container.innerHTML = str;\n }\n\n add(style, body) {\n if (!this.container) {\n this.type = 1;\n\n this.container = document.createElement(\"div\");\n this.container.style.cssText = [\n \"position:absolute;bottom:0px;left:0;cursor:pointer;\",\n \"opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;\",\n \"width:120px;height:50px;background-color:#002;color:#0ff;\"\n ].join(\"\");\n\n this.container.addEventListener(\n \"click\",\n e => {\n this.type++;\n if (this.type > 4) this.type = 1;\n },\n false\n );\n\n let bg, color;\n switch (style) {\n case 2:\n bg = \"#201\";\n color = \"#f08\";\n break;\n\n case 3:\n bg = \"#020\";\n color = \"#0f0\";\n break;\n\n default:\n bg = \"#002\";\n color = \"#0ff\";\n }\n\n this.container.style[\"background-color\"] = bg;\n this.container.style[\"color\"] = color;\n }\n\n if (!this.container.parentNode) {\n body = body || this.body || document.body;\n body.appendChild(this.container);\n }\n }\n\n getEmitter() {\n return this.proton.emitters[this.emitterIndex];\n }\n\n getRenderer() {\n return this.proton.renderers[this.rendererIndex];\n }\n\n concatArr(arr) {\n let result = \"\";\n if (!arr || !arr.length) return result;\n\n for (let i = 0; i < arr.length; i++) {\n result += (arr[i].name || \"\").substr(0, 1) + \".\";\n }\n\n return result;\n }\n\n getCreatedNumber(renderer) {\n return renderer.pool.total || (renderer.cpool && renderer.cpool.total) || 0;\n }\n\n getEmitterPos(e) {\n return Math.round(e.p.x) + \",\" + Math.round(e.p.y);\n }\n}\n","/*\n * EventDispatcher\n * This code reference since http://createjs.com/.\n *\n **/\n\nexport default class EventDispatcher {\n constructor() {\n this._listeners = null;\n }\n\n static bind(target) {\n target.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent;\n\n target.prototype.hasEventListener =\n EventDispatcher.prototype.hasEventListener;\n\n target.prototype.addEventListener =\n EventDispatcher.prototype.addEventListener;\n\n target.prototype.removeEventListener =\n EventDispatcher.prototype.removeEventListener;\n\n target.prototype.removeAllEventListeners =\n EventDispatcher.prototype.removeAllEventListeners;\n }\n\n addEventListener(type, listener) {\n if (!this._listeners) {\n this._listeners = {};\n } else {\n this.removeEventListener(type, listener);\n }\n\n if (!this._listeners[type]) this._listeners[type] = [];\n this._listeners[type].push(listener);\n\n return listener;\n }\n\n removeEventListener(type, listener) {\n if (!this._listeners) return;\n if (!this._listeners[type]) return;\n\n const arr = this._listeners[type];\n const length = arr.length;\n\n for (let i = 0; i < length; i++) {\n if (arr[i] === listener) {\n if (length === 1) {\n delete this._listeners[type];\n }\n\n // allows for faster checks.\n else {\n arr.splice(i, 1);\n }\n\n break;\n }\n }\n }\n\n removeAllEventListeners(type) {\n if (!type) this._listeners = null;\n else if (this._listeners) delete this._listeners[type];\n }\n\n dispatchEvent(type, args) {\n let result = false;\n const listeners = this._listeners;\n\n if (type && listeners) {\n let arr = listeners[type];\n if (!arr) return result;\n\n // arr = arr.slice();\n // to avoid issues with items being removed or added during the dispatch\n\n let handler;\n let i = arr.length;\n while (i--) {\n handler = arr[i];\n result = result || handler(args);\n }\n }\n\n return !!result;\n }\n\n hasEventListener(type) {\n const listeners = this._listeners;\n return !!(listeners && listeners[type]);\n }\n}\n","export default class Integration {\n constructor(type) {\n this.type = type;\n }\n\n calculate(particles, time, damping) {\n this.eulerIntegrate(particles, time, damping);\n }\n\n // Euler Integrate\n // https://rosettacode.org/wiki/Euler_method\n eulerIntegrate(particle, time, damping) {\n if (!particle.sleep) {\n particle.old.p.copy(particle.p);\n particle.old.v.copy(particle.v);\n\n particle.a.multiplyScalar(1 / particle.mass);\n particle.v.add(particle.a.multiplyScalar(time));\n particle.p.add(particle.old.v.multiplyScalar(time));\n\n if (damping) particle.v.multiplyScalar(damping);\n\n particle.a.clear();\n }\n }\n}\n","import Pool from \"./Pool\";\nimport Util from \"../utils/Util\";\nimport Stats from \"../debug/Stats\";\nimport EventDispatcher from \"../events/EventDispatcher\";\nimport MathUtil from \"../math/MathUtil\";\nimport Integration from \"../math/Integration\";\n\nexport default class Proton {\n static USE_CLOCK = false;\n\n // measure 1:100\n static MEASURE = 100;\n static EULER = \"euler\";\n static RK2 = \"runge-kutta2\";\n\n // event name\n static PARTICLE_CREATED = \"PARTICLE_CREATED\";\n static PARTICLE_UPDATE = \"PARTICLE_UPDATE\";\n static PARTICLE_SLEEP = \"PARTICLE_SLEEP\";\n static PARTICLE_DEAD = \"PARTICLE_DEAD\";\n\n static EMITTER_ADDED = \"EMITTER_ADDED\";\n static EMITTER_REMOVED = \"EMITTER_REMOVED\";\n\n static PROTON_UPDATE = \"PROTON_UPDATE\";\n static PROTON_UPDATE_AFTER = \"PROTON_UPDATE_AFTER\";\n static DEFAULT_INTERVAL = 0.0167;\n\n static amendChangeTabsBug = true;\n\n /**\n * The constructor to add emitters\n *\n * @constructor Proton\n *\n * @todo proParticleCount is not in use\n * @todo add more documentation of the single properties and parameters\n *\n * @param {Number} [proParticleCount] not in use?\n * @param {Number} [integrationType=Proton.EULER]\n *\n * @property {String} [integrationType=Proton.EULER]\n * @property {Array} emitters All added emitter\n * @property {Array} renderers All added renderer\n * @property {Number} time The active time\n * @property {Number} oldtime The old time\n */\n constructor(integrationType) {\n this.emitters = [];\n this.renderers = [];\n\n this.time = 0;\n this.now = 0;\n this.then = 0;\n this.elapsed = 0;\n\n this.stats = new Stats(this);\n this.pool = new Pool(80);\n\n this.integrationType = Util.initValue(integrationType, Proton.EULER);\n this.integrator = new Integration(this.integrationType);\n\n this._fps = \"auto\";\n this._interval = Proton.DEFAULT_INTERVAL;\n }\n\n set fps(fps) {\n this._fps = fps;\n this._interval =\n fps === \"auto\" ? Proton.DEFAULT_INTERVAL : MathUtil.floor(1 / fps, 7);\n }\n\n get fps() {\n return this._fps;\n }\n\n /**\n * add a type of Renderer\n *\n * @method addRenderer\n * @memberof Proton\n * @instance\n *\n * @param {Renderer} render\n */\n addRenderer(render) {\n render.init(this);\n this.renderers.push(render);\n }\n\n /**\n * @name add a type of Renderer\n *\n * @method addRenderer\n * @param {Renderer} render\n */\n removeRenderer(render) {\n const index = this.renderers.indexOf(render);\n this.renderers.splice(index, 1);\n render.remove(this);\n }\n\n /**\n * add the Emitter\n *\n * @method addEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Emitter} emitter\n */\n addEmitter(emitter) {\n this.emitters.push(emitter);\n emitter.parent = this;\n\n this.dispatchEvent(Proton.EMITTER_ADDED, emitter);\n }\n\n /**\n * Removes an Emitter\n *\n * @method removeEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Proton.Emitter} emitter\n */\n removeEmitter(emitter) {\n const index = this.emitters.indexOf(emitter);\n this.emitters.splice(index, 1);\n emitter.parent = null;\n\n this.dispatchEvent(Proton.EMITTER_REMOVED, emitter);\n }\n\n /**\n * Updates all added emitters\n *\n * @method update\n * @memberof Proton\n * @instance\n */\n update() {\n // 'auto' is the default browser refresh rate, the vast majority is 60fps\n if (this._fps === \"auto\") {\n this.dispatchEvent(Proton.PROTON_UPDATE);\n\n if (Proton.USE_CLOCK) {\n if (!this.then) this.then = new Date().getTime();\n this.now = new Date().getTime();\n this.elapsed = (this.now - this.then) * 0.001;\n // Fix bugs such as chrome browser switching tabs causing excessive time difference\n this.amendChangeTabsBug();\n\n if (this.elapsed > 0) this.emittersUpdate(this.elapsed);\n this.then = this.now;\n } else {\n this.emittersUpdate(Proton.DEFAULT_INTERVAL);\n }\n\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\n }\n\n // If the fps frame rate is set\n else {\n if (!this.then) this.then = new Date().getTime();\n this.now = new Date().getTime();\n this.elapsed = (this.now - this.then) * 0.001;\n\n if (this.elapsed > this._interval) {\n this.dispatchEvent(Proton.PROTON_UPDATE);\n this.emittersUpdate(this._interval);\n // https://stackoverflow.com/questions/19764018/controlling-fps-with-requestanimationframe\n this.then = this.now - (this.elapsed % this._interval) * 1000;\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\n }\n }\n }\n\n emittersUpdate(elapsed) {\n let i = this.emitters.length;\n while (i--) this.emitters[i].update(elapsed);\n }\n\n /**\n * @todo add description\n *\n * @method amendChangeTabsBug\n * @memberof Proton\n * @instance\n */\n amendChangeTabsBug() {\n if (!Proton.amendChangeTabsBug) return;\n if (this.elapsed > 0.5) {\n this.then = new Date().getTime();\n this.elapsed = 0;\n }\n }\n\n /**\n * Counts all particles from all emitters\n *\n * @method getCount\n * @memberof Proton\n * @instance\n */\n getCount() {\n let total = 0;\n let i = this.emitters.length;\n\n while (i--) total += this.emitters[i].particles.length;\n return total;\n }\n\n getAllParticles() {\n let particles = [];\n let i = this.emitters.length;\n\n while (i--) particles = particles.concat(this.emitters[i].particles);\n return particles;\n }\n\n destroyAllEmitters() {\n Util.destroyAll(this.emitters);\n }\n\n /**\n * Destroys everything related to this Proton instance. This includes all emitters, and all properties\n *\n * @method destroy\n * @memberof Proton\n * @instance\n */\n destroy(remove = false) {\n const destroyOther = () => {\n this.time = 0;\n this.then = 0;\n this.pool.destroy();\n\n Util.destroyAll(this.emitters);\n Util.destroyAll(this.renderers, this.getAllParticles());\n };\n\n if (remove) {\n setTimeout(destroyOther, 200);\n } else {\n destroyOther();\n }\n }\n}\n\nEventDispatcher.bind(Proton);\n","export default class Rgb {\n constructor(r = 255, g = 255, b = 255) {\n this.r = r;\n this.g = g;\n this.b = b;\n }\n\n reset() {\n this.r = 255;\n this.g = 255;\n this.b = 255;\n }\n}\n","import MathUtil from \"./MathUtil\";\n\nexport default {\n easeLinear(value) {\n return value;\n },\n\n easeInQuad(value) {\n return Math.pow(value, 2);\n },\n\n easeOutQuad(value) {\n return -(Math.pow(value - 1, 2) - 1);\n },\n\n easeInOutQuad(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 2);\n\n return -0.5 * ((value -= 2) * value - 2);\n },\n\n easeInCubic(value) {\n return Math.pow(value, 3);\n },\n\n easeOutCubic(value) {\n return Math.pow(value - 1, 3) + 1;\n },\n\n easeInOutCubic(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 3);\n\n return 0.5 * (Math.pow(value - 2, 3) + 2);\n },\n\n easeInQuart(value) {\n return Math.pow(value, 4);\n },\n\n easeOutQuart(value) {\n return -(Math.pow(value - 1, 4) - 1);\n },\n\n easeInOutQuart(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 4);\n\n return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2);\n },\n\n easeInSine(value) {\n return -Math.cos(value * MathUtil.PI_2) + 1;\n },\n\n easeOutSine(value) {\n return Math.sin(value * MathUtil.PI_2);\n },\n\n easeInOutSine(value) {\n return -0.5 * (Math.cos(Math.PI * value) - 1);\n },\n\n easeInExpo(value) {\n return value === 0 ? 0 : Math.pow(2, 10 * (value - 1));\n },\n\n easeOutExpo(value) {\n return value === 1 ? 1 : -Math.pow(2, -10 * value) + 1;\n },\n\n easeInOutExpo(value) {\n if (value === 0) return 0;\n\n if (value === 1) return 1;\n\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(2, 10 * (value - 1));\n\n return 0.5 * (-Math.pow(2, -10 * --value) + 2);\n },\n\n easeInCirc(value) {\n return -(Math.sqrt(1 - value * value) - 1);\n },\n\n easeOutCirc(value) {\n return Math.sqrt(1 - Math.pow(value - 1, 2));\n },\n\n easeInOutCirc(value) {\n if ((value /= 0.5) < 1) return -0.5 * (Math.sqrt(1 - value * value) - 1);\n return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1);\n },\n\n easeInBack(value) {\n let s = 1.70158;\n return value * value * ((s + 1) * value - s);\n },\n\n easeOutBack(value) {\n let s = 1.70158;\n return (value = value - 1) * value * ((s + 1) * value + s) + 1;\n },\n\n easeInOutBack(value) {\n let s = 1.70158;\n if ((value /= 0.5) < 1)\n return 0.5 * (value * value * (((s *= 1.525) + 1) * value - s));\n return 0.5 * ((value -= 2) * value * (((s *= 1.525) + 1) * value + s) + 2);\n },\n\n getEasing(ease) {\n if (typeof ease === \"function\") return ease;\n else return this[ease] || this.easeLinear;\n }\n};\n","import MathUtil from \"../math/MathUtil\";\n\nexport default class Vector2D {\n constructor(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n }\n\n set(x, y) {\n this.x = x;\n this.y = y;\n return this;\n }\n\n setX(x) {\n this.x = x;\n return this;\n }\n\n setY(y) {\n this.y = y;\n return this;\n }\n\n getGradient() {\n if (this.x !== 0) return Math.atan2(this.y, this.x);\n else if (this.y > 0) return MathUtil.PI_2;\n else if (this.y < 0) return -MathUtil.PI_2;\n }\n\n copy(v) {\n this.x = v.x;\n this.y = v.y;\n\n return this;\n }\n\n add(v, w) {\n if (w !== undefined) {\n return this.addVectors(v, w);\n }\n\n this.x += v.x;\n this.y += v.y;\n\n return this;\n }\n\n addXY(a, b) {\n this.x += a;\n this.y += b;\n\n return this;\n }\n\n addVectors(a, b) {\n this.x = a.x + b.x;\n this.y = a.y + b.y;\n\n return this;\n }\n\n sub(v, w) {\n if (w !== undefined) {\n return this.subVectors(v, w);\n }\n\n this.x -= v.x;\n this.y -= v.y;\n\n return this;\n }\n\n subVectors(a, b) {\n this.x = a.x - b.x;\n this.y = a.y - b.y;\n\n return this;\n }\n\n divideScalar(s) {\n if (s !== 0) {\n this.x /= s;\n this.y /= s;\n } else {\n this.set(0, 0);\n }\n\n return this;\n }\n\n multiplyScalar(s) {\n this.x *= s;\n this.y *= s;\n\n return this;\n }\n\n negate() {\n return this.multiplyScalar(-1);\n }\n\n dot(v) {\n return this.x * v.x + this.y * v.y;\n }\n\n lengthSq() {\n return this.x * this.x + this.y * this.y;\n }\n\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n\n normalize() {\n return this.divideScalar(this.length());\n }\n\n distanceTo(v) {\n return Math.sqrt(this.distanceToSquared(v));\n }\n\n rotate(tha) {\n const x = this.x;\n const y = this.y;\n\n this.x = x * Math.cos(tha) + y * Math.sin(tha);\n this.y = -x * Math.sin(tha) + y * Math.cos(tha);\n\n return this;\n }\n\n distanceToSquared(v) {\n const dx = this.x - v.x;\n const dy = this.y - v.y;\n\n return dx * dx + dy * dy;\n }\n\n lerp(v, alpha) {\n this.x += (v.x - this.x) * alpha;\n this.y += (v.y - this.y) * alpha;\n\n return this;\n }\n\n equals(v) {\n return v.x === this.x && v.y === this.y;\n }\n\n clear() {\n this.x = 0.0;\n this.y = 0.0;\n return this;\n }\n\n clone() {\n return new Vector2D(this.x, this.y);\n }\n}\n","import Rgb from \"../utils/Rgb\";\nimport Puid from \"../utils/Puid\";\nimport Util from \"../utils/Util\";\nimport ease from \"../math/ease\";\nimport Vector2D from \"../math/Vector2D\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Particle {\n /**\n * the Particle class\n *\n * @class Proton.Particle\n * @constructor\n * @param {Object} pObj the parameters object;\n * for example {life:3,dead:false}\n */\n constructor(conf) {\n /**\n * The particle's id;\n * @property id\n * @type {string}\n */\n this.name = \"Particle\";\n this.id = Puid.id(this.name);\n this.old = {};\n this.data = {};\n this.behaviours = [];\n\n this.p = new Vector2D();\n this.v = new Vector2D();\n this.a = new Vector2D();\n this.old.p = new Vector2D();\n this.old.v = new Vector2D();\n this.old.a = new Vector2D();\n\n this.rgb = new Rgb();\n this.reset();\n conf && Util.setProp(this, conf);\n }\n\n getDirection() {\n return Math.atan2(this.v.x, -this.v.y) * MathUtil.N180_PI;\n }\n\n reset() {\n this.life = Infinity;\n this.age = 0;\n\n this.dead = false;\n this.sleep = false;\n this.body = null;\n this.sprite = null;\n this.parent = null;\n\n this.energy = 1; // Energy Loss\n this.mass = 1;\n this.radius = 10;\n this.alpha = 1;\n this.scale = 1;\n this.rotation = 0;\n this.color = null;\n\n this.p.set(0, 0);\n this.v.set(0, 0);\n this.a.set(0, 0);\n this.old.p.set(0, 0);\n this.old.v.set(0, 0);\n this.old.a.set(0, 0);\n this.easing = ease.easeLinear;\n\n this.rgb.reset();\n Util.emptyObject(this.data);\n this.removeAllBehaviours();\n\n return this;\n }\n\n update(time, index) {\n if (!this.sleep) {\n this.age += time;\n this.applyBehaviours(time, index);\n }\n\n if (this.age < this.life) {\n const scale = this.easing(this.age / this.life);\n this.energy = Math.max(1 - scale, 0);\n } else {\n this.destroy();\n }\n }\n\n applyBehaviours(time, index) {\n const length = this.behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.behaviours[i] &&\n this.behaviours[i].applyBehaviour(this, time, index);\n }\n }\n\n addBehaviour(behaviour) {\n this.behaviours.push(behaviour);\n\n if (behaviour.hasOwnProperty(\"parents\")) behaviour.parents.push(this);\n behaviour.initialize(this);\n }\n\n addBehaviours(behaviours) {\n const length = behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.addBehaviour(behaviours[i]);\n }\n }\n\n removeBehaviour(behaviour) {\n const index = this.behaviours.indexOf(behaviour);\n\n if (index > -1) {\n const behaviour = this.behaviours.splice(index, 1);\n behaviour.parents = null;\n }\n }\n\n removeAllBehaviours() {\n Util.emptyArray(this.behaviours);\n }\n\n /**\n * Destory this particle\n * @method destroy\n */\n destroy() {\n this.removeAllBehaviours();\n this.energy = 0;\n this.dead = true;\n this.parent = null;\n }\n}\n","export default {\n /**\n * @typedef {Object} rgbObject\n * @property {Number} r red value\n * @property {Number} g green value\n * @property {Number} b blue value\n */\n /**\n * converts a hex value to a rgb object\n *\n * @memberof Proton#Proton.Util\n * @method hexToRgb\n *\n * @param {String} h any hex value, e.g. #000000 or 000000 for black\n *\n * @return {rgbObject}\n */\n hexToRgb(h) {\n const hex16 = h.charAt(0) === \"#\" ? h.substring(1, 7) : h;\n const r = parseInt(hex16.substring(0, 2), 16);\n const g = parseInt(hex16.substring(2, 4), 16);\n const b = parseInt(hex16.substring(4, 6), 16);\n\n return { r, g, b };\n },\n\n /**\n * converts a rgb value to a rgb string\n *\n * @memberof Proton#Proton.Util\n * @method rgbToHex\n *\n * @param {Object | Proton.hexToRgb} rgb a rgb object like in {@link Proton#Proton.}\n *\n * @return {String} rgb()\n */\n rgbToHex(rbg) {\n return `rgb(${rbg.r}, ${rbg.g}, ${rbg.b})`;\n },\n\n getHex16FromParticle(p) {\n return Number(p.rgb.r) * 65536 + Number(p.rgb.g) * 256 + Number(p.rgb.b);\n }\n};\n","import Vector2D from \"./Vector2D\";\n\nexport default class Polar2D {\n constructor(r, tha) {\n this.r = Math.abs(r) || 0;\n this.tha = tha || 0;\n }\n\n set(r, tha) {\n this.r = r;\n this.tha = tha;\n return this;\n }\n\n setR(r) {\n this.r = r;\n return this;\n }\n\n setTha(tha) {\n this.tha = tha;\n return this;\n }\n\n copy(p) {\n this.r = p.r;\n this.tha = p.tha;\n return this;\n }\n\n toVector() {\n return new Vector2D(this.getX(), this.getY());\n }\n\n getX() {\n return this.r * Math.sin(this.tha);\n }\n\n getY() {\n return -this.r * Math.cos(this.tha);\n }\n\n normalize() {\n this.r = 1;\n return this;\n }\n\n equals(v) {\n return v.r === this.r && v.tha === this.tha;\n }\n\n clear() {\n this.r = 0.0;\n this.tha = 0.0;\n return this;\n }\n\n clone() {\n return new Polar2D(this.r, this.tha);\n }\n}\n","const Mat3 = {\n create(mat3) {\n const mat = new Float32Array(9);\n if (mat3) this.set(mat3, mat);\n\n return mat;\n },\n\n set(mat1, mat2) {\n for (let i = 0; i < 9; i++) mat2[i] = mat1[i];\n\n return mat2;\n },\n\n multiply(mat, mat2, mat3) {\n let a00 = mat[0],\n a01 = mat[1],\n a02 = mat[2],\n a10 = mat[3],\n a11 = mat[4],\n a20 = mat[6],\n a21 = mat[7],\n b00 = mat2[0],\n b01 = mat2[1],\n b02 = mat2[2],\n b10 = mat2[3],\n b11 = mat2[4],\n b20 = mat2[6],\n b21 = mat2[7];\n\n mat3[0] = b00 * a00 + b01 * a10;\n mat3[1] = b00 * a01 + b01 * a11;\n mat3[2] = a02 * b02;\n mat3[3] = b10 * a00 + b11 * a10;\n mat3[4] = b10 * a01 + b11 * a11;\n mat3[6] = b20 * a00 + b21 * a10 + a20;\n mat3[7] = b20 * a01 + b21 * a11 + a21;\n\n return mat3;\n },\n\n inverse(mat, mat3) {\n let a00 = mat[0],\n a01 = mat[1],\n a10 = mat[3],\n a11 = mat[4],\n a20 = mat[6],\n a21 = mat[7],\n b01 = a11,\n b11 = -a10,\n b21 = a21 * a10 - a11 * a20,\n d = a00 * b01 + a01 * b11,\n id;\n\n id = 1 / d;\n mat3[0] = b01 * id;\n mat3[1] = -a01 * id;\n mat3[3] = b11 * id;\n mat3[4] = a00 * id;\n mat3[6] = b21 * id;\n mat3[7] = (-a21 * a00 + a01 * a20) * id;\n\n return mat3;\n },\n\n multiplyVec2(m, vec, mat3) {\n let x = vec[0],\n y = vec[1];\n\n mat3[0] = x * m[0] + y * m[3] + m[6];\n mat3[1] = x * m[1] + y * m[4] + m[7];\n\n return mat3;\n }\n};\n\nexport default Mat3;\n","import Span from \"./Span\";\nimport Util from \"../utils/Util\";\nimport MathUtil from \"./MathUtil\";\n\nexport default class ArraySpan extends Span {\n constructor(color) {\n super();\n this._arr = Util.toArray(color);\n }\n\n getValue() {\n const val = Util.getRandFromArray(this._arr);\n return val === \"random\" || val === \"Random\" ? MathUtil.randomColor() : val;\n }\n\n /**\n * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance\n *\n * @method setSpanValue\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n static createArraySpan(arr) {\n if (!arr) return null;\n\n if (arr instanceof ArraySpan) return arr;\n else return new ArraySpan(arr);\n }\n}\n","export default class Rectangle {\n constructor(x, y, w, h) {\n this.x = x;\n this.y = y;\n\n this.width = w;\n this.height = h;\n\n this.bottom = this.y + this.height;\n this.right = this.x + this.width;\n }\n\n contains(x, y) {\n if (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y)\n return true;\n else return false;\n }\n}\n","import Span from \"../math/Span\";\nimport Util from \"../utils/Util\";\n\nexport default class Rate {\n /**\n * The number of particles per second emission (a [particle]/b [s]);\n * @namespace\n * @memberof! Proton#\n * @constructor\n * @alias Rate\n *\n * @param {Array | Number | Span} numpan the number of each emission;\n * @param {Array | Number | Span} timepan the time of each emission;\n * for example: new Rate(new Span(10, 20), new Span(.1, .25));\n */\n constructor(numpan, timepan) {\n this.numPan = Span.setSpanValue(Util.initValue(numpan, 1));\n this.timePan = Span.setSpanValue(Util.initValue(timepan, 1));\n\n this.startTime = 0;\n this.nextTime = 0;\n this.init();\n }\n\n init() {\n this.startTime = 0;\n this.nextTime = this.timePan.getValue();\n }\n\n getValue(time) {\n this.startTime += time;\n\n if (this.startTime >= this.nextTime) {\n this.startTime = 0;\n this.nextTime = this.timePan.getValue();\n\n if (this.numPan.b === 1) {\n if (this.numPan.getValue(false) > 0.5) return 1;\n else return 0;\n } else {\n return this.numPan.getValue(true);\n }\n }\n\n return 0;\n }\n}\n","export default class Initialize {\n reset() {}\n\n init(emitter, particle) {\n if (particle) {\n this.initialize(particle);\n } else {\n this.initialize(emitter);\n }\n }\n\n // sub class init\n initialize(target) {}\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Life extends Initialize {\n constructor(a, b, c) {\n super();\n\n this.lifePan = Span.setSpanValue(a, b, c);\n this.name = \"Life\";\n }\n\n initialize(target) {\n if (this.lifePan.a === Infinity) target.life = Infinity;\n else target.life = this.lifePan.getValue();\n }\n}\n","import Vector2D from \"../math/Vector2D\";\n\nexport default class Zone {\n constructor() {\n this.vector = new Vector2D(0, 0);\n this.random = 0;\n this.crossType = \"dead\";\n this.alert = true;\n }\n\n getPosition() {}\n\n crossing(particle) {}\n}\n","import Zone from \"./Zone\";\n\nexport default class PointZone extends Zone {\n constructor(x, y) {\n super();\n\n this.x = x;\n this.y = y;\n }\n\n getPosition() {\n this.vector.x = this.x;\n this.vector.y = this.y;\n\n return this.vector;\n }\n\n crossing(particle) {\n if (this.alert) {\n console.error(\"Sorry, PointZone does not support crossing method!\");\n this.alert = false;\n }\n }\n}\n","import Util from \"../utils/Util\";\nimport PointZone from \"../zone/PointZone\";\nimport Initialize from \"./Initialize\";\n\nexport default class Position extends Initialize {\n constructor(zone) {\n super();\n this.zone = Util.initValue(zone, new PointZone());\n this.name = \"Position\";\n }\n\n reset(zone) {\n this.zone = Util.initValue(zone, new PointZone());\n }\n\n initialize(target) {\n this.zone.getPosition();\n\n target.p.x = this.zone.vector.x;\n target.p.y = this.zone.vector.y;\n }\n}\n","import Proton from \"../core/Proton\";\nimport Span from \"../math/Span\";\nimport Util from \"../utils/Util\";\nimport Initialize from \"./Initialize\";\nimport Polar2D from \"../math/Polar2D\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Velocity extends Initialize {\n constructor(rpan, thapan, type) {\n super();\n\n this.rPan = Span.setSpanValue(rpan);\n this.thaPan = Span.setSpanValue(thapan);\n this.type = Util.initValue(type, \"vector\");\n\n this.name = \"Velocity\";\n }\n\n reset(rpan, thapan, type) {\n this.rPan = Span.setSpanValue(rpan);\n this.thaPan = Span.setSpanValue(thapan);\n this.type = Util.initValue(type, \"vector\");\n }\n\n normalizeVelocity(vr) {\n return vr * Proton.MEASURE;\n }\n\n initialize(target) {\n if (this.type === \"p\" || this.type === \"P\" || this.type === \"polar\") {\n const polar2d = new Polar2D(\n this.normalizeVelocity(this.rPan.getValue()),\n this.thaPan.getValue() * MathUtil.PI_180\n );\n\n target.v.x = polar2d.getX();\n target.v.y = polar2d.getY();\n } else {\n target.v.x = this.normalizeVelocity(this.rPan.getValue());\n target.v.y = this.normalizeVelocity(this.thaPan.getValue());\n }\n }\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Mass extends Initialize {\n constructor(a, b, c) {\n super();\n this.massPan = Span.setSpanValue(a, b, c);\n this.name = \"Mass\";\n }\n\n initialize(target) {\n target.mass = this.massPan.getValue();\n }\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Radius extends Initialize {\n constructor(a, b, c) {\n super();\n this.radius = Span.setSpanValue(a, b, c);\n\n this.name = \"Radius\";\n }\n\n reset(a, b, c) {\n this.radius = Span.setSpanValue(a, b, c);\n }\n\n initialize(particle) {\n particle.radius = this.radius.getValue();\n particle.data.oldRadius = particle.radius;\n }\n}\n","import Util from \"../utils/Util\";\nimport ArraySpan from \"../math/ArraySpan\";\nimport Initialize from \"./Initialize\";\n\nexport default class Body extends Initialize {\n constructor(image, w, h) {\n super();\n\n this.image = this.setSpanValue(image);\n this.w = Util.initValue(w, 20);\n this.h = Util.initValue(h, this.w);\n this.name = \"Body\";\n }\n\n initialize(particle) {\n const imageTarget = this.image.getValue();\n\n if (typeof imageTarget === \"string\") {\n particle.body = {\n width: this.w,\n height: this.h,\n src: imageTarget,\n isInner: true,\n inner: true\n };\n } else {\n particle.body = imageTarget;\n }\n }\n\n setSpanValue(image) {\n return image instanceof ArraySpan ? image : new ArraySpan(image);\n }\n}\n","import Proton from '../core/Proton';\nimport Util from '../utils/Util';\nimport ease from '../math/ease';\n\nexport default class Behaviour {\n static id = 0;\n\n /**\n * The Behaviour class is the base for the other Behaviour\n *\n * @memberof! -\n * @interface\n * @alias Proton.Behaviour\n *\n * @param {Number} life \tthe behaviours life\n * @param {String} easing \tThe behaviour's decaying trend, for example ease.easeOutQuart\n *\n * @property {String} id \t\tThe behaviours id\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n * @property {Number} age=0 \tHow long the particle should be 'alife'\n * @property {Number} energy=1\n * @property {Boolean} dead=false The particle is dead at first\n * @property {Array} parents \tThe behaviour's parents array\n * @property {String} name \tThe behaviour name\n */\n constructor(life, easing) {\n\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n\n this.age = 0;\n this.energy = 1;\n this.dead = false;\n this.parents = [];\n\n this.id = `Behaviour_${Behaviour.id++}`;\n this.name = 'Behaviour';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(life, easing) {\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n }\n\n /**\n * Normalize a force by 1:100;\n *\n * @method normalizeForce\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Vector2D} force\n */\n normalizeForce(force) {\n return force.multiplyScalar(Proton.MEASURE);\n }\n\n /**\n * Normalize a value by 1:100;\n *\n * @method normalizeValue\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} value\n */\n normalizeValue(value) {\n return value * Proton.MEASURE;\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {}\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n calculate(particle, time, index) {\n this.age += time;\n\n if (this.age >= this.life || this.dead) {\n this.energy = 0;\n this.dead = true;\n this.destroy();\n } else {\n const scale = this.easing(particle.age / particle.life);\n this.energy = Math.max(1 - scale, 0);\n }\n }\n\n /**\n * Destory this behaviour\n *\n * @method destroy\n * @memberof Proton.Behaviour\n * @instance\n */\n destroy() {\n let i = this.parents.length;\n while (i--) {\n this.parents[i].removeBehaviour(this);\n }\n\n this.parents.length = 0;\n }\n}\n","import Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Force extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Force\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(fx, fy, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\t\tthis.name = 'Force';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(fx, fy, life, easing) {\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.a.add(this.force);\n\t}\n}","import Util from \"../utils/Util\";\nimport Vector2D from \"../math/Vector2D\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Attraction extends Behaviour {\n /**\n * This behaviour let the particles follow one specific Proton.Vector2D\n *\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Attraction\n *\n * @todo add description for 'force' and 'radius'\n *\n * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n * @param {Number} [force=100]\n * @param {Number} [radius=1000]\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {Proton.Vector2D} targetPosition\n * @property {Number} radius\n * @property {Number} force\n * @property {Number} radiusSq\n * @property {Proton.Vector2D} attractionForce\n * @property {Number} lengthSq\n * @property {String} name The Behaviour name\n */\n constructor(targetPosition, force, radius, life, easing) {\n super(life, easing);\n\n this.targetPosition = Util.initValue(targetPosition, new Vector2D());\n this.radius = Util.initValue(radius, 1000);\n this.force = Util.initValue(this.normalizeValue(force), 100);\n\n this.radiusSq = this.radius * this.radius;\n this.attractionForce = new Vector2D();\n this.lengthSq = 0;\n\n this.name = \"Attraction\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Attraction\n * @instance\n *\n * @todo add description for 'force' and 'radius'\n *\n * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n * @param {Number} [force=100]\n * @param {Number} [radius=1000]\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n */\n reset(targetPosition, force, radius, life, easing) {\n this.targetPosition = Util.initValue(targetPosition, new Vector2D());\n this.radius = Util.initValue(radius, 1000);\n this.force = Util.initValue(this.normalizeValue(force), 100);\n\n this.radiusSq = this.radius * this.radius;\n this.attractionForce = new Vector2D();\n this.lengthSq = 0;\n\n life && super.reset(life, easing);\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @memberof Proton#Proton.Attraction\n * @method applyBehaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n\n this.attractionForce.copy(this.targetPosition);\n this.attractionForce.sub(particle.p);\n this.lengthSq = this.attractionForce.lengthSq();\n\n if (this.lengthSq > 0.00004 && this.lengthSq < this.radiusSq) {\n this.attractionForce.normalize();\n this.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\n this.attractionForce.multiplyScalar(this.force);\n\n particle.a.add(this.attractionForce);\n }\n }\n}\n","import Vector2D from \"../math/Vector2D\";\nimport MathUtil from \"../math/MathUtil\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class RandomDrift extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Behaviour\n * @constructor\n * @alias RandomDrift\n *\n * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n * @param {Number} delay \t\t\t\tHow much delay the drift should have\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {Number} time The time of the drift\n * @property {String} name The Behaviour name\n */\n constructor(driftX, driftY, delay, life, easing) {\n super(life, easing);\n\n this.reset(driftX, driftY, delay);\n this.time = 0;\n this.name = \"RandomDrift\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#RandomDrift\n * @instance\n *\n * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n * @param {Number} delay \t\t\t\tHow much delay the drift should have\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(driftX, driftY, delay, life, easing) {\n this.panFoce = new Vector2D(driftX, driftY);\n this.panFoce = this.normalizeForce(this.panFoce);\n this.delay = delay;\n\n life && super.reset(life, easing);\n }\n\n initialize(particle) {\n particle.data.time = 0;\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#RandomDrift\n * @instance\n *\n * @param {Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n particle.data.time += time;\n\n if (particle.data.time >= this.delay) {\n particle.a.addXY(\n MathUtil.randomAToB(-this.panFoce.x, this.panFoce.x),\n MathUtil.randomAToB(-this.panFoce.y, this.panFoce.y)\n );\n\n particle.data.time = 0;\n }\n }\n}\n","import Force from './Force';\n\nexport default class Gravity extends Force {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Force\n\t * @constructor\n\t * @alias Proton.Gravity\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(g, life, easing) {\n\t\tsuper(0, g, life, easing);\n\t\tthis.name = 'Gravity';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Gravity\n\t * @instance\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(g, life, easing) {\n\t\tsuper.reset(0, g, life, easing);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Collision extends Behaviour {\n\n\t/**\n\t * The callback after collision\n\t *\n\t * @callback Callback\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Proton.Paritcle} otherParticle\n\t */\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Collision\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(emitter, mass, callback, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(emitter, mass, callback);\n\t\tthis.name = 'Collision';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method reset\n\t * @instance\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} \t\t\t[life=Infinity] \tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(emitter, mass, callback, life, easing) {\n\t\tthis.emitter = Util.initValue(emitter, null);\n\t\tthis.mass = Util.initValue(mass, true);\n\t\tthis.callback = Util.initValue(callback, null);\n\n\t\tthis.collisionPool = [];\n\t\tthis.delta = new Vector2D();\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tconst newPool = this.emitter ? this.emitter.particles.slice(index) : this.pool.slice(index);\n\t\tconst length = newPool.length;\n\n\t\tlet otherParticle;\n\t\tlet lengthSq;\n\t\tlet overlap;\n\t\tlet totalMass;\n\t\tlet averageMass1, averageMass2;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\totherParticle = newPool[i];\n\n\t\t\tif (otherParticle !== particle) {\n\t\t\t\tthis.delta.copy(otherParticle.p);\n\t\t\t\tthis.delta.sub(particle.p);\n\n\t\t\t\tlengthSq = this.delta.lengthSq();\n\t\t\t\tconst distance = particle.radius + otherParticle.radius;\n\n\t\t\t\tif (lengthSq <= distance * distance) {\n\t\t\t\t\toverlap = distance - Math.sqrt(lengthSq);\n\t\t\t\t\toverlap += 0.5;\n\n\t\t\t\t\ttotalMass = particle.mass + otherParticle.mass;\n\t\t\t\t\taverageMass1 = this.mass ? otherParticle.mass / totalMass : 0.5;\n\t\t\t\t\taverageMass2 = this.mass ? particle.mass / totalMass : 0.5;\n\n\t\t\t\t\tparticle.p.add(this.delta.clone().normalize().multiplyScalar(overlap * -averageMass1));\n\t\t\t\t\totherParticle.p.add(this.delta.normalize().multiplyScalar(overlap * averageMass2));\n\n\t\t\t\t\tthis.callback && this.callback(particle, otherParticle);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class CrossZone extends Behaviour {\n\n /**\n * Defines what happens if the particles come to the end of the specified zone\n *\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.CrossZone\n *\n * @param {Proton.Zone} zone \t\t\t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \t\t\twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \t\t\tthis behaviour's life\n * @param {String} \t\t[easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(zone, crossType, life, easing) {\n super(life, easing);\n\n this.reset(zone, crossType);\n this.name = 'CrossZone';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Zone} zone \t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \tthis behaviour's life\n * @param {String} \t\t[easing=easeLinear]\tthis behaviour's easing\n */\n reset(zone, crossType, life, easing) {\n this.zone = zone;\n this.zone.crossType = Util.initValue(crossType, 'dead');\n\n life && super.reset(life, easing);\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n this.zone.crossing(particle);\n };\n}","import Util from \"../utils/Util\";\nimport Span from \"../math/Span\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Alpha extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Alpha\n *\n * @todo add description for 'a' and 'b'\n *\n * @param {Number} a\n * @param {String} b\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = \"Alpha\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @todo add description for 'a' and 'b'\n *\n * @param {Number} a\n * @param {String} b\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.same = b === null || b === undefined ? true : false;\n this.a = Span.setSpanValue(Util.initValue(a, 1));\n this.b = Span.setSpanValue(b);\n\n life && super.reset(life, easing);\n }\n\n /**\n * Sets the new alpha value of the particle\n *\n * @method initialize\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @param {Proton.Particle} particle A single Proton generated particle\n */\n initialize(particle) {\n particle.data.alphaA = this.a.getValue();\n\n if (this.same) particle.data.alphaB = particle.data.alphaA;\n else particle.data.alphaB = this.b.getValue();\n }\n\n /**\n * @method applyBehaviour\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n\n particle.alpha =\n particle.data.alphaB +\n (particle.data.alphaA - particle.data.alphaB) * this.energy;\n\n if (particle.alpha < 0.001) particle.alpha = 0;\n }\n}\n","import Span from \"../math/Span\";\nimport Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Scale extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Scale\n\t *\n\t * @todo add description for 'a' and 'b'\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(a, b, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(a, b);\n\t\tthis.name = 'Scale';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\t\tthis.a = Span.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Span.setSpanValue(b);\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.data.scaleA = this.a.getValue();\n\t\tparticle.data.oldRadius = particle.radius;\n\t\tparticle.data.scaleB = this.same ? particle.data.scaleA : this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.scale = particle.data.scaleB + (particle.data.scaleA - particle.data.scaleB) * this.energy;\n\n\t\tif (particle.scale < 0.0001) particle.scale = 0;\n\t\tparticle.radius = particle.data.oldRadius * particle.scale;\n\t}\n}","import Span from \"../math/Span\";\nimport Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Rotate extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Rotate\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} [influence=Velocity] The rotation's influence\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(influence, b, style, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(influence, b, style);\n\t\tthis.name = 'Rotate';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} a\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, style, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\n\t\tthis.a = Span.setSpanValue(Util.initValue(a, 'Velocity'));\n\t\tthis.b = Span.setSpanValue(Util.initValue(b, 0));\n\t\tthis.style = Util.initValue(style, 'to');\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.rotation = this.a.getValue();\n\t\tparticle.data.rotationA = this.a.getValue();\n\n\t\tif (!this.same) particle.data.rotationB = this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tif (!this.same) {\n\t\t\tif (this.style === 'to' || this.style === 'TO' || this.style === '_') {\n\t\t\t\tparticle.rotation += particle.data.rotationB + (particle.data.rotationA - particle.data.rotationB) * this.energy\n\t\t\t} else {\n\t\t\t\tparticle.rotation += particle.data.rotationB;\n\t\t\t}\n\t\t} else if (this.a.a === 'V' || this.a.a === 'Velocity' || this.a.a === 'v') {\n\t\t\t// beta...\n\t\t\tparticle.rotation = particle.getDirection();\n\t\t}\n\t}\n\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport ArraySpan from \"../math/ArraySpan\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Color extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Color\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = \"Color\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.a = ArraySpan.createArraySpan(a);\n this.b = ArraySpan.createArraySpan(b);\n life && super.reset(life, easing);\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {\n particle.color = this.a.getValue();\n particle.data.colorA = ColorUtil.hexToRgb(particle.color);\n\n if (this.b) particle.data.colorB = ColorUtil.hexToRgb(this.b.getValue());\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n if (this.b) {\n this.calculate(particle, time, index);\n\n particle.rgb.r =\n particle.data.colorB.r +\n (particle.data.colorA.r - particle.data.colorB.r) * this.energy;\n particle.rgb.g =\n particle.data.colorB.g +\n (particle.data.colorA.g - particle.data.colorB.g) * this.energy;\n particle.rgb.b =\n particle.data.colorB.b +\n (particle.data.colorA.b - particle.data.colorB.b) * this.energy;\n\n particle.rgb.r = Math.floor(particle.rgb.r);\n particle.rgb.g = Math.floor(particle.rgb.g);\n particle.rgb.b = Math.floor(particle.rgb.b);\n } else {\n particle.rgb.r = particle.data.colorA.r;\n particle.rgb.g = particle.data.colorA.g;\n particle.rgb.b = particle.data.colorA.b;\n }\n }\n}\n","import MathUtil from \"../math/MathUtil\";\nimport Vector2D from \"../math/Vector2D\";\nimport Span from \"../math/Span\";\nimport Behaviour from \"./Behaviour\";\n\nconst CHANGING = \"changing\";\n\nexport default class Cyclone extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Cyclone\n *\n * @param {Number} angle\n * @param {Number} force\n * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(angle, force, life, easing) {\n super(life, easing);\n this.setAngleAndForce(angle, force);\n this.name = \"Cyclone\";\n }\n\n setAngleAndForce(angle, force) {\n this.force = CHANGING;\n this.angle = MathUtil.PI / 2;\n\n if (angle === \"right\") {\n this.angle = MathUtil.PI / 2;\n } else if (angle === \"left\") {\n this.angle = -MathUtil.PI / 2;\n } else if (angle === \"random\") {\n this.angle = \"random\";\n } else if (angle instanceof Span) {\n this.angle = \"span\";\n this.span = angle;\n } else if (angle) {\n this.angle = angle;\n }\n\n if (\n String(force).toLowerCase() === \"changing\" ||\n String(force).toLowerCase() === \"chang\" ||\n String(force).toLowerCase() === \"auto\"\n ) {\n this.force = CHANGING;\n } else if (force) {\n this.force = force;\n }\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Cyclone\n * @instance\n *\n * @param {Number} angle\n * @param {Number} force\n * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n */\n reset(angle, force, life, easing) {\n this.angle = MathUtil.PI / 2;\n this.setAngleAndForce(angle, force);\n life && super.reset(life, easing);\n }\n\n initialize(particle) {\n if (this.angle === \"random\") {\n particle.data.cangle = MathUtil.randomAToB(-MathUtil.PI, MathUtil.PI);\n } else if (this.angle === \"span\") {\n particle.data.cangle = this.span.getValue();\n }\n\n particle.data.cyclone = new Vector2D(0, 0);\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.Cyclone\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n\n let length;\n let gradient = particle.v.getGradient();\n if (this.angle === \"random\" || this.angle === \"span\") {\n gradient += particle.data.cangle;\n } else {\n gradient += this.angle;\n }\n\n if (this.force === CHANGING) {\n length = particle.v.length() / 100;\n } else {\n length = this.force;\n }\n\n particle.data.cyclone.x = length * Math.cos(gradient);\n particle.data.cyclone.y = length * Math.sin(gradient);\n particle.data.cyclone = this.normalizeForce(particle.data.cyclone);\n particle.a.add(particle.data.cyclone);\n }\n}\n","import Attraction from './Attraction';\n\nexport default class Repulsion extends Attraction {\n\n\t/**\n\t * The oppisite of Proton.Attraction - turns the force\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Attraction\n\t * @constructor\n\t * @alias Proton.Repulsion\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Number} force\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(targetPosition, force, radius, life, easing);\n\n\t\tthis.force *= -1;\n\t\tthis.name = 'Repulsion';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Repulsion\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tsuper.reset(targetPosition, force, radius, life, easing);\n\t\tthis.force *= -1;\n\t}\n}\n","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class GravityWell extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Behaviour\n\t * @constructor\n\t * @alias GravityWell\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(centerPoint, force, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.name = 'GravityWell';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t */\n\treset(centerPoint, force, life, easing) {\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tlife && super.reset(life, easing);\n\t};\n\n\t/**\n\t * @inheritdoc\n\t */\n\tinitialize(particle) {\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.distanceVec.set(this.centerPoint.x - particle.p.x, this.centerPoint.y - particle.p.y);\n\t\tconst distanceSq = this.distanceVec.lengthSq();\n\n\t\tif (distanceSq !== 0) {\n\t\t\tconst distance = this.distanceVec.length();\n\t\t\tconst factor = (this.force * time) / (distanceSq * distance);\n\n\t\t\tparticle.v.x += factor * this.distanceVec.x;\n\t\t\tparticle.v.y += factor * this.distanceVec.y;\n\t\t}\n\t}\n}","import Util from \"../utils/Util\";\nimport Initialize from \"./Initialize\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default {\n initialize(emitter, particle, initializes) {\n const length = initializes.length;\n let i;\n\n for (i = 0; i < length; i++) {\n if (initializes[i] instanceof Initialize) {\n initializes[i].init(emitter, particle);\n } else {\n this.init(emitter, particle, initializes[i]);\n }\n }\n\n this.bindEmitter(emitter, particle);\n },\n\n // init\n init(emitter, particle, initialize) {\n Util.setProp(particle, initialize);\n Util.setVectorVal(particle, initialize);\n },\n\n bindEmitter(emitter, particle) {\n if (emitter.bindEmitter) {\n particle.p.add(emitter.p);\n particle.v.add(emitter.v);\n particle.a.add(emitter.a);\n\n particle.v.rotate(MathUtil.degreeTransform(emitter.rotation));\n }\n }\n};\n","import Util from \"../utils/Util\";\nimport Puid from \"../utils/Puid\";\nimport Particle from \"../core/Particle\";\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport Rate from \"../initialize/Rate\";\nimport InitializeUtil from \"../initialize/InitializeUtil\";\n\nexport default class Emitter extends Particle {\n /**\n * You can use this emit particles.\n *\n * It will dispatch follow events:\n * PARTICLE_CREATED\n * PARTICLE_UPDATA\n * PARTICLE_DEAD\n *\n * @class Emitter\n * @constructor\n * @param {Object} conf the parameters object;\n * for example {damping:0.01,bindEmitter:false}\n */\n constructor(conf = {}) {\n super(conf);\n\n this.particles = [];\n this.behaviours = [];\n this.initializes = [];\n\n this.emitTime = 0;\n this.emitSpeed = 0;\n this.totalTime = -1;\n\n /**\n * The friction coefficient for all particle emit by This;\n * @property damping\n * @type {Number}\n * @default 0.006\n */\n this.damping = 0.006;\n\n /**\n * If bindEmitter the particles can bind this emitter's property;\n * @property bindEmitter\n * @type {Boolean}\n * @default true\n */\n this.bindEmitter = true;\n\n /**\n * The number of particles per second emit (a [particle]/b [s]);\n * @property rate\n * @type {Rate}\n * @default Rate(1, .1)\n */\n this.rate = new Rate(1, 0.1);\n\n this.name = \"Emitter\";\n this.id = Puid.id(this.name);\n }\n\n /**\n * start emit particle\n * @method emit\n * @param {Number} emitTime begin emit time;\n * @param {String} life the life of this emitter\n */\n emit(totalTime, life) {\n this.stoped = false;\n this.emitTime = 0;\n this.totalTime = Util.initValue(totalTime, Infinity);\n\n if (life === true || life === \"life\" || life === \"destroy\") {\n this.life = totalTime === \"once\" ? 1 : this.totalTime;\n } else if (!isNaN(life)) {\n this.life = life;\n }\n\n this.rate.init();\n }\n\n /**\n * stop emiting\n * @method stop\n */\n stop() {\n this.totalTime = -1;\n this.emitTime = 0;\n this.stoped = true;\n }\n\n preEmit(time) {\n let oldStoped = this.stoped;\n let oldEmitTime = this.emitTime;\n let oldTotalTime = this.totalTime;\n\n this.stoped = false;\n this.emitTime = 0;\n this.totalTime = time;\n this.rate.init();\n\n const step = 0.0167;\n while (time > step) {\n time -= step;\n this.update(step);\n }\n\n this.stoped = oldStoped;\n this.emitTime = oldEmitTime + Math.max(time, 0);\n this.totalTime = oldTotalTime;\n }\n\n /**\n * remove current all particles\n * @method removeAllParticles\n */\n removeAllParticles() {\n let i = this.particles.length;\n while (i--) this.particles[i].dead = true;\n }\n\n /**\n * add initialize to this emitter\n * @method addSelfInitialize\n */\n addSelfInitialize(initialize) {\n if (initialize[\"init\"]) {\n initialize.init(this);\n } else {\n this.initAll();\n }\n }\n\n /**\n * add the Initialize to particles;\n *\n * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);\n * @method addInitialize\n * @param {Initialize} initialize like this new Radius(1, 12)\n */\n addInitialize(...rest) {\n let i = rest.length;\n while (i--) this.initializes.push(rest[i]);\n }\n\n /**\n * remove the Initialize\n * @method removeInitialize\n * @param {Initialize} initialize a initialize\n */\n removeInitialize(initializer) {\n const index = this.initializes.indexOf(initializer);\n if (index > -1) this.initializes.splice(index, 1);\n }\n\n /**\n * remove all Initializes\n * @method removeInitializers\n */\n removeAllInitializers() {\n Util.emptyArray(this.initializes);\n }\n\n /**\n * add the Behaviour to particles;\n *\n * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);\n * @method addBehaviour\n * @param {Behaviour} behaviour like this new Color('random')\n */\n addBehaviour(...rest) {\n let i = arguments.length;\n while (i--) {\n let behaviour = rest[i];\n this.behaviours.push(behaviour);\n if (behaviour.parents) behaviour.parents.push(this);\n }\n }\n\n /**\n * remove the Behaviour\n * @method removeBehaviour\n * @param {Behaviour} behaviour a behaviour\n */\n removeBehaviour(behaviour) {\n let index = this.behaviours.indexOf(behaviour);\n this.behaviours.splice(index, 1);\n\n if (behaviour.parents) {\n index = behaviour.parents.indexOf(behaviour);\n behaviour.parents.splice(index, 1);\n }\n\n return index;\n }\n\n /**\n * remove all behaviours\n * @method removeAllBehaviours\n */\n removeAllBehaviours() {\n Util.emptyArray(this.behaviours);\n }\n\n // emitter update\n update(time) {\n this.age += time;\n if (this.age >= this.life || this.dead) this.destroy();\n\n this.emitting(time);\n this.integrate(time);\n }\n\n integrate(time) {\n if (!this.parent) return;\n\n const damping = 1 - this.damping;\n this.parent.integrator.calculate(this, time, damping);\n\n const length = this.particles.length;\n let i, particle;\n\n for (i = length - 1; i >= 0; i--) {\n particle = this.particles[i];\n\n // particle update\n particle.update(time, i);\n this.parent.integrator.calculate(particle, time, damping);\n this.dispatch(\"PARTICLE_UPDATE\", particle);\n\n // check dead\n if (particle.dead) {\n this.dispatch(\"PARTICLE_DEAD\", particle);\n\n this.parent.pool.expire(particle);\n this.particles.splice(i, 1);\n }\n }\n }\n\n dispatch(event, target) {\n this.parent && this.parent.dispatchEvent(event, target);\n this.bindEvent && this.dispatchEvent(event, target);\n }\n\n emitting(time) {\n if (this.totalTime === \"once\") {\n let i;\n const length = this.rate.getValue(99999);\n\n if (length > 0) this.emitSpeed = length;\n for (i = 0; i < length; i++) this.createParticle();\n this.totalTime = \"none\";\n } else {\n this.emitTime += time;\n\n if (this.emitTime < this.totalTime) {\n const length = this.rate.getValue(time);\n let i;\n\n if (length > 0) this.emitSpeed = length;\n for (i = 0; i < length; i++) this.createParticle();\n }\n }\n }\n\n /**\n * create single particle;\n *\n * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})\n * @method removeAllParticles\n */\n createParticle(initialize, behaviour) {\n const particle = this.parent.pool.get(Particle);\n this.setupParticle(particle, initialize, behaviour);\n this.dispatch(\"PARTICLE_CREATED\", particle);\n\n return particle;\n }\n\n setupParticle(particle, initialize, behaviour) {\n let initializes = this.initializes;\n let behaviours = this.behaviours;\n\n if (initialize) initializes = Util.toArray(initialize);\n if (behaviour) behaviours = Util.toArray(behaviour);\n\n particle.reset();\n InitializeUtil.initialize(this, particle, initializes);\n particle.addBehaviours(behaviours);\n particle.parent = this;\n\n this.particles.push(particle);\n }\n\n remove() {\n this.stop();\n Util.destroyAll(this.particles);\n }\n\n /**\n * Destory this Emitter\n * @method destroy\n */\n destroy() {\n this.dead = true;\n this.remove();\n this.removeAllInitializers();\n this.removeAllBehaviours();\n this.parent && this.parent.removeEmitter(this);\n }\n}\n\nEventDispatcher.bind(Emitter);\n","import Emitter from \"./Emitter\";\n\nexport default class BehaviourEmitter extends Emitter {\n /**\n * The BehaviourEmitter class inherits from Proton.Emitter\n *\n * use the BehaviourEmitter you can add behaviours to self;\n * @class Proton.BehaviourEmitter\n * @constructor\n * @param {Object} conf the parameters object;\n */\n constructor(conf) {\n super(conf);\n\n this.selfBehaviours = [];\n }\n\n /**\n * add the Behaviour to emitter;\n *\n * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);\n * @method addSelfBehaviour\n * @param {Proton.Behaviour} behaviour like this new Proton.Color('random')\n */\n addSelfBehaviour(...rest) {\n let i,\n length = rest.length;\n\n for (i = 0; i < length; i++) {\n let behaviour = rest[i];\n this.selfBehaviours.push(behaviour);\n behaviour.initialize(this);\n }\n }\n\n /**\n * remove the Behaviour for self\n * @method removeSelfBehaviour\n * @param {Proton.Behaviour} behaviour a behaviour\n */\n removeSelfBehaviour(behaviour) {\n const index = this.selfBehaviours.indexOf(behaviour);\n if (index > -1) this.selfBehaviours.splice(index, 1);\n }\n\n update(time) {\n super.update(time);\n\n if (!this.sleep) {\n const length = this.selfBehaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.selfBehaviours[i].applyBehaviour(this, time, i);\n }\n }\n }\n}\n","import Util from \"../utils/Util\";\nimport Emitter from \"./Emitter\";\n\nexport default class FollowEmitter extends Emitter {\n /**\n * The FollowEmitter class inherits from Proton.Emitter\n *\n * use the FollowEmitter will emit particle when mousemoving\n *\n * @class Proton.FollowEmitter\n * @constructor\n * @param {Element} mouseTarget mouseevent's target;\n * @param {Number} ease the easing of following speed;\n * @default 0.7\n * @param {Object} conf the parameters object;\n */\n constructor(mouseTarget, ease, conf) {\n super(conf);\n\n this.mouseTarget = Util.initValue(mouseTarget, window);\n this.ease = Util.initValue(ease, 0.7);\n\n this._allowEmitting = false;\n this.initEventHandler();\n }\n\n initEventHandler() {\n this.mousemoveHandler = e => this.mousemove.call(this, e);\n this.mousedownHandler = e => this.mousedown.call(this, e);\n this.mouseupHandler = e => this.mouseup.call(this, e);\n\n this.mouseTarget.addEventListener(\n \"mousemove\",\n this.mousemoveHandler,\n false\n );\n }\n\n /**\n * start emit particle\n * @method emit\n */\n emit() {\n this._allowEmitting = true;\n }\n\n /**\n * stop emiting\n * @method stop\n */\n stop() {\n this._allowEmitting = false;\n }\n\n mousemove(e) {\n if (e.layerX || e.layerX === 0) {\n this.p.x += (e.layerX - this.p.x) * this.ease;\n this.p.y += (e.layerY - this.p.y) * this.ease;\n } else if (e.offsetX || e.offsetX === 0) {\n this.p.x += (e.offsetX - this.p.x) * this.ease;\n this.p.y += (e.offsetY - this.p.y) * this.ease;\n }\n\n if (this._allowEmitting) super.emit(\"once\");\n }\n\n /**\n * Destory this Emitter\n * @method destroy\n */\n destroy() {\n super.destroy();\n this.mouseTarget.removeEventListener(\n \"mousemove\",\n this.mousemoveHandler,\n false\n );\n }\n}\n","import Pool from \"../core/Pool\";\n\nexport default class BaseRenderer {\n constructor(element, stroke) {\n this.pool = new Pool();\n this.element = element;\n this.stroke = stroke;\n this.circleConf = { isCircle: true };\n\n this.initHandler();\n this.name = \"BaseRenderer\";\n }\n\n setStroke(color = \"#000000\", thinkness = 1) {\n this.stroke = { color, thinkness };\n }\n\n initHandler() {\n this._protonUpdateHandler = () => {\n this.onProtonUpdate.call(this);\n };\n\n this._protonUpdateAfterHandler = () => {\n this.onProtonUpdateAfter.call(this);\n };\n\n this._emitterAddedHandler = emitter => {\n this.onEmitterAdded.call(this, emitter);\n };\n\n this._emitterRemovedHandler = emitter => {\n this.onEmitterRemoved.call(this, emitter);\n };\n\n this._particleCreatedHandler = particle => {\n this.onParticleCreated.call(this, particle);\n };\n\n this._particleUpdateHandler = particle => {\n this.onParticleUpdate.call(this, particle);\n };\n\n this._particleDeadHandler = particle => {\n this.onParticleDead.call(this, particle);\n };\n }\n\n init(proton) {\n this.parent = proton;\n\n proton.addEventListener(\"PROTON_UPDATE\", this._protonUpdateHandler);\n proton.addEventListener(\n \"PROTON_UPDATE_AFTER\",\n this._protonUpdateAfterHandler\n );\n\n proton.addEventListener(\"EMITTER_ADDED\", this._emitterAddedHandler);\n proton.addEventListener(\"EMITTER_REMOVED\", this._emitterRemovedHandler);\n\n proton.addEventListener(\n \"PARTICLE_CREATED\",\n this._particleCreatedHandler\n );\n proton.addEventListener(\"PARTICLE_UPDATE\", this._particleUpdateHandler);\n proton.addEventListener(\"PARTICLE_DEAD\", this._particleDeadHandler);\n }\n\n resize(width, height) {}\n\n destroy() {\n this.remove();\n }\n\n remove(proton) {\n this.parent.removeEventListener(\n \"PROTON_UPDATE\",\n this._protonUpdateHandler\n );\n this.parent.removeEventListener(\n \"PROTON_UPDATE_AFTER\",\n this._protonUpdateAfterHandler\n );\n\n this.parent.removeEventListener(\n \"EMITTER_ADDED\",\n this._emitterAddedHandler\n );\n this.parent.removeEventListener(\n \"EMITTER_REMOVED\",\n this._emitterRemovedHandler\n );\n\n this.parent.removeEventListener(\n \"PARTICLE_CREATED\",\n this._particleCreatedHandler\n );\n this.parent.removeEventListener(\n \"PARTICLE_UPDATE\",\n this._particleUpdateHandler\n );\n this.parent.removeEventListener(\n \"PARTICLE_DEAD\",\n this._particleDeadHandler\n );\n\n this.parent = null;\n }\n\n onProtonUpdate() {}\n onProtonUpdateAfter() {}\n\n onEmitterAdded(emitter) {}\n onEmitterRemoved(emitter) {}\n\n onParticleCreated(particle) {}\n onParticleUpdate(particle) {}\n onParticleDead(particle) {}\n}\n","import ImgUtil from \"../utils/ImgUtil\";\nimport ColorUtil from \"../utils/ColorUtil\";\nimport MathUtil from \"../math/MathUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class CanvasRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.context = this.element.getContext(\"2d\");\n this.bufferCache = {};\n this.name = \"CanvasRenderer\";\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n onProtonUpdate() {\n this.context.clearRect(0, 0, this.element.width, this.element.height);\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.color = particle.color || \"#ff0000\";\n }\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n if (particle.body instanceof Image) this.drawImage(particle);\n } else {\n this.drawCircle(particle);\n }\n }\n\n onParticleDead(particle) {\n particle.body = null;\n }\n\n // private\n addImg2Body(img, particle) {\n particle.body = img;\n }\n\n // private drawCircle\n drawImage(particle) {\n const w = (particle.body.width * particle.scale) | 0;\n const h = (particle.body.height * particle.scale) | 0;\n const x = particle.p.x - w / 2;\n const y = particle.p.y - h / 2;\n\n if (!!particle.color) {\n if (!particle.data[\"buffer\"])\n particle.data.buffer = this.createBuffer(particle.body);\n\n const bufContext = particle.data.buffer.getContext(\"2d\");\n bufContext.clearRect(\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height\n );\n bufContext.globalAlpha = particle.alpha;\n bufContext.drawImage(particle.body, 0, 0);\n\n bufContext.globalCompositeOperation = \"source-atop\";\n bufContext.fillStyle = ColorUtil.rgbToHex(particle.rgb);\n bufContext.fillRect(\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height\n );\n bufContext.globalCompositeOperation = \"source-over\";\n bufContext.globalAlpha = 1;\n\n this.context.drawImage(\n particle.data.buffer,\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height,\n x,\n y,\n w,\n h\n );\n } else {\n this.context.save();\n\n this.context.globalAlpha = particle.alpha;\n this.context.translate(particle.p.x, particle.p.y);\n this.context.rotate(MathUtil.degreeTransform(particle.rotation));\n this.context.translate(-particle.p.x, -particle.p.y);\n this.context.drawImage(\n particle.body,\n 0,\n 0,\n particle.body.width,\n particle.body.height,\n x,\n y,\n w,\n h\n );\n\n this.context.globalAlpha = 1;\n this.context.restore();\n }\n }\n\n // private drawCircle --\n drawCircle(particle) {\n if (particle.rgb) {\n this.context.fillStyle = `rgba(${particle.rgb.r},${particle.rgb.g},${particle.rgb.b},${particle.alpha})`;\n } else {\n this.context.fillStyle = particle.color;\n }\n\n // draw circle\n this.context.beginPath();\n this.context.arc(\n particle.p.x,\n particle.p.y,\n particle.radius,\n 0,\n Math.PI * 2,\n true\n );\n\n if (this.stroke) {\n this.context.strokeStyle = this.stroke.color;\n this.context.lineWidth = this.stroke.thinkness;\n this.context.stroke();\n }\n\n this.context.closePath();\n this.context.fill();\n }\n\n // private createBuffer\n createBuffer(image) {\n if (image instanceof Image) {\n const size = image.width + \"_\" + image.height;\n let canvas = this.bufferCache[size];\n\n if (!canvas) {\n canvas = document.createElement(\"canvas\");\n canvas.width = image.width;\n canvas.height = image.height;\n this.bufferCache[size] = canvas;\n }\n\n return canvas;\n }\n }\n}\n","import DomUtil from \"../utils/DomUtil\";\nimport ImgUtil from \"../utils/ImgUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class DomRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.transform3d = false;\n this.name = \"DomRenderer\";\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n this.element.appendChild(particle.body);\n }\n }\n\n onParticleUpdate(particle) {\n if (this.bodyReady(particle)) {\n if (this.transform3d)\n DomUtil.transform3d(\n particle.body,\n particle.p.x,\n particle.p.y,\n particle.scale,\n particle.rotation\n );\n else\n DomUtil.transform(\n particle.body,\n particle.p.x,\n particle.p.y,\n particle.scale,\n particle.rotation\n );\n\n particle.body.style.opacity = particle.alpha;\n if (particle.body.isCircle) {\n particle.body.style.backgroundColor = particle.color || \"#ff0000\";\n }\n }\n }\n\n onParticleDead(particle) {\n if (this.bodyReady(particle)) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n }\n\n bodyReady(particle) {\n return (\n typeof particle.body === \"object\" &&\n particle.body &&\n !particle.body.isInner\n );\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = this.pool.get(img, particle);\n DomUtil.resize(particle.body, img.width, img.height);\n\n this.element.appendChild(particle.body);\n }\n\n createBody(body, particle) {\n if (body.isCircle) return this.createCircle(particle);\n else return this.createSprite(body, particle);\n }\n\n // private --\n createCircle(particle) {\n const dom = DomUtil.createDiv(\n `${particle.id}_dom`,\n 2 * particle.radius,\n 2 * particle.radius\n );\n dom.style.borderRadius = `${particle.radius}px`;\n\n if (this.stroke) {\n dom.style.borderColor = this.stroke.color;\n dom.style.borderWidth = `${this.stroke.thinkness}px`;\n }\n dom.isCircle = true;\n\n return dom;\n }\n\n createSprite(body, particle) {\n const url = typeof body === \"string\" ? body : body.src;\n const dom = DomUtil.createDiv(\n `${particle.id}_dom`,\n body.width,\n body.height\n );\n dom.style.backgroundImage = `url(${url})`;\n\n return dom;\n }\n}\n","import BaseRenderer from \"./BaseRenderer\";\n\nexport default class EaselRenderer extends BaseRenderer {\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.name = \"EaselRenderer\";\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n this.createSprite(particle);\n } else {\n this.createCircle(particle);\n }\n\n this.element.addChild(particle.body);\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n particle.body.x = particle.p.x;\n particle.body.y = particle.p.y;\n\n particle.body.alpha = particle.alpha;\n particle.body.scaleX = particle.body.scaleY = particle.scale;\n particle.body.rotation = particle.rotation;\n }\n }\n\n onParticleDead(particle) {\n if (particle.body) {\n particle.body.parent && particle.body.parent.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n if (particle.graphics) this.pool.expire(particle.graphics);\n }\n\n // private\n createSprite(particle) {\n particle.body = this.pool.get(particle.body);\n\n if (particle.body.parent) return;\n if (particle.body[\"image\"]) {\n particle.body.regX = particle.body.image.width / 2;\n particle.body.regY = particle.body.image.height / 2;\n }\n }\n\n createCircle(particle) {\n const graphics = this.pool.get(createjs.Graphics);\n\n if (this.stroke) {\n if (this.stroke instanceof String) graphics.beginStroke(this.stroke);\n else graphics.beginStroke(\"#000000\");\n }\n graphics\n .beginFill(particle.color || \"#ff0000\")\n .drawCircle(0, 0, particle.radius);\n\n const shape = this.pool.get(createjs.Shape, [graphics]);\n\n particle.body = shape;\n particle.graphics = graphics;\n }\n}\n","import Rectangle from \"../math/Rectangle\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class PixelRenderer extends BaseRenderer {\n constructor(element, rectangle) {\n super(element);\n\n this.context = this.element.getContext(\"2d\");\n this.imageData = null;\n this.rectangle = null;\n this.rectangle = rectangle;\n this.createImageData(rectangle);\n\n this.name = \"PixelRenderer\";\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n createImageData(rectangle) {\n this.rectangle = rectangle\n ? rectangle\n : new Rectangle(0, 0, this.element.width, this.element.height);\n this.imageData = this.context.createImageData(\n this.rectangle.width,\n this.rectangle.height\n );\n this.context.putImageData(\n this.imageData,\n this.rectangle.x,\n this.rectangle.y\n );\n }\n\n onProtonUpdate() {\n this.context.clearRect(\n this.rectangle.x,\n this.rectangle.y,\n this.rectangle.width,\n this.rectangle.height\n );\n this.imageData = this.context.getImageData(\n this.rectangle.x,\n this.rectangle.y,\n this.rectangle.width,\n this.rectangle.height\n );\n }\n\n onProtonUpdateAfter() {\n this.context.putImageData(\n this.imageData,\n this.rectangle.x,\n this.rectangle.y\n );\n }\n\n onParticleCreated(particle) {}\n\n onParticleUpdate(particle) {\n if (this.imageData) {\n this.setPixel(\n this.imageData,\n Math.floor(particle.p.x - this.rectangle.x),\n Math.floor(particle.p.y - this.rectangle.y),\n particle\n );\n }\n }\n\n setPixel(imagedata, x, y, particle) {\n const rgb = particle.rgb;\n if (x < 0 || x > this.element.width || y < 0 || y > this.elementwidth)\n return;\n\n const i = ((y >> 0) * imagedata.width + (x >> 0)) * 4;\n\n imagedata.data[i] = rgb.r;\n imagedata.data[i + 1] = rgb.g;\n imagedata.data[i + 2] = rgb.b;\n imagedata.data[i + 3] = particle.alpha * 255;\n }\n\n onParticleDead(particle) {}\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport MathUtil from \"../math/MathUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nlet PIXIClass;\nexport default class PixiRenderer extends BaseRenderer {\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.color = false;\n this.setColor = false;\n this.blendMode = null;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.setPIXI(window.PIXI);\n\n this.name = \"PixiRenderer\";\n }\n\n setPIXI(PIXI) {\n try {\n PIXIClass = PIXI || { Sprite: {} };\n this.createFromImage =\n PIXIClass.Sprite.from || PIXIClass.Sprite.fromImage;\n } catch (e) {}\n }\n\n onProtonUpdate() {}\n\n /**\n * @param particle\n */\n onParticleCreated(particle) {\n if (particle.body) {\n particle.body = this.pool.get(particle.body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n }\n\n if (this.blendMode) {\n particle.body.blendMode = this.blendMode;\n }\n\n this.element.addChild(particle.body);\n }\n\n /**\n * @param particle\n */\n onParticleUpdate(particle) {\n this.transform(particle, particle.body);\n\n if (this.setColor === true || this.color === true) {\n particle.body.tint = ColorUtil.getHex16FromParticle(particle);\n }\n }\n\n /**\n * @param particle\n */\n onParticleDead(particle) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n destroy(particles) {\n super.destroy();\n this.pool.destroy();\n\n let i = particles.length;\n while (i--) {\n let particle = particles[i];\n if (particle.body) {\n this.element.removeChild(particle.body);\n }\n }\n }\n\n transform(particle, target) {\n target.x = particle.p.x;\n target.y = particle.p.y;\n\n target.alpha = particle.alpha;\n\n target.scale.x = particle.scale;\n target.scale.y = particle.scale;\n\n // using cached version of MathUtil.PI_180 for slight performance increase.\n target.rotation = particle.rotation * MathUtil.PI_180; // MathUtil.PI_180;\n }\n\n createBody(body, particle) {\n if (body.isCircle) return this.createCircle(particle);\n else return this.createSprite(body);\n }\n\n createSprite(body) {\n const sprite = body.isInner\n ? this.createFromImage(body.src)\n : new PIXIClass.Sprite(body);\n\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n\n return sprite;\n }\n\n createCircle(particle) {\n const graphics = new PIXIClass.Graphics();\n\n if (this.stroke) {\n const stroke = this.stroke instanceof String ? this.stroke : 0x000000;\n graphics.beginStroke(stroke);\n }\n\n graphics.beginFill(particle.color || 0x008ced);\n graphics.drawCircle(0, 0, particle.radius);\n graphics.endFill();\n\n return graphics;\n }\n}\n","import Mat3 from \"../math/Mat3\";\n\nexport default class MStack {\n constructor() {\n this.mats = [];\n this.size = 0;\n\n for (let i = 0; i < 20; i++)\n this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0]));\n }\n\n set(m, i) {\n if (i === 0) Mat3.set(m, this.mats[0]);\n else Mat3.multiply(this.mats[i - 1], m, this.mats[i]);\n\n this.size = Math.max(this.size, i + 1);\n }\n\n push(m) {\n if (this.size === 0) Mat3.set(m, this.mats[0]);\n else Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]);\n\n this.size++;\n }\n\n pop() {\n if (this.size > 0) this.size--;\n }\n\n top() {\n return this.mats[this.size - 1];\n }\n}\n","import Mat3 from '../math/Mat3';\nimport BaseRenderer from './BaseRenderer';\n\nimport Util from '../utils/Util';\nimport ImgUtil from '../utils/ImgUtil';\nimport MStack from '../utils/MStack';\nimport DomUtil from '../utils/DomUtil';\nimport WebGLUtil from '../utils/WebGLUtil';\nimport MathUtil from '../math/MathUtil';\n\nexport default class WebGLRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.gl = this.element.getContext('experimental-webgl', { antialias: true, stencil: false, depth: false });\n if (!this.gl) alert('Sorry your browser do not suppest WebGL!');\n\n this.initVar();\n this.setMaxRadius();\n this.initShaders();\n this.initBuffers();\n\n this.gl.blendEquation(this.gl.FUNC_ADD);\n this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);\n this.gl.enable(this.gl.BLEND);\n\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.name = 'WebGLRenderer';\n }\n\n init(proton) {\n super.init(proton);\n this.resize(this.element.width, this.element.height);\n }\n\n resize(width, height) {\n this.umat[4] = -2;\n this.umat[7] = 1;\n\n this.smat[0] = 1 / width;\n this.smat[4] = 1 / height;\n\n this.mstack.set(this.umat, 0);\n this.mstack.set(this.smat, 1);\n\n this.gl.viewport(0, 0, width, height);\n this.element.width = width;\n this.element.height = height;\n }\n\n setMaxRadius(radius) {\n this.circleCanvasURL = this.createCircle(radius);\n }\n\n getVertexShader() {\n const vsSource = ['uniform vec2 viewport;', 'attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform mat3 tMat;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'void main() {', 'vec3 v = tMat * vec3(aVertexPosition, 1.0);', 'gl_Position = vec4(v.x, v.y, 0, 1);', 'vTextureCoord = aTextureCoord;', 'alpha = tMat[0][2];', '}'].join('\\n');\n return vsSource;\n }\n\n getFragmentShader() {\n const fsSource = ['precision mediump float;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'uniform sampler2D uSampler;', 'uniform vec4 color;', 'uniform bool useTexture;', 'uniform vec3 uColor;', 'void main() {', 'vec4 textureColor = texture2D(uSampler, vTextureCoord);', 'gl_FragColor = textureColor * vec4(uColor, 1.0);', 'gl_FragColor.w *= alpha;', '}'].join('\\n');\n return fsSource;\n }\n\n initVar() {\n this.mstack = new MStack();\n this.umat = Mat3.create([2, 0, 1, 0, -2, 0, -1, 1, 1]);\n this.smat = Mat3.create([1 / 100, 0, 1, 0, 1 / 100, 0, 0, 0, 1]);\n this.texturebuffers = {};\n }\n\n blendEquation(A) {\n this.gl.blendEquation(this.gl[A]);\n }\n\n blendFunc(A, B) {\n this.gl.blendFunc(this.gl[A], this.gl[B]);\n }\n\n getShader(gl, str, fs) {\n const shader = fs ? gl.createShader(gl.FRAGMENT_SHADER) : gl.createShader(gl.VERTEX_SHADER);\n\n gl.shaderSource(shader, str);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n }\n\n initShaders() {\n const fragmentShader = this.getShader(this.gl, this.getFragmentShader(), true);\n const vertexShader = this.getShader(this.gl, this.getVertexShader(), false);\n\n this.sprogram = this.gl.createProgram();\n this.gl.attachShader(this.sprogram, vertexShader);\n this.gl.attachShader(this.sprogram, fragmentShader);\n this.gl.linkProgram(this.sprogram);\n\n if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS))\n alert('Could not initialise shaders');\n\n this.gl.useProgram(this.sprogram);\n this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, 'aVertexPosition');\n this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, 'aTextureCoord');\n this.gl.enableVertexAttribArray(this.sprogram.tca);\n this.gl.enableVertexAttribArray(this.sprogram.vpa);\n\n this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, 'tMat');\n this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, 'uSampler');\n this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, 'useTexture');\n this.sprogram.color = this.gl.getUniformLocation(this.sprogram, 'uColor');\n this.gl.uniform1i(this.sprogram.useTex, 1);\n };\n\n initBuffers() {\n const vs = [0, 3, 1, 0, 2, 3];\n let idx;\n\n this.unitIBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vs), this.gl.STATIC_DRAW);\n\n let i;\n let ids = [];\n for (i = 0; i < 100; i++) ids.push(i);\n idx = new Uint16Array(ids);\n\n this.unitI33 = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitI33);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n\n ids = [];\n for (i = 0; i < 100; i++) ids.push(i, i + 1, i + 2);\n idx = new Uint16Array(ids);\n\n this.stripBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.stripBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n };\n\n createCircle(raidus) {\n this.circleCanvasRadius = WebGLUtil.nhpot(Util.initValue(raidus, 32));\n const canvas = DomUtil.createCanvas('circle_canvas', this.circleCanvasRadius * 2, this.circleCanvasRadius * 2);\n const context = canvas.getContext('2d');\n\n context.beginPath();\n context.arc(this.circleCanvasRadius, this.circleCanvasRadius, this.circleCanvasRadius, 0, Math.PI * 2, true);\n context.closePath();\n context.fillStyle = '#FFF';\n context.fill();\n\n return canvas.toDataURL();\n };\n\n drawImg2Canvas(particle) {\n const _w = particle.body.width;\n const _h = particle.body.height;\n\n const _width = WebGLUtil.nhpot(particle.body.width);\n const _height = WebGLUtil.nhpot(particle.body.height);\n\n const _scaleX = particle.body.width / _width;\n const _scaleY = particle.body.height / _height;\n\n if (!this.texturebuffers[particle.data.src])\n this.texturebuffers[particle.data.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()];\n\n particle.data.texture = this.texturebuffers[particle.data.src][0];\n particle.data.vcBuffer = this.texturebuffers[particle.data.src][1];\n particle.data.tcBuffer = this.texturebuffers[particle.data.src][2];\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _scaleX, 0.0, 0.0, _scaleY, _scaleY, _scaleY]), this.gl.STATIC_DRAW);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _w, 0.0, 0.0, _h, _w, _h]), this.gl.STATIC_DRAW);\n\n const context = particle.data.canvas.getContext('2d');\n const data = context.getImageData(0, 0, _width, _height);\n\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture);\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, data);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_NEAREST);\n this.gl.generateMipmap(this.gl.TEXTURE_2D);\n\n particle.data.textureLoaded = true;\n particle.data.textureWidth = _w;\n particle.data.textureHeight = _h;\n }\n\n onProtonUpdate() {\n // this.gl.clearColor(0, 0, 0, 1);\n // this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\n }\n\n onParticleCreated(particle) {\n particle.data.textureLoaded = false;\n particle.data.tmat = Mat3.create();\n particle.data.tmat[8] = 1;\n particle.data.imat = Mat3.create();\n particle.data.imat[8] = 1;\n\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n ImgUtil.getImgFromCache(this.circleCanvasURL, this.addImg2Body, particle);\n particle.data.oldScale = particle.radius / this.circleCanvasRadius;\n }\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = img;\n particle.data.src = img.src;\n particle.data.canvas = ImgUtil.getCanvasFromCache(img);\n particle.data.oldScale = 1;\n\n this.drawImg2Canvas(particle);\n }\n\n onParticleUpdate(particle) {\n if (particle.data.textureLoaded) {\n this.updateMatrix(particle);\n\n this.gl.uniform3f(this.sprogram.color, particle.rgb.r / 255, particle.rgb.g / 255, particle.rgb.b / 255);\n this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top());\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture);\n this.gl.uniform1i(this.sprogram.samplerUniform, 0);\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n\n this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0);\n\n this.mstack.pop();\n }\n }\n\n onParticleDead(particle) { }\n\n updateMatrix(particle) {\n const moveOriginMatrix = WebGLUtil.makeTranslation(-particle.data.textureWidth / 2, -particle.data.textureHeight / 2);\n const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y);\n\n const angel = particle.rotation * (MathUtil.PI_180);\n const rotationMatrix = WebGLUtil.makeRotation(angel);\n\n const scale = particle.scale * particle.data.oldScale;\n const scaleMatrix = WebGLUtil.makeScale(scale, scale);\n let matrix = WebGLUtil.matrixMultiply(moveOriginMatrix, scaleMatrix);\n\n matrix = WebGLUtil.matrixMultiply(matrix, rotationMatrix);\n matrix = WebGLUtil.matrixMultiply(matrix, translationMatrix);\n\n Mat3.inverse(matrix, particle.data.imat);\n matrix[2] = particle.alpha;\n\n this.mstack.push(matrix);\n }\n}","import BaseRenderer from \"./BaseRenderer\";\n\nexport default class CustomRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.name = \"CustomRenderer\";\n }\n}\n","import Zone from \"./Zone\";\nimport Util from \"../utils/Util\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class LineZone extends Zone {\n constructor(x1, y1, x2, y2, direction) {\n super();\n\n if (x2 - x1 >= 0) {\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n } else {\n this.x1 = x2;\n this.y1 = y2;\n this.x2 = x1;\n this.y2 = y1;\n }\n\n this.dx = this.x2 - this.x1;\n this.dy = this.y2 - this.y1;\n\n this.minx = Math.min(this.x1, this.x2);\n this.miny = Math.min(this.y1, this.y2);\n this.maxx = Math.max(this.x1, this.x2);\n this.maxy = Math.max(this.y1, this.y2);\n\n this.dot = this.x2 * this.y1 - this.x1 * this.y2;\n this.xxyy = this.dx * this.dx + this.dy * this.dy;\n\n this.gradient = this.getGradient();\n this.length = this.getLength();\n this.direction = Util.initValue(direction, \">\");\n }\n\n getPosition() {\n this.random = Math.random();\n\n this.vector.x =\n this.x1 + this.random * this.length * Math.cos(this.gradient);\n this.vector.y =\n this.y1 + this.random * this.length * Math.sin(this.gradient);\n\n return this.vector;\n }\n\n getDirection(x, y) {\n const A = this.dy;\n const B = -this.dx;\n const C = this.dot;\n const D = B === 0 ? 1 : B;\n\n if ((A * x + B * y + C) * D > 0) return true;\n else return false;\n }\n\n getDistance(x, y) {\n const A = this.dy;\n const B = -this.dx;\n const C = this.dot;\n const D = A * x + B * y + C;\n\n return D / Math.sqrt(this.xxyy);\n }\n\n getSymmetric(v) {\n const tha2 = v.getGradient();\n const tha1 = this.getGradient();\n const tha = 2 * (tha1 - tha2);\n\n const oldx = v.x;\n const oldy = v.y;\n\n v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n\n return v;\n }\n\n getGradient() {\n return Math.atan2(this.dy, this.dx);\n }\n\n rangeOut(particle) {\n const angle = Math.abs(this.getGradient());\n\n if (angle <= MathUtil.PI / 4) {\n if (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true;\n } else {\n if (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true;\n }\n\n return false;\n }\n\n getLength() {\n return Math.sqrt(this.dx * this.dx + this.dy * this.dy);\n }\n\n crossing(particle) {\n if (this.crossType === \"dead\") {\n if (\n this.direction === \">\" ||\n this.direction === \"R\" ||\n this.direction === \"right\" ||\n this.direction === \"down\"\n ) {\n if (!this.rangeOut(particle)) return;\n if (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n } else {\n if (!this.rangeOut(particle)) return;\n if (!this.getDirection(particle.p.x, particle.p.y))\n particle.dead = true;\n }\n } else if (this.crossType === \"bound\") {\n if (!this.rangeOut(particle)) return;\n\n if (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) {\n if (this.dx === 0) {\n particle.v.x *= -1;\n } else if (this.dy === 0) {\n particle.v.y *= -1;\n } else {\n this.getSymmetric(particle.v);\n }\n }\n } else if (this.crossType === \"cross\") {\n if (this.alert) {\n console.error(\"Sorry, LineZone does not support cross method!\");\n this.alert = false;\n }\n }\n }\n}\n","import Zone from \"./Zone\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class CircleZone extends Zone {\n constructor(x, y, radius) {\n super();\n\n this.x = x;\n this.y = y;\n this.radius = radius;\n\n this.angle = 0;\n this.center = { x, y };\n }\n\n getPosition() {\n this.angle = MathUtil.PIx2 * Math.random();\n this.randomRadius = Math.random() * this.radius;\n\n this.vector.x = this.x + this.randomRadius * Math.cos(this.angle);\n this.vector.y = this.y + this.randomRadius * Math.sin(this.angle);\n\n return this.vector;\n }\n\n setCenter(x, y) {\n this.center.x = x;\n this.center.y = y;\n }\n\n crossing(particle) {\n const d = particle.p.distanceTo(this.center);\n\n if (this.crossType === \"dead\") {\n if (d - particle.radius > this.radius) particle.dead = true;\n } else if (this.crossType === \"bound\") {\n if (d + particle.radius >= this.radius) this.getSymmetric(particle);\n } else if (this.crossType === \"cross\") {\n if (this.alert) {\n console.error(\"Sorry, CircleZone does not support cross method!\");\n this.alert = false;\n }\n }\n }\n\n getSymmetric(particle) {\n let tha2 = particle.v.getGradient();\n let tha1 = this.getGradient(particle);\n\n let tha = 2 * (tha1 - tha2);\n let oldx = particle.v.x;\n let oldy = particle.v.y;\n\n particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n }\n\n getGradient(particle) {\n return (\n -MathUtil.PI_2 +\n Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x)\n );\n }\n}\n","import Zone from \"./Zone\";\n\nexport default class RectZone extends Zone {\n constructor(x, y, width, height) {\n super();\n\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n\n getPosition() {\n this.vector.x = this.x + Math.random() * this.width;\n this.vector.y = this.y + Math.random() * this.height;\n\n return this.vector;\n }\n\n crossing(particle) {\n // particle dead zone\n if (this.crossType === \"dead\") {\n if (particle.p.x + particle.radius < this.x) particle.dead = true;\n else if (particle.p.x - particle.radius > this.x + this.width)\n particle.dead = true;\n\n if (particle.p.y + particle.radius < this.y) particle.dead = true;\n else if (particle.p.y - particle.radius > this.y + this.height)\n particle.dead = true;\n }\n\n // particle bound zone\n else if (this.crossType === \"bound\") {\n if (particle.p.x - particle.radius < this.x) {\n particle.p.x = this.x + particle.radius;\n particle.v.x *= -1;\n } else if (particle.p.x + particle.radius > this.x + this.width) {\n particle.p.x = this.x + this.width - particle.radius;\n particle.v.x *= -1;\n }\n\n if (particle.p.y - particle.radius < this.y) {\n particle.p.y = this.y + particle.radius;\n particle.v.y *= -1;\n } else if (particle.p.y + particle.radius > this.y + this.height) {\n particle.p.y = this.y + this.height - particle.radius;\n particle.v.y *= -1;\n }\n }\n\n // particle cross zone\n else if (this.crossType === \"cross\") {\n if (particle.p.x + particle.radius < this.x && particle.v.x <= 0)\n particle.p.x = this.x + this.width + particle.radius;\n else if (\n particle.p.x - particle.radius > this.x + this.width &&\n particle.v.x >= 0\n )\n particle.p.x = this.x - particle.radius;\n\n if (particle.p.y + particle.radius < this.y && particle.v.y <= 0)\n particle.p.y = this.y + this.height + particle.radius;\n else if (\n particle.p.y - particle.radius > this.y + this.height &&\n particle.v.y >= 0\n )\n particle.p.y = this.y - particle.radius;\n }\n }\n}\n","import Zone from \"./Zone\";\nimport Util from \"../utils/Util\";\n\nexport default class ImageZone extends Zone {\n constructor(imageData, x, y, d) {\n super();\n\n this.reset(imageData, x, y, d);\n }\n\n reset(imageData, x, y, d) {\n this.imageData = imageData;\n this.x = Util.initValue(x, 0);\n this.y = Util.initValue(y, 0);\n this.d = Util.initValue(d, 2);\n\n this.vectors = [];\n this.setVectors();\n }\n\n setVectors() {\n let i, j;\n const length1 = this.imageData.width;\n const length2 = this.imageData.height;\n\n for (i = 0; i < length1; i += this.d) {\n for (j = 0; j < length2; j += this.d) {\n let index = ((j >> 0) * length1 + (i >> 0)) * 4;\n\n if (this.imageData.data[index + 3] > 0) {\n this.vectors.push({ x: i + this.x, y: j + this.y });\n }\n }\n }\n\n return this.vector;\n }\n\n getBound(x, y) {\n var index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n if (this.imageData.data[index + 3] > 0) return true;\n else return false;\n }\n\n getPosition() {\n const vector = Util.getRandFromArray(this.vectors);\n return this.vector.copy(vector);\n }\n\n getColor(x, y) {\n x -= this.x;\n y -= this.y;\n var i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\n return {\n r: this.imageData.data[i],\n g: this.imageData.data[i + 1],\n b: this.imageData.data[i + 2],\n a: this.imageData.data[i + 3]\n };\n }\n\n crossing(particle) {\n if (this.crossType === \"dead\") {\n if (this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n particle.dead = true;\n else particle.dead = false;\n } else if (this.crossType === \"bound\") {\n if (!this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n particle.v.negate();\n }\n }\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport CircleZone from \"../zone/CircleZone\";\nimport PointZone from \"../zone/PointZone\";\nimport LineZone from \"../zone/LineZone\";\nimport RectZone from \"../zone/RectZone\";\n\nexport default {\n addEventListener(proton, func) {\n proton.addEventListener(\"PROTON_UPDATE_AFTER\", () => func());\n },\n\n getStyle(color = \"#ff0000\") {\n const rgb = ColorUtil.hexToRgb(color);\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`;\n },\n\n drawZone(proton, canvas, zone, clear) {\n const context = canvas.getContext(\"2d\");\n const style = this.getStyle();\n\n this.addEventListener(proton, () => {\n if (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n if (zone instanceof PointZone) {\n context.beginPath();\n context.fillStyle = style;\n context.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true);\n context.fill();\n context.closePath();\n } else if (zone instanceof LineZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.moveTo(zone.x1, zone.y1);\n context.lineTo(zone.x2, zone.y2);\n context.stroke();\n context.closePath();\n } else if (zone instanceof RectZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.drawRect(zone.x, zone.y, zone.width, zone.height);\n context.stroke();\n context.closePath();\n } else if (zone instanceof CircleZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true);\n context.stroke();\n context.closePath();\n }\n });\n },\n\n drawEmitter(proton, canvas, emitter, clear) {\n const context = canvas.getContext(\"2d\");\n const style = this.getStyle();\n\n this.addEventListener(proton, () => {\n if (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n context.beginPath();\n context.fillStyle = style;\n context.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true);\n context.fill();\n context.closePath();\n });\n }\n};\n","import Proton from \"./core/Proton\";\nimport Particle from \"./core/Particle\";\nimport Pool from \"./core/Pool\";\n\nimport Util from \"./utils/Util\";\nimport ColorUtil from \"./utils/ColorUtil\";\nimport MathUtil from \"./math/MathUtil\";\nimport Vector2D from \"./math/Vector2D\";\nimport Polar2D from \"./math/Polar2D\";\nimport Mat3 from \"./math/Mat3\";\nimport Span from \"./math/Span\";\nimport ArraySpan from \"./math/ArraySpan\";\nimport Rectangle from \"./math/Rectangle\";\nimport ease from \"./math/ease\";\n\nimport Rate from \"./initialize/Rate\";\nimport Initialize from \"./initialize/Initialize\";\nimport Life from \"./initialize/Life\";\nimport Position from \"./initialize/Position\";\nimport Velocity from \"./initialize/Velocity\";\nimport Mass from \"./initialize/Mass\";\nimport Radius from \"./initialize/Radius\";\nimport Body from \"./initialize/Body\";\n\nimport Behaviour from \"./behaviour/Behaviour\";\nimport Force from \"./behaviour/Force\";\nimport Attraction from \"./behaviour/Attraction\";\nimport RandomDrift from \"./behaviour/RandomDrift\";\nimport Gravity from \"./behaviour/Gravity\";\nimport Collision from \"./behaviour/Collision\";\nimport CrossZone from \"./behaviour/CrossZone\";\nimport Alpha from \"./behaviour/Alpha\";\nimport Scale from \"./behaviour/Scale\";\nimport Rotate from \"./behaviour/Rotate\";\nimport Color from \"./behaviour/Color\";\nimport Cyclone from \"./behaviour/Cyclone\";\nimport Repulsion from \"./behaviour/Repulsion\";\nimport GravityWell from \"./behaviour/GravityWell\";\n\nimport Emitter from \"./emitter/Emitter\";\nimport BehaviourEmitter from \"./emitter/BehaviourEmitter\";\nimport FollowEmitter from \"./emitter/FollowEmitter\";\n\nimport CanvasRenderer from \"./render/CanvasRenderer\";\nimport DomRenderer from \"./render/DomRenderer\";\nimport EaselRenderer from \"./render/EaselRenderer\";\nimport PixelRenderer from \"./render/PixelRenderer\";\nimport PixiRenderer from \"./render/PixiRenderer\";\nimport WebGLRenderer from \"./render/WebGLRenderer\";\nimport CustomRenderer from \"./render/CustomRenderer\";\n\nimport Zone from \"./zone/Zone\";\nimport LineZone from \"./zone/LineZone\";\nimport CircleZone from \"./zone/CircleZone\";\nimport PointZone from \"./zone/PointZone\";\nimport RectZone from \"./zone/RectZone\";\nimport ImageZone from \"./zone/ImageZone\";\n\nimport Debug from \"./debug/Debug\";\n\n// namespace\nProton.Particle = Proton.P = Particle;\nProton.Pool = Pool;\n\nProton.Util = Util;\nProton.ColorUtil = ColorUtil;\nProton.MathUtil = MathUtil;\nProton.Vector2D = Proton.Vector = Vector2D;\nProton.Polar2D = Proton.Polar = Polar2D;\nProton.ArraySpan = ArraySpan;\nProton.Rectangle = Rectangle;\nProton.Rate = Rate;\nProton.ease = ease;\nProton.Span = Span;\nProton.Mat3 = Mat3;\nProton.getSpan = (a, b, center) => new Span(a, b, center);\nProton.createArraySpan = ArraySpan.createArraySpan;\n\nProton.Initialize = Proton.Init = Initialize;\nProton.Life = Proton.L = Life;\nProton.Position = Proton.P = Position;\nProton.Velocity = Proton.V = Velocity;\nProton.Mass = Proton.M = Mass;\nProton.Radius = Proton.R = Radius;\nProton.Body = Proton.B = Body;\n\nProton.Behaviour = Behaviour;\nProton.Force = Proton.F = Force;\nProton.Attraction = Proton.A = Attraction;\nProton.RandomDrift = Proton.RD = RandomDrift;\nProton.Gravity = Proton.G = Gravity;\nProton.Collision = Collision;\nProton.CrossZone = CrossZone;\nProton.Alpha = Proton.A = Alpha;\nProton.Scale = Proton.S = Scale;\nProton.Rotate = Rotate;\nProton.Color = Color;\nProton.Repulsion = Repulsion;\nProton.Cyclone = Cyclone;\nProton.GravityWell = GravityWell;\n\nProton.Emitter = Emitter;\nProton.BehaviourEmitter = BehaviourEmitter;\nProton.FollowEmitter = FollowEmitter;\n\nProton.Zone = Zone;\nProton.LineZone = LineZone;\nProton.CircleZone = CircleZone;\nProton.PointZone = PointZone;\nProton.RectZone = RectZone;\nProton.ImageZone = ImageZone;\n\nProton.CanvasRenderer = CanvasRenderer;\nProton.DomRenderer = DomRenderer;\nProton.EaselRenderer = EaselRenderer;\nProton.PixiRenderer = PixiRenderer;\nProton.PixelRenderer = PixelRenderer;\nProton.WebGLRenderer = Proton.WebGlRenderer = WebGLRenderer;\nProton.CustomRenderer = CustomRenderer;\n\nProton.Debug = Debug;\nUtil.assign(Proton, ease);\n\n// export\nexport default Proton;\n"],"names":["PI","MathUtil","num","this","Infinity","a","b","Math","floor","random","center","f","isInt","randomAToB","toString","slice","k","digits","pow","Span","isArray","Util","getRandFromArray","randomFloating","c","undefined","pan","getValue","initValue","length","i","tx","ty","angleInRadians","cos","s","sin","sx","sy","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b01","b02","b10","b11","b12","b20","b21","b22","id","width","height","position","dom","document","createElement","style","opacity","transform","resize","marginLeft","marginTop","div","x","y","scale","rotate","willChange","css3","key","val","bkey","charAt","toUpperCase","substr","imgsCache","canvasCache","canvasId","context","image","rect","drawImage","imagedata","getImageData","clearRect","img","callback","param","src","Image","onload","e","target","WebGLUtil","canvas","DomUtil","createCanvas","getContext","value","defaults","Object","prototype","call","arr","obj","ignore","indexOf","constructor","args","bind","apply","concat","particle","conf","hasProp","p","v","copy","props","prop","hasOwnProperty","getSpanValue","ImgUtil","destroy","source","assign","idsMap","Puid","type","uid","getIdFromCache","_index","_cache","isBody","isInner","Pool","params","__puid","getId","cache","pop","createOrClone","getCache","push","total","create","classApply","clone","count","Stats","body","add","emitter","getEmitter","renderer","getRenderer","str","proton","emitters","emitSpeed","getEmitterPos","initializes","concatArr","behaviours","name","getCreatedNumber","getCount","pool","container","innerHTML","cssText","join","addEventListener","_this","bg","color","parentNode","appendChild","emitterIndex","renderers","rendererIndex","result","cpool","round","EventDispatcher","listener","_listeners","removeEventListener","splice","listeners","handler","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","sleep","old","multiplyScalar","mass","clear","Proton","render","init","index","remove","parent","EMITTER_ADDED","EMITTER_REMOVED","_fps","PROTON_UPDATE","USE_CLOCK","then","Date","getTime","now","elapsed","amendChangeTabsBug","emittersUpdate","DEFAULT_INTERVAL","PROTON_UPDATE_AFTER","_interval","update","destroyAll","destroyOther","getAllParticles","fps","integrationType","stats","EULER","integrator","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","Rgb","r","g","PI_2","sqrt","ease","easeLinear","Vector2D","atan2","w","addVectors","subVectors","set","divideScalar","distanceToSquared","tha","dx","dy","alpha","Particle","N180_PI","life","age","dead","sprite","energy","radius","rotation","easing","rgb","reset","emptyObject","data","removeAllBehaviours","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","emptyArray","setProp","h","hex16","substring","parseInt","rbg","Number","Polar2D","getX","getY","abs","Mat3","mat3","mat","Float32Array","mat1","mat2","m","vec","ArraySpan","_arr","randomColor","toArray","Rectangle","right","bottom","Rate","startTime","nextTime","timePan","numPan","numpan","timepan","setSpanValue","Initialize","Life","lifePan","Zone","vector","crossType","alert","PointZone","error","Position","zone","getPosition","Velocity","rpan","thapan","rPan","thaPan","vr","polar2d","normalizeVelocity","PI_180","Mass","massPan","Radius","oldRadius","Body","imageTarget","Behaviour","getEasing","force","removeBehaviour","Force","fx","fy","normalizeForce","calculate","Attraction","targetPosition","normalizeValue","radiusSq","attractionForce","lengthSq","sub","normalize","RandomDrift","driftX","driftY","delay","panFoce","addXY","Gravity","Collision","collisionPool","delta","newPool","otherParticle","overlap","totalMass","averageMass1","averageMass2","distance","CrossZone","crossing","Alpha","same","alphaA","alphaB","Scale","scaleA","scaleB","Rotate","rotationA","rotationB","getDirection","influence","Color","createArraySpan","colorA","ColorUtil","hexToRgb","colorB","CHANGING","Cyclone","angle","span","String","toLowerCase","setAngleAndForce","cangle","cyclone","gradient","getGradient","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVectorVal","degreeTransform","Emitter","totalTime","stoped","emitTime","isNaN","rate","oldStoped","oldEmitTime","oldTotalTime","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mousemoveHandler","_this2","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","mouseTarget","_allowEmitting","layerX","layerY","offsetX","offsetY","babelHelpers.get","window","initEventHandler","BaseRenderer","thinkness","stroke","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","element","circleConf","isCircle","initHandler","CanvasRenderer","addImg2Body","drawCircle","buffer","createBuffer","bufContext","globalAlpha","globalCompositeOperation","fillStyle","rgbToHex","fillRect","save","translate","restore","beginPath","arc","strokeStyle","lineWidth","closePath","fill","size","bufferCache","DomRenderer","bodyReady","transform3d","backgroundColor","removeChild","babelHelpers.typeof","createCircle","createSprite","createDiv","borderRadius","borderColor","borderWidth","url","backgroundImage","createBody","EaselRenderer","addChild","scaleX","scaleY","graphics","regX","regY","createjs","Graphics","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","PIXIClass","PixiRenderer","PIXI","Sprite","createFromImage","from","fromImage","blendMode","setColor","tint","getHex16FromParticle","anchor","endFill","setPIXI","MStack","mats","multiply","WebGLRenderer","umat","smat","mstack","gl","viewport","circleCanvasURL","texturebuffers","A","blendEquation","B","blendFunc","fs","shader","createShader","FRAGMENT_SHADER","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","fragmentShader","getShader","getFragmentShader","vertexShader","getVertexShader","sprogram","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","useProgram","vpa","getAttribLocation","tca","enableVertexAttribArray","tMatUniform","getUniformLocation","samplerUniform","useTex","uniform1i","idx","unitIBuffer","bindBuffer","ELEMENT_ARRAY_BUFFER","bufferData","Uint16Array","STATIC_DRAW","ids","unitI33","stripBuffer","raidus","circleCanvasRadius","toDataURL","_w","_h","_width","_height","_scaleX","_scaleY","createTexture","texture","vcBuffer","tcBuffer","ARRAY_BUFFER","bindTexture","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","LINEAR_MIPMAP_NEAREST","generateMipmap","textureLoaded","textureWidth","textureHeight","tmat","imat","oldScale","drawImg2Canvas","updateMatrix","uniform3f","uniformMatrix3fv","top","vertexAttribPointer","FLOAT","drawElements","TRIANGLES","UNSIGNED_SHORT","moveOriginMatrix","translationMatrix","angel","rotationMatrix","scaleMatrix","matrix","inverse","antialias","stencil","depth","initVar","setMaxRadius","initShaders","initBuffers","FUNC_ADD","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","enable","BLEND","CustomRenderer","LineZone","x1","y1","dot","xxyy","tha2","oldx","oldy","maxx","minx","maxy","miny","direction","rangeOut","getDistance","getSymmetric","x2","y2","min","getLength","CircleZone","PIx2","randomRadius","d","distanceTo","RectZone","ImageZone","vectors","setVectors","j","length1","length2","getBound","negate","func","getStyle","moveTo","lineTo","drawRect","P","Vector","Polar","getSpan","Init","L","V","M","R","F","RD","G","S","WebGlRenderer","Debug"],"mappings":";;;;;;;;;gRAAA,IAAMA,EAAK,UAGLC,EAAW,IACXD,OACO,EAALA,OACAA,EAAK,SACHA,EAAK,YACJ,IAAMA,YACJ,wBAEAE,UACFA,IAAQC,KAAKC,UAAYF,IAXnBE,EAAAA,uBAcJC,EAAGC,8CAEAC,KAAKC,MAAMD,KAAKE,UAAYH,EAAID,IAAMA,EAD/BA,EAAIE,KAAKE,UAAYH,EAAID,4BAI/BK,EAAQC,EAAGC,UACjBT,KAAKU,WAA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AAIpY,GAC7B5H,EAAOqI,KAAOrI,EAAOigB,EAAI5X,GACzBrI,EAAOuI,OAASvI,EAAOkgB,EAAI3X,GAC3BvI,EAAOyI,KAAOzI,EAAO2W,EAAIlO,GAEzBzI,EAAO2I,UAAYA,GACnB3I,EAAO+I,MAAQ/I,EAAOmgB,EAAIpX,GAC1B/I,EAAOoJ,WAAapJ,EAAOyW,EAAIrN,GAC/BpJ,EAAO4J,YAAc5J,EAAOogB,GAAKxW,GACjC5J,EAAOkK,QAAUlK,EAAOqgB,EAAInW,GAC5BlK,EAAOmK,UAAYA,GACnBnK,EAAO6K,UAAYA,GACnB7K,EAAO+K,MAAQ/K,EAAOyW,EAAI1L,GAC1B/K,EAAOmL,MAAQnL,EAAOsgB,EAAInV,GAC1BnL,EAAOsL,OAASA,GAChBtL,EAAO2L,MAAQA,GACf3L,EAAO4M,UAAYA,GACnB5M,EAAOkM,QAAUA,GACjBlM,EAAO6M,YAAcA,GAErB7M,EAAOqN,QAAUA,GACjBrN,EAAO+O,iBAAmBA,GAC1B/O,EAAOiP,cAAgBA,GAEvBjP,EAAOmH,KAAOA,GACdnH,EAAOmd,SAAWA,GAClBnd,EAAOue,WAAaA,GACpBve,EAAOuH,UAAYA,GACnBvH,EAAO4e,SAAWA,GAClB5e,EAAO6e,UAAYA,GAEnB7e,EAAOuR,eAAiBA,GACxBvR,EAAO6S,YAAcA,GACrB7S,EAAO4T,cAAgBA,GACvB5T,EAAOiV,aAAeA,GACtBjV,EAAOyU,cAAgBA,GACvBzU,EAAOiW,cAAgBjW,EAAOugB,cAAgBtK,GAC9CjW,EAAOkd,eAAiBA,GAExBld,EAAOwgB,MAAQA,GACfvsB,EAAKgH,OAAO+E,EAAQyC"} \ No newline at end of file +{"version":3,"file":"proton.min.js","sources":["../src/math/MathUtil.js","../src/math/Span.js","../src/utils/WebGLUtil.js","../src/utils/DomUtil.js","../src/utils/ImgUtil.js","../src/utils/Util.js","../src/utils/Puid.js","../src/core/Pool.js","../src/debug/Stats.js","../src/events/EventDispatcher.js","../src/math/Integration.js","../src/core/Proton.js","../src/utils/Rgb.js","../src/math/ease.js","../src/math/Vector2D.js","../src/core/Particle.js","../src/utils/ColorUtil.js","../src/math/Polar2D.js","../src/math/Mat3.js","../src/math/ArraySpan.js","../src/math/Rectangle.js","../src/initialize/Rate.js","../src/initialize/Initialize.js","../src/initialize/Life.js","../src/zone/Zone.js","../src/zone/PointZone.js","../src/initialize/Position.js","../src/initialize/Velocity.js","../src/initialize/Mass.js","../src/initialize/Radius.js","../src/initialize/Body.js","../src/behaviour/Behaviour.js","../src/behaviour/Force.js","../src/behaviour/Attraction.js","../src/behaviour/RandomDrift.js","../src/behaviour/Gravity.js","../src/behaviour/Collision.js","../src/behaviour/CrossZone.js","../src/behaviour/Alpha.js","../src/behaviour/Scale.js","../src/behaviour/Rotate.js","../src/behaviour/Color.js","../src/behaviour/Cyclone.js","../src/behaviour/Repulsion.js","../src/behaviour/GravityWell.js","../src/initialize/InitializeUtil.js","../src/emitter/Emitter.js","../src/emitter/BehaviourEmitter.js","../src/emitter/FollowEmitter.js","../src/render/BaseRenderer.js","../src/render/CanvasRenderer.js","../src/render/DomRenderer.js","../src/render/EaselRenderer.js","../src/render/PixelRenderer.js","../src/render/PixiRenderer.js","../src/utils/MStack.js","../src/render/WebGLRenderer.js","../src/render/CustomRenderer.js","../src/zone/LineZone.js","../src/zone/CircleZone.js","../src/zone/RectZone.js","../src/zone/ImageZone.js","../src/debug/Debug.js","../src/index.js"],"sourcesContent":["const PI = 3.1415926;\nconst INFINITY = Infinity;\n\nconst MathUtil = {\n PI: PI,\n PIx2: PI * 2,\n PI_2: PI / 2,\n PI_180: PI / 180,\n N180_PI: 180 / PI,\n Infinity: -999,\n\n isInfinity(num) {\n return num === this.Infinity || num === INFINITY;\n },\n\n randomAToB(a, b, isInt = false) {\n if (!isInt) return a + Math.random() * (b - a);\n else return Math.floor(Math.random() * (b - a)) + a;\n },\n\n randomFloating(center, f, isInt) {\n return this.randomAToB(center - f, center + f, isInt);\n },\n\n randomColor() {\n return (\n \"#\" +\n (\"00000\" + ((Math.random() * 0x1000000) << 0).toString(16)).slice(-6)\n );\n },\n\n randomZone(display) {},\n\n floor(num, k = 4) {\n const digits = Math.pow(10, k);\n return Math.floor(num * digits) / digits;\n },\n\n degreeTransform(a) {\n return (a * PI) / 180;\n },\n\n toColor16(num) {\n return `#${num.toString(16)}`;\n }\n};\n\nexport default MathUtil;\n","import Util from \"../utils/Util\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Span {\n constructor(a, b, center) {\n if (Util.isArray(a)) {\n this.isArray = true;\n this.a = a;\n } else {\n this.isArray = false;\n this.a = Util.initValue(a, 1);\n this.b = Util.initValue(b, this.a);\n this.center = Util.initValue(center, false);\n }\n }\n\n getValue(isInt = false) {\n if (this.isArray) {\n return Util.getRandFromArray(this.a);\n } else {\n if (!this.center) {\n return MathUtil.randomAToB(this.a, this.b, isInt);\n } else {\n return MathUtil.randomFloating(this.a, this.b, isInt);\n }\n }\n }\n\n /**\n * Returns a new Span object\n *\n * @memberof Proton#Proton.Util\n * @method setSpanValue\n *\n * @todo a, b and c should be 'Mixed' or 'Number'?\n *\n * @param {Mixed | Span} a\n * @param {Mixed} b\n * @param {Mixed} c\n *\n * @return {Span}\n */\n static setSpanValue(a, b, c) {\n if (a instanceof Span) {\n return a;\n } else {\n if (b === undefined) {\n return new Span(a);\n } else {\n if (c === undefined) return new Span(a, b);\n else return new Span(a, b, c);\n }\n }\n }\n\n /**\n * Returns the value from a Span, if the param is not a Span it will return the given parameter\n *\n * @memberof Proton#Proton.Util\n * @method getValue\n *\n * @param {Mixed | Span} pan\n *\n * @return {Mixed} the value of Span OR the parameter if it is not a Span\n */\n static getSpanValue(pan) {\n return pan instanceof Span ? pan.getValue() : pan;\n }\n}\n","export default {\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method ipot\n *\n * @todo add description\n * @todo add length description\n *\n * @param {Number} length\n *\n * @return {Boolean}\n */\n ipot(length) {\n return (length & (length - 1)) === 0;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method nhpot\n *\n * @todo add description\n * @todo add length description\n *\n * @param {Number} length\n *\n * @return {Number}\n */\n nhpot(length) {\n --length;\n for (let i = 1; i < 32; i <<= 1) {\n length = length | (length >> i);\n }\n\n return length + 1;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeTranslation\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} tx either 0 or 1\n * @param {Number} ty either 0 or 1\n *\n * @return {Object}\n */\n makeTranslation(tx, ty) {\n return [1, 0, 0, 0, 1, 0, tx, ty, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeRotation\n *\n * @todo add description\n * @todo add return description\n *\n * @param {Number} angleInRadians\n *\n * @return {Object}\n */\n makeRotation(angleInRadians) {\n let c = Math.cos(angleInRadians);\n let s = Math.sin(angleInRadians);\n\n return [c, -s, 0, s, c, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeScale\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} sx either 0 or 1\n * @param {Number} sy either 0 or 1\n *\n * @return {Object}\n */\n makeScale(sx, sy) {\n return [sx, 0, 0, 0, sy, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method matrixMultiply\n *\n * @todo add description\n * @todo add a, b description\n * @todo add return description\n *\n * @param {Object} a\n * @param {Object} b\n *\n * @return {Object}\n */\n matrixMultiply(a, b) {\n let a00 = a[0 * 3 + 0];\n let a01 = a[0 * 3 + 1];\n let a02 = a[0 * 3 + 2];\n let a10 = a[1 * 3 + 0];\n let a11 = a[1 * 3 + 1];\n let a12 = a[1 * 3 + 2];\n let a20 = a[2 * 3 + 0];\n let a21 = a[2 * 3 + 1];\n let a22 = a[2 * 3 + 2];\n let b00 = b[0 * 3 + 0];\n let b01 = b[0 * 3 + 1];\n let b02 = b[0 * 3 + 2];\n let b10 = b[1 * 3 + 0];\n let b11 = b[1 * 3 + 1];\n let b12 = b[1 * 3 + 2];\n let b20 = b[2 * 3 + 0];\n let b21 = b[2 * 3 + 1];\n let b22 = b[2 * 3 + 2];\n\n return [\n a00 * b00 + a01 * b10 + a02 * b20,\n a00 * b01 + a01 * b11 + a02 * b21,\n a00 * b02 + a01 * b12 + a02 * b22,\n a10 * b00 + a11 * b10 + a12 * b20,\n a10 * b01 + a11 * b11 + a12 * b21,\n a10 * b02 + a11 * b12 + a12 * b22,\n a20 * b00 + a21 * b10 + a22 * b20,\n a20 * b01 + a21 * b11 + a22 * b21,\n a20 * b02 + a21 * b12 + a22 * b22\n ];\n }\n};\n","export default {\n /**\n * Creates and returns a new canvas. The opacity is by default set to 0\n *\n * @memberof Proton#Proton.DomUtil\n * @method createCanvas\n *\n * @param {String} $id the canvas' id\n * @param {Number} $width the canvas' width\n * @param {Number} $height the canvas' height\n * @param {String} [$position=absolute] the canvas' position, default is 'absolute'\n *\n * @return {Object}\n */\n createCanvas(id, width, height, position = \"absolute\") {\n const dom = document.createElement(\"canvas\");\n\n dom.id = id;\n dom.width = width;\n dom.height = height;\n dom.style.opacity = 0;\n dom.style.position = position;\n this.transform(dom, -500, -500, 0, 0);\n\n return dom;\n },\n\n createDiv(id, width, height) {\n const dom = document.createElement(\"div\");\n\n dom.id = id;\n dom.style.position = \"absolute\";\n this.resize(dom, width, height);\n\n return dom;\n },\n\n resize(dom, width, height) {\n dom.style.width = width + \"px\";\n dom.style.height = height + \"px\";\n dom.style.marginLeft = -width / 2 + \"px\";\n dom.style.marginTop = -height / 2 + \"px\";\n },\n\n /**\n * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers\n *\n * @memberof Proton#Proton.DomUtil\n * @method transform\n *\n * @param {HTMLDivElement} div\n * @param {Number} $x\n * @param {Number} $y\n * @param {Number} $scale\n * @param {Number} $rotate\n */\n transform(div, x, y, scale, rotate) {\n div.style.willChange = \"transform\";\n const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`;\n this.css3(div, \"transform\", transform);\n },\n\n transform3d(div, x, y, scale, rotate) {\n div.style.willChange = \"transform\";\n const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;\n this.css3(div, \"backfaceVisibility\", \"hidden\");\n this.css3(div, \"transform\", transform);\n },\n\n css3(div, key, val) {\n const bkey = key.charAt(0).toUpperCase() + key.substr(1);\n\n div.style[`Webkit${bkey}`] = val;\n div.style[`Moz${bkey}`] = val;\n div.style[`O${bkey}`] = val;\n div.style[`ms${bkey}`] = val;\n div.style[`${key}`] = val;\n }\n};\n","import WebGLUtil from \"./WebGLUtil\";\nimport DomUtil from \"./DomUtil\";\n\nconst imgsCache = {};\nconst canvasCache = {};\nlet canvasId = 0;\n\nexport default {\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n context.drawImage(image, rect.x, rect.y);\n const imagedata = context.getImageData(\n rect.x,\n rect.y,\n rect.width,\n rect.height\n );\n context.clearRect(rect.x, rect.y, rect.width, rect.height);\n\n return imagedata;\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method getImgFromCache\n *\n * @todo add description\n * @todo describe func\n *\n * @param {Mixed} img\n * @param {Proton.Particle} particle\n * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.data.canvas\n * @param {Boolean} func\n */\n getImgFromCache(img, callback, param) {\n const src = typeof img === \"string\" ? img : img.src;\n\n if (imgsCache[src]) {\n callback(imgsCache[src], param);\n } else {\n const image = new Image();\n image.onload = e => {\n imgsCache[src] = e.target;\n callback(imgsCache[src], param);\n };\n\n image.src = src;\n }\n },\n\n getCanvasFromCache(img, callback, param) {\n const src = img.src;\n\n if (!canvasCache[src]) {\n const width = WebGLUtil.nhpot(img.width);\n const height = WebGLUtil.nhpot(img.height);\n\n const canvas = DomUtil.createCanvas(\n `proton_canvas_cache_${++canvasId}`,\n width,\n height\n );\n const context = canvas.getContext(\"2d\");\n context.drawImage(img, 0, 0, img.width, img.height);\n\n canvasCache[src] = canvas;\n }\n\n callback && callback(canvasCache[src], param);\n\n return canvasCache[src];\n }\n};\n","import Span from \"../math/Span\";\nimport ImgUtil from \"./ImgUtil\";\n\nexport default {\n /**\n * Returns the default if the value is null or undefined\n *\n * @memberof Proton#Proton.Util\n * @method initValue\n *\n * @param {Mixed} value a specific value, could be everything but null or undefined\n * @param {Mixed} defaults the default if the value is null or undefined\n */\n initValue(value, defaults) {\n value = value !== null && value !== undefined ? value : defaults;\n return value;\n },\n\n /**\n * Checks if the value is a valid array\n *\n * @memberof Proton#Proton.Util\n * @method isArray\n *\n * @param {Array} value Any array\n *\n * @returns {Boolean}\n */\n isArray(value) {\n return Object.prototype.toString.call(value) === \"[object Array]\";\n },\n\n /**\n * Destroyes the given array\n *\n * @memberof Proton#Proton.Util\n * @method emptyArray\n *\n * @param {Array} array Any array\n */\n emptyArray(arr) {\n if (arr) arr.length = 0;\n },\n\n toArray(arr) {\n return this.isArray(arr) ? arr : [arr];\n },\n\n getRandFromArray(arr) {\n if (!arr) return null;\n return arr[Math.floor(arr.length * Math.random())];\n },\n\n /**\n * Destroyes the given object\n *\n * @memberof Proton#Proton.Util\n * @method emptyObject\n *\n * @param {Object} obj Any object\n */\n emptyObject(obj, ignore = null) {\n for (let key in obj) {\n if (ignore && ignore.indexOf(key) > -1) continue;\n delete obj[key];\n }\n },\n\n /**\n * Makes an instance of a class and binds the given array\n *\n * @memberof Proton#Proton.Util\n * @method classApply\n *\n * @param {Function} constructor A class to make an instance from\n * @param {Array} [args] Any array to bind it to the constructor\n *\n * @return {Object} The instance of constructor, optionally bind with args\n */\n classApply(constructor, args = null) {\n if (!args) {\n return new constructor();\n } else {\n const FactoryFunc = constructor.bind.apply(\n constructor,\n [null].concat(args)\n );\n return new FactoryFunc();\n }\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method setVectorVal\n *\n * @todo add description for param `target`\n * @todo add description for param `conf`\n * @todo add description for function\n *\n * @param {Object} target\n * @param {Object} conf\n */\n setVectorVal(particle, conf = null) {\n if (!conf) return;\n\n if (this.hasProp(conf, \"x\")) particle.p.x = conf[\"x\"];\n if (this.hasProp(conf, \"y\")) particle.p.y = conf[\"y\"];\n\n if (this.hasProp(conf, \"vx\")) particle.v.x = conf[\"vx\"];\n if (this.hasProp(conf, \"vy\")) particle.v.y = conf[\"vy\"];\n\n if (this.hasProp(conf, \"ax\")) particle.a.x = conf[\"ax\"];\n if (this.hasProp(conf, \"ay\")) particle.a.y = conf[\"ay\"];\n\n if (this.hasProp(conf, \"p\")) particle.p.copy(conf[\"p\"]);\n if (this.hasProp(conf, \"v\")) particle.v.copy(conf[\"v\"]);\n if (this.hasProp(conf, \"a\")) particle.a.copy(conf[\"a\"]);\n\n if (this.hasProp(conf, \"position\")) particle.p.copy(conf[\"position\"]);\n if (this.hasProp(conf, \"velocity\")) particle.v.copy(conf[\"velocity\"]);\n if (this.hasProp(conf, \"accelerate\")) particle.a.copy(conf[\"accelerate\"]);\n },\n\n hasProp(target, key) {\n if (!target) return false;\n return target[key] !== undefined;\n // return obj.hasOwnProperty(key);\n },\n\n /**\n * set the prototype in a given prototypeObject\n *\n * @memberof Proton#Proton.Util\n * @method setProp\n *\n * @todo add description for param `target`\n * @todo translate desription from chinese to english\n *\n * @param {Object} target\n * @param {Object} prototypeObject An object of single prototypes\n *\n * @return {Object} target\n */\n setProp(target, props) {\n for (let prop in props) {\n if (target.hasOwnProperty(prop)) {\n target[prop] = Span.getSpanValue(props[prop]);\n }\n }\n\n return target;\n },\n\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n return ImgUtil.getImageData(context, image, rect);\n },\n\n destroyAll(arr, param = null) {\n let i = arr.length;\n\n while (i--) {\n try {\n arr[i].destroy(param);\n } catch (e) {}\n\n delete arr[i];\n }\n\n arr.length = 0;\n },\n\n assign(target, source) {\n if (typeof Object.assign !== \"function\") {\n for (let key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n\n return target;\n } else {\n return Object.assign(target, source);\n }\n }\n};\n","const idsMap = {};\n\nconst Puid = {\n _index: 0,\n _cache: {},\n\n id(type) {\n if (idsMap[type] === undefined || idsMap[type] === null) idsMap[type] = 0;\n return `${type}_${idsMap[type]++}`;\n },\n\n getId(target) {\n let uid = this.getIdFromCache(target);\n if (uid) return uid;\n\n uid = `PUID_${this._index++}`;\n this._cache[uid] = target;\n\n return uid;\n },\n\n getIdFromCache(target) {\n let obj, id;\n\n for (id in this._cache) {\n obj = this._cache[id];\n\n if (obj === target) return id;\n if (this.isBody(obj, target) && obj.src === target.src) return id;\n }\n\n return null;\n },\n\n isBody(obj, target) {\n return (\n typeof obj === \"object\" &&\n typeof target === \"object\" &&\n obj.isInner &&\n target.isInner\n );\n },\n\n getTarget(uid) {\n return this._cache[uid];\n }\n};\n\nexport default Puid;\n","/**\n * Pool is the cache pool of the proton engine, it is very important.\n *\n * get(target, params, uid)\n * Class\n * uid = Puid.getId -> Puid save target cache\n * target.__puid = uid\n *\n * body\n * uid = Puid.getId -> Puid save target cache\n *\n *\n * expire(target)\n * cache[target.__puid] push target\n *\n */\nimport Util from \"../utils/Util\";\nimport Puid from \"../utils/Puid\";\n\nexport default class Pool {\n /**\n * @memberof! Proton#\n * @constructor\n * @alias Proton.Pool\n *\n * @todo add description\n * @todo add description of properties\n *\n * @property {Number} total\n * @property {Object} cache\n */\n constructor(num) {\n this.total = 0;\n this.cache = {};\n }\n\n /**\n * @todo add description\n *\n * @method get\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n get(target, params, uid) {\n let p;\n uid = uid || target.__puid || Puid.getId(target);\n\n if (this.cache[uid] && this.cache[uid].length > 0) {\n p = this.cache[uid].pop();\n } else {\n p = this.createOrClone(target, params);\n }\n\n p.__puid = target.__puid || uid;\n return p;\n }\n\n /**\n * @todo add description\n *\n * @method set\n * @memberof Proton#Proton.Pool\n *\n * @param {Object} target\n *\n * @return {Object}\n */\n expire(target) {\n return this.getCache(target.__puid).push(target);\n }\n\n /**\n * Creates a new class instance\n *\n * @todo add more documentation\n *\n * @method create\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target any Object or Function\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n createOrClone(target, params) {\n this.total++;\n\n if (this.create) {\n return this.create(target, params);\n } else if (typeof target === \"function\") {\n return Util.classApply(target, params);\n } else {\n return target.clone();\n }\n }\n\n /**\n * @todo add description - what is in the cache?\n *\n * @method getCount\n * @memberof Proton#Proton.Pool\n *\n * @return {Number}\n */\n getCount() {\n let count = 0;\n for (let id in this.cache) count += this.cache[id].length;\n return count++;\n }\n\n /**\n * Destroyes all items from Pool.cache\n *\n * @method destroy\n * @memberof Proton#Proton.Pool\n */\n destroy() {\n for (let id in this.cache) {\n this.cache[id].length = 0;\n delete this.cache[id];\n }\n }\n\n /**\n * Returns Pool.cache\n *\n * @method getCache\n * @memberof Proton#Proton.Pool\n * @private\n *\n * @param {Number} uid the unique id\n *\n * @return {Object}\n */\n getCache(uid = \"default\") {\n if (!this.cache[uid]) this.cache[uid] = [];\n return this.cache[uid];\n }\n}\n","export default class Stats {\n constructor(proton) {\n this.proton = proton;\n this.container = null;\n this.type = 1;\n\n this.emitterIndex = 0;\n this.rendererIndex = 0;\n }\n\n update(style, body) {\n this.add(style, body);\n\n const emitter = this.getEmitter();\n const renderer = this.getRenderer();\n let str = \"\";\n\n switch (this.type) {\n case 2:\n str += \"emitter:\" + this.proton.emitters.length + \"
\";\n if (emitter) str += \"em speed:\" + emitter.emitSpeed + \"
\";\n if (emitter) str += \"pos:\" + this.getEmitterPos(emitter);\n break;\n\n case 3:\n if (emitter)\n str += \"initializes:\" + emitter.initializes.length + \"
\";\n if (emitter)\n str +=\n '' +\n this.concatArr(emitter.initializes) +\n \"
\";\n if (emitter) str += \"behaviours:\" + emitter.behaviours.length + \"
\";\n if (emitter)\n str +=\n '' +\n this.concatArr(emitter.behaviours) +\n \"
\";\n break;\n\n case 4:\n if (renderer) str += renderer.name + \"
\";\n if (renderer) str += \"body:\" + this.getCreatedNumber(renderer) + \"
\";\n break;\n\n default:\n str += \"particles:\" + this.proton.getCount() + \"
\";\n str += \"pool:\" + this.proton.pool.getCount() + \"
\";\n str += \"total:\" + this.proton.pool.total;\n }\n\n this.container.innerHTML = str;\n }\n\n add(style, body) {\n if (!this.container) {\n this.type = 1;\n\n this.container = document.createElement(\"div\");\n this.container.style.cssText = [\n \"position:absolute;bottom:0px;left:0;cursor:pointer;\",\n \"opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;\",\n \"width:120px;height:50px;background-color:#002;color:#0ff;\"\n ].join(\"\");\n\n this.container.addEventListener(\n \"click\",\n e => {\n this.type++;\n if (this.type > 4) this.type = 1;\n },\n false\n );\n\n let bg, color;\n switch (style) {\n case 2:\n bg = \"#201\";\n color = \"#f08\";\n break;\n\n case 3:\n bg = \"#020\";\n color = \"#0f0\";\n break;\n\n default:\n bg = \"#002\";\n color = \"#0ff\";\n }\n\n this.container.style[\"background-color\"] = bg;\n this.container.style[\"color\"] = color;\n }\n\n if (!this.container.parentNode) {\n body = body || this.body || document.body;\n body.appendChild(this.container);\n }\n }\n\n getEmitter() {\n return this.proton.emitters[this.emitterIndex];\n }\n\n getRenderer() {\n return this.proton.renderers[this.rendererIndex];\n }\n\n concatArr(arr) {\n let result = \"\";\n if (!arr || !arr.length) return result;\n\n for (let i = 0; i < arr.length; i++) {\n result += (arr[i].name || \"\").substr(0, 1) + \".\";\n }\n\n return result;\n }\n\n getCreatedNumber(renderer) {\n return renderer.pool.total || (renderer.cpool && renderer.cpool.total) || 0;\n }\n\n getEmitterPos(e) {\n return Math.round(e.p.x) + \",\" + Math.round(e.p.y);\n }\n}\n","/*\n * EventDispatcher\n * This code reference since http://createjs.com/.\n *\n **/\n\nexport default class EventDispatcher {\n constructor() {\n this._listeners = null;\n }\n\n static bind(target) {\n target.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent;\n\n target.prototype.hasEventListener =\n EventDispatcher.prototype.hasEventListener;\n\n target.prototype.addEventListener =\n EventDispatcher.prototype.addEventListener;\n\n target.prototype.removeEventListener =\n EventDispatcher.prototype.removeEventListener;\n\n target.prototype.removeAllEventListeners =\n EventDispatcher.prototype.removeAllEventListeners;\n }\n\n addEventListener(type, listener) {\n if (!this._listeners) {\n this._listeners = {};\n } else {\n this.removeEventListener(type, listener);\n }\n\n if (!this._listeners[type]) this._listeners[type] = [];\n this._listeners[type].push(listener);\n\n return listener;\n }\n\n removeEventListener(type, listener) {\n if (!this._listeners) return;\n if (!this._listeners[type]) return;\n\n const arr = this._listeners[type];\n const length = arr.length;\n\n for (let i = 0; i < length; i++) {\n if (arr[i] === listener) {\n if (length === 1) {\n delete this._listeners[type];\n }\n\n // allows for faster checks.\n else {\n arr.splice(i, 1);\n }\n\n break;\n }\n }\n }\n\n removeAllEventListeners(type) {\n if (!type) this._listeners = null;\n else if (this._listeners) delete this._listeners[type];\n }\n\n dispatchEvent(type, args) {\n let result = false;\n const listeners = this._listeners;\n\n if (type && listeners) {\n let arr = listeners[type];\n if (!arr) return result;\n\n // arr = arr.slice();\n // to avoid issues with items being removed or added during the dispatch\n\n let handler;\n let i = arr.length;\n while (i--) {\n handler = arr[i];\n result = result || handler(args);\n }\n }\n\n return !!result;\n }\n\n hasEventListener(type) {\n const listeners = this._listeners;\n return !!(listeners && listeners[type]);\n }\n}\n","export default class Integration {\n constructor(type) {\n this.type = type;\n }\n\n calculate(particles, time, damping) {\n this.eulerIntegrate(particles, time, damping);\n }\n\n // Euler Integrate\n // https://rosettacode.org/wiki/Euler_method\n eulerIntegrate(particle, time, damping) {\n if (!particle.sleep) {\n particle.old.p.copy(particle.p);\n particle.old.v.copy(particle.v);\n\n particle.a.multiplyScalar(1 / particle.mass);\n particle.v.add(particle.a.multiplyScalar(time));\n particle.p.add(particle.old.v.multiplyScalar(time));\n\n if (damping) particle.v.multiplyScalar(damping);\n\n particle.a.clear();\n }\n }\n}\n","import Pool from \"./Pool\";\nimport Util from \"../utils/Util\";\nimport Stats from \"../debug/Stats\";\nimport EventDispatcher from \"../events/EventDispatcher\";\nimport MathUtil from \"../math/MathUtil\";\nimport Integration from \"../math/Integration\";\n\nexport default class Proton {\n static USE_CLOCK = false;\n\n // measure 1:100\n static MEASURE = 100;\n static EULER = \"euler\";\n static RK2 = \"runge-kutta2\";\n\n // event name\n static PARTICLE_CREATED = \"PARTICLE_CREATED\";\n static PARTICLE_UPDATE = \"PARTICLE_UPDATE\";\n static PARTICLE_SLEEP = \"PARTICLE_SLEEP\";\n static PARTICLE_DEAD = \"PARTICLE_DEAD\";\n\n static EMITTER_ADDED = \"EMITTER_ADDED\";\n static EMITTER_REMOVED = \"EMITTER_REMOVED\";\n\n static PROTON_UPDATE = \"PROTON_UPDATE\";\n static PROTON_UPDATE_AFTER = \"PROTON_UPDATE_AFTER\";\n static DEFAULT_INTERVAL = 0.0167;\n\n static amendChangeTabsBug = true;\n\n /**\n * The constructor to add emitters\n *\n * @constructor Proton\n *\n * @todo proParticleCount is not in use\n * @todo add more documentation of the single properties and parameters\n *\n * @param {Number} [proParticleCount] not in use?\n * @param {Number} [integrationType=Proton.EULER]\n *\n * @property {String} [integrationType=Proton.EULER]\n * @property {Array} emitters All added emitter\n * @property {Array} renderers All added renderer\n * @property {Number} time The active time\n * @property {Number} oldtime The old time\n */\n constructor(integrationType) {\n this.emitters = [];\n this.renderers = [];\n\n this.time = 0;\n this.now = 0;\n this.then = 0;\n this.elapsed = 0;\n\n this.stats = new Stats(this);\n this.pool = new Pool(80);\n\n this.integrationType = Util.initValue(integrationType, Proton.EULER);\n this.integrator = new Integration(this.integrationType);\n\n this._fps = \"auto\";\n this._interval = Proton.DEFAULT_INTERVAL;\n }\n\n set fps(fps) {\n this._fps = fps;\n this._interval =\n fps === \"auto\" ? Proton.DEFAULT_INTERVAL : MathUtil.floor(1 / fps, 7);\n }\n\n get fps() {\n return this._fps;\n }\n\n /**\n * add a type of Renderer\n *\n * @method addRenderer\n * @memberof Proton\n * @instance\n *\n * @param {Renderer} render\n */\n addRenderer(render) {\n render.init(this);\n this.renderers.push(render);\n }\n\n /**\n * @name add a type of Renderer\n *\n * @method addRenderer\n * @param {Renderer} render\n */\n removeRenderer(render) {\n const index = this.renderers.indexOf(render);\n this.renderers.splice(index, 1);\n render.remove(this);\n }\n\n /**\n * add the Emitter\n *\n * @method addEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Emitter} emitter\n */\n addEmitter(emitter) {\n this.emitters.push(emitter);\n emitter.parent = this;\n\n this.dispatchEvent(Proton.EMITTER_ADDED, emitter);\n }\n\n /**\n * Removes an Emitter\n *\n * @method removeEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Proton.Emitter} emitter\n */\n removeEmitter(emitter) {\n const index = this.emitters.indexOf(emitter);\n this.emitters.splice(index, 1);\n emitter.parent = null;\n\n this.dispatchEvent(Proton.EMITTER_REMOVED, emitter);\n }\n\n /**\n * Updates all added emitters\n *\n * @method update\n * @memberof Proton\n * @instance\n */\n update() {\n // 'auto' is the default browser refresh rate, the vast majority is 60fps\n if (this._fps === \"auto\") {\n this.dispatchEvent(Proton.PROTON_UPDATE);\n\n if (Proton.USE_CLOCK) {\n if (!this.then) this.then = new Date().getTime();\n this.now = new Date().getTime();\n this.elapsed = (this.now - this.then) * 0.001;\n // Fix bugs such as chrome browser switching tabs causing excessive time difference\n this.amendChangeTabsBug();\n\n if (this.elapsed > 0) this.emittersUpdate(this.elapsed);\n this.then = this.now;\n } else {\n this.emittersUpdate(Proton.DEFAULT_INTERVAL);\n }\n\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\n }\n\n // If the fps frame rate is set\n else {\n if (!this.then) this.then = new Date().getTime();\n this.now = new Date().getTime();\n this.elapsed = (this.now - this.then) * 0.001;\n\n if (this.elapsed > this._interval) {\n this.dispatchEvent(Proton.PROTON_UPDATE);\n this.emittersUpdate(this._interval);\n // https://stackoverflow.com/questions/19764018/controlling-fps-with-requestanimationframe\n this.then = this.now - (this.elapsed % this._interval) * 1000;\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\n }\n }\n }\n\n emittersUpdate(elapsed) {\n let i = this.emitters.length;\n while (i--) this.emitters[i].update(elapsed);\n }\n\n /**\n * @todo add description\n *\n * @method amendChangeTabsBug\n * @memberof Proton\n * @instance\n */\n amendChangeTabsBug() {\n if (!Proton.amendChangeTabsBug) return;\n if (this.elapsed > 0.5) {\n this.then = new Date().getTime();\n this.elapsed = 0;\n }\n }\n\n /**\n * Counts all particles from all emitters\n *\n * @method getCount\n * @memberof Proton\n * @instance\n */\n getCount() {\n let total = 0;\n let i = this.emitters.length;\n\n while (i--) total += this.emitters[i].particles.length;\n return total;\n }\n\n getAllParticles() {\n let particles = [];\n let i = this.emitters.length;\n\n while (i--) particles = particles.concat(this.emitters[i].particles);\n return particles;\n }\n\n destroyAllEmitters() {\n Util.destroyAll(this.emitters);\n }\n\n /**\n * Destroys everything related to this Proton instance. This includes all emitters, and all properties\n *\n * @method destroy\n * @memberof Proton\n * @instance\n */\n destroy(remove = false) {\n const destroyOther = () => {\n this.time = 0;\n this.then = 0;\n this.pool.destroy();\n\n Util.destroyAll(this.emitters);\n Util.destroyAll(this.renderers, this.getAllParticles());\n };\n\n if (remove) {\n setTimeout(destroyOther, 200);\n } else {\n destroyOther();\n }\n }\n}\n\nEventDispatcher.bind(Proton);\n","export default class Rgb {\n constructor(r = 255, g = 255, b = 255) {\n this.r = r;\n this.g = g;\n this.b = b;\n }\n\n reset() {\n this.r = 255;\n this.g = 255;\n this.b = 255;\n }\n}\n","import MathUtil from \"./MathUtil\";\n\nexport default {\n easeLinear(value) {\n return value;\n },\n\n easeInQuad(value) {\n return Math.pow(value, 2);\n },\n\n easeOutQuad(value) {\n return -(Math.pow(value - 1, 2) - 1);\n },\n\n easeInOutQuad(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 2);\n\n return -0.5 * ((value -= 2) * value - 2);\n },\n\n easeInCubic(value) {\n return Math.pow(value, 3);\n },\n\n easeOutCubic(value) {\n return Math.pow(value - 1, 3) + 1;\n },\n\n easeInOutCubic(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 3);\n\n return 0.5 * (Math.pow(value - 2, 3) + 2);\n },\n\n easeInQuart(value) {\n return Math.pow(value, 4);\n },\n\n easeOutQuart(value) {\n return -(Math.pow(value - 1, 4) - 1);\n },\n\n easeInOutQuart(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 4);\n\n return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2);\n },\n\n easeInSine(value) {\n return -Math.cos(value * MathUtil.PI_2) + 1;\n },\n\n easeOutSine(value) {\n return Math.sin(value * MathUtil.PI_2);\n },\n\n easeInOutSine(value) {\n return -0.5 * (Math.cos(Math.PI * value) - 1);\n },\n\n easeInExpo(value) {\n return value === 0 ? 0 : Math.pow(2, 10 * (value - 1));\n },\n\n easeOutExpo(value) {\n return value === 1 ? 1 : -Math.pow(2, -10 * value) + 1;\n },\n\n easeInOutExpo(value) {\n if (value === 0) return 0;\n\n if (value === 1) return 1;\n\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(2, 10 * (value - 1));\n\n return 0.5 * (-Math.pow(2, -10 * --value) + 2);\n },\n\n easeInCirc(value) {\n return -(Math.sqrt(1 - value * value) - 1);\n },\n\n easeOutCirc(value) {\n return Math.sqrt(1 - Math.pow(value - 1, 2));\n },\n\n easeInOutCirc(value) {\n if ((value /= 0.5) < 1) return -0.5 * (Math.sqrt(1 - value * value) - 1);\n return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1);\n },\n\n easeInBack(value) {\n let s = 1.70158;\n return value * value * ((s + 1) * value - s);\n },\n\n easeOutBack(value) {\n let s = 1.70158;\n return (value = value - 1) * value * ((s + 1) * value + s) + 1;\n },\n\n easeInOutBack(value) {\n let s = 1.70158;\n if ((value /= 0.5) < 1)\n return 0.5 * (value * value * (((s *= 1.525) + 1) * value - s));\n return 0.5 * ((value -= 2) * value * (((s *= 1.525) + 1) * value + s) + 2);\n },\n\n getEasing(ease) {\n if (typeof ease === \"function\") return ease;\n else return this[ease] || this.easeLinear;\n }\n};\n","import MathUtil from \"../math/MathUtil\";\n\nexport default class Vector2D {\n constructor(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n }\n\n set(x, y) {\n this.x = x;\n this.y = y;\n return this;\n }\n\n setX(x) {\n this.x = x;\n return this;\n }\n\n setY(y) {\n this.y = y;\n return this;\n }\n\n getGradient() {\n if (this.x !== 0) return Math.atan2(this.y, this.x);\n else if (this.y > 0) return MathUtil.PI_2;\n else if (this.y < 0) return -MathUtil.PI_2;\n }\n\n copy(v) {\n this.x = v.x;\n this.y = v.y;\n\n return this;\n }\n\n add(v, w) {\n if (w !== undefined) {\n return this.addVectors(v, w);\n }\n\n this.x += v.x;\n this.y += v.y;\n\n return this;\n }\n\n addXY(a, b) {\n this.x += a;\n this.y += b;\n\n return this;\n }\n\n addVectors(a, b) {\n this.x = a.x + b.x;\n this.y = a.y + b.y;\n\n return this;\n }\n\n sub(v, w) {\n if (w !== undefined) {\n return this.subVectors(v, w);\n }\n\n this.x -= v.x;\n this.y -= v.y;\n\n return this;\n }\n\n subVectors(a, b) {\n this.x = a.x - b.x;\n this.y = a.y - b.y;\n\n return this;\n }\n\n divideScalar(s) {\n if (s !== 0) {\n this.x /= s;\n this.y /= s;\n } else {\n this.set(0, 0);\n }\n\n return this;\n }\n\n multiplyScalar(s) {\n this.x *= s;\n this.y *= s;\n\n return this;\n }\n\n negate() {\n return this.multiplyScalar(-1);\n }\n\n dot(v) {\n return this.x * v.x + this.y * v.y;\n }\n\n lengthSq() {\n return this.x * this.x + this.y * this.y;\n }\n\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n\n normalize() {\n return this.divideScalar(this.length());\n }\n\n distanceTo(v) {\n return Math.sqrt(this.distanceToSquared(v));\n }\n\n rotate(tha) {\n const x = this.x;\n const y = this.y;\n\n this.x = x * Math.cos(tha) + y * Math.sin(tha);\n this.y = -x * Math.sin(tha) + y * Math.cos(tha);\n\n return this;\n }\n\n distanceToSquared(v) {\n const dx = this.x - v.x;\n const dy = this.y - v.y;\n\n return dx * dx + dy * dy;\n }\n\n lerp(v, alpha) {\n this.x += (v.x - this.x) * alpha;\n this.y += (v.y - this.y) * alpha;\n\n return this;\n }\n\n equals(v) {\n return v.x === this.x && v.y === this.y;\n }\n\n clear() {\n this.x = 0.0;\n this.y = 0.0;\n return this;\n }\n\n clone() {\n return new Vector2D(this.x, this.y);\n }\n}\n","/** @typedef {import('../behaviour/Behaviour')} Behaviour */\n/** @typedef {import('../math/Vector2D')} Vector2D */\n/** @typedef {import('../utils/Rgb')} Rgb */\nimport Rgb from \"../utils/Rgb\";\nimport Puid from \"../utils/Puid\";\nimport Util from \"../utils/Util\";\nimport ease from \"../math/ease\";\nimport Vector2D from \"../math/Vector2D\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Particle {\n /** @type string */\n id = ''\n\n /** @type {{p:Vector2D,v:Vector2D,a:Vector2D}} */\n old = {}\n\n /** @type {object} */\n data = {}\n\n /** @type {Behaviour[]} */\n behaviours = []\n\n /** @type {Vector2D} */\n p = []\n\n /** @type {Vector2D} */\n v = []\n\n /** @type {Vector2D} */\n a = []\n\n /** @type {Rgb} */\n rgb = {}\n\n /**\n * the Particle class\n *\n * @class Proton.Particle\n * @constructor\n * @param {Object} pObj the parameters object;\n * for example {life:3,dead:false}\n */\n constructor(conf) {\n /**\n * The particle's id;\n * @property id\n * @type {string}\n */\n this.name = \"Particle\";\n this.id = Puid.id(this.name);\n this.old = {};\n this.data = {};\n this.behaviours = [];\n\n this.p = new Vector2D();\n this.v = new Vector2D();\n this.a = new Vector2D();\n this.old.p = new Vector2D();\n this.old.v = new Vector2D();\n this.old.a = new Vector2D();\n\n this.rgb = new Rgb();\n this.reset();\n conf && Util.setProp(this, conf);\n }\n\n getDirection() {\n return Math.atan2(this.v.x, -this.v.y) * MathUtil.N180_PI;\n }\n\n reset() {\n this.life = Infinity;\n this.age = 0;\n\n this.dead = false;\n this.sleep = false;\n this.body = null;\n this.sprite = null;\n this.parent = null;\n\n this.energy = 1; // Energy Loss\n this.mass = 1;\n this.radius = 10;\n this.alpha = 1;\n this.scale = 1;\n this.rotation = 0;\n this.color = null;\n\n this.p.set(0, 0);\n this.v.set(0, 0);\n this.a.set(0, 0);\n this.old.p.set(0, 0);\n this.old.v.set(0, 0);\n this.old.a.set(0, 0);\n this.easing = ease.easeLinear;\n\n this.rgb.reset();\n Util.emptyObject(this.data);\n this.removeAllBehaviours();\n\n return this;\n }\n\n update(time, index) {\n if (!this.sleep) {\n this.age += time;\n this.applyBehaviours(time, index);\n }\n\n if (this.age < this.life) {\n const scale = this.easing(this.age / this.life);\n this.energy = Math.max(1 - scale, 0);\n } else {\n this.destroy();\n }\n }\n\n applyBehaviours(time, index) {\n const length = this.behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.behaviours[i] &&\n this.behaviours[i].applyBehaviour(this, time, index);\n }\n }\n\n /**\n * @param {Behaviour} behaviour\n */\n addBehaviour(behaviour) {\n this.behaviours.push(behaviour);\n\n if (behaviour.hasOwnProperty(\"parents\")) behaviour.parents.push(this);\n behaviour.initialize(this);\n }\n\n /**\n * @param {Behaviour[]} behaviours\n */\n addBehaviours(behaviours) {\n const length = behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.addBehaviour(behaviours[i]);\n }\n }\n\n removeBehaviour(behaviour) {\n const index = this.behaviours.indexOf(behaviour);\n\n if (index > -1) {\n const behaviour = this.behaviours.splice(index, 1);\n behaviour.parents = null;\n }\n }\n\n removeAllBehaviours() {\n Util.emptyArray(this.behaviours);\n }\n\n /**\n * Destory this particle\n * @method destroy\n */\n destroy() {\n this.removeAllBehaviours();\n this.energy = 0;\n this.dead = true;\n this.parent = null;\n }\n}\n","export default {\n /**\n * @typedef {Object} rgbObject\n * @property {Number} r red value\n * @property {Number} g green value\n * @property {Number} b blue value\n */\n /**\n * converts a hex value to a rgb object\n *\n * @memberof Proton#Proton.Util\n * @method hexToRgb\n *\n * @param {String} h any hex value, e.g. #000000 or 000000 for black\n *\n * @return {rgbObject}\n */\n hexToRgb(h) {\n const hex16 = h.charAt(0) === \"#\" ? h.substring(1, 7) : h;\n const r = parseInt(hex16.substring(0, 2), 16);\n const g = parseInt(hex16.substring(2, 4), 16);\n const b = parseInt(hex16.substring(4, 6), 16);\n\n return { r, g, b };\n },\n\n /**\n * converts a rgb value to a rgb string\n *\n * @memberof Proton#Proton.Util\n * @method rgbToHex\n *\n * @param {Object | Proton.hexToRgb} rgb a rgb object like in {@link Proton#Proton.}\n *\n * @return {String} rgb()\n */\n rgbToHex(rbg) {\n return `rgb(${rbg.r}, ${rbg.g}, ${rbg.b})`;\n },\n\n getHex16FromParticle(p) {\n return Number(p.rgb.r) * 65536 + Number(p.rgb.g) * 256 + Number(p.rgb.b);\n }\n};\n","import Vector2D from \"./Vector2D\";\n\nexport default class Polar2D {\n constructor(r, tha) {\n this.r = Math.abs(r) || 0;\n this.tha = tha || 0;\n }\n\n set(r, tha) {\n this.r = r;\n this.tha = tha;\n return this;\n }\n\n setR(r) {\n this.r = r;\n return this;\n }\n\n setTha(tha) {\n this.tha = tha;\n return this;\n }\n\n copy(p) {\n this.r = p.r;\n this.tha = p.tha;\n return this;\n }\n\n toVector() {\n return new Vector2D(this.getX(), this.getY());\n }\n\n getX() {\n return this.r * Math.sin(this.tha);\n }\n\n getY() {\n return -this.r * Math.cos(this.tha);\n }\n\n normalize() {\n this.r = 1;\n return this;\n }\n\n equals(v) {\n return v.r === this.r && v.tha === this.tha;\n }\n\n clear() {\n this.r = 0.0;\n this.tha = 0.0;\n return this;\n }\n\n clone() {\n return new Polar2D(this.r, this.tha);\n }\n}\n","const Mat3 = {\n create(mat3) {\n const mat = new Float32Array(9);\n if (mat3) this.set(mat3, mat);\n\n return mat;\n },\n\n set(mat1, mat2) {\n for (let i = 0; i < 9; i++) mat2[i] = mat1[i];\n\n return mat2;\n },\n\n multiply(mat, mat2, mat3) {\n let a00 = mat[0],\n a01 = mat[1],\n a02 = mat[2],\n a10 = mat[3],\n a11 = mat[4],\n a20 = mat[6],\n a21 = mat[7],\n b00 = mat2[0],\n b01 = mat2[1],\n b02 = mat2[2],\n b10 = mat2[3],\n b11 = mat2[4],\n b20 = mat2[6],\n b21 = mat2[7];\n\n mat3[0] = b00 * a00 + b01 * a10;\n mat3[1] = b00 * a01 + b01 * a11;\n mat3[2] = a02 * b02;\n mat3[3] = b10 * a00 + b11 * a10;\n mat3[4] = b10 * a01 + b11 * a11;\n mat3[6] = b20 * a00 + b21 * a10 + a20;\n mat3[7] = b20 * a01 + b21 * a11 + a21;\n\n return mat3;\n },\n\n inverse(mat, mat3) {\n let a00 = mat[0],\n a01 = mat[1],\n a10 = mat[3],\n a11 = mat[4],\n a20 = mat[6],\n a21 = mat[7],\n b01 = a11,\n b11 = -a10,\n b21 = a21 * a10 - a11 * a20,\n d = a00 * b01 + a01 * b11,\n id;\n\n id = 1 / d;\n mat3[0] = b01 * id;\n mat3[1] = -a01 * id;\n mat3[3] = b11 * id;\n mat3[4] = a00 * id;\n mat3[6] = b21 * id;\n mat3[7] = (-a21 * a00 + a01 * a20) * id;\n\n return mat3;\n },\n\n multiplyVec2(m, vec, mat3) {\n let x = vec[0],\n y = vec[1];\n\n mat3[0] = x * m[0] + y * m[3] + m[6];\n mat3[1] = x * m[1] + y * m[4] + m[7];\n\n return mat3;\n }\n};\n\nexport default Mat3;\n","import Span from \"./Span\";\nimport Util from \"../utils/Util\";\nimport MathUtil from \"./MathUtil\";\n\nexport default class ArraySpan extends Span {\n constructor(color) {\n super();\n this._arr = Util.toArray(color);\n }\n\n getValue() {\n const val = Util.getRandFromArray(this._arr);\n return val === \"random\" || val === \"Random\" ? MathUtil.randomColor() : val;\n }\n\n /**\n * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance\n *\n * @method setSpanValue\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n static createArraySpan(arr) {\n if (!arr) return null;\n\n if (arr instanceof ArraySpan) return arr;\n else return new ArraySpan(arr);\n }\n}\n","export default class Rectangle {\n constructor(x, y, w, h) {\n this.x = x;\n this.y = y;\n\n this.width = w;\n this.height = h;\n\n this.bottom = this.y + this.height;\n this.right = this.x + this.width;\n }\n\n contains(x, y) {\n if (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y)\n return true;\n else return false;\n }\n}\n","import Span from \"../math/Span\";\nimport Util from \"../utils/Util\";\n\nexport default class Rate {\n /**\n * The number of particles per second emission (a [particle]/b [s]);\n * @namespace\n * @memberof! Proton#\n * @constructor\n * @alias Rate\n *\n * @param {Array | Number | Span} numpan the number of each emission;\n * @param {Array | Number | Span} timepan the time of each emission;\n * for example: new Rate(new Span(10, 20), new Span(.1, .25));\n */\n constructor(numpan, timepan) {\n this.numPan = Span.setSpanValue(Util.initValue(numpan, 1));\n this.timePan = Span.setSpanValue(Util.initValue(timepan, 1));\n\n this.startTime = 0;\n this.nextTime = 0;\n this.init();\n }\n\n init() {\n this.startTime = 0;\n this.nextTime = this.timePan.getValue();\n }\n\n getValue(time) {\n this.startTime += time;\n\n if (this.startTime >= this.nextTime) {\n this.startTime = 0;\n this.nextTime = this.timePan.getValue();\n\n if (this.numPan.b === 1) {\n if (this.numPan.getValue(false) > 0.5) return 1;\n else return 0;\n } else {\n return this.numPan.getValue(true);\n }\n }\n\n return 0;\n }\n}\n","export default class Initialize {\n reset() {}\n\n init(emitter, particle) {\n if (particle) {\n this.initialize(particle);\n } else {\n this.initialize(emitter);\n }\n }\n\n // sub class init\n initialize(target) {}\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Life extends Initialize {\n constructor(a, b, c) {\n super();\n\n this.lifePan = Span.setSpanValue(a, b, c);\n this.name = \"Life\";\n }\n\n initialize(target) {\n if (this.lifePan.a === Infinity) target.life = Infinity;\n else target.life = this.lifePan.getValue();\n }\n}\n","import Vector2D from \"../math/Vector2D\";\n\nexport default class Zone {\n constructor() {\n this.vector = new Vector2D(0, 0);\n this.random = 0;\n this.crossType = \"dead\";\n this.alert = true;\n }\n\n getPosition() {}\n\n crossing(particle) {}\n}\n","import Zone from \"./Zone\";\n\nexport default class PointZone extends Zone {\n constructor(x, y) {\n super();\n\n this.x = x;\n this.y = y;\n }\n\n getPosition() {\n this.vector.x = this.x;\n this.vector.y = this.y;\n\n return this.vector;\n }\n\n crossing(particle) {\n if (this.alert) {\n console.error(\"Sorry, PointZone does not support crossing method!\");\n this.alert = false;\n }\n }\n}\n","import Util from \"../utils/Util\";\nimport PointZone from \"../zone/PointZone\";\nimport Initialize from \"./Initialize\";\n\nexport default class Position extends Initialize {\n constructor(zone) {\n super();\n this.zone = Util.initValue(zone, new PointZone());\n this.name = \"Position\";\n }\n\n reset(zone) {\n this.zone = Util.initValue(zone, new PointZone());\n }\n\n initialize(target) {\n this.zone.getPosition();\n\n target.p.x = this.zone.vector.x;\n target.p.y = this.zone.vector.y;\n }\n}\n","import Proton from \"../core/Proton\";\nimport Span from \"../math/Span\";\nimport Util from \"../utils/Util\";\nimport Initialize from \"./Initialize\";\nimport Polar2D from \"../math/Polar2D\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Velocity extends Initialize {\n constructor(rpan, thapan, type) {\n super();\n\n this.rPan = Span.setSpanValue(rpan);\n this.thaPan = Span.setSpanValue(thapan);\n this.type = Util.initValue(type, \"vector\");\n\n this.name = \"Velocity\";\n }\n\n reset(rpan, thapan, type) {\n this.rPan = Span.setSpanValue(rpan);\n this.thaPan = Span.setSpanValue(thapan);\n this.type = Util.initValue(type, \"vector\");\n }\n\n normalizeVelocity(vr) {\n return vr * Proton.MEASURE;\n }\n\n initialize(target) {\n if (this.type === \"p\" || this.type === \"P\" || this.type === \"polar\") {\n const polar2d = new Polar2D(\n this.normalizeVelocity(this.rPan.getValue()),\n this.thaPan.getValue() * MathUtil.PI_180\n );\n\n target.v.x = polar2d.getX();\n target.v.y = polar2d.getY();\n } else {\n target.v.x = this.normalizeVelocity(this.rPan.getValue());\n target.v.y = this.normalizeVelocity(this.thaPan.getValue());\n }\n }\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Mass extends Initialize {\n constructor(a, b, c) {\n super();\n this.massPan = Span.setSpanValue(a, b, c);\n this.name = \"Mass\";\n }\n\n initialize(target) {\n target.mass = this.massPan.getValue();\n }\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Radius extends Initialize {\n constructor(a, b, c) {\n super();\n this.radius = Span.setSpanValue(a, b, c);\n\n this.name = \"Radius\";\n }\n\n reset(a, b, c) {\n this.radius = Span.setSpanValue(a, b, c);\n }\n\n initialize(particle) {\n particle.radius = this.radius.getValue();\n particle.data.oldRadius = particle.radius;\n }\n}\n","import Util from \"../utils/Util\";\nimport ArraySpan from \"../math/ArraySpan\";\nimport Initialize from \"./Initialize\";\n\nexport default class Body extends Initialize {\n constructor(image, w, h) {\n super();\n\n this.image = this.setSpanValue(image);\n this.w = Util.initValue(w, 20);\n this.h = Util.initValue(h, this.w);\n this.name = \"Body\";\n }\n\n initialize(particle) {\n const imageTarget = this.image.getValue();\n\n if (typeof imageTarget === \"string\") {\n particle.body = {\n width: this.w,\n height: this.h,\n src: imageTarget,\n isInner: true,\n inner: true\n };\n } else {\n particle.body = imageTarget;\n }\n }\n\n setSpanValue(image) {\n return image instanceof ArraySpan ? image : new ArraySpan(image);\n }\n}\n","import Proton from '../core/Proton';\nimport Util from '../utils/Util';\nimport ease from '../math/ease';\n\nexport default class Behaviour {\n static id = 0;\n\n /**\n * The Behaviour class is the base for the other Behaviour\n *\n * @memberof! -\n * @interface\n * @alias Proton.Behaviour\n *\n * @param {Number} life \tthe behaviours life\n * @param {String} easing \tThe behaviour's decaying trend, for example ease.easeOutQuart\n *\n * @property {String} id \t\tThe behaviours id\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n * @property {Number} age=0 \tHow long the particle should be 'alife'\n * @property {Number} energy=1\n * @property {Boolean} dead=false The particle is dead at first\n * @property {Array} parents \tThe behaviour's parents array\n * @property {String} name \tThe behaviour name\n */\n constructor(life, easing) {\n\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n\n this.age = 0;\n this.energy = 1;\n this.dead = false;\n this.parents = [];\n\n this.id = `Behaviour_${Behaviour.id++}`;\n this.name = 'Behaviour';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(life, easing) {\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n }\n\n /**\n * Normalize a force by 1:100;\n *\n * @method normalizeForce\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Vector2D} force\n */\n normalizeForce(force) {\n return force.multiplyScalar(Proton.MEASURE);\n }\n\n /**\n * Normalize a value by 1:100;\n *\n * @method normalizeValue\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} value\n */\n normalizeValue(value) {\n return value * Proton.MEASURE;\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {}\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n calculate(particle, time, index) {\n this.age += time;\n\n if (this.age >= this.life || this.dead) {\n this.energy = 0;\n this.dead = true;\n this.destroy();\n } else {\n const scale = this.easing(particle.age / particle.life);\n this.energy = Math.max(1 - scale, 0);\n }\n }\n\n /**\n * Destory this behaviour\n *\n * @method destroy\n * @memberof Proton.Behaviour\n * @instance\n */\n destroy() {\n let i = this.parents.length;\n while (i--) {\n this.parents[i].removeBehaviour(this);\n }\n\n this.parents.length = 0;\n }\n}\n","import Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Force extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Force\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(fx, fy, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\t\tthis.name = 'Force';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(fx, fy, life, easing) {\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.a.add(this.force);\n\t}\n}","import Util from \"../utils/Util\";\nimport Vector2D from \"../math/Vector2D\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Attraction extends Behaviour {\n /**\n * This behaviour let the particles follow one specific Proton.Vector2D\n *\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Attraction\n *\n * @todo add description for 'force' and 'radius'\n *\n * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n * @param {Number} [force=100]\n * @param {Number} [radius=1000]\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {Proton.Vector2D} targetPosition\n * @property {Number} radius\n * @property {Number} force\n * @property {Number} radiusSq\n * @property {Proton.Vector2D} attractionForce\n * @property {Number} lengthSq\n * @property {String} name The Behaviour name\n */\n constructor(targetPosition, force, radius, life, easing) {\n super(life, easing);\n\n this.targetPosition = Util.initValue(targetPosition, new Vector2D());\n this.radius = Util.initValue(radius, 1000);\n this.force = Util.initValue(this.normalizeValue(force), 100);\n\n this.radiusSq = this.radius * this.radius;\n this.attractionForce = new Vector2D();\n this.lengthSq = 0;\n\n this.name = \"Attraction\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Attraction\n * @instance\n *\n * @todo add description for 'force' and 'radius'\n *\n * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n * @param {Number} [force=100]\n * @param {Number} [radius=1000]\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n */\n reset(targetPosition, force, radius, life, easing) {\n this.targetPosition = Util.initValue(targetPosition, new Vector2D());\n this.radius = Util.initValue(radius, 1000);\n this.force = Util.initValue(this.normalizeValue(force), 100);\n\n this.radiusSq = this.radius * this.radius;\n this.attractionForce = new Vector2D();\n this.lengthSq = 0;\n\n life && super.reset(life, easing);\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @memberof Proton#Proton.Attraction\n * @method applyBehaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n\n this.attractionForce.copy(this.targetPosition);\n this.attractionForce.sub(particle.p);\n this.lengthSq = this.attractionForce.lengthSq();\n\n if (this.lengthSq > 0.00004 && this.lengthSq < this.radiusSq) {\n this.attractionForce.normalize();\n this.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\n this.attractionForce.multiplyScalar(this.force);\n\n particle.a.add(this.attractionForce);\n }\n }\n}\n","import Vector2D from \"../math/Vector2D\";\nimport MathUtil from \"../math/MathUtil\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class RandomDrift extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Behaviour\n * @constructor\n * @alias RandomDrift\n *\n * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n * @param {Number} delay \t\t\t\tHow much delay the drift should have\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {Number} time The time of the drift\n * @property {String} name The Behaviour name\n */\n constructor(driftX, driftY, delay, life, easing) {\n super(life, easing);\n\n this.reset(driftX, driftY, delay);\n this.time = 0;\n this.name = \"RandomDrift\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#RandomDrift\n * @instance\n *\n * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n * @param {Number} delay \t\t\t\tHow much delay the drift should have\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(driftX, driftY, delay, life, easing) {\n this.panFoce = new Vector2D(driftX, driftY);\n this.panFoce = this.normalizeForce(this.panFoce);\n this.delay = delay;\n\n life && super.reset(life, easing);\n }\n\n initialize(particle) {\n particle.data.time = 0;\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#RandomDrift\n * @instance\n *\n * @param {Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n particle.data.time += time;\n\n if (particle.data.time >= this.delay) {\n particle.a.addXY(\n MathUtil.randomAToB(-this.panFoce.x, this.panFoce.x),\n MathUtil.randomAToB(-this.panFoce.y, this.panFoce.y)\n );\n\n particle.data.time = 0;\n }\n }\n}\n","import Force from './Force';\n\nexport default class Gravity extends Force {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Force\n\t * @constructor\n\t * @alias Proton.Gravity\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(g, life, easing) {\n\t\tsuper(0, g, life, easing);\n\t\tthis.name = 'Gravity';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Gravity\n\t * @instance\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(g, life, easing) {\n\t\tsuper.reset(0, g, life, easing);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Collision extends Behaviour {\n\n\t/**\n\t * The callback after collision\n\t *\n\t * @callback Callback\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Proton.Paritcle} otherParticle\n\t */\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Collision\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(emitter, mass, callback, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(emitter, mass, callback);\n\t\tthis.name = 'Collision';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method reset\n\t * @instance\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} \t\t\t[life=Infinity] \tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(emitter, mass, callback, life, easing) {\n\t\tthis.emitter = Util.initValue(emitter, null);\n\t\tthis.mass = Util.initValue(mass, true);\n\t\tthis.callback = Util.initValue(callback, null);\n\n\t\tthis.collisionPool = [];\n\t\tthis.delta = new Vector2D();\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tconst newPool = this.emitter ? this.emitter.particles.slice(index) : this.pool.slice(index);\n\t\tconst length = newPool.length;\n\n\t\tlet otherParticle;\n\t\tlet lengthSq;\n\t\tlet overlap;\n\t\tlet totalMass;\n\t\tlet averageMass1, averageMass2;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\totherParticle = newPool[i];\n\n\t\t\tif (otherParticle !== particle) {\n\t\t\t\tthis.delta.copy(otherParticle.p);\n\t\t\t\tthis.delta.sub(particle.p);\n\n\t\t\t\tlengthSq = this.delta.lengthSq();\n\t\t\t\tconst distance = particle.radius + otherParticle.radius;\n\n\t\t\t\tif (lengthSq <= distance * distance) {\n\t\t\t\t\toverlap = distance - Math.sqrt(lengthSq);\n\t\t\t\t\toverlap += 0.5;\n\n\t\t\t\t\ttotalMass = particle.mass + otherParticle.mass;\n\t\t\t\t\taverageMass1 = this.mass ? otherParticle.mass / totalMass : 0.5;\n\t\t\t\t\taverageMass2 = this.mass ? particle.mass / totalMass : 0.5;\n\n\t\t\t\t\tparticle.p.add(this.delta.clone().normalize().multiplyScalar(overlap * -averageMass1));\n\t\t\t\t\totherParticle.p.add(this.delta.normalize().multiplyScalar(overlap * averageMass2));\n\n\t\t\t\t\tthis.callback && this.callback(particle, otherParticle);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class CrossZone extends Behaviour {\n\n /**\n * Defines what happens if the particles come to the end of the specified zone\n *\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.CrossZone\n *\n * @param {Proton.Zone} zone \t\t\t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \t\t\twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \t\t\tthis behaviour's life\n * @param {String} \t\t[easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(zone, crossType, life, easing) {\n super(life, easing);\n\n this.reset(zone, crossType);\n this.name = 'CrossZone';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Zone} zone \t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \tthis behaviour's life\n * @param {String} \t\t[easing=easeLinear]\tthis behaviour's easing\n */\n reset(zone, crossType, life, easing) {\n this.zone = zone;\n this.zone.crossType = Util.initValue(crossType, 'dead');\n\n life && super.reset(life, easing);\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n this.zone.crossing(particle);\n };\n}","import Util from \"../utils/Util\";\nimport Span from \"../math/Span\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Alpha extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Alpha\n *\n * @todo add description for 'a' and 'b'\n *\n * @param {Number} a\n * @param {String} b\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = \"Alpha\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @todo add description for 'a' and 'b'\n *\n * @param {Number} a\n * @param {String} b\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.same = b === null || b === undefined ? true : false;\n this.a = Span.setSpanValue(Util.initValue(a, 1));\n this.b = Span.setSpanValue(b);\n\n life && super.reset(life, easing);\n }\n\n /**\n * Sets the new alpha value of the particle\n *\n * @method initialize\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @param {Proton.Particle} particle A single Proton generated particle\n */\n initialize(particle) {\n particle.data.alphaA = this.a.getValue();\n\n if (this.same) particle.data.alphaB = particle.data.alphaA;\n else particle.data.alphaB = this.b.getValue();\n }\n\n /**\n * @method applyBehaviour\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n\n particle.alpha =\n particle.data.alphaB +\n (particle.data.alphaA - particle.data.alphaB) * this.energy;\n\n if (particle.alpha < 0.001) particle.alpha = 0;\n }\n}\n","import Span from \"../math/Span\";\nimport Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Scale extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Scale\n\t *\n\t * @todo add description for 'a' and 'b'\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(a, b, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(a, b);\n\t\tthis.name = 'Scale';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\t\tthis.a = Span.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Span.setSpanValue(b);\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.data.scaleA = this.a.getValue();\n\t\tparticle.data.oldRadius = particle.radius;\n\t\tparticle.data.scaleB = this.same ? particle.data.scaleA : this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.scale = particle.data.scaleB + (particle.data.scaleA - particle.data.scaleB) * this.energy;\n\n\t\tif (particle.scale < 0.0001) particle.scale = 0;\n\t\tparticle.radius = particle.data.oldRadius * particle.scale;\n\t}\n}","import Span from \"../math/Span\";\nimport Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Rotate extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Rotate\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} [influence=Velocity] The rotation's influence\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(influence, b, style, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(influence, b, style);\n\t\tthis.name = 'Rotate';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} a\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, style, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\n\t\tthis.a = Span.setSpanValue(Util.initValue(a, 'Velocity'));\n\t\tthis.b = Span.setSpanValue(Util.initValue(b, 0));\n\t\tthis.style = Util.initValue(style, 'to');\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.rotation = this.a.getValue();\n\t\tparticle.data.rotationA = this.a.getValue();\n\n\t\tif (!this.same) particle.data.rotationB = this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tif (!this.same) {\n\t\t\tif (this.style === 'to' || this.style === 'TO' || this.style === '_') {\n\t\t\t\tparticle.rotation += particle.data.rotationB + (particle.data.rotationA - particle.data.rotationB) * this.energy\n\t\t\t} else {\n\t\t\t\tparticle.rotation += particle.data.rotationB;\n\t\t\t}\n\t\t} else if (this.a.a === 'V' || this.a.a === 'Velocity' || this.a.a === 'v') {\n\t\t\t// beta...\n\t\t\tparticle.rotation = particle.getDirection();\n\t\t}\n\t}\n\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport ArraySpan from \"../math/ArraySpan\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Color extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Color\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = \"Color\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.a = ArraySpan.createArraySpan(a);\n this.b = ArraySpan.createArraySpan(b);\n life && super.reset(life, easing);\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {\n particle.color = this.a.getValue();\n particle.data.colorA = ColorUtil.hexToRgb(particle.color);\n\n if (this.b) particle.data.colorB = ColorUtil.hexToRgb(this.b.getValue());\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n if (this.b) {\n this.calculate(particle, time, index);\n\n particle.rgb.r =\n particle.data.colorB.r +\n (particle.data.colorA.r - particle.data.colorB.r) * this.energy;\n particle.rgb.g =\n particle.data.colorB.g +\n (particle.data.colorA.g - particle.data.colorB.g) * this.energy;\n particle.rgb.b =\n particle.data.colorB.b +\n (particle.data.colorA.b - particle.data.colorB.b) * this.energy;\n\n particle.rgb.r = Math.floor(particle.rgb.r);\n particle.rgb.g = Math.floor(particle.rgb.g);\n particle.rgb.b = Math.floor(particle.rgb.b);\n } else {\n particle.rgb.r = particle.data.colorA.r;\n particle.rgb.g = particle.data.colorA.g;\n particle.rgb.b = particle.data.colorA.b;\n }\n }\n}\n","import MathUtil from \"../math/MathUtil\";\nimport Vector2D from \"../math/Vector2D\";\nimport Span from \"../math/Span\";\nimport Behaviour from \"./Behaviour\";\n\nconst CHANGING = \"changing\";\n\nexport default class Cyclone extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Cyclone\n *\n * @param {Number} angle\n * @param {Number} force\n * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(angle, force, life, easing) {\n super(life, easing);\n this.setAngleAndForce(angle, force);\n this.name = \"Cyclone\";\n }\n\n setAngleAndForce(angle, force) {\n this.force = CHANGING;\n this.angle = MathUtil.PI / 2;\n\n if (angle === \"right\") {\n this.angle = MathUtil.PI / 2;\n } else if (angle === \"left\") {\n this.angle = -MathUtil.PI / 2;\n } else if (angle === \"random\") {\n this.angle = \"random\";\n } else if (angle instanceof Span) {\n this.angle = \"span\";\n this.span = angle;\n } else if (angle) {\n this.angle = angle;\n }\n\n if (\n String(force).toLowerCase() === \"changing\" ||\n String(force).toLowerCase() === \"chang\" ||\n String(force).toLowerCase() === \"auto\"\n ) {\n this.force = CHANGING;\n } else if (force) {\n this.force = force;\n }\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Cyclone\n * @instance\n *\n * @param {Number} angle\n * @param {Number} force\n * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n */\n reset(angle, force, life, easing) {\n this.angle = MathUtil.PI / 2;\n this.setAngleAndForce(angle, force);\n life && super.reset(life, easing);\n }\n\n initialize(particle) {\n if (this.angle === \"random\") {\n particle.data.cangle = MathUtil.randomAToB(-MathUtil.PI, MathUtil.PI);\n } else if (this.angle === \"span\") {\n particle.data.cangle = this.span.getValue();\n }\n\n particle.data.cyclone = new Vector2D(0, 0);\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.Cyclone\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n\n let length;\n let gradient = particle.v.getGradient();\n if (this.angle === \"random\" || this.angle === \"span\") {\n gradient += particle.data.cangle;\n } else {\n gradient += this.angle;\n }\n\n if (this.force === CHANGING) {\n length = particle.v.length() / 100;\n } else {\n length = this.force;\n }\n\n particle.data.cyclone.x = length * Math.cos(gradient);\n particle.data.cyclone.y = length * Math.sin(gradient);\n particle.data.cyclone = this.normalizeForce(particle.data.cyclone);\n particle.a.add(particle.data.cyclone);\n }\n}\n","import Attraction from './Attraction';\n\nexport default class Repulsion extends Attraction {\n\n\t/**\n\t * The oppisite of Proton.Attraction - turns the force\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Attraction\n\t * @constructor\n\t * @alias Proton.Repulsion\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Number} force\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(targetPosition, force, radius, life, easing);\n\n\t\tthis.force *= -1;\n\t\tthis.name = 'Repulsion';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Repulsion\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tsuper.reset(targetPosition, force, radius, life, easing);\n\t\tthis.force *= -1;\n\t}\n}\n","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class GravityWell extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Behaviour\n\t * @constructor\n\t * @alias GravityWell\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(centerPoint, force, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.name = 'GravityWell';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t */\n\treset(centerPoint, force, life, easing) {\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tlife && super.reset(life, easing);\n\t};\n\n\t/**\n\t * @inheritdoc\n\t */\n\tinitialize(particle) {\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.distanceVec.set(this.centerPoint.x - particle.p.x, this.centerPoint.y - particle.p.y);\n\t\tconst distanceSq = this.distanceVec.lengthSq();\n\n\t\tif (distanceSq !== 0) {\n\t\t\tconst distance = this.distanceVec.length();\n\t\t\tconst factor = (this.force * time) / (distanceSq * distance);\n\n\t\t\tparticle.v.x += factor * this.distanceVec.x;\n\t\t\tparticle.v.y += factor * this.distanceVec.y;\n\t\t}\n\t}\n}","import Util from \"../utils/Util\";\nimport Initialize from \"./Initialize\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default {\n initialize(emitter, particle, initializes) {\n const length = initializes.length;\n let i;\n\n for (i = 0; i < length; i++) {\n if (initializes[i] instanceof Initialize) {\n initializes[i].init(emitter, particle);\n } else {\n this.init(emitter, particle, initializes[i]);\n }\n }\n\n this.bindEmitter(emitter, particle);\n },\n\n // init\n init(emitter, particle, initialize) {\n Util.setProp(particle, initialize);\n Util.setVectorVal(particle, initialize);\n },\n\n bindEmitter(emitter, particle) {\n if (emitter.bindEmitter) {\n particle.p.add(emitter.p);\n particle.v.add(emitter.v);\n particle.a.add(emitter.a);\n\n particle.v.rotate(MathUtil.degreeTransform(emitter.rotation));\n }\n }\n};\n","import Util from \"../utils/Util\";\nimport Puid from \"../utils/Puid\";\nimport Particle from \"../core/Particle\";\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport Rate from \"../initialize/Rate\";\nimport InitializeUtil from \"../initialize/InitializeUtil\";\n\nexport default class Emitter extends Particle {\n /**\n * You can use this emit particles.\n *\n * It will dispatch follow events:\n * PARTICLE_CREATED\n * PARTICLE_UPDATA\n * PARTICLE_DEAD\n *\n * @class Emitter\n * @constructor\n * @param {Object} conf the parameters object;\n * for example {damping:0.01,bindEmitter:false}\n */\n constructor(conf = {}) {\n super(conf);\n\n this.particles = [];\n this.behaviours = [];\n this.initializes = [];\n\n this.emitTime = 0;\n this.emitSpeed = 0;\n this.totalTime = -1;\n\n /**\n * The friction coefficient for all particle emit by This;\n * @property damping\n * @type {Number}\n * @default 0.006\n */\n this.damping = 0.006;\n\n /**\n * If bindEmitter the particles can bind this emitter's property;\n * @property bindEmitter\n * @type {Boolean}\n * @default true\n */\n this.bindEmitter = true;\n\n /**\n * The number of particles per second emit (a [particle]/b [s]);\n * @property rate\n * @type {Rate}\n * @default Rate(1, .1)\n */\n this.rate = new Rate(1, 0.1);\n\n this.name = \"Emitter\";\n this.id = Puid.id(this.name);\n }\n\n /**\n * start emit particle\n * @method emit\n * @param {Number} emitTime begin emit time;\n * @param {String} life the life of this emitter\n */\n emit(totalTime, life) {\n this.stoped = false;\n this.emitTime = 0;\n this.totalTime = Util.initValue(totalTime, Infinity);\n\n if (life === true || life === \"life\" || life === \"destroy\") {\n this.life = totalTime === \"once\" ? 1 : this.totalTime;\n } else if (!isNaN(life)) {\n this.life = life;\n }\n\n this.rate.init();\n }\n\n /**\n * stop emiting\n * @method stop\n */\n stop() {\n this.totalTime = -1;\n this.emitTime = 0;\n this.stoped = true;\n }\n\n preEmit(time) {\n let oldStoped = this.stoped;\n let oldEmitTime = this.emitTime;\n let oldTotalTime = this.totalTime;\n\n this.stoped = false;\n this.emitTime = 0;\n this.totalTime = time;\n this.rate.init();\n\n const step = 0.0167;\n while (time > step) {\n time -= step;\n this.update(step);\n }\n\n this.stoped = oldStoped;\n this.emitTime = oldEmitTime + Math.max(time, 0);\n this.totalTime = oldTotalTime;\n }\n\n /**\n * remove current all particles\n * @method removeAllParticles\n */\n removeAllParticles() {\n let i = this.particles.length;\n while (i--) this.particles[i].dead = true;\n }\n\n /**\n * add initialize to this emitter\n * @method addSelfInitialize\n */\n addSelfInitialize(initialize) {\n if (initialize[\"init\"]) {\n initialize.init(this);\n } else {\n this.initAll();\n }\n }\n\n /**\n * add the Initialize to particles;\n *\n * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);\n * @method addInitialize\n * @param {Initialize} initialize like this new Radius(1, 12)\n */\n addInitialize(...rest) {\n let i = rest.length;\n while (i--) this.initializes.push(rest[i]);\n }\n\n /**\n * remove the Initialize\n * @method removeInitialize\n * @param {Initialize} initialize a initialize\n */\n removeInitialize(initializer) {\n const index = this.initializes.indexOf(initializer);\n if (index > -1) this.initializes.splice(index, 1);\n }\n\n /**\n * remove all Initializes\n * @method removeInitializers\n */\n removeAllInitializers() {\n Util.emptyArray(this.initializes);\n }\n\n /**\n * add the Behaviour to particles;\n *\n * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);\n * @method addBehaviour\n * @param {Behaviour} behaviour like this new Color('random')\n */\n addBehaviour(...rest) {\n let i = arguments.length;\n while (i--) {\n let behaviour = rest[i];\n this.behaviours.push(behaviour);\n if (behaviour.parents) behaviour.parents.push(this);\n }\n }\n\n /**\n * remove the Behaviour\n * @method removeBehaviour\n * @param {Behaviour} behaviour a behaviour\n */\n removeBehaviour(behaviour) {\n let index = this.behaviours.indexOf(behaviour);\n this.behaviours.splice(index, 1);\n\n if (behaviour.parents) {\n index = behaviour.parents.indexOf(behaviour);\n behaviour.parents.splice(index, 1);\n }\n\n return index;\n }\n\n /**\n * remove all behaviours\n * @method removeAllBehaviours\n */\n removeAllBehaviours() {\n Util.emptyArray(this.behaviours);\n }\n\n // emitter update\n update(time) {\n this.age += time;\n if (this.age >= this.life || this.dead) this.destroy();\n\n this.emitting(time);\n this.integrate(time);\n }\n\n integrate(time) {\n if (!this.parent) return;\n\n const damping = 1 - this.damping;\n this.parent.integrator.calculate(this, time, damping);\n\n const length = this.particles.length;\n let i, particle;\n\n for (i = length - 1; i >= 0; i--) {\n particle = this.particles[i];\n\n // particle update\n particle.update(time, i);\n this.parent.integrator.calculate(particle, time, damping);\n this.dispatch(\"PARTICLE_UPDATE\", particle);\n\n // check dead\n if (particle.dead) {\n this.dispatch(\"PARTICLE_DEAD\", particle);\n\n this.parent.pool.expire(particle);\n this.particles.splice(i, 1);\n }\n }\n }\n\n dispatch(event, target) {\n this.parent && this.parent.dispatchEvent(event, target);\n this.bindEvent && this.dispatchEvent(event, target);\n }\n\n emitting(time) {\n if (this.totalTime === \"once\") {\n let i;\n const length = this.rate.getValue(99999);\n\n if (length > 0) this.emitSpeed = length;\n for (i = 0; i < length; i++) this.createParticle();\n this.totalTime = \"none\";\n } else {\n this.emitTime += time;\n\n if (this.emitTime < this.totalTime) {\n const length = this.rate.getValue(time);\n let i;\n\n if (length > 0) this.emitSpeed = length;\n for (i = 0; i < length; i++) this.createParticle();\n }\n }\n }\n\n /**\n * create single particle;\n *\n * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})\n * @method removeAllParticles\n */\n createParticle(initialize, behaviour) {\n const particle = this.parent.pool.get(Particle);\n this.setupParticle(particle, initialize, behaviour);\n this.dispatch(\"PARTICLE_CREATED\", particle);\n\n return particle;\n }\n\n setupParticle(particle, initialize, behaviour) {\n let initializes = this.initializes;\n let behaviours = this.behaviours;\n\n if (initialize) initializes = Util.toArray(initialize);\n if (behaviour) behaviours = Util.toArray(behaviour);\n\n particle.reset();\n InitializeUtil.initialize(this, particle, initializes);\n particle.addBehaviours(behaviours);\n particle.parent = this;\n\n this.particles.push(particle);\n }\n\n remove() {\n this.stop();\n Util.destroyAll(this.particles);\n }\n\n /**\n * Destory this Emitter\n * @method destroy\n */\n destroy() {\n this.dead = true;\n this.remove();\n this.removeAllInitializers();\n this.removeAllBehaviours();\n this.parent && this.parent.removeEmitter(this);\n }\n}\n\nEventDispatcher.bind(Emitter);\n","import Emitter from \"./Emitter\";\n\nexport default class BehaviourEmitter extends Emitter {\n /**\n * The BehaviourEmitter class inherits from Proton.Emitter\n *\n * use the BehaviourEmitter you can add behaviours to self;\n * @class Proton.BehaviourEmitter\n * @constructor\n * @param {Object} conf the parameters object;\n */\n constructor(conf) {\n super(conf);\n\n this.selfBehaviours = [];\n }\n\n /**\n * add the Behaviour to emitter;\n *\n * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);\n * @method addSelfBehaviour\n * @param {Proton.Behaviour} behaviour like this new Proton.Color('random')\n */\n addSelfBehaviour(...rest) {\n let i,\n length = rest.length;\n\n for (i = 0; i < length; i++) {\n let behaviour = rest[i];\n this.selfBehaviours.push(behaviour);\n behaviour.initialize(this);\n }\n }\n\n /**\n * remove the Behaviour for self\n * @method removeSelfBehaviour\n * @param {Proton.Behaviour} behaviour a behaviour\n */\n removeSelfBehaviour(behaviour) {\n const index = this.selfBehaviours.indexOf(behaviour);\n if (index > -1) this.selfBehaviours.splice(index, 1);\n }\n\n update(time) {\n super.update(time);\n\n if (!this.sleep) {\n const length = this.selfBehaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.selfBehaviours[i].applyBehaviour(this, time, i);\n }\n }\n }\n}\n","import Util from \"../utils/Util\";\nimport Emitter from \"./Emitter\";\n\nexport default class FollowEmitter extends Emitter {\n /**\n * The FollowEmitter class inherits from Proton.Emitter\n *\n * use the FollowEmitter will emit particle when mousemoving\n *\n * @class Proton.FollowEmitter\n * @constructor\n * @param {Element} mouseTarget mouseevent's target;\n * @param {Number} ease the easing of following speed;\n * @default 0.7\n * @param {Object} conf the parameters object;\n */\n constructor(mouseTarget, ease, conf) {\n super(conf);\n\n this.mouseTarget = Util.initValue(mouseTarget, window);\n this.ease = Util.initValue(ease, 0.7);\n\n this._allowEmitting = false;\n this.initEventHandler();\n }\n\n initEventHandler() {\n this.mousemoveHandler = e => this.mousemove.call(this, e);\n this.mousedownHandler = e => this.mousedown.call(this, e);\n this.mouseupHandler = e => this.mouseup.call(this, e);\n\n this.mouseTarget.addEventListener(\n \"mousemove\",\n this.mousemoveHandler,\n false\n );\n }\n\n /**\n * start emit particle\n * @method emit\n */\n emit() {\n this._allowEmitting = true;\n }\n\n /**\n * stop emiting\n * @method stop\n */\n stop() {\n this._allowEmitting = false;\n }\n\n mousemove(e) {\n if (e.layerX || e.layerX === 0) {\n this.p.x += (e.layerX - this.p.x) * this.ease;\n this.p.y += (e.layerY - this.p.y) * this.ease;\n } else if (e.offsetX || e.offsetX === 0) {\n this.p.x += (e.offsetX - this.p.x) * this.ease;\n this.p.y += (e.offsetY - this.p.y) * this.ease;\n }\n\n if (this._allowEmitting) super.emit(\"once\");\n }\n\n /**\n * Destory this Emitter\n * @method destroy\n */\n destroy() {\n super.destroy();\n this.mouseTarget.removeEventListener(\n \"mousemove\",\n this.mousemoveHandler,\n false\n );\n }\n}\n","import Pool from \"../core/Pool\";\n\nexport default class BaseRenderer {\n constructor(element, stroke) {\n this.pool = new Pool();\n this.element = element;\n this.stroke = stroke;\n this.circleConf = { isCircle: true };\n\n this.initHandler();\n this.name = \"BaseRenderer\";\n }\n\n setStroke(color = \"#000000\", thinkness = 1) {\n this.stroke = { color, thinkness };\n }\n\n initHandler() {\n this._protonUpdateHandler = () => {\n this.onProtonUpdate.call(this);\n };\n\n this._protonUpdateAfterHandler = () => {\n this.onProtonUpdateAfter.call(this);\n };\n\n this._emitterAddedHandler = emitter => {\n this.onEmitterAdded.call(this, emitter);\n };\n\n this._emitterRemovedHandler = emitter => {\n this.onEmitterRemoved.call(this, emitter);\n };\n\n this._particleCreatedHandler = particle => {\n this.onParticleCreated.call(this, particle);\n };\n\n this._particleUpdateHandler = particle => {\n this.onParticleUpdate.call(this, particle);\n };\n\n this._particleDeadHandler = particle => {\n this.onParticleDead.call(this, particle);\n };\n }\n\n init(proton) {\n this.parent = proton;\n\n proton.addEventListener(\"PROTON_UPDATE\", this._protonUpdateHandler);\n proton.addEventListener(\n \"PROTON_UPDATE_AFTER\",\n this._protonUpdateAfterHandler\n );\n\n proton.addEventListener(\"EMITTER_ADDED\", this._emitterAddedHandler);\n proton.addEventListener(\"EMITTER_REMOVED\", this._emitterRemovedHandler);\n\n proton.addEventListener(\n \"PARTICLE_CREATED\",\n this._particleCreatedHandler\n );\n proton.addEventListener(\"PARTICLE_UPDATE\", this._particleUpdateHandler);\n proton.addEventListener(\"PARTICLE_DEAD\", this._particleDeadHandler);\n }\n\n resize(width, height) {}\n\n destroy() {\n this.remove();\n }\n\n remove(proton) {\n this.parent.removeEventListener(\n \"PROTON_UPDATE\",\n this._protonUpdateHandler\n );\n this.parent.removeEventListener(\n \"PROTON_UPDATE_AFTER\",\n this._protonUpdateAfterHandler\n );\n\n this.parent.removeEventListener(\n \"EMITTER_ADDED\",\n this._emitterAddedHandler\n );\n this.parent.removeEventListener(\n \"EMITTER_REMOVED\",\n this._emitterRemovedHandler\n );\n\n this.parent.removeEventListener(\n \"PARTICLE_CREATED\",\n this._particleCreatedHandler\n );\n this.parent.removeEventListener(\n \"PARTICLE_UPDATE\",\n this._particleUpdateHandler\n );\n this.parent.removeEventListener(\n \"PARTICLE_DEAD\",\n this._particleDeadHandler\n );\n\n this.parent = null;\n }\n\n onProtonUpdate() {}\n onProtonUpdateAfter() {}\n\n onEmitterAdded(emitter) {}\n onEmitterRemoved(emitter) {}\n\n onParticleCreated(particle) {}\n onParticleUpdate(particle) {}\n onParticleDead(particle) {}\n}\n","import ImgUtil from \"../utils/ImgUtil\";\nimport ColorUtil from \"../utils/ColorUtil\";\nimport MathUtil from \"../math/MathUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class CanvasRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.context = this.element.getContext(\"2d\");\n this.bufferCache = {};\n this.name = \"CanvasRenderer\";\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n onProtonUpdate() {\n this.context.clearRect(0, 0, this.element.width, this.element.height);\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.color = particle.color || \"#ff0000\";\n }\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n if (particle.body instanceof Image) this.drawImage(particle);\n } else {\n this.drawCircle(particle);\n }\n }\n\n onParticleDead(particle) {\n particle.body = null;\n }\n\n // private\n addImg2Body(img, particle) {\n particle.body = img;\n }\n\n // private drawCircle\n drawImage(particle) {\n const w = (particle.body.width * particle.scale) | 0;\n const h = (particle.body.height * particle.scale) | 0;\n const x = particle.p.x - w / 2;\n const y = particle.p.y - h / 2;\n\n if (!!particle.color) {\n if (!particle.data[\"buffer\"])\n particle.data.buffer = this.createBuffer(particle.body);\n\n const bufContext = particle.data.buffer.getContext(\"2d\");\n bufContext.clearRect(\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height\n );\n bufContext.globalAlpha = particle.alpha;\n bufContext.drawImage(particle.body, 0, 0);\n\n bufContext.globalCompositeOperation = \"source-atop\";\n bufContext.fillStyle = ColorUtil.rgbToHex(particle.rgb);\n bufContext.fillRect(\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height\n );\n bufContext.globalCompositeOperation = \"source-over\";\n bufContext.globalAlpha = 1;\n\n this.context.drawImage(\n particle.data.buffer,\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height,\n x,\n y,\n w,\n h\n );\n } else {\n this.context.save();\n\n this.context.globalAlpha = particle.alpha;\n this.context.translate(particle.p.x, particle.p.y);\n this.context.rotate(MathUtil.degreeTransform(particle.rotation));\n this.context.translate(-particle.p.x, -particle.p.y);\n this.context.drawImage(\n particle.body,\n 0,\n 0,\n particle.body.width,\n particle.body.height,\n x,\n y,\n w,\n h\n );\n\n this.context.globalAlpha = 1;\n this.context.restore();\n }\n }\n\n // private drawCircle --\n drawCircle(particle) {\n if (particle.rgb) {\n this.context.fillStyle = `rgba(${particle.rgb.r},${particle.rgb.g},${particle.rgb.b},${particle.alpha})`;\n } else {\n this.context.fillStyle = particle.color;\n }\n\n // draw circle\n this.context.beginPath();\n this.context.arc(\n particle.p.x,\n particle.p.y,\n particle.radius,\n 0,\n Math.PI * 2,\n true\n );\n\n if (this.stroke) {\n this.context.strokeStyle = this.stroke.color;\n this.context.lineWidth = this.stroke.thinkness;\n this.context.stroke();\n }\n\n this.context.closePath();\n this.context.fill();\n }\n\n // private createBuffer\n createBuffer(image) {\n if (image instanceof Image) {\n const size = image.width + \"_\" + image.height;\n let canvas = this.bufferCache[size];\n\n if (!canvas) {\n canvas = document.createElement(\"canvas\");\n canvas.width = image.width;\n canvas.height = image.height;\n this.bufferCache[size] = canvas;\n }\n\n return canvas;\n }\n }\n}\n","import DomUtil from \"../utils/DomUtil\";\nimport ImgUtil from \"../utils/ImgUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class DomRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.transform3d = false;\n this.name = \"DomRenderer\";\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n this.element.appendChild(particle.body);\n }\n }\n\n onParticleUpdate(particle) {\n if (this.bodyReady(particle)) {\n if (this.transform3d)\n DomUtil.transform3d(\n particle.body,\n particle.p.x,\n particle.p.y,\n particle.scale,\n particle.rotation\n );\n else\n DomUtil.transform(\n particle.body,\n particle.p.x,\n particle.p.y,\n particle.scale,\n particle.rotation\n );\n\n particle.body.style.opacity = particle.alpha;\n if (particle.body.isCircle) {\n particle.body.style.backgroundColor = particle.color || \"#ff0000\";\n }\n }\n }\n\n onParticleDead(particle) {\n if (this.bodyReady(particle)) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n }\n\n bodyReady(particle) {\n return (\n typeof particle.body === \"object\" &&\n particle.body &&\n !particle.body.isInner\n );\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = this.pool.get(img, particle);\n DomUtil.resize(particle.body, img.width, img.height);\n\n this.element.appendChild(particle.body);\n }\n\n createBody(body, particle) {\n if (body.isCircle) return this.createCircle(particle);\n else return this.createSprite(body, particle);\n }\n\n // private --\n createCircle(particle) {\n const dom = DomUtil.createDiv(\n `${particle.id}_dom`,\n 2 * particle.radius,\n 2 * particle.radius\n );\n dom.style.borderRadius = `${particle.radius}px`;\n\n if (this.stroke) {\n dom.style.borderColor = this.stroke.color;\n dom.style.borderWidth = `${this.stroke.thinkness}px`;\n }\n dom.isCircle = true;\n\n return dom;\n }\n\n createSprite(body, particle) {\n const url = typeof body === \"string\" ? body : body.src;\n const dom = DomUtil.createDiv(\n `${particle.id}_dom`,\n body.width,\n body.height\n );\n dom.style.backgroundImage = `url(${url})`;\n\n return dom;\n }\n}\n","import BaseRenderer from \"./BaseRenderer\";\n\nexport default class EaselRenderer extends BaseRenderer {\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.name = \"EaselRenderer\";\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n this.createSprite(particle);\n } else {\n this.createCircle(particle);\n }\n\n this.element.addChild(particle.body);\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n particle.body.x = particle.p.x;\n particle.body.y = particle.p.y;\n\n particle.body.alpha = particle.alpha;\n particle.body.scaleX = particle.body.scaleY = particle.scale;\n particle.body.rotation = particle.rotation;\n }\n }\n\n onParticleDead(particle) {\n if (particle.body) {\n particle.body.parent && particle.body.parent.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n if (particle.graphics) this.pool.expire(particle.graphics);\n }\n\n // private\n createSprite(particle) {\n particle.body = this.pool.get(particle.body);\n\n if (particle.body.parent) return;\n if (particle.body[\"image\"]) {\n particle.body.regX = particle.body.image.width / 2;\n particle.body.regY = particle.body.image.height / 2;\n }\n }\n\n createCircle(particle) {\n const graphics = this.pool.get(createjs.Graphics);\n\n if (this.stroke) {\n if (this.stroke instanceof String) graphics.beginStroke(this.stroke);\n else graphics.beginStroke(\"#000000\");\n }\n graphics\n .beginFill(particle.color || \"#ff0000\")\n .drawCircle(0, 0, particle.radius);\n\n const shape = this.pool.get(createjs.Shape, [graphics]);\n\n particle.body = shape;\n particle.graphics = graphics;\n }\n}\n","import Rectangle from \"../math/Rectangle\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class PixelRenderer extends BaseRenderer {\n constructor(element, rectangle) {\n super(element);\n\n this.context = this.element.getContext(\"2d\");\n this.imageData = null;\n this.rectangle = null;\n this.rectangle = rectangle;\n this.createImageData(rectangle);\n\n this.name = \"PixelRenderer\";\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n createImageData(rectangle) {\n this.rectangle = rectangle\n ? rectangle\n : new Rectangle(0, 0, this.element.width, this.element.height);\n this.imageData = this.context.createImageData(\n this.rectangle.width,\n this.rectangle.height\n );\n this.context.putImageData(\n this.imageData,\n this.rectangle.x,\n this.rectangle.y\n );\n }\n\n onProtonUpdate() {\n this.context.clearRect(\n this.rectangle.x,\n this.rectangle.y,\n this.rectangle.width,\n this.rectangle.height\n );\n this.imageData = this.context.getImageData(\n this.rectangle.x,\n this.rectangle.y,\n this.rectangle.width,\n this.rectangle.height\n );\n }\n\n onProtonUpdateAfter() {\n this.context.putImageData(\n this.imageData,\n this.rectangle.x,\n this.rectangle.y\n );\n }\n\n onParticleCreated(particle) {}\n\n onParticleUpdate(particle) {\n if (this.imageData) {\n this.setPixel(\n this.imageData,\n Math.floor(particle.p.x - this.rectangle.x),\n Math.floor(particle.p.y - this.rectangle.y),\n particle\n );\n }\n }\n\n setPixel(imagedata, x, y, particle) {\n const rgb = particle.rgb;\n if (x < 0 || x > this.element.width || y < 0 || y > this.elementwidth)\n return;\n\n const i = ((y >> 0) * imagedata.width + (x >> 0)) * 4;\n\n imagedata.data[i] = rgb.r;\n imagedata.data[i + 1] = rgb.g;\n imagedata.data[i + 2] = rgb.b;\n imagedata.data[i + 3] = particle.alpha * 255;\n }\n\n onParticleDead(particle) {}\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport MathUtil from \"../math/MathUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nlet PIXIClass;\nexport default class PixiRenderer extends BaseRenderer {\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.color = false;\n this.setColor = false;\n this.blendMode = null;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.setPIXI(window.PIXI);\n\n this.name = \"PixiRenderer\";\n }\n\n setPIXI(PIXI) {\n try {\n PIXIClass = PIXI || { Sprite: {} };\n this.createFromImage =\n PIXIClass.Sprite.from || PIXIClass.Sprite.fromImage;\n } catch (e) {}\n }\n\n onProtonUpdate() {}\n\n /**\n * @param particle\n */\n onParticleCreated(particle) {\n if (particle.body) {\n particle.body = this.pool.get(particle.body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n }\n\n if (this.blendMode) {\n particle.body.blendMode = this.blendMode;\n }\n\n this.element.addChild(particle.body);\n }\n\n /**\n * @param particle\n */\n onParticleUpdate(particle) {\n this.transform(particle, particle.body);\n\n if (this.setColor === true || this.color === true) {\n particle.body.tint = ColorUtil.getHex16FromParticle(particle);\n }\n }\n\n /**\n * @param particle\n */\n onParticleDead(particle) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n destroy(particles) {\n super.destroy();\n this.pool.destroy();\n\n let i = particles.length;\n while (i--) {\n let particle = particles[i];\n if (particle.body) {\n this.element.removeChild(particle.body);\n }\n }\n }\n\n transform(particle, target) {\n target.x = particle.p.x;\n target.y = particle.p.y;\n\n target.alpha = particle.alpha;\n\n target.scale.x = particle.scale;\n target.scale.y = particle.scale;\n\n // using cached version of MathUtil.PI_180 for slight performance increase.\n target.rotation = particle.rotation * MathUtil.PI_180; // MathUtil.PI_180;\n }\n\n createBody(body, particle) {\n if (body.isCircle) return this.createCircle(particle);\n else return this.createSprite(body);\n }\n\n createSprite(body) {\n const sprite = body.isInner\n ? this.createFromImage(body.src)\n : new PIXIClass.Sprite(body);\n\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n\n return sprite;\n }\n\n createCircle(particle) {\n const graphics = new PIXIClass.Graphics();\n\n if (this.stroke) {\n const stroke = this.stroke instanceof String ? this.stroke : 0x000000;\n graphics.beginStroke(stroke);\n }\n\n graphics.beginFill(particle.color || 0x008ced);\n graphics.drawCircle(0, 0, particle.radius);\n graphics.endFill();\n\n return graphics;\n }\n}\n","import Mat3 from \"../math/Mat3\";\n\nexport default class MStack {\n constructor() {\n this.mats = [];\n this.size = 0;\n\n for (let i = 0; i < 20; i++)\n this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0]));\n }\n\n set(m, i) {\n if (i === 0) Mat3.set(m, this.mats[0]);\n else Mat3.multiply(this.mats[i - 1], m, this.mats[i]);\n\n this.size = Math.max(this.size, i + 1);\n }\n\n push(m) {\n if (this.size === 0) Mat3.set(m, this.mats[0]);\n else Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]);\n\n this.size++;\n }\n\n pop() {\n if (this.size > 0) this.size--;\n }\n\n top() {\n return this.mats[this.size - 1];\n }\n}\n","import Mat3 from '../math/Mat3';\nimport BaseRenderer from './BaseRenderer';\n\nimport Util from '../utils/Util';\nimport ImgUtil from '../utils/ImgUtil';\nimport MStack from '../utils/MStack';\nimport DomUtil from '../utils/DomUtil';\nimport WebGLUtil from '../utils/WebGLUtil';\nimport MathUtil from '../math/MathUtil';\n\nexport default class WebGLRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.gl = this.element.getContext('experimental-webgl', { antialias: true, stencil: false, depth: false });\n if (!this.gl) alert('Sorry your browser do not suppest WebGL!');\n\n this.initVar();\n this.setMaxRadius();\n this.initShaders();\n this.initBuffers();\n\n this.gl.blendEquation(this.gl.FUNC_ADD);\n this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);\n this.gl.enable(this.gl.BLEND);\n\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.name = 'WebGLRenderer';\n }\n\n init(proton) {\n super.init(proton);\n this.resize(this.element.width, this.element.height);\n }\n\n resize(width, height) {\n this.umat[4] = -2;\n this.umat[7] = 1;\n\n this.smat[0] = 1 / width;\n this.smat[4] = 1 / height;\n\n this.mstack.set(this.umat, 0);\n this.mstack.set(this.smat, 1);\n\n this.gl.viewport(0, 0, width, height);\n this.element.width = width;\n this.element.height = height;\n }\n\n setMaxRadius(radius) {\n this.circleCanvasURL = this.createCircle(radius);\n }\n\n getVertexShader() {\n const vsSource = ['uniform vec2 viewport;', 'attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform mat3 tMat;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'void main() {', 'vec3 v = tMat * vec3(aVertexPosition, 1.0);', 'gl_Position = vec4(v.x, v.y, 0, 1);', 'vTextureCoord = aTextureCoord;', 'alpha = tMat[0][2];', '}'].join('\\n');\n return vsSource;\n }\n\n getFragmentShader() {\n const fsSource = ['precision mediump float;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'uniform sampler2D uSampler;', 'uniform vec4 color;', 'uniform bool useTexture;', 'uniform vec3 uColor;', 'void main() {', 'vec4 textureColor = texture2D(uSampler, vTextureCoord);', 'gl_FragColor = textureColor * vec4(uColor, 1.0);', 'gl_FragColor.w *= alpha;', '}'].join('\\n');\n return fsSource;\n }\n\n initVar() {\n this.mstack = new MStack();\n this.umat = Mat3.create([2, 0, 1, 0, -2, 0, -1, 1, 1]);\n this.smat = Mat3.create([1 / 100, 0, 1, 0, 1 / 100, 0, 0, 0, 1]);\n this.texturebuffers = {};\n }\n\n blendEquation(A) {\n this.gl.blendEquation(this.gl[A]);\n }\n\n blendFunc(A, B) {\n this.gl.blendFunc(this.gl[A], this.gl[B]);\n }\n\n getShader(gl, str, fs) {\n const shader = fs ? gl.createShader(gl.FRAGMENT_SHADER) : gl.createShader(gl.VERTEX_SHADER);\n\n gl.shaderSource(shader, str);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n }\n\n initShaders() {\n const fragmentShader = this.getShader(this.gl, this.getFragmentShader(), true);\n const vertexShader = this.getShader(this.gl, this.getVertexShader(), false);\n\n this.sprogram = this.gl.createProgram();\n this.gl.attachShader(this.sprogram, vertexShader);\n this.gl.attachShader(this.sprogram, fragmentShader);\n this.gl.linkProgram(this.sprogram);\n\n if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS))\n alert('Could not initialise shaders');\n\n this.gl.useProgram(this.sprogram);\n this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, 'aVertexPosition');\n this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, 'aTextureCoord');\n this.gl.enableVertexAttribArray(this.sprogram.tca);\n this.gl.enableVertexAttribArray(this.sprogram.vpa);\n\n this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, 'tMat');\n this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, 'uSampler');\n this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, 'useTexture');\n this.sprogram.color = this.gl.getUniformLocation(this.sprogram, 'uColor');\n this.gl.uniform1i(this.sprogram.useTex, 1);\n };\n\n initBuffers() {\n const vs = [0, 3, 1, 0, 2, 3];\n let idx;\n\n this.unitIBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vs), this.gl.STATIC_DRAW);\n\n let i;\n let ids = [];\n for (i = 0; i < 100; i++) ids.push(i);\n idx = new Uint16Array(ids);\n\n this.unitI33 = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitI33);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n\n ids = [];\n for (i = 0; i < 100; i++) ids.push(i, i + 1, i + 2);\n idx = new Uint16Array(ids);\n\n this.stripBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.stripBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n };\n\n createCircle(raidus) {\n this.circleCanvasRadius = WebGLUtil.nhpot(Util.initValue(raidus, 32));\n const canvas = DomUtil.createCanvas('circle_canvas', this.circleCanvasRadius * 2, this.circleCanvasRadius * 2);\n const context = canvas.getContext('2d');\n\n context.beginPath();\n context.arc(this.circleCanvasRadius, this.circleCanvasRadius, this.circleCanvasRadius, 0, Math.PI * 2, true);\n context.closePath();\n context.fillStyle = '#FFF';\n context.fill();\n\n return canvas.toDataURL();\n };\n\n drawImg2Canvas(particle) {\n const _w = particle.body.width;\n const _h = particle.body.height;\n\n const _width = WebGLUtil.nhpot(particle.body.width);\n const _height = WebGLUtil.nhpot(particle.body.height);\n\n const _scaleX = particle.body.width / _width;\n const _scaleY = particle.body.height / _height;\n\n if (!this.texturebuffers[particle.data.src])\n this.texturebuffers[particle.data.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()];\n\n particle.data.texture = this.texturebuffers[particle.data.src][0];\n particle.data.vcBuffer = this.texturebuffers[particle.data.src][1];\n particle.data.tcBuffer = this.texturebuffers[particle.data.src][2];\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _scaleX, 0.0, 0.0, _scaleY, _scaleY, _scaleY]), this.gl.STATIC_DRAW);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _w, 0.0, 0.0, _h, _w, _h]), this.gl.STATIC_DRAW);\n\n const context = particle.data.canvas.getContext('2d');\n const data = context.getImageData(0, 0, _width, _height);\n\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture);\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, data);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_NEAREST);\n this.gl.generateMipmap(this.gl.TEXTURE_2D);\n\n particle.data.textureLoaded = true;\n particle.data.textureWidth = _w;\n particle.data.textureHeight = _h;\n }\n\n onProtonUpdate() {\n // this.gl.clearColor(0, 0, 0, 1);\n // this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\n }\n\n onParticleCreated(particle) {\n particle.data.textureLoaded = false;\n particle.data.tmat = Mat3.create();\n particle.data.tmat[8] = 1;\n particle.data.imat = Mat3.create();\n particle.data.imat[8] = 1;\n\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n ImgUtil.getImgFromCache(this.circleCanvasURL, this.addImg2Body, particle);\n particle.data.oldScale = particle.radius / this.circleCanvasRadius;\n }\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = img;\n particle.data.src = img.src;\n particle.data.canvas = ImgUtil.getCanvasFromCache(img);\n particle.data.oldScale = 1;\n\n this.drawImg2Canvas(particle);\n }\n\n onParticleUpdate(particle) {\n if (particle.data.textureLoaded) {\n this.updateMatrix(particle);\n\n this.gl.uniform3f(this.sprogram.color, particle.rgb.r / 255, particle.rgb.g / 255, particle.rgb.b / 255);\n this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top());\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture);\n this.gl.uniform1i(this.sprogram.samplerUniform, 0);\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n\n this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0);\n\n this.mstack.pop();\n }\n }\n\n onParticleDead(particle) { }\n\n updateMatrix(particle) {\n const moveOriginMatrix = WebGLUtil.makeTranslation(-particle.data.textureWidth / 2, -particle.data.textureHeight / 2);\n const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y);\n\n const angel = particle.rotation * (MathUtil.PI_180);\n const rotationMatrix = WebGLUtil.makeRotation(angel);\n\n const scale = particle.scale * particle.data.oldScale;\n const scaleMatrix = WebGLUtil.makeScale(scale, scale);\n let matrix = WebGLUtil.matrixMultiply(moveOriginMatrix, scaleMatrix);\n\n matrix = WebGLUtil.matrixMultiply(matrix, rotationMatrix);\n matrix = WebGLUtil.matrixMultiply(matrix, translationMatrix);\n\n Mat3.inverse(matrix, particle.data.imat);\n matrix[2] = particle.alpha;\n\n this.mstack.push(matrix);\n }\n}","import BaseRenderer from \"./BaseRenderer\";\n\nexport default class CustomRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.name = \"CustomRenderer\";\n }\n}\n","import Zone from \"./Zone\";\nimport Util from \"../utils/Util\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class LineZone extends Zone {\n constructor(x1, y1, x2, y2, direction) {\n super();\n\n if (x2 - x1 >= 0) {\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n } else {\n this.x1 = x2;\n this.y1 = y2;\n this.x2 = x1;\n this.y2 = y1;\n }\n\n this.dx = this.x2 - this.x1;\n this.dy = this.y2 - this.y1;\n\n this.minx = Math.min(this.x1, this.x2);\n this.miny = Math.min(this.y1, this.y2);\n this.maxx = Math.max(this.x1, this.x2);\n this.maxy = Math.max(this.y1, this.y2);\n\n this.dot = this.x2 * this.y1 - this.x1 * this.y2;\n this.xxyy = this.dx * this.dx + this.dy * this.dy;\n\n this.gradient = this.getGradient();\n this.length = this.getLength();\n this.direction = Util.initValue(direction, \">\");\n }\n\n getPosition() {\n this.random = Math.random();\n\n this.vector.x =\n this.x1 + this.random * this.length * Math.cos(this.gradient);\n this.vector.y =\n this.y1 + this.random * this.length * Math.sin(this.gradient);\n\n return this.vector;\n }\n\n getDirection(x, y) {\n const A = this.dy;\n const B = -this.dx;\n const C = this.dot;\n const D = B === 0 ? 1 : B;\n\n if ((A * x + B * y + C) * D > 0) return true;\n else return false;\n }\n\n getDistance(x, y) {\n const A = this.dy;\n const B = -this.dx;\n const C = this.dot;\n const D = A * x + B * y + C;\n\n return D / Math.sqrt(this.xxyy);\n }\n\n getSymmetric(v) {\n const tha2 = v.getGradient();\n const tha1 = this.getGradient();\n const tha = 2 * (tha1 - tha2);\n\n const oldx = v.x;\n const oldy = v.y;\n\n v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n\n return v;\n }\n\n getGradient() {\n return Math.atan2(this.dy, this.dx);\n }\n\n rangeOut(particle) {\n const angle = Math.abs(this.getGradient());\n\n if (angle <= MathUtil.PI / 4) {\n if (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true;\n } else {\n if (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true;\n }\n\n return false;\n }\n\n getLength() {\n return Math.sqrt(this.dx * this.dx + this.dy * this.dy);\n }\n\n crossing(particle) {\n if (this.crossType === \"dead\") {\n if (\n this.direction === \">\" ||\n this.direction === \"R\" ||\n this.direction === \"right\" ||\n this.direction === \"down\"\n ) {\n if (!this.rangeOut(particle)) return;\n if (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n } else {\n if (!this.rangeOut(particle)) return;\n if (!this.getDirection(particle.p.x, particle.p.y))\n particle.dead = true;\n }\n } else if (this.crossType === \"bound\") {\n if (!this.rangeOut(particle)) return;\n\n if (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) {\n if (this.dx === 0) {\n particle.v.x *= -1;\n } else if (this.dy === 0) {\n particle.v.y *= -1;\n } else {\n this.getSymmetric(particle.v);\n }\n }\n } else if (this.crossType === \"cross\") {\n if (this.alert) {\n console.error(\"Sorry, LineZone does not support cross method!\");\n this.alert = false;\n }\n }\n }\n}\n","import Zone from \"./Zone\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class CircleZone extends Zone {\n constructor(x, y, radius) {\n super();\n\n this.x = x;\n this.y = y;\n this.radius = radius;\n\n this.angle = 0;\n this.center = { x, y };\n }\n\n getPosition() {\n this.angle = MathUtil.PIx2 * Math.random();\n this.randomRadius = Math.random() * this.radius;\n\n this.vector.x = this.x + this.randomRadius * Math.cos(this.angle);\n this.vector.y = this.y + this.randomRadius * Math.sin(this.angle);\n\n return this.vector;\n }\n\n setCenter(x, y) {\n this.center.x = x;\n this.center.y = y;\n }\n\n crossing(particle) {\n const d = particle.p.distanceTo(this.center);\n\n if (this.crossType === \"dead\") {\n if (d - particle.radius > this.radius) particle.dead = true;\n } else if (this.crossType === \"bound\") {\n if (d + particle.radius >= this.radius) this.getSymmetric(particle);\n } else if (this.crossType === \"cross\") {\n if (this.alert) {\n console.error(\"Sorry, CircleZone does not support cross method!\");\n this.alert = false;\n }\n }\n }\n\n getSymmetric(particle) {\n let tha2 = particle.v.getGradient();\n let tha1 = this.getGradient(particle);\n\n let tha = 2 * (tha1 - tha2);\n let oldx = particle.v.x;\n let oldy = particle.v.y;\n\n particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n }\n\n getGradient(particle) {\n return (\n -MathUtil.PI_2 +\n Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x)\n );\n }\n}\n","import Zone from \"./Zone\";\n\nexport default class RectZone extends Zone {\n constructor(x, y, width, height) {\n super();\n\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n\n getPosition() {\n this.vector.x = this.x + Math.random() * this.width;\n this.vector.y = this.y + Math.random() * this.height;\n\n return this.vector;\n }\n\n crossing(particle) {\n // particle dead zone\n if (this.crossType === \"dead\") {\n if (particle.p.x + particle.radius < this.x) particle.dead = true;\n else if (particle.p.x - particle.radius > this.x + this.width)\n particle.dead = true;\n\n if (particle.p.y + particle.radius < this.y) particle.dead = true;\n else if (particle.p.y - particle.radius > this.y + this.height)\n particle.dead = true;\n }\n\n // particle bound zone\n else if (this.crossType === \"bound\") {\n if (particle.p.x - particle.radius < this.x) {\n particle.p.x = this.x + particle.radius;\n particle.v.x *= -1;\n } else if (particle.p.x + particle.radius > this.x + this.width) {\n particle.p.x = this.x + this.width - particle.radius;\n particle.v.x *= -1;\n }\n\n if (particle.p.y - particle.radius < this.y) {\n particle.p.y = this.y + particle.radius;\n particle.v.y *= -1;\n } else if (particle.p.y + particle.radius > this.y + this.height) {\n particle.p.y = this.y + this.height - particle.radius;\n particle.v.y *= -1;\n }\n }\n\n // particle cross zone\n else if (this.crossType === \"cross\") {\n if (particle.p.x + particle.radius < this.x && particle.v.x <= 0)\n particle.p.x = this.x + this.width + particle.radius;\n else if (\n particle.p.x - particle.radius > this.x + this.width &&\n particle.v.x >= 0\n )\n particle.p.x = this.x - particle.radius;\n\n if (particle.p.y + particle.radius < this.y && particle.v.y <= 0)\n particle.p.y = this.y + this.height + particle.radius;\n else if (\n particle.p.y - particle.radius > this.y + this.height &&\n particle.v.y >= 0\n )\n particle.p.y = this.y - particle.radius;\n }\n }\n}\n","import Zone from \"./Zone\";\nimport Util from \"../utils/Util\";\n\nexport default class ImageZone extends Zone {\n constructor(imageData, x, y, d) {\n super();\n\n this.reset(imageData, x, y, d);\n }\n\n reset(imageData, x, y, d) {\n this.imageData = imageData;\n this.x = Util.initValue(x, 0);\n this.y = Util.initValue(y, 0);\n this.d = Util.initValue(d, 2);\n\n this.vectors = [];\n this.setVectors();\n }\n\n setVectors() {\n let i, j;\n const length1 = this.imageData.width;\n const length2 = this.imageData.height;\n\n for (i = 0; i < length1; i += this.d) {\n for (j = 0; j < length2; j += this.d) {\n let index = ((j >> 0) * length1 + (i >> 0)) * 4;\n\n if (this.imageData.data[index + 3] > 0) {\n this.vectors.push({ x: i + this.x, y: j + this.y });\n }\n }\n }\n\n return this.vector;\n }\n\n getBound(x, y) {\n var index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n if (this.imageData.data[index + 3] > 0) return true;\n else return false;\n }\n\n getPosition() {\n const vector = Util.getRandFromArray(this.vectors);\n return this.vector.copy(vector);\n }\n\n getColor(x, y) {\n x -= this.x;\n y -= this.y;\n var i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\n return {\n r: this.imageData.data[i],\n g: this.imageData.data[i + 1],\n b: this.imageData.data[i + 2],\n a: this.imageData.data[i + 3]\n };\n }\n\n crossing(particle) {\n if (this.crossType === \"dead\") {\n if (this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n particle.dead = true;\n else particle.dead = false;\n } else if (this.crossType === \"bound\") {\n if (!this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n particle.v.negate();\n }\n }\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport CircleZone from \"../zone/CircleZone\";\nimport PointZone from \"../zone/PointZone\";\nimport LineZone from \"../zone/LineZone\";\nimport RectZone from \"../zone/RectZone\";\n\nexport default {\n addEventListener(proton, func) {\n proton.addEventListener(\"PROTON_UPDATE_AFTER\", () => func());\n },\n\n getStyle(color = \"#ff0000\") {\n const rgb = ColorUtil.hexToRgb(color);\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`;\n },\n\n drawZone(proton, canvas, zone, clear) {\n const context = canvas.getContext(\"2d\");\n const style = this.getStyle();\n\n this.addEventListener(proton, () => {\n if (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n if (zone instanceof PointZone) {\n context.beginPath();\n context.fillStyle = style;\n context.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true);\n context.fill();\n context.closePath();\n } else if (zone instanceof LineZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.moveTo(zone.x1, zone.y1);\n context.lineTo(zone.x2, zone.y2);\n context.stroke();\n context.closePath();\n } else if (zone instanceof RectZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.drawRect(zone.x, zone.y, zone.width, zone.height);\n context.stroke();\n context.closePath();\n } else if (zone instanceof CircleZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true);\n context.stroke();\n context.closePath();\n }\n });\n },\n\n drawEmitter(proton, canvas, emitter, clear) {\n const context = canvas.getContext(\"2d\");\n const style = this.getStyle();\n\n this.addEventListener(proton, () => {\n if (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n context.beginPath();\n context.fillStyle = style;\n context.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true);\n context.fill();\n context.closePath();\n });\n }\n};\n","import Proton from \"./core/Proton\";\nimport Particle from \"./core/Particle\";\nimport Pool from \"./core/Pool\";\n\nimport Util from \"./utils/Util\";\nimport ColorUtil from \"./utils/ColorUtil\";\nimport MathUtil from \"./math/MathUtil\";\nimport Vector2D from \"./math/Vector2D\";\nimport Polar2D from \"./math/Polar2D\";\nimport Mat3 from \"./math/Mat3\";\nimport Span from \"./math/Span\";\nimport ArraySpan from \"./math/ArraySpan\";\nimport Rectangle from \"./math/Rectangle\";\nimport ease from \"./math/ease\";\n\nimport Rate from \"./initialize/Rate\";\nimport Initialize from \"./initialize/Initialize\";\nimport Life from \"./initialize/Life\";\nimport Position from \"./initialize/Position\";\nimport Velocity from \"./initialize/Velocity\";\nimport Mass from \"./initialize/Mass\";\nimport Radius from \"./initialize/Radius\";\nimport Body from \"./initialize/Body\";\n\nimport Behaviour from \"./behaviour/Behaviour\";\nimport Force from \"./behaviour/Force\";\nimport Attraction from \"./behaviour/Attraction\";\nimport RandomDrift from \"./behaviour/RandomDrift\";\nimport Gravity from \"./behaviour/Gravity\";\nimport Collision from \"./behaviour/Collision\";\nimport CrossZone from \"./behaviour/CrossZone\";\nimport Alpha from \"./behaviour/Alpha\";\nimport Scale from \"./behaviour/Scale\";\nimport Rotate from \"./behaviour/Rotate\";\nimport Color from \"./behaviour/Color\";\nimport Cyclone from \"./behaviour/Cyclone\";\nimport Repulsion from \"./behaviour/Repulsion\";\nimport GravityWell from \"./behaviour/GravityWell\";\n\nimport Emitter from \"./emitter/Emitter\";\nimport BehaviourEmitter from \"./emitter/BehaviourEmitter\";\nimport FollowEmitter from \"./emitter/FollowEmitter\";\n\nimport CanvasRenderer from \"./render/CanvasRenderer\";\nimport DomRenderer from \"./render/DomRenderer\";\nimport EaselRenderer from \"./render/EaselRenderer\";\nimport PixelRenderer from \"./render/PixelRenderer\";\nimport PixiRenderer from \"./render/PixiRenderer\";\nimport WebGLRenderer from \"./render/WebGLRenderer\";\nimport CustomRenderer from \"./render/CustomRenderer\";\n\nimport Zone from \"./zone/Zone\";\nimport LineZone from \"./zone/LineZone\";\nimport CircleZone from \"./zone/CircleZone\";\nimport PointZone from \"./zone/PointZone\";\nimport RectZone from \"./zone/RectZone\";\nimport ImageZone from \"./zone/ImageZone\";\n\nimport Debug from \"./debug/Debug\";\n\n// namespace\nProton.Particle = Particle;\nProton.Pool = Pool;\n\nProton.Util = Util;\nProton.ColorUtil = ColorUtil;\nProton.MathUtil = MathUtil;\nProton.Vector2D = Proton.Vector = Vector2D;\nProton.Polar2D = Proton.Polar = Polar2D;\nProton.ArraySpan = ArraySpan;\nProton.Rectangle = Rectangle;\nProton.Rate = Rate;\nProton.ease = ease;\nProton.Span = Span;\nProton.Mat3 = Mat3;\nProton.getSpan = (a, b, center) => new Span(a, b, center);\nProton.createArraySpan = ArraySpan.createArraySpan;\n\nProton.Initialize = Proton.Init = Initialize;\nProton.Life = Proton.L = Life;\nProton.Position = Proton.P = Position;\nProton.Velocity = Proton.V = Velocity;\nProton.Mass = Proton.M = Mass;\nProton.Radius = Proton.R = Radius;\nProton.Body = Proton.B = Body;\n\nProton.Behaviour = Behaviour;\nProton.Force = Proton.F = Force;\nProton.Attraction = Proton.A = Attraction;\nProton.RandomDrift = Proton.RD = RandomDrift;\nProton.Gravity = Proton.G = Gravity;\nProton.Collision = Collision;\nProton.CrossZone = CrossZone;\nProton.Alpha = Alpha;\nProton.Scale = Proton.S = Scale;\nProton.Rotate = Rotate;\nProton.Color = Color;\nProton.Repulsion = Repulsion;\nProton.Cyclone = Cyclone;\nProton.GravityWell = GravityWell;\n\nProton.Emitter = Emitter;\nProton.BehaviourEmitter = BehaviourEmitter;\nProton.FollowEmitter = FollowEmitter;\n\nProton.Zone = Zone;\nProton.LineZone = LineZone;\nProton.CircleZone = CircleZone;\nProton.PointZone = PointZone;\nProton.RectZone = RectZone;\nProton.ImageZone = ImageZone;\n\nProton.CanvasRenderer = CanvasRenderer;\nProton.DomRenderer = DomRenderer;\nProton.EaselRenderer = EaselRenderer;\nProton.PixiRenderer = PixiRenderer;\nProton.PixelRenderer = PixelRenderer;\nProton.WebGLRenderer = Proton.WebGlRenderer = WebGLRenderer;\nProton.CustomRenderer = CustomRenderer;\n\nProton.Debug = Debug;\nUtil.assign(Proton, ease);\n\n// export\nexport default Proton;\n"],"names":["PI","MathUtil","num","this","Infinity","a","b","Math","floor","random","center","f","isInt","randomAToB","toString","slice","k","digits","pow","Span","isArray","Util","getRandFromArray","randomFloating","c","undefined","pan","getValue","initValue","length","i","tx","ty","angleInRadians","cos","s","sin","sx","sy","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b01","b02","b10","b11","b12","b20","b21","b22","id","width","height","position","dom","document","createElement","style","opacity","transform","resize","marginLeft","marginTop","div","x","y","scale","rotate","willChange","css3","key","val","bkey","charAt","toUpperCase","substr","imgsCache","canvasCache","canvasId","context","image","rect","drawImage","imagedata","getImageData","clearRect","img","callback","param","src","Image","onload","e","target","canvas","WebGLUtil","DomUtil","createCanvas","getContext","value","defaults","Object","prototype","call","arr","obj","ignore","indexOf","constructor","args","bind","apply","concat","particle","conf","hasProp","p","v","copy","props","prop","hasOwnProperty","getSpanValue","ImgUtil","destroy","source","assign","idsMap","Puid","type","uid","getIdFromCache","_index","_cache","isBody","isInner","Pool","params","__puid","getId","cache","pop","createOrClone","getCache","push","total","create","classApply","clone","count","Stats","body","add","emitter","getEmitter","renderer","getRenderer","str","proton","emitters","emitSpeed","getEmitterPos","initializes","concatArr","behaviours","name","getCreatedNumber","getCount","pool","container","innerHTML","cssText","join","addEventListener","_this","bg","color","parentNode","appendChild","emitterIndex","renderers","rendererIndex","result","cpool","round","EventDispatcher","listener","_listeners","removeEventListener","splice","listeners","handler","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","sleep","old","multiplyScalar","mass","clear","Proton","render","init","index","remove","parent","EMITTER_ADDED","EMITTER_REMOVED","_fps","PROTON_UPDATE","USE_CLOCK","then","Date","getTime","now","elapsed","amendChangeTabsBug","emittersUpdate","DEFAULT_INTERVAL","PROTON_UPDATE_AFTER","_interval","update","destroyAll","destroyOther","getAllParticles","fps","integrationType","stats","EULER","integrator","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","Rgb","r","g","PI_2","sqrt","ease","easeLinear","Vector2D","atan2","w","addVectors","subVectors","set","divideScalar","distanceToSquared","tha","dx","dy","alpha","Particle","N180_PI","life","age","dead","sprite","energy","radius","rotation","easing","rgb","reset","emptyObject","data","removeAllBehaviours","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","emptyArray","setProp","h","hex16","substring","parseInt","rbg","Number","Polar2D","getX","getY","abs","Mat3","mat3","mat","Float32Array","mat1","mat2","m","vec","ArraySpan","_arr","randomColor","toArray","Rectangle","right","bottom","Rate","startTime","nextTime","timePan","numPan","numpan","timepan","setSpanValue","Initialize","Life","lifePan","Zone","vector","crossType","alert","PointZone","error","Position","zone","getPosition","Velocity","rpan","thapan","rPan","thaPan","vr","polar2d","normalizeVelocity","PI_180","Mass","massPan","Radius","oldRadius","Body","imageTarget","Behaviour","getEasing","force","removeBehaviour","Force","fx","fy","normalizeForce","calculate","Attraction","targetPosition","normalizeValue","radiusSq","attractionForce","lengthSq","sub","normalize","RandomDrift","driftX","driftY","delay","panFoce","addXY","Gravity","Collision","collisionPool","delta","overlap","totalMass","averageMass1","averageMass2","distance","newPool","otherParticle","CrossZone","crossing","Alpha","same","alphaA","alphaB","Scale","scaleA","scaleB","Rotate","rotationA","rotationB","getDirection","influence","Color","createArraySpan","colorA","ColorUtil","hexToRgb","colorB","CHANGING","Cyclone","angle","span","String","toLowerCase","setAngleAndForce","cangle","cyclone","gradient","getGradient","Repulsion","GravityWell","centerPoint","distanceVec","factor","distanceSq","bindEmitter","setVectorVal","degreeTransform","Emitter","totalTime","stoped","emitTime","isNaN","rate","oldStoped","oldEmitTime","oldTotalTime","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mousemoveHandler","_this2","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","mouseTarget","_allowEmitting","layerX","layerY","offsetX","offsetY","babelHelpers.get","window","initEventHandler","BaseRenderer","thinkness","stroke","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","element","circleConf","isCircle","initHandler","CanvasRenderer","addImg2Body","drawCircle","bufContext","buffer","createBuffer","globalAlpha","globalCompositeOperation","fillStyle","rgbToHex","fillRect","save","translate","restore","beginPath","arc","strokeStyle","lineWidth","closePath","fill","size","bufferCache","DomRenderer","bodyReady","transform3d","backgroundColor","removeChild","babelHelpers.typeof","createCircle","createSprite","createDiv","borderRadius","borderColor","borderWidth","url","backgroundImage","createBody","EaselRenderer","addChild","scaleX","scaleY","graphics","regX","regY","createjs","Graphics","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","PIXIClass","PixiRenderer","PIXI","Sprite","createFromImage","from","fromImage","blendMode","setColor","tint","getHex16FromParticle","anchor","endFill","setPIXI","MStack","mats","multiply","umat","smat","mstack","gl","viewport","circleCanvasURL","texturebuffers","A","blendEquation","B","blendFunc","fs","shader","createShader","FRAGMENT_SHADER","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","fragmentShader","getShader","getFragmentShader","vertexShader","getVertexShader","sprogram","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","useProgram","vpa","getAttribLocation","tca","enableVertexAttribArray","tMatUniform","getUniformLocation","samplerUniform","useTex","uniform1i","idx","unitIBuffer","bindBuffer","ELEMENT_ARRAY_BUFFER","bufferData","Uint16Array","STATIC_DRAW","ids","unitI33","stripBuffer","raidus","circleCanvasRadius","toDataURL","_w","_h","_width","_height","_scaleX","_scaleY","createTexture","texture","vcBuffer","tcBuffer","ARRAY_BUFFER","bindTexture","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","LINEAR_MIPMAP_NEAREST","generateMipmap","textureLoaded","textureWidth","textureHeight","tmat","imat","oldScale","drawImg2Canvas","updateMatrix","uniform3f","uniformMatrix3fv","top","vertexAttribPointer","FLOAT","drawElements","TRIANGLES","UNSIGNED_SHORT","moveOriginMatrix","translationMatrix","angel","rotationMatrix","scaleMatrix","matrix","inverse","WebGLRenderer","antialias","stencil","depth","initVar","setMaxRadius","initShaders","initBuffers","FUNC_ADD","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","enable","BLEND","CustomRenderer","LineZone","x1","y1","dot","xxyy","tha2","oldx","oldy","maxx","minx","maxy","miny","direction","rangeOut","getDistance","getSymmetric","x2","y2","min","getLength","CircleZone","PIx2","randomRadius","d","distanceTo","RectZone","vectors","setVectors","j","length1","length2","getBound","negate","ImageZone","func","getStyle","moveTo","lineTo","drawRect","Vector","Polar","getSpan","Init","L","P","V","M","R","F","RD","G","S","WebGlRenderer","Debug"],"mappings":";;;;;;;;;kLAAA,IAAMA,EAAK,UAGLC,EAAW,IACXD,OACO,EAALA,OACAA,EAAK,SACHA,EAAK,YACJ,IAAMA,YACJ,wBAEAE,UACFA,IAAQC,KAAKC,UAAYF,IAXnBE,EAAAA,uBAcJC,EAAGC,8CAEAC,KAAKC,MAAMD,KAAKE,UAAYH,EAAID,IAAMA,EAD/BA,EAAIE,KAAKE,UAAYH,EAAID,4BAI/BK,EAAQC,EAAGC,UACjBT,KAAKU,WAAWH,EAASC,EAAGD,EAASC,EAAGC,iCAK7C,KACC,SAA4B,SAAhBL,KAAKE,UAAyB,GAAGK,SAAS,KA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ACnB3I,EAAO+I,MAAQ/I,EAAOmgB,EAAIpX,GAC1B/I,EAAOoJ,WAAapJ,EAAOwW,EAAIpN,GAC/BpJ,EAAO4J,YAAc5J,EAAOogB,GAAKxW,GACjC5J,EAAOkK,QAAUlK,EAAOqgB,EAAInW,GAC5BlK,EAAOmK,UAAYA,GACnBnK,EAAO6K,UAAYA,GACnB7K,EAAO+K,MAAQA,GACf/K,EAAOmL,MAAQnL,EAAOsgB,EAAInV,GAC1BnL,EAAOsL,OAASA,GAChBtL,EAAO2L,MAAQA,GACf3L,EAAO4M,UAAYA,GACnB5M,EAAOkM,QAAUA,GACjBlM,EAAO6M,YAAcA,GAErB7M,EAAOqN,QAAUA,GACjBrN,EAAO+O,iBAAmBA,GAC1B/O,EAAOiP,cAAgBA,GAEvBjP,EAAOmH,KAAOA,GACdnH,EAAOmd,SAAWA,GAClBnd,EAAOue,WAAaA,GACpBve,EAAOuH,UAAYA,GACnBvH,EAAO4e,SAAWA,GAClB5e,EAAOof,UAAYA,EAEnBpf,EAAOuR,eAAiBA,GACxBvR,EAAO6S,YAAcA,GACrB7S,EAAO4T,cAAgBA,GACvB5T,EAAOiV,aAAeA,GACtBjV,EAAOyU,cAAgBA,GACvBzU,EAAOqc,cAAgBrc,EAAOugB,cAAgBlE,EAC9Crc,EAAOkd,eAAiBA,GAExBld,EAAOwgB,MAAQA,EACfvsB,EAAKgH,OAAO+E,EAAQyC"} \ No newline at end of file diff --git a/package.json b/package.json index d2b8b94..f3e8560 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "proton-engine", - "version": "4.1.5", + "version": "4.2.0", "description": "Proton is a simple and powerful javascript particle animation engine.", "keywords": [ "particle", diff --git a/src/index.js b/src/index.js index cf39e05..ebbf2f8 100755 --- a/src/index.js +++ b/src/index.js @@ -59,7 +59,7 @@ import ImageZone from "./zone/ImageZone"; import Debug from "./debug/Debug"; // namespace -Proton.Particle = Proton.P = Particle; +Proton.Particle = Particle; Proton.Pool = Pool; Proton.Util = Util; @@ -91,7 +91,7 @@ Proton.RandomDrift = Proton.RD = RandomDrift; Proton.Gravity = Proton.G = Gravity; Proton.Collision = Collision; Proton.CrossZone = CrossZone; -Proton.Alpha = Proton.A = Alpha; +Proton.Alpha = Alpha; Proton.Scale = Proton.S = Scale; Proton.Rotate = Rotate; Proton.Color = Color;