mage-engine 3.17.0 → 3.17.3

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 +269 -89
  2. package/package.json +1 -1
package/dist/mage.js CHANGED
@@ -53544,7 +53544,8 @@ if ( typeof window !== 'undefined' ) {
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
53546
  var DEPRECATIONS = {
53547
- SCRIPTS_CREATE: "".concat(PREFIX, " [DEPRECATED] Scripts.create is deprecated, use Scripts.register instead. Will be removed in next major release.")
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
53549
  };
53549
53550
  var ONCREATE_NOT_AVAILABLE = "".concat(PREFIX, " Your scene needs a onCreate method.");
53550
53551
  var PATH_NOT_FOUND = "".concat(PREFIX, " can't find requested path");
@@ -53561,6 +53562,7 @@ var ANIMATION_HANDLER_NOT_FOUND = "".concat(PREFIX, " AnimationHander hasn't bee
53561
53562
  var ELEMENT_NOT_SET$1 = "".concat(PREFIX, " Body hasn't been defined yet.");
53562
53563
  var ELEMENT_NAME_NOT_PROVIDED = "".concat(PREFIX, " Desired element name wasn't provided.");
53563
53564
  var ELEMENT_SET_COLOR_MISSING_COLOR = "".concat(PREFIX, " Can't set color for this element, missing color");
53565
+ var ELEMENT_MATERIAL_NO_SUPPORT_FOR_TEXTURE = "".concat(PREFIX, " This element's material does not support texture: ");
53564
53566
  var ENTITY_TYPE_NOT_ALLOWED = "".concat(PREFIX, " The desired Entity type is not allowed.");
53565
53567
  var ERROR_LOADING_TEXTURE = "".concat(PREFIX, " Error while loading texture:");
53566
53568
  var TAG_CANT_BE_REMOVED = "".concat(PREFIX, " The default tag can't be removed.");
@@ -54637,13 +54639,28 @@ var VECTOR_BACK = {
54637
54639
  var ORIGIN = new Vector3$1(0, 0, 0);
54638
54640
  var ZERO_QUATERNION = new Quaternion().identity();
54639
54641
  var MATERIALS = {
54640
- LAMBERT: 0,
54641
- PHONG: 1,
54642
- DEPTH: 2,
54643
- STANDARD: 3,
54644
- BASIC: 4,
54645
- TOON: 5,
54646
- THREE_TOON: 6
54642
+ BASIC: 'BASIC',
54643
+ LAMBERT: 'LAMBERT',
54644
+ PHONG: 'PHONG',
54645
+ DEPTH: 'DEPTH',
54646
+ STANDARD: 'STANDARD',
54647
+ TOON: 'TOOM',
54648
+ THREE_TOON: 'THREE_TOON'
54649
+ };
54650
+ var TEXTURES = {
54651
+ ALPHA: 'alphaMap',
54652
+ AO: 'aoMap',
54653
+ ENV: 'envMap',
54654
+ MAP: 'map',
54655
+ LIGHT: 'lightMap',
54656
+ SPECULAR: 'specularMap',
54657
+ EMISSIVE: 'emissiveMap',
54658
+ BUMP: 'bumpMap',
54659
+ DISPLACEMENT: 'displacementMap',
54660
+ NORMAL: 'normalMap',
54661
+ METALNESS: 'metalnessMap',
54662
+ ROUGHNESS: 'roughnessMap',
54663
+ GRADIENT: 'gradientMap'
54647
54664
  };
54648
54665
  var EFFECTS = {
54649
54666
  SEPIA: 'SEPIAEFFECT',
@@ -54689,7 +54706,7 @@ var HASH = '#';
54689
54706
  var EMPTY$1 = '';
54690
54707
  var DEFAULT_SELECTOR = '#gameContainer';
54691
54708
  var BEFORE_UNLOAD = 'beforeunload';
54692
- var HASH_CHANGE = 'hashchange';var lib_constants=/*#__PURE__*/Object.freeze({__proto__:null,UP:UP$1,DOWN:DOWN$1,LEFT:LEFT,RIGHT:RIGHT,FRONT:FRONT,BACK:BACK,VECTOR_UP:VECTOR_UP,VECTOR_DOWN:VECTOR_DOWN,VECTOR_LEFT:VECTOR_LEFT,VECTOR_RIGHT:VECTOR_RIGHT,VECTOR_FRONT:VECTOR_FRONT,VECTOR_BACK:VECTOR_BACK,ORIGIN:ORIGIN,ZERO_QUATERNION:ZERO_QUATERNION,MATERIALS:MATERIALS,EFFECTS:EFFECTS,COLLISION_EVENT:COLLISION_EVENT,COLORS:COLORS,ASSETS_TYPES:ASSETS_TYPES,OUTPUT_ENCODINGS:OUTPUT_ENCODINGS,DEFAULT_OUTPUT_ENCODING:DEFAULT_OUTPUT_ENCODING,ROOT:ROOT,DIVIDER:DIVIDER,HASH:HASH,EMPTY:EMPTY$1,DEFAULT_SELECTOR:DEFAULT_SELECTOR,BEFORE_UNLOAD:BEFORE_UNLOAD,HASH_CHANGE:HASH_CHANGE});var buildAssetId = function buildAssetId(name, level) {
54709
+ var HASH_CHANGE = 'hashchange';var lib_constants=/*#__PURE__*/Object.freeze({__proto__:null,UP:UP$1,DOWN:DOWN$1,LEFT:LEFT,RIGHT:RIGHT,FRONT:FRONT,BACK:BACK,VECTOR_UP:VECTOR_UP,VECTOR_DOWN:VECTOR_DOWN,VECTOR_LEFT:VECTOR_LEFT,VECTOR_RIGHT:VECTOR_RIGHT,VECTOR_FRONT:VECTOR_FRONT,VECTOR_BACK:VECTOR_BACK,ORIGIN:ORIGIN,ZERO_QUATERNION:ZERO_QUATERNION,MATERIALS:MATERIALS,TEXTURES:TEXTURES,EFFECTS:EFFECTS,COLLISION_EVENT:COLLISION_EVENT,COLORS:COLORS,ASSETS_TYPES:ASSETS_TYPES,OUTPUT_ENCODINGS:OUTPUT_ENCODINGS,DEFAULT_OUTPUT_ENCODING:DEFAULT_OUTPUT_ENCODING,ROOT:ROOT,DIVIDER:DIVIDER,HASH:HASH,EMPTY:EMPTY$1,DEFAULT_SELECTOR:DEFAULT_SELECTOR,BEFORE_UNLOAD:BEFORE_UNLOAD,HASH_CHANGE:HASH_CHANGE});var buildAssetId = function buildAssetId(name, level) {
54693
54710
  return level ? "".concat(level, "_").concat(name) : name;
54694
54711
  };
54695
54712
  var isLevelName = function isLevelName(level) {
@@ -55676,7 +55693,48 @@ var Physics = /*#__PURE__*/function (_EventDispatcher) {
55676
55693
 
55677
55694
  return Physics;
55678
55695
  }(EventDispatcher);
55679
- var Physics$1 = new Physics();var Scene = /*#__PURE__*/function () {
55696
+ var Physics$1 = new Physics();var ENTITY_TYPES = {
55697
+ SCENE: 'SCENE',
55698
+ CAMERA: 'CAMERA',
55699
+ MESH: 'MESH',
55700
+ LIGHT: {
55701
+ DEFAULT: 'LIGHT.DEFAULT',
55702
+ AMBIENT: 'LIGHT.AMBIENT',
55703
+ SUN: 'LIGHT.SUN',
55704
+ HEMISPHERE: 'LIGHT.HEMISPHERE',
55705
+ POINT: 'LIGHT.POINT',
55706
+ SPOT: 'LIGHT.SPOT'
55707
+ },
55708
+ AUDIO: {
55709
+ DEFAULT: 'AUDIO.DEFAULT',
55710
+ AMBIENT: 'AUDIO.AMBIENT',
55711
+ DIRECTIONAL: 'AUDIO.DIRECTIONAL',
55712
+ BACKGROUND: 'AUDIO.BACKGROUND'
55713
+ },
55714
+ MODEL: 'MODEL',
55715
+ SPRITE: 'SPRITE',
55716
+ PARTICLE: 'PARTICLE',
55717
+ EFFECT: {
55718
+ PARTICLE: 'EFFECT.PARTICLE',
55719
+ SCENERY: 'EFFECT.SCENERY'
55720
+ },
55721
+ HELPER: {
55722
+ GRID: 'HELPER.GRID'
55723
+ },
55724
+ UNKNOWN: 'UNKNOWN'
55725
+ };
55726
+ var FLAT_ENTITY_TYPES = ['SCENE', 'CAMERA', 'MESH', 'LIGHT.DEFAULT', 'LIGHT.AMBIENT', 'LIGHT.SUN', 'LIGHT.HEMISPHERE', 'LIGHT.POINT', 'LIGHT.SPOT', 'AUDIO.DEFAULT', 'AUDIO.AMBIENT', 'AUDIO.DIRECTIONAL', 'AUDIO.BACKGROUND', 'MODEL', 'SPRITE', 'PARTICLE', 'EFFECT.PARTICLE', 'EFFECT.SCENERY', 'HELPER.GRID', 'UNKNOWN'];
55727
+ var ENTITY_EVENTS = {
55728
+ DISPOSE: 'DISPOSE',
55729
+ STATE_MACHINE: {
55730
+ CHANGE: 'STATE_MACHINE_CHANGE'
55731
+ },
55732
+ ANIMATION: {
55733
+ LOOP: 'LOOP',
55734
+ FINISHED: 'FINISHED'
55735
+ }
55736
+ };
55737
+ var DEFAULT_TAG = 'all';var Scene = /*#__PURE__*/function () {
55680
55738
  function Scene() {
55681
55739
  var _this = this;
55682
55740
 
@@ -55739,14 +55797,21 @@ var Physics$1 = new Physics();var Scene = /*#__PURE__*/function () {
55739
55797
 
55740
55798
  this.clock = new Clock();
55741
55799
  this.rendererElements = {};
55800
+ this.elements = [];
55742
55801
  this.clearColor = 0x000000;
55743
55802
  this.alpha = 1.0;
55744
55803
  this.shadowType = mapShadowTypeToShadowMap(DEFAULT_SHADOWTYPE);
55745
55804
  }
55746
55805
 
55747
55806
  _createClass(Scene, [{
55807
+ key: "getEntityType",
55808
+ value: function getEntityType() {
55809
+ return ENTITY_TYPES.SCENE;
55810
+ }
55811
+ }, {
55748
55812
  key: "createScene",
55749
- value: function createScene(name) {
55813
+ value: function createScene() {
55814
+ var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "LevelScene_".concat(Math.random());
55750
55815
  var fog = Config$1.fog();
55751
55816
  this.scene = new Scene$2();
55752
55817
  this.scene.name = name; // this.scene.overrideMaterial = null; // should be null by default, but it's not.
@@ -55755,6 +55820,16 @@ var Physics$1 = new Physics();var Scene = /*#__PURE__*/function () {
55755
55820
  this.fog(fog.color, fog.density);
55756
55821
  }
55757
55822
  }
55823
+ }, {
55824
+ key: "uuid",
55825
+ value: function uuid() {
55826
+ return this.scene.uuid;
55827
+ }
55828
+ }, {
55829
+ key: "getName",
55830
+ value: function getName() {
55831
+ return this.scene.name;
55832
+ }
55758
55833
  }, {
55759
55834
  key: "getScene",
55760
55835
  value: function getScene() {
@@ -55780,11 +55855,28 @@ var Physics$1 = new Physics();var Scene = /*#__PURE__*/function () {
55780
55855
  var addUniverse = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
55781
55856
  this.scene.add(body);
55782
55857
 
55858
+ if (element) {
55859
+ this.elements.push(element);
55860
+ }
55861
+
55783
55862
  if (addUniverse) {
55784
- Universe$1.set(element.getName(), element);
55785
- Universe$1.storeUUIDToElementNameReference(body.uuid, element.getName());
55863
+ var name = element.getName();
55864
+ Universe$1.set(name, element);
55865
+ Universe$1.storeUUIDToElementNameReference(body.uuid, name);
55786
55866
  }
55787
55867
  }
55868
+ }, {
55869
+ key: "getHierarchy",
55870
+ value: function getHierarchy() {
55871
+ return [{
55872
+ element: this,
55873
+ children: [this.getCamera().getHierarchy()].concat(_toConsumableArray(this.elements.filter(function (e) {
55874
+ return !e.hasParent() && !e.isHelper();
55875
+ }).map(function (e) {
55876
+ return e.getHierarchy();
55877
+ })))
55878
+ }];
55879
+ }
55788
55880
  }, {
55789
55881
  key: "remove",
55790
55882
  value: function remove(body) {
@@ -57111,7 +57203,7 @@ function applyMiddleware() {
57111
57203
 
57112
57204
  var thunk = createThunkMiddleware();
57113
57205
  thunk.withExtraArgument = createThunkMiddleware;var name = "mage-engine";
57114
- var version = "3.17.0";
57206
+ var version = "3.17.3";
57115
57207
  var description = "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.";
57116
57208
  var main = "dist/mage.js";
57117
57209
  var author$1 = {
@@ -58648,25 +58740,7 @@ var Scripts = /*#__PURE__*/function () {
58648
58740
 
58649
58741
  return Scripts;
58650
58742
  }();
58651
- var Scripts$1 = new Scripts();var ENTITY_TYPES = {
58652
- MESH: 'MESH',
58653
- LIGHT: 'LIGHT',
58654
- MODEL: 'MODEL',
58655
- SPRITE: 'SPRITE',
58656
- PARTICLE: 'PARTICLE',
58657
- UNKNOWN: 'UNKNOWN'
58658
- };
58659
- var ENTITY_EVENTS = {
58660
- DISPOSE: 'DISPOSE',
58661
- STATE_MACHINE: {
58662
- CHANGE: 'STATE_MACHINE_CHANGE'
58663
- },
58664
- ANIMATION: {
58665
- LOOP: 'LOOP',
58666
- FINISHED: 'FINISHED'
58667
- }
58668
- };
58669
- var DEFAULT_TAG = 'all';var Entity = /*#__PURE__*/function (_EventDispatcher) {
58743
+ var Scripts$1 = new Scripts();var Entity = /*#__PURE__*/function (_EventDispatcher) {
58670
58744
  _inherits(Entity, _EventDispatcher);
58671
58745
 
58672
58746
  var _super = _createSuper(Entity);
@@ -58721,10 +58795,6 @@ var DEFAULT_TAG = 'all';var Entity = /*#__PURE__*/function (_EventDispatcher) {
58721
58795
  return _this.getEntityType() === ENTITY_TYPES.MESH;
58722
58796
  });
58723
58797
 
58724
- _defineProperty$1(_assertThisInitialized(_this), "isLight", function () {
58725
- return _this.getEntityType() === ENTITY_TYPES.LIGHT;
58726
- });
58727
-
58728
58798
  _defineProperty$1(_assertThisInitialized(_this), "isModel", function () {
58729
58799
  return _this.getEntityType() === ENTITY_TYPES.MODEL;
58730
58800
  });
@@ -58733,6 +58803,18 @@ var DEFAULT_TAG = 'all';var Entity = /*#__PURE__*/function (_EventDispatcher) {
58733
58803
  return _this.getEntityType() === ENTITY_TYPES.SPRITE;
58734
58804
  });
58735
58805
 
58806
+ _defineProperty$1(_assertThisInitialized(_this), "isLight", function () {
58807
+ return Object.values(ENTITY_TYPES.LIGHT).includes(_this.getEntityType());
58808
+ });
58809
+
58810
+ _defineProperty$1(_assertThisInitialized(_this), "isHelper", function () {
58811
+ return Object.values(ENTITY_TYPES.HELPER).includes(_this.getEntityType());
58812
+ });
58813
+
58814
+ _defineProperty$1(_assertThisInitialized(_this), "isEffect", function () {
58815
+ return Object.values(ENTITY_TYPES.EFFECT).includes(_this.getEntityType());
58816
+ });
58817
+
58736
58818
  _defineProperty$1(_assertThisInitialized(_this), "setQuaternion", function (_ref2) {
58737
58819
  var x = _ref2.x,
58738
58820
  y = _ref2.y,
@@ -58780,6 +58862,21 @@ var DEFAULT_TAG = 'all';var Entity = /*#__PURE__*/function (_EventDispatcher) {
58780
58862
  value: function setBody(body) {
58781
58863
  this.body = body;
58782
58864
  }
58865
+ }, {
58866
+ key: "hasParent",
58867
+ value: function hasParent() {
58868
+ return !!this.parent;
58869
+ }
58870
+ }, {
58871
+ key: "getParent",
58872
+ value: function getParent() {
58873
+ return this.parent;
58874
+ }
58875
+ }, {
58876
+ key: "setParent",
58877
+ value: function setParent(parent) {
58878
+ this.parent = parent;
58879
+ }
58783
58880
  }, {
58784
58881
  key: "add",
58785
58882
  value: function add(element) {
@@ -58789,6 +58886,8 @@ var DEFAULT_TAG = 'all';var Entity = /*#__PURE__*/function (_EventDispatcher) {
58789
58886
  var _add = function _add(toAdd) {
58790
58887
  _this2.children.push(toAdd);
58791
58888
 
58889
+ toAdd.setParent(_this2);
58890
+
58792
58891
  _this2.getBody().add(toAdd.getBody());
58793
58892
  };
58794
58893
 
@@ -58834,6 +58933,16 @@ var DEFAULT_TAG = 'all';var Entity = /*#__PURE__*/function (_EventDispatcher) {
58834
58933
  this.children.splice(index, 1);
58835
58934
  }
58836
58935
  }
58936
+ }, {
58937
+ key: "getHierarchy",
58938
+ value: function getHierarchy() {
58939
+ return {
58940
+ element: this,
58941
+ children: this.children.map(function (e) {
58942
+ return e.getHierarchy();
58943
+ })
58944
+ };
58945
+ }
58837
58946
  }, {
58838
58947
  key: "addTags",
58839
58948
  value: function addTags() {
@@ -59054,7 +59163,7 @@ var DEFAULT_TAG = 'all';var Entity = /*#__PURE__*/function (_EventDispatcher) {
59054
59163
  }, {
59055
59164
  key: "setEntityType",
59056
59165
  value: function setEntityType(type) {
59057
- if (Object.values(ENTITY_TYPES).includes(type)) {
59166
+ if (FLAT_ENTITY_TYPES.includes(type)) {
59058
59167
  this.entityType = type;
59059
59168
  } else {
59060
59169
  console.log(ENTITY_TYPE_NOT_ALLOWED);
@@ -59068,7 +59177,7 @@ var DEFAULT_TAG = 'all';var Entity = /*#__PURE__*/function (_EventDispatcher) {
59068
59177
  }
59069
59178
  }, {
59070
59179
  key: "addLight",
59071
- // TODO: sounds should become like particle emitters
59180
+ // TODO: sounds should become entities
59072
59181
  // addSound(name, options) {
59073
59182
  // const { autoplay = false, ...opts } = options;
59074
59183
  // this.isPlayingSound = autoplay;
@@ -60172,6 +60281,10 @@ var prepareModel = function prepareModel(model) {
60172
60281
  setUpLightsAndShadows(mesh);
60173
60282
  });
60174
60283
  return model;
60284
+ };var _MATERIAL_TEXTURE_MAP;
60285
+ 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
+ var isTextureMapAllowedForMaterial = function isTextureMapAllowedForMaterial(materialType, textureType) {
60287
+ return MATERIAL_TEXTURE_MAP[materialType] && MATERIAL_TEXTURE_MAP[materialType].includes(textureType);
60175
60288
  };var _excluded$3 = ["position", "quaternion"],
60176
60289
  _excluded2 = ["applyPhysicsUpdate"],
60177
60290
  _excluded3 = ["dt", "event"];
@@ -60363,35 +60476,8 @@ var Element = /*#__PURE__*/function (_Entity) {
60363
60476
 
60364
60477
  _defineProperty$1(_assertThisInitialized(_this), "setTextureMap", function (textureId) {
60365
60478
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
60366
-
60367
- if (textureId) {
60368
- var _options$repeat = options.repeat,
60369
- repeat = _options$repeat === void 0 ? {
60370
- x: 1,
60371
- y: 1
60372
- } : _options$repeat,
60373
- _options$wrap = options.wrap,
60374
- wrap = _options$wrap === void 0 ? RepeatWrapping$1 : _options$wrap;
60375
-
60376
- var applyTextureTo = function applyTextureTo(element) {
60377
- var texture = Images$1.get(textureId);
60378
- _this.texture = textureId;
60379
- texture.wrapS = wrap;
60380
- texture.wrapT = wrap;
60381
- texture.repeat.set(repeat.x, repeat.y);
60382
- element.material.map = texture;
60383
- };
60384
-
60385
- if (hasMaterial(_this.getBody())) {
60386
- applyTextureTo(_this.getBody());
60387
- } else {
60388
- _this.getBody().traverse(function (child) {
60389
- if (hasMaterial(child)) {
60390
- applyTextureTo(child);
60391
- }
60392
- });
60393
- }
60394
- }
60479
+ console.warn(DEPRECATIONS.ELEMENT_SET_TEXTURE_MAP);
60480
+ return _this.setTexture(textureId, TEXTURES.MAP, options);
60395
60481
  });
60396
60482
 
60397
60483
  _defineProperty$1(_assertThisInitialized(_this), "lookAt", function () {
@@ -60433,7 +60519,7 @@ var Element = /*#__PURE__*/function (_Entity) {
60433
60519
  var _options$name = _options.name,
60434
60520
  _name = _options$name === void 0 ? "default_".concat(Math.random()) : _options$name;
60435
60521
 
60436
- _this.texture = undefined;
60522
+ _this.textures = {};
60437
60523
  _this.opacity = 1;
60438
60524
  _this.options = _objectSpread2$1(_objectSpread2$1({}, _options), {}, {
60439
60525
  name: _name
@@ -60451,12 +60537,25 @@ var Element = /*#__PURE__*/function (_Entity) {
60451
60537
  _this.animationHandler = undefined;
60452
60538
  _this.animations = [];
60453
60539
 
60540
+ _this.setMaterialType();
60541
+
60454
60542
  _this.setEntityType(ENTITY_TYPES.MESH);
60455
60543
 
60456
60544
  return _this;
60457
60545
  }
60458
60546
 
60459
60547
  _createClass(Element, [{
60548
+ key: "getMaterialType",
60549
+ value: function getMaterialType() {
60550
+ return this.materialType;
60551
+ }
60552
+ }, {
60553
+ key: "setMaterialType",
60554
+ value: function setMaterialType() {
60555
+ var materialType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : MATERIALS.BASIC;
60556
+ this.materialType = materialType;
60557
+ }
60558
+ }, {
60460
60559
  key: "addTag",
60461
60560
  value: function addTag(tag) {
60462
60561
  _get(_getPrototypeOf(Element.prototype), "addTag", this).call(this, tag);
@@ -60784,15 +60883,61 @@ var Element = /*#__PURE__*/function (_Entity) {
60784
60883
  return found;
60785
60884
  }
60786
60885
  }
60886
+ }, {
60887
+ key: "recordTexture",
60888
+ value: function recordTexture(textureId, textureType) {
60889
+ this.textures[textureType] = textureId;
60890
+ }
60891
+ }, {
60892
+ key: "setTexture",
60893
+ value: function setTexture(textureId) {
60894
+ var textureType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXTURES.MAP;
60895
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
60896
+
60897
+ if (!isTextureMapAllowedForMaterial(this.getMaterialType(), textureType)) {
60898
+ console.log(ELEMENT_MATERIAL_NO_SUPPORT_FOR_TEXTURE, textureType, this.getMaterialType());
60899
+ return;
60900
+ }
60901
+
60902
+ if (textureId) {
60903
+ var _options$repeat = options.repeat,
60904
+ repeat = _options$repeat === void 0 ? {
60905
+ x: 1,
60906
+ y: 1
60907
+ } : _options$repeat,
60908
+ _options$wrap = options.wrap,
60909
+ wrap = _options$wrap === void 0 ? RepeatWrapping$1 : _options$wrap;
60910
+ this.recordTexture(textureId, textureType);
60911
+
60912
+ var applyTextureTo = function applyTextureTo(element) {
60913
+ var texture = Images$1.get(textureId);
60914
+ texture.wrapS = wrap;
60915
+ texture.wrapT = wrap;
60916
+ texture.repeat.set(repeat.x, repeat.y);
60917
+ element.material[textureType] = texture;
60918
+ };
60919
+
60920
+ if (hasMaterial(this.getBody())) {
60921
+ applyTextureTo(this.getBody());
60922
+ } else {
60923
+ this.getBody().traverse(function (child) {
60924
+ if (hasMaterial(child)) {
60925
+ applyTextureTo(child);
60926
+ }
60927
+ });
60928
+ }
60929
+ }
60930
+ }
60787
60931
  }, {
60788
60932
  key: "setMaterialFromName",
60789
60933
  value: function setMaterialFromName(materialName) {
60790
60934
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
60935
+ this.setMaterialType(materialName);
60791
60936
 
60792
60937
  if (hasMaterial(this.getBody())) {
60793
60938
  changeMaterialByName(materialName, this.getBody(), options);
60794
60939
  } else {
60795
- this.body.traverse(function (child) {
60940
+ this.getBody().traverse(function (child) {
60796
60941
  if (hasMaterial(child)) {
60797
60942
  changeMaterialByName(materialName, child, options);
60798
60943
  }
@@ -60915,7 +61060,7 @@ var Element = /*#__PURE__*/function (_Entity) {
60915
61060
  return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(Element.prototype), "toJSON", this).call(this)), {}, {
60916
61061
  body: this.body.toJSON(),
60917
61062
  scripts: this.mapScriptsToJSON(),
60918
- texture: this.texture
61063
+ textures: this.textures
60919
61064
  }, this.options);
60920
61065
  }
60921
61066
  }
@@ -60951,6 +61096,10 @@ var Element = /*#__PURE__*/function (_Entity) {
60951
61096
 
60952
61097
  _this.setBody(new PerspectiveCamera(fov, ratio, near, far));
60953
61098
 
61099
+ _this.setEntityType(ENTITY_TYPES.CAMERA);
61100
+
61101
+ _this.setName(name);
61102
+
60954
61103
  return _this;
60955
61104
  }
60956
61105
 
@@ -61004,16 +61153,17 @@ var Element = /*#__PURE__*/function (_Entity) {
61004
61153
  size: size,
61005
61154
  division: division,
61006
61155
  color1: color1,
61007
- color2: color2
61156
+ color2: color2,
61157
+ name: "GridHelper_".concat(Math.random())
61008
61158
  };
61009
61159
  _this = _super.call(this, null, null, options);
61010
- _this.body = new GridHelper(size, division, color1, color2);
61160
+ var body = new GridHelper(size, division, color1, color2);
61011
61161
 
61012
61162
  _this.setBody({
61013
61163
  body: body
61014
61164
  });
61015
61165
 
61016
- _this.setEntityType(ENTITY_TYPES.MESH);
61166
+ _this.setEntityType(ENTITY_TYPES.HELPER.GRID);
61017
61167
 
61018
61168
  return _this;
61019
61169
  }
@@ -73609,7 +73759,7 @@ var Light = /*#__PURE__*/function (_Entity) {
73609
73759
 
73610
73760
  _this.target = undefined;
73611
73761
 
73612
- _this.setEntityType(ENTITY_TYPES.LIGHT);
73762
+ _this.setEntityType(ENTITY_TYPES.LIGHT.DEFAULT);
73613
73763
 
73614
73764
  Lights$1.add(_assertThisInitialized(_this));
73615
73765
  return _this;
@@ -73784,7 +73934,8 @@ var SunLight = /*#__PURE__*/function (_Light) {
73784
73934
  color = _options$color === void 0 ? WHITE$3 : _options$color,
73785
73935
  _options$intensity = options.intensity,
73786
73936
  intensity = _options$intensity === void 0 ? DEFAULT_INTENSITY$4 : _options$intensity,
73787
- name = options.name;
73937
+ _options$name = options.name,
73938
+ name = _options$name === void 0 ? "SunLight_".concat(Math.random()) : _options$name;
73788
73939
  _this = _super.call(this, {
73789
73940
  color: color,
73790
73941
  intensity: intensity,
@@ -73797,6 +73948,10 @@ var SunLight = /*#__PURE__*/function (_Light) {
73797
73948
  intensity: intensity
73798
73949
  });
73799
73950
 
73951
+ _this.setEntityType(ENTITY_TYPES.LIGHT.SUN);
73952
+
73953
+ _this.setName(name);
73954
+
73800
73955
  return _this;
73801
73956
  }
73802
73957
 
@@ -73947,7 +74102,8 @@ var AmbientLight = /*#__PURE__*/function (_Light) {
73947
74102
  color = _options$color === void 0 ? WHITE$2 : _options$color,
73948
74103
  _options$intensity = options.intensity,
73949
74104
  intensity = _options$intensity === void 0 ? DEFAULT_INTENSITY$3 : _options$intensity,
73950
- name = options.name;
74105
+ _options$name = options.name,
74106
+ name = _options$name === void 0 ? "AmbientLight_".concat(Math.random()) : _options$name;
73951
74107
  _this = _super.call(this, {
73952
74108
  color: color,
73953
74109
  intensity: intensity,
@@ -73960,6 +74116,10 @@ var AmbientLight = /*#__PURE__*/function (_Light) {
73960
74116
  intensity: intensity
73961
74117
  });
73962
74118
 
74119
+ _this.setEntityType(ENTITY_TYPES.LIGHT.AMBIENT);
74120
+
74121
+ _this.setName(name);
74122
+
73963
74123
  return _this;
73964
74124
  }
73965
74125
 
@@ -74046,7 +74206,8 @@ var PointLight = /*#__PURE__*/function (_Light) {
74046
74206
  color = _options$color === void 0 ? WHITE$1 : _options$color,
74047
74207
  _options$intensity = options.intensity,
74048
74208
  intensity = _options$intensity === void 0 ? DEFAULT_INTENSITY$2 : _options$intensity,
74049
- name = options.name,
74209
+ _options$name = options.name,
74210
+ name = _options$name === void 0 ? "PointLight_".concat(Math.random()) : _options$name,
74050
74211
  distance = options.distance,
74051
74212
  decay = options.decay;
74052
74213
  _this = _super.call(this, {
@@ -74063,6 +74224,10 @@ var PointLight = /*#__PURE__*/function (_Light) {
74063
74224
  decay: decay
74064
74225
  });
74065
74226
 
74227
+ _this.setEntityType(ENTITY_TYPES.LIGHT.POINT);
74228
+
74229
+ _this.setName(name);
74230
+
74066
74231
  return _this;
74067
74232
  }
74068
74233
 
@@ -76405,7 +76570,7 @@ var index$1=/*#__PURE__*/Object.freeze({__proto__:null,Emitter:k,Particle:P,Part
76405
76570
 
76406
76571
  _this.setName(name);
76407
76572
 
76408
- _this.setEntityType(ENTITY_TYPES.PARTICLE);
76573
+ _this.setEntityType(ENTITY_TYPES.EFFECT.PARTICLE);
76409
76574
 
76410
76575
  return _this;
76411
76576
  }
@@ -78349,7 +78514,7 @@ var Particles$1 = new Particles();var Orbit = /*#__PURE__*/function (_EventDispa
78349
78514
  _this.scaleHandleGeometry = new BoxGeometry(0.125, 0.125, 0.125);
78350
78515
  _this.lineGeometry = new BufferGeometry();
78351
78516
 
78352
- _this.lineGeometry.addAttribute('position', new Float32BufferAttribute([0, 0, 0, 1, 0, 0], 3)); // Make unique material for each axis/color
78517
+ _this.lineGeometry.setAttribute('position', new Float32BufferAttribute([0, 0, 0, 1, 0, 0], 3)); // Make unique material for each axis/color
78353
78518
 
78354
78519
 
78355
78520
  _this.matInvisible = _this.gizmoMaterial.clone();
@@ -78468,14 +78633,14 @@ var Particles$1 = new Particles();var Orbit = /*#__PURE__*/function (_EventDispa
78468
78633
  vertices.push(0, Math.cos(i / 32 * Math.PI) * radius, Math.sin(i / 32 * Math.PI) * radius);
78469
78634
  }
78470
78635
 
78471
- geometry.addAttribute('position', new Float32BufferAttribute(vertices, 3));
78636
+ geometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));
78472
78637
  return geometry;
78473
78638
  }
78474
78639
  }, {
78475
78640
  key: "createTranslateHelperGeometry",
78476
78641
  value: function createTranslateHelperGeometry(radius, arc) {
78477
78642
  var geometry = new BufferGeometry();
78478
- geometry.addAttribute('position', new Float32BufferAttribute([0, 0, 0, 1, 1, 1], 3));
78643
+ geometry.setAttribute('position', new Float32BufferAttribute([0, 0, 0, 1, 1, 1], 3));
78479
78644
  return geometry;
78480
78645
  }
78481
78646
  }, {
@@ -78614,7 +78779,7 @@ var Particles$1 = new Particles();var Orbit = /*#__PURE__*/function (_EventDispa
78614
78779
 
78615
78780
  object.updateMatrix();
78616
78781
  var tempGeometry = object.geometry.clone();
78617
- tempGeometry.applyMatrix(object.matrix);
78782
+ tempGeometry.applyMatrix4(object.matrix);
78618
78783
  object.geometry = tempGeometry;
78619
78784
  object.position.set(0, 0, 0);
78620
78785
  object.rotation.set(0, 0, 0);
@@ -79306,7 +79471,7 @@ var Particles$1 = new Particles();var Orbit = /*#__PURE__*/function (_EventDispa
79306
79471
  _this._quaternionStart = new Quaternion();
79307
79472
  _this._scaleStart = new Vector3$1();
79308
79473
  _this.isTransformControls = true;
79309
- Scene$1.add(_assertThisInitialized(_this), _assertThisInitialized(_this), false);
79474
+ Scene$1.add(_assertThisInitialized(_this), null, false);
79310
79475
  return _this;
79311
79476
  }
79312
79477
 
@@ -80624,8 +80789,8 @@ var Level = /*#__PURE__*/function (_EventDispatcher) {
80624
80789
  });
80625
80790
 
80626
80791
  _defineProperty$1(_assertThisInitialized(_this), "init", function () {
80627
- var path = _this.options.path;
80628
- Scene$1.create(path);
80792
+ _this.options.path;
80793
+ Scene$1.create(_this.getName());
80629
80794
  Scene$1.createCamera(new Camera());
80630
80795
 
80631
80796
  _this.enableInput();
@@ -80671,6 +80836,11 @@ var Level = /*#__PURE__*/function (_EventDispatcher) {
80671
80836
  }
80672
80837
 
80673
80838
  _createClass(Level, [{
80839
+ key: "getName",
80840
+ value: function getName() {
80841
+ return this.name;
80842
+ }
80843
+ }, {
80674
80844
  key: "prepareScene",
80675
80845
  value: function prepareScene() {}
80676
80846
  }, {
@@ -86507,7 +86677,8 @@ var SpotLight = /*#__PURE__*/function (_Light) {
86507
86677
  color = _options$color === void 0 ? WHITE : _options$color,
86508
86678
  _options$intensity = options.intensity,
86509
86679
  intensity = _options$intensity === void 0 ? DEFAULT_INTENSITY$1 : _options$intensity,
86510
- name = options.name;
86680
+ _options$name = options.name,
86681
+ name = _options$name === void 0 ? "SpotLight_".concat(Math.random()) : _options$name;
86511
86682
  _this = _super.call(this, {
86512
86683
  color: color,
86513
86684
  intensity: intensity,
@@ -86520,6 +86691,10 @@ var SpotLight = /*#__PURE__*/function (_Light) {
86520
86691
  intensity: intensity
86521
86692
  });
86522
86693
 
86694
+ _this.setEntityType(ENTITY_TYPES.LIGHT.SPOT);
86695
+
86696
+ _this.setName(name);
86697
+
86523
86698
  return _this;
86524
86699
  }
86525
86700
 
@@ -86675,7 +86850,8 @@ var HemisphereLight = /*#__PURE__*/function (_Light) {
86675
86850
  } : _options$color,
86676
86851
  _options$intensity = options.intensity,
86677
86852
  intensity = _options$intensity === void 0 ? DEFAULT_INTENSITY : _options$intensity,
86678
- name = options.name;
86853
+ _options$name = options.name,
86854
+ name = _options$name === void 0 ? "HemisphereLight_".concat(Math.random()) : _options$name;
86679
86855
  _this = _super.call(this, {
86680
86856
  color: color,
86681
86857
  intensity: intensity,
@@ -86688,6 +86864,10 @@ var HemisphereLight = /*#__PURE__*/function (_Light) {
86688
86864
  intensity: intensity
86689
86865
  });
86690
86866
 
86867
+ _this.setEntityType(ENTITY_TYPES.LIGHT.HEMISPHERE);
86868
+
86869
+ _this.setName(name);
86870
+
86691
86871
  return _this;
86692
86872
  }
86693
86873
 
@@ -88134,7 +88314,7 @@ var Sky = /*#__PURE__*/function (_Element) {
88134
88314
  body: body
88135
88315
  });
88136
88316
 
88137
- _this.setEntityType(ENTITY_TYPES.MESH);
88317
+ _this.setEntityType(ENTITY_TYPES.EFFECT.SCENERY);
88138
88318
 
88139
88319
  _this.setScale({
88140
88320
  x: scale,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mage-engine",
3
- "version": "3.17.0",
3
+ "version": "3.17.3",
4
4
  "description": "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.",
5
5
  "main": "dist/mage.js",
6
6
  "author": {