mage-engine 3.23.44 → 3.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mage.js +1307 -384
- package/package.json +1 -2
package/dist/mage.js
CHANGED
|
@@ -4770,7 +4770,7 @@ function interpret(machine, options) {
|
|
|
4770
4770
|
respond: respond,
|
|
4771
4771
|
forwardTo: forwardTo,
|
|
4772
4772
|
escalate: escalate
|
|
4773
|
-
};var index$
|
|
4773
|
+
};var index$2=/*#__PURE__*/Object.freeze({__proto__:null,actions:actions,matchesState:matchesState,mapState:mapState,get ActionTypes(){return ActionTypes$1},get SpecialTargets(){return SpecialTargets},assign:assign,doneInvoke:doneInvoke,forwardTo:forwardTo,send:send,sendParent:sendParent,sendUpdate:sendUpdate,State:State,StateNode:StateNode,Machine:Machine,createMachine:createMachine,Interpreter:Interpreter,interpret:interpret,spawn:spawn,matchState:matchState});// threejs.org/license
|
|
4774
4774
|
const REVISION = '126';
|
|
4775
4775
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
4776
4776
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -53738,6 +53738,7 @@ const DEPRECATIONS = {
|
|
|
53738
53738
|
const IMPORTER_ERROR_ELEMENT_CREATION = `${PREFIX} Error while creating element: `;
|
|
53739
53739
|
const IMPORTER_ERROR_LIGHT_CREATION = `${PREFIX} Error while creating light: `;
|
|
53740
53740
|
const IMPORTER_ERROR_SOUND_CREATION = `${PREFIX} Error while creating sound: `;
|
|
53741
|
+
const IMPORTER_ERROR_PARTICLE_CREATION = `${PREFIX} Error while creating particle emitter: `;
|
|
53741
53742
|
const IMPORTER_ERROR_UNKNOWN_ELEMENT_SUBTYPE = `${PREFIX} Unknown element subtype: `;
|
|
53742
53743
|
const ONCREATE_NOT_AVAILABLE = `${PREFIX} Your scene needs a onCreate method.`;
|
|
53743
53744
|
const PATH_NOT_FOUND = `${PREFIX} can't find requested path`;
|
|
@@ -54737,7 +54738,7 @@ let Keyboard = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
54737
54738
|
UNKNOWN: "UNKNOWN"
|
|
54738
54739
|
};
|
|
54739
54740
|
const FLAT_ENTITY_TYPES = [ENTITY_TYPES.SCENE.TYPE, ENTITY_TYPES.CAMERA.TYPE, ENTITY_TYPES.MESH.TYPE, ENTITY_TYPES.LABEL.TYPE, ENTITY_TYPES.LIGHT.TYPE, ENTITY_TYPES.AUDIO.TYPE, ENTITY_TYPES.MODEL.TYPE, ENTITY_TYPES.SPRITE.TYPE, ENTITY_TYPES.PARTICLE.TYPE, ENTITY_TYPES.SCENERY.TYPE, ENTITY_TYPES.HELPER.TYPE, ENTITY_TYPES.UNKNOWN];
|
|
54740
|
-
const FLAT_ENTITY_SUBTYPES = [ENTITY_TYPES.SCENE.SUBTYPES.DEFAULT, ENTITY_TYPES.CAMERA.SUBTYPES.DEFAULT, ENTITY_TYPES.CAMERA.SUBTYPES.MAIN, ENTITY_TYPES.CAMERA.SUBTYPES.GAME, ENTITY_TYPES.MESH.SUBTYPES.DEFAULT, ENTITY_TYPES.MESH.SUBTYPES.BOX, ENTITY_TYPES.MESH.SUBTYPES.SPHERE, ENTITY_TYPES.MESH.SUBTYPES.PLANE, ENTITY_TYPES.MESH.SUBTYPES.CYLINDER, ENTITY_TYPES.MESH.SUBTYPES.CONE, ENTITY_TYPES.MESH.SUBTYPES.CUBE, ENTITY_TYPES.MESH.SUBTYPES.LINE, ENTITY_TYPES.MESH.SUBTYPES.CURVE_LINE, ENTITY_TYPES.MESH.SUBTYPES.AXES, ENTITY_TYPES.MESH.SUBTYPES.GRID, ENTITY_TYPES.MESH.SUBTYPES.TARGET, ENTITY_TYPES.LABEL.SUBTYPES.DEFAULT, ENTITY_TYPES.LIGHT.SUBTYPES.DEFAULT, ENTITY_TYPES.LIGHT.SUBTYPES.AMBIENT, ENTITY_TYPES.LIGHT.SUBTYPES.SUN, ENTITY_TYPES.LIGHT.SUBTYPES.HEMISPHERE, ENTITY_TYPES.LIGHT.SUBTYPES.POINT, ENTITY_TYPES.LIGHT.SUBTYPES.SPOT, ENTITY_TYPES.AUDIO.SUBTYPES.DEFAULT, ENTITY_TYPES.AUDIO.SUBTYPES.DIRECTIONAL, ENTITY_TYPES.AUDIO.SUBTYPES.AMBIENT, ENTITY_TYPES.MODEL.SUBTYPES.DEFAULT, ENTITY_TYPES.SPRITE.SUBTYPES.DEFAULT, ENTITY_TYPES.SPRITE.SUBTYPES.ANIMATED_SPRITE, ENTITY_TYPES.PARTICLE.SUBTYPES.DEFAULT, ENTITY_TYPES.PARTICLE.SUBTYPES.EMITTER, ENTITY_TYPES.PARTICLE.SUBTYPES.SYSTEM, ENTITY_TYPES.PARTICLE.SUBTYPES.EMITTER_GROUP, ENTITY_TYPES.PARTICLE.SUBTYPES.PROTON_EMITTER, ENTITY_TYPES.SCENERY.SUBTYPES.DEFAULT, ENTITY_TYPES.SCENERY.SUBTYPES.SKY, ENTITY_TYPES.SCENERY.SUBTYPES.SKYBOX, ENTITY_TYPES.HELPER.SUBTYPES.GRID, ENTITY_TYPES.HELPER.SUBTYPES.AXES, ENTITY_TYPES.HELPER.SUBTYPES.HELPER_SPRITE];
|
|
54741
|
+
const FLAT_ENTITY_SUBTYPES = [ENTITY_TYPES.SCENE.SUBTYPES.DEFAULT, ENTITY_TYPES.CAMERA.SUBTYPES.DEFAULT, ENTITY_TYPES.CAMERA.SUBTYPES.MAIN, ENTITY_TYPES.CAMERA.SUBTYPES.GAME, ENTITY_TYPES.MESH.SUBTYPES.DEFAULT, ENTITY_TYPES.MESH.SUBTYPES.BOX, ENTITY_TYPES.MESH.SUBTYPES.SPHERE, ENTITY_TYPES.MESH.SUBTYPES.PLANE, ENTITY_TYPES.MESH.SUBTYPES.CYLINDER, ENTITY_TYPES.MESH.SUBTYPES.CONE, ENTITY_TYPES.MESH.SUBTYPES.CUBE, ENTITY_TYPES.MESH.SUBTYPES.LINE, ENTITY_TYPES.MESH.SUBTYPES.CURVE_LINE, ENTITY_TYPES.MESH.SUBTYPES.AXES, ENTITY_TYPES.MESH.SUBTYPES.GRID, ENTITY_TYPES.MESH.SUBTYPES.TARGET, ENTITY_TYPES.LABEL.SUBTYPES.DEFAULT, ENTITY_TYPES.LIGHT.SUBTYPES.DEFAULT, ENTITY_TYPES.LIGHT.SUBTYPES.AMBIENT, ENTITY_TYPES.LIGHT.SUBTYPES.SUN, ENTITY_TYPES.LIGHT.SUBTYPES.HEMISPHERE, ENTITY_TYPES.LIGHT.SUBTYPES.POINT, ENTITY_TYPES.LIGHT.SUBTYPES.SPOT, ENTITY_TYPES.AUDIO.SUBTYPES.DEFAULT, ENTITY_TYPES.AUDIO.SUBTYPES.DIRECTIONAL, ENTITY_TYPES.AUDIO.SUBTYPES.AMBIENT, ENTITY_TYPES.MODEL.SUBTYPES.DEFAULT, ENTITY_TYPES.SPRITE.SUBTYPES.DEFAULT, ENTITY_TYPES.SPRITE.SUBTYPES.ANIMATED_SPRITE, ENTITY_TYPES.PARTICLE.SUBTYPES.DEFAULT, ENTITY_TYPES.PARTICLE.SUBTYPES.EMITTER, ENTITY_TYPES.PARTICLE.SUBTYPES.SYSTEM, ENTITY_TYPES.PARTICLE.SUBTYPES.EMITTER_GROUP, ENTITY_TYPES.PARTICLE.SUBTYPES.PROTON_EMITTER, ENTITY_TYPES.PARTICLE.SUBTYPES.FIRE, ENTITY_TYPES.PARTICLE.SUBTYPES.EXPLOSION, ENTITY_TYPES.PARTICLE.SUBTYPES.TRAIL, ENTITY_TYPES.PARTICLE.SUBTYPES.RAIN, ENTITY_TYPES.PARTICLE.SUBTYPES.SNOW, ENTITY_TYPES.PARTICLE.SUBTYPES.FOUNTAIN, ENTITY_TYPES.SCENERY.SUBTYPES.DEFAULT, ENTITY_TYPES.SCENERY.SUBTYPES.SKY, ENTITY_TYPES.SCENERY.SUBTYPES.SKYBOX, ENTITY_TYPES.HELPER.SUBTYPES.GRID, ENTITY_TYPES.HELPER.SUBTYPES.AXES, ENTITY_TYPES.HELPER.SUBTYPES.HELPER_SPRITE];
|
|
54741
54742
|
const ENTITY_EVENTS = {
|
|
54742
54743
|
DISPOSE: "DISPOSE",
|
|
54743
54744
|
STATE_MACHINE: {
|
|
@@ -55592,6 +55593,10 @@ const TAGS = {
|
|
|
55592
55593
|
SOUNDS: {
|
|
55593
55594
|
HELPER: "TAGS.SOUNDS.HELPER",
|
|
55594
55595
|
HOLDER: "TAGS.SOUNDS.HOLDER"
|
|
55596
|
+
},
|
|
55597
|
+
PARTICLES: {
|
|
55598
|
+
HELPER: "TAGS.PARTICLES.HELPER",
|
|
55599
|
+
HOLDER: "TAGS.PARTICLES.HOLDER"
|
|
55595
55600
|
}
|
|
55596
55601
|
};var lib_constants=/*#__PURE__*/Object.freeze({__proto__:null,ALMOST_ZERO:ALMOST_ZERO,UP:UP$1,DOWN:DOWN$1,LEFT:LEFT,RIGHT:RIGHT,FRONT:FRONT,BACK:BACK,VECTOR_UP:VECTOR_UP,VECTOR_DOWN:VECTOR_DOWN,VECTOR_LEFT:VECTOR_LEFT,VECTOR_RIGHT:VECTOR_RIGHT,VECTOR_FRONT:VECTOR_FRONT,VECTOR_BACK:VECTOR_BACK,ORIGIN:ORIGIN,ZERO_QUATERNION:ZERO_QUATERNION,MATERIALS:MATERIALS,TEXTURES:TEXTURES,PROPERTIES:PROPERTIES,MATERIAL_PROPERTIES_DEFAULT_VALUES:MATERIAL_PROPERTIES_DEFAULT_VALUES,DEFAULT_MATERIAL_PROPERTIES:DEFAULT_MATERIAL_PROPERTIES,MATERIAL_PROPERTIES_MAP:MATERIAL_PROPERTIES_MAP,MATERIAL_TEXTURE_MAP:MATERIAL_TEXTURE_MAP$1,UNDESIRED_SERIALISED_MATERIAL_PROPERTIES:UNDESIRED_SERIALISED_MATERIAL_PROPERTIES,EFFECTS:EFFECTS,COLLISION_EVENT:COLLISION_EVENT,COLORS:COLORS,ASSETS_TYPES:ASSETS_TYPES,OUTPUT_ENCODINGS:OUTPUT_ENCODINGS,DEFAULT_OUTPUT_ENCODING:DEFAULT_OUTPUT_ENCODING,ROOT:ROOT,DIVIDER:DIVIDER,HASH:HASH,EMPTY:EMPTY$2,QUERY_START:QUERY_START,DEFAULT_SELECTOR:DEFAULT_SELECTOR,BEFORE_UNLOAD:BEFORE_UNLOAD,HASH_CHANGE:HASH_CHANGE,TAGS:TAGS});const buildAssetId = (name, level) => level ? `${level}_${name}` : name;
|
|
55597
55602
|
const isLevelName = level => level.startsWith(DIVIDER);/**
|
|
@@ -56835,11 +56840,15 @@ var Physics$1 = new Physics();let Scene = /*#__PURE__*/function () {
|
|
|
56835
56840
|
}, {
|
|
56836
56841
|
key: "updateChildren",
|
|
56837
56842
|
value: function updateChildren() {
|
|
56838
|
-
|
|
56839
|
-
if (
|
|
56840
|
-
|
|
56843
|
+
this.scene.traverse(child => {
|
|
56844
|
+
if (child.material) {
|
|
56845
|
+
if (Array.isArray(child.material)) {
|
|
56846
|
+
child.material.forEach(m => m.needsUpdate = true);
|
|
56847
|
+
} else {
|
|
56848
|
+
child.material.needsUpdate = true;
|
|
56849
|
+
}
|
|
56841
56850
|
}
|
|
56842
|
-
}
|
|
56851
|
+
});
|
|
56843
56852
|
}
|
|
56844
56853
|
}, {
|
|
56845
56854
|
key: "add",
|
|
@@ -56871,7 +56880,13 @@ var Physics$1 = new Physics();let Scene = /*#__PURE__*/function () {
|
|
|
56871
56880
|
key: "remove",
|
|
56872
56881
|
value: function remove(body) {
|
|
56873
56882
|
this.scene.remove(body);
|
|
56874
|
-
Universe$1.remove(body.uuid);
|
|
56883
|
+
Universe$1.remove(body.uuid); // Remove the element from the elements array
|
|
56884
|
+
|
|
56885
|
+
const index = this.elements.findIndex(e => e.hasBody() && e.getBody().uuid === body.uuid);
|
|
56886
|
+
|
|
56887
|
+
if (index !== -1) {
|
|
56888
|
+
this.elements.splice(index, 1);
|
|
56889
|
+
}
|
|
56875
56890
|
}
|
|
56876
56891
|
}, {
|
|
56877
56892
|
key: "setClearColor",
|
|
@@ -58204,7 +58219,7 @@ function applyMiddleware() {
|
|
|
58204
58219
|
|
|
58205
58220
|
var thunk = createThunkMiddleware();
|
|
58206
58221
|
thunk.withExtraArgument = createThunkMiddleware;var name = "mage-engine";
|
|
58207
|
-
var version$1 = "3.
|
|
58222
|
+
var version$1 = "3.24.1";
|
|
58208
58223
|
var description = "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.";
|
|
58209
58224
|
var main = "dist/mage.js";
|
|
58210
58225
|
var author$1 = {
|
|
@@ -58252,7 +58267,6 @@ var dependencies = {
|
|
|
58252
58267
|
inferno: "7.3.2",
|
|
58253
58268
|
"inferno-create-element": "7.3.3",
|
|
58254
58269
|
"inferno-redux": "7.4.2",
|
|
58255
|
-
"mage-engine.particles": "github:MageStudio/partykals#v2.0.5",
|
|
58256
58270
|
redux: "4.0.5",
|
|
58257
58271
|
"redux-thunk": "^2.3.0",
|
|
58258
58272
|
rxjs: "6.5.3",
|
|
@@ -60463,6 +60477,16 @@ let CascadeShadowMaps = /*#__PURE__*/function () {
|
|
|
60463
60477
|
value: function add(light) {
|
|
60464
60478
|
this.lights.push(light);
|
|
60465
60479
|
}
|
|
60480
|
+
}, {
|
|
60481
|
+
key: "dispose",
|
|
60482
|
+
value: function dispose() {
|
|
60483
|
+
this.lights = [];
|
|
60484
|
+
|
|
60485
|
+
if (this.csm) {
|
|
60486
|
+
this.csm.dispose();
|
|
60487
|
+
this.csm = undefined;
|
|
60488
|
+
}
|
|
60489
|
+
}
|
|
60466
60490
|
}, {
|
|
60467
60491
|
key: "update",
|
|
60468
60492
|
value: function update(dt) {
|
|
@@ -66964,7 +66988,7 @@ function patchKeyedChildrenComplex$1(a, b, context, aLength, bLength, aEnd, bEnd
|
|
|
66964
66988
|
}
|
|
66965
66989
|
}
|
|
66966
66990
|
var result$1;
|
|
66967
|
-
var p$
|
|
66991
|
+
var p$1;
|
|
66968
66992
|
var maxLen$1 = 0;
|
|
66969
66993
|
// https://en.wikipedia.org/wiki/Longest_increasing_subsequence
|
|
66970
66994
|
function lis_algorithm$1(arr) {
|
|
@@ -66979,14 +67003,14 @@ function lis_algorithm$1(arr) {
|
|
|
66979
67003
|
if (len > maxLen$1) {
|
|
66980
67004
|
maxLen$1 = len;
|
|
66981
67005
|
result$1 = new Int32Array(len);
|
|
66982
|
-
p$
|
|
67006
|
+
p$1 = new Int32Array(len);
|
|
66983
67007
|
}
|
|
66984
67008
|
for (; i < len; ++i) {
|
|
66985
67009
|
arrI = arr[i];
|
|
66986
67010
|
if (arrI !== 0) {
|
|
66987
67011
|
j = result$1[k];
|
|
66988
67012
|
if (arr[j] < arrI) {
|
|
66989
|
-
p$
|
|
67013
|
+
p$1[i] = j;
|
|
66990
67014
|
result$1[++k] = i;
|
|
66991
67015
|
continue;
|
|
66992
67016
|
}
|
|
@@ -67003,7 +67027,7 @@ function lis_algorithm$1(arr) {
|
|
|
67003
67027
|
}
|
|
67004
67028
|
if (arrI < arr[result$1[u]]) {
|
|
67005
67029
|
if (u > 0) {
|
|
67006
|
-
p$
|
|
67030
|
+
p$1[i] = result$1[u - 1];
|
|
67007
67031
|
}
|
|
67008
67032
|
result$1[u] = i;
|
|
67009
67033
|
}
|
|
@@ -67014,7 +67038,7 @@ function lis_algorithm$1(arr) {
|
|
|
67014
67038
|
v = result$1[u - 1];
|
|
67015
67039
|
while (u-- > 0) {
|
|
67016
67040
|
seq[u] = v;
|
|
67017
|
-
v = p$
|
|
67041
|
+
v = p$1[v];
|
|
67018
67042
|
result$1[u] = 0;
|
|
67019
67043
|
}
|
|
67020
67044
|
return seq;
|
|
@@ -69688,7 +69712,7 @@ function patchKeyedChildrenComplex(a, b, context, aLength, bLength, aEnd, bEnd,
|
|
|
69688
69712
|
}
|
|
69689
69713
|
}
|
|
69690
69714
|
var result;
|
|
69691
|
-
var p
|
|
69715
|
+
var p;
|
|
69692
69716
|
var maxLen = 0;
|
|
69693
69717
|
// https://en.wikipedia.org/wiki/Longest_increasing_subsequence
|
|
69694
69718
|
function lis_algorithm(arr) {
|
|
@@ -69703,14 +69727,14 @@ function lis_algorithm(arr) {
|
|
|
69703
69727
|
if (len > maxLen) {
|
|
69704
69728
|
maxLen = len;
|
|
69705
69729
|
result = new Int32Array(len);
|
|
69706
|
-
p
|
|
69730
|
+
p = new Int32Array(len);
|
|
69707
69731
|
}
|
|
69708
69732
|
for (; i < len; ++i) {
|
|
69709
69733
|
arrI = arr[i];
|
|
69710
69734
|
if (arrI !== 0) {
|
|
69711
69735
|
j = result[k];
|
|
69712
69736
|
if (arr[j] < arrI) {
|
|
69713
|
-
p
|
|
69737
|
+
p[i] = j;
|
|
69714
69738
|
result[++k] = i;
|
|
69715
69739
|
continue;
|
|
69716
69740
|
}
|
|
@@ -69727,7 +69751,7 @@ function lis_algorithm(arr) {
|
|
|
69727
69751
|
}
|
|
69728
69752
|
if (arrI < arr[result[u]]) {
|
|
69729
69753
|
if (u > 0) {
|
|
69730
|
-
p
|
|
69754
|
+
p[i] = result[u - 1];
|
|
69731
69755
|
}
|
|
69732
69756
|
result[u] = i;
|
|
69733
69757
|
}
|
|
@@ -69738,7 +69762,7 @@ function lis_algorithm(arr) {
|
|
|
69738
69762
|
v = result[u - 1];
|
|
69739
69763
|
while (u-- > 0) {
|
|
69740
69764
|
seq[u] = v;
|
|
69741
|
-
v = p
|
|
69765
|
+
v = p[v];
|
|
69742
69766
|
result[u] = 0;
|
|
69743
69767
|
}
|
|
69744
69768
|
return seq;
|
|
@@ -73252,10 +73276,10 @@ var rev = new u16(32768);
|
|
|
73252
73276
|
|
|
73253
73277
|
for (var i = 0; i < 32768; ++i) {
|
|
73254
73278
|
// reverse table algorithm from SO
|
|
73255
|
-
var x
|
|
73256
|
-
x
|
|
73257
|
-
x
|
|
73258
|
-
rev[i] = ((x
|
|
73279
|
+
var x = (i & 0xAAAA) >>> 1 | (i & 0x5555) << 1;
|
|
73280
|
+
x = (x & 0xCCCC) >>> 2 | (x & 0x3333) << 2;
|
|
73281
|
+
x = (x & 0xF0F0) >>> 4 | (x & 0x0F0F) << 4;
|
|
73282
|
+
rev[i] = ((x & 0xFF00) >>> 8 | (x & 0x00FF) << 8) >>> 1;
|
|
73259
73283
|
} // create huffman tree from u8 "map": index -> code length for code index
|
|
73260
73284
|
// mb (max bits) must be at most 15
|
|
73261
73285
|
// TODO: optimize/split up?
|
|
@@ -84858,7 +84882,7 @@ var ZipBufferIterator = /*@__PURE__*/ (function (_super) {
|
|
|
84858
84882
|
return subscribeToResult(this, this.observable, this, index);
|
|
84859
84883
|
};
|
|
84860
84884
|
return ZipBufferIterator;
|
|
84861
|
-
}(OuterSubscriber));/** PURE_IMPORTS_START PURE_IMPORTS_END */var index$
|
|
84885
|
+
}(OuterSubscriber));/** PURE_IMPORTS_START PURE_IMPORTS_END */var index$1=/*#__PURE__*/Object.freeze({__proto__:null,Observable:Observable,ConnectableObservable:ConnectableObservable,GroupedObservable:GroupedObservable,observable:observable,Subject:Subject,BehaviorSubject:BehaviorSubject,ReplaySubject:ReplaySubject,AsyncSubject:AsyncSubject,asapScheduler:asap,asyncScheduler:async,queueScheduler:queue,animationFrameScheduler:animationFrame,VirtualTimeScheduler:VirtualTimeScheduler,VirtualAction:VirtualAction,Scheduler:Scheduler,Subscription:Subscription,Subscriber:Subscriber,Notification:Notification,get NotificationKind(){return NotificationKind},pipe:pipe,noop:noop,identity:identity,isObservable:isObservable,ArgumentOutOfRangeError:ArgumentOutOfRangeError,EmptyError:EmptyError,ObjectUnsubscribedError:ObjectUnsubscribedError,UnsubscriptionError:UnsubscriptionError,TimeoutError:TimeoutError,bindCallback:bindCallback,bindNodeCallback:bindNodeCallback,combineLatest:combineLatest,concat:concat,defer:defer,empty:empty,forkJoin:forkJoin,from:from,fromEvent:fromEvent,fromEventPattern:fromEventPattern,generate:generate,iif:iif,interval:interval,merge:merge,never:never,of:of,onErrorResumeNext:onErrorResumeNext,pairs:pairs,partition:partition,race:race,range:range,throwError:throwError,timer:timer,using:using,zip:zip,scheduled:scheduled,EMPTY:EMPTY$1,NEVER:NEVER,config:config});const ONE_MB = 1048576;
|
|
84862
84886
|
|
|
84863
84887
|
let Stats = /*#__PURE__*/function () {
|
|
84864
84888
|
function Stats() {
|
|
@@ -87185,8 +87209,21 @@ let OutlineEffect = /*#__PURE__*/function () {
|
|
|
87185
87209
|
|
|
87186
87210
|
return PostProcessing;
|
|
87187
87211
|
}();
|
|
87188
|
-
var PostProcessing$1 = new PostProcessing();function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n);}}function d(t,e,i){return e&&u(t.prototype,e),i&&u(t,i),t}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e);}function v(t){return (v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){return (y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t,e){return !e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var g=function(t,e){return Math.random()*(e-t)+t},C=function(t,e){return e?g(t,t+e):t},S=function(e,i){return i?new Color$1(g(e.r,i.r),g(e.g,i.g),g(e.b,i.b)):e?e.clone():new Color$1},z=function(t,i){return i?new Vector3$1(g(t.x,i.x),g(t.y,i.y),g(t.z,i.z)):t?t.clone():new Vector3$1},w=function(t,e,i){return t.clone().lerp(e,i)},_=function(t,e,i){return t*(1-i)+e*i},A=function(t){return (t.generate?t.generate():t)||0},b=Object.freeze({__proto__:null,getRandomBetween:g,getRandomWithSpread:C,getRandomColorBetween:S,getRandomVectorBetween:z,lerpColors:w,lerp:_,randomizerOrValue:A}),P=function(){function t(e){p(this,t),this.system=e,this.reset();}return d(t,[{key:"reset",value:function(){var t=this.system.options.particles;this.age=0,this.finished=!1,this.gravity=t.gravity,this.velocity=x(t.velocity),t.velocityBonus&&this.velocity.add(t.velocityBonus),this.acceleration=x(t.acceleration,!0),this.position=x(t.offset||new Vector3$1),this.ttl=C(t.ttl||1,t.ttlExtra)||1,this.alpha=this.startAlpha=this.endAlpha=null,this.startAlphaChangeAt=(t.startAlphaChangeAt||0)/this.ttl,t.fade&&(void 0!==t.alpha?this.alpha=A(t.alpha):(this.startAlpha=A(t.startAlpha),this.endAlpha=A(t.endAlpha))),this.colorize=Boolean(t.colorize),this.color=this.startColor=this.endColor=null,this.startColorChangeAt=(t.startColorChangeAt||0)/this.ttl,this.colorize&&(t.color?this.color=T(t.color):(this.startColor=T(t.startColor),this.endColor=T(t.endColor))),this.size=this.startSize=this.endSize=null,this.startSizeChangeAt=(t.startSizeChangeAt||0)/this.ttl,t.scaling&&(void 0!==t.size?this.size=A(t.size):(this.startSize=A(t.startSize),this.endSize=A(t.endSize))),this.rotation=this.rotationSpeed=null,t.rotating&&(this.rotation=A(t.rotation||0),this.rotationSpeed=A(t.rotationSpeed||0)),this.startWorldPosition=null,this.onUpdate=t.onUpdate,t.onSpawn&&t.onSpawn(this);}},{key:"update",value:function(t,e){if(!this.finished){0===this.age?(this.system.options.particles.worldPosition&&(this.startWorldPosition=this.system.getWorldPosition()),null===this.alpha&&null===this.startAlpha||this.system.setAlpha(t,this.alpha||this.startAlpha),null===this.color&&null===this.startColor||this.system.setColor(t,this.color||this.startColor),null===this.size&&null===this.startSize||this.system.setSize(t,this.size||this.startSize),null!==this.rotation&&this.system.setRotation(t,this.rotation)):(this.startColor&&this.age>=this.startColorChangeAt&&this.system.setColor(t,w(this.startColor,this.endColor,this.startColorChangeAt?(this.age-this.startColorChangeAt)/(1-this.startColorChangeAt):this.age)),null!=this.startAlpha&&this.age>=this.startAlphaChangeAt&&this.system.setAlpha(t,_(this.startAlpha,this.endAlpha,this.startAlphaChangeAt?(this.age-this.startAlphaChangeAt)/(1-this.startAlphaChangeAt):this.age)),null!=this.startSize&&this.age>=this.startSizeChangeAt&&this.system.setSize(t,_(this.startSize,this.endSize,this.startSizeChangeAt?(this.age-this.startSizeChangeAt)/(1-this.startSizeChangeAt):this.age))),this.gravity&&this.velocity&&(this.velocity.y+=this.gravity*e),this.rotationSpeed&&(this.rotation+=this.rotationSpeed*e,this.system.setRotation(t,this.rotation)),this.velocity&&(this.position.x+=this.velocity.x*e,this.position.y+=this.velocity.y*e,this.position.z+=this.velocity.z*e);var i=this.position;if(this.startWorldPosition){var n=this.system.getWorldPosition();n.sub(this.startWorldPosition),i=i.clone().sub(n);}this.system.setPosition(t,i),this.acceleration&&this.velocity&&(this.velocity.x+=this.acceleration.x*e,this.velocity.y+=this.acceleration.y*e,this.velocity.z+=this.acceleration.z*e),this.age+=e/this.ttl,this.onUpdate&&this.onUpdate(this),this.age>1&&(this.age=1,this.finished=!0);}}},{key:"worldPosition",get:function(){return this.system.getWorldPosition().add(this.position)}}]),t}();function x(t,i){return t?t.generate?t.generate():t.clone():i?null:new Vector3$1}function T(e,i){return e?e.generate?e.generate():e.clone():i?null:new Color$1(1,1,1)}var R=function(){function e(r){p(this,e),this.options=r;var o={globalColor:{value:new Color$1(r.color||16777215)},rendererScale:{value:1}},s="";r.perspective&&(s+="#define PERSPECTIVE\n"),r.map&&(s+="#define TEXTURE\n",o.texture={value:r.map}),r.perParticleColor&&(s+="#define COLORING\n"),r.perParticleRotation&&(s+="#define ROTATION\n"),r.constSize&&(s+="#define CONST_SIZE\n",o.constSize={value:r.constSize}),r.alphaTest&&(s+="#define ALPHA_TEST\n"),s+="\n",this.material=new ShaderMaterial({uniforms:o,vertexShader:s+"\n// attributes we get from geometry\nattribute float alpha;\n\n// per-particle size\n#ifdef CONST_SIZE\n uniform float constSize;\n#else\n attribute float size;\n#endif\n\n// per-particle rotation\n#ifdef ROTATION\n attribute float rotation;\n#endif\n\n// system scale when using perspective mode\n#ifdef PERSPECTIVE\n uniform float rendererScale;\n#endif\n\n// output params for fragment shader\nvarying float vAlpha;\n\n// set per-particle color\n#ifdef COLORING\n varying vec3 vColor;\n#endif\n\n// get per-particle rotation\n#ifdef ROTATION\n varying float vRotation;\n#endif\n\n// vertex shader main\nvoid main() \n{\n // alpha and color\n vAlpha = alpha;\n\n // set color\n #ifdef COLORING\n vColor = color;\n #endif\n\n // set const size\n #ifdef CONST_SIZE\n float size = constSize;\n #endif\n\n // set position\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n\n // apply rotation\n #ifdef ROTATION\n vRotation = rotation;\n #endif\n \n // set size - either perspective or constant\n #ifdef PERSPECTIVE\n gl_PointSize = size * (rendererScale / length(mvPosition.xyz));\n #else\n gl_PointSize = size;\n #endif\n}\n",fragmentShader:s+"\n// material uniforms\nuniform vec3 globalColor;\n\n// params we get from vertex shader\nvarying float vAlpha;\n\n// per-particle color from vertex shader\n#ifdef COLORING\n varying vec3 vColor;\n#endif\n\n// per-particle rotation from vertex shader\n#ifdef ROTATION\n varying float vRotation;\n#endif\n\n// diffuse texture\n#ifdef TEXTURE\n uniform sampler2D texture;\n#endif\n\n// fragment shader main\nvoid main() \n{\n // set default color if don't have per-particle colors\n #ifndef COLORING\n vec3 vColor = vec3(1,1,1);\n #endif\n\n // texture\n #ifdef TEXTURE\n\n // use rotation (rotate texture)\n #ifdef ROTATION\n float mid = 0.5;\n vec2 rotated = vec2(cos(vRotation) * (gl_PointCoord.x - mid) + sin(vRotation) * (gl_PointCoord.y - mid) + mid,\n cos(vRotation) * (gl_PointCoord.y - mid) - sin(vRotation) * (gl_PointCoord.x - mid) + mid);\n vec4 texture = texture2D(texture, rotated);\n // no rotation\n #else\n vec2 coords = vec2((gl_PointCoord.x - 0.5) + 0.5, (gl_PointCoord.y - 0.5) + 0.5);\n vec4 texture = texture2D(texture, coords);\n #endif\n\n // get color with texture\n gl_FragColor = vec4( globalColor * vColor, vAlpha ) * texture;\n \n // no texture (colors only)\n #else\n gl_FragColor = vec4( globalColor * vColor, vAlpha );\n #endif\n\n // check if need to discard pixel\n #ifdef ALPHA_TEST\n if (gl_FragColor.a < 0.00001) { discard; }\n #endif\n}\n",transparent:Boolean(r.transparent),blending:r.blending,vertexColors:VertexColors,depthWrite:Boolean(r.depthWrite),depthTest:Boolean(r.depthTest)});}return d(e,[{key:"dispose",value:function(){this.material.dispose();}},{key:"setBaseScale",value:function(t){this.options.perspective&&(this.material.uniforms.rendererScale.value=t);}}]),e}(),O=function(t){return null!=t},E=function(){function i(e){p(this,i),e.particles=e.particles||{worldPosition:!0},e.system=e.system||{},this.options=e,this.hasStarted=!1;var n=e.particles;if("number"==typeof e.particles.size&&(console.warn("Note: replaced 'size' with 'globalSize' property since its more efficient and provided size value was constant anyway."),e.particles.globalSize=e.particles.size,delete e.particles.size),e.particles.color instanceof Color$1&&(console.warn("Note: replaced 'color' with 'globalColor' property since its more efficient and you provided color value was constant anyway."),e.particles.globalColor=e.particles.color,delete e.particles.color),e.particles.fade=O(n.startAlpha)||O(n.alpha),e.particles.rotating=O(n.rotationSpeed)||O(n.rotation),e.particles.colorize=O(n.color)||O(n.startColor),e.particles.scaling=O(n.size)||O(n.startSize),O(n.startAlpha)&&!O(n.endAlpha))throw new Error("When providing 'startAlpha' you must also provide 'endAlpha'!");if(O(n.startAlpha)&&O(n.alpha))throw new Error("When providing 'alpha' you can't also provide 'startAlpha'!");if(O(n.startColor)&&!O(n.endColor))throw new Error("When providing 'startColor' you must also provide 'endColor'!");if(O(n.startColor)&&O(n.color))throw new Error("When providing 'color' you can't also provide 'startColor'!");if(O(n.startSize)&&!O(n.endSize))throw new Error("When providing 'startSize' you must also provide 'endSize'!");if(O(n.startSize)&&O(n.size))throw new Error("When providing 'size' you can't also provide 'startSize'!");this.particleCount=e.system.particlesCount||10,this.blending=e.particles.blending||"opaque",this.threeBlend={opaque:NoBlending,additive:AdditiveBlending,multiply:MultiplyBlending,blend:NormalBlending}[this.blending],this.create(),e.autostart&&this.start();}return d(i,[{key:"create",value:function(){this._emitters=[];var t=this.options,e=t.system,i=t.particles;t.container;if(e.emitters)if(e.emitters instanceof Array)for(var n=0;n<e.emitters.length;++n)this.addEmitter(e.emitters[n]);else this.addEmitter(e.emitters);var r="opaque"!==this.blending;this.particlesGeometry=new BufferGeometry;var o=void 0===e.perspective||Boolean(e.perspective),s=new R({size:i.size||10,color:i.globalColor||16777215,blending:this.threeBlend,perspective:o,transparent:r,map:i.texture,perParticleColor:Boolean(i.colorize),alphaTest:"blend"===this.blending&&O(i.texture),constSize:O(i.globalSize)?i.globalSize:null,depthWrite:!O(e.depthWrite)||e.depthWrite,depthTest:!O(e.depthTest)||e.depthTest,perParticleRotation:i.rotating});this.material=s,this.speed=e.speed||1,this.reset(),this._aliveParticles=[],this._deadParticles=[];for(var a=new Float32Array(3*this.particleCount),p=i.colorize?new Float32Array(3*this.particleCount):null,u=i.fade?new Float32Array(1*this.particleCount):null,d=i.scaling?new Float32Array(1*this.particleCount):null,f=i.rotating?new Float32Array(1*this.particleCount):null,v=0;v<this.particleCount;v++){var y=3*v;a[y]=a[y+1]=a[y+2]=0,p&&(p[y]=p[y+1]=p[y+2]=1),u&&(u[v]=1),d&&(d[v]=1),f&&(f[v]=0),this._deadParticles.push(new P(this));}this.particlesGeometry.setAttribute("position",new BufferAttribute(a,3)),u&&this.particlesGeometry.setAttribute("alpha",new BufferAttribute(u,1)),p&&this.particlesGeometry.setAttribute("color",new BufferAttribute(p,3)),d&&this.particlesGeometry.setAttribute("size",new BufferAttribute(d,1)),f&&this.particlesGeometry.setAttribute("rotation",new BufferAttribute(f,1)),this.particlesGeometry.setDrawRange(0,0),this.material.setBaseScale(e.scale||400);var m=new Points(this.particlesGeometry,this.material.material);m.sortParticles=r,this.particleSystem=m,this._positionDirty=!0,this._colorsDirty=Boolean(p),this._alphaDirty=Boolean(u),this._rotateDirty=Boolean(f);}},{key:"start",value:function(){var t=this.options.container;t?(this.addTo(t),this.hasStarted=!0):console.log("no container for particle system, aborting.");}},{key:"stop",value:function(){this.ttl=0;}},{key:"addEmitter",value:function(t){this._emitters.push(t);}},{key:"dispose",value:function(){this.particlesGeometry.dispose(),this.material.dispose();}},{key:"reset",value:function(){this.ttl=this.options.system.ttl,this.age=0,this._timeToUpdateBS=0;}},{key:"getWorldPosition",value:function(){var t=new Vector3$1;return this.particleSystem.getWorldPosition(t),t}},{key:"addTo",value:function(t){t.add(this.particleSystem);}},{key:"setColor",value:function(t,e){t*=3;var i=this.particlesGeometry.attributes.color.array;i[t]=e.r,i[t+1]=e.g,i[t+2]=e.b,this._colorsDirty=!0;}},{key:"setPosition",value:function(t,e){t*=3;var i=this.particlesGeometry.attributes.position.array;i[t]=e.x,i[t+1]=e.y,i[t+2]=e.z,this._positionDirty=!0;}},{key:"setAlpha",value:function(t,e){this.particlesGeometry.attributes.alpha.array[t]=e,this._alphaDirty=!0;}},{key:"setRotation",value:function(t,e){this.particlesGeometry.attributes.rotation.array[t]=e,this._rotateDirty=!0;}},{key:"setSize",value:function(t,e){this.particlesGeometry.attributes.size.array[t]=e,this._sizeDirty=!0;}},{key:"removeAndDisposeIfFinished",value:function(){return !!this.finished&&(this.removeSelf(),this.dispose(),!0)}},{key:"update",value:function(t){if(this.hasStarted){if(void 0===t){var e=(new Date).getTime()/1e3;t=e-this._lastTime||0,this._lastTime=e;}if(0!==t){void 0!==this.ttl&&this.ttl>0&&(this.ttl-=t),t*=this.speed,this.dt=t,this.age+=t;var i=this._aliveParticles.length;if(!this.ttlExpired)for(var n=0;n<this._emitters.length;++n){var r=this._emitters[n].update(t,this);r&&this.spawnParticles(r);}for(n=this._aliveParticles.length-1;n>=0;--n){var o=this._aliveParticles[n];o.update(n,t),o.finished&&(this._aliveParticles.splice(n,1),this._deadParticles.push(o));}i!==this._aliveParticles.length&&this.particlesGeometry.setDrawRange(0,this._aliveParticles.length),this.particlesGeometry.attributes.position.needsUpdate=this._positionDirty,this._needBoundingSphereUpdate=this._needBoundingSphereUpdate||this._positionDirty,this._positionDirty=!1,this._colorsDirty&&(this.particlesGeometry.attributes.color.needsUpdate=!0,this._colorsDirty=!1),this._alphaDirty&&(this.particlesGeometry.attributes.alpha.needsUpdate=!0,this._alphaDirty=!1),this._sizeDirty&&(this.particlesGeometry.attributes.size.needsUpdate=!0,this._sizeDirty=!1),this._rotateDirty&&(this.particlesGeometry.attributes.rotation.needsUpdate=!0,this._rotateDirty=!1),this._needBoundingSphereUpdate&&(this._timeToUpdateBS-=t,this._timeToUpdateBS<=0&&(this._timeToUpdateBS=.2,this.particlesGeometry.computeBoundingSphere())),this.finished||this.options.system.onUpdate&&this.options.system.onUpdate(this);}}}},{key:"spawnParticles",value:function(t){for(var e=0;e<t;++e){if(0===this._deadParticles.length)return;var i=this._deadParticles.pop();i.reset(),this._aliveParticles.push(i);}}},{key:"removeSelf",value:function(){this.particleSystem.parent&&this.particleSystem.parent.remove(this.particleSystem);}},{key:"finished",get:function(){return this.ttlExpired&&0===this.particlesCount}},{key:"ttlExpired",get:function(){return void 0!==this.ttl&&this.ttl<=0}},{key:"particlesCount",get:function(){return this._aliveParticles.length}},{key:"maxParticlesCount",get:function(){return this._aliveParticles.length+this._deadParticles.length}}]),i}(),k=function(){function t(e){p(this,t),this.options=e,e.interval=e.interval||1,this.age=0,this.timeToSpawn=Math.random()*A(e.interval);}return d(t,[{key:"update",value:function(t,e){var i=0;if(0===this.age&&this.options.onSpawnBurst&&(i+=A(this.options.onSpawnBurst)),this.age+=t,!this.options.onInterval)return i;(this.timeToSpawn-=t,this.timeToSpawn<=0&&(this.timeToSpawn=A(this.options.interval),i+=A(this.options.onInterval)),this.options.detoretingMinTtl&&e.ttl<this.options.detoretingMinTtl)&&(i*=e.ttl/this.options.detoretingMinTtl);return i}}]),t}(),B=function(){function t(){p(this,t);}return d(t,[{key:"generate",value:function(){throw new Error("Not implemented.")}}]),t}(),D=function(t){function i(t,n){var r;return p(this,i),(r=m(this,v(i).call(this))).min=t||new Vector3$1(-1,-1,-1),r.max=n||new Vector3$1(1,1,1),r}return f(i,B),d(i,[{key:"generate",value:function(){return z(this.min,this.max)}}]),i}();function G(){return 2*Math.random()-1}var U=function(t){function i(t,e,n,r,o){var s;return p(this,i),(s=m(this,v(i).call(this))).maxRadius=t||1,s.minRadius=e||0,s.scaler=n,s.minVector=r,s.maxVector=o,s}return f(i,B),d(i,[{key:"generate",value:function(){var t=new Vector3$1(G(),G(),G());return (this.minVector||this.maxVector)&&t.clamp(this.minVector||new Vector3$1(-1,-1,-1),this.maxVector||new Vector3$1(1,1,1)),t.normalize().multiplyScalar(g(this.minRadius,this.maxRadius)),this.scaler&&t.multiply(this.scaler),t}}]),i}(),W=function(e){function i(e,n){var r;return p(this,i),(r=m(this,v(i).call(this))).min=e||new Color$1(0,0,0),r.max=n||new Color$1(1,1,1),r}return f(i,B),d(i,[{key:"generate",value:function(){return S(this.min,this.max)}}]),i}(),I=function(t){function e(t,i){var n;return p(this,e),(n=m(this,v(e).call(this))).min=t,n.max=i,n}return f(e,B),d(e,[{key:"generate",value:function(){return g(this.min,this.max)}}]),e}(),N=Object.freeze({__proto__:null,Randomizer:B,BoxRandomizer:D,SphereRandomizer:U,ColorsRandomizer:W,MinMaxRandomizer:I});
|
|
87189
|
-
|
|
87212
|
+
var PostProcessing$1 = new PostProcessing();var three_proton_min = {exports: {}};var require$$0 = /*@__PURE__*/getAugmentedNamespace(three_module);/*!
|
|
87213
|
+
* three.proton v0.2.0
|
|
87214
|
+
* https://github.com/drawcall/three.proton
|
|
87215
|
+
*
|
|
87216
|
+
* Copyright 2011-2020, ajiemath
|
|
87217
|
+
* Licensed under the MIT license
|
|
87218
|
+
* http://www.opensource.org/licenses/mit-license
|
|
87219
|
+
*
|
|
87220
|
+
*/
|
|
87221
|
+
|
|
87222
|
+
(function (module, exports) {
|
|
87223
|
+
(function(a,b){module.exports=b(require$$0);})(commonjsGlobal,function(a){function bd(a,b,c,d){bd._super_.call(this),this.camera=a,this.renderer=b,this.dis=c||20,d=d||"1234";for(var e=1;e<5;e++)this["d"+e]=d.indexOf(e+"")>=0;this.name="ScreenZone";}function bc(a,c,d,e,f,g){var h,i,j,k,l,e;bc._super_.call(this),b.Util.isUndefined(c,d,e,f,g)?(h=i=j=0,k=l=e=a||100):b.Util.isUndefined(e,f,g)?(h=i=j=0,k=a,l=c,e=d):(h=a,i=c,j=d,k=e,l=f,e=g),this.x=h,this.y=i,this.z=j,this.width=k,this.height=l,this.depth=e,this.friction=.85,this.max=6;}function bb(a,c,d){var e,f,g;bb._super_.call(this),b.Util.isUndefined(a,c,d)?e=f=g=0:(e=a,f=c,g=d),this.x=e,this.y=f,this.z=g;}function ba(b,c){ba._super_.call(this),b instanceof a.Geometry?this.geometry=b:this.geometry=b.geometry,this.scale=c||1;}function _(a,c,d,e){var f,i;_._super_.call(this),b.Util.isUndefined(c,d,e)?(f=0,i=a||100):(f=a,i=e),this.x=f,this.y=f,this.z=f,this.radius=i,this.tha=this.phi=0;}function $(a,c,d,e,f,g){$._super_.call(this),a instanceof b.Vector3D?(this.x1=a.x,this.y1=a.y,this.z1=a.z,this.x2=e.x,this.y2=e.y,this.z2=e.z):(this.x1=a,this.y1=c,this.z1=d,this.x2=e,this.y2=f,this.z2=g);}function Z(){this.vector=new b.Vector3D(0,0,0),this.random=0,this.crossType="dead",this.log=!0;}function Y(){Y._super_.call(this),this.targetPool=new b.Pool,this.materialPool=new b.Pool,this.name="CustomRender";}function X(b){X._super_.call(this,b),this._body=new a.Sprite(new a.SpriteMaterial({color:16777215})),this.name="SpriteRender";}function W(a){W._super_.call(this),this.points=a,this.name="PointsRender";}function V(c){V._super_.call(this),this.container=c,this._targetPool=new b.Pool,this._materialPool=new b.Pool,this._body=new a.Mesh(new a.BoxGeometry(50,50,50),new a.MeshLambertMaterial({color:"#ff0000"})),this.name="MeshRender";}function U(){this.name="BaseRender";}function R(a,c,d){this.mouseTarget=b.Util.initValue(a,window),this.ease=b.Util.initValue(c,.7),this._allowEmitting=!1,this.mouse=new b.Vector3D,this.initEventHandler(),R._super_.call(this,d);}function Q(a){this.selfBehaviours=[],Q._super_.call(this,a);}function P(a){this.initializes=[],this.particles=[],this.behaviours=[],this.currentEmitTime=0,this.totalEmitTimes=-1,this.damping=.006,this.bindEmitter=!0,this.rate=new b.Rate(1,.1),P._super_.call(this,a),this.id="emitter_"+P.ID++,this.cID=0,this.name="Emitter";}function O(a,b,c,d,e,f,g){O._super_.call(this,f,g),O.prototype.reset(a,b,c,d,e),this.name="Spring";}function N(a,b,c,d){N._super_.call(this,c,d),this.reset(a,b),this.name="Color";}function M(a,b,c,d,e){M._super_.call(this,d,e),this.reset(a,b,c),this.name="Rotate";}function L(a,b,c,d){L._super_.call(this,c,d),this.reset(a,b),this.name="Scale";}function K(a,b,c,d){K._super_.call(this,c,d),this.reset(a,b),this.name="Alpha";}function J(a,b,c,d){J._super_.call(this,c,d),this.reset(a,b),this.name="CrossZone";}function I(a,b,c,d,e){I._super_.call(this,d,e),this.reset(a,b,c),this.name="Collision";}function H(a,b,c){H._super_.call(this,0,-a,0,b,c),this.name="Gravity";}function G(a,b,c,d,e){G._super_.call(this,a,b,c,d,e),this.force*=-1,this.name="Repulsion";}function F(a,b,c,d,e,f){F._super_.call(this,e,f),this.reset(a,b,c,d),this.time=0,this.name="RandomDrift";}function E(a,c,d,e,f){E._super_.call(this,e,f),this.targetPosition=b.Util.initValue(a,new b.Vector3D),this.radius=b.Util.initValue(d,1e3),this.force=b.Util.initValue(this.normalizeValue(c),100),this.radiusSq=this.radius*this.radius,this.attractionForce=new b.Vector3D,this.lengthSq=0,this.name="Attraction";}function D(a,b,c,d,e){D._super_.call(this,d,e),D.prototype.reset.call(this,a,b,c),this.name="Force";}function C(a,c,d){C._super_.call(this),this.body=b.createArraySpan(a),this.w=c,this.h=b.Util.initValue(d,this.w);}function B(a,c,d){B._super_.call(this),this.radius=b.createSpan(a,c,d);}function A(a,c,d){A._super_.call(this),this.massPan=b.createSpan(a,c,d);}function z(a,c,d){z._super_.call(this),this.reset(a,c,d),this.dirVec=new b.Vector3D(0,0,0),this.name="Velocity";}function y(){y._super_.call(this),this.reset.apply(this,arguments);}function x(a,c,d){x._super_.call(this),this.lifePan=b.createSpan(a,c,d);}function v(){this.name="Initialize";}function u(a,c){this.numPan=b.createSpan(b.Util.initValue(a,1)),this.timePan=b.createSpan(b.Util.initValue(c,1)),this.startTime=0,this.nextTime=0,this.init();}function t(a,c){this.id="Behaviour_"+t.id++,this.life=b.Util.initValue(a,Infinity),this.easing=b.Util.initValue(c,b.ease.setEasingByName(b.ease.easeLinear)),this.age=0,this.energy=1,this.dead=!1,this.name="Behaviour";}function s(a,b,c,d,e,f){this.x=a,this.y=b,this.z=c,this.width=d,this.height=e,this.depth=f,this.bottom=this.y+this.height,this.right=this.x+this.width,this.right=this.x+this.width;}function q(a){this._arr=b.Util.isArray(a)?a:[a];}function p(a,c,d){this._isArray=!1,b.Util.isArray(a)?(this._isArray=!0,this.a=a):(this.a=b.Util.initValue(a,1),this.b=b.Util.initValue(c,this.a),this._center=b.Util.initValue(d,!1));}function j(){this.cID=0,this.list={};}function i(a){this.id="particle_"+i.ID++,this.name="Particle",this.reset("init"),b.Util.setPrototypeByObj(this,a);}function c(){this.initialize();}function b(a,c){this.preParticles=b.Util.initValue(a,b.POOL_MAX),this.integrationType=b.Util.initValue(c,b.EULER),this.emitters=[],this.renderers=[],this.pool=new b.Pool,b.integrator=new b.Integration(this.integrationType);}b.POOL_MAX=500,b.TIME_STEP=60,b.PI=3.142,b.DR=b.PI/180,b.MEASURE=100,b.EULER="euler",b.RK2="runge-kutta2",b.RK4="runge-kutta4",b.VERLET="verlet",b.PARTICLE_CREATED="partilcleCreated",b.PARTICLE_UPDATE="partilcleUpdate",b.PARTICLE_SLEEP="particleSleep",b.PARTICLE_DEAD="partilcleDead",b.PROTON_UPDATE="protonUpdate",b.PROTON_UPDATE_AFTER="protonUpdateAfter",b.EMITTER_ADDED="emitterAdded",b.EMITTER_REMOVED="emitterRemoved",b.bindEmtterEvent=!1,b.prototype={addRender:function(a){this.renderers.push(a),a.init(this);},removeRender:function(a){this.renderers.splice(this.renderers.indexOf(a),1),a.remove(this);},addEmitter:function(a){this.emitters.push(a),a.parent=this,this.dispatchEvent("EMITTER_ADDED",a);},removeEmitter:function(a){a.parent==this&&(this.emitters.splice(this.emitters.indexOf(a),1),a.parent=null,this.dispatchEvent("EMITTER_REMOVED",a));},update:function(a){this.dispatchEvent("PROTON_UPDATE",this);var b=a||.0167;if(b>0){var c=this.emitters.length;while(c--)this.emitters[c].update(b);}this.dispatchEvent("PROTON_UPDATE_AFTER",this);},getCount:function(){var a=0,b,c=this.emitters.length;for(b=0;b<c;b++)a+=this.emitters[b].particles.length;return a},destroy:function(){var a=0,b=this.emitters.length;for(a;a<b;a++)this.emitters[a].destroy(),delete this.emitters[a];this.emitters.length=0,this.pool.destroy();}},c.initialize=function(a){a.addEventListener=d.addEventListener,a.removeEventListener=d.removeEventListener,a.removeAllEventListeners=d.removeAllEventListeners,a.hasEventListener=d.hasEventListener,a.dispatchEvent=d.dispatchEvent;};var d=c.prototype;d._listeners=null,d.initialize=function(){},d.addEventListener=function(a,b){this._listeners?this.removeEventListener(a,b):this._listeners={},this._listeners[a]||(this._listeners[a]=[]),this._listeners[a].push(b);return b},d.removeEventListener=function(a,b){if(!!this._listeners){if(!this._listeners[a])return;var c=this._listeners[a];for(var d=0,e=c.length;d<e;d++)if(c[d]==b){e==1?delete this._listeners[a]:c.splice(d,1);break}}},d.removeAllEventListeners=function(a){a?this._listeners&&delete this._listeners[a]:this._listeners=null;},d.dispatchEvent=function(a,b){var c=!1,d=this._listeners;if(a&&d){var e=d[a];if(!e)return c;e=e.slice();var f,g=e.length;while(g--){var f=e[g];c=c||f(b);}}return !!c},d.hasEventListener=function(a){var b=this._listeners;return !!b&&!!b[a]},c.initialize(b.prototype),b.EventDispatcher=c;var e=e||{initValue:function(a,b){var a=a!=null&&a!=undefined?a:b;return a},isArray:function(a){return Object.prototype.toString.call(a)==="[object Array]"},destroyArray:function(a){a.length=0;},destroyObject:function(a){for(var b in a)delete a[b];},isUndefined:function(){for(var a in arguments){var b=arguments[a];if(b!==undefined)return !1}return !0},setVectorByObj:function(a,b){b.x!==undefined&&(a.p.x=b.x),b.y!==undefined&&(a.p.y=b.y),b.z!==undefined&&(a.p.z=b.z),b.vx!==undefined&&(a.v.x=b.vx),b.vy!==undefined&&(a.v.y=b.vy),b.vz!==undefined&&(a.v.z=b.vz),b.ax!==undefined&&(a.a.x=b.ax),b.ay!==undefined&&(a.a.y=b.ay),b.az!==undefined&&(a.a.z=b.az),b.p!==undefined&&a.p.copy(b.p),b.v!==undefined&&a.v.copy(b.v),b.a!==undefined&&a.a.copy(b.a),b.position!==undefined&&a.p.copy(b.position),b.velocity!==undefined&&a.v.copy(b.velocity),b.accelerate!==undefined&&a.a.copy(b.accelerate);},setPrototypeByObj:function(a,b,c){for(var d in b)a.hasOwnProperty(d)&&(c?c.indexOf(d)<0&&(a[d]=e._getValue(b[d])):a[d]=e._getValue(b[d]));return a},_getValue:function(a){return a instanceof p?a.getValue():a},inherits:function(a,b){a._super_=b;if(Object.create)a.prototype=Object.create(b.prototype,{constructor:{value:a}});else {var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a;}}};b.Util=e;var f=f||{getRGB:function(b){var c={};if(typeof b=="number")e=Math.floor(b),c.r=(b>>16&255)/255,c.g=(b>>8&255)/255,c.b=(b&255)/255;else if(typeof b=="string"){var d;if(d=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(b))c.r=Math.min(255,parseInt(d[1],10))/255,c.g=Math.min(255,parseInt(d[2],10))/255,c.b=Math.min(255,parseInt(d[3],10))/255;else if(d=/^\#([A-Fa-f0-9]+)$/.exec(b)){var e=d[1];c.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,c.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,c.b=parseInt(e.charAt(4)+e.charAt(5),16)/255;}}else b instanceof a.Color&&(c.r=b.r,c.g=b.g,c.b=b.b);return c}};b.ColorUtil=f;var g={toScreenPos:function(){var b=new a.Vector3;return function(a,c,d){b.copy(a),b.project(c),b.x=Math.round((b.x+1)*d.width/2),b.y=Math.round((-b.y+1)*d.height/2),b.z=0;return b}}(),toSpacePos:function(){var b=new a.Vector3,c=new a.Vector3,d;return function(a,e,f){b.set(a.x/f.width*2-1,-(a.y/f.height)*2+1,.5),b.unproject(e),c.copy(b.sub(e.position).normalize()),d=-e.position.z/c.z,b.copy(e.position),b.add(c.multiplyScalar(d));return b}}(),getTexture:function(){var c={};return function(d){if(d instanceof a.Texture)return d;if(typeof d=="string"){var e=b.PUID.hash(d);c[e]||(c[e]=new a.Texture(d));return c[e]}if(d instanceof Image){var e=b.PUID.hash(d.src);c[e]||(c[e]=new a.Texture(d));return c[e]}}}()};b.THREEUtil=g;var h=h||{_id:0,_uids:{},id:function(a){for(var b in this._uids)if(this._uids[b]==a)return b;var c="PUID_"+this._id++;this._uids[c]=a;return c},hash:function(a){return}};b.PUID=h,i.ID=0,i.prototype={getDirection:function(){return Math.atan2(this.v.x,-this.v.y)*(180/b.PI)},reset:function(a){this.life=Infinity,this.age=0,this.energy=1,this.dead=!1,this.sleep=!1,this.body=null,this.parent=null,this.mass=1,this.radius=10,this.alpha=1,this.scale=1,this.useColor=!1,this.useAlpha=!1,this.easing=b.ease.setEasingByName(b.ease.easeLinear),a?(this.p=new b.Vector3D,this.v=new b.Vector3D,this.a=new b.Vector3D,this.old={},this.old.p=this.p.clone(),this.old.v=this.v.clone(),this.old.a=this.a.clone(),this.behaviours=[],this.transform={},this.color={r:0,g:0,b:0},this.rotation=new b.Vector3D):(this.p.set(0,0,0),this.v.set(0,0,0),this.a.set(0,0,0),this.old.p.set(0,0,0),this.old.v.set(0,0,0),this.old.a.set(0,0,0),this.color.r=0,this.color.g=0,this.color.b=0,this.rotation.clear(),b.Util.destroyObject(this.transform),this.removeAllBehaviours());return this},update:function(a,b){if(!this.sleep){this.age+=a;var c=this.behaviours.length;while(c--)this.behaviours[c]&&this.behaviours[c].applyBehaviour(this,a,b);}if(this.age>=this.life)this.destroy();else {var d=this.easing(this.age/this.life);this.energy=Math.max(1-d,0);}},addBehaviour:function(a){this.behaviours.push(a),a.initialize(this);},addBehaviours:function(a){var b=a.length;while(b--)this.addBehaviour(a[b]);},removeBehaviour:function(a){var b=this.behaviours.indexOf(a);b>-1&&this.behaviours.splice(b,1);},removeAllBehaviours:function(){b.Util.destroyArray(this.behaviours);},destroy:function(){this.removeAllBehaviours(),this.energy=0,this.dead=!0,this.parent=null;}},b.Particle=i,j.prototype={create:function(a){this.cID++;return typeof a=="function"?new a:a.clone()},getCount:function(){var a=0;for(var b in this.list)a+=this.list[b].length;return a++},get:function(a){var c,d=a.__puid||b.PUID.id(a);this.list[d]&&this.list[d].length>0?c=this.list[d].pop():c=this.create(a),c.__puid=a.__puid||d;return c},expire:function(a){return this._getList(a.__puid).push(a)},destroy:function(){for(var a in this.list)this.list[a].length=0,delete this.list[a];},_getList:function(a){a=a||"default",this.list[a]||(this.list[a]=[]);return this.list[a]}},b.Pool=j;var k={randomAToB:function(a,b,c){return c?(Math.random()*(b-a)>>0)+a:a+Math.random()*(b-a)},randomFloating:function(a,b,c){return k.randomAToB(a-b,a+b,c)},randomZone:function(a){},degreeTransform:function(a){return a*b.PI/180},toColor16:function(a){return "#"+a.toString(16)},randomColor:function(){return "#"+("00000"+(Math.random()*16777216<<0).toString(16)).slice(-6)},lerp:function(a,b,c){return b+(a-b)*c},getNormal:function(a,b){a.x==0&&a.y==0?a.z==0?b.set(1,0,1):b.set(1,1,-a.y/a.z):a.x==0?b.set(1,0,1):b.set(-a.y/a.x,1,1);return b.normalize()},axisRotate:function(a,b,c,d){var e=Math.cos(d),f=Math.sin(d),g=c.dot(b)*(1-e);a.copy(c),a.cross(b).scalar(f),a.addValue(b.x*e,b.y*e,b.z*e),a.addValue(c.x*g,c.y*g,c.z*g);}};b.MathUtils=k;var m=function(a){this.type=b.Util.initValue(a,b.EULER);};m.prototype={integrate:function(a,b,c){this.euler(a,b,c);},euler:function(a,b,c){a.sleep||(a.old.p.copy(a.p),a.old.v.copy(a.v),a.a.scalar(1/a.mass),a.v.add(a.a.scalar(b)),a.p.add(a.old.v.scalar(b)),c&&a.v.scalar(c),a.a.clear());}},b.Integration=m;var n=function(a,b,c){this.x=a||0,this.y=b||0,this.z=c||0;};n.prototype={set:function(a,b,c){this.x=a,this.y=b,this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},getGradient:function(){if(this.x!=0)return Math.atan2(this.y,this.x);if(this.y>0)return b.PI/2;if(this.y<0)return -b.PI/2},copy:function(a){this.x=a.x,this.y=a.y,this.z=a.z;return this},add:function(a,b){if(b!==undefined)return this.addVectors(a,b);this.x+=a.x,this.y+=a.y,this.z+=a.z;return this},addValue:function(a,b,c){this.x+=a,this.y+=b,this.z+=c;return this},addVectors:function(a,b){this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z;return this},addScalar:function(a){this.x+=a,this.y+=a,this.z+=a;return this},sub:function(a,b){if(b!==undefined)return this.subVectors(a,b);this.x-=a.x,this.y-=a.y,this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z;return this},scalar:function(a){this.x*=a,this.y*=a,this.z*=a;return this},divideScalar:function(a){a!==0?(this.x/=a,this.y/=a,this.z/=a):this.set(0,0,0);return this},negate:function(){return this.scalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},cross:function(a){var b=this.x,c=this.y,d=this.z;this.x=c*a.z-d*a.y,this.y=d*a.x-b*a.z,this.z=b*a.y-c*a.x;return this},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g,this.y=e*f-c*h,this.z=c*g-d*f;return this},eulerFromDir:function(a){},applyEuler:function(){var a;return function(c){a===undefined&&(a=new b.Quaternion),this.applyQuaternion(a.setFromEuler(c));return this}}(),applyAxisAngle:function(){var a;return function(c,d){a===undefined&&(a=new b.Quaternion),this.applyQuaternion(a.setFromAxisAngle(c,d));return this}}(),applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z,h=a.w,i=h*b+f*d-g*c,j=h*c+g*b-e*d,k=h*d+e*c-f*b,l=-e*b-f*c-g*d;this.x=i*h+l*-e+j*-g-k*-f,this.y=j*h+l*-f+k*-e-i*-g,this.z=k*h+l*-g+i*-f-j*-e;return this},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y,d=this.z-a.z;return b*b+c*c+d*d},lerp:function(a,b){this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},clear:function(){this.x=0,this.y=0,this.z=0;return this},clone:function(){return new b.Vector3D(this.x,this.y,this.z)},toString:function(){return "x:"+this.x+"y:"+this.y+"z:"+this.z}},b.Vector3D=n;var o=function(a,b,c){this.radius=a||1,this.phi=c||0,this.theta=b||0;};o.prototype={set:function(a,b,c){this.radius=a||1,this.phi=c||0,this.theta=b||0;return this},setRadius:function(a){this.radius=a;return this},setPhi:function(a){this.phi=a;return this},setTheta:function(a){this.theta=a;return this},copy:function(a){this.radius=a.radius,this.phi=a.phi,this.theta=a.theta;return this},toVector3D:function(){return new b.Vector3D(this.getX(),this.getY(),this.getZ())},getX:function(){return this.radius*Math.sin(this.theta)*Math.cos(this.phi)},getY:function(){return -this.radius*Math.sin(this.theta)*Math.sin(this.phi)},getZ:function(){return this.radius*Math.cos(this.theta)},normalize:function(){this.radius=1;return this},equals:function(a){return a.radius===this.radius&&a.phi===this.phi&&a.theta===this.theta},clear:function(){this.radius=0,this.phi=0,this.theta=0;return this},clone:function(){return new o(this.radius,this.phi,this.theta)}},b.Polar3D=o,p.prototype={getValue:function(a){return this._isArray?this.a[this.a.length*Math.random()>>0]:this._center?b.MathUtils.randomFloating(this.a,this.b,a):b.MathUtils.randomAToB(this.a,this.b,a)}},b.createSpan=function(a,b,c){if(a instanceof p)return a;return b===undefined?new p(a):c===undefined?new p(a,b):new p(a,b,c)},b.Span=p,b.Util.inherits(q,b.Span),q.prototype.getValue=function(){var a=this._arr[this._arr.length*Math.random()>>0];return a=="random"||a=="Random"?b.MathUtils.randomColor():a},b.createArraySpan=function(a){if(!a)return null;return a instanceof b.ArraySpan?a:new b.ArraySpan(a)},b.ArraySpan=q;var r=function(a,b,c,d){this.x=a||0,this.y=b||0,this.z=c||0,this.w=d!==undefined?d:1;};r.prototype={set:function(a,b,c,d){this.x=a,this.y=b,this.z=c,this.w=d;return this},clone:function(){return new b.Quaternion(this.x,this.y,this.z,this.w)},copy:function(a){this.x=a.x,this.y=a.y,this.z=a.z,this.w=a.w;return this},setFromEuler:function(a){var b=Math.cos(a.x/2),c=Math.cos(a.y/2),d=Math.cos(a.z/2),e=Math.sin(a.x/2),f=Math.sin(a.y/2),g=Math.sin(a.z/2);this.x=e*c*d+b*f*g,this.y=b*f*d-e*c*g,this.z=b*c*g+e*f*d,this.w=b*c*d-e*f*g;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this.x=a.x*d,this.y=a.y*d,this.z=a.z*d,this.w=Math.cos(c);return this},normalize:function(){var a=this.length();a===0?(this.x=0,this.y=0,this.z=0,this.w=1):(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w}},b.Quaternion=r,s.prototype={contains:function(a,b,c){return a<=this.right&&a>=this.x&&b<=this.bottom&&b>=this.y&&c<=this.depth&&c>=this.z?!0:!1}},b.Box=s,t.id=0,t.prototype={reset:function(a,c){this.life=b.Util.initValue(a,Infinity),this.easing=b.Util.initValue(c,b.ease.setEasingByName(b.ease.easeLinear));},normalizeForce:function(a){return a.scalar(b.MEASURE)},normalizeValue:function(a){return a*b.MEASURE},initialize:function(a){},applyBehaviour:function(a,b,c){if(!this.dead){this.age+=b;if(this.age>=this.life){this.energy=0,this.dead=!0;return}var d=this.easing(a.age/a.life);this.energy=Math.max(1-d,0);}},destroy:function(){}},b.Behaviour=t,u.prototype={init:function(){this.startTime=0,this.nextTime=this.timePan.getValue();},getValue:function(a){this.startTime+=a;if(this.startTime>=this.nextTime){this.init();return this.numPan.b==1?this.numPan.getValue("Float")>.5?1:0:this.numPan.getValue("Int")}return 0}},b.Rate=u,v.prototype.reset=function(){},v.prototype.init=function(a,b){b?this.initialize(b):this.initialize(a);},v.prototype.initialize=function(a){},b.Initialize=v;var w={initialize:function(a,c,d){var e=d.length;while(e--){var f=d[e];f instanceof b.Initialize?f.init(a,c):w.init(a,c,f);}w.bindEmitter(a,c);},init:function(a,c,d){b.Util.setPrototypeByObj(c,d),b.Util.setVectorByObj(c,d);},bindEmitter:function(a,b){a.bindEmitter&&(b.p.add(a.p),b.v.add(a.v),b.a.add(a.a),b.v.applyEuler(a.rotation));}};b.InitializeUtil=w,b.Util.inherits(x,b.Initialize),x.prototype.initialize=function(a){this.lifePan.a==Infinity||this.lifePan.a=="infi"?a.life=Infinity:a.life=this.lifePan.getValue();},b.Life=x,b.Util.inherits(y,b.Initialize),y.prototype.reset=function(){this.zones?this.zones.length=0:this.zones=[];var a=Array.prototype.slice.call(arguments);this.zones=this.zones.concat(a);},y.prototype.addZone=function(){var a=Array.prototype.slice.call(arguments);this.zones=this.zones.concat(a);},y.prototype.initialize=function(){return function(a){var b=this.zones[Math.random()*this.zones.length>>0];b.getPosition(),a.p.x=b.vector.x,a.p.y=b.vector.y,a.p.z=b.vector.z;}}(),b.Position=y,b.P=y,b.Util.inherits(z,b.Initialize),z.prototype.reset=function(a,c,d){a instanceof b.Vector3D?(this.radiusPan=b.createSpan(1),this.dir=a.clone(),this.tha=c*b.DR,this._useV=!0):a instanceof b.Polar3D?(this.tha=c*b.DR,this.dirVec=a.toVector3D(),this._useV=!1):(this.radiusPan=b.createSpan(a),this.dir=c.clone().normalize(),this.tha=d*b.DR,this._useV=!0);},z.prototype.normalize=function(a){return a*b.MEASURE},z.prototype.initialize=function(){var a,c=new b.Vector3D(0,0,1),d=new b.Vector3D(0,0,0);return function(e){a=this.tha*Math.random(),this._useV&&this.dirVec.copy(this.dir).scalar(this.radiusPan.getValue()),b.MathUtils.getNormal(this.dirVec,c),d.copy(this.dirVec).applyAxisAngle(c,a),d.applyAxisAngle(this.dirVec.normalize(),Math.random()*b.PI*2),e.v.copy(d);return this}}(),b.Velocity=z,b.V=z,b.Util.inherits(A,b.Initialize),A.prototype.initialize=function(a){a.mass=this.massPan.getValue();},b.Mass=A,b.Util.inherits(B,b.Initialize),B.prototype.reset=function(a,c,d){this.radius=b.createSpan(a,c,d);},B.prototype.initialize=function(a){a.radius=this.radius.getValue(),a.transform.oldRadius=a.radius;},b.Radius=B,b.Util.inherits(C,b.Initialize),C.prototype.initialize=function(a){var b=this.body.getValue();this.w?a.body={width:this.w,height:this.h,body:b}:a.body=b;},b.Body=C,b.Util.inherits(D,b.Behaviour),D.prototype.reset=function(a,c,d){this.force=this.normalizeForce(new b.Vector3D(a,c,d)),this.force.id=Math.random();},D.prototype.applyBehaviour=function(a,b,c){D._super_.prototype.applyBehaviour.call(this,a,b,c),a.a.add(this.force);},b.F=b.Force=D,b.Util.inherits(E,b.Behaviour),E.prototype.reset=function(a,c,d,e,f){this.targetPosition=b.Util.initValue(a,new b.Vector3D),this.radius=b.Util.initValue(d,1e3),this.force=b.Util.initValue(this.normalizeValue(c),100),this.radiusSq=this.radius*this.radius,this.attractionForce=new b.Vector3D,this.lengthSq=0,e&&E._super_.prototype.reset.call(this,e,f);},E.prototype.applyBehaviour=function(a,b,c){E._super_.prototype.applyBehaviour.call(this,a,b,c),this.attractionForce.copy(this.targetPosition),this.attractionForce.sub(a.p),this.lengthSq=this.attractionForce.lengthSq(),this.lengthSq>4e-6&&this.lengthSq<this.radiusSq&&(this.attractionForce.normalize(),this.attractionForce.scalar(1-this.lengthSq/this.radiusSq),this.attractionForce.scalar(this.force),a.a.add(this.attractionForce));},b.Attraction=E,b.Util.inherits(F,b.Behaviour),F.prototype.reset=function(a,c,d,e,f,g){this.randomFoce=this.normalizeForce(new b.Vector3D(a,c,d)),this.delayPan=b.createSpan(e||.03),this.time=0,f&&F._super_.prototype.reset.call(this,f,g);},F.prototype.applyBehaviour=function(a,c,d){F._super_.prototype.applyBehaviour.call(this,a,c,d),this.time+=c;if(this.time>=this.delayPan.getValue()){var e=b.MathUtils.randomAToB(-this.randomFoce.x,this.randomFoce.x),f=b.MathUtils.randomAToB(-this.randomFoce.y,this.randomFoce.y),g=b.MathUtils.randomAToB(-this.randomFoce.z,this.randomFoce.z);a.a.addValue(e,f,g),this.time=0;}},b.RandomDrift=F,b.Util.inherits(G,b.Attraction),G.prototype.reset=function(a,b,c,d,e){G._super_.prototype.reset.call(this,a,b,c,d,e),this.force*=-1;},b.Repulsion=G,b.Util.inherits(H,b.Force),H.prototype.reset=function(a,b,c){H._super_.prototype.reset.call(this,0,-a,0,b,c);},b.Gravity=H,b.G=H,b.Util.inherits(I,b.Behaviour),I.prototype.reset=function(a,c,d,e,f){this.emitter=a,this.useMass=c,this.callback=d,this.particles=[],this.delta=new b.Vector3D,e&&I._super_.prototype.reset.call(this,e,f);},I.prototype.applyBehaviour=function(a,b,c){var d=this.emitter?this.emitter.particles.slice(c):this.particles.slice(c),e,f,g,h,i,j,k=d.length;while(k--){e=d[k];if(e==a)continue;this.delta.copy(e.p).sub(a.p),f=this.delta.lengthSq(),h=a.radius+e.radius,f<=h*h&&(g=h-Math.sqrt(f),g+=.5,i=this._getAverageMass(a,e),j=this._getAverageMass(e,a),a.p.add(this.delta.clone().normalize().scalar(g*-i)),e.p.add(this.delta.normalize().scalar(g*j)),this.callback&&this.callback(a,e));}},I.prototype._getAverageMass=function(a,b){return this.useMass?b.mass/(a.mass+b.mass):.5},b.Collision=I,b.Util.inherits(J,b.Behaviour),J.prototype.reset=function(a,c,d,e){var f,g;typeof a=="string"?(g=a,f=c):(g=c,f=a),this.zone=f,this.zone.crossType=b.Util.initValue(g,"dead"),d&&J._super_.prototype.reset.call(this,d,e);},J.prototype.applyBehaviour=function(a,b,c){J._super_.prototype.applyBehaviour.call(this,a,b,c),this.zone.crossing.call(this.zone,a);},b.CrossZone=J,b.Util.inherits(K,b.Behaviour),K.prototype.reset=function(a,c,d,e){c==null||c==undefined?this._same=!0:this._same=!1,this.a=b.createSpan(b.Util.initValue(a,1)),this.b=b.createSpan(c),d&&K._super_.prototype.reset.call(this,d,e);},K.prototype.initialize=function(a){a.useAlpha=!0,a.transform.alphaA=this.a.getValue(),this._same?a.transform.alphaB=a.transform.alphaA:a.transform.alphaB=this.b.getValue();},K.prototype.applyBehaviour=function(a,c,d){K._super_.prototype.applyBehaviour.call(this,a,c,d),a.alpha=b.MathUtils.lerp(a.transform.alphaA,a.transform.alphaB,this.energy),a.alpha<.002&&(a.alpha=0);},b.Alpha=K,b.Util.inherits(L,b.Behaviour),L.prototype.reset=function(a,c,d,e){c==null||c==undefined?this._same=!0:this._same=!1,this.a=b.createSpan(b.Util.initValue(a,1)),this.b=b.createSpan(c),d&&L._super_.prototype.reset.call(this,d,e);},L.prototype.initialize=function(a){a.transform.scaleA=this.a.getValue(),a.transform.oldRadius=a.radius,this._same?a.transform.scaleB=a.transform.scaleA:a.transform.scaleB=this.b.getValue();},L.prototype.applyBehaviour=function(a,c,d){L._super_.prototype.applyBehaviour.call(this,a,c,d),a.scale=b.MathUtils.lerp(a.transform.scaleA,a.transform.scaleB,this.energy),a.scale<5e-4&&(a.scale=0),a.radius=a.transform.oldRadius*a.scale;},b.Scale=L,b.Util.inherits(M,b.Behaviour),M.prototype.reset=function(a,c,d,e,f){this.a=a||0,this.b=c||0,this.c=d||0,a===undefined||a=="same"?this._type="same":c==undefined?this._type="set":d===undefined?this._type="to":(this._type="add",this.a=b.createSpan(this.a*b.DR),this.b=b.createSpan(this.b*b.DR),this.c=b.createSpan(this.c*b.DR)),e&&M._super_.prototype.reset.call(this,e,f);},M.prototype.initialize=function(a){switch(this._type){case"same":break;case"set":this._setRotation(a.rotation,this.a);break;case"to":a.transform.fR=a.transform.fR||new b.Vector3D,a.transform.tR=a.transform.tR||new b.Vector3D,this._setRotation(a.transform.fR,this.a),this._setRotation(a.transform.tR,this.b);break;case"add":a.transform.addR=new b.Vector3D(this.a.getValue(),this.b.getValue(),this.c.getValue());}},M.prototype._setRotation=function(a,c){a=a||new b.Vector3D;if(c=="random"){var d=b.MathUtils.randomAToB(-b.PI,b.PI),e=b.MathUtils.randomAToB(-b.PI,b.PI),f=b.MathUtils.randomAToB(-b.PI,b.PI);a.set(d,e,f);}else c instanceof b.Vector3D&&a.copy(c);},M.prototype.applyBehaviour=function(a,c,d){M._super_.prototype.applyBehaviour.call(this,a,c,d);switch(this._type){case"same":a.rotation||(a.rotation=new b.Vector3D),a.rotation.eulerFromDir(a.v);break;case"set":break;case"to":a.rotation.x=b.MathUtils.lerp(a.transform.fR.x,a.transform.tR.x,this.energy),a.rotation.y=b.MathUtils.lerp(a.transform.fR.y,a.transform.tR.y,this.energy),a.rotation.z=b.MathUtils.lerp(a.transform.fR.z,a.transform.tR.z,this.energy);break;case"add":a.rotation.add(a.transform.addR);}},b.Rotate=M,b.Util.inherits(N,b.Behaviour),N.prototype.reset=function(a,c,d,e){c==null||c==undefined?this._same=!0:this._same=!1,this.a=b.createArraySpan(a),this.b=b.createArraySpan(c),d&&N._super_.prototype.reset.call(this,d,e);},N.prototype.initialize=function(a){a.transform.colorA=b.ColorUtil.getRGB(this.a.getValue()),a.useColor=!0,this._same?a.transform.colorB=a.transform.colorA:a.transform.colorB=b.ColorUtil.getRGB(this.b.getValue());},N.prototype.applyBehaviour=function(a,c,d){N._super_.prototype.applyBehaviour.call(this,a,c,d),this._same?(a.color.r=a.transform.colorA.r,a.color.g=a.transform.colorA.g,a.color.b=a.transform.colorA.b):(a.color.r=b.MathUtils.lerp(a.transform.colorA.r,a.transform.colorB.r,this.energy),a.color.g=b.MathUtils.lerp(a.transform.colorA.g,a.transform.colorB.g,this.energy),a.color.b=b.MathUtils.lerp(a.transform.colorA.b,a.transform.colorB.b,this.energy));},b.Color=N,b.Util.inherits(O,b.Behaviour),O.prototype.reset=function(a,c,d,e,f){this.pos?this.pos.set(a,c,d):this.pos=new b.Vector3D(a,c,d),this.spring=e||.1,this.friction=f||.98;},O.prototype.applyBehaviour=function(a,b,c){O._super_.prototype.applyBehaviour.call(this,a,b,c),a.v.x+=(this.pos.x-a.p.x)*this.spring,a.v.y+=(this.pos.y-a.p.y)*this.spring,a.v.z+=(this.pos.z-a.p.z)*this.spring;},b.Spring=O,P.ID=0,b.Util.inherits(P,b.Particle),b.EventDispatcher.initialize(P.prototype),P.prototype.emit=function(a,c){this.currentEmitTime=0,this.totalEmitTimes=b.Util.initValue(a,Infinity),c==!0||c=="life"||c=="destroy"?this.life=a=="once"?1:this.totalEmitTimes:isNaN(c)||(this.life=c),this.rate.init();},P.prototype.stopEmit=function(){this.totalEmitTimes=-1,this.currentEmitTime=0;},P.prototype.removeAllParticles=function(){var a=this.particles.length;while(a--)this.particles[a].dead=!0;},P.prototype.createParticle=function(a,c){var d=this.parent.pool.get(b.Particle);this.setupParticle(d,a,c),this.parent&&this.parent.dispatchEvent("PARTICLE_CREATED",d),b.bindEmtterEvent&&this.dispatchEvent("PARTICLE_CREATED",d);return d},P.prototype.addSelfInitialize=function(a){a.init?a.init(this):this.initAll();},P.prototype.addInitialize=function(){var a=arguments.length;while(a--)this.initializes.push(arguments[a]);},P.prototype.removeInitialize=function(a){var b=this.initializes.indexOf(a);b>-1&&this.initializes.splice(b,1);},P.prototype.removeInitializers=function(){b.Util.destroyArray(this.initializes);},P.prototype.addBehaviour=function(){var a=arguments.length;while(a--)this.behaviours.push(arguments[a]);},P.prototype.removeBehaviour=function(a){var b=this.behaviours.indexOf(a);b>-1&&this.behaviours.splice(b,1);},P.prototype.removeAllBehaviours=function(){b.Util.destroyArray(this.behaviours);},P.prototype.integrate=function(a){var c=1-this.damping;b.integrator.integrate(this,a,c);var d=this.particles.length;while(d--){var e=this.particles[d];e.update(a,d),b.integrator.integrate(e,a,c),this.parent&&this.parent.dispatchEvent("PARTICLE_UPDATE",e),b.bindEmtterEvent&&this.dispatchEvent("PARTICLE_UPDATE",e);}},P.prototype.emitting=function(a){if(this.totalEmitTimes=="once"){var b=this.rate.getValue(99999);b>0&&(this.cID=b);while(b--)this.createParticle();this.totalEmitTimes="none";}else if(!isNaN(this.totalEmitTimes)){this.currentEmitTime+=a;if(this.currentEmitTime<this.totalEmitTimes){var b=this.rate.getValue(a);b>0&&(this.cID=b);while(b--)this.createParticle();}}},P.prototype.update=function(a){this.age+=a,(this.dead||this.age>=this.life)&&this.destroy(),this.emitting(a),this.integrate(a);var c,d=this.particles.length;while(d--)c=this.particles[d],c.dead&&(this.parent&&this.parent.dispatchEvent("PARTICLE_DEAD",c),b.bindEmtterEvent&&this.dispatchEvent("PARTICLE_DEAD",c),this.parent.pool.expire(c.reset()),this.particles.splice(d,1));},P.prototype.setupParticle=function(a,c,d){var e=this.initializes,f=this.behaviours;c&&(b.Util.isArray(c)?e=c:e=[c]),d&&(b.Util.isArray(d)?f=d:f=[d]),b.InitializeUtil.initialize(this,a,e),a.addBehaviours(f),a.parent=this,this.particles.push(a);},P.prototype.destroy=function(){this.dead=!0,this.energy=0,this.totalEmitTimes=-1,this.particles.length==0&&(this.removeInitializers(),this.removeAllBehaviours(),this.parent&&this.parent.removeEmitter(this));},b.Emitter=P,b.Util.inherits(Q,b.Emitter),Q.prototype.addSelfBehaviour=function(){var a=arguments.length,b;for(b=0;b<a;b++)this.selfBehaviours.push(arguments[b]);},Q.prototype.removeSelfBehaviour=function(a){var b=this.selfBehaviours.indexOf(a);b>-1&&this.selfBehaviours.splice(b,1);},Q.prototype.update=function(a){Q._super_.prototype.update.call(this,a);if(!this.sleep){var b=this.selfBehaviours.length,c;for(c=0;c<b;c++)this.selfBehaviours[c].applyBehaviour(this,a,c);}},b.BehaviourEmitter=Q,b.Util.inherits(R,b.Emitter),R.prototype.initEventHandler=function(){var a=this;this.mousemoveHandler=function(b){a.mousemove.call(a,b);},this.mousedownHandler=function(b){a.mousedown.call(a,b);},this.mouseupHandler=function(b){a.mouseup.call(a,b);},this.mouseTarget.addEventListener("mousemove",this.mousemoveHandler,!1);},R.prototype.emit=function(){this._allowEmitting=!0;},R.prototype.stopEmit=function(){this._allowEmitting=!1;},R.prototype.setCameraAndCanvas=function(a,b){this.camera=a,this.canvas=b;},R.prototype.setCameraAndRenderer=function(a,b){this.camera=a,this.renderer=b,this.canvas=b.domElement;},R.prototype.mousemove=function(a){var c=this.canvas.getBoundingClientRect(),d=a.clientX-c.left,e=a.clientY-c.top,f=this.renderer?this.renderer.getPixelRatio():1;d*=f,e*=f,this.mouse.x+=(d-this.mouse.x)*this.ease,this.mouse.y+=(e-this.mouse.y)*this.ease,this.p.copy(b.THREEUtil.toSpacePos(this.mouse,this.camera,this.canvas,this.renderer)),this._allowEmitting&&R._super_.prototype.emit.call(this,"once");},R.prototype.destroy=function(){R._super_.prototype.destroy.call(this),this.mouseTarget.removeEventListener("mousemove",this.mousemoveHandler,!1);},b.FollowEmitter=R;var S=S||{easeLinear:function(a){return a},easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return -(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){if((a/=.5)<1)return .5*Math.pow(a,2);return -0.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){if((a/=.5)<1)return .5*Math.pow(a,3);return .5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return -(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){if((a/=.5)<1)return .5*Math.pow(a,4);return -0.5*((a-=2)*Math.pow(a,3)-2)},easeInSine:function(a){return -Math.cos(a*(b.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(b.PI/2))},easeInOutSine:function(a){return -0.5*(Math.cos(b.PI*a)-1)},easeInExpo:function(a){return a===0?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return a===1?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){if(a===0)return 0;if(a===1)return 1;if((a/=.5)<1)return .5*Math.pow(2,10*(a-1));return .5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return -(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){if((a/=.5)<1)return -0.5*(Math.sqrt(1-a*a)-1);return .5*(Math.sqrt(1-(a-=2)*a)+1)},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return (a=a-1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;if((a/=.5)<1)return .5*a*a*(((b*=1.525)+1)*a-b);return .5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},setEasingByName:function(a){return S[a]?S[a]:S.easeLinear}};for(var T in S)T!="setEasingByName"&&(b[T]=S[T]);b.ease=S,U.prototype={init:function(a){var b=this;this.proton=a,this.proton.addEventListener("PROTON_UPDATE",function(a){b.onProtonUpdate.call(b,a);}),this.proton.addEventListener("PARTICLE_CREATED",function(a){b.onParticleCreated.call(b,a);}),this.proton.addEventListener("PARTICLE_UPDATE",function(a){b.onParticleUpdate.call(b,a);}),this.proton.addEventListener("PARTICLE_DEAD",function(a){b.onParticleDead.call(b,a);});},remove:function(a){this.proton=null;},onParticleCreated:function(a){},onParticleUpdate:function(a){},onParticleDead:function(a){},onProtonUpdate:function(a){}},b.BaseRender=U,b.Util.inherits(V,b.BaseRender),V.prototype.onProtonUpdate=function(){},V.prototype.onParticleCreated=function(a){if(!a.target){a.body||(a.body=this._body),a.target=this._targetPool.get(a.body);if(a.useAlpha||a.useColor)a.target.material.__puid=b.PUID.id(a.body.material),a.target.material=this._materialPool.get(a.target.material);}a.target&&(a.target.position.copy(a.p),this.container.add(a.target));},V.prototype.onParticleUpdate=function(a){a.target&&(a.target.position.copy(a.p),a.target.rotation.set(a.rotation.x,a.rotation.y,a.rotation.z),this.scale(a),a.useAlpha&&(a.target.material.opacity=a.alpha,a.target.material.transparent=!0),a.useColor&&a.target.material.color.copy(a.color));},V.prototype.scale=function(a){a.target.scale.set(a.scale,a.scale,a.scale);},V.prototype.onParticleDead=function(a){a.target&&((a.useAlpha||a.useColor)&&this._materialPool.expire(a.target.material),this._targetPool.expire(a.target),this.container.remove(a.target),a.target=null);},b.MeshRender=V,b.Util.inherits(W,b.BaseRender),W.prototype.onProtonUpdate=function(){},W.prototype.onParticleCreated=function(b){b.target||(b.target=new a.Vector3),b.target.copy(b.p),this.points.geometry.vertices.push(b.target);},W.prototype.onParticleUpdate=function(a){a.target&&a.target.copy(a.p);},W.prototype.onParticleDead=function(a){if(a.target){var b=this.points.geometry.vertices.indexOf(a.target);b>-1&&this.points.geometry.vertices.splice(b,1),a.target=null;}},b.PointsRender=W,b.Util.inherits(X,b.MeshRender),X.prototype.scale=function(a){a.target.scale.set(a.scale*a.radius,a.scale*a.radius,1);},b.SpriteRender=X,b.Util.inherits(Y,b.BaseRender),Y.prototype.onProtonUpdate=function(){},Y.prototype.onParticleCreated=function(a){},Y.prototype.onParticleUpdate=function(a){},Y.prototype.onParticleDead=function(a){},b.CustomRender=Y,Z.prototype={getPosition:function(){return null},crossing:function(a){switch(this.crossType){case"bound":this._bound(a);break;case"cross":this._cross(a);break;case"dead":this._dead(a);}},_dead:function(a){},_bound:function(a){},_cross:function(a){}},b.Zone=Z,b.Util.inherits($,b.Zone),$.prototype.getPosition=function(){this.random=Math.random(),this.vector.x=this.x1+this.random*(this.x2-this.x1),this.vector.y=this.y1+this.random*(this.y2-this.y1),this.vector.z=this.z1+this.random*(this.z2-this.z1);return this.vector},$.prototype.crossing=function(a){this.log&&(console.error("Sorry LineZone does not support crossing method"),this.log=!1);},b.LineZone=$,b.Util.inherits(_,b.Zone),_.prototype.getPosition=function(){var a,c,d;return function(){this.random=Math.random(),d=this.random*this.radius,a=b.PI*Math.random(),c=b.PI*2*Math.random(),this.vector.x=this.x+d*Math.sin(a)*Math.cos(c),this.vector.y=this.y+d*Math.sin(c)*Math.sin(a),this.vector.z=this.z+d*Math.cos(a);return this.vector}}(),_.prototype._dead=function(a){var b=a.p.distanceTo(this);b-a.radius>this.radius&&(a.dead=!0);},_.prototype._bound=function(){var a=new b.Vector3D,c=new b.Vector3D,d;return function(b){var e=b.p.distanceTo(this);e+b.radius>=this.radius&&(a.copy(b.p).sub(this).normalize(),c.copy(b.v),d=2*c.dot(a),b.v.sub(a.scalar(d)));}}(),_.prototype._cross=function(a){this.log&&(console.error("Sorry SphereZone does not support _cross method"),this.log=!1);},b.SphereZone=_,b.Util.inherits(ba,b.Zone),ba.prototype.getPosition=function(){var a=this.geometry.vertices,b=a[a.length*Math.random()>>0];this.vector.x=b.x*this.scale,this.vector.y=b.y*this.scale,this.vector.z=b.z*this.scale;return this.vector},ba.prototype.crossing=function(a){this.log&&(console.error("Sorry MeshZone does not support crossing method"),this.log=!1);},b.MeshZone=ba,b.Util.inherits(bb,b.Zone),bb.prototype.getPosition=function(){this.vector.x=this.x,this.vector.y=this.y,this.vector.z=this.z;return this.vector},bb.prototype.crossing=function(a){this.log&&(console.error("Sorry PointZone does not support crossing method"),this.log=!1);},b.PointZone=bb,b.Util.inherits(bc,b.Zone),bc.prototype.getPosition=function(){this.vector.x=this.x+b.MathUtils.randomAToB(-0.5,.5)*this.width,this.vector.y=this.y+b.MathUtils.randomAToB(-0.5,.5)*this.height,this.vector.z=this.z+b.MathUtils.randomAToB(-0.5,.5)*this.depth;return this.vector},bc.prototype._dead=function(a){a.p.x+a.radius<this.x-this.width/2?a.dead=!0:a.p.x-a.radius>this.x+this.width/2&&(a.dead=!0),a.p.y+a.radius<this.y-this.height/2?a.dead=!0:a.p.y-a.radius>this.y+this.height/2&&(a.dead=!0),a.p.z+a.radius<this.z-this.depth/2?a.dead=!0:a.p.z-a.radius>this.z+this.depth/2&&(a.dead=!0);},bc.prototype._bound=function(a){a.p.x-a.radius<this.x-this.width/2?(a.p.x=this.x-this.width/2+a.radius,a.v.x*=-this.friction,this._static(a,"x")):a.p.x+a.radius>this.x+this.width/2&&(a.p.x=this.x+this.width/2-a.radius,a.v.x*=-this.friction,this._static(a,"x")),a.p.y-a.radius<this.y-this.height/2?(a.p.y=this.y-this.height/2+a.radius,a.v.y*=-this.friction,this._static(a,"y")):a.p.y+a.radius>this.y+this.height/2&&(a.p.y=this.y+this.height/2-a.radius,a.v.y*=-this.friction,this._static(a,"y")),a.p.z-a.radius<this.z-this.depth/2?(a.p.z=this.z-this.depth/2+a.radius,a.v.z*=-this.friction,this._static(a,"z")):a.p.z+a.radius>this.z+this.depth/2&&(a.p.z=this.z+this.depth/2-a.radius,a.v.z*=-this.friction,this._static(a,"z"));},bc.prototype._static=function(a,b){a.v[b]*a.a[b]>0||Math.abs(a.v[b])<Math.abs(a.a[b])*.0167*this.max&&(a.v[b]=0,a.a[b]=0);},bc.prototype._cross=function(a){a.p.x+a.radius<this.x-this.width/2&&a.v.x<=0?a.p.x=this.x+this.width/2+a.radius:a.p.x-a.radius>this.x+this.width/2&&a.v.x>=0&&(a.p.x=this.x-this.width/2-a.radius),a.p.y+a.radius<this.y-this.height/2&&a.v.y<=0?a.p.y=this.y+this.height/2+a.radius:a.p.y-a.radius>this.y+this.height/2&&a.v.y>=0&&(a.p.y=this.y-this.height/2-a.radius),a.p.z+a.radius<this.z-this.depth/2&&a.v.z<=0?a.p.z=this.z+this.depth/2+a.radius:a.p.z-a.radius>this.z+this.depth/2&&a.v.z>=0&&(a.p.z=this.z-this.depth/2-a.radius);},b.BoxZone=bc,b.Util.inherits(bd,b.Zone),bd.prototype.getPosition=function(){var a=new b.Vector3D,c;return function(){c=this.renderer.domElement,a.x=Math.random()*c.width,a.y=Math.random()*c.height,this.vector.copy(b.THREEUtil.toSpacePos(a,this.camera,c));return this.vector}}(),bd.prototype._dead=function(a){var c=b.THREEUtil.toScreenPos(a.p,this.camera,this.renderer.domElement),d=this.renderer.domElement;c.y+a.radius<-this.dis&&this.d1?a.dead=!0:c.y-a.radius>d.height+this.dis&&this.d3&&(a.dead=!0),c.x+a.radius<-this.dis&&this.d4?a.dead=!0:c.x-a.radius>d.width+this.dis&&this.d2&&(a.dead=!0);},bd.prototype._cross=function(){var a=new b.Vector3D;return function(c){var d=b.THREEUtil.toScreenPos(c.p,this.camera,this.renderer.domElement),e=this.renderer.domElement;d.y+c.radius<-this.dis?(a.x=d.x,a.y=e.height+this.dis+c.radius,c.p.y=b.THREEUtil.toSpacePos(a,this.camera,e).y):d.y-c.radius>e.height+this.dis&&(a.x=d.x,a.y=-this.dis-c.radius,c.p.y=b.THREEUtil.toSpacePos(a,this.camera,e).y),d.x+c.radius<-this.dis?(a.y=d.y,a.x=e.width+this.dis+c.radius,c.p.x=b.THREEUtil.toSpacePos(a,this.camera,e).x):d.x-c.radius>e.width+this.dis&&(a.y=d.y,a.x=-this.dis-c.radius,c.p.x=b.THREEUtil.toSpacePos(a,this.camera,e).x);}}(),bd.prototype._bound=function(a){var c=b.THREEUtil.toScreenPos(a.p,this.camera,this.renderer.domElement),d=this.renderer.domElement;c.y+a.radius<-this.dis?a.v.y*=-1:c.y-a.radius>d.height+this.dis&&(a.v.y*=-1),c.x+a.radius<-this.dis?a.v.y*=-1:c.x-a.radius>d.width+this.dis&&(a.v.y*=-1);},b.ScreenZone=bd;var be=function(){if(window.console&&window.console.trace){var a=Array.prototype.slice.call(arguments),b=arguments[0]+"";if(b.indexOf("+")==0){var c=parseInt(arguments[0]);be.once<c&&(a.shift(),console.trace.apply(console,a),be.once++);}else a.unshift("+15"),be.apply(console,a);}};be.once=0,b.log=be;var bf=bf||{addEventListener:function(a,b){a.addEventListener("PROTON_UPDATE",function(a){b(a);});},drawZone:function(c,d,e){var f,g,h;e instanceof b.PointZone?f=new a.SphereGeometry(15):e instanceof b.LineZone||(e instanceof b.BoxZone?f=new a.BoxGeometry(e.width,e.height,e.depth):e instanceof b.SphereZone?f=new a.SphereGeometry(e.radius,10,10):e instanceof b.MeshZone&&(e.geometry instanceof a.Geometry?f=e.geometry:f=e.geometry.geometry,f=new a.SphereGeometry(e.radius,10,10))),g=new a.MeshBasicMaterial({color:"#2194ce",wireframe:!0}),h=new a.Mesh(f,g),d.add(h),this.addEventListener(c,function(a){h.position.set(e.x,e.y,e.z);});},drawEmitter:function(b,c,d,e){var f=new a.OctahedronGeometry(15),g=new a.MeshBasicMaterial({color:e||"#aaa",wireframe:!0}),h=new a.Mesh(f,g);c.add(h),this.addEventListener(b,function(){h.position.copy(d.p),h.rotation.set(d.rotation.x,d.rotation.y,d.rotation.z);});},renderInfo:function(){function b(a){var b=a.emitters[0];return Math.round(b.p.x)+","+Math.round(b.p.y)+","+Math.round(b.p.z)}function a(a,b){var c=b=="material"?"_materialPool":"_targetPool",d=a.renderers[0];return d[c].cID}return function(c,d){this.addInfo(d);var e="";switch(this._infoType){case 2:e+="emitter:"+c.emitters.length+"<br>",e+="em speed:"+c.emitters[0].cID+"<br>",e+="pos:"+b(c);break;case 3:e+=c.renderers[0].name+"<br>",e+="target:"+a(c,"target")+"<br>",e+="material:"+a(c,"material");break;default:e+="particles:"+c.getCount()+"<br>",e+="pool:"+c.pool.getCount()+"<br>",e+="total:"+(c.getCount()+c.pool.getCount());}this._infoCon.innerHTML=e;}}(),addInfo:function(){return function(a){var b=this;if(!this._infoCon){this._infoCon=document.createElement("div"),this._infoCon.style.cssText=["position:fixed;bottom:0px;left:0;cursor:pointer;","opacity:0.9;z-index:10000;padding:10px;font-size:12px;","width:120px;height:50px;background-color:#002;color:#0ff;"].join(""),this._infoType=1,this._infoCon.addEventListener("click",function(a){b._infoType++,b._infoType>3&&(b._infoType=1);},!1);var c,d;switch(a){case 2:c="#201",d="#f08";break;case 3:c="#020",d="#0f0";break;default:c="#002",d="#0ff";}this._infoCon.style["background-color"]=c,this._infoCon.style.color=d;}this._infoCon.parentNode||document.body.appendChild(this._infoCon);}}()};b.Debug=bf;return b});
|
|
87224
|
+
}(three_proton_min));
|
|
87225
|
+
|
|
87226
|
+
var Proton = three_proton_min.exports;const PARTICLE_EMITTER_TYPES = {
|
|
87190
87227
|
SINGLE: 'SINGLE',
|
|
87191
87228
|
GROUP: 'GROUP'
|
|
87192
87229
|
};let ParticleEmitter = /*#__PURE__*/function (_Entity) {
|
|
@@ -87210,6 +87247,11 @@ var index$1=/*#__PURE__*/Object.freeze({__proto__:null,Emitter:k,Particle:P,Part
|
|
|
87210
87247
|
_this.options = { ...options,
|
|
87211
87248
|
name
|
|
87212
87249
|
};
|
|
87250
|
+
_this.particleConfig = {};
|
|
87251
|
+
_this.preset = null;
|
|
87252
|
+
_this._sceneEmitter = false;
|
|
87253
|
+
_this.isUsingHelper = undefined;
|
|
87254
|
+
_this.holder = undefined;
|
|
87213
87255
|
|
|
87214
87256
|
_this.setSystem();
|
|
87215
87257
|
|
|
@@ -87227,6 +87269,16 @@ var index$1=/*#__PURE__*/Object.freeze({__proto__:null,Emitter:k,Particle:P,Part
|
|
|
87227
87269
|
}
|
|
87228
87270
|
|
|
87229
87271
|
_createClass(ParticleEmitter, [{
|
|
87272
|
+
key: "setParticleConfig",
|
|
87273
|
+
value: function setParticleConfig(config) {
|
|
87274
|
+
this.particleConfig = config;
|
|
87275
|
+
}
|
|
87276
|
+
}, {
|
|
87277
|
+
key: "getParticleConfig",
|
|
87278
|
+
value: function getParticleConfig() {
|
|
87279
|
+
return this.particleConfig;
|
|
87280
|
+
}
|
|
87281
|
+
}, {
|
|
87230
87282
|
key: "setBody",
|
|
87231
87283
|
value: function setBody(_ref) {
|
|
87232
87284
|
let {
|
|
@@ -87242,13 +87294,13 @@ var index$1=/*#__PURE__*/Object.freeze({__proto__:null,Emitter:k,Particle:P,Part
|
|
|
87242
87294
|
key: "addToScene",
|
|
87243
87295
|
value: function addToScene() {
|
|
87244
87296
|
const {
|
|
87245
|
-
addUniverse = true
|
|
87297
|
+
addUniverse = true,
|
|
87298
|
+
skipSceneAdd = false
|
|
87246
87299
|
} = this.options;
|
|
87300
|
+
if (skipSceneAdd) return;
|
|
87247
87301
|
|
|
87248
87302
|
if (this.hasBody()) {
|
|
87249
87303
|
Scene$1.add(this.getBody(), this, addUniverse);
|
|
87250
|
-
} else {
|
|
87251
|
-
console.warn(ELEMENT_NOT_SET);
|
|
87252
87304
|
}
|
|
87253
87305
|
}
|
|
87254
87306
|
}, {
|
|
@@ -87269,23 +87321,14 @@ var index$1=/*#__PURE__*/Object.freeze({__proto__:null,Emitter:k,Particle:P,Part
|
|
|
87269
87321
|
}, {
|
|
87270
87322
|
key: "isSystemDead",
|
|
87271
87323
|
value: function isSystemDead() {
|
|
87272
|
-
return this.system.
|
|
87324
|
+
return this.hasSystem() && this.system.dead;
|
|
87273
87325
|
}
|
|
87274
87326
|
}, {
|
|
87275
87327
|
key: "setSystem",
|
|
87276
87328
|
value: function setSystem() {
|
|
87277
|
-
|
|
87278
|
-
|
|
87279
|
-
|
|
87280
|
-
particles = {},
|
|
87281
|
-
system = {}
|
|
87282
|
-
} = this.options;
|
|
87283
|
-
this.system = new E({
|
|
87284
|
-
container,
|
|
87285
|
-
autostart,
|
|
87286
|
-
particles,
|
|
87287
|
-
system
|
|
87288
|
-
});
|
|
87329
|
+
// Base implementation is a no-op.
|
|
87330
|
+
// Subclasses (ProtonParticleEmitter) override this to create their system.
|
|
87331
|
+
this.system = null;
|
|
87289
87332
|
}
|
|
87290
87333
|
}, {
|
|
87291
87334
|
key: "getSystem",
|
|
@@ -87295,278 +87338,131 @@ var index$1=/*#__PURE__*/Object.freeze({__proto__:null,Emitter:k,Particle:P,Part
|
|
|
87295
87338
|
}, {
|
|
87296
87339
|
key: "emit",
|
|
87297
87340
|
value: function emit() {
|
|
87298
|
-
if (this.hasSystem()) {
|
|
87299
|
-
this.system.start(...arguments);
|
|
87300
|
-
}
|
|
87301
|
-
|
|
87302
87341
|
return this;
|
|
87303
87342
|
}
|
|
87304
87343
|
}, {
|
|
87305
87344
|
key: "stop",
|
|
87306
|
-
value: function stop() {
|
|
87307
|
-
if (this.hasSystem()) {
|
|
87308
|
-
this.system.stop();
|
|
87309
|
-
}
|
|
87310
|
-
}
|
|
87345
|
+
value: function stop() {}
|
|
87311
87346
|
}, {
|
|
87312
87347
|
key: "syncParticleEmitter",
|
|
87313
|
-
value: function syncParticleEmitter() {
|
|
87314
|
-
if (this.hasSystem()) {
|
|
87315
|
-
const {
|
|
87316
|
-
position,
|
|
87317
|
-
rotation
|
|
87318
|
-
} = this.getWorldTransform();
|
|
87319
|
-
this.system.particleSystem.position.set(position.x, position.y, position.z);
|
|
87320
|
-
this.system.particleSystem.rotation.set(rotation.x, rotation.y, rotation.z);
|
|
87321
|
-
}
|
|
87322
|
-
}
|
|
87348
|
+
value: function syncParticleEmitter() {}
|
|
87323
87349
|
}, {
|
|
87324
|
-
key: "
|
|
87325
|
-
value: function
|
|
87326
|
-
|
|
87327
|
-
|
|
87328
|
-
|
|
87329
|
-
|
|
87330
|
-
|
|
87331
|
-
_get(_getPrototypeOf(ParticleEmitter.prototype), "update", this).call(this, dt);
|
|
87332
|
-
|
|
87333
|
-
if (this.hasSystem() && !this.isSystemDead()) {
|
|
87334
|
-
this.system.update(dt);
|
|
87335
|
-
}
|
|
87336
|
-
|
|
87337
|
-
this.syncParticleEmitter();
|
|
87338
|
-
}
|
|
87339
|
-
}]);
|
|
87340
|
-
|
|
87341
|
-
return ParticleEmitter;
|
|
87342
|
-
}(Entity);let Fountain = /*#__PURE__*/function (_ParticleEmitter) {
|
|
87343
|
-
_inherits(Fountain, _ParticleEmitter);
|
|
87344
|
-
|
|
87345
|
-
var _super = _createSuper(Fountain);
|
|
87346
|
-
|
|
87347
|
-
function Fountain(_ref) {
|
|
87348
|
-
var _this;
|
|
87349
|
-
|
|
87350
|
-
let {
|
|
87351
|
-
container,
|
|
87352
|
-
autostart,
|
|
87353
|
-
particles,
|
|
87354
|
-
system
|
|
87355
|
-
} = _ref;
|
|
87356
|
-
|
|
87357
|
-
_classCallCheck(this, Fountain);
|
|
87350
|
+
key: "addHolder",
|
|
87351
|
+
value: function addHolder() {
|
|
87352
|
+
let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "particleholder";
|
|
87353
|
+
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;
|
|
87354
|
+
const holderSprite = new HelperSprite(size, size, name, {
|
|
87355
|
+
name
|
|
87356
|
+
});
|
|
87358
87357
|
|
|
87359
|
-
|
|
87360
|
-
|
|
87361
|
-
|
|
87362
|
-
|
|
87363
|
-
|
|
87364
|
-
|
|
87365
|
-
|
|
87366
|
-
|
|
87367
|
-
|
|
87368
|
-
|
|
87369
|
-
gravity: -10,
|
|
87370
|
-
startAlpha: 1,
|
|
87371
|
-
endAlpha: 0,
|
|
87372
|
-
startColor: new N.ColorsRandomizer(),
|
|
87373
|
-
endColor: new N.ColorsRandomizer(),
|
|
87374
|
-
startAlphaChangeAt: 0,
|
|
87375
|
-
onUpdate: particle => {
|
|
87376
|
-
let floorY = -10;
|
|
87377
|
-
|
|
87378
|
-
if (particle.position.y < floorY) {
|
|
87379
|
-
particle.position.y = floorY;
|
|
87380
|
-
particle.velocity.y *= -0.5;
|
|
87381
|
-
particle.velocity.x *= 0.5;
|
|
87382
|
-
particle.velocity.z *= 0.5;
|
|
87383
|
-
}
|
|
87384
|
-
},
|
|
87385
|
-
...particles
|
|
87386
|
-
},
|
|
87387
|
-
system: {
|
|
87388
|
-
particlesCount: 100,
|
|
87389
|
-
emitters: new k({
|
|
87390
|
-
onInterval: new N.MinMaxRandomizer(0, 5),
|
|
87391
|
-
interval: new N.MinMaxRandomizer(0, 0.25)
|
|
87392
|
-
}),
|
|
87393
|
-
speed: 1,
|
|
87394
|
-
...system
|
|
87358
|
+
if (holderSprite) {
|
|
87359
|
+
holderSprite.setSizeAttenuation(false);
|
|
87360
|
+
holderSprite.setDepthTest(false);
|
|
87361
|
+
holderSprite.setDepthWrite(false);
|
|
87362
|
+
holderSprite.setSerializable(false);
|
|
87363
|
+
holderSprite.setPosition(this.getPosition());
|
|
87364
|
+
holderSprite.addTags([TAGS.HELPER, TAGS.PARTICLES.HELPER, TAGS.PARTICLES.HOLDER, name]);
|
|
87365
|
+
holderSprite.setHelperTarget(this);
|
|
87366
|
+
this.holder = holderSprite;
|
|
87367
|
+
return true;
|
|
87395
87368
|
}
|
|
87396
|
-
};
|
|
87397
|
-
_this = _super.call(this, options);
|
|
87398
|
-
|
|
87399
|
-
_this.setEntitySubtype(ENTITY_TYPES.PARTICLE.SUBTYPES.FOUNTAIN);
|
|
87400
|
-
|
|
87401
|
-
return _this;
|
|
87402
|
-
}
|
|
87403
|
-
|
|
87404
|
-
return Fountain;
|
|
87405
|
-
}(ParticleEmitter);var three_proton_min = {exports: {}};var require$$0 = /*@__PURE__*/getAugmentedNamespace(three_module);/*!
|
|
87406
|
-
* three.proton v0.2.0
|
|
87407
|
-
* https://github.com/drawcall/three.proton
|
|
87408
|
-
*
|
|
87409
|
-
* Copyright 2011-2020, ajiemath
|
|
87410
|
-
* Licensed under the MIT license
|
|
87411
|
-
* http://www.opensource.org/licenses/mit-license
|
|
87412
|
-
*
|
|
87413
|
-
*/
|
|
87414
|
-
|
|
87415
|
-
(function (module, exports) {
|
|
87416
|
-
(function(a,b){module.exports=b(require$$0);})(commonjsGlobal,function(a){function bd(a,b,c,d){bd._super_.call(this),this.camera=a,this.renderer=b,this.dis=c||20,d=d||"1234";for(var e=1;e<5;e++)this["d"+e]=d.indexOf(e+"")>=0;this.name="ScreenZone";}function bc(a,c,d,e,f,g){var h,i,j,k,l,e;bc._super_.call(this),b.Util.isUndefined(c,d,e,f,g)?(h=i=j=0,k=l=e=a||100):b.Util.isUndefined(e,f,g)?(h=i=j=0,k=a,l=c,e=d):(h=a,i=c,j=d,k=e,l=f,e=g),this.x=h,this.y=i,this.z=j,this.width=k,this.height=l,this.depth=e,this.friction=.85,this.max=6;}function bb(a,c,d){var e,f,g;bb._super_.call(this),b.Util.isUndefined(a,c,d)?e=f=g=0:(e=a,f=c,g=d),this.x=e,this.y=f,this.z=g;}function ba(b,c){ba._super_.call(this),b instanceof a.Geometry?this.geometry=b:this.geometry=b.geometry,this.scale=c||1;}function _(a,c,d,e){var f,i;_._super_.call(this),b.Util.isUndefined(c,d,e)?(f=0,i=a||100):(f=a,i=e),this.x=f,this.y=f,this.z=f,this.radius=i,this.tha=this.phi=0;}function $(a,c,d,e,f,g){$._super_.call(this),a instanceof b.Vector3D?(this.x1=a.x,this.y1=a.y,this.z1=a.z,this.x2=e.x,this.y2=e.y,this.z2=e.z):(this.x1=a,this.y1=c,this.z1=d,this.x2=e,this.y2=f,this.z2=g);}function Z(){this.vector=new b.Vector3D(0,0,0),this.random=0,this.crossType="dead",this.log=!0;}function Y(){Y._super_.call(this),this.targetPool=new b.Pool,this.materialPool=new b.Pool,this.name="CustomRender";}function X(b){X._super_.call(this,b),this._body=new a.Sprite(new a.SpriteMaterial({color:16777215})),this.name="SpriteRender";}function W(a){W._super_.call(this),this.points=a,this.name="PointsRender";}function V(c){V._super_.call(this),this.container=c,this._targetPool=new b.Pool,this._materialPool=new b.Pool,this._body=new a.Mesh(new a.BoxGeometry(50,50,50),new a.MeshLambertMaterial({color:"#ff0000"})),this.name="MeshRender";}function U(){this.name="BaseRender";}function R(a,c,d){this.mouseTarget=b.Util.initValue(a,window),this.ease=b.Util.initValue(c,.7),this._allowEmitting=!1,this.mouse=new b.Vector3D,this.initEventHandler(),R._super_.call(this,d);}function Q(a){this.selfBehaviours=[],Q._super_.call(this,a);}function P(a){this.initializes=[],this.particles=[],this.behaviours=[],this.currentEmitTime=0,this.totalEmitTimes=-1,this.damping=.006,this.bindEmitter=!0,this.rate=new b.Rate(1,.1),P._super_.call(this,a),this.id="emitter_"+P.ID++,this.cID=0,this.name="Emitter";}function O(a,b,c,d,e,f,g){O._super_.call(this,f,g),O.prototype.reset(a,b,c,d,e),this.name="Spring";}function N(a,b,c,d){N._super_.call(this,c,d),this.reset(a,b),this.name="Color";}function M(a,b,c,d,e){M._super_.call(this,d,e),this.reset(a,b,c),this.name="Rotate";}function L(a,b,c,d){L._super_.call(this,c,d),this.reset(a,b),this.name="Scale";}function K(a,b,c,d){K._super_.call(this,c,d),this.reset(a,b),this.name="Alpha";}function J(a,b,c,d){J._super_.call(this,c,d),this.reset(a,b),this.name="CrossZone";}function I(a,b,c,d,e){I._super_.call(this,d,e),this.reset(a,b,c),this.name="Collision";}function H(a,b,c){H._super_.call(this,0,-a,0,b,c),this.name="Gravity";}function G(a,b,c,d,e){G._super_.call(this,a,b,c,d,e),this.force*=-1,this.name="Repulsion";}function F(a,b,c,d,e,f){F._super_.call(this,e,f),this.reset(a,b,c,d),this.time=0,this.name="RandomDrift";}function E(a,c,d,e,f){E._super_.call(this,e,f),this.targetPosition=b.Util.initValue(a,new b.Vector3D),this.radius=b.Util.initValue(d,1e3),this.force=b.Util.initValue(this.normalizeValue(c),100),this.radiusSq=this.radius*this.radius,this.attractionForce=new b.Vector3D,this.lengthSq=0,this.name="Attraction";}function D(a,b,c,d,e){D._super_.call(this,d,e),D.prototype.reset.call(this,a,b,c),this.name="Force";}function C(a,c,d){C._super_.call(this),this.body=b.createArraySpan(a),this.w=c,this.h=b.Util.initValue(d,this.w);}function B(a,c,d){B._super_.call(this),this.radius=b.createSpan(a,c,d);}function A(a,c,d){A._super_.call(this),this.massPan=b.createSpan(a,c,d);}function z(a,c,d){z._super_.call(this),this.reset(a,c,d),this.dirVec=new b.Vector3D(0,0,0),this.name="Velocity";}function y(){y._super_.call(this),this.reset.apply(this,arguments);}function x(a,c,d){x._super_.call(this),this.lifePan=b.createSpan(a,c,d);}function v(){this.name="Initialize";}function u(a,c){this.numPan=b.createSpan(b.Util.initValue(a,1)),this.timePan=b.createSpan(b.Util.initValue(c,1)),this.startTime=0,this.nextTime=0,this.init();}function t(a,c){this.id="Behaviour_"+t.id++,this.life=b.Util.initValue(a,Infinity),this.easing=b.Util.initValue(c,b.ease.setEasingByName(b.ease.easeLinear)),this.age=0,this.energy=1,this.dead=!1,this.name="Behaviour";}function s(a,b,c,d,e,f){this.x=a,this.y=b,this.z=c,this.width=d,this.height=e,this.depth=f,this.bottom=this.y+this.height,this.right=this.x+this.width,this.right=this.x+this.width;}function q(a){this._arr=b.Util.isArray(a)?a:[a];}function p(a,c,d){this._isArray=!1,b.Util.isArray(a)?(this._isArray=!0,this.a=a):(this.a=b.Util.initValue(a,1),this.b=b.Util.initValue(c,this.a),this._center=b.Util.initValue(d,!1));}function j(){this.cID=0,this.list={};}function i(a){this.id="particle_"+i.ID++,this.name="Particle",this.reset("init"),b.Util.setPrototypeByObj(this,a);}function c(){this.initialize();}function b(a,c){this.preParticles=b.Util.initValue(a,b.POOL_MAX),this.integrationType=b.Util.initValue(c,b.EULER),this.emitters=[],this.renderers=[],this.pool=new b.Pool,b.integrator=new b.Integration(this.integrationType);}b.POOL_MAX=500,b.TIME_STEP=60,b.PI=3.142,b.DR=b.PI/180,b.MEASURE=100,b.EULER="euler",b.RK2="runge-kutta2",b.RK4="runge-kutta4",b.VERLET="verlet",b.PARTICLE_CREATED="partilcleCreated",b.PARTICLE_UPDATE="partilcleUpdate",b.PARTICLE_SLEEP="particleSleep",b.PARTICLE_DEAD="partilcleDead",b.PROTON_UPDATE="protonUpdate",b.PROTON_UPDATE_AFTER="protonUpdateAfter",b.EMITTER_ADDED="emitterAdded",b.EMITTER_REMOVED="emitterRemoved",b.bindEmtterEvent=!1,b.prototype={addRender:function(a){this.renderers.push(a),a.init(this);},removeRender:function(a){this.renderers.splice(this.renderers.indexOf(a),1),a.remove(this);},addEmitter:function(a){this.emitters.push(a),a.parent=this,this.dispatchEvent("EMITTER_ADDED",a);},removeEmitter:function(a){a.parent==this&&(this.emitters.splice(this.emitters.indexOf(a),1),a.parent=null,this.dispatchEvent("EMITTER_REMOVED",a));},update:function(a){this.dispatchEvent("PROTON_UPDATE",this);var b=a||.0167;if(b>0){var c=this.emitters.length;while(c--)this.emitters[c].update(b);}this.dispatchEvent("PROTON_UPDATE_AFTER",this);},getCount:function(){var a=0,b,c=this.emitters.length;for(b=0;b<c;b++)a+=this.emitters[b].particles.length;return a},destroy:function(){var a=0,b=this.emitters.length;for(a;a<b;a++)this.emitters[a].destroy(),delete this.emitters[a];this.emitters.length=0,this.pool.destroy();}},c.initialize=function(a){a.addEventListener=d.addEventListener,a.removeEventListener=d.removeEventListener,a.removeAllEventListeners=d.removeAllEventListeners,a.hasEventListener=d.hasEventListener,a.dispatchEvent=d.dispatchEvent;};var d=c.prototype;d._listeners=null,d.initialize=function(){},d.addEventListener=function(a,b){this._listeners?this.removeEventListener(a,b):this._listeners={},this._listeners[a]||(this._listeners[a]=[]),this._listeners[a].push(b);return b},d.removeEventListener=function(a,b){if(!!this._listeners){if(!this._listeners[a])return;var c=this._listeners[a];for(var d=0,e=c.length;d<e;d++)if(c[d]==b){e==1?delete this._listeners[a]:c.splice(d,1);break}}},d.removeAllEventListeners=function(a){a?this._listeners&&delete this._listeners[a]:this._listeners=null;},d.dispatchEvent=function(a,b){var c=!1,d=this._listeners;if(a&&d){var e=d[a];if(!e)return c;e=e.slice();var f,g=e.length;while(g--){var f=e[g];c=c||f(b);}}return !!c},d.hasEventListener=function(a){var b=this._listeners;return !!b&&!!b[a]},c.initialize(b.prototype),b.EventDispatcher=c;var e=e||{initValue:function(a,b){var a=a!=null&&a!=undefined?a:b;return a},isArray:function(a){return Object.prototype.toString.call(a)==="[object Array]"},destroyArray:function(a){a.length=0;},destroyObject:function(a){for(var b in a)delete a[b];},isUndefined:function(){for(var a in arguments){var b=arguments[a];if(b!==undefined)return !1}return !0},setVectorByObj:function(a,b){b.x!==undefined&&(a.p.x=b.x),b.y!==undefined&&(a.p.y=b.y),b.z!==undefined&&(a.p.z=b.z),b.vx!==undefined&&(a.v.x=b.vx),b.vy!==undefined&&(a.v.y=b.vy),b.vz!==undefined&&(a.v.z=b.vz),b.ax!==undefined&&(a.a.x=b.ax),b.ay!==undefined&&(a.a.y=b.ay),b.az!==undefined&&(a.a.z=b.az),b.p!==undefined&&a.p.copy(b.p),b.v!==undefined&&a.v.copy(b.v),b.a!==undefined&&a.a.copy(b.a),b.position!==undefined&&a.p.copy(b.position),b.velocity!==undefined&&a.v.copy(b.velocity),b.accelerate!==undefined&&a.a.copy(b.accelerate);},setPrototypeByObj:function(a,b,c){for(var d in b)a.hasOwnProperty(d)&&(c?c.indexOf(d)<0&&(a[d]=e._getValue(b[d])):a[d]=e._getValue(b[d]));return a},_getValue:function(a){return a instanceof p?a.getValue():a},inherits:function(a,b){a._super_=b;if(Object.create)a.prototype=Object.create(b.prototype,{constructor:{value:a}});else {var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a;}}};b.Util=e;var f=f||{getRGB:function(b){var c={};if(typeof b=="number")e=Math.floor(b),c.r=(b>>16&255)/255,c.g=(b>>8&255)/255,c.b=(b&255)/255;else if(typeof b=="string"){var d;if(d=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(b))c.r=Math.min(255,parseInt(d[1],10))/255,c.g=Math.min(255,parseInt(d[2],10))/255,c.b=Math.min(255,parseInt(d[3],10))/255;else if(d=/^\#([A-Fa-f0-9]+)$/.exec(b)){var e=d[1];c.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,c.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,c.b=parseInt(e.charAt(4)+e.charAt(5),16)/255;}}else b instanceof a.Color&&(c.r=b.r,c.g=b.g,c.b=b.b);return c}};b.ColorUtil=f;var g={toScreenPos:function(){var b=new a.Vector3;return function(a,c,d){b.copy(a),b.project(c),b.x=Math.round((b.x+1)*d.width/2),b.y=Math.round((-b.y+1)*d.height/2),b.z=0;return b}}(),toSpacePos:function(){var b=new a.Vector3,c=new a.Vector3,d;return function(a,e,f){b.set(a.x/f.width*2-1,-(a.y/f.height)*2+1,.5),b.unproject(e),c.copy(b.sub(e.position).normalize()),d=-e.position.z/c.z,b.copy(e.position),b.add(c.multiplyScalar(d));return b}}(),getTexture:function(){var c={};return function(d){if(d instanceof a.Texture)return d;if(typeof d=="string"){var e=b.PUID.hash(d);c[e]||(c[e]=new a.Texture(d));return c[e]}if(d instanceof Image){var e=b.PUID.hash(d.src);c[e]||(c[e]=new a.Texture(d));return c[e]}}}()};b.THREEUtil=g;var h=h||{_id:0,_uids:{},id:function(a){for(var b in this._uids)if(this._uids[b]==a)return b;var c="PUID_"+this._id++;this._uids[c]=a;return c},hash:function(a){return}};b.PUID=h,i.ID=0,i.prototype={getDirection:function(){return Math.atan2(this.v.x,-this.v.y)*(180/b.PI)},reset:function(a){this.life=Infinity,this.age=0,this.energy=1,this.dead=!1,this.sleep=!1,this.body=null,this.parent=null,this.mass=1,this.radius=10,this.alpha=1,this.scale=1,this.useColor=!1,this.useAlpha=!1,this.easing=b.ease.setEasingByName(b.ease.easeLinear),a?(this.p=new b.Vector3D,this.v=new b.Vector3D,this.a=new b.Vector3D,this.old={},this.old.p=this.p.clone(),this.old.v=this.v.clone(),this.old.a=this.a.clone(),this.behaviours=[],this.transform={},this.color={r:0,g:0,b:0},this.rotation=new b.Vector3D):(this.p.set(0,0,0),this.v.set(0,0,0),this.a.set(0,0,0),this.old.p.set(0,0,0),this.old.v.set(0,0,0),this.old.a.set(0,0,0),this.color.r=0,this.color.g=0,this.color.b=0,this.rotation.clear(),b.Util.destroyObject(this.transform),this.removeAllBehaviours());return this},update:function(a,b){if(!this.sleep){this.age+=a;var c=this.behaviours.length;while(c--)this.behaviours[c]&&this.behaviours[c].applyBehaviour(this,a,b);}if(this.age>=this.life)this.destroy();else {var d=this.easing(this.age/this.life);this.energy=Math.max(1-d,0);}},addBehaviour:function(a){this.behaviours.push(a),a.initialize(this);},addBehaviours:function(a){var b=a.length;while(b--)this.addBehaviour(a[b]);},removeBehaviour:function(a){var b=this.behaviours.indexOf(a);b>-1&&this.behaviours.splice(b,1);},removeAllBehaviours:function(){b.Util.destroyArray(this.behaviours);},destroy:function(){this.removeAllBehaviours(),this.energy=0,this.dead=!0,this.parent=null;}},b.Particle=i,j.prototype={create:function(a){this.cID++;return typeof a=="function"?new a:a.clone()},getCount:function(){var a=0;for(var b in this.list)a+=this.list[b].length;return a++},get:function(a){var c,d=a.__puid||b.PUID.id(a);this.list[d]&&this.list[d].length>0?c=this.list[d].pop():c=this.create(a),c.__puid=a.__puid||d;return c},expire:function(a){return this._getList(a.__puid).push(a)},destroy:function(){for(var a in this.list)this.list[a].length=0,delete this.list[a];},_getList:function(a){a=a||"default",this.list[a]||(this.list[a]=[]);return this.list[a]}},b.Pool=j;var k={randomAToB:function(a,b,c){return c?(Math.random()*(b-a)>>0)+a:a+Math.random()*(b-a)},randomFloating:function(a,b,c){return k.randomAToB(a-b,a+b,c)},randomZone:function(a){},degreeTransform:function(a){return a*b.PI/180},toColor16:function(a){return "#"+a.toString(16)},randomColor:function(){return "#"+("00000"+(Math.random()*16777216<<0).toString(16)).slice(-6)},lerp:function(a,b,c){return b+(a-b)*c},getNormal:function(a,b){a.x==0&&a.y==0?a.z==0?b.set(1,0,1):b.set(1,1,-a.y/a.z):a.x==0?b.set(1,0,1):b.set(-a.y/a.x,1,1);return b.normalize()},axisRotate:function(a,b,c,d){var e=Math.cos(d),f=Math.sin(d),g=c.dot(b)*(1-e);a.copy(c),a.cross(b).scalar(f),a.addValue(b.x*e,b.y*e,b.z*e),a.addValue(c.x*g,c.y*g,c.z*g);}};b.MathUtils=k;var m=function(a){this.type=b.Util.initValue(a,b.EULER);};m.prototype={integrate:function(a,b,c){this.euler(a,b,c);},euler:function(a,b,c){a.sleep||(a.old.p.copy(a.p),a.old.v.copy(a.v),a.a.scalar(1/a.mass),a.v.add(a.a.scalar(b)),a.p.add(a.old.v.scalar(b)),c&&a.v.scalar(c),a.a.clear());}},b.Integration=m;var n=function(a,b,c){this.x=a||0,this.y=b||0,this.z=c||0;};n.prototype={set:function(a,b,c){this.x=a,this.y=b,this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},getGradient:function(){if(this.x!=0)return Math.atan2(this.y,this.x);if(this.y>0)return b.PI/2;if(this.y<0)return -b.PI/2},copy:function(a){this.x=a.x,this.y=a.y,this.z=a.z;return this},add:function(a,b){if(b!==undefined)return this.addVectors(a,b);this.x+=a.x,this.y+=a.y,this.z+=a.z;return this},addValue:function(a,b,c){this.x+=a,this.y+=b,this.z+=c;return this},addVectors:function(a,b){this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z;return this},addScalar:function(a){this.x+=a,this.y+=a,this.z+=a;return this},sub:function(a,b){if(b!==undefined)return this.subVectors(a,b);this.x-=a.x,this.y-=a.y,this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z;return this},scalar:function(a){this.x*=a,this.y*=a,this.z*=a;return this},divideScalar:function(a){a!==0?(this.x/=a,this.y/=a,this.z/=a):this.set(0,0,0);return this},negate:function(){return this.scalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},cross:function(a){var b=this.x,c=this.y,d=this.z;this.x=c*a.z-d*a.y,this.y=d*a.x-b*a.z,this.z=b*a.y-c*a.x;return this},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g,this.y=e*f-c*h,this.z=c*g-d*f;return this},eulerFromDir:function(a){},applyEuler:function(){var a;return function(c){a===undefined&&(a=new b.Quaternion),this.applyQuaternion(a.setFromEuler(c));return this}}(),applyAxisAngle:function(){var a;return function(c,d){a===undefined&&(a=new b.Quaternion),this.applyQuaternion(a.setFromAxisAngle(c,d));return this}}(),applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z,h=a.w,i=h*b+f*d-g*c,j=h*c+g*b-e*d,k=h*d+e*c-f*b,l=-e*b-f*c-g*d;this.x=i*h+l*-e+j*-g-k*-f,this.y=j*h+l*-f+k*-e-i*-g,this.z=k*h+l*-g+i*-f-j*-e;return this},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y,d=this.z-a.z;return b*b+c*c+d*d},lerp:function(a,b){this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},clear:function(){this.x=0,this.y=0,this.z=0;return this},clone:function(){return new b.Vector3D(this.x,this.y,this.z)},toString:function(){return "x:"+this.x+"y:"+this.y+"z:"+this.z}},b.Vector3D=n;var o=function(a,b,c){this.radius=a||1,this.phi=c||0,this.theta=b||0;};o.prototype={set:function(a,b,c){this.radius=a||1,this.phi=c||0,this.theta=b||0;return this},setRadius:function(a){this.radius=a;return this},setPhi:function(a){this.phi=a;return this},setTheta:function(a){this.theta=a;return this},copy:function(a){this.radius=a.radius,this.phi=a.phi,this.theta=a.theta;return this},toVector3D:function(){return new b.Vector3D(this.getX(),this.getY(),this.getZ())},getX:function(){return this.radius*Math.sin(this.theta)*Math.cos(this.phi)},getY:function(){return -this.radius*Math.sin(this.theta)*Math.sin(this.phi)},getZ:function(){return this.radius*Math.cos(this.theta)},normalize:function(){this.radius=1;return this},equals:function(a){return a.radius===this.radius&&a.phi===this.phi&&a.theta===this.theta},clear:function(){this.radius=0,this.phi=0,this.theta=0;return this},clone:function(){return new o(this.radius,this.phi,this.theta)}},b.Polar3D=o,p.prototype={getValue:function(a){return this._isArray?this.a[this.a.length*Math.random()>>0]:this._center?b.MathUtils.randomFloating(this.a,this.b,a):b.MathUtils.randomAToB(this.a,this.b,a)}},b.createSpan=function(a,b,c){if(a instanceof p)return a;return b===undefined?new p(a):c===undefined?new p(a,b):new p(a,b,c)},b.Span=p,b.Util.inherits(q,b.Span),q.prototype.getValue=function(){var a=this._arr[this._arr.length*Math.random()>>0];return a=="random"||a=="Random"?b.MathUtils.randomColor():a},b.createArraySpan=function(a){if(!a)return null;return a instanceof b.ArraySpan?a:new b.ArraySpan(a)},b.ArraySpan=q;var r=function(a,b,c,d){this.x=a||0,this.y=b||0,this.z=c||0,this.w=d!==undefined?d:1;};r.prototype={set:function(a,b,c,d){this.x=a,this.y=b,this.z=c,this.w=d;return this},clone:function(){return new b.Quaternion(this.x,this.y,this.z,this.w)},copy:function(a){this.x=a.x,this.y=a.y,this.z=a.z,this.w=a.w;return this},setFromEuler:function(a){var b=Math.cos(a.x/2),c=Math.cos(a.y/2),d=Math.cos(a.z/2),e=Math.sin(a.x/2),f=Math.sin(a.y/2),g=Math.sin(a.z/2);this.x=e*c*d+b*f*g,this.y=b*f*d-e*c*g,this.z=b*c*g+e*f*d,this.w=b*c*d-e*f*g;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this.x=a.x*d,this.y=a.y*d,this.z=a.z*d,this.w=Math.cos(c);return this},normalize:function(){var a=this.length();a===0?(this.x=0,this.y=0,this.z=0,this.w=1):(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w}},b.Quaternion=r,s.prototype={contains:function(a,b,c){return a<=this.right&&a>=this.x&&b<=this.bottom&&b>=this.y&&c<=this.depth&&c>=this.z?!0:!1}},b.Box=s,t.id=0,t.prototype={reset:function(a,c){this.life=b.Util.initValue(a,Infinity),this.easing=b.Util.initValue(c,b.ease.setEasingByName(b.ease.easeLinear));},normalizeForce:function(a){return a.scalar(b.MEASURE)},normalizeValue:function(a){return a*b.MEASURE},initialize:function(a){},applyBehaviour:function(a,b,c){if(!this.dead){this.age+=b;if(this.age>=this.life){this.energy=0,this.dead=!0;return}var d=this.easing(a.age/a.life);this.energy=Math.max(1-d,0);}},destroy:function(){}},b.Behaviour=t,u.prototype={init:function(){this.startTime=0,this.nextTime=this.timePan.getValue();},getValue:function(a){this.startTime+=a;if(this.startTime>=this.nextTime){this.init();return this.numPan.b==1?this.numPan.getValue("Float")>.5?1:0:this.numPan.getValue("Int")}return 0}},b.Rate=u,v.prototype.reset=function(){},v.prototype.init=function(a,b){b?this.initialize(b):this.initialize(a);},v.prototype.initialize=function(a){},b.Initialize=v;var w={initialize:function(a,c,d){var e=d.length;while(e--){var f=d[e];f instanceof b.Initialize?f.init(a,c):w.init(a,c,f);}w.bindEmitter(a,c);},init:function(a,c,d){b.Util.setPrototypeByObj(c,d),b.Util.setVectorByObj(c,d);},bindEmitter:function(a,b){a.bindEmitter&&(b.p.add(a.p),b.v.add(a.v),b.a.add(a.a),b.v.applyEuler(a.rotation));}};b.InitializeUtil=w,b.Util.inherits(x,b.Initialize),x.prototype.initialize=function(a){this.lifePan.a==Infinity||this.lifePan.a=="infi"?a.life=Infinity:a.life=this.lifePan.getValue();},b.Life=x,b.Util.inherits(y,b.Initialize),y.prototype.reset=function(){this.zones?this.zones.length=0:this.zones=[];var a=Array.prototype.slice.call(arguments);this.zones=this.zones.concat(a);},y.prototype.addZone=function(){var a=Array.prototype.slice.call(arguments);this.zones=this.zones.concat(a);},y.prototype.initialize=function(){return function(a){var b=this.zones[Math.random()*this.zones.length>>0];b.getPosition(),a.p.x=b.vector.x,a.p.y=b.vector.y,a.p.z=b.vector.z;}}(),b.Position=y,b.P=y,b.Util.inherits(z,b.Initialize),z.prototype.reset=function(a,c,d){a instanceof b.Vector3D?(this.radiusPan=b.createSpan(1),this.dir=a.clone(),this.tha=c*b.DR,this._useV=!0):a instanceof b.Polar3D?(this.tha=c*b.DR,this.dirVec=a.toVector3D(),this._useV=!1):(this.radiusPan=b.createSpan(a),this.dir=c.clone().normalize(),this.tha=d*b.DR,this._useV=!0);},z.prototype.normalize=function(a){return a*b.MEASURE},z.prototype.initialize=function(){var a,c=new b.Vector3D(0,0,1),d=new b.Vector3D(0,0,0);return function(e){a=this.tha*Math.random(),this._useV&&this.dirVec.copy(this.dir).scalar(this.radiusPan.getValue()),b.MathUtils.getNormal(this.dirVec,c),d.copy(this.dirVec).applyAxisAngle(c,a),d.applyAxisAngle(this.dirVec.normalize(),Math.random()*b.PI*2),e.v.copy(d);return this}}(),b.Velocity=z,b.V=z,b.Util.inherits(A,b.Initialize),A.prototype.initialize=function(a){a.mass=this.massPan.getValue();},b.Mass=A,b.Util.inherits(B,b.Initialize),B.prototype.reset=function(a,c,d){this.radius=b.createSpan(a,c,d);},B.prototype.initialize=function(a){a.radius=this.radius.getValue(),a.transform.oldRadius=a.radius;},b.Radius=B,b.Util.inherits(C,b.Initialize),C.prototype.initialize=function(a){var b=this.body.getValue();this.w?a.body={width:this.w,height:this.h,body:b}:a.body=b;},b.Body=C,b.Util.inherits(D,b.Behaviour),D.prototype.reset=function(a,c,d){this.force=this.normalizeForce(new b.Vector3D(a,c,d)),this.force.id=Math.random();},D.prototype.applyBehaviour=function(a,b,c){D._super_.prototype.applyBehaviour.call(this,a,b,c),a.a.add(this.force);},b.F=b.Force=D,b.Util.inherits(E,b.Behaviour),E.prototype.reset=function(a,c,d,e,f){this.targetPosition=b.Util.initValue(a,new b.Vector3D),this.radius=b.Util.initValue(d,1e3),this.force=b.Util.initValue(this.normalizeValue(c),100),this.radiusSq=this.radius*this.radius,this.attractionForce=new b.Vector3D,this.lengthSq=0,e&&E._super_.prototype.reset.call(this,e,f);},E.prototype.applyBehaviour=function(a,b,c){E._super_.prototype.applyBehaviour.call(this,a,b,c),this.attractionForce.copy(this.targetPosition),this.attractionForce.sub(a.p),this.lengthSq=this.attractionForce.lengthSq(),this.lengthSq>4e-6&&this.lengthSq<this.radiusSq&&(this.attractionForce.normalize(),this.attractionForce.scalar(1-this.lengthSq/this.radiusSq),this.attractionForce.scalar(this.force),a.a.add(this.attractionForce));},b.Attraction=E,b.Util.inherits(F,b.Behaviour),F.prototype.reset=function(a,c,d,e,f,g){this.randomFoce=this.normalizeForce(new b.Vector3D(a,c,d)),this.delayPan=b.createSpan(e||.03),this.time=0,f&&F._super_.prototype.reset.call(this,f,g);},F.prototype.applyBehaviour=function(a,c,d){F._super_.prototype.applyBehaviour.call(this,a,c,d),this.time+=c;if(this.time>=this.delayPan.getValue()){var e=b.MathUtils.randomAToB(-this.randomFoce.x,this.randomFoce.x),f=b.MathUtils.randomAToB(-this.randomFoce.y,this.randomFoce.y),g=b.MathUtils.randomAToB(-this.randomFoce.z,this.randomFoce.z);a.a.addValue(e,f,g),this.time=0;}},b.RandomDrift=F,b.Util.inherits(G,b.Attraction),G.prototype.reset=function(a,b,c,d,e){G._super_.prototype.reset.call(this,a,b,c,d,e),this.force*=-1;},b.Repulsion=G,b.Util.inherits(H,b.Force),H.prototype.reset=function(a,b,c){H._super_.prototype.reset.call(this,0,-a,0,b,c);},b.Gravity=H,b.G=H,b.Util.inherits(I,b.Behaviour),I.prototype.reset=function(a,c,d,e,f){this.emitter=a,this.useMass=c,this.callback=d,this.particles=[],this.delta=new b.Vector3D,e&&I._super_.prototype.reset.call(this,e,f);},I.prototype.applyBehaviour=function(a,b,c){var d=this.emitter?this.emitter.particles.slice(c):this.particles.slice(c),e,f,g,h,i,j,k=d.length;while(k--){e=d[k];if(e==a)continue;this.delta.copy(e.p).sub(a.p),f=this.delta.lengthSq(),h=a.radius+e.radius,f<=h*h&&(g=h-Math.sqrt(f),g+=.5,i=this._getAverageMass(a,e),j=this._getAverageMass(e,a),a.p.add(this.delta.clone().normalize().scalar(g*-i)),e.p.add(this.delta.normalize().scalar(g*j)),this.callback&&this.callback(a,e));}},I.prototype._getAverageMass=function(a,b){return this.useMass?b.mass/(a.mass+b.mass):.5},b.Collision=I,b.Util.inherits(J,b.Behaviour),J.prototype.reset=function(a,c,d,e){var f,g;typeof a=="string"?(g=a,f=c):(g=c,f=a),this.zone=f,this.zone.crossType=b.Util.initValue(g,"dead"),d&&J._super_.prototype.reset.call(this,d,e);},J.prototype.applyBehaviour=function(a,b,c){J._super_.prototype.applyBehaviour.call(this,a,b,c),this.zone.crossing.call(this.zone,a);},b.CrossZone=J,b.Util.inherits(K,b.Behaviour),K.prototype.reset=function(a,c,d,e){c==null||c==undefined?this._same=!0:this._same=!1,this.a=b.createSpan(b.Util.initValue(a,1)),this.b=b.createSpan(c),d&&K._super_.prototype.reset.call(this,d,e);},K.prototype.initialize=function(a){a.useAlpha=!0,a.transform.alphaA=this.a.getValue(),this._same?a.transform.alphaB=a.transform.alphaA:a.transform.alphaB=this.b.getValue();},K.prototype.applyBehaviour=function(a,c,d){K._super_.prototype.applyBehaviour.call(this,a,c,d),a.alpha=b.MathUtils.lerp(a.transform.alphaA,a.transform.alphaB,this.energy),a.alpha<.002&&(a.alpha=0);},b.Alpha=K,b.Util.inherits(L,b.Behaviour),L.prototype.reset=function(a,c,d,e){c==null||c==undefined?this._same=!0:this._same=!1,this.a=b.createSpan(b.Util.initValue(a,1)),this.b=b.createSpan(c),d&&L._super_.prototype.reset.call(this,d,e);},L.prototype.initialize=function(a){a.transform.scaleA=this.a.getValue(),a.transform.oldRadius=a.radius,this._same?a.transform.scaleB=a.transform.scaleA:a.transform.scaleB=this.b.getValue();},L.prototype.applyBehaviour=function(a,c,d){L._super_.prototype.applyBehaviour.call(this,a,c,d),a.scale=b.MathUtils.lerp(a.transform.scaleA,a.transform.scaleB,this.energy),a.scale<5e-4&&(a.scale=0),a.radius=a.transform.oldRadius*a.scale;},b.Scale=L,b.Util.inherits(M,b.Behaviour),M.prototype.reset=function(a,c,d,e,f){this.a=a||0,this.b=c||0,this.c=d||0,a===undefined||a=="same"?this._type="same":c==undefined?this._type="set":d===undefined?this._type="to":(this._type="add",this.a=b.createSpan(this.a*b.DR),this.b=b.createSpan(this.b*b.DR),this.c=b.createSpan(this.c*b.DR)),e&&M._super_.prototype.reset.call(this,e,f);},M.prototype.initialize=function(a){switch(this._type){case"same":break;case"set":this._setRotation(a.rotation,this.a);break;case"to":a.transform.fR=a.transform.fR||new b.Vector3D,a.transform.tR=a.transform.tR||new b.Vector3D,this._setRotation(a.transform.fR,this.a),this._setRotation(a.transform.tR,this.b);break;case"add":a.transform.addR=new b.Vector3D(this.a.getValue(),this.b.getValue(),this.c.getValue());}},M.prototype._setRotation=function(a,c){a=a||new b.Vector3D;if(c=="random"){var d=b.MathUtils.randomAToB(-b.PI,b.PI),e=b.MathUtils.randomAToB(-b.PI,b.PI),f=b.MathUtils.randomAToB(-b.PI,b.PI);a.set(d,e,f);}else c instanceof b.Vector3D&&a.copy(c);},M.prototype.applyBehaviour=function(a,c,d){M._super_.prototype.applyBehaviour.call(this,a,c,d);switch(this._type){case"same":a.rotation||(a.rotation=new b.Vector3D),a.rotation.eulerFromDir(a.v);break;case"set":break;case"to":a.rotation.x=b.MathUtils.lerp(a.transform.fR.x,a.transform.tR.x,this.energy),a.rotation.y=b.MathUtils.lerp(a.transform.fR.y,a.transform.tR.y,this.energy),a.rotation.z=b.MathUtils.lerp(a.transform.fR.z,a.transform.tR.z,this.energy);break;case"add":a.rotation.add(a.transform.addR);}},b.Rotate=M,b.Util.inherits(N,b.Behaviour),N.prototype.reset=function(a,c,d,e){c==null||c==undefined?this._same=!0:this._same=!1,this.a=b.createArraySpan(a),this.b=b.createArraySpan(c),d&&N._super_.prototype.reset.call(this,d,e);},N.prototype.initialize=function(a){a.transform.colorA=b.ColorUtil.getRGB(this.a.getValue()),a.useColor=!0,this._same?a.transform.colorB=a.transform.colorA:a.transform.colorB=b.ColorUtil.getRGB(this.b.getValue());},N.prototype.applyBehaviour=function(a,c,d){N._super_.prototype.applyBehaviour.call(this,a,c,d),this._same?(a.color.r=a.transform.colorA.r,a.color.g=a.transform.colorA.g,a.color.b=a.transform.colorA.b):(a.color.r=b.MathUtils.lerp(a.transform.colorA.r,a.transform.colorB.r,this.energy),a.color.g=b.MathUtils.lerp(a.transform.colorA.g,a.transform.colorB.g,this.energy),a.color.b=b.MathUtils.lerp(a.transform.colorA.b,a.transform.colorB.b,this.energy));},b.Color=N,b.Util.inherits(O,b.Behaviour),O.prototype.reset=function(a,c,d,e,f){this.pos?this.pos.set(a,c,d):this.pos=new b.Vector3D(a,c,d),this.spring=e||.1,this.friction=f||.98;},O.prototype.applyBehaviour=function(a,b,c){O._super_.prototype.applyBehaviour.call(this,a,b,c),a.v.x+=(this.pos.x-a.p.x)*this.spring,a.v.y+=(this.pos.y-a.p.y)*this.spring,a.v.z+=(this.pos.z-a.p.z)*this.spring;},b.Spring=O,P.ID=0,b.Util.inherits(P,b.Particle),b.EventDispatcher.initialize(P.prototype),P.prototype.emit=function(a,c){this.currentEmitTime=0,this.totalEmitTimes=b.Util.initValue(a,Infinity),c==!0||c=="life"||c=="destroy"?this.life=a=="once"?1:this.totalEmitTimes:isNaN(c)||(this.life=c),this.rate.init();},P.prototype.stopEmit=function(){this.totalEmitTimes=-1,this.currentEmitTime=0;},P.prototype.removeAllParticles=function(){var a=this.particles.length;while(a--)this.particles[a].dead=!0;},P.prototype.createParticle=function(a,c){var d=this.parent.pool.get(b.Particle);this.setupParticle(d,a,c),this.parent&&this.parent.dispatchEvent("PARTICLE_CREATED",d),b.bindEmtterEvent&&this.dispatchEvent("PARTICLE_CREATED",d);return d},P.prototype.addSelfInitialize=function(a){a.init?a.init(this):this.initAll();},P.prototype.addInitialize=function(){var a=arguments.length;while(a--)this.initializes.push(arguments[a]);},P.prototype.removeInitialize=function(a){var b=this.initializes.indexOf(a);b>-1&&this.initializes.splice(b,1);},P.prototype.removeInitializers=function(){b.Util.destroyArray(this.initializes);},P.prototype.addBehaviour=function(){var a=arguments.length;while(a--)this.behaviours.push(arguments[a]);},P.prototype.removeBehaviour=function(a){var b=this.behaviours.indexOf(a);b>-1&&this.behaviours.splice(b,1);},P.prototype.removeAllBehaviours=function(){b.Util.destroyArray(this.behaviours);},P.prototype.integrate=function(a){var c=1-this.damping;b.integrator.integrate(this,a,c);var d=this.particles.length;while(d--){var e=this.particles[d];e.update(a,d),b.integrator.integrate(e,a,c),this.parent&&this.parent.dispatchEvent("PARTICLE_UPDATE",e),b.bindEmtterEvent&&this.dispatchEvent("PARTICLE_UPDATE",e);}},P.prototype.emitting=function(a){if(this.totalEmitTimes=="once"){var b=this.rate.getValue(99999);b>0&&(this.cID=b);while(b--)this.createParticle();this.totalEmitTimes="none";}else if(!isNaN(this.totalEmitTimes)){this.currentEmitTime+=a;if(this.currentEmitTime<this.totalEmitTimes){var b=this.rate.getValue(a);b>0&&(this.cID=b);while(b--)this.createParticle();}}},P.prototype.update=function(a){this.age+=a,(this.dead||this.age>=this.life)&&this.destroy(),this.emitting(a),this.integrate(a);var c,d=this.particles.length;while(d--)c=this.particles[d],c.dead&&(this.parent&&this.parent.dispatchEvent("PARTICLE_DEAD",c),b.bindEmtterEvent&&this.dispatchEvent("PARTICLE_DEAD",c),this.parent.pool.expire(c.reset()),this.particles.splice(d,1));},P.prototype.setupParticle=function(a,c,d){var e=this.initializes,f=this.behaviours;c&&(b.Util.isArray(c)?e=c:e=[c]),d&&(b.Util.isArray(d)?f=d:f=[d]),b.InitializeUtil.initialize(this,a,e),a.addBehaviours(f),a.parent=this,this.particles.push(a);},P.prototype.destroy=function(){this.dead=!0,this.energy=0,this.totalEmitTimes=-1,this.particles.length==0&&(this.removeInitializers(),this.removeAllBehaviours(),this.parent&&this.parent.removeEmitter(this));},b.Emitter=P,b.Util.inherits(Q,b.Emitter),Q.prototype.addSelfBehaviour=function(){var a=arguments.length,b;for(b=0;b<a;b++)this.selfBehaviours.push(arguments[b]);},Q.prototype.removeSelfBehaviour=function(a){var b=this.selfBehaviours.indexOf(a);b>-1&&this.selfBehaviours.splice(b,1);},Q.prototype.update=function(a){Q._super_.prototype.update.call(this,a);if(!this.sleep){var b=this.selfBehaviours.length,c;for(c=0;c<b;c++)this.selfBehaviours[c].applyBehaviour(this,a,c);}},b.BehaviourEmitter=Q,b.Util.inherits(R,b.Emitter),R.prototype.initEventHandler=function(){var a=this;this.mousemoveHandler=function(b){a.mousemove.call(a,b);},this.mousedownHandler=function(b){a.mousedown.call(a,b);},this.mouseupHandler=function(b){a.mouseup.call(a,b);},this.mouseTarget.addEventListener("mousemove",this.mousemoveHandler,!1);},R.prototype.emit=function(){this._allowEmitting=!0;},R.prototype.stopEmit=function(){this._allowEmitting=!1;},R.prototype.setCameraAndCanvas=function(a,b){this.camera=a,this.canvas=b;},R.prototype.setCameraAndRenderer=function(a,b){this.camera=a,this.renderer=b,this.canvas=b.domElement;},R.prototype.mousemove=function(a){var c=this.canvas.getBoundingClientRect(),d=a.clientX-c.left,e=a.clientY-c.top,f=this.renderer?this.renderer.getPixelRatio():1;d*=f,e*=f,this.mouse.x+=(d-this.mouse.x)*this.ease,this.mouse.y+=(e-this.mouse.y)*this.ease,this.p.copy(b.THREEUtil.toSpacePos(this.mouse,this.camera,this.canvas,this.renderer)),this._allowEmitting&&R._super_.prototype.emit.call(this,"once");},R.prototype.destroy=function(){R._super_.prototype.destroy.call(this),this.mouseTarget.removeEventListener("mousemove",this.mousemoveHandler,!1);},b.FollowEmitter=R;var S=S||{easeLinear:function(a){return a},easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return -(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){if((a/=.5)<1)return .5*Math.pow(a,2);return -0.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){if((a/=.5)<1)return .5*Math.pow(a,3);return .5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return -(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){if((a/=.5)<1)return .5*Math.pow(a,4);return -0.5*((a-=2)*Math.pow(a,3)-2)},easeInSine:function(a){return -Math.cos(a*(b.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(b.PI/2))},easeInOutSine:function(a){return -0.5*(Math.cos(b.PI*a)-1)},easeInExpo:function(a){return a===0?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return a===1?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){if(a===0)return 0;if(a===1)return 1;if((a/=.5)<1)return .5*Math.pow(2,10*(a-1));return .5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return -(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){if((a/=.5)<1)return -0.5*(Math.sqrt(1-a*a)-1);return .5*(Math.sqrt(1-(a-=2)*a)+1)},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return (a=a-1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;if((a/=.5)<1)return .5*a*a*(((b*=1.525)+1)*a-b);return .5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},setEasingByName:function(a){return S[a]?S[a]:S.easeLinear}};for(var T in S)T!="setEasingByName"&&(b[T]=S[T]);b.ease=S,U.prototype={init:function(a){var b=this;this.proton=a,this.proton.addEventListener("PROTON_UPDATE",function(a){b.onProtonUpdate.call(b,a);}),this.proton.addEventListener("PARTICLE_CREATED",function(a){b.onParticleCreated.call(b,a);}),this.proton.addEventListener("PARTICLE_UPDATE",function(a){b.onParticleUpdate.call(b,a);}),this.proton.addEventListener("PARTICLE_DEAD",function(a){b.onParticleDead.call(b,a);});},remove:function(a){this.proton=null;},onParticleCreated:function(a){},onParticleUpdate:function(a){},onParticleDead:function(a){},onProtonUpdate:function(a){}},b.BaseRender=U,b.Util.inherits(V,b.BaseRender),V.prototype.onProtonUpdate=function(){},V.prototype.onParticleCreated=function(a){if(!a.target){a.body||(a.body=this._body),a.target=this._targetPool.get(a.body);if(a.useAlpha||a.useColor)a.target.material.__puid=b.PUID.id(a.body.material),a.target.material=this._materialPool.get(a.target.material);}a.target&&(a.target.position.copy(a.p),this.container.add(a.target));},V.prototype.onParticleUpdate=function(a){a.target&&(a.target.position.copy(a.p),a.target.rotation.set(a.rotation.x,a.rotation.y,a.rotation.z),this.scale(a),a.useAlpha&&(a.target.material.opacity=a.alpha,a.target.material.transparent=!0),a.useColor&&a.target.material.color.copy(a.color));},V.prototype.scale=function(a){a.target.scale.set(a.scale,a.scale,a.scale);},V.prototype.onParticleDead=function(a){a.target&&((a.useAlpha||a.useColor)&&this._materialPool.expire(a.target.material),this._targetPool.expire(a.target),this.container.remove(a.target),a.target=null);},b.MeshRender=V,b.Util.inherits(W,b.BaseRender),W.prototype.onProtonUpdate=function(){},W.prototype.onParticleCreated=function(b){b.target||(b.target=new a.Vector3),b.target.copy(b.p),this.points.geometry.vertices.push(b.target);},W.prototype.onParticleUpdate=function(a){a.target&&a.target.copy(a.p);},W.prototype.onParticleDead=function(a){if(a.target){var b=this.points.geometry.vertices.indexOf(a.target);b>-1&&this.points.geometry.vertices.splice(b,1),a.target=null;}},b.PointsRender=W,b.Util.inherits(X,b.MeshRender),X.prototype.scale=function(a){a.target.scale.set(a.scale*a.radius,a.scale*a.radius,1);},b.SpriteRender=X,b.Util.inherits(Y,b.BaseRender),Y.prototype.onProtonUpdate=function(){},Y.prototype.onParticleCreated=function(a){},Y.prototype.onParticleUpdate=function(a){},Y.prototype.onParticleDead=function(a){},b.CustomRender=Y,Z.prototype={getPosition:function(){return null},crossing:function(a){switch(this.crossType){case"bound":this._bound(a);break;case"cross":this._cross(a);break;case"dead":this._dead(a);}},_dead:function(a){},_bound:function(a){},_cross:function(a){}},b.Zone=Z,b.Util.inherits($,b.Zone),$.prototype.getPosition=function(){this.random=Math.random(),this.vector.x=this.x1+this.random*(this.x2-this.x1),this.vector.y=this.y1+this.random*(this.y2-this.y1),this.vector.z=this.z1+this.random*(this.z2-this.z1);return this.vector},$.prototype.crossing=function(a){this.log&&(console.error("Sorry LineZone does not support crossing method"),this.log=!1);},b.LineZone=$,b.Util.inherits(_,b.Zone),_.prototype.getPosition=function(){var a,c,d;return function(){this.random=Math.random(),d=this.random*this.radius,a=b.PI*Math.random(),c=b.PI*2*Math.random(),this.vector.x=this.x+d*Math.sin(a)*Math.cos(c),this.vector.y=this.y+d*Math.sin(c)*Math.sin(a),this.vector.z=this.z+d*Math.cos(a);return this.vector}}(),_.prototype._dead=function(a){var b=a.p.distanceTo(this);b-a.radius>this.radius&&(a.dead=!0);},_.prototype._bound=function(){var a=new b.Vector3D,c=new b.Vector3D,d;return function(b){var e=b.p.distanceTo(this);e+b.radius>=this.radius&&(a.copy(b.p).sub(this).normalize(),c.copy(b.v),d=2*c.dot(a),b.v.sub(a.scalar(d)));}}(),_.prototype._cross=function(a){this.log&&(console.error("Sorry SphereZone does not support _cross method"),this.log=!1);},b.SphereZone=_,b.Util.inherits(ba,b.Zone),ba.prototype.getPosition=function(){var a=this.geometry.vertices,b=a[a.length*Math.random()>>0];this.vector.x=b.x*this.scale,this.vector.y=b.y*this.scale,this.vector.z=b.z*this.scale;return this.vector},ba.prototype.crossing=function(a){this.log&&(console.error("Sorry MeshZone does not support crossing method"),this.log=!1);},b.MeshZone=ba,b.Util.inherits(bb,b.Zone),bb.prototype.getPosition=function(){this.vector.x=this.x,this.vector.y=this.y,this.vector.z=this.z;return this.vector},bb.prototype.crossing=function(a){this.log&&(console.error("Sorry PointZone does not support crossing method"),this.log=!1);},b.PointZone=bb,b.Util.inherits(bc,b.Zone),bc.prototype.getPosition=function(){this.vector.x=this.x+b.MathUtils.randomAToB(-0.5,.5)*this.width,this.vector.y=this.y+b.MathUtils.randomAToB(-0.5,.5)*this.height,this.vector.z=this.z+b.MathUtils.randomAToB(-0.5,.5)*this.depth;return this.vector},bc.prototype._dead=function(a){a.p.x+a.radius<this.x-this.width/2?a.dead=!0:a.p.x-a.radius>this.x+this.width/2&&(a.dead=!0),a.p.y+a.radius<this.y-this.height/2?a.dead=!0:a.p.y-a.radius>this.y+this.height/2&&(a.dead=!0),a.p.z+a.radius<this.z-this.depth/2?a.dead=!0:a.p.z-a.radius>this.z+this.depth/2&&(a.dead=!0);},bc.prototype._bound=function(a){a.p.x-a.radius<this.x-this.width/2?(a.p.x=this.x-this.width/2+a.radius,a.v.x*=-this.friction,this._static(a,"x")):a.p.x+a.radius>this.x+this.width/2&&(a.p.x=this.x+this.width/2-a.radius,a.v.x*=-this.friction,this._static(a,"x")),a.p.y-a.radius<this.y-this.height/2?(a.p.y=this.y-this.height/2+a.radius,a.v.y*=-this.friction,this._static(a,"y")):a.p.y+a.radius>this.y+this.height/2&&(a.p.y=this.y+this.height/2-a.radius,a.v.y*=-this.friction,this._static(a,"y")),a.p.z-a.radius<this.z-this.depth/2?(a.p.z=this.z-this.depth/2+a.radius,a.v.z*=-this.friction,this._static(a,"z")):a.p.z+a.radius>this.z+this.depth/2&&(a.p.z=this.z+this.depth/2-a.radius,a.v.z*=-this.friction,this._static(a,"z"));},bc.prototype._static=function(a,b){a.v[b]*a.a[b]>0||Math.abs(a.v[b])<Math.abs(a.a[b])*.0167*this.max&&(a.v[b]=0,a.a[b]=0);},bc.prototype._cross=function(a){a.p.x+a.radius<this.x-this.width/2&&a.v.x<=0?a.p.x=this.x+this.width/2+a.radius:a.p.x-a.radius>this.x+this.width/2&&a.v.x>=0&&(a.p.x=this.x-this.width/2-a.radius),a.p.y+a.radius<this.y-this.height/2&&a.v.y<=0?a.p.y=this.y+this.height/2+a.radius:a.p.y-a.radius>this.y+this.height/2&&a.v.y>=0&&(a.p.y=this.y-this.height/2-a.radius),a.p.z+a.radius<this.z-this.depth/2&&a.v.z<=0?a.p.z=this.z+this.depth/2+a.radius:a.p.z-a.radius>this.z+this.depth/2&&a.v.z>=0&&(a.p.z=this.z-this.depth/2-a.radius);},b.BoxZone=bc,b.Util.inherits(bd,b.Zone),bd.prototype.getPosition=function(){var a=new b.Vector3D,c;return function(){c=this.renderer.domElement,a.x=Math.random()*c.width,a.y=Math.random()*c.height,this.vector.copy(b.THREEUtil.toSpacePos(a,this.camera,c));return this.vector}}(),bd.prototype._dead=function(a){var c=b.THREEUtil.toScreenPos(a.p,this.camera,this.renderer.domElement),d=this.renderer.domElement;c.y+a.radius<-this.dis&&this.d1?a.dead=!0:c.y-a.radius>d.height+this.dis&&this.d3&&(a.dead=!0),c.x+a.radius<-this.dis&&this.d4?a.dead=!0:c.x-a.radius>d.width+this.dis&&this.d2&&(a.dead=!0);},bd.prototype._cross=function(){var a=new b.Vector3D;return function(c){var d=b.THREEUtil.toScreenPos(c.p,this.camera,this.renderer.domElement),e=this.renderer.domElement;d.y+c.radius<-this.dis?(a.x=d.x,a.y=e.height+this.dis+c.radius,c.p.y=b.THREEUtil.toSpacePos(a,this.camera,e).y):d.y-c.radius>e.height+this.dis&&(a.x=d.x,a.y=-this.dis-c.radius,c.p.y=b.THREEUtil.toSpacePos(a,this.camera,e).y),d.x+c.radius<-this.dis?(a.y=d.y,a.x=e.width+this.dis+c.radius,c.p.x=b.THREEUtil.toSpacePos(a,this.camera,e).x):d.x-c.radius>e.width+this.dis&&(a.y=d.y,a.x=-this.dis-c.radius,c.p.x=b.THREEUtil.toSpacePos(a,this.camera,e).x);}}(),bd.prototype._bound=function(a){var c=b.THREEUtil.toScreenPos(a.p,this.camera,this.renderer.domElement),d=this.renderer.domElement;c.y+a.radius<-this.dis?a.v.y*=-1:c.y-a.radius>d.height+this.dis&&(a.v.y*=-1),c.x+a.radius<-this.dis?a.v.y*=-1:c.x-a.radius>d.width+this.dis&&(a.v.y*=-1);},b.ScreenZone=bd;var be=function(){if(window.console&&window.console.trace){var a=Array.prototype.slice.call(arguments),b=arguments[0]+"";if(b.indexOf("+")==0){var c=parseInt(arguments[0]);be.once<c&&(a.shift(),console.trace.apply(console,a),be.once++);}else a.unshift("+15"),be.apply(console,a);}};be.once=0,b.log=be;var bf=bf||{addEventListener:function(a,b){a.addEventListener("PROTON_UPDATE",function(a){b(a);});},drawZone:function(c,d,e){var f,g,h;e instanceof b.PointZone?f=new a.SphereGeometry(15):e instanceof b.LineZone||(e instanceof b.BoxZone?f=new a.BoxGeometry(e.width,e.height,e.depth):e instanceof b.SphereZone?f=new a.SphereGeometry(e.radius,10,10):e instanceof b.MeshZone&&(e.geometry instanceof a.Geometry?f=e.geometry:f=e.geometry.geometry,f=new a.SphereGeometry(e.radius,10,10))),g=new a.MeshBasicMaterial({color:"#2194ce",wireframe:!0}),h=new a.Mesh(f,g),d.add(h),this.addEventListener(c,function(a){h.position.set(e.x,e.y,e.z);});},drawEmitter:function(b,c,d,e){var f=new a.OctahedronGeometry(15),g=new a.MeshBasicMaterial({color:e||"#aaa",wireframe:!0}),h=new a.Mesh(f,g);c.add(h),this.addEventListener(b,function(){h.position.copy(d.p),h.rotation.set(d.rotation.x,d.rotation.y,d.rotation.z);});},renderInfo:function(){function b(a){var b=a.emitters[0];return Math.round(b.p.x)+","+Math.round(b.p.y)+","+Math.round(b.p.z)}function a(a,b){var c=b=="material"?"_materialPool":"_targetPool",d=a.renderers[0];return d[c].cID}return function(c,d){this.addInfo(d);var e="";switch(this._infoType){case 2:e+="emitter:"+c.emitters.length+"<br>",e+="em speed:"+c.emitters[0].cID+"<br>",e+="pos:"+b(c);break;case 3:e+=c.renderers[0].name+"<br>",e+="target:"+a(c,"target")+"<br>",e+="material:"+a(c,"material");break;default:e+="particles:"+c.getCount()+"<br>",e+="pool:"+c.pool.getCount()+"<br>",e+="total:"+(c.getCount()+c.pool.getCount());}this._infoCon.innerHTML=e;}}(),addInfo:function(){return function(a){var b=this;if(!this._infoCon){this._infoCon=document.createElement("div"),this._infoCon.style.cssText=["position:fixed;bottom:0px;left:0;cursor:pointer;","opacity:0.9;z-index:10000;padding:10px;font-size:12px;","width:120px;height:50px;background-color:#002;color:#0ff;"].join(""),this._infoType=1,this._infoCon.addEventListener("click",function(a){b._infoType++,b._infoType>3&&(b._infoType=1);},!1);var c,d;switch(a){case 2:c="#201",d="#f08";break;case 3:c="#020",d="#0f0";break;default:c="#002",d="#0ff";}this._infoCon.style["background-color"]=c,this._infoCon.style.color=d;}this._infoCon.parentNode||document.body.appendChild(this._infoCon);}}()};b.Debug=bf;return b});
|
|
87417
|
-
}(three_proton_min));
|
|
87418
|
-
|
|
87419
|
-
var Proton = three_proton_min.exports;let ParticleEmitterGroup = /*#__PURE__*/function (_Entity) {
|
|
87420
|
-
_inherits(ParticleEmitterGroup, _Entity);
|
|
87421
|
-
|
|
87422
|
-
var _super = _createSuper(ParticleEmitterGroup);
|
|
87423
|
-
|
|
87424
|
-
function ParticleEmitterGroup() {
|
|
87425
|
-
var _this;
|
|
87426
|
-
|
|
87427
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
87428
|
-
|
|
87429
|
-
_classCallCheck(this, ParticleEmitterGroup);
|
|
87430
|
-
|
|
87431
|
-
_this = _super.call(this, {
|
|
87432
|
-
tag: "particle "
|
|
87433
|
-
});
|
|
87434
|
-
const {
|
|
87435
|
-
name = generateRandomName("EmitterGroup"),
|
|
87436
|
-
system
|
|
87437
|
-
} = options;
|
|
87438
|
-
_this.options = { ...options,
|
|
87439
|
-
name
|
|
87440
|
-
};
|
|
87441
|
-
_this.system = new Map();
|
|
87442
87369
|
|
|
87443
|
-
|
|
87444
|
-
body: new Object3D()
|
|
87445
|
-
});
|
|
87446
|
-
|
|
87447
|
-
_this.setName(name);
|
|
87448
|
-
|
|
87449
|
-
_this.setEntityType(ENTITY_TYPES.PARTICLE.TYPE);
|
|
87450
|
-
|
|
87451
|
-
_this.setEntitySubtype(ENTITY_TYPES.PARTICLE.SUBTYPES.EMITTER_GROUP);
|
|
87452
|
-
|
|
87453
|
-
_this.setSystem(system);
|
|
87454
|
-
|
|
87455
|
-
return _this;
|
|
87456
|
-
}
|
|
87457
|
-
|
|
87458
|
-
_createClass(ParticleEmitterGroup, [{
|
|
87459
|
-
key: "setBody",
|
|
87460
|
-
value: function setBody(_ref) {
|
|
87461
|
-
let {
|
|
87462
|
-
body
|
|
87463
|
-
} = _ref;
|
|
87464
|
-
this.body = body;
|
|
87465
|
-
|
|
87466
|
-
if (this.hasBody()) {
|
|
87467
|
-
this.addToScene();
|
|
87468
|
-
}
|
|
87370
|
+
return false;
|
|
87469
87371
|
}
|
|
87470
87372
|
}, {
|
|
87471
|
-
key: "
|
|
87472
|
-
value: function
|
|
87473
|
-
|
|
87474
|
-
|
|
87475
|
-
|
|
87476
|
-
|
|
87477
|
-
|
|
87478
|
-
|
|
87479
|
-
} else {
|
|
87480
|
-
console.warn(ELEMENT_NOT_SET);
|
|
87481
|
-
}
|
|
87373
|
+
key: "addHelpers",
|
|
87374
|
+
value: function addHelpers() {
|
|
87375
|
+
let {
|
|
87376
|
+
holderName = "particleholder",
|
|
87377
|
+
holderSize = 0.15
|
|
87378
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
87379
|
+
this.addHolder(holderName, holderSize);
|
|
87380
|
+
this.isUsingHelper = true;
|
|
87482
87381
|
}
|
|
87483
87382
|
}, {
|
|
87484
|
-
key: "
|
|
87485
|
-
value: function
|
|
87486
|
-
this.
|
|
87383
|
+
key: "usingHelper",
|
|
87384
|
+
value: function usingHelper() {
|
|
87385
|
+
return !!this.isUsingHelper;
|
|
87487
87386
|
}
|
|
87488
87387
|
}, {
|
|
87489
|
-
key: "
|
|
87490
|
-
value: function
|
|
87491
|
-
return
|
|
87388
|
+
key: "hasHolder",
|
|
87389
|
+
value: function hasHolder() {
|
|
87390
|
+
return !!this.holder;
|
|
87492
87391
|
}
|
|
87493
87392
|
}, {
|
|
87494
|
-
key: "
|
|
87495
|
-
value: function
|
|
87496
|
-
|
|
87393
|
+
key: "setPreset",
|
|
87394
|
+
value: function setPreset(preset) {
|
|
87395
|
+
this.preset = preset;
|
|
87497
87396
|
}
|
|
87498
87397
|
}, {
|
|
87499
|
-
key: "
|
|
87500
|
-
value: function
|
|
87501
|
-
this.
|
|
87398
|
+
key: "getPreset",
|
|
87399
|
+
value: function getPreset() {
|
|
87400
|
+
return this.preset;
|
|
87502
87401
|
}
|
|
87503
87402
|
}, {
|
|
87504
|
-
key: "
|
|
87505
|
-
value: function
|
|
87506
|
-
|
|
87507
|
-
system.forEach(emitter => {
|
|
87508
|
-
this.add(emitter);
|
|
87509
|
-
this.system.set(emitter.getName(), emitter);
|
|
87510
|
-
});
|
|
87403
|
+
key: "setSceneEmitter",
|
|
87404
|
+
value: function setSceneEmitter(value) {
|
|
87405
|
+
this._sceneEmitter = !!value;
|
|
87511
87406
|
}
|
|
87512
87407
|
}, {
|
|
87513
|
-
key: "
|
|
87514
|
-
value: function
|
|
87515
|
-
return this.
|
|
87408
|
+
key: "isSceneEmitter",
|
|
87409
|
+
value: function isSceneEmitter() {
|
|
87410
|
+
return this._sceneEmitter;
|
|
87516
87411
|
}
|
|
87517
87412
|
}, {
|
|
87518
|
-
key: "
|
|
87519
|
-
value: function
|
|
87520
|
-
|
|
87413
|
+
key: "toJSON",
|
|
87414
|
+
value: function toJSON() {
|
|
87415
|
+
let parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
87521
87416
|
|
|
87522
|
-
|
|
87523
|
-
return emitter;
|
|
87524
|
-
} else {
|
|
87525
|
-
console.log(EMITTER_NOT_FOUND, name);
|
|
87526
|
-
}
|
|
87527
|
-
}
|
|
87528
|
-
}, {
|
|
87529
|
-
key: "forEach",
|
|
87530
|
-
value: function forEach(cb) {
|
|
87531
|
-
this.system.forEach(emitter => cb(emitter));
|
|
87532
|
-
}
|
|
87533
|
-
}, {
|
|
87534
|
-
key: "emit",
|
|
87535
|
-
value: function emit() {
|
|
87536
|
-
for (var _len = arguments.length, options = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
87537
|
-
options[_key] = arguments[_key];
|
|
87538
|
-
}
|
|
87417
|
+
const base = _get(_getPrototypeOf(ParticleEmitter.prototype), "toJSON", this).call(this, parseJSON);
|
|
87539
87418
|
|
|
87540
|
-
if (
|
|
87541
|
-
|
|
87542
|
-
|
|
87419
|
+
if (!base) return base; // Replace `options` with the serializable particleConfig
|
|
87420
|
+
// so that Proton objects (Rate, Initializers, Behaviours) don't end up in JSON
|
|
87421
|
+
|
|
87422
|
+
return { ...base,
|
|
87423
|
+
preset: this.preset,
|
|
87424
|
+
options: this.particleConfig
|
|
87425
|
+
};
|
|
87543
87426
|
}
|
|
87544
87427
|
}, {
|
|
87545
|
-
key: "
|
|
87546
|
-
value: function
|
|
87547
|
-
if (this.
|
|
87548
|
-
this.
|
|
87428
|
+
key: "dispose",
|
|
87429
|
+
value: function dispose() {
|
|
87430
|
+
if (this.holder) {
|
|
87431
|
+
this.holder.dispose();
|
|
87432
|
+
this.holder = undefined;
|
|
87549
87433
|
}
|
|
87434
|
+
|
|
87435
|
+
_get(_getPrototypeOf(ParticleEmitter.prototype), "dispose", this).call(this);
|
|
87550
87436
|
}
|
|
87551
87437
|
}, {
|
|
87552
|
-
key: "
|
|
87553
|
-
value: function
|
|
87554
|
-
|
|
87438
|
+
key: "setPosition",
|
|
87439
|
+
value: function setPosition(where) {
|
|
87440
|
+
let {
|
|
87441
|
+
updateHolder = true
|
|
87442
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
87555
87443
|
|
|
87556
|
-
|
|
87444
|
+
_get(_getPrototypeOf(ParticleEmitter.prototype), "setPosition", this).call(this, where);
|
|
87445
|
+
|
|
87446
|
+
if (this.hasHolder() && updateHolder) {
|
|
87447
|
+
this.holder.setPosition(this.getPosition());
|
|
87448
|
+
}
|
|
87557
87449
|
}
|
|
87558
87450
|
}, {
|
|
87559
87451
|
key: "update",
|
|
87560
87452
|
value: function update(dt) {
|
|
87561
|
-
_get(_getPrototypeOf(
|
|
87453
|
+
_get(_getPrototypeOf(ParticleEmitter.prototype), "update", this).call(this, dt);
|
|
87562
87454
|
|
|
87563
|
-
|
|
87564
|
-
|
|
87455
|
+
this.syncParticleEmitter();
|
|
87456
|
+
|
|
87457
|
+
if (this.usingHelper()) {
|
|
87458
|
+
this.setPosition(this.holder.getPosition(), {
|
|
87459
|
+
updateHolder: false
|
|
87460
|
+
});
|
|
87565
87461
|
}
|
|
87566
87462
|
}
|
|
87567
87463
|
}]);
|
|
87568
87464
|
|
|
87569
|
-
return
|
|
87465
|
+
return ParticleEmitter;
|
|
87570
87466
|
}(Entity);const DEFAULT_PARTICLE_COLOR = PALETTES.BASE.BLACK;
|
|
87571
87467
|
const SYSTEM_DISPOSE_TIMEOUT = 700;
|
|
87572
87468
|
|
|
@@ -87588,6 +87484,8 @@ let ProtonParticleEmitter = /*#__PURE__*/function (_ParticleEmitter) {
|
|
|
87588
87484
|
texture = false,
|
|
87589
87485
|
color = DEFAULT_PARTICLE_COLOR,
|
|
87590
87486
|
rate,
|
|
87487
|
+
autoEmit = false,
|
|
87488
|
+
emitWhenEditing = false,
|
|
87591
87489
|
...rest
|
|
87592
87490
|
} = options;
|
|
87593
87491
|
const parsedOptions = {
|
|
@@ -87596,6 +87494,8 @@ let ProtonParticleEmitter = /*#__PURE__*/function (_ParticleEmitter) {
|
|
|
87596
87494
|
texture,
|
|
87597
87495
|
color,
|
|
87598
87496
|
rate,
|
|
87497
|
+
autoEmit,
|
|
87498
|
+
emitWhenEditing,
|
|
87599
87499
|
...rest
|
|
87600
87500
|
};
|
|
87601
87501
|
_this = _super.call(this, parsedOptions);
|
|
@@ -87610,6 +87510,10 @@ let ProtonParticleEmitter = /*#__PURE__*/function (_ParticleEmitter) {
|
|
|
87610
87510
|
|
|
87611
87511
|
_this.setEntitySubtype(ENTITY_TYPES.PARTICLE.SUBTYPES.PROTON_EMITTER);
|
|
87612
87512
|
|
|
87513
|
+
if (autoEmit || emitWhenEditing) {
|
|
87514
|
+
_this.emit();
|
|
87515
|
+
}
|
|
87516
|
+
|
|
87613
87517
|
return _this;
|
|
87614
87518
|
}
|
|
87615
87519
|
|
|
@@ -87656,13 +87560,119 @@ let ProtonParticleEmitter = /*#__PURE__*/function (_ParticleEmitter) {
|
|
|
87656
87560
|
behaviours.forEach(behaviour => this.system.addBehaviour(behaviour));
|
|
87657
87561
|
}
|
|
87658
87562
|
}, {
|
|
87659
|
-
key: "
|
|
87660
|
-
value: function
|
|
87661
|
-
let
|
|
87662
|
-
|
|
87563
|
+
key: "rebuildSystem",
|
|
87564
|
+
value: function rebuildSystem(_ref) {
|
|
87565
|
+
let {
|
|
87566
|
+
rate,
|
|
87567
|
+
initializers = [],
|
|
87568
|
+
behaviours = [],
|
|
87569
|
+
texture,
|
|
87570
|
+
color
|
|
87571
|
+
} = _ref;
|
|
87572
|
+
const wasEmitting = this.hasSystem() && !this.system.dead;
|
|
87573
|
+
|
|
87574
|
+
if (this.hasSystem()) {
|
|
87575
|
+
this.system.stopEmit();
|
|
87576
|
+
this.system.removeAllParticles(); // Clear existing initializers and behaviours
|
|
87577
|
+
|
|
87578
|
+
this.system.initializes.length = 0;
|
|
87579
|
+
this.system.behaviours.length = 0;
|
|
87580
|
+
} // Update options so setSystem can re-read if needed
|
|
87581
|
+
|
|
87582
|
+
|
|
87583
|
+
this.options = { ...this.options,
|
|
87584
|
+
rate,
|
|
87585
|
+
initializers,
|
|
87586
|
+
behaviours,
|
|
87587
|
+
texture,
|
|
87588
|
+
color
|
|
87589
|
+
}; // Set new rate
|
|
87590
|
+
|
|
87591
|
+
this.system.rate = rate; // Re-add initializers
|
|
87592
|
+
|
|
87593
|
+
initializers.forEach(init => this.system.addInitialize(init));
|
|
87594
|
+
|
|
87595
|
+
if (texture) {
|
|
87596
|
+
this.system.addInitialize(new Proton.Body(this.createParticleBody(texture, color)));
|
|
87597
|
+
} // Re-add behaviours
|
|
87598
|
+
|
|
87599
|
+
|
|
87600
|
+
behaviours.forEach(beh => this.system.addBehaviour(beh)); // Re-emit if was emitting
|
|
87601
|
+
|
|
87602
|
+
if (wasEmitting) {
|
|
87603
|
+
this.emit();
|
|
87604
|
+
}
|
|
87605
|
+
} // Override in subclasses to rebuild from particleConfig
|
|
87606
|
+
|
|
87607
|
+
}, {
|
|
87608
|
+
key: "rebuild",
|
|
87609
|
+
value: function rebuild() {}
|
|
87610
|
+
}, {
|
|
87611
|
+
key: "setTexture",
|
|
87612
|
+
value: function setTexture(texture) {
|
|
87613
|
+
this.particleConfig.texture = texture;
|
|
87614
|
+
this.rebuild();
|
|
87615
|
+
}
|
|
87616
|
+
}, {
|
|
87617
|
+
key: "getTexture",
|
|
87618
|
+
value: function getTexture() {
|
|
87619
|
+
return this.particleConfig.texture;
|
|
87620
|
+
}
|
|
87621
|
+
}, {
|
|
87622
|
+
key: "setAutoEmit",
|
|
87623
|
+
value: function setAutoEmit(autoEmit) {
|
|
87624
|
+
this.particleConfig.autoEmit = autoEmit;
|
|
87625
|
+
}
|
|
87626
|
+
}, {
|
|
87627
|
+
key: "getAutoEmit",
|
|
87628
|
+
value: function getAutoEmit() {
|
|
87629
|
+
return this.particleConfig.autoEmit;
|
|
87630
|
+
}
|
|
87631
|
+
}, {
|
|
87632
|
+
key: "setEmitWhenEditing",
|
|
87633
|
+
value: function setEmitWhenEditing(emitWhenEditing) {
|
|
87634
|
+
this.particleConfig.emitWhenEditing = emitWhenEditing;
|
|
87635
|
+
}
|
|
87636
|
+
}, {
|
|
87637
|
+
key: "getEmitWhenEditing",
|
|
87638
|
+
value: function getEmitWhenEditing() {
|
|
87639
|
+
return this.particleConfig.emitWhenEditing;
|
|
87640
|
+
}
|
|
87641
|
+
}, {
|
|
87642
|
+
key: "setEmitMode",
|
|
87643
|
+
value: function setEmitMode(emitMode) {
|
|
87644
|
+
this.particleConfig.emitMode = emitMode;
|
|
87645
|
+
}
|
|
87646
|
+
}, {
|
|
87647
|
+
key: "getEmitMode",
|
|
87648
|
+
value: function getEmitMode() {
|
|
87649
|
+
return this.particleConfig.emitMode || "continuous";
|
|
87650
|
+
}
|
|
87651
|
+
}, {
|
|
87652
|
+
key: "setEmitDuration",
|
|
87653
|
+
value: function setEmitDuration(emitDuration) {
|
|
87654
|
+
this.particleConfig.emitDuration = emitDuration;
|
|
87655
|
+
}
|
|
87656
|
+
}, {
|
|
87657
|
+
key: "getEmitDuration",
|
|
87658
|
+
value: function getEmitDuration() {
|
|
87659
|
+
return this.particleConfig.emitDuration || 1;
|
|
87660
|
+
}
|
|
87661
|
+
}, {
|
|
87662
|
+
key: "getEmitDurationValue",
|
|
87663
|
+
value: function getEmitDurationValue() {
|
|
87664
|
+
const mode = this.getEmitMode();
|
|
87665
|
+
if (mode === "continuous") return Infinity;
|
|
87666
|
+
if (mode === "burst") return 0.1; // timed
|
|
87663
87667
|
|
|
87668
|
+
return this.getEmitDuration();
|
|
87669
|
+
}
|
|
87670
|
+
}, {
|
|
87671
|
+
key: "emit",
|
|
87672
|
+
value: function emit(duration, life) {
|
|
87664
87673
|
if (this.hasSystem()) {
|
|
87665
|
-
this.
|
|
87674
|
+
const d = duration !== undefined ? duration : this.getEmitDurationValue();
|
|
87675
|
+
this.system.emit(d, life);
|
|
87666
87676
|
}
|
|
87667
87677
|
|
|
87668
87678
|
return this;
|
|
@@ -87699,7 +87709,459 @@ let ProtonParticleEmitter = /*#__PURE__*/function (_ParticleEmitter) {
|
|
|
87699
87709
|
}]);
|
|
87700
87710
|
|
|
87701
87711
|
return ProtonParticleEmitter;
|
|
87702
|
-
}(ParticleEmitter);const
|
|
87712
|
+
}(ParticleEmitter);const getFountainRate = () => new Proton.Rate(new Proton.Span(5, 10), new Proton.Span(0.05, 0.1));
|
|
87713
|
+
|
|
87714
|
+
const getFountainInitializers = (size, strength) => [new Proton.Mass(1), new Proton.Life(2, 4), new Proton.Radius(size / 2, size), new Proton.Position(new Proton.SphereZone(size / 2)), new Proton.V(new Proton.Span(strength, strength * 1.5), new Proton.Vector3D(0, 1, 0), 30)];
|
|
87715
|
+
|
|
87716
|
+
const getFountainBehaviours = (gravity, colors) => [new Proton.Alpha(1, 0, Infinity, Proton.easeOutSine), new Proton.Scale(new Proton.Span(1, 1.5), 0.1), new Proton.G(gravity), new Proton.Color(colors[0], colors[1], Infinity, Proton.easeLinear), new Proton.RandomDrift(1, 0, 1, 0.5)];
|
|
87717
|
+
|
|
87718
|
+
let Fountain = /*#__PURE__*/function (_ProtonParticleEmitte) {
|
|
87719
|
+
_inherits(Fountain, _ProtonParticleEmitte);
|
|
87720
|
+
|
|
87721
|
+
var _super = _createSuper(Fountain);
|
|
87722
|
+
|
|
87723
|
+
function Fountain() {
|
|
87724
|
+
var _this;
|
|
87725
|
+
|
|
87726
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
87727
|
+
|
|
87728
|
+
_classCallCheck(this, Fountain);
|
|
87729
|
+
|
|
87730
|
+
const {
|
|
87731
|
+
texture,
|
|
87732
|
+
size = 5,
|
|
87733
|
+
strength = 25,
|
|
87734
|
+
gravity = 3,
|
|
87735
|
+
colors = [PALETTES.FRENCH.FLAT_FLESH, PALETTES.FRENCH.MELON_MELODY],
|
|
87736
|
+
autoEmit = false,
|
|
87737
|
+
emitWhenEditing = false,
|
|
87738
|
+
...rest
|
|
87739
|
+
} = options;
|
|
87740
|
+
const fountainOptions = {
|
|
87741
|
+
rate: getFountainRate(),
|
|
87742
|
+
texture,
|
|
87743
|
+
initializers: getFountainInitializers(size, strength),
|
|
87744
|
+
behaviours: getFountainBehaviours(gravity, colors),
|
|
87745
|
+
autoEmit,
|
|
87746
|
+
emitWhenEditing,
|
|
87747
|
+
...rest
|
|
87748
|
+
};
|
|
87749
|
+
_this = _super.call(this, fountainOptions);
|
|
87750
|
+
|
|
87751
|
+
_this.setPreset("fountain");
|
|
87752
|
+
|
|
87753
|
+
_this.setEntitySubtype(ENTITY_TYPES.PARTICLE.SUBTYPES.FOUNTAIN);
|
|
87754
|
+
|
|
87755
|
+
_this.setParticleConfig({
|
|
87756
|
+
texture,
|
|
87757
|
+
size,
|
|
87758
|
+
strength,
|
|
87759
|
+
gravity,
|
|
87760
|
+
colors,
|
|
87761
|
+
autoEmit,
|
|
87762
|
+
emitWhenEditing
|
|
87763
|
+
});
|
|
87764
|
+
|
|
87765
|
+
return _this;
|
|
87766
|
+
}
|
|
87767
|
+
|
|
87768
|
+
_createClass(Fountain, [{
|
|
87769
|
+
key: "rebuild",
|
|
87770
|
+
value: function rebuild() {
|
|
87771
|
+
const config = this.getParticleConfig();
|
|
87772
|
+
const {
|
|
87773
|
+
texture,
|
|
87774
|
+
size = 5,
|
|
87775
|
+
strength = 25,
|
|
87776
|
+
gravity = 3,
|
|
87777
|
+
colors = [PALETTES.FRENCH.FLAT_FLESH, PALETTES.FRENCH.MELON_MELODY]
|
|
87778
|
+
} = config;
|
|
87779
|
+
this.rebuildSystem({
|
|
87780
|
+
rate: getFountainRate(),
|
|
87781
|
+
initializers: getFountainInitializers(size, strength),
|
|
87782
|
+
behaviours: getFountainBehaviours(gravity, colors),
|
|
87783
|
+
texture
|
|
87784
|
+
});
|
|
87785
|
+
}
|
|
87786
|
+
}, {
|
|
87787
|
+
key: "setSize",
|
|
87788
|
+
value: function setSize(size) {
|
|
87789
|
+
this.particleConfig.size = size;
|
|
87790
|
+
this.rebuild();
|
|
87791
|
+
}
|
|
87792
|
+
}, {
|
|
87793
|
+
key: "getSize",
|
|
87794
|
+
value: function getSize() {
|
|
87795
|
+
return this.particleConfig.size;
|
|
87796
|
+
}
|
|
87797
|
+
}, {
|
|
87798
|
+
key: "setStrength",
|
|
87799
|
+
value: function setStrength(strength) {
|
|
87800
|
+
this.particleConfig.strength = strength;
|
|
87801
|
+
this.rebuild();
|
|
87802
|
+
}
|
|
87803
|
+
}, {
|
|
87804
|
+
key: "getStrength",
|
|
87805
|
+
value: function getStrength() {
|
|
87806
|
+
return this.particleConfig.strength;
|
|
87807
|
+
}
|
|
87808
|
+
}, {
|
|
87809
|
+
key: "setGravity",
|
|
87810
|
+
value: function setGravity(gravity) {
|
|
87811
|
+
this.particleConfig.gravity = gravity;
|
|
87812
|
+
this.rebuild();
|
|
87813
|
+
}
|
|
87814
|
+
}, {
|
|
87815
|
+
key: "getGravity",
|
|
87816
|
+
value: function getGravity() {
|
|
87817
|
+
return this.particleConfig.gravity;
|
|
87818
|
+
}
|
|
87819
|
+
}, {
|
|
87820
|
+
key: "setColors",
|
|
87821
|
+
value: function setColors(colors) {
|
|
87822
|
+
this.particleConfig.colors = colors;
|
|
87823
|
+
this.rebuild();
|
|
87824
|
+
}
|
|
87825
|
+
}, {
|
|
87826
|
+
key: "getColors",
|
|
87827
|
+
value: function getColors() {
|
|
87828
|
+
return this.particleConfig.colors;
|
|
87829
|
+
}
|
|
87830
|
+
}]);
|
|
87831
|
+
|
|
87832
|
+
return Fountain;
|
|
87833
|
+
}(ProtonParticleEmitter);let ParticleEmitterGroup = /*#__PURE__*/function (_Entity) {
|
|
87834
|
+
_inherits(ParticleEmitterGroup, _Entity);
|
|
87835
|
+
|
|
87836
|
+
var _super = _createSuper(ParticleEmitterGroup);
|
|
87837
|
+
|
|
87838
|
+
function ParticleEmitterGroup() {
|
|
87839
|
+
var _this;
|
|
87840
|
+
|
|
87841
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
87842
|
+
|
|
87843
|
+
_classCallCheck(this, ParticleEmitterGroup);
|
|
87844
|
+
|
|
87845
|
+
_this = _super.call(this, {
|
|
87846
|
+
tag: "particle "
|
|
87847
|
+
});
|
|
87848
|
+
const {
|
|
87849
|
+
name = generateRandomName("EmitterGroup"),
|
|
87850
|
+
system,
|
|
87851
|
+
autoEmit = false,
|
|
87852
|
+
emitWhenEditing = false
|
|
87853
|
+
} = options;
|
|
87854
|
+
_this.options = { ...options,
|
|
87855
|
+
name,
|
|
87856
|
+
autoEmit,
|
|
87857
|
+
emitWhenEditing
|
|
87858
|
+
};
|
|
87859
|
+
_this.system = new Map();
|
|
87860
|
+
_this.particleConfig = {};
|
|
87861
|
+
_this.preset = null;
|
|
87862
|
+
_this._sceneEmitter = false;
|
|
87863
|
+
_this.isUsingHelper = undefined;
|
|
87864
|
+
_this.holder = undefined;
|
|
87865
|
+
|
|
87866
|
+
_this.setBody({
|
|
87867
|
+
body: new Object3D()
|
|
87868
|
+
});
|
|
87869
|
+
|
|
87870
|
+
_this.setName(name);
|
|
87871
|
+
|
|
87872
|
+
_this.setEntityType(ENTITY_TYPES.PARTICLE.TYPE);
|
|
87873
|
+
|
|
87874
|
+
_this.setEntitySubtype(ENTITY_TYPES.PARTICLE.SUBTYPES.EMITTER_GROUP);
|
|
87875
|
+
|
|
87876
|
+
_this.setSystem(system);
|
|
87877
|
+
|
|
87878
|
+
if (autoEmit || emitWhenEditing) {
|
|
87879
|
+
_this.emit();
|
|
87880
|
+
}
|
|
87881
|
+
|
|
87882
|
+
return _this;
|
|
87883
|
+
}
|
|
87884
|
+
|
|
87885
|
+
_createClass(ParticleEmitterGroup, [{
|
|
87886
|
+
key: "setBody",
|
|
87887
|
+
value: function setBody(_ref) {
|
|
87888
|
+
let {
|
|
87889
|
+
body
|
|
87890
|
+
} = _ref;
|
|
87891
|
+
this.body = body;
|
|
87892
|
+
|
|
87893
|
+
if (this.hasBody()) {
|
|
87894
|
+
this.addToScene();
|
|
87895
|
+
}
|
|
87896
|
+
}
|
|
87897
|
+
}, {
|
|
87898
|
+
key: "addToScene",
|
|
87899
|
+
value: function addToScene() {
|
|
87900
|
+
const {
|
|
87901
|
+
addUniverse = true
|
|
87902
|
+
} = this.options;
|
|
87903
|
+
|
|
87904
|
+
if (this.hasBody()) {
|
|
87905
|
+
Scene$1.add(this.getBody(), this, addUniverse);
|
|
87906
|
+
} else {
|
|
87907
|
+
console.warn(ELEMENT_NOT_SET);
|
|
87908
|
+
}
|
|
87909
|
+
}
|
|
87910
|
+
}, {
|
|
87911
|
+
key: "isProtonEmitter",
|
|
87912
|
+
value: function isProtonEmitter() {
|
|
87913
|
+
let result = false;
|
|
87914
|
+
this.system.forEach(emitter => {
|
|
87915
|
+
if (emitter.isProtonEmitter()) result = true;
|
|
87916
|
+
});
|
|
87917
|
+
return result;
|
|
87918
|
+
}
|
|
87919
|
+
}, {
|
|
87920
|
+
key: "getType",
|
|
87921
|
+
value: function getType() {
|
|
87922
|
+
return PARTICLE_EMITTER_TYPES.GROUP;
|
|
87923
|
+
}
|
|
87924
|
+
}, {
|
|
87925
|
+
key: "hasSystem",
|
|
87926
|
+
value: function hasSystem() {
|
|
87927
|
+
return !!this.system && !!this.system.size > 0;
|
|
87928
|
+
}
|
|
87929
|
+
}, {
|
|
87930
|
+
key: "isSystemDead",
|
|
87931
|
+
value: function isSystemDead() {
|
|
87932
|
+
let allDead = true;
|
|
87933
|
+
this.system.forEach(emitter => {
|
|
87934
|
+
if (!emitter.isSystemDead()) allDead = false;
|
|
87935
|
+
});
|
|
87936
|
+
return this.system.size > 0 && allDead;
|
|
87937
|
+
}
|
|
87938
|
+
}, {
|
|
87939
|
+
key: "setSystem",
|
|
87940
|
+
value: function setSystem() {
|
|
87941
|
+
let system = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
87942
|
+
system.forEach(emitter => {
|
|
87943
|
+
this.add(emitter);
|
|
87944
|
+
this.system.set(emitter.getName(), emitter);
|
|
87945
|
+
});
|
|
87946
|
+
}
|
|
87947
|
+
}, {
|
|
87948
|
+
key: "getSystem",
|
|
87949
|
+
value: function getSystem() {
|
|
87950
|
+
return this.system;
|
|
87951
|
+
}
|
|
87952
|
+
}, {
|
|
87953
|
+
key: "getEmitter",
|
|
87954
|
+
value: function getEmitter(name) {
|
|
87955
|
+
const emitter = this.system.get(name);
|
|
87956
|
+
|
|
87957
|
+
if (emitter) {
|
|
87958
|
+
return emitter;
|
|
87959
|
+
} else {
|
|
87960
|
+
console.log(EMITTER_NOT_FOUND, name);
|
|
87961
|
+
}
|
|
87962
|
+
}
|
|
87963
|
+
}, {
|
|
87964
|
+
key: "forEach",
|
|
87965
|
+
value: function forEach(cb) {
|
|
87966
|
+
this.system.forEach(emitter => cb(emitter));
|
|
87967
|
+
}
|
|
87968
|
+
}, {
|
|
87969
|
+
key: "emit",
|
|
87970
|
+
value: function emit(duration, life) {
|
|
87971
|
+
if (this.hasSystem()) {
|
|
87972
|
+
const d = duration !== undefined ? duration : this.getEmitDurationValue();
|
|
87973
|
+
this.system.forEach(emitter => emitter.emit(d, life));
|
|
87974
|
+
}
|
|
87975
|
+
}
|
|
87976
|
+
}, {
|
|
87977
|
+
key: "stop",
|
|
87978
|
+
value: function stop() {
|
|
87979
|
+
if (this.hasSystem()) {
|
|
87980
|
+
this.system.forEach(emitter => emitter.stop());
|
|
87981
|
+
}
|
|
87982
|
+
} // Override in subclasses to rebuild from particleConfig
|
|
87983
|
+
|
|
87984
|
+
}, {
|
|
87985
|
+
key: "rebuild",
|
|
87986
|
+
value: function rebuild() {}
|
|
87987
|
+
}, {
|
|
87988
|
+
key: "setAutoEmit",
|
|
87989
|
+
value: function setAutoEmit(autoEmit) {
|
|
87990
|
+
this.particleConfig.autoEmit = autoEmit;
|
|
87991
|
+
}
|
|
87992
|
+
}, {
|
|
87993
|
+
key: "getAutoEmit",
|
|
87994
|
+
value: function getAutoEmit() {
|
|
87995
|
+
return this.particleConfig.autoEmit;
|
|
87996
|
+
}
|
|
87997
|
+
}, {
|
|
87998
|
+
key: "setEmitWhenEditing",
|
|
87999
|
+
value: function setEmitWhenEditing(emitWhenEditing) {
|
|
88000
|
+
this.particleConfig.emitWhenEditing = emitWhenEditing;
|
|
88001
|
+
}
|
|
88002
|
+
}, {
|
|
88003
|
+
key: "getEmitWhenEditing",
|
|
88004
|
+
value: function getEmitWhenEditing() {
|
|
88005
|
+
return this.particleConfig.emitWhenEditing;
|
|
88006
|
+
}
|
|
88007
|
+
}, {
|
|
88008
|
+
key: "setEmitMode",
|
|
88009
|
+
value: function setEmitMode(emitMode) {
|
|
88010
|
+
this.particleConfig.emitMode = emitMode;
|
|
88011
|
+
}
|
|
88012
|
+
}, {
|
|
88013
|
+
key: "getEmitMode",
|
|
88014
|
+
value: function getEmitMode() {
|
|
88015
|
+
return this.particleConfig.emitMode || "continuous";
|
|
88016
|
+
}
|
|
88017
|
+
}, {
|
|
88018
|
+
key: "setEmitDuration",
|
|
88019
|
+
value: function setEmitDuration(emitDuration) {
|
|
88020
|
+
this.particleConfig.emitDuration = emitDuration;
|
|
88021
|
+
}
|
|
88022
|
+
}, {
|
|
88023
|
+
key: "getEmitDuration",
|
|
88024
|
+
value: function getEmitDuration() {
|
|
88025
|
+
return this.particleConfig.emitDuration || 1;
|
|
88026
|
+
}
|
|
88027
|
+
}, {
|
|
88028
|
+
key: "getEmitDurationValue",
|
|
88029
|
+
value: function getEmitDurationValue() {
|
|
88030
|
+
const mode = this.getEmitMode();
|
|
88031
|
+
if (mode === "continuous") return Infinity;
|
|
88032
|
+
if (mode === "burst") return 0.1;
|
|
88033
|
+
return this.getEmitDuration();
|
|
88034
|
+
}
|
|
88035
|
+
}, {
|
|
88036
|
+
key: "setParticleConfig",
|
|
88037
|
+
value: function setParticleConfig(config) {
|
|
88038
|
+
this.particleConfig = config;
|
|
88039
|
+
}
|
|
88040
|
+
}, {
|
|
88041
|
+
key: "getParticleConfig",
|
|
88042
|
+
value: function getParticleConfig() {
|
|
88043
|
+
return this.particleConfig;
|
|
88044
|
+
}
|
|
88045
|
+
}, {
|
|
88046
|
+
key: "addHolder",
|
|
88047
|
+
value: function addHolder() {
|
|
88048
|
+
let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "particleholder";
|
|
88049
|
+
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;
|
|
88050
|
+
const holderSprite = new HelperSprite(size, size, name, {
|
|
88051
|
+
name
|
|
88052
|
+
});
|
|
88053
|
+
|
|
88054
|
+
if (holderSprite) {
|
|
88055
|
+
holderSprite.setSizeAttenuation(false);
|
|
88056
|
+
holderSprite.setDepthTest(false);
|
|
88057
|
+
holderSprite.setDepthWrite(false);
|
|
88058
|
+
holderSprite.setSerializable(false);
|
|
88059
|
+
holderSprite.setPosition(this.getPosition());
|
|
88060
|
+
holderSprite.addTags([TAGS.HELPER, TAGS.PARTICLES.HELPER, TAGS.PARTICLES.HOLDER, name]);
|
|
88061
|
+
holderSprite.setHelperTarget(this);
|
|
88062
|
+
this.holder = holderSprite;
|
|
88063
|
+
return true;
|
|
88064
|
+
}
|
|
88065
|
+
|
|
88066
|
+
return false;
|
|
88067
|
+
}
|
|
88068
|
+
}, {
|
|
88069
|
+
key: "addHelpers",
|
|
88070
|
+
value: function addHelpers() {
|
|
88071
|
+
let {
|
|
88072
|
+
holderName = "particleholder",
|
|
88073
|
+
holderSize = 0.15
|
|
88074
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
88075
|
+
this.addHolder(holderName, holderSize);
|
|
88076
|
+
this.isUsingHelper = true;
|
|
88077
|
+
}
|
|
88078
|
+
}, {
|
|
88079
|
+
key: "usingHelper",
|
|
88080
|
+
value: function usingHelper() {
|
|
88081
|
+
return !!this.isUsingHelper;
|
|
88082
|
+
}
|
|
88083
|
+
}, {
|
|
88084
|
+
key: "hasHolder",
|
|
88085
|
+
value: function hasHolder() {
|
|
88086
|
+
return !!this.holder;
|
|
88087
|
+
}
|
|
88088
|
+
}, {
|
|
88089
|
+
key: "setPosition",
|
|
88090
|
+
value: function setPosition(where) {
|
|
88091
|
+
let {
|
|
88092
|
+
updateHolder = true
|
|
88093
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
88094
|
+
|
|
88095
|
+
_get(_getPrototypeOf(ParticleEmitterGroup.prototype), "setPosition", this).call(this, where);
|
|
88096
|
+
|
|
88097
|
+
if (this.hasHolder() && updateHolder) {
|
|
88098
|
+
this.holder.setPosition(this.getPosition());
|
|
88099
|
+
}
|
|
88100
|
+
}
|
|
88101
|
+
}, {
|
|
88102
|
+
key: "setPreset",
|
|
88103
|
+
value: function setPreset(preset) {
|
|
88104
|
+
this.preset = preset;
|
|
88105
|
+
}
|
|
88106
|
+
}, {
|
|
88107
|
+
key: "getPreset",
|
|
88108
|
+
value: function getPreset() {
|
|
88109
|
+
return this.preset;
|
|
88110
|
+
}
|
|
88111
|
+
}, {
|
|
88112
|
+
key: "setSceneEmitter",
|
|
88113
|
+
value: function setSceneEmitter(value) {
|
|
88114
|
+
this._sceneEmitter = !!value;
|
|
88115
|
+
}
|
|
88116
|
+
}, {
|
|
88117
|
+
key: "isSceneEmitter",
|
|
88118
|
+
value: function isSceneEmitter() {
|
|
88119
|
+
return this._sceneEmitter;
|
|
88120
|
+
}
|
|
88121
|
+
}, {
|
|
88122
|
+
key: "toJSON",
|
|
88123
|
+
value: function toJSON() {
|
|
88124
|
+
let parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
88125
|
+
|
|
88126
|
+
const base = _get(_getPrototypeOf(ParticleEmitterGroup.prototype), "toJSON", this).call(this, parseJSON);
|
|
88127
|
+
|
|
88128
|
+
if (!base) return base;
|
|
88129
|
+
return { ...base,
|
|
88130
|
+
preset: this.preset,
|
|
88131
|
+
options: this.particleConfig
|
|
88132
|
+
};
|
|
88133
|
+
}
|
|
88134
|
+
}, {
|
|
88135
|
+
key: "dispose",
|
|
88136
|
+
value: function dispose() {
|
|
88137
|
+
if (this.holder) {
|
|
88138
|
+
this.holder.dispose();
|
|
88139
|
+
this.holder = undefined;
|
|
88140
|
+
}
|
|
88141
|
+
|
|
88142
|
+
_get(_getPrototypeOf(ParticleEmitterGroup.prototype), "dispose", this).call(this);
|
|
88143
|
+
|
|
88144
|
+
this.system.forEach(emitter => emitter.dispose());
|
|
88145
|
+
}
|
|
88146
|
+
}, {
|
|
88147
|
+
key: "update",
|
|
88148
|
+
value: function update(dt) {
|
|
88149
|
+
_get(_getPrototypeOf(ParticleEmitterGroup.prototype), "update", this).call(this, dt);
|
|
88150
|
+
|
|
88151
|
+
if (this.usingHelper()) {
|
|
88152
|
+
this.setPosition(this.holder.getPosition(), {
|
|
88153
|
+
updateHolder: false
|
|
88154
|
+
});
|
|
88155
|
+
}
|
|
88156
|
+
|
|
88157
|
+
if (this.hasSystem()) {
|
|
88158
|
+
this.system.forEach(emitter => emitter.update(dt));
|
|
88159
|
+
}
|
|
88160
|
+
}
|
|
88161
|
+
}]);
|
|
88162
|
+
|
|
88163
|
+
return ParticleEmitterGroup;
|
|
88164
|
+
}(Entity);const DEFAULT_SIZE$1 = 4;
|
|
87703
88165
|
|
|
87704
88166
|
const getSparksInitializers = function () {
|
|
87705
88167
|
let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_SIZE$1;
|
|
@@ -87708,7 +88170,7 @@ const getSparksInitializers = function () {
|
|
|
87708
88170
|
|
|
87709
88171
|
const getSparksBehaviours = function () {
|
|
87710
88172
|
let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_SIZE$1;
|
|
87711
|
-
return [new Proton.RandomDrift(size * 0.75, size * 0.75, size * 0.75, 0.5), new Proton.Color("#ffffff"), new Proton.Scale(1, 0.1)];
|
|
88173
|
+
return [new Proton.Alpha(1, 0), new Proton.RandomDrift(size * 0.75, size * 0.75, size * 0.75, 0.5), new Proton.Color("#ffffff"), new Proton.Scale(1, 0.1)];
|
|
87712
88174
|
};
|
|
87713
88175
|
|
|
87714
88176
|
const getSparksRate = () => new Proton.Rate(50, 0.5);
|
|
@@ -87727,7 +88189,7 @@ const getDebrisBehaviours = function () {
|
|
|
87727
88189
|
const zone = new Proton.BoxZone(0, 50, 0, 300, 100, 300);
|
|
87728
88190
|
zone.friction = 0.95;
|
|
87729
88191
|
zone.max = 7;
|
|
87730
|
-
return [new Proton.CrossZone(zone, "bound"), new Proton.Repulsion(new Proton.Vector3D(0, 0, 0), size * 12.5, size * 1.5), new Proton.G(3), new Proton.Color("#95a5a6", "#000000")];
|
|
88192
|
+
return [new Proton.Alpha(1, 0), new Proton.CrossZone(zone, "bound"), new Proton.Repulsion(new Proton.Vector3D(0, 0, 0), size * 12.5, size * 1.5), new Proton.G(3), new Proton.Color("#95a5a6", "#000000")];
|
|
87731
88193
|
};
|
|
87732
88194
|
|
|
87733
88195
|
const getFireInitializers$1 = function () {
|
|
@@ -87735,7 +88197,7 @@ const getFireInitializers$1 = function () {
|
|
|
87735
88197
|
return [new Proton.Mass(1), new Proton.Radius(size * 1.5), new Proton.Life(0.2, 0.5), new Proton.Position(new Proton.SphereZone(size * 1.25))];
|
|
87736
88198
|
};
|
|
87737
88199
|
|
|
87738
|
-
const getFireBehaviours$1 = () => [new Proton.Scale(1, 2), new Proton.Color("#c0392b", "#f1c40f")];
|
|
88200
|
+
const getFireBehaviours$1 = () => [new Proton.Alpha(1, 0), new Proton.Scale(1, 2), new Proton.Color("#c0392b", "#f1c40f")];
|
|
87739
88201
|
|
|
87740
88202
|
let Explosion = /*#__PURE__*/function (_ParticleEmitterGroup) {
|
|
87741
88203
|
_inherits(Explosion, _ParticleEmitterGroup);
|
|
@@ -87752,19 +88214,23 @@ let Explosion = /*#__PURE__*/function (_ParticleEmitterGroup) {
|
|
|
87752
88214
|
const {
|
|
87753
88215
|
texture = false,
|
|
87754
88216
|
hasDebris = false,
|
|
87755
|
-
size = DEFAULT_SIZE$1
|
|
88217
|
+
size = DEFAULT_SIZE$1,
|
|
88218
|
+
autoEmit = false,
|
|
88219
|
+
emitWhenEditing = false
|
|
87756
88220
|
} = options;
|
|
87757
88221
|
const sparks = new ProtonParticleEmitter({
|
|
87758
88222
|
rate: getSparksRate(),
|
|
87759
88223
|
texture,
|
|
87760
88224
|
initializers: getSparksInitializers(size),
|
|
87761
|
-
behaviours: getSparksBehaviours(size)
|
|
88225
|
+
behaviours: getSparksBehaviours(size),
|
|
88226
|
+
skipSceneAdd: true
|
|
87762
88227
|
});
|
|
87763
88228
|
const fire = new ProtonParticleEmitter({
|
|
87764
88229
|
rate: getFireRate$1(),
|
|
87765
88230
|
texture,
|
|
87766
88231
|
initializers: getFireInitializers$1(size),
|
|
87767
|
-
behaviours: getFireBehaviours$1()
|
|
88232
|
+
behaviours: getFireBehaviours$1(),
|
|
88233
|
+
skipSceneAdd: true
|
|
87768
88234
|
});
|
|
87769
88235
|
const system = [sparks, fire];
|
|
87770
88236
|
|
|
@@ -87773,21 +88239,98 @@ let Explosion = /*#__PURE__*/function (_ParticleEmitterGroup) {
|
|
|
87773
88239
|
rate: getDebrisRate(),
|
|
87774
88240
|
texture,
|
|
87775
88241
|
initializers: getDebrisInitializers(size),
|
|
87776
|
-
behaviours: getDebrisBehaviours(size)
|
|
88242
|
+
behaviours: getDebrisBehaviours(size),
|
|
88243
|
+
skipSceneAdd: true
|
|
87777
88244
|
}));
|
|
87778
88245
|
}
|
|
87779
88246
|
|
|
87780
88247
|
const name = "ExplosionGroup";
|
|
87781
88248
|
_this = _super.call(this, {
|
|
87782
88249
|
system,
|
|
87783
|
-
name
|
|
88250
|
+
name,
|
|
88251
|
+
autoEmit,
|
|
88252
|
+
emitWhenEditing
|
|
87784
88253
|
});
|
|
87785
88254
|
|
|
88255
|
+
_this.setPreset("explosion");
|
|
88256
|
+
|
|
87786
88257
|
_this.setEntitySubtype(ENTITY_TYPES.PARTICLE.SUBTYPES.EXPLOSION);
|
|
87787
88258
|
|
|
88259
|
+
_this.setParticleConfig({
|
|
88260
|
+
texture,
|
|
88261
|
+
hasDebris,
|
|
88262
|
+
size,
|
|
88263
|
+
autoEmit,
|
|
88264
|
+
emitWhenEditing,
|
|
88265
|
+
emitMode: "burst"
|
|
88266
|
+
});
|
|
88267
|
+
|
|
87788
88268
|
return _this;
|
|
87789
88269
|
}
|
|
87790
88270
|
|
|
88271
|
+
_createClass(Explosion, [{
|
|
88272
|
+
key: "rebuild",
|
|
88273
|
+
value: function rebuild() {
|
|
88274
|
+
const config = this.getParticleConfig();
|
|
88275
|
+
const {
|
|
88276
|
+
texture = false,
|
|
88277
|
+
size = DEFAULT_SIZE$1
|
|
88278
|
+
} = config;
|
|
88279
|
+
const emitters = Array.from(this.system.values()); // Rebuild sparks (first emitter)
|
|
88280
|
+
|
|
88281
|
+
if (emitters[0]) {
|
|
88282
|
+
emitters[0].rebuildSystem({
|
|
88283
|
+
rate: getSparksRate(),
|
|
88284
|
+
initializers: getSparksInitializers(size),
|
|
88285
|
+
behaviours: getSparksBehaviours(size),
|
|
88286
|
+
texture
|
|
88287
|
+
});
|
|
88288
|
+
} // Rebuild fire (second emitter)
|
|
88289
|
+
|
|
88290
|
+
|
|
88291
|
+
if (emitters[1]) {
|
|
88292
|
+
emitters[1].rebuildSystem({
|
|
88293
|
+
rate: getFireRate$1(),
|
|
88294
|
+
initializers: getFireInitializers$1(size),
|
|
88295
|
+
behaviours: getFireBehaviours$1(),
|
|
88296
|
+
texture
|
|
88297
|
+
});
|
|
88298
|
+
} // Rebuild debris (third emitter, if exists)
|
|
88299
|
+
|
|
88300
|
+
|
|
88301
|
+
if (emitters[2]) {
|
|
88302
|
+
emitters[2].rebuildSystem({
|
|
88303
|
+
rate: getDebrisRate(),
|
|
88304
|
+
initializers: getDebrisInitializers(size),
|
|
88305
|
+
behaviours: getDebrisBehaviours(size),
|
|
88306
|
+
texture
|
|
88307
|
+
});
|
|
88308
|
+
}
|
|
88309
|
+
}
|
|
88310
|
+
}, {
|
|
88311
|
+
key: "setSize",
|
|
88312
|
+
value: function setSize(size) {
|
|
88313
|
+
this.particleConfig.size = size;
|
|
88314
|
+
this.rebuild();
|
|
88315
|
+
}
|
|
88316
|
+
}, {
|
|
88317
|
+
key: "getSize",
|
|
88318
|
+
value: function getSize() {
|
|
88319
|
+
return this.particleConfig.size;
|
|
88320
|
+
}
|
|
88321
|
+
}, {
|
|
88322
|
+
key: "setTexture",
|
|
88323
|
+
value: function setTexture(texture) {
|
|
88324
|
+
this.particleConfig.texture = texture;
|
|
88325
|
+
this.rebuild();
|
|
88326
|
+
}
|
|
88327
|
+
}, {
|
|
88328
|
+
key: "getTexture",
|
|
88329
|
+
value: function getTexture() {
|
|
88330
|
+
return this.particleConfig.texture;
|
|
88331
|
+
}
|
|
88332
|
+
}]);
|
|
88333
|
+
|
|
87791
88334
|
return Explosion;
|
|
87792
88335
|
}(ParticleEmitterGroup);const getFireRate = () => new Proton.Rate(new Proton.Span(10, 15), new Proton.Span(0.05, 0.1));
|
|
87793
88336
|
|
|
@@ -87796,7 +88339,7 @@ const getFireInitializers = (direction, strength, size) => [new Proton.Mass(1),
|
|
|
87796
88339
|
|
|
87797
88340
|
const getFireBehaviours = function (direction, strength) {
|
|
87798
88341
|
let colors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [PALETTES.FRENCH.MANDARIN_RED, PALETTES.FRENCH.MELON_MELODY];
|
|
87799
|
-
return [new Proton.Scale(new Proton.Span(2, 2.5), 0), new Proton.G(strength / 100), new Proton.Color(colors[0], colors[1], Infinity, Proton.easeOutSine), new Proton.RandomDrift(direction.x / 100, direction.y / 100, direction.z / 100, 2.5)];
|
|
88342
|
+
return [new Proton.Alpha(1, 0.1), new Proton.Scale(new Proton.Span(2, 2.5), 0), new Proton.G(strength / 100), new Proton.Color(colors[0], colors[1], Infinity, Proton.easeOutSine), new Proton.RandomDrift(direction.x / 100, direction.y / 100, direction.z / 100, 2.5)];
|
|
87800
88343
|
};
|
|
87801
88344
|
|
|
87802
88345
|
let Fire = /*#__PURE__*/function (_ProtonParticleEmitte) {
|
|
@@ -87804,9 +88347,11 @@ let Fire = /*#__PURE__*/function (_ProtonParticleEmitte) {
|
|
|
87804
88347
|
|
|
87805
88348
|
var _super = _createSuper(Fire);
|
|
87806
88349
|
|
|
87807
|
-
function Fire(
|
|
88350
|
+
function Fire() {
|
|
87808
88351
|
var _this;
|
|
87809
88352
|
|
|
88353
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
88354
|
+
|
|
87810
88355
|
_classCallCheck(this, Fire);
|
|
87811
88356
|
|
|
87812
88357
|
const {
|
|
@@ -87815,6 +88360,8 @@ let Fire = /*#__PURE__*/function (_ProtonParticleEmitte) {
|
|
|
87815
88360
|
size = 20,
|
|
87816
88361
|
strength = 100,
|
|
87817
88362
|
colors,
|
|
88363
|
+
autoEmit = false,
|
|
88364
|
+
emitWhenEditing = false,
|
|
87818
88365
|
...rest
|
|
87819
88366
|
} = options;
|
|
87820
88367
|
const fireOptions = {
|
|
@@ -87822,129 +88369,388 @@ let Fire = /*#__PURE__*/function (_ProtonParticleEmitte) {
|
|
|
87822
88369
|
texture,
|
|
87823
88370
|
initializers: getFireInitializers(direction, strength, size),
|
|
87824
88371
|
behaviours: getFireBehaviours(direction, strength, colors),
|
|
88372
|
+
autoEmit,
|
|
88373
|
+
emitWhenEditing,
|
|
87825
88374
|
...rest
|
|
87826
88375
|
};
|
|
87827
88376
|
_this = _super.call(this, fireOptions);
|
|
87828
88377
|
|
|
88378
|
+
_this.setPreset("fire");
|
|
88379
|
+
|
|
87829
88380
|
_this.setEntitySubtype(ENTITY_TYPES.PARTICLE.SUBTYPES.FIRE);
|
|
87830
88381
|
|
|
88382
|
+
_this.setParticleConfig({
|
|
88383
|
+
texture,
|
|
88384
|
+
direction: {
|
|
88385
|
+
x: direction.x,
|
|
88386
|
+
y: direction.y,
|
|
88387
|
+
z: direction.z
|
|
88388
|
+
},
|
|
88389
|
+
size,
|
|
88390
|
+
strength,
|
|
88391
|
+
colors,
|
|
88392
|
+
autoEmit,
|
|
88393
|
+
emitWhenEditing
|
|
88394
|
+
});
|
|
88395
|
+
|
|
87831
88396
|
return _this;
|
|
87832
88397
|
}
|
|
87833
88398
|
|
|
88399
|
+
_createClass(Fire, [{
|
|
88400
|
+
key: "rebuild",
|
|
88401
|
+
value: function rebuild() {
|
|
88402
|
+
const config = this.getParticleConfig();
|
|
88403
|
+
const {
|
|
88404
|
+
texture,
|
|
88405
|
+
direction = {
|
|
88406
|
+
x: 0,
|
|
88407
|
+
y: 1,
|
|
88408
|
+
z: 0
|
|
88409
|
+
},
|
|
88410
|
+
size = 20,
|
|
88411
|
+
strength = 100,
|
|
88412
|
+
colors
|
|
88413
|
+
} = config;
|
|
88414
|
+
const dir = new Vector3$1(direction.x, direction.y, direction.z);
|
|
88415
|
+
this.rebuildSystem({
|
|
88416
|
+
rate: getFireRate(),
|
|
88417
|
+
initializers: getFireInitializers(dir, strength, size),
|
|
88418
|
+
behaviours: getFireBehaviours(dir, strength, colors),
|
|
88419
|
+
texture
|
|
88420
|
+
});
|
|
88421
|
+
}
|
|
88422
|
+
}, {
|
|
88423
|
+
key: "setSize",
|
|
88424
|
+
value: function setSize(size) {
|
|
88425
|
+
this.particleConfig.size = size;
|
|
88426
|
+
this.rebuild();
|
|
88427
|
+
}
|
|
88428
|
+
}, {
|
|
88429
|
+
key: "getSize",
|
|
88430
|
+
value: function getSize() {
|
|
88431
|
+
return this.particleConfig.size;
|
|
88432
|
+
}
|
|
88433
|
+
}, {
|
|
88434
|
+
key: "setStrength",
|
|
88435
|
+
value: function setStrength(strength) {
|
|
88436
|
+
this.particleConfig.strength = strength;
|
|
88437
|
+
this.rebuild();
|
|
88438
|
+
}
|
|
88439
|
+
}, {
|
|
88440
|
+
key: "getStrength",
|
|
88441
|
+
value: function getStrength() {
|
|
88442
|
+
return this.particleConfig.strength;
|
|
88443
|
+
}
|
|
88444
|
+
}, {
|
|
88445
|
+
key: "setDirection",
|
|
88446
|
+
value: function setDirection(direction) {
|
|
88447
|
+
this.particleConfig.direction = direction;
|
|
88448
|
+
this.rebuild();
|
|
88449
|
+
}
|
|
88450
|
+
}, {
|
|
88451
|
+
key: "getDirection",
|
|
88452
|
+
value: function getDirection() {
|
|
88453
|
+
return this.particleConfig.direction;
|
|
88454
|
+
}
|
|
88455
|
+
}, {
|
|
88456
|
+
key: "setColors",
|
|
88457
|
+
value: function setColors(colors) {
|
|
88458
|
+
this.particleConfig.colors = colors;
|
|
88459
|
+
this.rebuild();
|
|
88460
|
+
}
|
|
88461
|
+
}, {
|
|
88462
|
+
key: "getColors",
|
|
88463
|
+
value: function getColors() {
|
|
88464
|
+
return this.particleConfig.colors;
|
|
88465
|
+
}
|
|
88466
|
+
}]);
|
|
88467
|
+
|
|
87834
88468
|
return Fire;
|
|
87835
|
-
}(ProtonParticleEmitter);
|
|
87836
|
-
|
|
88469
|
+
}(ProtonParticleEmitter);const getRainRate = particleCount => new Proton.Rate(new Proton.Span(particleCount / 10, particleCount / 5), new Proton.Span(0.01, 0.02));
|
|
88470
|
+
|
|
88471
|
+
const getRainInitializers = (size, strength, area) => [new Proton.Mass(0.5), new Proton.Life(2, 5), new Proton.Radius(size / 4, size / 2), new Proton.Position(new Proton.BoxZone(area, 0, area)), new Proton.V(new Proton.Span(strength, strength * 1.5), new Proton.Vector3D(0, -1, 0), 2)];
|
|
88472
|
+
|
|
88473
|
+
const getRainBehaviours = (strength, colors) => [new Proton.Alpha(1, 0), new Proton.Scale(new Proton.Span(0.3, 0.5), 0.1), new Proton.G(strength / 10), new Proton.Color(colors[0], colors[1], Infinity, Proton.easeLinear), new Proton.RandomDrift(0.5, 0, 0.5, 0.5)];
|
|
88474
|
+
|
|
88475
|
+
let Rain = /*#__PURE__*/function (_ProtonParticleEmitte) {
|
|
88476
|
+
_inherits(Rain, _ProtonParticleEmitte);
|
|
87837
88477
|
|
|
87838
88478
|
var _super = _createSuper(Rain);
|
|
87839
88479
|
|
|
87840
|
-
function Rain(
|
|
88480
|
+
function Rain() {
|
|
87841
88481
|
var _this;
|
|
87842
88482
|
|
|
87843
|
-
let {
|
|
87844
|
-
container,
|
|
87845
|
-
autostart,
|
|
87846
|
-
particles,
|
|
87847
|
-
system
|
|
87848
|
-
} = _ref;
|
|
88483
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
87849
88484
|
|
|
87850
88485
|
_classCallCheck(this, Rain);
|
|
87851
88486
|
|
|
87852
|
-
const
|
|
87853
|
-
|
|
87854
|
-
|
|
87855
|
-
|
|
87856
|
-
|
|
87857
|
-
|
|
87858
|
-
|
|
87859
|
-
|
|
87860
|
-
|
|
87861
|
-
|
|
87862
|
-
|
|
87863
|
-
|
|
87864
|
-
|
|
87865
|
-
|
|
87866
|
-
|
|
87867
|
-
|
|
87868
|
-
|
|
87869
|
-
|
|
87870
|
-
|
|
87871
|
-
...particles
|
|
87872
|
-
},
|
|
87873
|
-
system: {
|
|
87874
|
-
particlesCount: 2000,
|
|
87875
|
-
emitters: new k({
|
|
87876
|
-
onInterval: new N.MinMaxRandomizer(0, 5),
|
|
87877
|
-
interval: new N.MinMaxRandomizer(0, 0.25)
|
|
87878
|
-
}),
|
|
87879
|
-
speed: 1.5,
|
|
87880
|
-
...system
|
|
87881
|
-
}
|
|
88487
|
+
const {
|
|
88488
|
+
texture,
|
|
88489
|
+
size = 1,
|
|
88490
|
+
strength = 60,
|
|
88491
|
+
area = 100,
|
|
88492
|
+
particleCount = 200,
|
|
88493
|
+
colors = ["#ffffff", "#000000"],
|
|
88494
|
+
autoEmit = false,
|
|
88495
|
+
emitWhenEditing = false,
|
|
88496
|
+
...rest
|
|
88497
|
+
} = options;
|
|
88498
|
+
const rainOptions = {
|
|
88499
|
+
rate: getRainRate(particleCount),
|
|
88500
|
+
texture,
|
|
88501
|
+
initializers: getRainInitializers(size, strength, area),
|
|
88502
|
+
behaviours: getRainBehaviours(strength, colors),
|
|
88503
|
+
autoEmit,
|
|
88504
|
+
emitWhenEditing,
|
|
88505
|
+
...rest
|
|
87882
88506
|
};
|
|
87883
|
-
_this = _super.call(this,
|
|
88507
|
+
_this = _super.call(this, rainOptions);
|
|
88508
|
+
|
|
88509
|
+
_this.setPreset("rain");
|
|
87884
88510
|
|
|
87885
88511
|
_this.setEntitySubtype(ENTITY_TYPES.PARTICLE.SUBTYPES.RAIN);
|
|
87886
88512
|
|
|
88513
|
+
_this.setParticleConfig({
|
|
88514
|
+
texture,
|
|
88515
|
+
size,
|
|
88516
|
+
strength,
|
|
88517
|
+
area,
|
|
88518
|
+
particleCount,
|
|
88519
|
+
colors,
|
|
88520
|
+
autoEmit,
|
|
88521
|
+
emitWhenEditing
|
|
88522
|
+
});
|
|
88523
|
+
|
|
87887
88524
|
return _this;
|
|
87888
88525
|
}
|
|
87889
88526
|
|
|
88527
|
+
_createClass(Rain, [{
|
|
88528
|
+
key: "rebuild",
|
|
88529
|
+
value: function rebuild() {
|
|
88530
|
+
const config = this.getParticleConfig();
|
|
88531
|
+
const {
|
|
88532
|
+
texture,
|
|
88533
|
+
size = 1,
|
|
88534
|
+
strength = 60,
|
|
88535
|
+
area = 100,
|
|
88536
|
+
particleCount = 200,
|
|
88537
|
+
colors = ["#ffffff", "#000000"]
|
|
88538
|
+
} = config;
|
|
88539
|
+
this.rebuildSystem({
|
|
88540
|
+
rate: getRainRate(particleCount),
|
|
88541
|
+
initializers: getRainInitializers(size, strength, area),
|
|
88542
|
+
behaviours: getRainBehaviours(strength, colors),
|
|
88543
|
+
texture
|
|
88544
|
+
});
|
|
88545
|
+
}
|
|
88546
|
+
}, {
|
|
88547
|
+
key: "setSize",
|
|
88548
|
+
value: function setSize(size) {
|
|
88549
|
+
this.particleConfig.size = size;
|
|
88550
|
+
this.rebuild();
|
|
88551
|
+
}
|
|
88552
|
+
}, {
|
|
88553
|
+
key: "getSize",
|
|
88554
|
+
value: function getSize() {
|
|
88555
|
+
return this.particleConfig.size;
|
|
88556
|
+
}
|
|
88557
|
+
}, {
|
|
88558
|
+
key: "setStrength",
|
|
88559
|
+
value: function setStrength(strength) {
|
|
88560
|
+
this.particleConfig.strength = strength;
|
|
88561
|
+
this.rebuild();
|
|
88562
|
+
}
|
|
88563
|
+
}, {
|
|
88564
|
+
key: "getStrength",
|
|
88565
|
+
value: function getStrength() {
|
|
88566
|
+
return this.particleConfig.strength;
|
|
88567
|
+
}
|
|
88568
|
+
}, {
|
|
88569
|
+
key: "setArea",
|
|
88570
|
+
value: function setArea(area) {
|
|
88571
|
+
this.particleConfig.area = area;
|
|
88572
|
+
this.rebuild();
|
|
88573
|
+
}
|
|
88574
|
+
}, {
|
|
88575
|
+
key: "getArea",
|
|
88576
|
+
value: function getArea() {
|
|
88577
|
+
return this.particleConfig.area;
|
|
88578
|
+
}
|
|
88579
|
+
}, {
|
|
88580
|
+
key: "setParticleCount",
|
|
88581
|
+
value: function setParticleCount(particleCount) {
|
|
88582
|
+
this.particleConfig.particleCount = particleCount;
|
|
88583
|
+
this.rebuild();
|
|
88584
|
+
}
|
|
88585
|
+
}, {
|
|
88586
|
+
key: "getParticleCount",
|
|
88587
|
+
value: function getParticleCount() {
|
|
88588
|
+
return this.particleConfig.particleCount;
|
|
88589
|
+
}
|
|
88590
|
+
}, {
|
|
88591
|
+
key: "setColors",
|
|
88592
|
+
value: function setColors(colors) {
|
|
88593
|
+
this.particleConfig.colors = colors;
|
|
88594
|
+
this.rebuild();
|
|
88595
|
+
}
|
|
88596
|
+
}, {
|
|
88597
|
+
key: "getColors",
|
|
88598
|
+
value: function getColors() {
|
|
88599
|
+
return this.particleConfig.colors;
|
|
88600
|
+
}
|
|
88601
|
+
}]);
|
|
88602
|
+
|
|
87890
88603
|
return Rain;
|
|
87891
|
-
}(
|
|
87892
|
-
|
|
88604
|
+
}(ProtonParticleEmitter);const getSnowRate = particleCount => new Proton.Rate(new Proton.Span(particleCount / 10, particleCount / 5), new Proton.Span(0.02, 0.05));
|
|
88605
|
+
|
|
88606
|
+
const getSnowInitializers = (size, strength, area) => [new Proton.Mass(0.3), new Proton.Life(3, 6), new Proton.Radius(size / 2, size), new Proton.Position(new Proton.BoxZone(area, 0, area)), new Proton.V(new Proton.Span(strength / 2, strength), new Proton.Vector3D(0, -1, 0), 15)];
|
|
88607
|
+
|
|
88608
|
+
const getSnowBehaviours = (drift, colors) => [new Proton.Alpha(0.8, 0), new Proton.Scale(new Proton.Span(0.5, 1), 0.2), new Proton.G(0.5), new Proton.Color(colors[0], colors[1], Infinity, Proton.easeLinear), new Proton.RandomDrift(drift, drift / 4, drift, 0.5)];
|
|
88609
|
+
|
|
88610
|
+
let Snow = /*#__PURE__*/function (_ProtonParticleEmitte) {
|
|
88611
|
+
_inherits(Snow, _ProtonParticleEmitte);
|
|
87893
88612
|
|
|
87894
88613
|
var _super = _createSuper(Snow);
|
|
87895
88614
|
|
|
87896
|
-
function Snow(
|
|
88615
|
+
function Snow() {
|
|
87897
88616
|
var _this;
|
|
87898
88617
|
|
|
87899
|
-
let {
|
|
87900
|
-
container,
|
|
87901
|
-
autostart,
|
|
87902
|
-
particles,
|
|
87903
|
-
system
|
|
87904
|
-
} = _ref;
|
|
88618
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
87905
88619
|
|
|
87906
88620
|
_classCallCheck(this, Snow);
|
|
87907
88621
|
|
|
87908
|
-
const
|
|
87909
|
-
|
|
87910
|
-
|
|
87911
|
-
|
|
87912
|
-
|
|
87913
|
-
|
|
87914
|
-
|
|
87915
|
-
|
|
87916
|
-
|
|
87917
|
-
|
|
87918
|
-
|
|
87919
|
-
|
|
87920
|
-
|
|
87921
|
-
|
|
87922
|
-
|
|
87923
|
-
|
|
87924
|
-
|
|
87925
|
-
|
|
87926
|
-
|
|
87927
|
-
|
|
87928
|
-
},
|
|
87929
|
-
system: {
|
|
87930
|
-
particlesCount: 4000,
|
|
87931
|
-
emitters: new k({
|
|
87932
|
-
onInterval: new N.MinMaxRandomizer(0, 5),
|
|
87933
|
-
interval: new N.MinMaxRandomizer(0, 0.25)
|
|
87934
|
-
}),
|
|
87935
|
-
speed: 1.5,
|
|
87936
|
-
...system
|
|
87937
|
-
}
|
|
88622
|
+
const {
|
|
88623
|
+
texture,
|
|
88624
|
+
size = 2,
|
|
88625
|
+
strength = 30,
|
|
88626
|
+
area = 200,
|
|
88627
|
+
drift = 3,
|
|
88628
|
+
particleCount = 400,
|
|
88629
|
+
colors = [PALETTES.BASE.WHITE, PALETTES.BASE.WHITE],
|
|
88630
|
+
autoEmit = false,
|
|
88631
|
+
emitWhenEditing = false,
|
|
88632
|
+
...rest
|
|
88633
|
+
} = options;
|
|
88634
|
+
const snowOptions = {
|
|
88635
|
+
rate: getSnowRate(particleCount),
|
|
88636
|
+
texture,
|
|
88637
|
+
initializers: getSnowInitializers(size, strength, area),
|
|
88638
|
+
behaviours: getSnowBehaviours(drift, colors),
|
|
88639
|
+
autoEmit,
|
|
88640
|
+
emitWhenEditing,
|
|
88641
|
+
...rest
|
|
87938
88642
|
};
|
|
87939
|
-
_this = _super.call(this,
|
|
88643
|
+
_this = _super.call(this, snowOptions);
|
|
88644
|
+
|
|
88645
|
+
_this.setPreset("snow");
|
|
87940
88646
|
|
|
87941
88647
|
_this.setEntitySubtype(ENTITY_TYPES.PARTICLE.SUBTYPES.SNOW);
|
|
87942
88648
|
|
|
88649
|
+
_this.setParticleConfig({
|
|
88650
|
+
texture,
|
|
88651
|
+
size,
|
|
88652
|
+
strength,
|
|
88653
|
+
area,
|
|
88654
|
+
drift,
|
|
88655
|
+
particleCount,
|
|
88656
|
+
colors,
|
|
88657
|
+
autoEmit,
|
|
88658
|
+
emitWhenEditing
|
|
88659
|
+
});
|
|
88660
|
+
|
|
87943
88661
|
return _this;
|
|
87944
88662
|
}
|
|
87945
88663
|
|
|
88664
|
+
_createClass(Snow, [{
|
|
88665
|
+
key: "rebuild",
|
|
88666
|
+
value: function rebuild() {
|
|
88667
|
+
const config = this.getParticleConfig();
|
|
88668
|
+
const {
|
|
88669
|
+
texture,
|
|
88670
|
+
size = 2,
|
|
88671
|
+
strength = 30,
|
|
88672
|
+
area = 200,
|
|
88673
|
+
drift = 3,
|
|
88674
|
+
particleCount = 400,
|
|
88675
|
+
colors = [PALETTES.BASE.WHITE, PALETTES.BASE.WHITE]
|
|
88676
|
+
} = config;
|
|
88677
|
+
this.rebuildSystem({
|
|
88678
|
+
rate: getSnowRate(particleCount),
|
|
88679
|
+
initializers: getSnowInitializers(size, strength, area),
|
|
88680
|
+
behaviours: getSnowBehaviours(drift, colors),
|
|
88681
|
+
texture
|
|
88682
|
+
});
|
|
88683
|
+
}
|
|
88684
|
+
}, {
|
|
88685
|
+
key: "setSize",
|
|
88686
|
+
value: function setSize(size) {
|
|
88687
|
+
this.particleConfig.size = size;
|
|
88688
|
+
this.rebuild();
|
|
88689
|
+
}
|
|
88690
|
+
}, {
|
|
88691
|
+
key: "getSize",
|
|
88692
|
+
value: function getSize() {
|
|
88693
|
+
return this.particleConfig.size;
|
|
88694
|
+
}
|
|
88695
|
+
}, {
|
|
88696
|
+
key: "setStrength",
|
|
88697
|
+
value: function setStrength(strength) {
|
|
88698
|
+
this.particleConfig.strength = strength;
|
|
88699
|
+
this.rebuild();
|
|
88700
|
+
}
|
|
88701
|
+
}, {
|
|
88702
|
+
key: "getStrength",
|
|
88703
|
+
value: function getStrength() {
|
|
88704
|
+
return this.particleConfig.strength;
|
|
88705
|
+
}
|
|
88706
|
+
}, {
|
|
88707
|
+
key: "setArea",
|
|
88708
|
+
value: function setArea(area) {
|
|
88709
|
+
this.particleConfig.area = area;
|
|
88710
|
+
this.rebuild();
|
|
88711
|
+
}
|
|
88712
|
+
}, {
|
|
88713
|
+
key: "getArea",
|
|
88714
|
+
value: function getArea() {
|
|
88715
|
+
return this.particleConfig.area;
|
|
88716
|
+
}
|
|
88717
|
+
}, {
|
|
88718
|
+
key: "setDrift",
|
|
88719
|
+
value: function setDrift(drift) {
|
|
88720
|
+
this.particleConfig.drift = drift;
|
|
88721
|
+
this.rebuild();
|
|
88722
|
+
}
|
|
88723
|
+
}, {
|
|
88724
|
+
key: "getDrift",
|
|
88725
|
+
value: function getDrift() {
|
|
88726
|
+
return this.particleConfig.drift;
|
|
88727
|
+
}
|
|
88728
|
+
}, {
|
|
88729
|
+
key: "setParticleCount",
|
|
88730
|
+
value: function setParticleCount(particleCount) {
|
|
88731
|
+
this.particleConfig.particleCount = particleCount;
|
|
88732
|
+
this.rebuild();
|
|
88733
|
+
}
|
|
88734
|
+
}, {
|
|
88735
|
+
key: "getParticleCount",
|
|
88736
|
+
value: function getParticleCount() {
|
|
88737
|
+
return this.particleConfig.particleCount;
|
|
88738
|
+
}
|
|
88739
|
+
}, {
|
|
88740
|
+
key: "setColors",
|
|
88741
|
+
value: function setColors(colors) {
|
|
88742
|
+
this.particleConfig.colors = colors;
|
|
88743
|
+
this.rebuild();
|
|
88744
|
+
}
|
|
88745
|
+
}, {
|
|
88746
|
+
key: "getColors",
|
|
88747
|
+
value: function getColors() {
|
|
88748
|
+
return this.particleConfig.colors;
|
|
88749
|
+
}
|
|
88750
|
+
}]);
|
|
88751
|
+
|
|
87946
88752
|
return Snow;
|
|
87947
|
-
}(
|
|
88753
|
+
}(ProtonParticleEmitter);const DEFAULT_SIZE = 4;
|
|
87948
88754
|
|
|
87949
88755
|
const getTrailRate = () => new Proton.Rate(new Proton.Span(10, 20), new Proton.Span(0.01, 0.015));
|
|
87950
88756
|
|
|
@@ -87966,25 +88772,82 @@ let Trail = /*#__PURE__*/function (_ParticleEmitterGroup) {
|
|
|
87966
88772
|
|
|
87967
88773
|
const {
|
|
87968
88774
|
texture = false,
|
|
87969
|
-
size = DEFAULT_SIZE
|
|
88775
|
+
size = DEFAULT_SIZE,
|
|
88776
|
+
autoEmit = false,
|
|
88777
|
+
emitWhenEditing = false
|
|
87970
88778
|
} = options;
|
|
87971
88779
|
const system = [new ProtonParticleEmitter({
|
|
87972
88780
|
rate: getTrailRate(),
|
|
87973
88781
|
texture,
|
|
87974
88782
|
initializers: getTrailInitialisers(size),
|
|
87975
|
-
behaviours: getTrailBehaviour()
|
|
88783
|
+
behaviours: getTrailBehaviour(),
|
|
88784
|
+
skipSceneAdd: true
|
|
87976
88785
|
})];
|
|
87977
88786
|
const name = "TrailGroup";
|
|
87978
88787
|
_this = _super.call(this, {
|
|
87979
88788
|
system,
|
|
87980
|
-
name
|
|
88789
|
+
name,
|
|
88790
|
+
autoEmit,
|
|
88791
|
+
emitWhenEditing
|
|
87981
88792
|
});
|
|
87982
88793
|
|
|
88794
|
+
_this.setPreset("trail");
|
|
88795
|
+
|
|
87983
88796
|
_this.setEntitySubtype(ENTITY_TYPES.PARTICLE.SUBTYPES.TRAIL);
|
|
87984
88797
|
|
|
88798
|
+
_this.setParticleConfig({
|
|
88799
|
+
texture,
|
|
88800
|
+
size,
|
|
88801
|
+
autoEmit,
|
|
88802
|
+
emitWhenEditing
|
|
88803
|
+
});
|
|
88804
|
+
|
|
87985
88805
|
return _this;
|
|
87986
88806
|
}
|
|
87987
88807
|
|
|
88808
|
+
_createClass(Trail, [{
|
|
88809
|
+
key: "rebuild",
|
|
88810
|
+
value: function rebuild() {
|
|
88811
|
+
const config = this.getParticleConfig();
|
|
88812
|
+
const {
|
|
88813
|
+
texture = false,
|
|
88814
|
+
size = DEFAULT_SIZE
|
|
88815
|
+
} = config;
|
|
88816
|
+
const emitters = Array.from(this.system.values());
|
|
88817
|
+
|
|
88818
|
+
if (emitters[0]) {
|
|
88819
|
+
emitters[0].rebuildSystem({
|
|
88820
|
+
rate: getTrailRate(),
|
|
88821
|
+
initializers: getTrailInitialisers(size),
|
|
88822
|
+
behaviours: getTrailBehaviour(),
|
|
88823
|
+
texture
|
|
88824
|
+
});
|
|
88825
|
+
}
|
|
88826
|
+
}
|
|
88827
|
+
}, {
|
|
88828
|
+
key: "setSize",
|
|
88829
|
+
value: function setSize(size) {
|
|
88830
|
+
this.particleConfig.size = size;
|
|
88831
|
+
this.rebuild();
|
|
88832
|
+
}
|
|
88833
|
+
}, {
|
|
88834
|
+
key: "getSize",
|
|
88835
|
+
value: function getSize() {
|
|
88836
|
+
return this.particleConfig.size;
|
|
88837
|
+
}
|
|
88838
|
+
}, {
|
|
88839
|
+
key: "setTexture",
|
|
88840
|
+
value: function setTexture(texture) {
|
|
88841
|
+
this.particleConfig.texture = texture;
|
|
88842
|
+
this.rebuild();
|
|
88843
|
+
}
|
|
88844
|
+
}, {
|
|
88845
|
+
key: "getTexture",
|
|
88846
|
+
value: function getTexture() {
|
|
88847
|
+
return this.particleConfig.texture;
|
|
88848
|
+
}
|
|
88849
|
+
}]);
|
|
88850
|
+
|
|
87988
88851
|
return Trail;
|
|
87989
88852
|
}(ParticleEmitterGroup);const PARTICLES = {
|
|
87990
88853
|
RAIN: "rain",
|
|
@@ -87994,7 +88857,6 @@ let Trail = /*#__PURE__*/function (_ParticleEmitterGroup) {
|
|
|
87994
88857
|
SNOW: "snow",
|
|
87995
88858
|
TRAIL: "trail"
|
|
87996
88859
|
};
|
|
87997
|
-
const DEPRECATED_PARTICLES = [PARTICLES.RAIN, PARTICLES.FOUNTAIN, PARTICLES.SNOW];
|
|
87998
88860
|
const {
|
|
87999
88861
|
SINGLE,
|
|
88000
88862
|
GROUP
|
|
@@ -88028,6 +88890,7 @@ let Particles = /*#__PURE__*/function () {
|
|
|
88028
88890
|
_createClass(Particles, [{
|
|
88029
88891
|
key: "init",
|
|
88030
88892
|
value: function init() {
|
|
88893
|
+
if (this.isInitialised()) return;
|
|
88031
88894
|
this.proton = new Proton();
|
|
88032
88895
|
this.proton.addRender(new Proton.SpriteRender(Scene$1.getScene()));
|
|
88033
88896
|
}
|
|
@@ -88055,18 +88918,12 @@ let Particles = /*#__PURE__*/function () {
|
|
|
88055
88918
|
key: "addParticleEmitter",
|
|
88056
88919
|
value: function addParticleEmitter(emitter) {
|
|
88057
88920
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
88058
|
-
console.warn(DEPRECATIONS.PARTICLES_ADD_PARTICLE_EMITTER);
|
|
88059
88921
|
return this.add(emitter, options);
|
|
88060
88922
|
}
|
|
88061
88923
|
}, {
|
|
88062
88924
|
key: "add",
|
|
88063
88925
|
value: function add(_emitter) {
|
|
88064
88926
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
88065
|
-
|
|
88066
|
-
if (DEPRECATED_PARTICLES.includes(_emitter)) {
|
|
88067
|
-
console.warn(DEPRECATIONS.PARTICLES_OLD);
|
|
88068
|
-
}
|
|
88069
|
-
|
|
88070
88927
|
let emitter;
|
|
88071
88928
|
|
|
88072
88929
|
if (this.isRegisteredEmitter(_emitter)) {
|
|
@@ -88101,6 +88958,10 @@ let Particles = /*#__PURE__*/function () {
|
|
|
88101
88958
|
}, {
|
|
88102
88959
|
key: "addProtonEmitter",
|
|
88103
88960
|
value: function addProtonEmitter(emitter) {
|
|
88961
|
+
if (!this.isInitialised()) {
|
|
88962
|
+
this.init();
|
|
88963
|
+
}
|
|
88964
|
+
|
|
88104
88965
|
this.proton.addEmitter(emitter.getSystem());
|
|
88105
88966
|
}
|
|
88106
88967
|
}, {
|
|
@@ -88124,6 +88985,7 @@ let Particles = /*#__PURE__*/function () {
|
|
|
88124
88985
|
value: function disposeDeadEmitters() {
|
|
88125
88986
|
this.toDispose.forEach(uuid => {
|
|
88126
88987
|
const emitter = this.emitters.get(uuid);
|
|
88988
|
+
if (!emitter) return;
|
|
88127
88989
|
|
|
88128
88990
|
if (emitter.isProtonEmitter()) {
|
|
88129
88991
|
this.removeProtonEmitter(emitter);
|
|
@@ -88137,6 +88999,7 @@ let Particles = /*#__PURE__*/function () {
|
|
|
88137
88999
|
}, {
|
|
88138
89000
|
key: "update",
|
|
88139
89001
|
value: function update(dt) {
|
|
89002
|
+
if (!this.isInitialised()) return;
|
|
88140
89003
|
this.proton.update(dt);
|
|
88141
89004
|
this.updateEmitters(dt);
|
|
88142
89005
|
this.disposeDeadEmitters();
|
|
@@ -91436,6 +92299,7 @@ let Level = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
91436
92299
|
|
|
91437
92300
|
Physics$1.dispose();
|
|
91438
92301
|
Audio$1.dispose();
|
|
92302
|
+
Lights$1.dispose();
|
|
91439
92303
|
Particles$1.dispose();
|
|
91440
92304
|
PostProcessing$1.dispose();
|
|
91441
92305
|
Universe$1.bigfreeze();
|
|
@@ -91711,7 +92575,11 @@ var storage = new Storage();let Light$1 = /*#__PURE__*/function (_Entity) {
|
|
|
91711
92575
|
key: "addToScene",
|
|
91712
92576
|
value: function addToScene() {
|
|
91713
92577
|
if (this.hasBody()) {
|
|
91714
|
-
Scene$1.add(this.body, this);
|
|
92578
|
+
Scene$1.add(this.body, this); // When a new light is added to the scene, all materials need
|
|
92579
|
+
// their shaders recompiled so THREE.js picks up the updated
|
|
92580
|
+
// shadow-casting light count (NUM_DIR_LIGHT_SHADOWS, etc.).
|
|
92581
|
+
|
|
92582
|
+
Scene$1.updateChildren();
|
|
91715
92583
|
}
|
|
91716
92584
|
}
|
|
91717
92585
|
}, {
|
|
@@ -91808,7 +92676,10 @@ var storage = new Storage();let Light$1 = /*#__PURE__*/function (_Entity) {
|
|
|
91808
92676
|
key: "setCastShadow",
|
|
91809
92677
|
value: function setCastShadow(castShadow) {
|
|
91810
92678
|
this.castShadow = castShadow;
|
|
91811
|
-
this.getBody().castShadow = castShadow;
|
|
92679
|
+
this.getBody().castShadow = castShadow; // Changing shadow-casting state alters the number of active shadow
|
|
92680
|
+
// maps, so every material must recompile its shader.
|
|
92681
|
+
|
|
92682
|
+
Scene$1.updateChildren();
|
|
91812
92683
|
}
|
|
91813
92684
|
}, {
|
|
91814
92685
|
key: "getCastShadow",
|
|
@@ -92666,7 +93537,11 @@ let SpotLight$1 = /*#__PURE__*/function (_Light) {
|
|
|
92666
93537
|
key: "addToScene",
|
|
92667
93538
|
value: function addToScene() {
|
|
92668
93539
|
if (this.hasBody()) {
|
|
92669
|
-
Scene$1.add(this.body, this);
|
|
93540
|
+
Scene$1.add(this.body, this); // When a new light is added to the scene, all materials need
|
|
93541
|
+
// their shaders recompiled so THREE.js picks up the updated
|
|
93542
|
+
// shadow-casting light count (NUM_DIR_LIGHT_SHADOWS, etc.).
|
|
93543
|
+
|
|
93544
|
+
Scene$1.updateChildren();
|
|
92670
93545
|
}
|
|
92671
93546
|
}
|
|
92672
93547
|
}, {
|
|
@@ -92763,7 +93638,10 @@ let SpotLight$1 = /*#__PURE__*/function (_Light) {
|
|
|
92763
93638
|
key: "setCastShadow",
|
|
92764
93639
|
value: function setCastShadow(castShadow) {
|
|
92765
93640
|
this.castShadow = castShadow;
|
|
92766
|
-
this.getBody().castShadow = castShadow;
|
|
93641
|
+
this.getBody().castShadow = castShadow; // Changing shadow-casting state alters the number of active shadow
|
|
93642
|
+
// maps, so every material must recompile its shader.
|
|
93643
|
+
|
|
93644
|
+
Scene$1.updateChildren();
|
|
92767
93645
|
}
|
|
92768
93646
|
}, {
|
|
92769
93647
|
key: "getCastShadow",
|
|
@@ -94398,6 +95276,27 @@ let Sky = /*#__PURE__*/function (_Element) {
|
|
|
94398
95276
|
sound.detune(soundData.detune);
|
|
94399
95277
|
}
|
|
94400
95278
|
}
|
|
95279
|
+
}, {
|
|
95280
|
+
key: "completeParticleCreation",
|
|
95281
|
+
value: async function completeParticleCreation(emitter, particleData, options) {
|
|
95282
|
+
Importer.completeCommonCreationSteps(emitter, particleData, { ...options,
|
|
95283
|
+
skipOpacity: true
|
|
95284
|
+
}); // Load particle texture if one was saved
|
|
95285
|
+
|
|
95286
|
+
const particleOptions = particleData.options || {};
|
|
95287
|
+
|
|
95288
|
+
if (particleOptions.texture && particleOptions.textureAssetPath) {
|
|
95289
|
+
try {
|
|
95290
|
+
await Images$1.loadAssetByPath(particleOptions.textureAssetPath, particleOptions.texture, Images$1.currentLevel); // Rebuild so the texture is applied to the particle system
|
|
95291
|
+
|
|
95292
|
+
if (emitter.rebuild) {
|
|
95293
|
+
emitter.rebuild();
|
|
95294
|
+
}
|
|
95295
|
+
} catch (error) {
|
|
95296
|
+
console.warn("[Mage] Failed to load particle texture:", particleOptions.textureAssetPath, error);
|
|
95297
|
+
}
|
|
95298
|
+
}
|
|
95299
|
+
}
|
|
94401
95300
|
}, {
|
|
94402
95301
|
key: "parseLevelData",
|
|
94403
95302
|
value: async function parseLevelData() {
|
|
@@ -94408,7 +95307,8 @@ let Sky = /*#__PURE__*/function (_Element) {
|
|
|
94408
95307
|
lights = [],
|
|
94409
95308
|
audio = [],
|
|
94410
95309
|
sounds = [],
|
|
94411
|
-
cameras = []
|
|
95310
|
+
cameras = [],
|
|
95311
|
+
particles = []
|
|
94412
95312
|
} = data; // Support both 'audio' and 'sounds' keys for backwards compatibility
|
|
94413
95313
|
|
|
94414
95314
|
const allSounds = [...audio, ...sounds]; // Process cameras - create game camera entity and apply settings to scene camera
|
|
@@ -94607,6 +95507,29 @@ let Sky = /*#__PURE__*/function (_Element) {
|
|
|
94607
95507
|
} catch (error) {
|
|
94608
95508
|
console.error(IMPORTER_ERROR_SOUND_CREATION, data.name, data.entitySubType, error.stack);
|
|
94609
95509
|
}
|
|
95510
|
+
}); // processing particles
|
|
95511
|
+
|
|
95512
|
+
particles.forEach(data => {
|
|
95513
|
+
try {
|
|
95514
|
+
const particleOptions = data.options || {};
|
|
95515
|
+
const {
|
|
95516
|
+
preset
|
|
95517
|
+
} = data;
|
|
95518
|
+
|
|
95519
|
+
if (!preset) {
|
|
95520
|
+
console.warn(IMPORTER_ERROR_UNKNOWN_ELEMENT_SUBTYPE, data.entitySubType);
|
|
95521
|
+
return;
|
|
95522
|
+
}
|
|
95523
|
+
|
|
95524
|
+
const emitter = Particles$1.add(preset, particleOptions);
|
|
95525
|
+
|
|
95526
|
+
if (emitter) {
|
|
95527
|
+
emitter.setSceneEmitter(true);
|
|
95528
|
+
Importer.completeParticleCreation(emitter, data, options);
|
|
95529
|
+
}
|
|
95530
|
+
} catch (error) {
|
|
95531
|
+
console.error(IMPORTER_ERROR_PARTICLE_CREATION, data.name, data.preset, error.stack);
|
|
95532
|
+
}
|
|
94610
95533
|
});
|
|
94611
95534
|
}
|
|
94612
95535
|
}]);
|
|
@@ -98516,4 +99439,4 @@ var Shaders$1 = new Shaders();let Shader = function Shader(name, attributes, uni
|
|
|
98516
99439
|
...light_contants,
|
|
98517
99440
|
...material_constants,
|
|
98518
99441
|
...controls_contants
|
|
98519
|
-
};export{AUDIO_RAMPS,AmbientLight,AmbientSound,Atmosphere,Audio$1 as Audio,Axes,BUILTIN,BaseScript,Box,CONTROL_EVENTS,Camera,Color,Cone,Config$1 as Config,Controls$1 as Controls,Cube,CurveLine,Cylinder,DirectionalSound,ENTITY_EVENTS,ENTITY_TYPES,Element$1 as Element,Entity,EventDispatcher,Exporter,FEATURES,Features$1 as Features,GameRunner$1 as GameRunner,Grid,HelperSprite,HemisphereLight,INPUT_EVENTS,Images$1 as Images,Importer,Input$1 as Input,Label,LabelComponent,Level,Lights$1 as Lights,Line,Mirror,Models$1 as Models,Ocean,PALETTES,PARTICLES,PHYSICS_CONSTANTS,PHYSICS_EVENTS,ParticleEmitter,ParticleEmitterGroup,Particles$1 as Particles,
|
|
99442
|
+
};export{AUDIO_RAMPS,AmbientLight,AmbientSound,Atmosphere,Audio$1 as Audio,Axes,BUILTIN,BaseScript,Box,CONTROL_EVENTS,Camera,Color,Cone,Config$1 as Config,Controls$1 as Controls,Cube,CurveLine,Cylinder,DirectionalSound,ENTITY_EVENTS,ENTITY_TYPES,Element$1 as Element,Entity,EventDispatcher,Explosion,Exporter,FEATURES,Features$1 as Features,Fire,Fountain,GameRunner$1 as GameRunner,Grid,HelperSprite,HemisphereLight,INPUT_EVENTS,Images$1 as Images,Importer,Input$1 as Input,Label,LabelComponent,Level,Lights$1 as Lights,Line,Mirror,Models$1 as Models,Ocean,PALETTES,PARTICLES,PHYSICS_CONSTANTS,PHYSICS_EVENTS,ParticleEmitter,ParticleEmitterGroup,Particles$1 as Particles,Physics$1 as Physics,Plane,PointLight,PostProcessing$1 as PostProcessing,Proton,ProtonParticleEmitter,Provider,Rain,Router$1 as Router,Scene$1 as Scene,Scripts$1 as Scripts,Shader,Sky,Skybox,Snow,Sound,Sphere,SpotLight,Sprite,Stats$1 as Stats,SunLight,three_module as THREE,THREEJS_CONTROL_EVENTS,Trail,Universe$1 as Universe,Vector3$1 as Vector3,Water,author,connect,constants,createElement,easing,functions,hitbox as hitboxUtils,index_esm as inferno,map$1 as map,math,object,physicsUtils,index$1 as rxjs,index as store,strings,uuid$1 as uuid,workers,index$2 as xstate};
|