mage-engine 3.17.3 → 3.17.6

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.
Files changed (2) hide show
  1. package/dist/mage.js +405 -372
  2. package/package.json +1 -1
package/dist/mage.js CHANGED
@@ -53543,9 +53543,11 @@ if ( typeof window !== 'undefined' ) {
53543
53543
  }
53544
53544
 
53545
53545
  }var three_module=/*#__PURE__*/Object.freeze({__proto__:null,ACESFilmicToneMapping:ACESFilmicToneMapping,AddEquation:AddEquation,AddOperation:AddOperation,AdditiveAnimationBlendMode:AdditiveAnimationBlendMode,AdditiveBlending:AdditiveBlending,AlphaFormat:AlphaFormat,AlwaysDepth:AlwaysDepth,AlwaysStencilFunc:AlwaysStencilFunc,AmbientLight:AmbientLight$1,AmbientLightProbe:AmbientLightProbe,AnimationClip:AnimationClip,AnimationLoader:AnimationLoader,AnimationMixer:AnimationMixer,AnimationObjectGroup:AnimationObjectGroup,AnimationUtils:AnimationUtils,ArcCurve:ArcCurve,ArrayCamera:ArrayCamera,ArrowHelper:ArrowHelper,Audio:Audio$2,AudioAnalyser:AudioAnalyser,AudioContext:AudioContext,AudioListener:AudioListener,AudioLoader:AudioLoader,AxesHelper:AxesHelper,AxisHelper:AxisHelper,BackSide:BackSide,BasicDepthPacking:BasicDepthPacking,BasicShadowMap:BasicShadowMap,BinaryTextureLoader:BinaryTextureLoader,Bone:Bone,BooleanKeyframeTrack:BooleanKeyframeTrack,BoundingBoxHelper:BoundingBoxHelper,Box2:Box2,Box3:Box3,Box3Helper:Box3Helper,BoxBufferGeometry:BoxGeometry,BoxGeometry:BoxGeometry,BoxHelper:BoxHelper,BufferAttribute:BufferAttribute,BufferGeometry:BufferGeometry,BufferGeometryLoader:BufferGeometryLoader,ByteType:ByteType,Cache:Cache,Camera:Camera$1,CameraHelper:CameraHelper,CanvasRenderer:CanvasRenderer,CanvasTexture:CanvasTexture,CatmullRomCurve3:CatmullRomCurve3,CineonToneMapping:CineonToneMapping,CircleBufferGeometry:CircleGeometry,CircleGeometry:CircleGeometry,ClampToEdgeWrapping:ClampToEdgeWrapping,Clock:Clock,Color:Color$1,ColorKeyframeTrack:ColorKeyframeTrack,CompressedTexture:CompressedTexture,CompressedTextureLoader:CompressedTextureLoader,ConeBufferGeometry:ConeGeometry,ConeGeometry:ConeGeometry,CubeCamera:CubeCamera,CubeReflectionMapping:CubeReflectionMapping,CubeRefractionMapping:CubeRefractionMapping,CubeTexture:CubeTexture,CubeTextureLoader:CubeTextureLoader,CubeUVReflectionMapping:CubeUVReflectionMapping,CubeUVRefractionMapping:CubeUVRefractionMapping,CubicBezierCurve:CubicBezierCurve,CubicBezierCurve3:CubicBezierCurve3,CubicInterpolant:CubicInterpolant,CullFaceBack:CullFaceBack,CullFaceFront:CullFaceFront,CullFaceFrontBack:CullFaceFrontBack,CullFaceNone:CullFaceNone,Curve:Curve,CurvePath:CurvePath,CustomBlending:CustomBlending,CustomToneMapping:CustomToneMapping,CylinderBufferGeometry:CylinderGeometry,CylinderGeometry:CylinderGeometry,Cylindrical:Cylindrical,DataTexture:DataTexture,DataTexture2DArray:DataTexture2DArray,DataTexture3D:DataTexture3D,DataTextureLoader:DataTextureLoader,DataUtils:DataUtils,DecrementStencilOp:DecrementStencilOp,DecrementWrapStencilOp:DecrementWrapStencilOp,DefaultLoadingManager:DefaultLoadingManager,DepthFormat:DepthFormat,DepthStencilFormat:DepthStencilFormat,DepthTexture:DepthTexture,DirectionalLight:DirectionalLight,DirectionalLightHelper:DirectionalLightHelper,DiscreteInterpolant:DiscreteInterpolant,DodecahedronBufferGeometry:DodecahedronGeometry,DodecahedronGeometry:DodecahedronGeometry,DoubleSide:DoubleSide,DstAlphaFactor:DstAlphaFactor,DstColorFactor:DstColorFactor,DynamicBufferAttribute:DynamicBufferAttribute,DynamicCopyUsage:DynamicCopyUsage,DynamicDrawUsage:DynamicDrawUsage,DynamicReadUsage:DynamicReadUsage,EdgesGeometry:EdgesGeometry,EdgesHelper:EdgesHelper,EllipseCurve:EllipseCurve,EqualDepth:EqualDepth,EqualStencilFunc:EqualStencilFunc,EquirectangularReflectionMapping:EquirectangularReflectionMapping,EquirectangularRefractionMapping:EquirectangularRefractionMapping,Euler:Euler,EventDispatcher:EventDispatcher,ExtrudeBufferGeometry:ExtrudeGeometry,ExtrudeGeometry:ExtrudeGeometry,FaceColors:FaceColors,FileLoader:FileLoader,FlatShading:FlatShading,Float16BufferAttribute:Float16BufferAttribute,Float32Attribute:Float32Attribute,Float32BufferAttribute:Float32BufferAttribute,Float64Attribute:Float64Attribute,Float64BufferAttribute:Float64BufferAttribute,FloatType:FloatType$1,Fog:Fog,FogExp2:FogExp2,Font:Font,FontLoader:FontLoader,FrontSide:FrontSide,Frustum:Frustum$1,GLBufferAttribute:GLBufferAttribute,GLSL1:GLSL1,GLSL3:GLSL3,GammaEncoding:GammaEncoding,GreaterDepth:GreaterDepth,GreaterEqualDepth:GreaterEqualDepth,GreaterEqualStencilFunc:GreaterEqualStencilFunc,GreaterStencilFunc:GreaterStencilFunc,GridHelper:GridHelper,Group:Group,HalfFloatType:HalfFloatType,HemisphereLight:HemisphereLight$1,HemisphereLightHelper:HemisphereLightHelper,HemisphereLightProbe:HemisphereLightProbe,IcosahedronBufferGeometry:IcosahedronGeometry,IcosahedronGeometry:IcosahedronGeometry,ImageBitmapLoader:ImageBitmapLoader,ImageLoader:ImageLoader,ImageUtils:ImageUtils,ImmediateRenderObject:ImmediateRenderObject,IncrementStencilOp:IncrementStencilOp,IncrementWrapStencilOp:IncrementWrapStencilOp,InstancedBufferAttribute:InstancedBufferAttribute,InstancedBufferGeometry:InstancedBufferGeometry,InstancedInterleavedBuffer:InstancedInterleavedBuffer,InstancedMesh:InstancedMesh,Int16Attribute:Int16Attribute,Int16BufferAttribute:Int16BufferAttribute,Int32Attribute:Int32Attribute,Int32BufferAttribute:Int32BufferAttribute,Int8Attribute:Int8Attribute,Int8BufferAttribute:Int8BufferAttribute,IntType:IntType,InterleavedBuffer:InterleavedBuffer,InterleavedBufferAttribute:InterleavedBufferAttribute,Interpolant:Interpolant,InterpolateDiscrete:InterpolateDiscrete,InterpolateLinear:InterpolateLinear,InterpolateSmooth:InterpolateSmooth,InvertStencilOp:InvertStencilOp,JSONLoader:JSONLoader,KeepStencilOp:KeepStencilOp,KeyframeTrack:KeyframeTrack,LOD:LOD,LatheBufferGeometry:LatheGeometry,LatheGeometry:LatheGeometry,Layers:Layers,LensFlare:LensFlare,LessDepth:LessDepth,LessEqualDepth:LessEqualDepth,LessEqualStencilFunc:LessEqualStencilFunc,LessStencilFunc:LessStencilFunc,Light:Light$1,LightProbe:LightProbe,Line:Line$1,Line3:Line3,LineBasicMaterial:LineBasicMaterial,LineCurve:LineCurve,LineCurve3:LineCurve3,LineDashedMaterial:LineDashedMaterial,LineLoop:LineLoop,LinePieces:LinePieces,LineSegments:LineSegments,LineStrip:LineStrip,LinearEncoding:LinearEncoding,LinearFilter:LinearFilter,LinearInterpolant:LinearInterpolant,LinearMipMapLinearFilter:LinearMipMapLinearFilter,LinearMipMapNearestFilter:LinearMipMapNearestFilter,LinearMipmapLinearFilter:LinearMipmapLinearFilter,LinearMipmapNearestFilter:LinearMipmapNearestFilter,LinearToneMapping:LinearToneMapping,Loader:Loader$1,LoaderUtils:LoaderUtils,LoadingManager:LoadingManager,LogLuvEncoding:LogLuvEncoding,LoopOnce:LoopOnce,LoopPingPong:LoopPingPong,LoopRepeat:LoopRepeat,LuminanceAlphaFormat:LuminanceAlphaFormat,LuminanceFormat:LuminanceFormat,MOUSE:MOUSE,Material:Material,MaterialLoader:MaterialLoader,Math:MathUtils,MathUtils:MathUtils,Matrix3:Matrix3,Matrix4:Matrix4,MaxEquation:MaxEquation,Mesh:Mesh,MeshBasicMaterial:MeshBasicMaterial,MeshDepthMaterial:MeshDepthMaterial,MeshDistanceMaterial:MeshDistanceMaterial,MeshFaceMaterial:MeshFaceMaterial,MeshLambertMaterial:MeshLambertMaterial,MeshMatcapMaterial:MeshMatcapMaterial,MeshNormalMaterial:MeshNormalMaterial,MeshPhongMaterial:MeshPhongMaterial,MeshPhysicalMaterial:MeshPhysicalMaterial,MeshStandardMaterial:MeshStandardMaterial,MeshToonMaterial:MeshToonMaterial,MinEquation:MinEquation,MirroredRepeatWrapping:MirroredRepeatWrapping,MixOperation:MixOperation,MultiMaterial:MultiMaterial,MultiplyBlending:MultiplyBlending,MultiplyOperation:MultiplyOperation,NearestFilter:NearestFilter,NearestMipMapLinearFilter:NearestMipMapLinearFilter,NearestMipMapNearestFilter:NearestMipMapNearestFilter,NearestMipmapLinearFilter:NearestMipmapLinearFilter,NearestMipmapNearestFilter:NearestMipmapNearestFilter,NeverDepth:NeverDepth,NeverStencilFunc:NeverStencilFunc,NoBlending:NoBlending,NoColors:NoColors,NoToneMapping:NoToneMapping,NormalAnimationBlendMode:NormalAnimationBlendMode,NormalBlending:NormalBlending,NotEqualDepth:NotEqualDepth,NotEqualStencilFunc:NotEqualStencilFunc,NumberKeyframeTrack:NumberKeyframeTrack,Object3D:Object3D,ObjectLoader:ObjectLoader,ObjectSpaceNormalMap:ObjectSpaceNormalMap,OctahedronBufferGeometry:OctahedronGeometry,OctahedronGeometry:OctahedronGeometry,OneFactor:OneFactor,OneMinusDstAlphaFactor:OneMinusDstAlphaFactor,OneMinusDstColorFactor:OneMinusDstColorFactor,OneMinusSrcAlphaFactor:OneMinusSrcAlphaFactor,OneMinusSrcColorFactor:OneMinusSrcColorFactor,OrthographicCamera:OrthographicCamera,PCFShadowMap:PCFShadowMap,PCFSoftShadowMap:PCFSoftShadowMap,PMREMGenerator:PMREMGenerator,ParametricBufferGeometry:ParametricGeometry,ParametricGeometry:ParametricGeometry,Particle:Particle,ParticleBasicMaterial:ParticleBasicMaterial,ParticleSystem:ParticleSystem,ParticleSystemMaterial:ParticleSystemMaterial,Path:Path,PerspectiveCamera:PerspectiveCamera,Plane:Plane$1,PlaneBufferGeometry:PlaneGeometry,PlaneGeometry:PlaneGeometry,PlaneHelper:PlaneHelper,PointCloud:PointCloud,PointCloudMaterial:PointCloudMaterial,PointLight:PointLight$1,PointLightHelper:PointLightHelper,Points:Points,PointsMaterial:PointsMaterial,PolarGridHelper:PolarGridHelper,PolyhedronBufferGeometry:PolyhedronGeometry,PolyhedronGeometry:PolyhedronGeometry,PositionalAudio:PositionalAudio,PropertyBinding:PropertyBinding,PropertyMixer:PropertyMixer,QuadraticBezierCurve:QuadraticBezierCurve,QuadraticBezierCurve3:QuadraticBezierCurve3,Quaternion:Quaternion,QuaternionKeyframeTrack:QuaternionKeyframeTrack,QuaternionLinearInterpolant:QuaternionLinearInterpolant,REVISION:REVISION,RGBADepthPacking:RGBADepthPacking,RGBAFormat:RGBAFormat,RGBAIntegerFormat:RGBAIntegerFormat,RGBA_ASTC_10x10_Format:RGBA_ASTC_10x10_Format,RGBA_ASTC_10x5_Format:RGBA_ASTC_10x5_Format,RGBA_ASTC_10x6_Format:RGBA_ASTC_10x6_Format,RGBA_ASTC_10x8_Format:RGBA_ASTC_10x8_Format,RGBA_ASTC_12x10_Format:RGBA_ASTC_12x10_Format,RGBA_ASTC_12x12_Format:RGBA_ASTC_12x12_Format,RGBA_ASTC_4x4_Format:RGBA_ASTC_4x4_Format,RGBA_ASTC_5x4_Format:RGBA_ASTC_5x4_Format,RGBA_ASTC_5x5_Format:RGBA_ASTC_5x5_Format,RGBA_ASTC_6x5_Format:RGBA_ASTC_6x5_Format,RGBA_ASTC_6x6_Format:RGBA_ASTC_6x6_Format,RGBA_ASTC_8x5_Format:RGBA_ASTC_8x5_Format,RGBA_ASTC_8x6_Format:RGBA_ASTC_8x6_Format,RGBA_ASTC_8x8_Format:RGBA_ASTC_8x8_Format,RGBA_BPTC_Format:RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:RGBA_ETC2_EAC_Format,RGBA_PVRTC_2BPPV1_Format:RGBA_PVRTC_2BPPV1_Format,RGBA_PVRTC_4BPPV1_Format:RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:RGBA_S3TC_DXT1_Format,RGBA_S3TC_DXT3_Format:RGBA_S3TC_DXT3_Format,RGBA_S3TC_DXT5_Format:RGBA_S3TC_DXT5_Format,RGBDEncoding:RGBDEncoding,RGBEEncoding:RGBEEncoding,RGBEFormat:RGBEFormat,RGBFormat:RGBFormat,RGBIntegerFormat:RGBIntegerFormat,RGBM16Encoding:RGBM16Encoding,RGBM7Encoding:RGBM7Encoding,RGB_ETC1_Format:RGB_ETC1_Format,RGB_ETC2_Format:RGB_ETC2_Format,RGB_PVRTC_2BPPV1_Format:RGB_PVRTC_2BPPV1_Format,RGB_PVRTC_4BPPV1_Format:RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:RGB_S3TC_DXT1_Format,RGFormat:RGFormat,RGIntegerFormat:RGIntegerFormat,RawShaderMaterial:RawShaderMaterial,Ray:Ray,Raycaster:Raycaster,RectAreaLight:RectAreaLight,RedFormat:RedFormat,RedIntegerFormat:RedIntegerFormat,ReinhardToneMapping:ReinhardToneMapping,RepeatWrapping:RepeatWrapping$1,ReplaceStencilOp:ReplaceStencilOp,ReverseSubtractEquation:ReverseSubtractEquation,RingBufferGeometry:RingGeometry,RingGeometry:RingGeometry,SRGB8_ALPHA8_ASTC_10x10_Format:SRGB8_ALPHA8_ASTC_10x10_Format,SRGB8_ALPHA8_ASTC_10x5_Format:SRGB8_ALPHA8_ASTC_10x5_Format,SRGB8_ALPHA8_ASTC_10x6_Format:SRGB8_ALPHA8_ASTC_10x6_Format,SRGB8_ALPHA8_ASTC_10x8_Format:SRGB8_ALPHA8_ASTC_10x8_Format,SRGB8_ALPHA8_ASTC_12x10_Format:SRGB8_ALPHA8_ASTC_12x10_Format,SRGB8_ALPHA8_ASTC_12x12_Format:SRGB8_ALPHA8_ASTC_12x12_Format,SRGB8_ALPHA8_ASTC_4x4_Format:SRGB8_ALPHA8_ASTC_4x4_Format,SRGB8_ALPHA8_ASTC_5x4_Format:SRGB8_ALPHA8_ASTC_5x4_Format,SRGB8_ALPHA8_ASTC_5x5_Format:SRGB8_ALPHA8_ASTC_5x5_Format,SRGB8_ALPHA8_ASTC_6x5_Format:SRGB8_ALPHA8_ASTC_6x5_Format,SRGB8_ALPHA8_ASTC_6x6_Format:SRGB8_ALPHA8_ASTC_6x6_Format,SRGB8_ALPHA8_ASTC_8x5_Format:SRGB8_ALPHA8_ASTC_8x5_Format,SRGB8_ALPHA8_ASTC_8x6_Format:SRGB8_ALPHA8_ASTC_8x6_Format,SRGB8_ALPHA8_ASTC_8x8_Format:SRGB8_ALPHA8_ASTC_8x8_Format,Scene:Scene$2,SceneUtils:SceneUtils,ShaderChunk:ShaderChunk,ShaderLib:ShaderLib,ShaderMaterial:ShaderMaterial,ShadowMaterial:ShadowMaterial,Shape:Shape,ShapeBufferGeometry:ShapeGeometry,ShapeGeometry:ShapeGeometry,ShapePath:ShapePath,ShapeUtils:ShapeUtils,ShortType:ShortType,Skeleton:Skeleton,SkeletonHelper:SkeletonHelper,SkinnedMesh:SkinnedMesh,SmoothShading:SmoothShading,Sphere:Sphere$1,SphereBufferGeometry:SphereGeometry,SphereGeometry:SphereGeometry,Spherical:Spherical,SphericalHarmonics3:SphericalHarmonics3,SplineCurve:SplineCurve,SpotLight:SpotLight$1,SpotLightHelper:SpotLightHelper,Sprite:Sprite$1,SpriteMaterial:SpriteMaterial,SrcAlphaFactor:SrcAlphaFactor,SrcAlphaSaturateFactor:SrcAlphaSaturateFactor,SrcColorFactor:SrcColorFactor,StaticCopyUsage:StaticCopyUsage,StaticDrawUsage:StaticDrawUsage,StaticReadUsage:StaticReadUsage,StereoCamera:StereoCamera,StreamCopyUsage:StreamCopyUsage,StreamDrawUsage:StreamDrawUsage,StreamReadUsage:StreamReadUsage,StringKeyframeTrack:StringKeyframeTrack,SubtractEquation:SubtractEquation,SubtractiveBlending:SubtractiveBlending,TOUCH:TOUCH,TangentSpaceNormalMap:TangentSpaceNormalMap,TetrahedronBufferGeometry:TetrahedronGeometry,TetrahedronGeometry:TetrahedronGeometry,TextBufferGeometry:TextGeometry,TextGeometry:TextGeometry,Texture:Texture,TextureLoader:TextureLoader,TorusBufferGeometry:TorusGeometry,TorusGeometry:TorusGeometry,TorusKnotBufferGeometry:TorusKnotGeometry,TorusKnotGeometry:TorusKnotGeometry,Triangle:Triangle,TriangleFanDrawMode:TriangleFanDrawMode,TriangleStripDrawMode:TriangleStripDrawMode,TrianglesDrawMode:TrianglesDrawMode,TubeBufferGeometry:TubeGeometry,TubeGeometry:TubeGeometry,UVMapping:UVMapping,Uint16Attribute:Uint16Attribute,Uint16BufferAttribute:Uint16BufferAttribute,Uint32Attribute:Uint32Attribute,Uint32BufferAttribute:Uint32BufferAttribute,Uint8Attribute:Uint8Attribute,Uint8BufferAttribute:Uint8BufferAttribute,Uint8ClampedAttribute:Uint8ClampedAttribute,Uint8ClampedBufferAttribute:Uint8ClampedBufferAttribute,Uniform:Uniform,UniformsLib:UniformsLib,UniformsUtils:UniformsUtils,UnsignedByteType:UnsignedByteType,UnsignedInt248Type:UnsignedInt248Type,UnsignedIntType:UnsignedIntType,UnsignedShort4444Type:UnsignedShort4444Type,UnsignedShort5551Type:UnsignedShort5551Type,UnsignedShort565Type:UnsignedShort565Type,UnsignedShortType:UnsignedShortType,VSMShadowMap:VSMShadowMap,Vector2:Vector2,Vector3:Vector3$1,Vector4:Vector4,VectorKeyframeTrack:VectorKeyframeTrack,Vertex:Vertex,VertexColors:VertexColors,VideoTexture:VideoTexture,WebGL1Renderer:WebGL1Renderer,WebGLCubeRenderTarget:WebGLCubeRenderTarget,WebGLMultisampleRenderTarget:WebGLMultisampleRenderTarget,WebGLRenderTarget:WebGLRenderTarget,WebGLRenderTargetCube:WebGLRenderTargetCube,WebGLRenderer:WebGLRenderer,WebGLUtils:WebGLUtils,WireframeGeometry:WireframeGeometry,WireframeHelper:WireframeHelper,WrapAroundEnding:WrapAroundEnding,XHRLoader:XHRLoader,ZeroCurvatureEnding:ZeroCurvatureEnding,ZeroFactor:ZeroFactor,ZeroSlopeEnding:ZeroSlopeEnding,ZeroStencilOp:ZeroStencilOp,sRGBEncoding:sRGBEncoding});var PREFIX = '[Mage]';
53546
+ var DEPRECATED = '[DEPRECATED]';
53546
53547
  var DEPRECATIONS = {
53547
- SCRIPTS_CREATE: "".concat(PREFIX, " [DEPRECATED] Scripts.create is deprecated, use Scripts.register instead. Will be removed in next major release."),
53548
- ELEMENT_SET_TEXTURE_MAP: "".concat(PREFIX, " [DEPRECATED] Element.setTextureMap is deprecated, use Element.setTexture() instead. Will be removed in next major release.")
53548
+ MODELS_GETMODEL: "".concat(PREFIX, " ").concat(DEPRECATED, " Models.getModel is deprecated, use Models.get instead. WIll be removed in next major release"),
53549
+ SCRIPTS_CREATE: "".concat(PREFIX, " ").concat(DEPRECATED, " Scripts.create is deprecated, use Scripts.register instead. Will be removed in next major release."),
53550
+ ELEMENT_SET_TEXTURE_MAP: "".concat(PREFIX, " ").concat(DEPRECATED, " Element.setTextureMap is deprecated, use Element.setTexture() instead. Will be removed in next major release.")
53549
53551
  };
53550
53552
  var ONCREATE_NOT_AVAILABLE = "".concat(PREFIX, " Your scene needs a onCreate method.");
53551
53553
  var PATH_NOT_FOUND = "".concat(PREFIX, " can't find requested path");
@@ -53560,10 +53562,11 @@ var METHOD_NOT_SUPPORTED = "".concat(PREFIX, " This method is not supported.");
53560
53562
  var ANIMATION_NOT_FOUND = "".concat(PREFIX, " Required animation can't be found.");
53561
53563
  var ANIMATION_HANDLER_NOT_FOUND = "".concat(PREFIX, " AnimationHander hasn't been defined yet.");
53562
53564
  var ELEMENT_NOT_SET$1 = "".concat(PREFIX, " Body hasn't been defined yet.");
53563
- var ELEMENT_NAME_NOT_PROVIDED = "".concat(PREFIX, " Desired element name wasn't provided.");
53564
53565
  var ELEMENT_SET_COLOR_MISSING_COLOR = "".concat(PREFIX, " Can't set color for this element, missing color");
53565
53566
  var ELEMENT_MATERIAL_NO_SUPPORT_FOR_TEXTURE = "".concat(PREFIX, " This element's material does not support texture: ");
53567
+ var ENTITY_NOT_SET = "".concat(PREFIX, " This entity does not have a body.");
53566
53568
  var ENTITY_TYPE_NOT_ALLOWED = "".concat(PREFIX, " The desired Entity type is not allowed.");
53569
+ var ENTITY_CANT_ADD_NOT_ENTITY = "".concat(PREFIX, " Entity.add requires an Entity.");
53567
53570
  var ERROR_LOADING_TEXTURE = "".concat(PREFIX, " Error while loading texture:");
53568
53571
  var TAG_CANT_BE_REMOVED = "".concat(PREFIX, " The default tag can't be removed.");
53569
53572
  var TAG_ALREADY_EXISTS = "".concat(PREFIX, " The following tag has already been added: ");
@@ -53576,7 +53579,6 @@ var EFFECT_COULD_NOT_BE_CREATED = "".concat(PREFIX, " Could not create requeste
53576
53579
  var EFFECT_UNAVAILABLE = "".concat(PREFIX, " Requested effect is not available.");
53577
53580
  var SCRIPT_NOT_FOUND = "".concat(PREFIX, " Could not find desired script.");
53578
53581
  var KEYBOARD_COMBO_ALREADY_REGISTERED = "".concat(PREFIX, " Keyboard combo already registered.");
53579
- var KEYBOARD_COMBO_IS_INVALID = "".concat(PREFIX, " Keyboard combo is not valid.");
53580
53582
  var PHYSICS_ELEMENT_CANT_BE_REMOVED = "".concat(PREFIX, " This element can't be removed from physics world.");
53581
53583
  var PHYSICS_ELEMENT_ALREADY_STORED = "".concat(PREFIX, " This element has already been added to the world.");
53582
53584
  var ASSETS_AUDIO_LOAD_FAIL = "".concat(PREFIX, " Could not load audio.");
@@ -54175,30 +54177,46 @@ if (typeof window !== 'undefined') {
54175
54177
  keyup: true,
54176
54178
  keydown: true
54177
54179
  };
54178
- var COMBINATION_DIVIDER = '+';
54180
+ var KEY_PRESS = 'keyPress';
54181
+ var KEY_DOWN = 'keyDown';
54182
+ var KEY_UP = 'keyUp';
54183
+
54184
+ var Keyboard = /*#__PURE__*/function (_EventDispatcher) {
54185
+ _inherits(Keyboard, _EventDispatcher);
54186
+
54187
+ var _super = _createSuper(Keyboard);
54179
54188
 
54180
- var Keyboard = /*#__PURE__*/function () {
54181
54189
  function Keyboard() {
54182
- var _this = this;
54190
+ var _this;
54183
54191
 
54184
54192
  _classCallCheck(this, Keyboard);
54185
54193
 
54186
- _defineProperty$1(this, "handler", function (event, handler) {
54187
- if (!_this.enabled) return;
54194
+ _this = _super.call(this);
54188
54195
 
54189
- _this.listener(event, handler); // this stops propagation and deafult OS handling for events like cmd + s, cmd + r
54196
+ _defineProperty$1(_assertThisInitialized(_this), "handleKeydown", function (event) {
54197
+ _this.dispatchEvent({
54198
+ type: KEY_DOWN,
54199
+ event: event
54200
+ });
54201
+ });
54190
54202
 
54203
+ _defineProperty$1(_assertThisInitialized(_this), "handleKeyup", function (event) {
54204
+ _this.dispatchEvent({
54205
+ type: KEY_UP,
54206
+ event: event
54207
+ });
54208
+ });
54191
54209
 
54192
- return false;
54210
+ _defineProperty$1(_assertThisInitialized(_this), "handleKeypress", function (event) {
54211
+ _this.dispatchEvent({
54212
+ type: KEY_PRESS,
54213
+ event: event
54214
+ });
54193
54215
  });
54194
54216
 
54195
- this.keys = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'l', 'k', 'j', 'h', 'g', 'f', 'd', 's', 'a', 'z', 'x', 'c', 'v', 'b', 'n', 'm'];
54196
- this.specials = ['esc', 'escape', 'enter', 'space'];
54197
- this.symbols = [];
54198
- this.numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];
54199
- this.combos = [].concat(_toConsumableArray(this.keys), _toConsumableArray(this.numbers), _toConsumableArray(this.specials), _toConsumableArray(this.symbols));
54200
- this.enabled = false;
54201
- this.listener = undefined;
54217
+ _this.combos = [];
54218
+ _this.enabled = false;
54219
+ return _this;
54202
54220
  }
54203
54221
 
54204
54222
  _createClass(Keyboard, [{
@@ -54211,63 +54229,34 @@ var Keyboard = /*#__PURE__*/function () {
54211
54229
  }
54212
54230
 
54213
54231
  this.combos.push(combo);
54214
- hotkeys(combo, DEFAULT_OPTIONS, handler || this.handler);
54215
- }
54216
- }
54217
- }, {
54218
- key: "registerCombination",
54219
- value: function registerCombination() {
54220
- var combo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
54221
- var handler = arguments.length > 1 ? arguments[1] : undefined;
54222
-
54223
- if (combo instanceof Array && combo.length > 1) {
54224
- this.register(combo.join(COMBINATION_DIVIDER), handler);
54225
- } else {
54226
- console.warn(KEYBOARD_COMBO_IS_INVALID, combo);
54232
+ hotkeys(combo, DEFAULT_OPTIONS, handler);
54227
54233
  }
54228
54234
  }
54229
54235
  }, {
54230
54236
  key: "enable",
54231
54237
  value: function enable() {
54232
- var _this2 = this;
54233
-
54234
- var cb = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (f) {
54235
- return f;
54236
- };
54237
54238
  this.enabled = true;
54238
- this.listener = cb;
54239
- this.combos.forEach(function (combo) {
54240
- hotkeys(combo, DEFAULT_OPTIONS, _this2.handler);
54241
- });
54239
+ window.addEventListener(KEY_DOWN, this.handleKeydown.bind(this));
54240
+ window.addEventListener(KEY_UP, this.handleKeyup.bind(this));
54241
+ window.addEventListener(KEY_PRESS, this.handleKeypress.bind(this));
54242
54242
  }
54243
54243
  }, {
54244
54244
  key: "disable",
54245
54245
  value: function disable() {
54246
54246
  this.enabled = false;
54247
- this.listener = undefined;
54248
- this.combos.forEach(function (combo) {
54249
- hotkeys.unbind(combo);
54250
- });
54247
+ window.removeEventListener(KEY_DOWN, this.handleKeydown.bind(this));
54248
+ window.removeEventListener(KEY_UP, this.handleKeyup.bind(this));
54249
+ window.removeEventListener(KEY_PRESS, this.handleKeypress.bind(this));
54251
54250
  }
54252
54251
  }, {
54253
54252
  key: "isPressed",
54254
54253
  value: function isPressed(key) {
54255
54254
  return hotkeys.isPressed(key);
54256
54255
  }
54257
- }], [{
54258
- key: "KEYDOWN",
54259
- get: function get() {
54260
- return 'keydown';
54261
- }
54262
- }, {
54263
- key: "KEYUP",
54264
- get: function get() {
54265
- return 'keyup';
54266
- }
54267
54256
  }]);
54268
54257
 
54269
54258
  return Keyboard;
54270
- }();var SHADOW_TYPES = {
54259
+ }(EventDispatcher);var SHADOW_TYPES = {
54271
54260
  BASIC: 'BASIC',
54272
54261
  SOFT: 'SOFT',
54273
54262
  HARD: 'HARD'
@@ -54320,13 +54309,15 @@ var Config = /*#__PURE__*/function () {
54320
54309
  function Config() {
54321
54310
  _classCallCheck(this, Config);
54322
54311
 
54323
- getWindow();
54324
54312
  this.default = {
54325
54313
  tests: [],
54326
54314
  screen: {
54327
54315
  frameRate: 60,
54328
54316
  alpha: true
54329
54317
  },
54318
+ postprocessing: {
54319
+ enabled: false
54320
+ },
54330
54321
  fog: {
54331
54322
  enabled: false,
54332
54323
  density: 0,
@@ -54427,8 +54418,8 @@ var Config = /*#__PURE__*/function () {
54427
54418
  };
54428
54419
  }
54429
54420
  }, {
54430
- key: "getDefaults",
54431
- value: function getDefaults() {
54421
+ key: "getScreenDefaults",
54422
+ value: function getScreenDefaults() {
54432
54423
  return {
54433
54424
  h: DEFAULT_HEIGHT$1,
54434
54425
  w: DEFAULT_WIDTH,
@@ -54438,7 +54429,7 @@ var Config = /*#__PURE__*/function () {
54438
54429
  }, {
54439
54430
  key: "screen",
54440
54431
  value: function screen() {
54441
- var _ref = this.getContainerSize() || this.getWindowSize() || this.getDefaults(),
54432
+ var _ref = this.getContainerSize() || this.getWindowSize() || this.getScreenDefaults(),
54442
54433
  h = _ref.h,
54443
54434
  w = _ref.w,
54444
54435
  ratio = _ref.ratio;
@@ -54451,6 +54442,11 @@ var Config = /*#__PURE__*/function () {
54451
54442
  });
54452
54443
  return this.config.screen;
54453
54444
  }
54445
+ }, {
54446
+ key: "postprocessing",
54447
+ value: function postprocessing() {
54448
+ return this.config.postprocessing;
54449
+ }
54454
54450
  }, {
54455
54451
  key: "ui",
54456
54452
  value: function ui() {
@@ -55310,7 +55306,7 @@ var convertAmmoVector = function convertAmmoVector(_ref2) {
55310
55306
  };
55311
55307
  };var utils=/*#__PURE__*/Object.freeze({__proto__:null,DEFAULT_DESCRIPTION:DEFAULT_DESCRIPTION$1,mapColliderTypeToAddEvent:mapColliderTypeToAddEvent$1,extractBoundingBox:extractBoundingBox,extractBiggestBoundingBox:extractBiggestBoundingBox,extractBoundingSphere:extractBoundingSphere,extractBiggestBoundingSphere:extractBiggestBoundingSphere,parseBoundingBoxSize:parseBoundingBoxSize,extractPositionAndQuaternion:extractPositionAndQuaternion$1,extractBoxDescription:extractBoxDescription,extractSphereDescription:extractSphereDescription,getBoxDescriptionForElement:getBoxDescriptionForElement$1,getSphereDescriptionForElement:getSphereDescriptionForElement,mapColliderTypeToDescription:mapColliderTypeToDescription$1,iterateGeometries:iterateGeometries$1,convertAmmoVector:convertAmmoVector});var getHostURL = function getHostURL() {
55312
55308
  return "".concat(document.location.protocol, "//").concat(document.location.host);
55313
- };var _excluded$5 = ["uuid"];
55309
+ };var _excluded$7 = ["uuid"];
55314
55310
  var COLLIDER_TYPES = COLLIDER_TYPES$1;
55315
55311
  var getBoxDescriptionForElement = getBoxDescriptionForElement$1,
55316
55312
  extractPositionAndQuaternion = extractPositionAndQuaternion$1,
@@ -55376,7 +55372,7 @@ var Physics = /*#__PURE__*/function (_EventDispatcher) {
55376
55372
 
55377
55373
  _defineProperty$1(_assertThisInitialized(_this), "handleBodyUpdate", function (_ref3) {
55378
55374
  var uuid = _ref3.uuid,
55379
- data = _objectWithoutProperties(_ref3, _excluded$5);
55375
+ data = _objectWithoutProperties(_ref3, _excluded$7);
55380
55376
 
55381
55377
  var element = Universe$1.getByUUID(uuid);
55382
55378
 
@@ -55778,16 +55774,6 @@ var DEFAULT_TAG = 'all';var Scene = /*#__PURE__*/function () {
55778
55774
  _this.resize(w, h);
55779
55775
  });
55780
55776
 
55781
- _defineProperty$1(this, "render", function () {
55782
- _this.renderer.setClearColor(_this.clearColor, _this.alpha);
55783
-
55784
- _this.renderer.clear();
55785
-
55786
- _this.renderer.setRenderTarget(null);
55787
-
55788
- _this.renderer.render(_this.scene, _this.camera.getBody());
55789
- });
55790
-
55791
55777
  _defineProperty$1(this, "onPhysicsUpdate", function (_ref) {
55792
55778
  var dt = _ref.dt;
55793
55779
  Universe$1.onPhysicsUpdate(dt);
@@ -56018,7 +56004,8 @@ var DEFAULT_TAG = 'all';var Scene = /*#__PURE__*/function () {
56018
56004
  var container = Config$1.container();
56019
56005
  this.renderer = new WebGLRenderer({
56020
56006
  alpha: alpha,
56021
- antialias: antialias
56007
+ antialias: antialias,
56008
+ powerPreference: 'high-performance'
56022
56009
  });
56023
56010
 
56024
56011
  if (shadows) {
@@ -56054,6 +56041,14 @@ var DEFAULT_TAG = 'all';var Scene = /*#__PURE__*/function () {
56054
56041
  this.camera.getBody().updateProjectionMatrix();
56055
56042
  this.renderer.setSize(width, height);
56056
56043
  }
56044
+ }, {
56045
+ key: "render",
56046
+ value: function render() {
56047
+ this.renderer.setClearColor(this.clearColor, this.alpha);
56048
+ this.renderer.clear();
56049
+ this.renderer.setRenderTarget(null);
56050
+ this.renderer.render(this.scene, this.camera.getBody());
56051
+ }
56057
56052
  }, {
56058
56053
  key: "setFog",
56059
56054
  value: function setFog(color, density) {
@@ -56283,11 +56278,9 @@ var Features = /*#__PURE__*/function () {
56283
56278
  value: function setUpPolyfills() {
56284
56279
  var frameRate = Config$1.screen().frameRate;
56285
56280
 
56286
- window.requestNextFrame = function () {
56287
- return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback, element) {
56288
- window.setTimeout(callback, 1000 / frameRate);
56289
- };
56290
- }();
56281
+ window.requestNextFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback, element) {
56282
+ window.setTimeout(callback, 1000 / frameRate);
56283
+ };
56291
56284
  }
56292
56285
  }, {
56293
56286
  key: "isFeatureSupported",
@@ -57203,7 +57196,7 @@ function applyMiddleware() {
57203
57196
 
57204
57197
  var thunk = createThunkMiddleware();
57205
57198
  thunk.withExtraArgument = createThunkMiddleware;var name = "mage-engine";
57206
- var version = "3.17.3";
57199
+ var version = "3.17.6";
57207
57200
  var description = "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.";
57208
57201
  var main = "dist/mage.js";
57209
57202
  var author$1 = {
@@ -57817,10 +57810,6 @@ var Gamepad = /*#__PURE__*/function (_EventDispatcher) {
57817
57810
 
57818
57811
  return Gamepad;
57819
57812
  }(EventDispatcher);var _INPUT_EVENTS;
57820
- var KEY_PRESS = 'keyPress';
57821
- var KEY_DOWN = 'keyDown';
57822
- var KEY_UP = 'keyUp';
57823
- var INPUT_EVENTS_LIST = [KEY_PRESS, KEY_DOWN, KEY_UP, MOUSE_DOWN, MOUSE_UP, MOUSE_DOWN, ELEMENT_CLICK, ELEMENT_DESELECT, GAMEPAD_CONNECTED_EVENT, GAMEPAD_DISCONNECTED_EVENT, BUTTON_PRESSED_EVENT, BUTTON_RELEASED_EVENT, AXIS_CHANGE_EVENT];
57824
57813
  var INPUT_EVENTS = (_INPUT_EVENTS = {
57825
57814
  KEY_PRESS: KEY_PRESS,
57826
57815
  KEY_DOWN: KEY_DOWN,
@@ -57844,27 +57833,6 @@ var Input = /*#__PURE__*/function (_EventDispatcher) {
57844
57833
  _this.dispatchEvent(event);
57845
57834
  });
57846
57835
 
57847
- _defineProperty$1(_assertThisInitialized(_this), "handleKeyBoardEvent", function (event, handler) {
57848
- if (event.type === Keyboard.KEYDOWN) {
57849
- _this.dispatchEvent({
57850
- type: KEY_DOWN,
57851
- event: _objectSpread2$1(_objectSpread2$1({}, event), handler)
57852
- });
57853
- }
57854
-
57855
- if (event.type === Keyboard.KEYUP) {
57856
- _this.dispatchEvent({
57857
- type: KEY_UP,
57858
- event: _objectSpread2$1(_objectSpread2$1({}, event), handler)
57859
- });
57860
- }
57861
-
57862
- _this.dispatchEvent({
57863
- type: KEY_PRESS,
57864
- event: _objectSpread2$1(_objectSpread2$1({}, event), handler)
57865
- });
57866
- });
57867
-
57868
57836
  _this.enabled = false;
57869
57837
  return _this;
57870
57838
  }
@@ -57915,7 +57883,9 @@ var Input = /*#__PURE__*/function (_EventDispatcher) {
57915
57883
  key: "enableKeyboard",
57916
57884
  value: function enableKeyboard() {
57917
57885
  dispatch(keyboardEnabled());
57918
- this.keyboard.enable(this.handleKeyBoardEvent.bind(this));
57886
+ this.keyboard.enable();
57887
+ this.keyboard.addEventListener(KEY_DOWN, this.propagate.bind(this));
57888
+ this.keyboard.addEventListener(KEY_UP, this.propagate.bind(this));
57919
57889
  }
57920
57890
  }, {
57921
57891
  key: "enableMouse",
@@ -57933,6 +57903,8 @@ var Input = /*#__PURE__*/function (_EventDispatcher) {
57933
57903
  value: function disableKeyboard() {
57934
57904
  dispatch(keyboardDisabled());
57935
57905
  this.keyboard.disable();
57906
+ this.keyboard.removeEventListener(KEY_DOWN, this.propagate.bind(this));
57907
+ this.keyboard.removeEventListener(KEY_UP, this.propagate.bind(this));
57936
57908
  this.keyboard = undefined;
57937
57909
  }
57938
57910
  }, {
@@ -58490,7 +58462,7 @@ if (!self.fetch) {
58490
58462
  self.Headers = Headers;
58491
58463
  self.Request = Request;
58492
58464
  self.Response = Response;
58493
- }var _excluded$4 = ["wheels", "accelerationKey", "brakingKey", "rightKey", "leftKey", "debug"];
58465
+ }var _excluded$6 = ["wheels", "accelerationKey", "brakingKey", "rightKey", "leftKey", "debug"];
58494
58466
 
58495
58467
  var BaseCar = /*#__PURE__*/function (_BaseScript) {
58496
58468
  _inherits(BaseCar, _BaseScript);
@@ -58516,7 +58488,7 @@ var BaseCar = /*#__PURE__*/function (_BaseScript) {
58516
58488
  _options$leftKey = options.leftKey,
58517
58489
  leftKey = _options$leftKey === void 0 ? 'a' : _options$leftKey;
58518
58490
  options.debug;
58519
- var physicsOptions = _objectWithoutProperties(options, _excluded$4);
58491
+ var physicsOptions = _objectWithoutProperties(options, _excluded$6);
58520
58492
 
58521
58493
  this.car = element;
58522
58494
  this.wheels = wheels;
@@ -58745,10 +58717,11 @@ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatch
58745
58717
 
58746
58718
  var _super = _createSuper(Entity);
58747
58719
 
58748
- function Entity(_ref) {
58720
+ function Entity() {
58749
58721
  var _this;
58750
58722
 
58751
- var _ref$serializable = _ref.serializable,
58723
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
58724
+ _ref$serializable = _ref.serializable,
58752
58725
  serializable = _ref$serializable === void 0 ? true : _ref$serializable,
58753
58726
  _ref$tag = _ref.tag,
58754
58727
  tag = _ref$tag === void 0 ? '' : _ref$tag,
@@ -58759,6 +58732,14 @@ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatch
58759
58732
 
58760
58733
  _this = _super.call(this);
58761
58734
 
58735
+ _defineProperty$1(_assertThisInitialized(_this), "getBodyByName", function (name) {
58736
+ if (name && _this.hasBody()) {
58737
+ return _this.getBody().getObjectByName(name);
58738
+ }
58739
+
58740
+ console.warn(ELEMENT_NAME_NOT_PROVIDED);
58741
+ });
58742
+
58762
58743
  _defineProperty$1(_assertThisInitialized(_this), "addTag", function (tagName) {
58763
58744
  if (!tagName) return;
58764
58745
 
@@ -58834,6 +58815,7 @@ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatch
58834
58815
  _this.tags = [];
58835
58816
  _this.children = [];
58836
58817
  _this.isMage = true;
58818
+ _this.parent = false;
58837
58819
 
58838
58820
  _this.addTags([DEFAULT_TAG, tag].concat(_toConsumableArray(tags)));
58839
58821
 
@@ -58842,9 +58824,17 @@ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatch
58842
58824
  }
58843
58825
 
58844
58826
  _createClass(Entity, [{
58827
+ key: "isSerializable",
58828
+ value: function isSerializable() {
58829
+ return !!this.serializable;
58830
+ }
58831
+ }, {
58845
58832
  key: "reset",
58846
58833
  value: function reset() {
58847
58834
  this.scripts = [];
58835
+ this.children = [];
58836
+ this.isMage = true;
58837
+ this.parent = false;
58848
58838
  this.tags = [DEFAULT_TAG];
58849
58839
  }
58850
58840
  }, {
@@ -58879,35 +58869,42 @@ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatch
58879
58869
  }
58880
58870
  }, {
58881
58871
  key: "add",
58882
- value: function add(element) {
58872
+ value: function add(child) {
58883
58873
  var _this2 = this;
58884
58874
 
58875
+ var container = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getBody();
58876
+
58885
58877
  if (this.hasBody()) {
58886
58878
  var _add = function _add(toAdd) {
58887
- _this2.children.push(toAdd);
58888
-
58889
- toAdd.setParent(_this2);
58879
+ if (toAdd instanceof Entity) {
58880
+ _this2.children.push(toAdd);
58890
58881
 
58891
- _this2.getBody().add(toAdd.getBody());
58882
+ toAdd.setParent(_this2);
58883
+ container.add(toAdd.getBody());
58884
+ } else {
58885
+ console.log(ENTITY_CANT_ADD_NOT_ENTITY);
58886
+ }
58892
58887
  };
58893
58888
 
58894
- if (Array.isArray(element)) {
58895
- element.forEach(_add);
58889
+ if (Array.isArray(child)) {
58890
+ child.forEach(_add);
58896
58891
  } else {
58897
- _add(element);
58892
+ _add(child);
58898
58893
  }
58894
+ } else {
58895
+ console.log(ENTITY_NOT_SET);
58899
58896
  }
58900
58897
  }
58901
58898
  }, {
58902
58899
  key: "isParentOf",
58903
- value: function isParentOf(element) {
58900
+ value: function isParentOf(child) {
58904
58901
  var comparator = function comparator(child) {
58905
- return !!child.getBody().getObjectById(element.id);
58902
+ return !!child.getBody().getObjectById(child.id);
58906
58903
  };
58907
58904
 
58908
- if (element.isMage) {
58905
+ if (child.isMage) {
58909
58906
  comparator = function comparator(child) {
58910
- return child.getBody().getObjectById(element.id());
58907
+ return child.getBody().getObjectById(child.id());
58911
58908
  };
58912
58909
  }
58913
58910
 
@@ -58915,22 +58912,37 @@ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatch
58915
58912
  }
58916
58913
  }, {
58917
58914
  key: "has",
58918
- value: function has(element) {
58919
- if (element.isMage) {
58920
- return this.equals(element) || this.isParentOf(element);
58915
+ value: function has(child) {
58916
+ if (child.isMage) {
58917
+ return this.equals(child) || this.isParentOf(child);
58921
58918
  } else {
58922
- return this.getBody().getObjectById(element.id);
58919
+ return !!this.getBody().getObjectById(child.id);
58923
58920
  }
58924
58921
  }
58925
58922
  }, {
58926
58923
  key: "remove",
58927
58924
  value: function remove(element) {
58928
58925
  if (this.hasBody() && this.has(element)) {
58929
- this.body.remove(element.body);
58930
- var index = this.children.findIndex(function (m) {
58931
- return m.equals(element);
58932
- });
58933
- this.children.splice(index, 1);
58926
+ if (element.isMage) {
58927
+ this.body.remove(element.getBody());
58928
+ var index = this.children.findIndex(function (m) {
58929
+ return m.equals(element);
58930
+ });
58931
+ if (index) this.children.splice(index, 1);
58932
+ } else {
58933
+ this.body.remove(element.getBody());
58934
+ }
58935
+ }
58936
+ }
58937
+ }, {
58938
+ key: "addTo",
58939
+ value: function addTo(target, childName) {
58940
+ if (target && target.isMage) {
58941
+ if (childName) {
58942
+ target.add(this, target.getBodyByName(childName));
58943
+ } else {
58944
+ target.add(this);
58945
+ }
58934
58946
  }
58935
58947
  }
58936
58948
  }, {
@@ -59466,13 +59478,21 @@ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatch
59466
59478
  }, {
59467
59479
  key: "toJSON",
59468
59480
  value: function toJSON() {
59469
- return {
59470
- position: this.getPosition(),
59471
- rotation: this.getRotation(),
59472
- scale: this.getScale(),
59473
- entityType: this.getEntityType(),
59474
- tags: this.getTags()
59475
- };
59481
+ if (this.isSerializable()) {
59482
+ return {
59483
+ position: this.getPosition(),
59484
+ rotation: this.getRotation(),
59485
+ scale: this.getScale(),
59486
+ entityType: this.getEntityType(),
59487
+ tags: this.getTags()
59488
+ };
59489
+ }
59490
+ }
59491
+ }], [{
59492
+ key: "create",
59493
+ value: function create() {
59494
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
59495
+ return new this(options);
59476
59496
  }
59477
59497
  }]);
59478
59498
 
@@ -59506,6 +59526,7 @@ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatch
59506
59526
 
59507
59527
  _this.mixer = new AnimationMixer(mesh);
59508
59528
  _this.animations = animations;
59529
+ _this.isPlaying = false;
59509
59530
 
59510
59531
  _this.addEventsListeners();
59511
59532
 
@@ -59543,6 +59564,7 @@ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatch
59543
59564
  key: "stopAll",
59544
59565
  value: function stopAll() {
59545
59566
  this.mixer.stopAllAction();
59567
+ this.isPlaying = false;
59546
59568
  }
59547
59569
  }, {
59548
59570
  key: "stopCurrentAnimation",
@@ -59550,6 +59572,8 @@ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatch
59550
59572
  if (this.currentAction) {
59551
59573
  this.currentAction.stop();
59552
59574
  }
59575
+
59576
+ this.isPlaying = false;
59553
59577
  }
59554
59578
  }, {
59555
59579
  key: "playAnimation",
@@ -59557,6 +59581,7 @@ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatch
59557
59581
  var action = this.getAction(id);
59558
59582
  var _options$loop = options.loop,
59559
59583
  loop = _options$loop === void 0 ? LoopRepeat : _options$loop;
59584
+ this.isPlaying = true;
59560
59585
 
59561
59586
  if (this.currentAction) {
59562
59587
  this.fadeToAnimation(action, options);
@@ -60046,7 +60071,7 @@ var AMBIENTLIGHT = 'ambientlight';
60046
60071
  var SUNLIGHT = 'sunlight';
60047
60072
  var SPOTLIGHT = 'spotlight';
60048
60073
  var HEMISPHERELIGHT = 'hemisphere';
60049
- var TIME_TO_UPDATE = 100;
60074
+ var TIME_TO_UPDATE = 5;
60050
60075
  var Lights = /*#__PURE__*/function () {
60051
60076
  function Lights() {
60052
60077
  _classCallCheck(this, Lights);
@@ -60285,7 +60310,7 @@ var prepareModel = function prepareModel(model) {
60285
60310
  var MATERIAL_TEXTURE_MAP = (_MATERIAL_TEXTURE_MAP = {}, _defineProperty$1(_MATERIAL_TEXTURE_MAP, MATERIALS.BASIC, [TEXTURES.ALPHA, TEXTURES.AO, TEXTURES.ENV, TEXTURES.LIGHT, TEXTURES.MAP, TEXTURES.SPECULAR]), _defineProperty$1(_MATERIAL_TEXTURE_MAP, MATERIALS.LAMBERT, [TEXTURES.ALPHA, TEXTURES.AO, TEXTURES.ENV, TEXTURES.LIGHT, TEXTURES.MAP, TEXTURES.SPECULAR, TEXTURES.EMISSIVE]), _defineProperty$1(_MATERIAL_TEXTURE_MAP, MATERIALS.PHONG, [TEXTURES.ALPHA, TEXTURES.AO, TEXTURES.ENV, TEXTURES.LIGHT, TEXTURES.MAP, TEXTURES.SPECULAR, TEXTURES.EMISSIVE, TEXTURES.BUMP, TEXTURES.DISPLACEMENT, TEXTURES.NORMAL]), _defineProperty$1(_MATERIAL_TEXTURE_MAP, MATERIALS.DEPTH, [TEXTURES.ALPHA, TEXTURES.MAP, TEXTURES.DISPLACEMENT]), _defineProperty$1(_MATERIAL_TEXTURE_MAP, MATERIALS.STANDARD, [TEXTURES.ALPHA, TEXTURES.AO, TEXTURES.ENV, TEXTURES.LIGHT, TEXTURES.MAP, TEXTURES.EMISSIVE, TEXTURES.BUMP, TEXTURES.DISPLACEMENT, TEXTURES.NORMAL, TEXTURES.METALNESS, TEXTURES.ROUGHNESS]), _defineProperty$1(_MATERIAL_TEXTURE_MAP, MATERIALS.THREE_TOON, [TEXTURES.ALPHA, TEXTURES.AO, TEXTURES.BUMP, TEXTURES.DISPLACEMENT, TEXTURES.EMISSIVE, TEXTURES.GRADIENT, TEXTURES.LIGHT, TEXTURES.MAP, TEXTURES.NORMAL]), _MATERIAL_TEXTURE_MAP);
60286
60311
  var isTextureMapAllowedForMaterial = function isTextureMapAllowedForMaterial(materialType, textureType) {
60287
60312
  return MATERIAL_TEXTURE_MAP[materialType] && MATERIAL_TEXTURE_MAP[materialType].includes(textureType);
60288
- };var _excluded$3 = ["position", "quaternion"],
60313
+ };var _excluded$5 = ["position", "quaternion"],
60289
60314
  _excluded2 = ["applyPhysicsUpdate"],
60290
60315
  _excluded3 = ["dt", "event"];
60291
60316
  var COLLIDER_TAG = 'collider';
@@ -60303,39 +60328,15 @@ var Element = /*#__PURE__*/function (_Entity) {
60303
60328
 
60304
60329
  var _super = _createSuper(Element);
60305
60330
 
60306
- function Element(geometry, material) {
60331
+ function Element() {
60307
60332
  var _this;
60308
60333
 
60309
- var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
60334
+ var _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
60310
60335
 
60311
60336
  _classCallCheck(this, Element);
60312
60337
 
60313
60338
  _this = _super.call(this, _options);
60314
60339
 
60315
- _defineProperty$1(_assertThisInitialized(_this), "getBodyByName", function (name) {
60316
- if (name) {
60317
- if (_this.hasBody()) {
60318
- return _this.body.getObjectByName(name);
60319
- } else {
60320
- var body;
60321
-
60322
- _this.body.traverse(function (element) {
60323
- if (element.name === name) {
60324
- body = element;
60325
- }
60326
- });
60327
-
60328
- if (body) {
60329
- return body;
60330
- }
60331
-
60332
- console.warn(ELEMENT_NOT_SET$1);
60333
- }
60334
- } else {
60335
- console.warn(ELEMENT_NAME_NOT_PROVIDED);
60336
- }
60337
- });
60338
-
60339
60340
  _defineProperty$1(_assertThisInitialized(_this), "handleAnimationHandlerEvents", function (e) {
60340
60341
  _this.dispatchEvent(e);
60341
60342
  });
@@ -60499,7 +60500,7 @@ var Element = /*#__PURE__*/function (_Entity) {
60499
60500
  _defineProperty$1(_assertThisInitialized(_this), "handlePhysicsUpdate", function (_ref6) {
60500
60501
  var position = _ref6.position,
60501
60502
  quaternion = _ref6.quaternion,
60502
- data = _objectWithoutProperties(_ref6, _excluded$3);
60503
+ data = _objectWithoutProperties(_ref6, _excluded$5);
60503
60504
 
60504
60505
  _this.setPosition(position);
60505
60506
 
@@ -60517,19 +60518,22 @@ var Element = /*#__PURE__*/function (_Entity) {
60517
60518
  });
60518
60519
 
60519
60520
  var _options$name = _options.name,
60520
- _name = _options$name === void 0 ? "default_".concat(Math.random()) : _options$name;
60521
-
60521
+ name = _options$name === void 0 ? "default_".concat(Math.random()) : _options$name,
60522
+ geometry = _options.geometry,
60523
+ material = _options.material,
60524
+ _body = _options.body;
60522
60525
  _this.textures = {};
60523
60526
  _this.opacity = 1;
60524
60527
  _this.options = _objectSpread2$1(_objectSpread2$1({}, _options), {}, {
60525
- name: _name
60528
+ name: name
60526
60529
  });
60527
60530
  _this.physicsOptions = DEFAULT_PHYSICS_OPTIONS;
60528
60531
  _this.physicsState = {};
60529
60532
 
60530
60533
  _this.setBody({
60531
60534
  geometry: geometry,
60532
- material: material
60535
+ material: material,
60536
+ body: _body
60533
60537
  });
60534
60538
 
60535
60539
  _this.colliders = [];
@@ -61033,7 +61037,7 @@ var Element = /*#__PURE__*/function (_Entity) {
61033
61037
  this.checkCollisions();
61034
61038
  }
61035
61039
 
61036
- if (this.hasAnimationHandler()) {
61040
+ if (this.hasAnimationHandler() && this.animationHandler.isPlaying) {
61037
61041
  this.animationHandler.update(dt);
61038
61042
  }
61039
61043
  }
@@ -61056,7 +61060,7 @@ var Element = /*#__PURE__*/function (_Entity) {
61056
61060
  }, {
61057
61061
  key: "toJSON",
61058
61062
  value: function toJSON() {
61059
- if (this.serializable) {
61063
+ if (this.isSerializable()) {
61060
61064
  return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(Element.prototype), "toJSON", this).call(this)), {}, {
61061
61065
  body: this.body.toJSON(),
61062
61066
  scripts: this.mapScriptsToJSON(),
@@ -61156,7 +61160,7 @@ var Element = /*#__PURE__*/function (_Entity) {
61156
61160
  color2: color2,
61157
61161
  name: "GridHelper_".concat(Math.random())
61158
61162
  };
61159
- _this = _super.call(this, null, null, options);
61163
+ _this = _super.call(this, options);
61160
61164
  var body = new GridHelper(size, division, color1, color2);
61161
61165
 
61162
61166
  _this.setBody({
@@ -61188,7 +61192,7 @@ var Element = /*#__PURE__*/function (_Entity) {
61188
61192
 
61189
61193
  _classCallCheck(this, Cube);
61190
61194
 
61191
- _this = _super.call(this, null, null, options);
61195
+ _this = _super.call(this, options);
61192
61196
  var geometry = new BoxGeometry(side, side, side);
61193
61197
  var material = new MeshBasicMaterial(_objectSpread2$1({
61194
61198
  color: color,
@@ -61220,7 +61224,7 @@ var Element = /*#__PURE__*/function (_Entity) {
61220
61224
 
61221
61225
  _classCallCheck(this, Sphere);
61222
61226
 
61223
- _this = _super.call(this, null, null, options);
61227
+ _this = _super.call(this, options);
61224
61228
  var segments = 32;
61225
61229
  var geometry = new SphereGeometry(radius, segments, segments);
61226
61230
  var material = new MeshBasicMaterial(_objectSpread2$1({
@@ -61255,7 +61259,7 @@ var Element = /*#__PURE__*/function (_Entity) {
61255
61259
 
61256
61260
  _classCallCheck(this, Cylinder);
61257
61261
 
61258
- _this = _super.call(this, null, null, options);
61262
+ _this = _super.call(this, options);
61259
61263
  var segments = 32;
61260
61264
  var geometry = new CylinderGeometry(radiusTop, radiusBottom, height, segments);
61261
61265
  var material = new MeshBasicMaterial(_objectSpread2$1({
@@ -61291,7 +61295,7 @@ var Line = /*#__PURE__*/function (_Element) {
61291
61295
 
61292
61296
  _classCallCheck(this, Line);
61293
61297
 
61294
- _this = _super.call(this, null, null, options);
61298
+ _this = _super.call(this, options);
61295
61299
 
61296
61300
  _defineProperty$1(_assertThisInitialized(_this), "updatePoints", function (points) {
61297
61301
  var vectors = points.map(function (_ref) {
@@ -61425,7 +61429,7 @@ var Plane = /*#__PURE__*/function (_Element) {
61425
61429
 
61426
61430
  _classCallCheck(this, Plane);
61427
61431
 
61428
- _this = _super.call(this, null, null, options);
61432
+ _this = _super.call(this, options);
61429
61433
  var _options$color = options.color,
61430
61434
  color = _options$color === void 0 ? 0xfffffff : _options$color,
61431
61435
  _options$transparent = options.transparent,
@@ -61485,7 +61489,7 @@ var Plane = /*#__PURE__*/function (_Element) {
61485
61489
 
61486
61490
  _classCallCheck(this, Box);
61487
61491
 
61488
- _this = _super.call(this, null, null, options);
61492
+ _this = _super.call(this, options);
61489
61493
  var geometry = new BoxGeometry(width, height, depth);
61490
61494
  var material = new MeshBasicMaterial(_objectSpread2$1({
61491
61495
  color: color,
@@ -61503,7 +61507,7 @@ var Plane = /*#__PURE__*/function (_Element) {
61503
61507
  }
61504
61508
 
61505
61509
  return Box;
61506
- }(Element);var _excluded$2 = ["anisotropy"];
61510
+ }(Element);var _excluded$4 = ["anisotropy"];
61507
61511
 
61508
61512
  var validateAnisotropy = function validateAnisotropy(anisotropy) {
61509
61513
  var max = Scene$1.getRenderer().capabilities.getMaxAnisotropy();
@@ -61525,11 +61529,11 @@ var Sprite = /*#__PURE__*/function (_Element) {
61525
61529
 
61526
61530
  _classCallCheck(this, Sprite);
61527
61531
 
61528
- _this = _super.call(this, null, null, options);
61532
+ _this = _super.call(this, options);
61529
61533
 
61530
61534
  var _options$anisotropy = options.anisotropy,
61531
61535
  anisotropy = _options$anisotropy === void 0 ? 1 : _options$anisotropy,
61532
- rest = _objectWithoutProperties(options, _excluded$2);
61536
+ rest = _objectWithoutProperties(options, _excluded$4);
61533
61537
 
61534
61538
  var texture = Images$1.get(spriteTexture);
61535
61539
  texture.anisotropy = validateAnisotropy(anisotropy);
@@ -61577,7 +61581,7 @@ var Sprite = /*#__PURE__*/function (_Element) {
61577
61581
  (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});
61578
61582
  }(three_proton_min));
61579
61583
 
61580
- var Proton = three_proton_min.exports;var TIME_FOR_UPDATE = 150;
61584
+ var Proton = three_proton_min.exports;var TIME_FOR_UPDATE = 5;
61581
61585
  var VOLUME = 2;
61582
61586
  var AUDIO_EVENTS = {
61583
61587
  ENDED: 'ended'
@@ -72440,14 +72444,23 @@ var EXTENSIONS = {
72440
72444
  OBJ: 'obj'
72441
72445
  };
72442
72446
  var FULL_STOP = '.';
72443
- var loaders = (_loaders = {}, _defineProperty$1(_loaders, EXTENSIONS.JSON, new ObjectLoader()), _defineProperty$1(_loaders, EXTENSIONS.GLB, new GLTFLoader()), _defineProperty$1(_loaders, EXTENSIONS.GLTF, new GLTFLoader()), _defineProperty$1(_loaders, EXTENSIONS.FBX, new FBXLoader()), _defineProperty$1(_loaders, EXTENSIONS.OBJ, new OBJMTLLoader()), _loaders);
72447
+ var loaders = (_loaders = {}, _defineProperty$1(_loaders, EXTENSIONS.JSON, ObjectLoader), _defineProperty$1(_loaders, EXTENSIONS.GLB, GLTFLoader), _defineProperty$1(_loaders, EXTENSIONS.GLTF, GLTFLoader), _defineProperty$1(_loaders, EXTENSIONS.FBX, FBXLoader), _defineProperty$1(_loaders, EXTENSIONS.OBJ, OBJMTLLoader), _loaders);
72448
+ var loaderInstances = {};
72444
72449
 
72445
72450
  var extractExtension = function extractExtension(path) {
72446
72451
  return path.split(FULL_STOP).slice(-1).pop();
72447
72452
  };
72448
72453
 
72449
72454
  var getLoaderFromExtension = function getLoaderFromExtension(extension) {
72450
- return loaders[extension] || new ObjectLoader();
72455
+ var instance = loaderInstances[extension];
72456
+
72457
+ if (!instance) {
72458
+ var LoaderClass = loaders[extension] || ObjectLoader;
72459
+ instance = new LoaderClass();
72460
+ loaderInstances[extension] = instance;
72461
+ }
72462
+
72463
+ return instance;
72451
72464
  };
72452
72465
 
72453
72466
  var glbParser = function glbParser(_ref) {
@@ -72500,7 +72513,9 @@ var colladaParser = function colladaParser(_ref3) {
72500
72513
  var fbxParser = function fbxParser(scene) {
72501
72514
  scene.traverse(function (node) {
72502
72515
  if (node.isSkinnedMesh) {
72503
- node.material.skinning = true;
72516
+ processMaterial(node.material, function (material) {
72517
+ return material.skinning = true;
72518
+ });
72504
72519
  }
72505
72520
  });
72506
72521
  return {
@@ -72531,6 +72546,12 @@ var Models = function Models() {
72531
72546
 
72532
72547
  _defineProperty$1(this, "getModel", function (name) {
72533
72548
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
72549
+ console.warn(DEPRECATIONS.MODELS_GETMODEL);
72550
+ return _this.get(name, options);
72551
+ });
72552
+
72553
+ _defineProperty$1(this, "get", function (name) {
72554
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
72534
72555
 
72535
72556
  var _ref4 = _this.map[name] || _this.map[buildAssetId(name, _this.currentLevel)] || {},
72536
72557
  scene = _ref4.scene,
@@ -72549,10 +72570,9 @@ var Models = function Models() {
72549
72570
  model = SkeletonUtils.clone(scene);
72550
72571
  }
72551
72572
 
72552
- var element = new Element(null, null, elementOptions);
72553
- element.setBody({
72573
+ var element = new Element(_objectSpread2$1({
72554
72574
  body: prepareModel(model)
72555
- });
72575
+ }, elementOptions));
72556
72576
  element.setEntityType(ENTITY_TYPES.MODEL);
72557
72577
 
72558
72578
  if (hasAnimations(animations)) {
@@ -73568,11 +73588,6 @@ var Stats = /*#__PURE__*/function () {
73568
73588
  this._fps = 0;
73569
73589
  this._fpsMax = 100;
73570
73590
  this.fps = new Subject();
73571
- this.hasMemoryUsage = Features$1.isFeatureSupported(FEATURES.MEMORY);
73572
-
73573
- if (this.hasMemoryUsage) {
73574
- this.collectMemoryUsage();
73575
- }
73576
73591
  }
73577
73592
 
73578
73593
  _createClass(Stats, [{
@@ -73597,33 +73612,27 @@ var Stats = /*#__PURE__*/function () {
73597
73612
  return this._fps;
73598
73613
  }
73599
73614
  }, {
73600
- key: "collectMemoryUsage",
73601
- value: function collectMemoryUsage() {
73602
- this.memory = performance.memory.usedJSHeapSize / ONE_MB;
73603
- this.memoryMax = performance.memory.jsHeapSizeLimit / ONE_MB;
73615
+ key: "subscribe",
73616
+ value: function subscribe(handler) {
73617
+ var _this = this;
73618
+
73619
+ this.fps.subscribe(handler);
73620
+ return function () {
73621
+ return _this.fps.unsubscribe(handler);
73622
+ };
73604
73623
  }
73605
73624
  }, {
73606
- key: "getMemory",
73607
- value: function getMemory() {
73608
- this.frames++;
73609
- var time = (performance || Date).now();
73610
-
73611
- if (time >= this.prevTime + 1000) {
73612
- this.prevTime = time;
73613
- this.frames = 0;
73614
- this.collectMemoryUsage();
73625
+ key: "getMemoryUsage",
73626
+ value: function getMemoryUsage() {
73627
+ if (Features$1.isFeatureSupported(FEATURES.MEMORY)) {
73628
+ this.memory = performance.memory.usedJSHeapSize / ONE_MB;
73629
+ this.memoryMax = performance.memory.jsHeapSizeLimit / ONE_MB;
73615
73630
  }
73616
-
73617
- this.beginTime = time;
73618
73631
  }
73619
73632
  }, {
73620
73633
  key: "update",
73621
73634
  value: function update() {
73622
73635
  this.getFPS();
73623
-
73624
- if (this.hasMemoryUsage) {
73625
- this.getMemory();
73626
- }
73627
73636
  }
73628
73637
  }]);
73629
73638
 
@@ -73643,7 +73652,7 @@ var Stats$1 = new Stats();var Loader = /*#__PURE__*/function () {
73643
73652
  }]);
73644
73653
 
73645
73654
  return Loader;
73646
- }();var _excluded$1 = ["mesh", "scripts", "texture"];
73655
+ }();var _excluded$3 = ["mesh", "scripts", "texture"];
73647
73656
  var MeshLoader = /*#__PURE__*/function (_Loader) {
73648
73657
  _inherits(MeshLoader, _Loader);
73649
73658
 
@@ -73669,7 +73678,7 @@ var MeshLoader = /*#__PURE__*/function (_Loader) {
73669
73678
  var mesh = _ref.mesh,
73670
73679
  scripts = _ref.scripts,
73671
73680
  texture = _ref.texture,
73672
- opts = _objectWithoutProperties(_ref, _excluded$1);
73681
+ opts = _objectWithoutProperties(_ref, _excluded$3);
73673
73682
 
73674
73683
  return _this.loadMesh(_this.parseMesh(mesh), scripts, texture, opts);
73675
73684
  });
@@ -73684,13 +73693,21 @@ var MeshLoader = /*#__PURE__*/function (_Loader) {
73684
73693
  }
73685
73694
  }, {
73686
73695
  key: "loadMesh",
73687
- value: function loadMesh(parsedMesh, scripts, texture, elementOptions) {
73696
+ value: function loadMesh(_ref2, scripts, texture, elementOptions) {
73697
+ var geometry = _ref2.geometry,
73698
+ material = _ref2.material,
73699
+ position = _ref2.position,
73700
+ rotation = _ref2.rotation,
73701
+ scale = _ref2.scale;
73688
73702
  var _this$options$scriptE = this.options.scriptEnabled,
73689
73703
  scriptEnabled = _this$options$scriptE === void 0 ? true : _this$options$scriptE;
73690
- var element = new Element(parsedMesh.geometry, parsedMesh.material, elementOptions);
73691
- element.setPosition(_objectSpread2$1({}, parsedMesh.position));
73692
- element.setRotation(_objectSpread2$1({}, parsedMesh.rotation));
73693
- element.setScale(_objectSpread2$1({}, parsedMesh.scale));
73704
+ var element = new Element(_objectSpread2$1({
73705
+ geometry: geometry,
73706
+ material: material
73707
+ }, elementOptions));
73708
+ element.setPosition(_objectSpread2$1({}, position));
73709
+ element.setRotation(_objectSpread2$1({}, rotation));
73710
+ element.setScale(_objectSpread2$1({}, scale));
73694
73711
 
73695
73712
  if (scripts && scripts.length) {
73696
73713
  element.addScripts(scripts.names, scripts.options, scriptEnabled);
@@ -74028,7 +74045,10 @@ var SunLight = /*#__PURE__*/function (_Light) {
74028
74045
  color: 0xeeeeee,
74029
74046
  wireframe: true
74030
74047
  });
74031
- var target = new Element(geometry, material);
74048
+ var target = new Element({
74049
+ geometry: geometry,
74050
+ material: material
74051
+ });
74032
74052
  target.position(initialPosition);
74033
74053
  return target;
74034
74054
  }
@@ -74093,9 +74113,11 @@ var AmbientLight = /*#__PURE__*/function (_Light) {
74093
74113
 
74094
74114
  var _super = _createSuper(AmbientLight);
74095
74115
 
74096
- function AmbientLight(options) {
74116
+ function AmbientLight() {
74097
74117
  var _this;
74098
74118
 
74119
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
74120
+
74099
74121
  _classCallCheck(this, AmbientLight);
74100
74122
 
74101
74123
  var _options$color = options.color,
@@ -74439,11 +74461,11 @@ var LightLoader$1 = new LightLoader();var Pass = /*#__PURE__*/function () {
74439
74461
 
74440
74462
  _createClass(Pass, [{
74441
74463
  key: "setSize",
74442
- value: function setSize(width, height) {}
74464
+ value: function setSize() {}
74443
74465
  }, {
74444
74466
  key: "render",
74445
- value: function render(renderer, writeBuffer, readBuffer, delta, maskActive) {
74446
- console.error('Pass: .render() must be implemented in derived pass.');
74467
+ value: function render() {
74468
+ console.error('THREE.Pass: .render() must be implemented in derived pass.');
74447
74469
  }
74448
74470
  }]);
74449
74471
 
@@ -74498,7 +74520,7 @@ var FullScreenQuad = /*#__PURE__*/function () {
74498
74520
  _classCallCheck(this, ShaderPass);
74499
74521
 
74500
74522
  _this = _super.call(this);
74501
- _this.textureID = textureID !== undefined ? textureID : "tDiffuse";
74523
+ _this.textureID = textureID !== undefined ? textureID : 'tDiffuse';
74502
74524
 
74503
74525
  if (shader instanceof ShaderMaterial) {
74504
74526
  _this.uniforms = shader.uniforms;
@@ -74519,7 +74541,9 @@ var FullScreenQuad = /*#__PURE__*/function () {
74519
74541
 
74520
74542
  _createClass(ShaderPass, [{
74521
74543
  key: "render",
74522
- value: function render(renderer, writeBuffer, readBuffer) {
74544
+ value: function render(renderer, writeBuffer, readBuffer
74545
+ /*, deltaTime, maskActive */
74546
+ ) {
74523
74547
  if (this.uniforms[this.textureID]) {
74524
74548
  this.uniforms[this.textureID].value = readBuffer.texture;
74525
74549
  }
@@ -74540,21 +74564,23 @@ var FullScreenQuad = /*#__PURE__*/function () {
74540
74564
 
74541
74565
  return ShaderPass;
74542
74566
  }(Pass);/**
74543
- * @author alteredq / http://alteredqualia.com/
74544
- *
74545
74567
  * Full-screen textured quad shader
74546
74568
  */
74547
74569
  var CopyShader = {
74548
74570
  uniforms: {
74549
- "tDiffuse": {
74571
+ 'tDiffuse': {
74550
74572
  value: null
74551
74573
  },
74552
- "opacity": {
74574
+ 'opacity': {
74553
74575
  value: 1.0
74554
74576
  }
74555
74577
  },
74556
- vertexShader: ["varying vec2 vUv;", "void main() {", " vUv = uv;", " gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
74557
- fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", " vec4 texel = texture2D( tDiffuse, vUv );", " gl_FragColor = opacity * texel;", "}"].join("\n")
74578
+ vertexShader:
74579
+ /* glsl */
74580
+ "\n\n varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",
74581
+ fragmentShader:
74582
+ /* glsl */
74583
+ "\n\n uniform float opacity;\n\n uniform sampler2D tDiffuse;\n\n varying vec2 vUv;\n\n void main() {\n gl_FragColor = texture2D( tDiffuse, vUv );\n gl_FragColor.a *= opacity;\n }"
74558
74584
  };var MaskPass = /*#__PURE__*/function (_Pass) {
74559
74585
  _inherits(MaskPass, _Pass);
74560
74586
 
@@ -74576,7 +74602,9 @@ var CopyShader = {
74576
74602
 
74577
74603
  _createClass(MaskPass, [{
74578
74604
  key: "render",
74579
- value: function render(renderer, writeBuffer, readBuffer) {
74605
+ value: function render(renderer, writeBuffer, readBuffer
74606
+ /*, deltaTime, maskActive */
74607
+ ) {
74580
74608
  var context = renderer.getContext();
74581
74609
  var state = renderer.state; // don't update color or depth
74582
74610
 
@@ -74638,7 +74666,9 @@ var CopyShader = {
74638
74666
 
74639
74667
  _createClass(ClearMaskPass, [{
74640
74668
  key: "render",
74641
- value: function render(renderer, writeBuffer, readBuffer, delta, maskActive) {
74669
+ value: function render(renderer
74670
+ /*, writeBuffer, readBuffer, deltaTime, maskActive */
74671
+ ) {
74642
74672
  renderer.state.buffers.stencil.setLocked(false);
74643
74673
  renderer.state.buffers.stencil.setTest(false);
74644
74674
  }
@@ -74660,16 +74690,11 @@ var CopyShader = {
74660
74690
  this.renderer = renderer;
74661
74691
 
74662
74692
  if (renderTarget === undefined) {
74663
- var parameters = {
74664
- minFilter: LinearFilter,
74665
- magFilter: LinearFilter,
74666
- format: RGBAFormat
74667
- };
74668
74693
  var size = renderer.getSize(new Vector2());
74669
74694
  this._pixelRatio = renderer.getPixelRatio();
74670
74695
  this._width = size.width;
74671
74696
  this._height = size.height;
74672
- renderTarget = new WebGLRenderTarget(this._width * this._pixelRatio, this._height * this._pixelRatio, parameters);
74697
+ renderTarget = new WebGLRenderTarget(this._width * this._pixelRatio, this._height * this._pixelRatio);
74673
74698
  renderTarget.texture.name = 'EffectComposer.rt1';
74674
74699
  } else {
74675
74700
  this._pixelRatio = 1;
@@ -74686,11 +74711,11 @@ var CopyShader = {
74686
74711
  this.passes = []; // dependencies
74687
74712
 
74688
74713
  if (CopyShader === undefined) {
74689
- console.error('EffectComposer relies on CopyShader');
74714
+ console.error('THREE.EffectComposer relies on CopyShader');
74690
74715
  }
74691
74716
 
74692
74717
  if (ShaderPass === undefined) {
74693
- console.error('EffectComposer relies on ShaderPass');
74718
+ console.error('THREE.EffectComposer relies on ShaderPass');
74694
74719
  }
74695
74720
 
74696
74721
  this.copyPass = new ShaderPass(CopyShader);
@@ -74746,12 +74771,9 @@ var CopyShader = {
74746
74771
 
74747
74772
  var currentRenderTarget = this.renderer.getRenderTarget();
74748
74773
  var maskActive = false;
74749
- var pass,
74750
- i,
74751
- il = this.passes.length;
74752
74774
 
74753
- for (i = 0; i < il; i++) {
74754
- pass = this.passes[i];
74775
+ for (var i = 0, il = this.passes.length; i < il; i++) {
74776
+ var pass = this.passes[i];
74755
74777
  if (pass.enabled === false) continue;
74756
74778
  pass.renderToScreen = this.renderToScreen && this.isLastEnabledPass(i);
74757
74779
  pass.render(this.renderer, this.writeBuffer, this.readBuffer, deltaTime, maskActive);
@@ -74828,13 +74850,9 @@ var CopyShader = {
74828
74850
 
74829
74851
  var _super = _createSuper(RenderPass);
74830
74852
 
74831
- function RenderPass(scene, camera) {
74853
+ function RenderPass(scene, camera, overrideMaterial, clearColor, clearAlpha) {
74832
74854
  var _this;
74833
74855
 
74834
- var overrideMaterial = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
74835
- var clearColor = arguments.length > 3 ? arguments[3] : undefined;
74836
- var clearAlpha = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
74837
-
74838
74856
  _classCallCheck(this, RenderPass);
74839
74857
 
74840
74858
  _this = _super.call(this);
@@ -74842,7 +74860,7 @@ var CopyShader = {
74842
74860
  _this.camera = camera;
74843
74861
  _this.overrideMaterial = overrideMaterial;
74844
74862
  _this.clearColor = clearColor;
74845
- _this.clearAlpha = clearAlpha;
74863
+ _this.clearAlpha = clearAlpha !== undefined ? clearAlpha : 0;
74846
74864
  _this.clear = true;
74847
74865
  _this.clearDepth = false;
74848
74866
  _this.needsSwap = false;
@@ -74852,7 +74870,9 @@ var CopyShader = {
74852
74870
 
74853
74871
  _createClass(RenderPass, [{
74854
74872
  key: "render",
74855
- value: function render(renderer, writeBuffer, readBuffer) {
74873
+ value: function render(renderer, writeBuffer, readBuffer
74874
+ /*, deltaTime, maskActive */
74875
+ ) {
74856
74876
  var oldAutoClear = renderer.autoClear;
74857
74877
  renderer.autoClear = false;
74858
74878
  var oldClearAlpha, oldOverrideMaterial;
@@ -75319,6 +75339,9 @@ var PALETTES = {
75319
75339
  FRENCH: FRENCH_PALETTE
75320
75340
  };var MAX_EDGE_THICKNESS = 4;
75321
75341
  var MAX_EDGE_GLOW = 4;
75342
+ var DEFAULT_EDGE_GLOW = 0.0;
75343
+ var DEFAULT_EDGE_THICKNES = 1.0;
75344
+ var DEFAULT_EDGE_STRENGTH = 10.0;
75322
75345
  var BlurDirectionX = new Vector2(1.0, 0.0);
75323
75346
  var BlurDirectionY = new Vector2(0.0, 1.0);
75324
75347
 
@@ -75337,15 +75360,17 @@ var SelectiveOutline = /*#__PURE__*/function (_Pass) {
75337
75360
 
75338
75361
  var _ref$resolution = _ref.resolution,
75339
75362
  resolution = _ref$resolution === void 0 ? {} : _ref$resolution,
75340
- selectedObjects = _ref.selectedObjects,
75363
+ _ref$selectedObjects = _ref.selectedObjects,
75364
+ selectedObjects = _ref$selectedObjects === void 0 ? [] : _ref$selectedObjects,
75341
75365
  _ref$visibleEdgeColor = _ref.visibleEdgeColor,
75342
75366
  visibleEdgeColor = _ref$visibleEdgeColor === void 0 ? PALETTES.BASE.WHITE : _ref$visibleEdgeColor,
75343
75367
  _ref$hiddenEdgeColor = _ref.hiddenEdgeColor,
75344
- hiddenEdgeColor = _ref$hiddenEdgeColor === void 0 ? PALETTES.BASE.BLACK : _ref$hiddenEdgeColor;
75368
+ hiddenEdgeColor = _ref$hiddenEdgeColor === void 0 ? PALETTES.BASE.WHITE : _ref$hiddenEdgeColor;
75345
75369
 
75346
75370
  _classCallCheck(this, SelectiveOutline);
75347
75371
 
75348
75372
  _this = _super.call(this);
75373
+ _this.isPass = true;
75349
75374
 
75350
75375
  var _config$screen = Config$1.screen(),
75351
75376
  height = _config$screen.h,
@@ -75357,13 +75382,13 @@ var SelectiveOutline = /*#__PURE__*/function (_Pass) {
75357
75382
  resolutionY = _resolution$y === void 0 ? height : _resolution$y;
75358
75383
  _this.renderScene = Scene$1.getScene();
75359
75384
  _this.renderCamera = Scene$1.getCameraBody();
75360
- _this.selectedObjects = selectedObjects !== undefined ? selectedObjects : [];
75361
- _this.visibleEdgeColor = visibleEdgeColor;
75362
- _this.hiddenEdgeColor = hiddenEdgeColor;
75363
- _this.edgeGlow = 0.0;
75385
+ _this.selectedObjects = selectedObjects;
75386
+ _this.visibleEdgeColor = new Color$1(visibleEdgeColor);
75387
+ _this.hiddenEdgeColor = new Color$1(hiddenEdgeColor);
75388
+ _this.edgeGlow = DEFAULT_EDGE_GLOW;
75364
75389
  _this.usePatternTexture = false;
75365
- _this.edgeThickness = 1.0;
75366
- _this.edgeStrength = 3.0;
75390
+ _this.edgeThickness = DEFAULT_EDGE_THICKNES;
75391
+ _this.edgeStrength = DEFAULT_EDGE_STRENGTH;
75367
75392
  _this.downSampleRatio = 2;
75368
75393
  _this.pulsePeriod = 0;
75369
75394
  _this._visibilityCache = new Map();
@@ -75449,6 +75474,36 @@ var SelectiveOutline = /*#__PURE__*/function (_Pass) {
75449
75474
  return o.getBody();
75450
75475
  });
75451
75476
  }
75477
+ }, {
75478
+ key: "setVisibleEdgeColor",
75479
+ value: function setVisibleEdgeColor() {
75480
+ var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PALETTES.BASE.WHITE;
75481
+ this.visibleEdgeColor = new Color$1(color);
75482
+ }
75483
+ }, {
75484
+ key: "setHiddenEdgeColor",
75485
+ value: function setHiddenEdgeColor() {
75486
+ var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PALETTES.BASE.WHITE;
75487
+ this.hiddenEdgeColor = new Color$1(color);
75488
+ }
75489
+ }, {
75490
+ key: "setEdgeGlow",
75491
+ value: function setEdgeGlow() {
75492
+ var glow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_EDGE_GLOW;
75493
+ this.edgeGlow = glow;
75494
+ }
75495
+ }, {
75496
+ key: "setEdgeStrength",
75497
+ value: function setEdgeStrength() {
75498
+ var strength = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_EDGE_STRENGTH;
75499
+ this.edgeStrength = strength;
75500
+ }
75501
+ }, {
75502
+ key: "setEdgeThickness",
75503
+ value: function setEdgeThickness() {
75504
+ var thickness = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_EDGE_THICKNES;
75505
+ this.edgeThickness = thickness;
75506
+ }
75452
75507
  }, {
75453
75508
  key: "dispose",
75454
75509
  value: function dispose() {
@@ -75617,8 +75672,8 @@ var SelectiveOutline = /*#__PURE__*/function (_Pass) {
75617
75672
  this.fsQuad.material = this.edgeDetectionMaterial;
75618
75673
  this.edgeDetectionMaterial.uniforms['maskTexture'].value = this.renderTargetMaskDownSampleBuffer.texture;
75619
75674
  this.edgeDetectionMaterial.uniforms['texSize'].value.set(this.renderTargetMaskDownSampleBuffer.width, this.renderTargetMaskDownSampleBuffer.height);
75620
- this.edgeDetectionMaterial.uniforms['visibleEdgeColor'].value = this.tempPulseColor1;
75621
- this.edgeDetectionMaterial.uniforms['hiddenEdgeColor'].value = this.tempPulseColor2;
75675
+ this.edgeDetectionMaterial.uniforms['visibleEdgeColor'].value.set(this.tempPulseColor1.getHex());
75676
+ this.edgeDetectionMaterial.uniforms['hiddenEdgeColor'].value.set(this.tempPulseColor2.getHex());
75622
75677
  renderer.setRenderTarget(this.renderTargetEdgeBuffer1);
75623
75678
  renderer.clear();
75624
75679
  this.fsQuad.render(renderer); // 4. Apply Blur on Half res
@@ -75701,10 +75756,10 @@ var SelectiveOutline = /*#__PURE__*/function (_Pass) {
75701
75756
  value: new Vector2(0.5, 0.5)
75702
75757
  },
75703
75758
  'visibleEdgeColor': {
75704
- value: new Vector3$1(1.0, 1.0, 1.0)
75759
+ value: new Color$1(1.0, 1.0, 1.0)
75705
75760
  },
75706
75761
  'hiddenEdgeColor': {
75707
- value: new Vector3$1(1.0, 1.0, 1.0)
75762
+ value: new Color$1(1.0, 1.0, 1.0)
75708
75763
  }
75709
75764
  },
75710
75765
  vertexShader: "varying vec2 vUv;\n\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }",
@@ -76406,14 +76461,22 @@ var OutlineEffect = /*#__PURE__*/function () {
76406
76461
  _classCallCheck(this, PostProcessing);
76407
76462
 
76408
76463
  _defineProperty$1(this, "isEnabled", function () {
76409
- return !!_this.effects.length || !!_this.customs.length;
76464
+ return _this.enabled && (!!_this.effects.length || !!_this.customs.length);
76410
76465
  });
76411
76466
 
76412
76467
  _defineProperty$1(this, "init", function () {
76413
- window.addEventListener('resize', _this.onWindowResize, false);
76414
- _this.composer = new EffectComposer(Scene$1.getRenderer());
76468
+ var _Config$postprocessin = Config$1.postprocessing(),
76469
+ _Config$postprocessin2 = _Config$postprocessin.enabled,
76470
+ enabled = _Config$postprocessin2 === void 0 ? false : _Config$postprocessin2;
76471
+
76472
+ _this.enabled = enabled;
76415
76473
 
76416
- _this.composer.addPass(new RenderPass(Scene$1.getScene(), Scene$1.getCameraBody()));
76474
+ if (enabled) {
76475
+ window.addEventListener('resize', _this.onWindowResize, false);
76476
+ _this.composer = new EffectComposer(Scene$1.getRenderer());
76477
+
76478
+ _this.composer.addPass(new RenderPass(Scene$1.getScene(), Scene$1.getCameraBody()));
76479
+ }
76417
76480
  });
76418
76481
 
76419
76482
  _defineProperty$1(this, "dispose", function () {
@@ -76476,14 +76539,6 @@ var OutlineEffect = /*#__PURE__*/function () {
76476
76539
  }
76477
76540
  });
76478
76541
 
76479
- _defineProperty$1(this, "render", function (dt) {
76480
- _this.composer.render(dt);
76481
-
76482
- _this.customs.forEach(function (e) {
76483
- return e.render(Scene$1.getScene(), Scene$1.getCameraBody(), dt);
76484
- });
76485
- });
76486
-
76487
76542
  this.map = (_this$map = {}, _defineProperty$1(_this$map, EFFECTS.SEPIA, {
76488
76543
  effect: SepiaEffect,
76489
76544
  isClass: false
@@ -76511,6 +76566,7 @@ var OutlineEffect = /*#__PURE__*/function () {
76511
76566
  }), _this$map);
76512
76567
  this.effects = [];
76513
76568
  this.customs = [];
76569
+ this.enabled = false;
76514
76570
  }
76515
76571
 
76516
76572
  _createClass(PostProcessing, [{
@@ -76518,6 +76574,16 @@ var OutlineEffect = /*#__PURE__*/function () {
76518
76574
  value: function get(id) {
76519
76575
  return this.map[id] || null;
76520
76576
  }
76577
+ }, {
76578
+ key: "render",
76579
+ value: function render(dt) {
76580
+ var scene = Scene$1.getScene();
76581
+ var camera = Scene$1.getCameraBody();
76582
+ this.composer.render(dt);
76583
+ this.customs.forEach(function (e) {
76584
+ return e.render(scene, camera, dt);
76585
+ });
76586
+ }
76521
76587
  }], [{
76522
76588
  key: "createEffect",
76523
76589
  value: function createEffect(_ref, options) {
@@ -76564,12 +76630,12 @@ var index$1=/*#__PURE__*/Object.freeze({__proto__:null,Emitter:k,Particle:P,Part
76564
76630
 
76565
76631
  _this.setSystem();
76566
76632
 
76633
+ _this.setName(name);
76634
+
76567
76635
  _this.setBody({
76568
76636
  body: new Object3D()
76569
76637
  });
76570
76638
 
76571
- _this.setName(name);
76572
-
76573
76639
  _this.setEntityType(ENTITY_TYPES.EFFECT.PARTICLE);
76574
76640
 
76575
76641
  return _this;
@@ -76917,7 +76983,8 @@ var index$1=/*#__PURE__*/Object.freeze({__proto__:null,Emitter:k,Particle:P,Part
76917
76983
  }]);
76918
76984
 
76919
76985
  return ParticleEmitterGroup;
76920
- }(Entity);var DEFAULT_PARTICLE_COLOR = PALETTES.BASE.BLACK;
76986
+ }(Entity);var _excluded$2 = ["initializers", "behaviours", "texture", "color", "rate"];
76987
+ var DEFAULT_PARTICLE_COLOR = PALETTES.BASE.BLACK;
76921
76988
 
76922
76989
  var ProtonParticleEmitter = /*#__PURE__*/function (_ParticleEmitter) {
76923
76990
  _inherits(ProtonParticleEmitter, _ParticleEmitter);
@@ -76937,14 +77004,17 @@ var ProtonParticleEmitter = /*#__PURE__*/function (_ParticleEmitter) {
76937
77004
  texture = _options$texture === void 0 ? false : _options$texture,
76938
77005
  _options$color = options.color,
76939
77006
  color = _options$color === void 0 ? DEFAULT_PARTICLE_COLOR : _options$color,
76940
- rate = options.rate;
76941
- var parsedOptions = {
77007
+ rate = options.rate,
77008
+ rest = _objectWithoutProperties(options, _excluded$2);
77009
+
77010
+ var parsedOptions = _objectSpread2$1({
76942
77011
  initializers: initializers,
76943
77012
  behaviours: behaviours,
76944
77013
  texture: texture,
76945
77014
  color: color,
76946
77015
  rate: rate
76947
- };
77016
+ }, rest);
77017
+
76948
77018
  return _super.call(this, parsedOptions);
76949
77019
  }
76950
77020
 
@@ -77134,7 +77204,9 @@ var Explosion = /*#__PURE__*/function (_ParticleEmitterGroup) {
77134
77204
  }
77135
77205
 
77136
77206
  return Explosion;
77137
- }(ParticleEmitterGroup);var getFireRate = function getFireRate() {
77207
+ }(ParticleEmitterGroup);var _excluded$1 = ["texture", "direction", "size", "strength", "colors"];
77208
+
77209
+ var getFireRate = function getFireRate() {
77138
77210
  return new Proton.Rate(new Proton.Span(10, 15), new Proton.Span(.05, .1));
77139
77211
  };
77140
77212
 
@@ -77144,7 +77216,8 @@ var getFireInitializers = function getFireInitializers(direction, strength, size
77144
77216
  };
77145
77217
 
77146
77218
  var getFireBehaviours = function getFireBehaviours(direction, strength) {
77147
- return [new Proton.Scale(new Proton.Span(2, 2.5), 0), new Proton.G(strength / 100), new Proton.Color('#FF0026', ['#ffff00', '#ffff11'], Infinity, Proton.easeOutSine), new Proton.RandomDrift(direction.x / 100, direction.y / 100, direction.z / 100, 2.5)];
77219
+ var colors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [PALETTES.FRENCH.MANDARIN_RED, PALETTES.FRENCH.MELON_MELODY];
77220
+ 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)];
77148
77221
  };
77149
77222
 
77150
77223
  var Fire = /*#__PURE__*/function (_ProtonParticleEmitte) {
@@ -77161,13 +77234,17 @@ var Fire = /*#__PURE__*/function (_ProtonParticleEmitte) {
77161
77234
  _options$size = options.size,
77162
77235
  size = _options$size === void 0 ? 20 : _options$size,
77163
77236
  _options$strength = options.strength,
77164
- strength = _options$strength === void 0 ? 100 : _options$strength;
77165
- var fireOptions = {
77237
+ strength = _options$strength === void 0 ? 100 : _options$strength,
77238
+ colors = options.colors,
77239
+ rest = _objectWithoutProperties(options, _excluded$1);
77240
+
77241
+ var fireOptions = _objectSpread2$1({
77166
77242
  rate: getFireRate(),
77167
77243
  texture: texture,
77168
77244
  initializers: getFireInitializers(direction, strength, size),
77169
- behaviours: getFireBehaviours(direction, strength)
77170
- };
77245
+ behaviours: getFireBehaviours(direction, strength, colors)
77246
+ }, rest);
77247
+
77171
77248
  return _super.call(this, fireOptions);
77172
77249
  }
77173
77250
 
@@ -77333,11 +77410,7 @@ var Particles = /*#__PURE__*/function () {
77333
77410
  _defineProperty$1(this, "updateEmitters", function (dt) {
77334
77411
  _this.toDispose = [];
77335
77412
  Object.keys(_this.emitters).forEach(function (uuid) {
77336
- var emitter = _this.emitters[uuid]; // if (emitter.getType() === GROUP) {
77337
- // emitter.forEach(emitter => this.updateSingleEmitter(emitter, dt));
77338
- // } else {
77339
- // this.updateSingleEmitter(emitter, dt);
77340
- // }
77413
+ var emitter = _this.emitters[uuid];
77341
77414
 
77342
77415
  _this.updateSingleEmitter(emitter, dt);
77343
77416
  });
@@ -80628,7 +80701,6 @@ var Controls = /*#__PURE__*/function () {
80628
80701
  this.controls[CONTROLS.ORBIT] = new Orbit(Scene$1.getCameraBody(), Scene$1.getDOMElement());
80629
80702
  this.controls[CONTROLS.ORBIT].init();
80630
80703
  this.controls[CONTROLS.ORBIT].setTarget(target);
80631
- this.controls[CONTROLS.ORBIT].addEventListener(EVENTS.CHANGE, Scene$1.render);
80632
80704
  return this.controls[CONTROLS.ORBIT];
80633
80705
  }
80634
80706
  }, {
@@ -80683,37 +80755,6 @@ var Level = /*#__PURE__*/function (_EventDispatcher) {
80683
80755
 
80684
80756
  _defineProperty$1(_assertThisInitialized(_this), "onStateChange", function (state) {});
80685
80757
 
80686
- _defineProperty$1(_assertThisInitialized(_this), "enableInput", function () {
80687
- Input$1.enable();
80688
-
80689
- if (!_this.inputListenersAreSet) {
80690
- INPUT_EVENTS_LIST.forEach(function (event) {
80691
- var methodName = "on".concat(upperCaseFirst(event));
80692
-
80693
- if (typeof _this[methodName] === 'function') {
80694
- Input$1.addEventListener(event, _this[methodName].bind(_assertThisInitialized(_this)));
80695
- }
80696
- });
80697
- _this.inputListenersAreSet = true;
80698
-
80699
- _this.onInputEnabled();
80700
- }
80701
- });
80702
-
80703
- _defineProperty$1(_assertThisInitialized(_this), "disableInput", function () {
80704
- Input$1.disable();
80705
- INPUT_EVENTS_LIST.forEach(function (event) {
80706
- var methodName = "on".concat(upperCaseFirst(event));
80707
-
80708
- if (typeof _this[methodName] === 'function') {
80709
- Input$1.removeEventListener(event, _this[methodName]);
80710
- }
80711
- });
80712
- _this.inputListenersAreSet = false;
80713
-
80714
- _this.onInputDisabled();
80715
- });
80716
-
80717
80758
  _defineProperty$1(_assertThisInitialized(_this), "parseScene", function (_ref) {
80718
80759
  var _ref$elements = _ref.elements,
80719
80760
  elements = _ref$elements === void 0 ? [] : _ref$elements,
@@ -80741,13 +80782,13 @@ var Level = /*#__PURE__*/function (_EventDispatcher) {
80741
80782
  });
80742
80783
 
80743
80784
  _defineProperty$1(_assertThisInitialized(_this), "getJSONUrl", function () {
80744
- return "assets/scenes/".concat(_this.name, ".json");
80785
+ return null;
80745
80786
  });
80746
80787
 
80747
80788
  _defineProperty$1(_assertThisInitialized(_this), "loadScene", function () {
80748
80789
  var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.getJSONUrl();
80749
80790
 
80750
- if (getWindow()) {
80791
+ if (getWindow() && url) {
80751
80792
  return fetch$1(url).then(function (res) {
80752
80793
  return res.json();
80753
80794
  }).then(_this.parseScene).catch(function () {
@@ -80763,38 +80804,13 @@ var Level = /*#__PURE__*/function (_EventDispatcher) {
80763
80804
  return _this.loadScene(url);
80764
80805
  });
80765
80806
 
80766
- _defineProperty$1(_assertThisInitialized(_this), "requestNextAnimationFrame", function () {
80767
- _this.requestAnimationFrameId = requestNextFrame(_this.render.bind(_assertThisInitialized(_this)));
80768
- });
80769
-
80770
80807
  _defineProperty$1(_assertThisInitialized(_this), "cancelNextAnimationFrame", function () {
80771
- cancelAnimationFrame(_this.requestAnimationFrameId);
80772
- });
80773
-
80774
- _defineProperty$1(_assertThisInitialized(_this), "render", function () {
80775
- var dt = Scene$1.clock.getDelta();
80776
- Scene$1.render(dt);
80777
- Particles$1.update(dt);
80778
- PostProcessing$1.render(dt);
80779
-
80780
- _this.onUpdate(dt);
80781
-
80782
- Scene$1.update(dt);
80783
- Assets$1.update(dt);
80784
- Stats$1.update(dt);
80785
- Controls$1.update(dt);
80786
- Input$1.update(dt);
80787
-
80788
- _this.requestNextAnimationFrame();
80808
+ return cancelAnimationFrame(_this.requestAnimationFrameId);
80789
80809
  });
80790
80810
 
80791
80811
  _defineProperty$1(_assertThisInitialized(_this), "init", function () {
80792
- _this.options.path;
80793
80812
  Scene$1.create(_this.getName());
80794
80813
  Scene$1.createCamera(new Camera());
80795
-
80796
- _this.enableInput();
80797
-
80798
80814
  Physics$1.init().then(function () {
80799
80815
  Particles$1.init();
80800
80816
  PostProcessing$1.init();
@@ -80813,8 +80829,6 @@ var Level = /*#__PURE__*/function (_EventDispatcher) {
80813
80829
  _defineProperty$1(_assertThisInitialized(_this), "dispose", function () {
80814
80830
  _this.onBeforeDispose();
80815
80831
 
80816
- _this.disableInput();
80817
-
80818
80832
  Physics$1.dispose();
80819
80833
  Audio$1.dispose();
80820
80834
  Particles$1.dispose();
@@ -80832,6 +80846,7 @@ var Level = /*#__PURE__*/function (_EventDispatcher) {
80832
80846
  _this.name = _this.constructor.name;
80833
80847
  _this.debug = true;
80834
80848
  _this.inputListenersAreSet = false;
80849
+ _this.render = _this.render.bind(_assertThisInitialized(_this));
80835
80850
  return _this;
80836
80851
  }
80837
80852
 
@@ -80849,12 +80864,6 @@ var Level = /*#__PURE__*/function (_EventDispatcher) {
80849
80864
  }, {
80850
80865
  key: "onUpdate",
80851
80866
  value: function onUpdate() {}
80852
- }, {
80853
- key: "onFailedTest",
80854
- value: function onFailedTest(message, test) {}
80855
- }, {
80856
- key: "onSuccededTest",
80857
- value: function onSuccededTest(message) {}
80858
80867
  }, {
80859
80868
  key: "onBeforeDispose",
80860
80869
  value: function onBeforeDispose() {}
@@ -80862,11 +80871,30 @@ var Level = /*#__PURE__*/function (_EventDispatcher) {
80862
80871
  key: "onDispose",
80863
80872
  value: function onDispose() {}
80864
80873
  }, {
80865
- key: "onInputEnabled",
80866
- value: function onInputEnabled() {}
80874
+ key: "requestNextAnimationFrame",
80875
+ value: function requestNextAnimationFrame() {
80876
+ this.requestAnimationFrameId = requestNextFrame(this.render);
80877
+ }
80867
80878
  }, {
80868
- key: "onInputDisabled",
80869
- value: function onInputDisabled() {}
80879
+ key: "render",
80880
+ value: function render() {
80881
+ var dt = Scene$1.clock.getDelta();
80882
+
80883
+ if (PostProcessing$1.isEnabled()) {
80884
+ PostProcessing$1.render(dt);
80885
+ } else {
80886
+ Scene$1.render(dt);
80887
+ }
80888
+
80889
+ Particles$1.update(dt);
80890
+ this.onUpdate(dt);
80891
+ Scene$1.update(dt);
80892
+ Assets$1.update(dt);
80893
+ Stats$1.update(dt);
80894
+ Controls$1.update(dt);
80895
+ Input$1.update(dt);
80896
+ this.requestNextAnimationFrame();
80897
+ }
80870
80898
  }, {
80871
80899
  key: "toJSON",
80872
80900
  value: function toJSON() {
@@ -86706,7 +86734,10 @@ var SpotLight = /*#__PURE__*/function (_Light) {
86706
86734
  color: 0xeeeeee,
86707
86735
  wireframe: true
86708
86736
  });
86709
- var target = new Element(geometry, material);
86737
+ var target = new Element({
86738
+ geometry: geometry,
86739
+ material: material
86740
+ });
86710
86741
  target.position(initialPosition);
86711
86742
  return target;
86712
86743
  }
@@ -86838,9 +86869,11 @@ var HemisphereLight = /*#__PURE__*/function (_Light) {
86838
86869
 
86839
86870
  var _super = _createSuper(HemisphereLight);
86840
86871
 
86841
- function HemisphereLight(options) {
86872
+ function HemisphereLight() {
86842
86873
  var _this;
86843
86874
 
86875
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
86876
+
86844
86877
  _classCallCheck(this, HemisphereLight);
86845
86878
 
86846
86879
  var _options$color = options.color,
@@ -88135,7 +88168,7 @@ var Water = /*#__PURE__*/function (_Element) {
88135
88168
 
88136
88169
  _classCallCheck(this, Water);
88137
88170
 
88138
- _this = _super.call(this, null, null, options);
88171
+ _this = _super.call(this, options);
88139
88172
 
88140
88173
  _defineProperty$1(_assertThisInitialized(_this), "update", function (dt) {
88141
88174
  _get((_thisSuper = _assertThisInitialized(_this), _getPrototypeOf(Water.prototype)), "update", _thisSuper).call(_thisSuper, dt);
@@ -88285,7 +88318,7 @@ var Sky = /*#__PURE__*/function (_Element) {
88285
88318
 
88286
88319
  _classCallCheck(this, Sky);
88287
88320
 
88288
- _this = _super.call(this, null, null, options);
88321
+ _this = _super.call(this, options);
88289
88322
  var _options$scale = options.scale,
88290
88323
  scale = _options$scale === void 0 ? DEFAULT_SCALE : _options$scale,
88291
88324
  _options$turbidity = options.turbidity,
@@ -88393,7 +88426,7 @@ var Skybox = /*#__PURE__*/function (_Element) {
88393
88426
  texture = _options$texture === void 0 ? 'skybox' : _options$texture,
88394
88427
  rest = _objectWithoutProperties(options, _excluded);
88395
88428
 
88396
- _this = _super.call(this, null, null, _objectSpread2$1({
88429
+ _this = _super.call(this, _objectSpread2$1({
88397
88430
  name: name,
88398
88431
  texture: texture
88399
88432
  }, rest));