From 9699111f7955c500281481952c73fc7516cec2b6 Mon Sep 17 00:00:00 2001 From: a-jie Date: Fri, 25 May 2018 21:03:30 +0800 Subject: [PATCH] add eslint add eslint --- build/proton.js | 704 +++++++++++++------------- build/proton.js.map | 2 +- build/proton.min.js | 4 +- build/proton.min.js.map | 2 +- eslintrc.json | 183 +++++++ package.json | 8 +- src/behaviour/Alpha.js | 5 +- src/behaviour/Attraction.js | 5 +- src/behaviour/Behaviour.js | 2 +- src/behaviour/Collision.js | 12 +- src/behaviour/Color.js | 3 +- src/behaviour/CrossZone.js | 4 +- src/behaviour/Force.js | 3 +- src/behaviour/Gravity.js | 4 +- src/behaviour/GravityWell.js | 10 +- src/behaviour/RandomDrift.js | 3 +- src/behaviour/Repulsion.js | 3 +- src/behaviour/Rotate.js | 10 +- src/behaviour/Scale.js | 2 +- src/core/Particle.js | 4 +- src/core/Pool.js | 12 +- src/core/Proton.js | 4 +- src/debug/Debug.js | 15 +- src/debug/Stats.js | 44 +- src/emitter/BehaviourEmitter.js | 3 +- src/emitter/Emitter.js | 20 +- src/emitter/FollowEmitter.js | 2 +- src/events/EventDispatcher.js | 10 +- src/index.js | 119 +++-- src/initialize/Body.js | 4 +- src/initialize/Initialize.js | 4 +- src/initialize/InitializeUtil.js | 4 +- src/initialize/Life.js | 2 +- src/initialize/Rate.js | 2 +- src/initialize/Velocity.js | 2 +- src/math/Integration.js | 2 - src/math/MathUtils.js | 2 +- src/math/Vector2D.js | 2 +- src/polyfill/requestAnimationFrame.js | 44 +- src/render/BaseRenderer.js | 24 +- src/render/CanvasRenderer.js | 16 +- src/render/CustomRenderer.js | 1 - src/render/DomRenderer.js | 4 +- src/render/EaselRenderer.js | 1 - src/render/PixelRenderer.js | 1 - src/render/PixiRenderer.js | 6 +- src/render/WebGLRenderer.js | 27 +- src/utils/ColorUtil.js | 2 +- src/utils/DomUtil.js | 16 +- src/utils/ImgUtil.js | 2 +- src/utils/MStack.js | 4 +- src/utils/PUID.js | 1 - src/utils/Util.js | 20 +- src/utils/WebGLUtil.js | 2 +- src/zone/CircleZone.js | 6 +- src/zone/ImageZone.js | 7 +- src/zone/LineZone.js | 16 +- src/zone/PointZone.js | 3 +- src/zone/RectZone.js | 6 +- src/zone/Zone.js | 5 +- 60 files changed, 794 insertions(+), 646 deletions(-) create mode 100755 eslintrc.json diff --git a/build/proton.js b/build/proton.js index 2f28c39..0179bb1 100644 --- a/build/proton.js +++ b/build/proton.js @@ -25,7 +25,7 @@ var MathUtils = { return a * PI / 180; }, toColor16: function toColor16(num) { - return "#" + num.toString(16); + return '#' + num.toString(16); }, randomColor: function randomColor() { return '#' + ('00000' + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6); @@ -137,192 +137,6 @@ var possibleConstructorReturn = function (self, call) { return call && (typeof call === "object" || typeof call === "function") ? call : self; }; -var Vector2D = function () { - function Vector2D(x, y) { - classCallCheck(this, Vector2D); - - this.x = x || 0; - this.y = y || 0; - } - - createClass(Vector2D, [{ - key: 'set', - value: function set$$1(x, y) { - this.x = x; - this.y = y; - return this; - } - }, { - key: 'setX', - value: function setX(x) { - this.x = x; - return this; - } - }, { - key: 'setY', - value: function setY(y) { - this.y = y; - return this; - } - }, { - key: 'getGradient', - value: function getGradient() { - if (this.x != 0) return Math.atan2(this.y, this.x);else if (this.y > 0) return MathUtils.PI_2;else if (this.y < 0) return -MathUtils.PI_2; - } - }, { - key: 'copy', - value: function copy(v) { - this.x = v.x; - this.y = v.y; - - return this; - } - }, { - key: 'add', - value: function add(v, w) { - if (w !== undefined) { - return this.addVectors(v, w); - } - - this.x += v.x; - this.y += v.y; - - return this; - } - }, { - key: 'addXY', - value: function addXY(a, b) { - this.x += a; - this.y += b; - - return this; - } - }, { - key: 'addVectors', - value: function addVectors(a, b) { - this.x = a.x + b.x; - this.y = a.y + b.y; - - return this; - } - }, { - key: 'sub', - value: function sub(v, w) { - if (w !== undefined) { - return this.subVectors(v, w); - } - - this.x -= v.x; - this.y -= v.y; - - return this; - } - }, { - key: 'subVectors', - value: function subVectors(a, b) { - this.x = a.x - b.x; - this.y = a.y - b.y; - - return this; - } - }, { - key: 'divideScalar', - value: function divideScalar(s) { - if (s !== 0) { - this.x /= s; - this.y /= s; - } else { - this.set(0, 0); - } - - return this; - } - }, { - key: 'multiplyScalar', - value: function multiplyScalar(s) { - this.x *= s; - this.y *= s; - - return this; - } - }, { - key: 'negate', - value: function negate() { - return this.multiplyScalar(-1); - } - }, { - key: 'dot', - value: function dot(v) { - return this.x * v.x + this.y * v.y; - } - }, { - key: 'lengthSq', - value: function lengthSq() { - return this.x * this.x + this.y * this.y; - } - }, { - key: 'length', - value: function length() { - return Math.sqrt(this.x * this.x + this.y * this.y); - } - }, { - key: 'normalize', - value: function normalize() { - return this.divideScalar(this.length()); - } - }, { - key: 'distanceTo', - value: function distanceTo(v) { - return Math.sqrt(this.distanceToSquared(v)); - } - }, { - key: 'rotate', - value: function rotate(tha) { - var x = this.x; - var y = this.y; - - this.x = x * Math.cos(tha) + y * Math.sin(tha); - this.y = -x * Math.sin(tha) + y * Math.cos(tha); - - return this; - } - }, { - key: 'distanceToSquared', - value: function distanceToSquared(v) { - var dx = this.x - v.x; - var dy = this.y - v.y; - - return dx * dx + dy * dy; - } - }, { - key: 'lerp', - value: function lerp(v, alpha) { - this.x += (v.x - this.x) * alpha; - this.y += (v.y - this.y) * alpha; - - return this; - } - }, { - key: 'equals', - value: function equals(v) { - return v.x === this.x && v.y === this.y; - } - }, { - key: 'clear', - value: function clear() { - this.x = 0.0; - this.y = 0.0; - return this; - } - }, { - key: 'clone', - value: function clone() { - return new Vector2D(this.x, this.y); - } - }]); - return Vector2D; -}(); - var Span = function () { function Span(a, b, center) { classCallCheck(this, Span); @@ -366,7 +180,7 @@ var WebGLUtil = { * @return {Boolean} */ ipot: function ipot(length) { - return (length & length - 1) == 0; + return (length & length - 1) === 0; }, @@ -494,12 +308,12 @@ var DomUtil = { * @param {String} $id the canvas' id * @param {Number} $width the canvas' width * @param {Number} $height the canvas' height - * @param {String} [$position=absolute] the canvas' position, default is 'absolute' + * @param {String} [$position=absolute] the canvas' position, default is 'absolute' * * @return {Object} */ createCanvas: function createCanvas(id, width, height, position) { - var dom = document.createElement("canvas"); + var dom = document.createElement('canvas'); position = position || 'absolute'; dom.id = id; @@ -513,7 +327,7 @@ var DomUtil = { return dom; }, createDiv: function createDiv(id, width, height) { - var dom = document.createElement("div"); + var dom = document.createElement('div'); dom.id = id; dom.style.position = 'absolute'; @@ -535,20 +349,20 @@ var DomUtil = { * @memberof Proton#Proton.DomUtil * @method transform * - * @param {HTMLDivElement} div - * @param {Number} $x - * @param {Number} $y - * @param {Number} $scale - * @param {Number} $rotate + * @param {HTMLDivElement} div + * @param {Number} $x + * @param {Number} $y + * @param {Number} $scale + * @param {Number} $rotate */ transform: function transform(div, x, y, scale, rotate) { - var transform = "translate(" + x + "px, " + y + "px) scale(" + scale + ") rotate(" + rotate + "deg)"; + var transform = 'translate(' + x + 'px, ' + y + 'px) scale(' + scale + ') rotate(' + rotate + 'deg)'; div.style.willChange = 'transform'; this.css3(div, 'transform', transform); }, transform3d: function transform3d(div, x, y, scale, rotate) { - var transform = "translate3d(" + x + "px, " + y + "px, 0) scale(" + scale + ") rotate(" + rotate + "deg)"; + var transform = 'translate3d(' + x + 'px, ' + y + 'px, 0) scale(' + scale + ') rotate(' + rotate + 'deg)'; div.style.willChange = 'transform'; this.css3(div, 'backfaceVisibility', 'hidden'); @@ -557,11 +371,11 @@ var DomUtil = { css3: function css3(div, key, val) { var bkey = key.charAt(0).toUpperCase() + key.substr(1); - div.style["Webkit" + bkey] = val; - div.style["Moz" + bkey] = val; - div.style["O" + bkey] = val; - div.style["ms" + bkey] = val; - div.style["" + key] = val; + div.style['Webkit' + bkey] = val; + div.style['Moz' + bkey] = val; + div.style['O' + bkey] = val; + div.style['ms' + bkey] = val; + div.style['' + key] = val; } }; @@ -603,7 +417,7 @@ var ImgUtil = { * @param {Boolean} func */ getImgFromCache: function getImgFromCache(img, callback, param) { - var src = typeof img == 'string' ? img : img.src; + var src = typeof img === 'string' ? img : img.src; if (IMG_CACHE[src]) { callback(IMG_CACHE[src], param); @@ -662,7 +476,7 @@ var Util = { * * @param {Array} value Any array * - * @returns {Boolean} + * @returns {Boolean} */ isArray: function isArray(value) { return Object.prototype.toString.call(value) === '[object Array]'; @@ -713,8 +527,8 @@ var Util = { if (!args) return new constructor(); args = [null].concat(args); - var factoryFunction = constructor.bind.apply(constructor, args); - return new factoryFunction(); + var FactoryFunc = constructor.bind.apply(constructor, args); + return new FactoryFunc(); }, @@ -739,13 +553,13 @@ var Util = { if (this.hasProp(pOBJ, 'ax')) target.a.x = pOBJ['ax']; if (this.hasProp(pOBJ, 'ay')) target.a.y = pOBJ['ay']; - if (this.hasProp(pOBJ, 'p')) particle.p.copy(pOBJ['p']); - if (this.hasProp(pOBJ, 'v')) particle.v.copy(pOBJ['v']); - if (this.hasProp(pOBJ, 'a')) particle.a.copy(pOBJ['a']); + if (this.hasProp(pOBJ, 'p')) target.p.copy(pOBJ['p']); + if (this.hasProp(pOBJ, 'v')) target.v.copy(pOBJ['v']); + if (this.hasProp(pOBJ, 'a')) target.a.copy(pOBJ['a']); - if (this.hasProp(pOBJ, 'position')) particle.p.copy(pOBJ['position']); - if (this.hasProp(pOBJ, 'velocity')) particle.v.copy(pOBJ['velocity']); - if (this.hasProp(pOBJ, 'accelerate')) particle.a.copy(pOBJ['accelerate']); + if (this.hasProp(pOBJ, 'position')) target.p.copy(pOBJ['position']); + if (this.hasProp(pOBJ, 'velocity')) target.v.copy(pOBJ['velocity']); + if (this.hasProp(pOBJ, 'accelerate')) target.a.copy(pOBJ['accelerate']); }, hasProp: function hasProp(obj, key) { if (!obj) return false; @@ -873,7 +687,6 @@ var PUID = { obj = this.cache[id]; if (obj === target) return id; - if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && obj.isInner && target.isInner) { if (obj.src === target.src) return id; } @@ -891,9 +704,9 @@ var PUID = { * -> cache[abc]. -> cache[abc] .pop() * -> create [new Body| clone] * -> return p1: { __pid: abc } - * + * * expire -> cache[abc]= [p0, p1]; - * + * */ var Pool = function () { @@ -960,7 +773,7 @@ var Pool = function () { /** * Creates a new class instance * - * @todo add more documentation + * @todo add more documentation * * @method create * @memberof Proton#Proton.Pool @@ -978,7 +791,7 @@ var Pool = function () { if (this.create) { return this.create(target, params); - } else if (typeof target == "function") { + } else if (typeof target === 'function') { return Util.classApply(target, params); } else { return target.clone(); @@ -1035,7 +848,7 @@ var Pool = function () { }, { key: 'getCache', value: function getCache(uid) { - uid = uid || "default"; + uid = uid || 'default'; if (!this.cache[uid]) this.cache[uid] = []; return this.cache[uid]; @@ -1057,43 +870,43 @@ var Stats = function () { } createClass(Stats, [{ - key: "update", + key: 'update', value: function update(style, body) { this.add(style, body); var emitter = this.getEmitter(); var renderer = this.getRenderer(); - var str = ""; + var str = ''; switch (this.type) { case 2: - str += "emitter:" + this.proton.emitters.length + "
"; - if (emitter) str += "em speed:" + emitter.emitSpeed + "
"; - if (emitter) str += "pos:" + this.getEmitterPos(emitter); + str += 'emitter:' + this.proton.emitters.length + '
'; + if (emitter) str += 'em speed:' + emitter.emitSpeed + '
'; + if (emitter) str += 'pos:' + this.getEmitterPos(emitter); break; case 3: - if (emitter) str += "initializes:" + emitter.initializes.length + "
"; - if (emitter) str += "" + this.concatArr(emitter.initializes) + "
"; - if (emitter) str += "behaviours:" + emitter.behaviours.length + "
"; - if (emitter) str += "" + this.concatArr(emitter.behaviours) + "
"; + if (emitter) str += 'initializes:' + emitter.initializes.length + '
'; + if (emitter) str += '' + this.concatArr(emitter.initializes) + '
'; + if (emitter) str += 'behaviours:' + emitter.behaviours.length + '
'; + if (emitter) str += '' + this.concatArr(emitter.behaviours) + '
'; break; case 4: - if (renderer) str += renderer.name + "
"; - if (renderer) str += "body:" + this.getCreatedNumber(renderer) + "
"; + if (renderer) str += renderer.name + '
'; + if (renderer) str += 'body:' + this.getCreatedNumber(renderer) + '
'; break; default: - str += "particles:" + this.proton.getCount() + "
"; - str += "pool:" + this.proton.pool.getCount() + "
"; - str += "total:" + this.proton.pool.total; + str += 'particles:' + this.proton.getCount() + '
'; + str += 'pool:' + this.proton.pool.getCount() + '
'; + str += 'total:' + this.proton.pool.total; } this.container.innerHTML = str; } }, { - key: "add", + key: 'add', value: function add(style, body) { var _this = this; @@ -1112,22 +925,22 @@ var Stats = function () { color = void 0; switch (style) { case 2: - bg = "#201"; - color = "#f08"; + bg = '#201'; + color = '#f08'; break; case 3: - bg = "#020"; - color = "#0f0"; + bg = '#020'; + color = '#0f0'; break; default: - bg = "#002"; - color = "#0ff"; + bg = '#002'; + color = '#0ff'; } - this.container.style["background-color"] = bg; - this.container.style["color"] = color; + this.container.style['background-color'] = bg; + this.container.style['color'] = color; } if (!this.container.parentNode) { @@ -1136,17 +949,17 @@ var Stats = function () { } } }, { - key: "getEmitter", + key: 'getEmitter', value: function getEmitter() { return this.proton.emitters[this.emitterIndex]; } }, { - key: "getRenderer", + key: 'getRenderer', value: function getRenderer() { return this.proton.renderers[this.rendererIndex]; } }, { - key: "concatArr", + key: 'concatArr', value: function concatArr(arr) { var result = ''; if (!arr || !arr.length) return result; @@ -1158,14 +971,14 @@ var Stats = function () { return result; } }, { - key: "getCreatedNumber", + key: 'getCreatedNumber', value: function getCreatedNumber(renderer) { return renderer.pool.total || renderer.cpool && renderer.cpool.total || 0; } }, { - key: "getEmitterPos", + key: 'getEmitterPos', value: function getEmitterPos(e) { - return Math.round(e.p.x) + "," + Math.round(e.p.y); + return Math.round(e.p.x) + ',' + Math.round(e.p.y); } }]); return Stats; @@ -1208,8 +1021,8 @@ var EventDispatcher = function () { var length = arr.length; for (var i = 0; i < length; i++) { - if (arr[i] == listener) { - if (length == 1) { + if (arr[i] === listener) { + if (length === 1) { delete this._listeners[type]; } @@ -1237,7 +1050,7 @@ var EventDispatcher = function () { var arr = listeners[type]; if (!arr) return result; - //arr = arr.slice(); + // arr = arr.slice(); // to avoid issues with items being removed or added during the dispatch var handler = void 0; @@ -1277,7 +1090,7 @@ var Integration = function () { } createClass(Integration, [{ - key: 'calculate', + key: "calculate", value: function calculate(particles, time, damping) { this.eulerIntegrate(particles, time, damping); } @@ -1285,7 +1098,7 @@ var Integration = function () { // Euler Integrate }, { - key: 'eulerIntegrate', + key: "eulerIntegrate", value: function eulerIntegrate(particle, time, damping) { if (!particle.sleep) { particle.old.p.copy(particle.p); @@ -1325,7 +1138,7 @@ var Proton = function () { */ - //1:100 + // 1:100 function Proton(integrationType) { classCallCheck(this, Proton); @@ -1466,7 +1279,7 @@ var Proton = function () { }, { key: 'amendChangeTabsBug', value: function amendChangeTabsBug() { - if (this.elapsed > .5) { + if (this.elapsed > 0.5) { this.oldTime = new Date().getTime(); this.elapsed = 0; } @@ -1628,6 +1441,192 @@ var ease = { } }; +var Vector2D = function () { + function Vector2D(x, y) { + classCallCheck(this, Vector2D); + + this.x = x || 0; + this.y = y || 0; + } + + createClass(Vector2D, [{ + key: 'set', + value: function set$$1(x, y) { + this.x = x; + this.y = y; + return this; + } + }, { + key: 'setX', + value: function setX(x) { + this.x = x; + return this; + } + }, { + key: 'setY', + value: function setY(y) { + this.y = y; + return this; + } + }, { + key: 'getGradient', + value: function getGradient() { + if (this.x !== 0) return Math.atan2(this.y, this.x);else if (this.y > 0) return MathUtils.PI_2;else if (this.y < 0) return -MathUtils.PI_2; + } + }, { + key: 'copy', + value: function copy(v) { + this.x = v.x; + this.y = v.y; + + return this; + } + }, { + key: 'add', + value: function add(v, w) { + if (w !== undefined) { + return this.addVectors(v, w); + } + + this.x += v.x; + this.y += v.y; + + return this; + } + }, { + key: 'addXY', + value: function addXY(a, b) { + this.x += a; + this.y += b; + + return this; + } + }, { + key: 'addVectors', + value: function addVectors(a, b) { + this.x = a.x + b.x; + this.y = a.y + b.y; + + return this; + } + }, { + key: 'sub', + value: function sub(v, w) { + if (w !== undefined) { + return this.subVectors(v, w); + } + + this.x -= v.x; + this.y -= v.y; + + return this; + } + }, { + key: 'subVectors', + value: function subVectors(a, b) { + this.x = a.x - b.x; + this.y = a.y - b.y; + + return this; + } + }, { + key: 'divideScalar', + value: function divideScalar(s) { + if (s !== 0) { + this.x /= s; + this.y /= s; + } else { + this.set(0, 0); + } + + return this; + } + }, { + key: 'multiplyScalar', + value: function multiplyScalar(s) { + this.x *= s; + this.y *= s; + + return this; + } + }, { + key: 'negate', + value: function negate() { + return this.multiplyScalar(-1); + } + }, { + key: 'dot', + value: function dot(v) { + return this.x * v.x + this.y * v.y; + } + }, { + key: 'lengthSq', + value: function lengthSq() { + return this.x * this.x + this.y * this.y; + } + }, { + key: 'length', + value: function length() { + return Math.sqrt(this.x * this.x + this.y * this.y); + } + }, { + key: 'normalize', + value: function normalize() { + return this.divideScalar(this.length()); + } + }, { + key: 'distanceTo', + value: function distanceTo(v) { + return Math.sqrt(this.distanceToSquared(v)); + } + }, { + key: 'rotate', + value: function rotate(tha) { + var x = this.x; + var y = this.y; + + this.x = x * Math.cos(tha) + y * Math.sin(tha); + this.y = -x * Math.sin(tha) + y * Math.cos(tha); + + return this; + } + }, { + key: 'distanceToSquared', + value: function distanceToSquared(v) { + var dx = this.x - v.x; + var dy = this.y - v.y; + + return dx * dx + dy * dy; + } + }, { + key: 'lerp', + value: function lerp(v, alpha) { + this.x += (v.x - this.x) * alpha; + this.y += (v.y - this.y) * alpha; + + return this; + } + }, { + key: 'equals', + value: function equals(v) { + return v.x === this.x && v.y === this.y; + } + }, { + key: 'clear', + value: function clear() { + this.x = 0.0; + this.y = 0.0; + return this; + } + }, { + key: 'clone', + value: function clone() { + return new Vector2D(this.x, this.y); + } + }]); + return Vector2D; +}(); + var Particle = function () { /** @@ -1663,7 +1662,7 @@ var Particle = function () { this.life = Infinity; this.age = 0; - //Energy loss + // Energy loss this.energy = 1; this.dead = false; this.sleep = false; @@ -1680,7 +1679,7 @@ var Particle = function () { this.easing = ease.easeLinear; - if (init == 'init') { + if (init === 'init') { this.transform = {}; this.p = new Vector2D(); this.v = new Vector2D(); @@ -1814,7 +1813,7 @@ var ColorUtil = { * @return {rgbObject} */ hexToRGB: function hexToRGB(h) { - var hex16 = h.charAt(0) == "#" ? h.substring(1, 7) : h; + var hex16 = h.charAt(0) === '#' ? h.substring(1, 7) : h; var r = parseInt(hex16.substring(0, 2), 16); var g = parseInt(hex16.substring(2, 4), 16); var b = parseInt(hex16.substring(4, 6), 16); @@ -1834,7 +1833,7 @@ var ColorUtil = { * @return {String} rgb() */ rgbToHex: function rgbToHex(rbg) { - return "rgb(" + rbg.r + ", " + rbg.g + ", " + rbg.b + ")"; + return 'rgb(' + rbg.r + ', ' + rbg.g + ', ' + rbg.b + ')'; }, getHex16FromParticle: function getHex16FromParticle(p) { return Number(p.transform.rgb.r) * 65536 + Number(p.transform.rgb.g) * 256 + Number(p.transform.rgb.b); @@ -2093,7 +2092,7 @@ var Rate = function () { this.startTime = 0; this.nextTime = this.timePan.getValue(); - if (this.numPan.b == 1) { + if (this.numPan.b === 1) { if (this.numPan.getValue(false) > 0.5) return 1;else return 0; } else { return this.numPan.getValue(true); @@ -2127,7 +2126,7 @@ var Initialize = function () { key: "initialize", - ///sub class init + // sub class init value: function initialize(target) {} }]); return Initialize; @@ -2149,7 +2148,7 @@ var Life = function (_Initialize) { createClass(Life, [{ key: 'initialize', value: function initialize(target) { - if (this.lifePan.a == Infinity) target.life = Infinity;else target.life = this.lifePan.getValue(); + if (this.lifePan.a === Infinity) target.life = Infinity;else target.life = this.lifePan.getValue(); } }]); return Life; @@ -2161,15 +2160,15 @@ var Zone = function () { this.vector = new Vector2D(0, 0); this.random = 0; - this.crossType = "dead"; + this.crossType = 'dead'; this.alert = true; } createClass(Zone, [{ - key: "getPosition", + key: 'getPosition', value: function getPosition() {} }, { - key: "crossing", + key: 'crossing', value: function crossing(particle) {} }]); return Zone; @@ -2193,13 +2192,11 @@ var PointZone = function (_Zone) { value: function getPosition() { this.vector.x = this.x; this.vector.y = this.y; - return this.vector; } }, { key: 'crossing', value: function crossing(particle) { - if (this.alert) { alert('Sorry PointZone does not support crossing method'); this.alert = false; @@ -2271,7 +2268,7 @@ var Velocity = function (_Initialize) { }, { key: 'initialize', value: function initialize(target) { - if (this.type == 'p' || this.type == 'P' || this.type == 'polar') { + if (this.type === 'p' || this.type === 'P' || this.type === 'polar') { var polar2d = new Polar2D(this.normalizeVelocity(this.rPan.getValue()), this.thaPan.getValue() * MathUtils.PI_180); target.v.x = polar2d.getX(); @@ -2356,7 +2353,7 @@ var Body = function (_Initialize) { value: function initialize(particle) { var imagetarget = this.image.getValue(); - if (typeof imagetarget == 'string') { + if (typeof imagetarget === 'string') { particle.body = { width: this.w, height: this.h, src: imagetarget, isInner: true, inner: true }; } else { particle.body = imagetarget; @@ -2434,7 +2431,7 @@ var Behaviour = function () { * @memberof Proton.Behaviour * @instance * - * @param {Proton.Vector2D} force + * @param {Proton.Vector2D} force */ }, { @@ -2546,7 +2543,7 @@ var Force = function (_Behaviour) { var _this = possibleConstructorReturn(this, (Force.__proto__ || Object.getPrototypeOf(Force)).call(this, life, easing)); _this.force = _this.normalizeForce(new Vector2D(fx, fy)); - _this.name = "Force"; + _this.name = 'Force'; return _this; } @@ -2634,7 +2631,7 @@ var Attraction = function (_Behaviour) { _this.attractionForce = new Vector2D(); _this.lengthSq = 0; - _this.name = "Attraction"; + _this.name = 'Attraction'; return _this; } @@ -2727,7 +2724,7 @@ var RandomDrift = function (_Behaviour) { _this.reset(driftX, driftY, delay); _this.time = 0; - _this.name = "RandomDrift"; + _this.name = 'RandomDrift'; return _this; } @@ -2803,7 +2800,7 @@ var Gravity = function (_Force) { var _this = possibleConstructorReturn(this, (Gravity.__proto__ || Object.getPrototypeOf(Gravity)).call(this, 0, g, life, easing)); - _this.name = "Gravity"; + _this.name = 'Gravity'; return _this; } @@ -2829,8 +2826,6 @@ var Gravity = function (_Force) { return Gravity; }(Force); -//can use Collision(emitter,true,function(){}) or Collision(); - var Collision = function (_Behaviour) { inherits(Collision, _Behaviour); @@ -2851,7 +2846,7 @@ var Collision = function (_Behaviour) { * @todo add description to mass * * @param {Proton.Emitter} [emitter=null] the attraction point coordinates - * @param {Boolean} [mass=true] + * @param {Boolean} [mass=true] * @param {Callback} [callback=null] the callback after the collision * @param {Number} [life=Infinity] this behaviour's life * @param {String} [easing=ease.easeLinear] this behaviour's easing @@ -2864,7 +2859,7 @@ var Collision = function (_Behaviour) { var _this = possibleConstructorReturn(this, (Collision.__proto__ || Object.getPrototypeOf(Collision)).call(this, life, easing)); _this.reset(emitter, mass, callback); - _this.name = "Collision"; + _this.name = 'Collision'; return _this; } @@ -2878,7 +2873,7 @@ var Collision = function (_Behaviour) { * @todo add description to mass * * @param {Proton.Emitter} [emitter=null] the attraction point coordinates - * @param {Boolean} [mass=true] + * @param {Boolean} [mass=true] * @param {Callback} [callback=null] the callback after the collision * @param {Number} [life=Infinity] this behaviour's life * @param {String} [easing=ease.easeLinear] this behaviour's easing @@ -2978,7 +2973,7 @@ var CrossZone = function (_Behaviour) { var _this = possibleConstructorReturn(this, (CrossZone.__proto__ || Object.getPrototypeOf(CrossZone)).call(this, life, easing)); _this.reset(zone, crossType); - _this.name = "CrossZone"; + _this.name = 'CrossZone'; return _this; } @@ -3000,7 +2995,7 @@ var CrossZone = function (_Behaviour) { key: 'reset', value: function reset(zone, crossType, life, easing) { this.zone = zone; - this.zone.crossType = Util.initValue(crossType, "dead"); + this.zone.crossType = Util.initValue(crossType, 'dead'); life && get(CrossZone.prototype.__proto__ || Object.getPrototypeOf(CrossZone.prototype), 'reset', this).call(this, life, easing); } @@ -3051,7 +3046,7 @@ var Alpha = function (_Behaviour) { var _this = possibleConstructorReturn(this, (Alpha.__proto__ || Object.getPrototypeOf(Alpha)).call(this, life, easing)); _this.reset(a, b); - _this.name = "Alpha"; + _this.name = 'Alpha'; return _this; } @@ -3113,7 +3108,6 @@ var Alpha = function (_Behaviour) { key: 'applyBehaviour', value: function applyBehaviour(particle, time, index) { this.calculate(particle, time, index); - particle.alpha = particle.transform.alphaB + (particle.transform.alphaA - particle.transform.alphaB) * this.energy; if (particle.alpha < 0.001) particle.alpha = 0; } @@ -3145,7 +3139,7 @@ var Scale = function (_Behaviour) { var _this = possibleConstructorReturn(this, (Scale.__proto__ || Object.getPrototypeOf(Scale)).call(this, life, easing)); _this.reset(a, b); - _this.name = "Scale"; + _this.name = 'Scale'; return _this; } @@ -3241,7 +3235,7 @@ var Rotate = function (_Behaviour) { var _this = possibleConstructorReturn(this, (Rotate.__proto__ || Object.getPrototypeOf(Rotate)).call(this, life, easing)); _this.reset(influence, b, style); - _this.name = "Rotate"; + _this.name = 'Rotate'; return _this; } @@ -3267,7 +3261,7 @@ var Rotate = function (_Behaviour) { value: function reset(a, b, style, life, easing) { this.same = b === null || b === undefined ? true : false; - this.a = Util.setSpanValue(Util.initValue(a, "Velocity")); + this.a = Util.setSpanValue(Util.initValue(a, 'Velocity')); this.b = Util.setSpanValue(Util.initValue(b, 0)); this.style = Util.initValue(style, 'to'); @@ -3311,13 +3305,13 @@ var Rotate = function (_Behaviour) { this.calculate(particle, time, index); if (!this.same) { - if (this.style == 'to' || this.style == 'TO' || this.style == '_') { + if (this.style === 'to' || this.style === 'TO' || this.style === '_') { particle.rotation += particle.transform.rotationB + (particle.transform.rotationA - particle.transform.rotationB) * this.energy; } else { particle.rotation += particle.transform.rotationB; } - } else if (this.a.a == "V" || this.a.a == "Velocity" || this.a.a == "v") { - //beta... + } else if (this.a.a === 'V' || this.a.a === 'Velocity' || this.a.a === 'v') { + // beta... particle.rotation = particle.getDirection(); } } @@ -3347,7 +3341,7 @@ var Color = function (_Behaviour) { var _this = possibleConstructorReturn(this, (Color.__proto__ || Object.getPrototypeOf(Color)).call(this, life, easing)); _this.reset(a, b); - _this.name = "Color"; + _this.name = 'Color'; return _this; } @@ -3456,7 +3450,7 @@ var Repulsion = function (_Attraction) { var _this = possibleConstructorReturn(this, (Repulsion.__proto__ || Object.getPrototypeOf(Repulsion)).call(this, targetPosition, force, radius, life, easing)); _this.force *= -1; - _this.name = "Repulsion"; + _this.name = 'Repulsion'; return _this; } @@ -3497,7 +3491,7 @@ var GravityWell = function (_Behaviour) { * @alias GravityWell * * @param {Vector2D} [centerPoint=new Vector2D] The point in the center - * @param {Number} [force=100] The force + * @param {Number} [force=100] The force * @param {Number} [life=Infinity] this behaviour's life * @param {String} [easing=easeLinear] this behaviour's easing * @@ -3512,7 +3506,7 @@ var GravityWell = function (_Behaviour) { _this.centerPoint = Util.initValue(centerPoint, new Vector2D()); _this.force = Util.initValue(_this.normalizeValue(force), 100); - _this.name = "GravityWell"; + _this.name = 'GravityWell'; return _this; } @@ -3524,7 +3518,7 @@ var GravityWell = function (_Behaviour) { * @instance * * @param {Vector2D} [centerPoint=new Vector2D] The point in the center - * @param {Number} [force=100] The force + * @param {Number} [force=100] The force * @param {Number} [life=Infinity] this behaviour's life * @param {String} [easing=easeLinear] this behaviour's easing */ @@ -3566,7 +3560,7 @@ var GravityWell = function (_Behaviour) { this.distanceVec.set(this.centerPoint.x - particle.p.x, this.centerPoint.y - particle.p.y); var distanceSq = this.distanceVec.lengthSq(); - if (distanceSq != 0) { + if (distanceSq !== 0) { var distance = this.distanceVec.length(); var factor = this.force * time / (distanceSq * distance); @@ -3591,7 +3585,7 @@ var InitializeUtil = { }, - //////////////////////init////////////////////// + // init init: function init(emitter, particle, initialize) { Util.setPrototypeByObject(particle, initialize); Util.setVector2DByObject(particle, initialize); @@ -3680,8 +3674,8 @@ var Emitter = function (_Particle) { this.emitTime = 0; this.totalTime = Util.initValue(totalTime, Infinity); - if (life == true || life == 'life' || life == 'destroy') { - this.life = totalTime == 'once' ? 1 : this.totalTime; + if (life === true || life === 'life' || life === 'destroy') { + this.life = totalTime === 'once' ? 1 : this.totalTime; } else if (!isNaN(life)) { this.life = life; } @@ -3755,7 +3749,7 @@ var Emitter = function (_Particle) { /** * add the Initialize to particles; - * + * * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3); * @method addInitialize * @param {Initialize} initialize like this new Radius(1, 12) @@ -3800,7 +3794,7 @@ var Emitter = function (_Particle) { /** * add the Behaviour to particles; - * + * * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3); * @method addBehaviour * @param {Behaviour} behaviour like this new Color('random') @@ -3852,7 +3846,7 @@ var Emitter = function (_Particle) { Util.destroyArray(this.behaviours); } - // emitter update + // emitter update }, { key: 'update', @@ -3881,11 +3875,11 @@ var Emitter = function (_Particle) { // particle update particle.update(time, i); this.parent.integrator.calculate(particle, time, damping); - this.dispatch("PARTICLE_UPDATE", particle); + this.dispatch('PARTICLE_UPDATE', particle); // check dead if (particle.dead) { - this.dispatch("PARTICLE_DEAD", particle); + this.dispatch('PARTICLE_DEAD', particle); this.parent.pool.expire(particle); this.particles.splice(i, 1); @@ -3901,7 +3895,7 @@ var Emitter = function (_Particle) { }, { key: 'emitting', value: function emitting(time) { - if (this.totalTime == 'once') { + if (this.totalTime === 'once') { var i = void 0; var length = this.rate.getValue(99999); @@ -3926,7 +3920,7 @@ var Emitter = function (_Particle) { /** * create single particle; - * + * * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun}) * @method removeAllParticles */ @@ -3936,7 +3930,7 @@ var Emitter = function (_Particle) { value: function createParticle(initialize, behaviour) { var particle = this.parent.pool.get(Particle); this.setupParticle(particle, initialize, behaviour); - this.dispatch("PARTICLE_CREATED", particle); + this.dispatch('PARTICLE_CREATED', particle); return particle; } @@ -4084,7 +4078,7 @@ var FollowEmitter = function (_Emitter) { var _this = possibleConstructorReturn(this, (FollowEmitter.__proto__ || Object.getPrototypeOf(FollowEmitter)).call(this, pObj)); _this.mouseTarget = Util.initValue(mouseTarget, window); - _this.ease = Util.initValue(ease, .7); + _this.ease = Util.initValue(ease, 0.7); _this._allowEmitting = false; _this.initEventHandler(); @@ -4226,6 +4220,11 @@ var BaseRenderer = function () { }, { key: 'resize', value: function resize(width, height) {} + }, { + key: 'destroy', + value: function destroy() { + this.remove(); + } }, { key: 'remove', value: function remove(proton) { @@ -4241,11 +4240,6 @@ var BaseRenderer = function () { this.parent = null; } - }, { - key: 'destroy', - value: function destroy() { - this.remove(); - } }, { key: 'onProtonUpdate', value: function onProtonUpdate() {} @@ -4280,7 +4274,7 @@ var CanvasRenderer = function (_BaseRenderer) { var _this = possibleConstructorReturn(this, (CanvasRenderer.__proto__ || Object.getPrototypeOf(CanvasRenderer)).call(this, element)); _this.stroke = null; - _this.context = _this.element.getContext("2d"); + _this.context = _this.element.getContext('2d'); _this.bufferCache = {}; _this.name = 'CanvasRenderer'; @@ -4318,7 +4312,7 @@ var CanvasRenderer = function (_BaseRenderer) { particle.body = null; } - // private + // private }, { key: 'addImg2Body', @@ -4326,7 +4320,7 @@ var CanvasRenderer = function (_BaseRenderer) { particle.body = img; } - // private drawCircle -- + // private drawCircle }, { key: 'drawImage', @@ -4337,17 +4331,17 @@ var CanvasRenderer = function (_BaseRenderer) { var y = particle.p.y - h / 2; if (!!particle.color) { - if (!particle.transform["buffer"]) particle.transform.buffer = this.createBuffer(particle.body); + if (!particle.transform['buffer']) particle.transform.buffer = this.createBuffer(particle.body); var bufferContext = particle.transform.buffer.getContext('2d'); bufferContext.clearRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height); bufferContext.globalAlpha = particle.alpha; bufferContext.drawImage(particle.body, 0, 0); - bufferContext.globalCompositeOperation = "source-atop"; + bufferContext.globalCompositeOperation = 'source-atop'; bufferContext.fillStyle = ColorUtil.rgbToHex(particle.transform.rgb); bufferContext.fillRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height); - bufferContext.globalCompositeOperation = "source-over"; + bufferContext.globalCompositeOperation = 'source-over'; bufferContext.globalAlpha = 1; this.context.drawImage(particle.transform.buffer, 0, 0, particle.transform.buffer.width, particle.transform.buffer.height, x, y, w, h); @@ -4370,7 +4364,7 @@ var CanvasRenderer = function (_BaseRenderer) { }, { key: 'drawCircle', value: function drawCircle(particle) { - if (particle.transform["rgb"]) this.context.fillStyle = 'rgba(' + particle.transform.rgb.r + ',' + particle.transform.rgb.g + ',' + particle.transform.rgb.b + ',' + particle.alpha + ')';else this.context.fillStyle = particle.color; + if (particle.transform['rgb']) this.context.fillStyle = 'rgba(' + particle.transform.rgb.r + ',' + particle.transform.rgb.g + ',' + particle.transform.rgb.b + ',' + particle.alpha + ')';else this.context.fillStyle = particle.color; // draw circle this.context.beginPath(); @@ -4466,7 +4460,7 @@ var DomRenderer = function (_BaseRenderer) { return _typeof(particle.body) === 'object' && particle.body && !particle.body.isInner; } - // private + // private }, { key: 'addImg2Body', @@ -4773,7 +4767,7 @@ var PixiRenderer = function (_BaseRenderer) { if (this.stroke) { var stroke = this.stroke instanceof String ? this.stroke : 0x000000; - graphics.beginStroke(this.stroke); + graphics.beginStroke(stroke); } graphics.beginFill(particle.color || 0x008ced); @@ -4801,14 +4795,14 @@ var MStack = function () { createClass(MStack, [{ key: 'set', value: function set$$1(m, i) { - if (i == 0) Mat3.set(m, this.mats[0]);else Mat3.multiply(this.mats[i - 1], m, this.mats[i]); + if (i === 0) Mat3.set(m, this.mats[0]);else Mat3.multiply(this.mats[i - 1], m, this.mats[i]); this.size = Math.max(this.size, i + 1); } }, { key: 'push', value: function push(m) { - if (this.size == 0) Mat3.set(m, this.mats[0]);else Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]); + if (this.size === 0) Mat3.set(m, this.mats[0]);else Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]); this.size++; } @@ -4835,7 +4829,7 @@ var WebGLRenderer = function (_BaseRenderer) { var _this = possibleConstructorReturn(this, (WebGLRenderer.__proto__ || Object.getPrototypeOf(WebGLRenderer)).call(this, element)); _this.gl = _this.element.getContext('experimental-webgl', { antialias: true, stencil: false, depth: false }); - if (!_this.gl) alert("Sorry your browser do not suppest WebGL!"); + if (!_this.gl) alert('Sorry your browser do not suppest WebGL!'); _this.initVar(); _this.setMaxRadius(); @@ -4882,13 +4876,13 @@ var WebGLRenderer = function (_BaseRenderer) { }, { key: 'getVertexShader', value: function getVertexShader() { - var 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"); + var 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'); return vsSource; } }, { key: 'getFragmentShader', value: function getFragmentShader() { - var 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"); + var 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'); return fsSource; } }, { @@ -4935,18 +4929,18 @@ var WebGLRenderer = function (_BaseRenderer) { this.gl.attachShader(this.sprogram, fragmentShader); this.gl.linkProgram(this.sprogram); - if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS)) alert("Could not initialise shaders"); + if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS)) alert('Could not initialise shaders'); this.gl.useProgram(this.sprogram); - this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, "aVertexPosition"); - this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, "aTextureCoord"); + this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, 'aVertexPosition'); + this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, 'aTextureCoord'); this.gl.enableVertexAttribArray(this.sprogram.tca); this.gl.enableVertexAttribArray(this.sprogram.vpa); - this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, "tMat"); - this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, "uSampler"); - this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, "useTexture"); - this.sprogram.color = this.gl.getUniformLocation(this.sprogram, "uColor"); + this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, 'tMat'); + this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, 'uSampler'); + this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, 'useTexture'); + this.sprogram.color = this.gl.getUniformLocation(this.sprogram, 'uColor'); this.gl.uniform1i(this.sprogram.useTex, 1); } }, { @@ -5032,8 +5026,8 @@ var WebGLRenderer = function (_BaseRenderer) { }, { key: 'onProtonUpdate', value: function onProtonUpdate() { - //this.gl.clearColor(0, 0, 0, 1); - //this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT); + // this.gl.clearColor(0, 0, 0, 1); + // this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT); } }, { key: 'onParticleCreated', @@ -5052,13 +5046,12 @@ var WebGLRenderer = function (_BaseRenderer) { } } - // private + // private }, { key: 'addImg2Body', value: function addImg2Body(img, particle) { if (particle.dead) return; - particle.body = img; particle.transform.src = img.src; particle.transform.canvas = ImgUtil.getCanvasFromCache(img); @@ -5183,7 +5176,7 @@ var LineZone = function (_Zone) { var A = this.dy; var B = -this.dx; var C = this.dot; - var D = B == 0 ? 1 : B; + var D = B === 0 ? 1 : B; if ((A * x + B * y + C) * D > 0) return true;else return false; } @@ -5238,27 +5231,27 @@ var LineZone = function (_Zone) { }, { key: 'crossing', value: function crossing(particle) { - if (this.crossType == "dead") { - if (this.direction == ">" || this.direction == "R" || this.direction == "right" || this.direction == "down") { + if (this.crossType === 'dead') { + if (this.direction === '>' || this.direction === 'R' || this.direction === 'right' || this.direction === 'down') { if (!this.rangeOut(particle)) return; if (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true; } else { if (!this.rangeOut(particle)) return; if (!this.getDirection(particle.p.x, particle.p.y)) particle.dead = true; } - } else if (this.crossType == "bound") { + } else if (this.crossType === 'bound') { if (!this.rangeOut(particle)) return; if (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) { - if (this.dx == 0) { + if (this.dx === 0) { particle.v.x *= -1; - } else if (this.dy == 0) { + } else if (this.dy === 0) { particle.v.y *= -1; } else { this.getSymmetric(particle.v); } } - } else if (this.crossType == "cross") { + } else if (this.crossType === 'cross') { if (this.alert) { console.error('Sorry lineZone does not support cross method'); this.alert = false; @@ -5308,11 +5301,11 @@ var CircleZone = function (_Zone) { value: function crossing(particle) { var d = particle.p.distanceTo(this.center); - if (this.crossType == "dead") { + if (this.crossType === 'dead') { if (d - particle.radius > this.radius) particle.dead = true; - } else if (this.crossType == "bound") { + } else if (this.crossType === 'bound') { if (d + particle.radius >= this.radius) this.getSymmetric(particle); - } else if (this.crossType == "cross") { + } else if (this.crossType === 'cross') { if (this.alert) { alert('Sorry CircleZone does not support cross method'); this.alert = false; @@ -5357,7 +5350,7 @@ var RectZone = function (_Zone) { } createClass(RectZone, [{ - key: "getPosition", + key: 'getPosition', value: function getPosition() { this.vector.x = this.x + Math.random() * this.width; this.vector.y = this.y + Math.random() * this.height; @@ -5365,13 +5358,13 @@ var RectZone = function (_Zone) { return this.vector; } }, { - key: "crossing", + key: 'crossing', value: function crossing(particle) { - if (this.crossType == "dead") { + if (this.crossType === 'dead') { if (particle.p.x + particle.radius < this.x) particle.dead = true;else if (particle.p.x - particle.radius > this.x + this.width) particle.dead = true; if (particle.p.y + particle.radius < this.y) particle.dead = true;else if (particle.p.y - particle.radius > this.y + this.height) particle.dead = true; - } else if (this.crossType == "bound") { + } else if (this.crossType === 'bound') { if (particle.p.x - particle.radius < this.x) { particle.p.x = this.x + particle.radius; particle.v.x *= -1; @@ -5387,7 +5380,7 @@ var RectZone = function (_Zone) { particle.p.y = this.y + this.height - particle.radius; particle.v.y *= -1; } - } else if (this.crossType == "cross") { + } else if (this.crossType === 'cross') { if (particle.p.x + particle.radius < this.x && particle.v.x <= 0) particle.p.x = this.x + this.width + particle.radius;else if (particle.p.x - particle.radius > this.x + this.width && particle.v.x >= 0) particle.p.x = this.x - particle.radius; if (particle.p.y + particle.radius < this.y && particle.v.y <= 0) particle.p.y = this.y + this.height + particle.radius;else if (particle.p.y - particle.radius > this.y + this.height && particle.v.y >= 0) particle.p.y = this.y - particle.radius; @@ -5468,9 +5461,9 @@ var ImageZone = function (_Zone) { }, { key: 'crossing', value: function crossing(particle) { - if (this.crossType == "dead") { + if (this.crossType === 'dead') { if (this.getBound(particle.p.x - this.x, particle.p.y - this.y)) particle.dead = true;else particle.dead = false; - } else if (this.crossType == "bound") { + } else if (this.crossType === 'bound') { if (!this.getBound(particle.p.x - this.x, particle.p.y - this.y)) particle.v.negate(); } } @@ -5480,7 +5473,7 @@ var ImageZone = function (_Zone) { var Debug = { addEventListener: function addEventListener(proton, fun) { - proton.addEventListener("PROTON_UPDATE_AFTER", function () { + proton.addEventListener('PROTON_UPDATE_AFTER', function () { return fun(); }); }, @@ -5567,7 +5560,6 @@ var Debug = { }; })(); -// import // namespace Proton.Particle = Proton.P = Particle; Proton.Pool = Pool; diff --git a/build/proton.js.map b/build/proton.js.map index a15789c..cce8b64 100644 --- a/build/proton.js.map +++ b/build/proton.js.map @@ -1 +1 @@ -{"version":3,"file":"proton.js","sources":["../src/math/MathUtils.js","../src/math/Vector2D.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/math/ease.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/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/polyfill/requestAnimationFrame.js","../src/index.js"],"sourcesContent":["const PI = 3.1415926;\r\n\r\nconst MathUtils = {\r\n\r\n PI: PI,\r\n PIx2: PI * 2,\r\n PI_2: PI / 2,\r\n PI_180: PI / 180,\r\n N180_PI: 180 / PI,\r\n\r\n randomAToB(a, b, INT) {\r\n if (!INT)\r\n return a + Math.random() * (b - a);\r\n else\r\n return Math.floor(Math.random() * (b - a)) + a;\r\n },\r\n\r\n randomFloating(center, f, INT) {\r\n return this.randomAToB(center - f, center + f, INT);\r\n },\r\n\r\n randomZone(display) {},\r\n\r\n degreeTransform(a) {\r\n return a * PI / 180;\r\n },\r\n\r\n toColor16(num) {\r\n return \"#\" + num.toString(16);\r\n },\r\n\r\n randomColor() {\r\n return '#' + ('00000' + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6);\r\n }\r\n}\r\n\r\nexport default MathUtils;","import MathUtils from '../math/MathUtils';\r\n\r\nexport default class Vector2D {\r\n\r\n constructor(x, y) {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n\r\n set(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n }\r\n\r\n setX(x) {\r\n this.x = x;\r\n return this;\r\n }\r\n\r\n setY(y) {\r\n this.y = y;\r\n return this;\r\n }\r\n\r\n getGradient() {\r\n if (this.x != 0)\r\n return Math.atan2(this.y, this.x);\r\n else if (this.y > 0)\r\n return MathUtils.PI_2;\r\n else if (this.y < 0)\r\n return -MathUtils.PI_2;\r\n }\r\n\r\n copy(v) {\r\n this.x = v.x;\r\n this.y = v.y;\r\n\r\n return this;\r\n }\r\n\r\n add(v, w) {\r\n if (w !== undefined) {\r\n return this.addVectors(v, w);\r\n }\r\n\r\n this.x += v.x;\r\n this.y += v.y;\r\n\r\n return this;\r\n }\r\n\r\n addXY(a, b) {\r\n this.x += a;\r\n this.y += b;\r\n\r\n return this;\r\n }\r\n\r\n addVectors(a, b) {\r\n this.x = a.x + b.x;\r\n this.y = a.y + b.y;\r\n\r\n return this;\r\n }\r\n\r\n sub(v, w) {\r\n if (w !== undefined) {\r\n return this.subVectors(v, w);\r\n }\r\n\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n\r\n return this;\r\n }\r\n\r\n subVectors(a, b) {\r\n this.x = a.x - b.x;\r\n this.y = a.y - b.y;\r\n\r\n return this;\r\n }\r\n\r\n divideScalar(s) {\r\n if (s !== 0) {\r\n this.x /= s;\r\n this.y /= s;\r\n } else {\r\n this.set(0, 0);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n multiplyScalar(s) {\r\n this.x *= s;\r\n this.y *= s;\r\n\r\n return this;\r\n }\r\n\r\n negate() {\r\n return this.multiplyScalar(-1);\r\n }\r\n\r\n dot(v) {\r\n return this.x * v.x + this.y * v.y;\r\n }\r\n\r\n lengthSq() {\r\n return this.x * this.x + this.y * this.y;\r\n }\r\n\r\n length() {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n }\r\n\r\n normalize() {\r\n return this.divideScalar(this.length());\r\n }\r\n\r\n distanceTo(v) {\r\n return Math.sqrt(this.distanceToSquared(v));\r\n }\r\n\r\n rotate(tha) {\r\n const x = this.x;\r\n const y = this.y;\r\n\r\n this.x = x * Math.cos(tha) + y * Math.sin(tha);\r\n this.y = -x * Math.sin(tha) + y * Math.cos(tha);\r\n\r\n return this;\r\n }\r\n\r\n distanceToSquared(v) {\r\n const dx = this.x - v.x;\r\n const dy = this.y - v.y;\r\n\r\n return dx * dx + dy * dy;\r\n }\r\n\r\n lerp(v, alpha) {\r\n this.x += (v.x - this.x) * alpha;\r\n this.y += (v.y - this.y) * alpha;\r\n\r\n return this;\r\n }\r\n\r\n equals(v) {\r\n return ((v.x === this.x) && (v.y === this.y));\r\n }\r\n\r\n clear() {\r\n this.x = 0.0;\r\n this.y = 0.0;\r\n return this;\r\n }\r\n\r\n clone() {\r\n return new Vector2D(this.x, this.y);\r\n }\r\n}","import Util from '../utils/Util';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default class Span {\r\n\r\n\tconstructor(a, b, center) {\r\n\t\tthis.isArray = false;\r\n\r\n\t\tif (Util.isArray(a)) {\r\n\t\t\tthis.isArray = true;\r\n\t\t\tthis.a = a;\r\n\t\t} else {\r\n\t\t\tthis.a = Util.initValue(a, 1);\r\n\t\t\tthis.b = Util.initValue(b, this.a);\r\n\t\t\tthis.center = Util.initValue(center, false);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tgetValue(INT) {\r\n\t\tif (this.isArray) {\r\n\t\t\treturn this.a[Math.floor(this.a.length * Math.random())];\r\n\t\t} else {\r\n\t\t\tif (!this.center)\r\n\t\t\t\treturn MathUtils.randomAToB(this.a, this.b, INT);\r\n\t\t\telse\r\n\t\t\t\treturn MathUtils.randomFloating(this.a, this.b, INT);\r\n\t\t}\r\n\t}\r\n}","export default {\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method ipot\r\n *\r\n * @todo add description\r\n * @todo add length description\r\n *\r\n * @param {Number} length\r\n *\r\n * @return {Boolean}\r\n */\r\n ipot(length) {\r\n return (length & (length - 1)) == 0;\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method nhpot\r\n *\r\n * @todo add description\r\n * @todo add length description\r\n *\r\n * @param {Number} length\r\n *\r\n * @return {Number}\r\n */\r\n nhpot(length) {\r\n --length;\r\n for (let i = 1; i < 32; i <<= 1) {\r\n length = length | length >> i;\r\n }\r\n\r\n return length + 1;\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method makeTranslation\r\n *\r\n * @todo add description\r\n * @todo add tx, ty description\r\n * @todo add return description\r\n *\r\n * @param {Number} tx either 0 or 1\r\n * @param {Number} ty either 0 or 1\r\n *\r\n * @return {Object}\r\n */\r\n makeTranslation(tx, ty) {\r\n return [1, 0, 0, 0, 1, 0, tx, ty, 1];\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method makeRotation\r\n *\r\n * @todo add description\r\n * @todo add return description\r\n *\r\n * @param {Number} angleInRadians\r\n *\r\n * @return {Object}\r\n */\r\n makeRotation(angleInRadians) {\r\n let c = Math.cos(angleInRadians);\r\n let s = Math.sin(angleInRadians);\r\n\r\n return [c, -s, 0, s, c, 0, 0, 0, 1];\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method makeScale\r\n *\r\n * @todo add description\r\n * @todo add tx, ty description\r\n * @todo add return description\r\n *\r\n * @param {Number} sx either 0 or 1\r\n * @param {Number} sy either 0 or 1\r\n *\r\n * @return {Object}\r\n */\r\n makeScale(sx, sy) {\r\n return [sx, 0, 0, 0, sy, 0, 0, 0, 1];\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method matrixMultiply\r\n *\r\n * @todo add description\r\n * @todo add a, b description\r\n * @todo add return description\r\n *\r\n * @param {Object} a\r\n * @param {Object} b\r\n *\r\n * @return {Object}\r\n */\r\n matrixMultiply(a, b) {\r\n let a00 = a[0 * 3 + 0];\r\n let a01 = a[0 * 3 + 1];\r\n let a02 = a[0 * 3 + 2];\r\n let a10 = a[1 * 3 + 0];\r\n let a11 = a[1 * 3 + 1];\r\n let a12 = a[1 * 3 + 2];\r\n let a20 = a[2 * 3 + 0];\r\n let a21 = a[2 * 3 + 1];\r\n let a22 = a[2 * 3 + 2];\r\n let b00 = b[0 * 3 + 0];\r\n let b01 = b[0 * 3 + 1];\r\n let b02 = b[0 * 3 + 2];\r\n let b10 = b[1 * 3 + 0];\r\n let b11 = b[1 * 3 + 1];\r\n let b12 = b[1 * 3 + 2];\r\n let b20 = b[2 * 3 + 0];\r\n let b21 = b[2 * 3 + 1];\r\n let b22 = b[2 * 3 + 2];\r\n\r\n return [\r\n a00 * b00 + a01 * b10 + a02 * b20,\r\n a00 * b01 + a01 * b11 + a02 * b21,\r\n a00 * b02 + a01 * b12 + a02 * b22,\r\n a10 * b00 + a11 * b10 + a12 * b20,\r\n a10 * b01 + a11 * b11 + a12 * b21,\r\n a10 * b02 + a11 * b12 + a12 * b22,\r\n a20 * b00 + a21 * b10 + a22 * b20,\r\n a20 * b01 + a21 * b11 + a22 * b21,\r\n a20 * b02 + a21 * b12 + a22 * b22\r\n ];\r\n }\r\n}","export default {\r\n\r\n /**\r\n * Creates and returns a new canvas. The opacity is by default set to 0\r\n *\r\n * @memberof Proton#Proton.DomUtil\r\n * @method createCanvas\r\n *\r\n * @param {String} $id the canvas' id\r\n * @param {Number} $width the canvas' width\r\n * @param {Number} $height the canvas' height\r\n * @param {String} [$position=absolute] the canvas' position, default is 'absolute' \r\n *\r\n * @return {Object}\r\n */\r\n createCanvas(id, width, height, position) {\r\n const dom = document.createElement(\"canvas\");\r\n position = position || 'absolute';\r\n\r\n dom.id = id;\r\n dom.width = width;\r\n dom.height = height;\r\n dom.style.opacity = 0;\r\n dom.style.position = position;\r\n\r\n this.transform(dom, -500, -500, 0, 0);\r\n\r\n return dom;\r\n },\r\n\r\n createDiv(id, width, height) {\r\n const dom = document.createElement(\"div\");\r\n\r\n dom.id = id;\r\n dom.style.position = 'absolute';\r\n this.resize(dom, width, height);\r\n\r\n return dom;\r\n },\r\n\r\n resize(dom, width, height) {\r\n dom.style.width = width + 'px';\r\n dom.style.height = height + 'px';\r\n dom.style.marginLeft = -width / 2 + 'px';\r\n dom.style.marginTop = -height / 2 + 'px';\r\n },\r\n\r\n /**\r\n * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers\r\n *\r\n * @memberof Proton#Proton.DomUtil\r\n * @method transform\r\n *\r\n * @param {HTMLDivElement} div \r\n * @param {Number} $x \r\n * @param {Number} $y \r\n * @param {Number} $scale \r\n * @param {Number} $rotate \r\n */\r\n transform(div, x, y, scale, rotate) {\r\n const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`;\r\n\r\n div.style.willChange = 'transform';\r\n this.css3(div, 'transform', transform);\r\n },\r\n\r\n transform3d(div, x, y, scale, rotate) {\r\n const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;\r\n\r\n div.style.willChange = 'transform';\r\n this.css3(div, 'backfaceVisibility', 'hidden');\r\n this.css3(div, 'transform', transform);\r\n },\r\n\r\n css3(div, key, val) {\r\n const bkey = key.charAt(0).toUpperCase() + key.substr(1);\r\n\r\n div.style[`Webkit${bkey}`] = val;\r\n div.style[`Moz${bkey}`] = val;\r\n div.style[`O${bkey}`] = val;\r\n div.style[`ms${bkey}`] = val;\r\n div.style[`${key}`] = val;\r\n }\r\n}","import WebGLUtil from './WebGLUtil';\r\nimport DomUtil from './DomUtil';\r\n\r\nconst IMG_CACHE = {};\r\nconst CANVAS_CACHE = {};\r\nlet canvasID = 0;\r\n\r\nexport default {\r\n\r\n /**\r\n * This will get the image data. It could be necessary to create a Proton.Zone.\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method getImageData\r\n *\r\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\r\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\r\n * @param {Proton.Rectangle} rect\r\n */\r\n getImageData(context, image, rect) {\r\n context.drawImage(image, rect.x, rect.y);\r\n const imagedata = context.getImageData(rect.x, rect.y, rect.width, rect.height);\r\n context.clearRect(rect.x, rect.y, rect.width, rect.height);\r\n\r\n return imagedata;\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.Util\r\n * @method getImgFromCache\r\n *\r\n * @todo add description\r\n * @todo describe func\r\n *\r\n * @param {Mixed} img\r\n * @param {Proton.Particle} particle\r\n * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.transform.canvas\r\n * @param {Boolean} func\r\n */\r\n getImgFromCache(img, callback, param) {\r\n const src = typeof (img) == 'string' ? img : img.src;\r\n\r\n if (IMG_CACHE[src]) {\r\n callback(IMG_CACHE[src], param);\r\n } else {\r\n const image = new Image();\r\n image.onload = e => {\r\n IMG_CACHE[src] = e.target;\r\n callback(IMG_CACHE[src], param);\r\n }\r\n\r\n image.src = src;\r\n }\r\n },\r\n\r\n getCanvasFromCache(img, callback, param) {\r\n const src = img.src;\r\n\r\n if (!CANVAS_CACHE[src]) {\r\n const width = WebGLUtil.nhpot(img.width);\r\n const height = WebGLUtil.nhpot(img.height);\r\n\r\n const canvas = DomUtil.createCanvas(`canvas_cache_${canvasID}`, width, height);\r\n const context = canvas.getContext('2d');\r\n context.drawImage(img, 0, 0, img.width, img.height);\r\n\r\n CANVAS_CACHE[src] = canvas;\r\n }\r\n\r\n callback && callback(CANVAS_CACHE[src], param);\r\n\r\n return CANVAS_CACHE[src];\r\n }\r\n}","import Vector2D from '../math/Vector2D';\r\nimport Span from '../math/Span';\r\nimport ImgUtil from './ImgUtil';\r\nimport DomUtil from './DomUtil';\r\n\r\nexport default {\r\n\r\n /**\r\n * Returns the default if the value is null or undefined\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method initValue\r\n *\r\n * @param {Mixed} value a specific value, could be everything but null or undefined\r\n * @param {Mixed} defaults the default if the value is null or undefined\r\n */\r\n initValue(value, defaults) {\r\n value = (value !== null && value !== undefined) ? value : defaults;\r\n return value;\r\n },\r\n\r\n /**\r\n * Checks if the value is a valid array\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method isArray\r\n *\r\n * @param {Array} value Any array\r\n *\r\n * @returns {Boolean} \r\n */\r\n isArray(value) {\r\n return Object.prototype.toString.call(value) === '[object Array]';\r\n },\r\n\r\n /**\r\n * Destroyes the given array\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method destroyArray\r\n *\r\n * @param {Array} array Any array\r\n */\r\n destroyArray(array) {\r\n if (array) array.length = 0;\r\n },\r\n\r\n /**\r\n * Destroyes the given object\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method destroyObject\r\n *\r\n * @param {Object} obj Any object\r\n */\r\n destroyObject(obj, ignore) {\r\n for (let o in obj) {\r\n if (ignore && ignore.indexOf(o) > -1) continue;\r\n delete obj[o];\r\n }\r\n },\r\n\r\n /**\r\n * Makes an instance of a class and binds the given array\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method classApply\r\n *\r\n * @param {Function} constructor A class to make an instance from\r\n * @param {Array} [args] Any array to bind it to the constructor\r\n *\r\n * @return {Object} The instance of constructor, optionally bind with args\r\n */\r\n classApply(constructor, args) {\r\n if (!args) return new constructor;\r\n\r\n args = [null].concat(args);\r\n const factoryFunction = constructor.bind.apply(constructor, args);\r\n return new factoryFunction();\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.Util\r\n * @method setVector2DByObject\r\n *\r\n * @todo add description for param `target`\r\n * @todo add description for param `pOBJ`\r\n * @todo add description for function\r\n *\r\n * @param {Object} target\r\n * @param {Object} pOBJ\r\n */\r\n setVector2DByObject(target, pOBJ) {\r\n if (this.hasProp(pOBJ, 'x')) target.p.x = pOBJ['x'];\r\n if (this.hasProp(pOBJ, 'y')) target.p.y = pOBJ['y'];\r\n\r\n if (this.hasProp(pOBJ, 'vx')) target.v.x = pOBJ['vx'];\r\n if (this.hasProp(pOBJ, 'vy')) target.v.y = pOBJ['vy'];\r\n\r\n if (this.hasProp(pOBJ, 'ax')) target.a.x = pOBJ['ax'];\r\n if (this.hasProp(pOBJ, 'ay')) target.a.y = pOBJ['ay'];\r\n\r\n if (this.hasProp(pOBJ, 'p')) particle.p.copy(pOBJ['p']);\r\n if (this.hasProp(pOBJ, 'v')) particle.v.copy(pOBJ['v']);\r\n if (this.hasProp(pOBJ, 'a')) particle.a.copy(pOBJ['a']);\r\n\r\n if (this.hasProp(pOBJ, 'position')) particle.p.copy(pOBJ['position']);\r\n if (this.hasProp(pOBJ, 'velocity')) particle.v.copy(pOBJ['velocity']);\r\n if (this.hasProp(pOBJ, 'accelerate')) particle.a.copy(pOBJ['accelerate']);\r\n },\r\n\r\n hasProp(obj, key) {\r\n if (!obj) return false;\r\n return obj[key] !== undefined;\r\n // return obj.hasOwnProperty(key);\r\n },\r\n\r\n /**\r\n * set the prototype in a given prototypeObject\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method setPrototypeByObject\r\n *\r\n * @todo add description for param `target`\r\n * @todo add description for param `filters`\r\n * @todo translate desription from chinese to english\r\n *\r\n * @param {Object} target\r\n * @param {Object} prototypeObject An object of single prototypes\r\n * @param {Object} filters\r\n *\r\n * @return {Object} target\r\n */\r\n setPrototypeByObject(target, prototypeObject, filters) {\r\n for (let singleProp in prototypeObject) {\r\n if (target.hasOwnProperty(singleProp)) {\r\n if (filters) {\r\n if (filters.indexOf(singleProp) < 0)\r\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\r\n } else {\r\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\r\n }\r\n }\r\n }\r\n\r\n return target;\r\n },\r\n\r\n /**\r\n * Returns a new Span object\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method setSpanValue\r\n *\r\n * @todo a, b and c should be 'Mixed' or 'Number'?\r\n *\r\n * @param {Mixed | Span} a\r\n * @param {Mixed} b\r\n * @param {Mixed} c\r\n *\r\n * @return {Span}\r\n */\r\n setSpanValue(a, b, c) {\r\n if (a instanceof Span) {\r\n return a;\r\n } else {\r\n if (!b) {\r\n return new Span(a);\r\n } else {\r\n if (!c)\r\n return new Span(a, b);\r\n else\r\n return new Span(a, b, c);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Returns the value from a Span, if the param is not a Span it will return the given parameter\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method getSpanValue\r\n *\r\n * @param {Mixed | Span} pan\r\n *\r\n * @return {Mixed} the value of Span OR the parameter if it is not a Span\r\n */\r\n getSpanValue(pan) {\r\n return pan instanceof Span ? pan.getValue() : pan;\r\n },\r\n\r\n /**\r\n * This will get the image data. It could be necessary to create a Proton.Zone.\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method getImageData\r\n *\r\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\r\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\r\n * @param {Proton.Rectangle} rect\r\n */\r\n getImageData(context, image, rect) {\r\n return ImgUtil.getImageData(context, image, rect);\r\n },\r\n\r\n destroy(arr, param) {\r\n let i = arr.length;\r\n\r\n while (i--) {\r\n try { arr[i].destroy(param); } catch (e) { }\r\n delete arr[i];\r\n }\r\n\r\n arr.length = 0;\r\n }\r\n\r\n}","export default {\r\n id: 0,\r\n cache: {},\r\n\r\n getID(target) {\r\n let uid = this.getCacheID(target);\r\n if (uid) return uid;\r\n\r\n uid = `PUID_${this.id++}`;\r\n this.cache[uid] = target;\r\n\r\n return uid;\r\n },\r\n\r\n getCacheID(target) {\r\n let obj;\r\n for (let id in this.cache) {\r\n obj = this.cache[id];\r\n\r\n if (obj === target) return id;\r\n \r\n if (typeof obj === 'object' && typeof target === 'object' && obj.isInner && target.isInner) {\r\n if (obj.src === target.src)\r\n return id;\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n getTarget(uid) {\r\n return this.cache[uid];\r\n }\r\n}","/**\r\n * get -> PUID :: uid-> Body\r\n * -> cache[abc]. -> cache[abc] .pop()\r\n * -> create [new Body| clone]\r\n * -> return p1: { __pid: abc }\r\n * \r\n * expire -> cache[abc]= [p0, p1];\r\n * \r\n */\r\nimport Util from '../utils/Util';\r\nimport PUID from '../utils/PUID';\r\n\r\nexport default class Pool {\r\n\r\n /**\r\n * @memberof! Proton#\r\n * @constructor\r\n * @alias Proton.Pool\r\n *\r\n * @todo add description\r\n * @todo add description of properties\r\n *\r\n * @property {Number} total\r\n * @property {Object} cache\r\n */\r\n constructor(num) {\r\n this.total = 0;\r\n this.cache = {};\r\n }\r\n\r\n /**\r\n * @todo add description\r\n *\r\n * @method get\r\n * @memberof Proton#Proton.Pool\r\n *\r\n * @param {Object|Function} target\r\n * @param {Object} [params] just add if `target` is a function\r\n *\r\n * @return {Object}\r\n */\r\n get(target, params, uid) {\r\n let p;\r\n uid = uid || target.__puid || PUID.getID(target);\r\n\r\n if (this.cache[uid] && this.cache[uid].length > 0)\r\n p = this.cache[uid].pop();\r\n else\r\n p = this.createOrClone(target, params);\r\n\r\n p.__puid = target.__puid || uid;\r\n return p;\r\n }\r\n\r\n /**\r\n * @todo add description\r\n *\r\n * @method set\r\n * @memberof Proton#Proton.Pool\r\n *\r\n * @param {Object} target\r\n *\r\n * @return {Object}\r\n */\r\n expire(target) {\r\n return this.getCache(target.__puid).push(target);\r\n }\r\n\r\n /**\r\n * Creates a new class instance\r\n *\r\n * @todo add more documentation \r\n *\r\n * @method create\r\n * @memberof Proton#Proton.Pool\r\n *\r\n * @param {Object|Function} target any Object or Function\r\n * @param {Object} [params] just add if `target` is a function\r\n *\r\n * @return {Object}\r\n */\r\n createOrClone(target, params) {\r\n this.total++;\r\n\r\n if (this.create) {\r\n return this.create(target, params);\r\n } else if (typeof target == \"function\") {\r\n return Util.classApply(target, params);\r\n } else {\r\n return target.clone();\r\n }\r\n }\r\n\r\n /**\r\n * @todo add description - what is in the cache?\r\n *\r\n * @method getCount\r\n * @memberof Proton#Proton.Pool\r\n *\r\n * @return {Number}\r\n */\r\n getCount() {\r\n let count = 0;\r\n\r\n for (let id in this.cache)\r\n count += this.cache[id].length;\r\n\r\n return count++;;\r\n }\r\n\r\n /**\r\n * Destroyes all items from Pool.cache\r\n *\r\n * @method destroy\r\n * @memberof Proton#Proton.Pool\r\n */\r\n destroy() {\r\n for (let id in this.cache) {\r\n this.cache[id].length = 0;\r\n delete this.cache[id];\r\n }\r\n }\r\n\r\n /**\r\n * Returns Pool.cache\r\n *\r\n * @method getCache\r\n * @memberof Proton#Proton.Pool\r\n * @private\r\n *\r\n * @param {Number} uid the unique id\r\n *\r\n * @return {Object}\r\n */\r\n getCache(uid) {\r\n uid = uid || \"default\";\r\n\r\n if (!this.cache[uid]) this.cache[uid] = [];\r\n return this.cache[uid];\r\n }\r\n}","export default class Stats {\r\n\r\n constructor(proton) {\r\n this.proton = proton;\r\n this.container = null;\r\n this.type = 1;\r\n\r\n this.emitterIndex = 0;\r\n this.rendererIndex = 0;\r\n }\r\n\r\n update(style, body) {\r\n this.add(style, body);\r\n\r\n const emitter = this.getEmitter();\r\n const renderer = this.getRenderer();\r\n let str = \"\";\r\n\r\n switch (this.type) {\r\n case 2:\r\n str += \"emitter:\" + this.proton.emitters.length + \"
\";\r\n if (emitter) str += \"em speed:\" + emitter.emitSpeed + \"
\";\r\n if (emitter) str += \"pos:\" + this.getEmitterPos(emitter);\r\n break;\r\n\r\n case 3:\r\n if (emitter) str += \"initializes:\" + emitter.initializes.length + \"
\";\r\n if (emitter) str += \"\" + this.concatArr(emitter.initializes) + \"
\";\r\n if (emitter) str += \"behaviours:\" + emitter.behaviours.length + \"
\";\r\n if (emitter) str += \"\" + this.concatArr(emitter.behaviours) + \"
\";\r\n break;\r\n\r\n case 4:\r\n if (renderer) str += renderer.name + \"
\";\r\n if (renderer) str += \"body:\" + this.getCreatedNumber(renderer) + \"
\";\r\n break;\r\n\r\n default:\r\n str += \"particles:\" + this.proton.getCount() + \"
\";\r\n str += \"pool:\" + this.proton.pool.getCount() + \"
\";\r\n str += \"total:\" + this.proton.pool.total;\r\n }\r\n\r\n this.container.innerHTML = str;\r\n }\r\n\r\n add(style, body) {\r\n if (!this.container) {\r\n this.type = 1;\r\n\r\n this.container = document.createElement('div');\r\n this.container.style.cssText = [\r\n 'position:absolute;bottom:0px;left:0;cursor:pointer;',\r\n 'opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;',\r\n 'width:120px;height:50px;background-color:#002;color:#0ff;'\r\n ].join('');\r\n\r\n this.container.addEventListener('click', e => {\r\n this.type++;\r\n if (this.type > 4) this.type = 1;\r\n }, false);\r\n\r\n let bg, color;\r\n switch (style) {\r\n case 2:\r\n bg = \"#201\";\r\n color = \"#f08\";\r\n break;\r\n\r\n case 3:\r\n bg = \"#020\";\r\n color = \"#0f0\";\r\n break;\r\n\r\n default:\r\n bg = \"#002\";\r\n color = \"#0ff\";\r\n }\r\n\r\n this.container.style[\"background-color\"] = bg;\r\n this.container.style[\"color\"] = color;\r\n }\r\n\r\n if (!this.container.parentNode) {\r\n body = body || this.body || document.body;\r\n body.appendChild(this.container);\r\n }\r\n }\r\n\r\n getEmitter() {\r\n return this.proton.emitters[this.emitterIndex];\r\n }\r\n\r\n getRenderer() {\r\n return this.proton.renderers[this.rendererIndex];\r\n }\r\n\r\n concatArr(arr) {\r\n let result = '';\r\n if (!arr || !arr.length) return result;\r\n\r\n for (let i = 0; i < arr.length; i++) {\r\n result += (arr[i].name || '').substr(0, 1) + '.';\r\n }\r\n\r\n return result;\r\n }\r\n\r\n getCreatedNumber(renderer) {\r\n return renderer.pool.total || (renderer.cpool && renderer.cpool.total) || 0;\r\n }\r\n\r\n getEmitterPos(e) {\r\n return Math.round(e.p.x) + \",\" + Math.round(e.p.y);\r\n }\r\n}","/*\r\n * EventDispatcher\r\n * This code reference since http://createjs.com/.\r\n *\r\n **/\r\n\r\nexport default class EventDispatcher {\r\n\r\n constructor() {\r\n this._listeners = null;\r\n }\r\n\r\n static bind(TargetClass){\r\n TargetClass.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent;\r\n TargetClass.prototype.hasEventListener = EventDispatcher.prototype.hasEventListener;\r\n TargetClass.prototype.addEventListener = EventDispatcher.prototype.addEventListener;\r\n TargetClass.prototype.removeEventListener = EventDispatcher.prototype.removeEventListener;\r\n TargetClass.prototype.removeAllEventListeners = EventDispatcher.prototype.removeAllEventListeners;\r\n }\r\n\r\n addEventListener(type, listener) {\r\n if (!this._listeners) {\r\n this._listeners = {};\r\n } else {\r\n this.removeEventListener(type, listener);\r\n }\r\n\r\n if (!this._listeners[type]) this._listeners[type] = [];\r\n this._listeners[type].push(listener);\r\n\r\n return listener;\r\n }\r\n\r\n removeEventListener(type, listener) {\r\n if (!this._listeners) return;\r\n if (!this._listeners[type]) return;\r\n\r\n const arr = this._listeners[type];\r\n const length = arr.length;\r\n\r\n for (let i = 0;i < length; i++) {\r\n if (arr[i] == listener) {\r\n if (length == 1) {\r\n delete (this._listeners[type]);\r\n }\r\n\r\n // allows for faster checks.\r\n else {\r\n arr.splice(i, 1);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n removeAllEventListeners(type) {\r\n if (!type)\r\n this._listeners = null;\r\n else if (this._listeners)\r\n delete (this._listeners[type]);\r\n }\r\n\r\n dispatchEvent(type, args) {\r\n let result = false;\r\n const listeners = this._listeners;\r\n\r\n if (type && listeners) {\r\n let arr = listeners[type];\r\n if (!arr) return result;\r\n\r\n //arr = arr.slice();\r\n // to avoid issues with items being removed or added during the dispatch\r\n\r\n let handler;\r\n let i = arr.length;\r\n while (i--) {\r\n handler = arr[i];\r\n result = result || handler(args);\r\n }\r\n\r\n }\r\n\r\n return !!result;\r\n }\r\n\r\n hasEventListener(type) {\r\n const listeners = this._listeners;\r\n return !!(listeners && listeners[type]);\r\n }\r\n\r\n}","import Util from '../utils/Util';\r\n\r\nexport default class Integration {\r\n\r\n\tconstructor(type) {\r\n\t\tthis.type = type;\r\n\t}\r\n\r\n\tcalculate(particles, time, damping) {\r\n\t\tthis.eulerIntegrate(particles, time, damping);\r\n\t}\r\n\r\n\t// Euler Integrate\r\n\teulerIntegrate(particle, time, damping) {\r\n\t\tif (!particle.sleep) {\r\n\t\t\tparticle.old.p.copy(particle.p);\r\n\t\t\tparticle.old.v.copy(particle.v);\r\n\r\n\t\t\tparticle.a.multiplyScalar(1 / particle.mass);\r\n\t\t\tparticle.v.add(particle.a.multiplyScalar(time));\r\n\t\t\tparticle.p.add(particle.old.v.multiplyScalar(time));\r\n\r\n\t\t\tif (damping) particle.v.multiplyScalar(damping);\r\n\r\n\t\t\tparticle.a.clear();\r\n\t\t}\r\n\t}\r\n}","import Pool from './Pool';\r\nimport Util from '../utils/Util';\r\nimport Stats from '../debug/Stats';\r\nimport EventDispatcher from '../events/EventDispatcher';\r\nimport Integration from '../math/Integration';\r\n\r\nexport default class Proton {\r\n\r\n static USE_CLOCK = false;\r\n\r\n //1:100\r\n static MEASURE = 100;\r\n static EULER = 'euler';\r\n static RK2 = 'runge-kutta2';\r\n\r\n static PARTICLE_CREATED = 'PARTICLE_CREATED';\r\n static PARTICLE_UPDATE = 'PARTICLE_UPDATE';\r\n static PARTICLE_SLEEP = 'PARTICLE_SLEEP';\r\n static PARTICLE_DEAD = 'PARTICLE_DEAD';\r\n static PROTON_UPDATE = 'PROTON_UPDATE';\r\n static PROTON_UPDATE_AFTER = 'PROTON_UPDATE_AFTER';\r\n static EMITTER_ADDED = 'EMITTER_ADDED';\r\n static EMITTER_REMOVED = 'EMITTER_REMOVED';\r\n\r\n static amendChangeTabsBug = true;\r\n\r\n /**\r\n * The constructor to add emitters\r\n *\r\n * @constructor Proton\r\n *\r\n * @todo proParticleCount is not in use\r\n * @todo add more documentation of the single properties and parameters\r\n *\r\n * @param {Number} [proParticleCount] not in use?\r\n * @param {Number} [integrationType=Proton.EULER]\r\n *\r\n * @property {String} [integrationType=Proton.EULER]\r\n * @property {Array} emitters All added emitter\r\n * @property {Array} renderers All added renderer\r\n * @property {Number} time The active time\r\n * @property {Number} oldtime The old time\r\n */\r\n constructor(integrationType) {\r\n\r\n this.emitters = [];\r\n this.renderers = [];\r\n\r\n this.time = 0;\r\n this.oldTime = 0;\r\n this.elapsed = 0;\r\n\r\n this.stats = new Stats(this);\r\n this.pool = new Pool(80);\r\n\r\n this.integrationType = Util.initValue(integrationType, Proton.EULER);\r\n this.integrator = new Integration(this.integrationType);\r\n }\r\n\r\n /**\r\n * add a type of Renderer\r\n *\r\n * @method addRenderer\r\n * @memberof Proton\r\n * @instance\r\n *\r\n * @param {Renderer} render\r\n */\r\n addRenderer(render) {\r\n render.init(this);\r\n this.renderers.push(render);\r\n }\r\n\r\n /**\r\n * @name add a type of Renderer\r\n *\r\n * @method addRenderer\r\n * @param {Renderer} render\r\n */\r\n removeRenderer(render) {\r\n const index = this.renderers.indexOf(render);\r\n this.renderers.splice(index, 1);\r\n render.remove(this);\r\n }\r\n\r\n /**\r\n * add the Emitter\r\n *\r\n * @method addEmitter\r\n * @memberof Proton\r\n * @instance\r\n *\r\n * @param {Emitter} emitter\r\n */\r\n addEmitter(emitter) {\r\n this.emitters.push(emitter);\r\n emitter.parent = this;\r\n\r\n this.dispatchEvent(Proton.EMITTER_ADDED, emitter);\r\n }\r\n\r\n /**\r\n * Removes an Emitter\r\n *\r\n * @method removeEmitter\r\n * @memberof Proton\r\n * @instance\r\n *\r\n * @param {Proton.Emitter} emitter\r\n */\r\n removeEmitter(emitter) {\r\n const index = this.emitters.indexOf(emitter);\r\n this.emitters.splice(index, 1);\r\n emitter.parent = null;\r\n\r\n this.dispatchEvent(Proton.EMITTER_REMOVED, emitter);\r\n }\r\n\r\n /**\r\n * Updates all added emitters\r\n *\r\n * @method update\r\n * @memberof Proton\r\n * @instance\r\n */\r\n update() {\r\n this.dispatchEvent(Proton.PROTON_UPDATE);\r\n\r\n if (Proton.USE_CLOCK) {\r\n if (!this.oldTime) this.oldTime = (new Date()).getTime();\r\n\r\n let time = new Date().getTime();\r\n this.elapsed = (time - this.oldTime) / 1000;\r\n Proton.amendChangeTabsBug && this.amendChangeTabsBug();\r\n\r\n this.oldTime = time;\r\n } else {\r\n this.elapsed = 0.0167;\r\n }\r\n\r\n // emitter update\r\n if (this.elapsed > 0) this.emittersUpdate(this.elapsed);\r\n\r\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\r\n }\r\n\r\n emittersUpdate(elapsed) {\r\n let i = this.emitters.length;\r\n while (i--) this.emitters[i].update(elapsed);\r\n }\r\n\r\n /**\r\n * @todo add description\r\n *\r\n * @method amendChangeTabsBug\r\n * @memberof Proton\r\n * @instance\r\n */\r\n amendChangeTabsBug() {\r\n if (this.elapsed > .5) {\r\n this.oldTime = (new Date()).getTime();\r\n this.elapsed = 0;\r\n }\r\n }\r\n\r\n /**\r\n * Counts all particles from all emitters\r\n *\r\n * @method getCount\r\n * @memberof Proton\r\n * @instance\r\n */\r\n getCount() {\r\n let total = 0;\r\n let i = this.emitters.length;\r\n\r\n while (i--) total += this.emitters[i].particles.length;\r\n return total;\r\n }\r\n\r\n getAllParticles() {\r\n let particles = [];\r\n let i = this.emitters.length;\r\n\r\n while (i--) particles = particles.concat(this.emitters[i].particles);\r\n return particles;\r\n }\r\n\r\n /**\r\n * Destroys everything related to this Proton instance. This includes all emitters, and all properties\r\n *\r\n * @method destroy\r\n * @memberof Proton\r\n * @instance\r\n */\r\n destroy() {\r\n Util.destroy(this.renderers, this.getAllParticles());\r\n Util.destroy(this.emitters);\r\n\r\n this.time = 0;\r\n this.oldTime = 0;\r\n\r\n this.pool.destroy();\r\n }\r\n}\r\n\r\nEventDispatcher.bind(Proton);","import MathUtils from './MathUtils';\r\n\r\nexport default {\r\n\r\n easeLinear(value) {\r\n return value;\r\n },\r\n\r\n easeInQuad(value) {\r\n return Math.pow(value, 2);\r\n },\r\n\r\n easeOutQuad(value) {\r\n return -(Math.pow((value - 1), 2) - 1);\r\n },\r\n\r\n easeInOutQuad(value) {\r\n if ((value /= 0.5) < 1)\r\n return 0.5 * Math.pow(value, 2);\r\n\r\n return -0.5 * ((value -= 2) * value - 2);\r\n },\r\n\r\n easeInCubic(value) {\r\n return Math.pow(value, 3);\r\n },\r\n\r\n easeOutCubic(value) {\r\n return (Math.pow((value - 1), 3) + 1);\r\n },\r\n\r\n easeInOutCubic(value) {\r\n if ((value /= 0.5) < 1)\r\n return 0.5 * Math.pow(value, 3);\r\n\r\n return 0.5 * (Math.pow((value - 2), 3) + 2);\r\n },\r\n\r\n easeInQuart(value) {\r\n return Math.pow(value, 4);\r\n },\r\n\r\n easeOutQuart(value) {\r\n return -(Math.pow((value - 1), 4) - 1);\r\n },\r\n\r\n easeInOutQuart(value) {\r\n if ((value /= 0.5) < 1)\r\n return 0.5 * Math.pow(value, 4);\r\n\r\n return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2);\r\n },\r\n\r\n easeInSine(value) {\r\n return -Math.cos(value * (MathUtils.PI_2)) + 1;\r\n },\r\n\r\n easeOutSine(value) {\r\n return Math.sin(value * (MathUtils.PI_2));\r\n },\r\n\r\n easeInOutSine(value) {\r\n return (-0.5 * (Math.cos(MathUtils.PI * value) - 1));\r\n },\r\n\r\n easeInExpo(value) {\r\n return (value === 0) ? 0 : Math.pow(2, 10 * (value - 1));\r\n },\r\n\r\n easeOutExpo(value) {\r\n return (value === 1) ? 1 : -Math.pow(2, -10 * value) + 1;\r\n },\r\n\r\n easeInOutExpo(value) {\r\n if (value === 0)\r\n return 0;\r\n\r\n if (value === 1)\r\n return 1;\r\n\r\n if ((value /= 0.5) < 1)\r\n return 0.5 * Math.pow(2, 10 * (value - 1));\r\n\r\n return 0.5 * (-Math.pow(2, -10 * --value) + 2);\r\n },\r\n\r\n easeInCirc(value) {\r\n return -(Math.sqrt(1 - (value * value)) - 1);\r\n },\r\n\r\n easeOutCirc(value) {\r\n return Math.sqrt(1 - Math.pow((value - 1), 2));\r\n },\r\n\r\n easeInOutCirc(value) {\r\n if ((value /= 0.5) < 1)\r\n return -0.5 * (Math.sqrt(1 - value * value) - 1);\r\n return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1);\r\n },\r\n\r\n easeInBack(value) {\r\n let s = 1.70158;\r\n return (value) * value * ((s + 1) * value - s);\r\n },\r\n\r\n easeOutBack(value) {\r\n let s = 1.70158;\r\n return (value = value - 1) * value * ((s + 1) * value + s) + 1;\r\n },\r\n\r\n easeInOutBack(value) {\r\n let s = 1.70158;\r\n if ((value /= 0.5) < 1)\r\n return 0.5 * (value * value * (((s *= (1.525)) + 1) * value - s));\r\n return 0.5 * ((value -= 2) * value * (((s *= (1.525)) + 1) * value + s) + 2);\r\n },\r\n\r\n getEasing(ease) {\r\n if (typeof ease === 'function')\r\n return ease;\r\n else\r\n return this[ease] || this.easeLinear;\r\n }\r\n};","import Util from '../utils/Util';\r\nimport ease from '../math/ease';\r\nimport Vector2D from '../math/Vector2D';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default class Particle {\r\n\r\n static ID = 0;\r\n\r\n /**\r\n * the Particle class\r\n *\r\n * @class Proton.Particle\r\n * @constructor\r\n * @param {Object} pObj the parameters object;\r\n * for example {life:3,dead:false}\r\n */\r\n constructor(pOBJ) {\r\n /**\r\n * The particle's id;\r\n * @property id\r\n * @type {string}\r\n */\r\n this.id = `particle_${Particle.ID++}`;\r\n this.reset('init');\r\n\r\n pOBJ && Util.setPrototypeByObject(this, pOBJ);\r\n }\r\n\r\n getDirection() {\r\n return Math.atan2(this.v.x, -this.v.y) * MathUtils.N180_PI;\r\n }\r\n\r\n reset(init) {\r\n this.life = Infinity;\r\n this.age = 0;\r\n\r\n //Energy loss\r\n this.energy = 1;\r\n this.dead = false;\r\n this.sleep = false;\r\n this.body = null;\r\n this.sprite = null;\r\n this.parent = null;\r\n\r\n this.mass = 1;\r\n this.radius = 10;\r\n this.alpha = 1;\r\n this.scale = 1;\r\n this.rotation = 0;\r\n this.color = null;\r\n\r\n this.easing = ease.easeLinear;\r\n\r\n if (init == 'init') {\r\n this.transform = {};\r\n this.p = new Vector2D();\r\n this.v = new Vector2D();\r\n this.a = new Vector2D();\r\n\r\n this.old = {\r\n p: new Vector2D(),\r\n v: new Vector2D(),\r\n a: new Vector2D()\r\n };\r\n\r\n this.behaviours = [];\r\n } else {\r\n Util.destroyObject(this.transform, 'rgb');\r\n\r\n this.p.set(0, 0);\r\n this.v.set(0, 0);\r\n this.a.set(0, 0);\r\n\r\n this.old.p.set(0, 0);\r\n this.old.v.set(0, 0);\r\n this.old.a.set(0, 0);\r\n\r\n this.removeAllBehaviours();\r\n }\r\n\r\n if (!this.transform.rgb) {\r\n this.transform.rgb = { r: 255, g: 255, b: 255 };\r\n } else {\r\n this.transform.rgb.r = 255;\r\n this.transform.rgb.g = 255;\r\n this.transform.rgb.b = 255;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n update(time, index) {\r\n if (!this.sleep) {\r\n this.age += time;\r\n this.applyBehaviours(time, index);\r\n }\r\n\r\n if (this.age < this.life) {\r\n const scale = this.easing(this.age / this.life);\r\n this.energy = Math.max(1 - scale, 0);\r\n } else {\r\n this.destroy();\r\n }\r\n }\r\n\r\n applyBehaviours(time, index) {\r\n const length = this.behaviours.length;\r\n let i;\r\n\r\n for (i = 0; i < length; i++) {\r\n this.behaviours[i] && this.behaviours[i].applyBehaviour(this, time, index)\r\n }\r\n }\r\n\r\n addBehaviour(behaviour) {\r\n this.behaviours.push(behaviour);\r\n\r\n if (behaviour.hasOwnProperty('parents')) behaviour.parents.push(this);\r\n behaviour.initialize(this);\r\n }\r\n\r\n addBehaviours(behaviours) {\r\n const length = behaviours.length;\r\n let i;\r\n\r\n for (i = 0; i < length; i++) {\r\n this.addBehaviour(behaviours[i]);\r\n }\r\n }\r\n\r\n removeBehaviour(behaviour) {\r\n const index = this.behaviours.indexOf(behaviour);\r\n\r\n if (index > -1) {\r\n const behaviour = this.behaviours.splice(index, 1);\r\n behaviour.parents = null;\r\n }\r\n }\r\n\r\n removeAllBehaviours() {\r\n Util.destroyArray(this.behaviours);\r\n }\r\n\r\n /**\r\n * Destory this particle\r\n * @method destroy\r\n */\r\n destroy() {\r\n this.removeAllBehaviours();\r\n this.energy = 0;\r\n this.dead = true;\r\n this.parent = null;\r\n }\r\n\r\n}","export default {\r\n\r\n /**\r\n * @typedef {Object} rgbObject\r\n * @property {Number} r red value\r\n * @property {Number} g green value\r\n * @property {Number} b blue value\r\n */\r\n /**\r\n * converts a hex value to a rgb object\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method hexToRGB\r\n *\r\n * @param {String} h any hex value, e.g. #000000 or 000000 for black\r\n *\r\n * @return {rgbObject}\r\n */\r\n hexToRGB(h) {\r\n const hex16 = (h.charAt(0) == \"#\") ? h.substring(1, 7) : h;\r\n const r = parseInt(hex16.substring(0, 2), 16);\r\n const g = parseInt(hex16.substring(2, 4), 16);\r\n const b = parseInt(hex16.substring(4, 6), 16);\r\n\r\n return { r, g, b };\r\n },\r\n\r\n /**\r\n * converts a rgb value to a rgb string\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method rgbToHex\r\n *\r\n * @param {Object | Proton.hexToRGB} rgb a rgb object like in {@link Proton#Proton.}\r\n *\r\n * @return {String} rgb()\r\n */\r\n rgbToHex(rbg) {\r\n return `rgb(${rbg.r}, ${rbg.g}, ${rbg.b})`;\r\n },\r\n\r\n getHex16FromParticle(p) {\r\n return Number(p.transform.rgb.r) * 65536 + Number(p.transform.rgb.g) * 256 + Number(p.transform.rgb.b);\r\n }\r\n}","import Vector2D from './Vector2D';\r\n\r\nexport default class Polar2D {\r\n\r\n\tconstructor(r, tha) {\r\n\t\tthis.r = Math.abs(r) || 0;\r\n\t\tthis.tha = tha || 0;\r\n\t}\r\n\r\n\tset(r, tha) {\r\n\t\tthis.r = r;\r\n\t\tthis.tha = tha;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetR(r) {\r\n\t\tthis.r = r;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetTha(tha) {\r\n\t\tthis.tha = tha;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tcopy(p) {\r\n\t\tthis.r = p.r;\r\n\t\tthis.tha = p.tha;\r\n\t\treturn this;\r\n\t}\r\n\r\n\ttoVector() {\r\n\t\treturn new Vector2D(this.getX(), this.getY());\r\n\t}\r\n\r\n\tgetX() {\r\n\t\treturn this.r * Math.sin(this.tha);\r\n\t}\r\n\r\n\tgetY() {\r\n\t\treturn -this.r * Math.cos(this.tha);\r\n\t}\r\n\r\n\tnormalize() {\r\n\t\tthis.r = 1;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tequals(v) {\r\n\t\treturn ((v.r === this.r) && (v.tha === this.tha));\r\n\t}\r\n\r\n\tclear() {\r\n\t\tthis.r = 0.0;\r\n\t\tthis.tha = 0.0;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tclone() {\r\n\t\treturn new Polar2D(this.r, this.tha);\r\n\t}\r\n}","export default {\r\n\tcreate(mat3) {\r\n\t\tconst mat = new Float32Array(9);\r\n\t\tif (mat3) this.set(mat3, mat);\r\n\r\n\t\treturn mat;\r\n\t},\r\n\r\n\tset(mat1, mat2) {\r\n\t\tfor (let i = 0; i < 9; i++)\r\n\t\t\tmat2[i] = mat1[i];\r\n\r\n\t\treturn mat2;\r\n\t},\r\n\r\n\tmultiply(mat, mat2, mat3) {\r\n\t\tlet a00 = mat[0], a01 = mat[1], a02 = mat[2], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b00 = mat2[0], b01 = mat2[1], b02 = mat2[2], b10 = mat2[3], b11 = mat2[4], b20 = mat2[6], b21 = mat2[7];\r\n\r\n\t\tmat3[0] = b00 * a00 + b01 * a10;\r\n\t\tmat3[1] = b00 * a01 + b01 * a11;\r\n\t\tmat3[2] = a02 * b02;\r\n\t\tmat3[3] = b10 * a00 + b11 * a10;\r\n\t\tmat3[4] = b10 * a01 + b11 * a11;\r\n\t\tmat3[6] = b20 * a00 + b21 * a10 + a20;\r\n\t\tmat3[7] = b20 * a01 + b21 * a11 + a21;\r\n\r\n\t\treturn mat3;\r\n\t},\r\n\r\n\tinverse(mat, mat3) {\r\n\t\tlet a00 = mat[0], a01 = mat[1], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b01 = a11, b11 = -a10, b21 = a21 * a10 - a11 * a20, d = a00 * b01 + a01 * b11, id;\r\n\r\n\t\tid = 1 / d;\r\n\t\tmat3[0] = b01 * id;\r\n\t\tmat3[1] = (-a01) * id;\r\n\t\tmat3[3] = b11 * id;\r\n\t\tmat3[4] = a00 * id;\r\n\t\tmat3[6] = b21 * id;\r\n\t\tmat3[7] = (-a21 * a00 + a01 * a20) * id;\r\n\r\n\t\treturn mat3;\r\n\t},\r\n\r\n\tmultiplyVec2(m, vec, mat3) {\r\n\t\tlet x = vec[0], y = vec[1];\r\n\r\n\t\tmat3[0] = x * m[0] + y * m[3] + m[6];\r\n\t\tmat3[1] = x * m[1] + y * m[4] + m[7];\r\n\r\n\t\treturn mat3;\r\n\t}\r\n}","import Span from './Span';\r\nimport Util from '../utils/Util';\r\nimport MathUtils from './MathUtils';\r\n\r\nexport default class ArraySpan extends Span {\r\n\r\n constructor(color) {\r\n super();\r\n this._arr = Util.isArray(color) ? color : [color];\r\n }\r\n\r\n getValue() {\r\n const color = this._arr[Math.floor(this._arr.length * Math.random())];\r\n return color === 'random' || color === 'Random' ? MathUtils.randomColor() : color;\r\n }\r\n\r\n /**\r\n * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance\r\n *\r\n * @method setSpanValue\r\n * @memberof Proton#Proton.Color\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n * @param {Number} the integrate time 1/ms\r\n * @param {Int} the particle index\r\n */\r\n static createArraySpan(arr) {\r\n if (!arr) return null;\r\n\r\n if (arr instanceof ArraySpan)\r\n return arr;\r\n else\r\n return new ArraySpan(arr);\r\n }\r\n\r\n}","export default class Rectangle {\r\n\r\n\tconstructor(x, y, w, h) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\r\n\t\tthis.width = w;\r\n\t\tthis.height = h;\r\n\r\n\t\tthis.bottom = this.y + this.height;\r\n\t\tthis.right = this.x + this.width;\r\n\t}\r\n\r\n\tcontains(x, y) {\r\n\t\tif (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y)\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}\r\n}\r\n","import Util from '../utils/Util';\r\n\r\nexport default class Rate {\r\n\r\n\t/**\r\n\t * The number of particles per second emission (a [particle]/b [s]);\r\n\t * @namespace\r\n\t * @memberof! Proton#\r\n\t * @constructor\r\n\t * @alias Rate\r\n\t *\r\n\t * @param {Array | Number | Span} numpan the number of each emission;\r\n\t * @param {Array | Number | Span} timepan the time of each emission;\r\n\t * for example: new Rate(new Span(10, 20), new Span(.1, .25));\r\n\t */\r\n\tconstructor(numpan, timepan) {\r\n\t\tthis.numPan = Util.setSpanValue(Util.initValue(numpan, 1));\r\n\t\tthis.timePan = Util.setSpanValue(Util.initValue(timepan, 1));\r\n\r\n\t\tthis.startTime = 0;\r\n\t\tthis.nextTime = 0;\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.startTime = 0;\r\n\t\tthis.nextTime = this.timePan.getValue();\r\n\t}\r\n\r\n\tgetValue(time) {\r\n\t\tthis.startTime += time;\r\n\r\n\t\tif (this.startTime >= this.nextTime) {\r\n\t\t\tthis.startTime = 0;\r\n\t\t\tthis.nextTime = this.timePan.getValue();\r\n\r\n\t\t\tif (this.numPan.b == 1) {\r\n\t\t\t\tif (this.numPan.getValue(false) > 0.5)\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn 0;\r\n\t\t\t} else {\r\n\t\t\t\treturn this.numPan.getValue(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}\r\n}","export default class Initialize {\r\n\t\r\n\treset() {\r\n\t}\r\n\r\n\tinit(emitter, particle) {\r\n\t\tif (particle) {\r\n\t\t\tthis.initialize(particle);\r\n\t\t} else {\r\n\t\t\tthis.initialize(emitter);\r\n\t\t}\r\n\t};\r\n\r\n\t///sub class init\r\n\tinitialize(target) {\r\n\t};\r\n}","import Util from '../utils/Util';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Life extends Initialize {\r\n\r\n\tconstructor(a, b, c) {\r\n\t\tsuper();\r\n\r\n\t\tthis.lifePan = Util.setSpanValue(a, b, c);\r\n\t\tthis.name = 'Life';\r\n\t}\r\n\r\n\tinitialize(target) {\r\n\t\tif (this.lifePan.a == Infinity)\r\n\t\t\ttarget.life = Infinity;\r\n\t\telse\r\n\t\t\ttarget.life = this.lifePan.getValue();\r\n\t}\r\n}\r\n","import Vector2D from '../math/Vector2D';\r\n\r\nexport default class Zone {\r\n\tconstructor() {\r\n\t\tthis.vector = new Vector2D(0, 0);\r\n\t\tthis.random = 0;\r\n\t\tthis.crossType = \"dead\";\r\n\t\tthis.alert = true;\r\n\t}\r\n\r\n\tgetPosition() {\r\n\t}\r\n\r\n\tcrossing(particle) {\r\n\t}\r\n}","import Zone from './Zone';\r\n\r\nexport default class PointZone extends Zone {\r\n\r\n\tconstructor(x, y) {\r\n\t\tsuper();\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}\r\n\r\n\tgetPosition() {\r\n\t\tthis.vector.x = this.x;\r\n\t\tthis.vector.y = this.y;\r\n\r\n\t\treturn this.vector;\r\n\t}\r\n\r\n\tcrossing(particle) {\r\n\t\t\r\n\t\tif (this.alert) {\r\n\t\t\talert('Sorry PointZone does not support crossing method');\r\n\t\t\tthis.alert = false;\r\n\t\t}\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport PointZone from '../zone/PointZone';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Position extends Initialize {\r\n\r\n\tconstructor(zone) {\r\n\t\tsuper();\r\n\t\tthis.zone = Util.initValue(zone, new PointZone());\r\n\r\n\t\tthis.name = 'Position';\r\n\t}\r\n\r\n\treset(zone) {\r\n\t\tthis.zone = Util.initValue(zone, new PointZone());\r\n\t}\r\n\r\n\tinitialize(target) {\r\n\t\tthis.zone.getPosition();\r\n\r\n\t\ttarget.p.x = this.zone.vector.x;\r\n\t\ttarget.p.y = this.zone.vector.y;\r\n\t};\r\n\r\n}\r\n","import Proton from '../core/Proton';\r\nimport Util from '../utils/Util';\r\nimport Polar2D from '../math/Polar2D';\r\nimport MathUtils from '../math/MathUtils';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Velocity extends Initialize {\r\n\r\n constructor(rpan, thapan, type) {\r\n super();\r\n\r\n this.rPan = Util.setSpanValue(rpan);\r\n this.thaPan = Util.setSpanValue(thapan);\r\n this.type = Util.initValue(type, 'vector');\r\n\r\n this.name = 'Velocity';\r\n }\r\n\r\n reset(rpan, thapan, type) {\r\n this.rPan = Util.setSpanValue(rpan);\r\n this.thaPan = Util.setSpanValue(thapan);\r\n this.type = Util.initValue(type, 'vector');\r\n };\r\n\r\n normalizeVelocity(vr) {\r\n return vr * Proton.MEASURE;\r\n }\r\n\r\n initialize(target) {\r\n if (this.type == 'p' || this.type == 'P' || this.type == 'polar') {\r\n const polar2d = new Polar2D(this.normalizeVelocity(this.rPan.getValue()), this.thaPan.getValue() * MathUtils.PI_180);\r\n\r\n target.v.x = polar2d.getX();\r\n target.v.y = polar2d.getY();\r\n } else {\r\n target.v.x = this.normalizeVelocity(this.rPan.getValue());\r\n target.v.y = this.normalizeVelocity(this.thaPan.getValue());\r\n }\r\n };\r\n}","import Util from '../utils/Util';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Mass extends Initialize {\r\n\r\n\tconstructor(a, b, c) {\r\n\t\tsuper();\r\n\t\tthis.massPan = Util.setSpanValue(a, b, c);\r\n\t\tthis.name = 'Mass';\r\n\t}\r\n\r\n\tinitialize(target) {\r\n\t\ttarget.mass = this.massPan.getValue();\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Radius extends Initialize {\r\n\r\n\tconstructor(a, b, c) {\r\n\t\tsuper();\r\n\t\tthis.radius = Util.setSpanValue(a, b, c);\r\n\r\n\t\tthis.name = 'Radius';\r\n\t}\r\n\r\n\treset(a, b, c) {\r\n\t\tthis.radius = Util.setSpanValue(a, b, c);\r\n\t};\r\n\r\n\tinitialize(particle) {\r\n\t\tparticle.radius = this.radius.getValue();\r\n\t\tparticle.transform.oldRadius = particle.radius;\r\n\t};\r\n}","import Util from '../utils/Util';\r\nimport ArraySpan from '../math/ArraySpan';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Body extends Initialize {\r\n\r\n constructor(image, w, h) {\r\n super();\r\n\r\n this.image = this.setSpanValue(image);\r\n this.w = Util.initValue(w, 20);\r\n this.h = Util.initValue(h, this.w);\r\n this.name = 'Body';\r\n }\r\n\r\n initialize(particle) {\r\n const imagetarget = this.image.getValue();\r\n\r\n if (typeof(imagetarget) == 'string') {\r\n particle.body = { width: this.w, height: this.h, src: imagetarget , isInner: true, inner: true };\r\n } else {\r\n particle.body = imagetarget;\r\n }\r\n };\r\n\r\n setSpanValue(color) {\r\n return color instanceof ArraySpan ? color : new ArraySpan(color);\r\n }\r\n}","import Proton from '../core/Proton';\r\nimport Util from '../utils/Util';\r\nimport ease from '../math/ease';\r\n\r\nexport default class Behaviour {\r\n static id = 0;\r\n\r\n /**\r\n * The Behaviour class is the base for the other Behaviour\r\n *\r\n * @memberof! -\r\n * @interface\r\n * @alias Proton.Behaviour\r\n *\r\n * @param {Number} life \tthe behaviours life\r\n * @param {String} easing \tThe behaviour's decaying trend, for example ease.easeOutQuart\r\n *\r\n * @property {String} id \t\tThe behaviours id\r\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n * @property {Number} age=0 \tHow long the particle should be 'alife'\r\n * @property {Number} energy=1\r\n * @property {Boolean} dead=false The particle is dead at first\r\n * @property {Array} parents \tThe behaviour's parents array\r\n * @property {String} name \tThe behaviour name\r\n */\r\n constructor(life, easing) {\r\n\r\n this.life = Util.initValue(life, Infinity);\r\n this.easing = ease.getEasing(easing);\r\n\r\n this.age = 0;\r\n this.energy = 1;\r\n this.dead = false;\r\n this.parents = [];\r\n\r\n this.id = `Behaviour_${Behaviour.id++}`;\r\n this.name = 'Behaviour';\r\n }\r\n\r\n /**\r\n * Reset this behaviour's parameters\r\n *\r\n * @method reset\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n *\r\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\r\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\r\n */\r\n reset(life, easing) {\r\n this.life = Util.initValue(life, Infinity);\r\n this.easing = ease.getEasing(easing);\r\n }\r\n\r\n /**\r\n * Normalize a force by 1:100;\r\n *\r\n * @method normalizeForce\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n *\r\n * @param {Proton.Vector2D} force \r\n */\r\n normalizeForce(force) {\r\n return force.multiplyScalar(Proton.MEASURE);\r\n }\r\n\r\n /**\r\n * Normalize a value by 1:100;\r\n *\r\n * @method normalizeValue\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n *\r\n * @param {Number} value\r\n */\r\n normalizeValue(value) {\r\n return value * Proton.MEASURE;\r\n }\r\n\r\n /**\r\n * Initialize the behaviour's parameters for all particles\r\n *\r\n * @method initialize\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n */\r\n initialize(particle) {}\r\n\r\n /**\r\n * Apply this behaviour for all particles every time\r\n *\r\n * @method applyBehaviour\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n * @param {Number} \t\t\ttime the integrate time 1/ms\r\n * @param {Int} \t\t\tindex the particle index\r\n */\r\n calculate(particle, time, index) {\r\n this.age += time;\r\n\r\n if (this.age >= this.life || this.dead) {\r\n this.energy = 0;\r\n this.dead = true;\r\n this.destroy();\r\n } else {\r\n const scale = this.easing(particle.age / particle.life);\r\n this.energy = Math.max(1 - scale, 0);\r\n }\r\n }\r\n\r\n /**\r\n * Destory this behaviour\r\n *\r\n * @method destroy\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n */\r\n destroy() {\r\n let i = this.parents.length;\r\n while (i--) {\r\n this.parents[i].removeBehaviour(this);\r\n }\r\n\r\n this.parents.length = 0;\r\n }\r\n}","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Force extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Force\r\n\t *\r\n\t * @param {Number} fx\r\n\t * @param {Number} fy\r\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(fx, fy, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\r\n\t\tthis.name = \"Force\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Force\r\n\t * @instance\r\n\t *\r\n\t * @param {Number} fx\r\n\t * @param {Number} fy\r\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(fx, fy, life, easing) {\r\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#Proton.Force\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} the integrate time 1/ms\r\n\t * @param {Int} the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\t\tparticle.a.add(this.force);\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Attraction extends Behaviour {\r\n\r\n\t/**\r\n\t * This behaviour let the particles follow one specific Proton.Vector2D\r\n\t *\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Attraction\r\n\t *\r\n\t * @todo add description for 'force' and 'radius'\r\n\t *\r\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\r\n\t * @param {Number} [force=100]\r\n\t * @param {Number} [radius=1000]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {Proton.Vector2D} targetPosition\r\n\t * @property {Number} radius\r\n\t * @property {Number} force\r\n\t * @property {Number} radiusSq\r\n\t * @property {Proton.Vector2D} attractionForce\r\n\t * @property {Number} lengthSq\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(targetPosition, force, radius, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\r\n\t\tthis.radius = Util.initValue(radius, 1000);\r\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\r\n\r\n\t\tthis.radiusSq = this.radius * this.radius\r\n\t\tthis.attractionForce = new Vector2D();\r\n\t\tthis.lengthSq = 0;\r\n\r\n\t\tthis.name = \"Attraction\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Attraction\r\n\t * @instance\r\n\t *\r\n\t * @todo add description for 'force' and 'radius'\r\n\t *\r\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\r\n\t * @param {Number} [force=100]\r\n\t * @param {Number} [radius=1000]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(targetPosition, force, radius, life, easing) {\r\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\r\n\t\tthis.radius = Util.initValue(radius, 1000);\r\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\r\n\r\n\t\tthis.radiusSq = this.radius * this.radius\r\n\t\tthis.attractionForce = new Vector2D();\r\n\t\tthis.lengthSq = 0;\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @memberof Proton#Proton.Attraction\r\n\t * @method applyBehaviour\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\r\n\t\tthis.attractionForce.copy(this.targetPosition);\r\n\t\tthis.attractionForce.sub(particle.p);\r\n\t\tthis.lengthSq = this.attractionForce.lengthSq();\r\n\r\n\t\tif (this.lengthSq > 0.000004 && this.lengthSq < this.radiusSq) {\r\n\t\t\tthis.attractionForce.normalize();\r\n\t\t\tthis.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\r\n\t\t\tthis.attractionForce.multiplyScalar(this.force);\r\n\r\n\t\t\tparticle.a.add(this.attractionForce);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport MathUtils from '../math/MathUtils';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class RandomDrift extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Behaviour\r\n\t * @constructor\r\n\t * @alias RandomDrift\r\n\t *\r\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\r\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\r\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\r\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\r\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {Number} time The time of the drift\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(driftX, driftY, delay, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.reset(driftX, driftY, delay);\r\n\t\tthis.time = 0;\r\n\t\tthis.name = \"RandomDrift\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#RandomDrift\r\n\t * @instance\r\n\t *\r\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\r\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\r\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\r\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\r\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(driftX, driftY, delay, life, easing) {\r\n\t\tthis.panFoce = new Vector2D(driftX, driftY);\r\n\t\tthis.panFoce = this.normalizeForce(this.panFoce);\r\n\t\tthis.delay = delay;\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#RandomDrift\r\n\t * @instance\r\n\t *\r\n\t * @param {Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\t\tthis.time += time;\r\n\r\n\t\tif (this.time >= this.delay) {\r\n\t\t\tparticle.a.addXY(MathUtils.randomAToB(-this.panFoce.x, this.panFoce.x), MathUtils.randomAToB(-this.panFoce.y, this.panFoce.y));\r\n\t\t\tthis.time = 0;\r\n\t\t};\r\n\t}\r\n}\r\n","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport Force from './Force';\r\n\r\nexport default class Gravity extends Force {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton#Proton.Force\r\n\t * @constructor\r\n\t * @alias Proton.Gravity\r\n\t *\r\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(g, life, easing) {\r\n\t\tsuper(0, g, life, easing);\r\n\t\tthis.name = \"Gravity\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Gravity\r\n\t * @instance\r\n\t *\r\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(g, life, easing) {\r\n\t\tsuper.reset(0, g, life, easing);\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport Behaviour from './Behaviour';\r\n\r\n//can use Collision(emitter,true,function(){}) or Collision();\r\nexport default class Collision extends Behaviour {\r\n\r\n\t/**\r\n\t * The callback after collision\r\n\t *\r\n\t * @callback Callback\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Proton.Paritcle} otherParticle\r\n\t */\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Collision\r\n\t *\r\n\t * @todo add description to mass\r\n\t *\r\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\r\n\t * @param {Boolean} \t\t[mass=true]\t\t\t\r\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(emitter, mass, callback, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.reset(emitter, mass, callback);\r\n\t\tthis.name = \"Collision\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @memberof Proton#Proton.Collision\r\n\t * @method reset\r\n\t * @instance\r\n\t *\r\n\t * @todo add description to mass\r\n\t *\r\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\r\n\t * @param {Boolean} \t\t[mass=true]\t\t\t\r\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\r\n\t * @param {Number} \t\t\t[life=Infinity] \tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(emitter, mass, callback, life, easing) {\r\n\t\tthis.emitter = Util.initValue(emitter, null);\r\n\t\tthis.mass = Util.initValue(mass, true);\r\n\t\tthis.callback = Util.initValue(callback, null);\r\n\r\n\t\tthis.collisionPool = [];\r\n\t\tthis.delta = new Vector2D();\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @memberof Proton#Proton.Collision\r\n\t * @method applyBehaviour\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tconst newPool = this.emitter ? this.emitter.particles.slice(index) : this.pool.slice(index);\r\n\t\tconst length = newPool.length;\r\n\r\n\t\tlet otherParticle;\r\n\t\tlet lengthSq;\r\n\t\tlet overlap;\r\n\t\tlet totalMass;\r\n\t\tlet averageMass1, averageMass2;\r\n\t\tlet i;\r\n\r\n\t\tfor (i = 0; i < length; i++) {\r\n\t\t\totherParticle = newPool[i];\r\n\r\n\t\t\tif (otherParticle !== particle) {\r\n\t\t\t\tthis.delta.copy(otherParticle.p);\r\n\t\t\t\tthis.delta.sub(particle.p);\r\n\r\n\t\t\t\tlengthSq = this.delta.lengthSq();\r\n\t\t\t\tconst distance = particle.radius + otherParticle.radius;\r\n\r\n\t\t\t\tif (lengthSq <= distance * distance) {\r\n\t\t\t\t\toverlap = distance - Math.sqrt(lengthSq);\r\n\t\t\t\t\toverlap += 0.5;\r\n\r\n\t\t\t\t\ttotalMass = particle.mass + otherParticle.mass;\r\n\t\t\t\t\taverageMass1 = this.mass ? otherParticle.mass / totalMass : 0.5;\r\n\t\t\t\t\taverageMass2 = this.mass ? particle.mass / totalMass : 0.5;\r\n\t\t\t\t\t\r\n\t\t\t\t\tparticle.p.add(this.delta.clone().normalize().multiplyScalar(overlap * -averageMass1));\r\n\t\t\t\t\totherParticle.p.add(this.delta.normalize().multiplyScalar(overlap * averageMass2));\r\n\r\n\t\t\t\t\tthis.callback && this.callback(particle, otherParticle);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n","import Util from '../utils/Util';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class CrossZone extends Behaviour {\r\n\r\n /**\r\n * Defines what happens if the particles come to the end of the specified zone\r\n *\r\n * @memberof! Proton#\r\n * @augments Proton.Behaviour\r\n * @constructor\r\n * @alias Proton.CrossZone\r\n *\r\n * @param {Proton.Zone} zone \t\t\t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\r\n * @param {String} \t\t[crossType=dead] \t\t\twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\r\n * @param {Number} \t\t[life=Infinity] \t\t\tthis behaviour's life\r\n * @param {String} \t\t[easing=ease.easeLinear] \tthis behaviour's easing\r\n *\r\n * @property {String} name The Behaviour name\r\n */\r\n constructor(zone, crossType, life, easing) {\r\n super(life, easing);\r\n\r\n this.reset(zone, crossType);\r\n this.name = \"CrossZone\";\r\n }\r\n\r\n /**\r\n * Reset this behaviour's parameters\r\n *\r\n * @method reset\r\n * @memberof Proton#Proton.CrossZone\r\n * @instance\r\n *\r\n * @param {Proton.Zone} zone \t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\r\n * @param {String} \t\t[crossType=dead] \twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\r\n * @param {Number} \t\t[life=Infinity] \tthis behaviour's life\r\n * @param {String} \t\t[easing=easeLinear]\tthis behaviour's easing\r\n */\r\n reset(zone, crossType, life, easing) {\r\n this.zone = zone;\r\n this.zone.crossType = Util.initValue(crossType, \"dead\");\r\n\r\n life && super.reset(life, easing);\r\n }\r\n\r\n /**\r\n * Apply this behaviour for all particles every time\r\n *\r\n * @method applyBehaviour\r\n * @memberof Proton#Proton.CrossZone\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n * @param {Number} the integrate time 1/ms\r\n * @param {Int} the particle index\r\n */\r\n applyBehaviour(particle, time, index) {\r\n this.calculate(particle, time, index);\r\n this.zone.crossing(particle);\r\n };\r\n}","import Util from '../utils/Util';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Alpha extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Alpha\r\n\t *\r\n\t * @todo add description for 'a' and 'b'\r\n\t *\r\n\t * @param {Number} a\r\n\t * @param {String} b\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(a, b, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.reset(a, b);\r\n\t\tthis.name = \"Alpha\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Alpha\r\n\t * @instance\r\n\t *\r\n\t * @todo add description for 'a' and 'b'\r\n\t *\r\n\t * @param {Number} a\r\n\t * @param {String} b\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(a, b, life, easing) {\r\n\t\tthis.same = b === null || b === undefined ? true : false;\r\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 1));\r\n\t\tthis.b = Util.setSpanValue(b);\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\t\r\n\t/**\r\n\t * Sets the new alpha value of the particle\r\n\t *\r\n\t * @method initialize\r\n\t * @memberof Proton#Proton.Alpha\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle A single Proton generated particle\r\n\t */\r\n\tinitialize(particle) {\r\n\t\tparticle.transform.alphaA = this.a.getValue();\r\n\r\n\t\tif (this.same)\r\n\t\t\tparticle.transform.alphaB = particle.transform.alphaA;\r\n\t\telse\r\n\t\t\tparticle.transform.alphaB = this.b.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#Proton.Alpha\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n \t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\t\t\r\n\t\tparticle.alpha = particle.transform.alphaB + (particle.transform.alphaA - particle.transform.alphaB) * this.energy;\r\n\t\tif (particle.alpha < 0.001) particle.alpha = 0;\r\n\t}\r\n}\r\n","import Util from '../utils/Util';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Scale extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Scale\r\n\t *\r\n\t * @todo add description for 'a' and 'b'\r\n\t *\r\n\t * @param {Number} a\r\n\t * @param {String} b\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(a, b, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.reset(a, b);\r\n\t\tthis.name = \"Scale\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Scale\r\n\t * @instance\r\n\t *\r\n\t * @param {Number} a\r\n\t * @param {String} b\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(a, b, life, easing) {\r\n\t\tthis.same = b === null || b === undefined ? true : false;\r\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 1));\r\n\t\tthis.b = Util.setSpanValue(b);\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Initialize the behaviour's parameters for all particles\r\n\t *\r\n\t * @method initialize\r\n\t * @memberof Proton#Proton.Scale\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t */\r\n\tinitialize(particle) {\r\n\t\tparticle.transform.scaleA = this.a.getValue();\r\n\t\tparticle.transform.oldRadius = particle.radius;\r\n\t\tparticle.transform.scaleB = this.same ? particle.transform.scaleA : this.b.getValue();\r\n\t};\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#Proton.Scale\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\t\tparticle.scale = particle.transform.scaleB + (particle.transform.scaleA - particle.transform.scaleB) * this.energy;\r\n\r\n\t\tif (particle.scale < 0.0001) particle.scale = 0;\r\n\t\tparticle.radius = particle.transform.oldRadius * particle.scale;\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Rotate extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Rotate\r\n\t *\r\n\t * @todo add description for 'a', 'b' and 'style'\r\n\t *\r\n\t * @param {String} [influence=Velocity] The rotation's influence\r\n\t * @param {String} b\r\n\t * @param {String} [style=to]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(influence, b, style, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.reset(influence, b, style);\r\n\t\tthis.name = \"Rotate\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Rotate\r\n\t * @instance\r\n\t *\r\n\t * @todo add description for 'a', 'b' and 'style'\r\n\t *\r\n\t * @param {String} a\r\n\t * @param {String} b\r\n\t * @param {String} [style=to]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(a, b, style, life, easing) {\r\n\t\tthis.same = b === null || b === undefined ? true : false;\r\n\r\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, \"Velocity\"));\r\n\t\tthis.b = Util.setSpanValue(Util.initValue(b, 0));\r\n\t\tthis.style = Util.initValue(style, 'to');\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Initialize the behaviour's parameters for all particles\r\n\t *\r\n\t * @method initialize\r\n\t * @memberof Proton#Proton.Rotate\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t */\r\n\tinitialize(particle) {\r\n\t\tparticle.rotation = this.a.getValue();\r\n\t\tparticle.transform.rotationA = this.a.getValue();\r\n\r\n\t\tif (!this.same) particle.transform.rotationB = this.b.getValue();\r\n\t};\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#Proton.Rotate\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\r\n\t\tif (!this.same) {\r\n\t\t\tif (this.style == 'to' || this.style == 'TO' || this.style == '_') {\r\n\t\t\t\tparticle.rotation += particle.transform.rotationB + (particle.transform.rotationA - particle.transform.rotationB) * this.energy\r\n\t\t\t} else {\r\n\t\t\t\tparticle.rotation += particle.transform.rotationB;\r\n\t\t\t}\r\n\t\t} else if (this.a.a == \"V\" || this.a.a == \"Velocity\" || this.a.a == \"v\") {\r\n\t\t\t//beta...\r\n\t\t\tparticle.rotation = particle.getDirection();\r\n\t\t}\r\n\t}\r\n\r\n}\r\n","import Util from '../utils/Util';\r\nimport ColorUtil from '../utils/ColorUtil';\r\nimport ArraySpan from '../math/ArraySpan';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Color extends Behaviour {\r\n\r\n /**\r\n * @memberof! Proton#\r\n * @augments Proton.Behaviour\r\n * @constructor\r\n * @alias Proton.Color\r\n *\r\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\r\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\r\n * @param {Number} [life=Infinity] \tthis behaviour's life\r\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\r\n *\r\n * @property {String} name The Behaviour name\r\n */\r\n constructor(a, b, life, easing) {\r\n super(life, easing);\r\n\r\n this.reset(a, b);\r\n this.name = \"Color\";\r\n }\r\n\r\n /**\r\n * Reset this behaviour's parameters\r\n *\r\n * @method reset\r\n * @memberof Proton#Proton.Color\r\n * @instance\r\n *\r\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\r\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\r\n * @param {Number} [life=Infinity] \tthis behaviour's life\r\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\r\n */\r\n reset(a, b, life, easing) {\r\n this.a = ArraySpan.createArraySpan(a);\r\n this.b = ArraySpan.createArraySpan(b);\r\n\r\n life && super.reset(life, easing);\r\n }\r\n\r\n /**\r\n * Initialize the behaviour's parameters for all particles\r\n *\r\n * @method initialize\r\n * @memberof Proton#Proton.Color\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n */\r\n initialize(particle) {\r\n particle.color = this.a.getValue();\r\n particle.transform.colorA = ColorUtil.hexToRGB(particle.color);\r\n\r\n if (this.b)\r\n particle.transform.colorB = ColorUtil.hexToRGB(this.b.getValue());\r\n };\r\n\r\n /**\r\n * Apply this behaviour for all particles every time\r\n *\r\n * @method applyBehaviour\r\n * @memberof Proton#Proton.Color\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n * @param {Number} the integrate time 1/ms\r\n * @param {Int} the particle index\r\n */\r\n applyBehaviour(particle, time, index) {\r\n if (this.b) {\r\n this.calculate(particle, time, index);\r\n\r\n particle.transform.rgb.r = particle.transform.colorB.r + (particle.transform.colorA.r - particle.transform.colorB.r) * this.energy;\r\n particle.transform.rgb.g = particle.transform.colorB.g + (particle.transform.colorA.g - particle.transform.colorB.g) * this.energy;\r\n particle.transform.rgb.b = particle.transform.colorB.b + (particle.transform.colorA.b - particle.transform.colorB.b) * this.energy;\r\n\r\n particle.transform.rgb.r = Math.floor(particle.transform.rgb.r);\r\n particle.transform.rgb.g = Math.floor(particle.transform.rgb.g);\r\n particle.transform.rgb.b = Math.floor(particle.transform.rgb.b);\r\n\r\n } else {\r\n particle.transform.rgb.r = particle.transform.colorA.r;\r\n particle.transform.rgb.g = particle.transform.colorA.g;\r\n particle.transform.rgb.b = particle.transform.colorA.b;\r\n }\r\n };\r\n\r\n}","import Util from '../utils/Util';\r\nimport Attraction from './Attraction';\r\n\r\nexport default class Repulsion extends Attraction {\r\n\r\n\t/**\r\n\t * The oppisite of Proton.Attraction - turns the force\r\n\t *\r\n\t * @memberof! Proton#\r\n\t * @augments Proton#Proton.Attraction\r\n\t * @constructor\r\n\t * @alias Proton.Repulsion\r\n\t *\r\n\t * @todo add description for 'force' and 'radius'\r\n\t *\r\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\r\n\t * @param {Number} [force=100]\r\n\t * @param {Number} [radius=1000]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {Number} force\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(targetPosition, force, radius, life, easing) {\r\n\t\tsuper(targetPosition, force, radius, life, easing);\r\n\r\n\t\tthis.force *= -1;\r\n\t\tthis.name = \"Repulsion\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Repulsion\r\n\t * @instance\r\n\t *\r\n\t * @todo add description for 'force' and 'radius'\r\n\t *\r\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\r\n\t * @param {Number} [force=100]\r\n\t * @param {Number} [radius=1000]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(targetPosition, force, radius, life, easing) {\r\n\t\tsuper.reset(targetPosition, force, radius, life, easing);\r\n\t\tthis.force *= -1;\r\n\t}\r\n}\r\n","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class GravityWell extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Behaviour\r\n\t * @constructor\r\n\t * @alias GravityWell\r\n\t *\r\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\r\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\t\r\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(centerPoint, force, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.distanceVec = new Vector2D();\r\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\r\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\r\n\r\n\t\tthis.name = \"GravityWell\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#GravityWell\r\n\t * @instance\r\n\t *\r\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\r\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\t\r\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\r\n\t */\r\n\treset(centerPoint, force, life, easing) {\r\n\t\tthis.distanceVec = new Vector2D();\r\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\r\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\r\n\t\t\r\n\t\tlife && super.reset(life, easing);\r\n\t};\r\n\r\n\t/**\r\n\t * @inheritdoc\r\n\t */\r\n\tinitialize(particle) {\r\n\t};\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#GravityWell\r\n\t * @instance\r\n\t *\r\n\t * @param {Particle} particle\r\n\t * @param {Number} the integrate time 1/ms\r\n\t * @param {Int} the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.distanceVec.set(this.centerPoint.x - particle.p.x, this.centerPoint.y - particle.p.y);\r\n\t\tconst distanceSq = this.distanceVec.lengthSq();\r\n\r\n\t\tif (distanceSq != 0) {\r\n\t\t\tconst distance = this.distanceVec.length();\r\n\t\t\tconst factor = (this.force * time) / (distanceSq * distance);\r\n\r\n\t\t\tparticle.v.x += factor * this.distanceVec.x;\r\n\t\t\tparticle.v.y += factor * this.distanceVec.y;\r\n\t\t}\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Initialize from './Initialize';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default {\r\n\r\n\tinitialize(emitter, particle, initializes) {\r\n\t\tconst length = initializes.length;\r\n\t\tlet i;\r\n\r\n\t\tfor (i = 0; i < length; i++) {\r\n\t\t\tif (initializes[i] instanceof Initialize)\r\n\t\t\t\tinitializes[i].init(emitter, particle);\r\n\t\t\telse\r\n\t\t\t\tthis.init(emitter, particle, initializes[i]);\r\n\t\t}\r\n\r\n\t\tthis.bindEmitter(emitter, particle);\r\n\t},\r\n\r\n\t//////////////////////init//////////////////////\r\n\tinit(emitter, particle, initialize) {\r\n\t\tUtil.setPrototypeByObject(particle, initialize);\r\n\t\tUtil.setVector2DByObject(particle, initialize);\r\n\t},\r\n\t\r\n\tbindEmitter(emitter, particle) {\r\n\t\tif (emitter.bindEmitter) {\r\n\t\t\tparticle.p.add(emitter.p);\r\n\t\t\tparticle.v.add(emitter.v);\r\n\t\t\tparticle.a.add(emitter.a);\r\n\r\n\t\t\tparticle.v.rotate(MathUtils.degreeTransform(emitter.rotation));\r\n\t\t}\r\n\t}\r\n}\r\n","import Util from '../utils/Util';\r\nimport Particle from '../core/Particle';\r\nimport EventDispatcher from '../events/EventDispatcher';\r\n\r\nimport Rate from '../initialize/Rate';\r\nimport InitializeUtil from '../initialize/InitializeUtil';\r\n\r\nexport default class Emitter extends Particle {\r\n\r\n\tstatic ID = 0;\r\n\r\n\t/**\r\n\t * You can use this emit particles.\r\n\t *\r\n\t * It will dispatch follow events:\r\n\t * PARTICLE_CREATED\r\n\t * PARTICLE_UPDATA\r\n\t * PARTICLE_DEAD\r\n\t *\r\n\t * @class Emitter\r\n\t * @constructor\r\n\t * @param {Object} pObj the parameters object;\r\n\t * for example {damping:0.01,bindEmitter:false}\r\n\t */\r\n\tconstructor(pObj) {\r\n\t\tsuper(pObj);\r\n\r\n\t\tthis.initializes = [];\r\n\t\tthis.particles = [];\r\n\t\tthis.behaviours = [];\r\n\r\n\t\tthis.emitSpeed = 0;\r\n\t\tthis.emitTime = 0;\r\n\t\tthis.totalTime = -1;\r\n\r\n\t\t/**\r\n\t\t * The friction coefficient for all particle emit by This;\r\n\t\t * @property damping\r\n\t\t * @type {Number}\r\n\t\t * @default 0.006\r\n\t\t */\r\n\t\tthis.damping = .006;\r\n\r\n\t\t/**\r\n\t\t * If bindEmitter the particles can bind this emitter's property;\r\n\t\t * @property bindEmitter\r\n\t\t * @type {Boolean}\r\n\t\t * @default true\r\n\t\t */\r\n\t\tthis.bindEmitter = true;\r\n\r\n\t\t/**\r\n\t\t * The number of particles per second emit (a [particle]/b [s]);\r\n\t\t * @property rate\r\n\t\t * @type {Rate}\r\n\t\t * @default Rate(1, .1)\r\n\t\t */\r\n\t\tthis.rate = new Rate(1, .1);\r\n\r\n\t\tthis.id = `emitter_${Emitter.ID++}`;\r\n\t\tthis.name = 'Emitter';\r\n\t}\r\n\r\n\t/**\r\n\t * start emit particle\r\n\t * @method emit\r\n\t * @param {Number} emitTime begin emit time;\r\n\t * @param {String} life the life of this emitter\r\n\t */\r\n\temit(totalTime, life) {\r\n\t\tthis.stoped = false;\r\n\t\tthis.emitTime = 0;\r\n\t\tthis.totalTime = Util.initValue(totalTime, Infinity);\r\n\r\n\t\tif (life == true || life == 'life' || life == 'destroy') {\r\n\t\t\tthis.life = totalTime == 'once' ? 1 : this.totalTime;\r\n\t\t} else if (!isNaN(life)) {\r\n\t\t\tthis.life = life;\r\n\t\t}\r\n\r\n\t\tthis.rate.init();\r\n\t}\r\n\r\n\t/**\r\n\t * stop emiting\r\n\t * @method stop\r\n\t */\r\n\tstop() {\r\n\t\tthis.totalTime = -1;\r\n\t\tthis.emitTime = 0;\r\n\t\tthis.stoped = true;\r\n\t}\r\n\r\n\tpreEmit(time) {\r\n\t\tlet oldStoped = this.stoped;\r\n\t\tlet oldEmitTime = this.emitTime;\r\n\t\tlet oldTotalTime = this.totalTime;\r\n\r\n\t\tthis.stoped = false;\r\n\t\tthis.emitTime = 0;\r\n\t\tthis.totalTime = time;\r\n\t\tthis.rate.init();\r\n\r\n\t\tconst step = 0.0167;\r\n\t\twhile (time > step) {\r\n\t\t\ttime -= step;\r\n\t\t\tthis.update(step);\r\n\t\t}\r\n\r\n\t\tthis.stoped = oldStoped;\r\n\t\tthis.emitTime = oldEmitTime + Math.max(time, 0);\r\n\t\tthis.totalTime = oldTotalTime;\r\n\t}\r\n\r\n\t/**\r\n\t * remove current all particles\r\n\t * @method removeAllParticles\r\n\t */\r\n\tremoveAllParticles() {\r\n\t\tlet i = this.particles.length;\r\n\t\twhile (i--) this.particles[i].dead = true;\r\n\t}\r\n\r\n\t/**\r\n\t * add initialize to this emitter\r\n\t * @method addSelfInitialize\r\n\t */\r\n\taddSelfInitialize(pObj) {\r\n\t\tif (pObj['init']) {\r\n\t\t\tpObj.init(this);\r\n\t\t} else {\r\n\t\t\tthis.initAll();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * add the Initialize to particles;\r\n\t * \r\n\t * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);\r\n\t * @method addInitialize\r\n\t * @param {Initialize} initialize like this new Radius(1, 12)\r\n\t */\r\n\taddInitialize(...rest) {\r\n\t\tlet i = rest.length;\r\n\t\twhile (i--)\r\n\t\t\tthis.initializes.push(rest[i]);\r\n\t}\r\n\r\n\t/**\r\n\t * remove the Initialize\r\n\t * @method removeInitialize\r\n\t * @param {Initialize} initialize a initialize\r\n\t */\r\n\tremoveInitialize(initializer) {\r\n\t\tconst index = this.initializes.indexOf(initializer);\r\n\t\tif (index > -1) this.initializes.splice(index, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * remove all Initializes\r\n\t * @method removeInitializers\r\n\t */\r\n\tremoveAllInitializers() {\r\n\t\tUtil.destroyArray(this.initializes);\r\n\t}\r\n\r\n\t/**\r\n\t * add the Behaviour to particles;\r\n\t * \r\n\t * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);\r\n\t * @method addBehaviour\r\n\t * @param {Behaviour} behaviour like this new Color('random')\r\n\t */\r\n\taddBehaviour(...rest) {\r\n\t\tlet i = arguments.length;\r\n\t\twhile (i--) {\r\n\t\t\tlet behaviour = rest[i];\r\n\t\t\tthis.behaviours.push(behaviour);\r\n\t\t\tif (behaviour.parents) behaviour.parents.push(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * remove the Behaviour\r\n\t * @method removeBehaviour\r\n\t * @param {Behaviour} behaviour a behaviour\r\n\t */\r\n\tremoveBehaviour(behaviour) {\r\n\t\tlet index = this.behaviours.indexOf(behaviour);\r\n\t\tthis.behaviours.splice(index, 1);\r\n\r\n\t\tif (behaviour.parents) {\r\n\t\t\tindex = behaviour.parents.indexOf(behaviour);\r\n\t\t\tbehaviour.parents.splice(index, 1);\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\t/**\r\n\t * remove all behaviours\r\n\t * @method removeAllBehaviours\r\n\t */\r\n\tremoveAllBehaviours() {\r\n\t\tUtil.destroyArray(this.behaviours);\r\n\t}\r\n\r\n\t// emitter update \r\n\tupdate(time) {\r\n\t\tthis.age += time;\r\n\t\tif (this.age >= this.life || this.dead) this.destroy();\r\n\r\n\t\tthis.emitting(time);\r\n\t\tthis.integrate(time);\r\n\t}\r\n\r\n\tintegrate(time) {\r\n\t\tif (!this.parent) return;\r\n\r\n\t\tconst damping = 1 - this.damping;\r\n\t\tthis.parent.integrator.calculate(this, time, damping);\r\n\r\n\t\tconst length = this.particles.length;\r\n\t\tlet i, particle;\r\n\r\n\t\tfor (i = length - 1; i >= 0; i--) {\r\n\t\t\tparticle = this.particles[i];\r\n\r\n\t\t\t// particle update\r\n\t\t\tparticle.update(time, i);\r\n\t\t\tthis.parent.integrator.calculate(particle, time, damping);\r\n\t\t\tthis.dispatch(\"PARTICLE_UPDATE\", particle);\r\n\r\n\t\t\t// check dead\r\n\t\t\tif (particle.dead) {\r\n\t\t\t\tthis.dispatch(\"PARTICLE_DEAD\", particle);\r\n\r\n\t\t\t\tthis.parent.pool.expire(particle);\r\n\t\t\t\tthis.particles.splice(i, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdispatch(event, target) {\r\n\t\tthis.parent && this.parent.dispatchEvent(event, target);\r\n\t\tthis.bindEvent && this.dispatchEvent(event, target);\r\n\t}\r\n\r\n\temitting(time) {\r\n\t\tif (this.totalTime == 'once') {\r\n\t\t\tlet i;\r\n\t\t\tconst length = this.rate.getValue(99999);\r\n\r\n\t\t\tif (length > 0) this.emitSpeed = length;\r\n\t\t\tfor (i = 0; i < length; i++) this.createParticle();\r\n\t\t\tthis.totalTime = 'none';\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\tthis.emitTime += time;\r\n\r\n\t\t\tif (this.emitTime < this.totalTime) {\r\n\t\t\t\tconst length = this.rate.getValue(time)\r\n\t\t\t\tlet i;\r\n\r\n\t\t\t\tif (length > 0) this.emitSpeed = length;\r\n\t\t\t\tfor (i = 0; i < length; i++) this.createParticle();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * create single particle;\r\n\t * \r\n\t * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})\r\n\t * @method removeAllParticles\r\n\t */\r\n\tcreateParticle(initialize, behaviour) {\r\n\t\tconst particle = this.parent.pool.get(Particle);\r\n\t\tthis.setupParticle(particle, initialize, behaviour);\r\n\t\tthis.dispatch(\"PARTICLE_CREATED\", particle);\r\n\r\n\t\treturn particle;\r\n\t}\r\n\r\n\tsetupParticle(particle, initialize, behaviour) {\r\n\t\tlet initializes = this.initializes;\r\n\t\tlet behaviours = this.behaviours;\r\n\r\n\t\tif (initialize) {\r\n\t\t\tinitializes = Util.isArray(initialize) ? initialize : [initialize];\r\n\t\t}\r\n\r\n\t\tif (behaviour) {\r\n\t\t\tbehaviour = Util.isArray(behaviour) ? behaviour : [behaviour];\r\n\t\t}\r\n\r\n\t\tparticle.reset();\r\n\t\tInitializeUtil.initialize(this, particle, initializes);\r\n\t\tparticle.addBehaviours(behaviours);\r\n\t\tparticle.parent = this;\r\n\r\n\t\tthis.particles.push(particle);\r\n\t}\r\n\r\n\tremove() {\r\n\t\tthis.stop();\r\n\t\tUtil.destroy(this.particles);\r\n\t}\r\n\r\n\t/**\r\n\t * Destory this Emitter\r\n\t * @method destroy\r\n\t */\r\n\tdestroy(slow) {\r\n\t\tthis.dead = true;\r\n\t\tthis.remove();\r\n\t\tthis.removeAllInitializers();\r\n\t\tthis.removeAllBehaviours();\r\n\t\tthis.parent && this.parent.removeEmitter(this);\r\n\t}\r\n\r\n}\r\n\r\nEventDispatcher.bind(Emitter);","import Util from '../utils/Util';\r\nimport Emitter from './Emitter';\r\n\r\nexport default class BehaviourEmitter extends Emitter {\r\n\r\n\t/**\r\n\t * The BehaviourEmitter class inherits from Proton.Emitter\r\n\t *\r\n\t * use the BehaviourEmitter you can add behaviours to self;\r\n\t * @class Proton.BehaviourEmitter\r\n\t * @constructor\r\n\t * @param {Object} pObj the parameters object;\r\n\t */\r\n\tconstructor(pObj) {\r\n\t\tsuper(pObj);\r\n\r\n\t\tthis.selfBehaviours = [];\r\n\t};\r\n\t\r\n\t/**\r\n\t * add the Behaviour to emitter;\r\n\t *\r\n\t * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);\r\n\t * @method addSelfBehaviour\r\n\t * @param {Proton.Behaviour} behaviour like this new Proton.Color('random')\r\n\t */\r\n\taddSelfBehaviour(...rest) {\r\n\t\tconst length = rest.length;\r\n\t\tlet i;\r\n\r\n\t\tfor (i = 0; i < length; i++) {\r\n\t\t\tthis.selfBehaviours.push(rest[i]);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * remove the Behaviour for self\r\n\t * @method removeSelfBehaviour\r\n\t * @param {Proton.Behaviour} behaviour a behaviour\r\n\t */\r\n\tremoveSelfBehaviour(behaviour) {\r\n\t\tconst index = this.selfBehaviours.indexOf(behaviour);\r\n\t\tif (index > -1) this.selfBehaviours.splice(index, 1);\r\n\t};\r\n\r\n\tupdate(time) {\r\n\t\tsuper.update(time);\r\n\r\n\t\tif (!this.sleep) {\r\n\t\t\tconst length = this.selfBehaviours.length;\r\n\t\t\tlet i;\r\n\r\n\t\t\tfor (i = 0; i < length; i++) {\r\n\t\t\t\tthis.selfBehaviours[i].applyBehaviour(this, time, i);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Emitter from './Emitter';\r\n\r\nexport default class FollowEmitter extends Emitter {\r\n\r\n\t/**\r\n\t * The FollowEmitter class inherits from Proton.Emitter\r\n\t *\r\n\t * use the FollowEmitter will emit particle when mousemoving\r\n\t *\r\n\t * @class Proton.FollowEmitter\r\n\t * @constructor\r\n\t * @param {Element} mouseTarget mouseevent's target;\r\n\t * @param {Number} ease the easing of following speed;\r\n\t * @default 0.7\r\n\t * @param {Object} pObj the parameters object;\r\n\t */\r\n\tconstructor(mouseTarget, ease, pObj) {\r\n\t\tsuper(pObj);\r\n\r\n\t\tthis.mouseTarget = Util.initValue(mouseTarget, window);\r\n\t\tthis.ease = Util.initValue(ease, .7);\r\n\r\n\t\tthis._allowEmitting = false;\r\n\t\tthis.initEventHandler();\r\n\t};\r\n\r\n\tinitEventHandler() {\r\n\t\tthis.mousemoveHandler = e => this.mousemove.call(this, e);\r\n\t\tthis.mousedownHandler = e => this.mousedown.call(this, e);\r\n\t\tthis.mouseupHandler = e => this.mouseup.call(this, e);\r\n\r\n\t\tthis.mouseTarget.addEventListener('mousemove', this.mousemoveHandler, false);\r\n\t}\r\n\r\n\t/**\r\n\t * start emit particle\r\n\t * @method emit\r\n\t */\r\n\temit() {\r\n\t\tthis._allowEmitting = true;\r\n\t}\r\n\r\n\t/**\r\n\t * stop emiting\r\n\t * @method stop\r\n\t */\r\n\tstop() {\r\n\t\tthis._allowEmitting = false;\r\n\t}\r\n\r\n\tmousemove(e) {\r\n\t\tif (e.layerX || e.layerX === 0) {\r\n\t\t\tthis.p.x += (e.layerX - this.p.x) * this.ease;\r\n\t\t\tthis.p.y += (e.layerY - this.p.y) * this.ease;\r\n\t\t} else if (e.offsetX || e.offsetX === 0) {\r\n\t\t\tthis.p.x += (e.offsetX - this.p.x) * this.ease;\r\n\t\t\tthis.p.y += (e.offsetY - this.p.y) * this.ease;\r\n\t\t}\r\n\r\n\t\tif (this._allowEmitting) super.emit('once');\r\n\t};\r\n\r\n\t/**\r\n\t * Destory this Emitter\r\n\t * @method destroy\r\n\t */\r\n\tdestroy() {\r\n\t\tsuper.destroy();\r\n\t\tthis.mouseTarget.removeEventListener('mousemove', this.mousemoveHandler, false);\r\n\t}\r\n\r\n}\r\n","import Pool from '../core/Pool';\r\nimport Util from '../utils/Util';\r\n\r\nexport default class BaseRenderer {\r\n\r\n constructor(element, stroke) {\r\n this.element = element;\r\n this.stroke = stroke;\r\n\r\n this.initHandler();\r\n\r\n this.circleConf = { isCircle: true };\r\n this.pool = new Pool();\r\n this.name = 'BaseRenderer';\r\n }\r\n\r\n setStroke(color, thinkness) {\r\n color = Util.initValue(color, '#000000');\r\n thinkness = Util.initValue(thinkness, 1);\r\n\r\n this.stroke = { color, thinkness };\r\n }\r\n\r\n initHandler() {\r\n this._protonUpdateHandler = () => { this.onProtonUpdate.call(this) };\r\n this._protonUpdateAfterHandler = () => { this.onProtonUpdateAfter.call(this) };\r\n this._emitterAddedHandler = (emitter) => { this.onEmitterAdded.call(this, emitter) };\r\n this._emitterRemovedHandler = (emitter) => { this.onEmitterRemoved.call(this, emitter) };\r\n this._particleCreatedHandler = (particle) => { this.onParticleCreated.call(this, particle) };\r\n this._particleUpdateHandler = (particle) => { this.onParticleUpdate.call(this, particle) };\r\n this._particleDeadHandler = (particle) => { this.onParticleDead.call(this, particle) };\r\n }\r\n\r\n init(proton) {\r\n this.parent = proton;\r\n\r\n proton.addEventListener('PROTON_UPDATE', this._protonUpdateHandler);\r\n proton.addEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\r\n\r\n proton.addEventListener('EMITTER_ADDED', this._emitterAddedHandler);\r\n proton.addEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\r\n\r\n proton.addEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\r\n proton.addEventListener('PARTICLE_UPDATE', this._particleUpdateHandler);\r\n proton.addEventListener('PARTICLE_DEAD', this._particleDeadHandler);\r\n }\r\n\r\n resize(width, height) {}\r\n\r\n remove(proton) {\r\n this.parent.removeEventListener('PROTON_UPDATE', this._protonUpdateHandler);\r\n this.parent.removeEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\r\n\r\n this.parent.removeEventListener('EMITTER_ADDED', this._emitterAddedHandler);\r\n this.parent.removeEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\r\n\r\n this.parent.removeEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\r\n this.parent.removeEventListener('PARTICLE_UPDATE', this._particleUpdateHandler);\r\n this.parent.removeEventListener('PARTICLE_DEAD', this._particleDeadHandler);\r\n\r\n this.parent = null;\r\n }\r\n\r\n destroy(){\r\n this.remove();\r\n }\r\n \r\n onProtonUpdate() {}\r\n onProtonUpdateAfter() {}\r\n\r\n onEmitterAdded(emitter) {}\r\n onEmitterRemoved(emitter) {}\r\n\r\n onParticleCreated(particle) {}\r\n onParticleUpdate(particle) {}\r\n onParticleDead(particle) {}\r\n}","import Util from '../utils/Util';\r\nimport ImgUtil from '../utils/ImgUtil';\r\nimport ColorUtil from '../utils/ColorUtil';\r\nimport MathUtils from '../math/MathUtils';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class CanvasRenderer extends BaseRenderer {\r\n\r\n constructor(element) {\r\n super(element);\r\n\r\n this.stroke = null;\r\n this.context = this.element.getContext(\"2d\");\r\n this.bufferCache = {};\r\n\r\n this.name = 'CanvasRenderer';\r\n }\r\n\r\n resize(width, height) {\r\n this.element.width = width;\r\n this.element.height = height;\r\n }\r\n\r\n onProtonUpdate() {\r\n this.context.clearRect(0, 0, this.element.width, this.element.height);\r\n }\r\n\r\n onParticleCreated(particle) {\r\n if (particle.body)\r\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\r\n else\r\n particle.color = particle.color || '#ff0000';\r\n }\r\n\r\n onParticleUpdate(particle) {\r\n if (particle.body) {\r\n if (particle.body instanceof Image) this.drawImage(particle);\r\n } else {\r\n this.drawCircle(particle);\r\n }\r\n }\r\n\r\n onParticleDead(particle) {\r\n particle.body = null;\r\n }\r\n\r\n\r\n // private \r\n addImg2Body(img, particle) {\r\n particle.body = img;\r\n }\r\n\r\n // private drawCircle --\r\n drawImage(particle) {\r\n const w = particle.body.width * particle.scale | 0;\r\n const h = particle.body.height * particle.scale | 0;\r\n const x = particle.p.x - w / 2;\r\n const y = particle.p.y - h / 2;\r\n\r\n if (!!particle.color) {\r\n if (!particle.transform[\"buffer\"]) particle.transform.buffer = this.createBuffer(particle.body);\r\n\r\n const bufferContext = particle.transform.buffer.getContext('2d');\r\n bufferContext.clearRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\r\n bufferContext.globalAlpha = particle.alpha;\r\n bufferContext.drawImage(particle.body, 0, 0);\r\n\r\n bufferContext.globalCompositeOperation = \"source-atop\";\r\n bufferContext.fillStyle = ColorUtil.rgbToHex(particle.transform.rgb);\r\n bufferContext.fillRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\r\n bufferContext.globalCompositeOperation = \"source-over\";\r\n bufferContext.globalAlpha = 1;\r\n\r\n this.context.drawImage(particle.transform.buffer, 0, 0, particle.transform.buffer.width, particle.transform.buffer.height, x, y, w, h);\r\n } else {\r\n this.context.save();\r\n\r\n this.context.globalAlpha = particle.alpha;\r\n this.context.translate(particle.p.x, particle.p.y);\r\n this.context.rotate(MathUtils.degreeTransform(particle.rotation));\r\n this.context.translate(-particle.p.x, -particle.p.y);\r\n this.context.drawImage(particle.body, 0, 0, particle.body.width, particle.body.height, x, y, w, h);\r\n\r\n this.context.globalAlpha = 1;\r\n this.context.restore();\r\n }\r\n }\r\n\r\n // private drawCircle --\r\n drawCircle(particle) {\r\n if (particle.transform[\"rgb\"])\r\n this.context.fillStyle = 'rgba(' + particle.transform.rgb.r + ',' + particle.transform.rgb.g + ',' + particle.transform.rgb.b + ',' + particle.alpha + ')';\r\n else\r\n this.context.fillStyle = particle.color;\r\n\r\n // draw circle\r\n this.context.beginPath();\r\n this.context.arc(particle.p.x, particle.p.y, particle.radius, 0, Math.PI * 2, true);\r\n\r\n if (this.stroke) {\r\n this.context.strokeStyle = this.stroke.color;\r\n this.context.lineWidth = this.stroke.thinkness;\r\n this.context.stroke();\r\n }\r\n\r\n this.context.closePath();\r\n this.context.fill();\r\n }\r\n\r\n // private createBuffer --\r\n createBuffer(image) {\r\n if (image instanceof Image) {\r\n const size = image.width + '_' + image.height;\r\n let canvas = this.bufferCache[size];\r\n\r\n if (!canvas) {\r\n canvas = document.createElement('canvas');\r\n canvas.width = image.width;\r\n canvas.height = image.height;\r\n this.bufferCache[size] = canvas;\r\n }\r\n\r\n return canvas;\r\n }\r\n }\r\n}","import Util from '../utils/Util';\r\nimport DomUtil from '../utils/DomUtil';\r\nimport ImgUtil from '../utils/ImgUtil';\r\nimport MathUtils from '../math/MathUtils';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class DomRenderer extends BaseRenderer {\r\n\r\n constructor(element) {\r\n super(element);\r\n\r\n this.stroke = null;\r\n this.pool.create = (body, particle) => this.createBody(body, particle);\r\n this.addImg2Body = this.addImg2Body.bind(this);\r\n\r\n this.transform3d = false;\r\n\r\n this.name = 'DomRenderer';\r\n }\r\n\r\n onParticleCreated(particle) {\r\n if (particle.body) {\r\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\r\n } else {\r\n particle.body = this.pool.get(this.circleConf, particle);\r\n this.element.appendChild(particle.body);\r\n }\r\n }\r\n\r\n onParticleUpdate(particle) {\r\n if (this.bodyReady(particle)) {\r\n if (this.transform3d)\r\n DomUtil.transform3d(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\r\n else\r\n DomUtil.transform(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\r\n\r\n particle.body.style.opacity = particle.alpha;\r\n if (particle.body.isCircle) {\r\n particle.body.style.backgroundColor = particle.color || '#ff0000';\r\n }\r\n }\r\n }\r\n\r\n onParticleDead(particle) {\r\n if (this.bodyReady(particle)) {\r\n this.element.removeChild(particle.body);\r\n this.pool.expire(particle.body);\r\n particle.body = null;\r\n }\r\n }\r\n\r\n bodyReady(particle) {\r\n return typeof particle.body === 'object' && particle.body && !particle.body.isInner;\r\n }\r\n\r\n // private \r\n addImg2Body(img, particle) {\r\n if (particle.dead) return;\r\n particle.body = this.pool.get(img, particle);\r\n DomUtil.resize(particle.body, img.width, img.height);\r\n\r\n this.element.appendChild(particle.body);\r\n }\r\n\r\n createBody(body, particle) {\r\n if (body.isCircle)\r\n return this.createCircle(particle);\r\n else\r\n return this.createSprite(body, particle);\r\n }\r\n\r\n // private --\r\n createCircle(particle) {\r\n const dom = DomUtil.createDiv(`${particle.id}_dom`, 2 * particle.radius, 2 * particle.radius);\r\n dom.style.borderRadius = `${particle.radius}px`;\r\n\r\n if (this.stroke) {\r\n dom.style.borderColor = this.stroke.color;\r\n dom.style.borderWidth = `${this.stroke.thinkness}px`;\r\n }\r\n dom.isCircle = true;\r\n\r\n return dom;\r\n }\r\n\r\n createSprite(body, particle) {\r\n const url = typeof body === 'string' ? body : body.src;\r\n const dom = DomUtil.createDiv(`${particle.id}_dom`, body.width, body.height);\r\n dom.style.backgroundImage = `url(${url})`;\r\n\r\n return dom;\r\n }\r\n\r\n}","import Util from '../utils/Util';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class EaselRenderer extends BaseRenderer {\r\n\r\n constructor(element, stroke) {\r\n super(element);\r\n\r\n this.stroke = stroke;\r\n this.name = 'EaselRenderer';\r\n }\r\n\r\n onParticleCreated(particle) {\r\n if (particle.body) {\r\n this.createSprite(particle);\r\n } else {\r\n this.createCircle(particle);\r\n }\r\n\r\n this.element.addChild(particle.body);\r\n }\r\n\r\n onParticleUpdate(particle) {\r\n if (particle.body) {\r\n particle.body.x = particle.p.x;\r\n particle.body.y = particle.p.y;\r\n\r\n particle.body.alpha = particle.alpha;\r\n particle.body.scaleX = particle.body.scaleY = particle.scale;\r\n particle.body.rotation = particle.rotation;\r\n }\r\n }\r\n\r\n onParticleDead(particle) {\r\n if (particle.body) {\r\n particle.body.parent && particle.body.parent.removeChild(particle.body);\r\n this.pool.expire(particle.body);\r\n particle.body = null;\r\n }\r\n\r\n if (particle.graphics) this.pool.expire(particle.graphics);\r\n }\r\n\r\n // private\r\n createSprite(particle) {\r\n particle.body = this.pool.get(particle.body);\r\n\r\n if (particle.body.parent) return;\r\n if (particle.body['image']) {\r\n particle.body.regX = particle.body.image.width / 2;\r\n particle.body.regY = particle.body.image.height / 2;\r\n }\r\n }\r\n\r\n createCircle(particle) {\r\n const graphics = this.pool.get(createjs.Graphics);\r\n\r\n if (this.stroke) {\r\n if (this.stroke instanceof String)\r\n graphics.beginStroke(this.stroke);\r\n else\r\n graphics.beginStroke('#000000');\r\n }\r\n graphics.beginFill(particle.color || '#ff0000').drawCircle(0, 0, particle.radius);\r\n\r\n const shape = this.pool.get(createjs.Shape, [graphics]);\r\n\r\n particle.body = shape;\r\n particle.graphics = graphics;\r\n }\r\n\r\n}","import Util from '../utils/Util';\r\nimport Rectangle from '../math/Rectangle';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class PixelRenderer extends BaseRenderer {\r\n\r\n constructor(element, rectangle) {\r\n super(element);\r\n\r\n this.context = this.element.getContext('2d');\r\n this.imageData = null;\r\n this.rectangle = null;\r\n this.rectangle = rectangle;\r\n this.createImageData(rectangle);\r\n\r\n this.name = 'PixelRenderer';\r\n }\r\n\r\n resize(width, height) {\r\n this.element.width = width;\r\n this.element.height = height;\r\n }\r\n\r\n createImageData(rectangle) {\r\n this.rectangle = rectangle ? rectangle : new Rectangle(0, 0, this.element.width, this.element.height);\r\n this.imageData = this.context.createImageData(this.rectangle.width, this.rectangle.height);\r\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\r\n }\r\n\r\n onProtonUpdate() {\r\n this.context.clearRect(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\r\n this.imageData = this.context.getImageData(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\r\n }\r\n\r\n onProtonUpdateAfter() {\r\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\r\n }\r\n\r\n onParticleCreated(particle) {}\r\n\r\n onParticleUpdate(particle) {\r\n if (this.imageData) {\r\n this.setPixel(this.imageData, Math.floor(particle.p.x - this.rectangle.x), Math.floor(particle.p.y - this.rectangle.y), particle);\r\n }\r\n }\r\n\r\n setPixel(imagedata, x, y, particle) {\r\n const rgb = particle.transform.rgb;\r\n\r\n if ((x < 0) || (x > this.element.width) || (y < 0) || (y > this.elementwidth))\r\n return;\r\n\r\n const i = ((y >> 0) * imagedata.width + (x >> 0)) * 4;\r\n\r\n imagedata.data[i] = rgb.r;\r\n imagedata.data[i + 1] = rgb.g;\r\n imagedata.data[i + 2] = rgb.b;\r\n imagedata.data[i + 3] = particle.alpha * 255;\r\n }\r\n\r\n onParticleDead(particle) {\r\n\r\n }\r\n\r\n}","import Pool from '../core/Pool';\r\nimport Util from '../utils/Util';\r\nimport ColorUtil from '../utils/ColorUtil';\r\nimport MathUtils from '../math/MathUtils';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class PixiRenderer extends BaseRenderer {\r\n\r\n constructor(element, stroke) {\r\n super(element);\r\n\r\n this.stroke = stroke;\r\n this.setColor = false;\r\n this.pool.create = (body, particle) => this.createBody(body, particle);\r\n this.name = 'PixiRenderer';\r\n }\r\n\r\n onProtonUpdate() { }\r\n\r\n /**\r\n * @param particle\r\n */\r\n onParticleCreated(particle) {\r\n if (particle.body) {\r\n particle.body = this.pool.get(particle.body, particle);\r\n } else {\r\n particle.body = this.pool.get(this.circleConf, particle);\r\n }\r\n\r\n this.element.addChild(particle.body);\r\n }\r\n\r\n /**\r\n * @param particle\r\n */\r\n onParticleUpdate(particle) {\r\n this.transform(particle, particle.body);\r\n if (this.setColor) particle.body.tint = ColorUtil.getHex16FromParticle(particle);\r\n }\r\n\r\n /**\r\n * @param particle\r\n */\r\n onParticleDead(particle) {\r\n this.element.removeChild(particle.body);\r\n this.pool.expire(particle.body);\r\n particle.body = null;\r\n }\r\n\r\n destroy(particles) {\r\n super.destroy();\r\n this.pool.destroy();\r\n\r\n let i = particles.length;\r\n while (i--) {\r\n let particle = particles[i];\r\n if (particle.body) {\r\n this.element.removeChild(particle.body);\r\n }\r\n }\r\n }\r\n\r\n transform(particle, target) {\r\n target.x = particle.p.x;\r\n target.y = particle.p.y;\r\n\r\n target.alpha = particle.alpha;\r\n\r\n target.scale.x = particle.scale;\r\n target.scale.y = particle.scale;\r\n\r\n // using cached version of MathUtils.PI_180 for slight performance increase.\r\n target.rotation = particle.rotation * MathUtils.PI_180; // MathUtils.PI_180;\r\n }\r\n\r\n createBody(body, particle) {\r\n if (body.isCircle)\r\n return this.createCircle(particle);\r\n else\r\n return this.createSprite(body);\r\n }\r\n\r\n createSprite(body) {\r\n const sprite = body.isInner ? PIXI.Sprite.fromImage(body.src) : new PIXI.Sprite(body);\r\n sprite.anchor.x = 0.5;\r\n sprite.anchor.y = 0.5;\r\n\r\n return sprite;\r\n }\r\n\r\n createCircle(particle) {\r\n const graphics = new PIXI.Graphics();\r\n\r\n if (this.stroke) {\r\n let stroke = this.stroke instanceof String ? this.stroke : 0x000000;\r\n graphics.beginStroke(this.stroke);\r\n }\r\n\r\n graphics.beginFill(particle.color || 0x008ced);\r\n graphics.drawCircle(0, 0, particle.radius);\r\n graphics.endFill();\r\n\r\n return graphics;\r\n }\r\n}","import Mat3 from '../math/Mat3';\r\n\r\nexport default class MStack {\r\n\r\n\tconstructor() {\r\n\t\tthis.mats = [];\r\n\t\tthis.size = 0;\r\n\r\n\t\tfor (let i = 0; i < 20; i++) this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0]));\r\n\t}\r\n\r\n\tset(m, i) {\r\n\t\tif (i == 0)\r\n\t\t\tMat3.set(m, this.mats[0]);\r\n\t\telse\r\n\t\t\tMat3.multiply(this.mats[i - 1], m, this.mats[i]);\r\n\r\n\t\tthis.size = Math.max(this.size, i + 1);\r\n\t}\r\n\r\n\tpush(m) {\r\n\t\tif (this.size == 0)\r\n\t\t\tMat3.set(m, this.mats[0]);\r\n\t\telse\r\n\t\t\tMat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]);\r\n\r\n\t\tthis.size++;\r\n\t}\r\n\r\n\tpop() {\r\n\t\tif (this.size > 0)\r\n\t\t\tthis.size--;\r\n\t}\r\n\r\n\ttop() {\r\n\t\treturn (this.mats[this.size - 1]);\r\n\t}\r\n}","import Mat3 from '../math/Mat3';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nimport Util from '../utils/Util';\r\nimport ImgUtil from '../utils/ImgUtil';\r\nimport MStack from '../utils/MStack';\r\nimport DomUtil from '../utils/DomUtil';\r\nimport WebGLUtil from '../utils/WebGLUtil';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default class WebGLRenderer extends BaseRenderer {\r\n\r\n constructor(element) {\r\n super(element);\r\n\r\n this.gl = this.element.getContext('experimental-webgl', { antialias: true, stencil: false, depth: false });\r\n if (!this.gl) alert(\"Sorry your browser do not suppest WebGL!\");\r\n\r\n this.initVar();\r\n this.setMaxRadius();\r\n this.initShaders();\r\n this.initBuffers();\r\n\r\n this.gl.blendEquation(this.gl.FUNC_ADD);\r\n this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);\r\n this.gl.enable(this.gl.BLEND);\r\n\r\n this.addImg2Body = this.addImg2Body.bind(this);\r\n\r\n this.name = 'WebGLRenderer';\r\n }\r\n\r\n init(proton) {\r\n super.init(proton);\r\n this.resize(this.element.width, this.element.height);\r\n }\r\n\r\n resize(width, height) {\r\n this.umat[4] = -2;\r\n this.umat[7] = 1;\r\n\r\n this.smat[0] = 1 / width;\r\n this.smat[4] = 1 / height;\r\n\r\n this.mstack.set(this.umat, 0);\r\n this.mstack.set(this.smat, 1);\r\n\r\n this.gl.viewport(0, 0, width, height);\r\n this.element.width = width;\r\n this.element.height = height;\r\n }\r\n\r\n setMaxRadius(radius) {\r\n this.circleCanvasURL = this.createCircle(radius);\r\n }\r\n\r\n getVertexShader() {\r\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\");\r\n return vsSource;\r\n }\r\n\r\n getFragmentShader() {\r\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\");\r\n return fsSource;\r\n }\r\n\r\n initVar() {\r\n this.mstack = new MStack();\r\n this.umat = Mat3.create([2, 0, 1, 0, -2, 0, -1, 1, 1]);\r\n this.smat = Mat3.create([1 / 100, 0, 1, 0, 1 / 100, 0, 0, 0, 1]);\r\n this.texturebuffers = {};\r\n }\r\n\r\n blendEquation(A) {\r\n this.gl.blendEquation(this.gl[A]);\r\n }\r\n\r\n blendFunc(A, B) {\r\n this.gl.blendFunc(this.gl[A], this.gl[B]);\r\n }\r\n\r\n getShader(gl, str, fs) {\r\n const shader = fs ? gl.createShader(gl.FRAGMENT_SHADER) : gl.createShader(gl.VERTEX_SHADER);\r\n\r\n gl.shaderSource(shader, str);\r\n gl.compileShader(shader);\r\n\r\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n alert(gl.getShaderInfoLog(shader));\r\n return null;\r\n }\r\n\r\n return shader;\r\n }\r\n\r\n initShaders() {\r\n const fragmentShader = this.getShader(this.gl, this.getFragmentShader(), true);\r\n const vertexShader = this.getShader(this.gl, this.getVertexShader(), false);\r\n\r\n this.sprogram = this.gl.createProgram();\r\n this.gl.attachShader(this.sprogram, vertexShader);\r\n this.gl.attachShader(this.sprogram, fragmentShader);\r\n this.gl.linkProgram(this.sprogram);\r\n\r\n if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS))\r\n alert(\"Could not initialise shaders\");\r\n\r\n this.gl.useProgram(this.sprogram);\r\n this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, \"aVertexPosition\");\r\n this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, \"aTextureCoord\");\r\n this.gl.enableVertexAttribArray(this.sprogram.tca);\r\n this.gl.enableVertexAttribArray(this.sprogram.vpa);\r\n\r\n this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, \"tMat\");\r\n this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, \"uSampler\");\r\n this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, \"useTexture\");\r\n this.sprogram.color = this.gl.getUniformLocation(this.sprogram, \"uColor\");\r\n this.gl.uniform1i(this.sprogram.useTex, 1);\r\n };\r\n\r\n initBuffers() {\r\n const vs = [0, 3, 1, 0, 2, 3];\r\n let idx;\r\n\r\n this.unitIBuffer = this.gl.createBuffer();\r\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\r\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vs), this.gl.STATIC_DRAW);\r\n\r\n let i;\r\n let ids = [];\r\n for (i = 0; i < 100; i++) ids.push(i);\r\n idx = new Uint16Array(ids);\r\n\r\n this.unitI33 = this.gl.createBuffer();\r\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitI33);\r\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\r\n\r\n ids = [];\r\n for (i = 0; i < 100; i++) ids.push(i, i + 1, i + 2);\r\n idx = new Uint16Array(ids);\r\n\r\n this.stripBuffer = this.gl.createBuffer();\r\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.stripBuffer);\r\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\r\n };\r\n\r\n createCircle(raidus) {\r\n this.circleCanvasRadius = WebGLUtil.nhpot(Util.initValue(raidus, 32));\r\n const canvas = DomUtil.createCanvas('circle_canvas', this.circleCanvasRadius * 2, this.circleCanvasRadius * 2);\r\n const context = canvas.getContext('2d');\r\n\r\n context.beginPath();\r\n context.arc(this.circleCanvasRadius, this.circleCanvasRadius, this.circleCanvasRadius, 0, Math.PI * 2, true);\r\n context.closePath();\r\n context.fillStyle = '#FFF';\r\n context.fill();\r\n\r\n return canvas.toDataURL();\r\n };\r\n\r\n drawImg2Canvas(particle) {\r\n const _w = particle.body.width;\r\n const _h = particle.body.height;\r\n\r\n const _width = WebGLUtil.nhpot(particle.body.width);\r\n const _height = WebGLUtil.nhpot(particle.body.height);\r\n\r\n const _scaleX = particle.body.width / _width;\r\n const _scaleY = particle.body.height / _height;\r\n\r\n if (!this.texturebuffers[particle.transform.src])\r\n this.texturebuffers[particle.transform.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()];\r\n\r\n particle.transform.texture = this.texturebuffers[particle.transform.src][0];\r\n particle.transform.vcBuffer = this.texturebuffers[particle.transform.src][1];\r\n particle.transform.tcBuffer = this.texturebuffers[particle.transform.src][2];\r\n\r\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer);\r\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);\r\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer);\r\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);\r\n\r\n const context = particle.transform.canvas.getContext('2d');\r\n const data = context.getImageData(0, 0, _width, _height);\r\n\r\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture);\r\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, data);\r\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR);\r\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_NEAREST);\r\n this.gl.generateMipmap(this.gl.TEXTURE_2D);\r\n\r\n particle.transform.textureLoaded = true;\r\n particle.transform.textureWidth = _w;\r\n particle.transform.textureHeight = _h;\r\n }\r\n\r\n onProtonUpdate() {\r\n //this.gl.clearColor(0, 0, 0, 1);\r\n //this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\r\n }\r\n\r\n onParticleCreated(particle) {\r\n particle.transform.textureLoaded = false;\r\n particle.transform.tmat = Mat3.create();\r\n particle.transform.tmat[8] = 1;\r\n particle.transform.imat = Mat3.create();\r\n particle.transform.imat[8] = 1;\r\n\r\n if (particle.body) {\r\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\r\n } else {\r\n ImgUtil.getImgFromCache(this.circleCanvasURL, this.addImg2Body, particle);\r\n particle.transform.oldScale = particle.radius / this.circleCanvasRadius;\r\n }\r\n }\r\n\r\n // private \r\n addImg2Body(img, particle) {\r\n if (particle.dead) return;\r\n \r\n particle.body = img;\r\n particle.transform.src = img.src;\r\n particle.transform.canvas = ImgUtil.getCanvasFromCache(img);\r\n particle.transform.oldScale = 1;\r\n\r\n this.drawImg2Canvas(particle);\r\n }\r\n\r\n onParticleUpdate(particle) {\r\n if (particle.transform.textureLoaded) {\r\n this.updateMatrix(particle);\r\n\r\n this.gl.uniform3f(this.sprogram.color, particle.transform.rgb.r / 255, particle.transform.rgb.g / 255, particle.transform.rgb.b / 255);\r\n this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top());\r\n\r\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer);\r\n this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0);\r\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer);\r\n this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0);\r\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture);\r\n this.gl.uniform1i(this.sprogram.samplerUniform, 0);\r\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\r\n\r\n this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0);\r\n\r\n this.mstack.pop();\r\n }\r\n }\r\n\r\n onParticleDead(particle) { }\r\n\r\n updateMatrix(particle) {\r\n const moveOriginMatrix = WebGLUtil.makeTranslation(-particle.transform.textureWidth / 2, -particle.transform.textureHeight / 2);\r\n const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y);\r\n\r\n const angel = particle.rotation * (MathUtils.PI_180);\r\n const rotationMatrix = WebGLUtil.makeRotation(angel);\r\n\r\n const scale = particle.scale * particle.transform.oldScale;\r\n const scaleMatrix = WebGLUtil.makeScale(scale, scale);\r\n let matrix = WebGLUtil.matrixMultiply(moveOriginMatrix, scaleMatrix);\r\n\r\n matrix = WebGLUtil.matrixMultiply(matrix, rotationMatrix);\r\n matrix = WebGLUtil.matrixMultiply(matrix, translationMatrix);\r\n\r\n Mat3.inverse(matrix, particle.transform.imat);\r\n matrix[2] = particle.alpha;\r\n\r\n this.mstack.push(matrix);\r\n }\r\n}","import Util from '../utils/Util';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class CustomRenderer extends BaseRenderer {\r\n\r\n constructor(element) {\r\n super(element);\r\n\r\n this.name = 'CustomRenderer';\r\n }\r\n\r\n}","import Zone from './Zone';\r\nimport Util from '../utils/Util';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default class LineZone extends Zone {\r\n\r\n\tconstructor(x1, y1, x2, y2, direction) {\r\n\t\tsuper();\r\n\r\n\t\tif (x2 - x1 >= 0) {\r\n\t\t\tthis.x1 = x1;\r\n\t\t\tthis.y1 = y1;\r\n\t\t\tthis.x2 = x2;\r\n\t\t\tthis.y2 = y2;\r\n\t\t} else {\r\n\t\t\tthis.x1 = x2;\r\n\t\t\tthis.y1 = y2;\r\n\t\t\tthis.x2 = x1;\r\n\t\t\tthis.y2 = y1;\r\n\t\t}\r\n\r\n\t\tthis.dx = this.x2 - this.x1;\r\n\t\tthis.dy = this.y2 - this.y1;\r\n\r\n\t\tthis.minx = Math.min(this.x1, this.x2);\r\n\t\tthis.miny = Math.min(this.y1, this.y2);\r\n\t\tthis.maxx = Math.max(this.x1, this.x2);\r\n\t\tthis.maxy = Math.max(this.y1, this.y2);\r\n\r\n\t\tthis.dot = this.x2 * this.y1 - this.x1 * this.y2;\r\n\t\tthis.xxyy = this.dx * this.dx + this.dy * this.dy;\r\n\r\n\t\tthis.gradient = this.getGradient();\r\n\t\tthis.length = this.getLength();\r\n\t\tthis.direction = Util.initValue(direction, '>');\r\n\t}\r\n\r\n\r\n\tgetPosition() {\r\n\t\tthis.random = Math.random();\r\n\t\tthis.vector.x = this.x1 + this.random * this.length * Math.cos(this.gradient);\r\n\t\tthis.vector.y = this.y1 + this.random * this.length * Math.sin(this.gradient);\r\n\r\n\t\treturn this.vector;\r\n\t}\r\n\r\n\tgetDirection(x, y) {\r\n\t\tconst A = this.dy;\r\n\t\tconst B = -this.dx;\r\n\t\tconst C = this.dot;\r\n\t\tconst D = B == 0 ? 1 : B;\r\n\r\n\t\tif ((A * x + B * y + C) * D > 0)\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\tgetDistance(x, y) {\r\n\t\tconst A = this.dy;\r\n\t\tconst B = -this.dx;\r\n\t\tconst C = this.dot;\r\n\t\tconst D = (A * x + B * y + C);\r\n\r\n\t\treturn D / Math.sqrt(this.xxyy);\r\n\t}\r\n\r\n\tgetSymmetric(v) {\r\n\t\tconst tha2 = v.getGradient();\r\n\t\tconst tha1 = this.getGradient();\r\n\t\tconst tha = 2 * (tha1 - tha2);\r\n\r\n\t\tconst oldx = v.x;\r\n\t\tconst oldy = v.y;\r\n\r\n\t\tv.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\r\n\t\tv.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\r\n\r\n\t\treturn v;\r\n\t}\r\n\r\n\tgetGradient() {\r\n\t\treturn Math.atan2(this.dy, this.dx);\r\n\t}\r\n\r\n\trangeOut(particle) {\r\n\t\tconst angle = Math.abs(this.getGradient());\r\n\r\n\t\tif (angle <= MathUtils.PI / 4) {\r\n\t\t\tif (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true;\r\n\t\t} else {\r\n\t\t\tif (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetLength() {\r\n\t\treturn Math.sqrt(this.dx * this.dx + this.dy * this.dy)\r\n\t}\r\n\r\n\tcrossing(particle) {\r\n\t\tif (this.crossType == \"dead\") {\r\n\t\t\tif (this.direction == \">\" || this.direction == \"R\" || this.direction == \"right\" || this.direction == \"down\") {\r\n\t\t\t\tif (!this.rangeOut(particle)) return;\r\n\t\t\t\tif (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\r\n\t\t\t} else {\r\n\t\t\t\tif (!this.rangeOut(particle)) return;\r\n\t\t\t\tif (!this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse if (this.crossType == \"bound\") {\r\n\t\t\tif (!this.rangeOut(particle)) return;\r\n\r\n\t\t\tif (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) {\r\n\t\t\t\tif (this.dx == 0) {\r\n\t\t\t\t\tparticle.v.x *= -1;\r\n\t\t\t\t} else if (this.dy == 0) {\r\n\t\t\t\t\tparticle.v.y *= -1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.getSymmetric(particle.v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse if (this.crossType == \"cross\") {\r\n\t\t\tif (this.alert) {\r\n\t\t\t\tconsole.error('Sorry lineZone does not support cross method');\r\n\t\t\t\tthis.alert = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}","import Zone from './Zone';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default class CircleZone extends Zone {\r\n\r\n constructor(x, y, radius) {\r\n super();\r\n\r\n this.x = x;\r\n this.y = y;\r\n this.radius = radius;\r\n\r\n this.angle = 0;\r\n this.center = { x, y };\r\n }\r\n\r\n getPosition() {\r\n this.random = Math.random();\r\n this.angle = MathUtils.PIx2 * Math.random();\r\n\r\n this.vector.x = this.x + this.random * this.radius * Math.cos(this.angle);\r\n this.vector.y = this.y + this.random * this.radius * Math.sin(this.angle);\r\n\r\n return this.vector;\r\n }\r\n\r\n setCenter(x, y) {\r\n this.center.x = x;\r\n this.center.y = y;\r\n }\r\n\r\n crossing(particle) {\r\n const d = particle.p.distanceTo(this.center);\r\n\r\n if (this.crossType == \"dead\") {\r\n if (d - particle.radius > this.radius)\r\n particle.dead = true;\r\n } else if (this.crossType == \"bound\") {\r\n if (d + particle.radius >= this.radius)\r\n this.getSymmetric(particle);\r\n } else if (this.crossType == \"cross\") {\r\n if (this.alert) {\r\n alert('Sorry CircleZone does not support cross method');\r\n this.alert = false;\r\n }\r\n }\r\n }\r\n\r\n getSymmetric(particle) {\r\n let tha2 = particle.v.getGradient();\r\n let tha1 = this.getGradient(particle);\r\n\r\n let tha = 2 * (tha1 - tha2);\r\n let oldx = particle.v.x;\r\n let oldy = particle.v.y;\r\n\r\n particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\r\n particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\r\n }\r\n\r\n getGradient(particle) {\r\n return -MathUtils.PI_2 + Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x);\r\n }\r\n}","import Zone from './Zone';\r\n\r\nexport default class RectZone extends Zone {\r\n\r\n\tconstructor(x, y, width, height) {\r\n\t\tsuper();\r\n\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t}\r\n\r\n\tgetPosition() {\r\n\t\tthis.vector.x = this.x + Math.random() * this.width;\r\n\t\tthis.vector.y = this.y + Math.random() * this.height;\r\n\r\n\t\treturn this.vector;\r\n\t}\r\n\r\n\tcrossing(particle) {\r\n\t\tif (this.crossType == \"dead\") {\r\n\t\t\tif (particle.p.x + particle.radius < this.x)\r\n\t\t\t\tparticle.dead = true;\r\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width)\r\n\t\t\t\tparticle.dead = true;\r\n\r\n\t\t\tif (particle.p.y + particle.radius < this.y)\r\n\t\t\t\tparticle.dead = true;\r\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height)\r\n\t\t\t\tparticle.dead = true;\r\n\t\t}\r\n\r\n\t\telse if (this.crossType == \"bound\") {\r\n\t\t\tif (particle.p.x - particle.radius < this.x) {\r\n\t\t\t\tparticle.p.x = this.x + particle.radius;\r\n\t\t\t\tparticle.v.x *= -1;\r\n\t\t\t} else if (particle.p.x + particle.radius > this.x + this.width) {\r\n\t\t\t\tparticle.p.x = this.x + this.width - particle.radius;\r\n\t\t\t\tparticle.v.x *= -1;\r\n\t\t\t}\r\n\r\n\t\t\tif (particle.p.y - particle.radius < this.y) {\r\n\t\t\t\tparticle.p.y = this.y + particle.radius;\r\n\t\t\t\tparticle.v.y *= -1;\r\n\t\t\t} else if (particle.p.y + particle.radius > this.y + this.height) {\r\n\t\t\t\tparticle.p.y = this.y + this.height - particle.radius;\r\n\t\t\t\tparticle.v.y *= -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse if (this.crossType == \"cross\") {\r\n\t\t\tif (particle.p.x + particle.radius < this.x && particle.v.x <= 0)\r\n\t\t\t\tparticle.p.x = this.x + this.width + particle.radius;\r\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width && particle.v.x >= 0)\r\n\t\t\t\tparticle.p.x = this.x - particle.radius;\r\n\r\n\t\t\tif (particle.p.y + particle.radius < this.y && particle.v.y <= 0)\r\n\t\t\t\tparticle.p.y = this.y + this.height + particle.radius;\r\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height && particle.v.y >= 0)\r\n\t\t\t\tparticle.p.y = this.y - particle.radius;\r\n\t\t}\r\n\t}\r\n}","import Zone from './Zone';\r\nimport Util from '../utils/Util';\r\n\r\nexport default class ImageZone extends Zone {\r\n\r\n\tconstructor(imageData, x, y, d) {\r\n\t\tsuper();\r\n\r\n\t\tthis.reset(imageData, x, y, d);\r\n\t}\r\n\r\n\treset(imageData, x, y, d) {\r\n\t\tthis.imageData = imageData;\r\n\t\tthis.x = Util.initValue(x, 0);\r\n\t\tthis.y = Util.initValue(y, 0);\r\n\t\tthis.d = Util.initValue(d, 2);\r\n\r\n\t\tthis.vectors = [];\r\n\t\tthis.setVectors();\r\n\t}\r\n\r\n\tsetVectors() {\r\n\t\tlet i, j;\r\n\t\tconst length1 = this.imageData.width;\r\n\t\tconst length2 = this.imageData.height;\r\n\r\n\t\tfor (i = 0; i < length1; i += this.d) {\r\n\t\t\tfor (j = 0; j < length2; j += this.d) {\r\n\t\t\t\tlet index = ((j >> 0) * length1 + (i >> 0)) * 4;\r\n\r\n\t\t\t\tif (this.imageData.data[index + 3] > 0) {\r\n\t\t\t\t\tthis.vectors.push({ x: i + this.x, y: j + this.y });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.vector;\r\n\t}\r\n\r\n\tgetBound(x, y) {\r\n\t\tvar index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\r\n\t\tif (this.imageData.data[index + 3] > 0)\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\tgetPosition() {\r\n\t\treturn this.vector.copy(this.vectors[Math.floor(Math.random() * this.vectors.length)]);\r\n\t}\r\n\r\n\tgetColor(x, y) {\r\n\t\tx -= this.x;\r\n\t\ty -= this.y;\r\n\t\tvar i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\r\n\r\n\t\treturn {\r\n\t\t\tr: this.imageData.data[i],\r\n\t\t\tg: this.imageData.data[i + 1],\r\n\t\t\tb: this.imageData.data[i + 2],\r\n\t\t\ta: this.imageData.data[i + 3]\r\n\t\t};\r\n\t}\r\n\r\n\tcrossing(particle) {\r\n\t\tif (this.crossType == \"dead\") {\r\n\t\t\tif (this.getBound(particle.p.x - this.x, particle.p.y - this.y))\r\n\t\t\t\tparticle.dead = true;\r\n\t\t\telse\r\n\t\t\t\tparticle.dead = false;\r\n\t\t} \r\n\t\t\r\n\t\telse if (this.crossType == \"bound\") {\r\n\t\t\tif (!this.getBound(particle.p.x - this.x, particle.p.y - this.y))\r\n\t\t\t\tparticle.v.negate();\r\n\t\t}\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport ColorUtil from '../utils/ColorUtil';\r\nimport MathUtils from '../math/MathUtils';\r\nimport CircleZone from '../zone/CircleZone';\r\nimport PointZone from '../zone/PointZone';\r\nimport LineZone from '../zone/LineZone';\r\nimport RectZone from '../zone/RectZone';\r\n\r\nexport default {\r\n\taddEventListener(proton, fun) {\r\n\t\tproton.addEventListener(\"PROTON_UPDATE_AFTER\", () => fun());\r\n\t},\r\n\r\n\tgetStyle(color) {\r\n\t\tconst rgb = ColorUtil.hexToRGB(color || '#ff0000');\r\n\t\treturn `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`;\r\n\t},\r\n\t\r\n\tdrawZone(proton, canvas, zone, clear) {\r\n\t\tconst context = canvas.getContext('2d');\r\n\t\tconst style = this.getStyle();\r\n\r\n\t\tthis.addEventListener(proton, () => {\r\n\t\t\tif (clear)\r\n\t\t\t\tcontext.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n\t\t\tif (zone instanceof PointZone) {\r\n\t\t\t\tcontext.beginPath();\r\n\t\t\t\tcontext.fillStyle = style;\r\n\t\t\t\tcontext.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true);\r\n\t\t\t\tcontext.fill();\r\n\t\t\t\tcontext.closePath();\r\n\t\t\t} else if (zone instanceof LineZone) {\r\n\t\t\t\tcontext.beginPath();\r\n\t\t\t\tcontext.strokeStyle = style;\r\n\t\t\t\tcontext.moveTo(zone.x1, zone.y1);\r\n\t\t\t\tcontext.lineTo(zone.x2, zone.y2);\r\n\t\t\t\tcontext.stroke();\r\n\t\t\t\tcontext.closePath();\r\n\t\t\t} else if (zone instanceof RectZone) {\r\n\t\t\t\tcontext.beginPath();\r\n\t\t\t\tcontext.strokeStyle = style;\r\n\t\t\t\tcontext.drawRect(zone.x, zone.y, zone.width, zone.height);\r\n\t\t\t\tcontext.stroke();\r\n\t\t\t\tcontext.closePath();\r\n\t\t\t} else if (zone instanceof CircleZone) {\r\n\t\t\t\tcontext.beginPath();\r\n\t\t\t\tcontext.strokeStyle = style;\r\n\t\t\t\tcontext.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true);\r\n\t\t\t\tcontext.stroke();\r\n\t\t\t\tcontext.closePath();\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\t\r\n\tdrawEmitter(proton, canvas, emitter, clear) {\r\n\t\tconst context = canvas.getContext('2d');\r\n\t\tconst style = this.getStyle();\r\n\r\n\t\tthis.addEventListener(proton, () => {\r\n\t\t\tif (clear) context.clearRect(0, 0, canvas.width, canvas.height);\r\n\t\t\t\r\n\t\t\tcontext.beginPath();\r\n\t\t\tcontext.fillStyle = style;\r\n\t\t\tcontext.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true);\r\n\t\t\tcontext.fill();\r\n\t\t\tcontext.closePath();\r\n\t\t});\r\n\t},\r\n}\r\n\r\n","// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\r\n// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating\r\n\r\n// requestAnimationFrame polyfill by Erik Möller\r\n// fixes from Paul Irish and Tino Zijdel\r\n( function() {\r\n\t\tvar lastTime = 0;\r\n\t\tvar vendors = ['ms', 'moz', 'webkit', 'o'];\r\n\t\tfor (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {\r\n\t\t\twindow.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];\r\n\t\t\twindow.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];\r\n\t\t}\r\n\r\n\t\tif (!window.requestAnimationFrame)\r\n\t\t\twindow.requestAnimationFrame = function(callback, element) {\r\n\t\t\t\tvar currTime = new Date().getTime();\r\n\t\t\t\tvar timeToCall = Math.max(0, 16 - (currTime - lastTime));\r\n\t\t\t\tvar id = window.setTimeout(function() {\r\n\t\t\t\t\tcallback(currTime + timeToCall);\r\n\t\t\t\t}, timeToCall);\r\n\t\t\t\tlastTime = currTime + timeToCall;\r\n\t\t\t\treturn id;\r\n\t\t\t};\r\n\r\n\t\tif (!window.cancelAnimationFrame)\r\n\t\t\twindow.cancelAnimationFrame = function(id) {\r\n\t\t\t\tclearTimeout(id);\r\n\t\t\t};\r\n\t}()); ","// import \r\nimport Proton from \"./core/Proton\";\r\nimport Particle from \"./core/Particle\";\r\nimport Pool from \"./core/Pool\";\r\n\r\nimport Util from \"./utils/Util\";\r\nimport ColorUtil from \"./utils/ColorUtil\";\r\nimport MathUtils from \"./math/MathUtils\";\r\nimport Vector2D from \"./math/Vector2D\";\r\nimport Polar2D from \"./math/Polar2D\";\r\nimport Mat3 from \"./math/Mat3\";\r\nimport Span from \"./math/Span\";\r\nimport ArraySpan from \"./math/ArraySpan\";\r\nimport Rectangle from \"./math/Rectangle\";\r\nimport ease from \"./math/ease\";\r\n\r\nimport Rate from \"./initialize/Rate\";\r\nimport Initialize from \"./initialize/Initialize\";\r\nimport Life from \"./initialize/Life\";\r\nimport Position from \"./initialize/Position\";\r\nimport Velocity from \"./initialize/Velocity\";\r\nimport Mass from \"./initialize/Mass\";\r\nimport Radius from \"./initialize/Radius\";\r\nimport Body from \"./initialize/Body\";\r\n\r\nimport Behaviour from \"./behaviour/Behaviour\";\r\nimport Force from \"./behaviour/Force\";\r\nimport Attraction from \"./behaviour/Attraction\";\r\nimport RandomDrift from \"./behaviour/RandomDrift\";\r\nimport Gravity from \"./behaviour/Gravity\";\r\nimport Collision from \"./behaviour/Collision\";\r\nimport CrossZone from \"./behaviour/CrossZone\";\r\nimport Alpha from \"./behaviour/Alpha\";\r\nimport Scale from \"./behaviour/Scale\";\r\nimport Rotate from \"./behaviour/Rotate\";\r\nimport Color from \"./behaviour/Color\";\r\nimport Repulsion from \"./behaviour/Repulsion\";\r\nimport GravityWell from \"./behaviour/GravityWell\";\r\n\r\nimport Emitter from \"./emitter/Emitter\";\r\nimport BehaviourEmitter from \"./emitter/BehaviourEmitter\";\r\nimport FollowEmitter from \"./emitter/FollowEmitter\";\r\n\r\nimport CanvasRenderer from \"./render/CanvasRenderer\";\r\nimport DomRenderer from \"./render/DomRenderer\";\r\nimport EaselRenderer from \"./render/EaselRenderer\";\r\nimport PixelRenderer from \"./render/PixelRenderer\";\r\nimport PixiRenderer from \"./render/PixiRenderer\";\r\nimport WebGLRenderer from \"./render/WebGLRenderer\";\r\nimport CustomRenderer from \"./render/CustomRenderer\";\r\n\r\nimport Zone from \"./zone/Zone\";\r\nimport LineZone from \"./zone/LineZone\";\r\nimport CircleZone from \"./zone/CircleZone\";\r\nimport PointZone from \"./zone/PointZone\";\r\nimport RectZone from \"./zone/RectZone\";\r\nimport ImageZone from \"./zone/ImageZone\";\r\n\r\nimport Debug from \"./debug/Debug\";\r\nimport \"./polyfill/requestAnimationFrame\";\r\n\r\n// namespace\r\nProton.Particle = Proton.P = Particle;\r\nProton.Pool = Pool;\r\n\r\nProton.Util = Util;\r\nProton.ColorUtil = ColorUtil;\r\nProton.MathUtils = MathUtils;\r\nProton.Vector2D = Proton.Vector = Vector2D;\r\nProton.Polar2D = Proton.Polar = Polar2D;\r\nProton.ArraySpan = ArraySpan;\r\nProton.Rectangle = Rectangle;\r\nProton.Rate = Rate;\r\nProton.ease = ease;\r\nProton.Span = Span;\r\nProton.Mat3 = Mat3;\r\nProton.getSpan = (a, b, center) => new Span(a, b, center);\r\nProton.createArraySpan = ArraySpan.createArraySpan;\r\n\r\nProton.Initialize = Proton.Init = Initialize;\r\nProton.Life = Proton.L = Life;\r\nProton.Position = Proton.P = Position;\r\nProton.Velocity = Proton.V = Velocity;\r\nProton.Mass = Proton.M = Mass;\r\nProton.Radius = Proton.R = Radius;\r\nProton.Body = Proton.B = Body;\r\n\r\nProton.Behaviour = Behaviour;\r\nProton.Force = Proton.F = Force;\r\nProton.Attraction = Proton.A = Attraction;\r\nProton.RandomDrift = Proton.RD = RandomDrift;\r\nProton.Gravity = Proton.G = Gravity;\r\nProton.Collision = Collision;\r\nProton.CrossZone = CrossZone;\r\nProton.Alpha = Proton.A = Alpha;\r\nProton.Scale = Proton.S = Scale;\r\nProton.Rotate = Rotate;\r\nProton.Color = Color;\r\nProton.Repulsion = Repulsion;\r\nProton.GravityWell = GravityWell;\r\n\r\nProton.Emitter = Emitter;\r\nProton.BehaviourEmitter = BehaviourEmitter;\r\nProton.FollowEmitter = FollowEmitter;\r\n\r\nProton.Zone = Zone;\r\nProton.LineZone = LineZone;\r\nProton.CircleZone = CircleZone;\r\nProton.PointZone = PointZone;\r\nProton.RectZone = RectZone;\r\nProton.ImageZone = ImageZone;\r\n\r\nProton.CanvasRenderer = CanvasRenderer;\r\nProton.DomRenderer = DomRenderer;\r\nProton.EaselRenderer = EaselRenderer;\r\nProton.PixiRenderer = PixiRenderer;\r\nProton.PixelRenderer = PixelRenderer;\r\nProton.WebGLRenderer = Proton.WebGlRenderer = WebGLRenderer;\r\nProton.CustomRenderer = CustomRenderer;\r\n\r\nProton.Debug = Debug;\r\n\r\nObject.assign(Proton, ease);\r\n\r\n// export\r\nexport default Proton;"],"names":["PI","MathUtils","a","b","INT","Math","random","floor","center","f","randomAToB","display","num","toString","slice","Vector2D","x","y","atan2","PI_2","v","w","undefined","addVectors","subVectors","s","set","multiplyScalar","sqrt","divideScalar","length","distanceToSquared","tha","cos","sin","dx","dy","alpha","Span","isArray","Util","initValue","randomFloating","i","tx","ty","angleInRadians","c","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","scale","rotate","willChange","css3","key","val","bkey","charAt","toUpperCase","substr","IMG_CACHE","CANVAS_CACHE","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","array","obj","ignore","o","indexOf","constructor","args","concat","factoryFunction","bind","apply","pOBJ","hasProp","p","particle","copy","prototypeObject","filters","singleProp","hasOwnProperty","getSpanValue","pan","getValue","ImgUtil","arr","destroy","uid","getCacheID","cache","isInner","Pool","total","params","__puid","PUID","getID","pop","createOrClone","getCache","push","create","classApply","clone","count","Stats","proton","container","type","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","TargetClass","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","sleep","old","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","getAllParticles","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","pow","ease","easeLinear","Particle","ID","reset","setPrototypeByObject","N180_PI","life","Infinity","age","energy","dead","sprite","radius","rotation","easing","destroyObject","removeAllBehaviours","rgb","r","g","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","destroyArray","h","hex16","substring","parseInt","rbg","Number","Polar2D","abs","getX","getY","mat3","mat","Float32Array","mat1","mat2","d","m","vec","ArraySpan","_arr","randomColor","Rectangle","bottom","right","Rate","numpan","timepan","numPan","setSpanValue","timePan","startTime","nextTime","Initialize","Life","lifePan","Zone","vector","crossType","alert","PointZone","Position","zone","getPosition","Velocity","rpan","thapan","rPan","thaPan","vr","polar2d","normalizeVelocity","PI_180","Mass","massPan","Radius","oldRadius","Body","imagetarget","inner","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","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVector2DByObject","degreeTransform","Emitter","pObj","emitTime","totalTime","rate","stoped","isNaN","oldStoped","oldEmitTime","oldTotalTime","step","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","slow","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mouseTarget","window","_allowEmitting","initEventHandler","mousemoveHandler","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","layerX","layerY","offsetX","offsetY","babelHelpers.get","BaseRenderer","element","stroke","initHandler","circleConf","isCircle","thinkness","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","CanvasRenderer","bufferCache","getImgFromCache","addImg2Body","drawCircle","buffer","createBuffer","bufferContext","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","String","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","data","PixiRenderer","setColor","tint","getHex16FromParticle","PIXI","Sprite","fromImage","anchor","endFill","MStack","mats","Mat3","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","gradient","getGradient","getLength","C","D","tha2","tha1","oldx","oldy","angle","rangeOut","getDistance","getSymmetric","error","CircleZone","PIx2","distanceTo","RectZone","ImageZone","vectors","setVectors","j","length1","length2","getBound","negate","fun","getStyle","moveTo","lineTo","drawRect","lastTime","vendors","requestAnimationFrame","cancelAnimationFrame","currTime","timeToCall","setTimeout","P","Vector","Polar","getSpan","Init","L","V","M","R","F","RD","G","S","WebGlRenderer","Debug","assign"],"mappings":";;;;;;AAAA,I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,OAAO0V,CAAP,GAAWhM,KAA1B;AACA1J,OAAO8J,KAAP,GAAe9J,OAAO2f,CAAP,GAAW7V,KAA1B;AACA9J,OAAOiK,MAAP,GAAgBA,MAAhB;AACAjK,OAAOsK,KAAP,GAAeA,KAAf;AACAtK,OAAO4K,SAAP,GAAmBA,SAAnB;AACA5K,OAAO6K,WAAP,GAAqBA,WAArB;;AAEA7K,OAAOqL,OAAP,GAAiBA,OAAjB;AACArL,OAAOkN,gBAAP,GAA0BA,gBAA1B;AACAlN,OAAOoN,aAAP,GAAuBA,aAAvB;;AAEApN,OAAO8F,IAAP,GAAcA,IAAd;AACA9F,OAAO4b,QAAP,GAAkBA,QAAlB;AACA5b,OAAOud,UAAP,GAAoBA,UAApB;AACAvd,OAAOkG,SAAP,GAAmBA,SAAnB;AACAlG,OAAO0d,QAAP,GAAkBA,QAAlB;AACA1d,OAAO2d,SAAP,GAAmBA,SAAnB;;AAEA3d,OAAOyP,cAAP,GAAwBA,cAAxB;AACAzP,OAAOgR,WAAP,GAAqBA,WAArB;AACAhR,OAAO+R,aAAP,GAAuBA,aAAvB;AACA/R,OAAOqT,YAAP,GAAsBA,YAAtB;AACArT,OAAO6S,aAAP,GAAuBA,aAAvB;AACA7S,OAAOkU,aAAP,GAAuBlU,OAAO4f,aAAP,GAAuB1L,aAA9C;AACAlU,OAAO2b,cAAP,GAAwBA,cAAxB;;AAEA3b,OAAO6f,KAAP,GAAeA,KAAf;;AAEAnmB,OAAOomB,MAAP,CAAc9f,MAAd,EAAsB8B,IAAtB;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"proton.js","sources":["../src/math/MathUtils.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/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/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/polyfill/requestAnimationFrame.js","../src/index.js"],"sourcesContent":["const PI = 3.1415926;\n\nconst MathUtils = {\n\n PI: PI,\n PIx2: PI * 2,\n PI_2: PI / 2,\n PI_180: PI / 180,\n N180_PI: 180 / PI,\n\n randomAToB(a, b, INT) {\n if (!INT)\n return a + Math.random() * (b - a);\n else\n return Math.floor(Math.random() * (b - a)) + a;\n },\n\n randomFloating(center, f, INT) {\n return this.randomAToB(center - f, center + f, INT);\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 '#' + ('00000' + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6);\n }\n}\n\nexport default MathUtils;","import Util from '../utils/Util';\nimport MathUtils from '../math/MathUtils';\n\nexport default class Span {\n\n\tconstructor(a, b, center) {\n\t\tthis.isArray = false;\n\n\t\tif (Util.isArray(a)) {\n\t\t\tthis.isArray = true;\n\t\t\tthis.a = a;\n\t\t} else {\n\t\t\tthis.a = Util.initValue(a, 1);\n\t\t\tthis.b = Util.initValue(b, this.a);\n\t\t\tthis.center = Util.initValue(center, false);\n\t\t}\n\n\t}\n\n\tgetValue(INT) {\n\t\tif (this.isArray) {\n\t\t\treturn this.a[Math.floor(this.a.length * Math.random())];\n\t\t} else {\n\t\t\tif (!this.center)\n\t\t\t\treturn MathUtils.randomAToB(this.a, this.b, INT);\n\t\t\telse\n\t\t\t\treturn MathUtils.randomFloating(this.a, this.b, INT);\n\t\t}\n\t}\n}","export default {\n\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}","export default {\n\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) {\n const dom = document.createElement('canvas');\n position = position || 'absolute';\n\n dom.id = id;\n dom.width = width;\n dom.height = height;\n dom.style.opacity = 0;\n dom.style.position = position;\n\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 const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`;\n\n div.style.willChange = 'transform';\n this.css3(div, 'transform', transform);\n },\n\n transform3d(div, x, y, scale, rotate) {\n const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;\n\n div.style.willChange = 'transform';\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}","import WebGLUtil from './WebGLUtil';\nimport DomUtil from './DomUtil';\n\nconst IMG_CACHE = {};\nconst CANVAS_CACHE = {};\nlet canvasID = 0;\n\nexport default {\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 context.drawImage(image, rect.x, rect.y);\n const imagedata = context.getImageData(rect.x, rect.y, rect.width, rect.height);\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.transform.canvas\n * @param {Boolean} func\n */\n getImgFromCache(img, callback, param) {\n const src = typeof (img) === 'string' ? img : img.src;\n\n if (IMG_CACHE[src]) {\n callback(IMG_CACHE[src], param);\n } else {\n const image = new Image();\n image.onload = e => {\n IMG_CACHE[src] = e.target;\n callback(IMG_CACHE[src], param);\n }\n\n image.src = src;\n }\n },\n\n getCanvasFromCache(img, callback, param) {\n const src = img.src;\n\n if (!CANVAS_CACHE[src]) {\n const width = WebGLUtil.nhpot(img.width);\n const height = WebGLUtil.nhpot(img.height);\n\n const canvas = DomUtil.createCanvas(`canvas_cache_${canvasID}`, width, height);\n const context = canvas.getContext('2d');\n context.drawImage(img, 0, 0, img.width, img.height);\n\n CANVAS_CACHE[src] = canvas;\n }\n\n callback && callback(CANVAS_CACHE[src], param);\n\n return CANVAS_CACHE[src];\n }\n}","import Span from '../math/Span';\nimport ImgUtil from './ImgUtil';\n\nexport default {\n\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 destroyArray\n *\n * @param {Array} array Any array\n */\n destroyArray(array) {\n if (array) array.length = 0;\n },\n\n /**\n * Destroyes the given object\n *\n * @memberof Proton#Proton.Util\n * @method destroyObject\n *\n * @param {Object} obj Any object\n */\n destroyObject(obj, ignore) {\n for (let o in obj) {\n if (ignore && ignore.indexOf(o) > -1) continue;\n delete obj[o];\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) {\n if (!args) return new constructor;\n\n args = [null].concat(args);\n const FactoryFunc = constructor.bind.apply(constructor, args);\n return new FactoryFunc();\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method setVector2DByObject\n *\n * @todo add description for param `target`\n * @todo add description for param `pOBJ`\n * @todo add description for function\n *\n * @param {Object} target\n * @param {Object} pOBJ\n */\n setVector2DByObject(target, pOBJ) {\n if (this.hasProp(pOBJ, 'x')) target.p.x = pOBJ['x'];\n if (this.hasProp(pOBJ, 'y')) target.p.y = pOBJ['y'];\n\n if (this.hasProp(pOBJ, 'vx')) target.v.x = pOBJ['vx'];\n if (this.hasProp(pOBJ, 'vy')) target.v.y = pOBJ['vy'];\n\n if (this.hasProp(pOBJ, 'ax')) target.a.x = pOBJ['ax'];\n if (this.hasProp(pOBJ, 'ay')) target.a.y = pOBJ['ay'];\n\n if (this.hasProp(pOBJ, 'p')) target.p.copy(pOBJ['p']);\n if (this.hasProp(pOBJ, 'v')) target.v.copy(pOBJ['v']);\n if (this.hasProp(pOBJ, 'a')) target.a.copy(pOBJ['a']);\n\n if (this.hasProp(pOBJ, 'position')) target.p.copy(pOBJ['position']);\n if (this.hasProp(pOBJ, 'velocity')) target.v.copy(pOBJ['velocity']);\n if (this.hasProp(pOBJ, 'accelerate')) target.a.copy(pOBJ['accelerate']);\n },\n\n hasProp(obj, key) {\n if (!obj) return false;\n return obj[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 setPrototypeByObject\n *\n * @todo add description for param `target`\n * @todo add description for param `filters`\n * @todo translate desription from chinese to english\n *\n * @param {Object} target\n * @param {Object} prototypeObject An object of single prototypes\n * @param {Object} filters\n *\n * @return {Object} target\n */\n setPrototypeByObject(target, prototypeObject, filters) {\n for (let singleProp in prototypeObject) {\n if (target.hasOwnProperty(singleProp)) {\n if (filters) {\n if (filters.indexOf(singleProp) < 0)\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\n } else {\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\n }\n }\n }\n\n return target;\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 setSpanValue(a, b, c) {\n if (a instanceof Span) {\n return a;\n } else {\n if (!b) {\n return new Span(a);\n } else {\n if (!c)\n return new Span(a, b);\n else\n 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 getSpanValue\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 getSpanValue(pan) {\n return pan instanceof Span ? pan.getValue() : pan;\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 destroy(arr, param) {\n let i = arr.length;\n\n while (i--) {\n try { arr[i].destroy(param); } catch (e) { }\n delete arr[i];\n }\n\n arr.length = 0;\n }\n\n}","export default {\n id: 0,\n cache: {},\n\n getID(target) {\n let uid = this.getCacheID(target);\n if (uid) return uid;\n\n uid = `PUID_${this.id++}`;\n this.cache[uid] = target;\n\n return uid;\n },\n\n getCacheID(target) {\n let obj;\n for (let id in this.cache) {\n obj = this.cache[id];\n\n if (obj === target) return id;\n if (typeof obj === 'object' && typeof target === 'object' && obj.isInner && target.isInner) {\n if (obj.src === target.src)\n return id;\n }\n }\n\n return null;\n },\n\n getTarget(uid) {\n return this.cache[uid];\n }\n}","/**\n * get -> PUID :: uid-> Body\n * -> cache[abc]. -> cache[abc] .pop()\n * -> create [new Body| clone]\n * -> return p1: { __pid: abc }\n *\n * expire -> cache[abc]= [p0, p1];\n *\n */\nimport Util from '../utils/Util';\nimport PUID from '../utils/PUID';\n\nexport default class Pool {\n\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 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\n for (let id in this.cache)\n count += this.cache[id].length;\n\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) {\n uid = uid || 'default';\n\n if (!this.cache[uid]) this.cache[uid] = [];\n return this.cache[uid];\n }\n}","export default class Stats {\n\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) str += 'initializes:' + emitter.initializes.length + '
';\n if (emitter) str += '' + this.concatArr(emitter.initializes) + '
';\n if (emitter) str += 'behaviours:' + emitter.behaviours.length + '
';\n if (emitter) str += '' + this.concatArr(emitter.behaviours) + '
';\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('click', e => {\n this.type++;\n if (this.type > 4) this.type = 1;\n }, false);\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 * EventDispatcher\n * This code reference since http://createjs.com/.\n *\n **/\n\nexport default class EventDispatcher {\n\n constructor() {\n this._listeners = null;\n }\n\n static bind(TargetClass) {\n TargetClass.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent;\n TargetClass.prototype.hasEventListener = EventDispatcher.prototype.hasEventListener;\n TargetClass.prototype.addEventListener = EventDispatcher.prototype.addEventListener;\n TargetClass.prototype.removeEventListener = EventDispatcher.prototype.removeEventListener;\n TargetClass.prototype.removeAllEventListeners = 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)\n this._listeners = null;\n else if (this._listeners)\n 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\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\n\tconstructor(type) {\n\t\tthis.type = type;\n\t}\n\n\tcalculate(particles, time, damping) {\n\t\tthis.eulerIntegrate(particles, time, damping);\n\t}\n\n\t// Euler Integrate\n\teulerIntegrate(particle, time, damping) {\n\t\tif (!particle.sleep) {\n\t\t\tparticle.old.p.copy(particle.p);\n\t\t\tparticle.old.v.copy(particle.v);\n\n\t\t\tparticle.a.multiplyScalar(1 / particle.mass);\n\t\t\tparticle.v.add(particle.a.multiplyScalar(time));\n\t\t\tparticle.p.add(particle.old.v.multiplyScalar(time));\n\n\t\t\tif (damping) particle.v.multiplyScalar(damping);\n\n\t\t\tparticle.a.clear();\n\t\t}\n\t}\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\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\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 /**\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() {\n Util.destroy(this.renderers, this.getAllParticles());\n Util.destroy(this.emitters);\n\n this.time = 0;\n this.oldTime = 0;\n\n this.pool.destroy();\n }\n}\n\nEventDispatcher.bind(Proton);","import MathUtils from './MathUtils';\n\nexport default {\n\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)\n 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)\n 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)\n 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 * (MathUtils.PI_2)) + 1;\n },\n\n easeOutSine(value) {\n return Math.sin(value * (MathUtils.PI_2));\n },\n\n easeInOutSine(value) {\n return (-0.5 * (Math.cos(MathUtils.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)\n return 0;\n\n if (value === 1)\n return 1;\n\n if ((value /= 0.5) < 1)\n 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)\n 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')\n return ease;\n else\n return this[ease] || this.easeLinear;\n }\n};","import MathUtils from '../math/MathUtils';\n\nexport default class Vector2D {\n\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)\n return Math.atan2(this.y, this.x);\n else if (this.y > 0)\n return MathUtils.PI_2;\n else if (this.y < 0)\n return -MathUtils.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}","import Util from '../utils/Util';\nimport ease from '../math/ease';\nimport Vector2D from '../math/Vector2D';\nimport MathUtils from '../math/MathUtils';\n\nexport default class Particle {\n\n static ID = 0;\n\n /**\n * the Particle class\n *\n * @class Proton.Particle\n * @constructor\n * @param {Object} pObj the parameters object;\n * for example {life:3,dead:false}\n */\n constructor(pOBJ) {\n /**\n * The particle's id;\n * @property id\n * @type {string}\n */\n this.id = `particle_${Particle.ID++}`;\n this.reset('init');\n\n pOBJ && Util.setPrototypeByObject(this, pOBJ);\n }\n\n getDirection() {\n return Math.atan2(this.v.x, -this.v.y) * MathUtils.N180_PI;\n }\n\n reset(init) {\n this.life = Infinity;\n this.age = 0;\n\n // Energy loss\n this.energy = 1;\n this.dead = false;\n this.sleep = false;\n this.body = null;\n this.sprite = null;\n this.parent = null;\n\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.easing = ease.easeLinear;\n\n if (init === 'init') {\n this.transform = {};\n this.p = new Vector2D();\n this.v = new Vector2D();\n this.a = new Vector2D();\n\n this.old = {\n p: new Vector2D(),\n v: new Vector2D(),\n a: new Vector2D()\n };\n\n this.behaviours = [];\n } else {\n Util.destroyObject(this.transform, 'rgb');\n\n this.p.set(0, 0);\n this.v.set(0, 0);\n this.a.set(0, 0);\n\n this.old.p.set(0, 0);\n this.old.v.set(0, 0);\n this.old.a.set(0, 0);\n\n this.removeAllBehaviours();\n }\n\n if (!this.transform.rgb) {\n this.transform.rgb = { r: 255, g: 255, b: 255 };\n } else {\n this.transform.rgb.r = 255;\n this.transform.rgb.g = 255;\n this.transform.rgb.b = 255;\n }\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] && 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.destroyArray(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 /**\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.transform.rgb.r) * 65536 + Number(p.transform.rgb.g) * 256 + Number(p.transform.rgb.b);\n }\n}","import Vector2D from './Vector2D';\n\nexport default class Polar2D {\n\n\tconstructor(r, tha) {\n\t\tthis.r = Math.abs(r) || 0;\n\t\tthis.tha = tha || 0;\n\t}\n\n\tset(r, tha) {\n\t\tthis.r = r;\n\t\tthis.tha = tha;\n\t\treturn this;\n\t}\n\n\tsetR(r) {\n\t\tthis.r = r;\n\t\treturn this;\n\t}\n\n\tsetTha(tha) {\n\t\tthis.tha = tha;\n\t\treturn this;\n\t}\n\n\tcopy(p) {\n\t\tthis.r = p.r;\n\t\tthis.tha = p.tha;\n\t\treturn this;\n\t}\n\n\ttoVector() {\n\t\treturn new Vector2D(this.getX(), this.getY());\n\t}\n\n\tgetX() {\n\t\treturn this.r * Math.sin(this.tha);\n\t}\n\n\tgetY() {\n\t\treturn -this.r * Math.cos(this.tha);\n\t}\n\n\tnormalize() {\n\t\tthis.r = 1;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn ((v.r === this.r) && (v.tha === this.tha));\n\t}\n\n\tclear() {\n\t\tthis.r = 0.0;\n\t\tthis.tha = 0.0;\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new Polar2D(this.r, this.tha);\n\t}\n}","export default {\n\tcreate(mat3) {\n\t\tconst mat = new Float32Array(9);\n\t\tif (mat3) this.set(mat3, mat);\n\n\t\treturn mat;\n\t},\n\n\tset(mat1, mat2) {\n\t\tfor (let i = 0; i < 9; i++)\n\t\t\tmat2[i] = mat1[i];\n\n\t\treturn mat2;\n\t},\n\n\tmultiply(mat, mat2, mat3) {\n\t\tlet a00 = mat[0], a01 = mat[1], a02 = mat[2], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b00 = mat2[0], b01 = mat2[1], b02 = mat2[2], b10 = mat2[3], b11 = mat2[4], b20 = mat2[6], b21 = mat2[7];\n\n\t\tmat3[0] = b00 * a00 + b01 * a10;\n\t\tmat3[1] = b00 * a01 + b01 * a11;\n\t\tmat3[2] = a02 * b02;\n\t\tmat3[3] = b10 * a00 + b11 * a10;\n\t\tmat3[4] = b10 * a01 + b11 * a11;\n\t\tmat3[6] = b20 * a00 + b21 * a10 + a20;\n\t\tmat3[7] = b20 * a01 + b21 * a11 + a21;\n\n\t\treturn mat3;\n\t},\n\n\tinverse(mat, mat3) {\n\t\tlet a00 = mat[0], a01 = mat[1], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b01 = a11, b11 = -a10, b21 = a21 * a10 - a11 * a20, d = a00 * b01 + a01 * b11, id;\n\n\t\tid = 1 / d;\n\t\tmat3[0] = b01 * id;\n\t\tmat3[1] = (-a01) * id;\n\t\tmat3[3] = b11 * id;\n\t\tmat3[4] = a00 * id;\n\t\tmat3[6] = b21 * id;\n\t\tmat3[7] = (-a21 * a00 + a01 * a20) * id;\n\n\t\treturn mat3;\n\t},\n\n\tmultiplyVec2(m, vec, mat3) {\n\t\tlet x = vec[0], y = vec[1];\n\n\t\tmat3[0] = x * m[0] + y * m[3] + m[6];\n\t\tmat3[1] = x * m[1] + y * m[4] + m[7];\n\n\t\treturn mat3;\n\t}\n}","import Span from './Span';\nimport Util from '../utils/Util';\nimport MathUtils from './MathUtils';\n\nexport default class ArraySpan extends Span {\n\n constructor(color) {\n super();\n this._arr = Util.isArray(color) ? color : [color];\n }\n\n getValue() {\n const color = this._arr[Math.floor(this._arr.length * Math.random())];\n return color === 'random' || color === 'Random' ? MathUtils.randomColor() : color;\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)\n return arr;\n else\n return new ArraySpan(arr);\n }\n\n}","export default class Rectangle {\n\n\tconstructor(x, y, w, h) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\tthis.width = w;\n\t\tthis.height = h;\n\n\t\tthis.bottom = this.y + this.height;\n\t\tthis.right = this.x + this.width;\n\t}\n\n\tcontains(x, y) {\n\t\tif (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n}\n","import Util from '../utils/Util';\n\nexport default class Rate {\n\n\t/**\n\t * The number of particles per second emission (a [particle]/b [s]);\n\t * @namespace\n\t * @memberof! Proton#\n\t * @constructor\n\t * @alias Rate\n\t *\n\t * @param {Array | Number | Span} numpan the number of each emission;\n\t * @param {Array | Number | Span} timepan the time of each emission;\n\t * for example: new Rate(new Span(10, 20), new Span(.1, .25));\n\t */\n\tconstructor(numpan, timepan) {\n\t\tthis.numPan = Util.setSpanValue(Util.initValue(numpan, 1));\n\t\tthis.timePan = Util.setSpanValue(Util.initValue(timepan, 1));\n\n\t\tthis.startTime = 0;\n\t\tthis.nextTime = 0;\n\t\tthis.init();\n\t}\n\n\tinit() {\n\t\tthis.startTime = 0;\n\t\tthis.nextTime = this.timePan.getValue();\n\t}\n\n\tgetValue(time) {\n\t\tthis.startTime += time;\n\n\t\tif (this.startTime >= this.nextTime) {\n\t\t\tthis.startTime = 0;\n\t\t\tthis.nextTime = this.timePan.getValue();\n\n\t\t\tif (this.numPan.b === 1) {\n\t\t\t\tif (this.numPan.getValue(false) > 0.5)\n\t\t\t\t\treturn 1;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn this.numPan.getValue(true);\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n}","export default class Initialize {\n\n\treset() {\n\t}\n\n\tinit(emitter, particle) {\n\t\tif (particle) {\n\t\t\tthis.initialize(particle);\n\t\t} else {\n\t\t\tthis.initialize(emitter);\n\t\t}\n\t};\n\n\t// sub class init\n\tinitialize(target) {\n\t};\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Life extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\n\t\tthis.lifePan = Util.setSpanValue(a, b, c);\n\t\tthis.name = 'Life';\n\t}\n\n\tinitialize(target) {\n\t\tif (this.lifePan.a === Infinity)\n\t\t\ttarget.life = Infinity;\n\t\telse\n\t\t\ttarget.life = this.lifePan.getValue();\n\t}\n}\n","import Vector2D from '../math/Vector2D';\n\nexport default class Zone {\n\n\tconstructor() {\n\t\tthis.vector = new Vector2D(0, 0);\n\t\tthis.random = 0;\n\t\tthis.crossType = 'dead';\n\t\tthis.alert = true;\n\t}\n\n\tgetPosition() {\n\t}\n\n\tcrossing(particle) {\n\t}\n}\n","import Zone from './Zone';\n\nexport default class PointZone extends Zone {\n\n\tconstructor(x, y) {\n\t\tsuper();\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tgetPosition() {\n\t\tthis.vector.x = this.x;\n\t\tthis.vector.y = this.y;\n\t\treturn this.vector;\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.alert) {\n\t\t\talert('Sorry PointZone does not support crossing method');\n\t\t\tthis.alert = false;\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport PointZone from '../zone/PointZone';\nimport Initialize from './Initialize';\n\nexport default class Position extends Initialize {\n\n\tconstructor(zone) {\n\t\tsuper();\n\t\tthis.zone = Util.initValue(zone, new PointZone());\n\n\t\tthis.name = 'Position';\n\t}\n\n\treset(zone) {\n\t\tthis.zone = Util.initValue(zone, new PointZone());\n\t}\n\n\tinitialize(target) {\n\t\tthis.zone.getPosition();\n\n\t\ttarget.p.x = this.zone.vector.x;\n\t\ttarget.p.y = this.zone.vector.y;\n\t};\n\n}\n","import Proton from '../core/Proton';\nimport Util from '../utils/Util';\nimport Polar2D from '../math/Polar2D';\nimport MathUtils from '../math/MathUtils';\nimport Initialize from './Initialize';\n\nexport default class Velocity extends Initialize {\n\n constructor(rpan, thapan, type) {\n super();\n\n this.rPan = Util.setSpanValue(rpan);\n this.thaPan = Util.setSpanValue(thapan);\n this.type = Util.initValue(type, 'vector');\n\n this.name = 'Velocity';\n }\n\n reset(rpan, thapan, type) {\n this.rPan = Util.setSpanValue(rpan);\n this.thaPan = Util.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(this.normalizeVelocity(this.rPan.getValue()), this.thaPan.getValue() * MathUtils.PI_180);\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}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Mass extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\t\tthis.massPan = Util.setSpanValue(a, b, c);\n\t\tthis.name = 'Mass';\n\t}\n\n\tinitialize(target) {\n\t\ttarget.mass = this.massPan.getValue();\n\t}\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Radius extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\t\tthis.radius = Util.setSpanValue(a, b, c);\n\n\t\tthis.name = 'Radius';\n\t}\n\n\treset(a, b, c) {\n\t\tthis.radius = Util.setSpanValue(a, b, c);\n\t};\n\n\tinitialize(particle) {\n\t\tparticle.radius = this.radius.getValue();\n\t\tparticle.transform.oldRadius = particle.radius;\n\t};\n}","import Util from '../utils/Util';\nimport ArraySpan from '../math/ArraySpan';\nimport Initialize from './Initialize';\n\nexport default class Body extends Initialize {\n\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 = { width: this.w, height: this.h, src: imagetarget, isInner: true, inner: true };\n } else {\n particle.body = imagetarget;\n }\n };\n\n setSpanValue(color) {\n return color instanceof ArraySpan ? color : new ArraySpan(color);\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}","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 MathUtils from '../math/MathUtils';\nimport Behaviour from './Behaviour';\n\nexport default class RandomDrift extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Behaviour\n\t * @constructor\n\t * @alias RandomDrift\n\t *\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Number} time The time of the drift\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(driftX, driftY, delay, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(driftX, driftY, delay);\n\t\tthis.time = 0;\n\t\tthis.name = 'RandomDrift';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#RandomDrift\n\t * @instance\n\t *\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\n\t */\n\treset(driftX, driftY, delay, life, easing) {\n\t\tthis.panFoce = new Vector2D(driftX, driftY);\n\t\tthis.panFoce = this.normalizeForce(this.panFoce);\n\t\tthis.delay = delay;\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#RandomDrift\n\t * @instance\n\t *\n\t * @param {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\tthis.time += time;\n\n\t\tif (this.time >= this.delay) {\n\t\t\tparticle.a.addXY(MathUtils.randomAToB(-this.panFoce.x, this.panFoce.x), MathUtils.randomAToB(-this.panFoce.y, this.panFoce.y));\n\t\t\tthis.time = 0;\n\t\t};\n\t}\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 Behaviour from './Behaviour';\n\nexport default class Alpha extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Alpha\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 = 'Alpha';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Alpha\n\t * @instance\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\treset(a, b, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Util.setSpanValue(b);\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Sets the new alpha value of the particle\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Alpha\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle A single Proton generated particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.transform.alphaA = this.a.getValue();\n\n\t\tif (this.same)\n\t\t\tparticle.transform.alphaB = particle.transform.alphaA;\n\t\telse\n\t\t\tparticle.transform.alphaB = this.b.getValue();\n\t}\n\n\t/**\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Alpha\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.alpha = particle.transform.alphaB + (particle.transform.alphaA - particle.transform.alphaB) * this.energy;\n\t\tif (particle.alpha < 0.001) particle.alpha = 0;\n\t}\n}\n","import 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 = Util.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Util.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.transform.scaleA = this.a.getValue();\n\t\tparticle.transform.oldRadius = particle.radius;\n\t\tparticle.transform.scaleB = this.same ? particle.transform.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.transform.scaleB + (particle.transform.scaleA - particle.transform.scaleB) * this.energy;\n\n\t\tif (particle.scale < 0.0001) particle.scale = 0;\n\t\tparticle.radius = particle.transform.oldRadius * particle.scale;\n\t}\n}","import 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 = Util.setSpanValue(Util.initValue(a, 'Velocity'));\n\t\tthis.b = Util.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.transform.rotationA = this.a.getValue();\n\n\t\tif (!this.same) particle.transform.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.transform.rotationB + (particle.transform.rotationA - particle.transform.rotationB) * this.energy\n\t\t\t} else {\n\t\t\t\tparticle.rotation += particle.transform.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 /**\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\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.transform.colorA = ColorUtil.hexToRGB(particle.color);\n\n if (this.b)\n particle.transform.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.transform.rgb.r = particle.transform.colorB.r + (particle.transform.colorA.r - particle.transform.colorB.r) * this.energy;\n particle.transform.rgb.g = particle.transform.colorB.g + (particle.transform.colorA.g - particle.transform.colorB.g) * this.energy;\n particle.transform.rgb.b = particle.transform.colorB.b + (particle.transform.colorA.b - particle.transform.colorB.b) * this.energy;\n\n particle.transform.rgb.r = Math.floor(particle.transform.rgb.r);\n particle.transform.rgb.g = Math.floor(particle.transform.rgb.g);\n particle.transform.rgb.b = Math.floor(particle.transform.rgb.b);\n\n } else {\n particle.transform.rgb.r = particle.transform.colorA.r;\n particle.transform.rgb.g = particle.transform.colorA.g;\n particle.transform.rgb.b = particle.transform.colorA.b;\n }\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 MathUtils from '../math/MathUtils';\n\nexport default {\n\n\tinitialize(emitter, particle, initializes) {\n\t\tconst length = initializes.length;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tif (initializes[i] instanceof Initialize)\n\t\t\t\tinitializes[i].init(emitter, particle);\n\t\t\telse\n\t\t\t\tthis.init(emitter, particle, initializes[i]);\n\t\t}\n\n\t\tthis.bindEmitter(emitter, particle);\n\t},\n\n\t// init\n\tinit(emitter, particle, initialize) {\n\t\tUtil.setPrototypeByObject(particle, initialize);\n\t\tUtil.setVector2DByObject(particle, initialize);\n\t},\n\n\tbindEmitter(emitter, particle) {\n\t\tif (emitter.bindEmitter) {\n\t\t\tparticle.p.add(emitter.p);\n\t\t\tparticle.v.add(emitter.v);\n\t\t\tparticle.a.add(emitter.a);\n\n\t\t\tparticle.v.rotate(MathUtils.degreeTransform(emitter.rotation));\n\t\t}\n\t}\n}\n","import Util from '../utils/Util';\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\tstatic ID = 0;\n\n\t/**\n\t * You can use this emit particles.\n\t *\n\t * It will dispatch follow events:\n\t * PARTICLE_CREATED\n\t * PARTICLE_UPDATA\n\t * PARTICLE_DEAD\n\t *\n\t * @class Emitter\n\t * @constructor\n\t * @param {Object} pObj the parameters object;\n\t * for example {damping:0.01,bindEmitter:false}\n\t */\n\tconstructor(pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.initializes = [];\n\t\tthis.particles = [];\n\t\tthis.behaviours = [];\n\n\t\tthis.emitSpeed = 0;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = -1;\n\n\t\t/**\n\t\t * The friction coefficient for all particle emit by This;\n\t\t * @property damping\n\t\t * @type {Number}\n\t\t * @default 0.006\n\t\t */\n\t\tthis.damping = .006;\n\n\t\t/**\n\t\t * If bindEmitter the particles can bind this emitter's property;\n\t\t * @property bindEmitter\n\t\t * @type {Boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.bindEmitter = true;\n\n\t\t/**\n\t\t * The number of particles per second emit (a [particle]/b [s]);\n\t\t * @property rate\n\t\t * @type {Rate}\n\t\t * @default Rate(1, .1)\n\t\t */\n\t\tthis.rate = new Rate(1, .1);\n\n\t\tthis.id = `emitter_${Emitter.ID++}`;\n\t\tthis.name = 'Emitter';\n\t}\n\n\t/**\n\t * start emit particle\n\t * @method emit\n\t * @param {Number} emitTime begin emit time;\n\t * @param {String} life the life of this emitter\n\t */\n\temit(totalTime, life) {\n\t\tthis.stoped = false;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = Util.initValue(totalTime, Infinity);\n\n\t\tif (life === true || life === 'life' || life === 'destroy') {\n\t\t\tthis.life = totalTime === 'once' ? 1 : this.totalTime;\n\t\t} else if (!isNaN(life)) {\n\t\t\tthis.life = life;\n\t\t}\n\n\t\tthis.rate.init();\n\t}\n\n\t/**\n\t * stop emiting\n\t * @method stop\n\t */\n\tstop() {\n\t\tthis.totalTime = -1;\n\t\tthis.emitTime = 0;\n\t\tthis.stoped = true;\n\t}\n\n\tpreEmit(time) {\n\t\tlet oldStoped = this.stoped;\n\t\tlet oldEmitTime = this.emitTime;\n\t\tlet oldTotalTime = this.totalTime;\n\n\t\tthis.stoped = false;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = time;\n\t\tthis.rate.init();\n\n\t\tconst step = 0.0167;\n\t\twhile (time > step) {\n\t\t\ttime -= step;\n\t\t\tthis.update(step);\n\t\t}\n\n\t\tthis.stoped = oldStoped;\n\t\tthis.emitTime = oldEmitTime + Math.max(time, 0);\n\t\tthis.totalTime = oldTotalTime;\n\t}\n\n\t/**\n\t * remove current all particles\n\t * @method removeAllParticles\n\t */\n\tremoveAllParticles() {\n\t\tlet i = this.particles.length;\n\t\twhile (i--) this.particles[i].dead = true;\n\t}\n\n\t/**\n\t * add initialize to this emitter\n\t * @method addSelfInitialize\n\t */\n\taddSelfInitialize(pObj) {\n\t\tif (pObj['init']) {\n\t\t\tpObj.init(this);\n\t\t} else {\n\t\t\tthis.initAll();\n\t\t}\n\t}\n\n\t/**\n\t * add the Initialize to particles;\n\t *\n\t * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);\n\t * @method addInitialize\n\t * @param {Initialize} initialize like this new Radius(1, 12)\n\t */\n\taddInitialize(...rest) {\n\t\tlet i = rest.length;\n\t\twhile (i--)\n\t\t\tthis.initializes.push(rest[i]);\n\t}\n\n\t/**\n\t * remove the Initialize\n\t * @method removeInitialize\n\t * @param {Initialize} initialize a initialize\n\t */\n\tremoveInitialize(initializer) {\n\t\tconst index = this.initializes.indexOf(initializer);\n\t\tif (index > -1) this.initializes.splice(index, 1);\n\t}\n\n\t/**\n\t * remove all Initializes\n\t * @method removeInitializers\n\t */\n\tremoveAllInitializers() {\n\t\tUtil.destroyArray(this.initializes);\n\t}\n\n\t/**\n\t * add the Behaviour to particles;\n\t *\n\t * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);\n\t * @method addBehaviour\n\t * @param {Behaviour} behaviour like this new Color('random')\n\t */\n\taddBehaviour(...rest) {\n\t\tlet i = arguments.length;\n\t\twhile (i--) {\n\t\t\tlet behaviour = rest[i];\n\t\t\tthis.behaviours.push(behaviour);\n\t\t\tif (behaviour.parents) behaviour.parents.push(this);\n\t\t}\n\t}\n\n\t/**\n\t * remove the Behaviour\n\t * @method removeBehaviour\n\t * @param {Behaviour} behaviour a behaviour\n\t */\n\tremoveBehaviour(behaviour) {\n\t\tlet index = this.behaviours.indexOf(behaviour);\n\t\tthis.behaviours.splice(index, 1);\n\n\t\tif (behaviour.parents) {\n\t\t\tindex = behaviour.parents.indexOf(behaviour);\n\t\t\tbehaviour.parents.splice(index, 1);\n\t\t}\n\n\t\treturn index;\n\t}\n\n\t/**\n\t * remove all behaviours\n\t * @method removeAllBehaviours\n\t */\n\tremoveAllBehaviours() {\n\t\tUtil.destroyArray(this.behaviours);\n\t}\n\n\t// emitter update\n\tupdate(time) {\n\t\tthis.age += time;\n\t\tif (this.age >= this.life || this.dead) this.destroy();\n\n\t\tthis.emitting(time);\n\t\tthis.integrate(time);\n\t}\n\n\tintegrate(time) {\n\t\tif (!this.parent) return;\n\n\t\tconst damping = 1 - this.damping;\n\t\tthis.parent.integrator.calculate(this, time, damping);\n\n\t\tconst length = this.particles.length;\n\t\tlet i, particle;\n\n\t\tfor (i = length - 1; i >= 0; i--) {\n\t\t\tparticle = this.particles[i];\n\n\t\t\t// particle update\n\t\t\tparticle.update(time, i);\n\t\t\tthis.parent.integrator.calculate(particle, time, damping);\n\t\t\tthis.dispatch('PARTICLE_UPDATE', particle);\n\n\t\t\t// check dead\n\t\t\tif (particle.dead) {\n\t\t\t\tthis.dispatch('PARTICLE_DEAD', particle);\n\n\t\t\t\tthis.parent.pool.expire(particle);\n\t\t\t\tthis.particles.splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tdispatch(event, target) {\n\t\tthis.parent && this.parent.dispatchEvent(event, target);\n\t\tthis.bindEvent && this.dispatchEvent(event, target);\n\t}\n\n\temitting(time) {\n\t\tif (this.totalTime === 'once') {\n\t\t\tlet i;\n\t\t\tconst length = this.rate.getValue(99999);\n\n\t\t\tif (length > 0) this.emitSpeed = length;\n\t\t\tfor (i = 0; i < length; i++) this.createParticle();\n\t\t\tthis.totalTime = 'none';\n\t\t}\n\n\t\telse {\n\t\t\tthis.emitTime += time;\n\n\t\t\tif (this.emitTime < this.totalTime) {\n\t\t\t\tconst length = this.rate.getValue(time)\n\t\t\t\tlet i;\n\n\t\t\t\tif (length > 0) this.emitSpeed = length;\n\t\t\t\tfor (i = 0; i < length; i++) this.createParticle();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * create single particle;\n\t *\n\t * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})\n\t * @method removeAllParticles\n\t */\n\tcreateParticle(initialize, behaviour) {\n\t\tconst particle = this.parent.pool.get(Particle);\n\t\tthis.setupParticle(particle, initialize, behaviour);\n\t\tthis.dispatch('PARTICLE_CREATED', particle);\n\n\t\treturn particle;\n\t}\n\n\tsetupParticle(particle, initialize, behaviour) {\n\t\tlet initializes = this.initializes;\n\t\tlet behaviours = this.behaviours;\n\n\t\tif (initialize) {\n\t\t\tinitializes = Util.isArray(initialize) ? initialize : [initialize];\n\t\t}\n\n\t\tif (behaviour) {\n\t\t\tbehaviour = Util.isArray(behaviour) ? behaviour : [behaviour];\n\t\t}\n\n\t\tparticle.reset();\n\t\tInitializeUtil.initialize(this, particle, initializes);\n\t\tparticle.addBehaviours(behaviours);\n\t\tparticle.parent = this;\n\n\t\tthis.particles.push(particle);\n\t}\n\n\tremove() {\n\t\tthis.stop();\n\t\tUtil.destroy(this.particles);\n\t}\n\n\t/**\n\t * Destory this Emitter\n\t * @method destroy\n\t */\n\tdestroy(slow) {\n\t\tthis.dead = true;\n\t\tthis.remove();\n\t\tthis.removeAllInitializers();\n\t\tthis.removeAllBehaviours();\n\t\tthis.parent && this.parent.removeEmitter(this);\n\t}\n\n}\n\nEventDispatcher.bind(Emitter);","import Emitter from './Emitter';\n\nexport default class BehaviourEmitter extends Emitter {\n\n\t/**\n\t * The BehaviourEmitter class inherits from Proton.Emitter\n\t *\n\t * use the BehaviourEmitter you can add behaviours to self;\n\t * @class Proton.BehaviourEmitter\n\t * @constructor\n\t * @param {Object} pObj the parameters object;\n\t */\n\tconstructor(pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.selfBehaviours = [];\n\t};\n\n\t/**\n\t * add the Behaviour to emitter;\n\t *\n\t * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);\n\t * @method addSelfBehaviour\n\t * @param {Proton.Behaviour} behaviour like this new Proton.Color('random')\n\t */\n\taddSelfBehaviour(...rest) {\n\t\tconst length = rest.length;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tthis.selfBehaviours.push(rest[i]);\n\t\t}\n\t};\n\n\t/**\n\t * remove the Behaviour for self\n\t * @method removeSelfBehaviour\n\t * @param {Proton.Behaviour} behaviour a behaviour\n\t */\n\tremoveSelfBehaviour(behaviour) {\n\t\tconst index = this.selfBehaviours.indexOf(behaviour);\n\t\tif (index > -1) this.selfBehaviours.splice(index, 1);\n\t};\n\n\tupdate(time) {\n\t\tsuper.update(time);\n\n\t\tif (!this.sleep) {\n\t\t\tconst length = this.selfBehaviours.length;\n\t\t\tlet i;\n\n\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\tthis.selfBehaviours[i].applyBehaviour(this, time, i);\n\t\t\t}\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Emitter from './Emitter';\n\nexport default class FollowEmitter extends Emitter {\n\n\t/**\n\t * The FollowEmitter class inherits from Proton.Emitter\n\t *\n\t * use the FollowEmitter will emit particle when mousemoving\n\t *\n\t * @class Proton.FollowEmitter\n\t * @constructor\n\t * @param {Element} mouseTarget mouseevent's target;\n\t * @param {Number} ease the easing of following speed;\n\t * @default 0.7\n\t * @param {Object} pObj the parameters object;\n\t */\n\tconstructor(mouseTarget, ease, pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.mouseTarget = Util.initValue(mouseTarget, window);\n\t\tthis.ease = Util.initValue(ease, 0.7);\n\n\t\tthis._allowEmitting = false;\n\t\tthis.initEventHandler();\n\t};\n\n\tinitEventHandler() {\n\t\tthis.mousemoveHandler = e => this.mousemove.call(this, e);\n\t\tthis.mousedownHandler = e => this.mousedown.call(this, e);\n\t\tthis.mouseupHandler = e => this.mouseup.call(this, e);\n\n\t\tthis.mouseTarget.addEventListener('mousemove', this.mousemoveHandler, false);\n\t}\n\n\t/**\n\t * start emit particle\n\t * @method emit\n\t */\n\temit() {\n\t\tthis._allowEmitting = true;\n\t}\n\n\t/**\n\t * stop emiting\n\t * @method stop\n\t */\n\tstop() {\n\t\tthis._allowEmitting = false;\n\t}\n\n\tmousemove(e) {\n\t\tif (e.layerX || e.layerX === 0) {\n\t\t\tthis.p.x += (e.layerX - this.p.x) * this.ease;\n\t\t\tthis.p.y += (e.layerY - this.p.y) * this.ease;\n\t\t} else if (e.offsetX || e.offsetX === 0) {\n\t\t\tthis.p.x += (e.offsetX - this.p.x) * this.ease;\n\t\t\tthis.p.y += (e.offsetY - this.p.y) * this.ease;\n\t\t}\n\n\t\tif (this._allowEmitting) super.emit('once');\n\t};\n\n\t/**\n\t * Destory this Emitter\n\t * @method destroy\n\t */\n\tdestroy() {\n\t\tsuper.destroy();\n\t\tthis.mouseTarget.removeEventListener('mousemove', this.mousemoveHandler, false);\n\t}\n\n}\n","import Pool from '../core/Pool';\nimport Util from '../utils/Util';\n\nexport default class BaseRenderer {\n\n constructor(element, stroke) {\n this.element = element;\n this.stroke = stroke;\n\n this.initHandler();\n\n this.circleConf = { isCircle: true };\n this.pool = new Pool();\n this.name = 'BaseRenderer';\n }\n\n setStroke(color, thinkness) {\n color = Util.initValue(color, '#000000');\n thinkness = Util.initValue(thinkness, 1);\n\n this.stroke = { color, thinkness };\n }\n\n initHandler() {\n this._protonUpdateHandler = () => { this.onProtonUpdate.call(this) };\n this._protonUpdateAfterHandler = () => { this.onProtonUpdateAfter.call(this) };\n this._emitterAddedHandler = (emitter) => { this.onEmitterAdded.call(this, emitter) };\n this._emitterRemovedHandler = (emitter) => { this.onEmitterRemoved.call(this, emitter) };\n this._particleCreatedHandler = (particle) => { this.onParticleCreated.call(this, particle) };\n this._particleUpdateHandler = (particle) => { this.onParticleUpdate.call(this, particle) };\n this._particleDeadHandler = (particle) => { this.onParticleDead.call(this, particle) };\n }\n\n init(proton) {\n this.parent = proton;\n\n proton.addEventListener('PROTON_UPDATE', this._protonUpdateHandler);\n proton.addEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\n\n proton.addEventListener('EMITTER_ADDED', this._emitterAddedHandler);\n proton.addEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\n\n proton.addEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\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('PROTON_UPDATE', this._protonUpdateHandler);\n this.parent.removeEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\n\n this.parent.removeEventListener('EMITTER_ADDED', this._emitterAddedHandler);\n this.parent.removeEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\n\n this.parent.removeEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\n this.parent.removeEventListener('PARTICLE_UPDATE', this._particleUpdateHandler);\n this.parent.removeEventListener('PARTICLE_DEAD', this._particleDeadHandler);\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}","import ImgUtil from '../utils/ImgUtil';\nimport ColorUtil from '../utils/ColorUtil';\nimport MathUtils from '../math/MathUtils';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class CanvasRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.context = this.element.getContext('2d');\n this.bufferCache = {};\n\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 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.transform['buffer']) particle.transform.buffer = this.createBuffer(particle.body);\n\n const bufferContext = particle.transform.buffer.getContext('2d');\n bufferContext.clearRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\n bufferContext.globalAlpha = particle.alpha;\n bufferContext.drawImage(particle.body, 0, 0);\n\n bufferContext.globalCompositeOperation = 'source-atop';\n bufferContext.fillStyle = ColorUtil.rgbToHex(particle.transform.rgb);\n bufferContext.fillRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\n bufferContext.globalCompositeOperation = 'source-over';\n bufferContext.globalAlpha = 1;\n\n this.context.drawImage(particle.transform.buffer, 0, 0, particle.transform.buffer.width, particle.transform.buffer.height, x, y, w, h);\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(MathUtils.degreeTransform(particle.rotation));\n this.context.translate(-particle.p.x, -particle.p.y);\n this.context.drawImage(particle.body, 0, 0, particle.body.width, particle.body.height, x, y, w, h);\n\n this.context.globalAlpha = 1;\n this.context.restore();\n }\n }\n\n // private drawCircle --\n drawCircle(particle) {\n if (particle.transform['rgb'])\n this.context.fillStyle = 'rgba(' + particle.transform.rgb.r + ',' + particle.transform.rgb.g + ',' + particle.transform.rgb.b + ',' + particle.alpha + ')';\n else\n this.context.fillStyle = particle.color;\n\n // draw circle\n this.context.beginPath();\n this.context.arc(particle.p.x, particle.p.y, particle.radius, 0, Math.PI * 2, true);\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}","import DomUtil from '../utils/DomUtil';\nimport ImgUtil from '../utils/ImgUtil';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class DomRenderer extends BaseRenderer {\n\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\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(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\n else\n DomUtil.transform(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\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 typeof particle.body === 'object' && particle.body && !particle.body.isInner;\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)\n return this.createCircle(particle);\n else\n return this.createSprite(body, particle);\n }\n\n // private --\n createCircle(particle) {\n const dom = DomUtil.createDiv(`${particle.id}_dom`, 2 * particle.radius, 2 * particle.radius);\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(`${particle.id}_dom`, body.width, body.height);\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\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)\n graphics.beginStroke(this.stroke);\n else\n graphics.beginStroke('#000000');\n }\n graphics.beginFill(particle.color || '#ff0000').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\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 ? rectangle : new Rectangle(0, 0, this.element.width, this.element.height);\n this.imageData = this.context.createImageData(this.rectangle.width, this.rectangle.height);\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\n }\n\n onProtonUpdate() {\n this.context.clearRect(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\n this.imageData = this.context.getImageData(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\n }\n\n onProtonUpdateAfter() {\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\n }\n\n onParticleCreated(particle) {}\n\n onParticleUpdate(particle) {\n if (this.imageData) {\n this.setPixel(this.imageData, Math.floor(particle.p.x - this.rectangle.x), Math.floor(particle.p.y - this.rectangle.y), particle);\n }\n }\n\n setPixel(imagedata, x, y, particle) {\n const rgb = particle.transform.rgb;\n\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 }\n\n}","import ColorUtil from '../utils/ColorUtil';\nimport MathUtils from '../math/MathUtils';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class PixiRenderer extends BaseRenderer {\n\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.setColor = false;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.name = 'PixiRenderer';\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 this.element.addChild(particle.body);\n }\n\n /**\n * @param particle\n */\n onParticleUpdate(particle) {\n this.transform(particle, particle.body);\n if (this.setColor) particle.body.tint = ColorUtil.getHex16FromParticle(particle);\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 MathUtils.PI_180 for slight performance increase.\n target.rotation = particle.rotation * MathUtils.PI_180; // MathUtils.PI_180;\n }\n\n createBody(body, particle) {\n if (body.isCircle)\n return this.createCircle(particle);\n else\n return this.createSprite(body);\n }\n\n createSprite(body) {\n const sprite = body.isInner ? PIXI.Sprite.fromImage(body.src) : new PIXI.Sprite(body);\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 PIXI.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}","import Mat3 from '../math/Mat3';\n\nexport default class MStack {\n\n\tconstructor() {\n\t\tthis.mats = [];\n\t\tthis.size = 0;\n\n\t\tfor (let i = 0; i < 20; i++) this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0]));\n\t}\n\n\tset(m, i) {\n\t\tif (i === 0)\n\t\t\tMat3.set(m, this.mats[0]);\n\t\telse\n\t\t\tMat3.multiply(this.mats[i - 1], m, this.mats[i]);\n\n\t\tthis.size = Math.max(this.size, i + 1);\n\t}\n\n\tpush(m) {\n\t\tif (this.size === 0)\n\t\t\tMat3.set(m, this.mats[0]);\n\t\telse\n\t\t\tMat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]);\n\n\t\tthis.size++;\n\t}\n\n\tpop() {\n\t\tif (this.size > 0)\n\t\t\tthis.size--;\n\t}\n\n\ttop() {\n\t\treturn (this.mats[this.size - 1]);\n\t}\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 MathUtils from '../math/MathUtils';\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.transform.src])\n this.texturebuffers[particle.transform.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()];\n\n particle.transform.texture = this.texturebuffers[particle.transform.src][0];\n particle.transform.vcBuffer = this.texturebuffers[particle.transform.src][1];\n particle.transform.tcBuffer = this.texturebuffers[particle.transform.src][2];\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.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.transform.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.transform.canvas.getContext('2d');\n const data = context.getImageData(0, 0, _width, _height);\n\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.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.transform.textureLoaded = true;\n particle.transform.textureWidth = _w;\n particle.transform.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.transform.textureLoaded = false;\n particle.transform.tmat = Mat3.create();\n particle.transform.tmat[8] = 1;\n particle.transform.imat = Mat3.create();\n particle.transform.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.transform.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.transform.src = img.src;\n particle.transform.canvas = ImgUtil.getCanvasFromCache(img);\n particle.transform.oldScale = 1;\n\n this.drawImg2Canvas(particle);\n }\n\n onParticleUpdate(particle) {\n if (particle.transform.textureLoaded) {\n this.updateMatrix(particle);\n\n this.gl.uniform3f(this.sprogram.color, particle.transform.rgb.r / 255, particle.transform.rgb.g / 255, particle.transform.rgb.b / 255);\n this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top());\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.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.transform.textureWidth / 2, -particle.transform.textureHeight / 2);\n const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y);\n\n const angel = particle.rotation * (MathUtils.PI_180);\n const rotationMatrix = WebGLUtil.makeRotation(angel);\n\n const scale = particle.scale * particle.transform.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.transform.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\n constructor(element) {\n super(element);\n\n this.name = 'CustomRenderer';\n }\n\n}","import Zone from './Zone';\nimport Util from '../utils/Util';\nimport MathUtils from '../math/MathUtils';\n\nexport default class LineZone extends Zone {\n\n\tconstructor(x1, y1, x2, y2, direction) {\n\t\tsuper();\n\n\t\tif (x2 - x1 >= 0) {\n\t\t\tthis.x1 = x1;\n\t\t\tthis.y1 = y1;\n\t\t\tthis.x2 = x2;\n\t\t\tthis.y2 = y2;\n\t\t} else {\n\t\t\tthis.x1 = x2;\n\t\t\tthis.y1 = y2;\n\t\t\tthis.x2 = x1;\n\t\t\tthis.y2 = y1;\n\t\t}\n\n\t\tthis.dx = this.x2 - this.x1;\n\t\tthis.dy = this.y2 - this.y1;\n\n\t\tthis.minx = Math.min(this.x1, this.x2);\n\t\tthis.miny = Math.min(this.y1, this.y2);\n\t\tthis.maxx = Math.max(this.x1, this.x2);\n\t\tthis.maxy = Math.max(this.y1, this.y2);\n\n\t\tthis.dot = this.x2 * this.y1 - this.x1 * this.y2;\n\t\tthis.xxyy = this.dx * this.dx + this.dy * this.dy;\n\n\t\tthis.gradient = this.getGradient();\n\t\tthis.length = this.getLength();\n\t\tthis.direction = Util.initValue(direction, '>');\n\t}\n\n\tgetPosition() {\n\t\tthis.random = Math.random();\n\t\tthis.vector.x = this.x1 + this.random * this.length * Math.cos(this.gradient);\n\t\tthis.vector.y = this.y1 + this.random * this.length * Math.sin(this.gradient);\n\n\t\treturn this.vector;\n\t}\n\n\tgetDirection(x, y) {\n\t\tconst A = this.dy;\n\t\tconst B = -this.dx;\n\t\tconst C = this.dot;\n\t\tconst D = B === 0 ? 1 : B;\n\n\t\tif ((A * x + B * y + C) * D > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\n\tgetDistance(x, y) {\n\t\tconst A = this.dy;\n\t\tconst B = -this.dx;\n\t\tconst C = this.dot;\n\t\tconst D = (A * x + B * y + C);\n\n\t\treturn D / Math.sqrt(this.xxyy);\n\t}\n\n\tgetSymmetric(v) {\n\t\tconst tha2 = v.getGradient();\n\t\tconst tha1 = this.getGradient();\n\t\tconst tha = 2 * (tha1 - tha2);\n\n\t\tconst oldx = v.x;\n\t\tconst oldy = v.y;\n\n\t\tv.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n\t\tv.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n\n\t\treturn v;\n\t}\n\n\tgetGradient() {\n\t\treturn Math.atan2(this.dy, this.dx);\n\t}\n\n\trangeOut(particle) {\n\t\tconst angle = Math.abs(this.getGradient());\n\n\t\tif (angle <= MathUtils.PI / 4) {\n\t\t\tif (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true;\n\t\t} else {\n\t\t\tif (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetLength() {\n\t\treturn Math.sqrt(this.dx * this.dx + this.dy * this.dy)\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (this.direction === '>' || this.direction === 'R' || this.direction === 'right' || this.direction === 'down') {\n\t\t\t\tif (!this.rangeOut(particle)) return;\n\t\t\t\tif (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n\t\t\t} else {\n\t\t\t\tif (!this.rangeOut(particle)) return;\n\t\t\t\tif (!this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (!this.rangeOut(particle)) return;\n\n\t\t\tif (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) {\n\t\t\t\tif (this.dx === 0) {\n\t\t\t\t\tparticle.v.x *= -1;\n\t\t\t\t} else if (this.dy === 0) {\n\t\t\t\t\tparticle.v.y *= -1;\n\t\t\t\t} else {\n\t\t\t\t\tthis.getSymmetric(particle.v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'cross') {\n\t\t\tif (this.alert) {\n\t\t\t\tconsole.error('Sorry lineZone does not support cross method');\n\t\t\t\tthis.alert = false;\n\t\t\t}\n\t\t}\n\t}\n}","import Zone from './Zone';\nimport MathUtils from '../math/MathUtils';\n\nexport default class CircleZone extends Zone {\n\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.random = Math.random();\n this.angle = MathUtils.PIx2 * Math.random();\n\n this.vector.x = this.x + this.random * this.radius * Math.cos(this.angle);\n this.vector.y = this.y + this.random * this.radius * 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)\n particle.dead = true;\n } else if (this.crossType === 'bound') {\n if (d + particle.radius >= this.radius)\n this.getSymmetric(particle);\n } else if (this.crossType === 'cross') {\n if (this.alert) {\n alert('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 -MathUtils.PI_2 + Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x);\n }\n}","import Zone from './Zone';\n\nexport default class RectZone extends Zone {\n\n\tconstructor(x, y, width, height) {\n\t\tsuper();\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\n\tgetPosition() {\n\t\tthis.vector.x = this.x + Math.random() * this.width;\n\t\tthis.vector.y = this.y + Math.random() * this.height;\n\n\t\treturn this.vector;\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (particle.p.x + particle.radius < this.x)\n\t\t\t\tparticle.dead = true;\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width)\n\t\t\t\tparticle.dead = true;\n\n\t\t\tif (particle.p.y + particle.radius < this.y)\n\t\t\t\tparticle.dead = true;\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height)\n\t\t\t\tparticle.dead = true;\n\t\t}\n\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (particle.p.x - particle.radius < this.x) {\n\t\t\t\tparticle.p.x = this.x + particle.radius;\n\t\t\t\tparticle.v.x *= -1;\n\t\t\t} else if (particle.p.x + particle.radius > this.x + this.width) {\n\t\t\t\tparticle.p.x = this.x + this.width - particle.radius;\n\t\t\t\tparticle.v.x *= -1;\n\t\t\t}\n\n\t\t\tif (particle.p.y - particle.radius < this.y) {\n\t\t\t\tparticle.p.y = this.y + particle.radius;\n\t\t\t\tparticle.v.y *= -1;\n\t\t\t} else if (particle.p.y + particle.radius > this.y + this.height) {\n\t\t\t\tparticle.p.y = this.y + this.height - particle.radius;\n\t\t\t\tparticle.v.y *= -1;\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'cross') {\n\t\t\tif (particle.p.x + particle.radius < this.x && particle.v.x <= 0)\n\t\t\t\tparticle.p.x = this.x + this.width + particle.radius;\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width && particle.v.x >= 0)\n\t\t\t\tparticle.p.x = this.x - particle.radius;\n\n\t\t\tif (particle.p.y + particle.radius < this.y && particle.v.y <= 0)\n\t\t\t\tparticle.p.y = this.y + this.height + particle.radius;\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height && particle.v.y >= 0)\n\t\t\t\tparticle.p.y = this.y - particle.radius;\n\t\t}\n\t}\n}","import Zone from './Zone';\nimport Util from '../utils/Util';\n\nexport default class ImageZone extends Zone {\n\n\tconstructor(imageData, x, y, d) {\n\t\tsuper();\n\n\t\tthis.reset(imageData, x, y, d);\n\t}\n\n\treset(imageData, x, y, d) {\n\t\tthis.imageData = imageData;\n\t\tthis.x = Util.initValue(x, 0);\n\t\tthis.y = Util.initValue(y, 0);\n\t\tthis.d = Util.initValue(d, 2);\n\n\t\tthis.vectors = [];\n\t\tthis.setVectors();\n\t}\n\n\tsetVectors() {\n\t\tlet i, j;\n\t\tconst length1 = this.imageData.width;\n\t\tconst length2 = this.imageData.height;\n\n\t\tfor (i = 0; i < length1; i += this.d) {\n\t\t\tfor (j = 0; j < length2; j += this.d) {\n\t\t\t\tlet index = ((j >> 0) * length1 + (i >> 0)) * 4;\n\n\t\t\t\tif (this.imageData.data[index + 3] > 0) {\n\t\t\t\t\tthis.vectors.push({ x: i + this.x, y: j + this.y });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.vector;\n\t}\n\n\tgetBound(x, y) {\n\t\tvar index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\t\tif (this.imageData.data[index + 3] > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\n\tgetPosition() {\n\t\treturn this.vector.copy(this.vectors[Math.floor(Math.random() * this.vectors.length)]);\n\t}\n\n\tgetColor(x, y) {\n\t\tx -= this.x;\n\t\ty -= this.y;\n\t\tvar i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\n\t\treturn {\n\t\t\tr: this.imageData.data[i],\n\t\t\tg: this.imageData.data[i + 1],\n\t\t\tb: this.imageData.data[i + 2],\n\t\t\ta: this.imageData.data[i + 3]\n\t\t};\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n\t\t\t\tparticle.dead = true;\n\t\t\telse\n\t\t\t\tparticle.dead = false;\n\t\t}\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (!this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n\t\t\t\tparticle.v.negate();\n\t\t}\n\t}\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\taddEventListener(proton, fun) {\n\t\tproton.addEventListener('PROTON_UPDATE_AFTER', () => fun());\n\t},\n\n\tgetStyle(color) {\n\t\tconst rgb = ColorUtil.hexToRGB(color || '#ff0000');\n\t\treturn `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`;\n\t},\n\n\tdrawZone(proton, canvas, zone, clear) {\n\t\tconst context = canvas.getContext('2d');\n\t\tconst style = this.getStyle();\n\n\t\tthis.addEventListener(proton, () => {\n\t\t\tif (clear)\n\t\t\t\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\n\t\t\tif (zone instanceof PointZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.fillStyle = style;\n\t\t\t\tcontext.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true);\n\t\t\t\tcontext.fill();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof LineZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.moveTo(zone.x1, zone.y1);\n\t\t\t\tcontext.lineTo(zone.x2, zone.y2);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof RectZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.drawRect(zone.x, zone.y, zone.width, zone.height);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof CircleZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t}\n\t\t});\n\t},\n\n\tdrawEmitter(proton, canvas, emitter, clear) {\n\t\tconst context = canvas.getContext('2d');\n\t\tconst style = this.getStyle();\n\n\t\tthis.addEventListener(proton, () => {\n\t\t\tif (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n\t\t\tcontext.beginPath();\n\t\t\tcontext.fillStyle = style;\n\t\t\tcontext.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true);\n\t\t\tcontext.fill();\n\t\t\tcontext.closePath();\n\t\t});\n\t}\n}","// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating\n\n// requestAnimationFrame polyfill by Erik Möller\n// fixes from Paul Irish and Tino Zijdel\n(function () {\n\tvar lastTime = 0;\n\tvar vendors = ['ms', 'moz', 'webkit', 'o'];\n\tfor (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {\n\t\twindow.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];\n\t\twindow.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];\n\t}\n\n\tif (!window.requestAnimationFrame)\n\t\twindow.requestAnimationFrame = function (callback, element) {\n\t\t\tvar currTime = new Date().getTime();\n\t\t\tvar timeToCall = Math.max(0, 16 - (currTime - lastTime));\n\t\t\tvar id = window.setTimeout(function () {\n\t\t\t\tcallback(currTime + timeToCall);\n\t\t\t}, timeToCall);\n\t\t\tlastTime = currTime + timeToCall;\n\t\t\treturn id;\n\t\t};\n\n\tif (!window.cancelAnimationFrame)\n\t\twindow.cancelAnimationFrame = function (id) {\n\t\t\tclearTimeout(id);\n\t\t};\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 MathUtils from './math/MathUtils';\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 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';\nimport './polyfill/requestAnimationFrame';\n\n// namespace\nProton.Particle = Proton.P = Particle;\nProton.Pool = Pool;\n\nProton.Util = Util;\nProton.ColorUtil = ColorUtil;\nProton.MathUtils = MathUtils;\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.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;"],"names":["PI","MathUtils","a","b","INT","Math","random","floor","center","f","randomAToB","display","num","toString","slice","Span","isArray","Util","initValue","length","randomFloating","i","tx","ty","angleInRadians","c","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","IMG_CACHE","CANVAS_CACHE","canvasID","context","image","rect","drawImage","imagedata","getImageData","clearRect","img","callback","param","src","Image","onload","e","target","WebGLUtil","nhpot","canvas","DomUtil","createCanvas","getContext","value","defaults","undefined","Object","prototype","call","array","obj","ignore","o","indexOf","constructor","args","concat","FactoryFunc","bind","apply","pOBJ","hasProp","p","v","copy","prototypeObject","filters","singleProp","hasOwnProperty","getSpanValue","pan","getValue","ImgUtil","arr","destroy","uid","getCacheID","cache","isInner","Pool","total","params","__puid","PUID","getID","pop","createOrClone","getCache","push","create","classApply","clone","count","Stats","proton","container","type","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","TargetClass","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","particle","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","getAllParticles","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","pow","PI_2","sqrt","ease","easeLinear","Vector2D","atan2","w","addVectors","subVectors","set","divideScalar","distanceToSquared","tha","dx","dy","alpha","Particle","ID","reset","setPrototypeByObject","N180_PI","life","Infinity","age","energy","dead","sprite","radius","rotation","easing","destroyObject","removeAllBehaviours","rgb","r","g","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","destroyArray","h","hex16","substring","parseInt","rbg","Number","Polar2D","abs","getX","getY","mat3","mat","Float32Array","mat1","mat2","d","m","vec","ArraySpan","_arr","randomColor","Rectangle","bottom","right","Rate","numpan","timepan","numPan","setSpanValue","timePan","startTime","nextTime","Initialize","Life","lifePan","Zone","vector","crossType","alert","PointZone","Position","zone","getPosition","Velocity","rpan","thapan","rPan","thaPan","vr","polar2d","normalizeVelocity","PI_180","Mass","massPan","Radius","oldRadius","Body","imagetarget","inner","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","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVector2DByObject","degreeTransform","Emitter","pObj","emitTime","totalTime","rate","stoped","isNaN","oldStoped","oldEmitTime","oldTotalTime","step","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","slow","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mouseTarget","window","_allowEmitting","initEventHandler","mousemoveHandler","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","layerX","layerY","offsetX","offsetY","babelHelpers.get","BaseRenderer","element","stroke","initHandler","circleConf","isCircle","thinkness","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","CanvasRenderer","bufferCache","getImgFromCache","addImg2Body","drawCircle","buffer","createBuffer","bufferContext","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","String","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","data","PixiRenderer","setColor","tint","getHex16FromParticle","PIXI","Sprite","fromImage","anchor","endFill","MStack","mats","Mat3","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","gradient","getGradient","getLength","C","D","tha2","tha1","oldx","oldy","angle","rangeOut","getDistance","getSymmetric","error","CircleZone","PIx2","distanceTo","RectZone","ImageZone","vectors","setVectors","j","length1","length2","getBound","negate","fun","getStyle","moveTo","lineTo","drawRect","lastTime","vendors","requestAnimationFrame","cancelAnimationFrame","currTime","timeToCall","setTimeout","P","Vector","Polar","getSpan","Init","L","V","M","R","F","RD","G","S","WebGlRenderer","Debug","assign"],"mappings":";;;;;;AAAA,IAAMA,KAAK,SAAX;;AAEA,IAAMC,YAAY;;QAEVD,EAFU;UAGRA,KAAK,CAHG;UAIRA,KAAK,CAJG;YAKNA,KAAK,GALC;aAML,MAAMA,EAND;;cAAA,sBAQHE,CARG,EAQAC,CARA,EAQGC,GARH,EAQQ;YACd,CAACA,GAAL,EACI,OAAOF,IAAIG,KAAKC,MAAL,MAAiBH,IAAID,CAArB,CAAX,CADJ,KAGI,OAAOG,KAAKE,KAAL,CAAWF,KAAKC,MAAL,MAAiBH,IAAID,CAArB,CAAX,IAAsCA,CAA7C;KAZM;kBAAA,0BAeCM,MAfD,EAeSC,CAfT,EAeYL,GAfZ,EAeiB;eACpB,KAAKM,UAAL,CAAgBF,SAASC,CAAzB,EAA4BD,SAASC,CAArC,EAAwCL,GAAxC,CAAP;KAhBU;cAAA,sBAmBHO,OAnBG,EAmBM,EAnBN;mBAAA,2BAqBET,CArBF,EAqBK;eACRA,IAAIF,EAAJ,GAAS,GAAhB;KAtBU;aAAA,qBAyBJY,GAzBI,EAyBC;eACJ,MAAMA,IAAIC,QAAJ,CAAa,EAAb,CAAb;KA1BU;eAAA,yBA6BA;eACH,MAAM,CAAC,UAAU,CAACR,KAAKC,MAAL,KAAgB,SAAhB,IAA6B,CAA9B,EAAiCO,QAAjC,CAA0C,EAA1C,CAAX,EAA0DC,KAA1D,CAAgE,CAAC,CAAjE,CAAb;;CA9BR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICCqBC;eAERb,CAAZ,EAAeC,CAAf,EAAkBK,MAAlB,EAA0B;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AhV,OAAOyc,cAAP,GAAwBA,cAAxB;;AAEAzc,OAAO2gB,KAAP,GAAeA,KAAf;;AAEAnnB,OAAOonB,MAAP,CAAc5gB,MAAd,EAAsBgC,IAAtB;;;;;;;;"} \ No newline at end of file diff --git a/build/proton.min.js b/build/proton.min.js index ea0c8ff..712c431 100644 --- a/build/proton.min.js +++ b/build/proton.min.js @@ -1,5 +1,5 @@ /*! -* Proton v3.1.2 +* Proton v3.3.0 * https://github.com/a-jie/Proton * * Copyright 2013-2018, 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";var e=3.1415926,h={PI:e,PIx2:2*e,PI_2:e/2,PI_180:e/180,N180_PI:180/e,randomAToB:function(t,e,i){return i?Math.floor(Math.random()*(e-t))+t:t+Math.random()*(e-t)},randomFloating:function(t,e,i){return this.randomAToB(t-e,t+e,i)},randomZone:function(t){},degreeTransform:function(t){return t*e/180},toColor16:function(t){return"#"+t.toString(16)},randomColor:function(){return"#"+("00000"+(16777216*Math.random()<<0).toString(16)).slice(-6)}},r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function r(t,e){for(var i=0;i>e;return t+1},p=function(t,e){return[1,0,0,0,1,0,t,e,1]},v=function(t){var e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},g=function(t,e){return[t,0,0,0,e,0,0,0,1]},m=function(t,e){var i=t[0],r=t[1],n=t[2],a=t[3],s=t[4],o=t[5],h=t[6],l=t[7],u=t[8],c=e[0],f=e[1],d=e[2],y=e[3],p=e[4],v=e[5],g=e[6],m=e[7],b=e[8];return[i*c+r*y+n*g,i*f+r*p+n*m,i*d+r*v+n*b,a*c+s*y+o*g,a*f+s*p+o*m,a*d+s*v+o*b,h*c+l*y+u*g,h*f+l*p+u*m,h*d+l*v+u*b]},b={createCanvas:function(t,e,i,r){var n=document.createElement("canvas");return r=r||"absolute",n.id=t,n.width=e,n.height=i,n.style.opacity=0,n.style.position=r,this.transform(n,-500,-500,0,0),n},createDiv:function(t,e,i){var r=document.createElement("div");return r.id=t,r.style.position="absolute",this.resize(r,e,i),r},resize:function(t,e,i){t.style.width=e+"px",t.style.height=i+"px",t.style.marginLeft=-e/2+"px",t.style.marginTop=-i/2+"px"},transform:function(t,e,i,r,n){var a="translate("+e+"px, "+i+"px) scale("+r+") rotate("+n+"deg)";t.style.willChange="transform",this.css3(t,"transform",a)},transform3d:function(t,e,i,r,n){var a="translate3d("+e+"px, "+i+"px, 0) scale("+r+") rotate("+n+"deg)";t.style.willChange="transform",this.css3(t,"backfaceVisibility","hidden"),this.css3(t,"transform",a)},css3:function(t,e,i){var r=e.charAt(0).toUpperCase()+e.substr(1);t.style["Webkit"+r]=i,t.style["Moz"+r]=i,t.style["O"+r]=i,t.style["ms"+r]=i,t.style[""+e]=i}},a={},_={},s=function(t,e,i){t.drawImage(e,i.x,i.y);var r=t.getImageData(i.x,i.y,i.width,i.height);return t.clearRect(i.x,i.y,i.width,i.height),r},x=function(t,e,i){var r="string"==typeof t?t:t.src;if(a[r])e(a[r],i);else{var n=new Image;n.onload=function(t){a[r]=t.target,e(a[r],i)},n.src=r}},k=function(t,e,i){var r=t.src;if(!_[r]){var n=y(t.width),a=y(t.height),s=b.createCanvas("canvas_cache_0",n,a);s.getContext("2d").drawImage(t,0,0,t.width,t.height),_[r]=s}return e&&e(_[r],i),_[r]},P={initValue:function(t,e){return t=null!=t?t:e},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},destroyArray:function(t){t&&(t.length=0)},destroyObject:function(t,e){for(var i in t)e&&-1",i&&(n+="em speed:"+i.emitSpeed+"
"),i&&(n+="pos:"+this.getEmitterPos(i));break;case 3:i&&(n+="initializes:"+i.initializes.length+"
"),i&&(n+=""+this.concatArr(i.initializes)+"
"),i&&(n+="behaviours:"+i.behaviours.length+"
"),i&&(n+=""+this.concatArr(i.behaviours)+"
");break;case 4:r&&(n+=r.name+"
"),r&&(n+="body:"+this.getCreatedNumber(r)+"
");break;default:n+="particles:"+this.proton.getCount()+"
",n+="pool:"+this.proton.pool.getCount()+"
",n+="total:"+this.proton.pool.total}this.container.innerHTML=n}},{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}}]),n}(),V=function(){function i(t,e){o(this,i),this.numPan=P.setSpanValue(P.initValue(t,1)),this.timePan=P.setSpanValue(P.initValue(e,1)),this.startTime=0,this.nextTime=0,this.init()}return l(i,[{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 r=this.easing(t.age/t.life);this.energy=Math.max(1-r,0)}}},{key:"destroy",value:function(){for(var t=this.parents.length;t--;)this.parents[t].removeBehaviour(this);this.parents.length=0}}]),i}();G.id=0;var X=function(t){function a(t,e,i,r){o(this,a);var n=f(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,i,r));return n.force=n.normalizeForce(new d(t,e)),n.name="Force",n}return c(a,G),l(a,[{key:"reset",value:function(t,e,i,r){this.force=this.normalizeForce(new d(t,e)),i&&u(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"reset",this).call(this,i,r)}},{key:"applyBehaviour",value:function(t,e,i){this.calculate(t,e,i),t.a.add(this.force)}}]),a}(),Y=function(t){function s(t,e,i,r,n){o(this,s);var a=f(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,r,n));return a.targetPosition=P.initValue(t,new d),a.radius=P.initValue(i,1e3),a.force=P.initValue(a.normalizeValue(e),100),a.radiusSq=a.radius*a.radius,a.attractionForce=new d,a.lengthSq=0,a.name="Attraction",a}return c(s,G),l(s,[{key:"reset",value:function(t,e,i,r,n){this.targetPosition=P.initValue(t,new d),this.radius=P.initValue(i,1e3),this.force=P.initValue(this.normalizeValue(e),100),this.radiusSq=this.radius*this.radius,this.attractionForce=new d,this.lengthSq=0,r&&u(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"reset",this).call(this,r,n)}},{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)),this.time=0)}}]),s}(),Z=function(t){function n(t,e,i){o(this,n);var r=f(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,0,t,e,i));return r.name="Gravity",r}return c(n,X),l(n,[{key:"reset",value:function(t,e,i){u(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"reset",this).call(this,0,t,e,i)}}]),n}(),Q=function(t){function s(t,e,i,r,n){o(this,s);var a=f(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,r,n));return a.reset(t,e,i),a.name="Collision",a}return c(s,G),l(s,[{key:"reset",value:function(t,e,i,r,n){this.emitter=P.initValue(t,null),this.mass=P.initValue(e,!0),this.callback=P.initValue(i,null),this.collisionPool=[],this.delta=new d,r&&u(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"reset",this).call(this,r,n)}},{key:"applyBehaviour",value:function(t,e,i){var r=this.emitter?this.emitter.particles.slice(i):this.pool.slice(i),n=r.length,a=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,r=void 0;for(i=this.particles.length-1;0<=i;i--)(r=this.particles[i]).update(t,i),this.parent.integrator.calculate(r,t,e),this.dispatch("PARTICLE_UPDATE",r),r.dead&&(this.dispatch("PARTICLE_DEAD",r),this.parent.pool.expire(r),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 a=4*((i>>0)*t.width+(e>>0));t.data[a]=n.r,t.data[a+1]=n.g,t.data[a+2]=n.b,t.data[a+3]=255*r.alpha}}},{key:"onParticleDead",value:function(t){}}]),r}(),dt=function(t){function r(t,e){o(this,r);var i=f(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t));return i.stroke=e,i.setColor=!1,i.pool.create=function(t,e){return i.createBody(t,e)},i.name="PixiRenderer",i}return c(r,ht),l(r,[{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.element.addChild(t.body)}},{key:"onParticleUpdate",value:function(t){this.transform(t,t.body),this.setColor&&(t.body.tint=S.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){u(r.prototype.__proto__||Object.getPrototypeOf(r.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?PIXI.Sprite.fromImage(t.src):new PIXI.Sprite(t);return e.anchor.x=.5,e.anchor.y=.5,e}},{key:"createCircle",value:function(t){var e=new PIXI.Graphics;if(this.stroke){this.stroke instanceof String&&this.stroke;e.beginStroke(this.stroke)}return e.beginFill(t.color||36077),e.drawCircle(0,0,t.radius),e.endFill(),e}}]),r}(),yt=function(){function e(){o(this,e),this.mats=[];for(var t=this.size=0;t<20;t++)this.mats.push(I.create([0,0,0,0,0,0,0,0,0]))}return l(e,[{key:"set",value:function(t,e){0==e?I.set(t,this.mats[0]):I.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?I.set(t,this.mats[0]):I.multiply(this.mats[this.size-1],t,this.mats[this.size]),this.size++}},{key:"pop",value:function(){0"),a}return c(s,U),l(s,[{key:"getPosition",value:function(){return this.random=Math.random(),this.vector.x=this.x1+this.random*this.length*Math.cos(this.gradient),this.vector.y=this.y1+this.random*this.length*Math.sin(this.gradient),this.vector}},{key:"getDirection",value:function(t,e){var i=this.dy,r=-this.dx;return 0<(i*t+r*e+this.dot)*(0==r?1:r)}},{key:"getDistance",value:function(t,e){return(this.dy*t+-this.dx*e+this.dot)/Math.sqrt(this.xxyy)}},{key:"getSymmetric",value:function(t){var e=t.getGradient(),i=2*(this.getGradient()-e),r=t.x,n=t.y;return t.x=r*Math.cos(i)-n*Math.sin(i),t.y=r*Math.sin(i)+n*Math.cos(i),t}},{key:"getGradient",value:function(){return Math.atan2(this.dy,this.dx)}},{key:"rangeOut",value:function(t){if(Math.abs(this.getGradient())<=h.PI/4){if(t.p.x<=this.maxx&&t.p.x>=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)}}]),s}(),mt=function(t){function n(t,e,i){o(this,n);var r=f(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return r.x=t,r.y=e,r.radius=i,r.angle=0,r.center={x:t,y:e},r}return c(n,U),l(n,[{key:"getPosition",value:function(){return this.random=Math.random(),this.angle=h.PIx2*Math.random(),this.vector.x=this.x+this.random*this.radius*Math.cos(this.angle),this.vector.y=this.y+this.random*this.radius*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&&(alert("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),r=t.v.x,n=t.v.y;t.v.x=r*Math.cos(i)-n*Math.sin(i),t.v.y=r*Math.sin(i)+n*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)}}]),n}(),bt=function(t){function a(t,e,i,r){o(this,a);var n=f(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return n.x=t,n.y=e,n.width=i,n.height=r,n}return c(a,U),l(a,[{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))}}]),a}(),_t=function(t){function a(t,e,i,r){o(this,a);var n=f(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return n.reset(t,e,i,r),n}return c(a,U),l(a,[{key:"reset",value:function(t,e,i,r){this.imageData=t,this.x=P.initValue(e,0),this.y=P.initValue(i,0),this.d=P.initValue(r,2),this.vectors=[],this.setVectors()}},{key:"setVectors",value:function(){var t=void 0,e=void 0,i=this.imageData.width,r=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[i+1],b:this.imageData.data[i+2],a:this.imageData.data[i+3]}}},{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())}}]),a}(),xt={addEventListener:function(t,e){t.addEventListener("PROTON_UPDATE_AFTER",function(){return e()})},getStyle:function(t){var e=S.hexToRGB(t||"#ff0000");return"rgba("+e.r+", "+e.g+", "+e.b+", 0.5)"},drawZone:function(t,e,i,r){var n=e.getContext("2d"),a=this.getStyle();this.addEventListener(t,function(){r&&n.clearRect(0,0,e.width,e.height),i instanceof F?(n.beginPath(),n.fillStyle=a,n.arc(i.x,i.y,10,0,2*Math.PI,!0),n.fill(),n.closePath()):i instanceof gt?(n.beginPath(),n.strokeStyle=a,n.moveTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.stroke(),n.closePath()):i instanceof bt?(n.beginPath(),n.strokeStyle=a,n.drawRect(i.x,i.y,i.width,i.height),n.stroke(),n.closePath()):i instanceof mt&&(n.beginPath(),n.strokeStyle=a,n.arc(i.x,i.y,i.radius,0,2*Math.PI,!0),n.stroke(),n.closePath())})},drawEmitter:function(t,e,i,r){var n=e.getContext("2d"),a=this.getStyle();this.addEventListener(t,function(){r&&n.clearRect(0,0,e.width,e.height),n.beginPath(),n.fillStyle=a,n.arc(i.p.x,i.p.y,10,0,2*Math.PI,!0),n.fill(),n.closePath()})}};return function(){for(var a=0,t=["ms","moz","webkit","o"],e=0;e>e;return t+1},y=function(t,e){return[1,0,0,0,1,0,t,e,1]},p=function(t){var e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},v=function(t,e){return[t,0,0,0,e,0,0,0,1]},g=function(t,e){var i=t[0],r=t[1],n=t[2],a=t[3],s=t[4],o=t[5],h=t[6],l=t[7],u=t[8],c=e[0],f=e[1],d=e[2],y=e[3],p=e[4],v=e[5],g=e[6],m=e[7],b=e[8];return[i*c+r*y+n*g,i*f+r*p+n*m,i*d+r*v+n*b,a*c+s*y+o*g,a*f+s*p+o*m,a*d+s*v+o*b,h*c+l*y+u*g,h*f+l*p+u*m,h*d+l*v+u*b]},m={createCanvas:function(t,e,i,r){var n=document.createElement("canvas");return r=r||"absolute",n.id=t,n.width=e,n.height=i,n.style.opacity=0,n.style.position=r,this.transform(n,-500,-500,0,0),n},createDiv:function(t,e,i){var r=document.createElement("div");return r.id=t,r.style.position="absolute",this.resize(r,e,i),r},resize:function(t,e,i){t.style.width=e+"px",t.style.height=i+"px",t.style.marginLeft=-e/2+"px",t.style.marginTop=-i/2+"px"},transform:function(t,e,i,r,n){var a="translate("+e+"px, "+i+"px) scale("+r+") rotate("+n+"deg)";t.style.willChange="transform",this.css3(t,"transform",a)},transform3d:function(t,e,i,r,n){var a="translate3d("+e+"px, "+i+"px, 0) scale("+r+") rotate("+n+"deg)";t.style.willChange="transform",this.css3(t,"backfaceVisibility","hidden"),this.css3(t,"transform",a)},css3:function(t,e,i){var r=e.charAt(0).toUpperCase()+e.substr(1);t.style["Webkit"+r]=i,t.style["Moz"+r]=i,t.style["O"+r]=i,t.style["ms"+r]=i,t.style[""+e]=i}},a={},b={},s=function(t,e,i){t.drawImage(e,i.x,i.y);var r=t.getImageData(i.x,i.y,i.width,i.height);return t.clearRect(i.x,i.y,i.width,i.height),r},_=function(t,e,i){var r="string"==typeof t?t:t.src;if(a[r])e(a[r],i);else{var n=new Image;n.onload=function(t){a[r]=t.target,e(a[r],i)},n.src=r}},x=function(t,e,i){var r=t.src;if(!b[r]){var n=d(t.width),a=d(t.height),s=m.createCanvas("canvas_cache_0",n,a);s.getContext("2d").drawImage(t,0,0,t.width,t.height),b[r]=s}return e&&e(b[r],i),b[r]},k={initValue:function(t,e){return t=null!=t?t:e},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},destroyArray:function(t){t&&(t.length=0)},destroyObject:function(t,e){for(var i in t)e&&-1",i&&(n+="em speed:"+i.emitSpeed+"
"),i&&(n+="pos:"+this.getEmitterPos(i));break;case 3:i&&(n+="initializes:"+i.initializes.length+"
"),i&&(n+=''+this.concatArr(i.initializes)+"
"),i&&(n+="behaviours:"+i.behaviours.length+"
"),i&&(n+=''+this.concatArr(i.behaviours)+"
");break;case 4:r&&(n+=r.name+"
"),r&&(n+="body:"+this.getCreatedNumber(r)+"
");break;default:n+="particles:"+this.proton.getCount()+"
",n+="pool:"+this.proton.pool.getCount()+"
",n+="total:"+this.proton.pool.total}this.container.innerHTML=n}},{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}}]),n}(),V=function(){function i(t,e){o(this,i),this.numPan=k.setSpanValue(k.initValue(t,1)),this.timePan=k.setSpanValue(k.initValue(e,1)),this.startTime=0,this.nextTime=0,this.init()}return l(i,[{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 r=this.easing(t.age/t.life);this.energy=Math.max(1-r,0)}}},{key:"destroy",value:function(){for(var t=this.parents.length;t--;)this.parents[t].removeBehaviour(this);this.parents.length=0}}]),i}();G.id=0;var X=function(t){function a(t,e,i,r){o(this,a);var n=f(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,i,r));return n.force=n.normalizeForce(new O(t,e)),n.name="Force",n}return c(a,G),l(a,[{key:"reset",value:function(t,e,i,r){this.force=this.normalizeForce(new O(t,e)),i&&u(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"reset",this).call(this,i,r)}},{key:"applyBehaviour",value:function(t,e,i){this.calculate(t,e,i),t.a.add(this.force)}}]),a}(),Y=function(t){function s(t,e,i,r,n){o(this,s);var a=f(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,r,n));return a.targetPosition=k.initValue(t,new O),a.radius=k.initValue(i,1e3),a.force=k.initValue(a.normalizeValue(e),100),a.radiusSq=a.radius*a.radius,a.attractionForce=new O,a.lengthSq=0,a.name="Attraction",a}return c(s,G),l(s,[{key:"reset",value:function(t,e,i,r,n){this.targetPosition=k.initValue(t,new O),this.radius=k.initValue(i,1e3),this.force=k.initValue(this.normalizeValue(e),100),this.radiusSq=this.radius*this.radius,this.attractionForce=new O,this.lengthSq=0,r&&u(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"reset",this).call(this,r,n)}},{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)),this.time=0)}}]),s}(),Z=function(t){function n(t,e,i){o(this,n);var r=f(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,0,t,e,i));return r.name="Gravity",r}return c(n,X),l(n,[{key:"reset",value:function(t,e,i){u(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"reset",this).call(this,0,t,e,i)}}]),n}(),Q=function(t){function s(t,e,i,r,n){o(this,s);var a=f(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,r,n));return a.reset(t,e,i),a.name="Collision",a}return c(s,G),l(s,[{key:"reset",value:function(t,e,i,r,n){this.emitter=k.initValue(t,null),this.mass=k.initValue(e,!0),this.callback=k.initValue(i,null),this.collisionPool=[],this.delta=new O,r&&u(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"reset",this).call(this,r,n)}},{key:"applyBehaviour",value:function(t,e,i){var r=this.emitter?this.emitter.particles.slice(i):this.pool.slice(i),n=r.length,a=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,r=void 0;for(i=this.particles.length-1;0<=i;i--)(r=this.particles[i]).update(t,i),this.parent.integrator.calculate(r,t,e),this.dispatch("PARTICLE_UPDATE",r),r.dead&&(this.dispatch("PARTICLE_DEAD",r),this.parent.pool.expire(r),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 a=4*((i>>0)*t.width+(e>>0));t.data[a]=n.r,t.data[a+1]=n.g,t.data[a+2]=n.b,t.data[a+3]=255*r.alpha}}},{key:"onParticleDead",value:function(t){}}]),r}(),dt=function(t){function r(t,e){o(this,r);var i=f(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t));return i.stroke=e,i.setColor=!1,i.pool.create=function(t,e){return i.createBody(t,e)},i.name="PixiRenderer",i}return c(r,ht),l(r,[{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.element.addChild(t.body)}},{key:"onParticleUpdate",value:function(t){this.transform(t,t.body),this.setColor&&(t.body.tint=S.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){u(r.prototype.__proto__||Object.getPrototypeOf(r.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?PIXI.Sprite.fromImage(t.src):new PIXI.Sprite(t);return e.anchor.x=.5,e.anchor.y=.5,e}},{key:"createCircle",value:function(t){var e=new PIXI.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}}]),r}(),yt=function(){function e(){o(this,e),this.mats=[];for(var t=this.size=0;t<20;t++)this.mats.push(I.create([0,0,0,0,0,0,0,0,0]))}return l(e,[{key:"set",value:function(t,e){0===e?I.set(t,this.mats[0]):I.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?I.set(t,this.mats[0]):I.multiply(this.mats[this.size-1],t,this.mats[this.size]),this.size++}},{key:"pop",value:function(){0"),a}return c(s,U),l(s,[{key:"getPosition",value:function(){return this.random=Math.random(),this.vector.x=this.x1+this.random*this.length*Math.cos(this.gradient),this.vector.y=this.y1+this.random*this.length*Math.sin(this.gradient),this.vector}},{key:"getDirection",value:function(t,e){var i=this.dy,r=-this.dx;return 0<(i*t+r*e+this.dot)*(0===r?1:r)}},{key:"getDistance",value:function(t,e){return(this.dy*t+-this.dx*e+this.dot)/Math.sqrt(this.xxyy)}},{key:"getSymmetric",value:function(t){var e=t.getGradient(),i=2*(this.getGradient()-e),r=t.x,n=t.y;return t.x=r*Math.cos(i)-n*Math.sin(i),t.y=r*Math.sin(i)+n*Math.cos(i),t}},{key:"getGradient",value:function(){return Math.atan2(this.dy,this.dx)}},{key:"rangeOut",value:function(t){if(Math.abs(this.getGradient())<=h.PI/4){if(t.p.x<=this.maxx&&t.p.x>=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)}}]),s}(),mt=function(t){function n(t,e,i){o(this,n);var r=f(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return r.x=t,r.y=e,r.radius=i,r.angle=0,r.center={x:t,y:e},r}return c(n,U),l(n,[{key:"getPosition",value:function(){return this.random=Math.random(),this.angle=h.PIx2*Math.random(),this.vector.x=this.x+this.random*this.radius*Math.cos(this.angle),this.vector.y=this.y+this.random*this.radius*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&&(alert("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),r=t.v.x,n=t.v.y;t.v.x=r*Math.cos(i)-n*Math.sin(i),t.v.y=r*Math.sin(i)+n*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)}}]),n}(),bt=function(t){function a(t,e,i,r){o(this,a);var n=f(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return n.x=t,n.y=e,n.width=i,n.height=r,n}return c(a,U),l(a,[{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))}}]),a}(),_t=function(t){function a(t,e,i,r){o(this,a);var n=f(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return n.reset(t,e,i,r),n}return c(a,U),l(a,[{key:"reset",value:function(t,e,i,r){this.imageData=t,this.x=k.initValue(e,0),this.y=k.initValue(i,0),this.d=k.initValue(r,2),this.vectors=[],this.setVectors()}},{key:"setVectors",value:function(){var t=void 0,e=void 0,i=this.imageData.width,r=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[i+1],b:this.imageData.data[i+2],a:this.imageData.data[i+3]}}},{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())}}]),a}(),xt={addEventListener:function(t,e){t.addEventListener("PROTON_UPDATE_AFTER",function(){return e()})},getStyle:function(t){var e=S.hexToRGB(t||"#ff0000");return"rgba("+e.r+", "+e.g+", "+e.b+", 0.5)"},drawZone:function(t,e,i,r){var n=e.getContext("2d"),a=this.getStyle();this.addEventListener(t,function(){r&&n.clearRect(0,0,e.width,e.height),i instanceof F?(n.beginPath(),n.fillStyle=a,n.arc(i.x,i.y,10,0,2*Math.PI,!0),n.fill(),n.closePath()):i instanceof gt?(n.beginPath(),n.strokeStyle=a,n.moveTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.stroke(),n.closePath()):i instanceof bt?(n.beginPath(),n.strokeStyle=a,n.drawRect(i.x,i.y,i.width,i.height),n.stroke(),n.closePath()):i instanceof mt&&(n.beginPath(),n.strokeStyle=a,n.arc(i.x,i.y,i.radius,0,2*Math.PI,!0),n.stroke(),n.closePath())})},drawEmitter:function(t,e,i,r){var n=e.getContext("2d"),a=this.getStyle();this.addEventListener(t,function(){r&&n.clearRect(0,0,e.width,e.height),n.beginPath(),n.fillStyle=a,n.arc(i.p.x,i.p.y,10,0,2*Math.PI,!0),n.fill(),n.closePath()})}};return function(){for(var a=0,t=["ms","moz","webkit","o"],e=0;e 0)\r\n return MathUtils.PI_2;\r\n else if (this.y < 0)\r\n return -MathUtils.PI_2;\r\n }\r\n\r\n copy(v) {\r\n this.x = v.x;\r\n this.y = v.y;\r\n\r\n return this;\r\n }\r\n\r\n add(v, w) {\r\n if (w !== undefined) {\r\n return this.addVectors(v, w);\r\n }\r\n\r\n this.x += v.x;\r\n this.y += v.y;\r\n\r\n return this;\r\n }\r\n\r\n addXY(a, b) {\r\n this.x += a;\r\n this.y += b;\r\n\r\n return this;\r\n }\r\n\r\n addVectors(a, b) {\r\n this.x = a.x + b.x;\r\n this.y = a.y + b.y;\r\n\r\n return this;\r\n }\r\n\r\n sub(v, w) {\r\n if (w !== undefined) {\r\n return this.subVectors(v, w);\r\n }\r\n\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n\r\n return this;\r\n }\r\n\r\n subVectors(a, b) {\r\n this.x = a.x - b.x;\r\n this.y = a.y - b.y;\r\n\r\n return this;\r\n }\r\n\r\n divideScalar(s) {\r\n if (s !== 0) {\r\n this.x /= s;\r\n this.y /= s;\r\n } else {\r\n this.set(0, 0);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n multiplyScalar(s) {\r\n this.x *= s;\r\n this.y *= s;\r\n\r\n return this;\r\n }\r\n\r\n negate() {\r\n return this.multiplyScalar(-1);\r\n }\r\n\r\n dot(v) {\r\n return this.x * v.x + this.y * v.y;\r\n }\r\n\r\n lengthSq() {\r\n return this.x * this.x + this.y * this.y;\r\n }\r\n\r\n length() {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n }\r\n\r\n normalize() {\r\n return this.divideScalar(this.length());\r\n }\r\n\r\n distanceTo(v) {\r\n return Math.sqrt(this.distanceToSquared(v));\r\n }\r\n\r\n rotate(tha) {\r\n const x = this.x;\r\n const y = this.y;\r\n\r\n this.x = x * Math.cos(tha) + y * Math.sin(tha);\r\n this.y = -x * Math.sin(tha) + y * Math.cos(tha);\r\n\r\n return this;\r\n }\r\n\r\n distanceToSquared(v) {\r\n const dx = this.x - v.x;\r\n const dy = this.y - v.y;\r\n\r\n return dx * dx + dy * dy;\r\n }\r\n\r\n lerp(v, alpha) {\r\n this.x += (v.x - this.x) * alpha;\r\n this.y += (v.y - this.y) * alpha;\r\n\r\n return this;\r\n }\r\n\r\n equals(v) {\r\n return ((v.x === this.x) && (v.y === this.y));\r\n }\r\n\r\n clear() {\r\n this.x = 0.0;\r\n this.y = 0.0;\r\n return this;\r\n }\r\n\r\n clone() {\r\n return new Vector2D(this.x, this.y);\r\n }\r\n}","import Util from '../utils/Util';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default class Span {\r\n\r\n\tconstructor(a, b, center) {\r\n\t\tthis.isArray = false;\r\n\r\n\t\tif (Util.isArray(a)) {\r\n\t\t\tthis.isArray = true;\r\n\t\t\tthis.a = a;\r\n\t\t} else {\r\n\t\t\tthis.a = Util.initValue(a, 1);\r\n\t\t\tthis.b = Util.initValue(b, this.a);\r\n\t\t\tthis.center = Util.initValue(center, false);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tgetValue(INT) {\r\n\t\tif (this.isArray) {\r\n\t\t\treturn this.a[Math.floor(this.a.length * Math.random())];\r\n\t\t} else {\r\n\t\t\tif (!this.center)\r\n\t\t\t\treturn MathUtils.randomAToB(this.a, this.b, INT);\r\n\t\t\telse\r\n\t\t\t\treturn MathUtils.randomFloating(this.a, this.b, INT);\r\n\t\t}\r\n\t}\r\n}","export default {\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method ipot\r\n *\r\n * @todo add description\r\n * @todo add length description\r\n *\r\n * @param {Number} length\r\n *\r\n * @return {Boolean}\r\n */\r\n ipot(length) {\r\n return (length & (length - 1)) == 0;\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method nhpot\r\n *\r\n * @todo add description\r\n * @todo add length description\r\n *\r\n * @param {Number} length\r\n *\r\n * @return {Number}\r\n */\r\n nhpot(length) {\r\n --length;\r\n for (let i = 1; i < 32; i <<= 1) {\r\n length = length | length >> i;\r\n }\r\n\r\n return length + 1;\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method makeTranslation\r\n *\r\n * @todo add description\r\n * @todo add tx, ty description\r\n * @todo add return description\r\n *\r\n * @param {Number} tx either 0 or 1\r\n * @param {Number} ty either 0 or 1\r\n *\r\n * @return {Object}\r\n */\r\n makeTranslation(tx, ty) {\r\n return [1, 0, 0, 0, 1, 0, tx, ty, 1];\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method makeRotation\r\n *\r\n * @todo add description\r\n * @todo add return description\r\n *\r\n * @param {Number} angleInRadians\r\n *\r\n * @return {Object}\r\n */\r\n makeRotation(angleInRadians) {\r\n let c = Math.cos(angleInRadians);\r\n let s = Math.sin(angleInRadians);\r\n\r\n return [c, -s, 0, s, c, 0, 0, 0, 1];\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method makeScale\r\n *\r\n * @todo add description\r\n * @todo add tx, ty description\r\n * @todo add return description\r\n *\r\n * @param {Number} sx either 0 or 1\r\n * @param {Number} sy either 0 or 1\r\n *\r\n * @return {Object}\r\n */\r\n makeScale(sx, sy) {\r\n return [sx, 0, 0, 0, sy, 0, 0, 0, 1];\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.WebGLUtil\r\n * @method matrixMultiply\r\n *\r\n * @todo add description\r\n * @todo add a, b description\r\n * @todo add return description\r\n *\r\n * @param {Object} a\r\n * @param {Object} b\r\n *\r\n * @return {Object}\r\n */\r\n matrixMultiply(a, b) {\r\n let a00 = a[0 * 3 + 0];\r\n let a01 = a[0 * 3 + 1];\r\n let a02 = a[0 * 3 + 2];\r\n let a10 = a[1 * 3 + 0];\r\n let a11 = a[1 * 3 + 1];\r\n let a12 = a[1 * 3 + 2];\r\n let a20 = a[2 * 3 + 0];\r\n let a21 = a[2 * 3 + 1];\r\n let a22 = a[2 * 3 + 2];\r\n let b00 = b[0 * 3 + 0];\r\n let b01 = b[0 * 3 + 1];\r\n let b02 = b[0 * 3 + 2];\r\n let b10 = b[1 * 3 + 0];\r\n let b11 = b[1 * 3 + 1];\r\n let b12 = b[1 * 3 + 2];\r\n let b20 = b[2 * 3 + 0];\r\n let b21 = b[2 * 3 + 1];\r\n let b22 = b[2 * 3 + 2];\r\n\r\n return [\r\n a00 * b00 + a01 * b10 + a02 * b20,\r\n a00 * b01 + a01 * b11 + a02 * b21,\r\n a00 * b02 + a01 * b12 + a02 * b22,\r\n a10 * b00 + a11 * b10 + a12 * b20,\r\n a10 * b01 + a11 * b11 + a12 * b21,\r\n a10 * b02 + a11 * b12 + a12 * b22,\r\n a20 * b00 + a21 * b10 + a22 * b20,\r\n a20 * b01 + a21 * b11 + a22 * b21,\r\n a20 * b02 + a21 * b12 + a22 * b22\r\n ];\r\n }\r\n}","export default {\r\n\r\n /**\r\n * Creates and returns a new canvas. The opacity is by default set to 0\r\n *\r\n * @memberof Proton#Proton.DomUtil\r\n * @method createCanvas\r\n *\r\n * @param {String} $id the canvas' id\r\n * @param {Number} $width the canvas' width\r\n * @param {Number} $height the canvas' height\r\n * @param {String} [$position=absolute] the canvas' position, default is 'absolute' \r\n *\r\n * @return {Object}\r\n */\r\n createCanvas(id, width, height, position) {\r\n const dom = document.createElement(\"canvas\");\r\n position = position || 'absolute';\r\n\r\n dom.id = id;\r\n dom.width = width;\r\n dom.height = height;\r\n dom.style.opacity = 0;\r\n dom.style.position = position;\r\n\r\n this.transform(dom, -500, -500, 0, 0);\r\n\r\n return dom;\r\n },\r\n\r\n createDiv(id, width, height) {\r\n const dom = document.createElement(\"div\");\r\n\r\n dom.id = id;\r\n dom.style.position = 'absolute';\r\n this.resize(dom, width, height);\r\n\r\n return dom;\r\n },\r\n\r\n resize(dom, width, height) {\r\n dom.style.width = width + 'px';\r\n dom.style.height = height + 'px';\r\n dom.style.marginLeft = -width / 2 + 'px';\r\n dom.style.marginTop = -height / 2 + 'px';\r\n },\r\n\r\n /**\r\n * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers\r\n *\r\n * @memberof Proton#Proton.DomUtil\r\n * @method transform\r\n *\r\n * @param {HTMLDivElement} div \r\n * @param {Number} $x \r\n * @param {Number} $y \r\n * @param {Number} $scale \r\n * @param {Number} $rotate \r\n */\r\n transform(div, x, y, scale, rotate) {\r\n const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`;\r\n\r\n div.style.willChange = 'transform';\r\n this.css3(div, 'transform', transform);\r\n },\r\n\r\n transform3d(div, x, y, scale, rotate) {\r\n const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;\r\n\r\n div.style.willChange = 'transform';\r\n this.css3(div, 'backfaceVisibility', 'hidden');\r\n this.css3(div, 'transform', transform);\r\n },\r\n\r\n css3(div, key, val) {\r\n const bkey = key.charAt(0).toUpperCase() + key.substr(1);\r\n\r\n div.style[`Webkit${bkey}`] = val;\r\n div.style[`Moz${bkey}`] = val;\r\n div.style[`O${bkey}`] = val;\r\n div.style[`ms${bkey}`] = val;\r\n div.style[`${key}`] = val;\r\n }\r\n}","import WebGLUtil from './WebGLUtil';\r\nimport DomUtil from './DomUtil';\r\n\r\nconst IMG_CACHE = {};\r\nconst CANVAS_CACHE = {};\r\nlet canvasID = 0;\r\n\r\nexport default {\r\n\r\n /**\r\n * This will get the image data. It could be necessary to create a Proton.Zone.\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method getImageData\r\n *\r\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\r\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\r\n * @param {Proton.Rectangle} rect\r\n */\r\n getImageData(context, image, rect) {\r\n context.drawImage(image, rect.x, rect.y);\r\n const imagedata = context.getImageData(rect.x, rect.y, rect.width, rect.height);\r\n context.clearRect(rect.x, rect.y, rect.width, rect.height);\r\n\r\n return imagedata;\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.Util\r\n * @method getImgFromCache\r\n *\r\n * @todo add description\r\n * @todo describe func\r\n *\r\n * @param {Mixed} img\r\n * @param {Proton.Particle} particle\r\n * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.transform.canvas\r\n * @param {Boolean} func\r\n */\r\n getImgFromCache(img, callback, param) {\r\n const src = typeof (img) == 'string' ? img : img.src;\r\n\r\n if (IMG_CACHE[src]) {\r\n callback(IMG_CACHE[src], param);\r\n } else {\r\n const image = new Image();\r\n image.onload = e => {\r\n IMG_CACHE[src] = e.target;\r\n callback(IMG_CACHE[src], param);\r\n }\r\n\r\n image.src = src;\r\n }\r\n },\r\n\r\n getCanvasFromCache(img, callback, param) {\r\n const src = img.src;\r\n\r\n if (!CANVAS_CACHE[src]) {\r\n const width = WebGLUtil.nhpot(img.width);\r\n const height = WebGLUtil.nhpot(img.height);\r\n\r\n const canvas = DomUtil.createCanvas(`canvas_cache_${canvasID}`, width, height);\r\n const context = canvas.getContext('2d');\r\n context.drawImage(img, 0, 0, img.width, img.height);\r\n\r\n CANVAS_CACHE[src] = canvas;\r\n }\r\n\r\n callback && callback(CANVAS_CACHE[src], param);\r\n\r\n return CANVAS_CACHE[src];\r\n }\r\n}","import Vector2D from '../math/Vector2D';\r\nimport Span from '../math/Span';\r\nimport ImgUtil from './ImgUtil';\r\nimport DomUtil from './DomUtil';\r\n\r\nexport default {\r\n\r\n /**\r\n * Returns the default if the value is null or undefined\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method initValue\r\n *\r\n * @param {Mixed} value a specific value, could be everything but null or undefined\r\n * @param {Mixed} defaults the default if the value is null or undefined\r\n */\r\n initValue(value, defaults) {\r\n value = (value !== null && value !== undefined) ? value : defaults;\r\n return value;\r\n },\r\n\r\n /**\r\n * Checks if the value is a valid array\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method isArray\r\n *\r\n * @param {Array} value Any array\r\n *\r\n * @returns {Boolean} \r\n */\r\n isArray(value) {\r\n return Object.prototype.toString.call(value) === '[object Array]';\r\n },\r\n\r\n /**\r\n * Destroyes the given array\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method destroyArray\r\n *\r\n * @param {Array} array Any array\r\n */\r\n destroyArray(array) {\r\n if (array) array.length = 0;\r\n },\r\n\r\n /**\r\n * Destroyes the given object\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method destroyObject\r\n *\r\n * @param {Object} obj Any object\r\n */\r\n destroyObject(obj, ignore) {\r\n for (let o in obj) {\r\n if (ignore && ignore.indexOf(o) > -1) continue;\r\n delete obj[o];\r\n }\r\n },\r\n\r\n /**\r\n * Makes an instance of a class and binds the given array\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method classApply\r\n *\r\n * @param {Function} constructor A class to make an instance from\r\n * @param {Array} [args] Any array to bind it to the constructor\r\n *\r\n * @return {Object} The instance of constructor, optionally bind with args\r\n */\r\n classApply(constructor, args) {\r\n if (!args) return new constructor;\r\n\r\n args = [null].concat(args);\r\n const factoryFunction = constructor.bind.apply(constructor, args);\r\n return new factoryFunction();\r\n },\r\n\r\n /**\r\n * @memberof Proton#Proton.Util\r\n * @method setVector2DByObject\r\n *\r\n * @todo add description for param `target`\r\n * @todo add description for param `pOBJ`\r\n * @todo add description for function\r\n *\r\n * @param {Object} target\r\n * @param {Object} pOBJ\r\n */\r\n setVector2DByObject(target, pOBJ) {\r\n if (this.hasProp(pOBJ, 'x')) target.p.x = pOBJ['x'];\r\n if (this.hasProp(pOBJ, 'y')) target.p.y = pOBJ['y'];\r\n\r\n if (this.hasProp(pOBJ, 'vx')) target.v.x = pOBJ['vx'];\r\n if (this.hasProp(pOBJ, 'vy')) target.v.y = pOBJ['vy'];\r\n\r\n if (this.hasProp(pOBJ, 'ax')) target.a.x = pOBJ['ax'];\r\n if (this.hasProp(pOBJ, 'ay')) target.a.y = pOBJ['ay'];\r\n\r\n if (this.hasProp(pOBJ, 'p')) particle.p.copy(pOBJ['p']);\r\n if (this.hasProp(pOBJ, 'v')) particle.v.copy(pOBJ['v']);\r\n if (this.hasProp(pOBJ, 'a')) particle.a.copy(pOBJ['a']);\r\n\r\n if (this.hasProp(pOBJ, 'position')) particle.p.copy(pOBJ['position']);\r\n if (this.hasProp(pOBJ, 'velocity')) particle.v.copy(pOBJ['velocity']);\r\n if (this.hasProp(pOBJ, 'accelerate')) particle.a.copy(pOBJ['accelerate']);\r\n },\r\n\r\n hasProp(obj, key) {\r\n if (!obj) return false;\r\n return obj[key] !== undefined;\r\n // return obj.hasOwnProperty(key);\r\n },\r\n\r\n /**\r\n * set the prototype in a given prototypeObject\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method setPrototypeByObject\r\n *\r\n * @todo add description for param `target`\r\n * @todo add description for param `filters`\r\n * @todo translate desription from chinese to english\r\n *\r\n * @param {Object} target\r\n * @param {Object} prototypeObject An object of single prototypes\r\n * @param {Object} filters\r\n *\r\n * @return {Object} target\r\n */\r\n setPrototypeByObject(target, prototypeObject, filters) {\r\n for (let singleProp in prototypeObject) {\r\n if (target.hasOwnProperty(singleProp)) {\r\n if (filters) {\r\n if (filters.indexOf(singleProp) < 0)\r\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\r\n } else {\r\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\r\n }\r\n }\r\n }\r\n\r\n return target;\r\n },\r\n\r\n /**\r\n * Returns a new Span object\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method setSpanValue\r\n *\r\n * @todo a, b and c should be 'Mixed' or 'Number'?\r\n *\r\n * @param {Mixed | Span} a\r\n * @param {Mixed} b\r\n * @param {Mixed} c\r\n *\r\n * @return {Span}\r\n */\r\n setSpanValue(a, b, c) {\r\n if (a instanceof Span) {\r\n return a;\r\n } else {\r\n if (!b) {\r\n return new Span(a);\r\n } else {\r\n if (!c)\r\n return new Span(a, b);\r\n else\r\n return new Span(a, b, c);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Returns the value from a Span, if the param is not a Span it will return the given parameter\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method getSpanValue\r\n *\r\n * @param {Mixed | Span} pan\r\n *\r\n * @return {Mixed} the value of Span OR the parameter if it is not a Span\r\n */\r\n getSpanValue(pan) {\r\n return pan instanceof Span ? pan.getValue() : pan;\r\n },\r\n\r\n /**\r\n * This will get the image data. It could be necessary to create a Proton.Zone.\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method getImageData\r\n *\r\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\r\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\r\n * @param {Proton.Rectangle} rect\r\n */\r\n getImageData(context, image, rect) {\r\n return ImgUtil.getImageData(context, image, rect);\r\n },\r\n\r\n destroy(arr, param) {\r\n let i = arr.length;\r\n\r\n while (i--) {\r\n try { arr[i].destroy(param); } catch (e) { }\r\n delete arr[i];\r\n }\r\n\r\n arr.length = 0;\r\n }\r\n\r\n}","export default {\r\n id: 0,\r\n cache: {},\r\n\r\n getID(target) {\r\n let uid = this.getCacheID(target);\r\n if (uid) return uid;\r\n\r\n uid = `PUID_${this.id++}`;\r\n this.cache[uid] = target;\r\n\r\n return uid;\r\n },\r\n\r\n getCacheID(target) {\r\n let obj;\r\n for (let id in this.cache) {\r\n obj = this.cache[id];\r\n\r\n if (obj === target) return id;\r\n \r\n if (typeof obj === 'object' && typeof target === 'object' && obj.isInner && target.isInner) {\r\n if (obj.src === target.src)\r\n return id;\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n\r\n getTarget(uid) {\r\n return this.cache[uid];\r\n }\r\n}","/**\r\n * get -> PUID :: uid-> Body\r\n * -> cache[abc]. -> cache[abc] .pop()\r\n * -> create [new Body| clone]\r\n * -> return p1: { __pid: abc }\r\n * \r\n * expire -> cache[abc]= [p0, p1];\r\n * \r\n */\r\nimport Util from '../utils/Util';\r\nimport PUID from '../utils/PUID';\r\n\r\nexport default class Pool {\r\n\r\n /**\r\n * @memberof! Proton#\r\n * @constructor\r\n * @alias Proton.Pool\r\n *\r\n * @todo add description\r\n * @todo add description of properties\r\n *\r\n * @property {Number} total\r\n * @property {Object} cache\r\n */\r\n constructor(num) {\r\n this.total = 0;\r\n this.cache = {};\r\n }\r\n\r\n /**\r\n * @todo add description\r\n *\r\n * @method get\r\n * @memberof Proton#Proton.Pool\r\n *\r\n * @param {Object|Function} target\r\n * @param {Object} [params] just add if `target` is a function\r\n *\r\n * @return {Object}\r\n */\r\n get(target, params, uid) {\r\n let p;\r\n uid = uid || target.__puid || PUID.getID(target);\r\n\r\n if (this.cache[uid] && this.cache[uid].length > 0)\r\n p = this.cache[uid].pop();\r\n else\r\n p = this.createOrClone(target, params);\r\n\r\n p.__puid = target.__puid || uid;\r\n return p;\r\n }\r\n\r\n /**\r\n * @todo add description\r\n *\r\n * @method set\r\n * @memberof Proton#Proton.Pool\r\n *\r\n * @param {Object} target\r\n *\r\n * @return {Object}\r\n */\r\n expire(target) {\r\n return this.getCache(target.__puid).push(target);\r\n }\r\n\r\n /**\r\n * Creates a new class instance\r\n *\r\n * @todo add more documentation \r\n *\r\n * @method create\r\n * @memberof Proton#Proton.Pool\r\n *\r\n * @param {Object|Function} target any Object or Function\r\n * @param {Object} [params] just add if `target` is a function\r\n *\r\n * @return {Object}\r\n */\r\n createOrClone(target, params) {\r\n this.total++;\r\n\r\n if (this.create) {\r\n return this.create(target, params);\r\n } else if (typeof target == \"function\") {\r\n return Util.classApply(target, params);\r\n } else {\r\n return target.clone();\r\n }\r\n }\r\n\r\n /**\r\n * @todo add description - what is in the cache?\r\n *\r\n * @method getCount\r\n * @memberof Proton#Proton.Pool\r\n *\r\n * @return {Number}\r\n */\r\n getCount() {\r\n let count = 0;\r\n\r\n for (let id in this.cache)\r\n count += this.cache[id].length;\r\n\r\n return count++;;\r\n }\r\n\r\n /**\r\n * Destroyes all items from Pool.cache\r\n *\r\n * @method destroy\r\n * @memberof Proton#Proton.Pool\r\n */\r\n destroy() {\r\n for (let id in this.cache) {\r\n this.cache[id].length = 0;\r\n delete this.cache[id];\r\n }\r\n }\r\n\r\n /**\r\n * Returns Pool.cache\r\n *\r\n * @method getCache\r\n * @memberof Proton#Proton.Pool\r\n * @private\r\n *\r\n * @param {Number} uid the unique id\r\n *\r\n * @return {Object}\r\n */\r\n getCache(uid) {\r\n uid = uid || \"default\";\r\n\r\n if (!this.cache[uid]) this.cache[uid] = [];\r\n return this.cache[uid];\r\n }\r\n}","export default class Stats {\r\n\r\n constructor(proton) {\r\n this.proton = proton;\r\n this.container = null;\r\n this.type = 1;\r\n\r\n this.emitterIndex = 0;\r\n this.rendererIndex = 0;\r\n }\r\n\r\n update(style, body) {\r\n this.add(style, body);\r\n\r\n const emitter = this.getEmitter();\r\n const renderer = this.getRenderer();\r\n let str = \"\";\r\n\r\n switch (this.type) {\r\n case 2:\r\n str += \"emitter:\" + this.proton.emitters.length + \"
\";\r\n if (emitter) str += \"em speed:\" + emitter.emitSpeed + \"
\";\r\n if (emitter) str += \"pos:\" + this.getEmitterPos(emitter);\r\n break;\r\n\r\n case 3:\r\n if (emitter) str += \"initializes:\" + emitter.initializes.length + \"
\";\r\n if (emitter) str += \"\" + this.concatArr(emitter.initializes) + \"
\";\r\n if (emitter) str += \"behaviours:\" + emitter.behaviours.length + \"
\";\r\n if (emitter) str += \"\" + this.concatArr(emitter.behaviours) + \"
\";\r\n break;\r\n\r\n case 4:\r\n if (renderer) str += renderer.name + \"
\";\r\n if (renderer) str += \"body:\" + this.getCreatedNumber(renderer) + \"
\";\r\n break;\r\n\r\n default:\r\n str += \"particles:\" + this.proton.getCount() + \"
\";\r\n str += \"pool:\" + this.proton.pool.getCount() + \"
\";\r\n str += \"total:\" + this.proton.pool.total;\r\n }\r\n\r\n this.container.innerHTML = str;\r\n }\r\n\r\n add(style, body) {\r\n if (!this.container) {\r\n this.type = 1;\r\n\r\n this.container = document.createElement('div');\r\n this.container.style.cssText = [\r\n 'position:absolute;bottom:0px;left:0;cursor:pointer;',\r\n 'opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;',\r\n 'width:120px;height:50px;background-color:#002;color:#0ff;'\r\n ].join('');\r\n\r\n this.container.addEventListener('click', e => {\r\n this.type++;\r\n if (this.type > 4) this.type = 1;\r\n }, false);\r\n\r\n let bg, color;\r\n switch (style) {\r\n case 2:\r\n bg = \"#201\";\r\n color = \"#f08\";\r\n break;\r\n\r\n case 3:\r\n bg = \"#020\";\r\n color = \"#0f0\";\r\n break;\r\n\r\n default:\r\n bg = \"#002\";\r\n color = \"#0ff\";\r\n }\r\n\r\n this.container.style[\"background-color\"] = bg;\r\n this.container.style[\"color\"] = color;\r\n }\r\n\r\n if (!this.container.parentNode) {\r\n body = body || this.body || document.body;\r\n body.appendChild(this.container);\r\n }\r\n }\r\n\r\n getEmitter() {\r\n return this.proton.emitters[this.emitterIndex];\r\n }\r\n\r\n getRenderer() {\r\n return this.proton.renderers[this.rendererIndex];\r\n }\r\n\r\n concatArr(arr) {\r\n let result = '';\r\n if (!arr || !arr.length) return result;\r\n\r\n for (let i = 0; i < arr.length; i++) {\r\n result += (arr[i].name || '').substr(0, 1) + '.';\r\n }\r\n\r\n return result;\r\n }\r\n\r\n getCreatedNumber(renderer) {\r\n return renderer.pool.total || (renderer.cpool && renderer.cpool.total) || 0;\r\n }\r\n\r\n getEmitterPos(e) {\r\n return Math.round(e.p.x) + \",\" + Math.round(e.p.y);\r\n }\r\n}","/*\r\n * EventDispatcher\r\n * This code reference since http://createjs.com/.\r\n *\r\n **/\r\n\r\nexport default class EventDispatcher {\r\n\r\n constructor() {\r\n this._listeners = null;\r\n }\r\n\r\n static bind(TargetClass){\r\n TargetClass.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent;\r\n TargetClass.prototype.hasEventListener = EventDispatcher.prototype.hasEventListener;\r\n TargetClass.prototype.addEventListener = EventDispatcher.prototype.addEventListener;\r\n TargetClass.prototype.removeEventListener = EventDispatcher.prototype.removeEventListener;\r\n TargetClass.prototype.removeAllEventListeners = EventDispatcher.prototype.removeAllEventListeners;\r\n }\r\n\r\n addEventListener(type, listener) {\r\n if (!this._listeners) {\r\n this._listeners = {};\r\n } else {\r\n this.removeEventListener(type, listener);\r\n }\r\n\r\n if (!this._listeners[type]) this._listeners[type] = [];\r\n this._listeners[type].push(listener);\r\n\r\n return listener;\r\n }\r\n\r\n removeEventListener(type, listener) {\r\n if (!this._listeners) return;\r\n if (!this._listeners[type]) return;\r\n\r\n const arr = this._listeners[type];\r\n const length = arr.length;\r\n\r\n for (let i = 0;i < length; i++) {\r\n if (arr[i] == listener) {\r\n if (length == 1) {\r\n delete (this._listeners[type]);\r\n }\r\n\r\n // allows for faster checks.\r\n else {\r\n arr.splice(i, 1);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n removeAllEventListeners(type) {\r\n if (!type)\r\n this._listeners = null;\r\n else if (this._listeners)\r\n delete (this._listeners[type]);\r\n }\r\n\r\n dispatchEvent(type, args) {\r\n let result = false;\r\n const listeners = this._listeners;\r\n\r\n if (type && listeners) {\r\n let arr = listeners[type];\r\n if (!arr) return result;\r\n\r\n //arr = arr.slice();\r\n // to avoid issues with items being removed or added during the dispatch\r\n\r\n let handler;\r\n let i = arr.length;\r\n while (i--) {\r\n handler = arr[i];\r\n result = result || handler(args);\r\n }\r\n\r\n }\r\n\r\n return !!result;\r\n }\r\n\r\n hasEventListener(type) {\r\n const listeners = this._listeners;\r\n return !!(listeners && listeners[type]);\r\n }\r\n\r\n}","import Util from '../utils/Util';\r\n\r\nexport default class Integration {\r\n\r\n\tconstructor(type) {\r\n\t\tthis.type = type;\r\n\t}\r\n\r\n\tcalculate(particles, time, damping) {\r\n\t\tthis.eulerIntegrate(particles, time, damping);\r\n\t}\r\n\r\n\t// Euler Integrate\r\n\teulerIntegrate(particle, time, damping) {\r\n\t\tif (!particle.sleep) {\r\n\t\t\tparticle.old.p.copy(particle.p);\r\n\t\t\tparticle.old.v.copy(particle.v);\r\n\r\n\t\t\tparticle.a.multiplyScalar(1 / particle.mass);\r\n\t\t\tparticle.v.add(particle.a.multiplyScalar(time));\r\n\t\t\tparticle.p.add(particle.old.v.multiplyScalar(time));\r\n\r\n\t\t\tif (damping) particle.v.multiplyScalar(damping);\r\n\r\n\t\t\tparticle.a.clear();\r\n\t\t}\r\n\t}\r\n}","import Pool from './Pool';\r\nimport Util from '../utils/Util';\r\nimport Stats from '../debug/Stats';\r\nimport EventDispatcher from '../events/EventDispatcher';\r\nimport Integration from '../math/Integration';\r\n\r\nexport default class Proton {\r\n\r\n static USE_CLOCK = false;\r\n\r\n //1:100\r\n static MEASURE = 100;\r\n static EULER = 'euler';\r\n static RK2 = 'runge-kutta2';\r\n\r\n static PARTICLE_CREATED = 'PARTICLE_CREATED';\r\n static PARTICLE_UPDATE = 'PARTICLE_UPDATE';\r\n static PARTICLE_SLEEP = 'PARTICLE_SLEEP';\r\n static PARTICLE_DEAD = 'PARTICLE_DEAD';\r\n static PROTON_UPDATE = 'PROTON_UPDATE';\r\n static PROTON_UPDATE_AFTER = 'PROTON_UPDATE_AFTER';\r\n static EMITTER_ADDED = 'EMITTER_ADDED';\r\n static EMITTER_REMOVED = 'EMITTER_REMOVED';\r\n\r\n static amendChangeTabsBug = true;\r\n\r\n /**\r\n * The constructor to add emitters\r\n *\r\n * @constructor Proton\r\n *\r\n * @todo proParticleCount is not in use\r\n * @todo add more documentation of the single properties and parameters\r\n *\r\n * @param {Number} [proParticleCount] not in use?\r\n * @param {Number} [integrationType=Proton.EULER]\r\n *\r\n * @property {String} [integrationType=Proton.EULER]\r\n * @property {Array} emitters All added emitter\r\n * @property {Array} renderers All added renderer\r\n * @property {Number} time The active time\r\n * @property {Number} oldtime The old time\r\n */\r\n constructor(integrationType) {\r\n\r\n this.emitters = [];\r\n this.renderers = [];\r\n\r\n this.time = 0;\r\n this.oldTime = 0;\r\n this.elapsed = 0;\r\n\r\n this.stats = new Stats(this);\r\n this.pool = new Pool(80);\r\n\r\n this.integrationType = Util.initValue(integrationType, Proton.EULER);\r\n this.integrator = new Integration(this.integrationType);\r\n }\r\n\r\n /**\r\n * add a type of Renderer\r\n *\r\n * @method addRenderer\r\n * @memberof Proton\r\n * @instance\r\n *\r\n * @param {Renderer} render\r\n */\r\n addRenderer(render) {\r\n render.init(this);\r\n this.renderers.push(render);\r\n }\r\n\r\n /**\r\n * @name add a type of Renderer\r\n *\r\n * @method addRenderer\r\n * @param {Renderer} render\r\n */\r\n removeRenderer(render) {\r\n const index = this.renderers.indexOf(render);\r\n this.renderers.splice(index, 1);\r\n render.remove(this);\r\n }\r\n\r\n /**\r\n * add the Emitter\r\n *\r\n * @method addEmitter\r\n * @memberof Proton\r\n * @instance\r\n *\r\n * @param {Emitter} emitter\r\n */\r\n addEmitter(emitter) {\r\n this.emitters.push(emitter);\r\n emitter.parent = this;\r\n\r\n this.dispatchEvent(Proton.EMITTER_ADDED, emitter);\r\n }\r\n\r\n /**\r\n * Removes an Emitter\r\n *\r\n * @method removeEmitter\r\n * @memberof Proton\r\n * @instance\r\n *\r\n * @param {Proton.Emitter} emitter\r\n */\r\n removeEmitter(emitter) {\r\n const index = this.emitters.indexOf(emitter);\r\n this.emitters.splice(index, 1);\r\n emitter.parent = null;\r\n\r\n this.dispatchEvent(Proton.EMITTER_REMOVED, emitter);\r\n }\r\n\r\n /**\r\n * Updates all added emitters\r\n *\r\n * @method update\r\n * @memberof Proton\r\n * @instance\r\n */\r\n update() {\r\n this.dispatchEvent(Proton.PROTON_UPDATE);\r\n\r\n if (Proton.USE_CLOCK) {\r\n if (!this.oldTime) this.oldTime = (new Date()).getTime();\r\n\r\n let time = new Date().getTime();\r\n this.elapsed = (time - this.oldTime) / 1000;\r\n Proton.amendChangeTabsBug && this.amendChangeTabsBug();\r\n\r\n this.oldTime = time;\r\n } else {\r\n this.elapsed = 0.0167;\r\n }\r\n\r\n // emitter update\r\n if (this.elapsed > 0) this.emittersUpdate(this.elapsed);\r\n\r\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\r\n }\r\n\r\n emittersUpdate(elapsed) {\r\n let i = this.emitters.length;\r\n while (i--) this.emitters[i].update(elapsed);\r\n }\r\n\r\n /**\r\n * @todo add description\r\n *\r\n * @method amendChangeTabsBug\r\n * @memberof Proton\r\n * @instance\r\n */\r\n amendChangeTabsBug() {\r\n if (this.elapsed > .5) {\r\n this.oldTime = (new Date()).getTime();\r\n this.elapsed = 0;\r\n }\r\n }\r\n\r\n /**\r\n * Counts all particles from all emitters\r\n *\r\n * @method getCount\r\n * @memberof Proton\r\n * @instance\r\n */\r\n getCount() {\r\n let total = 0;\r\n let i = this.emitters.length;\r\n\r\n while (i--) total += this.emitters[i].particles.length;\r\n return total;\r\n }\r\n\r\n getAllParticles() {\r\n let particles = [];\r\n let i = this.emitters.length;\r\n\r\n while (i--) particles = particles.concat(this.emitters[i].particles);\r\n return particles;\r\n }\r\n\r\n /**\r\n * Destroys everything related to this Proton instance. This includes all emitters, and all properties\r\n *\r\n * @method destroy\r\n * @memberof Proton\r\n * @instance\r\n */\r\n destroy() {\r\n Util.destroy(this.renderers, this.getAllParticles());\r\n Util.destroy(this.emitters);\r\n\r\n this.time = 0;\r\n this.oldTime = 0;\r\n\r\n this.pool.destroy();\r\n }\r\n}\r\n\r\nEventDispatcher.bind(Proton);","import MathUtils from './MathUtils';\r\n\r\nexport default {\r\n\r\n easeLinear(value) {\r\n return value;\r\n },\r\n\r\n easeInQuad(value) {\r\n return Math.pow(value, 2);\r\n },\r\n\r\n easeOutQuad(value) {\r\n return -(Math.pow((value - 1), 2) - 1);\r\n },\r\n\r\n easeInOutQuad(value) {\r\n if ((value /= 0.5) < 1)\r\n return 0.5 * Math.pow(value, 2);\r\n\r\n return -0.5 * ((value -= 2) * value - 2);\r\n },\r\n\r\n easeInCubic(value) {\r\n return Math.pow(value, 3);\r\n },\r\n\r\n easeOutCubic(value) {\r\n return (Math.pow((value - 1), 3) + 1);\r\n },\r\n\r\n easeInOutCubic(value) {\r\n if ((value /= 0.5) < 1)\r\n return 0.5 * Math.pow(value, 3);\r\n\r\n return 0.5 * (Math.pow((value - 2), 3) + 2);\r\n },\r\n\r\n easeInQuart(value) {\r\n return Math.pow(value, 4);\r\n },\r\n\r\n easeOutQuart(value) {\r\n return -(Math.pow((value - 1), 4) - 1);\r\n },\r\n\r\n easeInOutQuart(value) {\r\n if ((value /= 0.5) < 1)\r\n return 0.5 * Math.pow(value, 4);\r\n\r\n return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2);\r\n },\r\n\r\n easeInSine(value) {\r\n return -Math.cos(value * (MathUtils.PI_2)) + 1;\r\n },\r\n\r\n easeOutSine(value) {\r\n return Math.sin(value * (MathUtils.PI_2));\r\n },\r\n\r\n easeInOutSine(value) {\r\n return (-0.5 * (Math.cos(MathUtils.PI * value) - 1));\r\n },\r\n\r\n easeInExpo(value) {\r\n return (value === 0) ? 0 : Math.pow(2, 10 * (value - 1));\r\n },\r\n\r\n easeOutExpo(value) {\r\n return (value === 1) ? 1 : -Math.pow(2, -10 * value) + 1;\r\n },\r\n\r\n easeInOutExpo(value) {\r\n if (value === 0)\r\n return 0;\r\n\r\n if (value === 1)\r\n return 1;\r\n\r\n if ((value /= 0.5) < 1)\r\n return 0.5 * Math.pow(2, 10 * (value - 1));\r\n\r\n return 0.5 * (-Math.pow(2, -10 * --value) + 2);\r\n },\r\n\r\n easeInCirc(value) {\r\n return -(Math.sqrt(1 - (value * value)) - 1);\r\n },\r\n\r\n easeOutCirc(value) {\r\n return Math.sqrt(1 - Math.pow((value - 1), 2));\r\n },\r\n\r\n easeInOutCirc(value) {\r\n if ((value /= 0.5) < 1)\r\n return -0.5 * (Math.sqrt(1 - value * value) - 1);\r\n return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1);\r\n },\r\n\r\n easeInBack(value) {\r\n let s = 1.70158;\r\n return (value) * value * ((s + 1) * value - s);\r\n },\r\n\r\n easeOutBack(value) {\r\n let s = 1.70158;\r\n return (value = value - 1) * value * ((s + 1) * value + s) + 1;\r\n },\r\n\r\n easeInOutBack(value) {\r\n let s = 1.70158;\r\n if ((value /= 0.5) < 1)\r\n return 0.5 * (value * value * (((s *= (1.525)) + 1) * value - s));\r\n return 0.5 * ((value -= 2) * value * (((s *= (1.525)) + 1) * value + s) + 2);\r\n },\r\n\r\n getEasing(ease) {\r\n if (typeof ease === 'function')\r\n return ease;\r\n else\r\n return this[ease] || this.easeLinear;\r\n }\r\n};","import Util from '../utils/Util';\r\nimport ease from '../math/ease';\r\nimport Vector2D from '../math/Vector2D';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default class Particle {\r\n\r\n static ID = 0;\r\n\r\n /**\r\n * the Particle class\r\n *\r\n * @class Proton.Particle\r\n * @constructor\r\n * @param {Object} pObj the parameters object;\r\n * for example {life:3,dead:false}\r\n */\r\n constructor(pOBJ) {\r\n /**\r\n * The particle's id;\r\n * @property id\r\n * @type {string}\r\n */\r\n this.id = `particle_${Particle.ID++}`;\r\n this.reset('init');\r\n\r\n pOBJ && Util.setPrototypeByObject(this, pOBJ);\r\n }\r\n\r\n getDirection() {\r\n return Math.atan2(this.v.x, -this.v.y) * MathUtils.N180_PI;\r\n }\r\n\r\n reset(init) {\r\n this.life = Infinity;\r\n this.age = 0;\r\n\r\n //Energy loss\r\n this.energy = 1;\r\n this.dead = false;\r\n this.sleep = false;\r\n this.body = null;\r\n this.sprite = null;\r\n this.parent = null;\r\n\r\n this.mass = 1;\r\n this.radius = 10;\r\n this.alpha = 1;\r\n this.scale = 1;\r\n this.rotation = 0;\r\n this.color = null;\r\n\r\n this.easing = ease.easeLinear;\r\n\r\n if (init == 'init') {\r\n this.transform = {};\r\n this.p = new Vector2D();\r\n this.v = new Vector2D();\r\n this.a = new Vector2D();\r\n\r\n this.old = {\r\n p: new Vector2D(),\r\n v: new Vector2D(),\r\n a: new Vector2D()\r\n };\r\n\r\n this.behaviours = [];\r\n } else {\r\n Util.destroyObject(this.transform, 'rgb');\r\n\r\n this.p.set(0, 0);\r\n this.v.set(0, 0);\r\n this.a.set(0, 0);\r\n\r\n this.old.p.set(0, 0);\r\n this.old.v.set(0, 0);\r\n this.old.a.set(0, 0);\r\n\r\n this.removeAllBehaviours();\r\n }\r\n\r\n if (!this.transform.rgb) {\r\n this.transform.rgb = { r: 255, g: 255, b: 255 };\r\n } else {\r\n this.transform.rgb.r = 255;\r\n this.transform.rgb.g = 255;\r\n this.transform.rgb.b = 255;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n update(time, index) {\r\n if (!this.sleep) {\r\n this.age += time;\r\n this.applyBehaviours(time, index);\r\n }\r\n\r\n if (this.age < this.life) {\r\n const scale = this.easing(this.age / this.life);\r\n this.energy = Math.max(1 - scale, 0);\r\n } else {\r\n this.destroy();\r\n }\r\n }\r\n\r\n applyBehaviours(time, index) {\r\n const length = this.behaviours.length;\r\n let i;\r\n\r\n for (i = 0; i < length; i++) {\r\n this.behaviours[i] && this.behaviours[i].applyBehaviour(this, time, index)\r\n }\r\n }\r\n\r\n addBehaviour(behaviour) {\r\n this.behaviours.push(behaviour);\r\n\r\n if (behaviour.hasOwnProperty('parents')) behaviour.parents.push(this);\r\n behaviour.initialize(this);\r\n }\r\n\r\n addBehaviours(behaviours) {\r\n const length = behaviours.length;\r\n let i;\r\n\r\n for (i = 0; i < length; i++) {\r\n this.addBehaviour(behaviours[i]);\r\n }\r\n }\r\n\r\n removeBehaviour(behaviour) {\r\n const index = this.behaviours.indexOf(behaviour);\r\n\r\n if (index > -1) {\r\n const behaviour = this.behaviours.splice(index, 1);\r\n behaviour.parents = null;\r\n }\r\n }\r\n\r\n removeAllBehaviours() {\r\n Util.destroyArray(this.behaviours);\r\n }\r\n\r\n /**\r\n * Destory this particle\r\n * @method destroy\r\n */\r\n destroy() {\r\n this.removeAllBehaviours();\r\n this.energy = 0;\r\n this.dead = true;\r\n this.parent = null;\r\n }\r\n\r\n}","export default {\r\n\r\n /**\r\n * @typedef {Object} rgbObject\r\n * @property {Number} r red value\r\n * @property {Number} g green value\r\n * @property {Number} b blue value\r\n */\r\n /**\r\n * converts a hex value to a rgb object\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method hexToRGB\r\n *\r\n * @param {String} h any hex value, e.g. #000000 or 000000 for black\r\n *\r\n * @return {rgbObject}\r\n */\r\n hexToRGB(h) {\r\n const hex16 = (h.charAt(0) == \"#\") ? h.substring(1, 7) : h;\r\n const r = parseInt(hex16.substring(0, 2), 16);\r\n const g = parseInt(hex16.substring(2, 4), 16);\r\n const b = parseInt(hex16.substring(4, 6), 16);\r\n\r\n return { r, g, b };\r\n },\r\n\r\n /**\r\n * converts a rgb value to a rgb string\r\n *\r\n * @memberof Proton#Proton.Util\r\n * @method rgbToHex\r\n *\r\n * @param {Object | Proton.hexToRGB} rgb a rgb object like in {@link Proton#Proton.}\r\n *\r\n * @return {String} rgb()\r\n */\r\n rgbToHex(rbg) {\r\n return `rgb(${rbg.r}, ${rbg.g}, ${rbg.b})`;\r\n },\r\n\r\n getHex16FromParticle(p) {\r\n return Number(p.transform.rgb.r) * 65536 + Number(p.transform.rgb.g) * 256 + Number(p.transform.rgb.b);\r\n }\r\n}","import Vector2D from './Vector2D';\r\n\r\nexport default class Polar2D {\r\n\r\n\tconstructor(r, tha) {\r\n\t\tthis.r = Math.abs(r) || 0;\r\n\t\tthis.tha = tha || 0;\r\n\t}\r\n\r\n\tset(r, tha) {\r\n\t\tthis.r = r;\r\n\t\tthis.tha = tha;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetR(r) {\r\n\t\tthis.r = r;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetTha(tha) {\r\n\t\tthis.tha = tha;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tcopy(p) {\r\n\t\tthis.r = p.r;\r\n\t\tthis.tha = p.tha;\r\n\t\treturn this;\r\n\t}\r\n\r\n\ttoVector() {\r\n\t\treturn new Vector2D(this.getX(), this.getY());\r\n\t}\r\n\r\n\tgetX() {\r\n\t\treturn this.r * Math.sin(this.tha);\r\n\t}\r\n\r\n\tgetY() {\r\n\t\treturn -this.r * Math.cos(this.tha);\r\n\t}\r\n\r\n\tnormalize() {\r\n\t\tthis.r = 1;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tequals(v) {\r\n\t\treturn ((v.r === this.r) && (v.tha === this.tha));\r\n\t}\r\n\r\n\tclear() {\r\n\t\tthis.r = 0.0;\r\n\t\tthis.tha = 0.0;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tclone() {\r\n\t\treturn new Polar2D(this.r, this.tha);\r\n\t}\r\n}","export default {\r\n\tcreate(mat3) {\r\n\t\tconst mat = new Float32Array(9);\r\n\t\tif (mat3) this.set(mat3, mat);\r\n\r\n\t\treturn mat;\r\n\t},\r\n\r\n\tset(mat1, mat2) {\r\n\t\tfor (let i = 0; i < 9; i++)\r\n\t\t\tmat2[i] = mat1[i];\r\n\r\n\t\treturn mat2;\r\n\t},\r\n\r\n\tmultiply(mat, mat2, mat3) {\r\n\t\tlet a00 = mat[0], a01 = mat[1], a02 = mat[2], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b00 = mat2[0], b01 = mat2[1], b02 = mat2[2], b10 = mat2[3], b11 = mat2[4], b20 = mat2[6], b21 = mat2[7];\r\n\r\n\t\tmat3[0] = b00 * a00 + b01 * a10;\r\n\t\tmat3[1] = b00 * a01 + b01 * a11;\r\n\t\tmat3[2] = a02 * b02;\r\n\t\tmat3[3] = b10 * a00 + b11 * a10;\r\n\t\tmat3[4] = b10 * a01 + b11 * a11;\r\n\t\tmat3[6] = b20 * a00 + b21 * a10 + a20;\r\n\t\tmat3[7] = b20 * a01 + b21 * a11 + a21;\r\n\r\n\t\treturn mat3;\r\n\t},\r\n\r\n\tinverse(mat, mat3) {\r\n\t\tlet a00 = mat[0], a01 = mat[1], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b01 = a11, b11 = -a10, b21 = a21 * a10 - a11 * a20, d = a00 * b01 + a01 * b11, id;\r\n\r\n\t\tid = 1 / d;\r\n\t\tmat3[0] = b01 * id;\r\n\t\tmat3[1] = (-a01) * id;\r\n\t\tmat3[3] = b11 * id;\r\n\t\tmat3[4] = a00 * id;\r\n\t\tmat3[6] = b21 * id;\r\n\t\tmat3[7] = (-a21 * a00 + a01 * a20) * id;\r\n\r\n\t\treturn mat3;\r\n\t},\r\n\r\n\tmultiplyVec2(m, vec, mat3) {\r\n\t\tlet x = vec[0], y = vec[1];\r\n\r\n\t\tmat3[0] = x * m[0] + y * m[3] + m[6];\r\n\t\tmat3[1] = x * m[1] + y * m[4] + m[7];\r\n\r\n\t\treturn mat3;\r\n\t}\r\n}","import Span from './Span';\r\nimport Util from '../utils/Util';\r\nimport MathUtils from './MathUtils';\r\n\r\nexport default class ArraySpan extends Span {\r\n\r\n constructor(color) {\r\n super();\r\n this._arr = Util.isArray(color) ? color : [color];\r\n }\r\n\r\n getValue() {\r\n const color = this._arr[Math.floor(this._arr.length * Math.random())];\r\n return color === 'random' || color === 'Random' ? MathUtils.randomColor() : color;\r\n }\r\n\r\n /**\r\n * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance\r\n *\r\n * @method setSpanValue\r\n * @memberof Proton#Proton.Color\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n * @param {Number} the integrate time 1/ms\r\n * @param {Int} the particle index\r\n */\r\n static createArraySpan(arr) {\r\n if (!arr) return null;\r\n\r\n if (arr instanceof ArraySpan)\r\n return arr;\r\n else\r\n return new ArraySpan(arr);\r\n }\r\n\r\n}","export default class Rectangle {\r\n\r\n\tconstructor(x, y, w, h) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\r\n\t\tthis.width = w;\r\n\t\tthis.height = h;\r\n\r\n\t\tthis.bottom = this.y + this.height;\r\n\t\tthis.right = this.x + this.width;\r\n\t}\r\n\r\n\tcontains(x, y) {\r\n\t\tif (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y)\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}\r\n}\r\n","import Util from '../utils/Util';\r\n\r\nexport default class Rate {\r\n\r\n\t/**\r\n\t * The number of particles per second emission (a [particle]/b [s]);\r\n\t * @namespace\r\n\t * @memberof! Proton#\r\n\t * @constructor\r\n\t * @alias Rate\r\n\t *\r\n\t * @param {Array | Number | Span} numpan the number of each emission;\r\n\t * @param {Array | Number | Span} timepan the time of each emission;\r\n\t * for example: new Rate(new Span(10, 20), new Span(.1, .25));\r\n\t */\r\n\tconstructor(numpan, timepan) {\r\n\t\tthis.numPan = Util.setSpanValue(Util.initValue(numpan, 1));\r\n\t\tthis.timePan = Util.setSpanValue(Util.initValue(timepan, 1));\r\n\r\n\t\tthis.startTime = 0;\r\n\t\tthis.nextTime = 0;\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.startTime = 0;\r\n\t\tthis.nextTime = this.timePan.getValue();\r\n\t}\r\n\r\n\tgetValue(time) {\r\n\t\tthis.startTime += time;\r\n\r\n\t\tif (this.startTime >= this.nextTime) {\r\n\t\t\tthis.startTime = 0;\r\n\t\t\tthis.nextTime = this.timePan.getValue();\r\n\r\n\t\t\tif (this.numPan.b == 1) {\r\n\t\t\t\tif (this.numPan.getValue(false) > 0.5)\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn 0;\r\n\t\t\t} else {\r\n\t\t\t\treturn this.numPan.getValue(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}\r\n}","export default class Initialize {\r\n\t\r\n\treset() {\r\n\t}\r\n\r\n\tinit(emitter, particle) {\r\n\t\tif (particle) {\r\n\t\t\tthis.initialize(particle);\r\n\t\t} else {\r\n\t\t\tthis.initialize(emitter);\r\n\t\t}\r\n\t};\r\n\r\n\t///sub class init\r\n\tinitialize(target) {\r\n\t};\r\n}","import Util from '../utils/Util';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Life extends Initialize {\r\n\r\n\tconstructor(a, b, c) {\r\n\t\tsuper();\r\n\r\n\t\tthis.lifePan = Util.setSpanValue(a, b, c);\r\n\t\tthis.name = 'Life';\r\n\t}\r\n\r\n\tinitialize(target) {\r\n\t\tif (this.lifePan.a == Infinity)\r\n\t\t\ttarget.life = Infinity;\r\n\t\telse\r\n\t\t\ttarget.life = this.lifePan.getValue();\r\n\t}\r\n}\r\n","import Vector2D from '../math/Vector2D';\r\n\r\nexport default class Zone {\r\n\tconstructor() {\r\n\t\tthis.vector = new Vector2D(0, 0);\r\n\t\tthis.random = 0;\r\n\t\tthis.crossType = \"dead\";\r\n\t\tthis.alert = true;\r\n\t}\r\n\r\n\tgetPosition() {\r\n\t}\r\n\r\n\tcrossing(particle) {\r\n\t}\r\n}","import Zone from './Zone';\r\n\r\nexport default class PointZone extends Zone {\r\n\r\n\tconstructor(x, y) {\r\n\t\tsuper();\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}\r\n\r\n\tgetPosition() {\r\n\t\tthis.vector.x = this.x;\r\n\t\tthis.vector.y = this.y;\r\n\r\n\t\treturn this.vector;\r\n\t}\r\n\r\n\tcrossing(particle) {\r\n\t\t\r\n\t\tif (this.alert) {\r\n\t\t\talert('Sorry PointZone does not support crossing method');\r\n\t\t\tthis.alert = false;\r\n\t\t}\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport PointZone from '../zone/PointZone';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Position extends Initialize {\r\n\r\n\tconstructor(zone) {\r\n\t\tsuper();\r\n\t\tthis.zone = Util.initValue(zone, new PointZone());\r\n\r\n\t\tthis.name = 'Position';\r\n\t}\r\n\r\n\treset(zone) {\r\n\t\tthis.zone = Util.initValue(zone, new PointZone());\r\n\t}\r\n\r\n\tinitialize(target) {\r\n\t\tthis.zone.getPosition();\r\n\r\n\t\ttarget.p.x = this.zone.vector.x;\r\n\t\ttarget.p.y = this.zone.vector.y;\r\n\t};\r\n\r\n}\r\n","import Proton from '../core/Proton';\r\nimport Util from '../utils/Util';\r\nimport Polar2D from '../math/Polar2D';\r\nimport MathUtils from '../math/MathUtils';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Velocity extends Initialize {\r\n\r\n constructor(rpan, thapan, type) {\r\n super();\r\n\r\n this.rPan = Util.setSpanValue(rpan);\r\n this.thaPan = Util.setSpanValue(thapan);\r\n this.type = Util.initValue(type, 'vector');\r\n\r\n this.name = 'Velocity';\r\n }\r\n\r\n reset(rpan, thapan, type) {\r\n this.rPan = Util.setSpanValue(rpan);\r\n this.thaPan = Util.setSpanValue(thapan);\r\n this.type = Util.initValue(type, 'vector');\r\n };\r\n\r\n normalizeVelocity(vr) {\r\n return vr * Proton.MEASURE;\r\n }\r\n\r\n initialize(target) {\r\n if (this.type == 'p' || this.type == 'P' || this.type == 'polar') {\r\n const polar2d = new Polar2D(this.normalizeVelocity(this.rPan.getValue()), this.thaPan.getValue() * MathUtils.PI_180);\r\n\r\n target.v.x = polar2d.getX();\r\n target.v.y = polar2d.getY();\r\n } else {\r\n target.v.x = this.normalizeVelocity(this.rPan.getValue());\r\n target.v.y = this.normalizeVelocity(this.thaPan.getValue());\r\n }\r\n };\r\n}","import Util from '../utils/Util';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Mass extends Initialize {\r\n\r\n\tconstructor(a, b, c) {\r\n\t\tsuper();\r\n\t\tthis.massPan = Util.setSpanValue(a, b, c);\r\n\t\tthis.name = 'Mass';\r\n\t}\r\n\r\n\tinitialize(target) {\r\n\t\ttarget.mass = this.massPan.getValue();\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Radius extends Initialize {\r\n\r\n\tconstructor(a, b, c) {\r\n\t\tsuper();\r\n\t\tthis.radius = Util.setSpanValue(a, b, c);\r\n\r\n\t\tthis.name = 'Radius';\r\n\t}\r\n\r\n\treset(a, b, c) {\r\n\t\tthis.radius = Util.setSpanValue(a, b, c);\r\n\t};\r\n\r\n\tinitialize(particle) {\r\n\t\tparticle.radius = this.radius.getValue();\r\n\t\tparticle.transform.oldRadius = particle.radius;\r\n\t};\r\n}","import Util from '../utils/Util';\r\nimport ArraySpan from '../math/ArraySpan';\r\nimport Initialize from './Initialize';\r\n\r\nexport default class Body extends Initialize {\r\n\r\n constructor(image, w, h) {\r\n super();\r\n\r\n this.image = this.setSpanValue(image);\r\n this.w = Util.initValue(w, 20);\r\n this.h = Util.initValue(h, this.w);\r\n this.name = 'Body';\r\n }\r\n\r\n initialize(particle) {\r\n const imagetarget = this.image.getValue();\r\n\r\n if (typeof(imagetarget) == 'string') {\r\n particle.body = { width: this.w, height: this.h, src: imagetarget , isInner: true, inner: true };\r\n } else {\r\n particle.body = imagetarget;\r\n }\r\n };\r\n\r\n setSpanValue(color) {\r\n return color instanceof ArraySpan ? color : new ArraySpan(color);\r\n }\r\n}","import Proton from '../core/Proton';\r\nimport Util from '../utils/Util';\r\nimport ease from '../math/ease';\r\n\r\nexport default class Behaviour {\r\n static id = 0;\r\n\r\n /**\r\n * The Behaviour class is the base for the other Behaviour\r\n *\r\n * @memberof! -\r\n * @interface\r\n * @alias Proton.Behaviour\r\n *\r\n * @param {Number} life \tthe behaviours life\r\n * @param {String} easing \tThe behaviour's decaying trend, for example ease.easeOutQuart\r\n *\r\n * @property {String} id \t\tThe behaviours id\r\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n * @property {Number} age=0 \tHow long the particle should be 'alife'\r\n * @property {Number} energy=1\r\n * @property {Boolean} dead=false The particle is dead at first\r\n * @property {Array} parents \tThe behaviour's parents array\r\n * @property {String} name \tThe behaviour name\r\n */\r\n constructor(life, easing) {\r\n\r\n this.life = Util.initValue(life, Infinity);\r\n this.easing = ease.getEasing(easing);\r\n\r\n this.age = 0;\r\n this.energy = 1;\r\n this.dead = false;\r\n this.parents = [];\r\n\r\n this.id = `Behaviour_${Behaviour.id++}`;\r\n this.name = 'Behaviour';\r\n }\r\n\r\n /**\r\n * Reset this behaviour's parameters\r\n *\r\n * @method reset\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n *\r\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\r\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\r\n */\r\n reset(life, easing) {\r\n this.life = Util.initValue(life, Infinity);\r\n this.easing = ease.getEasing(easing);\r\n }\r\n\r\n /**\r\n * Normalize a force by 1:100;\r\n *\r\n * @method normalizeForce\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n *\r\n * @param {Proton.Vector2D} force \r\n */\r\n normalizeForce(force) {\r\n return force.multiplyScalar(Proton.MEASURE);\r\n }\r\n\r\n /**\r\n * Normalize a value by 1:100;\r\n *\r\n * @method normalizeValue\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n *\r\n * @param {Number} value\r\n */\r\n normalizeValue(value) {\r\n return value * Proton.MEASURE;\r\n }\r\n\r\n /**\r\n * Initialize the behaviour's parameters for all particles\r\n *\r\n * @method initialize\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n */\r\n initialize(particle) {}\r\n\r\n /**\r\n * Apply this behaviour for all particles every time\r\n *\r\n * @method applyBehaviour\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n * @param {Number} \t\t\ttime the integrate time 1/ms\r\n * @param {Int} \t\t\tindex the particle index\r\n */\r\n calculate(particle, time, index) {\r\n this.age += time;\r\n\r\n if (this.age >= this.life || this.dead) {\r\n this.energy = 0;\r\n this.dead = true;\r\n this.destroy();\r\n } else {\r\n const scale = this.easing(particle.age / particle.life);\r\n this.energy = Math.max(1 - scale, 0);\r\n }\r\n }\r\n\r\n /**\r\n * Destory this behaviour\r\n *\r\n * @method destroy\r\n * @memberof Proton.Behaviour\r\n * @instance\r\n */\r\n destroy() {\r\n let i = this.parents.length;\r\n while (i--) {\r\n this.parents[i].removeBehaviour(this);\r\n }\r\n\r\n this.parents.length = 0;\r\n }\r\n}","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Force extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Force\r\n\t *\r\n\t * @param {Number} fx\r\n\t * @param {Number} fy\r\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(fx, fy, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\r\n\t\tthis.name = \"Force\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Force\r\n\t * @instance\r\n\t *\r\n\t * @param {Number} fx\r\n\t * @param {Number} fy\r\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(fx, fy, life, easing) {\r\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#Proton.Force\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} the integrate time 1/ms\r\n\t * @param {Int} the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\t\tparticle.a.add(this.force);\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Attraction extends Behaviour {\r\n\r\n\t/**\r\n\t * This behaviour let the particles follow one specific Proton.Vector2D\r\n\t *\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Attraction\r\n\t *\r\n\t * @todo add description for 'force' and 'radius'\r\n\t *\r\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\r\n\t * @param {Number} [force=100]\r\n\t * @param {Number} [radius=1000]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {Proton.Vector2D} targetPosition\r\n\t * @property {Number} radius\r\n\t * @property {Number} force\r\n\t * @property {Number} radiusSq\r\n\t * @property {Proton.Vector2D} attractionForce\r\n\t * @property {Number} lengthSq\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(targetPosition, force, radius, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\r\n\t\tthis.radius = Util.initValue(radius, 1000);\r\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\r\n\r\n\t\tthis.radiusSq = this.radius * this.radius\r\n\t\tthis.attractionForce = new Vector2D();\r\n\t\tthis.lengthSq = 0;\r\n\r\n\t\tthis.name = \"Attraction\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Attraction\r\n\t * @instance\r\n\t *\r\n\t * @todo add description for 'force' and 'radius'\r\n\t *\r\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\r\n\t * @param {Number} [force=100]\r\n\t * @param {Number} [radius=1000]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(targetPosition, force, radius, life, easing) {\r\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\r\n\t\tthis.radius = Util.initValue(radius, 1000);\r\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\r\n\r\n\t\tthis.radiusSq = this.radius * this.radius\r\n\t\tthis.attractionForce = new Vector2D();\r\n\t\tthis.lengthSq = 0;\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @memberof Proton#Proton.Attraction\r\n\t * @method applyBehaviour\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\r\n\t\tthis.attractionForce.copy(this.targetPosition);\r\n\t\tthis.attractionForce.sub(particle.p);\r\n\t\tthis.lengthSq = this.attractionForce.lengthSq();\r\n\r\n\t\tif (this.lengthSq > 0.000004 && this.lengthSq < this.radiusSq) {\r\n\t\t\tthis.attractionForce.normalize();\r\n\t\t\tthis.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\r\n\t\t\tthis.attractionForce.multiplyScalar(this.force);\r\n\r\n\t\t\tparticle.a.add(this.attractionForce);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport MathUtils from '../math/MathUtils';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class RandomDrift extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Behaviour\r\n\t * @constructor\r\n\t * @alias RandomDrift\r\n\t *\r\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\r\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\r\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\r\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\r\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {Number} time The time of the drift\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(driftX, driftY, delay, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.reset(driftX, driftY, delay);\r\n\t\tthis.time = 0;\r\n\t\tthis.name = \"RandomDrift\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#RandomDrift\r\n\t * @instance\r\n\t *\r\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\r\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\r\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\r\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\r\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(driftX, driftY, delay, life, easing) {\r\n\t\tthis.panFoce = new Vector2D(driftX, driftY);\r\n\t\tthis.panFoce = this.normalizeForce(this.panFoce);\r\n\t\tthis.delay = delay;\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#RandomDrift\r\n\t * @instance\r\n\t *\r\n\t * @param {Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\t\tthis.time += time;\r\n\r\n\t\tif (this.time >= this.delay) {\r\n\t\t\tparticle.a.addXY(MathUtils.randomAToB(-this.panFoce.x, this.panFoce.x), MathUtils.randomAToB(-this.panFoce.y, this.panFoce.y));\r\n\t\t\tthis.time = 0;\r\n\t\t};\r\n\t}\r\n}\r\n","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport Force from './Force';\r\n\r\nexport default class Gravity extends Force {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton#Proton.Force\r\n\t * @constructor\r\n\t * @alias Proton.Gravity\r\n\t *\r\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(g, life, easing) {\r\n\t\tsuper(0, g, life, easing);\r\n\t\tthis.name = \"Gravity\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Gravity\r\n\t * @instance\r\n\t *\r\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(g, life, easing) {\r\n\t\tsuper.reset(0, g, life, easing);\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport Behaviour from './Behaviour';\r\n\r\n//can use Collision(emitter,true,function(){}) or Collision();\r\nexport default class Collision extends Behaviour {\r\n\r\n\t/**\r\n\t * The callback after collision\r\n\t *\r\n\t * @callback Callback\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Proton.Paritcle} otherParticle\r\n\t */\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Collision\r\n\t *\r\n\t * @todo add description to mass\r\n\t *\r\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\r\n\t * @param {Boolean} \t\t[mass=true]\t\t\t\r\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(emitter, mass, callback, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.reset(emitter, mass, callback);\r\n\t\tthis.name = \"Collision\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @memberof Proton#Proton.Collision\r\n\t * @method reset\r\n\t * @instance\r\n\t *\r\n\t * @todo add description to mass\r\n\t *\r\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\r\n\t * @param {Boolean} \t\t[mass=true]\t\t\t\r\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\r\n\t * @param {Number} \t\t\t[life=Infinity] \tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(emitter, mass, callback, life, easing) {\r\n\t\tthis.emitter = Util.initValue(emitter, null);\r\n\t\tthis.mass = Util.initValue(mass, true);\r\n\t\tthis.callback = Util.initValue(callback, null);\r\n\r\n\t\tthis.collisionPool = [];\r\n\t\tthis.delta = new Vector2D();\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @memberof Proton#Proton.Collision\r\n\t * @method applyBehaviour\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tconst newPool = this.emitter ? this.emitter.particles.slice(index) : this.pool.slice(index);\r\n\t\tconst length = newPool.length;\r\n\r\n\t\tlet otherParticle;\r\n\t\tlet lengthSq;\r\n\t\tlet overlap;\r\n\t\tlet totalMass;\r\n\t\tlet averageMass1, averageMass2;\r\n\t\tlet i;\r\n\r\n\t\tfor (i = 0; i < length; i++) {\r\n\t\t\totherParticle = newPool[i];\r\n\r\n\t\t\tif (otherParticle !== particle) {\r\n\t\t\t\tthis.delta.copy(otherParticle.p);\r\n\t\t\t\tthis.delta.sub(particle.p);\r\n\r\n\t\t\t\tlengthSq = this.delta.lengthSq();\r\n\t\t\t\tconst distance = particle.radius + otherParticle.radius;\r\n\r\n\t\t\t\tif (lengthSq <= distance * distance) {\r\n\t\t\t\t\toverlap = distance - Math.sqrt(lengthSq);\r\n\t\t\t\t\toverlap += 0.5;\r\n\r\n\t\t\t\t\ttotalMass = particle.mass + otherParticle.mass;\r\n\t\t\t\t\taverageMass1 = this.mass ? otherParticle.mass / totalMass : 0.5;\r\n\t\t\t\t\taverageMass2 = this.mass ? particle.mass / totalMass : 0.5;\r\n\t\t\t\t\t\r\n\t\t\t\t\tparticle.p.add(this.delta.clone().normalize().multiplyScalar(overlap * -averageMass1));\r\n\t\t\t\t\totherParticle.p.add(this.delta.normalize().multiplyScalar(overlap * averageMass2));\r\n\r\n\t\t\t\t\tthis.callback && this.callback(particle, otherParticle);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n","import Util from '../utils/Util';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class CrossZone extends Behaviour {\r\n\r\n /**\r\n * Defines what happens if the particles come to the end of the specified zone\r\n *\r\n * @memberof! Proton#\r\n * @augments Proton.Behaviour\r\n * @constructor\r\n * @alias Proton.CrossZone\r\n *\r\n * @param {Proton.Zone} zone \t\t\t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\r\n * @param {String} \t\t[crossType=dead] \t\t\twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\r\n * @param {Number} \t\t[life=Infinity] \t\t\tthis behaviour's life\r\n * @param {String} \t\t[easing=ease.easeLinear] \tthis behaviour's easing\r\n *\r\n * @property {String} name The Behaviour name\r\n */\r\n constructor(zone, crossType, life, easing) {\r\n super(life, easing);\r\n\r\n this.reset(zone, crossType);\r\n this.name = \"CrossZone\";\r\n }\r\n\r\n /**\r\n * Reset this behaviour's parameters\r\n *\r\n * @method reset\r\n * @memberof Proton#Proton.CrossZone\r\n * @instance\r\n *\r\n * @param {Proton.Zone} zone \t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\r\n * @param {String} \t\t[crossType=dead] \twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\r\n * @param {Number} \t\t[life=Infinity] \tthis behaviour's life\r\n * @param {String} \t\t[easing=easeLinear]\tthis behaviour's easing\r\n */\r\n reset(zone, crossType, life, easing) {\r\n this.zone = zone;\r\n this.zone.crossType = Util.initValue(crossType, \"dead\");\r\n\r\n life && super.reset(life, easing);\r\n }\r\n\r\n /**\r\n * Apply this behaviour for all particles every time\r\n *\r\n * @method applyBehaviour\r\n * @memberof Proton#Proton.CrossZone\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n * @param {Number} the integrate time 1/ms\r\n * @param {Int} the particle index\r\n */\r\n applyBehaviour(particle, time, index) {\r\n this.calculate(particle, time, index);\r\n this.zone.crossing(particle);\r\n };\r\n}","import Util from '../utils/Util';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Alpha extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Alpha\r\n\t *\r\n\t * @todo add description for 'a' and 'b'\r\n\t *\r\n\t * @param {Number} a\r\n\t * @param {String} b\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(a, b, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.reset(a, b);\r\n\t\tthis.name = \"Alpha\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Alpha\r\n\t * @instance\r\n\t *\r\n\t * @todo add description for 'a' and 'b'\r\n\t *\r\n\t * @param {Number} a\r\n\t * @param {String} b\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(a, b, life, easing) {\r\n\t\tthis.same = b === null || b === undefined ? true : false;\r\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 1));\r\n\t\tthis.b = Util.setSpanValue(b);\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\t\r\n\t/**\r\n\t * Sets the new alpha value of the particle\r\n\t *\r\n\t * @method initialize\r\n\t * @memberof Proton#Proton.Alpha\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle A single Proton generated particle\r\n\t */\r\n\tinitialize(particle) {\r\n\t\tparticle.transform.alphaA = this.a.getValue();\r\n\r\n\t\tif (this.same)\r\n\t\t\tparticle.transform.alphaB = particle.transform.alphaA;\r\n\t\telse\r\n\t\t\tparticle.transform.alphaB = this.b.getValue();\r\n\t}\r\n\r\n\t/**\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#Proton.Alpha\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n \t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\t\t\r\n\t\tparticle.alpha = particle.transform.alphaB + (particle.transform.alphaA - particle.transform.alphaB) * this.energy;\r\n\t\tif (particle.alpha < 0.001) particle.alpha = 0;\r\n\t}\r\n}\r\n","import Util from '../utils/Util';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Scale extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Scale\r\n\t *\r\n\t * @todo add description for 'a' and 'b'\r\n\t *\r\n\t * @param {Number} a\r\n\t * @param {String} b\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(a, b, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.reset(a, b);\r\n\t\tthis.name = \"Scale\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Scale\r\n\t * @instance\r\n\t *\r\n\t * @param {Number} a\r\n\t * @param {String} b\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(a, b, life, easing) {\r\n\t\tthis.same = b === null || b === undefined ? true : false;\r\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 1));\r\n\t\tthis.b = Util.setSpanValue(b);\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Initialize the behaviour's parameters for all particles\r\n\t *\r\n\t * @method initialize\r\n\t * @memberof Proton#Proton.Scale\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t */\r\n\tinitialize(particle) {\r\n\t\tparticle.transform.scaleA = this.a.getValue();\r\n\t\tparticle.transform.oldRadius = particle.radius;\r\n\t\tparticle.transform.scaleB = this.same ? particle.transform.scaleA : this.b.getValue();\r\n\t};\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#Proton.Scale\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\t\tparticle.scale = particle.transform.scaleB + (particle.transform.scaleA - particle.transform.scaleB) * this.energy;\r\n\r\n\t\tif (particle.scale < 0.0001) particle.scale = 0;\r\n\t\tparticle.radius = particle.transform.oldRadius * particle.scale;\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Rotate extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Proton.Behaviour\r\n\t * @constructor\r\n\t * @alias Proton.Rotate\r\n\t *\r\n\t * @todo add description for 'a', 'b' and 'style'\r\n\t *\r\n\t * @param {String} [influence=Velocity] The rotation's influence\r\n\t * @param {String} b\r\n\t * @param {String} [style=to]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(influence, b, style, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.reset(influence, b, style);\r\n\t\tthis.name = \"Rotate\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Rotate\r\n\t * @instance\r\n\t *\r\n\t * @todo add description for 'a', 'b' and 'style'\r\n\t *\r\n\t * @param {String} a \r\n\t * @param {String} b\r\n\t * @param {String} [style=to]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(a, b, style, life, easing) {\r\n\t\tthis.same = b === null || b === undefined ? true : false;\r\n\r\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, \"Velocity\"));\r\n\t\tthis.b = Util.setSpanValue(Util.initValue(b, 0));\r\n\t\tthis.style = Util.initValue(style, 'to');\r\n\r\n\t\tlife && super.reset(life, easing);\r\n\t}\r\n\r\n\t/**\r\n\t * Initialize the behaviour's parameters for all particles\r\n\t *\r\n\t * @method initialize\r\n\t * @memberof Proton#Proton.Rotate\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t */\r\n\tinitialize(particle) {\r\n\t\tparticle.rotation = this.a.getValue();\r\n\t\tparticle.transform.rotationA = this.a.getValue();\r\n\r\n\t\tif (!this.same) particle.transform.rotationB = this.b.getValue();\r\n\t};\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#Proton.Rotate\r\n\t * @instance\r\n\t *\r\n\t * @param {Proton.Particle} particle\r\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\r\n\t * @param {Int} \t\t\tindex the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.calculate(particle, time, index);\r\n\r\n\t\tif (!this.same) {\r\n\t\t\tif (this.style == 'to' || this.style == 'TO' || this.style == '_') {\r\n\t\t\t\tparticle.rotation += particle.transform.rotationB + (particle.transform.rotationA - particle.transform.rotationB) * this.energy\r\n\t\t\t} else {\r\n\t\t\t\tparticle.rotation += particle.transform.rotationB;\r\n\t\t\t}\r\n\t\t} else if (this.a.a == \"V\" || this.a.a == \"Velocity\" || this.a.a == \"v\") {\r\n\t\t\t//beta...\r\n\t\t\tparticle.rotation = particle.getDirection();\r\n\t\t}\r\n\t}\r\n\r\n}\r\n","import Util from '../utils/Util';\r\nimport ColorUtil from '../utils/ColorUtil';\r\nimport ArraySpan from '../math/ArraySpan';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class Color extends Behaviour {\r\n\r\n /**\r\n * @memberof! Proton#\r\n * @augments Proton.Behaviour\r\n * @constructor\r\n * @alias Proton.Color\r\n *\r\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\r\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\r\n * @param {Number} [life=Infinity] \tthis behaviour's life\r\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\r\n *\r\n * @property {String} name The Behaviour name\r\n */\r\n constructor(a, b, life, easing) {\r\n super(life, easing);\r\n\r\n this.reset(a, b);\r\n this.name = \"Color\";\r\n }\r\n\r\n /**\r\n * Reset this behaviour's parameters\r\n *\r\n * @method reset\r\n * @memberof Proton#Proton.Color\r\n * @instance\r\n *\r\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\r\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\r\n * @param {Number} [life=Infinity] \tthis behaviour's life\r\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\r\n */\r\n reset(a, b, life, easing) {\r\n this.a = ArraySpan.createArraySpan(a);\r\n this.b = ArraySpan.createArraySpan(b);\r\n\r\n life && super.reset(life, easing);\r\n }\r\n\r\n /**\r\n * Initialize the behaviour's parameters for all particles\r\n *\r\n * @method initialize\r\n * @memberof Proton#Proton.Color\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n */\r\n initialize(particle) {\r\n particle.color = this.a.getValue();\r\n particle.transform.colorA = ColorUtil.hexToRGB(particle.color);\r\n\r\n if (this.b)\r\n particle.transform.colorB = ColorUtil.hexToRGB(this.b.getValue());\r\n };\r\n\r\n /**\r\n * Apply this behaviour for all particles every time\r\n *\r\n * @method applyBehaviour\r\n * @memberof Proton#Proton.Color\r\n * @instance\r\n *\r\n * @param {Proton.Particle} particle\r\n * @param {Number} the integrate time 1/ms\r\n * @param {Int} the particle index\r\n */\r\n applyBehaviour(particle, time, index) {\r\n if (this.b) {\r\n this.calculate(particle, time, index);\r\n\r\n particle.transform.rgb.r = particle.transform.colorB.r + (particle.transform.colorA.r - particle.transform.colorB.r) * this.energy;\r\n particle.transform.rgb.g = particle.transform.colorB.g + (particle.transform.colorA.g - particle.transform.colorB.g) * this.energy;\r\n particle.transform.rgb.b = particle.transform.colorB.b + (particle.transform.colorA.b - particle.transform.colorB.b) * this.energy;\r\n\r\n particle.transform.rgb.r = Math.floor(particle.transform.rgb.r);\r\n particle.transform.rgb.g = Math.floor(particle.transform.rgb.g);\r\n particle.transform.rgb.b = Math.floor(particle.transform.rgb.b);\r\n\r\n } else {\r\n particle.transform.rgb.r = particle.transform.colorA.r;\r\n particle.transform.rgb.g = particle.transform.colorA.g;\r\n particle.transform.rgb.b = particle.transform.colorA.b;\r\n }\r\n };\r\n\r\n}","import Util from '../utils/Util';\r\nimport Attraction from './Attraction';\r\n\r\nexport default class Repulsion extends Attraction {\r\n\r\n\t/**\r\n\t * The oppisite of Proton.Attraction - turns the force\r\n\t *\r\n\t * @memberof! Proton#\r\n\t * @augments Proton#Proton.Attraction\r\n\t * @constructor\r\n\t * @alias Proton.Repulsion\r\n\t *\r\n\t * @todo add description for 'force' and 'radius'\r\n\t *\r\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\r\n\t * @param {Number} [force=100]\r\n\t * @param {Number} [radius=1000]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t *\r\n\t * @property {Number} force\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(targetPosition, force, radius, life, easing) {\r\n\t\tsuper(targetPosition, force, radius, life, easing);\r\n\r\n\t\tthis.force *= -1;\r\n\t\tthis.name = \"Repulsion\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#Proton.Repulsion\r\n\t * @instance\r\n\t *\r\n\t * @todo add description for 'force' and 'radius'\r\n\t *\r\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\r\n\t * @param {Number} [force=100]\r\n\t * @param {Number} [radius=1000]\r\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\r\n\t */\r\n\treset(targetPosition, force, radius, life, easing) {\r\n\t\tsuper.reset(targetPosition, force, radius, life, easing);\r\n\t\tthis.force *= -1;\r\n\t}\r\n}\r\n","import Util from '../utils/Util';\r\nimport Vector2D from '../math/Vector2D';\r\nimport Behaviour from './Behaviour';\r\n\r\nexport default class GravityWell extends Behaviour {\r\n\r\n\t/**\r\n\t * @memberof! Proton#\r\n\t * @augments Behaviour\r\n\t * @constructor\r\n\t * @alias GravityWell\r\n\t *\r\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\r\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\t\r\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\r\n\t *\r\n\t * @property {String} name The Behaviour name\r\n\t */\r\n\tconstructor(centerPoint, force, life, easing) {\r\n\t\tsuper(life, easing);\r\n\r\n\t\tthis.distanceVec = new Vector2D();\r\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\r\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\r\n\r\n\t\tthis.name = \"GravityWell\";\r\n\t}\r\n\r\n\t/**\r\n\t * Reset this behaviour's parameters\r\n\t *\r\n\t * @method reset\r\n\t * @memberof Proton#GravityWell\r\n\t * @instance\r\n\t *\r\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\r\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\t\r\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\r\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\r\n\t */\r\n\treset(centerPoint, force, life, easing) {\r\n\t\tthis.distanceVec = new Vector2D();\r\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\r\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\r\n\t\t\r\n\t\tlife && super.reset(life, easing);\r\n\t};\r\n\r\n\t/**\r\n\t * @inheritdoc\r\n\t */\r\n\tinitialize(particle) {\r\n\t};\r\n\r\n\t/**\r\n\t * Apply this behaviour for all particles every time\r\n\t *\r\n\t * @method applyBehaviour\r\n\t * @memberof Proton#GravityWell\r\n\t * @instance\r\n\t *\r\n\t * @param {Particle} particle\r\n\t * @param {Number} the integrate time 1/ms\r\n\t * @param {Int} the particle index\r\n\t */\r\n\tapplyBehaviour(particle, time, index) {\r\n\t\tthis.distanceVec.set(this.centerPoint.x - particle.p.x, this.centerPoint.y - particle.p.y);\r\n\t\tconst distanceSq = this.distanceVec.lengthSq();\r\n\r\n\t\tif (distanceSq != 0) {\r\n\t\t\tconst distance = this.distanceVec.length();\r\n\t\t\tconst factor = (this.force * time) / (distanceSq * distance);\r\n\r\n\t\t\tparticle.v.x += factor * this.distanceVec.x;\r\n\t\t\tparticle.v.y += factor * this.distanceVec.y;\r\n\t\t}\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Initialize from './Initialize';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default {\r\n\r\n\tinitialize(emitter, particle, initializes) {\r\n\t\tconst length = initializes.length;\r\n\t\tlet i;\r\n\r\n\t\tfor (i = 0; i < length; i++) {\r\n\t\t\tif (initializes[i] instanceof Initialize)\r\n\t\t\t\tinitializes[i].init(emitter, particle);\r\n\t\t\telse\r\n\t\t\t\tthis.init(emitter, particle, initializes[i]);\r\n\t\t}\r\n\r\n\t\tthis.bindEmitter(emitter, particle);\r\n\t},\r\n\r\n\t//////////////////////init//////////////////////\r\n\tinit(emitter, particle, initialize) {\r\n\t\tUtil.setPrototypeByObject(particle, initialize);\r\n\t\tUtil.setVector2DByObject(particle, initialize);\r\n\t},\r\n\t\r\n\tbindEmitter(emitter, particle) {\r\n\t\tif (emitter.bindEmitter) {\r\n\t\t\tparticle.p.add(emitter.p);\r\n\t\t\tparticle.v.add(emitter.v);\r\n\t\t\tparticle.a.add(emitter.a);\r\n\r\n\t\t\tparticle.v.rotate(MathUtils.degreeTransform(emitter.rotation));\r\n\t\t}\r\n\t}\r\n}\r\n","import Util from '../utils/Util';\r\nimport Particle from '../core/Particle';\r\nimport EventDispatcher from '../events/EventDispatcher';\r\n\r\nimport Rate from '../initialize/Rate';\r\nimport InitializeUtil from '../initialize/InitializeUtil';\r\n\r\nexport default class Emitter extends Particle {\r\n\r\n\tstatic ID = 0;\r\n\r\n\t/**\r\n\t * You can use this emit particles.\r\n\t *\r\n\t * It will dispatch follow events:\r\n\t * PARTICLE_CREATED\r\n\t * PARTICLE_UPDATA\r\n\t * PARTICLE_DEAD\r\n\t *\r\n\t * @class Emitter\r\n\t * @constructor\r\n\t * @param {Object} pObj the parameters object;\r\n\t * for example {damping:0.01,bindEmitter:false}\r\n\t */\r\n\tconstructor(pObj) {\r\n\t\tsuper(pObj);\r\n\r\n\t\tthis.initializes = [];\r\n\t\tthis.particles = [];\r\n\t\tthis.behaviours = [];\r\n\r\n\t\tthis.emitSpeed = 0;\r\n\t\tthis.emitTime = 0;\r\n\t\tthis.totalTime = -1;\r\n\r\n\t\t/**\r\n\t\t * The friction coefficient for all particle emit by This;\r\n\t\t * @property damping\r\n\t\t * @type {Number}\r\n\t\t * @default 0.006\r\n\t\t */\r\n\t\tthis.damping = .006;\r\n\r\n\t\t/**\r\n\t\t * If bindEmitter the particles can bind this emitter's property;\r\n\t\t * @property bindEmitter\r\n\t\t * @type {Boolean}\r\n\t\t * @default true\r\n\t\t */\r\n\t\tthis.bindEmitter = true;\r\n\r\n\t\t/**\r\n\t\t * The number of particles per second emit (a [particle]/b [s]);\r\n\t\t * @property rate\r\n\t\t * @type {Rate}\r\n\t\t * @default Rate(1, .1)\r\n\t\t */\r\n\t\tthis.rate = new Rate(1, .1);\r\n\r\n\t\tthis.id = `emitter_${Emitter.ID++}`;\r\n\t\tthis.name = 'Emitter';\r\n\t}\r\n\r\n\t/**\r\n\t * start emit particle\r\n\t * @method emit\r\n\t * @param {Number} emitTime begin emit time;\r\n\t * @param {String} life the life of this emitter\r\n\t */\r\n\temit(totalTime, life) {\r\n\t\tthis.stoped = false;\r\n\t\tthis.emitTime = 0;\r\n\t\tthis.totalTime = Util.initValue(totalTime, Infinity);\r\n\r\n\t\tif (life == true || life == 'life' || life == 'destroy') {\r\n\t\t\tthis.life = totalTime == 'once' ? 1 : this.totalTime;\r\n\t\t} else if (!isNaN(life)) {\r\n\t\t\tthis.life = life;\r\n\t\t}\r\n\r\n\t\tthis.rate.init();\r\n\t}\r\n\r\n\t/**\r\n\t * stop emiting\r\n\t * @method stop\r\n\t */\r\n\tstop() {\r\n\t\tthis.totalTime = -1;\r\n\t\tthis.emitTime = 0;\r\n\t\tthis.stoped = true;\r\n\t}\r\n\r\n\tpreEmit(time) {\r\n\t\tlet oldStoped = this.stoped;\r\n\t\tlet oldEmitTime = this.emitTime;\r\n\t\tlet oldTotalTime = this.totalTime;\r\n\r\n\t\tthis.stoped = false;\r\n\t\tthis.emitTime = 0;\r\n\t\tthis.totalTime = time;\r\n\t\tthis.rate.init();\r\n\r\n\t\tconst step = 0.0167;\r\n\t\twhile (time > step) {\r\n\t\t\ttime -= step;\r\n\t\t\tthis.update(step);\r\n\t\t}\r\n\r\n\t\tthis.stoped = oldStoped;\r\n\t\tthis.emitTime = oldEmitTime + Math.max(time, 0);\r\n\t\tthis.totalTime = oldTotalTime;\r\n\t}\r\n\r\n\t/**\r\n\t * remove current all particles\r\n\t * @method removeAllParticles\r\n\t */\r\n\tremoveAllParticles() {\r\n\t\tlet i = this.particles.length;\r\n\t\twhile (i--) this.particles[i].dead = true;\r\n\t}\r\n\r\n\t/**\r\n\t * add initialize to this emitter\r\n\t * @method addSelfInitialize\r\n\t */\r\n\taddSelfInitialize(pObj) {\r\n\t\tif (pObj['init']) {\r\n\t\t\tpObj.init(this);\r\n\t\t} else {\r\n\t\t\tthis.initAll();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * add the Initialize to particles;\r\n\t * \r\n\t * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);\r\n\t * @method addInitialize\r\n\t * @param {Initialize} initialize like this new Radius(1, 12)\r\n\t */\r\n\taddInitialize(...rest) {\r\n\t\tlet i = rest.length;\r\n\t\twhile (i--)\r\n\t\t\tthis.initializes.push(rest[i]);\r\n\t}\r\n\r\n\t/**\r\n\t * remove the Initialize\r\n\t * @method removeInitialize\r\n\t * @param {Initialize} initialize a initialize\r\n\t */\r\n\tremoveInitialize(initializer) {\r\n\t\tconst index = this.initializes.indexOf(initializer);\r\n\t\tif (index > -1) this.initializes.splice(index, 1);\r\n\t}\r\n\r\n\t/**\r\n\t * remove all Initializes\r\n\t * @method removeInitializers\r\n\t */\r\n\tremoveAllInitializers() {\r\n\t\tUtil.destroyArray(this.initializes);\r\n\t}\r\n\r\n\t/**\r\n\t * add the Behaviour to particles;\r\n\t * \r\n\t * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);\r\n\t * @method addBehaviour\r\n\t * @param {Behaviour} behaviour like this new Color('random')\r\n\t */\r\n\taddBehaviour(...rest) {\r\n\t\tlet i = arguments.length;\r\n\t\twhile (i--) {\r\n\t\t\tlet behaviour = rest[i];\r\n\t\t\tthis.behaviours.push(behaviour);\r\n\t\t\tif (behaviour.parents) behaviour.parents.push(this);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * remove the Behaviour\r\n\t * @method removeBehaviour\r\n\t * @param {Behaviour} behaviour a behaviour\r\n\t */\r\n\tremoveBehaviour(behaviour) {\r\n\t\tlet index = this.behaviours.indexOf(behaviour);\r\n\t\tthis.behaviours.splice(index, 1);\r\n\r\n\t\tif (behaviour.parents) {\r\n\t\t\tindex = behaviour.parents.indexOf(behaviour);\r\n\t\t\tbehaviour.parents.splice(index, 1);\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\t/**\r\n\t * remove all behaviours\r\n\t * @method removeAllBehaviours\r\n\t */\r\n\tremoveAllBehaviours() {\r\n\t\tUtil.destroyArray(this.behaviours);\r\n\t}\r\n\r\n\t// emitter update \r\n\tupdate(time) {\r\n\t\tthis.age += time;\r\n\t\tif (this.age >= this.life || this.dead) this.destroy();\r\n\r\n\t\tthis.emitting(time);\r\n\t\tthis.integrate(time);\r\n\t}\r\n\r\n\tintegrate(time) {\r\n\t\tif (!this.parent) return;\r\n\r\n\t\tconst damping = 1 - this.damping;\r\n\t\tthis.parent.integrator.calculate(this, time, damping);\r\n\r\n\t\tconst length = this.particles.length;\r\n\t\tlet i, particle;\r\n\r\n\t\tfor (i = length - 1; i >= 0; i--) {\r\n\t\t\tparticle = this.particles[i];\r\n\r\n\t\t\t// particle update\r\n\t\t\tparticle.update(time, i);\r\n\t\t\tthis.parent.integrator.calculate(particle, time, damping);\r\n\t\t\tthis.dispatch(\"PARTICLE_UPDATE\", particle);\r\n\r\n\t\t\t// check dead\r\n\t\t\tif (particle.dead) {\r\n\t\t\t\tthis.dispatch(\"PARTICLE_DEAD\", particle);\r\n\r\n\t\t\t\tthis.parent.pool.expire(particle);\r\n\t\t\t\tthis.particles.splice(i, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdispatch(event, target) {\r\n\t\tthis.parent && this.parent.dispatchEvent(event, target);\r\n\t\tthis.bindEvent && this.dispatchEvent(event, target);\r\n\t}\r\n\r\n\temitting(time) {\r\n\t\tif (this.totalTime == 'once') {\r\n\t\t\tlet i;\r\n\t\t\tconst length = this.rate.getValue(99999);\r\n\r\n\t\t\tif (length > 0) this.emitSpeed = length;\r\n\t\t\tfor (i = 0; i < length; i++) this.createParticle();\r\n\t\t\tthis.totalTime = 'none';\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\tthis.emitTime += time;\r\n\r\n\t\t\tif (this.emitTime < this.totalTime) {\r\n\t\t\t\tconst length = this.rate.getValue(time)\r\n\t\t\t\tlet i;\r\n\r\n\t\t\t\tif (length > 0) this.emitSpeed = length;\r\n\t\t\t\tfor (i = 0; i < length; i++) this.createParticle();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * create single particle;\r\n\t * \r\n\t * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})\r\n\t * @method removeAllParticles\r\n\t */\r\n\tcreateParticle(initialize, behaviour) {\r\n\t\tconst particle = this.parent.pool.get(Particle);\r\n\t\tthis.setupParticle(particle, initialize, behaviour);\r\n\t\tthis.dispatch(\"PARTICLE_CREATED\", particle);\r\n\r\n\t\treturn particle;\r\n\t}\r\n\r\n\tsetupParticle(particle, initialize, behaviour) {\r\n\t\tlet initializes = this.initializes;\r\n\t\tlet behaviours = this.behaviours;\r\n\r\n\t\tif (initialize) {\r\n\t\t\tinitializes = Util.isArray(initialize) ? initialize : [initialize];\r\n\t\t}\r\n\r\n\t\tif (behaviour) {\r\n\t\t\tbehaviour = Util.isArray(behaviour) ? behaviour : [behaviour];\r\n\t\t}\r\n\r\n\t\tparticle.reset();\r\n\t\tInitializeUtil.initialize(this, particle, initializes);\r\n\t\tparticle.addBehaviours(behaviours);\r\n\t\tparticle.parent = this;\r\n\r\n\t\tthis.particles.push(particle);\r\n\t}\r\n\r\n\tremove() {\r\n\t\tthis.stop();\r\n\t\tUtil.destroy(this.particles);\r\n\t}\r\n\r\n\t/**\r\n\t * Destory this Emitter\r\n\t * @method destroy\r\n\t */\r\n\tdestroy(slow) {\r\n\t\tthis.dead = true;\r\n\t\tthis.remove();\r\n\t\tthis.removeAllInitializers();\r\n\t\tthis.removeAllBehaviours();\r\n\t\tthis.parent && this.parent.removeEmitter(this);\r\n\t}\r\n\r\n}\r\n\r\nEventDispatcher.bind(Emitter);","import Util from '../utils/Util';\r\nimport Emitter from './Emitter';\r\n\r\nexport default class BehaviourEmitter extends Emitter {\r\n\r\n\t/**\r\n\t * The BehaviourEmitter class inherits from Proton.Emitter\r\n\t *\r\n\t * use the BehaviourEmitter you can add behaviours to self;\r\n\t * @class Proton.BehaviourEmitter\r\n\t * @constructor\r\n\t * @param {Object} pObj the parameters object;\r\n\t */\r\n\tconstructor(pObj) {\r\n\t\tsuper(pObj);\r\n\r\n\t\tthis.selfBehaviours = [];\r\n\t};\r\n\t\r\n\t/**\r\n\t * add the Behaviour to emitter;\r\n\t *\r\n\t * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);\r\n\t * @method addSelfBehaviour\r\n\t * @param {Proton.Behaviour} behaviour like this new Proton.Color('random')\r\n\t */\r\n\taddSelfBehaviour(...rest) {\r\n\t\tconst length = rest.length;\r\n\t\tlet i;\r\n\r\n\t\tfor (i = 0; i < length; i++) {\r\n\t\t\tthis.selfBehaviours.push(rest[i]);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * remove the Behaviour for self\r\n\t * @method removeSelfBehaviour\r\n\t * @param {Proton.Behaviour} behaviour a behaviour\r\n\t */\r\n\tremoveSelfBehaviour(behaviour) {\r\n\t\tconst index = this.selfBehaviours.indexOf(behaviour);\r\n\t\tif (index > -1) this.selfBehaviours.splice(index, 1);\r\n\t};\r\n\r\n\tupdate(time) {\r\n\t\tsuper.update(time);\r\n\r\n\t\tif (!this.sleep) {\r\n\t\t\tconst length = this.selfBehaviours.length;\r\n\t\t\tlet i;\r\n\r\n\t\t\tfor (i = 0; i < length; i++) {\r\n\t\t\t\tthis.selfBehaviours[i].applyBehaviour(this, time, i);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport Emitter from './Emitter';\r\n\r\nexport default class FollowEmitter extends Emitter {\r\n\r\n\t/**\r\n\t * The FollowEmitter class inherits from Proton.Emitter\r\n\t *\r\n\t * use the FollowEmitter will emit particle when mousemoving\r\n\t *\r\n\t * @class Proton.FollowEmitter\r\n\t * @constructor\r\n\t * @param {Element} mouseTarget mouseevent's target;\r\n\t * @param {Number} ease the easing of following speed;\r\n\t * @default 0.7\r\n\t * @param {Object} pObj the parameters object;\r\n\t */\r\n\tconstructor(mouseTarget, ease, pObj) {\r\n\t\tsuper(pObj);\r\n\r\n\t\tthis.mouseTarget = Util.initValue(mouseTarget, window);\r\n\t\tthis.ease = Util.initValue(ease, .7);\r\n\r\n\t\tthis._allowEmitting = false;\r\n\t\tthis.initEventHandler();\r\n\t};\r\n\r\n\tinitEventHandler() {\r\n\t\tthis.mousemoveHandler = e => this.mousemove.call(this, e);\r\n\t\tthis.mousedownHandler = e => this.mousedown.call(this, e);\r\n\t\tthis.mouseupHandler = e => this.mouseup.call(this, e);\r\n\r\n\t\tthis.mouseTarget.addEventListener('mousemove', this.mousemoveHandler, false);\r\n\t}\r\n\r\n\t/**\r\n\t * start emit particle\r\n\t * @method emit\r\n\t */\r\n\temit() {\r\n\t\tthis._allowEmitting = true;\r\n\t}\r\n\r\n\t/**\r\n\t * stop emiting\r\n\t * @method stop\r\n\t */\r\n\tstop() {\r\n\t\tthis._allowEmitting = false;\r\n\t}\r\n\r\n\tmousemove(e) {\r\n\t\tif (e.layerX || e.layerX === 0) {\r\n\t\t\tthis.p.x += (e.layerX - this.p.x) * this.ease;\r\n\t\t\tthis.p.y += (e.layerY - this.p.y) * this.ease;\r\n\t\t} else if (e.offsetX || e.offsetX === 0) {\r\n\t\t\tthis.p.x += (e.offsetX - this.p.x) * this.ease;\r\n\t\t\tthis.p.y += (e.offsetY - this.p.y) * this.ease;\r\n\t\t}\r\n\r\n\t\tif (this._allowEmitting) super.emit('once');\r\n\t};\r\n\r\n\t/**\r\n\t * Destory this Emitter\r\n\t * @method destroy\r\n\t */\r\n\tdestroy() {\r\n\t\tsuper.destroy();\r\n\t\tthis.mouseTarget.removeEventListener('mousemove', this.mousemoveHandler, false);\r\n\t}\r\n\r\n}\r\n","import Pool from '../core/Pool';\r\nimport Util from '../utils/Util';\r\n\r\nexport default class BaseRenderer {\r\n\r\n constructor(element, stroke) {\r\n this.element = element;\r\n this.stroke = stroke;\r\n\r\n this.initHandler();\r\n\r\n this.circleConf = { isCircle: true };\r\n this.pool = new Pool();\r\n this.name = 'BaseRenderer';\r\n }\r\n\r\n setStroke(color, thinkness) {\r\n color = Util.initValue(color, '#000000');\r\n thinkness = Util.initValue(thinkness, 1);\r\n\r\n this.stroke = { color, thinkness };\r\n }\r\n\r\n initHandler() {\r\n this._protonUpdateHandler = () => { this.onProtonUpdate.call(this) };\r\n this._protonUpdateAfterHandler = () => { this.onProtonUpdateAfter.call(this) };\r\n this._emitterAddedHandler = (emitter) => { this.onEmitterAdded.call(this, emitter) };\r\n this._emitterRemovedHandler = (emitter) => { this.onEmitterRemoved.call(this, emitter) };\r\n this._particleCreatedHandler = (particle) => { this.onParticleCreated.call(this, particle) };\r\n this._particleUpdateHandler = (particle) => { this.onParticleUpdate.call(this, particle) };\r\n this._particleDeadHandler = (particle) => { this.onParticleDead.call(this, particle) };\r\n }\r\n\r\n init(proton) {\r\n this.parent = proton;\r\n\r\n proton.addEventListener('PROTON_UPDATE', this._protonUpdateHandler);\r\n proton.addEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\r\n\r\n proton.addEventListener('EMITTER_ADDED', this._emitterAddedHandler);\r\n proton.addEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\r\n\r\n proton.addEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\r\n proton.addEventListener('PARTICLE_UPDATE', this._particleUpdateHandler);\r\n proton.addEventListener('PARTICLE_DEAD', this._particleDeadHandler);\r\n }\r\n\r\n resize(width, height) {}\r\n\r\n remove(proton) {\r\n this.parent.removeEventListener('PROTON_UPDATE', this._protonUpdateHandler);\r\n this.parent.removeEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\r\n\r\n this.parent.removeEventListener('EMITTER_ADDED', this._emitterAddedHandler);\r\n this.parent.removeEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\r\n\r\n this.parent.removeEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\r\n this.parent.removeEventListener('PARTICLE_UPDATE', this._particleUpdateHandler);\r\n this.parent.removeEventListener('PARTICLE_DEAD', this._particleDeadHandler);\r\n\r\n this.parent = null;\r\n }\r\n\r\n destroy(){\r\n this.remove();\r\n }\r\n \r\n onProtonUpdate() {}\r\n onProtonUpdateAfter() {}\r\n\r\n onEmitterAdded(emitter) {}\r\n onEmitterRemoved(emitter) {}\r\n\r\n onParticleCreated(particle) {}\r\n onParticleUpdate(particle) {}\r\n onParticleDead(particle) {}\r\n}","import Util from '../utils/Util';\r\nimport ImgUtil from '../utils/ImgUtil';\r\nimport ColorUtil from '../utils/ColorUtil';\r\nimport MathUtils from '../math/MathUtils';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class CanvasRenderer extends BaseRenderer {\r\n\r\n constructor(element) {\r\n super(element);\r\n\r\n this.stroke = null;\r\n this.context = this.element.getContext(\"2d\");\r\n this.bufferCache = {};\r\n\r\n this.name = 'CanvasRenderer';\r\n }\r\n\r\n resize(width, height) {\r\n this.element.width = width;\r\n this.element.height = height;\r\n }\r\n\r\n onProtonUpdate() {\r\n this.context.clearRect(0, 0, this.element.width, this.element.height);\r\n }\r\n\r\n onParticleCreated(particle) {\r\n if (particle.body)\r\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\r\n else\r\n particle.color = particle.color || '#ff0000';\r\n }\r\n\r\n onParticleUpdate(particle) {\r\n if (particle.body) {\r\n if (particle.body instanceof Image) this.drawImage(particle);\r\n } else {\r\n this.drawCircle(particle);\r\n }\r\n }\r\n\r\n onParticleDead(particle) {\r\n particle.body = null;\r\n }\r\n\r\n\r\n // private \r\n addImg2Body(img, particle) {\r\n particle.body = img;\r\n }\r\n\r\n // private drawCircle --\r\n drawImage(particle) {\r\n const w = particle.body.width * particle.scale | 0;\r\n const h = particle.body.height * particle.scale | 0;\r\n const x = particle.p.x - w / 2;\r\n const y = particle.p.y - h / 2;\r\n\r\n if (!!particle.color) {\r\n if (!particle.transform[\"buffer\"]) particle.transform.buffer = this.createBuffer(particle.body);\r\n\r\n const bufferContext = particle.transform.buffer.getContext('2d');\r\n bufferContext.clearRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\r\n bufferContext.globalAlpha = particle.alpha;\r\n bufferContext.drawImage(particle.body, 0, 0);\r\n\r\n bufferContext.globalCompositeOperation = \"source-atop\";\r\n bufferContext.fillStyle = ColorUtil.rgbToHex(particle.transform.rgb);\r\n bufferContext.fillRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\r\n bufferContext.globalCompositeOperation = \"source-over\";\r\n bufferContext.globalAlpha = 1;\r\n\r\n this.context.drawImage(particle.transform.buffer, 0, 0, particle.transform.buffer.width, particle.transform.buffer.height, x, y, w, h);\r\n } else {\r\n this.context.save();\r\n\r\n this.context.globalAlpha = particle.alpha;\r\n this.context.translate(particle.p.x, particle.p.y);\r\n this.context.rotate(MathUtils.degreeTransform(particle.rotation));\r\n this.context.translate(-particle.p.x, -particle.p.y);\r\n this.context.drawImage(particle.body, 0, 0, particle.body.width, particle.body.height, x, y, w, h);\r\n\r\n this.context.globalAlpha = 1;\r\n this.context.restore();\r\n }\r\n }\r\n\r\n // private drawCircle --\r\n drawCircle(particle) {\r\n if (particle.transform[\"rgb\"])\r\n this.context.fillStyle = 'rgba(' + particle.transform.rgb.r + ',' + particle.transform.rgb.g + ',' + particle.transform.rgb.b + ',' + particle.alpha + ')';\r\n else\r\n this.context.fillStyle = particle.color;\r\n\r\n // draw circle\r\n this.context.beginPath();\r\n this.context.arc(particle.p.x, particle.p.y, particle.radius, 0, Math.PI * 2, true);\r\n\r\n if (this.stroke) {\r\n this.context.strokeStyle = this.stroke.color;\r\n this.context.lineWidth = this.stroke.thinkness;\r\n this.context.stroke();\r\n }\r\n\r\n this.context.closePath();\r\n this.context.fill();\r\n }\r\n\r\n // private createBuffer --\r\n createBuffer(image) {\r\n if (image instanceof Image) {\r\n const size = image.width + '_' + image.height;\r\n let canvas = this.bufferCache[size];\r\n\r\n if (!canvas) {\r\n canvas = document.createElement('canvas');\r\n canvas.width = image.width;\r\n canvas.height = image.height;\r\n this.bufferCache[size] = canvas;\r\n }\r\n\r\n return canvas;\r\n }\r\n }\r\n}","import Util from '../utils/Util';\r\nimport DomUtil from '../utils/DomUtil';\r\nimport ImgUtil from '../utils/ImgUtil';\r\nimport MathUtils from '../math/MathUtils';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class DomRenderer extends BaseRenderer {\r\n\r\n constructor(element) {\r\n super(element);\r\n\r\n this.stroke = null;\r\n this.pool.create = (body, particle) => this.createBody(body, particle);\r\n this.addImg2Body = this.addImg2Body.bind(this);\r\n\r\n this.transform3d = false;\r\n\r\n this.name = 'DomRenderer';\r\n }\r\n\r\n onParticleCreated(particle) {\r\n if (particle.body) {\r\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\r\n } else {\r\n particle.body = this.pool.get(this.circleConf, particle);\r\n this.element.appendChild(particle.body);\r\n }\r\n }\r\n\r\n onParticleUpdate(particle) {\r\n if (this.bodyReady(particle)) {\r\n if (this.transform3d)\r\n DomUtil.transform3d(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\r\n else\r\n DomUtil.transform(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\r\n\r\n particle.body.style.opacity = particle.alpha;\r\n if (particle.body.isCircle) {\r\n particle.body.style.backgroundColor = particle.color || '#ff0000';\r\n }\r\n }\r\n }\r\n\r\n onParticleDead(particle) {\r\n if (this.bodyReady(particle)) {\r\n this.element.removeChild(particle.body);\r\n this.pool.expire(particle.body);\r\n particle.body = null;\r\n }\r\n }\r\n\r\n bodyReady(particle) {\r\n return typeof particle.body === 'object' && particle.body && !particle.body.isInner;\r\n }\r\n\r\n // private \r\n addImg2Body(img, particle) {\r\n if (particle.dead) return;\r\n particle.body = this.pool.get(img, particle);\r\n DomUtil.resize(particle.body, img.width, img.height);\r\n\r\n this.element.appendChild(particle.body);\r\n }\r\n\r\n createBody(body, particle) {\r\n if (body.isCircle)\r\n return this.createCircle(particle);\r\n else\r\n return this.createSprite(body, particle);\r\n }\r\n\r\n // private --\r\n createCircle(particle) {\r\n const dom = DomUtil.createDiv(`${particle.id}_dom`, 2 * particle.radius, 2 * particle.radius);\r\n dom.style.borderRadius = `${particle.radius}px`;\r\n\r\n if (this.stroke) {\r\n dom.style.borderColor = this.stroke.color;\r\n dom.style.borderWidth = `${this.stroke.thinkness}px`;\r\n }\r\n dom.isCircle = true;\r\n\r\n return dom;\r\n }\r\n\r\n createSprite(body, particle) {\r\n const url = typeof body === 'string' ? body : body.src;\r\n const dom = DomUtil.createDiv(`${particle.id}_dom`, body.width, body.height);\r\n dom.style.backgroundImage = `url(${url})`;\r\n\r\n return dom;\r\n }\r\n\r\n}","import Util from '../utils/Util';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class EaselRenderer extends BaseRenderer {\r\n\r\n constructor(element, stroke) {\r\n super(element);\r\n\r\n this.stroke = stroke;\r\n this.name = 'EaselRenderer';\r\n }\r\n\r\n onParticleCreated(particle) {\r\n if (particle.body) {\r\n this.createSprite(particle);\r\n } else {\r\n this.createCircle(particle);\r\n }\r\n\r\n this.element.addChild(particle.body);\r\n }\r\n\r\n onParticleUpdate(particle) {\r\n if (particle.body) {\r\n particle.body.x = particle.p.x;\r\n particle.body.y = particle.p.y;\r\n\r\n particle.body.alpha = particle.alpha;\r\n particle.body.scaleX = particle.body.scaleY = particle.scale;\r\n particle.body.rotation = particle.rotation;\r\n }\r\n }\r\n\r\n onParticleDead(particle) {\r\n if (particle.body) {\r\n particle.body.parent && particle.body.parent.removeChild(particle.body);\r\n this.pool.expire(particle.body);\r\n particle.body = null;\r\n }\r\n\r\n if (particle.graphics) this.pool.expire(particle.graphics);\r\n }\r\n\r\n // private\r\n createSprite(particle) {\r\n particle.body = this.pool.get(particle.body);\r\n\r\n if (particle.body.parent) return;\r\n if (particle.body['image']) {\r\n particle.body.regX = particle.body.image.width / 2;\r\n particle.body.regY = particle.body.image.height / 2;\r\n }\r\n }\r\n\r\n createCircle(particle) {\r\n const graphics = this.pool.get(createjs.Graphics);\r\n\r\n if (this.stroke) {\r\n if (this.stroke instanceof String)\r\n graphics.beginStroke(this.stroke);\r\n else\r\n graphics.beginStroke('#000000');\r\n }\r\n graphics.beginFill(particle.color || '#ff0000').drawCircle(0, 0, particle.radius);\r\n\r\n const shape = this.pool.get(createjs.Shape, [graphics]);\r\n\r\n particle.body = shape;\r\n particle.graphics = graphics;\r\n }\r\n\r\n}","import Util from '../utils/Util';\r\nimport Rectangle from '../math/Rectangle';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class PixelRenderer extends BaseRenderer {\r\n\r\n constructor(element, rectangle) {\r\n super(element);\r\n\r\n this.context = this.element.getContext('2d');\r\n this.imageData = null;\r\n this.rectangle = null;\r\n this.rectangle = rectangle;\r\n this.createImageData(rectangle);\r\n\r\n this.name = 'PixelRenderer';\r\n }\r\n\r\n resize(width, height) {\r\n this.element.width = width;\r\n this.element.height = height;\r\n }\r\n\r\n createImageData(rectangle) {\r\n this.rectangle = rectangle ? rectangle : new Rectangle(0, 0, this.element.width, this.element.height);\r\n this.imageData = this.context.createImageData(this.rectangle.width, this.rectangle.height);\r\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\r\n }\r\n\r\n onProtonUpdate() {\r\n this.context.clearRect(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\r\n this.imageData = this.context.getImageData(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\r\n }\r\n\r\n onProtonUpdateAfter() {\r\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\r\n }\r\n\r\n onParticleCreated(particle) {}\r\n\r\n onParticleUpdate(particle) {\r\n if (this.imageData) {\r\n this.setPixel(this.imageData, Math.floor(particle.p.x - this.rectangle.x), Math.floor(particle.p.y - this.rectangle.y), particle);\r\n }\r\n }\r\n\r\n setPixel(imagedata, x, y, particle) {\r\n const rgb = particle.transform.rgb;\r\n\r\n if ((x < 0) || (x > this.element.width) || (y < 0) || (y > this.elementwidth))\r\n return;\r\n\r\n const i = ((y >> 0) * imagedata.width + (x >> 0)) * 4;\r\n\r\n imagedata.data[i] = rgb.r;\r\n imagedata.data[i + 1] = rgb.g;\r\n imagedata.data[i + 2] = rgb.b;\r\n imagedata.data[i + 3] = particle.alpha * 255;\r\n }\r\n\r\n onParticleDead(particle) {\r\n\r\n }\r\n\r\n}","import Pool from '../core/Pool';\r\nimport Util from '../utils/Util';\r\nimport ColorUtil from '../utils/ColorUtil';\r\nimport MathUtils from '../math/MathUtils';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class PixiRenderer extends BaseRenderer {\r\n\r\n constructor(element, stroke) {\r\n super(element);\r\n\r\n this.stroke = stroke;\r\n this.setColor = false;\r\n this.pool.create = (body, particle) => this.createBody(body, particle);\r\n this.name = 'PixiRenderer';\r\n }\r\n\r\n onProtonUpdate() { }\r\n\r\n /**\r\n * @param particle\r\n */\r\n onParticleCreated(particle) {\r\n if (particle.body) {\r\n particle.body = this.pool.get(particle.body, particle);\r\n } else {\r\n particle.body = this.pool.get(this.circleConf, particle);\r\n }\r\n\r\n this.element.addChild(particle.body);\r\n }\r\n\r\n /**\r\n * @param particle\r\n */\r\n onParticleUpdate(particle) {\r\n this.transform(particle, particle.body);\r\n if (this.setColor) particle.body.tint = ColorUtil.getHex16FromParticle(particle);\r\n }\r\n\r\n /**\r\n * @param particle\r\n */\r\n onParticleDead(particle) {\r\n this.element.removeChild(particle.body);\r\n this.pool.expire(particle.body);\r\n particle.body = null;\r\n }\r\n\r\n destroy(particles) {\r\n super.destroy();\r\n this.pool.destroy();\r\n\r\n let i = particles.length;\r\n while (i--) {\r\n let particle = particles[i];\r\n if (particle.body) {\r\n this.element.removeChild(particle.body);\r\n }\r\n }\r\n }\r\n\r\n transform(particle, target) {\r\n target.x = particle.p.x;\r\n target.y = particle.p.y;\r\n\r\n target.alpha = particle.alpha;\r\n\r\n target.scale.x = particle.scale;\r\n target.scale.y = particle.scale;\r\n\r\n // using cached version of MathUtils.PI_180 for slight performance increase.\r\n target.rotation = particle.rotation * MathUtils.PI_180; // MathUtils.PI_180;\r\n }\r\n\r\n createBody(body, particle) {\r\n if (body.isCircle)\r\n return this.createCircle(particle);\r\n else\r\n return this.createSprite(body);\r\n }\r\n\r\n createSprite(body) {\r\n const sprite = body.isInner ? PIXI.Sprite.fromImage(body.src) : new PIXI.Sprite(body);\r\n sprite.anchor.x = 0.5;\r\n sprite.anchor.y = 0.5;\r\n\r\n return sprite;\r\n }\r\n\r\n createCircle(particle) {\r\n const graphics = new PIXI.Graphics();\r\n\r\n if (this.stroke) {\r\n let stroke = this.stroke instanceof String ? this.stroke : 0x000000;\r\n graphics.beginStroke(this.stroke);\r\n }\r\n\r\n graphics.beginFill(particle.color || 0x008ced);\r\n graphics.drawCircle(0, 0, particle.radius);\r\n graphics.endFill();\r\n\r\n return graphics;\r\n }\r\n}","import Mat3 from '../math/Mat3';\r\n\r\nexport default class MStack {\r\n\r\n\tconstructor() {\r\n\t\tthis.mats = [];\r\n\t\tthis.size = 0;\r\n\r\n\t\tfor (let i = 0; i < 20; i++) this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0]));\r\n\t}\r\n\r\n\tset(m, i) {\r\n\t\tif (i == 0)\r\n\t\t\tMat3.set(m, this.mats[0]);\r\n\t\telse\r\n\t\t\tMat3.multiply(this.mats[i - 1], m, this.mats[i]);\r\n\r\n\t\tthis.size = Math.max(this.size, i + 1);\r\n\t}\r\n\r\n\tpush(m) {\r\n\t\tif (this.size == 0)\r\n\t\t\tMat3.set(m, this.mats[0]);\r\n\t\telse\r\n\t\t\tMat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]);\r\n\r\n\t\tthis.size++;\r\n\t}\r\n\r\n\tpop() {\r\n\t\tif (this.size > 0)\r\n\t\t\tthis.size--;\r\n\t}\r\n\r\n\ttop() {\r\n\t\treturn (this.mats[this.size - 1]);\r\n\t}\r\n}","import Mat3 from '../math/Mat3';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nimport Util from '../utils/Util';\r\nimport ImgUtil from '../utils/ImgUtil';\r\nimport MStack from '../utils/MStack';\r\nimport DomUtil from '../utils/DomUtil';\r\nimport WebGLUtil from '../utils/WebGLUtil';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default class WebGLRenderer extends BaseRenderer {\r\n\r\n constructor(element) {\r\n super(element);\r\n\r\n this.gl = this.element.getContext('experimental-webgl', { antialias: true, stencil: false, depth: false });\r\n if (!this.gl) alert(\"Sorry your browser do not suppest WebGL!\");\r\n\r\n this.initVar();\r\n this.setMaxRadius();\r\n this.initShaders();\r\n this.initBuffers();\r\n\r\n this.gl.blendEquation(this.gl.FUNC_ADD);\r\n this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);\r\n this.gl.enable(this.gl.BLEND);\r\n\r\n this.addImg2Body = this.addImg2Body.bind(this);\r\n\r\n this.name = 'WebGLRenderer';\r\n }\r\n\r\n init(proton) {\r\n super.init(proton);\r\n this.resize(this.element.width, this.element.height);\r\n }\r\n\r\n resize(width, height) {\r\n this.umat[4] = -2;\r\n this.umat[7] = 1;\r\n\r\n this.smat[0] = 1 / width;\r\n this.smat[4] = 1 / height;\r\n\r\n this.mstack.set(this.umat, 0);\r\n this.mstack.set(this.smat, 1);\r\n\r\n this.gl.viewport(0, 0, width, height);\r\n this.element.width = width;\r\n this.element.height = height;\r\n }\r\n\r\n setMaxRadius(radius) {\r\n this.circleCanvasURL = this.createCircle(radius);\r\n }\r\n\r\n getVertexShader() {\r\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\");\r\n return vsSource;\r\n }\r\n\r\n getFragmentShader() {\r\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\");\r\n return fsSource;\r\n }\r\n\r\n initVar() {\r\n this.mstack = new MStack();\r\n this.umat = Mat3.create([2, 0, 1, 0, -2, 0, -1, 1, 1]);\r\n this.smat = Mat3.create([1 / 100, 0, 1, 0, 1 / 100, 0, 0, 0, 1]);\r\n this.texturebuffers = {};\r\n }\r\n\r\n blendEquation(A) {\r\n this.gl.blendEquation(this.gl[A]);\r\n }\r\n\r\n blendFunc(A, B) {\r\n this.gl.blendFunc(this.gl[A], this.gl[B]);\r\n }\r\n\r\n getShader(gl, str, fs) {\r\n const shader = fs ? gl.createShader(gl.FRAGMENT_SHADER) : gl.createShader(gl.VERTEX_SHADER);\r\n\r\n gl.shaderSource(shader, str);\r\n gl.compileShader(shader);\r\n\r\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n alert(gl.getShaderInfoLog(shader));\r\n return null;\r\n }\r\n\r\n return shader;\r\n }\r\n\r\n initShaders() {\r\n const fragmentShader = this.getShader(this.gl, this.getFragmentShader(), true);\r\n const vertexShader = this.getShader(this.gl, this.getVertexShader(), false);\r\n\r\n this.sprogram = this.gl.createProgram();\r\n this.gl.attachShader(this.sprogram, vertexShader);\r\n this.gl.attachShader(this.sprogram, fragmentShader);\r\n this.gl.linkProgram(this.sprogram);\r\n\r\n if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS))\r\n alert(\"Could not initialise shaders\");\r\n\r\n this.gl.useProgram(this.sprogram);\r\n this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, \"aVertexPosition\");\r\n this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, \"aTextureCoord\");\r\n this.gl.enableVertexAttribArray(this.sprogram.tca);\r\n this.gl.enableVertexAttribArray(this.sprogram.vpa);\r\n\r\n this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, \"tMat\");\r\n this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, \"uSampler\");\r\n this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, \"useTexture\");\r\n this.sprogram.color = this.gl.getUniformLocation(this.sprogram, \"uColor\");\r\n this.gl.uniform1i(this.sprogram.useTex, 1);\r\n };\r\n\r\n initBuffers() {\r\n const vs = [0, 3, 1, 0, 2, 3];\r\n let idx;\r\n\r\n this.unitIBuffer = this.gl.createBuffer();\r\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\r\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vs), this.gl.STATIC_DRAW);\r\n\r\n let i;\r\n let ids = [];\r\n for (i = 0; i < 100; i++) ids.push(i);\r\n idx = new Uint16Array(ids);\r\n\r\n this.unitI33 = this.gl.createBuffer();\r\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitI33);\r\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\r\n\r\n ids = [];\r\n for (i = 0; i < 100; i++) ids.push(i, i + 1, i + 2);\r\n idx = new Uint16Array(ids);\r\n\r\n this.stripBuffer = this.gl.createBuffer();\r\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.stripBuffer);\r\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\r\n };\r\n\r\n createCircle(raidus) {\r\n this.circleCanvasRadius = WebGLUtil.nhpot(Util.initValue(raidus, 32));\r\n const canvas = DomUtil.createCanvas('circle_canvas', this.circleCanvasRadius * 2, this.circleCanvasRadius * 2);\r\n const context = canvas.getContext('2d');\r\n\r\n context.beginPath();\r\n context.arc(this.circleCanvasRadius, this.circleCanvasRadius, this.circleCanvasRadius, 0, Math.PI * 2, true);\r\n context.closePath();\r\n context.fillStyle = '#FFF';\r\n context.fill();\r\n\r\n return canvas.toDataURL();\r\n };\r\n\r\n drawImg2Canvas(particle) {\r\n const _w = particle.body.width;\r\n const _h = particle.body.height;\r\n\r\n const _width = WebGLUtil.nhpot(particle.body.width);\r\n const _height = WebGLUtil.nhpot(particle.body.height);\r\n\r\n const _scaleX = particle.body.width / _width;\r\n const _scaleY = particle.body.height / _height;\r\n\r\n if (!this.texturebuffers[particle.transform.src])\r\n this.texturebuffers[particle.transform.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()];\r\n\r\n particle.transform.texture = this.texturebuffers[particle.transform.src][0];\r\n particle.transform.vcBuffer = this.texturebuffers[particle.transform.src][1];\r\n particle.transform.tcBuffer = this.texturebuffers[particle.transform.src][2];\r\n\r\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer);\r\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);\r\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer);\r\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);\r\n\r\n const context = particle.transform.canvas.getContext('2d');\r\n const data = context.getImageData(0, 0, _width, _height);\r\n\r\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture);\r\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, data);\r\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR);\r\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_NEAREST);\r\n this.gl.generateMipmap(this.gl.TEXTURE_2D);\r\n\r\n particle.transform.textureLoaded = true;\r\n particle.transform.textureWidth = _w;\r\n particle.transform.textureHeight = _h;\r\n }\r\n\r\n onProtonUpdate() {\r\n //this.gl.clearColor(0, 0, 0, 1);\r\n //this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\r\n }\r\n\r\n onParticleCreated(particle) {\r\n particle.transform.textureLoaded = false;\r\n particle.transform.tmat = Mat3.create();\r\n particle.transform.tmat[8] = 1;\r\n particle.transform.imat = Mat3.create();\r\n particle.transform.imat[8] = 1;\r\n\r\n if (particle.body) {\r\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\r\n } else {\r\n ImgUtil.getImgFromCache(this.circleCanvasURL, this.addImg2Body, particle);\r\n particle.transform.oldScale = particle.radius / this.circleCanvasRadius;\r\n }\r\n }\r\n\r\n // private \r\n addImg2Body(img, particle) {\r\n if (particle.dead) return;\r\n \r\n particle.body = img;\r\n particle.transform.src = img.src;\r\n particle.transform.canvas = ImgUtil.getCanvasFromCache(img);\r\n particle.transform.oldScale = 1;\r\n\r\n this.drawImg2Canvas(particle);\r\n }\r\n\r\n onParticleUpdate(particle) {\r\n if (particle.transform.textureLoaded) {\r\n this.updateMatrix(particle);\r\n\r\n this.gl.uniform3f(this.sprogram.color, particle.transform.rgb.r / 255, particle.transform.rgb.g / 255, particle.transform.rgb.b / 255);\r\n this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top());\r\n\r\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer);\r\n this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0);\r\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer);\r\n this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0);\r\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture);\r\n this.gl.uniform1i(this.sprogram.samplerUniform, 0);\r\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\r\n\r\n this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0);\r\n\r\n this.mstack.pop();\r\n }\r\n }\r\n\r\n onParticleDead(particle) { }\r\n\r\n updateMatrix(particle) {\r\n const moveOriginMatrix = WebGLUtil.makeTranslation(-particle.transform.textureWidth / 2, -particle.transform.textureHeight / 2);\r\n const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y);\r\n\r\n const angel = particle.rotation * (MathUtils.PI_180);\r\n const rotationMatrix = WebGLUtil.makeRotation(angel);\r\n\r\n const scale = particle.scale * particle.transform.oldScale;\r\n const scaleMatrix = WebGLUtil.makeScale(scale, scale);\r\n let matrix = WebGLUtil.matrixMultiply(moveOriginMatrix, scaleMatrix);\r\n\r\n matrix = WebGLUtil.matrixMultiply(matrix, rotationMatrix);\r\n matrix = WebGLUtil.matrixMultiply(matrix, translationMatrix);\r\n\r\n Mat3.inverse(matrix, particle.transform.imat);\r\n matrix[2] = particle.alpha;\r\n\r\n this.mstack.push(matrix);\r\n }\r\n}","import Util from '../utils/Util';\r\nimport BaseRenderer from './BaseRenderer';\r\n\r\nexport default class CustomRenderer extends BaseRenderer {\r\n\r\n constructor(element) {\r\n super(element);\r\n\r\n this.name = 'CustomRenderer';\r\n }\r\n\r\n}","import Zone from './Zone';\r\nimport Util from '../utils/Util';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default class LineZone extends Zone {\r\n\r\n\tconstructor(x1, y1, x2, y2, direction) {\r\n\t\tsuper();\r\n\r\n\t\tif (x2 - x1 >= 0) {\r\n\t\t\tthis.x1 = x1;\r\n\t\t\tthis.y1 = y1;\r\n\t\t\tthis.x2 = x2;\r\n\t\t\tthis.y2 = y2;\r\n\t\t} else {\r\n\t\t\tthis.x1 = x2;\r\n\t\t\tthis.y1 = y2;\r\n\t\t\tthis.x2 = x1;\r\n\t\t\tthis.y2 = y1;\r\n\t\t}\r\n\r\n\t\tthis.dx = this.x2 - this.x1;\r\n\t\tthis.dy = this.y2 - this.y1;\r\n\r\n\t\tthis.minx = Math.min(this.x1, this.x2);\r\n\t\tthis.miny = Math.min(this.y1, this.y2);\r\n\t\tthis.maxx = Math.max(this.x1, this.x2);\r\n\t\tthis.maxy = Math.max(this.y1, this.y2);\r\n\r\n\t\tthis.dot = this.x2 * this.y1 - this.x1 * this.y2;\r\n\t\tthis.xxyy = this.dx * this.dx + this.dy * this.dy;\r\n\r\n\t\tthis.gradient = this.getGradient();\r\n\t\tthis.length = this.getLength();\r\n\t\tthis.direction = Util.initValue(direction, '>');\r\n\t}\r\n\r\n\r\n\tgetPosition() {\r\n\t\tthis.random = Math.random();\r\n\t\tthis.vector.x = this.x1 + this.random * this.length * Math.cos(this.gradient);\r\n\t\tthis.vector.y = this.y1 + this.random * this.length * Math.sin(this.gradient);\r\n\r\n\t\treturn this.vector;\r\n\t}\r\n\r\n\tgetDirection(x, y) {\r\n\t\tconst A = this.dy;\r\n\t\tconst B = -this.dx;\r\n\t\tconst C = this.dot;\r\n\t\tconst D = B == 0 ? 1 : B;\r\n\r\n\t\tif ((A * x + B * y + C) * D > 0)\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\tgetDistance(x, y) {\r\n\t\tconst A = this.dy;\r\n\t\tconst B = -this.dx;\r\n\t\tconst C = this.dot;\r\n\t\tconst D = (A * x + B * y + C);\r\n\r\n\t\treturn D / Math.sqrt(this.xxyy);\r\n\t}\r\n\r\n\tgetSymmetric(v) {\r\n\t\tconst tha2 = v.getGradient();\r\n\t\tconst tha1 = this.getGradient();\r\n\t\tconst tha = 2 * (tha1 - tha2);\r\n\r\n\t\tconst oldx = v.x;\r\n\t\tconst oldy = v.y;\r\n\r\n\t\tv.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\r\n\t\tv.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\r\n\r\n\t\treturn v;\r\n\t}\r\n\r\n\tgetGradient() {\r\n\t\treturn Math.atan2(this.dy, this.dx);\r\n\t}\r\n\r\n\trangeOut(particle) {\r\n\t\tconst angle = Math.abs(this.getGradient());\r\n\r\n\t\tif (angle <= MathUtils.PI / 4) {\r\n\t\t\tif (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true;\r\n\t\t} else {\r\n\t\t\tif (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetLength() {\r\n\t\treturn Math.sqrt(this.dx * this.dx + this.dy * this.dy)\r\n\t}\r\n\r\n\tcrossing(particle) {\r\n\t\tif (this.crossType == \"dead\") {\r\n\t\t\tif (this.direction == \">\" || this.direction == \"R\" || this.direction == \"right\" || this.direction == \"down\") {\r\n\t\t\t\tif (!this.rangeOut(particle)) return;\r\n\t\t\t\tif (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\r\n\t\t\t} else {\r\n\t\t\t\tif (!this.rangeOut(particle)) return;\r\n\t\t\t\tif (!this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse if (this.crossType == \"bound\") {\r\n\t\t\tif (!this.rangeOut(particle)) return;\r\n\r\n\t\t\tif (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) {\r\n\t\t\t\tif (this.dx == 0) {\r\n\t\t\t\t\tparticle.v.x *= -1;\r\n\t\t\t\t} else if (this.dy == 0) {\r\n\t\t\t\t\tparticle.v.y *= -1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.getSymmetric(particle.v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse if (this.crossType == \"cross\") {\r\n\t\t\tif (this.alert) {\r\n\t\t\t\tconsole.error('Sorry lineZone does not support cross method');\r\n\t\t\t\tthis.alert = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}","import Zone from './Zone';\r\nimport MathUtils from '../math/MathUtils';\r\n\r\nexport default class CircleZone extends Zone {\r\n\r\n constructor(x, y, radius) {\r\n super();\r\n\r\n this.x = x;\r\n this.y = y;\r\n this.radius = radius;\r\n\r\n this.angle = 0;\r\n this.center = { x, y };\r\n }\r\n\r\n getPosition() {\r\n this.random = Math.random();\r\n this.angle = MathUtils.PIx2 * Math.random();\r\n\r\n this.vector.x = this.x + this.random * this.radius * Math.cos(this.angle);\r\n this.vector.y = this.y + this.random * this.radius * Math.sin(this.angle);\r\n\r\n return this.vector;\r\n }\r\n\r\n setCenter(x, y) {\r\n this.center.x = x;\r\n this.center.y = y;\r\n }\r\n\r\n crossing(particle) {\r\n const d = particle.p.distanceTo(this.center);\r\n\r\n if (this.crossType == \"dead\") {\r\n if (d - particle.radius > this.radius)\r\n particle.dead = true;\r\n } else if (this.crossType == \"bound\") {\r\n if (d + particle.radius >= this.radius)\r\n this.getSymmetric(particle);\r\n } else if (this.crossType == \"cross\") {\r\n if (this.alert) {\r\n alert('Sorry CircleZone does not support cross method');\r\n this.alert = false;\r\n }\r\n }\r\n }\r\n\r\n getSymmetric(particle) {\r\n let tha2 = particle.v.getGradient();\r\n let tha1 = this.getGradient(particle);\r\n\r\n let tha = 2 * (tha1 - tha2);\r\n let oldx = particle.v.x;\r\n let oldy = particle.v.y;\r\n\r\n particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\r\n particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\r\n }\r\n\r\n getGradient(particle) {\r\n return -MathUtils.PI_2 + Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x);\r\n }\r\n}","import Zone from './Zone';\r\n\r\nexport default class RectZone extends Zone {\r\n\r\n\tconstructor(x, y, width, height) {\r\n\t\tsuper();\r\n\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t}\r\n\r\n\tgetPosition() {\r\n\t\tthis.vector.x = this.x + Math.random() * this.width;\r\n\t\tthis.vector.y = this.y + Math.random() * this.height;\r\n\r\n\t\treturn this.vector;\r\n\t}\r\n\r\n\tcrossing(particle) {\r\n\t\tif (this.crossType == \"dead\") {\r\n\t\t\tif (particle.p.x + particle.radius < this.x)\r\n\t\t\t\tparticle.dead = true;\r\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width)\r\n\t\t\t\tparticle.dead = true;\r\n\r\n\t\t\tif (particle.p.y + particle.radius < this.y)\r\n\t\t\t\tparticle.dead = true;\r\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height)\r\n\t\t\t\tparticle.dead = true;\r\n\t\t}\r\n\r\n\t\telse if (this.crossType == \"bound\") {\r\n\t\t\tif (particle.p.x - particle.radius < this.x) {\r\n\t\t\t\tparticle.p.x = this.x + particle.radius;\r\n\t\t\t\tparticle.v.x *= -1;\r\n\t\t\t} else if (particle.p.x + particle.radius > this.x + this.width) {\r\n\t\t\t\tparticle.p.x = this.x + this.width - particle.radius;\r\n\t\t\t\tparticle.v.x *= -1;\r\n\t\t\t}\r\n\r\n\t\t\tif (particle.p.y - particle.radius < this.y) {\r\n\t\t\t\tparticle.p.y = this.y + particle.radius;\r\n\t\t\t\tparticle.v.y *= -1;\r\n\t\t\t} else if (particle.p.y + particle.radius > this.y + this.height) {\r\n\t\t\t\tparticle.p.y = this.y + this.height - particle.radius;\r\n\t\t\t\tparticle.v.y *= -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\telse if (this.crossType == \"cross\") {\r\n\t\t\tif (particle.p.x + particle.radius < this.x && particle.v.x <= 0)\r\n\t\t\t\tparticle.p.x = this.x + this.width + particle.radius;\r\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width && particle.v.x >= 0)\r\n\t\t\t\tparticle.p.x = this.x - particle.radius;\r\n\r\n\t\t\tif (particle.p.y + particle.radius < this.y && particle.v.y <= 0)\r\n\t\t\t\tparticle.p.y = this.y + this.height + particle.radius;\r\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height && particle.v.y >= 0)\r\n\t\t\t\tparticle.p.y = this.y - particle.radius;\r\n\t\t}\r\n\t}\r\n}","import Zone from './Zone';\r\nimport Util from '../utils/Util';\r\n\r\nexport default class ImageZone extends Zone {\r\n\r\n\tconstructor(imageData, x, y, d) {\r\n\t\tsuper();\r\n\r\n\t\tthis.reset(imageData, x, y, d);\r\n\t}\r\n\r\n\treset(imageData, x, y, d) {\r\n\t\tthis.imageData = imageData;\r\n\t\tthis.x = Util.initValue(x, 0);\r\n\t\tthis.y = Util.initValue(y, 0);\r\n\t\tthis.d = Util.initValue(d, 2);\r\n\r\n\t\tthis.vectors = [];\r\n\t\tthis.setVectors();\r\n\t}\r\n\r\n\tsetVectors() {\r\n\t\tlet i, j;\r\n\t\tconst length1 = this.imageData.width;\r\n\t\tconst length2 = this.imageData.height;\r\n\r\n\t\tfor (i = 0; i < length1; i += this.d) {\r\n\t\t\tfor (j = 0; j < length2; j += this.d) {\r\n\t\t\t\tlet index = ((j >> 0) * length1 + (i >> 0)) * 4;\r\n\r\n\t\t\t\tif (this.imageData.data[index + 3] > 0) {\r\n\t\t\t\t\tthis.vectors.push({ x: i + this.x, y: j + this.y });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.vector;\r\n\t}\r\n\r\n\tgetBound(x, y) {\r\n\t\tvar index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\r\n\t\tif (this.imageData.data[index + 3] > 0)\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\tgetPosition() {\r\n\t\treturn this.vector.copy(this.vectors[Math.floor(Math.random() * this.vectors.length)]);\r\n\t}\r\n\r\n\tgetColor(x, y) {\r\n\t\tx -= this.x;\r\n\t\ty -= this.y;\r\n\t\tvar i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\r\n\r\n\t\treturn {\r\n\t\t\tr: this.imageData.data[i],\r\n\t\t\tg: this.imageData.data[i + 1],\r\n\t\t\tb: this.imageData.data[i + 2],\r\n\t\t\ta: this.imageData.data[i + 3]\r\n\t\t};\r\n\t}\r\n\r\n\tcrossing(particle) {\r\n\t\tif (this.crossType == \"dead\") {\r\n\t\t\tif (this.getBound(particle.p.x - this.x, particle.p.y - this.y))\r\n\t\t\t\tparticle.dead = true;\r\n\t\t\telse\r\n\t\t\t\tparticle.dead = false;\r\n\t\t} \r\n\t\t\r\n\t\telse if (this.crossType == \"bound\") {\r\n\t\t\tif (!this.getBound(particle.p.x - this.x, particle.p.y - this.y))\r\n\t\t\t\tparticle.v.negate();\r\n\t\t}\r\n\t}\r\n}","import Util from '../utils/Util';\r\nimport ColorUtil from '../utils/ColorUtil';\r\nimport MathUtils from '../math/MathUtils';\r\nimport CircleZone from '../zone/CircleZone';\r\nimport PointZone from '../zone/PointZone';\r\nimport LineZone from '../zone/LineZone';\r\nimport RectZone from '../zone/RectZone';\r\n\r\nexport default {\r\n\taddEventListener(proton, fun) {\r\n\t\tproton.addEventListener(\"PROTON_UPDATE_AFTER\", () => fun());\r\n\t},\r\n\r\n\tgetStyle(color) {\r\n\t\tconst rgb = ColorUtil.hexToRGB(color || '#ff0000');\r\n\t\treturn `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`;\r\n\t},\r\n\t\r\n\tdrawZone(proton, canvas, zone, clear) {\r\n\t\tconst context = canvas.getContext('2d');\r\n\t\tconst style = this.getStyle();\r\n\r\n\t\tthis.addEventListener(proton, () => {\r\n\t\t\tif (clear)\r\n\t\t\t\tcontext.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n\t\t\tif (zone instanceof PointZone) {\r\n\t\t\t\tcontext.beginPath();\r\n\t\t\t\tcontext.fillStyle = style;\r\n\t\t\t\tcontext.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true);\r\n\t\t\t\tcontext.fill();\r\n\t\t\t\tcontext.closePath();\r\n\t\t\t} else if (zone instanceof LineZone) {\r\n\t\t\t\tcontext.beginPath();\r\n\t\t\t\tcontext.strokeStyle = style;\r\n\t\t\t\tcontext.moveTo(zone.x1, zone.y1);\r\n\t\t\t\tcontext.lineTo(zone.x2, zone.y2);\r\n\t\t\t\tcontext.stroke();\r\n\t\t\t\tcontext.closePath();\r\n\t\t\t} else if (zone instanceof RectZone) {\r\n\t\t\t\tcontext.beginPath();\r\n\t\t\t\tcontext.strokeStyle = style;\r\n\t\t\t\tcontext.drawRect(zone.x, zone.y, zone.width, zone.height);\r\n\t\t\t\tcontext.stroke();\r\n\t\t\t\tcontext.closePath();\r\n\t\t\t} else if (zone instanceof CircleZone) {\r\n\t\t\t\tcontext.beginPath();\r\n\t\t\t\tcontext.strokeStyle = style;\r\n\t\t\t\tcontext.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true);\r\n\t\t\t\tcontext.stroke();\r\n\t\t\t\tcontext.closePath();\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\t\r\n\tdrawEmitter(proton, canvas, emitter, clear) {\r\n\t\tconst context = canvas.getContext('2d');\r\n\t\tconst style = this.getStyle();\r\n\r\n\t\tthis.addEventListener(proton, () => {\r\n\t\t\tif (clear) context.clearRect(0, 0, canvas.width, canvas.height);\r\n\t\t\t\r\n\t\t\tcontext.beginPath();\r\n\t\t\tcontext.fillStyle = style;\r\n\t\t\tcontext.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true);\r\n\t\t\tcontext.fill();\r\n\t\t\tcontext.closePath();\r\n\t\t});\r\n\t},\r\n}\r\n\r\n","// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\r\n// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating\r\n\r\n// requestAnimationFrame polyfill by Erik Möller\r\n// fixes from Paul Irish and Tino Zijdel\r\n( function() {\r\n\t\tvar lastTime = 0;\r\n\t\tvar vendors = ['ms', 'moz', 'webkit', 'o'];\r\n\t\tfor (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {\r\n\t\t\twindow.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];\r\n\t\t\twindow.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];\r\n\t\t}\r\n\r\n\t\tif (!window.requestAnimationFrame)\r\n\t\t\twindow.requestAnimationFrame = function(callback, element) {\r\n\t\t\t\tvar currTime = new Date().getTime();\r\n\t\t\t\tvar timeToCall = Math.max(0, 16 - (currTime - lastTime));\r\n\t\t\t\tvar id = window.setTimeout(function() {\r\n\t\t\t\t\tcallback(currTime + timeToCall);\r\n\t\t\t\t}, timeToCall);\r\n\t\t\t\tlastTime = currTime + timeToCall;\r\n\t\t\t\treturn id;\r\n\t\t\t};\r\n\r\n\t\tif (!window.cancelAnimationFrame)\r\n\t\t\twindow.cancelAnimationFrame = function(id) {\r\n\t\t\t\tclearTimeout(id);\r\n\t\t\t};\r\n\t}()); ","// import \r\nimport Proton from \"./core/Proton\";\r\nimport Particle from \"./core/Particle\";\r\nimport Pool from \"./core/Pool\";\r\n\r\nimport Util from \"./utils/Util\";\r\nimport ColorUtil from \"./utils/ColorUtil\";\r\nimport MathUtils from \"./math/MathUtils\";\r\nimport Vector2D from \"./math/Vector2D\";\r\nimport Polar2D from \"./math/Polar2D\";\r\nimport Mat3 from \"./math/Mat3\";\r\nimport Span from \"./math/Span\";\r\nimport ArraySpan from \"./math/ArraySpan\";\r\nimport Rectangle from \"./math/Rectangle\";\r\nimport ease from \"./math/ease\";\r\n\r\nimport Rate from \"./initialize/Rate\";\r\nimport Initialize from \"./initialize/Initialize\";\r\nimport Life from \"./initialize/Life\";\r\nimport Position from \"./initialize/Position\";\r\nimport Velocity from \"./initialize/Velocity\";\r\nimport Mass from \"./initialize/Mass\";\r\nimport Radius from \"./initialize/Radius\";\r\nimport Body from \"./initialize/Body\";\r\n\r\nimport Behaviour from \"./behaviour/Behaviour\";\r\nimport Force from \"./behaviour/Force\";\r\nimport Attraction from \"./behaviour/Attraction\";\r\nimport RandomDrift from \"./behaviour/RandomDrift\";\r\nimport Gravity from \"./behaviour/Gravity\";\r\nimport Collision from \"./behaviour/Collision\";\r\nimport CrossZone from \"./behaviour/CrossZone\";\r\nimport Alpha from \"./behaviour/Alpha\";\r\nimport Scale from \"./behaviour/Scale\";\r\nimport Rotate from \"./behaviour/Rotate\";\r\nimport Color from \"./behaviour/Color\";\r\nimport Repulsion from \"./behaviour/Repulsion\";\r\nimport GravityWell from \"./behaviour/GravityWell\";\r\n\r\nimport Emitter from \"./emitter/Emitter\";\r\nimport BehaviourEmitter from \"./emitter/BehaviourEmitter\";\r\nimport FollowEmitter from \"./emitter/FollowEmitter\";\r\n\r\nimport CanvasRenderer from \"./render/CanvasRenderer\";\r\nimport DomRenderer from \"./render/DomRenderer\";\r\nimport EaselRenderer from \"./render/EaselRenderer\";\r\nimport PixelRenderer from \"./render/PixelRenderer\";\r\nimport PixiRenderer from \"./render/PixiRenderer\";\r\nimport WebGLRenderer from \"./render/WebGLRenderer\";\r\nimport CustomRenderer from \"./render/CustomRenderer\";\r\n\r\nimport Zone from \"./zone/Zone\";\r\nimport LineZone from \"./zone/LineZone\";\r\nimport CircleZone from \"./zone/CircleZone\";\r\nimport PointZone from \"./zone/PointZone\";\r\nimport RectZone from \"./zone/RectZone\";\r\nimport ImageZone from \"./zone/ImageZone\";\r\n\r\nimport Debug from \"./debug/Debug\";\r\nimport \"./polyfill/requestAnimationFrame\";\r\n\r\n// namespace\r\nProton.Particle = Proton.P = Particle;\r\nProton.Pool = Pool;\r\n\r\nProton.Util = Util;\r\nProton.ColorUtil = ColorUtil;\r\nProton.MathUtils = MathUtils;\r\nProton.Vector2D = Proton.Vector = Vector2D;\r\nProton.Polar2D = Proton.Polar = Polar2D;\r\nProton.ArraySpan = ArraySpan;\r\nProton.Rectangle = Rectangle;\r\nProton.Rate = Rate;\r\nProton.ease = ease;\r\nProton.Span = Span;\r\nProton.Mat3 = Mat3;\r\nProton.getSpan = (a, b, center) => new Span(a, b, center);\r\nProton.createArraySpan = ArraySpan.createArraySpan;\r\n\r\nProton.Initialize = Proton.Init = Initialize;\r\nProton.Life = Proton.L = Life;\r\nProton.Position = Proton.P = Position;\r\nProton.Velocity = Proton.V = Velocity;\r\nProton.Mass = Proton.M = Mass;\r\nProton.Radius = Proton.R = Radius;\r\nProton.Body = Proton.B = Body;\r\n\r\nProton.Behaviour = Behaviour;\r\nProton.Force = Proton.F = Force;\r\nProton.Attraction = Proton.A = Attraction;\r\nProton.RandomDrift = Proton.RD = RandomDrift;\r\nProton.Gravity = Proton.G = Gravity;\r\nProton.Collision = Collision;\r\nProton.CrossZone = CrossZone;\r\nProton.Alpha = Proton.A = Alpha;\r\nProton.Scale = Proton.S = Scale;\r\nProton.Rotate = Rotate;\r\nProton.Color = Color;\r\nProton.Repulsion = Repulsion;\r\nProton.GravityWell = GravityWell;\r\n\r\nProton.Emitter = Emitter;\r\nProton.BehaviourEmitter = BehaviourEmitter;\r\nProton.FollowEmitter = FollowEmitter;\r\n\r\nProton.Zone = Zone;\r\nProton.LineZone = LineZone;\r\nProton.CircleZone = CircleZone;\r\nProton.PointZone = PointZone;\r\nProton.RectZone = RectZone;\r\nProton.ImageZone = ImageZone;\r\n\r\nProton.CanvasRenderer = CanvasRenderer;\r\nProton.DomRenderer = DomRenderer;\r\nProton.EaselRenderer = EaselRenderer;\r\nProton.PixiRenderer = PixiRenderer;\r\nProton.PixelRenderer = PixelRenderer;\r\nProton.WebGLRenderer = Proton.WebGlRenderer = WebGLRenderer;\r\nProton.CustomRenderer = CustomRenderer;\r\n\r\nProton.Debug = Debug;\r\n\r\nObject.assign(Proton, ease);\r\n\r\n// export\r\nexport default Proton;"],"names":["PI","MathUtils","a","b","INT","Math","floor","random","center","f","this","randomAToB","display","num","toString","slice","Vector2D","x","y","atan2","PI_2","v","w","undefined","addVectors","subVectors","s","set","multiplyScalar","sqrt","divideScalar","length","distanceToSquared","tha","cos","sin","dx","dy","alpha","Span","isArray","Util","initValue","randomFloating","i","tx","ty","angleInRadians","c","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","scale","rotate","willChange","css3","key","val","bkey","charAt","toUpperCase","substr","IMG_CACHE","CANVAS_CACHE","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","array","obj","ignore","o","indexOf","constructor","args","concat","bind","apply","pOBJ","hasProp","p","particle","copy","prototypeObject","filters","singleProp","hasOwnProperty","getSpanValue","pan","getValue","ImgUtil","arr","destroy","uid","getCacheID","cache","isInner","Pool","total","params","__puid","PUID","getID","pop","createOrClone","getCache","push","create","classApply","clone","count","Stats","proton","container","type","emitterIndex","rendererIndex","body","add","emitter","getEmitter","renderer","getRenderer","str","emitters","emitSpeed","getEmitterPos","initializes","concatArr","behaviours","name","getCreatedNumber","getCount","pool","innerHTML","cssText","join","addEventListener","_this","bg","color","parentNode","appendChild","renderers","result","cpool","round","EventDispatcher","_listeners","listener","removeEventListener","splice","listeners","handler","TargetClass","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","sleep","old","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","getAllParticles","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","pow","ease","easeLinear","Particle","ID","reset","setPrototypeByObject","N180_PI","life","Infinity","age","energy","dead","sprite","radius","rotation","easing","destroyObject","removeAllBehaviours","rgb","r","g","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","destroyArray","h","hex16","substring","parseInt","rbg","Number","Polar2D","abs","getX","getY","mat3","mat","Float32Array","mat1","mat2","m","vec","ArraySpan","_arr","randomColor","Rectangle","bottom","right","Rate","numpan","timepan","numPan","setSpanValue","timePan","startTime","nextTime","Initialize","Life","lifePan","Zone","vector","crossType","alert","PointZone","Position","zone","getPosition","Velocity","rpan","thapan","rPan","thaPan","vr","polar2d","normalizeVelocity","PI_180","Mass","massPan","Radius","oldRadius","Body","imagetarget","inner","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","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVector2DByObject","degreeTransform","Emitter","pObj","emitTime","totalTime","rate","stoped","isNaN","oldStoped","oldEmitTime","oldTotalTime","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","slow","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mouseTarget","window","_allowEmitting","initEventHandler","mousemoveHandler","_this2","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","layerX","layerY","offsetX","offsetY","babelHelpers.get","BaseRenderer","element","stroke","initHandler","circleConf","isCircle","thinkness","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","CanvasRenderer","bufferCache","addImg2Body","drawCircle","buffer","createBuffer","bufferContext","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","String","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","data","PixiRenderer","setColor","tint","getHex16FromParticle","PIXI","Sprite","fromImage","anchor","endFill","MStack","mats","Mat3","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","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","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","CustomRenderer","LineZone","x1","y1","x2","y2","direction","minx","min","miny","maxx","maxy","dot","xxyy","gradient","getGradient","getLength","tha2","oldx","oldy","rangeOut","getDistance","getSymmetric","error","CircleZone","angle","PIx2","d","distanceTo","RectZone","ImageZone","vectors","setVectors","j","length1","length2","getBound","negate","fun","getStyle","moveTo","lineTo","drawRect","lastTime","vendors","requestAnimationFrame","cancelAnimationFrame","currTime","timeToCall","setTimeout","P","Vector","Polar","getSpan","Init","L","V","M","R","F","RD","G","S","WebGlRenderer","Debug","assign"],"mappings":";;;;;;;;;kLAAA,IAAMA,EAAK,UAELC,EAAY,IAEVD,OACO,EAALA,OACAA,EAAK,SACHA,EAAK,YACJ,IAAMA,sBAEJE,EAAGC,EAAGC,UACRA,EAGMC,KAAKC,MAAMD,KAAKE,UAAYJ,EAAID,IAAMA,EAFtCA,EAAIG,KAAKE,UAAYJ,EAAID,4BAKzBM,EAAQC,EAAGL,UACfM,KAAKC,WAAWH,EAASC,EAAGD,EAASC,EAAGL,wBAGxCQ,8BAEKV,UACLA,EAAIF,EAAK,wBAGVa,SACC,IAAMA,EAAIC,SAAS,kCAInB,KAAO,SAA2B,SAAhBT,KAAKE,UAAwB,GAAGO,SAAS,KAAKC,OAAO,iwCC9BjEC,wBAELC,EAAGC,kBACND,EAAIA,GAAK,OACTC,EAAIA,GAAK,wCAGdD,EAAGC,eACED,EAAIA,OACJC,EAAIA,EACFR,kCAGNO,eACIA,EAAIA,EACFP,kCAGNQ,eACIA,EAAIA,EACFR,kDAIO,GAAVA,KAAKO,EACEZ,KAAKc,MAAMT,KAAKQ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OwlB,OAAOlf,EAAQ8B"} \ No newline at end of file +{"version":3,"file":"proton.min.js","sources":["../src/math/MathUtils.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/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/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/polyfill/requestAnimationFrame.js","../src/index.js"],"sourcesContent":["const PI = 3.1415926;\n\nconst MathUtils = {\n\n PI: PI,\n PIx2: PI * 2,\n PI_2: PI / 2,\n PI_180: PI / 180,\n N180_PI: 180 / PI,\n\n randomAToB(a, b, INT) {\n if (!INT)\n return a + Math.random() * (b - a);\n else\n return Math.floor(Math.random() * (b - a)) + a;\n },\n\n randomFloating(center, f, INT) {\n return this.randomAToB(center - f, center + f, INT);\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 '#' + ('00000' + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6);\n }\n}\n\nexport default MathUtils;","import Util from '../utils/Util';\nimport MathUtils from '../math/MathUtils';\n\nexport default class Span {\n\n\tconstructor(a, b, center) {\n\t\tthis.isArray = false;\n\n\t\tif (Util.isArray(a)) {\n\t\t\tthis.isArray = true;\n\t\t\tthis.a = a;\n\t\t} else {\n\t\t\tthis.a = Util.initValue(a, 1);\n\t\t\tthis.b = Util.initValue(b, this.a);\n\t\t\tthis.center = Util.initValue(center, false);\n\t\t}\n\n\t}\n\n\tgetValue(INT) {\n\t\tif (this.isArray) {\n\t\t\treturn this.a[Math.floor(this.a.length * Math.random())];\n\t\t} else {\n\t\t\tif (!this.center)\n\t\t\t\treturn MathUtils.randomAToB(this.a, this.b, INT);\n\t\t\telse\n\t\t\t\treturn MathUtils.randomFloating(this.a, this.b, INT);\n\t\t}\n\t}\n}","export default {\n\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}","export default {\n\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) {\n const dom = document.createElement('canvas');\n position = position || 'absolute';\n\n dom.id = id;\n dom.width = width;\n dom.height = height;\n dom.style.opacity = 0;\n dom.style.position = position;\n\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 const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`;\n\n div.style.willChange = 'transform';\n this.css3(div, 'transform', transform);\n },\n\n transform3d(div, x, y, scale, rotate) {\n const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;\n\n div.style.willChange = 'transform';\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}","import WebGLUtil from './WebGLUtil';\nimport DomUtil from './DomUtil';\n\nconst IMG_CACHE = {};\nconst CANVAS_CACHE = {};\nlet canvasID = 0;\n\nexport default {\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 context.drawImage(image, rect.x, rect.y);\n const imagedata = context.getImageData(rect.x, rect.y, rect.width, rect.height);\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.transform.canvas\n * @param {Boolean} func\n */\n getImgFromCache(img, callback, param) {\n const src = typeof (img) === 'string' ? img : img.src;\n\n if (IMG_CACHE[src]) {\n callback(IMG_CACHE[src], param);\n } else {\n const image = new Image();\n image.onload = e => {\n IMG_CACHE[src] = e.target;\n callback(IMG_CACHE[src], param);\n }\n\n image.src = src;\n }\n },\n\n getCanvasFromCache(img, callback, param) {\n const src = img.src;\n\n if (!CANVAS_CACHE[src]) {\n const width = WebGLUtil.nhpot(img.width);\n const height = WebGLUtil.nhpot(img.height);\n\n const canvas = DomUtil.createCanvas(`canvas_cache_${canvasID}`, width, height);\n const context = canvas.getContext('2d');\n context.drawImage(img, 0, 0, img.width, img.height);\n\n CANVAS_CACHE[src] = canvas;\n }\n\n callback && callback(CANVAS_CACHE[src], param);\n\n return CANVAS_CACHE[src];\n }\n}","import Span from '../math/Span';\nimport ImgUtil from './ImgUtil';\n\nexport default {\n\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 destroyArray\n *\n * @param {Array} array Any array\n */\n destroyArray(array) {\n if (array) array.length = 0;\n },\n\n /**\n * Destroyes the given object\n *\n * @memberof Proton#Proton.Util\n * @method destroyObject\n *\n * @param {Object} obj Any object\n */\n destroyObject(obj, ignore) {\n for (let o in obj) {\n if (ignore && ignore.indexOf(o) > -1) continue;\n delete obj[o];\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) {\n if (!args) return new constructor;\n\n args = [null].concat(args);\n const FactoryFunc = constructor.bind.apply(constructor, args);\n return new FactoryFunc();\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method setVector2DByObject\n *\n * @todo add description for param `target`\n * @todo add description for param `pOBJ`\n * @todo add description for function\n *\n * @param {Object} target\n * @param {Object} pOBJ\n */\n setVector2DByObject(target, pOBJ) {\n if (this.hasProp(pOBJ, 'x')) target.p.x = pOBJ['x'];\n if (this.hasProp(pOBJ, 'y')) target.p.y = pOBJ['y'];\n\n if (this.hasProp(pOBJ, 'vx')) target.v.x = pOBJ['vx'];\n if (this.hasProp(pOBJ, 'vy')) target.v.y = pOBJ['vy'];\n\n if (this.hasProp(pOBJ, 'ax')) target.a.x = pOBJ['ax'];\n if (this.hasProp(pOBJ, 'ay')) target.a.y = pOBJ['ay'];\n\n if (this.hasProp(pOBJ, 'p')) target.p.copy(pOBJ['p']);\n if (this.hasProp(pOBJ, 'v')) target.v.copy(pOBJ['v']);\n if (this.hasProp(pOBJ, 'a')) target.a.copy(pOBJ['a']);\n\n if (this.hasProp(pOBJ, 'position')) target.p.copy(pOBJ['position']);\n if (this.hasProp(pOBJ, 'velocity')) target.v.copy(pOBJ['velocity']);\n if (this.hasProp(pOBJ, 'accelerate')) target.a.copy(pOBJ['accelerate']);\n },\n\n hasProp(obj, key) {\n if (!obj) return false;\n return obj[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 setPrototypeByObject\n *\n * @todo add description for param `target`\n * @todo add description for param `filters`\n * @todo translate desription from chinese to english\n *\n * @param {Object} target\n * @param {Object} prototypeObject An object of single prototypes\n * @param {Object} filters\n *\n * @return {Object} target\n */\n setPrototypeByObject(target, prototypeObject, filters) {\n for (let singleProp in prototypeObject) {\n if (target.hasOwnProperty(singleProp)) {\n if (filters) {\n if (filters.indexOf(singleProp) < 0)\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\n } else {\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\n }\n }\n }\n\n return target;\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 setSpanValue(a, b, c) {\n if (a instanceof Span) {\n return a;\n } else {\n if (!b) {\n return new Span(a);\n } else {\n if (!c)\n return new Span(a, b);\n else\n 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 getSpanValue\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 getSpanValue(pan) {\n return pan instanceof Span ? pan.getValue() : pan;\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 destroy(arr, param) {\n let i = arr.length;\n\n while (i--) {\n try { arr[i].destroy(param); } catch (e) { }\n delete arr[i];\n }\n\n arr.length = 0;\n }\n\n}","export default {\n id: 0,\n cache: {},\n\n getID(target) {\n let uid = this.getCacheID(target);\n if (uid) return uid;\n\n uid = `PUID_${this.id++}`;\n this.cache[uid] = target;\n\n return uid;\n },\n\n getCacheID(target) {\n let obj;\n for (let id in this.cache) {\n obj = this.cache[id];\n\n if (obj === target) return id;\n if (typeof obj === 'object' && typeof target === 'object' && obj.isInner && target.isInner) {\n if (obj.src === target.src)\n return id;\n }\n }\n\n return null;\n },\n\n getTarget(uid) {\n return this.cache[uid];\n }\n}","/**\n * get -> PUID :: uid-> Body\n * -> cache[abc]. -> cache[abc] .pop()\n * -> create [new Body| clone]\n * -> return p1: { __pid: abc }\n *\n * expire -> cache[abc]= [p0, p1];\n *\n */\nimport Util from '../utils/Util';\nimport PUID from '../utils/PUID';\n\nexport default class Pool {\n\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 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\n for (let id in this.cache)\n count += this.cache[id].length;\n\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) {\n uid = uid || 'default';\n\n if (!this.cache[uid]) this.cache[uid] = [];\n return this.cache[uid];\n }\n}","export default class Stats {\n\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) str += 'initializes:' + emitter.initializes.length + '
';\n if (emitter) str += '' + this.concatArr(emitter.initializes) + '
';\n if (emitter) str += 'behaviours:' + emitter.behaviours.length + '
';\n if (emitter) str += '' + this.concatArr(emitter.behaviours) + '
';\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('click', e => {\n this.type++;\n if (this.type > 4) this.type = 1;\n }, false);\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 * EventDispatcher\n * This code reference since http://createjs.com/.\n *\n **/\n\nexport default class EventDispatcher {\n\n constructor() {\n this._listeners = null;\n }\n\n static bind(TargetClass) {\n TargetClass.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent;\n TargetClass.prototype.hasEventListener = EventDispatcher.prototype.hasEventListener;\n TargetClass.prototype.addEventListener = EventDispatcher.prototype.addEventListener;\n TargetClass.prototype.removeEventListener = EventDispatcher.prototype.removeEventListener;\n TargetClass.prototype.removeAllEventListeners = 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)\n this._listeners = null;\n else if (this._listeners)\n 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\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\n\tconstructor(type) {\n\t\tthis.type = type;\n\t}\n\n\tcalculate(particles, time, damping) {\n\t\tthis.eulerIntegrate(particles, time, damping);\n\t}\n\n\t// Euler Integrate\n\teulerIntegrate(particle, time, damping) {\n\t\tif (!particle.sleep) {\n\t\t\tparticle.old.p.copy(particle.p);\n\t\t\tparticle.old.v.copy(particle.v);\n\n\t\t\tparticle.a.multiplyScalar(1 / particle.mass);\n\t\t\tparticle.v.add(particle.a.multiplyScalar(time));\n\t\t\tparticle.p.add(particle.old.v.multiplyScalar(time));\n\n\t\t\tif (damping) particle.v.multiplyScalar(damping);\n\n\t\t\tparticle.a.clear();\n\t\t}\n\t}\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\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\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 /**\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() {\n Util.destroy(this.renderers, this.getAllParticles());\n Util.destroy(this.emitters);\n\n this.time = 0;\n this.oldTime = 0;\n\n this.pool.destroy();\n }\n}\n\nEventDispatcher.bind(Proton);","import MathUtils from './MathUtils';\n\nexport default {\n\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)\n 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)\n 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)\n 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 * (MathUtils.PI_2)) + 1;\n },\n\n easeOutSine(value) {\n return Math.sin(value * (MathUtils.PI_2));\n },\n\n easeInOutSine(value) {\n return (-0.5 * (Math.cos(MathUtils.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)\n return 0;\n\n if (value === 1)\n return 1;\n\n if ((value /= 0.5) < 1)\n 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)\n 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')\n return ease;\n else\n return this[ease] || this.easeLinear;\n }\n};","import MathUtils from '../math/MathUtils';\n\nexport default class Vector2D {\n\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)\n return Math.atan2(this.y, this.x);\n else if (this.y > 0)\n return MathUtils.PI_2;\n else if (this.y < 0)\n return -MathUtils.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}","import Util from '../utils/Util';\nimport ease from '../math/ease';\nimport Vector2D from '../math/Vector2D';\nimport MathUtils from '../math/MathUtils';\n\nexport default class Particle {\n\n static ID = 0;\n\n /**\n * the Particle class\n *\n * @class Proton.Particle\n * @constructor\n * @param {Object} pObj the parameters object;\n * for example {life:3,dead:false}\n */\n constructor(pOBJ) {\n /**\n * The particle's id;\n * @property id\n * @type {string}\n */\n this.id = `particle_${Particle.ID++}`;\n this.reset('init');\n\n pOBJ && Util.setPrototypeByObject(this, pOBJ);\n }\n\n getDirection() {\n return Math.atan2(this.v.x, -this.v.y) * MathUtils.N180_PI;\n }\n\n reset(init) {\n this.life = Infinity;\n this.age = 0;\n\n // Energy loss\n this.energy = 1;\n this.dead = false;\n this.sleep = false;\n this.body = null;\n this.sprite = null;\n this.parent = null;\n\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.easing = ease.easeLinear;\n\n if (init === 'init') {\n this.transform = {};\n this.p = new Vector2D();\n this.v = new Vector2D();\n this.a = new Vector2D();\n\n this.old = {\n p: new Vector2D(),\n v: new Vector2D(),\n a: new Vector2D()\n };\n\n this.behaviours = [];\n } else {\n Util.destroyObject(this.transform, 'rgb');\n\n this.p.set(0, 0);\n this.v.set(0, 0);\n this.a.set(0, 0);\n\n this.old.p.set(0, 0);\n this.old.v.set(0, 0);\n this.old.a.set(0, 0);\n\n this.removeAllBehaviours();\n }\n\n if (!this.transform.rgb) {\n this.transform.rgb = { r: 255, g: 255, b: 255 };\n } else {\n this.transform.rgb.r = 255;\n this.transform.rgb.g = 255;\n this.transform.rgb.b = 255;\n }\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] && 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.destroyArray(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 /**\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.transform.rgb.r) * 65536 + Number(p.transform.rgb.g) * 256 + Number(p.transform.rgb.b);\n }\n}","import Vector2D from './Vector2D';\n\nexport default class Polar2D {\n\n\tconstructor(r, tha) {\n\t\tthis.r = Math.abs(r) || 0;\n\t\tthis.tha = tha || 0;\n\t}\n\n\tset(r, tha) {\n\t\tthis.r = r;\n\t\tthis.tha = tha;\n\t\treturn this;\n\t}\n\n\tsetR(r) {\n\t\tthis.r = r;\n\t\treturn this;\n\t}\n\n\tsetTha(tha) {\n\t\tthis.tha = tha;\n\t\treturn this;\n\t}\n\n\tcopy(p) {\n\t\tthis.r = p.r;\n\t\tthis.tha = p.tha;\n\t\treturn this;\n\t}\n\n\ttoVector() {\n\t\treturn new Vector2D(this.getX(), this.getY());\n\t}\n\n\tgetX() {\n\t\treturn this.r * Math.sin(this.tha);\n\t}\n\n\tgetY() {\n\t\treturn -this.r * Math.cos(this.tha);\n\t}\n\n\tnormalize() {\n\t\tthis.r = 1;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn ((v.r === this.r) && (v.tha === this.tha));\n\t}\n\n\tclear() {\n\t\tthis.r = 0.0;\n\t\tthis.tha = 0.0;\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new Polar2D(this.r, this.tha);\n\t}\n}","export default {\n\tcreate(mat3) {\n\t\tconst mat = new Float32Array(9);\n\t\tif (mat3) this.set(mat3, mat);\n\n\t\treturn mat;\n\t},\n\n\tset(mat1, mat2) {\n\t\tfor (let i = 0; i < 9; i++)\n\t\t\tmat2[i] = mat1[i];\n\n\t\treturn mat2;\n\t},\n\n\tmultiply(mat, mat2, mat3) {\n\t\tlet a00 = mat[0], a01 = mat[1], a02 = mat[2], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b00 = mat2[0], b01 = mat2[1], b02 = mat2[2], b10 = mat2[3], b11 = mat2[4], b20 = mat2[6], b21 = mat2[7];\n\n\t\tmat3[0] = b00 * a00 + b01 * a10;\n\t\tmat3[1] = b00 * a01 + b01 * a11;\n\t\tmat3[2] = a02 * b02;\n\t\tmat3[3] = b10 * a00 + b11 * a10;\n\t\tmat3[4] = b10 * a01 + b11 * a11;\n\t\tmat3[6] = b20 * a00 + b21 * a10 + a20;\n\t\tmat3[7] = b20 * a01 + b21 * a11 + a21;\n\n\t\treturn mat3;\n\t},\n\n\tinverse(mat, mat3) {\n\t\tlet a00 = mat[0], a01 = mat[1], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b01 = a11, b11 = -a10, b21 = a21 * a10 - a11 * a20, d = a00 * b01 + a01 * b11, id;\n\n\t\tid = 1 / d;\n\t\tmat3[0] = b01 * id;\n\t\tmat3[1] = (-a01) * id;\n\t\tmat3[3] = b11 * id;\n\t\tmat3[4] = a00 * id;\n\t\tmat3[6] = b21 * id;\n\t\tmat3[7] = (-a21 * a00 + a01 * a20) * id;\n\n\t\treturn mat3;\n\t},\n\n\tmultiplyVec2(m, vec, mat3) {\n\t\tlet x = vec[0], y = vec[1];\n\n\t\tmat3[0] = x * m[0] + y * m[3] + m[6];\n\t\tmat3[1] = x * m[1] + y * m[4] + m[7];\n\n\t\treturn mat3;\n\t}\n}","import Span from './Span';\nimport Util from '../utils/Util';\nimport MathUtils from './MathUtils';\n\nexport default class ArraySpan extends Span {\n\n constructor(color) {\n super();\n this._arr = Util.isArray(color) ? color : [color];\n }\n\n getValue() {\n const color = this._arr[Math.floor(this._arr.length * Math.random())];\n return color === 'random' || color === 'Random' ? MathUtils.randomColor() : color;\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)\n return arr;\n else\n return new ArraySpan(arr);\n }\n\n}","export default class Rectangle {\n\n\tconstructor(x, y, w, h) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\tthis.width = w;\n\t\tthis.height = h;\n\n\t\tthis.bottom = this.y + this.height;\n\t\tthis.right = this.x + this.width;\n\t}\n\n\tcontains(x, y) {\n\t\tif (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n}\n","import Util from '../utils/Util';\n\nexport default class Rate {\n\n\t/**\n\t * The number of particles per second emission (a [particle]/b [s]);\n\t * @namespace\n\t * @memberof! Proton#\n\t * @constructor\n\t * @alias Rate\n\t *\n\t * @param {Array | Number | Span} numpan the number of each emission;\n\t * @param {Array | Number | Span} timepan the time of each emission;\n\t * for example: new Rate(new Span(10, 20), new Span(.1, .25));\n\t */\n\tconstructor(numpan, timepan) {\n\t\tthis.numPan = Util.setSpanValue(Util.initValue(numpan, 1));\n\t\tthis.timePan = Util.setSpanValue(Util.initValue(timepan, 1));\n\n\t\tthis.startTime = 0;\n\t\tthis.nextTime = 0;\n\t\tthis.init();\n\t}\n\n\tinit() {\n\t\tthis.startTime = 0;\n\t\tthis.nextTime = this.timePan.getValue();\n\t}\n\n\tgetValue(time) {\n\t\tthis.startTime += time;\n\n\t\tif (this.startTime >= this.nextTime) {\n\t\t\tthis.startTime = 0;\n\t\t\tthis.nextTime = this.timePan.getValue();\n\n\t\t\tif (this.numPan.b === 1) {\n\t\t\t\tif (this.numPan.getValue(false) > 0.5)\n\t\t\t\t\treturn 1;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn this.numPan.getValue(true);\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n}","export default class Initialize {\n\n\treset() {\n\t}\n\n\tinit(emitter, particle) {\n\t\tif (particle) {\n\t\t\tthis.initialize(particle);\n\t\t} else {\n\t\t\tthis.initialize(emitter);\n\t\t}\n\t};\n\n\t// sub class init\n\tinitialize(target) {\n\t};\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Life extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\n\t\tthis.lifePan = Util.setSpanValue(a, b, c);\n\t\tthis.name = 'Life';\n\t}\n\n\tinitialize(target) {\n\t\tif (this.lifePan.a === Infinity)\n\t\t\ttarget.life = Infinity;\n\t\telse\n\t\t\ttarget.life = this.lifePan.getValue();\n\t}\n}\n","import Vector2D from '../math/Vector2D';\n\nexport default class Zone {\n\n\tconstructor() {\n\t\tthis.vector = new Vector2D(0, 0);\n\t\tthis.random = 0;\n\t\tthis.crossType = 'dead';\n\t\tthis.alert = true;\n\t}\n\n\tgetPosition() {\n\t}\n\n\tcrossing(particle) {\n\t}\n}\n","import Zone from './Zone';\n\nexport default class PointZone extends Zone {\n\n\tconstructor(x, y) {\n\t\tsuper();\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tgetPosition() {\n\t\tthis.vector.x = this.x;\n\t\tthis.vector.y = this.y;\n\t\treturn this.vector;\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.alert) {\n\t\t\talert('Sorry PointZone does not support crossing method');\n\t\t\tthis.alert = false;\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport PointZone from '../zone/PointZone';\nimport Initialize from './Initialize';\n\nexport default class Position extends Initialize {\n\n\tconstructor(zone) {\n\t\tsuper();\n\t\tthis.zone = Util.initValue(zone, new PointZone());\n\n\t\tthis.name = 'Position';\n\t}\n\n\treset(zone) {\n\t\tthis.zone = Util.initValue(zone, new PointZone());\n\t}\n\n\tinitialize(target) {\n\t\tthis.zone.getPosition();\n\n\t\ttarget.p.x = this.zone.vector.x;\n\t\ttarget.p.y = this.zone.vector.y;\n\t};\n\n}\n","import Proton from '../core/Proton';\nimport Util from '../utils/Util';\nimport Polar2D from '../math/Polar2D';\nimport MathUtils from '../math/MathUtils';\nimport Initialize from './Initialize';\n\nexport default class Velocity extends Initialize {\n\n constructor(rpan, thapan, type) {\n super();\n\n this.rPan = Util.setSpanValue(rpan);\n this.thaPan = Util.setSpanValue(thapan);\n this.type = Util.initValue(type, 'vector');\n\n this.name = 'Velocity';\n }\n\n reset(rpan, thapan, type) {\n this.rPan = Util.setSpanValue(rpan);\n this.thaPan = Util.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(this.normalizeVelocity(this.rPan.getValue()), this.thaPan.getValue() * MathUtils.PI_180);\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}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Mass extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\t\tthis.massPan = Util.setSpanValue(a, b, c);\n\t\tthis.name = 'Mass';\n\t}\n\n\tinitialize(target) {\n\t\ttarget.mass = this.massPan.getValue();\n\t}\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Radius extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\t\tthis.radius = Util.setSpanValue(a, b, c);\n\n\t\tthis.name = 'Radius';\n\t}\n\n\treset(a, b, c) {\n\t\tthis.radius = Util.setSpanValue(a, b, c);\n\t};\n\n\tinitialize(particle) {\n\t\tparticle.radius = this.radius.getValue();\n\t\tparticle.transform.oldRadius = particle.radius;\n\t};\n}","import Util from '../utils/Util';\nimport ArraySpan from '../math/ArraySpan';\nimport Initialize from './Initialize';\n\nexport default class Body extends Initialize {\n\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 = { width: this.w, height: this.h, src: imagetarget, isInner: true, inner: true };\n } else {\n particle.body = imagetarget;\n }\n };\n\n setSpanValue(color) {\n return color instanceof ArraySpan ? color : new ArraySpan(color);\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}","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 MathUtils from '../math/MathUtils';\nimport Behaviour from './Behaviour';\n\nexport default class RandomDrift extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Behaviour\n\t * @constructor\n\t * @alias RandomDrift\n\t *\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Number} time The time of the drift\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(driftX, driftY, delay, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(driftX, driftY, delay);\n\t\tthis.time = 0;\n\t\tthis.name = 'RandomDrift';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#RandomDrift\n\t * @instance\n\t *\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\n\t */\n\treset(driftX, driftY, delay, life, easing) {\n\t\tthis.panFoce = new Vector2D(driftX, driftY);\n\t\tthis.panFoce = this.normalizeForce(this.panFoce);\n\t\tthis.delay = delay;\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#RandomDrift\n\t * @instance\n\t *\n\t * @param {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\tthis.time += time;\n\n\t\tif (this.time >= this.delay) {\n\t\t\tparticle.a.addXY(MathUtils.randomAToB(-this.panFoce.x, this.panFoce.x), MathUtils.randomAToB(-this.panFoce.y, this.panFoce.y));\n\t\t\tthis.time = 0;\n\t\t};\n\t}\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 Behaviour from './Behaviour';\n\nexport default class Alpha extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Alpha\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 = 'Alpha';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Alpha\n\t * @instance\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\treset(a, b, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Util.setSpanValue(b);\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Sets the new alpha value of the particle\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Alpha\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle A single Proton generated particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.transform.alphaA = this.a.getValue();\n\n\t\tif (this.same)\n\t\t\tparticle.transform.alphaB = particle.transform.alphaA;\n\t\telse\n\t\t\tparticle.transform.alphaB = this.b.getValue();\n\t}\n\n\t/**\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Alpha\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.alpha = particle.transform.alphaB + (particle.transform.alphaA - particle.transform.alphaB) * this.energy;\n\t\tif (particle.alpha < 0.001) particle.alpha = 0;\n\t}\n}\n","import 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 = Util.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Util.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.transform.scaleA = this.a.getValue();\n\t\tparticle.transform.oldRadius = particle.radius;\n\t\tparticle.transform.scaleB = this.same ? particle.transform.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.transform.scaleB + (particle.transform.scaleA - particle.transform.scaleB) * this.energy;\n\n\t\tif (particle.scale < 0.0001) particle.scale = 0;\n\t\tparticle.radius = particle.transform.oldRadius * particle.scale;\n\t}\n}","import 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 = Util.setSpanValue(Util.initValue(a, 'Velocity'));\n\t\tthis.b = Util.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.transform.rotationA = this.a.getValue();\n\n\t\tif (!this.same) particle.transform.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.transform.rotationB + (particle.transform.rotationA - particle.transform.rotationB) * this.energy\n\t\t\t} else {\n\t\t\t\tparticle.rotation += particle.transform.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 /**\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\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.transform.colorA = ColorUtil.hexToRGB(particle.color);\n\n if (this.b)\n particle.transform.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.transform.rgb.r = particle.transform.colorB.r + (particle.transform.colorA.r - particle.transform.colorB.r) * this.energy;\n particle.transform.rgb.g = particle.transform.colorB.g + (particle.transform.colorA.g - particle.transform.colorB.g) * this.energy;\n particle.transform.rgb.b = particle.transform.colorB.b + (particle.transform.colorA.b - particle.transform.colorB.b) * this.energy;\n\n particle.transform.rgb.r = Math.floor(particle.transform.rgb.r);\n particle.transform.rgb.g = Math.floor(particle.transform.rgb.g);\n particle.transform.rgb.b = Math.floor(particle.transform.rgb.b);\n\n } else {\n particle.transform.rgb.r = particle.transform.colorA.r;\n particle.transform.rgb.g = particle.transform.colorA.g;\n particle.transform.rgb.b = particle.transform.colorA.b;\n }\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 MathUtils from '../math/MathUtils';\n\nexport default {\n\n\tinitialize(emitter, particle, initializes) {\n\t\tconst length = initializes.length;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tif (initializes[i] instanceof Initialize)\n\t\t\t\tinitializes[i].init(emitter, particle);\n\t\t\telse\n\t\t\t\tthis.init(emitter, particle, initializes[i]);\n\t\t}\n\n\t\tthis.bindEmitter(emitter, particle);\n\t},\n\n\t// init\n\tinit(emitter, particle, initialize) {\n\t\tUtil.setPrototypeByObject(particle, initialize);\n\t\tUtil.setVector2DByObject(particle, initialize);\n\t},\n\n\tbindEmitter(emitter, particle) {\n\t\tif (emitter.bindEmitter) {\n\t\t\tparticle.p.add(emitter.p);\n\t\t\tparticle.v.add(emitter.v);\n\t\t\tparticle.a.add(emitter.a);\n\n\t\t\tparticle.v.rotate(MathUtils.degreeTransform(emitter.rotation));\n\t\t}\n\t}\n}\n","import Util from '../utils/Util';\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\tstatic ID = 0;\n\n\t/**\n\t * You can use this emit particles.\n\t *\n\t * It will dispatch follow events:\n\t * PARTICLE_CREATED\n\t * PARTICLE_UPDATA\n\t * PARTICLE_DEAD\n\t *\n\t * @class Emitter\n\t * @constructor\n\t * @param {Object} pObj the parameters object;\n\t * for example {damping:0.01,bindEmitter:false}\n\t */\n\tconstructor(pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.initializes = [];\n\t\tthis.particles = [];\n\t\tthis.behaviours = [];\n\n\t\tthis.emitSpeed = 0;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = -1;\n\n\t\t/**\n\t\t * The friction coefficient for all particle emit by This;\n\t\t * @property damping\n\t\t * @type {Number}\n\t\t * @default 0.006\n\t\t */\n\t\tthis.damping = .006;\n\n\t\t/**\n\t\t * If bindEmitter the particles can bind this emitter's property;\n\t\t * @property bindEmitter\n\t\t * @type {Boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.bindEmitter = true;\n\n\t\t/**\n\t\t * The number of particles per second emit (a [particle]/b [s]);\n\t\t * @property rate\n\t\t * @type {Rate}\n\t\t * @default Rate(1, .1)\n\t\t */\n\t\tthis.rate = new Rate(1, .1);\n\n\t\tthis.id = `emitter_${Emitter.ID++}`;\n\t\tthis.name = 'Emitter';\n\t}\n\n\t/**\n\t * start emit particle\n\t * @method emit\n\t * @param {Number} emitTime begin emit time;\n\t * @param {String} life the life of this emitter\n\t */\n\temit(totalTime, life) {\n\t\tthis.stoped = false;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = Util.initValue(totalTime, Infinity);\n\n\t\tif (life === true || life === 'life' || life === 'destroy') {\n\t\t\tthis.life = totalTime === 'once' ? 1 : this.totalTime;\n\t\t} else if (!isNaN(life)) {\n\t\t\tthis.life = life;\n\t\t}\n\n\t\tthis.rate.init();\n\t}\n\n\t/**\n\t * stop emiting\n\t * @method stop\n\t */\n\tstop() {\n\t\tthis.totalTime = -1;\n\t\tthis.emitTime = 0;\n\t\tthis.stoped = true;\n\t}\n\n\tpreEmit(time) {\n\t\tlet oldStoped = this.stoped;\n\t\tlet oldEmitTime = this.emitTime;\n\t\tlet oldTotalTime = this.totalTime;\n\n\t\tthis.stoped = false;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = time;\n\t\tthis.rate.init();\n\n\t\tconst step = 0.0167;\n\t\twhile (time > step) {\n\t\t\ttime -= step;\n\t\t\tthis.update(step);\n\t\t}\n\n\t\tthis.stoped = oldStoped;\n\t\tthis.emitTime = oldEmitTime + Math.max(time, 0);\n\t\tthis.totalTime = oldTotalTime;\n\t}\n\n\t/**\n\t * remove current all particles\n\t * @method removeAllParticles\n\t */\n\tremoveAllParticles() {\n\t\tlet i = this.particles.length;\n\t\twhile (i--) this.particles[i].dead = true;\n\t}\n\n\t/**\n\t * add initialize to this emitter\n\t * @method addSelfInitialize\n\t */\n\taddSelfInitialize(pObj) {\n\t\tif (pObj['init']) {\n\t\t\tpObj.init(this);\n\t\t} else {\n\t\t\tthis.initAll();\n\t\t}\n\t}\n\n\t/**\n\t * add the Initialize to particles;\n\t *\n\t * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);\n\t * @method addInitialize\n\t * @param {Initialize} initialize like this new Radius(1, 12)\n\t */\n\taddInitialize(...rest) {\n\t\tlet i = rest.length;\n\t\twhile (i--)\n\t\t\tthis.initializes.push(rest[i]);\n\t}\n\n\t/**\n\t * remove the Initialize\n\t * @method removeInitialize\n\t * @param {Initialize} initialize a initialize\n\t */\n\tremoveInitialize(initializer) {\n\t\tconst index = this.initializes.indexOf(initializer);\n\t\tif (index > -1) this.initializes.splice(index, 1);\n\t}\n\n\t/**\n\t * remove all Initializes\n\t * @method removeInitializers\n\t */\n\tremoveAllInitializers() {\n\t\tUtil.destroyArray(this.initializes);\n\t}\n\n\t/**\n\t * add the Behaviour to particles;\n\t *\n\t * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);\n\t * @method addBehaviour\n\t * @param {Behaviour} behaviour like this new Color('random')\n\t */\n\taddBehaviour(...rest) {\n\t\tlet i = arguments.length;\n\t\twhile (i--) {\n\t\t\tlet behaviour = rest[i];\n\t\t\tthis.behaviours.push(behaviour);\n\t\t\tif (behaviour.parents) behaviour.parents.push(this);\n\t\t}\n\t}\n\n\t/**\n\t * remove the Behaviour\n\t * @method removeBehaviour\n\t * @param {Behaviour} behaviour a behaviour\n\t */\n\tremoveBehaviour(behaviour) {\n\t\tlet index = this.behaviours.indexOf(behaviour);\n\t\tthis.behaviours.splice(index, 1);\n\n\t\tif (behaviour.parents) {\n\t\t\tindex = behaviour.parents.indexOf(behaviour);\n\t\t\tbehaviour.parents.splice(index, 1);\n\t\t}\n\n\t\treturn index;\n\t}\n\n\t/**\n\t * remove all behaviours\n\t * @method removeAllBehaviours\n\t */\n\tremoveAllBehaviours() {\n\t\tUtil.destroyArray(this.behaviours);\n\t}\n\n\t// emitter update\n\tupdate(time) {\n\t\tthis.age += time;\n\t\tif (this.age >= this.life || this.dead) this.destroy();\n\n\t\tthis.emitting(time);\n\t\tthis.integrate(time);\n\t}\n\n\tintegrate(time) {\n\t\tif (!this.parent) return;\n\n\t\tconst damping = 1 - this.damping;\n\t\tthis.parent.integrator.calculate(this, time, damping);\n\n\t\tconst length = this.particles.length;\n\t\tlet i, particle;\n\n\t\tfor (i = length - 1; i >= 0; i--) {\n\t\t\tparticle = this.particles[i];\n\n\t\t\t// particle update\n\t\t\tparticle.update(time, i);\n\t\t\tthis.parent.integrator.calculate(particle, time, damping);\n\t\t\tthis.dispatch('PARTICLE_UPDATE', particle);\n\n\t\t\t// check dead\n\t\t\tif (particle.dead) {\n\t\t\t\tthis.dispatch('PARTICLE_DEAD', particle);\n\n\t\t\t\tthis.parent.pool.expire(particle);\n\t\t\t\tthis.particles.splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tdispatch(event, target) {\n\t\tthis.parent && this.parent.dispatchEvent(event, target);\n\t\tthis.bindEvent && this.dispatchEvent(event, target);\n\t}\n\n\temitting(time) {\n\t\tif (this.totalTime === 'once') {\n\t\t\tlet i;\n\t\t\tconst length = this.rate.getValue(99999);\n\n\t\t\tif (length > 0) this.emitSpeed = length;\n\t\t\tfor (i = 0; i < length; i++) this.createParticle();\n\t\t\tthis.totalTime = 'none';\n\t\t}\n\n\t\telse {\n\t\t\tthis.emitTime += time;\n\n\t\t\tif (this.emitTime < this.totalTime) {\n\t\t\t\tconst length = this.rate.getValue(time)\n\t\t\t\tlet i;\n\n\t\t\t\tif (length > 0) this.emitSpeed = length;\n\t\t\t\tfor (i = 0; i < length; i++) this.createParticle();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * create single particle;\n\t *\n\t * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})\n\t * @method removeAllParticles\n\t */\n\tcreateParticle(initialize, behaviour) {\n\t\tconst particle = this.parent.pool.get(Particle);\n\t\tthis.setupParticle(particle, initialize, behaviour);\n\t\tthis.dispatch('PARTICLE_CREATED', particle);\n\n\t\treturn particle;\n\t}\n\n\tsetupParticle(particle, initialize, behaviour) {\n\t\tlet initializes = this.initializes;\n\t\tlet behaviours = this.behaviours;\n\n\t\tif (initialize) {\n\t\t\tinitializes = Util.isArray(initialize) ? initialize : [initialize];\n\t\t}\n\n\t\tif (behaviour) {\n\t\t\tbehaviour = Util.isArray(behaviour) ? behaviour : [behaviour];\n\t\t}\n\n\t\tparticle.reset();\n\t\tInitializeUtil.initialize(this, particle, initializes);\n\t\tparticle.addBehaviours(behaviours);\n\t\tparticle.parent = this;\n\n\t\tthis.particles.push(particle);\n\t}\n\n\tremove() {\n\t\tthis.stop();\n\t\tUtil.destroy(this.particles);\n\t}\n\n\t/**\n\t * Destory this Emitter\n\t * @method destroy\n\t */\n\tdestroy(slow) {\n\t\tthis.dead = true;\n\t\tthis.remove();\n\t\tthis.removeAllInitializers();\n\t\tthis.removeAllBehaviours();\n\t\tthis.parent && this.parent.removeEmitter(this);\n\t}\n\n}\n\nEventDispatcher.bind(Emitter);","import Emitter from './Emitter';\n\nexport default class BehaviourEmitter extends Emitter {\n\n\t/**\n\t * The BehaviourEmitter class inherits from Proton.Emitter\n\t *\n\t * use the BehaviourEmitter you can add behaviours to self;\n\t * @class Proton.BehaviourEmitter\n\t * @constructor\n\t * @param {Object} pObj the parameters object;\n\t */\n\tconstructor(pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.selfBehaviours = [];\n\t};\n\n\t/**\n\t * add the Behaviour to emitter;\n\t *\n\t * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);\n\t * @method addSelfBehaviour\n\t * @param {Proton.Behaviour} behaviour like this new Proton.Color('random')\n\t */\n\taddSelfBehaviour(...rest) {\n\t\tconst length = rest.length;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tthis.selfBehaviours.push(rest[i]);\n\t\t}\n\t};\n\n\t/**\n\t * remove the Behaviour for self\n\t * @method removeSelfBehaviour\n\t * @param {Proton.Behaviour} behaviour a behaviour\n\t */\n\tremoveSelfBehaviour(behaviour) {\n\t\tconst index = this.selfBehaviours.indexOf(behaviour);\n\t\tif (index > -1) this.selfBehaviours.splice(index, 1);\n\t};\n\n\tupdate(time) {\n\t\tsuper.update(time);\n\n\t\tif (!this.sleep) {\n\t\t\tconst length = this.selfBehaviours.length;\n\t\t\tlet i;\n\n\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\tthis.selfBehaviours[i].applyBehaviour(this, time, i);\n\t\t\t}\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Emitter from './Emitter';\n\nexport default class FollowEmitter extends Emitter {\n\n\t/**\n\t * The FollowEmitter class inherits from Proton.Emitter\n\t *\n\t * use the FollowEmitter will emit particle when mousemoving\n\t *\n\t * @class Proton.FollowEmitter\n\t * @constructor\n\t * @param {Element} mouseTarget mouseevent's target;\n\t * @param {Number} ease the easing of following speed;\n\t * @default 0.7\n\t * @param {Object} pObj the parameters object;\n\t */\n\tconstructor(mouseTarget, ease, pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.mouseTarget = Util.initValue(mouseTarget, window);\n\t\tthis.ease = Util.initValue(ease, 0.7);\n\n\t\tthis._allowEmitting = false;\n\t\tthis.initEventHandler();\n\t};\n\n\tinitEventHandler() {\n\t\tthis.mousemoveHandler = e => this.mousemove.call(this, e);\n\t\tthis.mousedownHandler = e => this.mousedown.call(this, e);\n\t\tthis.mouseupHandler = e => this.mouseup.call(this, e);\n\n\t\tthis.mouseTarget.addEventListener('mousemove', this.mousemoveHandler, false);\n\t}\n\n\t/**\n\t * start emit particle\n\t * @method emit\n\t */\n\temit() {\n\t\tthis._allowEmitting = true;\n\t}\n\n\t/**\n\t * stop emiting\n\t * @method stop\n\t */\n\tstop() {\n\t\tthis._allowEmitting = false;\n\t}\n\n\tmousemove(e) {\n\t\tif (e.layerX || e.layerX === 0) {\n\t\t\tthis.p.x += (e.layerX - this.p.x) * this.ease;\n\t\t\tthis.p.y += (e.layerY - this.p.y) * this.ease;\n\t\t} else if (e.offsetX || e.offsetX === 0) {\n\t\t\tthis.p.x += (e.offsetX - this.p.x) * this.ease;\n\t\t\tthis.p.y += (e.offsetY - this.p.y) * this.ease;\n\t\t}\n\n\t\tif (this._allowEmitting) super.emit('once');\n\t};\n\n\t/**\n\t * Destory this Emitter\n\t * @method destroy\n\t */\n\tdestroy() {\n\t\tsuper.destroy();\n\t\tthis.mouseTarget.removeEventListener('mousemove', this.mousemoveHandler, false);\n\t}\n\n}\n","import Pool from '../core/Pool';\nimport Util from '../utils/Util';\n\nexport default class BaseRenderer {\n\n constructor(element, stroke) {\n this.element = element;\n this.stroke = stroke;\n\n this.initHandler();\n\n this.circleConf = { isCircle: true };\n this.pool = new Pool();\n this.name = 'BaseRenderer';\n }\n\n setStroke(color, thinkness) {\n color = Util.initValue(color, '#000000');\n thinkness = Util.initValue(thinkness, 1);\n\n this.stroke = { color, thinkness };\n }\n\n initHandler() {\n this._protonUpdateHandler = () => { this.onProtonUpdate.call(this) };\n this._protonUpdateAfterHandler = () => { this.onProtonUpdateAfter.call(this) };\n this._emitterAddedHandler = (emitter) => { this.onEmitterAdded.call(this, emitter) };\n this._emitterRemovedHandler = (emitter) => { this.onEmitterRemoved.call(this, emitter) };\n this._particleCreatedHandler = (particle) => { this.onParticleCreated.call(this, particle) };\n this._particleUpdateHandler = (particle) => { this.onParticleUpdate.call(this, particle) };\n this._particleDeadHandler = (particle) => { this.onParticleDead.call(this, particle) };\n }\n\n init(proton) {\n this.parent = proton;\n\n proton.addEventListener('PROTON_UPDATE', this._protonUpdateHandler);\n proton.addEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\n\n proton.addEventListener('EMITTER_ADDED', this._emitterAddedHandler);\n proton.addEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\n\n proton.addEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\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('PROTON_UPDATE', this._protonUpdateHandler);\n this.parent.removeEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\n\n this.parent.removeEventListener('EMITTER_ADDED', this._emitterAddedHandler);\n this.parent.removeEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\n\n this.parent.removeEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\n this.parent.removeEventListener('PARTICLE_UPDATE', this._particleUpdateHandler);\n this.parent.removeEventListener('PARTICLE_DEAD', this._particleDeadHandler);\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}","import ImgUtil from '../utils/ImgUtil';\nimport ColorUtil from '../utils/ColorUtil';\nimport MathUtils from '../math/MathUtils';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class CanvasRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.context = this.element.getContext('2d');\n this.bufferCache = {};\n\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 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.transform['buffer']) particle.transform.buffer = this.createBuffer(particle.body);\n\n const bufferContext = particle.transform.buffer.getContext('2d');\n bufferContext.clearRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\n bufferContext.globalAlpha = particle.alpha;\n bufferContext.drawImage(particle.body, 0, 0);\n\n bufferContext.globalCompositeOperation = 'source-atop';\n bufferContext.fillStyle = ColorUtil.rgbToHex(particle.transform.rgb);\n bufferContext.fillRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\n bufferContext.globalCompositeOperation = 'source-over';\n bufferContext.globalAlpha = 1;\n\n this.context.drawImage(particle.transform.buffer, 0, 0, particle.transform.buffer.width, particle.transform.buffer.height, x, y, w, h);\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(MathUtils.degreeTransform(particle.rotation));\n this.context.translate(-particle.p.x, -particle.p.y);\n this.context.drawImage(particle.body, 0, 0, particle.body.width, particle.body.height, x, y, w, h);\n\n this.context.globalAlpha = 1;\n this.context.restore();\n }\n }\n\n // private drawCircle --\n drawCircle(particle) {\n if (particle.transform['rgb'])\n this.context.fillStyle = 'rgba(' + particle.transform.rgb.r + ',' + particle.transform.rgb.g + ',' + particle.transform.rgb.b + ',' + particle.alpha + ')';\n else\n this.context.fillStyle = particle.color;\n\n // draw circle\n this.context.beginPath();\n this.context.arc(particle.p.x, particle.p.y, particle.radius, 0, Math.PI * 2, true);\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}","import DomUtil from '../utils/DomUtil';\nimport ImgUtil from '../utils/ImgUtil';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class DomRenderer extends BaseRenderer {\n\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\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(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\n else\n DomUtil.transform(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\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 typeof particle.body === 'object' && particle.body && !particle.body.isInner;\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)\n return this.createCircle(particle);\n else\n return this.createSprite(body, particle);\n }\n\n // private --\n createCircle(particle) {\n const dom = DomUtil.createDiv(`${particle.id}_dom`, 2 * particle.radius, 2 * particle.radius);\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(`${particle.id}_dom`, body.width, body.height);\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\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)\n graphics.beginStroke(this.stroke);\n else\n graphics.beginStroke('#000000');\n }\n graphics.beginFill(particle.color || '#ff0000').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\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 ? rectangle : new Rectangle(0, 0, this.element.width, this.element.height);\n this.imageData = this.context.createImageData(this.rectangle.width, this.rectangle.height);\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\n }\n\n onProtonUpdate() {\n this.context.clearRect(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\n this.imageData = this.context.getImageData(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\n }\n\n onProtonUpdateAfter() {\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\n }\n\n onParticleCreated(particle) {}\n\n onParticleUpdate(particle) {\n if (this.imageData) {\n this.setPixel(this.imageData, Math.floor(particle.p.x - this.rectangle.x), Math.floor(particle.p.y - this.rectangle.y), particle);\n }\n }\n\n setPixel(imagedata, x, y, particle) {\n const rgb = particle.transform.rgb;\n\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 }\n\n}","import ColorUtil from '../utils/ColorUtil';\nimport MathUtils from '../math/MathUtils';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class PixiRenderer extends BaseRenderer {\n\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.setColor = false;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.name = 'PixiRenderer';\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 this.element.addChild(particle.body);\n }\n\n /**\n * @param particle\n */\n onParticleUpdate(particle) {\n this.transform(particle, particle.body);\n if (this.setColor) particle.body.tint = ColorUtil.getHex16FromParticle(particle);\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 MathUtils.PI_180 for slight performance increase.\n target.rotation = particle.rotation * MathUtils.PI_180; // MathUtils.PI_180;\n }\n\n createBody(body, particle) {\n if (body.isCircle)\n return this.createCircle(particle);\n else\n return this.createSprite(body);\n }\n\n createSprite(body) {\n const sprite = body.isInner ? PIXI.Sprite.fromImage(body.src) : new PIXI.Sprite(body);\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 PIXI.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}","import Mat3 from '../math/Mat3';\n\nexport default class MStack {\n\n\tconstructor() {\n\t\tthis.mats = [];\n\t\tthis.size = 0;\n\n\t\tfor (let i = 0; i < 20; i++) this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0]));\n\t}\n\n\tset(m, i) {\n\t\tif (i === 0)\n\t\t\tMat3.set(m, this.mats[0]);\n\t\telse\n\t\t\tMat3.multiply(this.mats[i - 1], m, this.mats[i]);\n\n\t\tthis.size = Math.max(this.size, i + 1);\n\t}\n\n\tpush(m) {\n\t\tif (this.size === 0)\n\t\t\tMat3.set(m, this.mats[0]);\n\t\telse\n\t\t\tMat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]);\n\n\t\tthis.size++;\n\t}\n\n\tpop() {\n\t\tif (this.size > 0)\n\t\t\tthis.size--;\n\t}\n\n\ttop() {\n\t\treturn (this.mats[this.size - 1]);\n\t}\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 MathUtils from '../math/MathUtils';\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.transform.src])\n this.texturebuffers[particle.transform.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()];\n\n particle.transform.texture = this.texturebuffers[particle.transform.src][0];\n particle.transform.vcBuffer = this.texturebuffers[particle.transform.src][1];\n particle.transform.tcBuffer = this.texturebuffers[particle.transform.src][2];\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.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.transform.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.transform.canvas.getContext('2d');\n const data = context.getImageData(0, 0, _width, _height);\n\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.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.transform.textureLoaded = true;\n particle.transform.textureWidth = _w;\n particle.transform.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.transform.textureLoaded = false;\n particle.transform.tmat = Mat3.create();\n particle.transform.tmat[8] = 1;\n particle.transform.imat = Mat3.create();\n particle.transform.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.transform.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.transform.src = img.src;\n particle.transform.canvas = ImgUtil.getCanvasFromCache(img);\n particle.transform.oldScale = 1;\n\n this.drawImg2Canvas(particle);\n }\n\n onParticleUpdate(particle) {\n if (particle.transform.textureLoaded) {\n this.updateMatrix(particle);\n\n this.gl.uniform3f(this.sprogram.color, particle.transform.rgb.r / 255, particle.transform.rgb.g / 255, particle.transform.rgb.b / 255);\n this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top());\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.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.transform.textureWidth / 2, -particle.transform.textureHeight / 2);\n const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y);\n\n const angel = particle.rotation * (MathUtils.PI_180);\n const rotationMatrix = WebGLUtil.makeRotation(angel);\n\n const scale = particle.scale * particle.transform.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.transform.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\n constructor(element) {\n super(element);\n\n this.name = 'CustomRenderer';\n }\n\n}","import Zone from './Zone';\nimport Util from '../utils/Util';\nimport MathUtils from '../math/MathUtils';\n\nexport default class LineZone extends Zone {\n\n\tconstructor(x1, y1, x2, y2, direction) {\n\t\tsuper();\n\n\t\tif (x2 - x1 >= 0) {\n\t\t\tthis.x1 = x1;\n\t\t\tthis.y1 = y1;\n\t\t\tthis.x2 = x2;\n\t\t\tthis.y2 = y2;\n\t\t} else {\n\t\t\tthis.x1 = x2;\n\t\t\tthis.y1 = y2;\n\t\t\tthis.x2 = x1;\n\t\t\tthis.y2 = y1;\n\t\t}\n\n\t\tthis.dx = this.x2 - this.x1;\n\t\tthis.dy = this.y2 - this.y1;\n\n\t\tthis.minx = Math.min(this.x1, this.x2);\n\t\tthis.miny = Math.min(this.y1, this.y2);\n\t\tthis.maxx = Math.max(this.x1, this.x2);\n\t\tthis.maxy = Math.max(this.y1, this.y2);\n\n\t\tthis.dot = this.x2 * this.y1 - this.x1 * this.y2;\n\t\tthis.xxyy = this.dx * this.dx + this.dy * this.dy;\n\n\t\tthis.gradient = this.getGradient();\n\t\tthis.length = this.getLength();\n\t\tthis.direction = Util.initValue(direction, '>');\n\t}\n\n\tgetPosition() {\n\t\tthis.random = Math.random();\n\t\tthis.vector.x = this.x1 + this.random * this.length * Math.cos(this.gradient);\n\t\tthis.vector.y = this.y1 + this.random * this.length * Math.sin(this.gradient);\n\n\t\treturn this.vector;\n\t}\n\n\tgetDirection(x, y) {\n\t\tconst A = this.dy;\n\t\tconst B = -this.dx;\n\t\tconst C = this.dot;\n\t\tconst D = B === 0 ? 1 : B;\n\n\t\tif ((A * x + B * y + C) * D > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\n\tgetDistance(x, y) {\n\t\tconst A = this.dy;\n\t\tconst B = -this.dx;\n\t\tconst C = this.dot;\n\t\tconst D = (A * x + B * y + C);\n\n\t\treturn D / Math.sqrt(this.xxyy);\n\t}\n\n\tgetSymmetric(v) {\n\t\tconst tha2 = v.getGradient();\n\t\tconst tha1 = this.getGradient();\n\t\tconst tha = 2 * (tha1 - tha2);\n\n\t\tconst oldx = v.x;\n\t\tconst oldy = v.y;\n\n\t\tv.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n\t\tv.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n\n\t\treturn v;\n\t}\n\n\tgetGradient() {\n\t\treturn Math.atan2(this.dy, this.dx);\n\t}\n\n\trangeOut(particle) {\n\t\tconst angle = Math.abs(this.getGradient());\n\n\t\tif (angle <= MathUtils.PI / 4) {\n\t\t\tif (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true;\n\t\t} else {\n\t\t\tif (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetLength() {\n\t\treturn Math.sqrt(this.dx * this.dx + this.dy * this.dy)\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (this.direction === '>' || this.direction === 'R' || this.direction === 'right' || this.direction === 'down') {\n\t\t\t\tif (!this.rangeOut(particle)) return;\n\t\t\t\tif (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n\t\t\t} else {\n\t\t\t\tif (!this.rangeOut(particle)) return;\n\t\t\t\tif (!this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (!this.rangeOut(particle)) return;\n\n\t\t\tif (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) {\n\t\t\t\tif (this.dx === 0) {\n\t\t\t\t\tparticle.v.x *= -1;\n\t\t\t\t} else if (this.dy === 0) {\n\t\t\t\t\tparticle.v.y *= -1;\n\t\t\t\t} else {\n\t\t\t\t\tthis.getSymmetric(particle.v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'cross') {\n\t\t\tif (this.alert) {\n\t\t\t\tconsole.error('Sorry lineZone does not support cross method');\n\t\t\t\tthis.alert = false;\n\t\t\t}\n\t\t}\n\t}\n}","import Zone from './Zone';\nimport MathUtils from '../math/MathUtils';\n\nexport default class CircleZone extends Zone {\n\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.random = Math.random();\n this.angle = MathUtils.PIx2 * Math.random();\n\n this.vector.x = this.x + this.random * this.radius * Math.cos(this.angle);\n this.vector.y = this.y + this.random * this.radius * 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)\n particle.dead = true;\n } else if (this.crossType === 'bound') {\n if (d + particle.radius >= this.radius)\n this.getSymmetric(particle);\n } else if (this.crossType === 'cross') {\n if (this.alert) {\n alert('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 -MathUtils.PI_2 + Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x);\n }\n}","import Zone from './Zone';\n\nexport default class RectZone extends Zone {\n\n\tconstructor(x, y, width, height) {\n\t\tsuper();\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\n\tgetPosition() {\n\t\tthis.vector.x = this.x + Math.random() * this.width;\n\t\tthis.vector.y = this.y + Math.random() * this.height;\n\n\t\treturn this.vector;\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (particle.p.x + particle.radius < this.x)\n\t\t\t\tparticle.dead = true;\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width)\n\t\t\t\tparticle.dead = true;\n\n\t\t\tif (particle.p.y + particle.radius < this.y)\n\t\t\t\tparticle.dead = true;\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height)\n\t\t\t\tparticle.dead = true;\n\t\t}\n\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (particle.p.x - particle.radius < this.x) {\n\t\t\t\tparticle.p.x = this.x + particle.radius;\n\t\t\t\tparticle.v.x *= -1;\n\t\t\t} else if (particle.p.x + particle.radius > this.x + this.width) {\n\t\t\t\tparticle.p.x = this.x + this.width - particle.radius;\n\t\t\t\tparticle.v.x *= -1;\n\t\t\t}\n\n\t\t\tif (particle.p.y - particle.radius < this.y) {\n\t\t\t\tparticle.p.y = this.y + particle.radius;\n\t\t\t\tparticle.v.y *= -1;\n\t\t\t} else if (particle.p.y + particle.radius > this.y + this.height) {\n\t\t\t\tparticle.p.y = this.y + this.height - particle.radius;\n\t\t\t\tparticle.v.y *= -1;\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'cross') {\n\t\t\tif (particle.p.x + particle.radius < this.x && particle.v.x <= 0)\n\t\t\t\tparticle.p.x = this.x + this.width + particle.radius;\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width && particle.v.x >= 0)\n\t\t\t\tparticle.p.x = this.x - particle.radius;\n\n\t\t\tif (particle.p.y + particle.radius < this.y && particle.v.y <= 0)\n\t\t\t\tparticle.p.y = this.y + this.height + particle.radius;\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height && particle.v.y >= 0)\n\t\t\t\tparticle.p.y = this.y - particle.radius;\n\t\t}\n\t}\n}","import Zone from './Zone';\nimport Util from '../utils/Util';\n\nexport default class ImageZone extends Zone {\n\n\tconstructor(imageData, x, y, d) {\n\t\tsuper();\n\n\t\tthis.reset(imageData, x, y, d);\n\t}\n\n\treset(imageData, x, y, d) {\n\t\tthis.imageData = imageData;\n\t\tthis.x = Util.initValue(x, 0);\n\t\tthis.y = Util.initValue(y, 0);\n\t\tthis.d = Util.initValue(d, 2);\n\n\t\tthis.vectors = [];\n\t\tthis.setVectors();\n\t}\n\n\tsetVectors() {\n\t\tlet i, j;\n\t\tconst length1 = this.imageData.width;\n\t\tconst length2 = this.imageData.height;\n\n\t\tfor (i = 0; i < length1; i += this.d) {\n\t\t\tfor (j = 0; j < length2; j += this.d) {\n\t\t\t\tlet index = ((j >> 0) * length1 + (i >> 0)) * 4;\n\n\t\t\t\tif (this.imageData.data[index + 3] > 0) {\n\t\t\t\t\tthis.vectors.push({ x: i + this.x, y: j + this.y });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.vector;\n\t}\n\n\tgetBound(x, y) {\n\t\tvar index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\t\tif (this.imageData.data[index + 3] > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\n\tgetPosition() {\n\t\treturn this.vector.copy(this.vectors[Math.floor(Math.random() * this.vectors.length)]);\n\t}\n\n\tgetColor(x, y) {\n\t\tx -= this.x;\n\t\ty -= this.y;\n\t\tvar i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\n\t\treturn {\n\t\t\tr: this.imageData.data[i],\n\t\t\tg: this.imageData.data[i + 1],\n\t\t\tb: this.imageData.data[i + 2],\n\t\t\ta: this.imageData.data[i + 3]\n\t\t};\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n\t\t\t\tparticle.dead = true;\n\t\t\telse\n\t\t\t\tparticle.dead = false;\n\t\t}\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (!this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n\t\t\t\tparticle.v.negate();\n\t\t}\n\t}\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\taddEventListener(proton, fun) {\n\t\tproton.addEventListener('PROTON_UPDATE_AFTER', () => fun());\n\t},\n\n\tgetStyle(color) {\n\t\tconst rgb = ColorUtil.hexToRGB(color || '#ff0000');\n\t\treturn `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`;\n\t},\n\n\tdrawZone(proton, canvas, zone, clear) {\n\t\tconst context = canvas.getContext('2d');\n\t\tconst style = this.getStyle();\n\n\t\tthis.addEventListener(proton, () => {\n\t\t\tif (clear)\n\t\t\t\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\n\t\t\tif (zone instanceof PointZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.fillStyle = style;\n\t\t\t\tcontext.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true);\n\t\t\t\tcontext.fill();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof LineZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.moveTo(zone.x1, zone.y1);\n\t\t\t\tcontext.lineTo(zone.x2, zone.y2);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof RectZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.drawRect(zone.x, zone.y, zone.width, zone.height);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof CircleZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t}\n\t\t});\n\t},\n\n\tdrawEmitter(proton, canvas, emitter, clear) {\n\t\tconst context = canvas.getContext('2d');\n\t\tconst style = this.getStyle();\n\n\t\tthis.addEventListener(proton, () => {\n\t\t\tif (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n\t\t\tcontext.beginPath();\n\t\t\tcontext.fillStyle = style;\n\t\t\tcontext.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true);\n\t\t\tcontext.fill();\n\t\t\tcontext.closePath();\n\t\t});\n\t}\n}","// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating\n\n// requestAnimationFrame polyfill by Erik Möller\n// fixes from Paul Irish and Tino Zijdel\n(function () {\n\tvar lastTime = 0;\n\tvar vendors = ['ms', 'moz', 'webkit', 'o'];\n\tfor (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {\n\t\twindow.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];\n\t\twindow.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];\n\t}\n\n\tif (!window.requestAnimationFrame)\n\t\twindow.requestAnimationFrame = function (callback, element) {\n\t\t\tvar currTime = new Date().getTime();\n\t\t\tvar timeToCall = Math.max(0, 16 - (currTime - lastTime));\n\t\t\tvar id = window.setTimeout(function () {\n\t\t\t\tcallback(currTime + timeToCall);\n\t\t\t}, timeToCall);\n\t\t\tlastTime = currTime + timeToCall;\n\t\t\treturn id;\n\t\t};\n\n\tif (!window.cancelAnimationFrame)\n\t\twindow.cancelAnimationFrame = function (id) {\n\t\t\tclearTimeout(id);\n\t\t};\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 MathUtils from './math/MathUtils';\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 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';\nimport './polyfill/requestAnimationFrame';\n\n// namespace\nProton.Particle = Proton.P = Particle;\nProton.Pool = Pool;\n\nProton.Util = Util;\nProton.ColorUtil = ColorUtil;\nProton.MathUtils = MathUtils;\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.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;"],"names":["PI","MathUtils","a","b","INT","Math","floor","random","center","f","this","randomAToB","display","num","toString","slice","Span","isArray","Util","initValue","length","randomFloating","i","tx","ty","angleInRadians","c","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","IMG_CACHE","CANVAS_CACHE","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","array","obj","ignore","o","indexOf","constructor","args","concat","bind","apply","pOBJ","hasProp","p","v","copy","undefined","prototypeObject","filters","singleProp","hasOwnProperty","getSpanValue","pan","getValue","ImgUtil","arr","destroy","uid","getCacheID","cache","isInner","Pool","total","params","__puid","PUID","getID","pop","createOrClone","getCache","push","create","classApply","clone","count","Stats","proton","container","type","emitterIndex","rendererIndex","body","add","emitter","getEmitter","renderer","getRenderer","str","emitters","emitSpeed","getEmitterPos","initializes","concatArr","behaviours","name","getCreatedNumber","getCount","pool","innerHTML","cssText","join","addEventListener","_this","bg","color","parentNode","appendChild","renderers","result","cpool","round","EventDispatcher","_listeners","listener","removeEventListener","splice","listeners","handler","TargetClass","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","particle","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","getAllParticles","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","pow","PI_2","sqrt","ease","easeLinear","Vector2D","atan2","w","addVectors","subVectors","set","divideScalar","distanceToSquared","tha","dx","dy","alpha","Particle","ID","reset","setPrototypeByObject","N180_PI","life","Infinity","age","energy","dead","sprite","radius","rotation","easing","destroyObject","removeAllBehaviours","rgb","r","g","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","destroyArray","h","hex16","substring","parseInt","rbg","Number","Polar2D","abs","getX","getY","mat3","mat","Float32Array","mat1","mat2","m","vec","ArraySpan","_arr","randomColor","Rectangle","bottom","right","Rate","numpan","timepan","numPan","setSpanValue","timePan","startTime","nextTime","Initialize","Life","lifePan","Zone","vector","crossType","alert","PointZone","Position","zone","getPosition","Velocity","rpan","thapan","rPan","thaPan","vr","polar2d","normalizeVelocity","PI_180","Mass","massPan","Radius","oldRadius","Body","imagetarget","inner","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","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVector2DByObject","degreeTransform","Emitter","pObj","emitTime","totalTime","rate","stoped","isNaN","oldStoped","oldEmitTime","oldTotalTime","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","slow","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mouseTarget","window","_allowEmitting","initEventHandler","mousemoveHandler","_this2","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","layerX","layerY","offsetX","offsetY","babelHelpers.get","BaseRenderer","element","stroke","initHandler","circleConf","isCircle","thinkness","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","CanvasRenderer","bufferCache","addImg2Body","drawCircle","buffer","createBuffer","bufferContext","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","String","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","data","PixiRenderer","setColor","tint","getHex16FromParticle","PIXI","Sprite","fromImage","anchor","endFill","MStack","mats","Mat3","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","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","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","CustomRenderer","LineZone","x1","y1","x2","y2","direction","minx","min","miny","maxx","maxy","dot","xxyy","gradient","getGradient","getLength","tha2","oldx","oldy","rangeOut","getDistance","getSymmetric","error","CircleZone","angle","PIx2","d","distanceTo","RectZone","ImageZone","vectors","setVectors","j","length1","length2","getBound","negate","fun","getStyle","moveTo","lineTo","drawRect","lastTime","vendors","requestAnimationFrame","cancelAnimationFrame","currTime","timeToCall","setTimeout","P","Vector","Polar","getSpan","Init","L","V","M","R","F","RD","G","S","WebGlRenderer","Debug","assign"],"mappings":";;;;;;;;;kLAAA,IAAMA,EAAK,UAELC,EAAY,IAEVD,OACO,EAALA,OACAA,EAAK,SACHA,EAAK,YACJ,IAAMA,sBAEJE,EAAGC,EAAGC,UACRA,EAGMC,KAAKC,MAAMD,KAAKE,UAAYJ,EAAID,IAAMA,EAFtCA,EAAIG,KAAKE,UAAYJ,EAAID,4BAKzBM,EAAQC,EAAGL,UACfM,KAAKC,WAAWH,EAASC,EAAGD,EAASC,EAAGL,wBAGxCQ,8BAEKV,UACLA,EAAIF,EAAK,wBAGVa,SACC,IAAMA,EAAIC,SAAS,kCAInB,KAAO,SAA2B,SAAhBT,KAAKE,UAAwB,GAAGO,SAAS,KAAKC,OAAO,iwCC7BjEC,wBAERd,EAAGC,EAAGK,kBACZS,SAAU,EAEXC,EAAKD,QAAQf,SACXe,SAAU,OACVf,EAAIA,SAEJA,EAAIgB,EAAKC,UAAUjB,EAAG,QACtBC,EAAIe,EAAKC,UAAUhB,EAAGO,KAAKR,QAC3BM,OAASU,EAAKC,UAAUX,GAAQ,+CAK9BJ,UACJM,KAAKO,QACDP,KAAKR,EAAEG,KAAKC,MAAMI,KAAKR,EAAEkB,OAASf,KAAKE,WAEzCG,KAAKF,OAGFP,EAAUoB,eAAeX,KAAKR,EAAGQ,KAAKP,EAAGC,GAFzCH,EAAUU,WAAWD,KAAKR,EAAGQ,KAAKP,EAAGC,uBCItCgB,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AYA,EACnB/G,EAAO4d,SAAWA,GAClB5d,EAAO6d,UAAYA,GAEnB7d,EAAOsQ,eAAiBA,GACxBtQ,EAAO4R,YAAcA,GACrB5R,EAAO2S,cAAgBA,GACvB3S,EAAOiU,aAAeA,GACtBjU,EAAOyT,cAAgBA,GACvBzT,EAAO8U,cAAgB9U,EAAO8f,cAAgBhL,GAC9C9U,EAAO+b,eAAiBA,GAExB/b,EAAO+f,MAAQA,GAEfxmB,OAAOymB,OAAOhgB,EAAQgC"} \ No newline at end of file diff --git a/eslintrc.json b/eslintrc.json new file mode 100755 index 0000000..3feaeec --- /dev/null +++ b/eslintrc.json @@ -0,0 +1,183 @@ +{ + "parser": "babel-eslint", + "parserOptions": { + "ecmaVersion": 9, + "ecmaFeatures": { + }, + "sourceType": "module" + }, + + "env": { + "es6": true + }, + + "plugins": [ + "import", + "promise", + "standard" + ], + + "globals": { + "document": false, + "navigator": false, + "window": false + }, + + "rules": { + "accessor-pairs": "error", + "arrow-spacing": ["error", { "before": true, "after": true }], + "block-spacing": ["error", "always"], + "brace-style": 0, + "camelcase": ["error", { "properties": "never" }], + "comma-dangle": ["error", { + "arrays": "never", + "objects": "never", + "imports": "never", + "exports": "never", + "functions": "never" + }], + "comma-spacing": ["error", { "before": false, "after": true }], + "comma-style": ["error", "last"], + "constructor-super": "error", + "curly": 0, + "dot-location": ["error", "property"], + "eol-last": 0, + "eqeqeq": ["error", "always", { "null": "ignore" }], + "func-call-spacing": ["error", "never"], + "generator-star-spacing": ["error", { "before": true, "after": true }], + "handle-callback-err": ["error", "^(err|error)$" ], + "key-spacing": ["error", { "beforeColon": false, "afterColon": true }], + "keyword-spacing": ["error", { "before": true, "after": true }], + "new-cap": ["error", { "newIsCap": true, "capIsNew": false }], + "new-parens": 0, + "no-array-constructor": "error", + "no-caller": "error", + "no-class-assign": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", + "no-const-assign": "error", + "no-constant-condition": ["error", { "checkLoops": false }], + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-empty-character-class": "error", + "no-empty-pattern": "error", + "no-eval": "error", + "no-ex-assign": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-boolean-cast": 0, + "no-extra-parens": ["error", "functions"], + "no-fallthrough": "error", + "no-floating-decimal": 0, + "no-func-assign": "error", + "no-global-assign": "error", + "no-implied-eval": "error", + "no-inner-declarations": ["error", "functions"], + "no-invalid-regexp": "error", + "no-irregular-whitespace": "error", + "no-iterator": "error", + "no-label-var": "error", + "no-labels": ["error", { "allowLoop": false, "allowSwitch": false }], + "no-lone-blocks": "error", + "no-mixed-operators": ["error", { + "groups": [ + ["==", "!=", "===", "!==", ">", ">=", "<", "<="], + ["&&", "||"], + ["in", "instanceof"] + ], + "allowSamePrecedence": true + }], + "no-mixed-spaces-and-tabs": "error", + "no-multi-spaces": "error", + "no-multi-str": "error", + "no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }], + "no-negated-in-lhs": "error", + "no-new": "error", + "no-new-func": "error", + "no-new-object": "error", + "no-new-require": "error", + "no-new-symbol": "error", + "no-new-wrappers": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-octal-escape": "error", + "no-path-concat": "error", + "no-proto": "error", + "no-redeclare": "error", + "no-regex-spaces": "error", + "no-return-assign": ["error", "except-parens"], + "no-return-await": "error", + "no-self-assign": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-tabs": "off", + "no-template-curly-in-string": "error", + "no-this-before-super": "error", + "no-throw-literal": "error", + "no-trailing-spaces": "error", + "no-undef": 0, + "no-undef-init": "error", + "no-unexpected-multiline": "error", + "no-unmodified-loop-condition": "error", + "no-unneeded-ternary": 0, + "no-unreachable": "error", + "no-unsafe-finally": "error", + "no-unsafe-negation": "error", + "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true }], + "no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }], + "no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }], + "no-useless-call": 0, + "no-useless-computed-key": "error", + "no-useless-constructor": "error", + "no-useless-escape": "error", + "no-useless-rename": "error", + "no-useless-return": "error", + "no-whitespace-before-property": "error", + "no-with": "error", + "object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }], + "one-var": 0, + "operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before" } }], + "padded-blocks": 0, + "prefer-promise-reject-errors": "error", + "quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }], + "rest-spread-spacing": ["error", "never"], + "semi": 0, + "semi-spacing": ["error", { "before": false, "after": true }], + "space-before-blocks": ["error", "always"], + "space-before-function-paren": 0, + "space-in-parens": ["error", "never"], + "space-infix-ops": "error", + "space-unary-ops": ["error", { "words": true, "nonwords": false }], + "spaced-comment": ["error", "always", { + "line": { "markers": ["*package", "!", "/", ",", "="] }, + "block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] } + }], + "symbol-description": "error", + "template-curly-spacing": ["error", "never"], + "template-tag-spacing": ["error", "never"], + "unicode-bom": ["error", "never"], + "use-isnan": "error", + "valid-typeof": ["error", { "requireStringLiterals": true }], + "wrap-iife": ["error", "any", { "functionPrototypeMethods": true }], + "yield-star-spacing": ["error", "both"], + "yoda": ["error", "never"], + + "import/export": "error", + "import/first": "error", + "import/no-duplicates": "error", + "import/no-webpack-loader-syntax": "error", + + "promise/param-names": "error", + + "standard/array-bracket-even-spacing": ["error", "either"], + "standard/computed-property-even-spacing": ["error", "even"], + "standard/object-curly-even-spacing": ["error", "either"] + } +} diff --git a/package.json b/package.json index 237d7b4..7090006 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,12 @@ { "name": "proton-js", - "version": "3.1.2", + "version": "3.3.0", "description": "Proton is an easily customizable html5 particle engine including six different types of renderers.", "main": "./build/proton.min.js", "scripts": { "start": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c -w -m inline\" \"serve --port 3001\"", "page": "node ./script/makeexamplepage", + "lint": "eslint ./src --config=eslintrc.json", "build": "rollup -c --pub" }, "repository": { @@ -22,10 +23,15 @@ "homepage": "http://a-jie.github.io/Proton", "devDependencies": { "babel-core": "^6.26.0", + "babel-eslint": "^8.2.3", "babel-preset-es2015": "^6.24.1", "babel-preset-es2015-rollup": "^3.0.0", "babel-preset-stage-0": "^6.24.1", "concurrently": "^3.5.1", + "eslint": "^4.19.1", + "eslint-plugin-import": "^2.12.0", + "eslint-plugin-promise": "^3.8.0", + "eslint-plugin-standard": "^3.1.0", "rollup": "^0.54.0", "rollup-plugin-babel": "^3.0.3", "rollup-plugin-license": "^0.5.0", diff --git a/src/behaviour/Alpha.js b/src/behaviour/Alpha.js index a0ad3cd..1be2a70 100644 --- a/src/behaviour/Alpha.js +++ b/src/behaviour/Alpha.js @@ -22,7 +22,7 @@ export default class Alpha extends Behaviour { super(life, easing); this.reset(a, b); - this.name = "Alpha"; + this.name = 'Alpha'; } /** @@ -46,7 +46,7 @@ export default class Alpha extends Behaviour { life && super.reset(life, easing); } - + /** * Sets the new alpha value of the particle * @@ -76,7 +76,6 @@ export default class Alpha extends Behaviour { */ applyBehaviour(particle, time, index) { this.calculate(particle, time, index); - particle.alpha = particle.transform.alphaB + (particle.transform.alphaA - particle.transform.alphaB) * this.energy; if (particle.alpha < 0.001) particle.alpha = 0; } diff --git a/src/behaviour/Attraction.js b/src/behaviour/Attraction.js index 60cb0a9..1fed97e 100644 --- a/src/behaviour/Attraction.js +++ b/src/behaviour/Attraction.js @@ -39,7 +39,7 @@ export default class Attraction extends Behaviour { this.attractionForce = new Vector2D(); this.lengthSq = 0; - this.name = "Attraction"; + this.name = 'Attraction'; } /** @@ -95,5 +95,4 @@ export default class Attraction extends Behaviour { particle.a.add(this.attractionForce); } } -} - +} \ No newline at end of file diff --git a/src/behaviour/Behaviour.js b/src/behaviour/Behaviour.js index 3be07f2..fca4cca 100644 --- a/src/behaviour/Behaviour.js +++ b/src/behaviour/Behaviour.js @@ -60,7 +60,7 @@ export default class Behaviour { * @memberof Proton.Behaviour * @instance * - * @param {Proton.Vector2D} force + * @param {Proton.Vector2D} force */ normalizeForce(force) { return force.multiplyScalar(Proton.MEASURE); diff --git a/src/behaviour/Collision.js b/src/behaviour/Collision.js index f725b03..8c01f85 100644 --- a/src/behaviour/Collision.js +++ b/src/behaviour/Collision.js @@ -2,7 +2,6 @@ import Util from '../utils/Util'; import Vector2D from '../math/Vector2D'; import Behaviour from './Behaviour'; -//can use Collision(emitter,true,function(){}) or Collision(); export default class Collision extends Behaviour { /** @@ -22,7 +21,7 @@ export default class Collision extends Behaviour { * @todo add description to mass * * @param {Proton.Emitter} [emitter=null] the attraction point coordinates - * @param {Boolean} [mass=true] + * @param {Boolean} [mass=true] * @param {Callback} [callback=null] the callback after the collision * @param {Number} [life=Infinity] this behaviour's life * @param {String} [easing=ease.easeLinear] this behaviour's easing @@ -33,7 +32,7 @@ export default class Collision extends Behaviour { super(life, easing); this.reset(emitter, mass, callback); - this.name = "Collision"; + this.name = 'Collision'; } /** @@ -46,7 +45,7 @@ export default class Collision extends Behaviour { * @todo add description to mass * * @param {Proton.Emitter} [emitter=null] the attraction point coordinates - * @param {Boolean} [mass=true] + * @param {Boolean} [mass=true] * @param {Callback} [callback=null] the callback after the collision * @param {Number} [life=Infinity] this behaviour's life * @param {String} [easing=ease.easeLinear] this behaviour's easing @@ -101,7 +100,7 @@ export default class Collision extends Behaviour { totalMass = particle.mass + otherParticle.mass; averageMass1 = this.mass ? otherParticle.mass / totalMass : 0.5; averageMass2 = this.mass ? particle.mass / totalMass : 0.5; - + particle.p.add(this.delta.clone().normalize().multiplyScalar(overlap * -averageMass1)); otherParticle.p.add(this.delta.normalize().multiplyScalar(overlap * averageMass2)); @@ -110,5 +109,4 @@ export default class Collision extends Behaviour { } } } -} - +} \ No newline at end of file diff --git a/src/behaviour/Color.js b/src/behaviour/Color.js index aadd6ef..9c25a87 100644 --- a/src/behaviour/Color.js +++ b/src/behaviour/Color.js @@ -1,4 +1,3 @@ -import Util from '../utils/Util'; import ColorUtil from '../utils/ColorUtil'; import ArraySpan from '../math/ArraySpan'; import Behaviour from './Behaviour'; @@ -22,7 +21,7 @@ export default class Color extends Behaviour { super(life, easing); this.reset(a, b); - this.name = "Color"; + this.name = 'Color'; } /** diff --git a/src/behaviour/CrossZone.js b/src/behaviour/CrossZone.js index 040a83d..e9f1c0f 100644 --- a/src/behaviour/CrossZone.js +++ b/src/behaviour/CrossZone.js @@ -22,7 +22,7 @@ export default class CrossZone extends Behaviour { super(life, easing); this.reset(zone, crossType); - this.name = "CrossZone"; + this.name = 'CrossZone'; } /** @@ -39,7 +39,7 @@ export default class CrossZone extends Behaviour { */ reset(zone, crossType, life, easing) { this.zone = zone; - this.zone.crossType = Util.initValue(crossType, "dead"); + this.zone.crossType = Util.initValue(crossType, 'dead'); life && super.reset(life, easing); } diff --git a/src/behaviour/Force.js b/src/behaviour/Force.js index b213152..a01aae2 100644 --- a/src/behaviour/Force.js +++ b/src/behaviour/Force.js @@ -1,4 +1,3 @@ -import Util from '../utils/Util'; import Vector2D from '../math/Vector2D'; import Behaviour from './Behaviour'; @@ -21,7 +20,7 @@ export default class Force extends Behaviour { super(life, easing); this.force = this.normalizeForce(new Vector2D(fx, fy)); - this.name = "Force"; + this.name = 'Force'; } /** diff --git a/src/behaviour/Gravity.js b/src/behaviour/Gravity.js index e013f01..72ad55c 100644 --- a/src/behaviour/Gravity.js +++ b/src/behaviour/Gravity.js @@ -1,5 +1,3 @@ -import Util from '../utils/Util'; -import Vector2D from '../math/Vector2D'; import Force from './Force'; export default class Gravity extends Force { @@ -18,7 +16,7 @@ export default class Gravity extends Force { */ constructor(g, life, easing) { super(0, g, life, easing); - this.name = "Gravity"; + this.name = 'Gravity'; } /** diff --git a/src/behaviour/GravityWell.js b/src/behaviour/GravityWell.js index af6d841..33eeb74 100644 --- a/src/behaviour/GravityWell.js +++ b/src/behaviour/GravityWell.js @@ -11,7 +11,7 @@ export default class GravityWell extends Behaviour { * @alias GravityWell * * @param {Vector2D} [centerPoint=new Vector2D] The point in the center - * @param {Number} [force=100] The force + * @param {Number} [force=100] The force * @param {Number} [life=Infinity] this behaviour's life * @param {String} [easing=easeLinear] this behaviour's easing * @@ -24,7 +24,7 @@ export default class GravityWell extends Behaviour { this.centerPoint = Util.initValue(centerPoint, new Vector2D); this.force = Util.initValue(this.normalizeValue(force), 100); - this.name = "GravityWell"; + this.name = 'GravityWell'; } /** @@ -35,7 +35,7 @@ export default class GravityWell extends Behaviour { * @instance * * @param {Vector2D} [centerPoint=new Vector2D] The point in the center - * @param {Number} [force=100] The force + * @param {Number} [force=100] The force * @param {Number} [life=Infinity] this behaviour's life * @param {String} [easing=easeLinear] this behaviour's easing */ @@ -43,7 +43,7 @@ export default class GravityWell extends Behaviour { this.distanceVec = new Vector2D(); this.centerPoint = Util.initValue(centerPoint, new Vector2D); this.force = Util.initValue(this.normalizeValue(force), 100); - + life && super.reset(life, easing); }; @@ -68,7 +68,7 @@ export default class GravityWell extends Behaviour { this.distanceVec.set(this.centerPoint.x - particle.p.x, this.centerPoint.y - particle.p.y); const distanceSq = this.distanceVec.lengthSq(); - if (distanceSq != 0) { + if (distanceSq !== 0) { const distance = this.distanceVec.length(); const factor = (this.force * time) / (distanceSq * distance); diff --git a/src/behaviour/RandomDrift.js b/src/behaviour/RandomDrift.js index eab8799..2f9bbd4 100644 --- a/src/behaviour/RandomDrift.js +++ b/src/behaviour/RandomDrift.js @@ -1,4 +1,3 @@ -import Util from '../utils/Util'; import Vector2D from '../math/Vector2D'; import MathUtils from '../math/MathUtils'; import Behaviour from './Behaviour'; @@ -25,7 +24,7 @@ export default class RandomDrift extends Behaviour { this.reset(driftX, driftY, delay); this.time = 0; - this.name = "RandomDrift"; + this.name = 'RandomDrift'; } /** diff --git a/src/behaviour/Repulsion.js b/src/behaviour/Repulsion.js index 60ea5e9..bd441e6 100644 --- a/src/behaviour/Repulsion.js +++ b/src/behaviour/Repulsion.js @@ -1,4 +1,3 @@ -import Util from '../utils/Util'; import Attraction from './Attraction'; export default class Repulsion extends Attraction { @@ -26,7 +25,7 @@ export default class Repulsion extends Attraction { super(targetPosition, force, radius, life, easing); this.force *= -1; - this.name = "Repulsion"; + this.name = 'Repulsion'; } /** diff --git a/src/behaviour/Rotate.js b/src/behaviour/Rotate.js index 01c1a6b..185e422 100644 --- a/src/behaviour/Rotate.js +++ b/src/behaviour/Rotate.js @@ -23,7 +23,7 @@ export default class Rotate extends Behaviour { super(life, easing); this.reset(influence, b, style); - this.name = "Rotate"; + this.name = 'Rotate'; } /** @@ -44,7 +44,7 @@ export default class Rotate extends Behaviour { reset(a, b, style, life, easing) { this.same = b === null || b === undefined ? true : false; - this.a = Util.setSpanValue(Util.initValue(a, "Velocity")); + this.a = Util.setSpanValue(Util.initValue(a, 'Velocity')); this.b = Util.setSpanValue(Util.initValue(b, 0)); this.style = Util.initValue(style, 'to'); @@ -82,13 +82,13 @@ export default class Rotate extends Behaviour { this.calculate(particle, time, index); if (!this.same) { - if (this.style == 'to' || this.style == 'TO' || this.style == '_') { + if (this.style === 'to' || this.style === 'TO' || this.style === '_') { particle.rotation += particle.transform.rotationB + (particle.transform.rotationA - particle.transform.rotationB) * this.energy } else { particle.rotation += particle.transform.rotationB; } - } else if (this.a.a == "V" || this.a.a == "Velocity" || this.a.a == "v") { - //beta... + } else if (this.a.a === 'V' || this.a.a === 'Velocity' || this.a.a === 'v') { + // beta... particle.rotation = particle.getDirection(); } } diff --git a/src/behaviour/Scale.js b/src/behaviour/Scale.js index 42e6db7..fd92561 100644 --- a/src/behaviour/Scale.js +++ b/src/behaviour/Scale.js @@ -22,7 +22,7 @@ export default class Scale extends Behaviour { super(life, easing); this.reset(a, b); - this.name = "Scale"; + this.name = 'Scale'; } /** diff --git a/src/core/Particle.js b/src/core/Particle.js index bd1d367..7569222 100644 --- a/src/core/Particle.js +++ b/src/core/Particle.js @@ -35,7 +35,7 @@ export default class Particle { this.life = Infinity; this.age = 0; - //Energy loss + // Energy loss this.energy = 1; this.dead = false; this.sleep = false; @@ -52,7 +52,7 @@ export default class Particle { this.easing = ease.easeLinear; - if (init == 'init') { + if (init === 'init') { this.transform = {}; this.p = new Vector2D(); this.v = new Vector2D(); diff --git a/src/core/Pool.js b/src/core/Pool.js index 5b46b08..bfe98fb 100644 --- a/src/core/Pool.js +++ b/src/core/Pool.js @@ -3,9 +3,9 @@ * -> cache[abc]. -> cache[abc] .pop() * -> create [new Body| clone] * -> return p1: { __pid: abc } - * + * * expire -> cache[abc]= [p0, p1]; - * + * */ import Util from '../utils/Util'; import PUID from '../utils/PUID'; @@ -69,7 +69,7 @@ export default class Pool { /** * Creates a new class instance * - * @todo add more documentation + * @todo add more documentation * * @method create * @memberof Proton#Proton.Pool @@ -84,7 +84,7 @@ export default class Pool { if (this.create) { return this.create(target, params); - } else if (typeof target == "function") { + } else if (typeof target === 'function') { return Util.classApply(target, params); } else { return target.clone(); @@ -105,7 +105,7 @@ export default class Pool { for (let id in this.cache) count += this.cache[id].length; - return count++;; + return count++; } /** @@ -133,7 +133,7 @@ export default class Pool { * @return {Object} */ getCache(uid) { - uid = uid || "default"; + uid = uid || 'default'; if (!this.cache[uid]) this.cache[uid] = []; return this.cache[uid]; diff --git a/src/core/Proton.js b/src/core/Proton.js index 6239532..53f932b 100644 --- a/src/core/Proton.js +++ b/src/core/Proton.js @@ -8,7 +8,7 @@ export default class Proton { static USE_CLOCK = false; - //1:100 + // 1:100 static MEASURE = 100; static EULER = 'euler'; static RK2 = 'runge-kutta2'; @@ -157,7 +157,7 @@ export default class Proton { * @instance */ amendChangeTabsBug() { - if (this.elapsed > .5) { + if (this.elapsed > 0.5) { this.oldTime = (new Date()).getTime(); this.elapsed = 0; } diff --git a/src/debug/Debug.js b/src/debug/Debug.js index 9e86df1..f0ab375 100644 --- a/src/debug/Debug.js +++ b/src/debug/Debug.js @@ -1,6 +1,4 @@ -import Util from '../utils/Util'; import ColorUtil from '../utils/ColorUtil'; -import MathUtils from '../math/MathUtils'; import CircleZone from '../zone/CircleZone'; import PointZone from '../zone/PointZone'; import LineZone from '../zone/LineZone'; @@ -8,14 +6,14 @@ import RectZone from '../zone/RectZone'; export default { addEventListener(proton, fun) { - proton.addEventListener("PROTON_UPDATE_AFTER", () => fun()); + proton.addEventListener('PROTON_UPDATE_AFTER', () => fun()); }, getStyle(color) { const rgb = ColorUtil.hexToRGB(color || '#ff0000'); return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`; }, - + drawZone(proton, canvas, zone, clear) { const context = canvas.getContext('2d'); const style = this.getStyle(); @@ -52,20 +50,19 @@ export default { } }); }, - + drawEmitter(proton, canvas, emitter, clear) { const context = canvas.getContext('2d'); const style = this.getStyle(); this.addEventListener(proton, () => { if (clear) context.clearRect(0, 0, canvas.width, canvas.height); - + context.beginPath(); context.fillStyle = style; context.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true); context.fill(); context.closePath(); }); - }, -} - + } +} \ No newline at end of file diff --git a/src/debug/Stats.js b/src/debug/Stats.js index 8c2880c..356c5a2 100644 --- a/src/debug/Stats.js +++ b/src/debug/Stats.js @@ -14,31 +14,31 @@ export default class Stats { const emitter = this.getEmitter(); const renderer = this.getRenderer(); - let str = ""; + let str = ''; switch (this.type) { case 2: - str += "emitter:" + this.proton.emitters.length + "
"; - if (emitter) str += "em speed:" + emitter.emitSpeed + "
"; - if (emitter) str += "pos:" + this.getEmitterPos(emitter); + str += 'emitter:' + this.proton.emitters.length + '
'; + if (emitter) str += 'em speed:' + emitter.emitSpeed + '
'; + if (emitter) str += 'pos:' + this.getEmitterPos(emitter); break; case 3: - if (emitter) str += "initializes:" + emitter.initializes.length + "
"; - if (emitter) str += "" + this.concatArr(emitter.initializes) + "
"; - if (emitter) str += "behaviours:" + emitter.behaviours.length + "
"; - if (emitter) str += "" + this.concatArr(emitter.behaviours) + "
"; + if (emitter) str += 'initializes:' + emitter.initializes.length + '
'; + if (emitter) str += '' + this.concatArr(emitter.initializes) + '
'; + if (emitter) str += 'behaviours:' + emitter.behaviours.length + '
'; + if (emitter) str += '' + this.concatArr(emitter.behaviours) + '
'; break; case 4: - if (renderer) str += renderer.name + "
"; - if (renderer) str += "body:" + this.getCreatedNumber(renderer) + "
"; + if (renderer) str += renderer.name + '
'; + if (renderer) str += 'body:' + this.getCreatedNumber(renderer) + '
'; break; default: - str += "particles:" + this.proton.getCount() + "
"; - str += "pool:" + this.proton.pool.getCount() + "
"; - str += "total:" + this.proton.pool.total; + str += 'particles:' + this.proton.getCount() + '
'; + str += 'pool:' + this.proton.pool.getCount() + '
'; + str += 'total:' + this.proton.pool.total; } this.container.innerHTML = str; @@ -63,22 +63,22 @@ export default class Stats { let bg, color; switch (style) { case 2: - bg = "#201"; - color = "#f08"; + bg = '#201'; + color = '#f08'; break; case 3: - bg = "#020"; - color = "#0f0"; + bg = '#020'; + color = '#0f0'; break; default: - bg = "#002"; - color = "#0ff"; + bg = '#002'; + color = '#0ff'; } - this.container.style["background-color"] = bg; - this.container.style["color"] = color; + this.container.style['background-color'] = bg; + this.container.style['color'] = color; } if (!this.container.parentNode) { @@ -111,6 +111,6 @@ export default class Stats { } getEmitterPos(e) { - return Math.round(e.p.x) + "," + Math.round(e.p.y); + return Math.round(e.p.x) + ',' + Math.round(e.p.y); } } \ No newline at end of file diff --git a/src/emitter/BehaviourEmitter.js b/src/emitter/BehaviourEmitter.js index bcc6809..20aa438 100644 --- a/src/emitter/BehaviourEmitter.js +++ b/src/emitter/BehaviourEmitter.js @@ -1,4 +1,3 @@ -import Util from '../utils/Util'; import Emitter from './Emitter'; export default class BehaviourEmitter extends Emitter { @@ -16,7 +15,7 @@ export default class BehaviourEmitter extends Emitter { this.selfBehaviours = []; }; - + /** * add the Behaviour to emitter; * diff --git a/src/emitter/Emitter.js b/src/emitter/Emitter.js index 8638d4d..e41d779 100644 --- a/src/emitter/Emitter.js +++ b/src/emitter/Emitter.js @@ -72,8 +72,8 @@ export default class Emitter extends Particle { this.emitTime = 0; this.totalTime = Util.initValue(totalTime, Infinity); - if (life == true || life == 'life' || life == 'destroy') { - this.life = totalTime == 'once' ? 1 : this.totalTime; + if (life === true || life === 'life' || life === 'destroy') { + this.life = totalTime === 'once' ? 1 : this.totalTime; } else if (!isNaN(life)) { this.life = life; } @@ -135,7 +135,7 @@ export default class Emitter extends Particle { /** * add the Initialize to particles; - * + * * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3); * @method addInitialize * @param {Initialize} initialize like this new Radius(1, 12) @@ -166,7 +166,7 @@ export default class Emitter extends Particle { /** * add the Behaviour to particles; - * + * * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3); * @method addBehaviour * @param {Behaviour} behaviour like this new Color('random') @@ -205,7 +205,7 @@ export default class Emitter extends Particle { Util.destroyArray(this.behaviours); } - // emitter update + // emitter update update(time) { this.age += time; if (this.age >= this.life || this.dead) this.destroy(); @@ -229,11 +229,11 @@ export default class Emitter extends Particle { // particle update particle.update(time, i); this.parent.integrator.calculate(particle, time, damping); - this.dispatch("PARTICLE_UPDATE", particle); + this.dispatch('PARTICLE_UPDATE', particle); // check dead if (particle.dead) { - this.dispatch("PARTICLE_DEAD", particle); + this.dispatch('PARTICLE_DEAD', particle); this.parent.pool.expire(particle); this.particles.splice(i, 1); @@ -247,7 +247,7 @@ export default class Emitter extends Particle { } emitting(time) { - if (this.totalTime == 'once') { + if (this.totalTime === 'once') { let i; const length = this.rate.getValue(99999); @@ -271,14 +271,14 @@ export default class Emitter extends Particle { /** * create single particle; - * + * * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun}) * @method removeAllParticles */ createParticle(initialize, behaviour) { const particle = this.parent.pool.get(Particle); this.setupParticle(particle, initialize, behaviour); - this.dispatch("PARTICLE_CREATED", particle); + this.dispatch('PARTICLE_CREATED', particle); return particle; } diff --git a/src/emitter/FollowEmitter.js b/src/emitter/FollowEmitter.js index af0ae2a..254307c 100644 --- a/src/emitter/FollowEmitter.js +++ b/src/emitter/FollowEmitter.js @@ -19,7 +19,7 @@ export default class FollowEmitter extends Emitter { super(pObj); this.mouseTarget = Util.initValue(mouseTarget, window); - this.ease = Util.initValue(ease, .7); + this.ease = Util.initValue(ease, 0.7); this._allowEmitting = false; this.initEventHandler(); diff --git a/src/events/EventDispatcher.js b/src/events/EventDispatcher.js index 0de1fc2..5c37699 100644 --- a/src/events/EventDispatcher.js +++ b/src/events/EventDispatcher.js @@ -10,7 +10,7 @@ export default class EventDispatcher { this._listeners = null; } - static bind(TargetClass){ + static bind(TargetClass) { TargetClass.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent; TargetClass.prototype.hasEventListener = EventDispatcher.prototype.hasEventListener; TargetClass.prototype.addEventListener = EventDispatcher.prototype.addEventListener; @@ -38,9 +38,9 @@ export default class EventDispatcher { const arr = this._listeners[type]; const length = arr.length; - for (let i = 0;i < length; i++) { - if (arr[i] == listener) { - if (length == 1) { + for (let i = 0; i < length; i++) { + if (arr[i] === listener) { + if (length === 1) { delete (this._listeners[type]); } @@ -69,7 +69,7 @@ export default class EventDispatcher { let arr = listeners[type]; if (!arr) return result; - //arr = arr.slice(); + // arr = arr.slice(); // to avoid issues with items being removed or added during the dispatch let handler; diff --git a/src/index.js b/src/index.js index 4c7eec1..2063ffd 100644 --- a/src/index.js +++ b/src/index.js @@ -1,63 +1,62 @@ -// import -import Proton from "./core/Proton"; -import Particle from "./core/Particle"; -import Pool from "./core/Pool"; - -import Util from "./utils/Util"; -import ColorUtil from "./utils/ColorUtil"; -import MathUtils from "./math/MathUtils"; -import Vector2D from "./math/Vector2D"; -import Polar2D from "./math/Polar2D"; -import Mat3 from "./math/Mat3"; -import Span from "./math/Span"; -import ArraySpan from "./math/ArraySpan"; -import Rectangle from "./math/Rectangle"; -import ease from "./math/ease"; - -import Rate from "./initialize/Rate"; -import Initialize from "./initialize/Initialize"; -import Life from "./initialize/Life"; -import Position from "./initialize/Position"; -import Velocity from "./initialize/Velocity"; -import Mass from "./initialize/Mass"; -import Radius from "./initialize/Radius"; -import Body from "./initialize/Body"; - -import Behaviour from "./behaviour/Behaviour"; -import Force from "./behaviour/Force"; -import Attraction from "./behaviour/Attraction"; -import RandomDrift from "./behaviour/RandomDrift"; -import Gravity from "./behaviour/Gravity"; -import Collision from "./behaviour/Collision"; -import CrossZone from "./behaviour/CrossZone"; -import Alpha from "./behaviour/Alpha"; -import Scale from "./behaviour/Scale"; -import Rotate from "./behaviour/Rotate"; -import Color from "./behaviour/Color"; -import Repulsion from "./behaviour/Repulsion"; -import GravityWell from "./behaviour/GravityWell"; - -import Emitter from "./emitter/Emitter"; -import BehaviourEmitter from "./emitter/BehaviourEmitter"; -import FollowEmitter from "./emitter/FollowEmitter"; - -import CanvasRenderer from "./render/CanvasRenderer"; -import DomRenderer from "./render/DomRenderer"; -import EaselRenderer from "./render/EaselRenderer"; -import PixelRenderer from "./render/PixelRenderer"; -import PixiRenderer from "./render/PixiRenderer"; -import WebGLRenderer from "./render/WebGLRenderer"; -import CustomRenderer from "./render/CustomRenderer"; - -import Zone from "./zone/Zone"; -import LineZone from "./zone/LineZone"; -import CircleZone from "./zone/CircleZone"; -import PointZone from "./zone/PointZone"; -import RectZone from "./zone/RectZone"; -import ImageZone from "./zone/ImageZone"; - -import Debug from "./debug/Debug"; -import "./polyfill/requestAnimationFrame"; +import Proton from './core/Proton'; +import Particle from './core/Particle'; +import Pool from './core/Pool'; + +import Util from './utils/Util'; +import ColorUtil from './utils/ColorUtil'; +import MathUtils from './math/MathUtils'; +import Vector2D from './math/Vector2D'; +import Polar2D from './math/Polar2D'; +import Mat3 from './math/Mat3'; +import Span from './math/Span'; +import ArraySpan from './math/ArraySpan'; +import Rectangle from './math/Rectangle'; +import ease from './math/ease'; + +import Rate from './initialize/Rate'; +import Initialize from './initialize/Initialize'; +import Life from './initialize/Life'; +import Position from './initialize/Position'; +import Velocity from './initialize/Velocity'; +import Mass from './initialize/Mass'; +import Radius from './initialize/Radius'; +import Body from './initialize/Body'; + +import Behaviour from './behaviour/Behaviour'; +import Force from './behaviour/Force'; +import Attraction from './behaviour/Attraction'; +import RandomDrift from './behaviour/RandomDrift'; +import Gravity from './behaviour/Gravity'; +import Collision from './behaviour/Collision'; +import CrossZone from './behaviour/CrossZone'; +import Alpha from './behaviour/Alpha'; +import Scale from './behaviour/Scale'; +import Rotate from './behaviour/Rotate'; +import Color from './behaviour/Color'; +import Repulsion from './behaviour/Repulsion'; +import GravityWell from './behaviour/GravityWell'; + +import Emitter from './emitter/Emitter'; +import BehaviourEmitter from './emitter/BehaviourEmitter'; +import FollowEmitter from './emitter/FollowEmitter'; + +import CanvasRenderer from './render/CanvasRenderer'; +import DomRenderer from './render/DomRenderer'; +import EaselRenderer from './render/EaselRenderer'; +import PixelRenderer from './render/PixelRenderer'; +import PixiRenderer from './render/PixiRenderer'; +import WebGLRenderer from './render/WebGLRenderer'; +import CustomRenderer from './render/CustomRenderer'; + +import Zone from './zone/Zone'; +import LineZone from './zone/LineZone'; +import CircleZone from './zone/CircleZone'; +import PointZone from './zone/PointZone'; +import RectZone from './zone/RectZone'; +import ImageZone from './zone/ImageZone'; + +import Debug from './debug/Debug'; +import './polyfill/requestAnimationFrame'; // namespace Proton.Particle = Proton.P = Particle; diff --git a/src/initialize/Body.js b/src/initialize/Body.js index 4ad4c87..b9e06b4 100644 --- a/src/initialize/Body.js +++ b/src/initialize/Body.js @@ -16,8 +16,8 @@ export default class Body extends Initialize { initialize(particle) { const imagetarget = this.image.getValue(); - if (typeof(imagetarget) == 'string') { - particle.body = { width: this.w, height: this.h, src: imagetarget , isInner: true, inner: true }; + if (typeof (imagetarget) === 'string') { + particle.body = { width: this.w, height: this.h, src: imagetarget, isInner: true, inner: true }; } else { particle.body = imagetarget; } diff --git a/src/initialize/Initialize.js b/src/initialize/Initialize.js index 0799162..42db392 100644 --- a/src/initialize/Initialize.js +++ b/src/initialize/Initialize.js @@ -1,5 +1,5 @@ export default class Initialize { - + reset() { } @@ -11,7 +11,7 @@ export default class Initialize { } }; - ///sub class init + // sub class init initialize(target) { }; } \ No newline at end of file diff --git a/src/initialize/InitializeUtil.js b/src/initialize/InitializeUtil.js index f630982..82336cb 100644 --- a/src/initialize/InitializeUtil.js +++ b/src/initialize/InitializeUtil.js @@ -18,12 +18,12 @@ export default { this.bindEmitter(emitter, particle); }, - //////////////////////init////////////////////// + // init init(emitter, particle, initialize) { Util.setPrototypeByObject(particle, initialize); Util.setVector2DByObject(particle, initialize); }, - + bindEmitter(emitter, particle) { if (emitter.bindEmitter) { particle.p.add(emitter.p); diff --git a/src/initialize/Life.js b/src/initialize/Life.js index bded674..dbb0c80 100644 --- a/src/initialize/Life.js +++ b/src/initialize/Life.js @@ -11,7 +11,7 @@ export default class Life extends Initialize { } initialize(target) { - if (this.lifePan.a == Infinity) + if (this.lifePan.a === Infinity) target.life = Infinity; else target.life = this.lifePan.getValue(); diff --git a/src/initialize/Rate.js b/src/initialize/Rate.js index d29f513..542c9f4 100644 --- a/src/initialize/Rate.js +++ b/src/initialize/Rate.js @@ -34,7 +34,7 @@ export default class Rate { this.startTime = 0; this.nextTime = this.timePan.getValue(); - if (this.numPan.b == 1) { + if (this.numPan.b === 1) { if (this.numPan.getValue(false) > 0.5) return 1; else diff --git a/src/initialize/Velocity.js b/src/initialize/Velocity.js index 7b5ca9b..4aaee74 100644 --- a/src/initialize/Velocity.js +++ b/src/initialize/Velocity.js @@ -27,7 +27,7 @@ export default class Velocity extends Initialize { } initialize(target) { - if (this.type == 'p' || this.type == 'P' || this.type == 'polar') { + if (this.type === 'p' || this.type === 'P' || this.type === 'polar') { const polar2d = new Polar2D(this.normalizeVelocity(this.rPan.getValue()), this.thaPan.getValue() * MathUtils.PI_180); target.v.x = polar2d.getX(); diff --git a/src/math/Integration.js b/src/math/Integration.js index c652595..03db6db 100644 --- a/src/math/Integration.js +++ b/src/math/Integration.js @@ -1,5 +1,3 @@ -import Util from '../utils/Util'; - export default class Integration { constructor(type) { diff --git a/src/math/MathUtils.js b/src/math/MathUtils.js index 6d8e217..df4b0e1 100644 --- a/src/math/MathUtils.js +++ b/src/math/MathUtils.js @@ -26,7 +26,7 @@ const MathUtils = { }, toColor16(num) { - return "#" + num.toString(16); + return '#' + num.toString(16); }, randomColor() { diff --git a/src/math/Vector2D.js b/src/math/Vector2D.js index 9df14b0..32d1b9c 100644 --- a/src/math/Vector2D.js +++ b/src/math/Vector2D.js @@ -24,7 +24,7 @@ export default class Vector2D { } getGradient() { - if (this.x != 0) + if (this.x !== 0) return Math.atan2(this.y, this.x); else if (this.y > 0) return MathUtils.PI_2; diff --git a/src/polyfill/requestAnimationFrame.js b/src/polyfill/requestAnimationFrame.js index db91dec..a785b7d 100644 --- a/src/polyfill/requestAnimationFrame.js +++ b/src/polyfill/requestAnimationFrame.js @@ -3,27 +3,27 @@ // requestAnimationFrame polyfill by Erik Möller // fixes from Paul Irish and Tino Zijdel -( function() { - var lastTime = 0; - var vendors = ['ms', 'moz', 'webkit', 'o']; - for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame']; - } +(function () { + var lastTime = 0; + var vendors = ['ms', 'moz', 'webkit', 'o']; + for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { + window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; + window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame']; + } - if (!window.requestAnimationFrame) - window.requestAnimationFrame = function(callback, element) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function() { - callback(currTime + timeToCall); - }, timeToCall); - lastTime = currTime + timeToCall; - return id; - }; + if (!window.requestAnimationFrame) + window.requestAnimationFrame = function (callback, element) { + var currTime = new Date().getTime(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function () { + callback(currTime + timeToCall); + }, timeToCall); + lastTime = currTime + timeToCall; + return id; + }; - if (!window.cancelAnimationFrame) - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; - }()); \ No newline at end of file + if (!window.cancelAnimationFrame) + window.cancelAnimationFrame = function (id) { + clearTimeout(id); + }; +}()); \ No newline at end of file diff --git a/src/render/BaseRenderer.js b/src/render/BaseRenderer.js index 5734020..cfc525b 100644 --- a/src/render/BaseRenderer.js +++ b/src/render/BaseRenderer.js @@ -45,7 +45,11 @@ export default class BaseRenderer { proton.addEventListener('PARTICLE_DEAD', this._particleDeadHandler); } - resize(width, height) {} + resize(width, height) { } + + destroy() { + this.remove(); + } remove(proton) { this.parent.removeEventListener('PROTON_UPDATE', this._protonUpdateHandler); @@ -61,17 +65,13 @@ export default class BaseRenderer { this.parent = null; } - destroy(){ - this.remove(); - } - - onProtonUpdate() {} - onProtonUpdateAfter() {} + onProtonUpdate() { } + onProtonUpdateAfter() { } - onEmitterAdded(emitter) {} - onEmitterRemoved(emitter) {} + onEmitterAdded(emitter) { } + onEmitterRemoved(emitter) { } - onParticleCreated(particle) {} - onParticleUpdate(particle) {} - onParticleDead(particle) {} + onParticleCreated(particle) { } + onParticleUpdate(particle) { } + onParticleDead(particle) { } } \ No newline at end of file diff --git a/src/render/CanvasRenderer.js b/src/render/CanvasRenderer.js index 6df6166..b398831 100644 --- a/src/render/CanvasRenderer.js +++ b/src/render/CanvasRenderer.js @@ -1,4 +1,3 @@ -import Util from '../utils/Util'; import ImgUtil from '../utils/ImgUtil'; import ColorUtil from '../utils/ColorUtil'; import MathUtils from '../math/MathUtils'; @@ -10,7 +9,7 @@ export default class CanvasRenderer extends BaseRenderer { super(element); this.stroke = null; - this.context = this.element.getContext("2d"); + this.context = this.element.getContext('2d'); this.bufferCache = {}; this.name = 'CanvasRenderer'; @@ -44,13 +43,12 @@ export default class CanvasRenderer extends BaseRenderer { particle.body = null; } - - // private + // private addImg2Body(img, particle) { particle.body = img; } - // private drawCircle -- + // private drawCircle drawImage(particle) { const w = particle.body.width * particle.scale | 0; const h = particle.body.height * particle.scale | 0; @@ -58,17 +56,17 @@ export default class CanvasRenderer extends BaseRenderer { const y = particle.p.y - h / 2; if (!!particle.color) { - if (!particle.transform["buffer"]) particle.transform.buffer = this.createBuffer(particle.body); + if (!particle.transform['buffer']) particle.transform.buffer = this.createBuffer(particle.body); const bufferContext = particle.transform.buffer.getContext('2d'); bufferContext.clearRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height); bufferContext.globalAlpha = particle.alpha; bufferContext.drawImage(particle.body, 0, 0); - bufferContext.globalCompositeOperation = "source-atop"; + bufferContext.globalCompositeOperation = 'source-atop'; bufferContext.fillStyle = ColorUtil.rgbToHex(particle.transform.rgb); bufferContext.fillRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height); - bufferContext.globalCompositeOperation = "source-over"; + bufferContext.globalCompositeOperation = 'source-over'; bufferContext.globalAlpha = 1; this.context.drawImage(particle.transform.buffer, 0, 0, particle.transform.buffer.width, particle.transform.buffer.height, x, y, w, h); @@ -88,7 +86,7 @@ export default class CanvasRenderer extends BaseRenderer { // private drawCircle -- drawCircle(particle) { - if (particle.transform["rgb"]) + if (particle.transform['rgb']) this.context.fillStyle = 'rgba(' + particle.transform.rgb.r + ',' + particle.transform.rgb.g + ',' + particle.transform.rgb.b + ',' + particle.alpha + ')'; else this.context.fillStyle = particle.color; diff --git a/src/render/CustomRenderer.js b/src/render/CustomRenderer.js index fcc83d9..0ff24e0 100644 --- a/src/render/CustomRenderer.js +++ b/src/render/CustomRenderer.js @@ -1,4 +1,3 @@ -import Util from '../utils/Util'; import BaseRenderer from './BaseRenderer'; export default class CustomRenderer extends BaseRenderer { diff --git a/src/render/DomRenderer.js b/src/render/DomRenderer.js index bf5308e..437ee27 100644 --- a/src/render/DomRenderer.js +++ b/src/render/DomRenderer.js @@ -1,7 +1,5 @@ -import Util from '../utils/Util'; import DomUtil from '../utils/DomUtil'; import ImgUtil from '../utils/ImgUtil'; -import MathUtils from '../math/MathUtils'; import BaseRenderer from './BaseRenderer'; export default class DomRenderer extends BaseRenderer { @@ -53,7 +51,7 @@ export default class DomRenderer extends BaseRenderer { return typeof particle.body === 'object' && particle.body && !particle.body.isInner; } - // private + // private addImg2Body(img, particle) { if (particle.dead) return; particle.body = this.pool.get(img, particle); diff --git a/src/render/EaselRenderer.js b/src/render/EaselRenderer.js index 9c677b1..d07704e 100644 --- a/src/render/EaselRenderer.js +++ b/src/render/EaselRenderer.js @@ -1,4 +1,3 @@ -import Util from '../utils/Util'; import BaseRenderer from './BaseRenderer'; export default class EaselRenderer extends BaseRenderer { diff --git a/src/render/PixelRenderer.js b/src/render/PixelRenderer.js index 228ff78..9192f91 100644 --- a/src/render/PixelRenderer.js +++ b/src/render/PixelRenderer.js @@ -1,4 +1,3 @@ -import Util from '../utils/Util'; import Rectangle from '../math/Rectangle'; import BaseRenderer from './BaseRenderer'; diff --git a/src/render/PixiRenderer.js b/src/render/PixiRenderer.js index 7717c47..1bb214a 100644 --- a/src/render/PixiRenderer.js +++ b/src/render/PixiRenderer.js @@ -1,5 +1,3 @@ -import Pool from '../core/Pool'; -import Util from '../utils/Util'; import ColorUtil from '../utils/ColorUtil'; import MathUtils from '../math/MathUtils'; import BaseRenderer from './BaseRenderer'; @@ -92,8 +90,8 @@ export default class PixiRenderer extends BaseRenderer { const graphics = new PIXI.Graphics(); if (this.stroke) { - let stroke = this.stroke instanceof String ? this.stroke : 0x000000; - graphics.beginStroke(this.stroke); + const stroke = this.stroke instanceof String ? this.stroke : 0x000000; + graphics.beginStroke(stroke); } graphics.beginFill(particle.color || 0x008ced); diff --git a/src/render/WebGLRenderer.js b/src/render/WebGLRenderer.js index e2718d8..f818266 100644 --- a/src/render/WebGLRenderer.js +++ b/src/render/WebGLRenderer.js @@ -14,7 +14,7 @@ export default class WebGLRenderer extends BaseRenderer { super(element); this.gl = this.element.getContext('experimental-webgl', { antialias: true, stencil: false, depth: false }); - if (!this.gl) alert("Sorry your browser do not suppest WebGL!"); + if (!this.gl) alert('Sorry your browser do not suppest WebGL!'); this.initVar(); this.setMaxRadius(); @@ -55,12 +55,12 @@ export default class WebGLRenderer extends BaseRenderer { } getVertexShader() { - 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"); + 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'); return vsSource; } getFragmentShader() { - 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"); + 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'); return fsSource; } @@ -103,18 +103,18 @@ export default class WebGLRenderer extends BaseRenderer { this.gl.linkProgram(this.sprogram); if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS)) - alert("Could not initialise shaders"); + alert('Could not initialise shaders'); this.gl.useProgram(this.sprogram); - this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, "aVertexPosition"); - this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, "aTextureCoord"); + this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, 'aVertexPosition'); + this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, 'aTextureCoord'); this.gl.enableVertexAttribArray(this.sprogram.tca); this.gl.enableVertexAttribArray(this.sprogram.vpa); - this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, "tMat"); - this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, "uSampler"); - this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, "useTexture"); - this.sprogram.color = this.gl.getUniformLocation(this.sprogram, "uColor"); + this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, 'tMat'); + this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, 'uSampler'); + this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, 'useTexture'); + this.sprogram.color = this.gl.getUniformLocation(this.sprogram, 'uColor'); this.gl.uniform1i(this.sprogram.useTex, 1); }; @@ -195,8 +195,8 @@ export default class WebGLRenderer extends BaseRenderer { } onProtonUpdate() { - //this.gl.clearColor(0, 0, 0, 1); - //this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT); + // this.gl.clearColor(0, 0, 0, 1); + // this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT); } onParticleCreated(particle) { @@ -214,10 +214,9 @@ export default class WebGLRenderer extends BaseRenderer { } } - // private + // private addImg2Body(img, particle) { if (particle.dead) return; - particle.body = img; particle.transform.src = img.src; particle.transform.canvas = ImgUtil.getCanvasFromCache(img); diff --git a/src/utils/ColorUtil.js b/src/utils/ColorUtil.js index c39eee8..b5334b6 100644 --- a/src/utils/ColorUtil.js +++ b/src/utils/ColorUtil.js @@ -17,7 +17,7 @@ export default { * @return {rgbObject} */ hexToRGB(h) { - const hex16 = (h.charAt(0) == "#") ? h.substring(1, 7) : h; + const hex16 = (h.charAt(0) === '#') ? h.substring(1, 7) : h; const r = parseInt(hex16.substring(0, 2), 16); const g = parseInt(hex16.substring(2, 4), 16); const b = parseInt(hex16.substring(4, 6), 16); diff --git a/src/utils/DomUtil.js b/src/utils/DomUtil.js index 729b5e1..dcbea97 100644 --- a/src/utils/DomUtil.js +++ b/src/utils/DomUtil.js @@ -9,12 +9,12 @@ export default { * @param {String} $id the canvas' id * @param {Number} $width the canvas' width * @param {Number} $height the canvas' height - * @param {String} [$position=absolute] the canvas' position, default is 'absolute' + * @param {String} [$position=absolute] the canvas' position, default is 'absolute' * * @return {Object} */ createCanvas(id, width, height, position) { - const dom = document.createElement("canvas"); + const dom = document.createElement('canvas'); position = position || 'absolute'; dom.id = id; @@ -29,7 +29,7 @@ export default { }, createDiv(id, width, height) { - const dom = document.createElement("div"); + const dom = document.createElement('div'); dom.id = id; dom.style.position = 'absolute'; @@ -51,11 +51,11 @@ export default { * @memberof Proton#Proton.DomUtil * @method transform * - * @param {HTMLDivElement} div - * @param {Number} $x - * @param {Number} $y - * @param {Number} $scale - * @param {Number} $rotate + * @param {HTMLDivElement} div + * @param {Number} $x + * @param {Number} $y + * @param {Number} $scale + * @param {Number} $rotate */ transform(div, x, y, scale, rotate) { const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`; diff --git a/src/utils/ImgUtil.js b/src/utils/ImgUtil.js index 18f36c7..1cc7c52 100644 --- a/src/utils/ImgUtil.js +++ b/src/utils/ImgUtil.js @@ -38,7 +38,7 @@ export default { * @param {Boolean} func */ getImgFromCache(img, callback, param) { - const src = typeof (img) == 'string' ? img : img.src; + const src = typeof (img) === 'string' ? img : img.src; if (IMG_CACHE[src]) { callback(IMG_CACHE[src], param); diff --git a/src/utils/MStack.js b/src/utils/MStack.js index 1f9861f..d91c884 100644 --- a/src/utils/MStack.js +++ b/src/utils/MStack.js @@ -10,7 +10,7 @@ export default class MStack { } set(m, i) { - if (i == 0) + if (i === 0) Mat3.set(m, this.mats[0]); else Mat3.multiply(this.mats[i - 1], m, this.mats[i]); @@ -19,7 +19,7 @@ export default class MStack { } push(m) { - if (this.size == 0) + if (this.size === 0) Mat3.set(m, this.mats[0]); else Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]); diff --git a/src/utils/PUID.js b/src/utils/PUID.js index 7802ef4..5d2fb02 100644 --- a/src/utils/PUID.js +++ b/src/utils/PUID.js @@ -18,7 +18,6 @@ export default { obj = this.cache[id]; if (obj === target) return id; - if (typeof obj === 'object' && typeof target === 'object' && obj.isInner && target.isInner) { if (obj.src === target.src) return id; diff --git a/src/utils/Util.js b/src/utils/Util.js index 2b49ab6..efe0dd0 100644 --- a/src/utils/Util.js +++ b/src/utils/Util.js @@ -1,7 +1,5 @@ -import Vector2D from '../math/Vector2D'; import Span from '../math/Span'; import ImgUtil from './ImgUtil'; -import DomUtil from './DomUtil'; export default { @@ -27,7 +25,7 @@ export default { * * @param {Array} value Any array * - * @returns {Boolean} + * @returns {Boolean} */ isArray(value) { return Object.prototype.toString.call(value) === '[object Array]'; @@ -75,8 +73,8 @@ export default { if (!args) return new constructor; args = [null].concat(args); - const factoryFunction = constructor.bind.apply(constructor, args); - return new factoryFunction(); + const FactoryFunc = constructor.bind.apply(constructor, args); + return new FactoryFunc(); }, /** @@ -100,13 +98,13 @@ export default { if (this.hasProp(pOBJ, 'ax')) target.a.x = pOBJ['ax']; if (this.hasProp(pOBJ, 'ay')) target.a.y = pOBJ['ay']; - if (this.hasProp(pOBJ, 'p')) particle.p.copy(pOBJ['p']); - if (this.hasProp(pOBJ, 'v')) particle.v.copy(pOBJ['v']); - if (this.hasProp(pOBJ, 'a')) particle.a.copy(pOBJ['a']); + if (this.hasProp(pOBJ, 'p')) target.p.copy(pOBJ['p']); + if (this.hasProp(pOBJ, 'v')) target.v.copy(pOBJ['v']); + if (this.hasProp(pOBJ, 'a')) target.a.copy(pOBJ['a']); - if (this.hasProp(pOBJ, 'position')) particle.p.copy(pOBJ['position']); - if (this.hasProp(pOBJ, 'velocity')) particle.v.copy(pOBJ['velocity']); - if (this.hasProp(pOBJ, 'accelerate')) particle.a.copy(pOBJ['accelerate']); + if (this.hasProp(pOBJ, 'position')) target.p.copy(pOBJ['position']); + if (this.hasProp(pOBJ, 'velocity')) target.v.copy(pOBJ['velocity']); + if (this.hasProp(pOBJ, 'accelerate')) target.a.copy(pOBJ['accelerate']); }, hasProp(obj, key) { diff --git a/src/utils/WebGLUtil.js b/src/utils/WebGLUtil.js index 9e4af9e..cd89ad6 100644 --- a/src/utils/WebGLUtil.js +++ b/src/utils/WebGLUtil.js @@ -12,7 +12,7 @@ export default { * @return {Boolean} */ ipot(length) { - return (length & (length - 1)) == 0; + return (length & (length - 1)) === 0; }, /** diff --git a/src/zone/CircleZone.js b/src/zone/CircleZone.js index 9ccfc76..12670ec 100644 --- a/src/zone/CircleZone.js +++ b/src/zone/CircleZone.js @@ -32,13 +32,13 @@ export default class CircleZone extends Zone { crossing(particle) { const d = particle.p.distanceTo(this.center); - if (this.crossType == "dead") { + if (this.crossType === 'dead') { if (d - particle.radius > this.radius) particle.dead = true; - } else if (this.crossType == "bound") { + } else if (this.crossType === 'bound') { if (d + particle.radius >= this.radius) this.getSymmetric(particle); - } else if (this.crossType == "cross") { + } else if (this.crossType === 'cross') { if (this.alert) { alert('Sorry CircleZone does not support cross method'); this.alert = false; diff --git a/src/zone/ImageZone.js b/src/zone/ImageZone.js index 8fe9150..9f261ef 100644 --- a/src/zone/ImageZone.js +++ b/src/zone/ImageZone.js @@ -63,14 +63,13 @@ export default class ImageZone extends Zone { } crossing(particle) { - if (this.crossType == "dead") { + if (this.crossType === 'dead') { if (this.getBound(particle.p.x - this.x, particle.p.y - this.y)) particle.dead = true; else particle.dead = false; - } - - else if (this.crossType == "bound") { + } + else if (this.crossType === 'bound') { if (!this.getBound(particle.p.x - this.x, particle.p.y - this.y)) particle.v.negate(); } diff --git a/src/zone/LineZone.js b/src/zone/LineZone.js index 953f814..ee19ac5 100644 --- a/src/zone/LineZone.js +++ b/src/zone/LineZone.js @@ -35,7 +35,6 @@ export default class LineZone extends Zone { this.direction = Util.initValue(direction, '>'); } - getPosition() { this.random = Math.random(); this.vector.x = this.x1 + this.random * this.length * Math.cos(this.gradient); @@ -48,7 +47,7 @@ export default class LineZone extends Zone { const A = this.dy; const B = -this.dx; const C = this.dot; - const D = B == 0 ? 1 : B; + const D = B === 0 ? 1 : B; if ((A * x + B * y + C) * D > 0) return true; @@ -100,8 +99,8 @@ export default class LineZone extends Zone { } crossing(particle) { - if (this.crossType == "dead") { - if (this.direction == ">" || this.direction == "R" || this.direction == "right" || this.direction == "down") { + if (this.crossType === 'dead') { + if (this.direction === '>' || this.direction === 'R' || this.direction === 'right' || this.direction === 'down') { if (!this.rangeOut(particle)) return; if (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true; } else { @@ -110,13 +109,13 @@ export default class LineZone extends Zone { } } - else if (this.crossType == "bound") { + else if (this.crossType === 'bound') { if (!this.rangeOut(particle)) return; if (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) { - if (this.dx == 0) { + if (this.dx === 0) { particle.v.x *= -1; - } else if (this.dy == 0) { + } else if (this.dy === 0) { particle.v.y *= -1; } else { this.getSymmetric(particle.v); @@ -124,12 +123,11 @@ export default class LineZone extends Zone { } } - else if (this.crossType == "cross") { + else if (this.crossType === 'cross') { if (this.alert) { console.error('Sorry lineZone does not support cross method'); this.alert = false; } } } - } \ No newline at end of file diff --git a/src/zone/PointZone.js b/src/zone/PointZone.js index bd080d1..896c0c6 100644 --- a/src/zone/PointZone.js +++ b/src/zone/PointZone.js @@ -4,6 +4,7 @@ export default class PointZone extends Zone { constructor(x, y) { super(); + this.x = x; this.y = y; } @@ -11,12 +12,10 @@ export default class PointZone extends Zone { getPosition() { this.vector.x = this.x; this.vector.y = this.y; - return this.vector; } crossing(particle) { - if (this.alert) { alert('Sorry PointZone does not support crossing method'); this.alert = false; diff --git a/src/zone/RectZone.js b/src/zone/RectZone.js index 0378b7d..e91d0d7 100644 --- a/src/zone/RectZone.js +++ b/src/zone/RectZone.js @@ -19,7 +19,7 @@ export default class RectZone extends Zone { } crossing(particle) { - if (this.crossType == "dead") { + if (this.crossType === 'dead') { if (particle.p.x + particle.radius < this.x) particle.dead = true; else if (particle.p.x - particle.radius > this.x + this.width) @@ -31,7 +31,7 @@ export default class RectZone extends Zone { particle.dead = true; } - else if (this.crossType == "bound") { + else if (this.crossType === 'bound') { if (particle.p.x - particle.radius < this.x) { particle.p.x = this.x + particle.radius; particle.v.x *= -1; @@ -49,7 +49,7 @@ export default class RectZone extends Zone { } } - else if (this.crossType == "cross") { + else if (this.crossType === 'cross') { if (particle.p.x + particle.radius < this.x && particle.v.x <= 0) particle.p.x = this.x + this.width + particle.radius; else if (particle.p.x - particle.radius > this.x + this.width && particle.v.x >= 0) diff --git a/src/zone/Zone.js b/src/zone/Zone.js index 3144935..00ca86c 100644 --- a/src/zone/Zone.js +++ b/src/zone/Zone.js @@ -1,10 +1,11 @@ import Vector2D from '../math/Vector2D'; export default class Zone { + constructor() { this.vector = new Vector2D(0, 0); this.random = 0; - this.crossType = "dead"; + this.crossType = 'dead'; this.alert = true; } @@ -13,4 +14,4 @@ export default class Zone { crossing(particle) { } -} \ No newline at end of file +}