{"version":3,"file":"proton.min.js","sources":["../src/math/MathUtil.js","../src/math/Span.js","../src/utils/WebGLUtil.js","../src/utils/DomUtil.js","../src/utils/ImgUtil.js","../src/utils/Util.js","../src/utils/Puid.js","../src/core/Pool.js","../src/debug/Stats.js","../src/events/EventDispatcher.js","../src/math/Integration.js","../src/core/Proton.js","../src/utils/Rgb.js","../src/math/ease.js","../src/math/Vector2D.js","../src/core/Particle.js","../src/utils/ColorUtil.js","../src/math/Polar2D.js","../src/math/Mat3.js","../src/math/ArraySpan.js","../src/math/Rectangle.js","../src/initialize/Rate.js","../src/initialize/Initialize.js","../src/initialize/Life.js","../src/zone/Zone.js","../src/zone/PointZone.js","../src/initialize/Position.js","../src/initialize/Velocity.js","../src/initialize/Mass.js","../src/initialize/Radius.js","../src/initialize/Body.js","../src/behaviour/Behaviour.js","../src/behaviour/Force.js","../src/behaviour/Attraction.js","../src/behaviour/RandomDrift.js","../src/behaviour/Gravity.js","../src/behaviour/Collision.js","../src/behaviour/CrossZone.js","../src/behaviour/Alpha.js","../src/behaviour/Scale.js","../src/behaviour/Rotate.js","../src/behaviour/Color.js","../src/behaviour/Repulsion.js","../src/behaviour/GravityWell.js","../src/initialize/InitializeUtil.js","../src/emitter/Emitter.js","../src/emitter/BehaviourEmitter.js","../src/emitter/FollowEmitter.js","../src/render/BaseRenderer.js","../src/render/CanvasRenderer.js","../src/render/DomRenderer.js","../src/render/EaselRenderer.js","../src/render/PixelRenderer.js","../src/render/PixiRenderer.js","../src/utils/MStack.js","../src/render/WebGLRenderer.js","../src/render/CustomRenderer.js","../src/zone/LineZone.js","../src/zone/CircleZone.js","../src/zone/RectZone.js","../src/zone/ImageZone.js","../src/debug/Debug.js","../src/index.js"],"sourcesContent":["const PI = 3.1415926;\nconst INFINITY = Infinity;\n\nconst MathUtil = {\n PI: PI,\n PIx2: PI * 2,\n PI_2: PI / 2,\n PI_180: PI / 180,\n N180_PI: 180 / PI,\n Infinity: -999,\n\n isInfinity(num) {\n return num === this.Infinity || num === INFINITY;\n },\n\n randomAToB(a, b, isInt = false) {\n if (!isInt) return a + Math.random() * (b - a);\n else return Math.floor(Math.random() * (b - a)) + a;\n },\n\n randomFloating(center, f, isInt) {\n return this.randomAToB(center - f, center + f, isInt);\n },\n\n randomZone(display) {},\n\n degreeTransform(a) {\n return (a * PI) / 180;\n },\n\n toColor16(num) {\n return `#${num.toString(16)}`;\n },\n\n randomColor() {\n return (\n \"#\" +\n (\"00000\" + ((Math.random() * 0x1000000) << 0).toString(16)).slice(\n -6\n )\n );\n }\n};\n\nexport default MathUtil;\n","import Util from \"../utils/Util\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Span {\n constructor(a, b, center) {\n if (Util.isArray(a)) {\n this.isArray = true;\n this.a = a;\n } else {\n this.isArray = false;\n this.a = Util.initValue(a, 1);\n this.b = Util.initValue(b, this.a);\n this.center = Util.initValue(center, false);\n }\n }\n\n getValue(isInt = false) {\n if (this.isArray) {\n return Util.getRandFromArray(this.a);\n } else {\n if (!this.center) {\n return MathUtil.randomAToB(this.a, this.b, isInt);\n } else {\n return MathUtil.randomFloating(this.a, this.b, isInt);\n }\n }\n }\n\n /**\n * Returns a new Span object\n *\n * @memberof Proton#Proton.Util\n * @method setSpanValue\n *\n * @todo a, b and c should be 'Mixed' or 'Number'?\n *\n * @param {Mixed | Span} a\n * @param {Mixed} b\n * @param {Mixed} c\n *\n * @return {Span}\n */\n static setSpanValue(a, b, c) {\n if (a instanceof Span) {\n return a;\n } else {\n if (b === undefined) {\n return new Span(a);\n } else {\n if (c === undefined) return new Span(a, b);\n else return new Span(a, b, c);\n }\n }\n }\n\n /**\n * Returns the value from a Span, if the param is not a Span it will return the given parameter\n *\n * @memberof Proton#Proton.Util\n * @method getValue\n *\n * @param {Mixed | Span} pan\n *\n * @return {Mixed} the value of Span OR the parameter if it is not a Span\n */\n static getSpanValue(pan) {\n return pan instanceof Span ? pan.getValue() : pan;\n }\n}\n","export default {\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method ipot\n *\n * @todo add description\n * @todo add length description\n *\n * @param {Number} length\n *\n * @return {Boolean}\n */\n ipot(length) {\n return (length & (length - 1)) === 0;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method nhpot\n *\n * @todo add description\n * @todo add length description\n *\n * @param {Number} length\n *\n * @return {Number}\n */\n nhpot(length) {\n --length;\n for (let i = 1; i < 32; i <<= 1) {\n length = length | (length >> i);\n }\n\n return length + 1;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeTranslation\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} tx either 0 or 1\n * @param {Number} ty either 0 or 1\n *\n * @return {Object}\n */\n makeTranslation(tx, ty) {\n return [1, 0, 0, 0, 1, 0, tx, ty, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeRotation\n *\n * @todo add description\n * @todo add return description\n *\n * @param {Number} angleInRadians\n *\n * @return {Object}\n */\n makeRotation(angleInRadians) {\n let c = Math.cos(angleInRadians);\n let s = Math.sin(angleInRadians);\n\n return [c, -s, 0, s, c, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeScale\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} sx either 0 or 1\n * @param {Number} sy either 0 or 1\n *\n * @return {Object}\n */\n makeScale(sx, sy) {\n return [sx, 0, 0, 0, sy, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method matrixMultiply\n *\n * @todo add description\n * @todo add a, b description\n * @todo add return description\n *\n * @param {Object} a\n * @param {Object} b\n *\n * @return {Object}\n */\n matrixMultiply(a, b) {\n let a00 = a[0 * 3 + 0];\n let a01 = a[0 * 3 + 1];\n let a02 = a[0 * 3 + 2];\n let a10 = a[1 * 3 + 0];\n let a11 = a[1 * 3 + 1];\n let a12 = a[1 * 3 + 2];\n let a20 = a[2 * 3 + 0];\n let a21 = a[2 * 3 + 1];\n let a22 = a[2 * 3 + 2];\n let b00 = b[0 * 3 + 0];\n let b01 = b[0 * 3 + 1];\n let b02 = b[0 * 3 + 2];\n let b10 = b[1 * 3 + 0];\n let b11 = b[1 * 3 + 1];\n let b12 = b[1 * 3 + 2];\n let b20 = b[2 * 3 + 0];\n let b21 = b[2 * 3 + 1];\n let b22 = b[2 * 3 + 2];\n\n return [\n a00 * b00 + a01 * b10 + a02 * b20,\n a00 * b01 + a01 * b11 + a02 * b21,\n a00 * b02 + a01 * b12 + a02 * b22,\n a10 * b00 + a11 * b10 + a12 * b20,\n a10 * b01 + a11 * b11 + a12 * b21,\n a10 * b02 + a11 * b12 + a12 * b22,\n a20 * b00 + a21 * b10 + a22 * b20,\n a20 * b01 + a21 * b11 + a22 * b21,\n a20 * b02 + a21 * b12 + a22 * b22\n ];\n }\n};\n","export default {\n /**\n * Creates and returns a new canvas. The opacity is by default set to 0\n *\n * @memberof Proton#Proton.DomUtil\n * @method createCanvas\n *\n * @param {String} $id the canvas' id\n * @param {Number} $width the canvas' width\n * @param {Number} $height the canvas' height\n * @param {String} [$position=absolute] the canvas' position, default is 'absolute'\n *\n * @return {Object}\n */\n createCanvas(id, width, height, position = \"absolute\") {\n const dom = document.createElement(\"canvas\");\n\n dom.id = id;\n dom.width = width;\n dom.height = height;\n dom.style.opacity = 0;\n dom.style.position = position;\n this.transform(dom, -500, -500, 0, 0);\n\n return dom;\n },\n\n createDiv(id, width, height) {\n const dom = document.createElement(\"div\");\n\n dom.id = id;\n dom.style.position = \"absolute\";\n this.resize(dom, width, height);\n\n return dom;\n },\n\n resize(dom, width, height) {\n dom.style.width = width + \"px\";\n dom.style.height = height + \"px\";\n dom.style.marginLeft = -width / 2 + \"px\";\n dom.style.marginTop = -height / 2 + \"px\";\n },\n\n /**\n * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers\n *\n * @memberof Proton#Proton.DomUtil\n * @method transform\n *\n * @param {HTMLDivElement} div\n * @param {Number} $x\n * @param {Number} $y\n * @param {Number} $scale\n * @param {Number} $rotate\n */\n transform(div, x, y, scale, rotate) {\n div.style.willChange = \"transform\";\n const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`;\n this.css3(div, \"transform\", transform);\n },\n\n transform3d(div, x, y, scale, rotate) {\n div.style.willChange = \"transform\";\n const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;\n this.css3(div, \"backfaceVisibility\", \"hidden\");\n this.css3(div, \"transform\", transform);\n },\n\n css3(div, key, val) {\n const bkey = key.charAt(0).toUpperCase() + key.substr(1);\n\n div.style[`Webkit${bkey}`] = val;\n div.style[`Moz${bkey}`] = val;\n div.style[`O${bkey}`] = val;\n div.style[`ms${bkey}`] = val;\n div.style[`${key}`] = val;\n }\n};\n","import WebGLUtil from \"./WebGLUtil\";\nimport DomUtil from \"./DomUtil\";\n\nconst imgsCache = {};\nconst canvasCache = {};\nlet canvasId = 0;\n\nexport default {\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n context.drawImage(image, rect.x, rect.y);\n const imagedata = context.getImageData(\n rect.x,\n rect.y,\n rect.width,\n rect.height\n );\n context.clearRect(rect.x, rect.y, rect.width, rect.height);\n\n return imagedata;\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method getImgFromCache\n *\n * @todo add description\n * @todo describe func\n *\n * @param {Mixed} img\n * @param {Proton.Particle} particle\n * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.data.canvas\n * @param {Boolean} func\n */\n getImgFromCache(img, callback, param) {\n const src = typeof img === \"string\" ? img : img.src;\n\n if (imgsCache[src]) {\n callback(imgsCache[src], param);\n } else {\n const image = new Image();\n image.onload = e => {\n imgsCache[src] = e.target;\n callback(imgsCache[src], param);\n };\n\n image.src = src;\n }\n },\n\n getCanvasFromCache(img, callback, param) {\n const src = img.src;\n\n if (!canvasCache[src]) {\n const width = WebGLUtil.nhpot(img.width);\n const height = WebGLUtil.nhpot(img.height);\n\n const canvas = DomUtil.createCanvas(\n `proton_canvas_cache_${++canvasId}`,\n width,\n height\n );\n const context = canvas.getContext(\"2d\");\n context.drawImage(img, 0, 0, img.width, img.height);\n\n canvasCache[src] = canvas;\n }\n\n callback && callback(canvasCache[src], param);\n\n return canvasCache[src];\n }\n};\n","import Span from \"../math/Span\";\nimport ImgUtil from \"./ImgUtil\";\n\nexport default {\n /**\n * Returns the default if the value is null or undefined\n *\n * @memberof Proton#Proton.Util\n * @method initValue\n *\n * @param {Mixed} value a specific value, could be everything but null or undefined\n * @param {Mixed} defaults the default if the value is null or undefined\n */\n initValue(value, defaults) {\n value = value !== null && value !== undefined ? value : defaults;\n return value;\n },\n\n /**\n * Checks if the value is a valid array\n *\n * @memberof Proton#Proton.Util\n * @method isArray\n *\n * @param {Array} value Any array\n *\n * @returns {Boolean}\n */\n isArray(value) {\n return Object.prototype.toString.call(value) === \"[object Array]\";\n },\n\n /**\n * Destroyes the given array\n *\n * @memberof Proton#Proton.Util\n * @method emptyArray\n *\n * @param {Array} array Any array\n */\n emptyArray(arr) {\n if (arr) arr.length = 0;\n },\n\n toArray(arr) {\n return this.isArray(arr) ? arr : [arr];\n },\n\n getRandFromArray(arr) {\n if (!arr) return null;\n return arr[Math.floor(arr.length * Math.random())];\n },\n\n /**\n * Destroyes the given object\n *\n * @memberof Proton#Proton.Util\n * @method emptyObject\n *\n * @param {Object} obj Any object\n */\n emptyObject(obj, ignore = null) {\n for (let key in obj) {\n if (ignore && ignore.indexOf(key) > -1) continue;\n delete obj[key];\n }\n },\n\n /**\n * Makes an instance of a class and binds the given array\n *\n * @memberof Proton#Proton.Util\n * @method classApply\n *\n * @param {Function} constructor A class to make an instance from\n * @param {Array} [args] Any array to bind it to the constructor\n *\n * @return {Object} The instance of constructor, optionally bind with args\n */\n classApply(constructor, args = null) {\n if (!args) {\n return new constructor();\n } else {\n const FactoryFunc = constructor.bind.apply(\n constructor,\n [null].concat(args)\n );\n return new FactoryFunc();\n }\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method setVectorVal\n *\n * @todo add description for param `target`\n * @todo add description for param `conf`\n * @todo add description for function\n *\n * @param {Object} target\n * @param {Object} conf\n */\n setVectorVal(particle, conf = null) {\n if (!conf) return;\n\n if (this.hasProp(conf, \"x\")) particle.p.x = conf[\"x\"];\n if (this.hasProp(conf, \"y\")) particle.p.y = conf[\"y\"];\n\n if (this.hasProp(conf, \"vx\")) particle.v.x = conf[\"vx\"];\n if (this.hasProp(conf, \"vy\")) particle.v.y = conf[\"vy\"];\n\n if (this.hasProp(conf, \"ax\")) particle.a.x = conf[\"ax\"];\n if (this.hasProp(conf, \"ay\")) particle.a.y = conf[\"ay\"];\n\n if (this.hasProp(conf, \"p\")) particle.p.copy(conf[\"p\"]);\n if (this.hasProp(conf, \"v\")) particle.v.copy(conf[\"v\"]);\n if (this.hasProp(conf, \"a\")) particle.a.copy(conf[\"a\"]);\n\n if (this.hasProp(conf, \"position\")) particle.p.copy(conf[\"position\"]);\n if (this.hasProp(conf, \"velocity\")) particle.v.copy(conf[\"velocity\"]);\n if (this.hasProp(conf, \"accelerate\")) particle.a.copy(conf[\"accelerate\"]);\n },\n\n hasProp(target, key) {\n if (!target) return false;\n return target[key] !== undefined;\n // return obj.hasOwnProperty(key);\n },\n\n /**\n * set the prototype in a given prototypeObject\n *\n * @memberof Proton#Proton.Util\n * @method setProp\n *\n * @todo add description for param `target`\n * @todo translate desription from chinese to english\n *\n * @param {Object} target\n * @param {Object} prototypeObject An object of single prototypes\n *\n * @return {Object} target\n */\n setProp(target, props) {\n for (let prop in props) {\n if (target.hasOwnProperty(prop)) {\n target[prop] = Span.getSpanValue(props[prop]);\n }\n }\n\n return target;\n },\n\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n return ImgUtil.getImageData(context, image, rect);\n },\n\n destroyAll(arr, param = null) {\n let i = arr.length;\n\n while (i--) {\n try {\n arr[i].destroy(param);\n } catch (e) {}\n\n delete arr[i];\n }\n\n arr.length = 0;\n }\n};\n","const idsMap = {};\n\nconst Puid = {\n _index: 0,\n _cache: {},\n\n id(type) {\n if (idsMap[type] === undefined || idsMap[type] === null) idsMap[type] = 0;\n return `${type}_${idsMap[type]++}`;\n },\n\n getId(target) {\n let uid = this.getIdFromCache(target);\n if (uid) return uid;\n\n uid = `PUID_${this._index++}`;\n this._cache[uid] = target;\n\n return uid;\n },\n\n getIdFromCache(target) {\n let obj, id;\n\n for (id in this._cache) {\n obj = this._cache[id];\n\n if (obj === target) return id;\n if (this.isBody(obj, target) && obj.src === target.src) return id;\n }\n\n return null;\n },\n\n isBody(obj, target) {\n return (\n typeof obj === \"object\" &&\n typeof target === \"object\" &&\n obj.isInner &&\n target.isInner\n );\n },\n\n getTarget(uid) {\n return this._cache[uid];\n }\n};\n\nexport default Puid;\n","/**\n * Pool is the cache pool of the proton engine, it is very important.\n *\n * get(target, params, uid)\n * Class\n * uid = Puid.getId -> Puid save target cache\n * target.__puid = uid\n *\n * body\n * uid = Puid.getId -> Puid save target cache\n *\n *\n * expire(target)\n * cache[target.__puid] push target\n *\n */\nimport Util from \"../utils/Util\";\nimport Puid from \"../utils/Puid\";\n\nexport default class Pool {\n /**\n * @memberof! Proton#\n * @constructor\n * @alias Proton.Pool\n *\n * @todo add description\n * @todo add description of properties\n *\n * @property {Number} total\n * @property {Object} cache\n */\n constructor(num) {\n this.total = 0;\n this.cache = {};\n }\n\n /**\n * @todo add description\n *\n * @method get\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n get(target, params, uid) {\n let p;\n uid = uid || target.__puid || Puid.getId(target);\n\n if (this.cache[uid] && this.cache[uid].length > 0) {\n p = this.cache[uid].pop();\n } else {\n p = this.createOrClone(target, params);\n }\n\n p.__puid = target.__puid || uid;\n return p;\n }\n\n /**\n * @todo add description\n *\n * @method set\n * @memberof Proton#Proton.Pool\n *\n * @param {Object} target\n *\n * @return {Object}\n */\n expire(target) {\n return this.getCache(target.__puid).push(target);\n }\n\n /**\n * Creates a new class instance\n *\n * @todo add more documentation\n *\n * @method create\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target any Object or Function\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n createOrClone(target, params) {\n this.total++;\n\n if (this.create) {\n return this.create(target, params);\n } else if (typeof target === \"function\") {\n return Util.classApply(target, params);\n } else {\n return target.clone();\n }\n }\n\n /**\n * @todo add description - what is in the cache?\n *\n * @method getCount\n * @memberof Proton#Proton.Pool\n *\n * @return {Number}\n */\n getCount() {\n let count = 0;\n for (let id in this.cache) count += this.cache[id].length;\n return count++;\n }\n\n /**\n * Destroyes all items from Pool.cache\n *\n * @method destroy\n * @memberof Proton#Proton.Pool\n */\n destroy() {\n for (let id in this.cache) {\n this.cache[id].length = 0;\n delete this.cache[id];\n }\n }\n\n /**\n * Returns Pool.cache\n *\n * @method getCache\n * @memberof Proton#Proton.Pool\n * @private\n *\n * @param {Number} uid the unique id\n *\n * @return {Object}\n */\n getCache(uid = \"default\") {\n if (!this.cache[uid]) this.cache[uid] = [];\n return this.cache[uid];\n }\n}\n","export default class Stats {\n constructor(proton) {\n this.proton = proton;\n this.container = null;\n this.type = 1;\n\n this.emitterIndex = 0;\n this.rendererIndex = 0;\n }\n\n update(style, body) {\n this.add(style, body);\n\n const emitter = this.getEmitter();\n const renderer = this.getRenderer();\n let str = \"\";\n\n switch (this.type) {\n case 2:\n str += \"emitter:\" + this.proton.emitters.length + \"
\";\n if (emitter) str += \"em speed:\" + emitter.emitSpeed + \"
\";\n if (emitter) str += \"pos:\" + this.getEmitterPos(emitter);\n break;\n\n case 3:\n if (emitter)\n str += \"initializes:\" + emitter.initializes.length + \"
\";\n if (emitter)\n str +=\n '' +\n this.concatArr(emitter.initializes) +\n \"
\";\n if (emitter) str += \"behaviours:\" + emitter.behaviours.length + \"
\";\n if (emitter)\n str +=\n '' +\n this.concatArr(emitter.behaviours) +\n \"
\";\n break;\n\n case 4:\n if (renderer) str += renderer.name + \"
\";\n if (renderer) str += \"body:\" + this.getCreatedNumber(renderer) + \"
\";\n break;\n\n default:\n str += \"particles:\" + this.proton.getCount() + \"
\";\n str += \"pool:\" + this.proton.pool.getCount() + \"
\";\n str += \"total:\" + this.proton.pool.total;\n }\n\n this.container.innerHTML = str;\n }\n\n add(style, body) {\n if (!this.container) {\n this.type = 1;\n\n this.container = document.createElement(\"div\");\n this.container.style.cssText = [\n \"position:absolute;bottom:0px;left:0;cursor:pointer;\",\n \"opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;\",\n \"width:120px;height:50px;background-color:#002;color:#0ff;\"\n ].join(\"\");\n\n this.container.addEventListener(\n \"click\",\n e => {\n this.type++;\n if (this.type > 4) this.type = 1;\n },\n false\n );\n\n let bg, color;\n switch (style) {\n case 2:\n bg = \"#201\";\n color = \"#f08\";\n break;\n\n case 3:\n bg = \"#020\";\n color = \"#0f0\";\n break;\n\n default:\n bg = \"#002\";\n color = \"#0ff\";\n }\n\n this.container.style[\"background-color\"] = bg;\n this.container.style[\"color\"] = color;\n }\n\n if (!this.container.parentNode) {\n body = body || this.body || document.body;\n body.appendChild(this.container);\n }\n }\n\n getEmitter() {\n return this.proton.emitters[this.emitterIndex];\n }\n\n getRenderer() {\n return this.proton.renderers[this.rendererIndex];\n }\n\n concatArr(arr) {\n let result = \"\";\n if (!arr || !arr.length) return result;\n\n for (let i = 0; i < arr.length; i++) {\n result += (arr[i].name || \"\").substr(0, 1) + \".\";\n }\n\n return result;\n }\n\n getCreatedNumber(renderer) {\n return renderer.pool.total || (renderer.cpool && renderer.cpool.total) || 0;\n }\n\n getEmitterPos(e) {\n return Math.round(e.p.x) + \",\" + Math.round(e.p.y);\n }\n}\n","/*\n * EventDispatcher\n * This code reference since http://createjs.com/.\n *\n **/\n\nexport default class EventDispatcher {\n constructor() {\n this._listeners = null;\n }\n\n static bind(target) {\n target.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent;\n\n target.prototype.hasEventListener =\n EventDispatcher.prototype.hasEventListener;\n\n target.prototype.addEventListener =\n EventDispatcher.prototype.addEventListener;\n\n target.prototype.removeEventListener =\n EventDispatcher.prototype.removeEventListener;\n\n target.prototype.removeAllEventListeners =\n EventDispatcher.prototype.removeAllEventListeners;\n }\n\n addEventListener(type, listener) {\n if (!this._listeners) {\n this._listeners = {};\n } else {\n this.removeEventListener(type, listener);\n }\n\n if (!this._listeners[type]) this._listeners[type] = [];\n this._listeners[type].push(listener);\n\n return listener;\n }\n\n removeEventListener(type, listener) {\n if (!this._listeners) return;\n if (!this._listeners[type]) return;\n\n const arr = this._listeners[type];\n const length = arr.length;\n\n for (let i = 0; i < length; i++) {\n if (arr[i] === listener) {\n if (length === 1) {\n delete this._listeners[type];\n }\n\n // allows for faster checks.\n else {\n arr.splice(i, 1);\n }\n\n break;\n }\n }\n }\n\n removeAllEventListeners(type) {\n if (!type) this._listeners = null;\n else if (this._listeners) delete this._listeners[type];\n }\n\n dispatchEvent(type, args) {\n let result = false;\n const listeners = this._listeners;\n\n if (type && listeners) {\n let arr = listeners[type];\n if (!arr) return result;\n\n // arr = arr.slice();\n // to avoid issues with items being removed or added during the dispatch\n\n let handler;\n let i = arr.length;\n while (i--) {\n handler = arr[i];\n result = result || handler(args);\n }\n }\n\n return !!result;\n }\n\n hasEventListener(type) {\n const listeners = this._listeners;\n return !!(listeners && listeners[type]);\n }\n}\n","export default class Integration {\n constructor(type) {\n this.type = type;\n }\n\n calculate(particles, time, damping) {\n this.eulerIntegrate(particles, time, damping);\n }\n\n // Euler Integrate\n // https://rosettacode.org/wiki/Euler_method\n eulerIntegrate(particle, time, damping) {\n if (!particle.sleep) {\n particle.old.p.copy(particle.p);\n particle.old.v.copy(particle.v);\n\n particle.a.multiplyScalar(1 / particle.mass);\n particle.v.add(particle.a.multiplyScalar(time));\n particle.p.add(particle.old.v.multiplyScalar(time));\n\n if (damping) particle.v.multiplyScalar(damping);\n\n particle.a.clear();\n }\n }\n}\n","import Pool from \"./Pool\";\nimport Util from \"../utils/Util\";\nimport Stats from \"../debug/Stats\";\nimport EventDispatcher from \"../events/EventDispatcher\";\nimport Integration from \"../math/Integration\";\n\nexport default class Proton {\n static USE_CLOCK = false;\n\n // 1:100\n static MEASURE = 100;\n static EULER = \"euler\";\n static RK2 = \"runge-kutta2\";\n\n static PARTICLE_CREATED = \"PARTICLE_CREATED\";\n static PARTICLE_UPDATE = \"PARTICLE_UPDATE\";\n static PARTICLE_SLEEP = \"PARTICLE_SLEEP\";\n static PARTICLE_DEAD = \"PARTICLE_DEAD\";\n static PROTON_UPDATE = \"PROTON_UPDATE\";\n static PROTON_UPDATE_AFTER = \"PROTON_UPDATE_AFTER\";\n static EMITTER_ADDED = \"EMITTER_ADDED\";\n static EMITTER_REMOVED = \"EMITTER_REMOVED\";\n\n static amendChangeTabsBug = true;\n\n /**\n * The constructor to add emitters\n *\n * @constructor Proton\n *\n * @todo proParticleCount is not in use\n * @todo add more documentation of the single properties and parameters\n *\n * @param {Number} [proParticleCount] not in use?\n * @param {Number} [integrationType=Proton.EULER]\n *\n * @property {String} [integrationType=Proton.EULER]\n * @property {Array} emitters All added emitter\n * @property {Array} renderers All added renderer\n * @property {Number} time The active time\n * @property {Number} oldtime The old time\n */\n constructor(integrationType) {\n this.emitters = [];\n this.renderers = [];\n\n this.time = 0;\n this.oldTime = 0;\n this.elapsed = 0;\n\n this.stats = new Stats(this);\n this.pool = new Pool(80);\n\n this.integrationType = Util.initValue(integrationType, Proton.EULER);\n this.integrator = new Integration(this.integrationType);\n }\n\n /**\n * add a type of Renderer\n *\n * @method addRenderer\n * @memberof Proton\n * @instance\n *\n * @param {Renderer} render\n */\n addRenderer(render) {\n render.init(this);\n this.renderers.push(render);\n }\n\n /**\n * @name add a type of Renderer\n *\n * @method addRenderer\n * @param {Renderer} render\n */\n removeRenderer(render) {\n const index = this.renderers.indexOf(render);\n this.renderers.splice(index, 1);\n render.remove(this);\n }\n\n /**\n * add the Emitter\n *\n * @method addEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Emitter} emitter\n */\n addEmitter(emitter) {\n this.emitters.push(emitter);\n emitter.parent = this;\n\n this.dispatchEvent(Proton.EMITTER_ADDED, emitter);\n }\n\n /**\n * Removes an Emitter\n *\n * @method removeEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Proton.Emitter} emitter\n */\n removeEmitter(emitter) {\n const index = this.emitters.indexOf(emitter);\n this.emitters.splice(index, 1);\n emitter.parent = null;\n\n this.dispatchEvent(Proton.EMITTER_REMOVED, emitter);\n }\n\n /**\n * Updates all added emitters\n *\n * @method update\n * @memberof Proton\n * @instance\n */\n update() {\n this.dispatchEvent(Proton.PROTON_UPDATE);\n\n if (Proton.USE_CLOCK) {\n if (!this.oldTime) this.oldTime = new Date().getTime();\n\n let time = new Date().getTime();\n this.elapsed = (time - this.oldTime) / 1000;\n Proton.amendChangeTabsBug && this.amendChangeTabsBug();\n\n this.oldTime = time;\n } else {\n this.elapsed = 0.0167;\n }\n\n // emitter update\n if (this.elapsed > 0) this.emittersUpdate(this.elapsed);\n\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\n }\n\n emittersUpdate(elapsed) {\n let i = this.emitters.length;\n while (i--) this.emitters[i].update(elapsed);\n }\n\n /**\n * @todo add description\n *\n * @method amendChangeTabsBug\n * @memberof Proton\n * @instance\n */\n amendChangeTabsBug() {\n if (this.elapsed > 0.5) {\n this.oldTime = new Date().getTime();\n this.elapsed = 0;\n }\n }\n\n /**\n * Counts all particles from all emitters\n *\n * @method getCount\n * @memberof Proton\n * @instance\n */\n getCount() {\n let total = 0;\n let i = this.emitters.length;\n\n while (i--) total += this.emitters[i].particles.length;\n return total;\n }\n\n getAllParticles() {\n let particles = [];\n let i = this.emitters.length;\n\n while (i--) particles = particles.concat(this.emitters[i].particles);\n return particles;\n }\n\n destroyAllEmitters() {\n Util.destroyAll(this.emitters);\n }\n\n /**\n * Destroys everything related to this Proton instance. This includes all emitters, and all properties\n *\n * @method destroy\n * @memberof Proton\n * @instance\n */\n destroy(remove = false) {\n const destroyOther = () => {\n this.time = 0;\n this.oldTime = 0;\n this.pool.destroy();\n\n Util.destroyAll(this.emitters);\n Util.destroyAll(this.renderers, this.getAllParticles());\n };\n\n if (remove) {\n setTimeout(destroyOther, 200);\n } else {\n destroyOther();\n }\n }\n}\n\nEventDispatcher.bind(Proton);\n","export default class Rgb {\n constructor(r = 255, g = 255, b = 255) {\n this.r = r;\n this.g = g;\n this.b = b;\n }\n\n reset() {\n this.r = 255;\n this.g = 255;\n this.b = 255;\n }\n}\n","import MathUtil from \"./MathUtil\";\n\nexport default {\n easeLinear(value) {\n return value;\n },\n\n easeInQuad(value) {\n return Math.pow(value, 2);\n },\n\n easeOutQuad(value) {\n return -(Math.pow(value - 1, 2) - 1);\n },\n\n easeInOutQuad(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 2);\n\n return -0.5 * ((value -= 2) * value - 2);\n },\n\n easeInCubic(value) {\n return Math.pow(value, 3);\n },\n\n easeOutCubic(value) {\n return Math.pow(value - 1, 3) + 1;\n },\n\n easeInOutCubic(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 3);\n\n return 0.5 * (Math.pow(value - 2, 3) + 2);\n },\n\n easeInQuart(value) {\n return Math.pow(value, 4);\n },\n\n easeOutQuart(value) {\n return -(Math.pow(value - 1, 4) - 1);\n },\n\n easeInOutQuart(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 4);\n\n return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2);\n },\n\n easeInSine(value) {\n return -Math.cos(value * MathUtil.PI_2) + 1;\n },\n\n easeOutSine(value) {\n return Math.sin(value * MathUtil.PI_2);\n },\n\n easeInOutSine(value) {\n return -0.5 * (Math.cos(Math.PI * value) - 1);\n },\n\n easeInExpo(value) {\n return value === 0 ? 0 : Math.pow(2, 10 * (value - 1));\n },\n\n easeOutExpo(value) {\n return value === 1 ? 1 : -Math.pow(2, -10 * value) + 1;\n },\n\n easeInOutExpo(value) {\n if (value === 0) return 0;\n\n if (value === 1) return 1;\n\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(2, 10 * (value - 1));\n\n return 0.5 * (-Math.pow(2, -10 * --value) + 2);\n },\n\n easeInCirc(value) {\n return -(Math.sqrt(1 - value * value) - 1);\n },\n\n easeOutCirc(value) {\n return Math.sqrt(1 - Math.pow(value - 1, 2));\n },\n\n easeInOutCirc(value) {\n if ((value /= 0.5) < 1) return -0.5 * (Math.sqrt(1 - value * value) - 1);\n return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1);\n },\n\n easeInBack(value) {\n let s = 1.70158;\n return value * value * ((s + 1) * value - s);\n },\n\n easeOutBack(value) {\n let s = 1.70158;\n return (value = value - 1) * value * ((s + 1) * value + s) + 1;\n },\n\n easeInOutBack(value) {\n let s = 1.70158;\n if ((value /= 0.5) < 1)\n return 0.5 * (value * value * (((s *= 1.525) + 1) * value - s));\n return 0.5 * ((value -= 2) * value * (((s *= 1.525) + 1) * value + s) + 2);\n },\n\n getEasing(ease) {\n if (typeof ease === \"function\") return ease;\n else return this[ease] || this.easeLinear;\n }\n};\n","import MathUtil from \"../math/MathUtil\";\n\nexport default class Vector2D {\n constructor(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n }\n\n set(x, y) {\n this.x = x;\n this.y = y;\n return this;\n }\n\n setX(x) {\n this.x = x;\n return this;\n }\n\n setY(y) {\n this.y = y;\n return this;\n }\n\n getGradient() {\n if (this.x !== 0) return Math.atan2(this.y, this.x);\n else if (this.y > 0) return MathUtil.PI_2;\n else if (this.y < 0) return -MathUtil.PI_2;\n }\n\n copy(v) {\n this.x = v.x;\n this.y = v.y;\n\n return this;\n }\n\n add(v, w) {\n if (w !== undefined) {\n return this.addVectors(v, w);\n }\n\n this.x += v.x;\n this.y += v.y;\n\n return this;\n }\n\n addXY(a, b) {\n this.x += a;\n this.y += b;\n\n return this;\n }\n\n addVectors(a, b) {\n this.x = a.x + b.x;\n this.y = a.y + b.y;\n\n return this;\n }\n\n sub(v, w) {\n if (w !== undefined) {\n return this.subVectors(v, w);\n }\n\n this.x -= v.x;\n this.y -= v.y;\n\n return this;\n }\n\n subVectors(a, b) {\n this.x = a.x - b.x;\n this.y = a.y - b.y;\n\n return this;\n }\n\n divideScalar(s) {\n if (s !== 0) {\n this.x /= s;\n this.y /= s;\n } else {\n this.set(0, 0);\n }\n\n return this;\n }\n\n multiplyScalar(s) {\n this.x *= s;\n this.y *= s;\n\n return this;\n }\n\n negate() {\n return this.multiplyScalar(-1);\n }\n\n dot(v) {\n return this.x * v.x + this.y * v.y;\n }\n\n lengthSq() {\n return this.x * this.x + this.y * this.y;\n }\n\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n\n normalize() {\n return this.divideScalar(this.length());\n }\n\n distanceTo(v) {\n return Math.sqrt(this.distanceToSquared(v));\n }\n\n rotate(tha) {\n const x = this.x;\n const y = this.y;\n\n this.x = x * Math.cos(tha) + y * Math.sin(tha);\n this.y = -x * Math.sin(tha) + y * Math.cos(tha);\n\n return this;\n }\n\n distanceToSquared(v) {\n const dx = this.x - v.x;\n const dy = this.y - v.y;\n\n return dx * dx + dy * dy;\n }\n\n lerp(v, alpha) {\n this.x += (v.x - this.x) * alpha;\n this.y += (v.y - this.y) * alpha;\n\n return this;\n }\n\n equals(v) {\n return v.x === this.x && v.y === this.y;\n }\n\n clear() {\n this.x = 0.0;\n this.y = 0.0;\n return this;\n }\n\n clone() {\n return new Vector2D(this.x, this.y);\n }\n}\n","import Rgb from \"../utils/Rgb\";\nimport Puid from \"../utils/Puid\";\nimport Util from \"../utils/Util\";\nimport ease from \"../math/ease\";\nimport Vector2D from \"../math/Vector2D\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Particle {\n /**\n * the Particle class\n *\n * @class Proton.Particle\n * @constructor\n * @param {Object} pObj the parameters object;\n * for example {life:3,dead:false}\n */\n constructor(conf) {\n /**\n * The particle's id;\n * @property id\n * @type {string}\n */\n this.name = \"Particle\";\n this.id = Puid.id(this.name);\n this.old = {};\n this.data = {};\n this.behaviours = [];\n\n this.p = new Vector2D();\n this.v = new Vector2D();\n this.a = new Vector2D();\n this.old.p = new Vector2D();\n this.old.v = new Vector2D();\n this.old.a = new Vector2D();\n\n this.rgb = new Rgb();\n this.reset();\n conf && Util.setProp(this, conf);\n }\n\n getDirection() {\n return Math.atan2(this.v.x, -this.v.y) * MathUtil.N180_PI;\n }\n\n reset() {\n this.life = Infinity;\n this.age = 0;\n\n this.dead = false;\n this.sleep = false;\n this.body = null;\n this.sprite = null;\n this.parent = null;\n\n this.energy = 1; // Energy Loss\n this.mass = 1;\n this.radius = 10;\n this.alpha = 1;\n this.scale = 1;\n this.rotation = 0;\n this.color = null;\n\n this.p.set(0, 0);\n this.v.set(0, 0);\n this.a.set(0, 0);\n this.old.p.set(0, 0);\n this.old.v.set(0, 0);\n this.old.a.set(0, 0);\n this.easing = ease.easeLinear;\n\n this.rgb.reset();\n Util.emptyObject(this.data);\n this.removeAllBehaviours();\n\n return this;\n }\n\n update(time, index) {\n if (!this.sleep) {\n this.age += time;\n this.applyBehaviours(time, index);\n }\n\n if (this.age < this.life) {\n const scale = this.easing(this.age / this.life);\n this.energy = Math.max(1 - scale, 0);\n } else {\n this.destroy();\n }\n }\n\n applyBehaviours(time, index) {\n const length = this.behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.behaviours[i] &&\n this.behaviours[i].applyBehaviour(this, time, index);\n }\n }\n\n addBehaviour(behaviour) {\n this.behaviours.push(behaviour);\n\n if (behaviour.hasOwnProperty(\"parents\")) behaviour.parents.push(this);\n behaviour.initialize(this);\n }\n\n addBehaviours(behaviours) {\n const length = behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.addBehaviour(behaviours[i]);\n }\n }\n\n removeBehaviour(behaviour) {\n const index = this.behaviours.indexOf(behaviour);\n\n if (index > -1) {\n const behaviour = this.behaviours.splice(index, 1);\n behaviour.parents = null;\n }\n }\n\n removeAllBehaviours() {\n Util.emptyArray(this.behaviours);\n }\n\n /**\n * Destory this particle\n * @method destroy\n */\n destroy() {\n this.removeAllBehaviours();\n this.energy = 0;\n this.dead = true;\n this.parent = null;\n }\n}\n","export default {\n /**\n * @typedef {Object} rgbObject\n * @property {Number} r red value\n * @property {Number} g green value\n * @property {Number} b blue value\n */\n /**\n * converts a hex value to a rgb object\n *\n * @memberof Proton#Proton.Util\n * @method hexToRgb\n *\n * @param {String} h any hex value, e.g. #000000 or 000000 for black\n *\n * @return {rgbObject}\n */\n hexToRgb(h) {\n const hex16 = h.charAt(0) === \"#\" ? h.substring(1, 7) : h;\n const r = parseInt(hex16.substring(0, 2), 16);\n const g = parseInt(hex16.substring(2, 4), 16);\n const b = parseInt(hex16.substring(4, 6), 16);\n\n return { r, g, b };\n },\n\n /**\n * converts a rgb value to a rgb string\n *\n * @memberof Proton#Proton.Util\n * @method rgbToHex\n *\n * @param {Object | Proton.hexToRgb} rgb a rgb object like in {@link Proton#Proton.}\n *\n * @return {String} rgb()\n */\n rgbToHex(rbg) {\n return `rgb(${rbg.r}, ${rbg.g}, ${rbg.b})`;\n },\n\n getHex16FromParticle(p) {\n return Number(p.rgb.r) * 65536 + Number(p.rgb.g) * 256 + Number(p.rgb.b);\n }\n};\n","import Vector2D from \"./Vector2D\";\n\nexport default class Polar2D {\n constructor(r, tha) {\n this.r = Math.abs(r) || 0;\n this.tha = tha || 0;\n }\n\n set(r, tha) {\n this.r = r;\n this.tha = tha;\n return this;\n }\n\n setR(r) {\n this.r = r;\n return this;\n }\n\n setTha(tha) {\n this.tha = tha;\n return this;\n }\n\n copy(p) {\n this.r = p.r;\n this.tha = p.tha;\n return this;\n }\n\n toVector() {\n return new Vector2D(this.getX(), this.getY());\n }\n\n getX() {\n return this.r * Math.sin(this.tha);\n }\n\n getY() {\n return -this.r * Math.cos(this.tha);\n }\n\n normalize() {\n this.r = 1;\n return this;\n }\n\n equals(v) {\n return v.r === this.r && v.tha === this.tha;\n }\n\n clear() {\n this.r = 0.0;\n this.tha = 0.0;\n return this;\n }\n\n clone() {\n return new Polar2D(this.r, this.tha);\n }\n}\n","const Mat3 = {\n create(mat3) {\n const mat = new Float32Array(9);\n if (mat3) this.set(mat3, mat);\n\n return mat;\n },\n\n set(mat1, mat2) {\n for (let i = 0; i < 9; i++) mat2[i] = mat1[i];\n\n return mat2;\n },\n\n multiply(mat, mat2, mat3) {\n let a00 = mat[0],\n a01 = mat[1],\n a02 = mat[2],\n a10 = mat[3],\n a11 = mat[4],\n a20 = mat[6],\n a21 = mat[7],\n b00 = mat2[0],\n b01 = mat2[1],\n b02 = mat2[2],\n b10 = mat2[3],\n b11 = mat2[4],\n b20 = mat2[6],\n b21 = mat2[7];\n\n mat3[0] = b00 * a00 + b01 * a10;\n mat3[1] = b00 * a01 + b01 * a11;\n mat3[2] = a02 * b02;\n mat3[3] = b10 * a00 + b11 * a10;\n mat3[4] = b10 * a01 + b11 * a11;\n mat3[6] = b20 * a00 + b21 * a10 + a20;\n mat3[7] = b20 * a01 + b21 * a11 + a21;\n\n return mat3;\n },\n\n inverse(mat, mat3) {\n let a00 = mat[0],\n a01 = mat[1],\n a10 = mat[3],\n a11 = mat[4],\n a20 = mat[6],\n a21 = mat[7],\n b01 = a11,\n b11 = -a10,\n b21 = a21 * a10 - a11 * a20,\n d = a00 * b01 + a01 * b11,\n id;\n\n id = 1 / d;\n mat3[0] = b01 * id;\n mat3[1] = -a01 * id;\n mat3[3] = b11 * id;\n mat3[4] = a00 * id;\n mat3[6] = b21 * id;\n mat3[7] = (-a21 * a00 + a01 * a20) * id;\n\n return mat3;\n },\n\n multiplyVec2(m, vec, mat3) {\n let x = vec[0],\n y = vec[1];\n\n mat3[0] = x * m[0] + y * m[3] + m[6];\n mat3[1] = x * m[1] + y * m[4] + m[7];\n\n return mat3;\n }\n};\n\nexport default Mat3;\n","import Span from \"./Span\";\nimport Util from \"../utils/Util\";\nimport MathUtil from \"./MathUtil\";\n\nexport default class ArraySpan extends Span {\n constructor(color) {\n super();\n this._arr = Util.toArray(color);\n }\n\n getValue() {\n const val = Util.getRandFromArray(this._arr);\n return val === \"random\" || val === \"Random\" ? MathUtil.randomColor() : val;\n }\n\n /**\n * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance\n *\n * @method setSpanValue\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n static createArraySpan(arr) {\n if (!arr) return null;\n\n if (arr instanceof ArraySpan) return arr;\n else return new ArraySpan(arr);\n }\n}\n","export default class Rectangle {\n constructor(x, y, w, h) {\n this.x = x;\n this.y = y;\n\n this.width = w;\n this.height = h;\n\n this.bottom = this.y + this.height;\n this.right = this.x + this.width;\n }\n\n contains(x, y) {\n if (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y)\n return true;\n else return false;\n }\n}\n","import Span from \"../math/Span\";\nimport Util from \"../utils/Util\";\n\nexport default class Rate {\n /**\n * The number of particles per second emission (a [particle]/b [s]);\n * @namespace\n * @memberof! Proton#\n * @constructor\n * @alias Rate\n *\n * @param {Array | Number | Span} numpan the number of each emission;\n * @param {Array | Number | Span} timepan the time of each emission;\n * for example: new Rate(new Span(10, 20), new Span(.1, .25));\n */\n constructor(numpan, timepan) {\n this.numPan = Span.setSpanValue(Util.initValue(numpan, 1));\n this.timePan = Span.setSpanValue(Util.initValue(timepan, 1));\n\n this.startTime = 0;\n this.nextTime = 0;\n this.init();\n }\n\n init() {\n this.startTime = 0;\n this.nextTime = this.timePan.getValue();\n }\n\n getValue(time) {\n this.startTime += time;\n\n if (this.startTime >= this.nextTime) {\n this.startTime = 0;\n this.nextTime = this.timePan.getValue();\n\n if (this.numPan.b === 1) {\n if (this.numPan.getValue(false) > 0.5) return 1;\n else return 0;\n } else {\n return this.numPan.getValue(true);\n }\n }\n\n return 0;\n }\n}\n","export default class Initialize {\n reset() {}\n\n init(emitter, particle) {\n if (particle) {\n this.initialize(particle);\n } else {\n this.initialize(emitter);\n }\n }\n\n // sub class init\n initialize(target) {}\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Life extends Initialize {\n constructor(a, b, c) {\n super();\n\n this.lifePan = Span.setSpanValue(a, b, c);\n this.name = \"Life\";\n }\n\n initialize(target) {\n if (this.lifePan.a === Infinity) target.life = Infinity;\n else target.life = this.lifePan.getValue();\n }\n}\n","import Vector2D from \"../math/Vector2D\";\n\nexport default class Zone {\n constructor() {\n this.vector = new Vector2D(0, 0);\n this.random = 0;\n this.crossType = \"dead\";\n this.alert = true;\n }\n\n getPosition() {}\n\n crossing(particle) {}\n}\n","import Zone from \"./Zone\";\n\nexport default class PointZone extends Zone {\n constructor(x, y) {\n super();\n\n this.x = x;\n this.y = y;\n }\n\n getPosition() {\n this.vector.x = this.x;\n this.vector.y = this.y;\n\n return this.vector;\n }\n\n crossing(particle) {\n if (this.alert) {\n console.error(\"Sorry, PointZone does not support crossing method!\");\n this.alert = false;\n }\n }\n}\n","import Util from \"../utils/Util\";\nimport PointZone from \"../zone/PointZone\";\nimport Initialize from \"./Initialize\";\n\nexport default class Position extends Initialize {\n constructor(zone) {\n super();\n this.zone = Util.initValue(zone, new PointZone());\n this.name = \"Position\";\n }\n\n reset(zone) {\n this.zone = Util.initValue(zone, new PointZone());\n }\n\n initialize(target) {\n this.zone.getPosition();\n\t\n target.p.x = this.zone.vector.x;\n target.p.y = this.zone.vector.y;\n }\n}\n","import Proton from \"../core/Proton\";\nimport Span from \"../math/Span\";\nimport Util from \"../utils/Util\";\nimport Initialize from \"./Initialize\";\nimport Polar2D from \"../math/Polar2D\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Velocity extends Initialize {\n constructor(rpan, thapan, type) {\n super();\n\n this.rPan = Span.setSpanValue(rpan);\n this.thaPan = Span.setSpanValue(thapan);\n this.type = Util.initValue(type, \"vector\");\n\n this.name = \"Velocity\";\n }\n\n reset(rpan, thapan, type) {\n this.rPan = Span.setSpanValue(rpan);\n this.thaPan = Span.setSpanValue(thapan);\n this.type = Util.initValue(type, \"vector\");\n }\n\n normalizeVelocity(vr) {\n return vr * Proton.MEASURE;\n }\n\n initialize(target) {\n if (this.type === \"p\" || this.type === \"P\" || this.type === \"polar\") {\n const polar2d = new Polar2D(\n this.normalizeVelocity(this.rPan.getValue()),\n this.thaPan.getValue() * MathUtil.PI_180\n );\n\n target.v.x = polar2d.getX();\n target.v.y = polar2d.getY();\n } else {\n target.v.x = this.normalizeVelocity(this.rPan.getValue());\n target.v.y = this.normalizeVelocity(this.thaPan.getValue());\n }\n }\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Mass extends Initialize {\n constructor(a, b, c) {\n super();\n this.massPan = Span.setSpanValue(a, b, c);\n this.name = \"Mass\";\n }\n\n initialize(target) {\n target.mass = this.massPan.getValue();\n }\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Radius extends Initialize {\n constructor(a, b, c) {\n super();\n this.radius = Span.setSpanValue(a, b, c);\n\n this.name = \"Radius\";\n }\n\n reset(a, b, c) {\n this.radius = Span.setSpanValue(a, b, c);\n }\n\n initialize(particle) {\n particle.radius = this.radius.getValue();\n particle.data.oldRadius = particle.radius;\n }\n}\n","import Util from \"../utils/Util\";\nimport ArraySpan from \"../math/ArraySpan\";\nimport Initialize from \"./Initialize\";\n\nexport default class Body extends Initialize {\n constructor(image, w, h) {\n super();\n\n this.image = this.setSpanValue(image);\n this.w = Util.initValue(w, 20);\n this.h = Util.initValue(h, this.w);\n this.name = \"Body\";\n }\n\n initialize(particle) {\n const imageTarget = this.image.getValue();\n\n if (typeof imageTarget === \"string\") {\n particle.body = {\n width: this.w,\n height: this.h,\n src: imageTarget,\n isInner: true,\n inner: true\n };\n } else {\n particle.body = imageTarget;\n }\n }\n\n setSpanValue(image) {\n return image instanceof ArraySpan ? image : new ArraySpan(image);\n }\n}\n","import Proton from '../core/Proton';\nimport Util from '../utils/Util';\nimport ease from '../math/ease';\n\nexport default class Behaviour {\n static id = 0;\n\n /**\n * The Behaviour class is the base for the other Behaviour\n *\n * @memberof! -\n * @interface\n * @alias Proton.Behaviour\n *\n * @param {Number} life \tthe behaviours life\n * @param {String} easing \tThe behaviour's decaying trend, for example ease.easeOutQuart\n *\n * @property {String} id \t\tThe behaviours id\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n * @property {Number} age=0 \tHow long the particle should be 'alife'\n * @property {Number} energy=1\n * @property {Boolean} dead=false The particle is dead at first\n * @property {Array} parents \tThe behaviour's parents array\n * @property {String} name \tThe behaviour name\n */\n constructor(life, easing) {\n\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n\n this.age = 0;\n this.energy = 1;\n this.dead = false;\n this.parents = [];\n\n this.id = `Behaviour_${Behaviour.id++}`;\n this.name = 'Behaviour';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(life, easing) {\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n }\n\n /**\n * Normalize a force by 1:100;\n *\n * @method normalizeForce\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Vector2D} force\n */\n normalizeForce(force) {\n return force.multiplyScalar(Proton.MEASURE);\n }\n\n /**\n * Normalize a value by 1:100;\n *\n * @method normalizeValue\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} value\n */\n normalizeValue(value) {\n return value * Proton.MEASURE;\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {}\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n calculate(particle, time, index) {\n this.age += time;\n\n if (this.age >= this.life || this.dead) {\n this.energy = 0;\n this.dead = true;\n this.destroy();\n } else {\n const scale = this.easing(particle.age / particle.life);\n this.energy = Math.max(1 - scale, 0);\n }\n }\n\n /**\n * Destory this behaviour\n *\n * @method destroy\n * @memberof Proton.Behaviour\n * @instance\n */\n destroy() {\n let i = this.parents.length;\n while (i--) {\n this.parents[i].removeBehaviour(this);\n }\n\n this.parents.length = 0;\n }\n}\n","import Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Force extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Force\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(fx, fy, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\t\tthis.name = 'Force';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(fx, fy, life, easing) {\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.a.add(this.force);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Attraction extends Behaviour {\n\n\t/**\n\t * This behaviour let the particles follow one specific Proton.Vector2D\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Attraction\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Proton.Vector2D} targetPosition\n\t * @property {Number} radius\n\t * @property {Number} force\n\t * @property {Number} radiusSq\n\t * @property {Proton.Vector2D} attractionForce\n\t * @property {Number} lengthSq\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tthis.name = 'Attraction';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Attraction\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Attraction\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tthis.attractionForce.copy(this.targetPosition);\n\t\tthis.attractionForce.sub(particle.p);\n\t\tthis.lengthSq = this.attractionForce.lengthSq();\n\n\t\tif (this.lengthSq > 0.000004 && this.lengthSq < this.radiusSq) {\n\t\t\tthis.attractionForce.normalize();\n\t\t\tthis.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\n\t\t\tthis.attractionForce.multiplyScalar(this.force);\n\n\t\t\tparticle.a.add(this.attractionForce);\n\t\t}\n\t}\n}","import Vector2D from \"../math/Vector2D\";\nimport MathUtil from \"../math/MathUtil\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class RandomDrift extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Behaviour\n * @constructor\n * @alias RandomDrift\n *\n * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n * @param {Number} delay \t\t\t\tHow much delay the drift should have\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {Number} time The time of the drift\n * @property {String} name The Behaviour name\n */\n constructor(driftX, driftY, delay, life, easing) {\n super(life, easing);\n\n this.reset(driftX, driftY, delay);\n this.time = 0;\n this.name = \"RandomDrift\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#RandomDrift\n * @instance\n *\n * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n * @param {Number} delay \t\t\t\tHow much delay the drift should have\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(driftX, driftY, delay, life, easing) {\n this.panFoce = new Vector2D(driftX, driftY);\n this.panFoce = this.normalizeForce(this.panFoce);\n this.delay = delay;\n\n life && super.reset(life, easing);\n }\n\n initialize(particle) {\n particle.data.time = 0;\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#RandomDrift\n * @instance\n *\n * @param {Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n particle.data.time += time;\n\n if (particle.data.time >= this.delay) {\n particle.a.addXY(\n MathUtil.randomAToB(-this.panFoce.x, this.panFoce.x),\n MathUtil.randomAToB(-this.panFoce.y, this.panFoce.y)\n );\n\n particle.data.time = 0;\n }\n }\n}\n","import Force from './Force';\n\nexport default class Gravity extends Force {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Force\n\t * @constructor\n\t * @alias Proton.Gravity\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(g, life, easing) {\n\t\tsuper(0, g, life, easing);\n\t\tthis.name = 'Gravity';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Gravity\n\t * @instance\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(g, life, easing) {\n\t\tsuper.reset(0, g, life, easing);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Collision extends Behaviour {\n\n\t/**\n\t * The callback after collision\n\t *\n\t * @callback Callback\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Proton.Paritcle} otherParticle\n\t */\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Collision\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(emitter, mass, callback, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(emitter, mass, callback);\n\t\tthis.name = 'Collision';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method reset\n\t * @instance\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} \t\t\t[life=Infinity] \tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(emitter, mass, callback, life, easing) {\n\t\tthis.emitter = Util.initValue(emitter, null);\n\t\tthis.mass = Util.initValue(mass, true);\n\t\tthis.callback = Util.initValue(callback, null);\n\n\t\tthis.collisionPool = [];\n\t\tthis.delta = new Vector2D();\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tconst newPool = this.emitter ? this.emitter.particles.slice(index) : this.pool.slice(index);\n\t\tconst length = newPool.length;\n\n\t\tlet otherParticle;\n\t\tlet lengthSq;\n\t\tlet overlap;\n\t\tlet totalMass;\n\t\tlet averageMass1, averageMass2;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\totherParticle = newPool[i];\n\n\t\t\tif (otherParticle !== particle) {\n\t\t\t\tthis.delta.copy(otherParticle.p);\n\t\t\t\tthis.delta.sub(particle.p);\n\n\t\t\t\tlengthSq = this.delta.lengthSq();\n\t\t\t\tconst distance = particle.radius + otherParticle.radius;\n\n\t\t\t\tif (lengthSq <= distance * distance) {\n\t\t\t\t\toverlap = distance - Math.sqrt(lengthSq);\n\t\t\t\t\toverlap += 0.5;\n\n\t\t\t\t\ttotalMass = particle.mass + otherParticle.mass;\n\t\t\t\t\taverageMass1 = this.mass ? otherParticle.mass / totalMass : 0.5;\n\t\t\t\t\taverageMass2 = this.mass ? particle.mass / totalMass : 0.5;\n\n\t\t\t\t\tparticle.p.add(this.delta.clone().normalize().multiplyScalar(overlap * -averageMass1));\n\t\t\t\t\totherParticle.p.add(this.delta.normalize().multiplyScalar(overlap * averageMass2));\n\n\t\t\t\t\tthis.callback && this.callback(particle, otherParticle);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class CrossZone extends Behaviour {\n\n /**\n * Defines what happens if the particles come to the end of the specified zone\n *\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.CrossZone\n *\n * @param {Proton.Zone} zone \t\t\t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \t\t\twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \t\t\tthis behaviour's life\n * @param {String} \t\t[easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(zone, crossType, life, easing) {\n super(life, easing);\n\n this.reset(zone, crossType);\n this.name = 'CrossZone';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Zone} zone \t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \tthis behaviour's life\n * @param {String} \t\t[easing=easeLinear]\tthis behaviour's easing\n */\n reset(zone, crossType, life, easing) {\n this.zone = zone;\n this.zone.crossType = Util.initValue(crossType, 'dead');\n\n life && super.reset(life, easing);\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n this.zone.crossing(particle);\n };\n}","import Util from \"../utils/Util\";\nimport Span from \"../math/Span\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Alpha extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Alpha\n *\n * @todo add description for 'a' and 'b'\n *\n * @param {Number} a\n * @param {String} b\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = \"Alpha\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @todo add description for 'a' and 'b'\n *\n * @param {Number} a\n * @param {String} b\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.same = b === null || b === undefined ? true : false;\n this.a = Span.setSpanValue(Util.initValue(a, 1));\n this.b = Span.setSpanValue(b);\n\n life && super.reset(life, easing);\n }\n\n /**\n * Sets the new alpha value of the particle\n *\n * @method initialize\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @param {Proton.Particle} particle A single Proton generated particle\n */\n initialize(particle) {\n particle.data.alphaA = this.a.getValue();\n\n if (this.same) particle.data.alphaB = particle.data.alphaA;\n else particle.data.alphaB = this.b.getValue();\n }\n\n /**\n * @method applyBehaviour\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n\tthis.calculate(particle, time, index);\n\t\n particle.alpha =\n particle.data.alphaB +\n\t (particle.data.alphaA - particle.data.alphaB) * this.energy;\n\t \n if (particle.alpha < 0.001) particle.alpha = 0;\n }\n}\n","import Span from \"../math/Span\";\nimport Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Scale extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Scale\n\t *\n\t * @todo add description for 'a' and 'b'\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(a, b, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(a, b);\n\t\tthis.name = 'Scale';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\t\tthis.a = Span.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Span.setSpanValue(b);\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.data.scaleA = this.a.getValue();\n\t\tparticle.data.oldRadius = particle.radius;\n\t\tparticle.data.scaleB = this.same ? particle.data.scaleA : this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.scale = particle.data.scaleB + (particle.data.scaleA - particle.data.scaleB) * this.energy;\n\n\t\tif (particle.scale < 0.0001) particle.scale = 0;\n\t\tparticle.radius = particle.data.oldRadius * particle.scale;\n\t}\n}","import Span from \"../math/Span\";\nimport Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Rotate extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Rotate\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} [influence=Velocity] The rotation's influence\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(influence, b, style, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(influence, b, style);\n\t\tthis.name = 'Rotate';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} a\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, style, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\n\t\tthis.a = Span.setSpanValue(Util.initValue(a, 'Velocity'));\n\t\tthis.b = Span.setSpanValue(Util.initValue(b, 0));\n\t\tthis.style = Util.initValue(style, 'to');\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.rotation = this.a.getValue();\n\t\tparticle.data.rotationA = this.a.getValue();\n\n\t\tif (!this.same) particle.data.rotationB = this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tif (!this.same) {\n\t\t\tif (this.style === 'to' || this.style === 'TO' || this.style === '_') {\n\t\t\t\tparticle.rotation += particle.data.rotationB + (particle.data.rotationA - particle.data.rotationB) * this.energy\n\t\t\t} else {\n\t\t\t\tparticle.rotation += particle.data.rotationB;\n\t\t\t}\n\t\t} else if (this.a.a === 'V' || this.a.a === 'Velocity' || this.a.a === 'v') {\n\t\t\t// beta...\n\t\t\tparticle.rotation = particle.getDirection();\n\t\t}\n\t}\n\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport ArraySpan from \"../math/ArraySpan\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Color extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Color\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = \"Color\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.a = ArraySpan.createArraySpan(a);\n this.b = ArraySpan.createArraySpan(b);\n life && super.reset(life, easing);\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {\n particle.color = this.a.getValue();\n particle.data.colorA = ColorUtil.hexToRgb(particle.color);\n\n if (this.b) particle.data.colorB = ColorUtil.hexToRgb(this.b.getValue());\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n if (this.b) {\n this.calculate(particle, time, index);\n\n particle.rgb.r =\n particle.data.colorB.r +\n (particle.data.colorA.r - particle.data.colorB.r) * this.energy;\n particle.rgb.g =\n particle.data.colorB.g +\n (particle.data.colorA.g - particle.data.colorB.g) * this.energy;\n particle.rgb.b =\n particle.data.colorB.b +\n (particle.data.colorA.b - particle.data.colorB.b) * this.energy;\n\n particle.rgb.r = Math.floor(particle.rgb.r);\n particle.rgb.g = Math.floor(particle.rgb.g);\n particle.rgb.b = Math.floor(particle.rgb.b);\n } else {\n particle.rgb.r = particle.data.colorA.r;\n particle.rgb.g = particle.data.colorA.g;\n particle.rgb.b = particle.data.colorA.b;\n }\n }\n}\n","import Attraction from './Attraction';\n\nexport default class Repulsion extends Attraction {\n\n\t/**\n\t * The oppisite of Proton.Attraction - turns the force\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Attraction\n\t * @constructor\n\t * @alias Proton.Repulsion\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Number} force\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(targetPosition, force, radius, life, easing);\n\n\t\tthis.force *= -1;\n\t\tthis.name = 'Repulsion';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Repulsion\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tsuper.reset(targetPosition, force, radius, life, easing);\n\t\tthis.force *= -1;\n\t}\n}\n","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class GravityWell extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Behaviour\n\t * @constructor\n\t * @alias GravityWell\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(centerPoint, force, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.name = 'GravityWell';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t */\n\treset(centerPoint, force, life, easing) {\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tlife && super.reset(life, easing);\n\t};\n\n\t/**\n\t * @inheritdoc\n\t */\n\tinitialize(particle) {\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.distanceVec.set(this.centerPoint.x - particle.p.x, this.centerPoint.y - particle.p.y);\n\t\tconst distanceSq = this.distanceVec.lengthSq();\n\n\t\tif (distanceSq !== 0) {\n\t\t\tconst distance = this.distanceVec.length();\n\t\t\tconst factor = (this.force * time) / (distanceSq * distance);\n\n\t\t\tparticle.v.x += factor * this.distanceVec.x;\n\t\t\tparticle.v.y += factor * this.distanceVec.y;\n\t\t}\n\t}\n}","import Util from \"../utils/Util\";\nimport Initialize from \"./Initialize\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default {\n initialize(emitter, particle, initializes) {\n const length = initializes.length;\n let i;\n\n for (i = 0; i < length; i++) {\n if (initializes[i] instanceof Initialize) {\n initializes[i].init(emitter, particle);\n } else {\n this.init(emitter, particle, initializes[i]);\n }\n }\n\n this.bindEmitter(emitter, particle);\n },\n\n // init\n init(emitter, particle, initialize) {\n Util.setProp(particle, initialize);\n Util.setVectorVal(particle, initialize);\n },\n\n bindEmitter(emitter, particle) {\n if (emitter.bindEmitter) {\n particle.p.add(emitter.p);\n particle.v.add(emitter.v);\n particle.a.add(emitter.a);\n\n particle.v.rotate(MathUtil.degreeTransform(emitter.rotation));\n }\n }\n};\n","import Util from \"../utils/Util\";\nimport Puid from \"../utils/Puid\";\nimport Particle from \"../core/Particle\";\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport Rate from \"../initialize/Rate\";\nimport InitializeUtil from \"../initialize/InitializeUtil\";\n\nexport default class Emitter extends Particle {\n /**\n * You can use this emit particles.\n *\n * It will dispatch follow events:\n * PARTICLE_CREATED\n * PARTICLE_UPDATA\n * PARTICLE_DEAD\n *\n * @class Emitter\n * @constructor\n * @param {Object} conf the parameters object;\n * for example {damping:0.01,bindEmitter:false}\n */\n constructor(conf = {}) {\n super(conf);\n\n this.particles = [];\n this.behaviours = [];\n this.initializes = [];\n\n this.emitTime = 0;\n this.emitSpeed = 0;\n this.totalTime = -1;\n\n /**\n * The friction coefficient for all particle emit by This;\n * @property damping\n * @type {Number}\n * @default 0.006\n */\n this.damping = 0.006;\n\n /**\n * If bindEmitter the particles can bind this emitter's property;\n * @property bindEmitter\n * @type {Boolean}\n * @default true\n */\n this.bindEmitter = true;\n\n /**\n * The number of particles per second emit (a [particle]/b [s]);\n * @property rate\n * @type {Rate}\n * @default Rate(1, .1)\n */\n this.rate = new Rate(1, 0.1);\n\n this.name = \"Emitter\";\n this.id = Puid.id(this.name);\n }\n\n /**\n * start emit particle\n * @method emit\n * @param {Number} emitTime begin emit time;\n * @param {String} life the life of this emitter\n */\n emit(totalTime, life) {\n this.stoped = false;\n this.emitTime = 0;\n this.totalTime = Util.initValue(totalTime, Infinity);\n\n if (life === true || life === \"life\" || life === \"destroy\") {\n this.life = totalTime === \"once\" ? 1 : this.totalTime;\n } else if (!isNaN(life)) {\n this.life = life;\n }\n\n this.rate.init();\n }\n\n /**\n * stop emiting\n * @method stop\n */\n stop() {\n this.totalTime = -1;\n this.emitTime = 0;\n this.stoped = true;\n }\n\n preEmit(time) {\n let oldStoped = this.stoped;\n let oldEmitTime = this.emitTime;\n let oldTotalTime = this.totalTime;\n\n this.stoped = false;\n this.emitTime = 0;\n this.totalTime = time;\n this.rate.init();\n\n const step = 0.0167;\n while (time > step) {\n time -= step;\n this.update(step);\n }\n\n this.stoped = oldStoped;\n this.emitTime = oldEmitTime + Math.max(time, 0);\n this.totalTime = oldTotalTime;\n }\n\n /**\n * remove current all particles\n * @method removeAllParticles\n */\n removeAllParticles() {\n let i = this.particles.length;\n while (i--) this.particles[i].dead = true;\n }\n\n /**\n * add initialize to this emitter\n * @method addSelfInitialize\n */\n addSelfInitialize(initialize) {\n if (initialize[\"init\"]) {\n initialize.init(this);\n } else {\n this.initAll();\n }\n }\n\n /**\n * add the Initialize to particles;\n *\n * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);\n * @method addInitialize\n * @param {Initialize} initialize like this new Radius(1, 12)\n */\n addInitialize(...rest) {\n let i = rest.length;\n while (i--) this.initializes.push(rest[i]);\n }\n\n /**\n * remove the Initialize\n * @method removeInitialize\n * @param {Initialize} initialize a initialize\n */\n removeInitialize(initializer) {\n const index = this.initializes.indexOf(initializer);\n if (index > -1) this.initializes.splice(index, 1);\n }\n\n /**\n * remove all Initializes\n * @method removeInitializers\n */\n removeAllInitializers() {\n Util.emptyArray(this.initializes);\n }\n\n /**\n * add the Behaviour to particles;\n *\n * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);\n * @method addBehaviour\n * @param {Behaviour} behaviour like this new Color('random')\n */\n addBehaviour(...rest) {\n let i = arguments.length;\n while (i--) {\n let behaviour = rest[i];\n this.behaviours.push(behaviour);\n if (behaviour.parents) behaviour.parents.push(this);\n }\n }\n\n /**\n * remove the Behaviour\n * @method removeBehaviour\n * @param {Behaviour} behaviour a behaviour\n */\n removeBehaviour(behaviour) {\n let index = this.behaviours.indexOf(behaviour);\n this.behaviours.splice(index, 1);\n\n if (behaviour.parents) {\n index = behaviour.parents.indexOf(behaviour);\n behaviour.parents.splice(index, 1);\n }\n\n return index;\n }\n\n /**\n * remove all behaviours\n * @method removeAllBehaviours\n */\n removeAllBehaviours() {\n Util.emptyArray(this.behaviours);\n }\n\n // emitter update\n update(time) {\n this.age += time;\n if (this.age >= this.life || this.dead) this.destroy();\n\n this.emitting(time);\n this.integrate(time);\n }\n\n integrate(time) {\n if (!this.parent) return;\n\n const damping = 1 - this.damping;\n this.parent.integrator.calculate(this, time, damping);\n\n const length = this.particles.length;\n let i, particle;\n\n for (i = length - 1; i >= 0; i--) {\n particle = this.particles[i];\n\n // particle update\n particle.update(time, i);\n this.parent.integrator.calculate(particle, time, damping);\n this.dispatch(\"PARTICLE_UPDATE\", particle);\n\n // check dead\n if (particle.dead) {\n this.dispatch(\"PARTICLE_DEAD\", particle);\n\n this.parent.pool.expire(particle);\n this.particles.splice(i, 1);\n }\n }\n }\n\n dispatch(event, target) {\n this.parent && this.parent.dispatchEvent(event, target);\n this.bindEvent && this.dispatchEvent(event, target);\n }\n\n emitting(time) {\n if (this.totalTime === \"once\") {\n let i;\n const length = this.rate.getValue(99999);\n\n if (length > 0) this.emitSpeed = length;\n for (i = 0; i < length; i++) this.createParticle();\n this.totalTime = \"none\";\n } else {\n this.emitTime += time;\n\n if (this.emitTime < this.totalTime) {\n const length = this.rate.getValue(time);\n let i;\n\n if (length > 0) this.emitSpeed = length;\n for (i = 0; i < length; i++) this.createParticle();\n }\n }\n }\n\n /**\n * create single particle;\n *\n * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})\n * @method removeAllParticles\n */\n createParticle(initialize, behaviour) {\n const particle = this.parent.pool.get(Particle);\n this.setupParticle(particle, initialize, behaviour);\n this.dispatch(\"PARTICLE_CREATED\", particle);\n\n return particle;\n }\n\n setupParticle(particle, initialize, behaviour) {\n let initializes = this.initializes;\n let behaviours = this.behaviours;\n\n if (initialize) initializes = Util.toArray(initialize);\n if (behaviour) behaviours = Util.toArray(behaviour);\n\n particle.reset();\n InitializeUtil.initialize(this, particle, initializes);\n particle.addBehaviours(behaviours);\n particle.parent = this;\n\n this.particles.push(particle);\n }\n\n remove() {\n this.stop();\n Util.destroyAll(this.particles);\n }\n\n /**\n * Destory this Emitter\n * @method destroy\n */\n destroy() {\n this.dead = true;\n this.remove();\n this.removeAllInitializers();\n this.removeAllBehaviours();\n this.parent && this.parent.removeEmitter(this);\n }\n}\n\nEventDispatcher.bind(Emitter);\n","import Emitter from \"./Emitter\";\n\nexport default class BehaviourEmitter extends Emitter {\n /**\n * The BehaviourEmitter class inherits from Proton.Emitter\n *\n * use the BehaviourEmitter you can add behaviours to self;\n * @class Proton.BehaviourEmitter\n * @constructor\n * @param {Object} conf the parameters object;\n */\n constructor(conf) {\n super(conf);\n\n this.selfBehaviours = [];\n }\n\n /**\n * add the Behaviour to emitter;\n *\n * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);\n * @method addSelfBehaviour\n * @param {Proton.Behaviour} behaviour like this new Proton.Color('random')\n */\n addSelfBehaviour(...rest) {\n let i,\n length = rest.length;\n\n for (i = 0; i < length; i++) {\n this.selfBehaviours.push(rest[i]);\n }\n }\n\n /**\n * remove the Behaviour for self\n * @method removeSelfBehaviour\n * @param {Proton.Behaviour} behaviour a behaviour\n */\n removeSelfBehaviour(behaviour) {\n const index = this.selfBehaviours.indexOf(behaviour);\n if (index > -1) this.selfBehaviours.splice(index, 1);\n }\n\n update(time) {\n super.update(time);\n\n if (!this.sleep) {\n const length = this.selfBehaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.selfBehaviours[i].applyBehaviour(this, time, i);\n }\n }\n }\n}\n","import Util from \"../utils/Util\";\nimport Emitter from \"./Emitter\";\n\nexport default class FollowEmitter extends Emitter {\n /**\n * The FollowEmitter class inherits from Proton.Emitter\n *\n * use the FollowEmitter will emit particle when mousemoving\n *\n * @class Proton.FollowEmitter\n * @constructor\n * @param {Element} mouseTarget mouseevent's target;\n * @param {Number} ease the easing of following speed;\n * @default 0.7\n * @param {Object} conf the parameters object;\n */\n constructor(mouseTarget, ease, conf) {\n super(conf);\n\n this.mouseTarget = Util.initValue(mouseTarget, window);\n this.ease = Util.initValue(ease, 0.7);\n\n this._allowEmitting = false;\n this.initEventHandler();\n }\n\n initEventHandler() {\n this.mousemoveHandler = e => this.mousemove.call(this, e);\n this.mousedownHandler = e => this.mousedown.call(this, e);\n this.mouseupHandler = e => this.mouseup.call(this, e);\n\n this.mouseTarget.addEventListener(\n \"mousemove\",\n this.mousemoveHandler,\n false\n );\n }\n\n /**\n * start emit particle\n * @method emit\n */\n emit() {\n this._allowEmitting = true;\n }\n\n /**\n * stop emiting\n * @method stop\n */\n stop() {\n this._allowEmitting = false;\n }\n\n mousemove(e) {\n if (e.layerX || e.layerX === 0) {\n this.p.x += (e.layerX - this.p.x) * this.ease;\n this.p.y += (e.layerY - this.p.y) * this.ease;\n } else if (e.offsetX || e.offsetX === 0) {\n this.p.x += (e.offsetX - this.p.x) * this.ease;\n this.p.y += (e.offsetY - this.p.y) * this.ease;\n }\n\n if (this._allowEmitting) super.emit(\"once\");\n }\n\n /**\n * Destory this Emitter\n * @method destroy\n */\n destroy() {\n super.destroy();\n this.mouseTarget.removeEventListener(\n \"mousemove\",\n this.mousemoveHandler,\n false\n );\n }\n}\n","import Pool from \"../core/Pool\";\nimport Util from \"../utils/Util\";\n\nexport default class BaseRenderer {\n constructor(element, stroke) {\n this.pool = new Pool();\n this.element = element;\n this.stroke = stroke;\n this.circleConf = { isCircle: true };\n\n this.initHandler();\n this.name = \"BaseRenderer\";\n }\n\n setStroke(color = \"#000000\", thinkness = 1) {\n this.stroke = { color, thinkness };\n }\n\n initHandler() {\n this._protonUpdateHandler = () => {\n this.onProtonUpdate.call(this);\n };\n\n this._protonUpdateAfterHandler = () => {\n this.onProtonUpdateAfter.call(this);\n };\n\n this._emitterAddedHandler = emitter => {\n this.onEmitterAdded.call(this, emitter);\n };\n\n this._emitterRemovedHandler = emitter => {\n this.onEmitterRemoved.call(this, emitter);\n };\n\n this._particleCreatedHandler = particle => {\n this.onParticleCreated.call(this, particle);\n };\n\n this._particleUpdateHandler = particle => {\n this.onParticleUpdate.call(this, particle);\n };\n\n this._particleDeadHandler = particle => {\n this.onParticleDead.call(this, particle);\n };\n }\n\n init(proton) {\n this.parent = proton;\n\n proton.addEventListener(\"PROTON_UPDATE\", this._protonUpdateHandler);\n proton.addEventListener(\n \"PROTON_UPDATE_AFTER\",\n this._protonUpdateAfterHandler\n );\n\n proton.addEventListener(\"EMITTER_ADDED\", this._emitterAddedHandler);\n proton.addEventListener(\"EMITTER_REMOVED\", this._emitterRemovedHandler);\n\n proton.addEventListener(\n \"PARTICLE_CREATED\",\n this._particleCreatedHandler\n );\n proton.addEventListener(\"PARTICLE_UPDATE\", this._particleUpdateHandler);\n proton.addEventListener(\"PARTICLE_DEAD\", this._particleDeadHandler);\n }\n\n resize(width, height) {}\n\n destroy() {\n this.remove();\n }\n\n remove(proton) {\n this.parent.removeEventListener(\n \"PROTON_UPDATE\",\n this._protonUpdateHandler\n );\n this.parent.removeEventListener(\n \"PROTON_UPDATE_AFTER\",\n this._protonUpdateAfterHandler\n );\n\n this.parent.removeEventListener(\n \"EMITTER_ADDED\",\n this._emitterAddedHandler\n );\n this.parent.removeEventListener(\n \"EMITTER_REMOVED\",\n this._emitterRemovedHandler\n );\n\n this.parent.removeEventListener(\n \"PARTICLE_CREATED\",\n this._particleCreatedHandler\n );\n this.parent.removeEventListener(\n \"PARTICLE_UPDATE\",\n this._particleUpdateHandler\n );\n this.parent.removeEventListener(\n \"PARTICLE_DEAD\",\n this._particleDeadHandler\n );\n\n this.parent = null;\n }\n\n onProtonUpdate() {}\n onProtonUpdateAfter() {}\n\n onEmitterAdded(emitter) {}\n onEmitterRemoved(emitter) {}\n\n onParticleCreated(particle) {}\n onParticleUpdate(particle) {}\n onParticleDead(particle) {}\n}\n","import ImgUtil from \"../utils/ImgUtil\";\nimport ColorUtil from \"../utils/ColorUtil\";\nimport MathUtil from \"../math/MathUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class CanvasRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.context = this.element.getContext(\"2d\");\n this.bufferCache = {};\n this.name = \"CanvasRenderer\";\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n onProtonUpdate() {\n this.context.clearRect(0, 0, this.element.width, this.element.height);\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.color = particle.color || \"#ff0000\";\n }\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n if (particle.body instanceof Image) this.drawImage(particle);\n } else {\n this.drawCircle(particle);\n }\n }\n\n onParticleDead(particle) {\n particle.body = null;\n }\n\n // private\n addImg2Body(img, particle) {\n particle.body = img;\n }\n\n // private drawCircle\n drawImage(particle) {\n const w = (particle.body.width * particle.scale) | 0;\n const h = (particle.body.height * particle.scale) | 0;\n const x = particle.p.x - w / 2;\n const y = particle.p.y - h / 2;\n\n if (!!particle.color) {\n if (!particle.data[\"buffer\"])\n particle.data.buffer = this.createBuffer(particle.body);\n\n const bufContext = particle.data.buffer.getContext(\"2d\");\n bufContext.clearRect(\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height\n );\n bufContext.globalAlpha = particle.alpha;\n bufContext.drawImage(particle.body, 0, 0);\n\n bufContext.globalCompositeOperation = \"source-atop\";\n bufContext.fillStyle = ColorUtil.rgbToHex(particle.rgb);\n bufContext.fillRect(\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height\n );\n bufContext.globalCompositeOperation = \"source-over\";\n bufContext.globalAlpha = 1;\n\n this.context.drawImage(\n particle.data.buffer,\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height,\n x,\n y,\n w,\n h\n );\n } else {\n this.context.save();\n\n this.context.globalAlpha = particle.alpha;\n this.context.translate(particle.p.x, particle.p.y);\n this.context.rotate(MathUtil.degreeTransform(particle.rotation));\n this.context.translate(-particle.p.x, -particle.p.y);\n this.context.drawImage(\n particle.body,\n 0,\n 0,\n particle.body.width,\n particle.body.height,\n x,\n y,\n w,\n h\n );\n\n this.context.globalAlpha = 1;\n this.context.restore();\n }\n }\n\n // private drawCircle --\n drawCircle(particle) {\n if (particle.rgb) {\n this.context.fillStyle = `rgba(${particle.rgb.r},${particle.rgb.g},${particle.rgb.b},${particle.alpha})`;\n } else {\n this.context.fillStyle = particle.color;\n }\n\n // draw circle\n this.context.beginPath();\n this.context.arc(\n particle.p.x,\n particle.p.y,\n particle.radius,\n 0,\n Math.PI * 2,\n true\n );\n\n if (this.stroke) {\n this.context.strokeStyle = this.stroke.color;\n this.context.lineWidth = this.stroke.thinkness;\n this.context.stroke();\n }\n\n this.context.closePath();\n this.context.fill();\n }\n\n // private createBuffer\n createBuffer(image) {\n if (image instanceof Image) {\n const size = image.width + \"_\" + image.height;\n let canvas = this.bufferCache[size];\n\n if (!canvas) {\n canvas = document.createElement(\"canvas\");\n canvas.width = image.width;\n canvas.height = image.height;\n this.bufferCache[size] = canvas;\n }\n\n return canvas;\n }\n }\n}\n","import DomUtil from \"../utils/DomUtil\";\nimport ImgUtil from \"../utils/ImgUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class DomRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.transform3d = false;\n this.name = \"DomRenderer\";\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n this.element.appendChild(particle.body);\n }\n }\n\n onParticleUpdate(particle) {\n if (this.bodyReady(particle)) {\n if (this.transform3d)\n DomUtil.transform3d(\n particle.body,\n particle.p.x,\n particle.p.y,\n particle.scale,\n particle.rotation\n );\n else\n DomUtil.transform(\n particle.body,\n particle.p.x,\n particle.p.y,\n particle.scale,\n particle.rotation\n );\n\n particle.body.style.opacity = particle.alpha;\n if (particle.body.isCircle) {\n particle.body.style.backgroundColor = particle.color || \"#ff0000\";\n }\n }\n }\n\n onParticleDead(particle) {\n if (this.bodyReady(particle)) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n }\n\n bodyReady(particle) {\n return (\n typeof particle.body === \"object\" &&\n particle.body &&\n !particle.body.isInner\n );\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = this.pool.get(img, particle);\n DomUtil.resize(particle.body, img.width, img.height);\n\n this.element.appendChild(particle.body);\n }\n\n createBody(body, particle) {\n if (body.isCircle) return this.createCircle(particle);\n else return this.createSprite(body, particle);\n }\n\n // private --\n createCircle(particle) {\n const dom = DomUtil.createDiv(\n `${particle.id}_dom`,\n 2 * particle.radius,\n 2 * particle.radius\n );\n dom.style.borderRadius = `${particle.radius}px`;\n\n if (this.stroke) {\n dom.style.borderColor = this.stroke.color;\n dom.style.borderWidth = `${this.stroke.thinkness}px`;\n }\n dom.isCircle = true;\n\n return dom;\n }\n\n createSprite(body, particle) {\n const url = typeof body === \"string\" ? body : body.src;\n const dom = DomUtil.createDiv(\n `${particle.id}_dom`,\n body.width,\n body.height\n );\n dom.style.backgroundImage = `url(${url})`;\n\n return dom;\n }\n}\n","import BaseRenderer from \"./BaseRenderer\";\n\nexport default class EaselRenderer extends BaseRenderer {\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.name = \"EaselRenderer\";\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n this.createSprite(particle);\n } else {\n this.createCircle(particle);\n }\n\n this.element.addChild(particle.body);\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n particle.body.x = particle.p.x;\n particle.body.y = particle.p.y;\n\n particle.body.alpha = particle.alpha;\n particle.body.scaleX = particle.body.scaleY = particle.scale;\n particle.body.rotation = particle.rotation;\n }\n }\n\n onParticleDead(particle) {\n if (particle.body) {\n particle.body.parent && particle.body.parent.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n if (particle.graphics) this.pool.expire(particle.graphics);\n }\n\n // private\n createSprite(particle) {\n particle.body = this.pool.get(particle.body);\n\n if (particle.body.parent) return;\n if (particle.body[\"image\"]) {\n particle.body.regX = particle.body.image.width / 2;\n particle.body.regY = particle.body.image.height / 2;\n }\n }\n\n createCircle(particle) {\n const graphics = this.pool.get(createjs.Graphics);\n\n if (this.stroke) {\n if (this.stroke instanceof String) graphics.beginStroke(this.stroke);\n else graphics.beginStroke(\"#000000\");\n }\n graphics\n .beginFill(particle.color || \"#ff0000\")\n .drawCircle(0, 0, particle.radius);\n\n const shape = this.pool.get(createjs.Shape, [graphics]);\n\n particle.body = shape;\n particle.graphics = graphics;\n }\n}\n","import Rectangle from \"../math/Rectangle\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class PixelRenderer extends BaseRenderer {\n constructor(element, rectangle) {\n super(element);\n\n this.context = this.element.getContext(\"2d\");\n this.imageData = null;\n this.rectangle = null;\n this.rectangle = rectangle;\n this.createImageData(rectangle);\n\n this.name = \"PixelRenderer\";\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n createImageData(rectangle) {\n this.rectangle = rectangle\n ? rectangle\n : new Rectangle(0, 0, this.element.width, this.element.height);\n this.imageData = this.context.createImageData(\n this.rectangle.width,\n this.rectangle.height\n );\n this.context.putImageData(\n this.imageData,\n this.rectangle.x,\n this.rectangle.y\n );\n }\n\n onProtonUpdate() {\n this.context.clearRect(\n this.rectangle.x,\n this.rectangle.y,\n this.rectangle.width,\n this.rectangle.height\n );\n this.imageData = this.context.getImageData(\n this.rectangle.x,\n this.rectangle.y,\n this.rectangle.width,\n this.rectangle.height\n );\n }\n\n onProtonUpdateAfter() {\n this.context.putImageData(\n this.imageData,\n this.rectangle.x,\n this.rectangle.y\n );\n }\n\n onParticleCreated(particle) {}\n\n onParticleUpdate(particle) {\n if (this.imageData) {\n this.setPixel(\n this.imageData,\n Math.floor(particle.p.x - this.rectangle.x),\n Math.floor(particle.p.y - this.rectangle.y),\n particle\n );\n }\n }\n\n setPixel(imagedata, x, y, particle) {\n const rgb = particle.rgb;\n if (x < 0 || x > this.element.width || y < 0 || y > this.elementwidth)\n return;\n\n const i = ((y >> 0) * imagedata.width + (x >> 0)) * 4;\n\n imagedata.data[i] = rgb.r;\n imagedata.data[i + 1] = rgb.g;\n imagedata.data[i + 2] = rgb.b;\n imagedata.data[i + 3] = particle.alpha * 255;\n }\n\n onParticleDead(particle) {}\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport MathUtil from \"../math/MathUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nlet PIXIClass;\nexport default class PixiRenderer extends BaseRenderer {\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.setColor = false;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.setPIXI(window.PIXI);\n\n this.name = \"PixiRenderer\";\n }\n\n setPIXI(PIXI) {\n if (!PIXI) console.error(\"Sorry, the PIXI class is null\");\n\n try {\n PIXIClass = PIXI || { Sprite: {} };\n this.createFromImage =\n PIXIClass.Sprite.from || PIXIClass.Sprite.fromImage;\n } catch (e) {}\n }\n\n onProtonUpdate() {}\n\n /**\n * @param particle\n */\n onParticleCreated(particle) {\n if (particle.body) {\n particle.body = this.pool.get(particle.body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n }\n\n 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)\n 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 MathUtil.PI_180 for slight performance increase.\n target.rotation = particle.rotation * MathUtil.PI_180; // MathUtil.PI_180;\n }\n\n createBody(body, particle) {\n if (body.isCircle) return this.createCircle(particle);\n else return this.createSprite(body);\n }\n\n createSprite(body) {\n const sprite = body.isInner\n ? this.createFromImage(body.src)\n : new PIXIClass.Sprite(body);\n\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n\n return sprite;\n }\n\n createCircle(particle) {\n const graphics = new PIXIClass.Graphics();\n\n if (this.stroke) {\n const stroke = this.stroke instanceof String ? this.stroke : 0x000000;\n graphics.beginStroke(stroke);\n }\n\n graphics.beginFill(particle.color || 0x008ced);\n graphics.drawCircle(0, 0, particle.radius);\n graphics.endFill();\n\n return graphics;\n }\n}\n","import Mat3 from \"../math/Mat3\";\n\nexport default class MStack {\n constructor() {\n this.mats = [];\n this.size = 0;\n\n for (let i = 0; i < 20; i++)\n this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0]));\n }\n\n set(m, i) {\n if (i === 0) Mat3.set(m, this.mats[0]);\n else Mat3.multiply(this.mats[i - 1], m, this.mats[i]);\n\n this.size = Math.max(this.size, i + 1);\n }\n\n push(m) {\n if (this.size === 0) Mat3.set(m, this.mats[0]);\n else Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]);\n\n this.size++;\n }\n\n pop() {\n if (this.size > 0) this.size--;\n }\n\n top() {\n return this.mats[this.size - 1];\n }\n}\n","import Mat3 from '../math/Mat3';\nimport BaseRenderer from './BaseRenderer';\n\nimport Util from '../utils/Util';\nimport ImgUtil from '../utils/ImgUtil';\nimport MStack from '../utils/MStack';\nimport DomUtil from '../utils/DomUtil';\nimport WebGLUtil from '../utils/WebGLUtil';\nimport MathUtil from '../math/MathUtil';\n\nexport default class WebGLRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.gl = this.element.getContext('experimental-webgl', { antialias: true, stencil: false, depth: false });\n if (!this.gl) alert('Sorry your browser do not suppest WebGL!');\n\n this.initVar();\n this.setMaxRadius();\n this.initShaders();\n this.initBuffers();\n\n this.gl.blendEquation(this.gl.FUNC_ADD);\n this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);\n this.gl.enable(this.gl.BLEND);\n\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.name = 'WebGLRenderer';\n }\n\n init(proton) {\n super.init(proton);\n this.resize(this.element.width, this.element.height);\n }\n\n resize(width, height) {\n this.umat[4] = -2;\n this.umat[7] = 1;\n\n this.smat[0] = 1 / width;\n this.smat[4] = 1 / height;\n\n this.mstack.set(this.umat, 0);\n this.mstack.set(this.smat, 1);\n\n this.gl.viewport(0, 0, width, height);\n this.element.width = width;\n this.element.height = height;\n }\n\n setMaxRadius(radius) {\n this.circleCanvasURL = this.createCircle(radius);\n }\n\n getVertexShader() {\n const vsSource = ['uniform vec2 viewport;', 'attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform mat3 tMat;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'void main() {', 'vec3 v = tMat * vec3(aVertexPosition, 1.0);', 'gl_Position = vec4(v.x, v.y, 0, 1);', 'vTextureCoord = aTextureCoord;', 'alpha = tMat[0][2];', '}'].join('\\n');\n return vsSource;\n }\n\n getFragmentShader() {\n const fsSource = ['precision mediump float;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'uniform sampler2D uSampler;', 'uniform vec4 color;', 'uniform bool useTexture;', 'uniform vec3 uColor;', 'void main() {', 'vec4 textureColor = texture2D(uSampler, vTextureCoord);', 'gl_FragColor = textureColor * vec4(uColor, 1.0);', 'gl_FragColor.w *= alpha;', '}'].join('\\n');\n return fsSource;\n }\n\n initVar() {\n this.mstack = new MStack();\n this.umat = Mat3.create([2, 0, 1, 0, -2, 0, -1, 1, 1]);\n this.smat = Mat3.create([1 / 100, 0, 1, 0, 1 / 100, 0, 0, 0, 1]);\n this.texturebuffers = {};\n }\n\n blendEquation(A) {\n this.gl.blendEquation(this.gl[A]);\n }\n\n blendFunc(A, B) {\n this.gl.blendFunc(this.gl[A], this.gl[B]);\n }\n\n getShader(gl, str, fs) {\n const shader = fs ? gl.createShader(gl.FRAGMENT_SHADER) : gl.createShader(gl.VERTEX_SHADER);\n\n gl.shaderSource(shader, str);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n }\n\n initShaders() {\n const fragmentShader = this.getShader(this.gl, this.getFragmentShader(), true);\n const vertexShader = this.getShader(this.gl, this.getVertexShader(), false);\n\n this.sprogram = this.gl.createProgram();\n this.gl.attachShader(this.sprogram, vertexShader);\n this.gl.attachShader(this.sprogram, fragmentShader);\n this.gl.linkProgram(this.sprogram);\n\n if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS))\n alert('Could not initialise shaders');\n\n this.gl.useProgram(this.sprogram);\n this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, 'aVertexPosition');\n this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, 'aTextureCoord');\n this.gl.enableVertexAttribArray(this.sprogram.tca);\n this.gl.enableVertexAttribArray(this.sprogram.vpa);\n\n this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, 'tMat');\n this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, 'uSampler');\n this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, 'useTexture');\n this.sprogram.color = this.gl.getUniformLocation(this.sprogram, 'uColor');\n this.gl.uniform1i(this.sprogram.useTex, 1);\n };\n\n initBuffers() {\n const vs = [0, 3, 1, 0, 2, 3];\n let idx;\n\n this.unitIBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vs), this.gl.STATIC_DRAW);\n\n let i;\n let ids = [];\n for (i = 0; i < 100; i++) ids.push(i);\n idx = new Uint16Array(ids);\n\n this.unitI33 = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitI33);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n\n ids = [];\n for (i = 0; i < 100; i++) ids.push(i, i + 1, i + 2);\n idx = new Uint16Array(ids);\n\n this.stripBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.stripBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n };\n\n createCircle(raidus) {\n this.circleCanvasRadius = WebGLUtil.nhpot(Util.initValue(raidus, 32));\n const canvas = DomUtil.createCanvas('circle_canvas', this.circleCanvasRadius * 2, this.circleCanvasRadius * 2);\n const context = canvas.getContext('2d');\n\n context.beginPath();\n context.arc(this.circleCanvasRadius, this.circleCanvasRadius, this.circleCanvasRadius, 0, Math.PI * 2, true);\n context.closePath();\n context.fillStyle = '#FFF';\n context.fill();\n\n return canvas.toDataURL();\n };\n\n drawImg2Canvas(particle) {\n const _w = particle.body.width;\n const _h = particle.body.height;\n\n const _width = WebGLUtil.nhpot(particle.body.width);\n const _height = WebGLUtil.nhpot(particle.body.height);\n\n const _scaleX = particle.body.width / _width;\n const _scaleY = particle.body.height / _height;\n\n if (!this.texturebuffers[particle.data.src])\n this.texturebuffers[particle.data.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()];\n\n particle.data.texture = this.texturebuffers[particle.data.src][0];\n particle.data.vcBuffer = this.texturebuffers[particle.data.src][1];\n particle.data.tcBuffer = this.texturebuffers[particle.data.src][2];\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _scaleX, 0.0, 0.0, _scaleY, _scaleY, _scaleY]), this.gl.STATIC_DRAW);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _w, 0.0, 0.0, _h, _w, _h]), this.gl.STATIC_DRAW);\n\n const context = particle.data.canvas.getContext('2d');\n const data = context.getImageData(0, 0, _width, _height);\n\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture);\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, data);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_NEAREST);\n this.gl.generateMipmap(this.gl.TEXTURE_2D);\n\n particle.data.textureLoaded = true;\n particle.data.textureWidth = _w;\n particle.data.textureHeight = _h;\n }\n\n onProtonUpdate() {\n // this.gl.clearColor(0, 0, 0, 1);\n // this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\n }\n\n onParticleCreated(particle) {\n particle.data.textureLoaded = false;\n particle.data.tmat = Mat3.create();\n particle.data.tmat[8] = 1;\n particle.data.imat = Mat3.create();\n particle.data.imat[8] = 1;\n\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n ImgUtil.getImgFromCache(this.circleCanvasURL, this.addImg2Body, particle);\n particle.data.oldScale = particle.radius / this.circleCanvasRadius;\n }\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = img;\n particle.data.src = img.src;\n particle.data.canvas = ImgUtil.getCanvasFromCache(img);\n particle.data.oldScale = 1;\n\n this.drawImg2Canvas(particle);\n }\n\n onParticleUpdate(particle) {\n if (particle.data.textureLoaded) {\n this.updateMatrix(particle);\n\n this.gl.uniform3f(this.sprogram.color, particle.rgb.r / 255, particle.rgb.g / 255, particle.rgb.b / 255);\n this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top());\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture);\n this.gl.uniform1i(this.sprogram.samplerUniform, 0);\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n\n this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0);\n\n this.mstack.pop();\n }\n }\n\n onParticleDead(particle) { }\n\n updateMatrix(particle) {\n const moveOriginMatrix = WebGLUtil.makeTranslation(-particle.data.textureWidth / 2, -particle.data.textureHeight / 2);\n const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y);\n\n const angel = particle.rotation * (MathUtil.PI_180);\n const rotationMatrix = WebGLUtil.makeRotation(angel);\n\n const scale = particle.scale * particle.data.oldScale;\n const scaleMatrix = WebGLUtil.makeScale(scale, scale);\n let matrix = WebGLUtil.matrixMultiply(moveOriginMatrix, scaleMatrix);\n\n matrix = WebGLUtil.matrixMultiply(matrix, rotationMatrix);\n matrix = WebGLUtil.matrixMultiply(matrix, translationMatrix);\n\n Mat3.inverse(matrix, particle.data.imat);\n matrix[2] = particle.alpha;\n\n this.mstack.push(matrix);\n }\n}","import BaseRenderer from \"./BaseRenderer\";\n\nexport default class CustomRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.name = \"CustomRenderer\";\n }\n}\n","import Zone from \"./Zone\";\nimport Util from \"../utils/Util\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class LineZone extends Zone {\n constructor(x1, y1, x2, y2, direction) {\n super();\n\n if (x2 - x1 >= 0) {\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n } else {\n this.x1 = x2;\n this.y1 = y2;\n this.x2 = x1;\n this.y2 = y1;\n }\n\n this.dx = this.x2 - this.x1;\n this.dy = this.y2 - this.y1;\n\n this.minx = Math.min(this.x1, this.x2);\n this.miny = Math.min(this.y1, this.y2);\n this.maxx = Math.max(this.x1, this.x2);\n this.maxy = Math.max(this.y1, this.y2);\n\n this.dot = this.x2 * this.y1 - this.x1 * this.y2;\n this.xxyy = this.dx * this.dx + this.dy * this.dy;\n\n this.gradient = this.getGradient();\n this.length = this.getLength();\n this.direction = Util.initValue(direction, \">\");\n }\n\n getPosition() {\n this.random = Math.random();\n\n this.vector.x =\n this.x1 + this.random * this.length * Math.cos(this.gradient);\n this.vector.y =\n this.y1 + this.random * this.length * Math.sin(this.gradient);\n\n return this.vector;\n }\n\n getDirection(x, y) {\n const A = this.dy;\n const B = -this.dx;\n const C = this.dot;\n const D = B === 0 ? 1 : B;\n\n if ((A * x + B * y + C) * D > 0) return true;\n else return false;\n }\n\n getDistance(x, y) {\n const A = this.dy;\n const B = -this.dx;\n const C = this.dot;\n const D = A * x + B * y + C;\n\n return D / Math.sqrt(this.xxyy);\n }\n\n getSymmetric(v) {\n const tha2 = v.getGradient();\n const tha1 = this.getGradient();\n const tha = 2 * (tha1 - tha2);\n\n const oldx = v.x;\n const oldy = v.y;\n\n v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n\n return v;\n }\n\n getGradient() {\n return Math.atan2(this.dy, this.dx);\n }\n\n rangeOut(particle) {\n const angle = Math.abs(this.getGradient());\n\n if (angle <= MathUtil.PI / 4) {\n if (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true;\n } else {\n if (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true;\n }\n\n return false;\n }\n\n getLength() {\n return Math.sqrt(this.dx * this.dx + this.dy * this.dy);\n }\n\n crossing(particle) {\n if (this.crossType === \"dead\") {\n if (\n this.direction === \">\" ||\n this.direction === \"R\" ||\n this.direction === \"right\" ||\n this.direction === \"down\"\n ) {\n if (!this.rangeOut(particle)) return;\n if (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n } else {\n if (!this.rangeOut(particle)) return;\n if (!this.getDirection(particle.p.x, particle.p.y))\n particle.dead = true;\n }\n } else if (this.crossType === \"bound\") {\n if (!this.rangeOut(particle)) return;\n\n if (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) {\n if (this.dx === 0) {\n particle.v.x *= -1;\n } else if (this.dy === 0) {\n particle.v.y *= -1;\n } else {\n this.getSymmetric(particle.v);\n }\n }\n } else if (this.crossType === \"cross\") {\n if (this.alert) {\n console.error(\"Sorry, LineZone does not support cross method!\");\n this.alert = false;\n }\n }\n }\n}\n","import Zone from \"./Zone\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class CircleZone extends Zone {\n constructor(x, y, radius) {\n super();\n\n this.x = x;\n this.y = y;\n this.radius = radius;\n\n this.angle = 0;\n this.center = { x, y };\n }\n\n getPosition() {\n this.angle = MathUtil.PIx2 * Math.random();\n this.randomRadius = Math.random() * this.radius;\n\n this.vector.x = this.x + this.randomRadius * Math.cos(this.angle);\n this.vector.y = this.y + this.randomRadius * Math.sin(this.angle);\n\n return this.vector;\n }\n\n setCenter(x, y) {\n this.center.x = x;\n this.center.y = y;\n }\n\n crossing(particle) {\n const d = particle.p.distanceTo(this.center);\n\n if (this.crossType === \"dead\") {\n if (d - particle.radius > this.radius) particle.dead = true;\n } else if (this.crossType === \"bound\") {\n if (d + particle.radius >= this.radius) this.getSymmetric(particle);\n } else if (this.crossType === \"cross\") {\n if (this.alert) {\n console.error(\"Sorry, CircleZone does not support cross method!\");\n this.alert = false;\n }\n }\n }\n\n getSymmetric(particle) {\n let tha2 = particle.v.getGradient();\n let tha1 = this.getGradient(particle);\n\n let tha = 2 * (tha1 - tha2);\n let oldx = particle.v.x;\n let oldy = particle.v.y;\n\n particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n }\n\n getGradient(particle) {\n return (\n -MathUtil.PI_2 +\n Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x)\n );\n }\n}\n","import Zone from \"./Zone\";\n\nexport default class RectZone extends Zone {\n constructor(x, y, width, height) {\n super();\n\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n\n getPosition() {\n this.vector.x = this.x + Math.random() * this.width;\n this.vector.y = this.y + Math.random() * this.height;\n\n return this.vector;\n }\n\n crossing(particle) {\n // particle dead zone\n if (this.crossType === \"dead\") {\n if (particle.p.x + particle.radius < this.x) particle.dead = true;\n else if (particle.p.x - particle.radius > this.x + this.width)\n particle.dead = true;\n\n if (particle.p.y + particle.radius < this.y) particle.dead = true;\n else if (particle.p.y - particle.radius > this.y + this.height)\n particle.dead = true;\n }\n\n // particle bound zone\n else if (this.crossType === \"bound\") {\n if (particle.p.x - particle.radius < this.x) {\n particle.p.x = this.x + particle.radius;\n particle.v.x *= -1;\n } else if (particle.p.x + particle.radius > this.x + this.width) {\n particle.p.x = this.x + this.width - particle.radius;\n particle.v.x *= -1;\n }\n\n if (particle.p.y - particle.radius < this.y) {\n particle.p.y = this.y + particle.radius;\n particle.v.y *= -1;\n } else if (particle.p.y + particle.radius > this.y + this.height) {\n particle.p.y = this.y + this.height - particle.radius;\n particle.v.y *= -1;\n }\n }\n\n // particle cross zone\n else if (this.crossType === \"cross\") {\n if (particle.p.x + particle.radius < this.x && particle.v.x <= 0)\n particle.p.x = this.x + this.width + particle.radius;\n else if (\n particle.p.x - particle.radius > this.x + this.width &&\n particle.v.x >= 0\n )\n particle.p.x = this.x - particle.radius;\n\n if (particle.p.y + particle.radius < this.y && particle.v.y <= 0)\n particle.p.y = this.y + this.height + particle.radius;\n else if (\n particle.p.y - particle.radius > this.y + this.height &&\n particle.v.y >= 0\n )\n particle.p.y = this.y - particle.radius;\n }\n }\n}\n","import Zone from \"./Zone\";\nimport Util from \"../utils/Util\";\n\nexport default class ImageZone extends Zone {\n constructor(imageData, x, y, d) {\n super();\n\n this.reset(imageData, x, y, d);\n }\n\n reset(imageData, x, y, d) {\n this.imageData = imageData;\n this.x = Util.initValue(x, 0);\n this.y = Util.initValue(y, 0);\n this.d = Util.initValue(d, 2);\n\n this.vectors = [];\n this.setVectors();\n }\n\n setVectors() {\n let i, j;\n const length1 = this.imageData.width;\n const length2 = this.imageData.height;\n\n for (i = 0; i < length1; i += this.d) {\n for (j = 0; j < length2; j += this.d) {\n let index = ((j >> 0) * length1 + (i >> 0)) * 4;\n\n if (this.imageData.data[index + 3] > 0) {\n this.vectors.push({ x: i + this.x, y: j + this.y });\n }\n }\n }\n\n return this.vector;\n }\n\n getBound(x, y) {\n var index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n if (this.imageData.data[index + 3] > 0) return true;\n else return false;\n }\n\n getPosition() {\n const vector = Util.getRandFromArray(this.vectors);\n return this.vector.copy(vector);\n }\n\n getColor(x, y) {\n x -= this.x;\n y -= this.y;\n var i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\n return {\n r: this.imageData.data[i],\n g: this.imageData.data[i + 1],\n b: this.imageData.data[i + 2],\n a: this.imageData.data[i + 3]\n };\n }\n\n crossing(particle) {\n if (this.crossType === \"dead\") {\n if (this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n particle.dead = true;\n else particle.dead = false;\n } else if (this.crossType === \"bound\") {\n if (!this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n particle.v.negate();\n }\n }\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport CircleZone from \"../zone/CircleZone\";\nimport PointZone from \"../zone/PointZone\";\nimport LineZone from \"../zone/LineZone\";\nimport RectZone from \"../zone/RectZone\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default {\n addEventListener(proton, func) {\n proton.addEventListener(\"PROTON_UPDATE_AFTER\", () => func());\n },\n\n getStyle(color = \"#ff0000\") {\n const rgb = ColorUtil.hexToRgb(color);\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`;\n },\n\n drawZone(proton, canvas, zone, clear) {\n const context = canvas.getContext(\"2d\");\n const style = this.getStyle();\n\n this.addEventListener(proton, () => {\n if (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n if (zone instanceof PointZone) {\n context.beginPath();\n context.fillStyle = style;\n context.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true);\n context.fill();\n context.closePath();\n } else if (zone instanceof LineZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.moveTo(zone.x1, zone.y1);\n context.lineTo(zone.x2, zone.y2);\n context.stroke();\n context.closePath();\n } else if (zone instanceof RectZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.drawRect(zone.x, zone.y, zone.width, zone.height);\n context.stroke();\n context.closePath();\n } else if (zone instanceof CircleZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true);\n context.stroke();\n context.closePath();\n }\n });\n },\n\n drawEmitter(proton, canvas, emitter, clear) {\n const context = canvas.getContext(\"2d\");\n const style = this.getStyle();\n\n this.addEventListener(proton, () => {\n if (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n context.beginPath();\n context.fillStyle = style;\n context.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true);\n context.fill();\n context.closePath();\n });\n }\n};\n","import Proton from \"./core/Proton\";\nimport Particle from \"./core/Particle\";\nimport Pool from \"./core/Pool\";\n\nimport Util from \"./utils/Util\";\nimport ColorUtil from \"./utils/ColorUtil\";\nimport MathUtil from \"./math/MathUtil\";\nimport Vector2D from \"./math/Vector2D\";\nimport Polar2D from \"./math/Polar2D\";\nimport Mat3 from \"./math/Mat3\";\nimport Span from \"./math/Span\";\nimport ArraySpan from \"./math/ArraySpan\";\nimport Rectangle from \"./math/Rectangle\";\nimport ease from \"./math/ease\";\n\nimport Rate from \"./initialize/Rate\";\nimport Initialize from \"./initialize/Initialize\";\nimport Life from \"./initialize/Life\";\nimport Position from \"./initialize/Position\";\nimport Velocity from \"./initialize/Velocity\";\nimport Mass from \"./initialize/Mass\";\nimport Radius from \"./initialize/Radius\";\nimport Body from \"./initialize/Body\";\n\nimport Behaviour from \"./behaviour/Behaviour\";\nimport Force from \"./behaviour/Force\";\nimport Attraction from \"./behaviour/Attraction\";\nimport RandomDrift from \"./behaviour/RandomDrift\";\nimport Gravity from \"./behaviour/Gravity\";\nimport Collision from \"./behaviour/Collision\";\nimport CrossZone from \"./behaviour/CrossZone\";\nimport Alpha from \"./behaviour/Alpha\";\nimport Scale from \"./behaviour/Scale\";\nimport Rotate from \"./behaviour/Rotate\";\nimport Color from \"./behaviour/Color\";\nimport Repulsion from \"./behaviour/Repulsion\";\nimport GravityWell from \"./behaviour/GravityWell\";\n\nimport Emitter from \"./emitter/Emitter\";\nimport BehaviourEmitter from \"./emitter/BehaviourEmitter\";\nimport FollowEmitter from \"./emitter/FollowEmitter\";\n\nimport CanvasRenderer from \"./render/CanvasRenderer\";\nimport DomRenderer from \"./render/DomRenderer\";\nimport EaselRenderer from \"./render/EaselRenderer\";\nimport PixelRenderer from \"./render/PixelRenderer\";\nimport PixiRenderer from \"./render/PixiRenderer\";\nimport WebGLRenderer from \"./render/WebGLRenderer\";\nimport CustomRenderer from \"./render/CustomRenderer\";\n\nimport Zone from \"./zone/Zone\";\nimport LineZone from \"./zone/LineZone\";\nimport CircleZone from \"./zone/CircleZone\";\nimport PointZone from \"./zone/PointZone\";\nimport RectZone from \"./zone/RectZone\";\nimport ImageZone from \"./zone/ImageZone\";\n\nimport Debug from \"./debug/Debug\";\n\n// namespace\nProton.Particle = Proton.P = Particle;\nProton.Pool = Pool;\n\nProton.Util = Util;\nProton.ColorUtil = ColorUtil;\nProton.MathUtil = MathUtil;\nProton.Vector2D = Proton.Vector = Vector2D;\nProton.Polar2D = Proton.Polar = Polar2D;\nProton.ArraySpan = ArraySpan;\nProton.Rectangle = Rectangle;\nProton.Rate = Rate;\nProton.ease = ease;\nProton.Span = Span;\nProton.Mat3 = Mat3;\nProton.getSpan = (a, b, center) => new Span(a, b, center);\nProton.createArraySpan = ArraySpan.createArraySpan;\n\nProton.Initialize = Proton.Init = Initialize;\nProton.Life = Proton.L = Life;\nProton.Position = Proton.P = Position;\nProton.Velocity = Proton.V = Velocity;\nProton.Mass = Proton.M = Mass;\nProton.Radius = Proton.R = Radius;\nProton.Body = Proton.B = Body;\n\nProton.Behaviour = Behaviour;\nProton.Force = Proton.F = Force;\nProton.Attraction = Proton.A = Attraction;\nProton.RandomDrift = Proton.RD = RandomDrift;\nProton.Gravity = Proton.G = Gravity;\nProton.Collision = Collision;\nProton.CrossZone = CrossZone;\nProton.Alpha = Proton.A = Alpha;\nProton.Scale = Proton.S = Scale;\nProton.Rotate = Rotate;\nProton.Color = Color;\nProton.Repulsion = Repulsion;\nProton.GravityWell = GravityWell;\n\nProton.Emitter = Emitter;\nProton.BehaviourEmitter = BehaviourEmitter;\nProton.FollowEmitter = FollowEmitter;\n\nProton.Zone = Zone;\nProton.LineZone = LineZone;\nProton.CircleZone = CircleZone;\nProton.PointZone = PointZone;\nProton.RectZone = RectZone;\nProton.ImageZone = ImageZone;\n\nProton.CanvasRenderer = CanvasRenderer;\nProton.DomRenderer = DomRenderer;\nProton.EaselRenderer = EaselRenderer;\nProton.PixiRenderer = PixiRenderer;\nProton.PixelRenderer = PixelRenderer;\nProton.WebGLRenderer = Proton.WebGlRenderer = WebGLRenderer;\nProton.CustomRenderer = CustomRenderer;\n\nProton.Debug = Debug;\n\nObject.assign(Proton, ease);\n\n// export\nexport default Proton;\n"],"names":["PI","MathUtil","num","this","Infinity","a","b","Math","floor","random","center","f","isInt","randomAToB","toString","slice","Span","isArray","Util","getRandFromArray","randomFloating","c","undefined","pan","getValue","initValue","length","i","tx","ty","angleInRadians","cos","s","sin","sx","sy","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b01","b02","b10","b11","b12","b20","b21","b22","id","width","height","position","dom","document","createElement","style","opacity","transform","resize","marginLeft","marginTop","div","x","y","scale","rotate","willChange","css3","key","val","bkey","charAt","toUpperCase","substr","imgsCache","canvasCache","canvasId","context","image","rect","drawImage","imagedata","getImageData","clearRect","img","callback","param","src","Image","onload","e","target","WebGLUtil","canvas","DomUtil","createCanvas","getContext","value","defaults","Object","prototype","call","arr","obj","ignore","indexOf","constructor","args","bind","apply","concat","particle","conf","hasProp","p","v","copy","props","prop","hasOwnProperty","getSpanValue","ImgUtil","destroy","idsMap","Puid","type","uid","getIdFromCache","_index","_cache","isBody","isInner","Pool","params","__puid","getId","cache","pop","createOrClone","getCache","push","total","create","classApply","clone","count","Stats","body","add","emitter","getEmitter","renderer","getRenderer","str","proton","emitters","emitSpeed","getEmitterPos","initializes","concatArr","behaviours","name","getCreatedNumber","getCount","pool","container","innerHTML","cssText","join","addEventListener","_this","bg","color","parentNode","appendChild","emitterIndex","renderers","rendererIndex","result","cpool","round","EventDispatcher","listener","_listeners","removeEventListener","splice","listeners","handler","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","sleep","old","multiplyScalar","mass","clear","Proton","render","init","index","remove","parent","EMITTER_ADDED","EMITTER_REMOVED","PROTON_UPDATE","USE_CLOCK","oldTime","Date","getTime","elapsed","amendChangeTabsBug","emittersUpdate","PROTON_UPDATE_AFTER","update","destroyAll","destroyOther","getAllParticles","integrationType","stats","EULER","integrator","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","Rgb","r","g","pow","PI_2","sqrt","ease","easeLinear","Vector2D","atan2","w","addVectors","subVectors","set","divideScalar","distanceToSquared","tha","dx","dy","alpha","Particle","N180_PI","life","age","dead","sprite","energy","radius","rotation","easing","rgb","reset","emptyObject","data","removeAllBehaviours","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","emptyArray","setProp","h","hex16","substring","parseInt","rbg","Number","Polar2D","getX","getY","abs","Mat3","mat3","mat","Float32Array","mat1","mat2","m","vec","ArraySpan","_arr","randomColor","toArray","Rectangle","right","bottom","Rate","startTime","nextTime","timePan","numPan","numpan","timepan","setSpanValue","Initialize","Life","lifePan","Zone","vector","crossType","alert","PointZone","error","Position","zone","getPosition","Velocity","rpan","thapan","rPan","thaPan","vr","polar2d","normalizeVelocity","PI_180","Mass","massPan","Radius","oldRadius","Body","imageTarget","Behaviour","getEasing","force","removeBehaviour","Force","fx","fy","normalizeForce","calculate","Attraction","targetPosition","normalizeValue","radiusSq","attractionForce","lengthSq","sub","normalize","RandomDrift","driftX","driftY","delay","panFoce","addXY","Gravity","Collision","collisionPool","delta","newPool","otherParticle","overlap","totalMass","averageMass1","averageMass2","distance","CrossZone","crossing","Alpha","same","alphaA","alphaB","Scale","scaleA","scaleB","Rotate","rotationA","rotationB","getDirection","influence","Color","createArraySpan","colorA","ColorUtil","hexToRgb","colorB","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVectorVal","degreeTransform","Emitter","totalTime","stoped","emitTime","isNaN","rate","oldStoped","oldEmitTime","oldTotalTime","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mousemoveHandler","_this2","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","mouseTarget","_allowEmitting","layerX","layerY","offsetX","offsetY","babelHelpers.get","window","initEventHandler","BaseRenderer","thinkness","stroke","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","element","circleConf","isCircle","initHandler","CanvasRenderer","addImg2Body","drawCircle","buffer","createBuffer","bufContext","globalAlpha","globalCompositeOperation","fillStyle","rgbToHex","fillRect","save","translate","restore","beginPath","arc","strokeStyle","lineWidth","closePath","fill","size","bufferCache","DomRenderer","bodyReady","transform3d","backgroundColor","removeChild","babelHelpers.typeof","createCircle","createSprite","createDiv","borderRadius","borderColor","borderWidth","url","backgroundImage","createBody","EaselRenderer","addChild","scaleX","scaleY","graphics","regX","regY","createjs","Graphics","String","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","PIXIClass","PixiRenderer","PIXI","console","Sprite","createFromImage","from","fromImage","setColor","tint","getHex16FromParticle","anchor","endFill","setPIXI","MStack","mats","multiply","WebGLRenderer","umat","smat","mstack","gl","viewport","circleCanvasURL","texturebuffers","A","blendEquation","B","blendFunc","fs","shader","createShader","FRAGMENT_SHADER","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","fragmentShader","getShader","getFragmentShader","vertexShader","getVertexShader","sprogram","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","useProgram","vpa","getAttribLocation","tca","enableVertexAttribArray","tMatUniform","getUniformLocation","samplerUniform","useTex","uniform1i","idx","unitIBuffer","bindBuffer","ELEMENT_ARRAY_BUFFER","bufferData","Uint16Array","STATIC_DRAW","ids","unitI33","stripBuffer","raidus","circleCanvasRadius","toDataURL","_w","_h","_width","_height","_scaleX","_scaleY","createTexture","texture","vcBuffer","tcBuffer","ARRAY_BUFFER","bindTexture","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","LINEAR_MIPMAP_NEAREST","generateMipmap","textureLoaded","textureWidth","textureHeight","tmat","imat","oldScale","drawImg2Canvas","updateMatrix","uniform3f","uniformMatrix3fv","top","vertexAttribPointer","FLOAT","drawElements","TRIANGLES","UNSIGNED_SHORT","moveOriginMatrix","translationMatrix","angel","rotationMatrix","scaleMatrix","matrix","inverse","antialias","stencil","depth","initVar","setMaxRadius","initShaders","initBuffers","FUNC_ADD","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","enable","BLEND","CustomRenderer","LineZone","x1","gradient","y1","dot","xxyy","tha2","getGradient","oldx","oldy","maxx","minx","maxy","miny","direction","rangeOut","getDistance","getSymmetric","x2","y2","min","getLength","CircleZone","angle","PIx2","randomRadius","d","distanceTo","RectZone","ImageZone","vectors","setVectors","j","length1","length2","getBound","negate","func","getStyle","moveTo","lineTo","drawRect","P","Vector","Polar","getSpan","Init","L","V","M","R","F","RD","G","S","WebGlRenderer","Debug","assign"],"mappings":";;;;;;;;;gRAAA,IAAMA,EAAK,UAGLC,EAAW,IACTD,OACO,EAALA,OACAA,EAAK,SACHA,EAAK,YACJ,IAAMA,YACJ,wBAEAE,UACAA,IAAQC,KAAKC,UAAYF,IAXvBE,EAAAA,uBAcFC,EAAGC,8CAEEC,KAAKC,MAAMD,KAAKE,UAAYH,EAAID,IAAMA,EAD/BA,EAAIE,KAAKE,UAAYH,EAAID,4BAIjCK,EAAQC,EAAGC,UACfT,KAAKU,WAAWH,EAASC,EAAGD,EAASC,EAAGC,qDAKnCP,UACJA,EAAIL,EAAM,wBAGZE,aACKA,EAAIY,SAAS,kCAKpB,KACC,SAA4B,SAAhBP,KAAKE,UAAyB,GAAGK,SAAS,KAAKC,OACvD,4oCCnCIC,8CAaVJ,2CACHT,KAAKc,QACAC,EAAKC,iBAAiBhB,KAAKE,GAE7BF,KAAKO,OAGDT,EAASm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