mage-engine 3.17.1 → 3.17.2

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 +95 -42
  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) {
@@ -57111,7 +57128,7 @@ function applyMiddleware() {
57111
57128
 
57112
57129
  var thunk = createThunkMiddleware();
57113
57130
  thunk.withExtraArgument = createThunkMiddleware;var name = "mage-engine";
57114
- var version = "3.17.1";
57131
+ var version = "3.17.2";
57115
57132
  var description = "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.";
57116
57133
  var main = "dist/mage.js";
57117
57134
  var author$1 = {
@@ -60172,6 +60189,10 @@ var prepareModel = function prepareModel(model) {
60172
60189
  setUpLightsAndShadows(mesh);
60173
60190
  });
60174
60191
  return model;
60192
+ };var _MATERIAL_TEXTURE_MAP;
60193
+ 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);
60194
+ var isTextureMapAllowedForMaterial = function isTextureMapAllowedForMaterial(materialType, textureType) {
60195
+ return MATERIAL_TEXTURE_MAP[materialType] && MATERIAL_TEXTURE_MAP[materialType].includes(textureType);
60175
60196
  };var _excluded$3 = ["position", "quaternion"],
60176
60197
  _excluded2 = ["applyPhysicsUpdate"],
60177
60198
  _excluded3 = ["dt", "event"];
@@ -60363,35 +60384,8 @@ var Element = /*#__PURE__*/function (_Entity) {
60363
60384
 
60364
60385
  _defineProperty$1(_assertThisInitialized(_this), "setTextureMap", function (textureId) {
60365
60386
  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
- }
60387
+ console.warn(DEPRECATIONS.ELEMENT_SET_TEXTURE_MAP);
60388
+ return _this.setTexture(textureId, TEXTURES.MAP, options);
60395
60389
  });
60396
60390
 
60397
60391
  _defineProperty$1(_assertThisInitialized(_this), "lookAt", function () {
@@ -60433,7 +60427,7 @@ var Element = /*#__PURE__*/function (_Entity) {
60433
60427
  var _options$name = _options.name,
60434
60428
  _name = _options$name === void 0 ? "default_".concat(Math.random()) : _options$name;
60435
60429
 
60436
- _this.texture = undefined;
60430
+ _this.textures = {};
60437
60431
  _this.opacity = 1;
60438
60432
  _this.options = _objectSpread2$1(_objectSpread2$1({}, _options), {}, {
60439
60433
  name: _name
@@ -60451,12 +60445,25 @@ var Element = /*#__PURE__*/function (_Entity) {
60451
60445
  _this.animationHandler = undefined;
60452
60446
  _this.animations = [];
60453
60447
 
60448
+ _this.setMaterialType();
60449
+
60454
60450
  _this.setEntityType(ENTITY_TYPES.MESH);
60455
60451
 
60456
60452
  return _this;
60457
60453
  }
60458
60454
 
60459
60455
  _createClass(Element, [{
60456
+ key: "getMaterialType",
60457
+ value: function getMaterialType() {
60458
+ return this.materialType;
60459
+ }
60460
+ }, {
60461
+ key: "setMaterialType",
60462
+ value: function setMaterialType() {
60463
+ var materialType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : MATERIALS.BASIC;
60464
+ this.materialType = materialType;
60465
+ }
60466
+ }, {
60460
60467
  key: "addTag",
60461
60468
  value: function addTag(tag) {
60462
60469
  _get(_getPrototypeOf(Element.prototype), "addTag", this).call(this, tag);
@@ -60784,15 +60791,61 @@ var Element = /*#__PURE__*/function (_Entity) {
60784
60791
  return found;
60785
60792
  }
60786
60793
  }
60794
+ }, {
60795
+ key: "recordTexture",
60796
+ value: function recordTexture(textureId, textureType) {
60797
+ this.textures[textureType] = textureId;
60798
+ }
60799
+ }, {
60800
+ key: "setTexture",
60801
+ value: function setTexture(textureId) {
60802
+ var textureType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXTURES.MAP;
60803
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
60804
+
60805
+ if (!isTextureMapAllowedForMaterial(this.getMaterialType(), textureType)) {
60806
+ console.log(ELEMENT_MATERIAL_NO_SUPPORT_FOR_TEXTURE, textureType, this.getMaterialType());
60807
+ return;
60808
+ }
60809
+
60810
+ if (textureId) {
60811
+ var _options$repeat = options.repeat,
60812
+ repeat = _options$repeat === void 0 ? {
60813
+ x: 1,
60814
+ y: 1
60815
+ } : _options$repeat,
60816
+ _options$wrap = options.wrap,
60817
+ wrap = _options$wrap === void 0 ? RepeatWrapping$1 : _options$wrap;
60818
+ this.recordTexture(textureId, textureType);
60819
+
60820
+ var applyTextureTo = function applyTextureTo(element) {
60821
+ var texture = Images$1.get(textureId);
60822
+ texture.wrapS = wrap;
60823
+ texture.wrapT = wrap;
60824
+ texture.repeat.set(repeat.x, repeat.y);
60825
+ element.material[textureType] = texture;
60826
+ };
60827
+
60828
+ if (hasMaterial(this.getBody())) {
60829
+ applyTextureTo(this.getBody());
60830
+ } else {
60831
+ this.getBody().traverse(function (child) {
60832
+ if (hasMaterial(child)) {
60833
+ applyTextureTo(child);
60834
+ }
60835
+ });
60836
+ }
60837
+ }
60838
+ }
60787
60839
  }, {
60788
60840
  key: "setMaterialFromName",
60789
60841
  value: function setMaterialFromName(materialName) {
60790
60842
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
60843
+ this.setMaterialType(materialName);
60791
60844
 
60792
60845
  if (hasMaterial(this.getBody())) {
60793
60846
  changeMaterialByName(materialName, this.getBody(), options);
60794
60847
  } else {
60795
- this.body.traverse(function (child) {
60848
+ this.getBody().traverse(function (child) {
60796
60849
  if (hasMaterial(child)) {
60797
60850
  changeMaterialByName(materialName, child, options);
60798
60851
  }
@@ -60915,7 +60968,7 @@ var Element = /*#__PURE__*/function (_Entity) {
60915
60968
  return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(Element.prototype), "toJSON", this).call(this)), {}, {
60916
60969
  body: this.body.toJSON(),
60917
60970
  scripts: this.mapScriptsToJSON(),
60918
- texture: this.texture
60971
+ textures: this.textures
60919
60972
  }, this.options);
60920
60973
  }
60921
60974
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mage-engine",
3
- "version": "3.17.1",
3
+ "version": "3.17.2",
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": {