diff --git a/README.md b/README.md index aa10f50..fc7649c 100755 --- a/README.md +++ b/README.md @@ -106,6 +106,8 @@ proton.addRenderer(renderer); * Added `Proton.Cyclone` behavior, you can make vortex effects with Cyclone. Demo please check [here](https://codesandbox.io/s/proton-cyclone-rzweu). +* `proton.fps=60` In most cases, you don't need to set this property. You can set this property when the game engine has fixed fps or some browsers have a higher refresh rate. + * Use Euler integration calculation is more accurate (default false) `Proton.USE_CLOCK = false or true;`. Proton has now been upgraded to the __v4__ version. Performance has been greatly improved and api also has some improvements. For more details, please check [here](https://github.com/a-jie/Proton/releases). diff --git a/build/proton.js b/build/proton.js index 39fe45d..18b8f28 100755 --- a/build/proton.js +++ b/build/proton.js @@ -8,34 +8,40 @@ var PI = 3.1415926; var INFINITY = Infinity; var MathUtil = { - PI: PI, - PIx2: PI * 2, - PI_2: PI / 2, - PI_180: PI / 180, - N180_PI: 180 / PI, - Infinity: -999, - - isInfinity: function isInfinity(num) { - return num === this.Infinity || num === INFINITY; - }, - randomAToB: function randomAToB(a, b) { - var isInt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + PI: PI, + PIx2: PI * 2, + PI_2: PI / 2, + PI_180: PI / 180, + N180_PI: 180 / PI, + Infinity: -999, + + isInfinity: function isInfinity(num) { + return num === this.Infinity || num === INFINITY; + }, + randomAToB: function randomAToB(a, b) { + var isInt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - if (!isInt) return a + Math.random() * (b - a);else return Math.floor(Math.random() * (b - a)) + a; - }, - randomFloating: function randomFloating(center, f, isInt) { - return this.randomAToB(center - f, center + f, isInt); - }, - randomZone: function randomZone(display) {}, - degreeTransform: function degreeTransform(a) { - return a * PI / 180; - }, - toColor16: function toColor16(num) { - return "#" + num.toString(16); - }, - randomColor: function randomColor() { - return "#" + ("00000" + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6); - } + if (!isInt) return a + Math.random() * (b - a);else return Math.floor(Math.random() * (b - a)) + a; + }, + randomFloating: function randomFloating(center, f, isInt) { + return this.randomAToB(center - f, center + f, isInt); + }, + randomColor: function randomColor() { + return "#" + ("00000" + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6); + }, + randomZone: function randomZone(display) {}, + floor: function floor(num) { + var k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4; + + var digits = Math.pow(10, k); + return Math.floor(num * digits) / digits; + }, + degreeTransform: function degreeTransform(a) { + return a * PI / 180; + }, + toColor16: function toColor16(num) { + return "#" + num.toString(16); + } }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { @@ -1183,7 +1189,7 @@ var Proton = function () { */ - // 1:100 + // event name function Proton(integrationType) { classCallCheck(this, Proton); @@ -1191,7 +1197,8 @@ var Proton = function () { this.renderers = []; this.time = 0; - this.oldTime = 0; + this.now = 0; + this.then = 0; this.elapsed = 0; this.stats = new Stats(this); @@ -1199,21 +1206,27 @@ var Proton = function () { this.integrationType = Util.initValue(integrationType, Proton.EULER); this.integrator = new Integration(this.integrationType); + + this._fps = "auto"; + this._interval = Proton.DEFAULT_INTERVAL; } - /** - * add a type of Renderer - * - * @method addRenderer - * @memberof Proton - * @instance - * - * @param {Renderer} render - */ + // measure 1:100 createClass(Proton, [{ key: "addRenderer", + + + /** + * add a type of Renderer + * + * @method addRenderer + * @memberof Proton + * @instance + * + * @param {Renderer} render + */ value: function addRenderer(render) { render.init(this); this.renderers.push(render); @@ -1284,24 +1297,40 @@ var Proton = function () { }, { key: "update", value: function update() { - this.dispatchEvent(Proton.PROTON_UPDATE); - - if (Proton.USE_CLOCK) { - if (!this.oldTime) this.oldTime = new Date().getTime(); - - var time = new Date().getTime(); - this.elapsed = (time - this.oldTime) / 1000; - Proton.amendChangeTabsBug && this.amendChangeTabsBug(); + // 'auto' is the default browser refresh rate, the vast majority is 60fps + if (this._fps === "auto") { + this.dispatchEvent(Proton.PROTON_UPDATE); + + if (Proton.USE_CLOCK) { + if (!this.then) this.then = new Date().getTime(); + this.now = new Date().getTime(); + this.elapsed = (this.now - this.then) * 0.001; + // Fix bugs such as chrome browser switching tabs causing excessive time difference + this.amendChangeTabsBug(); + + if (this.elapsed > 0) this.emittersUpdate(this.elapsed); + this.then = this.now; + } else { + this.emittersUpdate(Proton.DEFAULT_INTERVAL); + } - this.oldTime = time; - } else { - this.elapsed = 0.0167; + this.dispatchEvent(Proton.PROTON_UPDATE_AFTER); } - // emitter update - if (this.elapsed > 0) this.emittersUpdate(this.elapsed); - - this.dispatchEvent(Proton.PROTON_UPDATE_AFTER); + // If the fps frame rate is set + else { + if (!this.then) this.then = new Date().getTime(); + this.now = new Date().getTime(); + this.elapsed = (this.now - this.then) * 0.001; + + if (this.elapsed > this._interval) { + this.dispatchEvent(Proton.PROTON_UPDATE); + this.emittersUpdate(this._interval); + // https://stackoverflow.com/questions/19764018/controlling-fps-with-requestanimationframe + this.then = this.now - this.elapsed % this._interval * 1000; + this.dispatchEvent(Proton.PROTON_UPDATE_AFTER); + } + } } }, { key: "emittersUpdate", @@ -1323,8 +1352,9 @@ var Proton = function () { }, { key: "amendChangeTabsBug", value: function amendChangeTabsBug() { + if (!Proton.amendChangeTabsBug) return; if (this.elapsed > 0.5) { - this.oldTime = new Date().getTime(); + this.then = new Date().getTime(); this.elapsed = 0; } } @@ -1380,7 +1410,7 @@ var Proton = function () { var destroyOther = function destroyOther() { _this.time = 0; - _this.oldTime = 0; + _this.then = 0; _this.pool.destroy(); Util.destroyAll(_this.emitters); @@ -1393,6 +1423,15 @@ var Proton = function () { destroyOther(); } } + }, { + key: "fps", + set: function set$$1(fps) { + this._fps = fps; + this._interval = fps === "auto" ? Proton.DEFAULT_INTERVAL : MathUtil.floor(1 / fps, 7); + }, + get: function get$$1() { + return this._fps; + } }]); return Proton; }(); @@ -1405,10 +1444,11 @@ Proton.PARTICLE_CREATED = "PARTICLE_CREATED"; Proton.PARTICLE_UPDATE = "PARTICLE_UPDATE"; Proton.PARTICLE_SLEEP = "PARTICLE_SLEEP"; Proton.PARTICLE_DEAD = "PARTICLE_DEAD"; -Proton.PROTON_UPDATE = "PROTON_UPDATE"; -Proton.PROTON_UPDATE_AFTER = "PROTON_UPDATE_AFTER"; Proton.EMITTER_ADDED = "EMITTER_ADDED"; Proton.EMITTER_REMOVED = "EMITTER_REMOVED"; +Proton.PROTON_UPDATE = "PROTON_UPDATE"; +Proton.PROTON_UPDATE_AFTER = "PROTON_UPDATE_AFTER"; +Proton.DEFAULT_INTERVAL = 0.0167; Proton.amendChangeTabsBug = true; EventDispatcher.bind(Proton); diff --git a/build/proton.js.map b/build/proton.js.map index fc9cf0f..f582c30 100755 --- a/build/proton.js.map +++ b/build/proton.js.map @@ -1 +1 @@ -{"version":3,"file":"proton.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 randomZone(display) {},\n\n degreeTransform(a) {\n return (a * PI) / 180;\n },\n\n toColor16(num) {\n return `#${num.toString(16)}`;\n },\n\n randomColor() {\n return (\n \"#\" +\n (\"00000\" + ((Math.random() * 0x1000000) << 0).toString(16)).slice(\n -6\n )\n );\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","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 Integration from \"../math/Integration\";\n\nexport default class Proton {\n static USE_CLOCK = false;\n\n // 1:100\n static MEASURE = 100;\n static EULER = \"euler\";\n static RK2 = \"runge-kutta2\";\n\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 static PROTON_UPDATE = \"PROTON_UPDATE\";\n static PROTON_UPDATE_AFTER = \"PROTON_UPDATE_AFTER\";\n static EMITTER_ADDED = \"EMITTER_ADDED\";\n static EMITTER_REMOVED = \"EMITTER_REMOVED\";\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.oldTime = 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\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 this.dispatchEvent(Proton.PROTON_UPDATE);\n\n if (Proton.USE_CLOCK) {\n if (!this.oldTime) this.oldTime = new Date().getTime();\n\n let time = new Date().getTime();\n this.elapsed = (time - this.oldTime) / 1000;\n Proton.amendChangeTabsBug && this.amendChangeTabsBug();\n\n this.oldTime = time;\n } else {\n this.elapsed = 0.0167;\n }\n\n // emitter update\n if (this.elapsed > 0) this.emittersUpdate(this.elapsed);\n\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\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 (this.elapsed > 0.5) {\n this.oldTime = 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.oldTime = 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\t/**\n\t * This behaviour let the particles follow one specific Proton.Vector2D\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Attraction\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 {Proton.Vector2D} targetPosition\n\t * @property {Number} radius\n\t * @property {Number} force\n\t * @property {Number} radiusSq\n\t * @property {Proton.Vector2D} attractionForce\n\t * @property {Number} lengthSq\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tthis.name = 'Attraction';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Attraction\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\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\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.Attraction\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\tthis.calculate(particle, time, index);\n\n\t\tthis.attractionForce.copy(this.targetPosition);\n\t\tthis.attractionForce.sub(particle.p);\n\t\tthis.lengthSq = this.attractionForce.lengthSq();\n\n\t\tif (this.lengthSq > 0.000004 && this.lengthSq < this.radiusSq) {\n\t\t\tthis.attractionForce.normalize();\n\t\t\tthis.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\n\t\t\tthis.attractionForce.multiplyScalar(this.force);\n\n\t\t\tparticle.a.add(this.attractionForce);\n\t\t}\n\t}\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;\n\nObject.assign(Proton, ease);\n\n// export\nexport default Proton;\n"],"names":["PI","INFINITY","Infinity","MathUtil","num","a","b","isInt","Math","random","floor","center","f","randomAToB","display","toString","slice","Span","Util","isArray","initValue","getRandFromArray","randomFloating","c","undefined","pan","getValue","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","nhpot","canvas","DomUtil","createCanvas","getContext","value","defaults","Object","prototype","call","arr","obj","ignore","indexOf","constructor","args","FactoryFunc","bind","apply","concat","particle","conf","hasProp","p","v","copy","props","prop","hasOwnProperty","getSpanValue","ImgUtil","destroy","idsMap","Puid","type","uid","getIdFromCache","_index","_cache","isBody","isInner","Pool","total","cache","params","__puid","getId","pop","createOrClone","getCache","push","create","classApply","clone","count","Stats","proton","container","emitterIndex","rendererIndex","body","add","emitter","getEmitter","renderer","getRenderer","str","emitters","emitSpeed","getEmitterPos","initializes","concatArr","behaviours","name","getCreatedNumber","getCount","pool","innerHTML","cssText","join","addEventListener","bg","color","parentNode","appendChild","renderers","result","cpool","round","EventDispatcher","_listeners","listener","removeEventListener","splice","listeners","handler","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","sleep","old","multiplyScalar","mass","clear","Proton","integrationType","oldTime","elapsed","stats","EULER","integrator","render","init","index","remove","parent","EMITTER_ADDED","EMITTER_REMOVED","PROTON_UPDATE","USE_CLOCK","Date","getTime","amendChangeTabsBug","emittersUpdate","PROTON_UPDATE_AFTER","update","destroyAll","destroyOther","getAllParticles","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","Rgb","r","g","pow","PI_2","sqrt","ease","easeLinear","Vector2D","atan2","w","addVectors","subVectors","set","divideScalar","distanceToSquared","tha","dx","dy","alpha","Particle","data","rgb","reset","setProp","N180_PI","life","age","dead","sprite","energy","radius","rotation","easing","emptyObject","removeAllBehaviours","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","emptyArray","h","hex16","substring","parseInt","rbg","Number","Polar2D","abs","getX","getY","Mat3","mat3","mat","Float32Array","mat1","mat2","d","m","vec","ArraySpan","_arr","toArray","randomColor","Rectangle","bottom","right","Rate","numpan","timepan","numPan","setSpanValue","timePan","startTime","nextTime","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","influence","rotationA","rotationB","getDirection","Color","createArraySpan","colorA","ColorUtil","hexToRgb","colorB","CHANGING","Cyclone","angle","setAngleAndForce","span","String","toLowerCase","cangle","cyclone","gradient","getGradient","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVectorVal","degreeTransform","Emitter","emitTime","totalTime","rate","stoped","isNaN","oldStoped","oldEmitTime","oldTotalTime","step","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mouseTarget","window","_allowEmitting","initEventHandler","mousemoveHandler","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","layerX","layerY","offsetX","offsetY","babelHelpers.get","BaseRenderer","element","stroke","circleConf","isCircle","initHandler","thinkness","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","CanvasRenderer","bufferCache","getImgFromCache","addImg2Body","drawCircle","buffer","createBuffer","bufContext","globalAlpha","globalCompositeOperation","fillStyle","rgbToHex","fillRect","save","translate","restore","beginPath","arc","strokeStyle","lineWidth","closePath","fill","size","DomRenderer","createBody","transform3d","bodyReady","backgroundColor","removeChild","babelHelpers.typeof","createCircle","createSprite","createDiv","borderRadius","borderColor","borderWidth","url","backgroundImage","EaselRenderer","addChild","scaleX","scaleY","graphics","regX","regY","createjs","Graphics","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","PIXIClass","PixiRenderer","setColor","blendMode","setPIXI","PIXI","Sprite","createFromImage","from","fromImage","tint","getHex16FromParticle","anchor","endFill","MStack","mats","multiply","WebGLRenderer","gl","antialias","stencil","depth","initVar","setMaxRadius","initShaders","initBuffers","blendEquation","FUNC_ADD","blendFunc","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","enable","BLEND","umat","smat","mstack","viewport","circleCanvasURL","vsSource","fsSource","texturebuffers","A","B","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","vs","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","getCanvasFromCache","drawImg2Canvas","updateMatrix","uniform3f","uniformMatrix3fv","top","vertexAttribPointer","FLOAT","drawElements","TRIANGLES","UNSIGNED_SHORT","moveOriginMatrix","makeTranslation","translationMatrix","angel","rotationMatrix","makeRotation","scaleMatrix","makeScale","matrix","matrixMultiply","inverse","CustomRenderer","LineZone","x1","y1","x2","y2","direction","minx","min","miny","maxx","maxy","dot","xxyy","getLength","C","D","tha2","tha1","oldx","oldy","rangeOut","getDistance","getSymmetric","CircleZone","PIx2","randomRadius","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","assign"],"mappings":";;;;;;AAAA,IAAMA,KAAK,SAAX;AACA,IAAMC,WAAWC,QAAjB;;AAEA,IAAMC,WAAW;QACTH,EADS;UAEPA,KAAK,CAFE;UAGPA,KAAK,CAHE;YAILA,KAAK,GAJA;aAKJ,MAAMA,EALF;cAMH,CAAC,GANE;;cAAA,sBAQFI,GARE,EAQG;eACLA,QAAQ,KAAKF,QAAb,IAAyBE,QAAQH,QAAxC;KATS;cAAA,sBAYFI,CAZE,EAYCC,CAZD,EAYmB;YAAfC,KAAe,uEAAP,KAAO;;YACxB,CAACA,KAAL,EAAY,OAAOF,IAAIG,KAAKC,MAAL,MAAiBH,IAAID,CAArB,CAAX,CAAZ,KACK,OAAOG,KAAKE,KAAL,CAAWF,KAAKC,MAAL,MAAiBH,IAAID,CAArB,CAAX,IAAsCA,CAA7C;KAdI;kBAAA,0BAiBEM,MAjBF,EAiBUC,CAjBV,EAiBaL,KAjBb,EAiBoB;eACtB,KAAKM,UAAL,CAAgBF,SAASC,CAAzB,EAA4BD,SAASC,CAArC,EAAwCL,KAAxC,CAAP;KAlBS;cAAA,s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":"proton.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","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\t/**\n\t * This behaviour let the particles follow one specific Proton.Vector2D\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Attraction\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 {Proton.Vector2D} targetPosition\n\t * @property {Number} radius\n\t * @property {Number} force\n\t * @property {Number} radiusSq\n\t * @property {Proton.Vector2D} attractionForce\n\t * @property {Number} lengthSq\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tthis.name = 'Attraction';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Attraction\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\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\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.Attraction\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\tthis.calculate(particle, time, index);\n\n\t\tthis.attractionForce.copy(this.targetPosition);\n\t\tthis.attractionForce.sub(particle.p);\n\t\tthis.lengthSq = this.attractionForce.lengthSq();\n\n\t\tif (this.lengthSq > 0.000004 && this.lengthSq < this.radiusSq) {\n\t\t\tthis.attractionForce.normalize();\n\t\t\tthis.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\n\t\t\tthis.attractionForce.multiplyScalar(this.force);\n\n\t\t\tparticle.a.add(this.attractionForce);\n\t\t}\n\t}\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;\n\nObject.assign(Proton, ease);\n\n// export\nexport default Proton;\n"],"names":["PI","INFINITY","Infinity","MathUtil","num","a","b","isInt","Math","random","floor","center","f","randomAToB","toString","slice","display","k","digits","pow","Span","Util","isArray","initValue","getRandFromArray","randomFloating","c","undefined","pan","getValue","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","nhpot","canvas","DomUtil","createCanvas","getContext","value","defaults","Object","prototype","call","arr","obj","ignore","indexOf","constructor","args","FactoryFunc","bind","apply","concat","particle","conf","hasProp","p","v","copy","props","prop","hasOwnProperty","getSpanValue","ImgUtil","destroy","idsMap","Puid","type","uid","getIdFromCache","_index","_cache","isBody","isInner","Pool","total","cache","params","__puid","getId","pop","createOrClone","getCache","push","create","classApply","clone","count","Stats","proton","container","emitterIndex","rendererIndex","body","add","emitter","getEmitter","renderer","getRenderer","str","emitters","emitSpeed","getEmitterPos","initializes","concatArr","behaviours","name","getCreatedNumber","getCount","pool","innerHTML","cssText","join","addEventListener","bg","color","parentNode","appendChild","renderers","result","cpool","round","EventDispatcher","_listeners","listener","removeEventListener","splice","listeners","handler","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","sleep","old","multiplyScalar","mass","clear","Proton","integrationType","now","then","elapsed","stats","EULER","integrator","_fps","_interval","DEFAULT_INTERVAL","render","init","index","remove","parent","EMITTER_ADDED","EMITTER_REMOVED","PROTON_UPDATE","USE_CLOCK","Date","getTime","amendChangeTabsBug","emittersUpdate","PROTON_UPDATE_AFTER","update","destroyAll","destroyOther","getAllParticles","fps","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","data","rgb","reset","setProp","N180_PI","life","age","dead","sprite","energy","radius","rotation","easing","emptyObject","removeAllBehaviours","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","emptyArray","h","hex16","substring","parseInt","rbg","Number","Polar2D","abs","getX","getY","Mat3","mat3","mat","Float32Array","mat1","mat2","d","m","vec","ArraySpan","_arr","toArray","randomColor","Rectangle","bottom","right","Rate","numpan","timepan","numPan","setSpanValue","timePan","startTime","nextTime","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","influence","rotationA","rotationB","getDirection","Color","createArraySpan","colorA","ColorUtil","hexToRgb","colorB","CHANGING","Cyclone","angle","setAngleAndForce","span","String","toLowerCase","cangle","cyclone","gradient","getGradient","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVectorVal","degreeTransform","Emitter","emitTime","totalTime","rate","stoped","isNaN","oldStoped","oldEmitTime","oldTotalTime","step","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mouseTarget","window","_allowEmitting","initEventHandler","mousemoveHandler","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","layerX","layerY","offsetX","offsetY","babelHelpers.get","BaseRenderer","element","stroke","circleConf","isCircle","initHandler","thinkness","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","CanvasRenderer","bufferCache","getImgFromCache","addImg2Body","drawCircle","buffer","createBuffer","bufContext","globalAlpha","globalCompositeOperation","fillStyle","rgbToHex","fillRect","save","translate","restore","beginPath","arc","strokeStyle","lineWidth","closePath","fill","size","DomRenderer","createBody","transform3d","bodyReady","backgroundColor","removeChild","babelHelpers.typeof","createCircle","createSprite","createDiv","borderRadius","borderColor","borderWidth","url","backgroundImage","EaselRenderer","addChild","scaleX","scaleY","graphics","regX","regY","createjs","Graphics","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","PIXIClass","PixiRenderer","setColor","blendMode","setPIXI","PIXI","Sprite","createFromImage","from","fromImage","tint","getHex16FromParticle","anchor","endFill","MStack","mats","multiply","WebGLRenderer","gl","antialias","stencil","depth","initVar","setMaxRadius","initShaders","initBuffers","blendEquation","FUNC_ADD","blendFunc","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","enable","BLEND","umat","smat","mstack","viewport","circleCanvasURL","vsSource","fsSource","texturebuffers","A","B","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","vs","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","getCanvasFromCache","drawImg2Canvas","updateMatrix","uniform3f","uniformMatrix3fv","top","vertexAttribPointer","FLOAT","drawElements","TRIANGLES","UNSIGNED_SHORT","moveOriginMatrix","makeTranslation","translationMatrix","angel","rotationMatrix","makeRotation","scaleMatrix","makeScale","matrix","matrixMultiply","inverse","CustomRenderer","LineZone","x1","y1","x2","y2","direction","minx","min","miny","maxx","maxy","dot","xxyy","getLength","C","D","tha2","tha1","oldx","oldy","rangeOut","getDistance","getSymmetric","CircleZone","PIx2","randomRadius","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","assign"],"mappings":";;;;;;AAAA,IAAMA,KAAK,SAAX;AACA,IAAMC,WAAWC,QAAjB;;AAEA,IAAMC,WAAW;MACXH,EADW;QAETA,KAAK,CAFI;QAGTA,KAAK,CAHI;UAIPA,KAAK,GAJE;WAKN,MAAMA,EALA;YAML,CAAC,GANI;;YAAA,sBAQJI,GARI,EAQC;WACPA,QAAQ,KAAKF,QAAb,IAAyBE,QAAQH,QAAxC;GATa;YAAA,sBAYJI,CAZI,EAYDC,CAZC,EAYiB;QAAfC,KAAe,uEAAP,KAAO;;QAC1B,CAACA,KAAL,EAAY,OAAOF,IAAIG,KAAKC,MAAL,M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AACAnV,OAAO2U,aAAP,GAAuBA,aAAvB;AACA3U,OAAOmW,aAAP,GAAuBnW,OAAOmhB,aAAP,GAAuBhL,aAA9C;AACAnW,OAAO4d,cAAP,GAAwBA,cAAxB;;AAEA5d,OAAOohB,KAAP,GAAeA,KAAf;;AAEA1nB,OAAO2nB,MAAP,CAAcrhB,MAAd,EAAsByC,IAAtB;;;;;;;;;;"} \ No newline at end of file diff --git a/build/proton.min.js b/build/proton.min.js index d96a277..75751b0 100755 --- a/build/proton.min.js +++ b/build/proton.min.js @@ -1,5 +1,5 @@ /*! -* Proton v4.0.7 +* Proton v4.1.0 * https://github.com/a-jie/Proton * * Copyright 2013-2019, A-JIE @@ -7,5 +7,5 @@ * 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++,4=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-6=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=N.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=N.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),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> 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","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 Integration from \"../math/Integration\";\n\nexport default class Proton {\n static USE_CLOCK = false;\n\n // 1:100\n static MEASURE = 100;\n static EULER = \"euler\";\n static RK2 = \"runge-kutta2\";\n\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 static PROTON_UPDATE = \"PROTON_UPDATE\";\n static PROTON_UPDATE_AFTER = \"PROTON_UPDATE_AFTER\";\n static EMITTER_ADDED = \"EMITTER_ADDED\";\n static EMITTER_REMOVED = \"EMITTER_REMOVED\";\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.oldTime = 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\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 this.dispatchEvent(Proton.PROTON_UPDATE);\n\n if (Proton.USE_CLOCK) {\n if (!this.oldTime) this.oldTime = new Date().getTime();\n\n let time = new Date().getTime();\n this.elapsed = (time - this.oldTime) / 1000;\n Proton.amendChangeTabsBug && this.amendChangeTabsBug();\n\n this.oldTime = time;\n } else {\n this.elapsed = 0.0167;\n }\n\n // emitter update\n if (this.elapsed > 0) this.emittersUpdate(this.elapsed);\n\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\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 (this.elapsed > 0.5) {\n this.oldTime = 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.oldTime = 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\t/**\n\t * This behaviour let the particles follow one specific Proton.Vector2D\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Attraction\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 {Proton.Vector2D} targetPosition\n\t * @property {Number} radius\n\t * @property {Number} force\n\t * @property {Number} radiusSq\n\t * @property {Proton.Vector2D} attractionForce\n\t * @property {Number} lengthSq\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tthis.name = 'Attraction';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Attraction\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\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\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.Attraction\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\tthis.calculate(particle, time, index);\n\n\t\tthis.attractionForce.copy(this.targetPosition);\n\t\tthis.attractionForce.sub(particle.p);\n\t\tthis.lengthSq = this.attractionForce.lengthSq();\n\n\t\tif (this.lengthSq > 0.000004 && this.lengthSq < this.radiusSq) {\n\t\t\tthis.attractionForce.normalize();\n\t\t\tthis.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\n\t\t\tthis.attractionForce.multiplyScalar(this.force);\n\n\t\t\tparticle.a.add(this.attractionForce);\n\t\t}\n\t}\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;\n\nObject.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","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","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","PROTON_UPDATE","USE_CLOCK","oldTime","Date","getTime","elapsed","amendChangeTabsBug","emittersUpdate","PROTON_UPDATE_AFTER","update","destroyAll","destroyOther","getAllParticles","integrationType","stats","EULER","integrator","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","Rgb","r","g","pow","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","assign"],"mappings":";;;;;;;;;gRAAA,IAAMA,EAAK,UAGLC,EAAW,IACTD,OACO,EAALA,OACAA,EAAK,SACHA,EAAK,YACJ,IAAMA,YACJ,wBAEAE,UACAA,IAAQC,KAAKC,UAAYF,IAXvBE,EAAAA,uBAcFC,EAAGC,8CAEEC,KAAKC,MAAMD,KAAKE,UAAYH,EAAID,IAAMA,EAD/BA,EAAIE,KAAKE,UAAYH,EAAID,4BAIjCK,EAAQC,EAAGC,UACfT,KAAKU,WAAWH,EAASC,EAAGD,EAASC,EAAGC,qDAKnCP,UACJA,EAAIL,EAAM,wBAGZE,aACKA,EAAIY,SAAS,kCAKpB,KACC,SAA4B,SAAhBP,KAAKE,UAAyB,GAAGK,SAAS,KAAKC,OACvD,4oCCnCIC,8CAaVJ,2CACHT,KAAKc,QACAC,EAAKC,iBAAiBhB,KAAKE,GAE7BF,KAAKO,OAGDT,EAASmB,eAAejB,KAAKE,EAAGF,KAAKG,EAAGM,GAFxCX,EAASY,WAAWV,KAAKE,EAAGF,KAAKG,EAAGM,0CAqB7BP,EAAGC,EAAGe,UACpBhB,aAAaW,EACRX,OAEGiB,IAANhB,EACK,IAAIU,EAAKX,QAENiB,IAAND,EAAwB,IAAIL,EAAKX,EAAGC,GAC5B,IAAIU,EAAKX,EAAGC,EAAGe,wCAebE,UACXA,aAAeP,EAAOO,EAAIC,WAAaD,oBA9DpClB,EAAGC,EAAGI,aACZQ,EAAKD,QAAQZ,SACVY,SAAU,OACVZ,EAAIA,SAEJY,SAAU,OACVZ,EAAIa,EAAKO,UAAUpB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AC5B9J,EAAO+J,UAAYA,GACnB/J,EAAOyK,UAAYA,GACnBzK,EAAO2K,MAAQ3K,EAAOqW,EAAI1L,GAC1B3K,EAAO+K,MAAQ/K,EAAOkgB,EAAInV,GAC1B/K,EAAOkL,OAASA,GAChBlL,EAAOuL,MAAQA,GACfvL,EAAOwM,UAAYA,GACnBxM,EAAO8L,QAAUA,GACjB9L,EAAOyM,YAAcA,GAErBzM,EAAOiN,QAAUA,GACjBjN,EAAO2O,iBAAmBA,GAC1B3O,EAAO6O,cAAgBA,GAEvB7O,EAAO+G,KAAOA,GACd/G,EAAO+c,SAAWA,GAClB/c,EAAOme,WAAaA,GACpBne,EAAOmH,UAAYA,GACnBnH,EAAOwe,SAAWA,GAClBxe,EAAOye,UAAYA,GAEnBze,EAAOmR,eAAiBA,GACxBnR,EAAOyS,YAAcA,GACrBzS,EAAOwT,cAAgBA,GACvBxT,EAAO6U,aAAeA,GACtB7U,EAAOqU,cAAgBA,GACvBrU,EAAO6V,cAAgB7V,EAAOmgB,cAAgBtK,GAC9C7V,EAAO8c,eAAiBA,GAExB9c,EAAOogB,MAAQA,GAEf1mB,OAAO2mB,OAAOrgB,EAAQqC"} \ 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","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;\n\nObject.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","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","assign"],"mappings":";;;;;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AC7BzH,EAAO4H,SAAW5H,EAAOggB,EAAIpY,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,GAEf9mB,OAAO+mB,OAAOzgB,EAAQyC"} \ No newline at end of file diff --git a/example/zone/pointzone/pointzone.html b/example/zone/pointzone/pointzone.html index 4e519cd..6c3b6c1 100755 --- a/example/zone/pointzone/pointzone.html +++ b/example/zone/pointzone/pointzone.html @@ -1,130 +1,150 @@ - + - - + proton.js-zone-PointZone - - + + - + - +
- +
- - - \ No newline at end of file + + diff --git a/package.json b/package.json index 3312abf..cf213a8 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "proton-engine", - "version": "4.0.7", + "version": "4.1.0", "description": "Proton is a simple and powerful javascript particle animation engine.", "keywords": [ "particle", diff --git a/rollup.config.js b/rollup.config.js index 95eed7c..75999cf 100755 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,9 +1,8 @@ // Rollup plugins -import babel from 'rollup-plugin-babel'; -import uglify from 'rollup-plugin-uglify'; -import license from 'rollup-plugin-license'; - -import pkjson from './package.json'; +import babel from "rollup-plugin-babel"; +import uglify from "rollup-plugin-uglify"; +import license from "rollup-plugin-license"; +import pkjson from "./package.json"; const banner = `/*! * Proton v${pkjson.version} @@ -15,30 +14,32 @@ const banner = `/*! * */`; -const isDev = process.argv.splice(2).indexOf('--pub') < 0; -const plugins = isDev ? - [ - babel({ - exclude: 'node_modules/**', - }) - ] : [ - babel({ - exclude: 'node_modules/**', - }), - uglify(), - license({ banner: banner }) +const isDev = process.argv.splice(2).indexOf("--pub") < 0; +const plugins = isDev + ? [ + babel({ + exclude: "node_modules/**" + }) + ] + : [ + babel({ + exclude: "node_modules/**" + }), + uglify(), + license({ banner: banner }) ]; -const output = isDev ? { file: 'build/proton.js' } : { file: 'build/proton.min.js' }; - +const output = isDev + ? { file: "build/proton.js" } + : { file: "build/proton.min.js" }; export default { - input: 'src/index.js', - output: { - ...output, - format: 'umd', - name: 'Proton', - sourcemap: true, - }, - plugins: plugins -}; \ No newline at end of file + input: "src/index.js", + output: { + ...output, + format: "umd", + name: "Proton", + sourcemap: true + }, + plugins: plugins +}; diff --git a/src/behaviour/Attraction.js b/src/behaviour/Attraction.js index 1fed97e..05af6c6 100755 --- a/src/behaviour/Attraction.js +++ b/src/behaviour/Attraction.js @@ -1,98 +1,97 @@ -import Util from '../utils/Util'; -import Vector2D from '../math/Vector2D'; -import Behaviour from './Behaviour'; +import Util from "../utils/Util"; +import Vector2D from "../math/Vector2D"; +import Behaviour from "./Behaviour"; export default class Attraction extends Behaviour { + /** + * This behaviour let the particles follow one specific Proton.Vector2D + * + * @memberof! Proton# + * @augments Proton.Behaviour + * @constructor + * @alias Proton.Attraction + * + * @todo add description for 'force' and 'radius' + * + * @param {Proton.Vector2D} targetPosition the attraction point coordinates + * @param {Number} [force=100] + * @param {Number} [radius=1000] + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=ease.easeLinear] this behaviour's easing + * + * @property {Proton.Vector2D} targetPosition + * @property {Number} radius + * @property {Number} force + * @property {Number} radiusSq + * @property {Proton.Vector2D} attractionForce + * @property {Number} lengthSq + * @property {String} name The Behaviour name + */ + constructor(targetPosition, force, radius, life, easing) { + super(life, easing); - /** - * This behaviour let the particles follow one specific Proton.Vector2D - * - * @memberof! Proton# - * @augments Proton.Behaviour - * @constructor - * @alias Proton.Attraction - * - * @todo add description for 'force' and 'radius' - * - * @param {Proton.Vector2D} targetPosition the attraction point coordinates - * @param {Number} [force=100] - * @param {Number} [radius=1000] - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=ease.easeLinear] this behaviour's easing - * - * @property {Proton.Vector2D} targetPosition - * @property {Number} radius - * @property {Number} force - * @property {Number} radiusSq - * @property {Proton.Vector2D} attractionForce - * @property {Number} lengthSq - * @property {String} name The Behaviour name - */ - constructor(targetPosition, force, radius, life, easing) { - super(life, easing); + this.targetPosition = Util.initValue(targetPosition, new Vector2D()); + this.radius = Util.initValue(radius, 1000); + this.force = Util.initValue(this.normalizeValue(force), 100); - this.targetPosition = Util.initValue(targetPosition, new Vector2D); - this.radius = Util.initValue(radius, 1000); - this.force = Util.initValue(this.normalizeValue(force), 100); + this.radiusSq = this.radius * this.radius; + this.attractionForce = new Vector2D(); + this.lengthSq = 0; - this.radiusSq = this.radius * this.radius - this.attractionForce = new Vector2D(); - this.lengthSq = 0; + this.name = "Attraction"; + } - this.name = 'Attraction'; - } + /** + * Reset this behaviour's parameters + * + * @method reset + * @memberof Proton#Proton.Attraction + * @instance + * + * @todo add description for 'force' and 'radius' + * + * @param {Proton.Vector2D} targetPosition the attraction point coordinates + * @param {Number} [force=100] + * @param {Number} [radius=1000] + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=ease.easeLinear] this behaviour's easing + */ + reset(targetPosition, force, radius, life, easing) { + this.targetPosition = Util.initValue(targetPosition, new Vector2D()); + this.radius = Util.initValue(radius, 1000); + this.force = Util.initValue(this.normalizeValue(force), 100); - /** - * Reset this behaviour's parameters - * - * @method reset - * @memberof Proton#Proton.Attraction - * @instance - * - * @todo add description for 'force' and 'radius' - * - * @param {Proton.Vector2D} targetPosition the attraction point coordinates - * @param {Number} [force=100] - * @param {Number} [radius=1000] - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=ease.easeLinear] this behaviour's easing - */ - reset(targetPosition, force, radius, life, easing) { - this.targetPosition = Util.initValue(targetPosition, new Vector2D); - this.radius = Util.initValue(radius, 1000); - this.force = Util.initValue(this.normalizeValue(force), 100); + this.radiusSq = this.radius * this.radius; + this.attractionForce = new Vector2D(); + this.lengthSq = 0; - this.radiusSq = this.radius * this.radius - this.attractionForce = new Vector2D(); - this.lengthSq = 0; + life && super.reset(life, easing); + } - life && super.reset(life, easing); - } + /** + * Apply this behaviour for all particles every time + * + * @memberof Proton#Proton.Attraction + * @method applyBehaviour + * @instance + * + * @param {Proton.Particle} particle + * @param {Number} time the integrate time 1/ms + * @param {Int} index the particle index + */ + applyBehaviour(particle, time, index) { + this.calculate(particle, time, index); - /** - * Apply this behaviour for all particles every time - * - * @memberof Proton#Proton.Attraction - * @method applyBehaviour - * @instance - * - * @param {Proton.Particle} particle - * @param {Number} time the integrate time 1/ms - * @param {Int} index the particle index - */ - applyBehaviour(particle, time, index) { - this.calculate(particle, time, index); + this.attractionForce.copy(this.targetPosition); + this.attractionForce.sub(particle.p); + this.lengthSq = this.attractionForce.lengthSq(); - this.attractionForce.copy(this.targetPosition); - this.attractionForce.sub(particle.p); - this.lengthSq = this.attractionForce.lengthSq(); + if (this.lengthSq > 0.00004 && this.lengthSq < this.radiusSq) { + this.attractionForce.normalize(); + this.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq); + this.attractionForce.multiplyScalar(this.force); - if (this.lengthSq > 0.000004 && this.lengthSq < this.radiusSq) { - this.attractionForce.normalize(); - this.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq); - this.attractionForce.multiplyScalar(this.force); - - particle.a.add(this.attractionForce); - } - } -} \ No newline at end of file + particle.a.add(this.attractionForce); + } + } +} diff --git a/src/core/Proton.js b/src/core/Proton.js index 1db5de9..4c7ee93 100755 --- a/src/core/Proton.js +++ b/src/core/Proton.js @@ -2,25 +2,30 @@ import Pool from "./Pool"; import Util from "../utils/Util"; import Stats from "../debug/Stats"; import EventDispatcher from "../events/EventDispatcher"; +import MathUtil from "../math/MathUtil"; import Integration from "../math/Integration"; export default class Proton { static USE_CLOCK = false; - // 1:100 + // measure 1:100 static MEASURE = 100; static EULER = "euler"; static RK2 = "runge-kutta2"; + // event name static PARTICLE_CREATED = "PARTICLE_CREATED"; static PARTICLE_UPDATE = "PARTICLE_UPDATE"; static PARTICLE_SLEEP = "PARTICLE_SLEEP"; static PARTICLE_DEAD = "PARTICLE_DEAD"; - static PROTON_UPDATE = "PROTON_UPDATE"; - static PROTON_UPDATE_AFTER = "PROTON_UPDATE_AFTER"; + static EMITTER_ADDED = "EMITTER_ADDED"; static EMITTER_REMOVED = "EMITTER_REMOVED"; + static PROTON_UPDATE = "PROTON_UPDATE"; + static PROTON_UPDATE_AFTER = "PROTON_UPDATE_AFTER"; + static DEFAULT_INTERVAL = 0.0167; + static amendChangeTabsBug = true; /** @@ -45,7 +50,8 @@ export default class Proton { this.renderers = []; this.time = 0; - this.oldTime = 0; + this.now = 0; + this.then = 0; this.elapsed = 0; this.stats = new Stats(this); @@ -53,6 +59,19 @@ export default class Proton { this.integrationType = Util.initValue(integrationType, Proton.EULER); this.integrator = new Integration(this.integrationType); + + this._fps = "auto"; + this._interval = Proton.DEFAULT_INTERVAL; + } + + set fps(fps) { + this._fps = fps; + this._interval = + fps === "auto" ? Proton.DEFAULT_INTERVAL : MathUtil.floor(1 / fps, 7); + } + + get fps() { + return this._fps; } /** @@ -122,24 +141,40 @@ export default class Proton { * @instance */ update() { - this.dispatchEvent(Proton.PROTON_UPDATE); - - if (Proton.USE_CLOCK) { - if (!this.oldTime) this.oldTime = new Date().getTime(); - - let time = new Date().getTime(); - this.elapsed = (time - this.oldTime) / 1000; - Proton.amendChangeTabsBug && this.amendChangeTabsBug(); - - this.oldTime = time; - } else { - this.elapsed = 0.0167; + // 'auto' is the default browser refresh rate, the vast majority is 60fps + if (this._fps === "auto") { + this.dispatchEvent(Proton.PROTON_UPDATE); + + if (Proton.USE_CLOCK) { + if (!this.then) this.then = new Date().getTime(); + this.now = new Date().getTime(); + this.elapsed = (this.now - this.then) * 0.001; + // Fix bugs such as chrome browser switching tabs causing excessive time difference + this.amendChangeTabsBug(); + + if (this.elapsed > 0) this.emittersUpdate(this.elapsed); + this.then = this.now; + } else { + this.emittersUpdate(Proton.DEFAULT_INTERVAL); + } + + this.dispatchEvent(Proton.PROTON_UPDATE_AFTER); } - // emitter update - if (this.elapsed > 0) this.emittersUpdate(this.elapsed); - - this.dispatchEvent(Proton.PROTON_UPDATE_AFTER); + // If the fps frame rate is set + else { + if (!this.then) this.then = new Date().getTime(); + this.now = new Date().getTime(); + this.elapsed = (this.now - this.then) * 0.001; + + if (this.elapsed > this._interval) { + this.dispatchEvent(Proton.PROTON_UPDATE); + this.emittersUpdate(this._interval); + // https://stackoverflow.com/questions/19764018/controlling-fps-with-requestanimationframe + this.then = this.now - (this.elapsed % this._interval) * 1000; + this.dispatchEvent(Proton.PROTON_UPDATE_AFTER); + } + } } emittersUpdate(elapsed) { @@ -155,8 +190,9 @@ export default class Proton { * @instance */ amendChangeTabsBug() { + if (!Proton.amendChangeTabsBug) return; if (this.elapsed > 0.5) { - this.oldTime = new Date().getTime(); + this.then = new Date().getTime(); this.elapsed = 0; } } @@ -198,7 +234,7 @@ export default class Proton { destroy(remove = false) { const destroyOther = () => { this.time = 0; - this.oldTime = 0; + this.then = 0; this.pool.destroy(); Util.destroyAll(this.emitters); diff --git a/src/math/MathUtil.js b/src/math/MathUtil.js index 62d2d92..66ed1fc 100755 --- a/src/math/MathUtil.js +++ b/src/math/MathUtil.js @@ -2,44 +2,47 @@ const PI = 3.1415926; const INFINITY = Infinity; const MathUtil = { - PI: PI, - PIx2: PI * 2, - PI_2: PI / 2, - PI_180: PI / 180, - N180_PI: 180 / PI, - Infinity: -999, - - isInfinity(num) { - return num === this.Infinity || num === INFINITY; - }, - - randomAToB(a, b, isInt = false) { - if (!isInt) return a + Math.random() * (b - a); - else return Math.floor(Math.random() * (b - a)) + a; - }, - - randomFloating(center, f, isInt) { - return this.randomAToB(center - f, center + f, isInt); - }, - - randomZone(display) {}, - - degreeTransform(a) { - return (a * PI) / 180; - }, - - toColor16(num) { - return `#${num.toString(16)}`; - }, - - randomColor() { - return ( - "#" + - ("00000" + ((Math.random() * 0x1000000) << 0).toString(16)).slice( - -6 - ) - ); - } + PI: PI, + PIx2: PI * 2, + PI_2: PI / 2, + PI_180: PI / 180, + N180_PI: 180 / PI, + Infinity: -999, + + isInfinity(num) { + return num === this.Infinity || num === INFINITY; + }, + + randomAToB(a, b, isInt = false) { + if (!isInt) return a + Math.random() * (b - a); + else return Math.floor(Math.random() * (b - a)) + a; + }, + + randomFloating(center, f, isInt) { + return this.randomAToB(center - f, center + f, isInt); + }, + + randomColor() { + return ( + "#" + + ("00000" + ((Math.random() * 0x1000000) << 0).toString(16)).slice(-6) + ); + }, + + randomZone(display) {}, + + floor(num, k = 4) { + const digits = Math.pow(10, k); + return Math.floor(num * digits) / digits; + }, + + degreeTransform(a) { + return (a * PI) / 180; + }, + + toColor16(num) { + return `#${num.toString(16)}`; + } }; export default MathUtil;