Jelajahi Sumber

Merge branch 'dev' of https://github.com/mrdoob/three.js into dev

Dinesh Salunke 6 tahun lalu
induk
melakukan
77cd93d086
90 mengubah file dengan 2144 tambahan dan 824 penghapusan
  1. 6 10
      build/three.js
  2. 136 136
      build/three.min.js
  3. 6 10
      build/three.module.js
  4. 1 1
      docs/api/en/core/Object3D.html
  5. 131 0
      docs/api/en/materials/MeshDistanceMaterial.html
  6. 150 0
      docs/api/en/materials/MeshMatcapMaterial.html
  7. 61 1
      docs/api/en/materials/MeshNormalMaterial.html
  8. 8 3
      docs/api/en/textures/Texture.html
  9. 1 1
      docs/api/zh/core/Object3D.html
  10. 112 0
      docs/api/zh/materials/MeshDistanceMaterial.html
  11. 120 0
      docs/api/zh/materials/MeshMatcapMaterial.html
  12. 42 1
      docs/api/zh/materials/MeshNormalMaterial.html
  13. 4 0
      docs/api/zh/textures/Texture.html
  14. 4 0
      docs/list.js
  15. 8 1
      docs/manual/en/introduction/How-to-dispose-of-objects.html
  16. 97 47
      docs/scenes/js/material.js
  17. 0 2
      editor/index.html
  18. 7 1
      editor/js/Editor.js
  19. 2 0
      editor/js/Sidebar.Geometry.js
  20. 136 3
      editor/js/Sidebar.Material.js
  21. 4 0
      editor/js/Strings.js
  22. 1 0
      editor/js/Viewport.js
  23. 1 1
      editor/js/libs/codemirror/mode/glsl.js
  24. 38 38
      editor/js/libs/three.html.js
  25. 25 22
      examples/js/animation/MMDPhysics.js
  26. 3 3
      examples/js/effects/OutlineEffect.js
  27. 37 32
      examples/js/loaders/GLTFLoader.js
  28. 5 3
      examples/js/loaders/KTXLoader.js
  29. 167 25
      examples/js/loaders/LWOLoader.js
  30. 3 0
      examples/js/loaders/MMDLoader.js
  31. 11 1
      examples/js/loaders/SVGLoader.js
  32. 8 8
      examples/js/shaders/DepthLimitedBlurShader.js
  33. 5 5
      examples/js/shaders/LuminosityHighPassShader.js
  34. 17 17
      examples/js/shaders/SAOShader.js
  35. 7 0
      examples/jsm/exporters/ColladaExporter.d.ts
  36. 3 3
      examples/jsm/exporters/GLTFExporter.d.ts
  37. 7 0
      examples/jsm/exporters/MMDExporter.d.ts
  38. 7 0
      examples/jsm/exporters/OBJExporter.d.ts
  39. 7 0
      examples/jsm/exporters/PLYExporter.d.ts
  40. 7 0
      examples/jsm/exporters/STLExporter.d.ts
  41. 7 0
      examples/jsm/exporters/TypedGeometryExporter.d.ts
  42. 1 6
      examples/jsm/pmrem/PMREMCubeUVPacker.d.ts
  43. 5 0
      examples/jsm/utils/MathUtils.d.ts
  44. 40 32
      examples/jsm/utils/MathUtils.js
  45. 8 0
      examples/jsm/utils/ShadowMapViewer.d.ts
  46. 32 0
      examples/jsm/utils/SkeletonUtils.d.ts
  47. 58 0
      examples/jsm/utils/TypedArrayUtils.d.ts
  48. 3 0
      examples/jsm/utils/UVsDebug.d.ts
  49. TEMPAT SAMPAH
      examples/textures/alphaMap.jpg
  50. 405 319
      examples/webgl_animation_multiple.html
  51. 1 0
      examples/webgl_buffergeometry_morphtargets.html
  52. 0 2
      examples/webgl_custom_attributes_points.html
  53. 0 1
      examples/webgl_custom_attributes_points2.html
  54. 1 1
      examples/webgl_loader_lwo.html
  55. 4 4
      examples/webgl_materials_lightmap.html
  56. 3 0
      examples/webgl_materials_matcap.html
  57. 0 2
      examples/webvr_ballshooter.html
  58. 0 2
      examples/webvr_cubes.html
  59. 0 2
      examples/webvr_dragging.html
  60. 0 2
      examples/webvr_lorenzattractor.html
  61. 0 2
      examples/webvr_paint.html
  62. 0 2
      examples/webvr_panorama.html
  63. 0 2
      examples/webvr_rollercoaster.html
  64. 0 2
      examples/webvr_sandbox.html
  65. 0 2
      examples/webvr_sculpt.html
  66. 0 2
      examples/webvr_video.html
  67. 0 2
      examples/webvr_vive_paint.html
  68. 0 2
      examples/webvr_vive_sculpt.html
  69. 1 0
      src/animation/AnimationAction.d.ts
  70. 1 1
      src/animation/PropertyBinding.js
  71. 2 2
      src/cameras/CubeCamera.js
  72. 5 0
      src/constants.d.ts
  73. 1 1
      src/constants.js
  74. 0 3
      src/core/BufferGeometry.d.ts
  75. 1 0
      src/loaders/MaterialLoader.js
  76. 1 0
      src/materials/Material.js
  77. 3 3
      src/materials/Materials.d.ts
  78. 15 7
      src/materials/MeshDepthMaterial.d.ts
  79. 25 0
      src/materials/MeshDistanceMaterial.d.ts
  80. 46 0
      src/materials/MeshMatcapMaterial.d.ts
  81. 32 10
      src/materials/MeshNormalMaterial.d.ts
  82. 3 1
      src/materials/MeshPhongMaterial.d.ts
  83. 3 0
      src/materials/MeshStandardMaterial.d.ts
  84. 14 0
      src/materials/MeshToonMaterial.d.ts
  85. 1 1
      src/materials/ShaderMaterial.d.ts
  86. 21 21
      src/math/Matrix4.js
  87. 2 0
      src/objects/LOD.js
  88. 1 7
      src/renderers/WebGLRenderer.js
  89. 2 2
      src/renderers/webvr/WebVRManager.js
  90. 1 1
      src/textures/Texture.js

+ 6 - 10
build/three.js

@@ -185,7 +185,7 @@
 
 	} );
 
-	var REVISION = '103';
+	var REVISION = '104dev';
 	var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
 	var CullFaceNone = 0;
 	var CullFaceBack = 1;
@@ -12927,6 +12927,7 @@
 			if ( this.clearCoatRoughness !== undefined ) data.clearCoatRoughness = this.clearCoatRoughness;
 
 			if ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;
+			if ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid;
 			if ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;
 			if ( this.lightMap && this.lightMap.isTexture ) data.lightMap = this.lightMap.toJSON( meta ).uuid;
 
@@ -22902,13 +22903,7 @@
 
 		// vr
 
-		var vr = null;
-
-		if ( typeof navigator !== 'undefined' ) {
-
-			vr = ( 'xr' in navigator ) ? new WebXRManager( _this ) : new WebVRManager( _this );
-
-		}
+		var vr = ( typeof navigator !== 'undefined' && 'xr' in navigator ) ? new WebXRManager( _this ) : new WebVRManager( _this );
 
 		this.vr = vr;
 
@@ -37905,6 +37900,7 @@
 			// maps
 
 			if ( json.map !== undefined ) material.map = getTexture( json.map );
+			if ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap );
 
 			if ( json.alphaMap !== undefined ) {
 
@@ -40208,14 +40204,14 @@
 	 * @author alteredq / http://alteredqualia.com/
 	 */
 
+	var fov = 90, aspect = 1;
+
 	function CubeCamera( near, far, cubeResolution, options ) {
 
 		Object3D.call( this );
 
 		this.type = 'CubeCamera';
 
-		var fov = 90, aspect = 1;
-
 		var cameraPX = new PerspectiveCamera( fov, aspect, near, far );
 		cameraPX.up.set( 0, - 1, 0 );
 		cameraPX.lookAt( new Vector3( 1, 0, 0 ) );

+ 136 - 136
build/three.min.js

@@ -156,15 +156,15 @@ w.stop()}function e(a,b){null===b?a.matrixWorld.copy(a.matrix):a.matrixWorld.mul
 b);return b};this.getDevice=function(){return g};this.setDevice=function(a){void 0!==a&&(g=a);a instanceof XRDevice&&f.setCompatibleXRDevice(a)};this.setFramebufferScaleFactor=function(a){k=a};this.setFrameOfReferenceType=function(a){p=a};this.setSession=function(b){h=b;null!==h&&(h.addEventListener("select",c),h.addEventListener("selectstart",c),h.addEventListener("selectend",c),h.addEventListener("end",d),h.baseLayer=new XRWebGLLayer(h,f,{framebufferScaleFactor:k}),h.requestFrameOfReference(p).then(function(b){m=
 b;a.setFramebuffer(h.baseLayer.framebuffer);w.setContext(h);w.start()}),t=h.getInputSources(),h.addEventListener("inputsourceschange",function(){t=h.getInputSources();console.log(t);for(var a=0;a<l.length;a++)l[a].userData.inputSource=t[a]}))};this.getCamera=function(a){if(b()){var c=a.parent,d=n.cameras;e(n,c);for(var f=0;f<d.length;f++)e(d[f],c);a.matrixWorld.copy(n.matrixWorld);a=a.children;f=0;for(c=a.length;f<c;f++)a[f].updateMatrixWorld(!0);qf(n,r,u);return n}return a};this.isPresenting=b;var A=
 null,w=new ae;w.setAnimationLoop(function(a,b){q=b.getDevicePose(m);if(null!==q)for(var c=h.baseLayer,d=b.views,e=0;e<d.length;e++){var f=d[e],g=c.getViewport(f),k=q.getViewMatrix(f),p=n.cameras[e];p.matrix.fromArray(k).getInverse(p.matrix);p.projectionMatrix.fromArray(f.projectionMatrix);p.viewport.set(g.x,g.y,g.width,g.height);0===e&&n.matrix.copy(p.matrix)}for(e=0;e<l.length;e++){c=l[e];if(d=t[e])if(d=b.getInputPose(d,m),null!==d){"targetRay"in d?c.matrix.elements=d.targetRay.transformMatrix:"pointerMatrix"in
-d&&(c.matrix.elements=d.pointerMatrix);c.matrix.decompose(c.position,c.rotation,c.scale);c.visible=!0;continue}c.visible=!1}A&&A(a)});this.setAnimationLoop=function(a){A=a};this.dispose=function(){};this.getStandingMatrix=function(){console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed.");return new P};this.submitFrame=function(){}}function ge(a){var b;function c(){na=new eg(L);Aa=new cg(L,na,a);Aa.isWebGL2||(na.get("WEBGL_depth_texture"),na.get("OES_texture_float"),na.get("OES_texture_half_float"),
-na.get("OES_texture_half_float_linear"),na.get("OES_standard_derivatives"),na.get("OES_element_index_uint"),na.get("ANGLE_instanced_arrays"));na.get("OES_texture_float_linear");ia=new pf(L,na,Aa);ca=new bh(L,na,ia,Aa);ca.scissor(W.copy(Ha).multiplyScalar(H));ca.viewport(R.copy(Z).multiplyScalar(H));lb=new hg(L);Ba=new Ug;ba=new ch(L,na,ca,Ba,Aa,ia,lb);pa=new Vf(L);sa=new fg(L,pa,lb);oa=new kg(sa,lb);va=new jg(L);la=new Tg(fa,na,Aa,ba);ra=new Xg;qa=new ah;ma=new ag(fa,ca,oa,ua);wa=new bg(L,na,lb,Aa);
-ya=new gg(L,na,lb,Aa);lb.programs=la.programs;fa.context=L;fa.capabilities=Aa;fa.extensions=na;fa.properties=Ba;fa.renderLists=ra;fa.state=ca;fa.info=lb}function d(a){a.preventDefault();console.log("THREE.WebGLRenderer: Context Lost.");I=!0}function e(){console.log("THREE.WebGLRenderer: Context Restored.");I=!1;c()}function f(a){a=a.target;a.removeEventListener("dispose",f);g(a);Ba.remove(a)}function g(a){var b=Ba.get(a).program;a.program=void 0;void 0!==b&&la.releaseProgram(b)}function h(a,b){a.render(function(a){fa.renderBufferImmediate(a,
-b)})}function k(a,b,c,d){if(!1!==a.visible){if(a.layers.test(b.layers))if(a.isGroup)c=a.renderOrder;else if(a.isLight)z.pushLight(a),a.castShadow&&z.pushShadow(a);else if(a.isSprite){if(!a.frustumCulled||ja.intersectsSprite(a)){d&&kb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(Fc);var e=oa.update(a),f=a.material;f.visible&&C.push(a,e,f,c,kb.z,null)}}else if(a.isImmediateRenderObject)d&&kb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(Fc),C.push(a,null,a.material,c,kb.z,null);else if(a.isMesh||
-a.isLine||a.isPoints)if(a.isSkinnedMesh&&a.skeleton.update(),!a.frustumCulled||ja.intersectsObject(a))if(d&&kb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(Fc),e=oa.update(a),f=a.material,Array.isArray(f))for(var g=e.groups,h=0,m=g.length;h<m;h++){var p=g[h],q=f[p.materialIndex];q&&q.visible&&C.push(a,e,q,c,kb.z,p)}else f.visible&&C.push(a,e,f,c,kb.z,null);a=a.children;h=0;for(m=a.length;h<m;h++)k(a[h],b,c,d)}}function m(a,b,c,d){for(var e=0,f=a.length;e<f;e++){var g=a[e],h=g.object,k=g.geometry,
+d&&(c.matrix.elements=d.pointerMatrix);c.matrix.decompose(c.position,c.rotation,c.scale);c.visible=!0;continue}c.visible=!1}A&&A(a)});this.setAnimationLoop=function(a){A=a};this.dispose=function(){};this.getStandingMatrix=function(){console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed.");return new P};this.submitFrame=function(){}}function ge(a){var b;function c(){ma=new eg(L);Aa=new cg(L,ma,a);Aa.isWebGL2||(ma.get("WEBGL_depth_texture"),ma.get("OES_texture_float"),ma.get("OES_texture_half_float"),
+ma.get("OES_texture_half_float_linear"),ma.get("OES_standard_derivatives"),ma.get("OES_element_index_uint"),ma.get("ANGLE_instanced_arrays"));ma.get("OES_texture_float_linear");ia=new pf(L,ma,Aa);ca=new bh(L,ma,ia,Aa);ca.scissor(W.copy(Ha).multiplyScalar(H));ca.viewport(R.copy(Z).multiplyScalar(H));lb=new hg(L);Ba=new Ug;ba=new ch(L,ma,ca,Ba,Aa,ia,lb);pa=new Vf(L);sa=new fg(L,pa,lb);na=new kg(sa,lb);va=new jg(L);ka=new Tg(fa,ma,Aa,ba);ra=new Xg;qa=new ah;la=new ag(fa,ca,na,ua);wa=new bg(L,ma,lb,Aa);
+ya=new gg(L,ma,lb,Aa);lb.programs=ka.programs;fa.context=L;fa.capabilities=Aa;fa.extensions=ma;fa.properties=Ba;fa.renderLists=ra;fa.state=ca;fa.info=lb}function d(a){a.preventDefault();console.log("THREE.WebGLRenderer: Context Lost.");I=!0}function e(){console.log("THREE.WebGLRenderer: Context Restored.");I=!1;c()}function f(a){a=a.target;a.removeEventListener("dispose",f);g(a);Ba.remove(a)}function g(a){var b=Ba.get(a).program;a.program=void 0;void 0!==b&&ka.releaseProgram(b)}function h(a,b){a.render(function(a){fa.renderBufferImmediate(a,
+b)})}function k(a,b,c,d){if(!1!==a.visible){if(a.layers.test(b.layers))if(a.isGroup)c=a.renderOrder;else if(a.isLight)z.pushLight(a),a.castShadow&&z.pushShadow(a);else if(a.isSprite){if(!a.frustumCulled||ja.intersectsSprite(a)){d&&kb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(Fc);var e=na.update(a),f=a.material;f.visible&&C.push(a,e,f,c,kb.z,null)}}else if(a.isImmediateRenderObject)d&&kb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(Fc),C.push(a,null,a.material,c,kb.z,null);else if(a.isMesh||
+a.isLine||a.isPoints)if(a.isSkinnedMesh&&a.skeleton.update(),!a.frustumCulled||ja.intersectsObject(a))if(d&&kb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(Fc),e=na.update(a),f=a.material,Array.isArray(f))for(var g=e.groups,h=0,m=g.length;h<m;h++){var p=g[h],q=f[p.materialIndex];q&&q.visible&&C.push(a,e,q,c,kb.z,p)}else f.visible&&C.push(a,e,f,c,kb.z,null);a=a.children;h=0;for(m=a.length;h<m;h++)k(a[h],b,c,d)}}function m(a,b,c,d){for(var e=0,f=a.length;e<f;e++){var g=a[e],h=g.object,k=g.geometry,
 m=void 0===d?g.material:d;g=g.group;if(c.isArrayCamera){T=c;for(var q=c.cameras,l=0,v=q.length;l<v;l++){var r=q[l];if(h.layers.test(r.layers)){if("viewport"in r)ca.viewport(R.copy(r.viewport));else{var t=r.bounds;ca.viewport(R.set(t.x*Ea,t.y*U,t.z*Ea,t.w*U).multiplyScalar(H))}z.setupLights(r);p(h,b,r,k,m,g)}}}else T=null,p(h,b,c,k,m,g)}}function p(a,c,d,e,f,g){a.onBeforeRender(fa,c,d,e,f,g);z=qa.get(c,T||d);a.modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,a.matrixWorld);a.normalMatrix.getNormalMatrix(a.modelViewMatrix);
-if(a.isImmediateRenderObject){ca.setMaterial(f);var k=l(d,c.fog,f,a);O=b=null;da=!1;h(a,k)}else fa.renderBufferDirect(d,c.fog,e,f,a,g);a.onAfterRender(fa,c,d,e,f,g);z=qa.get(c,T||d)}function q(a,b,c){var d=Ba.get(a),e=z.state.lights,h=d.lightsHash,k=e.state.hash;c=la.getParameters(a,e.state,z.state.shadowsArray,b,aa.numPlanes,aa.numIntersection,c);var m=la.getProgramCode(a,c),p=d.program,q=!0;if(void 0===p)a.addEventListener("dispose",f);else if(p.code!==m)g(a);else{if(h.stateID!==k.stateID||h.directionalLength!==
+if(a.isImmediateRenderObject){ca.setMaterial(f);var k=l(d,c.fog,f,a);O=b=null;da=!1;h(a,k)}else fa.renderBufferDirect(d,c.fog,e,f,a,g);a.onAfterRender(fa,c,d,e,f,g);z=qa.get(c,T||d)}function q(a,b,c){var d=Ba.get(a),e=z.state.lights,h=d.lightsHash,k=e.state.hash;c=ka.getParameters(a,e.state,z.state.shadowsArray,b,aa.numPlanes,aa.numIntersection,c);var m=ka.getProgramCode(a,c),p=d.program,q=!0;if(void 0===p)a.addEventListener("dispose",f);else if(p.code!==m)g(a);else{if(h.stateID!==k.stateID||h.directionalLength!==
 k.directionalLength||h.pointLength!==k.pointLength||h.spotLength!==k.spotLength||h.rectAreaLength!==k.rectAreaLength||h.hemiLength!==k.hemiLength||h.shadowsLength!==k.shadowsLength)h.stateID=k.stateID,h.directionalLength=k.directionalLength,h.pointLength=k.pointLength,h.spotLength=k.spotLength,h.rectAreaLength=k.rectAreaLength,h.hemiLength=k.hemiLength,h.shadowsLength=k.shadowsLength;else if(void 0!==c.shaderID)return;q=!1}q&&(c.shaderID?(m=Wa[c.shaderID],d.shader={name:a.type,uniforms:Pb(m.uniforms),
-vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}):d.shader={name:a.type,uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader},a.onBeforeCompile(d.shader,fa),m=la.getProgramCode(a,c),p=la.acquireProgram(a,d.shader,c,m),d.program=p,a.program=p);c=p.getAttributes();if(a.morphTargets)for(m=a.numSupportedMorphTargets=0;m<fa.maxMorphTargets;m++)0<=c["morphTarget"+m]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(m=a.numSupportedMorphNormals=0;m<fa.maxMorphNormals;m++)0<=
+vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}):d.shader={name:a.type,uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader},a.onBeforeCompile(d.shader,fa),m=ka.getProgramCode(a,c),p=ka.acquireProgram(a,d.shader,c,m),d.program=p,a.program=p);c=p.getAttributes();if(a.morphTargets)for(m=a.numSupportedMorphTargets=0;m<fa.maxMorphTargets;m++)0<=c["morphTarget"+m]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(m=a.numSupportedMorphNormals=0;m<fa.maxMorphNormals;m++)0<=
 c["morphNormal"+m]&&a.numSupportedMorphNormals++;c=d.shader.uniforms;if(!a.isShaderMaterial&&!a.isRawShaderMaterial||!0===a.clipping)d.numClippingPlanes=aa.numPlanes,d.numIntersection=aa.numIntersection,c.clippingPlanes=aa.uniform;d.fog=b;void 0===h&&(d.lightsHash=h={});h.stateID=k.stateID;h.directionalLength=k.directionalLength;h.pointLength=k.pointLength;h.spotLength=k.spotLength;h.rectAreaLength=k.rectAreaLength;h.hemiLength=k.hemiLength;h.shadowsLength=k.shadowsLength;a.lights&&(c.ambientLightColor.value=
 e.state.ambient,c.directionalLights.value=e.state.directional,c.spotLights.value=e.state.spot,c.rectAreaLights.value=e.state.rectArea,c.pointLights.value=e.state.point,c.hemisphereLights.value=e.state.hemi,c.directionalShadowMap.value=e.state.directionalShadowMap,c.directionalShadowMatrix.value=e.state.directionalShadowMatrix,c.spotShadowMap.value=e.state.spotShadowMap,c.spotShadowMatrix.value=e.state.spotShadowMatrix,c.pointShadowMap.value=e.state.pointShadowMap,c.pointShadowMatrix.value=e.state.pointShadowMatrix);
 a=d.program.getUniforms();a=hb.seqWithValue(a.seq,c);d.uniformsList=a}function l(a,b,c,d){ba.resetTextureUnits();var e=Ba.get(c),f=e.lightsHash,g=z.state.lights.state.hash;ha&&(fe||a!==S)&&aa.setState(c.clippingPlanes,c.clipIntersection,c.clipShadows,a,e,a===S&&c.id===Q);!1===c.needsUpdate&&(void 0===e.program?c.needsUpdate=!0:c.fog&&e.fog!==b?c.needsUpdate=!0:!c.lights||f.stateID===g.stateID&&f.directionalLength===g.directionalLength&&f.pointLength===g.pointLength&&f.spotLength===g.spotLength&&f.rectAreaLength===
@@ -181,49 +181,49 @@ e.uniformsList,p,ba),c.uniformsNeedUpdate=!1);c.isSpriteMaterial&&g.setValue(L,"
 b.specularMap);b.envMap&&(a.envMap.value=b.envMap,a.flipEnvMap.value=b.envMap.isCubeTexture?-1:1,a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio,a.maxMipLevel.value=Ba.get(b.envMap).__maxMipLevel);b.lightMap&&(a.lightMap.value=b.lightMap,a.lightMapIntensity.value=b.lightMapIntensity);b.aoMap&&(a.aoMap.value=b.aoMap,a.aoMapIntensity.value=b.aoMapIntensity);if(b.map)var c=b.map;else b.specularMap?c=b.specularMap:b.displacementMap?c=b.displacementMap:b.normalMap?c=b.normalMap:
 b.bumpMap?c=b.bumpMap:b.roughnessMap?c=b.roughnessMap:b.metalnessMap?c=b.metalnessMap:b.alphaMap?c=b.alphaMap:b.emissiveMap&&(c=b.emissiveMap);void 0!==c&&(c.isWebGLRenderTarget&&(c=c.texture),!0===c.matrixAutoUpdate&&c.updateMatrix(),a.uvTransform.value.copy(c.matrix))}function r(a,b){a.specular.value=b.specular;a.shininess.value=Math.max(b.shininess,1E-4);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=
 -1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias)}function u(a,b){a.roughness.value=b.roughness;a.metalness.value=b.metalness;b.roughnessMap&&(a.roughnessMap.value=b.roughnessMap);b.metalnessMap&&(a.metalnessMap.value=b.metalnessMap);b.emissiveMap&&(a.emissiveMap.value=
-b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias);b.envMap&&(a.envMapIntensity.value=b.envMapIntensity)}console.log("THREE.WebGLRenderer","103");a=a||{};
-var x=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),A=void 0!==a.context?a.context:null,w=void 0!==a.alpha?a.alpha:!1,y=void 0!==a.depth?a.depth:!0,D=void 0!==a.stencil?a.stencil:!0,J=void 0!==a.antialias?a.antialias:!1,ua=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,E=void 0!==a.powerPreference?a.powerPreference:"default",C=null,z=null;this.domElement=x;this.context=null;this.sortObjects=
+b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias);b.envMap&&(a.envMapIntensity.value=b.envMapIntensity)}console.log("THREE.WebGLRenderer","104dev");a=a||
+{};var x=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),A=void 0!==a.context?a.context:null,w=void 0!==a.alpha?a.alpha:!1,y=void 0!==a.depth?a.depth:!0,D=void 0!==a.stencil?a.stencil:!0,J=void 0!==a.antialias?a.antialias:!1,ua=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,E=void 0!==a.powerPreference?a.powerPreference:"default",C=null,z=null;this.domElement=x;this.context=null;this.sortObjects=
 this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=[];this.localClippingEnabled=!1;this.gammaFactor=2;this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1;this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var fa=this,I=!1,M=null,N=null,X=null,Q=-1;var O=b=null;var da=!1;var S=null,T=null,R=new Y,W=new Y,V=null,Ea=x.width,U=x.height,H=1,Z=new Y(0,0,Ea,U),Ha=new Y(0,0,Ea,U),
 ea=!1,ja=new vd,aa=new dg,ha=!1,fe=!1,Fc=new P,kb=new n;try{w={alpha:w,depth:y,stencil:D,antialias:J,premultipliedAlpha:ua,preserveDrawingBuffer:F,powerPreference:E};x.addEventListener("webglcontextlost",d,!1);x.addEventListener("webglcontextrestored",e,!1);var L=A||x.getContext("webgl",w)||x.getContext("experimental-webgl",w);if(null===L){if(null!==x.getContext("webgl"))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0===
-L.getShaderPrecisionFormat&&(L.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(uf){throw console.error("THREE.WebGLRenderer: "+uf.message),uf;}var na,Aa,ca,lb,Ba,ba,pa,sa,oa,la,ra,qa,ma,va,wa,ya,ia;c();var ka=null;"undefined"!==typeof navigator&&(ka="xr"in navigator?new dh(fa):new tf(fa));this.vr=ka;var za=new nf(fa,oa,Aa.maxTextureSize);this.shadowMap=za;this.getContext=function(){return L};this.getContextAttributes=function(){return L.getContextAttributes()};
-this.forceContextLoss=function(){var a=na.get("WEBGL_lose_context");a&&a.loseContext()};this.forceContextRestore=function(){var a=na.get("WEBGL_lose_context");a&&a.restoreContext()};this.getPixelRatio=function(){return H};this.setPixelRatio=function(a){void 0!==a&&(H=a,this.setSize(Ea,U,!1))};this.getSize=function(a){void 0===a&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),a=new B);return a.set(Ea,U)};this.setSize=function(a,b,c){ka.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):
+L.getShaderPrecisionFormat&&(L.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(uf){throw console.error("THREE.WebGLRenderer: "+uf.message),uf;}var ma,Aa,ca,lb,Ba,ba,pa,sa,na,ka,ra,qa,la,va,wa,ya,ia;c();var oa="undefined"!==typeof navigator&&"xr"in navigator?new dh(fa):new tf(fa);this.vr=oa;var za=new nf(fa,na,Aa.maxTextureSize);this.shadowMap=za;this.getContext=function(){return L};this.getContextAttributes=function(){return L.getContextAttributes()};this.forceContextLoss=
+function(){var a=ma.get("WEBGL_lose_context");a&&a.loseContext()};this.forceContextRestore=function(){var a=ma.get("WEBGL_lose_context");a&&a.restoreContext()};this.getPixelRatio=function(){return H};this.setPixelRatio=function(a){void 0!==a&&(H=a,this.setSize(Ea,U,!1))};this.getSize=function(a){void 0===a&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),a=new B);return a.set(Ea,U)};this.setSize=function(a,b,c){oa.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):
 (Ea=a,U=b,x.width=a*H,x.height=b*H,!1!==c&&(x.style.width=a+"px",x.style.height=b+"px"),this.setViewport(0,0,a,b))};this.getDrawingBufferSize=function(a){void 0===a&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),a=new B);return a.set(Ea*H,U*H)};this.setDrawingBufferSize=function(a,b,c){Ea=a;U=b;H=c;x.width=a*c;x.height=b*c;this.setViewport(0,0,a,b)};this.getCurrentViewport=function(a){void 0===a&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),
-a=new Y);return a.copy(R)};this.getViewport=function(a){return a.copy(Z)};this.setViewport=function(a,b,c,d){a.isVector4?Z.set(a.x,a.y,a.z,a.w):Z.set(a,b,c,d);ca.viewport(R.copy(Z).multiplyScalar(H))};this.getScissor=function(a){return a.copy(Ha)};this.setScissor=function(a,b,c,d){a.isVector4?Ha.set(a.x,a.y,a.z,a.w):Ha.set(a,b,c,d);ca.scissor(W.copy(Ha).multiplyScalar(H))};this.getScissorTest=function(){return ea};this.setScissorTest=function(a){ca.setScissorTest(ea=a)};this.getClearColor=function(){return ma.getClearColor()};
-this.setClearColor=function(){ma.setClearColor.apply(ma,arguments)};this.getClearAlpha=function(){return ma.getClearAlpha()};this.setClearAlpha=function(){ma.setClearAlpha.apply(ma,arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=16384;if(void 0===b||b)d|=256;if(void 0===c||c)d|=1024;L.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.dispose=function(){x.removeEventListener("webglcontextlost",
-d,!1);x.removeEventListener("webglcontextrestored",e,!1);ra.dispose();qa.dispose();Ba.dispose();oa.dispose();ka.dispose();ta.stop()};this.renderBufferImmediate=function(a,b){ca.initAttributes();var c=Ba.get(a);a.hasPositions&&!c.position&&(c.position=L.createBuffer());a.hasNormals&&!c.normal&&(c.normal=L.createBuffer());a.hasUvs&&!c.uv&&(c.uv=L.createBuffer());a.hasColors&&!c.color&&(c.color=L.createBuffer());b=b.getAttributes();a.hasPositions&&(L.bindBuffer(34962,c.position),L.bufferData(34962,a.positionArray,
+a=new Y);return a.copy(R)};this.getViewport=function(a){return a.copy(Z)};this.setViewport=function(a,b,c,d){a.isVector4?Z.set(a.x,a.y,a.z,a.w):Z.set(a,b,c,d);ca.viewport(R.copy(Z).multiplyScalar(H))};this.getScissor=function(a){return a.copy(Ha)};this.setScissor=function(a,b,c,d){a.isVector4?Ha.set(a.x,a.y,a.z,a.w):Ha.set(a,b,c,d);ca.scissor(W.copy(Ha).multiplyScalar(H))};this.getScissorTest=function(){return ea};this.setScissorTest=function(a){ca.setScissorTest(ea=a)};this.getClearColor=function(){return la.getClearColor()};
+this.setClearColor=function(){la.setClearColor.apply(la,arguments)};this.getClearAlpha=function(){return la.getClearAlpha()};this.setClearAlpha=function(){la.setClearAlpha.apply(la,arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=16384;if(void 0===b||b)d|=256;if(void 0===c||c)d|=1024;L.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.dispose=function(){x.removeEventListener("webglcontextlost",
+d,!1);x.removeEventListener("webglcontextrestored",e,!1);ra.dispose();qa.dispose();Ba.dispose();na.dispose();oa.dispose();ta.stop()};this.renderBufferImmediate=function(a,b){ca.initAttributes();var c=Ba.get(a);a.hasPositions&&!c.position&&(c.position=L.createBuffer());a.hasNormals&&!c.normal&&(c.normal=L.createBuffer());a.hasUvs&&!c.uv&&(c.uv=L.createBuffer());a.hasColors&&!c.color&&(c.color=L.createBuffer());b=b.getAttributes();a.hasPositions&&(L.bindBuffer(34962,c.position),L.bufferData(34962,a.positionArray,
 35048),ca.enableAttribute(b.position),L.vertexAttribPointer(b.position,3,5126,!1,0,0));a.hasNormals&&(L.bindBuffer(34962,c.normal),L.bufferData(34962,a.normalArray,35048),ca.enableAttribute(b.normal),L.vertexAttribPointer(b.normal,3,5126,!1,0,0));a.hasUvs&&(L.bindBuffer(34962,c.uv),L.bufferData(34962,a.uvArray,35048),ca.enableAttribute(b.uv),L.vertexAttribPointer(b.uv,2,5126,!1,0,0));a.hasColors&&(L.bindBuffer(34962,c.color),L.bufferData(34962,a.colorArray,35048),ca.enableAttribute(b.color),L.vertexAttribPointer(b.color,
 3,5126,!1,0,0));ca.disableUnusedAttributes();L.drawArrays(4,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f,g){var h=f.isMesh&&0>f.matrixWorld.determinant();ca.setMaterial(e,h);var k=l(a,c,e,f),m=!1;if(b!==d.id||O!==k.id||da!==(!0===e.wireframe))b=d.id,O=k.id,da=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(va.update(f,d,e,k),m=!0);h=d.index;var p=d.attributes.position;c=1;!0===e.wireframe&&(h=sa.getWireframeAttribute(d),c=2);a=wa;if(null!==h){var q=pa.get(h);a=ya;a.setIndex(q)}if(m){if(d&&
-d.isInstancedBufferGeometry&&!Aa.isWebGL2&&null===na.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{ca.initAttributes();m=d.attributes;k=k.getAttributes();var v=e.defaultAttributeValues;for(D in k){var r=k[D];if(0<=r){var t=m[D];if(void 0!==t){var n=t.normalized,u=t.itemSize,x=pa.get(t);if(void 0!==x){var w=x.buffer,A=x.type;x=x.bytesPerElement;if(t.isInterleavedBufferAttribute){var y=
+d.isInstancedBufferGeometry&&!Aa.isWebGL2&&null===ma.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{ca.initAttributes();m=d.attributes;k=k.getAttributes();var v=e.defaultAttributeValues;for(D in k){var r=k[D];if(0<=r){var t=m[D];if(void 0!==t){var n=t.normalized,u=t.itemSize,x=pa.get(t);if(void 0!==x){var w=x.buffer,A=x.type;x=x.bytesPerElement;if(t.isInterleavedBufferAttribute){var y=
 t.data,J=y.stride;t=t.offset;y&&y.isInstancedInterleavedBuffer?(ca.enableAttributeAndDivisor(r,y.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=y.meshPerAttribute*y.count)):ca.enableAttribute(r);L.bindBuffer(34962,w);L.vertexAttribPointer(r,u,A,n,J*x,t*x)}else t.isInstancedBufferAttribute?(ca.enableAttributeAndDivisor(r,t.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=t.meshPerAttribute*t.count)):ca.enableAttribute(r),L.bindBuffer(34962,w),L.vertexAttribPointer(r,
 u,A,n,0,0)}}else if(void 0!==v&&(n=v[D],void 0!==n))switch(n.length){case 2:L.vertexAttrib2fv(r,n);break;case 3:L.vertexAttrib3fv(r,n);break;case 4:L.vertexAttrib4fv(r,n);break;default:L.vertexAttrib1fv(r,n)}}}ca.disableUnusedAttributes()}null!==h&&L.bindBuffer(34963,q.buffer)}q=Infinity;null!==h?q=h.count:void 0!==p&&(q=p.count);h=d.drawRange.start*c;p=null!==g?g.start*c:0;var D=Math.max(h,p);g=Math.max(0,Math.min(q,h+d.drawRange.count*c,p+(null!==g?g.count*c:Infinity))-1-D+1);if(0!==g){if(f.isMesh)if(!0===
 e.wireframe)ca.setLineWidth(e.wireframeLinewidth*(null===N?H:1)),a.setMode(1);else switch(f.drawMode){case 0:a.setMode(4);break;case 1:a.setMode(5);break;case 2:a.setMode(6)}else f.isLine?(e=e.linewidth,void 0===e&&(e=1),ca.setLineWidth(e*(null===N?H:1)),f.isLineSegments?a.setMode(1):f.isLineLoop?a.setMode(2):a.setMode(3)):f.isPoints?a.setMode(0):f.isSprite&&a.setMode(4);d&&d.isInstancedBufferGeometry?0<d.maxInstancedCount&&a.renderInstances(d,D,g):a.render(D,g)}};this.compile=function(a,b){z=qa.get(a,
-b);z.init();a.traverse(function(a){a.isLight&&(z.pushLight(a),a.castShadow&&z.pushShadow(a))});z.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=0;c<b.material.length;c++)q(b.material[c],a.fog,b);else q(b.material,a.fog,b)})};var xa=null,ta=new ae;ta.setAnimationLoop(function(a){ka.isPresenting()||xa&&xa(a)});"undefined"!==typeof window&&ta.setContext(window);this.setAnimationLoop=function(a){xa=a;ka.setAnimationLoop(a);ta.start()};this.render=function(a,
-c,d,e){if(void 0!==d){console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.");var f=d}if(void 0!==e){console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead.");var g=e}c&&c.isCamera?I||(O=b=null,da=!1,Q=-1,S=null,!0===a.autoUpdate&&a.updateMatrixWorld(),null===c.parent&&c.updateMatrixWorld(),ka.enabled&&(c=ka.getCamera(c)),z=qa.get(a,c),z.init(),a.onBeforeRender(fa,a,c,f||N),Fc.multiplyMatrices(c.projectionMatrix,
-c.matrixWorldInverse),ja.setFromMatrix(Fc),fe=this.localClippingEnabled,ha=aa.init(this.clippingPlanes,fe,c),C=ra.get(a,c),C.init(),k(a,c,0,fa.sortObjects),!0===fa.sortObjects&&C.sort(),ha&&aa.beginShadows(),za.render(z.state.shadowsArray,a,c),z.setupLights(c),ha&&aa.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==f&&this.setRenderTarget(f),ma.render(C,a,c,g),d=C.opaque,e=C.transparent,a.overrideMaterial?(f=a.overrideMaterial,d.length&&m(d,a,c,f),e.length&&m(e,a,c,f)):(d.length&&m(d,
-a,c),e.length&&m(e,a,c)),a.onAfterRender(fa,a,c),null!==N&&(ba.updateRenderTargetMipmap(N),ba.updateMultisampleRenderTarget(N)),ca.buffers.depth.setTest(!0),ca.buffers.depth.setMask(!0),ca.buffers.color.setMask(!0),ca.setPolygonOffset(!1),ka.enabled&&ka.submitFrame(),z=C=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")};this.setFramebuffer=function(a){M=a};this.getRenderTarget=function(){return N};this.setRenderTarget=function(a,b,c){(N=a)&&void 0===Ba.get(a).__webglFramebuffer&&
+b);z.init();a.traverse(function(a){a.isLight&&(z.pushLight(a),a.castShadow&&z.pushShadow(a))});z.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=0;c<b.material.length;c++)q(b.material[c],a.fog,b);else q(b.material,a.fog,b)})};var xa=null,ta=new ae;ta.setAnimationLoop(function(a){oa.isPresenting()||xa&&xa(a)});"undefined"!==typeof window&&ta.setContext(window);this.setAnimationLoop=function(a){xa=a;oa.setAnimationLoop(a);ta.start()};this.render=function(a,
+c,d,e){if(void 0!==d){console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.");var f=d}if(void 0!==e){console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead.");var g=e}c&&c.isCamera?I||(O=b=null,da=!1,Q=-1,S=null,!0===a.autoUpdate&&a.updateMatrixWorld(),null===c.parent&&c.updateMatrixWorld(),oa.enabled&&(c=oa.getCamera(c)),z=qa.get(a,c),z.init(),a.onBeforeRender(fa,a,c,f||N),Fc.multiplyMatrices(c.projectionMatrix,
+c.matrixWorldInverse),ja.setFromMatrix(Fc),fe=this.localClippingEnabled,ha=aa.init(this.clippingPlanes,fe,c),C=ra.get(a,c),C.init(),k(a,c,0,fa.sortObjects),!0===fa.sortObjects&&C.sort(),ha&&aa.beginShadows(),za.render(z.state.shadowsArray,a,c),z.setupLights(c),ha&&aa.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==f&&this.setRenderTarget(f),la.render(C,a,c,g),d=C.opaque,e=C.transparent,a.overrideMaterial?(f=a.overrideMaterial,d.length&&m(d,a,c,f),e.length&&m(e,a,c,f)):(d.length&&m(d,
+a,c),e.length&&m(e,a,c)),a.onAfterRender(fa,a,c),null!==N&&(ba.updateRenderTargetMipmap(N),ba.updateMultisampleRenderTarget(N)),ca.buffers.depth.setTest(!0),ca.buffers.depth.setMask(!0),ca.buffers.color.setMask(!0),ca.setPolygonOffset(!1),oa.enabled&&oa.submitFrame(),z=C=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")};this.setFramebuffer=function(a){M=a};this.getRenderTarget=function(){return N};this.setRenderTarget=function(a,b,c){(N=a)&&void 0===Ba.get(a).__webglFramebuffer&&
 ba.setupRenderTarget(a);var d=M,e=!1;a?(d=Ba.get(a).__webglFramebuffer,a.isWebGLRenderTargetCube?(d=d[b||0],e=!0):d=a.isWebGLMultisampleRenderTarget?Ba.get(a).__webglMultisampledFramebuffer:d,R.copy(a.viewport),W.copy(a.scissor),V=a.scissorTest):(R.copy(Z).multiplyScalar(H),W.copy(Ha).multiplyScalar(H),V=ea);X!==d&&(L.bindFramebuffer(36160,d),X=d);ca.viewport(R);ca.scissor(W);ca.setScissorTest(V);e&&(a=Ba.get(a.texture),L.framebufferTexture2D(36160,36064,34069+(b||0),a.__webglTexture,c||0))};this.readRenderTargetPixels=
-function(a,b,c,d,e,f){if(a&&a.isWebGLRenderTarget){var g=Ba.get(a).__webglFramebuffer;if(g){var h=!1;g!==X&&(L.bindFramebuffer(36160,g),h=!0);try{var k=a.texture,m=k.format,p=k.type;1023!==m&&ia.convert(m)!==L.getParameter(35739)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):1009===p||ia.convert(p)===L.getParameter(35738)||1015===p&&(Aa.isWebGL2||na.get("OES_texture_float")||na.get("WEBGL_color_buffer_float"))||1016===p&&
-(Aa.isWebGL2?na.get("EXT_color_buffer_float"):na.get("EXT_color_buffer_half_float"))?36053===L.checkFramebufferStatus(36160)?0<=b&&b<=a.width-d&&0<=c&&c<=a.height-e&&L.readPixels(b,c,d,e,ia.convert(m),ia.convert(p),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&L.bindFramebuffer(36160,
+function(a,b,c,d,e,f){if(a&&a.isWebGLRenderTarget){var g=Ba.get(a).__webglFramebuffer;if(g){var h=!1;g!==X&&(L.bindFramebuffer(36160,g),h=!0);try{var k=a.texture,m=k.format,p=k.type;1023!==m&&ia.convert(m)!==L.getParameter(35739)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):1009===p||ia.convert(p)===L.getParameter(35738)||1015===p&&(Aa.isWebGL2||ma.get("OES_texture_float")||ma.get("WEBGL_color_buffer_float"))||1016===p&&
+(Aa.isWebGL2?ma.get("EXT_color_buffer_float"):ma.get("EXT_color_buffer_half_float"))?36053===L.checkFramebufferStatus(36160)?0<=b&&b<=a.width-d&&0<=c&&c<=a.height-e&&L.readPixels(b,c,d,e,ia.convert(m),ia.convert(p),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&L.bindFramebuffer(36160,
 X)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")};this.copyFramebufferToTexture=function(a,b,c){var d=b.image.width,e=b.image.height,f=ia.convert(b.format);ba.setTexture2D(b,0);L.copyTexImage2D(3553,c||0,f,a.x,a.y,d,e,0)};this.copyTextureToTexture=function(a,b,c,d){var e=b.image.width,f=b.image.height,g=ia.convert(c.format),h=ia.convert(c.type);ba.setTexture2D(c,0);b.isDataTexture?L.texSubImage2D(3553,d||0,a.x,a.y,e,f,g,h,b.image.data):
 L.texSubImage2D(3553,d||0,a.x,a.y,g,h,b.image)}}function yd(a,b){this.name="";this.color=new M(a);this.density=void 0!==b?b:2.5E-4}function zd(a,b,c){this.name="";this.color=new M(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3}function Ad(){C.call(this);this.type="Scene";this.overrideMaterial=this.fog=this.background=null;this.autoUpdate=!0}function xb(a,b){this.array=a;this.stride=b;this.count=void 0!==a?a.length/b:0;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function Hc(a,
 b,c,d){this.data=a;this.itemSize=b;this.offset=c;this.normalized=!0===d}function mb(a){O.call(this);this.type="SpriteMaterial";this.color=new M(16777215);this.map=null;this.rotation=0;this.sizeAttenuation=!0;this.lights=!1;this.transparent=!0;this.setValues(a)}function Ic(a){C.call(this);this.type="Sprite";if(void 0===Wb){Wb=new z;var b=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]);b=new xb(b,5);Wb.setIndex([0,1,2,0,2,3]);Wb.addAttribute("position",new Hc(b,3,0,!1));Wb.addAttribute("uv",
 new Hc(b,2,3,!1))}this.geometry=Wb;this.material=void 0!==a?a:new mb;this.center=new B(.5,.5)}function Jc(){C.call(this);this.type="LOD";Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Kc(a,b){a&&a.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");va.call(this,a,b);this.type="SkinnedMesh";this.bindMode="attached";this.bindMatrix=new P;this.bindMatrixInverse=new P}function Bd(a,b){a=a||[];this.bones=a.slice(0);
 this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[],a=0,b=this.bones.length;a<b;a++)this.boneInverses.push(new P)}function he(){C.call(this);this.type="Bone"}function R(a){O.call(this);this.type="LineBasicMaterial";this.color=new M(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.lights=
-!1;this.setValues(a)}function oa(a,b,c){1===c&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead.");C.call(this);this.type="Line";this.geometry=void 0!==a?a:new z;this.material=void 0!==b?b:new R({color:16777215*Math.random()})}function V(a,b){oa.call(this,a,b);this.type="LineSegments"}function Cd(a,b){oa.call(this,a,b);this.type="LineLoop"}function Ka(a){O.call(this);this.type="PointsMaterial";this.color=new M(16777215);this.map=null;this.size=
+!1;this.setValues(a)}function na(a,b,c){1===c&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead.");C.call(this);this.type="Line";this.geometry=void 0!==a?a:new z;this.material=void 0!==b?b:new R({color:16777215*Math.random()})}function V(a,b){na.call(this,a,b);this.type="LineSegments"}function Cd(a,b){na.call(this,a,b);this.type="LineLoop"}function Ka(a){O.call(this);this.type="PointsMaterial";this.color=new M(16777215);this.map=null;this.size=
 1;this.sizeAttenuation=!0;this.lights=this.morphTargets=!1;this.setValues(a)}function Xb(a,b){C.call(this);this.type="Points";this.geometry=void 0!==a?a:new z;this.material=void 0!==b?b:new Ka({color:16777215*Math.random()})}function ie(a,b,c,d,e,f,g,h,k){W.call(this,a,b,c,d,e,f,g,h,k);this.format=void 0!==g?g:1022;this.minFilter=void 0!==f?f:1006;this.magFilter=void 0!==e?e:1006;this.generateMipmaps=!1}function Yb(a,b,c,d,e,f,g,h,k,m,p,q){W.call(this,null,f,g,h,k,m,d,e,p,q);this.image={width:b,height:c};
 this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Lc(a,b,c,d,e,f,g,h,k){W.call(this,a,b,c,d,e,f,g,h,k);this.needsUpdate=!0}function Mc(a,b,c,d,e,f,g,h,k,m){m=void 0!==m?m:1026;if(1026!==m&&1027!==m)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===c&&1026===m&&(c=1012);void 0===c&&1027===m&&(c=1020);W.call(this,null,d,e,f,g,h,m,c,k);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==h?h:1003;this.generateMipmaps=
 this.flipY=!1}function Zb(a){z.call(this);this.type="WireframeGeometry";var b=[],c,d,e,f=[0,0],g={},h=["a","b","c"];if(a&&a.isGeometry){var k=a.faces;var m=0;for(d=k.length;m<d;m++){var p=k[m];for(c=0;3>c;c++){var q=p[h[c]];var l=p[h[(c+1)%3]];f[0]=Math.min(q,l);f[1]=Math.max(q,l);q=f[0]+","+f[1];void 0===g[q]&&(g[q]={index1:f[0],index2:f[1]})}}for(q in g)m=g[q],h=a.vertices[m.index1],b.push(h.x,h.y,h.z),h=a.vertices[m.index2],b.push(h.x,h.y,h.z)}else if(a&&a.isBufferGeometry)if(h=new n,null!==a.index){k=
 a.attributes.position;p=a.index;var t=a.groups;0===t.length&&(t=[{start:0,count:p.count,materialIndex:0}]);a=0;for(e=t.length;a<e;++a)for(m=t[a],c=m.start,d=m.count,m=c,d=c+d;m<d;m+=3)for(c=0;3>c;c++)q=p.getX(m+c),l=p.getX(m+(c+1)%3),f[0]=Math.min(q,l),f[1]=Math.max(q,l),q=f[0]+","+f[1],void 0===g[q]&&(g[q]={index1:f[0],index2:f[1]});for(q in g)m=g[q],h.fromBufferAttribute(k,m.index1),b.push(h.x,h.y,h.z),h.fromBufferAttribute(k,m.index2),b.push(h.x,h.y,h.z)}else for(k=a.attributes.position,m=0,d=
 k.count/3;m<d;m++)for(c=0;3>c;c++)g=3*m+c,h.fromBufferAttribute(k,g),b.push(h.x,h.y,h.z),g=3*m+(c+1)%3,h.fromBufferAttribute(k,g),b.push(h.x,h.y,h.z);this.addAttribute("position",new E(b,3))}function Nc(a,b,c){N.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new $b(a,b,c));this.mergeVertices()}function $b(a,b,c){z.call(this);this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],h=new n,
 k=new n,m=new n,p=new n,q=new n,l,t;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var r=b+1;for(l=0;l<=c;l++){var u=l/c;for(t=0;t<=b;t++){var x=t/b;a(x,u,k);e.push(k.x,k.y,k.z);0<=x-1E-5?(a(x-1E-5,u,m),p.subVectors(k,m)):(a(x+1E-5,u,m),p.subVectors(m,k));0<=u-1E-5?(a(x,u-1E-5,m),q.subVectors(k,m)):(a(x,u+1E-5,m),q.subVectors(m,k));h.crossVectors(p,q).normalize();f.push(h.x,h.y,h.z);g.push(x,u)}}for(l=0;l<c;l++)for(t=0;t<b;t++)a=l*r+t+
-1,h=(l+1)*r+t+1,k=(l+1)*r+t,d.push(l*r+t,a,k),d.push(a,h,k);this.setIndex(d);this.addAttribute("position",new E(e,3));this.addAttribute("normal",new E(f,3));this.addAttribute("uv",new E(g,2))}function Oc(a,b,c,d){N.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};this.fromBufferGeometry(new ka(a,b,c,d));this.mergeVertices()}function ka(a,b,c,d){function e(a){h.push(a.x,a.y,a.z)}function f(b,c){b*=3;c.x=a[b+0];c.y=a[b+1];c.z=a[b+2]}function g(a,b,c,
+1,h=(l+1)*r+t+1,k=(l+1)*r+t,d.push(l*r+t,a,k),d.push(a,h,k);this.setIndex(d);this.addAttribute("position",new E(e,3));this.addAttribute("normal",new E(f,3));this.addAttribute("uv",new E(g,2))}function Oc(a,b,c,d){N.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};this.fromBufferGeometry(new oa(a,b,c,d));this.mergeVertices()}function oa(a,b,c,d){function e(a){h.push(a.x,a.y,a.z)}function f(b,c){b*=3;c.x=a[b+0];c.y=a[b+1];c.z=a[b+2]}function g(a,b,c,
 d){0>d&&1===a.x&&(k[b]=a.x-1);0===c.x&&0===c.z&&(k[b]=d/2/Math.PI+.5)}z.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;var h=[],k=[];(function(a){for(var c=new n,d=new n,g=new n,h=0;h<b.length;h+=3){f(b[h+0],c);f(b[h+1],d);f(b[h+2],g);var k,m,l=c,A=d,w=g,y=Math.pow(2,a),D=[];for(m=0;m<=y;m++){D[m]=[];var J=l.clone().lerp(w,m/y),B=A.clone().lerp(w,m/y),F=y-m;for(k=0;k<=F;k++)D[m][k]=0===k&&m===y?J:J.clone().lerp(B,k/F)}for(m=0;m<
 y;m++)for(k=0;k<2*(y-m)-1;k++)l=Math.floor(k/2),0===k%2?(e(D[m][l+1]),e(D[m+1][l]),e(D[m][l])):(e(D[m][l+1]),e(D[m+1][l+1]),e(D[m+1][l]))}})(d);(function(a){for(var b=new n,c=0;c<h.length;c+=3)b.x=h[c+0],b.y=h[c+1],b.z=h[c+2],b.normalize().multiplyScalar(a),h[c+0]=b.x,h[c+1]=b.y,h[c+2]=b.z})(c);(function(){for(var a=new n,b=0;b<h.length;b+=3)a.x=h[b+0],a.y=h[b+1],a.z=h[b+2],k.push(Math.atan2(a.z,-a.x)/2/Math.PI+.5,1-(Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5));a=new n;b=new n;for(var c=
 new n,d=new n,e=new B,f=new B,l=new B,x=0,A=0;x<h.length;x+=9,A+=6){a.set(h[x+0],h[x+1],h[x+2]);b.set(h[x+3],h[x+4],h[x+5]);c.set(h[x+6],h[x+7],h[x+8]);e.set(k[A+0],k[A+1]);f.set(k[A+2],k[A+3]);l.set(k[A+4],k[A+5]);d.copy(a).add(b).add(c).divideScalar(3);var w=Math.atan2(d.z,-d.x);g(e,A+0,a,w);g(f,A+2,b,w);g(l,A+4,c,w)}for(a=0;a<k.length;a+=6)b=k[a+0],c=k[a+2],d=k[a+4],e=Math.min(b,c,d),.9<Math.max(b,c,d)&&.1>e&&(.2>b&&(k[a+0]+=1),.2>c&&(k[a+2]+=1),.2>d&&(k[a+4]+=1))})();this.addAttribute("position",
-new E(h,3));this.addAttribute("normal",new E(h.slice(),3));this.addAttribute("uv",new E(k,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Pc(a,b){N.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ac(a,b));this.mergeVertices()}function ac(a,b){ka.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Qc(a,b){N.call(this);
-this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new yb(a,b));this.mergeVertices()}function yb(a,b){ka.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Rc(a,b){N.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new bc(a,b));this.mergeVertices()}function bc(a,b){var c=
-(1+Math.sqrt(5))/2;ka.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Sc(a,b){N.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new cc(a,b));this.mergeVertices()}function cc(a,b){var c=
-(1+Math.sqrt(5))/2,d=1/c;ka.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b);this.type="DodecahedronBufferGeometry";this.parameters=
+new E(h,3));this.addAttribute("normal",new E(h.slice(),3));this.addAttribute("uv",new E(k,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Pc(a,b){N.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ac(a,b));this.mergeVertices()}function ac(a,b){oa.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Qc(a,b){N.call(this);
+this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new yb(a,b));this.mergeVertices()}function yb(a,b){oa.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Rc(a,b){N.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new bc(a,b));this.mergeVertices()}function bc(a,b){var c=
+(1+Math.sqrt(5))/2;oa.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Sc(a,b){N.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new cc(a,b));this.mergeVertices()}function cc(a,b){var c=
+(1+Math.sqrt(5))/2,d=1/c;oa.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b);this.type="DodecahedronBufferGeometry";this.parameters=
 {radius:a,detail:b}}function Tc(a,b,c,d,e,f){N.call(this);this.type="TubeGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new zb(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function zb(a,b,c,d,e){function f(e){p=a.getPointAt(e/b,p);var f=g.normals[e];e=g.binormals[e];for(l=0;l<=d;l++){var m=l/d*Math.PI*
 2,q=Math.sin(m);m=-Math.cos(m);k.x=m*f.x+q*e.x;k.y=m*f.y+q*e.y;k.z=m*f.z+q*e.z;k.normalize();r.push(k.x,k.y,k.z);h.x=p.x+c*k.x;h.y=p.y+c*k.y;h.z=p.z+c*k.z;t.push(h.x,h.y,h.z)}}z.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new n,k=new n,m=new B,p=new n,q,l,t=[],r=[],u=[],x=[];for(q=
 0;q<b;q++)f(q);f(!1===e?b:0);for(q=0;q<=b;q++)for(l=0;l<=d;l++)m.x=q/b,m.y=l/d,u.push(m.x,m.y);(function(){for(l=1;l<=b;l++)for(q=1;q<=d;q++){var a=(d+1)*l+(q-1),c=(d+1)*l+q,e=(d+1)*(l-1)+q;x.push((d+1)*(l-1)+(q-1),a,e);x.push(a,c,e)}})();this.setIndex(x);this.addAttribute("position",new E(t,3));this.addAttribute("normal",new E(r,3));this.addAttribute("uv",new E(u,2))}function Uc(a,b,c,d,e,f,g){N.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,tubularSegments:c,radialSegments:d,
@@ -273,8 +273,8 @@ this.defines={PHYSICAL:""};this.type="MeshPhysicalMaterial";this.reflectivity=.5
 function Jb(a){O.call(this);this.type="MeshNormalMaterial";this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=0;this.normalScale=new B(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.lights=this.fog=!1;this.setValues(a)}function Kb(a){O.call(this);this.type="MeshLambertMaterial";this.color=new M(16777215);this.lightMap=this.map=null;this.lightMapIntensity=
 1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new M(0);this.emissiveIntensity=1;this.envMap=this.alphaMap=this.specularMap=this.emissiveMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function Lb(a){O.call(this);this.defines={MATCAP:""};this.type="MeshMatcapMaterial";this.color=new M(16777215);this.bumpMap=
 this.map=this.matcap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=0;this.normalScale=new B(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.alphaMap=null;this.lights=this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function Mb(a){R.call(this);this.type="LineDashedMaterial";this.scale=1;this.dashSize=3;this.gapSize=1;this.setValues(a)}function Fa(a,b,c,d){this.parameterPositions=a;this._cachedIndex=0;this.resultBuffer=void 0!==
-d?d:new b.constructor(c);this.sampleValues=b;this.valueSize=c}function Ed(a,b,c,d){Fa.call(this,a,b,c,d);this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0}function gd(a,b,c,d){Fa.call(this,a,b,c,d)}function Fd(a,b,c,d){Fa.call(this,a,b,c,d)}function la(a,b,c,d){if(void 0===a)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===b||0===b.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+a);this.name=a;this.times=pa.convertArray(b,this.TimeBufferType);
-this.values=pa.convertArray(c,this.ValueBufferType);this.setInterpolation(d||this.DefaultInterpolation)}function Gd(a,b,c){la.call(this,a,b,c)}function Hd(a,b,c,d){la.call(this,a,b,c,d)}function lc(a,b,c,d){la.call(this,a,b,c,d)}function Id(a,b,c,d){Fa.call(this,a,b,c,d)}function hd(a,b,c,d){la.call(this,a,b,c,d)}function Jd(a,b,c,d){la.call(this,a,b,c,d)}function mc(a,b,c,d){la.call(this,a,b,c,d)}function Ia(a,b,c){this.name=a;this.tracks=c;this.duration=void 0!==b?b:-1;this.uuid=K.generateUUID();
+d?d:new b.constructor(c);this.sampleValues=b;this.valueSize=c}function Ed(a,b,c,d){Fa.call(this,a,b,c,d);this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0}function gd(a,b,c,d){Fa.call(this,a,b,c,d)}function Fd(a,b,c,d){Fa.call(this,a,b,c,d)}function ka(a,b,c,d){if(void 0===a)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===b||0===b.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+a);this.name=a;this.times=pa.convertArray(b,this.TimeBufferType);
+this.values=pa.convertArray(c,this.ValueBufferType);this.setInterpolation(d||this.DefaultInterpolation)}function Gd(a,b,c){ka.call(this,a,b,c)}function Hd(a,b,c,d){ka.call(this,a,b,c,d)}function lc(a,b,c,d){ka.call(this,a,b,c,d)}function Id(a,b,c,d){Fa.call(this,a,b,c,d)}function hd(a,b,c,d){ka.call(this,a,b,c,d)}function Jd(a,b,c,d){ka.call(this,a,b,c,d)}function mc(a,b,c,d){ka.call(this,a,b,c,d)}function Ia(a,b,c){this.name=a;this.tracks=c;this.duration=void 0!==b?b:-1;this.uuid=K.generateUUID();
 0>this.duration&&this.resetDuration()}function ih(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return lc;case "vector":case "vector2":case "vector3":case "vector4":return mc;case "color":return Hd;case "quaternion":return hd;case "bool":case "boolean":return Gd;case "string":return Jd}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a);}function jh(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");
 var b=ih(a.type);if(void 0===a.times){var c=[],d=[];pa.flattenJSON(a.keys,c,d,"value");a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name,a.times,a.values,a.interpolation)}function le(a,b,c){var d=this,e=!1,f=0,g=0,h=void 0;this.onStart=void 0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){g++;if(!1===e&&void 0!==d.onStart)d.onStart(a,f,g);e=!0};this.itemEnd=function(a){f++;if(void 0!==d.onProgress)d.onProgress(a,f,g);if(f===g&&(e=!1,void 0!==d.onLoad))d.onLoad()};
 this.itemError=function(a){if(void 0!==d.onError)d.onError(a)};this.resolveURL=function(a){return h?h(a):a};this.setURLModifier=function(a){h=a;return this}}function Ma(a){this.manager=void 0!==a?a:za}function Df(a){this.manager=void 0!==a?a:za}function Ef(a){this.manager=void 0!==a?a:za;this._parser=null}function me(a){this.manager=void 0!==a?a:za;this._parser=null}function id(a){this.manager=void 0!==a?a:za}function ne(a){this.manager=void 0!==a?a:za}function Kd(a){this.manager=void 0!==a?a:za}
@@ -292,7 +292,7 @@ function ue(a){this.manager=void 0!==a?a:za}function Hf(){this.type="StereoCamer
 d=this.renderTarget,p=d.texture.generateMipmaps;d.texture.generateMipmaps=!1;a.setRenderTarget(d,0);a.render(b,e);a.setRenderTarget(d,1);a.render(b,f);a.setRenderTarget(d,2);a.render(b,g);a.setRenderTarget(d,3);a.render(b,h);a.setRenderTarget(d,4);a.render(b,k);d.texture.generateMipmaps=p;a.setRenderTarget(d,5);a.render(b,m);a.setRenderTarget(c)};this.clear=function(a,b,c,d){for(var e=a.getRenderTarget(),f=this.renderTarget,g=0;6>g;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function ve(a){this.autoStart=
 void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function we(){C.call(this);this.type="AudioListener";this.context=xe.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0}function oc(a){C.call(this);this.type="Audio";this.listener=a;this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.detune=0;this.loop=!1;this.offset=
 this.startTime=0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function ye(a){oc.call(this,a);this.panner=this.context.createPanner();this.panner.connect(this.gain)}function ze(a,b){this.analyser=a.context.createAnalyser();this.analyser.fftSize=void 0!==b?b:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);a.getOutput().connect(this.analyser)}function Ae(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch(b){case "quaternion":b=
-this._slerp;break;case "string":case "bool":a=Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount=this.useCount=this.cumulativeWeight=0}function If(a,b,c){c=c||ma.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function ma(a,b,c){this.path=b;this.parsedPath=c||ma.parseTrackName(b);this.node=ma.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function Jf(){this.uuid=K.generateUUID();this._objects=Array.prototype.slice.call(arguments);
+this._slerp;break;case "string":case "bool":a=Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount=this.useCount=this.cumulativeWeight=0}function If(a,b,c){c=c||la.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function la(a,b,c){this.path=b;this.parsedPath=c||la.parseTrackName(b);this.node=la.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function Jf(){this.uuid=K.generateUUID();this._objects=Array.prototype.slice.call(arguments);
 this.nCachedObjects_=0;var a={};this._indicesByUUID=a;for(var b=0,c=arguments.length;b!==c;++b)a[arguments[b].uuid]=b;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var d=this;this.stats={objects:{get total(){return d._objects.length},get inUse(){return this.total-d.nCachedObjects_}},get bindingsPerObject(){return d._bindings.length}}}function Kf(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=b.tracks;b=a.length;c=Array(b);for(var d={endingStart:2400,
 endingEnd:2400},e=0;e!==b;++e){var f=a[e].createInterpolant(null);c[e]=f;f.settings=d}this._interpolantSettings=d;this._interpolants=c;this._propertyBindings=Array(b);this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null;this.loop=2201;this._loopCount=-1;this._startTime=null;this.time=0;this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1;this.repetitions=Infinity;this.paused=!1;this.enabled=!0;this.clampWhenFinished=!1;this.zeroSlopeAtEnd=
 this.zeroSlopeAtStart=!0}function Be(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function Ud(a,b){"string"===typeof a&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),a=b);this.value=a}function Ce(){z.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0}function De(a,b,c){xb.call(this,a,b);this.meshPerAttribute=c||1}function Ee(a,b,c,d){"number"===typeof c&&(d=c,c=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument."));
@@ -301,17 +301,17 @@ a.length;d<e;d++)Fe(a[d],b,c,!0)}}function Nf(a,b,c){this.radius=void 0!==a?a:1;
 function pd(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16711680;d=void 0!==d?d:1;b=0;(c=this.object.geometry)&&c.isGeometry?b=3*c.faces.length:c&&c.isBufferGeometry&&(b=c.attributes.normal.count);c=new z;b=new E(6*b,3);c.addAttribute("position",b);V.call(this,c,new R({color:a,linewidth:d}));this.matrixAutoUpdate=!1;this.update()}function pc(a,b){C.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=b;a=new z;b=[0,
 0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(var c=0,d=1;32>c;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}a.addAttribute("position",new E(b,3));b=new R({fog:!1});this.cone=new V(a,b);this.add(this.cone);this.update()}function Pf(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;c<a.children.length;c++)b.push.apply(b,Pf(a.children[c]));return b}function qc(a){for(var b=Pf(a),c=new z,d=[],e=[],f=new M(0,0,1),g=new M(0,1,
 0),h=0;h<b.length;h++){var k=b[h];k.parent&&k.parent.isBone&&(d.push(0,0,0),d.push(0,0,0),e.push(f.r,f.g,f.b),e.push(g.r,g.g,g.b))}c.addAttribute("position",new E(d,3));c.addAttribute("color",new E(e,3));d=new R({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});V.call(this,c,d);this.root=a;this.bones=b;this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1}function rc(a,b,c){this.light=a;this.light.updateMatrixWorld();this.color=c;a=new Cb(b,4,2);b=new Da({wireframe:!0,fog:!1});va.call(this,
-a,b);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1;this.update()}function sc(a,b){this.type="RectAreaLightHelper";this.light=a;this.color=b;a=new z;a.addAttribute("position",new E([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3));a.computeBoundingSphere();b=new R({fog:!1});oa.call(this,a,b);a=new z;a.addAttribute("position",new E([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3));a.computeBoundingSphere();this.add(new va(a,new Da({side:1,fog:!1})));this.update()}function tc(a,b,c){C.call(this);this.light=
+a,b);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1;this.update()}function sc(a,b){this.type="RectAreaLightHelper";this.light=a;this.color=b;a=new z;a.addAttribute("position",new E([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3));a.computeBoundingSphere();b=new R({fog:!1});na.call(this,a,b);a=new z;a.addAttribute("position",new E([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3));a.computeBoundingSphere();this.add(new va(a,new Da({side:1,fog:!1})));this.update()}function tc(a,b,c){C.call(this);this.light=
 a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=c;a=new yb(b);a.rotateY(.5*Math.PI);this.material=new Da({wireframe:!0,fog:!1});void 0===this.color&&(this.material.vertexColors=2);b=a.getAttribute("position");b=new Float32Array(3*b.count);a.addAttribute("color",new S(b,3));this.add(new va(a,this.material));this.update()}function Vd(a,b,c,d){a=a||10;b=b||10;c=new M(void 0!==c?c:4473924);d=new M(void 0!==d?d:8947848);var e=b/2,f=a/b,g=a/2;a=[];for(var h=
 [],k=0,m=0,p=-g;k<=b;k++,p+=f){a.push(-g,0,p,g,0,p);a.push(p,0,-g,p,0,g);var l=k===e?c:d;l.toArray(h,m);m+=3;l.toArray(h,m);m+=3;l.toArray(h,m);m+=3;l.toArray(h,m);m+=3}b=new z;b.addAttribute("position",new E(a,3));b.addAttribute("color",new E(h,3));c=new R({vertexColors:2});V.call(this,b,c)}function Wd(a,b,c,d,e,f){a=a||10;b=b||16;c=c||8;d=d||64;e=new M(void 0!==e?e:4473924);f=new M(void 0!==f?f:8947848);var g=[],h=[],k;for(k=0;k<=b;k++){var m=k/b*2*Math.PI;var p=Math.sin(m)*a;m=Math.cos(m)*a;g.push(0,
 0,0);g.push(p,0,m);var l=k&1?e:f;h.push(l.r,l.g,l.b);h.push(l.r,l.g,l.b)}for(k=0;k<=c;k++){l=k&1?e:f;var n=a-a/c*k;for(b=0;b<d;b++)m=b/d*2*Math.PI,p=Math.sin(m)*n,m=Math.cos(m)*n,g.push(p,0,m),h.push(l.r,l.g,l.b),m=(b+1)/d*2*Math.PI,p=Math.sin(m)*n,m=Math.cos(m)*n,g.push(p,0,m),h.push(l.r,l.g,l.b)}a=new z;a.addAttribute("position",new E(g,3));a.addAttribute("color",new E(h,3));g=new R({vertexColors:2});V.call(this,a,g)}function uc(a,b,c,d){this.audio=a;this.range=b||1;this.divisionsInnerAngle=c||
-16;this.divisionsOuterAngle=d||2;a=new z;b=new Float32Array(3*(3*(this.divisionsInnerAngle+2*this.divisionsOuterAngle)+3));a.addAttribute("position",new S(b,3));b=new R({color:65280});c=new R({color:16776960});oa.call(this,a,[c,b]);this.update()}function qd(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=0;(c=this.object.geometry)&&c.isGeometry?b=c.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
-c=new z;b=new E(6*b,3);c.addAttribute("position",b);V.call(this,c,new R({color:a,linewidth:d}));this.matrixAutoUpdate=!1;this.update()}function vc(a,b,c){C.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=c;void 0===b&&(b=1);a=new z;a.addAttribute("position",new E([-b,b,0,b,b,0,b,-b,0,-b,-b,0,-b,b,0],3));b=new R({fog:!1});this.lightPlane=new oa(a,b);this.add(this.lightPlane);a=new z;a.addAttribute("position",new E([0,0,0,0,0,1],3));
-this.targetLine=new oa(a,b);this.add(this.targetLine);this.update()}function rd(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){f.push(0,0,0);g.push(b.r,b.g,b.b);void 0===h[a]&&(h[a]=[]);h[a].push(f.length/3-1)}var d=new z,e=new R({color:16777215,vertexColors:1}),f=[],g=[],h={},k=new M(16755200),m=new M(16711680),p=new M(43775),l=new M(16777215),n=new M(3355443);b("n1","n2",k);b("n2","n4",k);b("n4","n3",k);b("n3","n1",k);b("f1","f2",k);b("f2","f4",k);b("f4","f3",k);b("f3","f1",k);b("n1","f1",k);
+16;this.divisionsOuterAngle=d||2;a=new z;b=new Float32Array(3*(3*(this.divisionsInnerAngle+2*this.divisionsOuterAngle)+3));a.addAttribute("position",new S(b,3));b=new R({color:65280});c=new R({color:16776960});na.call(this,a,[c,b]);this.update()}function qd(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=0;(c=this.object.geometry)&&c.isGeometry?b=c.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
+c=new z;b=new E(6*b,3);c.addAttribute("position",b);V.call(this,c,new R({color:a,linewidth:d}));this.matrixAutoUpdate=!1;this.update()}function vc(a,b,c){C.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=c;void 0===b&&(b=1);a=new z;a.addAttribute("position",new E([-b,b,0,b,b,0,b,-b,0,-b,-b,0,-b,b,0],3));b=new R({fog:!1});this.lightPlane=new na(a,b);this.add(this.lightPlane);a=new z;a.addAttribute("position",new E([0,0,0,0,0,1],3));
+this.targetLine=new na(a,b);this.add(this.targetLine);this.update()}function rd(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){f.push(0,0,0);g.push(b.r,b.g,b.b);void 0===h[a]&&(h[a]=[]);h[a].push(f.length/3-1)}var d=new z,e=new R({color:16777215,vertexColors:1}),f=[],g=[],h={},k=new M(16755200),m=new M(16711680),p=new M(43775),l=new M(16777215),n=new M(3355443);b("n1","n2",k);b("n2","n4",k);b("n4","n3",k);b("n3","n1",k);b("f1","f2",k);b("f2","f4",k);b("f4","f3",k);b("f3","f1",k);b("n1","f1",k);
 b("n2","f2",k);b("n3","f3",k);b("n4","f4",k);b("p","n1",m);b("p","n2",m);b("p","n3",m);b("p","n4",m);b("u1","u2",p);b("u2","u3",p);b("u3","u1",p);b("c","t",l);b("p","c",n);b("cn1","cn2",n);b("cn3","cn4",n);b("cf1","cf2",n);b("cf3","cf4",n);d.addAttribute("position",new E(f,3));d.addAttribute("color",new E(g,3));V.call(this,d,e);this.camera=a;this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=h;this.update()}function fb(a,
 b){this.object=a;void 0===b&&(b=16776960);a=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);var c=new Float32Array(24),d=new z;d.setIndex(new S(a,1));d.addAttribute("position",new S(c,3));V.call(this,d,new R({color:b}));this.matrixAutoUpdate=!1;this.update()}function sd(a,b){this.type="Box3Helper";this.box=a;a=void 0!==b?b:16776960;b=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);var c=new z;c.setIndex(new S(b,1));c.addAttribute("position",new E([1,1,1,-1,1,
-1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3));V.call(this,c,new R({color:a}));this.geometry.computeBoundingSphere()}function td(a,b,c){this.type="PlaneHelper";this.plane=a;this.size=void 0===b?1:b;a=void 0!==c?c:16776960;b=new z;b.addAttribute("position",new E([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3));b.computeBoundingSphere();oa.call(this,b,new R({color:a}));b=new z;b.addAttribute("position",new E([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3));b.computeBoundingSphere();
-this.add(new va(b,new Da({color:a,opacity:.2,transparent:!0,depthWrite:!1})))}function gb(a,b,c,d,e,f){C.call(this);void 0===a&&(a=new n(0,0,1));void 0===b&&(b=new n(0,0,0));void 0===c&&(c=1);void 0===d&&(d=16776960);void 0===e&&(e=.2*c);void 0===f&&(f=.2*e);void 0===Xd&&(Xd=new z,Xd.addAttribute("position",new E([0,0,0,0,1,0],3)),Ie=new db(0,.5,1,5,1),Ie.translate(0,-.5,0));this.position.copy(b);this.line=new oa(Xd,new R({color:d}));this.line.matrixAutoUpdate=!1;this.add(this.line);this.cone=new va(Ie,
+1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3));V.call(this,c,new R({color:a}));this.geometry.computeBoundingSphere()}function td(a,b,c){this.type="PlaneHelper";this.plane=a;this.size=void 0===b?1:b;a=void 0!==c?c:16776960;b=new z;b.addAttribute("position",new E([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3));b.computeBoundingSphere();na.call(this,b,new R({color:a}));b=new z;b.addAttribute("position",new E([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3));b.computeBoundingSphere();
+this.add(new va(b,new Da({color:a,opacity:.2,transparent:!0,depthWrite:!1})))}function gb(a,b,c,d,e,f){C.call(this);void 0===a&&(a=new n(0,0,1));void 0===b&&(b=new n(0,0,0));void 0===c&&(c=1);void 0===d&&(d=16776960);void 0===e&&(e=.2*c);void 0===f&&(f=.2*e);void 0===Xd&&(Xd=new z,Xd.addAttribute("position",new E([0,0,0,0,1,0],3)),Ie=new db(0,.5,1,5,1),Ie.translate(0,-.5,0));this.position.copy(b);this.line=new na(Xd,new R({color:d}));this.line.matrixAutoUpdate=!1;this.add(this.line);this.cone=new va(Ie,
 new Da({color:d}));this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(a);this.setLength(c,e,f)}function ud(a){a=a||1;var b=[0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a];a=new z;a.addAttribute("position",new E(b,3));a.addAttribute("color",new E([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));b=new R({vertexColors:2});V.call(this,a,b)}function Qf(a){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.");qa.call(this,a);this.type="catmullrom";this.closed=
 !0}function Rf(a){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.");qa.call(this,a);this.type="catmullrom"}function Je(a){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.");qa.call(this,a);this.type="catmullrom"}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52));void 0===Number.isInteger&&(Number.isInteger=function(a){return"number"===typeof a&&isFinite(a)&&Math.floor(a)===a});void 0===Math.sign&&(Math.sign=function(a){return 0>
 a?-1:0<a?1:+a});!1==="name"in Function.prototype&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}});void 0===Object.assign&&function(){Object.assign=function(a){if(void 0===a||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var d=arguments[c];if(void 0!==d&&null!==d)for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&(b[e]=d[e])}return b}}();
@@ -591,18 +591,18 @@ c=a.attributes;for(g in c)this.addAttribute(g,c[g].clone());var d=a.morphAttribu
 return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Rb.prototype=Object.create(N.prototype);Rb.prototype.constructor=Rb;ub.prototype=Object.create(z.prototype);ub.prototype.constructor=ub;Dc.prototype=Object.create(N.prototype);Dc.prototype.constructor=Dc;vb.prototype=Object.create(z.prototype);vb.prototype.constructor=vb;var $f=0;O.prototype=Object.assign(Object.create(ta.prototype),{constructor:O,isMaterial:!0,onBeforeCompile:function(){},setValues:function(a){if(void 0!==a)for(var b in a){var c=
 a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if("shading"===b)console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===c?!0:!1;else{var d=this[b];void 0===d?console.warn("THREE."+this.type+": '"+b+"' is not a property of this material."):d&&d.isColor?d.set(c):d&&d.isVector3&&c&&c.isVector3?d.copy(c):this[b]=c}}},toJSON:function(a){function b(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;
 b.push(d)}return b}var c=void 0===a||"string"===typeof a;c&&(a={textures:{},images:{}});var d={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};d.uuid=this.uuid;d.type=this.type;""!==this.name&&(d.name=this.name);this.color&&this.color.isColor&&(d.color=this.color.getHex());void 0!==this.roughness&&(d.roughness=this.roughness);void 0!==this.metalness&&(d.metalness=this.metalness);this.emissive&&this.emissive.isColor&&(d.emissive=this.emissive.getHex());1!==this.emissiveIntensity&&
-(d.emissiveIntensity=this.emissiveIntensity);this.specular&&this.specular.isColor&&(d.specular=this.specular.getHex());void 0!==this.shininess&&(d.shininess=this.shininess);void 0!==this.clearCoat&&(d.clearCoat=this.clearCoat);void 0!==this.clearCoatRoughness&&(d.clearCoatRoughness=this.clearCoatRoughness);this.map&&this.map.isTexture&&(d.map=this.map.toJSON(a).uuid);this.alphaMap&&this.alphaMap.isTexture&&(d.alphaMap=this.alphaMap.toJSON(a).uuid);this.lightMap&&this.lightMap.isTexture&&(d.lightMap=
-this.lightMap.toJSON(a).uuid);this.aoMap&&this.aoMap.isTexture&&(d.aoMap=this.aoMap.toJSON(a).uuid,d.aoMapIntensity=this.aoMapIntensity);this.bumpMap&&this.bumpMap.isTexture&&(d.bumpMap=this.bumpMap.toJSON(a).uuid,d.bumpScale=this.bumpScale);this.normalMap&&this.normalMap.isTexture&&(d.normalMap=this.normalMap.toJSON(a).uuid,d.normalMapType=this.normalMapType,d.normalScale=this.normalScale.toArray());this.displacementMap&&this.displacementMap.isTexture&&(d.displacementMap=this.displacementMap.toJSON(a).uuid,
-d.displacementScale=this.displacementScale,d.displacementBias=this.displacementBias);this.roughnessMap&&this.roughnessMap.isTexture&&(d.roughnessMap=this.roughnessMap.toJSON(a).uuid);this.metalnessMap&&this.metalnessMap.isTexture&&(d.metalnessMap=this.metalnessMap.toJSON(a).uuid);this.emissiveMap&&this.emissiveMap.isTexture&&(d.emissiveMap=this.emissiveMap.toJSON(a).uuid);this.specularMap&&this.specularMap.isTexture&&(d.specularMap=this.specularMap.toJSON(a).uuid);this.envMap&&this.envMap.isTexture&&
-(d.envMap=this.envMap.toJSON(a).uuid,d.reflectivity=this.reflectivity,void 0!==this.combine&&(d.combine=this.combine),void 0!==this.envMapIntensity&&(d.envMapIntensity=this.envMapIntensity));this.gradientMap&&this.gradientMap.isTexture&&(d.gradientMap=this.gradientMap.toJSON(a).uuid);void 0!==this.size&&(d.size=this.size);void 0!==this.sizeAttenuation&&(d.sizeAttenuation=this.sizeAttenuation);1!==this.blending&&(d.blending=this.blending);!0===this.flatShading&&(d.flatShading=this.flatShading);0!==
-this.side&&(d.side=this.side);0!==this.vertexColors&&(d.vertexColors=this.vertexColors);1>this.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);d.depthFunc=this.depthFunc;d.depthTest=this.depthTest;d.depthWrite=this.depthWrite;0!==this.rotation&&(d.rotation=this.rotation);!0===this.polygonOffset&&(d.polygonOffset=!0);0!==this.polygonOffsetFactor&&(d.polygonOffsetFactor=this.polygonOffsetFactor);0!==this.polygonOffsetUnits&&(d.polygonOffsetUnits=this.polygonOffsetUnits);
-1!==this.linewidth&&(d.linewidth=this.linewidth);void 0!==this.dashSize&&(d.dashSize=this.dashSize);void 0!==this.gapSize&&(d.gapSize=this.gapSize);void 0!==this.scale&&(d.scale=this.scale);!0===this.dithering&&(d.dithering=!0);0<this.alphaTest&&(d.alphaTest=this.alphaTest);!0===this.premultipliedAlpha&&(d.premultipliedAlpha=this.premultipliedAlpha);!0===this.wireframe&&(d.wireframe=this.wireframe);1<this.wireframeLinewidth&&(d.wireframeLinewidth=this.wireframeLinewidth);"round"!==this.wireframeLinecap&&
-(d.wireframeLinecap=this.wireframeLinecap);"round"!==this.wireframeLinejoin&&(d.wireframeLinejoin=this.wireframeLinejoin);!0===this.morphTargets&&(d.morphTargets=!0);!0===this.skinning&&(d.skinning=!0);!1===this.visible&&(d.visible=!1);"{}"!==JSON.stringify(this.userData)&&(d.userData=this.userData);c&&(c=b(a.textures),a=b(a.images),0<c.length&&(d.textures=c),0<a.length&&(d.images=a));return d},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.name=a.name;this.fog=a.fog;
-this.lights=a.lights;this.blending=a.blending;this.side=a.side;this.flatShading=a.flatShading;this.vertexColors=a.vertexColors;this.opacity=a.opacity;this.transparent=a.transparent;this.blendSrc=a.blendSrc;this.blendDst=a.blendDst;this.blendEquation=a.blendEquation;this.blendSrcAlpha=a.blendSrcAlpha;this.blendDstAlpha=a.blendDstAlpha;this.blendEquationAlpha=a.blendEquationAlpha;this.depthFunc=a.depthFunc;this.depthTest=a.depthTest;this.depthWrite=a.depthWrite;this.colorWrite=a.colorWrite;this.precision=
-a.precision;this.polygonOffset=a.polygonOffset;this.polygonOffsetFactor=a.polygonOffsetFactor;this.polygonOffsetUnits=a.polygonOffsetUnits;this.dithering=a.dithering;this.alphaTest=a.alphaTest;this.premultipliedAlpha=a.premultipliedAlpha;this.visible=a.visible;this.userData=JSON.parse(JSON.stringify(a.userData));this.clipShadows=a.clipShadows;this.clipIntersection=a.clipIntersection;var b=a.clippingPlanes,c=null;if(null!==b){var d=b.length;c=Array(d);for(var e=0;e!==d;++e)c[e]=b[e].clone()}this.clippingPlanes=
-c;this.shadowSide=a.shadowSide;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Ca.prototype=Object.create(O.prototype);Ca.prototype.constructor=Ca;Ca.prototype.isShaderMaterial=!0;Ca.prototype.copy=function(a){O.prototype.copy.call(this,a);this.fragmentShader=a.fragmentShader;this.vertexShader=a.vertexShader;this.uniforms=Pb(a.uniforms);this.defines=Object.assign({},a.defines);this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.lights=a.lights;this.clipping=
-a.clipping;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;this.extensions=a.extensions;return this};Ca.prototype.toJSON=function(a){var b=O.prototype.toJSON.call(this,a);b.uniforms={};for(var c in this.uniforms){var d=this.uniforms[c].value;b.uniforms[c]=d&&d.isTexture?{type:"t",value:d.toJSON(a).uuid}:d&&d.isColor?{type:"c",value:d.getHex()}:d&&d.isVector2?{type:"v2",value:d.toArray()}:d&&d.isVector3?{type:"v3",value:d.toArray()}:d&&d.isVector4?{type:"v4",
-value:d.toArray()}:d&&d.isMatrix3?{type:"m3",value:d.toArray()}:d&&d.isMatrix4?{type:"m4",value:d.toArray()}:{value:d}}0<Object.keys(this.defines).length&&(b.defines=this.defines);b.vertexShader=this.vertexShader;b.fragmentShader=this.fragmentShader;a={};for(var e in this.extensions)!0===this.extensions[e]&&(a[e]=!0);0<Object.keys(a).length&&(b.extensions=a);return b};Object.assign(wb.prototype,{set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},
+(d.emissiveIntensity=this.emissiveIntensity);this.specular&&this.specular.isColor&&(d.specular=this.specular.getHex());void 0!==this.shininess&&(d.shininess=this.shininess);void 0!==this.clearCoat&&(d.clearCoat=this.clearCoat);void 0!==this.clearCoatRoughness&&(d.clearCoatRoughness=this.clearCoatRoughness);this.map&&this.map.isTexture&&(d.map=this.map.toJSON(a).uuid);this.matcap&&this.matcap.isTexture&&(d.matcap=this.matcap.toJSON(a).uuid);this.alphaMap&&this.alphaMap.isTexture&&(d.alphaMap=this.alphaMap.toJSON(a).uuid);
+this.lightMap&&this.lightMap.isTexture&&(d.lightMap=this.lightMap.toJSON(a).uuid);this.aoMap&&this.aoMap.isTexture&&(d.aoMap=this.aoMap.toJSON(a).uuid,d.aoMapIntensity=this.aoMapIntensity);this.bumpMap&&this.bumpMap.isTexture&&(d.bumpMap=this.bumpMap.toJSON(a).uuid,d.bumpScale=this.bumpScale);this.normalMap&&this.normalMap.isTexture&&(d.normalMap=this.normalMap.toJSON(a).uuid,d.normalMapType=this.normalMapType,d.normalScale=this.normalScale.toArray());this.displacementMap&&this.displacementMap.isTexture&&
+(d.displacementMap=this.displacementMap.toJSON(a).uuid,d.displacementScale=this.displacementScale,d.displacementBias=this.displacementBias);this.roughnessMap&&this.roughnessMap.isTexture&&(d.roughnessMap=this.roughnessMap.toJSON(a).uuid);this.metalnessMap&&this.metalnessMap.isTexture&&(d.metalnessMap=this.metalnessMap.toJSON(a).uuid);this.emissiveMap&&this.emissiveMap.isTexture&&(d.emissiveMap=this.emissiveMap.toJSON(a).uuid);this.specularMap&&this.specularMap.isTexture&&(d.specularMap=this.specularMap.toJSON(a).uuid);
+this.envMap&&this.envMap.isTexture&&(d.envMap=this.envMap.toJSON(a).uuid,d.reflectivity=this.reflectivity,void 0!==this.combine&&(d.combine=this.combine),void 0!==this.envMapIntensity&&(d.envMapIntensity=this.envMapIntensity));this.gradientMap&&this.gradientMap.isTexture&&(d.gradientMap=this.gradientMap.toJSON(a).uuid);void 0!==this.size&&(d.size=this.size);void 0!==this.sizeAttenuation&&(d.sizeAttenuation=this.sizeAttenuation);1!==this.blending&&(d.blending=this.blending);!0===this.flatShading&&
+(d.flatShading=this.flatShading);0!==this.side&&(d.side=this.side);0!==this.vertexColors&&(d.vertexColors=this.vertexColors);1>this.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);d.depthFunc=this.depthFunc;d.depthTest=this.depthTest;d.depthWrite=this.depthWrite;0!==this.rotation&&(d.rotation=this.rotation);!0===this.polygonOffset&&(d.polygonOffset=!0);0!==this.polygonOffsetFactor&&(d.polygonOffsetFactor=this.polygonOffsetFactor);0!==this.polygonOffsetUnits&&
+(d.polygonOffsetUnits=this.polygonOffsetUnits);1!==this.linewidth&&(d.linewidth=this.linewidth);void 0!==this.dashSize&&(d.dashSize=this.dashSize);void 0!==this.gapSize&&(d.gapSize=this.gapSize);void 0!==this.scale&&(d.scale=this.scale);!0===this.dithering&&(d.dithering=!0);0<this.alphaTest&&(d.alphaTest=this.alphaTest);!0===this.premultipliedAlpha&&(d.premultipliedAlpha=this.premultipliedAlpha);!0===this.wireframe&&(d.wireframe=this.wireframe);1<this.wireframeLinewidth&&(d.wireframeLinewidth=this.wireframeLinewidth);
+"round"!==this.wireframeLinecap&&(d.wireframeLinecap=this.wireframeLinecap);"round"!==this.wireframeLinejoin&&(d.wireframeLinejoin=this.wireframeLinejoin);!0===this.morphTargets&&(d.morphTargets=!0);!0===this.skinning&&(d.skinning=!0);!1===this.visible&&(d.visible=!1);"{}"!==JSON.stringify(this.userData)&&(d.userData=this.userData);c&&(c=b(a.textures),a=b(a.images),0<c.length&&(d.textures=c),0<a.length&&(d.images=a));return d},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.name=
+a.name;this.fog=a.fog;this.lights=a.lights;this.blending=a.blending;this.side=a.side;this.flatShading=a.flatShading;this.vertexColors=a.vertexColors;this.opacity=a.opacity;this.transparent=a.transparent;this.blendSrc=a.blendSrc;this.blendDst=a.blendDst;this.blendEquation=a.blendEquation;this.blendSrcAlpha=a.blendSrcAlpha;this.blendDstAlpha=a.blendDstAlpha;this.blendEquationAlpha=a.blendEquationAlpha;this.depthFunc=a.depthFunc;this.depthTest=a.depthTest;this.depthWrite=a.depthWrite;this.colorWrite=
+a.colorWrite;this.precision=a.precision;this.polygonOffset=a.polygonOffset;this.polygonOffsetFactor=a.polygonOffsetFactor;this.polygonOffsetUnits=a.polygonOffsetUnits;this.dithering=a.dithering;this.alphaTest=a.alphaTest;this.premultipliedAlpha=a.premultipliedAlpha;this.visible=a.visible;this.userData=JSON.parse(JSON.stringify(a.userData));this.clipShadows=a.clipShadows;this.clipIntersection=a.clipIntersection;var b=a.clippingPlanes,c=null;if(null!==b){var d=b.length;c=Array(d);for(var e=0;e!==d;++e)c[e]=
+b[e].clone()}this.clippingPlanes=c;this.shadowSide=a.shadowSide;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Ca.prototype=Object.create(O.prototype);Ca.prototype.constructor=Ca;Ca.prototype.isShaderMaterial=!0;Ca.prototype.copy=function(a){O.prototype.copy.call(this,a);this.fragmentShader=a.fragmentShader;this.vertexShader=a.vertexShader;this.uniforms=Pb(a.uniforms);this.defines=Object.assign({},a.defines);this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;
+this.lights=a.lights;this.clipping=a.clipping;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;this.extensions=a.extensions;return this};Ca.prototype.toJSON=function(a){var b=O.prototype.toJSON.call(this,a);b.uniforms={};for(var c in this.uniforms){var d=this.uniforms[c].value;b.uniforms[c]=d&&d.isTexture?{type:"t",value:d.toJSON(a).uuid}:d&&d.isColor?{type:"c",value:d.getHex()}:d&&d.isVector2?{type:"v2",value:d.toArray()}:d&&d.isVector3?{type:"v3",value:d.toArray()}:
+d&&d.isVector4?{type:"v4",value:d.toArray()}:d&&d.isMatrix3?{type:"m3",value:d.toArray()}:d&&d.isMatrix4?{type:"m4",value:d.toArray()}:{value:d}}0<Object.keys(this.defines).length&&(b.defines=this.defines);b.vertexShader=this.vertexShader;b.fragmentShader=this.fragmentShader;a={};for(var e in this.extensions)!0===this.extensions[e]&&(a[e]=!0);0<Object.keys(a).length&&(b.extensions=a);return b};Object.assign(wb.prototype,{set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},
 copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){void 0===b&&(console.warn("THREE.Ray: .at() target is now required"),b=new n);return b.copy(this.direction).multiplyScalar(a).add(this.origin)},lookAt:function(a){this.direction.copy(a).sub(this.origin).normalize();return this},recast:function(){var a=new n;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){void 0===b&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),
 b=new n);b.subVectors(a,this.origin);a=b.dot(this.direction);return 0>a?b.copy(this.origin):b.copy(this.direction).multiplyScalar(a).add(this.origin)},distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))},distanceSqToPoint:function(){var a=new n;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceToSquared(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceToSquared(b)}}(),distanceSqToSegment:function(){var a=
 new n,b=new n,c=new n;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),m=c.dot(this.direction),l=-c.dot(b),n=c.lengthSq(),v=Math.abs(1-k*k);if(0<v){d=k*l-m;e=k*m-l;var t=h*v;0<=d?e>=-t?e<=t?(h=1/v,d*=h,e*=h,k=d*(d+k*e+2*m)+e*(k*d+e+2*l)+n):(e=h,d=Math.max(0,-(k*e+m)),k=-d*d+e*(e+2*l)+n):(e=-h,d=Math.max(0,-(k*e+m)),k=-d*d+e*(e+2*l)+n):e<=-t?(d=Math.max(0,-(-k*h+m)),e=0<d?-h:Math.min(Math.max(-h,
@@ -652,18 +652,18 @@ this.skeleton.calculateInverses(),b=this.matrixWorld);this.bindMatrix.copy(b);th
 this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});Object.assign(Bd.prototype,{calculateInverses:function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new P;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}},
 pose:function(){var a,b;var c=0;for(b=this.bones.length;c<b;c++)(a=this.bones[c])&&a.matrixWorld.getInverse(this.boneInverses[c]);c=0;for(b=this.bones.length;c<b;c++)if(a=this.bones[c])a.parent&&a.parent.isBone?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale)},update:function(){var a=new P,b=new P;return function(){for(var c=this.bones,d=this.boneInverses,e=this.boneMatrices,f=this.boneTexture,
 g=0,h=c.length;g<h;g++)a.multiplyMatrices(c[g]?c[g].matrixWorld:b,d[g]),a.toArray(e,16*g);void 0!==f&&(f.needsUpdate=!0)}}(),clone:function(){return new Bd(this.bones,this.boneInverses)},getBoneByName:function(a){for(var b=0,c=this.bones.length;b<c;b++){var d=this.bones[b];if(d.name===a)return d}}});he.prototype=Object.assign(Object.create(C.prototype),{constructor:he,isBone:!0});R.prototype=Object.create(O.prototype);R.prototype.constructor=R;R.prototype.isLineBasicMaterial=!0;R.prototype.copy=function(a){O.prototype.copy.call(this,
-a);this.color.copy(a.color);this.linewidth=a.linewidth;this.linecap=a.linecap;this.linejoin=a.linejoin;return this};oa.prototype=Object.assign(Object.create(C.prototype),{constructor:oa,isLine:!0,computeLineDistances:function(){var a=new n,b=new n;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===c.index){for(var d=c.attributes.position,e=[0],f=1,g=d.count;f<g;f++)a.fromBufferAttribute(d,f-1),b.fromBufferAttribute(d,f),e[f]=e[f-1],e[f]+=a.distanceTo(b);c.addAttribute("lineDistance",
+a);this.color.copy(a.color);this.linewidth=a.linewidth;this.linecap=a.linecap;this.linejoin=a.linejoin;return this};na.prototype=Object.assign(Object.create(C.prototype),{constructor:na,isLine:!0,computeLineDistances:function(){var a=new n,b=new n;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===c.index){for(var d=c.attributes.position,e=[0],f=1,g=d.count;f<g;f++)a.fromBufferAttribute(d,f-1),b.fromBufferAttribute(d,f),e[f]=e[f-1],e[f]+=a.distanceTo(b);c.addAttribute("lineDistance",
 new E(e,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(c.isGeometry)for(d=c.vertices,e=c.lineDistances,e[0]=0,f=1,g=d.length;f<g;f++)e[f]=e[f-1],e[f]+=d[f-1].distanceTo(d[f]);return this}}(),raycast:function(){var a=new P,b=new wb,c=new Ua;return function(d,e){var f=d.linePrecision,g=this.geometry,h=this.matrixWorld;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(h);c.radius+=
 f;if(!1!==d.ray.intersectsSphere(c)){a.getInverse(h);b.copy(d.ray).applyMatrix4(a);f/=(this.scale.x+this.scale.y+this.scale.z)/3;f*=f;var k=new n,m=new n;h=new n;var l=new n,q=this&&this.isLineSegments?2:1;if(g.isBufferGeometry){var v=g.index,t=g.attributes.position.array;if(null!==v){v=v.array;g=0;for(var r=v.length-1;g<r;g+=q){var u=v[g+1];k.fromArray(t,3*v[g]);m.fromArray(t,3*u);u=b.distanceSqToSegment(k,m,l,h);u>f||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),u<d.near||u>d.far||
 e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}else for(g=0,r=t.length/3-1;g<r;g+=q)k.fromArray(t,3*g),m.fromArray(t,3*g+3),u=b.distanceSqToSegment(k,m,l,h),u>f||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),u<d.near||u>d.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g.isGeometry)for(k=g.vertices,m=k.length,g=0;g<m-1;g+=q)u=b.distanceSqToSegment(k[g],
-k[g+1],l,h),u>f||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),u<d.near||u>d.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});V.prototype=Object.assign(Object.create(oa.prototype),{constructor:V,isLineSegments:!0,computeLineDistances:function(){var a=new n,b=new n;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===
+k[g+1],l,h),u>f||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),u<d.near||u>d.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});V.prototype=Object.assign(Object.create(na.prototype),{constructor:V,isLineSegments:!0,computeLineDistances:function(){var a=new n,b=new n;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===
 c.index){for(var d=c.attributes.position,e=[],f=0,g=d.count;f<g;f+=2)a.fromBufferAttribute(d,f),b.fromBufferAttribute(d,f+1),e[f]=0===f?0:e[f-1],e[f+1]=e[f]+a.distanceTo(b);c.addAttribute("lineDistance",new E(e,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(c.isGeometry)for(d=c.vertices,e=c.lineDistances,f=0,g=d.length;f<g;f+=2)a.copy(d[f]),b.copy(d[f+1]),e[f]=0===f?0:e[f-1],e[f+1]=e[f]+a.distanceTo(b);return this}}()});
-Cd.prototype=Object.assign(Object.create(oa.prototype),{constructor:Cd,isLineLoop:!0});Ka.prototype=Object.create(O.prototype);Ka.prototype.constructor=Ka;Ka.prototype.isPointsMaterial=!0;Ka.prototype.copy=function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.size=a.size;this.sizeAttenuation=a.sizeAttenuation;this.morphTargets=a.morphTargets;return this};Xb.prototype=Object.assign(Object.create(C.prototype),{constructor:Xb,isPoints:!0,raycast:function(){var a=new P,
+Cd.prototype=Object.assign(Object.create(na.prototype),{constructor:Cd,isLineLoop:!0});Ka.prototype=Object.create(O.prototype);Ka.prototype.constructor=Ka;Ka.prototype.isPointsMaterial=!0;Ka.prototype.copy=function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.size=a.size;this.sizeAttenuation=a.sizeAttenuation;this.morphTargets=a.morphTargets;return this};Xb.prototype=Object.assign(Object.create(C.prototype),{constructor:Xb,isPoints:!0,raycast:function(){var a=new P,
 b=new wb,c=new Ua;return function(d,e){function f(a,c){var f=b.distanceSqToPoint(a);f<l&&(b.closestPointToPoint(a,q),q.applyMatrix4(k),a=d.ray.origin.distanceTo(q),a<d.near||a>d.far||e.push({distance:a,distanceToRay:Math.sqrt(f),point:q.clone(),index:c,face:null,object:g}))}var g=this,h=this.geometry,k=this.matrixWorld,m=d.params.Points.threshold;null===h.boundingSphere&&h.computeBoundingSphere();c.copy(h.boundingSphere);c.applyMatrix4(k);c.radius+=m;if(!1!==d.ray.intersectsSphere(c)){a.getInverse(k);
 b.copy(d.ray).applyMatrix4(a);m/=(this.scale.x+this.scale.y+this.scale.z)/3;var l=m*m;m=new n;var q=new n;if(h.isBufferGeometry){var v=h.index;h=h.attributes.position.array;if(null!==v){var t=v.array;v=0;for(var r=t.length;v<r;v++){var u=t[v];m.fromArray(h,3*u);f(m,u)}}else for(v=0,t=h.length/3;v<t;v++)m.fromArray(h,3*v),f(m,v)}else for(m=h.vertices,v=0,t=m.length;v<t;v++)f(m[v],v)}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});ie.prototype=Object.assign(Object.create(W.prototype),
 {constructor:ie,isVideoTexture:!0,update:function(){var a=this.image;a.readyState>=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Yb.prototype=Object.create(W.prototype);Yb.prototype.constructor=Yb;Yb.prototype.isCompressedTexture=!0;Lc.prototype=Object.create(W.prototype);Lc.prototype.constructor=Lc;Lc.prototype.isCanvasTexture=!0;Mc.prototype=Object.create(W.prototype);Mc.prototype.constructor=Mc;Mc.prototype.isDepthTexture=!0;Zb.prototype=Object.create(z.prototype);Zb.prototype.constructor=Zb;Nc.prototype=
-Object.create(N.prototype);Nc.prototype.constructor=Nc;$b.prototype=Object.create(z.prototype);$b.prototype.constructor=$b;Oc.prototype=Object.create(N.prototype);Oc.prototype.constructor=Oc;ka.prototype=Object.create(z.prototype);ka.prototype.constructor=ka;Pc.prototype=Object.create(N.prototype);Pc.prototype.constructor=Pc;ac.prototype=Object.create(ka.prototype);ac.prototype.constructor=ac;Qc.prototype=Object.create(N.prototype);Qc.prototype.constructor=Qc;yb.prototype=Object.create(ka.prototype);
-yb.prototype.constructor=yb;Rc.prototype=Object.create(N.prototype);Rc.prototype.constructor=Rc;bc.prototype=Object.create(ka.prototype);bc.prototype.constructor=bc;Sc.prototype=Object.create(N.prototype);Sc.prototype.constructor=Sc;cc.prototype=Object.create(ka.prototype);cc.prototype.constructor=cc;Tc.prototype=Object.create(N.prototype);Tc.prototype.constructor=Tc;zb.prototype=Object.create(z.prototype);zb.prototype.constructor=zb;zb.prototype.toJSON=function(){var a=z.prototype.toJSON.call(this);
+Object.create(N.prototype);Nc.prototype.constructor=Nc;$b.prototype=Object.create(z.prototype);$b.prototype.constructor=$b;Oc.prototype=Object.create(N.prototype);Oc.prototype.constructor=Oc;oa.prototype=Object.create(z.prototype);oa.prototype.constructor=oa;Pc.prototype=Object.create(N.prototype);Pc.prototype.constructor=Pc;ac.prototype=Object.create(oa.prototype);ac.prototype.constructor=ac;Qc.prototype=Object.create(N.prototype);Qc.prototype.constructor=Qc;yb.prototype=Object.create(oa.prototype);
+yb.prototype.constructor=yb;Rc.prototype=Object.create(N.prototype);Rc.prototype.constructor=Rc;bc.prototype=Object.create(oa.prototype);bc.prototype.constructor=bc;Sc.prototype=Object.create(N.prototype);Sc.prototype.constructor=Sc;cc.prototype=Object.create(oa.prototype);cc.prototype.constructor=cc;Tc.prototype=Object.create(N.prototype);Tc.prototype.constructor=Tc;zb.prototype=Object.create(z.prototype);zb.prototype.constructor=zb;zb.prototype.toJSON=function(){var a=z.prototype.toJSON.call(this);
 a.path=this.parameters.path.toJSON();return a};Uc.prototype=Object.create(N.prototype);Uc.prototype.constructor=Uc;dc.prototype=Object.create(z.prototype);dc.prototype.constructor=dc;Vc.prototype=Object.create(N.prototype);Vc.prototype.constructor=Vc;ec.prototype=Object.create(z.prototype);ec.prototype.constructor=ec;var mh={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?b[0]*c:a.length,f=vf(a,0,e,c,!0),g=[];if(!f)return g;var h;if(d){var k=c;d=[];var m;var l=0;for(m=b.length;l<m;l++){var n=
 b[l]*k;var v=l<m-1?b[l+1]*k:a.length;n=vf(a,n,v,k,!1);n===n.next&&(n.steiner=!0);d.push(gh(n))}d.sort(eh);for(l=0;l<d.length;l++){b=d[l];k=f;if(k=fh(b,k))b=yf(k,b),Xc(b,b.next);f=Xc(f,f.next)}}if(a.length>80*c){var t=h=a[0];var r=d=a[1];for(k=c;k<e;k+=c)l=a[k],b=a[k+1],l<t&&(t=l),b<r&&(r=b),l>h&&(h=l),b>d&&(d=b);h=Math.max(h-t,d-r);h=0!==h?1/h:0}Yc(f,g,c,t,r,h);return g}},cb={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;e<b;d=e++)c+=a[d].x*a[e].y-a[e].x*a[d].y;return.5*c},isClockWise:function(a){return 0>
 cb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];zf(a);Af(c,a);var f=a.length;b.forEach(zf);for(a=0;a<b.length;a++)d.push(f),f+=b[a].length,Af(c,b[a]);b=mh.triangulate(c,d);for(a=0;a<b.length;a+=3)e.push(b.slice(a,a+3));return e}};Bb.prototype=Object.create(N.prototype);Bb.prototype.constructor=Bb;Bb.prototype.toJSON=function(){var a=N.prototype.toJSON.call(this);return Bf(this.parameters.shapes,this.parameters.options,a)};Ya.prototype=Object.create(z.prototype);Ya.prototype.constructor=
@@ -671,7 +671,7 @@ Ya;Ya.prototype.toJSON=function(){var a=z.prototype.toJSON.call(this);return Bf(
 new B(m,1-e),new B(n,1-b)]:[new B(g,1-c),new B(k,1-d),new B(l,1-e),new B(v,1-b)]}};$c.prototype=Object.create(N.prototype);$c.prototype.constructor=$c;fc.prototype=Object.create(Ya.prototype);fc.prototype.constructor=fc;ad.prototype=Object.create(N.prototype);ad.prototype.constructor=ad;Cb.prototype=Object.create(z.prototype);Cb.prototype.constructor=Cb;bd.prototype=Object.create(N.prototype);bd.prototype.constructor=bd;gc.prototype=Object.create(z.prototype);gc.prototype.constructor=gc;cd.prototype=
 Object.create(N.prototype);cd.prototype.constructor=cd;hc.prototype=Object.create(z.prototype);hc.prototype.constructor=hc;Db.prototype=Object.create(N.prototype);Db.prototype.constructor=Db;Db.prototype.toJSON=function(){var a=N.prototype.toJSON.call(this);return Cf(this.parameters.shapes,a)};Eb.prototype=Object.create(z.prototype);Eb.prototype.constructor=Eb;Eb.prototype.toJSON=function(){var a=z.prototype.toJSON.call(this);return Cf(this.parameters.shapes,a)};ic.prototype=Object.create(z.prototype);
 ic.prototype.constructor=ic;Fb.prototype=Object.create(N.prototype);Fb.prototype.constructor=Fb;db.prototype=Object.create(z.prototype);db.prototype.constructor=db;dd.prototype=Object.create(Fb.prototype);dd.prototype.constructor=dd;ed.prototype=Object.create(db.prototype);ed.prototype.constructor=ed;fd.prototype=Object.create(N.prototype);fd.prototype.constructor=fd;jc.prototype=Object.create(z.prototype);jc.prototype.constructor=jc;var ya=Object.freeze({WireframeGeometry:Zb,ParametricGeometry:Nc,
-ParametricBufferGeometry:$b,TetrahedronGeometry:Pc,TetrahedronBufferGeometry:ac,OctahedronGeometry:Qc,OctahedronBufferGeometry:yb,IcosahedronGeometry:Rc,IcosahedronBufferGeometry:bc,DodecahedronGeometry:Sc,DodecahedronBufferGeometry:cc,PolyhedronGeometry:Oc,PolyhedronBufferGeometry:ka,TubeGeometry:Tc,TubeBufferGeometry:zb,TorusKnotGeometry:Uc,TorusKnotBufferGeometry:dc,TorusGeometry:Vc,TorusBufferGeometry:ec,TextGeometry:$c,TextBufferGeometry:fc,SphereGeometry:ad,SphereBufferGeometry:Cb,RingGeometry:bd,
+ParametricBufferGeometry:$b,TetrahedronGeometry:Pc,TetrahedronBufferGeometry:ac,OctahedronGeometry:Qc,OctahedronBufferGeometry:yb,IcosahedronGeometry:Rc,IcosahedronBufferGeometry:bc,DodecahedronGeometry:Sc,DodecahedronBufferGeometry:cc,PolyhedronGeometry:Oc,PolyhedronBufferGeometry:oa,TubeGeometry:Tc,TubeBufferGeometry:zb,TorusKnotGeometry:Uc,TorusKnotBufferGeometry:dc,TorusGeometry:Vc,TorusBufferGeometry:ec,TextGeometry:$c,TextBufferGeometry:fc,SphereGeometry:ad,SphereBufferGeometry:Cb,RingGeometry:bd,
 RingBufferGeometry:gc,PlaneGeometry:Dc,PlaneBufferGeometry:vb,LatheGeometry:cd,LatheBufferGeometry:hc,ShapeGeometry:Db,ShapeBufferGeometry:Eb,ExtrudeGeometry:Bb,ExtrudeBufferGeometry:Ya,EdgesGeometry:ic,ConeGeometry:dd,ConeBufferGeometry:ed,CylinderGeometry:Fb,CylinderBufferGeometry:db,CircleGeometry:fd,CircleBufferGeometry:jc,BoxGeometry:Rb,BoxBufferGeometry:ub});Gb.prototype=Object.create(O.prototype);Gb.prototype.constructor=Gb;Gb.prototype.isShadowMaterial=!0;Gb.prototype.copy=function(a){O.prototype.copy.call(this,
 a);this.color.copy(a.color);return this};kc.prototype=Object.create(Ca.prototype);kc.prototype.constructor=kc;kc.prototype.isRawShaderMaterial=!0;Za.prototype=Object.create(O.prototype);Za.prototype.constructor=Za;Za.prototype.isMeshStandardMaterial=!0;Za.prototype.copy=function(a){O.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;
 this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.roughnessMap=a.roughnessMap;this.metalnessMap=a.metalnessMap;this.alphaMap=
@@ -691,17 +691,17 @@ f[d],void 0!==g&&(b.push(f.time),c.push.apply(c,g)),f=a[e++];while(void 0!==f)}e
 e,a,d)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(a){var b=this.resultBuffer,c=this.sampleValues,d=this.valueSize;a*=d;for(var e=0;e!==d;++e)b[e]=c[a+e];return b},interpolate_:function(){throw Error("call to abstract method");},intervalChanged_:function(){}});Object.assign(Fa.prototype,{beforeStart_:Fa.prototype.copySampleValue_,afterEnd_:Fa.prototype.copySampleValue_});Ed.prototype=Object.assign(Object.create(Fa.prototype),
 {constructor:Ed,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(a,b,c){var d=this.parameterPositions,e=a-2,f=a+1,g=d[e],h=d[f];if(void 0===g)switch(this.getSettings_().endingStart){case 2401:e=a;g=2*b-c;break;case 2402:e=d.length-2;g=b+d[e]-d[e+1];break;default:e=a,g=c}if(void 0===h)switch(this.getSettings_().endingEnd){case 2401:f=a;h=2*c-b;break;case 2402:f=1;h=c+d[1]-d[0];break;default:f=a-1,h=b}a=.5*(c-b);d=this.valueSize;this._weightPrev=a/(b-g);this._weightNext=
 a/(h-c);this._offsetPrev=e*d;this._offsetNext=f*d},interpolate_:function(a,b,c,d){var e=this.resultBuffer,f=this.sampleValues,g=this.valueSize;a*=g;var h=a-g,k=this._offsetPrev,m=this._offsetNext,l=this._weightPrev,n=this._weightNext,v=(c-b)/(d-b);c=v*v;d=c*v;b=-l*d+2*l*c-l*v;l=(1+l)*d+(-1.5-2*l)*c+(-.5+l)*v+1;v=(-1-n)*d+(1.5+n)*c+.5*v;n=n*d-n*c;for(c=0;c!==g;++c)e[c]=b*f[k+c]+l*f[h+c]+v*f[a+c]+n*f[m+c];return e}});gd.prototype=Object.assign(Object.create(Fa.prototype),{constructor:gd,interpolate_:function(a,
-b,c,d){var e=this.resultBuffer,f=this.sampleValues,g=this.valueSize;a*=g;var h=a-g;b=(c-b)/(d-b);c=1-b;for(d=0;d!==g;++d)e[d]=f[h+d]*c+f[a+d]*b;return e}});Fd.prototype=Object.assign(Object.create(Fa.prototype),{constructor:Fd,interpolate_:function(a){return this.copySampleValue_(a-1)}});Object.assign(la,{toJSON:function(a){var b=a.constructor;if(void 0!==b.toJSON)b=b.toJSON(a);else{b={name:a.name,times:pa.convertArray(a.times,Array),values:pa.convertArray(a.values,Array)};var c=a.getInterpolation();
-c!==a.DefaultInterpolation&&(b.interpolation=c)}b.type=a.ValueTypeName;return b}});Object.assign(la.prototype,{constructor:la,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(a){return new Fd(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodLinear:function(a){return new gd(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:function(a){return new Ed(this.times,this.values,this.getValueSize(),
+b,c,d){var e=this.resultBuffer,f=this.sampleValues,g=this.valueSize;a*=g;var h=a-g;b=(c-b)/(d-b);c=1-b;for(d=0;d!==g;++d)e[d]=f[h+d]*c+f[a+d]*b;return e}});Fd.prototype=Object.assign(Object.create(Fa.prototype),{constructor:Fd,interpolate_:function(a){return this.copySampleValue_(a-1)}});Object.assign(ka,{toJSON:function(a){var b=a.constructor;if(void 0!==b.toJSON)b=b.toJSON(a);else{b={name:a.name,times:pa.convertArray(a.times,Array),values:pa.convertArray(a.values,Array)};var c=a.getInterpolation();
+c!==a.DefaultInterpolation&&(b.interpolation=c)}b.type=a.ValueTypeName;return b}});Object.assign(ka.prototype,{constructor:ka,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(a){return new Fd(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodLinear:function(a){return new gd(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:function(a){return new Ed(this.times,this.values,this.getValueSize(),
 a)},setInterpolation:function(a){switch(a){case 2300:var b=this.InterpolantFactoryMethodDiscrete;break;case 2301:b=this.InterpolantFactoryMethodLinear;break;case 2302:b=this.InterpolantFactoryMethodSmooth}if(void 0===b){b="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(a!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(b);console.warn("THREE.KeyframeTrack:",b);return this}this.createInterpolant=
 b;return this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(a){if(0!==a)for(var b=this.times,c=0,d=b.length;c!==d;++c)b[c]+=a;return this},scale:function(a){if(1!==a)for(var b=this.times,c=0,d=b.length;c!==d;++c)b[c]*=a;return this},trim:function(a,
 b){for(var c=this.times,d=c.length,e=0,f=d-1;e!==d&&c[e]<a;)++e;for(;-1!==f&&c[f]>b;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),a=this.getValueSize(),this.times=pa.arraySlice(c,e,f),this.values=pa.arraySlice(this.values,e*a,f*a);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),a=!1);var c=this.times;b=this.values;var d=c.length;0===d&&(console.error("THREE.KeyframeTrack: Track is empty.",
 this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if("number"===typeof g&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,f,g);a=!1;break}if(null!==e&&e>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&pa.isTypedArray(b))for(f=0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,f,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values,
 c=this.getValueSize(),d=2302===this.getInterpolation(),e=1,f=a.length-1,g=1;g<f;++g){var h=!1,k=a[g];if(k!==a[g+1]&&(1!==g||k!==k[0]))if(d)h=!0;else{var m=g*c,l=m-c,n=m+c;for(k=0;k!==c;++k){var v=b[m+k];if(v!==b[l+k]||v!==b[n+k]){h=!0;break}}}if(h){if(g!==e)for(a[e]=a[g],h=g*c,m=e*c,k=0;k!==c;++k)b[m+k]=b[h+k];++e}}if(0<f){a[e]=a[f];h=f*c;m=e*c;for(k=0;k!==c;++k)b[m+k]=b[h+k];++e}e!==a.length&&(this.times=pa.arraySlice(a,0,e),this.values=pa.arraySlice(b,0,e*c));return this},clone:function(){var a=
-pa.arraySlice(this.times,0),b=pa.arraySlice(this.values,0);a=new this.constructor(this.name,a,b);a.createInterpolant=this.createInterpolant;return a}});Gd.prototype=Object.assign(Object.create(la.prototype),{constructor:Gd,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});Hd.prototype=Object.assign(Object.create(la.prototype),{constructor:Hd,ValueTypeName:"color"});lc.prototype=Object.assign(Object.create(la.prototype),
-{constructor:lc,ValueTypeName:"number"});Id.prototype=Object.assign(Object.create(Fa.prototype),{constructor:Id,interpolate_:function(a,b,c,d){var e=this.resultBuffer,f=this.sampleValues,g=this.valueSize;a*=g;b=(c-b)/(d-b);for(c=a+g;a!==c;a+=4)aa.slerpFlat(e,0,f,a-g,f,a,b);return e}});hd.prototype=Object.assign(Object.create(la.prototype),{constructor:hd,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(a){return new Id(this.times,this.values,this.getValueSize(),
-a)},InterpolantFactoryMethodSmooth:void 0});Jd.prototype=Object.assign(Object.create(la.prototype),{constructor:Jd,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});mc.prototype=Object.assign(Object.create(la.prototype),{constructor:mc,ValueTypeName:"vector"});Object.assign(Ia,{parse:function(a){for(var b=[],c=a.tracks,d=1/(a.fps||1),e=0,f=c.length;e!==f;++e)b.push(jh(c[e]).scale(d));return new Ia(a.name,
-a.duration,b)},toJSON:function(a){var b=[],c=a.tracks;a={name:a.name,duration:a.duration,tracks:b,uuid:a.uuid};for(var d=0,e=c.length;d!==e;++d)b.push(la.toJSON(c[d]));return a},CreateFromMorphTargetSequence:function(a,b,c,d){for(var e=b.length,f=[],g=0;g<e;g++){var h=[],k=[];h.push((g+e-1)%e,g,(g+1)%e);k.push(0,1,0);var m=pa.getKeyframeOrder(h);h=pa.sortedArray(h,1,m);k=pa.sortedArray(k,1,m);d||0!==h[0]||(h.push(e),k.push(k[0]));f.push((new lc(".morphTargetInfluences["+b[g].name+"]",h,k)).scale(1/
+pa.arraySlice(this.times,0),b=pa.arraySlice(this.values,0);a=new this.constructor(this.name,a,b);a.createInterpolant=this.createInterpolant;return a}});Gd.prototype=Object.assign(Object.create(ka.prototype),{constructor:Gd,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});Hd.prototype=Object.assign(Object.create(ka.prototype),{constructor:Hd,ValueTypeName:"color"});lc.prototype=Object.assign(Object.create(ka.prototype),
+{constructor:lc,ValueTypeName:"number"});Id.prototype=Object.assign(Object.create(Fa.prototype),{constructor:Id,interpolate_:function(a,b,c,d){var e=this.resultBuffer,f=this.sampleValues,g=this.valueSize;a*=g;b=(c-b)/(d-b);for(c=a+g;a!==c;a+=4)aa.slerpFlat(e,0,f,a-g,f,a,b);return e}});hd.prototype=Object.assign(Object.create(ka.prototype),{constructor:hd,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(a){return new Id(this.times,this.values,this.getValueSize(),
+a)},InterpolantFactoryMethodSmooth:void 0});Jd.prototype=Object.assign(Object.create(ka.prototype),{constructor:Jd,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});mc.prototype=Object.assign(Object.create(ka.prototype),{constructor:mc,ValueTypeName:"vector"});Object.assign(Ia,{parse:function(a){for(var b=[],c=a.tracks,d=1/(a.fps||1),e=0,f=c.length;e!==f;++e)b.push(jh(c[e]).scale(d));return new Ia(a.name,
+a.duration,b)},toJSON:function(a){var b=[],c=a.tracks;a={name:a.name,duration:a.duration,tracks:b,uuid:a.uuid};for(var d=0,e=c.length;d!==e;++d)b.push(ka.toJSON(c[d]));return a},CreateFromMorphTargetSequence:function(a,b,c,d){for(var e=b.length,f=[],g=0;g<e;g++){var h=[],k=[];h.push((g+e-1)%e,g,(g+1)%e);k.push(0,1,0);var m=pa.getKeyframeOrder(h);h=pa.sortedArray(h,1,m);k=pa.sortedArray(k,1,m);d||0!==h[0]||(h.push(e),k.push(k[0]));f.push((new lc(".morphTargetInfluences["+b[g].name+"]",h,k)).scale(1/
 c))}return new Ia(a,-1,f)},findByName:function(a,b){var c=a;Array.isArray(a)||(c=a.geometry&&a.geometry.animations||a.animations);for(a=0;a<c.length;a++)if(c[a].name===b)return c[a];return null},CreateClipsFromMorphTargetSequences:function(a,b,c){for(var d={},e=/^([\w-]*?)([\d]+)$/,f=0,g=a.length;f<g;f++){var h=a[f],k=h.name.match(e);if(k&&1<k.length){var m=k[1];(k=d[m])||(d[m]=k=[]);k.push(h)}}a=[];for(m in d)a.push(Ia.CreateFromMorphTargetSequence(m,d[m],b,c));return a},parseAnimation:function(a,
 b){if(!a)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;var c=function(a,b,c,d,e){if(0!==c.length){var f=[],g=[];pa.flattenJSON(c,f,g,d);0!==f.length&&e.push(new a(b,f,g))}},d=[],e=a.name||"default",f=a.length||-1,g=a.fps||30;a=a.hierarchy||[];for(var h=0;h<a.length;h++){var k=a[h].keys;if(k&&0!==k.length)if(k[0].morphTargets){f={};for(var m=0;m<k.length;m++)if(k[m].morphTargets)for(var l=0;l<k[m].morphTargets.length;l++)f[k[m].morphTargets[l]]=-1;for(var n in f){var v=
 [],t=[];for(l=0;l!==k[m].morphTargets.length;++l){var r=k[m];v.push(r.time);t.push(r.morphTarget===n?1:0)}d.push(new lc(".morphTargetInfluence["+n+"]",v,t))}f=f.length*(g||1)}else m=".bones["+b[h].name+"]",c(mc,m+".position",k,"pos",d),c(hd,m+".quaternion",k,"rot",d),c(mc,m+".scale",k,"scl",d)}return 0===d.length?null:new Ia(e,f,d)}});Object.assign(Ia.prototype,{resetDuration:function(){for(var a=0,b=0,c=this.tracks.length;b!==c;++b){var d=this.tracks[b];a=Math.max(a,d.times[d.times.length-1])}this.duration=
@@ -764,54 +764,54 @@ a.vertexColors);void 0!==a.fog&&(d.fog=a.fog);void 0!==a.flatShading&&(d.flatSha
 void 0!==a.wireframe&&(d.wireframe=a.wireframe);void 0!==a.wireframeLinewidth&&(d.wireframeLinewidth=a.wireframeLinewidth);void 0!==a.wireframeLinecap&&(d.wireframeLinecap=a.wireframeLinecap);void 0!==a.wireframeLinejoin&&(d.wireframeLinejoin=a.wireframeLinejoin);void 0!==a.rotation&&(d.rotation=a.rotation);1!==a.linewidth&&(d.linewidth=a.linewidth);void 0!==a.dashSize&&(d.dashSize=a.dashSize);void 0!==a.gapSize&&(d.gapSize=a.gapSize);void 0!==a.scale&&(d.scale=a.scale);void 0!==a.polygonOffset&&
 (d.polygonOffset=a.polygonOffset);void 0!==a.polygonOffsetFactor&&(d.polygonOffsetFactor=a.polygonOffsetFactor);void 0!==a.polygonOffsetUnits&&(d.polygonOffsetUnits=a.polygonOffsetUnits);void 0!==a.skinning&&(d.skinning=a.skinning);void 0!==a.morphTargets&&(d.morphTargets=a.morphTargets);void 0!==a.dithering&&(d.dithering=a.dithering);void 0!==a.visible&&(d.visible=a.visible);void 0!==a.userData&&(d.userData=a.userData);if(void 0!==a.uniforms)for(var e in a.uniforms){var f=a.uniforms[e];d.uniforms[e]=
 {};switch(f.type){case "t":d.uniforms[e].value=b(f.value);break;case "c":d.uniforms[e].value=(new M).setHex(f.value);break;case "v2":d.uniforms[e].value=(new B).fromArray(f.value);break;case "v3":d.uniforms[e].value=(new n).fromArray(f.value);break;case "v4":d.uniforms[e].value=(new Y).fromArray(f.value);break;case "m3":d.uniforms[e].value=(new ba).fromArray(f.value);case "m4":d.uniforms[e].value=(new P).fromArray(f.value);break;default:d.uniforms[e].value=f.value}}void 0!==a.defines&&(d.defines=
-a.defines);void 0!==a.vertexShader&&(d.vertexShader=a.vertexShader);void 0!==a.fragmentShader&&(d.fragmentShader=a.fragmentShader);if(void 0!==a.extensions)for(var g in a.extensions)d.extensions[g]=a.extensions[g];void 0!==a.shading&&(d.flatShading=1===a.shading);void 0!==a.size&&(d.size=a.size);void 0!==a.sizeAttenuation&&(d.sizeAttenuation=a.sizeAttenuation);void 0!==a.map&&(d.map=b(a.map));void 0!==a.alphaMap&&(d.alphaMap=b(a.alphaMap),d.transparent=!0);void 0!==a.bumpMap&&(d.bumpMap=b(a.bumpMap));
-void 0!==a.bumpScale&&(d.bumpScale=a.bumpScale);void 0!==a.normalMap&&(d.normalMap=b(a.normalMap));void 0!==a.normalMapType&&(d.normalMapType=a.normalMapType);void 0!==a.normalScale&&(e=a.normalScale,!1===Array.isArray(e)&&(e=[e,e]),d.normalScale=(new B).fromArray(e));void 0!==a.displacementMap&&(d.displacementMap=b(a.displacementMap));void 0!==a.displacementScale&&(d.displacementScale=a.displacementScale);void 0!==a.displacementBias&&(d.displacementBias=a.displacementBias);void 0!==a.roughnessMap&&
-(d.roughnessMap=b(a.roughnessMap));void 0!==a.metalnessMap&&(d.metalnessMap=b(a.metalnessMap));void 0!==a.emissiveMap&&(d.emissiveMap=b(a.emissiveMap));void 0!==a.emissiveIntensity&&(d.emissiveIntensity=a.emissiveIntensity);void 0!==a.specularMap&&(d.specularMap=b(a.specularMap));void 0!==a.envMap&&(d.envMap=b(a.envMap));void 0!==a.envMapIntensity&&(d.envMapIntensity=a.envMapIntensity);void 0!==a.reflectivity&&(d.reflectivity=a.reflectivity);void 0!==a.lightMap&&(d.lightMap=b(a.lightMap));void 0!==
-a.lightMapIntensity&&(d.lightMapIntensity=a.lightMapIntensity);void 0!==a.aoMap&&(d.aoMap=b(a.aoMap));void 0!==a.aoMapIntensity&&(d.aoMapIntensity=a.aoMapIntensity);void 0!==a.gradientMap&&(d.gradientMap=b(a.gradientMap));return d},setPath:function(a){this.path=a;return this},setTextures:function(a){this.textures=a;return this}});var Oe={decodeText:function(a){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(a);for(var b="",c=0,d=a.length;c<d;c++)b+=String.fromCharCode(a[c]);return decodeURIComponent(escape(b))},
-extractUrlBase:function(a){var b=a.lastIndexOf("/");return-1===b?"./":a.substr(0,b+1)}};Object.assign(pe.prototype,{load:function(a,b,c,d){var e=this,f=new Ma(e.manager);f.setPath(e.path);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},parse:function(a){var b=new z,c=a.data.index;if(void 0!==c){var d=new Pe[c.type](c.array);b.setIndex(new S(d,1))}c=a.data.attributes;for(var e in c){var f=c[e];d=new Pe[f.type](f.array);d=new S(d,f.itemSize,f.normalized);void 0!==f.name&&(d.name=f.name);b.addAttribute(e,
-d)}var g=a.data.morphAttributes;if(g)for(e in g){var h=g[e],k=[];c=0;for(var m=h.length;c<m;c++)f=h[c],d=new Pe[f.type](f.array),d=new S(d,f.itemSize,f.normalized),void 0!==f.name&&(d.name=f.name),k.push(d);b.morphAttributes[e]=k}e=a.data.groups||a.data.drawcalls||a.data.offsets;if(void 0!==e)for(c=0,f=e.length;c!==f;++c)d=e[c],b.addGroup(d.start,d.count,d.materialIndex);c=a.data.boundingSphere;void 0!==c&&(e=new n,void 0!==c.center&&e.fromArray(c.center),b.boundingSphere=new Ua(e,c.radius));a.name&&
-(b.name=a.name);a.userData&&(b.userData=a.userData);return b},setPath:function(a){this.path=a;return this}});var Pe={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!==typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};Object.assign(qe.prototype,{crossOrigin:"anonymous",load:function(a,b,c,d){var e=this,f=void 0===this.path?Oe.extractUrlBase(a):
-this.path;this.resourcePath=this.resourcePath||f;f=new Ma(e.manager);f.setPath(this.path);f.load(a,function(c){var f=null;try{f=JSON.parse(c)}catch(k){void 0!==d&&d(k);console.error("THREE:ObjectLoader: Can't parse "+a+".",k.message);return}c=f.metadata;void 0===c||void 0===c.type||"geometry"===c.type.toLowerCase()?console.error("THREE.ObjectLoader: Can't load "+a):e.parse(f,b)},c,d)},setPath:function(a){this.path=a;return this},setResourcePath:function(a){this.resourcePath=a;return this},setCrossOrigin:function(a){this.crossOrigin=
-a;return this},parse:function(a,b){var c=this.parseShape(a.shapes);c=this.parseGeometries(a.geometries,c);var d=this.parseImages(a.images,function(){void 0!==b&&b(e)});d=this.parseTextures(a.textures,d);d=this.parseMaterials(a.materials,d);var e=this.parseObject(a.object,c,d);a.animations&&(e.animations=this.parseAnimations(a.animations));void 0!==a.images&&0!==a.images.length||void 0===b||b(e);return e},parseShape:function(a){var b={};if(void 0!==a)for(var c=0,d=a.length;c<d;c++){var e=(new nb).fromJSON(a[c]);
-b[e.uuid]=e}return b},parseGeometries:function(a,b){var c={};if(void 0!==a)for(var d=new pe,e=0,f=a.length;e<f;e++){var g=a[e];switch(g.type){case "PlaneGeometry":case "PlaneBufferGeometry":var h=new ya[g.type](g.width,g.height,g.widthSegments,g.heightSegments);break;case "BoxGeometry":case "BoxBufferGeometry":case "CubeGeometry":h=new ya[g.type](g.width,g.height,g.depth,g.widthSegments,g.heightSegments,g.depthSegments);break;case "CircleGeometry":case "CircleBufferGeometry":h=new ya[g.type](g.radius,
-g.segments,g.thetaStart,g.thetaLength);break;case "CylinderGeometry":case "CylinderBufferGeometry":h=new ya[g.type](g.radiusTop,g.radiusBottom,g.height,g.radialSegments,g.heightSegments,g.openEnded,g.thetaStart,g.thetaLength);break;case "ConeGeometry":case "ConeBufferGeometry":h=new ya[g.type](g.radius,g.height,g.radialSegments,g.heightSegments,g.openEnded,g.thetaStart,g.thetaLength);break;case "SphereGeometry":case "SphereBufferGeometry":h=new ya[g.type](g.radius,g.widthSegments,g.heightSegments,
-g.phiStart,g.phiLength,g.thetaStart,g.thetaLength);break;case "DodecahedronGeometry":case "DodecahedronBufferGeometry":case "IcosahedronGeometry":case "IcosahedronBufferGeometry":case "OctahedronGeometry":case "OctahedronBufferGeometry":case "TetrahedronGeometry":case "TetrahedronBufferGeometry":h=new ya[g.type](g.radius,g.detail);break;case "RingGeometry":case "RingBufferGeometry":h=new ya[g.type](g.innerRadius,g.outerRadius,g.thetaSegments,g.phiSegments,g.thetaStart,g.thetaLength);break;case "TorusGeometry":case "TorusBufferGeometry":h=
-new ya[g.type](g.radius,g.tube,g.radialSegments,g.tubularSegments,g.arc);break;case "TorusKnotGeometry":case "TorusKnotBufferGeometry":h=new ya[g.type](g.radius,g.tube,g.tubularSegments,g.radialSegments,g.p,g.q);break;case "TubeGeometry":case "TubeBufferGeometry":h=new ya[g.type]((new Ne[g.path.type]).fromJSON(g.path),g.tubularSegments,g.radius,g.radialSegments,g.closed);break;case "LatheGeometry":case "LatheBufferGeometry":h=new ya[g.type](g.points,g.segments,g.phiStart,g.phiLength);break;case "PolyhedronGeometry":case "PolyhedronBufferGeometry":h=
-new ya[g.type](g.vertices,g.indices,g.radius,g.details);break;case "ShapeGeometry":case "ShapeBufferGeometry":h=[];for(var k=0,m=g.shapes.length;k<m;k++){var l=b[g.shapes[k]];h.push(l)}h=new ya[g.type](h,g.curveSegments);break;case "ExtrudeGeometry":case "ExtrudeBufferGeometry":h=[];k=0;for(m=g.shapes.length;k<m;k++)l=b[g.shapes[k]],h.push(l);k=g.options.extrudePath;void 0!==k&&(g.options.extrudePath=(new Ne[k.type]).fromJSON(k));h=new ya[g.type](h,g.options);break;case "BufferGeometry":h=d.parse(g);
-break;case "Geometry":"THREE"in window&&"LegacyJSONLoader"in THREE?h=(new THREE.LegacyJSONLoader).parse(g,this.resourcePath).geometry:console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+g.type+'"');continue}h.uuid=g.uuid;void 0!==g.name&&(h.name=g.name);!0===h.isBufferGeometry&&void 0!==g.userData&&(h.userData=g.userData);c[g.uuid]=h}return c},parseMaterials:function(a,
-b){var c={},d={};if(void 0!==a){var e=new Td;e.setTextures(b);b=0;for(var f=a.length;b<f;b++){var g=a[b];if("MultiMaterial"===g.type){for(var h=[],k=0;k<g.materials.length;k++){var m=g.materials[k];void 0===c[m.uuid]&&(c[m.uuid]=e.parse(m));h.push(c[m.uuid])}d[g.uuid]=h}else void 0===c[g.uuid]&&(c[g.uuid]=e.parse(g)),d[g.uuid]=c[g.uuid]}}return d},parseAnimations:function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=Ia.parse(d);void 0!==d.uuid&&(e.uuid=d.uuid);b.push(e)}return b},parseImages:function(a,
-b){function c(a){d.manager.itemStart(a);return f.load(a,function(){d.manager.itemEnd(a)},void 0,function(){d.manager.itemError(a);d.manager.itemEnd(a)})}var d=this,e={};if(void 0!==a&&0<a.length){b=new le(b);var f=new id(b);f.setCrossOrigin(this.crossOrigin);b=0;for(var g=a.length;b<g;b++){var h=a[b],k=h.url;if(Array.isArray(k)){e[h.uuid]=[];for(var m=0,l=k.length;m<l;m++){var n=k[m];n=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:d.resourcePath+n;e[h.uuid].push(c(n))}}else n=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)?
-h.url:d.resourcePath+h.url,e[h.uuid]=c(n)}}return e},parseTextures:function(a,b){function c(a,b){if("number"===typeof a)return a;console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",a);return b[a]}var d={};if(void 0!==a)for(var e=0,f=a.length;e<f;e++){var g=a[e];void 0===g.image&&console.warn('THREE.ObjectLoader: No "image" specified for',g.uuid);void 0===b[g.image]&&console.warn("THREE.ObjectLoader: Undefined image",g.image);var h=Array.isArray(b[g.image])?new bb(b[g.image]):
-new W(b[g.image]);h.needsUpdate=!0;h.uuid=g.uuid;void 0!==g.name&&(h.name=g.name);void 0!==g.mapping&&(h.mapping=c(g.mapping,oh));void 0!==g.offset&&h.offset.fromArray(g.offset);void 0!==g.repeat&&h.repeat.fromArray(g.repeat);void 0!==g.center&&h.center.fromArray(g.center);void 0!==g.rotation&&(h.rotation=g.rotation);void 0!==g.wrap&&(h.wrapS=c(g.wrap[0],Sf),h.wrapT=c(g.wrap[1],Sf));void 0!==g.format&&(h.format=g.format);void 0!==g.type&&(h.type=g.type);void 0!==g.encoding&&(h.encoding=g.encoding);
-void 0!==g.minFilter&&(h.minFilter=c(g.minFilter,Tf));void 0!==g.magFilter&&(h.magFilter=c(g.magFilter,Tf));void 0!==g.anisotropy&&(h.anisotropy=g.anisotropy);void 0!==g.flipY&&(h.flipY=g.flipY);void 0!==g.premultiplyAlpha&&(h.premultiplyAlpha=g.premultiplyAlpha);void 0!==g.unpackAlignment&&(h.unpackAlignment=g.unpackAlignment);d[g.uuid]=h}return d},parseObject:function(a,b,c){function d(a){void 0===b[a]&&console.warn("THREE.ObjectLoader: Undefined geometry",a);return b[a]}function e(a){if(void 0!==
-a){if(Array.isArray(a)){for(var b=[],d=0,e=a.length;d<e;d++){var f=a[d];void 0===c[f]&&console.warn("THREE.ObjectLoader: Undefined material",f);b.push(c[f])}return b}void 0===c[a]&&console.warn("THREE.ObjectLoader: Undefined material",a);return c[a]}}switch(a.type){case "Scene":var f=new Ad;void 0!==a.background&&Number.isInteger(a.background)&&(f.background=new M(a.background));void 0!==a.fog&&("Fog"===a.fog.type?f.fog=new zd(a.fog.color,a.fog.near,a.fog.far):"FogExp2"===a.fog.type&&(f.fog=new yd(a.fog.color,
-a.fog.density)));break;case "PerspectiveCamera":f=new ja(a.fov,a.aspect,a.near,a.far);void 0!==a.focus&&(f.focus=a.focus);void 0!==a.zoom&&(f.zoom=a.zoom);void 0!==a.filmGauge&&(f.filmGauge=a.filmGauge);void 0!==a.filmOffset&&(f.filmOffset=a.filmOffset);void 0!==a.view&&(f.view=Object.assign({},a.view));break;case "OrthographicCamera":f=new ld(a.left,a.right,a.top,a.bottom,a.near,a.far);void 0!==a.zoom&&(f.zoom=a.zoom);void 0!==a.view&&(f.view=Object.assign({},a.view));break;case "AmbientLight":f=
-new Rd(a.color,a.intensity);break;case "DirectionalLight":f=new Qd(a.color,a.intensity);break;case "PointLight":f=new Od(a.color,a.intensity,a.distance,a.decay);break;case "RectAreaLight":f=new Sd(a.color,a.intensity,a.width,a.height);break;case "SpotLight":f=new Nd(a.color,a.intensity,a.distance,a.angle,a.penumbra,a.decay);break;case "HemisphereLight":f=new Ld(a.color,a.groundColor,a.intensity);break;case "SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");
-case "Mesh":f=d(a.geometry);var g=e(a.material);f=f.bones&&0<f.bones.length?new Kc(f,g):new va(f,g);void 0!==a.drawMode&&f.setDrawMode(a.drawMode);break;case "LOD":f=new Jc;break;case "Line":f=new oa(d(a.geometry),e(a.material),a.mode);break;case "LineLoop":f=new Cd(d(a.geometry),e(a.material));break;case "LineSegments":f=new V(d(a.geometry),e(a.material));break;case "PointCloud":case "Points":f=new Xb(d(a.geometry),e(a.material));break;case "Sprite":f=new Ic(e(a.material));break;case "Group":f=new Vb;
-break;default:f=new C}f.uuid=a.uuid;void 0!==a.name&&(f.name=a.name);void 0!==a.matrix?(f.matrix.fromArray(a.matrix),void 0!==a.matrixAutoUpdate&&(f.matrixAutoUpdate=a.matrixAutoUpdate),f.matrixAutoUpdate&&f.matrix.decompose(f.position,f.quaternion,f.scale)):(void 0!==a.position&&f.position.fromArray(a.position),void 0!==a.rotation&&f.rotation.fromArray(a.rotation),void 0!==a.quaternion&&f.quaternion.fromArray(a.quaternion),void 0!==a.scale&&f.scale.fromArray(a.scale));void 0!==a.castShadow&&(f.castShadow=
-a.castShadow);void 0!==a.receiveShadow&&(f.receiveShadow=a.receiveShadow);a.shadow&&(void 0!==a.shadow.bias&&(f.shadow.bias=a.shadow.bias),void 0!==a.shadow.radius&&(f.shadow.radius=a.shadow.radius),void 0!==a.shadow.mapSize&&f.shadow.mapSize.fromArray(a.shadow.mapSize),void 0!==a.shadow.camera&&(f.shadow.camera=this.parseObject(a.shadow.camera)));void 0!==a.visible&&(f.visible=a.visible);void 0!==a.frustumCulled&&(f.frustumCulled=a.frustumCulled);void 0!==a.renderOrder&&(f.renderOrder=a.renderOrder);
-void 0!==a.userData&&(f.userData=a.userData);void 0!==a.layers&&(f.layers.mask=a.layers);if(void 0!==a.children){g=a.children;for(var h=0;h<g.length;h++)f.add(this.parseObject(g[h],b,c))}if("LOD"===a.type)for(a=a.levels,g=0;g<a.length;g++){h=a[g];var k=f.getObjectByProperty("uuid",h.object);void 0!==k&&f.addLevel(k,h.distance)}return f}});var oh={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,
-CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},Sf={RepeatWrapping:1E3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},Tf={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008};re.prototype={constructor:re,setOptions:function(a){this.options=a;return this},load:function(a,b,c,d){void 0===a&&(a="");void 0!==this.path&&(a=this.path+a);a=this.manager.resolveURL(a);var e=this,f=Ob.get(a);
-if(void 0!==f)return e.manager.itemStart(a),setTimeout(function(){b&&b(f);e.manager.itemEnd(a)},0),f;fetch(a).then(function(a){return a.blob()}).then(function(a){return void 0===e.options?createImageBitmap(a):createImageBitmap(a,e.options)}).then(function(c){Ob.add(a,c);b&&b(c);e.manager.itemEnd(a)}).catch(function(b){d&&d(b);e.manager.itemError(a);e.manager.itemEnd(a)});e.manager.itemStart(a)},setCrossOrigin:function(){return this},setPath:function(a){this.path=a;return this}};Object.assign(se.prototype,
-{moveTo:function(a,b){this.currentPath=new Ra;this.subPaths.push(this.currentPath);this.currentPath.moveTo(a,b)},lineTo:function(a,b){this.currentPath.lineTo(a,b)},quadraticCurveTo:function(a,b,c,d){this.currentPath.quadraticCurveTo(a,b,c,d)},bezierCurveTo:function(a,b,c,d,e,f){this.currentPath.bezierCurveTo(a,b,c,d,e,f)},splineThru:function(a){this.currentPath.splineThru(a)},toShapes:function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new nb;f.curves=e.curves;b.push(f)}return b}
-function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,m=h.y-g.y;if(Math.abs(m)>Number.EPSILON){if(0>m&&(g=b[f],k=-k,h=b[e],m=-m),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=m*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=cb.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new nb;h.curves=g.curves;
-b.push(h);return b}var k=!e(f[0].getPoints());k=a?!k:k;h=[];var m=[],l=[],n=0;m[n]=void 0;l[n]=[];for(var v=0,t=f.length;v<t;v++){g=f[v];var r=g.getPoints();var u=e(r);(u=a?!u:u)?(!k&&m[n]&&n++,m[n]={s:new nb,p:r},m[n].s.curves=g.curves,k&&n++,l[n]=[]):l[n].push({h:g,p:r[0]})}if(!m[0])return c(f);if(1<m.length){v=!1;a=[];e=0;for(f=m.length;e<f;e++)h[e]=[];e=0;for(f=m.length;e<f;e++)for(g=l[e],u=0;u<g.length;u++){k=g[u];n=!0;for(r=0;r<m.length;r++)d(k.p,m[r].p)&&(e!==r&&a.push({froms:e,tos:r,hole:u}),
-n?(n=!1,h[r].push(k)):v=!0);n&&h[e].push(k)}0<a.length&&(v||(l=h))}v=0;for(e=m.length;v<e;v++)for(h=m[v].s,b.push(h),a=l[v],f=0,g=a.length;f<g;f++)h.holes.push(a[f].h);return b}});Object.assign(te.prototype,{isFont:!0,generateShapes:function(a,b){void 0===b&&(b=100);var c=[],d=b;b=this.data;var e=Array.from?Array.from(a):String(a).split("");d/=b.resolution;var f=(b.boundingBox.yMax-b.boundingBox.yMin+b.underlineThickness)*d;a=[];for(var g=0,h=0,k=0;k<e.length;k++){var m=e[k];if("\n"===m)g=0,h-=f;
-else{var l=d;var n=g,v=h;if(m=b.glyphs[m]||b.glyphs["?"]){var t=new se;if(m.o)for(var r=m._cachedOutline||(m._cachedOutline=m.o.split(" ")),u=0,x=r.length;u<x;)switch(r[u++]){case "m":var A=r[u++]*l+n;var w=r[u++]*l+v;t.moveTo(A,w);break;case "l":A=r[u++]*l+n;w=r[u++]*l+v;t.lineTo(A,w);break;case "q":var y=r[u++]*l+n;var z=r[u++]*l+v;var B=r[u++]*l+n;var C=r[u++]*l+v;t.quadraticCurveTo(B,C,y,z);break;case "b":y=r[u++]*l+n,z=r[u++]*l+v,B=r[u++]*l+n,C=r[u++]*l+v,A=r[u++]*l+n,w=r[u++]*l+v,t.bezierCurveTo(B,
-C,A,w,y,z)}l={offsetX:m.ha*l,path:t}}else l=void 0;g+=l.offsetX;a.push(l.path)}}b=0;for(e=a.length;b<e;b++)Array.prototype.push.apply(c,a[b].toShapes());return c}});Object.assign(Gf.prototype,{load:function(a,b,c,d){var e=this,f=new Ma(this.manager);f.setPath(this.path);f.load(a,function(a){try{var c=JSON.parse(a)}catch(k){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),c=JSON.parse(a.substring(65,a.length-2))}a=e.parse(c);b&&b(a)},c,d)},parse:function(a){return new te(a)},
-setPath:function(a){this.path=a;return this}});md.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=this.handlers,c=0,d=b.length;c<d;c+=2){var e=b[c+1];if(b[c].test(a))return e}return null}};Object.assign(md.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(a,b,c){for(var d=[],e=0;e<a.length;++e)d[e]=this.createMaterial(a[e],b,c);return d},createMaterial:function(){var a=
-{NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},b=new M,c=new Kd,d=new Td;return function(e,f,g){function h(a,b,d,e,h){a=f+a;var l=md.Handlers.get(a);null!==l?a=l.load(a):(c.setCrossOrigin(g),a=c.load(a));void 0!==b&&(a.repeat.fromArray(b),1!==b[0]&&(a.wrapS=1E3),1!==b[1]&&(a.wrapT=1E3));void 0!==d&&a.offset.fromArray(d);void 0!==e&&("repeat"===e[0]&&(a.wrapS=1E3),"mirror"===e[0]&&(a.wrapS=1002),"repeat"===e[1]&&(a.wrapT=1E3),"mirror"===
-e[1]&&(a.wrapT=1002));void 0!==h&&(a.anisotropy=h);b=K.generateUUID();k[b]=a;return b}var k={},l={uuid:K.generateUUID(),type:"MeshLambertMaterial"},n;for(n in e){var q=e[n];switch(n){case "DbgColor":case "DbgIndex":case "opticalDensity":case "illumination":break;case "DbgName":l.name=q;break;case "blending":l.blending=a[q];break;case "colorAmbient":case "mapAmbient":console.warn("THREE.Loader.createMaterial:",n,"is no longer supported.");break;case "colorDiffuse":l.color=b.fromArray(q).getHex();break;
-case "colorSpecular":l.specular=b.fromArray(q).getHex();break;case "colorEmissive":l.emissive=b.fromArray(q).getHex();break;case "specularCoef":l.shininess=q;break;case "shading":"basic"===q.toLowerCase()&&(l.type="MeshBasicMaterial");"phong"===q.toLowerCase()&&(l.type="MeshPhongMaterial");"standard"===q.toLowerCase()&&(l.type="MeshStandardMaterial");break;case "mapDiffuse":l.map=h(q,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case "mapDiffuseRepeat":case "mapDiffuseOffset":case "mapDiffuseWrap":case "mapDiffuseAnisotropy":break;
-case "mapEmissive":l.emissiveMap=h(q,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case "mapEmissiveRepeat":case "mapEmissiveOffset":case "mapEmissiveWrap":case "mapEmissiveAnisotropy":break;case "mapLight":l.lightMap=h(q,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case "mapLightRepeat":case "mapLightOffset":case "mapLightWrap":case "mapLightAnisotropy":break;case "mapAO":l.aoMap=h(q,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,
-e.mapAOAnisotropy);break;case "mapAORepeat":case "mapAOOffset":case "mapAOWrap":case "mapAOAnisotropy":break;case "mapBump":l.bumpMap=h(q,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case "mapBumpScale":l.bumpScale=q;break;case "mapBumpRepeat":case "mapBumpOffset":case "mapBumpWrap":case "mapBumpAnisotropy":break;case "mapNormal":l.normalMap=h(q,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case "mapNormalFactor":l.normalScale=q;break;
-case "mapNormalRepeat":case "mapNormalOffset":case "mapNormalWrap":case "mapNormalAnisotropy":break;case "mapSpecular":l.specularMap=h(q,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case "mapSpecularRepeat":case "mapSpecularOffset":case "mapSpecularWrap":case "mapSpecularAnisotropy":break;case "mapMetalness":l.metalnessMap=h(q,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case "mapMetalnessRepeat":case "mapMetalnessOffset":case "mapMetalnessWrap":case "mapMetalnessAnisotropy":break;
-case "mapRoughness":l.roughnessMap=h(q,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case "mapRoughnessRepeat":case "mapRoughnessOffset":case "mapRoughnessWrap":case "mapRoughnessAnisotropy":break;case "mapAlpha":l.alphaMap=h(q,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case "mapAlphaRepeat":case "mapAlphaOffset":case "mapAlphaWrap":case "mapAlphaAnisotropy":break;case "flipSided":l.side=1;break;case "doubleSided":l.side=
-2;break;case "transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity");l.opacity=q;break;case "depthTest":case "depthWrite":case "colorWrite":case "opacity":case "reflectivity":case "transparent":case "visible":case "wireframe":l[n]=q;break;case "vertexColors":!0===q&&(l.vertexColors=2);"face"===q&&(l.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",n,q)}}"MeshBasicMaterial"===l.type&&delete l.emissive;"MeshPhongMaterial"!==
-l.type&&delete l.specular;1>l.opacity&&(l.transparent=!0);d.setTextures(k);return d.parse(l)}}()});var Zd,xe={getContext:function(){void 0===Zd&&(Zd=new (window.AudioContext||window.webkitAudioContext));return Zd},setContext:function(a){Zd=a}};Object.assign(ue.prototype,{load:function(a,b,c,d){var e=new Ma(this.manager);e.setResponseType("arraybuffer");e.setPath(this.path);e.load(a,function(a){a=a.slice(0);xe.getContext().decodeAudioData(a,function(a){b(a)})},c,d)},setPath:function(a){this.path=a;
-return this}});Object.assign(Hf.prototype,{update:function(){var a,b,c,d,e,f,g,h,k=new P,l=new P;return function(m){if(a!==this||b!==m.focus||c!==m.fov||d!==m.aspect*this.aspect||e!==m.near||f!==m.far||g!==m.zoom||h!==this.eyeSep){a=this;b=m.focus;c=m.fov;d=m.aspect*this.aspect;e=m.near;f=m.far;g=m.zoom;var n=m.projectionMatrix.clone();h=this.eyeSep/2;var p=h*e/b,t=e*Math.tan(K.DEG2RAD*c*.5)/g;l.elements[12]=-h;k.elements[12]=h;var r=-t*d+p;var u=t*d+p;n.elements[0]=2*e/(u-r);n.elements[8]=(u+r)/
-(u-r);this.cameraL.projectionMatrix.copy(n);r=-t*d-p;u=t*d-p;n.elements[0]=2*e/(u-r);n.elements[8]=(u+r)/(u-r);this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(m.matrixWorld).multiply(l);this.cameraR.matrixWorld.copy(m.matrixWorld).multiply(k)}}()});nd.prototype=Object.create(C.prototype);nd.prototype.constructor=nd;Object.assign(ve.prototype,{start:function(){this.oldTime=this.startTime=("undefined"===typeof performance?Date:performance).now();this.elapsedTime=0;this.running=!0},
-stop:function(){this.getElapsedTime();this.autoStart=this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var b=("undefined"===typeof performance?Date:performance).now();a=(b-this.oldTime)/1E3;this.oldTime=b;this.elapsedTime+=a}return a}});we.prototype=Object.assign(Object.create(C.prototype),{constructor:we,getInput:function(){return this.gain},removeFilter:function(){null!==
+a.defines);void 0!==a.vertexShader&&(d.vertexShader=a.vertexShader);void 0!==a.fragmentShader&&(d.fragmentShader=a.fragmentShader);if(void 0!==a.extensions)for(var g in a.extensions)d.extensions[g]=a.extensions[g];void 0!==a.shading&&(d.flatShading=1===a.shading);void 0!==a.size&&(d.size=a.size);void 0!==a.sizeAttenuation&&(d.sizeAttenuation=a.sizeAttenuation);void 0!==a.map&&(d.map=b(a.map));void 0!==a.matcap&&(d.matcap=b(a.matcap));void 0!==a.alphaMap&&(d.alphaMap=b(a.alphaMap),d.transparent=!0);
+void 0!==a.bumpMap&&(d.bumpMap=b(a.bumpMap));void 0!==a.bumpScale&&(d.bumpScale=a.bumpScale);void 0!==a.normalMap&&(d.normalMap=b(a.normalMap));void 0!==a.normalMapType&&(d.normalMapType=a.normalMapType);void 0!==a.normalScale&&(e=a.normalScale,!1===Array.isArray(e)&&(e=[e,e]),d.normalScale=(new B).fromArray(e));void 0!==a.displacementMap&&(d.displacementMap=b(a.displacementMap));void 0!==a.displacementScale&&(d.displacementScale=a.displacementScale);void 0!==a.displacementBias&&(d.displacementBias=
+a.displacementBias);void 0!==a.roughnessMap&&(d.roughnessMap=b(a.roughnessMap));void 0!==a.metalnessMap&&(d.metalnessMap=b(a.metalnessMap));void 0!==a.emissiveMap&&(d.emissiveMap=b(a.emissiveMap));void 0!==a.emissiveIntensity&&(d.emissiveIntensity=a.emissiveIntensity);void 0!==a.specularMap&&(d.specularMap=b(a.specularMap));void 0!==a.envMap&&(d.envMap=b(a.envMap));void 0!==a.envMapIntensity&&(d.envMapIntensity=a.envMapIntensity);void 0!==a.reflectivity&&(d.reflectivity=a.reflectivity);void 0!==a.lightMap&&
+(d.lightMap=b(a.lightMap));void 0!==a.lightMapIntensity&&(d.lightMapIntensity=a.lightMapIntensity);void 0!==a.aoMap&&(d.aoMap=b(a.aoMap));void 0!==a.aoMapIntensity&&(d.aoMapIntensity=a.aoMapIntensity);void 0!==a.gradientMap&&(d.gradientMap=b(a.gradientMap));return d},setPath:function(a){this.path=a;return this},setTextures:function(a){this.textures=a;return this}});var Oe={decodeText:function(a){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(a);for(var b="",c=0,d=a.length;c<d;c++)b+=
+String.fromCharCode(a[c]);return decodeURIComponent(escape(b))},extractUrlBase:function(a){var b=a.lastIndexOf("/");return-1===b?"./":a.substr(0,b+1)}};Object.assign(pe.prototype,{load:function(a,b,c,d){var e=this,f=new Ma(e.manager);f.setPath(e.path);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},parse:function(a){var b=new z,c=a.data.index;if(void 0!==c){var d=new Pe[c.type](c.array);b.setIndex(new S(d,1))}c=a.data.attributes;for(var e in c){var f=c[e];d=new Pe[f.type](f.array);d=new S(d,
+f.itemSize,f.normalized);void 0!==f.name&&(d.name=f.name);b.addAttribute(e,d)}var g=a.data.morphAttributes;if(g)for(e in g){var h=g[e],k=[];c=0;for(var m=h.length;c<m;c++)f=h[c],d=new Pe[f.type](f.array),d=new S(d,f.itemSize,f.normalized),void 0!==f.name&&(d.name=f.name),k.push(d);b.morphAttributes[e]=k}e=a.data.groups||a.data.drawcalls||a.data.offsets;if(void 0!==e)for(c=0,f=e.length;c!==f;++c)d=e[c],b.addGroup(d.start,d.count,d.materialIndex);c=a.data.boundingSphere;void 0!==c&&(e=new n,void 0!==
+c.center&&e.fromArray(c.center),b.boundingSphere=new Ua(e,c.radius));a.name&&(b.name=a.name);a.userData&&(b.userData=a.userData);return b},setPath:function(a){this.path=a;return this}});var Pe={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!==typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};Object.assign(qe.prototype,{crossOrigin:"anonymous",
+load:function(a,b,c,d){var e=this,f=void 0===this.path?Oe.extractUrlBase(a):this.path;this.resourcePath=this.resourcePath||f;f=new Ma(e.manager);f.setPath(this.path);f.load(a,function(c){var f=null;try{f=JSON.parse(c)}catch(k){void 0!==d&&d(k);console.error("THREE:ObjectLoader: Can't parse "+a+".",k.message);return}c=f.metadata;void 0===c||void 0===c.type||"geometry"===c.type.toLowerCase()?console.error("THREE.ObjectLoader: Can't load "+a):e.parse(f,b)},c,d)},setPath:function(a){this.path=a;return this},
+setResourcePath:function(a){this.resourcePath=a;return this},setCrossOrigin:function(a){this.crossOrigin=a;return this},parse:function(a,b){var c=this.parseShape(a.shapes);c=this.parseGeometries(a.geometries,c);var d=this.parseImages(a.images,function(){void 0!==b&&b(e)});d=this.parseTextures(a.textures,d);d=this.parseMaterials(a.materials,d);var e=this.parseObject(a.object,c,d);a.animations&&(e.animations=this.parseAnimations(a.animations));void 0!==a.images&&0!==a.images.length||void 0===b||b(e);
+return e},parseShape:function(a){var b={};if(void 0!==a)for(var c=0,d=a.length;c<d;c++){var e=(new nb).fromJSON(a[c]);b[e.uuid]=e}return b},parseGeometries:function(a,b){var c={};if(void 0!==a)for(var d=new pe,e=0,f=a.length;e<f;e++){var g=a[e];switch(g.type){case "PlaneGeometry":case "PlaneBufferGeometry":var h=new ya[g.type](g.width,g.height,g.widthSegments,g.heightSegments);break;case "BoxGeometry":case "BoxBufferGeometry":case "CubeGeometry":h=new ya[g.type](g.width,g.height,g.depth,g.widthSegments,
+g.heightSegments,g.depthSegments);break;case "CircleGeometry":case "CircleBufferGeometry":h=new ya[g.type](g.radius,g.segments,g.thetaStart,g.thetaLength);break;case "CylinderGeometry":case "CylinderBufferGeometry":h=new ya[g.type](g.radiusTop,g.radiusBottom,g.height,g.radialSegments,g.heightSegments,g.openEnded,g.thetaStart,g.thetaLength);break;case "ConeGeometry":case "ConeBufferGeometry":h=new ya[g.type](g.radius,g.height,g.radialSegments,g.heightSegments,g.openEnded,g.thetaStart,g.thetaLength);
+break;case "SphereGeometry":case "SphereBufferGeometry":h=new ya[g.type](g.radius,g.widthSegments,g.heightSegments,g.phiStart,g.phiLength,g.thetaStart,g.thetaLength);break;case "DodecahedronGeometry":case "DodecahedronBufferGeometry":case "IcosahedronGeometry":case "IcosahedronBufferGeometry":case "OctahedronGeometry":case "OctahedronBufferGeometry":case "TetrahedronGeometry":case "TetrahedronBufferGeometry":h=new ya[g.type](g.radius,g.detail);break;case "RingGeometry":case "RingBufferGeometry":h=
+new ya[g.type](g.innerRadius,g.outerRadius,g.thetaSegments,g.phiSegments,g.thetaStart,g.thetaLength);break;case "TorusGeometry":case "TorusBufferGeometry":h=new ya[g.type](g.radius,g.tube,g.radialSegments,g.tubularSegments,g.arc);break;case "TorusKnotGeometry":case "TorusKnotBufferGeometry":h=new ya[g.type](g.radius,g.tube,g.tubularSegments,g.radialSegments,g.p,g.q);break;case "TubeGeometry":case "TubeBufferGeometry":h=new ya[g.type]((new Ne[g.path.type]).fromJSON(g.path),g.tubularSegments,g.radius,
+g.radialSegments,g.closed);break;case "LatheGeometry":case "LatheBufferGeometry":h=new ya[g.type](g.points,g.segments,g.phiStart,g.phiLength);break;case "PolyhedronGeometry":case "PolyhedronBufferGeometry":h=new ya[g.type](g.vertices,g.indices,g.radius,g.details);break;case "ShapeGeometry":case "ShapeBufferGeometry":h=[];for(var k=0,m=g.shapes.length;k<m;k++){var l=b[g.shapes[k]];h.push(l)}h=new ya[g.type](h,g.curveSegments);break;case "ExtrudeGeometry":case "ExtrudeBufferGeometry":h=[];k=0;for(m=
+g.shapes.length;k<m;k++)l=b[g.shapes[k]],h.push(l);k=g.options.extrudePath;void 0!==k&&(g.options.extrudePath=(new Ne[k.type]).fromJSON(k));h=new ya[g.type](h,g.options);break;case "BufferGeometry":h=d.parse(g);break;case "Geometry":"THREE"in window&&"LegacyJSONLoader"in THREE?h=(new THREE.LegacyJSONLoader).parse(g,this.resourcePath).geometry:console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+
+g.type+'"');continue}h.uuid=g.uuid;void 0!==g.name&&(h.name=g.name);!0===h.isBufferGeometry&&void 0!==g.userData&&(h.userData=g.userData);c[g.uuid]=h}return c},parseMaterials:function(a,b){var c={},d={};if(void 0!==a){var e=new Td;e.setTextures(b);b=0;for(var f=a.length;b<f;b++){var g=a[b];if("MultiMaterial"===g.type){for(var h=[],k=0;k<g.materials.length;k++){var m=g.materials[k];void 0===c[m.uuid]&&(c[m.uuid]=e.parse(m));h.push(c[m.uuid])}d[g.uuid]=h}else void 0===c[g.uuid]&&(c[g.uuid]=e.parse(g)),
+d[g.uuid]=c[g.uuid]}}return d},parseAnimations:function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=Ia.parse(d);void 0!==d.uuid&&(e.uuid=d.uuid);b.push(e)}return b},parseImages:function(a,b){function c(a){d.manager.itemStart(a);return f.load(a,function(){d.manager.itemEnd(a)},void 0,function(){d.manager.itemError(a);d.manager.itemEnd(a)})}var d=this,e={};if(void 0!==a&&0<a.length){b=new le(b);var f=new id(b);f.setCrossOrigin(this.crossOrigin);b=0;for(var g=a.length;b<g;b++){var h=a[b],k=h.url;
+if(Array.isArray(k)){e[h.uuid]=[];for(var m=0,l=k.length;m<l;m++){var n=k[m];n=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:d.resourcePath+n;e[h.uuid].push(c(n))}}else n=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)?h.url:d.resourcePath+h.url,e[h.uuid]=c(n)}}return e},parseTextures:function(a,b){function c(a,b){if("number"===typeof a)return a;console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",a);return b[a]}var d={};if(void 0!==a)for(var e=0,f=a.length;e<f;e++){var g=a[e];void 0===
+g.image&&console.warn('THREE.ObjectLoader: No "image" specified for',g.uuid);void 0===b[g.image]&&console.warn("THREE.ObjectLoader: Undefined image",g.image);var h=Array.isArray(b[g.image])?new bb(b[g.image]):new W(b[g.image]);h.needsUpdate=!0;h.uuid=g.uuid;void 0!==g.name&&(h.name=g.name);void 0!==g.mapping&&(h.mapping=c(g.mapping,oh));void 0!==g.offset&&h.offset.fromArray(g.offset);void 0!==g.repeat&&h.repeat.fromArray(g.repeat);void 0!==g.center&&h.center.fromArray(g.center);void 0!==g.rotation&&
+(h.rotation=g.rotation);void 0!==g.wrap&&(h.wrapS=c(g.wrap[0],Sf),h.wrapT=c(g.wrap[1],Sf));void 0!==g.format&&(h.format=g.format);void 0!==g.type&&(h.type=g.type);void 0!==g.encoding&&(h.encoding=g.encoding);void 0!==g.minFilter&&(h.minFilter=c(g.minFilter,Tf));void 0!==g.magFilter&&(h.magFilter=c(g.magFilter,Tf));void 0!==g.anisotropy&&(h.anisotropy=g.anisotropy);void 0!==g.flipY&&(h.flipY=g.flipY);void 0!==g.premultiplyAlpha&&(h.premultiplyAlpha=g.premultiplyAlpha);void 0!==g.unpackAlignment&&(h.unpackAlignment=
+g.unpackAlignment);d[g.uuid]=h}return d},parseObject:function(a,b,c){function d(a){void 0===b[a]&&console.warn("THREE.ObjectLoader: Undefined geometry",a);return b[a]}function e(a){if(void 0!==a){if(Array.isArray(a)){for(var b=[],d=0,e=a.length;d<e;d++){var f=a[d];void 0===c[f]&&console.warn("THREE.ObjectLoader: Undefined material",f);b.push(c[f])}return b}void 0===c[a]&&console.warn("THREE.ObjectLoader: Undefined material",a);return c[a]}}switch(a.type){case "Scene":var f=new Ad;void 0!==a.background&&
+Number.isInteger(a.background)&&(f.background=new M(a.background));void 0!==a.fog&&("Fog"===a.fog.type?f.fog=new zd(a.fog.color,a.fog.near,a.fog.far):"FogExp2"===a.fog.type&&(f.fog=new yd(a.fog.color,a.fog.density)));break;case "PerspectiveCamera":f=new ja(a.fov,a.aspect,a.near,a.far);void 0!==a.focus&&(f.focus=a.focus);void 0!==a.zoom&&(f.zoom=a.zoom);void 0!==a.filmGauge&&(f.filmGauge=a.filmGauge);void 0!==a.filmOffset&&(f.filmOffset=a.filmOffset);void 0!==a.view&&(f.view=Object.assign({},a.view));
+break;case "OrthographicCamera":f=new ld(a.left,a.right,a.top,a.bottom,a.near,a.far);void 0!==a.zoom&&(f.zoom=a.zoom);void 0!==a.view&&(f.view=Object.assign({},a.view));break;case "AmbientLight":f=new Rd(a.color,a.intensity);break;case "DirectionalLight":f=new Qd(a.color,a.intensity);break;case "PointLight":f=new Od(a.color,a.intensity,a.distance,a.decay);break;case "RectAreaLight":f=new Sd(a.color,a.intensity,a.width,a.height);break;case "SpotLight":f=new Nd(a.color,a.intensity,a.distance,a.angle,
+a.penumbra,a.decay);break;case "HemisphereLight":f=new Ld(a.color,a.groundColor,a.intensity);break;case "SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case "Mesh":f=d(a.geometry);var g=e(a.material);f=f.bones&&0<f.bones.length?new Kc(f,g):new va(f,g);void 0!==a.drawMode&&f.setDrawMode(a.drawMode);break;case "LOD":f=new Jc;break;case "Line":f=new na(d(a.geometry),e(a.material),a.mode);break;case "LineLoop":f=new Cd(d(a.geometry),e(a.material));break;
+case "LineSegments":f=new V(d(a.geometry),e(a.material));break;case "PointCloud":case "Points":f=new Xb(d(a.geometry),e(a.material));break;case "Sprite":f=new Ic(e(a.material));break;case "Group":f=new Vb;break;default:f=new C}f.uuid=a.uuid;void 0!==a.name&&(f.name=a.name);void 0!==a.matrix?(f.matrix.fromArray(a.matrix),void 0!==a.matrixAutoUpdate&&(f.matrixAutoUpdate=a.matrixAutoUpdate),f.matrixAutoUpdate&&f.matrix.decompose(f.position,f.quaternion,f.scale)):(void 0!==a.position&&f.position.fromArray(a.position),
+void 0!==a.rotation&&f.rotation.fromArray(a.rotation),void 0!==a.quaternion&&f.quaternion.fromArray(a.quaternion),void 0!==a.scale&&f.scale.fromArray(a.scale));void 0!==a.castShadow&&(f.castShadow=a.castShadow);void 0!==a.receiveShadow&&(f.receiveShadow=a.receiveShadow);a.shadow&&(void 0!==a.shadow.bias&&(f.shadow.bias=a.shadow.bias),void 0!==a.shadow.radius&&(f.shadow.radius=a.shadow.radius),void 0!==a.shadow.mapSize&&f.shadow.mapSize.fromArray(a.shadow.mapSize),void 0!==a.shadow.camera&&(f.shadow.camera=
+this.parseObject(a.shadow.camera)));void 0!==a.visible&&(f.visible=a.visible);void 0!==a.frustumCulled&&(f.frustumCulled=a.frustumCulled);void 0!==a.renderOrder&&(f.renderOrder=a.renderOrder);void 0!==a.userData&&(f.userData=a.userData);void 0!==a.layers&&(f.layers.mask=a.layers);if(void 0!==a.children){g=a.children;for(var h=0;h<g.length;h++)f.add(this.parseObject(g[h],b,c))}if("LOD"===a.type)for(a=a.levels,g=0;g<a.length;g++){h=a[g];var k=f.getObjectByProperty("uuid",h.object);void 0!==k&&f.addLevel(k,
+h.distance)}return f}});var oh={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},Sf={RepeatWrapping:1E3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},Tf={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008};
+re.prototype={constructor:re,setOptions:function(a){this.options=a;return this},load:function(a,b,c,d){void 0===a&&(a="");void 0!==this.path&&(a=this.path+a);a=this.manager.resolveURL(a);var e=this,f=Ob.get(a);if(void 0!==f)return e.manager.itemStart(a),setTimeout(function(){b&&b(f);e.manager.itemEnd(a)},0),f;fetch(a).then(function(a){return a.blob()}).then(function(a){return void 0===e.options?createImageBitmap(a):createImageBitmap(a,e.options)}).then(function(c){Ob.add(a,c);b&&b(c);e.manager.itemEnd(a)}).catch(function(b){d&&
+d(b);e.manager.itemError(a);e.manager.itemEnd(a)});e.manager.itemStart(a)},setCrossOrigin:function(){return this},setPath:function(a){this.path=a;return this}};Object.assign(se.prototype,{moveTo:function(a,b){this.currentPath=new Ra;this.subPaths.push(this.currentPath);this.currentPath.moveTo(a,b)},lineTo:function(a,b){this.currentPath.lineTo(a,b)},quadraticCurveTo:function(a,b,c,d){this.currentPath.quadraticCurveTo(a,b,c,d)},bezierCurveTo:function(a,b,c,d,e,f){this.currentPath.bezierCurveTo(a,b,
+c,d,e,f)},splineThru:function(a){this.currentPath.splineThru(a)},toShapes:function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new nb;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,m=h.y-g.y;if(Math.abs(m)>Number.EPSILON){if(0>m&&(g=b[f],k=-k,h=b[e],m=-m),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=m*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=
+a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=cb.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new nb;h.curves=g.curves;b.push(h);return b}var k=!e(f[0].getPoints());k=a?!k:k;h=[];var m=[],l=[],n=0;m[n]=void 0;l[n]=[];for(var v=0,t=f.length;v<t;v++){g=f[v];var r=g.getPoints();var u=e(r);(u=a?!u:u)?(!k&&m[n]&&n++,m[n]={s:new nb,p:r},m[n].s.curves=g.curves,k&&n++,l[n]=[]):l[n].push({h:g,p:r[0]})}if(!m[0])return c(f);if(1<
+m.length){v=!1;a=[];e=0;for(f=m.length;e<f;e++)h[e]=[];e=0;for(f=m.length;e<f;e++)for(g=l[e],u=0;u<g.length;u++){k=g[u];n=!0;for(r=0;r<m.length;r++)d(k.p,m[r].p)&&(e!==r&&a.push({froms:e,tos:r,hole:u}),n?(n=!1,h[r].push(k)):v=!0);n&&h[e].push(k)}0<a.length&&(v||(l=h))}v=0;for(e=m.length;v<e;v++)for(h=m[v].s,b.push(h),a=l[v],f=0,g=a.length;f<g;f++)h.holes.push(a[f].h);return b}});Object.assign(te.prototype,{isFont:!0,generateShapes:function(a,b){void 0===b&&(b=100);var c=[],d=b;b=this.data;var e=Array.from?
+Array.from(a):String(a).split("");d/=b.resolution;var f=(b.boundingBox.yMax-b.boundingBox.yMin+b.underlineThickness)*d;a=[];for(var g=0,h=0,k=0;k<e.length;k++){var m=e[k];if("\n"===m)g=0,h-=f;else{var l=d;var n=g,v=h;if(m=b.glyphs[m]||b.glyphs["?"]){var t=new se;if(m.o)for(var r=m._cachedOutline||(m._cachedOutline=m.o.split(" ")),u=0,x=r.length;u<x;)switch(r[u++]){case "m":var A=r[u++]*l+n;var w=r[u++]*l+v;t.moveTo(A,w);break;case "l":A=r[u++]*l+n;w=r[u++]*l+v;t.lineTo(A,w);break;case "q":var y=r[u++]*
+l+n;var z=r[u++]*l+v;var B=r[u++]*l+n;var C=r[u++]*l+v;t.quadraticCurveTo(B,C,y,z);break;case "b":y=r[u++]*l+n,z=r[u++]*l+v,B=r[u++]*l+n,C=r[u++]*l+v,A=r[u++]*l+n,w=r[u++]*l+v,t.bezierCurveTo(B,C,A,w,y,z)}l={offsetX:m.ha*l,path:t}}else l=void 0;g+=l.offsetX;a.push(l.path)}}b=0;for(e=a.length;b<e;b++)Array.prototype.push.apply(c,a[b].toShapes());return c}});Object.assign(Gf.prototype,{load:function(a,b,c,d){var e=this,f=new Ma(this.manager);f.setPath(this.path);f.load(a,function(a){try{var c=JSON.parse(a)}catch(k){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),
+c=JSON.parse(a.substring(65,a.length-2))}a=e.parse(c);b&&b(a)},c,d)},parse:function(a){return new te(a)},setPath:function(a){this.path=a;return this}});md.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=this.handlers,c=0,d=b.length;c<d;c+=2){var e=b[c+1];if(b[c].test(a))return e}return null}};Object.assign(md.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(a,b,c){for(var d=
+[],e=0;e<a.length;++e)d[e]=this.createMaterial(a[e],b,c);return d},createMaterial:function(){var a={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},b=new M,c=new Kd,d=new Td;return function(e,f,g){function h(a,b,d,e,h){a=f+a;var l=md.Handlers.get(a);null!==l?a=l.load(a):(c.setCrossOrigin(g),a=c.load(a));void 0!==b&&(a.repeat.fromArray(b),1!==b[0]&&(a.wrapS=1E3),1!==b[1]&&(a.wrapT=1E3));void 0!==d&&a.offset.fromArray(d);void 0!==e&&("repeat"===
+e[0]&&(a.wrapS=1E3),"mirror"===e[0]&&(a.wrapS=1002),"repeat"===e[1]&&(a.wrapT=1E3),"mirror"===e[1]&&(a.wrapT=1002));void 0!==h&&(a.anisotropy=h);b=K.generateUUID();k[b]=a;return b}var k={},l={uuid:K.generateUUID(),type:"MeshLambertMaterial"},n;for(n in e){var q=e[n];switch(n){case "DbgColor":case "DbgIndex":case "opticalDensity":case "illumination":break;case "DbgName":l.name=q;break;case "blending":l.blending=a[q];break;case "colorAmbient":case "mapAmbient":console.warn("THREE.Loader.createMaterial:",
+n,"is no longer supported.");break;case "colorDiffuse":l.color=b.fromArray(q).getHex();break;case "colorSpecular":l.specular=b.fromArray(q).getHex();break;case "colorEmissive":l.emissive=b.fromArray(q).getHex();break;case "specularCoef":l.shininess=q;break;case "shading":"basic"===q.toLowerCase()&&(l.type="MeshBasicMaterial");"phong"===q.toLowerCase()&&(l.type="MeshPhongMaterial");"standard"===q.toLowerCase()&&(l.type="MeshStandardMaterial");break;case "mapDiffuse":l.map=h(q,e.mapDiffuseRepeat,e.mapDiffuseOffset,
+e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case "mapDiffuseRepeat":case "mapDiffuseOffset":case "mapDiffuseWrap":case "mapDiffuseAnisotropy":break;case "mapEmissive":l.emissiveMap=h(q,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case "mapEmissiveRepeat":case "mapEmissiveOffset":case "mapEmissiveWrap":case "mapEmissiveAnisotropy":break;case "mapLight":l.lightMap=h(q,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case "mapLightRepeat":case "mapLightOffset":case "mapLightWrap":case "mapLightAnisotropy":break;
+case "mapAO":l.aoMap=h(q,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case "mapAORepeat":case "mapAOOffset":case "mapAOWrap":case "mapAOAnisotropy":break;case "mapBump":l.bumpMap=h(q,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case "mapBumpScale":l.bumpScale=q;break;case "mapBumpRepeat":case "mapBumpOffset":case "mapBumpWrap":case "mapBumpAnisotropy":break;case "mapNormal":l.normalMap=h(q,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);
+break;case "mapNormalFactor":l.normalScale=q;break;case "mapNormalRepeat":case "mapNormalOffset":case "mapNormalWrap":case "mapNormalAnisotropy":break;case "mapSpecular":l.specularMap=h(q,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case "mapSpecularRepeat":case "mapSpecularOffset":case "mapSpecularWrap":case "mapSpecularAnisotropy":break;case "mapMetalness":l.metalnessMap=h(q,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);
+break;case "mapMetalnessRepeat":case "mapMetalnessOffset":case "mapMetalnessWrap":case "mapMetalnessAnisotropy":break;case "mapRoughness":l.roughnessMap=h(q,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case "mapRoughnessRepeat":case "mapRoughnessOffset":case "mapRoughnessWrap":case "mapRoughnessAnisotropy":break;case "mapAlpha":l.alphaMap=h(q,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case "mapAlphaRepeat":case "mapAlphaOffset":case "mapAlphaWrap":case "mapAlphaAnisotropy":break;
+case "flipSided":l.side=1;break;case "doubleSided":l.side=2;break;case "transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity");l.opacity=q;break;case "depthTest":case "depthWrite":case "colorWrite":case "opacity":case "reflectivity":case "transparent":case "visible":case "wireframe":l[n]=q;break;case "vertexColors":!0===q&&(l.vertexColors=2);"face"===q&&(l.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",n,q)}}"MeshBasicMaterial"===
+l.type&&delete l.emissive;"MeshPhongMaterial"!==l.type&&delete l.specular;1>l.opacity&&(l.transparent=!0);d.setTextures(k);return d.parse(l)}}()});var Zd,xe={getContext:function(){void 0===Zd&&(Zd=new (window.AudioContext||window.webkitAudioContext));return Zd},setContext:function(a){Zd=a}};Object.assign(ue.prototype,{load:function(a,b,c,d){var e=new Ma(this.manager);e.setResponseType("arraybuffer");e.setPath(this.path);e.load(a,function(a){a=a.slice(0);xe.getContext().decodeAudioData(a,function(a){b(a)})},
+c,d)},setPath:function(a){this.path=a;return this}});Object.assign(Hf.prototype,{update:function(){var a,b,c,d,e,f,g,h,k=new P,l=new P;return function(m){if(a!==this||b!==m.focus||c!==m.fov||d!==m.aspect*this.aspect||e!==m.near||f!==m.far||g!==m.zoom||h!==this.eyeSep){a=this;b=m.focus;c=m.fov;d=m.aspect*this.aspect;e=m.near;f=m.far;g=m.zoom;var n=m.projectionMatrix.clone();h=this.eyeSep/2;var p=h*e/b,t=e*Math.tan(K.DEG2RAD*c*.5)/g;l.elements[12]=-h;k.elements[12]=h;var r=-t*d+p;var u=t*d+p;n.elements[0]=
+2*e/(u-r);n.elements[8]=(u+r)/(u-r);this.cameraL.projectionMatrix.copy(n);r=-t*d-p;u=t*d-p;n.elements[0]=2*e/(u-r);n.elements[8]=(u+r)/(u-r);this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(m.matrixWorld).multiply(l);this.cameraR.matrixWorld.copy(m.matrixWorld).multiply(k)}}()});nd.prototype=Object.create(C.prototype);nd.prototype.constructor=nd;Object.assign(ve.prototype,{start:function(){this.oldTime=this.startTime=("undefined"===typeof performance?Date:performance).now();this.elapsedTime=
+0;this.running=!0},stop:function(){this.getElapsedTime();this.autoStart=this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var b=("undefined"===typeof performance?Date:performance).now();a=(b-this.oldTime)/1E3;this.oldTime=b;this.elapsedTime+=a}return a}});we.prototype=Object.assign(Object.create(C.prototype),{constructor:we,getInput:function(){return this.gain},removeFilter:function(){null!==
 this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null);return this},getFilter:function(){return this.filter},setFilter:function(a){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination);this.filter=a;this.gain.connect(this.filter);this.filter.connect(this.context.destination);return this},getMasterVolume:function(){return this.gain.gain.value},
 setMasterVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this},updateMatrixWorld:function(){var a=new n,b=new aa,c=new n,d=new n,e=new ve;return function(f){C.prototype.updateMatrixWorld.call(this,f);f=this.context.listener;var g=this.up;this.timeDelta=e.getDelta();this.matrixWorld.decompose(a,b,c);d.set(0,0,-1).applyQuaternion(b);if(f.positionX){var h=this.context.currentTime+this.timeDelta;f.positionX.linearRampToValueAtTime(a.x,h);f.positionY.linearRampToValueAtTime(a.y,
 h);f.positionZ.linearRampToValueAtTime(a.z,h);f.forwardX.linearRampToValueAtTime(d.x,h);f.forwardY.linearRampToValueAtTime(d.y,h);f.forwardZ.linearRampToValueAtTime(d.z,h);f.upX.linearRampToValueAtTime(g.x,h);f.upY.linearRampToValueAtTime(g.y,h);f.upZ.linearRampToValueAtTime(g.z,h)}else f.setPosition(a.x,a.y,a.z),f.setOrientation(d.x,d.y,d.z,g.x,g.y,g.z)}}()});oc.prototype=Object.assign(Object.create(C.prototype),{constructor:oc,getOutput:function(){return this.gain},setNodeSource:function(a){this.hasPlaybackControl=
@@ -827,22 +827,22 @@ e);if(!0!==this.hasPlaybackControl||!1!==this.isPlaying)if(this.matrixWorld.deco
 a.z),e.setOrientation(d.x,d.y,d.z)}}()});Object.assign(ze.prototype,{getFrequencyData:function(){this.analyser.getByteFrequencyData(this.data);return this.data},getAverageFrequency:function(){for(var a=0,b=this.getFrequencyData(),c=0;c<b.length;c++)a+=b[c];return a/b.length}});Object.assign(Ae.prototype,{accumulate:function(a,b){var c=this.buffer,d=this.valueSize;a=a*d+d;var e=this.cumulativeWeight;if(0===e){for(e=0;e!==d;++e)c[a+e]=c[e];e=b}else e+=b,this._mixBufferRegion(c,a,0,b/e,d);this.cumulativeWeight=
 e},apply:function(a){var b=this.valueSize,c=this.buffer;a=a*b+b;var d=this.cumulativeWeight,e=this.binding;this.cumulativeWeight=0;1>d&&this._mixBufferRegion(c,a,3*b,1-d,b);d=b;for(var f=b+b;d!==f;++d)if(c[d]!==c[d+b]){e.setValue(c,a);break}},saveOriginalState:function(){var a=this.buffer,b=this.valueSize,c=3*b;this.binding.getValue(a,c);for(var d=b;d!==c;++d)a[d]=a[c+d%b];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(a,
 b,c,d,e){if(.5<=d)for(d=0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d){aa.slerpFlat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d,e){for(var f=1-d,g=0;g!==e;++g){var h=b+g;a[h]=a[h]*f+a[c+g]*d}}});Object.assign(If.prototype,{getValue:function(a,b){this.bind();var c=this._bindings[this._targetGroup.nCachedObjects_];void 0!==c&&c.getValue(a,b)},setValue:function(a,b){for(var c=this._bindings,d=this._targetGroup.nCachedObjects_,e=c.length;d!==e;++d)c[d].setValue(a,b)},bind:function(){for(var a=this._bindings,
-b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()},unbind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].unbind()}});Object.assign(ma,{Composite:If,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new ma.Composite(a,b,c):new ma(a,b,c)},sanitizeNodeName:function(){var a=/[\[\]\.:\/]/g;return function(b){return b.replace(/\s/g,"_").replace(a,"")}}(),parseTrackName:function(){var a="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",
+b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()},unbind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].unbind()}});Object.assign(la,{Composite:If,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new la.Composite(a,b,c):new la(a,b,c)},sanitizeNodeName:function(){var a=/[\[\]\.:\/]/g;return function(b){return b.replace(/\s/g,"_").replace(a,"")}}(),parseTrackName:function(){var a="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",
 b=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]");a=/(WCOD+)?/.source.replace("WCOD",a);var c=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),d=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),e=new RegExp("^"+b+a+c+d+"$"),f=["material","materials","bones"];return function(a){var b=e.exec(a);if(!b)throw Error("PropertyBinding: Cannot parse trackName: "+a);b={nodeName:b[2],objectName:b[3],objectIndex:b[4],propertyName:b[5],propertyIndex:b[6]};var c=b.nodeName&&
 b.nodeName.lastIndexOf(".");if(void 0!==c&&-1!==c){var d=b.nodeName.substring(c+1);-1!==f.indexOf(d)&&(b.nodeName=b.nodeName.substring(0,c),b.objectName=d)}if(null===b.propertyName||0===b.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+a);return b}}(),findNode:function(a,b){if(!b||""===b||"root"===b||"."===b||-1===b||b===a.name||b===a.uuid)return a;if(a.skeleton){var c=a.skeleton.getBoneByName(b);if(void 0!==c)return c}if(a.children){var d=function(a){for(var c=
-0;c<a.length;c++){var e=a[c];if(e.name===b||e.uuid===b||(e=d(e.children)))return e}return null};if(a=d(a.children))return a}return null}});Object.assign(ma.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(a,b){a[b]=this.node[this.propertyName]},function(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)a[b++]=
+0;c<a.length;c++){var e=a[c];if(e.name===b||e.uuid===b||(e=d(e.children)))return e}return null};if(a=d(a.children))return a}return null}});Object.assign(la.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(a,b){a[b]=this.node[this.propertyName]},function(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)a[b++]=
 c[d]},function(a,b){a[b]=this.resolvedProperty[this.propertyIndex]},function(a,b){this.resolvedProperty.toArray(a,b)}],SetterByBindingTypeAndVersioning:[[function(a,b){this.targetObject[this.propertyName]=a[b]},function(a,b){this.targetObject[this.propertyName]=a[b];this.targetObject.needsUpdate=!0},function(a,b){this.targetObject[this.propertyName]=a[b];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)c[d]=a[b++]},function(a,b){for(var c=
 this.resolvedProperty,d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.needsUpdate=!0},function(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,b){this.resolvedProperty[this.propertyIndex]=a[b]},function(a,b){this.resolvedProperty[this.propertyIndex]=a[b];this.targetObject.needsUpdate=!0},function(a,b){this.resolvedProperty[this.propertyIndex]=a[b];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,b){this.resolvedProperty.fromArray(a,
-b)},function(a,b){this.resolvedProperty.fromArray(a,b);this.targetObject.needsUpdate=!0},function(a,b){this.resolvedProperty.fromArray(a,b);this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(a,b){this.bind();this.getValue(a,b)},setValue:function(a,b){this.bind();this.setValue(a,b)},bind:function(){var a=this.node,b=this.parsedPath,c=b.objectName,d=b.propertyName,e=b.propertyIndex;a||(this.node=a=ma.findNode(this.rootNode,b.nodeName)||this.rootNode);this.getValue=this._getValue_unavailable;
+b)},function(a,b){this.resolvedProperty.fromArray(a,b);this.targetObject.needsUpdate=!0},function(a,b){this.resolvedProperty.fromArray(a,b);this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(a,b){this.bind();this.getValue(a,b)},setValue:function(a,b){this.bind();this.setValue(a,b)},bind:function(){var a=this.node,b=this.parsedPath,c=b.objectName,d=b.propertyName,e=b.propertyIndex;a||(this.node=a=la.findNode(this.rootNode,b.nodeName)||this.rootNode);this.getValue=this._getValue_unavailable;
 this.setValue=this._setValue_unavailable;if(a){if(c){var f=b.objectIndex;switch(c){case "materials":if(!a.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!a.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}a=a.material.materials;break;case "bones":if(!a.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",
 this);return}a=a.skeleton.bones;for(c=0;c<a.length;c++)if(a[c].name===f){f=c;break}break;default:if(void 0===a[c]){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}a=a[c]}if(void 0!==f){if(void 0===a[f]){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,a);return}a=a[f]}}f=a[d];if(void 0===f)console.error("THREE.PropertyBinding: Trying to update property for track: "+b.nodeName+"."+d+" but it wasn't found.",
 a);else{b=this.Versioning.None;this.targetObject=a;void 0!==a.needsUpdate?b=this.Versioning.NeedsUpdate:void 0!==a.matrixWorldNeedsUpdate&&(b=this.Versioning.MatrixWorldNeedsUpdate);c=this.BindingType.Direct;if(void 0!==e){if("morphTargetInfluences"===d){if(!a.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(a.geometry.isBufferGeometry){if(!a.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",
 this);return}for(c=0;c<this.node.geometry.morphAttributes.position.length;c++)if(a.geometry.morphAttributes.position[c].name===e){e=c;break}}else{if(!a.geometry.morphTargets){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);return}for(c=0;c<this.node.geometry.morphTargets.length;c++)if(a.geometry.morphTargets[c].name===e){e=c;break}}}c=this.BindingType.ArrayElement;this.resolvedProperty=f;this.propertyIndex=e}else void 0!==
 f.fromArray&&void 0!==f.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=f):Array.isArray(f)?(c=this.BindingType.EntireArray,this.resolvedProperty=f):this.propertyName=d;this.getValue=this.GetterByBindingType[c];this.setValue=this.SetterByBindingTypeAndVersioning[c][b]}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null;this.getValue=this._getValue_unbound;this.setValue=this._setValue_unbound}});
-Object.assign(ma.prototype,{_getValue_unbound:ma.prototype.getValue,_setValue_unbound:ma.prototype.setValue});Object.assign(Jf.prototype,{isAnimationObjectGroup:!0,add:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._paths,f=this._parsedPaths,g=this._bindings,h=g.length,k=void 0,l=0,n=arguments.length;l!==n;++l){var q=arguments[l],v=q.uuid,t=d[v];if(void 0===t){t=b++;d[v]=t;a.push(q);v=0;for(var r=h;v!==r;++v)g[v].push(new ma(q,e[v],f[v]))}else if(t<
-c){k=a[t];var u=--c;r=a[u];d[r.uuid]=t;a[t]=r;d[v]=u;a[u]=q;v=0;for(r=h;v!==r;++v){var x=g[v],z=x[t];x[t]=x[u];void 0===z&&(z=new ma(q,e[v],f[v]));x[u]=z}}else a[t]!==k&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c},remove:function(){for(var a=this._objects,b=this.nCachedObjects_,c=this._indicesByUUID,d=this._bindings,e=d.length,f=0,g=arguments.length;f!==g;++f){var h=
+Object.assign(la.prototype,{_getValue_unbound:la.prototype.getValue,_setValue_unbound:la.prototype.setValue});Object.assign(Jf.prototype,{isAnimationObjectGroup:!0,add:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._paths,f=this._parsedPaths,g=this._bindings,h=g.length,k=void 0,l=0,n=arguments.length;l!==n;++l){var q=arguments[l],v=q.uuid,t=d[v];if(void 0===t){t=b++;d[v]=t;a.push(q);v=0;for(var r=h;v!==r;++v)g[v].push(new la(q,e[v],f[v]))}else if(t<
+c){k=a[t];var u=--c;r=a[u];d[r.uuid]=t;a[t]=r;d[v]=u;a[u]=q;v=0;for(r=h;v!==r;++v){var x=g[v],z=x[t];x[t]=x[u];void 0===z&&(z=new la(q,e[v],f[v]));x[u]=z}}else a[t]!==k&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c},remove:function(){for(var a=this._objects,b=this.nCachedObjects_,c=this._indicesByUUID,d=this._bindings,e=d.length,f=0,g=arguments.length;f!==g;++f){var h=
 arguments[f],k=h.uuid,l=c[k];if(void 0!==l&&l>=b){var n=b++,q=a[n];c[q.uuid]=l;a[l]=q;c[k]=n;a[n]=h;h=0;for(k=e;h!==k;++h){q=d[h];var v=q[l];q[l]=q[n];q[n]=v}}}this.nCachedObjects_=b},uncache:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var k=arguments[g].uuid,l=d[k];if(void 0!==l)if(delete d[k],l<c){k=--c;var n=a[k],q=--b,v=a[q];d[n.uuid]=l;a[l]=n;d[v.uuid]=k;a[k]=v;a.pop();n=0;for(v=f;n!==
-v;++n){var t=e[n],r=t[q];t[l]=t[k];t[k]=r;t.pop()}}else for(q=--b,v=a[q],d[v.uuid]=l,a[l]=v,a.pop(),n=0,v=f;n!==v;++n)t=e[n],t[l]=t[q],t.pop()}this.nCachedObjects_=c},subscribe_:function(a,b){var c=this._bindingsIndicesByPath,d=c[a],e=this._bindings;if(void 0!==d)return e[d];var f=this._paths,g=this._parsedPaths,h=this._objects,k=this.nCachedObjects_,l=Array(h.length);d=e.length;c[a]=d;f.push(a);g.push(b);e.push(l);c=k;for(d=h.length;c!==d;++c)l[c]=new ma(h[c],a,b);return l},unsubscribe_:function(a){var b=
+v;++n){var t=e[n],r=t[q];t[l]=t[k];t[k]=r;t.pop()}}else for(q=--b,v=a[q],d[v.uuid]=l,a[l]=v,a.pop(),n=0,v=f;n!==v;++n)t=e[n],t[l]=t[q],t.pop()}this.nCachedObjects_=c},subscribe_:function(a,b){var c=this._bindingsIndicesByPath,d=c[a],e=this._bindings;if(void 0!==d)return e[d];var f=this._paths,g=this._parsedPaths,h=this._objects,k=this.nCachedObjects_,l=Array(h.length);d=e.length;c[a]=d;f.push(a);g.push(b);e.push(l);c=k;for(d=h.length;c!==d;++c)l[c]=new la(h[c],a,b);return l},unsubscribe_:function(a){var b=
 this._bindingsIndicesByPath,c=b[a];if(void 0!==c){var d=this._paths,e=this._parsedPaths,f=this._bindings,g=f.length-1,h=f[g];b[a[g]]=c;f[c]=h;f.pop();e[c]=e[g];e.pop();d[c]=d[g];d.pop()}}});Object.assign(Kf.prototype,{play:function(){this._mixer._activateAction(this);return this},stop:function(){this._mixer._deactivateAction(this);return this.reset()},reset:function(){this.paused=!1;this.enabled=!0;this.time=0;this._loopCount=-1;this._startTime=null;return this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&
 !this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(a){this._startTime=a;return this},setLoop:function(a,b){this.loop=a;this.repetitions=b;return this},setEffectiveWeight:function(a){this.weight=a;this._effectiveWeight=this.enabled?a:0;return this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(a){return this._scheduleFading(a,0,1)},fadeOut:function(a){return this._scheduleFading(a,
 1,0)},crossFadeFrom:function(a,b,c){a.fadeOut(b);this.fadeIn(b);if(c){c=this._clip.duration;var d=a._clip.duration,e=c/d;a.warp(1,d/c,b);this.warp(e,1,b)}return this},crossFadeTo:function(a,b,c){return a.crossFadeFrom(this,b,c)},stopFading:function(){var a=this._weightInterpolant;null!==a&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(a));return this},setEffectiveTimeScale:function(a){this.timeScale=a;this._effectiveTimeScale=this.paused?0:a;return this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},
@@ -852,7 +852,7 @@ e=this._propertyBindings;for(var f=0,g=b.length;f!==g;++f)b[f].evaluate(c),e[f].
 b*=d;a>c.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale=b},_updateTime:function(a){var b=this.time+a,c=this._clip.duration,d=this.loop,e=this._loopCount,f=2202===d;if(0===a)return-1===e?b:f&&1===(e&1)?c-b:b;if(2200===d)a:{if(-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1)),b>=c)b=c;else if(0>b)b=0;else break a;this.clampWhenFinished?this.paused=!0:this.enabled=!1;this._mixer.dispatchEvent({type:"finished",action:this,direction:0>
 a?-1:1})}else{-1===e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions,f)):this._setEndings(0===this.repetitions,!0,f));if(b>=c||0>b){d=Math.floor(b/c);b-=c*d;e+=Math.abs(d);var g=this.repetitions-e;0>=g?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,b=0<a?c:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<a?1:-1})):(1===g?(a=0>a,this._setEndings(a,!a,f)):this._setEndings(!1,!1,f),this._loopCount=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:d}))}if(f&&
 1===(e&1))return this.time=b,c-b}return this.time=b},_setEndings:function(a,b,c){var d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(d.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,d.endingEnd=b?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(a,b,c){var d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(this._weightInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;f[0]=b;d[1]=e+a;f[1]=c;return this}});Be.prototype=
-Object.assign(Object.create(ta.prototype),{constructor:Be,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var l=d[h],n=l.name,q=k[n];if(void 0===q){q=f[h];if(void 0!==q){null===q._cacheIndex&&(++q.referenceCount,this._addInactiveBinding(q,g,n));continue}q=new Ae(ma.create(c,n,b&&b._propertyBindings[h].binding.parsedPath),l.ValueTypeName,
+Object.assign(Object.create(ta.prototype),{constructor:Be,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var l=d[h],n=l.name,q=k[n];if(void 0===q){q=f[h];if(void 0!==q){null===q._cacheIndex&&(++q.referenceCount,this._addInactiveBinding(q,g,n));continue}q=new Ae(la.create(c,n,b&&b._propertyBindings[h].binding.parsedPath),l.ValueTypeName,
 l.getValueSize());++q.referenceCount;this._addInactiveBinding(q,g,n)}f[h]=q;a[h].resultBuffer=q.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,d&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b=
 a._propertyBindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length},
 get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex;return null!==a&&a<this._nActiveActions},_addInactiveAction:function(a,b,c){var d=this._actions,e=this._actionsByClip,f=e[b];void 0===f?(f={knownActions:[a],actionByRoot:{}},a._byClipCacheIndex=0,e[b]=f):(b=f.knownActions,a._byClipCacheIndex=b.length,b.push(a));a._cacheIndex=d.length;d.push(a);
@@ -881,10 +881,10 @@ this.geometry.attributes.position,g=this.object.geometry;if(g&&g.isGeometry)for(
 d.getZ(v)).applyMatrix4(e),b.set(h.getX(v),h.getY(v),h.getZ(v)),b.applyMatrix3(c).normalize().multiplyScalar(this.size).add(a),f.setXYZ(g,a.x,a.y,a.z),g+=1,f.setXYZ(g,b.x,b.y,b.z),g+=1;f.needsUpdate=!0}}();pc.prototype=Object.create(C.prototype);pc.prototype.constructor=pc;pc.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};pc.prototype.update=function(){var a=new n;return function(){this.light.updateMatrixWorld();var b=this.light.distance?this.light.distance:
 1E3,c=b*Math.tan(this.light.angle);this.cone.scale.set(c,c,b);a.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(a);void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}();qc.prototype=Object.create(V.prototype);qc.prototype.constructor=qc;qc.prototype.updateMatrixWorld=function(){var a=new n,b=new P,c=new P;return function(d){var e=this.bones,f=this.geometry,g=f.getAttribute("position");c.getInverse(this.root.matrixWorld);
 for(var h=0,k=0;h<e.length;h++){var l=e[h];l.parent&&l.parent.isBone&&(b.multiplyMatrices(c,l.matrixWorld),a.setFromMatrixPosition(b),g.setXYZ(k,a.x,a.y,a.z),b.multiplyMatrices(c,l.parent.matrixWorld),a.setFromMatrixPosition(b),g.setXYZ(k+1,a.x,a.y,a.z),k+=2)}f.getAttribute("position").needsUpdate=!0;C.prototype.updateMatrixWorld.call(this,d)}}();rc.prototype=Object.create(va.prototype);rc.prototype.constructor=rc;rc.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};rc.prototype.update=
-function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};sc.prototype=Object.create(oa.prototype);sc.prototype.constructor=sc;sc.prototype.update=function(){this.scale.set(.5*this.light.width,.5*this.light.height,1);if(void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var a=this.material.color,b=Math.max(a.r,
+function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};sc.prototype=Object.create(na.prototype);sc.prototype.constructor=sc;sc.prototype.update=function(){this.scale.set(.5*this.light.width,.5*this.light.height,1);if(void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var a=this.material.color,b=Math.max(a.r,
 a.g,a.b);1<b&&a.multiplyScalar(1/b);this.children[0].material.color.copy(this.material.color)}};sc.prototype.dispose=function(){this.geometry.dispose();this.material.dispose();this.children[0].geometry.dispose();this.children[0].material.dispose()};tc.prototype=Object.create(C.prototype);tc.prototype.constructor=tc;tc.prototype.dispose=function(){this.children[0].geometry.dispose();this.children[0].material.dispose()};tc.prototype.update=function(){var a=new n,b=new M,c=new M;return function(){var d=
 this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=d.geometry.getAttribute("color");b.copy(this.light.color);c.copy(this.light.groundColor);for(var f=0,g=e.count;f<g;f++){var h=f<g/2?b:c;e.setXYZ(f,h.r,h.g,h.b)}e.needsUpdate=!0}d.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate())}}();Vd.prototype=Object.assign(Object.create(V.prototype),{constructor:Vd,copy:function(a){V.prototype.copy.call(this,a);this.geometry.copy(a.geometry);this.material.copy(a.material);
-return this},clone:function(){return(new this.constructor).copy(this)}});Wd.prototype=Object.create(V.prototype);Wd.prototype.constructor=Wd;uc.prototype=Object.create(oa.prototype);uc.prototype.constructor=uc;uc.prototype.update=function(){function a(a,b,d,e){d=(b-a)/d;t.setXYZ(k,0,0,0);l++;for(n=a;n<b;n+=d)q=k+l,t.setXYZ(q,Math.sin(n)*c,0,Math.cos(n)*c),t.setXYZ(q+1,Math.sin(Math.min(n+d,b))*c,0,Math.cos(Math.min(n+d,b))*c),t.setXYZ(q+2,0,0,0),l+=3;v.addGroup(k,l,e);k+=l;l=0}var b=this.audio,c=
+return this},clone:function(){return(new this.constructor).copy(this)}});Wd.prototype=Object.create(V.prototype);Wd.prototype.constructor=Wd;uc.prototype=Object.create(na.prototype);uc.prototype.constructor=uc;uc.prototype.update=function(){function a(a,b,d,e){d=(b-a)/d;t.setXYZ(k,0,0,0);l++;for(n=a;n<b;n+=d)q=k+l,t.setXYZ(q,Math.sin(n)*c,0,Math.cos(n)*c),t.setXYZ(q+1,Math.sin(Math.min(n+d,b))*c,0,Math.cos(Math.min(n+d,b))*c),t.setXYZ(q+2,0,0,0),l+=3;v.addGroup(k,l,e);k+=l;l=0}var b=this.audio,c=
 this.range,d=this.divisionsInnerAngle,e=this.divisionsOuterAngle,f=K.degToRad(b.panner.coneInnerAngle);b=K.degToRad(b.panner.coneOuterAngle);var g=f/2,h=b/2,k=0,l=0,n,q,v=this.geometry,t=v.attributes.position;v.clearGroups();a(-h,-g,e,0);a(-g,g,d,1);a(g,h,e,0);t.needsUpdate=!0;f===b&&(this.material[0].visible=!1)};uc.prototype.dispose=function(){this.geometry.dispose();this.material[0].dispose();this.material[1].dispose()};qd.prototype=Object.create(V.prototype);qd.prototype.constructor=qd;qd.prototype.update=
 function(){var a=new n,b=new n,c=new ba;return function(){this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var d=this.object.matrixWorld,e=this.geometry.attributes.position,f=this.object.geometry,g=f.vertices;f=f.faces;for(var h=0,k=0,l=f.length;k<l;k++){var n=f[k],q=n.normal;a.copy(g[n.a]).add(g[n.b]).add(g[n.c]).divideScalar(3).applyMatrix4(d);b.copy(q).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);e.setXYZ(h,a.x,a.y,a.z);h+=1;e.setXYZ(h,b.x,b.y,b.z);h+=
 1}e.needsUpdate=!0}}();vc.prototype=Object.create(C.prototype);vc.prototype.constructor=vc;vc.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};vc.prototype.update=function(){var a=new n,b=new n,c=new n;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(b);void 0!==this.color?
@@ -892,7 +892,7 @@ function(){var a=new n,b=new n,c=new ba;return function(){this.object.updateMatr
 d.x,d.y,d.z)}var b,c,d=new n,e=new Xa;return function(){b=this.geometry;c=this.pointMap;e.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse);a("c",0,0,-1);a("t",0,0,1);a("n1",-1,-1,-1);a("n2",1,-1,-1);a("n3",-1,1,-1);a("n4",1,1,-1);a("f1",-1,-1,1);a("f2",1,-1,1);a("f3",-1,1,1);a("f4",1,1,1);a("u1",.7,1.1,-1);a("u2",-.7,1.1,-1);a("u3",0,2,-1);a("cf1",-1,0,1);a("cf2",1,0,1);a("cf3",0,-1,1);a("cf4",0,1,1);a("cn1",-1,0,-1);a("cn2",1,0,-1);a("cn3",0,-1,-1);a("cn4",0,1,-1);b.getAttribute("position").needsUpdate=
 !0}}();fb.prototype=Object.create(V.prototype);fb.prototype.constructor=fb;fb.prototype.update=function(){var a=new Ja;return function(b){void 0!==b&&console.warn("THREE.BoxHelper: .update() has no longer arguments.");void 0!==this.object&&a.setFromObject(this.object);if(!a.isEmpty()){b=a.min;var c=a.max,d=this.geometry.attributes.position,e=d.array;e[0]=c.x;e[1]=c.y;e[2]=c.z;e[3]=b.x;e[4]=c.y;e[5]=c.z;e[6]=b.x;e[7]=b.y;e[8]=c.z;e[9]=c.x;e[10]=b.y;e[11]=c.z;e[12]=c.x;e[13]=c.y;e[14]=b.z;e[15]=b.x;
 e[16]=c.y;e[17]=b.z;e[18]=b.x;e[19]=b.y;e[20]=b.z;e[21]=c.x;e[22]=b.y;e[23]=b.z;d.needsUpdate=!0;this.geometry.computeBoundingSphere()}}}();fb.prototype.setFromObject=function(a){this.object=a;this.update();return this};fb.prototype.copy=function(a){V.prototype.copy.call(this,a);this.object=a.object;return this};fb.prototype.clone=function(){return(new this.constructor).copy(this)};sd.prototype=Object.create(V.prototype);sd.prototype.constructor=sd;sd.prototype.updateMatrixWorld=function(a){var b=
-this.box;b.isEmpty()||(b.getCenter(this.position),b.getSize(this.scale),this.scale.multiplyScalar(.5),C.prototype.updateMatrixWorld.call(this,a))};td.prototype=Object.create(oa.prototype);td.prototype.constructor=td;td.prototype.updateMatrixWorld=function(a){var b=-this.plane.constant;1E-8>Math.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side=0>b?1:0;this.lookAt(this.plane.normal);C.prototype.updateMatrixWorld.call(this,a)};var Xd,Ie;gb.prototype=Object.create(C.prototype);
+this.box;b.isEmpty()||(b.getCenter(this.position),b.getSize(this.scale),this.scale.multiplyScalar(.5),C.prototype.updateMatrixWorld.call(this,a))};td.prototype=Object.create(na.prototype);td.prototype.constructor=td;td.prototype.updateMatrixWorld=function(a){var b=-this.plane.constant;1E-8>Math.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side=0>b?1:0;this.lookAt(this.plane.normal);C.prototype.updateMatrixWorld.call(this,a)};var Xd,Ie;gb.prototype=Object.create(C.prototype);
 gb.prototype.constructor=gb;gb.prototype.setDirection=function(){var a=new n,b;return function(c){.99999<c.y?this.quaternion.set(0,0,0,1):-.99999>c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();gb.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,Math.max(0,a-b),1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};gb.prototype.setColor=
 function(a){this.line.material.color.copy(a);this.cone.material.color.copy(a)};gb.prototype.copy=function(a){C.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};gb.prototype.clone=function(){return(new this.constructor).copy(this)};ud.prototype=Object.create(V.prototype);ud.prototype.constructor=ud;I.create=function(a,b){console.log("THREE.Curve.create() has been deprecated");a.prototype=Object.create(I.prototype);a.prototype.constructor=a;a.prototype.getPoint=
 b;return a};Object.assign(eb.prototype,{createPointsGeometry:function(a){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getPoints(a);return this.createGeometry(a)},createSpacedPointsGeometry:function(a){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getSpacedPoints(a);return this.createGeometry(a)},createGeometry:function(a){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");
@@ -947,29 +947,29 @@ this.texture.repeat=a}},format:{get:function(){console.warn("THREE.WebGLRenderTa
 return this.texture.generateMipmaps},set:function(a){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");this.texture.generateMipmaps=a}}});Object.defineProperties(tf.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}});oc.prototype.load=function(a){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");
 var b=this;(new ue).load(a,function(a){b.setBuffer(a)});return this};ze.prototype.getData=function(){console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData().");return this.getFrequencyData()};nd.prototype.updateCubeMap=function(a,b){console.warn("THREE.CubeCamera: .updateCubeMap() is now .update().");return this.update(a,b)};ob.crossOrigin=void 0;ob.loadTexture=function(a,b,c,d){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var e=
 new Kd;e.setCrossOrigin(this.crossOrigin);a=e.load(a,c,void 0,d);b&&(a.mapping=b);return a};ob.loadTextureCube=function(a,b,c,d){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var e=new ne;e.setCrossOrigin(this.crossOrigin);a=e.load(a,c,void 0,d);b&&(a.mapping=b);return a};ob.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")};ob.loadCompressedTextureCube=
-function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};l.WebGLMultisampleRenderTarget=$d;l.WebGLRenderTargetCube=pb;l.WebGLRenderTarget=Ta;l.WebGLRenderer=ge;l.ShaderLib=Wa;l.UniformsLib=G;l.UniformsUtils=kh;l.ShaderChunk=T;l.FogExp2=yd;l.Fog=zd;l.Scene=Ad;l.Sprite=Ic;l.LOD=Jc;l.SkinnedMesh=Kc;l.Skeleton=Bd;l.Bone=he;l.Mesh=va;l.LineSegments=V;l.LineLoop=Cd;l.Line=oa;l.Points=Xb;l.Group=Vb;l.VideoTexture=ie;l.DataTexture=qb;l.DataTexture2DArray=
+function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};l.WebGLMultisampleRenderTarget=$d;l.WebGLRenderTargetCube=pb;l.WebGLRenderTarget=Ta;l.WebGLRenderer=ge;l.ShaderLib=Wa;l.UniformsLib=G;l.UniformsUtils=kh;l.ShaderChunk=T;l.FogExp2=yd;l.Fog=zd;l.Scene=Ad;l.Sprite=Ic;l.LOD=Jc;l.SkinnedMesh=Kc;l.Skeleton=Bd;l.Bone=he;l.Mesh=va;l.LineSegments=V;l.LineLoop=Cd;l.Line=na;l.Points=Xb;l.Group=Vb;l.VideoTexture=ie;l.DataTexture=qb;l.DataTexture2DArray=
 Sb;l.DataTexture3D=Tb;l.CompressedTexture=Yb;l.CubeTexture=bb;l.CanvasTexture=Lc;l.DepthTexture=Mc;l.Texture=W;l.AnimationLoader=Df;l.CompressedTextureLoader=Ef;l.DataTextureLoader=me;l.CubeTextureLoader=ne;l.TextureLoader=Kd;l.ObjectLoader=qe;l.MaterialLoader=Td;l.BufferGeometryLoader=pe;l.DefaultLoadingManager=za;l.LoadingManager=le;l.ImageLoader=id;l.ImageBitmapLoader=re;l.FontLoader=Gf;l.FileLoader=Ma;l.Loader=md;l.LoaderUtils=Oe;l.Cache=Ob;l.AudioLoader=ue;l.SpotLightShadow=Md;l.SpotLight=Nd;
 l.PointLight=Od;l.RectAreaLight=Sd;l.HemisphereLight=Ld;l.DirectionalLightShadow=Pd;l.DirectionalLight=Qd;l.AmbientLight=Rd;l.LightShadow=Nb;l.Light=ea;l.StereoCamera=Hf;l.PerspectiveCamera=ja;l.OrthographicCamera=ld;l.CubeCamera=nd;l.ArrayCamera=Gc;l.Camera=Xa;l.AudioListener=we;l.PositionalAudio=ye;l.AudioContext=xe;l.AudioAnalyser=ze;l.Audio=oc;l.VectorKeyframeTrack=mc;l.StringKeyframeTrack=Jd;l.QuaternionKeyframeTrack=hd;l.NumberKeyframeTrack=lc;l.ColorKeyframeTrack=Hd;l.BooleanKeyframeTrack=
-Gd;l.PropertyMixer=Ae;l.PropertyBinding=ma;l.KeyframeTrack=la;l.AnimationUtils=pa;l.AnimationObjectGroup=Jf;l.AnimationMixer=Be;l.AnimationClip=Ia;l.Uniform=Ud;l.InstancedBufferGeometry=Ce;l.BufferGeometry=z;l.Geometry=N;l.InterleavedBufferAttribute=Hc;l.InstancedInterleavedBuffer=De;l.InterleavedBuffer=xb;l.InstancedBufferAttribute=Ee;l.Face3=Qb;l.Object3D=C;l.Raycaster=Lf;l.Layers=be;l.EventDispatcher=ta;l.Clock=ve;l.QuaternionLinearInterpolant=Id;l.LinearInterpolant=gd;l.DiscreteInterpolant=Fd;
+Gd;l.PropertyMixer=Ae;l.PropertyBinding=la;l.KeyframeTrack=ka;l.AnimationUtils=pa;l.AnimationObjectGroup=Jf;l.AnimationMixer=Be;l.AnimationClip=Ia;l.Uniform=Ud;l.InstancedBufferGeometry=Ce;l.BufferGeometry=z;l.Geometry=N;l.InterleavedBufferAttribute=Hc;l.InstancedInterleavedBuffer=De;l.InterleavedBuffer=xb;l.InstancedBufferAttribute=Ee;l.Face3=Qb;l.Object3D=C;l.Raycaster=Lf;l.Layers=be;l.EventDispatcher=ta;l.Clock=ve;l.QuaternionLinearInterpolant=Id;l.LinearInterpolant=gd;l.DiscreteInterpolant=Fd;
 l.CubicInterpolant=Ed;l.Interpolant=Fa;l.Triangle=ra;l.Math=K;l.Spherical=Nf;l.Cylindrical=Of;l.Plane=Va;l.Frustum=vd;l.Sphere=Ua;l.Ray=wb;l.Matrix4=P;l.Matrix3=ba;l.Box3=Ja;l.Box2=Ge;l.Line3=He;l.Euler=rb;l.Vector4=Y;l.Vector3=n;l.Vector2=B;l.Quaternion=aa;l.Color=M;l.ImmediateRenderObject=od;l.VertexNormalsHelper=pd;l.SpotLightHelper=pc;l.SkeletonHelper=qc;l.PointLightHelper=rc;l.RectAreaLightHelper=sc;l.HemisphereLightHelper=tc;l.GridHelper=Vd;l.PolarGridHelper=Wd;l.PositionalAudioHelper=uc;l.FaceNormalsHelper=
 qd;l.DirectionalLightHelper=vc;l.CameraHelper=rd;l.BoxHelper=fb;l.Box3Helper=sd;l.PlaneHelper=td;l.ArrowHelper=gb;l.AxesHelper=ud;l.Shape=nb;l.Path=Ra;l.ShapePath=se;l.Font=te;l.CurvePath=eb;l.Curve=I;l.ImageUtils=ob;l.ShapeUtils=cb;l.WebGLUtils=pf;l.WireframeGeometry=Zb;l.ParametricGeometry=Nc;l.ParametricBufferGeometry=$b;l.TetrahedronGeometry=Pc;l.TetrahedronBufferGeometry=ac;l.OctahedronGeometry=Qc;l.OctahedronBufferGeometry=yb;l.IcosahedronGeometry=Rc;l.IcosahedronBufferGeometry=bc;l.DodecahedronGeometry=
-Sc;l.DodecahedronBufferGeometry=cc;l.PolyhedronGeometry=Oc;l.PolyhedronBufferGeometry=ka;l.TubeGeometry=Tc;l.TubeBufferGeometry=zb;l.TorusKnotGeometry=Uc;l.TorusKnotBufferGeometry=dc;l.TorusGeometry=Vc;l.TorusBufferGeometry=ec;l.TextGeometry=$c;l.TextBufferGeometry=fc;l.SphereGeometry=ad;l.SphereBufferGeometry=Cb;l.RingGeometry=bd;l.RingBufferGeometry=gc;l.PlaneGeometry=Dc;l.PlaneBufferGeometry=vb;l.LatheGeometry=cd;l.LatheBufferGeometry=hc;l.ShapeGeometry=Db;l.ShapeBufferGeometry=Eb;l.ExtrudeGeometry=
+Sc;l.DodecahedronBufferGeometry=cc;l.PolyhedronGeometry=Oc;l.PolyhedronBufferGeometry=oa;l.TubeGeometry=Tc;l.TubeBufferGeometry=zb;l.TorusKnotGeometry=Uc;l.TorusKnotBufferGeometry=dc;l.TorusGeometry=Vc;l.TorusBufferGeometry=ec;l.TextGeometry=$c;l.TextBufferGeometry=fc;l.SphereGeometry=ad;l.SphereBufferGeometry=Cb;l.RingGeometry=bd;l.RingBufferGeometry=gc;l.PlaneGeometry=Dc;l.PlaneBufferGeometry=vb;l.LatheGeometry=cd;l.LatheBufferGeometry=hc;l.ShapeGeometry=Db;l.ShapeBufferGeometry=Eb;l.ExtrudeGeometry=
 Bb;l.ExtrudeBufferGeometry=Ya;l.EdgesGeometry=ic;l.ConeGeometry=dd;l.ConeBufferGeometry=ed;l.CylinderGeometry=Fb;l.CylinderBufferGeometry=db;l.CircleGeometry=fd;l.CircleBufferGeometry=jc;l.BoxGeometry=Rb;l.CubeGeometry=Rb;l.BoxBufferGeometry=ub;l.ShadowMaterial=Gb;l.SpriteMaterial=mb;l.RawShaderMaterial=kc;l.ShaderMaterial=Ca;l.PointsMaterial=Ka;l.MeshPhysicalMaterial=Hb;l.MeshStandardMaterial=Za;l.MeshPhongMaterial=La;l.MeshToonMaterial=Ib;l.MeshNormalMaterial=Jb;l.MeshLambertMaterial=Kb;l.MeshDepthMaterial=
 ib;l.MeshDistanceMaterial=jb;l.MeshBasicMaterial=Da;l.MeshMatcapMaterial=Lb;l.LineDashedMaterial=Mb;l.LineBasicMaterial=R;l.Material=O;l.Float64BufferAttribute=Cc;l.Float32BufferAttribute=E;l.Uint32BufferAttribute=tb;l.Int32BufferAttribute=Bc;l.Uint16BufferAttribute=sb;l.Int16BufferAttribute=Ac;l.Uint8ClampedBufferAttribute=zc;l.Uint8BufferAttribute=yc;l.Int8BufferAttribute=xc;l.BufferAttribute=S;l.ArcCurve=nc;l.CatmullRomCurve3=qa;l.CubicBezierCurve=Na;l.CubicBezierCurve3=$a;l.EllipseCurve=Ga;l.LineCurve=
-xa;l.LineCurve3=Oa;l.QuadraticBezierCurve=Pa;l.QuadraticBezierCurve3=ab;l.SplineCurve=Qa;l.REVISION="103";l.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2};l.CullFaceNone=0;l.CullFaceBack=1;l.CullFaceFront=2;l.CullFaceFrontBack=3;l.FrontFaceDirectionCW=0;l.FrontFaceDirectionCCW=1;l.BasicShadowMap=0;l.PCFShadowMap=1;l.PCFSoftShadowMap=2;l.FrontSide=0;l.BackSide=1;l.DoubleSide=2;l.FlatShading=1;l.SmoothShading=2;l.NoColors=0;l.FaceColors=1;l.VertexColors=2;l.NoBlending=0;l.NormalBlending=1;l.AdditiveBlending=2;l.SubtractiveBlending=
-3;l.MultiplyBlending=4;l.CustomBlending=5;l.AddEquation=100;l.SubtractEquation=101;l.ReverseSubtractEquation=102;l.MinEquation=103;l.MaxEquation=104;l.ZeroFactor=200;l.OneFactor=201;l.SrcColorFactor=202;l.OneMinusSrcColorFactor=203;l.SrcAlphaFactor=204;l.OneMinusSrcAlphaFactor=205;l.DstAlphaFactor=206;l.OneMinusDstAlphaFactor=207;l.DstColorFactor=208;l.OneMinusDstColorFactor=209;l.SrcAlphaSaturateFactor=210;l.NeverDepth=0;l.AlwaysDepth=1;l.LessDepth=2;l.LessEqualDepth=3;l.EqualDepth=4;l.GreaterEqualDepth=
-5;l.GreaterDepth=6;l.NotEqualDepth=7;l.MultiplyOperation=0;l.MixOperation=1;l.AddOperation=2;l.NoToneMapping=0;l.LinearToneMapping=1;l.ReinhardToneMapping=2;l.Uncharted2ToneMapping=3;l.CineonToneMapping=4;l.ACESFilmicToneMapping=5;l.UVMapping=300;l.CubeReflectionMapping=301;l.CubeRefractionMapping=302;l.EquirectangularReflectionMapping=303;l.EquirectangularRefractionMapping=304;l.SphericalReflectionMapping=305;l.CubeUVReflectionMapping=306;l.CubeUVRefractionMapping=307;l.RepeatWrapping=1E3;l.ClampToEdgeWrapping=
-1001;l.MirroredRepeatWrapping=1002;l.NearestFilter=1003;l.NearestMipMapNearestFilter=1004;l.NearestMipMapLinearFilter=1005;l.LinearFilter=1006;l.LinearMipMapNearestFilter=1007;l.LinearMipMapLinearFilter=1008;l.UnsignedByteType=1009;l.ByteType=1010;l.ShortType=1011;l.UnsignedShortType=1012;l.IntType=1013;l.UnsignedIntType=1014;l.FloatType=1015;l.HalfFloatType=1016;l.UnsignedShort4444Type=1017;l.UnsignedShort5551Type=1018;l.UnsignedShort565Type=1019;l.UnsignedInt248Type=1020;l.AlphaFormat=1021;l.RGBFormat=
-1022;l.RGBAFormat=1023;l.LuminanceFormat=1024;l.LuminanceAlphaFormat=1025;l.RGBEFormat=1023;l.DepthFormat=1026;l.DepthStencilFormat=1027;l.RedFormat=1028;l.RGB_S3TC_DXT1_Format=33776;l.RGBA_S3TC_DXT1_Format=33777;l.RGBA_S3TC_DXT3_Format=33778;l.RGBA_S3TC_DXT5_Format=33779;l.RGB_PVRTC_4BPPV1_Format=35840;l.RGB_PVRTC_2BPPV1_Format=35841;l.RGBA_PVRTC_4BPPV1_Format=35842;l.RGBA_PVRTC_2BPPV1_Format=35843;l.RGB_ETC1_Format=36196;l.RGBA_ASTC_4x4_Format=37808;l.RGBA_ASTC_5x4_Format=37809;l.RGBA_ASTC_5x5_Format=
-37810;l.RGBA_ASTC_6x5_Format=37811;l.RGBA_ASTC_6x6_Format=37812;l.RGBA_ASTC_8x5_Format=37813;l.RGBA_ASTC_8x6_Format=37814;l.RGBA_ASTC_8x8_Format=37815;l.RGBA_ASTC_10x5_Format=37816;l.RGBA_ASTC_10x6_Format=37817;l.RGBA_ASTC_10x8_Format=37818;l.RGBA_ASTC_10x10_Format=37819;l.RGBA_ASTC_12x10_Format=37820;l.RGBA_ASTC_12x12_Format=37821;l.LoopOnce=2200;l.LoopRepeat=2201;l.LoopPingPong=2202;l.InterpolateDiscrete=2300;l.InterpolateLinear=2301;l.InterpolateSmooth=2302;l.ZeroCurvatureEnding=2400;l.ZeroSlopeEnding=
-2401;l.WrapAroundEnding=2402;l.TrianglesDrawMode=0;l.TriangleStripDrawMode=1;l.TriangleFanDrawMode=2;l.LinearEncoding=3E3;l.sRGBEncoding=3001;l.GammaEncoding=3007;l.RGBEEncoding=3002;l.LogLuvEncoding=3003;l.RGBM7Encoding=3004;l.RGBM16Encoding=3005;l.RGBDEncoding=3006;l.BasicDepthPacking=3200;l.RGBADepthPacking=3201;l.TangentSpaceNormalMap=0;l.ObjectSpaceNormalMap=1;l.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new Qb(a,
-b,c,e,f,g)};l.LineStrip=0;l.LinePieces=1;l.MeshFaceMaterial=function(a){console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead.");return a};l.MultiMaterial=function(a){void 0===a&&(a=[]);console.warn("THREE.MultiMaterial has been removed. Use an Array instead.");a.isMultiMaterial=!0;a.materials=a;a.clone=function(){return a.slice()};return a};l.PointCloud=function(a,b){console.warn("THREE.PointCloud has been renamed to THREE.Points.");return new Xb(a,b)};l.Particle=function(a){console.warn("THREE.Particle has been renamed to THREE.Sprite.");
-return new Ic(a)};l.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.Points.");return new Xb(a,b)};l.PointCloudMaterial=function(a){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.");return new Ka(a)};l.ParticleBasicMaterial=function(a){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.");return new Ka(a)};l.ParticleSystemMaterial=function(a){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.");
-return new Ka(a)};l.Vertex=function(a,b,c){console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead.");return new n(a,b,c)};l.DynamicBufferAttribute=function(a,b){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.");return(new S(a,b)).setDynamic(!0)};l.Int8Attribute=function(a,b){console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.");return new xc(a,b)};l.Uint8Attribute=
-function(a,b){console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.");return new yc(a,b)};l.Uint8ClampedAttribute=function(a,b){console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.");return new zc(a,b)};l.Int16Attribute=function(a,b){console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.");return new Ac(a,b)};l.Uint16Attribute=function(a,b){console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.");
-return new sb(a,b)};l.Int32Attribute=function(a,b){console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.");return new Bc(a,b)};l.Uint32Attribute=function(a,b){console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.");return new tb(a,b)};l.Float32Attribute=function(a,b){console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.");return new E(a,b)};l.Float64Attribute=
-function(a,b){console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.");return new Cc(a,b)};l.ClosedSplineCurve3=Qf;l.SplineCurve3=Rf;l.Spline=Je;l.AxisHelper=function(a){console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper.");return new ud(a)};l.BoundingBoxHelper=function(a,b){console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.");return new fb(a,b)};l.EdgesHelper=function(a,b){console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.");
-return new V(new ic(a.geometry),new R({color:void 0!==b?b:16777215}))};l.WireframeHelper=function(a,b){console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.");return new V(new Zb(a.geometry),new R({color:void 0!==b?b:16777215}))};l.XHRLoader=function(a){console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader.");return new Ma(a)};l.BinaryTextureLoader=function(a){console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.");return new me(a)};
-l.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");if(b.isMesh){b.matrixAutoUpdate&&b.updateMatrix();var d=b.matrix;b=b.geometry}a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};l.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js.");
+xa;l.LineCurve3=Oa;l.QuadraticBezierCurve=Pa;l.QuadraticBezierCurve3=ab;l.SplineCurve=Qa;l.REVISION="104dev";l.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2};l.CullFaceNone=0;l.CullFaceBack=1;l.CullFaceFront=2;l.CullFaceFrontBack=3;l.FrontFaceDirectionCW=0;l.FrontFaceDirectionCCW=1;l.BasicShadowMap=0;l.PCFShadowMap=1;l.PCFSoftShadowMap=2;l.FrontSide=0;l.BackSide=1;l.DoubleSide=2;l.FlatShading=1;l.SmoothShading=2;l.NoColors=0;l.FaceColors=1;l.VertexColors=2;l.NoBlending=0;l.NormalBlending=1;l.AdditiveBlending=2;
+l.SubtractiveBlending=3;l.MultiplyBlending=4;l.CustomBlending=5;l.AddEquation=100;l.SubtractEquation=101;l.ReverseSubtractEquation=102;l.MinEquation=103;l.MaxEquation=104;l.ZeroFactor=200;l.OneFactor=201;l.SrcColorFactor=202;l.OneMinusSrcColorFactor=203;l.SrcAlphaFactor=204;l.OneMinusSrcAlphaFactor=205;l.DstAlphaFactor=206;l.OneMinusDstAlphaFactor=207;l.DstColorFactor=208;l.OneMinusDstColorFactor=209;l.SrcAlphaSaturateFactor=210;l.NeverDepth=0;l.AlwaysDepth=1;l.LessDepth=2;l.LessEqualDepth=3;l.EqualDepth=
+4;l.GreaterEqualDepth=5;l.GreaterDepth=6;l.NotEqualDepth=7;l.MultiplyOperation=0;l.MixOperation=1;l.AddOperation=2;l.NoToneMapping=0;l.LinearToneMapping=1;l.ReinhardToneMapping=2;l.Uncharted2ToneMapping=3;l.CineonToneMapping=4;l.ACESFilmicToneMapping=5;l.UVMapping=300;l.CubeReflectionMapping=301;l.CubeRefractionMapping=302;l.EquirectangularReflectionMapping=303;l.EquirectangularRefractionMapping=304;l.SphericalReflectionMapping=305;l.CubeUVReflectionMapping=306;l.CubeUVRefractionMapping=307;l.RepeatWrapping=
+1E3;l.ClampToEdgeWrapping=1001;l.MirroredRepeatWrapping=1002;l.NearestFilter=1003;l.NearestMipMapNearestFilter=1004;l.NearestMipMapLinearFilter=1005;l.LinearFilter=1006;l.LinearMipMapNearestFilter=1007;l.LinearMipMapLinearFilter=1008;l.UnsignedByteType=1009;l.ByteType=1010;l.ShortType=1011;l.UnsignedShortType=1012;l.IntType=1013;l.UnsignedIntType=1014;l.FloatType=1015;l.HalfFloatType=1016;l.UnsignedShort4444Type=1017;l.UnsignedShort5551Type=1018;l.UnsignedShort565Type=1019;l.UnsignedInt248Type=1020;
+l.AlphaFormat=1021;l.RGBFormat=1022;l.RGBAFormat=1023;l.LuminanceFormat=1024;l.LuminanceAlphaFormat=1025;l.RGBEFormat=1023;l.DepthFormat=1026;l.DepthStencilFormat=1027;l.RedFormat=1028;l.RGB_S3TC_DXT1_Format=33776;l.RGBA_S3TC_DXT1_Format=33777;l.RGBA_S3TC_DXT3_Format=33778;l.RGBA_S3TC_DXT5_Format=33779;l.RGB_PVRTC_4BPPV1_Format=35840;l.RGB_PVRTC_2BPPV1_Format=35841;l.RGBA_PVRTC_4BPPV1_Format=35842;l.RGBA_PVRTC_2BPPV1_Format=35843;l.RGB_ETC1_Format=36196;l.RGBA_ASTC_4x4_Format=37808;l.RGBA_ASTC_5x4_Format=
+37809;l.RGBA_ASTC_5x5_Format=37810;l.RGBA_ASTC_6x5_Format=37811;l.RGBA_ASTC_6x6_Format=37812;l.RGBA_ASTC_8x5_Format=37813;l.RGBA_ASTC_8x6_Format=37814;l.RGBA_ASTC_8x8_Format=37815;l.RGBA_ASTC_10x5_Format=37816;l.RGBA_ASTC_10x6_Format=37817;l.RGBA_ASTC_10x8_Format=37818;l.RGBA_ASTC_10x10_Format=37819;l.RGBA_ASTC_12x10_Format=37820;l.RGBA_ASTC_12x12_Format=37821;l.LoopOnce=2200;l.LoopRepeat=2201;l.LoopPingPong=2202;l.InterpolateDiscrete=2300;l.InterpolateLinear=2301;l.InterpolateSmooth=2302;l.ZeroCurvatureEnding=
+2400;l.ZeroSlopeEnding=2401;l.WrapAroundEnding=2402;l.TrianglesDrawMode=0;l.TriangleStripDrawMode=1;l.TriangleFanDrawMode=2;l.LinearEncoding=3E3;l.sRGBEncoding=3001;l.GammaEncoding=3007;l.RGBEEncoding=3002;l.LogLuvEncoding=3003;l.RGBM7Encoding=3004;l.RGBM16Encoding=3005;l.RGBDEncoding=3006;l.BasicDepthPacking=3200;l.RGBADepthPacking=3201;l.TangentSpaceNormalMap=0;l.ObjectSpaceNormalMap=1;l.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");
+return new Qb(a,b,c,e,f,g)};l.LineStrip=0;l.LinePieces=1;l.MeshFaceMaterial=function(a){console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead.");return a};l.MultiMaterial=function(a){void 0===a&&(a=[]);console.warn("THREE.MultiMaterial has been removed. Use an Array instead.");a.isMultiMaterial=!0;a.materials=a;a.clone=function(){return a.slice()};return a};l.PointCloud=function(a,b){console.warn("THREE.PointCloud has been renamed to THREE.Points.");return new Xb(a,b)};l.Particle=
+function(a){console.warn("THREE.Particle has been renamed to THREE.Sprite.");return new Ic(a)};l.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.Points.");return new Xb(a,b)};l.PointCloudMaterial=function(a){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.");return new Ka(a)};l.ParticleBasicMaterial=function(a){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.");return new Ka(a)};l.ParticleSystemMaterial=
+function(a){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.");return new Ka(a)};l.Vertex=function(a,b,c){console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead.");return new n(a,b,c)};l.DynamicBufferAttribute=function(a,b){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.");return(new S(a,b)).setDynamic(!0)};l.Int8Attribute=function(a,b){console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.");
+return new xc(a,b)};l.Uint8Attribute=function(a,b){console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.");return new yc(a,b)};l.Uint8ClampedAttribute=function(a,b){console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.");return new zc(a,b)};l.Int16Attribute=function(a,b){console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.");return new Ac(a,b)};l.Uint16Attribute=
+function(a,b){console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.");return new sb(a,b)};l.Int32Attribute=function(a,b){console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.");return new Bc(a,b)};l.Uint32Attribute=function(a,b){console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.");return new tb(a,b)};l.Float32Attribute=function(a,b){console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.");
+return new E(a,b)};l.Float64Attribute=function(a,b){console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.");return new Cc(a,b)};l.ClosedSplineCurve3=Qf;l.SplineCurve3=Rf;l.Spline=Je;l.AxisHelper=function(a){console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper.");return new ud(a)};l.BoundingBoxHelper=function(a,b){console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.");return new fb(a,b)};l.EdgesHelper=
+function(a,b){console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.");return new V(new ic(a.geometry),new R({color:void 0!==b?b:16777215}))};l.WireframeHelper=function(a,b){console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.");return new V(new Zb(a.geometry),new R({color:void 0!==b?b:16777215}))};l.XHRLoader=function(a){console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader.");return new Ma(a)};l.BinaryTextureLoader=function(a){console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.");
+return new me(a)};l.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");if(b.isMesh){b.matrixAutoUpdate&&b.updateMatrix();var d=b.matrix;b=b.geometry}a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};l.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js.");
 this.projectVector=function(a,b){console.warn("THREE.Projector: .projectVector() is now vector.project().");a.project(b)};this.unprojectVector=function(a,b){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject().");a.unproject(b)};this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}};l.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")};l.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")};
 l.SceneUtils={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};l.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")};Object.defineProperty(l,"__esModule",{value:!0})});

+ 6 - 10
build/three.module.js

@@ -179,7 +179,7 @@ Object.assign( EventDispatcher.prototype, {
 
 } );
 
-var REVISION = '103';
+var REVISION = '104dev';
 var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
 var CullFaceNone = 0;
 var CullFaceBack = 1;
@@ -12921,6 +12921,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 		if ( this.clearCoatRoughness !== undefined ) data.clearCoatRoughness = this.clearCoatRoughness;
 
 		if ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;
+		if ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid;
 		if ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;
 		if ( this.lightMap && this.lightMap.isTexture ) data.lightMap = this.lightMap.toJSON( meta ).uuid;
 
@@ -22896,13 +22897,7 @@ function WebGLRenderer( parameters ) {
 
 	// vr
 
-	var vr = null;
-
-	if ( typeof navigator !== 'undefined' ) {
-
-		vr = ( 'xr' in navigator ) ? new WebXRManager( _this ) : new WebVRManager( _this );
-
-	}
+	var vr = ( typeof navigator !== 'undefined' && 'xr' in navigator ) ? new WebXRManager( _this ) : new WebVRManager( _this );
 
 	this.vr = vr;
 
@@ -37899,6 +37894,7 @@ Object.assign( MaterialLoader.prototype, {
 		// maps
 
 		if ( json.map !== undefined ) material.map = getTexture( json.map );
+		if ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap );
 
 		if ( json.alphaMap !== undefined ) {
 
@@ -40202,14 +40198,14 @@ Object.assign( StereoCamera.prototype, {
  * @author alteredq / http://alteredqualia.com/
  */
 
+var fov = 90, aspect = 1;
+
 function CubeCamera( near, far, cubeResolution, options ) {
 
 	Object3D.call( this );
 
 	this.type = 'CubeCamera';
 
-	var fov = 90, aspect = 1;
-
 	var cameraPX = new PerspectiveCamera( fov, aspect, near, far );
 	cameraPX.up.set( 0, - 1, 0 );
 	cameraPX.lookAt( new Vector3( 1, 0, 0 ) );

+ 1 - 1
docs/api/en/core/Object3D.html

@@ -46,7 +46,7 @@
 
 		<h3>[property:Material customDistanceMaterial]</h3>
 		<p>
-		Same as customDepthMaterial, but used with [page:PointLight]. Default is *undefined*.
+		Same as [page:.customDepthMaterial customDepthMaterial], but used with [page:PointLight]. Default is *undefined*.
 		</p>
 
 		<h3>[property:Boolean frustumCulled]</h3>

+ 131 - 0
docs/api/en/materials/MeshDistanceMaterial.html

@@ -0,0 +1,131 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		[page:Material] &rarr;
+
+		<h1>[name]</h1>
+
+		<p class="desc">
+			[name] is internally used for implementing shadow mapping with [page:PointLight]s.<br/><br/>
+
+			Can also be used to customize the shadow casting of an object by assigning an instance of [name] to [page:Object3D.customDistanceMaterial].
+			The following examples demonstrates this approach in order to ensure transparent parts of objects do no cast shadows.
+		</p>
+
+		<h2>Example</h2>
+
+		[example:webgl_shadowmap_pointlight WebGL / shadowmap / pointlight]
+
+		<script>
+
+		// iOS iframe auto-resize workaround
+
+		if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+			var scene = document.getElementById( 'scene' );
+
+			scene.style.width = getComputedStyle( scene ).width;
+			scene.style.height = getComputedStyle( scene ).height;
+			scene.setAttribute( 'scrolling', 'no' );
+
+		}
+
+		</script>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( [param:Object parameters] )</h3>
+		<p>
+			[page:Object parameters] - (optional) an object with one or more properties defining the material's appearance.
+			Any property of the material (including any property inherited from [page:Material]) can be passed in here.
+		</p>
+
+		<h2>Properties</h2>
+		<p>See the base [page:Material] class for common properties.</p>
+
+		<h3>[property:Texture alphaMap]</h3>
+		<p>The alpha map is a grayscale texture that controls the opacity across the surface
+			(black: fully transparent; white: fully opaque). Default is null.<br /><br />
+
+			Only the color of the texture is used, ignoring the alpha channel if one exists.
+			For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the
+			green channel when sampling this texture due to the extra bit of precision provided
+			for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
+			luminance/alpha textures will also still work as expected.
+		</p>
+
+		<h3>[property:Texture displacementMap]</h3>
+		<p>
+			The displacement map affects the position of the mesh's vertices. Unlike other maps
+			which only affect the light and shade of the material the displaced vertices can cast shadows,
+			block other objects, and otherwise act as real geometry. The displacement texture is
+			an image where the value of each pixel (white being the highest) is mapped against,
+			and repositions, the vertices of the mesh.
+		</p>
+
+		<h3>[property:Float displacementScale]</h3>
+		<p>
+			How much the displacement map affects the mesh (where black is no displacement,
+			and white is maximum displacement). Without a displacement map set, this value is not applied.
+			 Default is 1.
+		</p>
+
+		<h3>[property:Float displacementBias]</h3>
+		<p>
+			The offset of the displacement map's values on the mesh's vertices.
+			Without a displacement map set, this value is not applied. Default is 0.
+		</p>
+
+		<h3>[property:Float farDistance]</h3>
+		<p>
+			The far value of the point light's internal shadow camera.
+		</p>
+
+		<h3>[property:Boolean fog]</h3>
+		<p>Whether the material is affected by fog. Default is *false*.</p>
+
+		<h3>[property:Boolean isMeshDistanceMaterial]</h3>
+		<p>
+			Used to check whether this or derived classes are mesh depth materials. Default is *true*.<br /><br />
+
+			You should not change this, as it used internally for optimisation.
+		</p>
+
+		<h3>[property:Boolean lights]</h3>
+		<p>Whether the material is affected by lights. Default is *false*.</p>
+
+		<h3>[property:Texture map]</h3>
+		<p>The color map. Default is  null.</p>
+
+		<h3>[property:boolean morphTargets]</h3>
+		<p>Define whether the material uses morphTargets. Default is false.</p>
+
+		<h3>[property:Float nearDistance]</h3>
+		<p>
+			The near value of the point light's internal shadow camera.
+		</p>
+
+		<h3>[property:Vector3 referencePosition]</h3>
+		<p>
+			The position of the point light in world space.
+		</p>
+
+		<h3>[property:Boolean skinning]</h3>
+		<p>Define whether the material uses skinning. Default is false.</p>
+
+		<h2>Methods</h2>
+		<p>See the base [page:Material] class for common methods.</p>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 150 - 0
docs/api/en/materials/MeshMatcapMaterial.html

@@ -0,0 +1,150 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		[page:Material] &rarr;
+
+		<h1>[name]</h1>
+
+		<p class="desc">
+			[name] is defined by a MatCap (or Lit Sphere) texture, which encodes the material color and shading.<br/><br/>
+			[name] does not respond to lights since the matcap image file encodes baked lighting.
+			It will cast a shadow onto an object that receives shadows (and shadow clipping works), but it will not self-shadow or receive shadows.
+		</p>
+
+		<iframe id="scene" src="scenes/material-browser.html#MeshMatcapMaterial"></iframe>
+
+		<script>
+
+		// iOS iframe auto-resize workaround
+
+		if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+			var scene = document.getElementById( 'scene' );
+
+			scene.style.width = getComputedStyle( scene ).width;
+			scene.style.height = getComputedStyle( scene ).height;
+			scene.setAttribute( 'scrolling', 'no' );
+
+		}
+
+		</script>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( [param:Object parameters] )</h3>
+		<p>
+			[page:Object parameters] - (optional) an object with one or more properties defining the material's appearance.
+			Any property of the material (including any property inherited from [page:Material]) can be passed in here.<br /><br />
+
+			The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal
+			string and is *0xffffff* (white) by default. [page:Color.set]( color ) is called internally.
+		</p>
+
+		<h2>Properties</h2>
+		<p>See the base [page:Material] class for common properties.</p>
+
+		<h3>[property:Texture alphaMap]</h3>
+		<p>The alpha map is a grayscale texture that controls the opacity across the surface
+			(black: fully transparent; white: fully opaque). Default is null.<br /><br />
+
+			Only the color of the texture is used, ignoring the alpha channel if one exists.
+			For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer will use the
+			green channel when sampling this texture due to the extra bit of precision provided
+			for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
+			luminance/alpha textures will also still work as expected.
+		</p>
+
+		<h3>[property:Texture bumpMap]</h3>
+		<p>
+			The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
+			Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will
+			be ignored.
+		</p>
+
+		<h3>[property:Float bumpScale]</h3>
+		<p>How much the bump map affects the material. Typical ranges are 0-1. Default is 1.</p>
+
+		<h3>[property:Color color]</h3>
+		<p>[page:Color] of the material, by default set to white (0xffffff).</p>
+
+		<h3>[property:Texture displacementMap]</h3>
+		<p>
+			The displacement map affects the position of the mesh's vertices. Unlike other maps
+			which only affect the light and shade of the material the displaced vertices can cast shadows,
+			block other objects, and otherwise act as real geometry. The displacement texture is
+			an image where the value of each pixel (white being the highest) is mapped against,
+			and repositions, the vertices of the mesh.
+		</p>
+
+		<h3>[property:Float displacementScale]</h3>
+		<p>
+			How much the displacement map affects the mesh (where black is no displacement,
+			and white is maximum displacement). Without a displacement map set, this value is not applied.
+			 Default is 1.
+		</p>
+
+		<h3>[property:Float displacementBias]</h3>
+		<p>
+			The offset of the displacement map's values on the mesh's vertices.
+			Without a displacement map set, this value is not applied. Default is 0.
+		</p>
+
+		<h3>[property:Boolean isMeshMatcapMaterial]</h3>
+		<p>
+			Used to check whether this or derived classes are mesh Matcap materials. Default is *true*.<br /><br />
+
+			You should not change this, as it used internally for optimisation.
+		</p>
+
+		<h3>[property:Texture map]</h3>
+		<p>The color map. Default is null. The texture map color is modulated by the diffuse [page:.color].</p>
+
+		<h3>[property:Texture matcap]</h3>
+		<p>The matcap map. Default is null.</p>
+
+		<h3>[property:boolean morphNormals]</h3>
+		<p>
+			Defines whether the material uses morphNormals. Set as true to pass morphNormal
+			attributes from the [page:Geometry]	to the shader. Default is *false*.
+		</p>
+
+		<h3>[property:Boolean morphTargets]</h3>
+		<p>Define whether the material uses morphTargets. Default is false.</p>
+
+		<h3>[property:Texture normalMap]</h3>
+		<p>
+			The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change
+			the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.
+		</p>
+
+		<h3>[property:Integer normalMapType]</h3>
+		<p>
+			The type of normal map.<br /><br />
+
+			Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
+		</p>
+
+		<h3>[property:Vector2 normalScale]</h3>
+		<p>
+			How much the normal map affects the material. Typical ranges are 0-1.
+			Default is a [page:Vector2] set to (1,1).
+		</p>
+
+		<h3>[property:Boolean skinning]</h3>
+		<p>Define whether the material uses skinning. Default is false.</p>
+
+		<h2>Methods</h2>
+		<p>See the base [page:Material] class for common methods.</p>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 61 - 1
docs/api/en/materials/MeshNormalMaterial.html

@@ -44,6 +44,38 @@
 		<h2>Properties</h2>
 		<p>See the base [page:Material] class for common properties.</p>
 
+		<h3>[property:Texture bumpMap]</h3>
+		<p>
+			The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights.
+			Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will
+			be ignored.
+		</p>
+
+		<h3>[property:Float bumpScale]</h3>
+		<p>How much the bump map affects the material. Typical ranges are 0-1. Default is 1.</p>
+
+		<h3>[property:Texture displacementMap]</h3>
+		<p>
+			The displacement map affects the position of the mesh's vertices. Unlike other maps
+			which only affect the light and shade of the material the displaced vertices can cast shadows,
+			block other objects, and otherwise act as real geometry. The displacement texture is
+			an image where the value of each pixel (white being the highest) is mapped against,
+			and repositions, the vertices of the mesh.
+		</p>
+
+		<h3>[property:Float displacementScale]</h3>
+		<p>
+			How much the displacement map affects the mesh (where black is no displacement,
+			and white is maximum displacement). Without a displacement map set, this value is not applied.
+			 Default is 1.
+		</p>
+
+		<h3>[property:Float displacementBias]</h3>
+		<p>
+			The offset of the displacement map's values on the mesh's vertices.
+			Without a displacement map set, this value is not applied. Default is 0.
+		</p>
+
 		<h3>[property:Boolean fog]</h3>
 		<p>Whether the material is affected by fog. Default is *false*.</p>
 
@@ -57,9 +89,37 @@
 		<h3>[property:Boolean lights]</h3>
 		<p>Whether the material is affected by lights. Default is *false*.</p>
 
-		<h3>[property:boolean morphTargets]</h3>
+		<h3>[property:boolean morphNormals]</h3>
+		<p>
+			Defines whether the material uses morphNormals. Set as true to pass morphNormal
+			attributes from the [page:Geometry]	to the shader. Default is *false*.
+		</p>
+
+		<h3>[property:Boolean morphTargets]</h3>
 		<p>Define whether the material uses morphTargets. Default is false.</p>
 
+		<h3>[property:Texture normalMap]</h3>
+		<p>
+			The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change
+			the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.
+		</p>
+
+		<h3>[property:Integer normalMapType]</h3>
+		<p>
+			The type of normal map.<br /><br />
+
+			Options are [page:constant THREE.TangentSpaceNormalMap] (default), and [page:constant THREE.ObjectSpaceNormalMap].
+		</p>
+
+		<h3>[property:Vector2 normalScale]</h3>
+		<p>
+			How much the normal map affects the material. Typical ranges are 0-1.
+			Default is a [page:Vector2] set to (1,1).
+		</p>
+
+		<h3>[property:Boolean skinning]</h3>
+		<p>Define whether the material uses skinning. Default is false.</p>
+
 		<h3>[property:boolean wireframe]</h3>
 		<p>
 			Render geometry as wireframe. Default is false (i.e. render as smooth shaded).

+ 8 - 3
docs/api/en/textures/Texture.html

@@ -187,13 +187,18 @@
 
 		<h3>[property:boolean premultiplyAlpha]</h3>
 		<p>
-		False by default, which is the norm for PNG images. Set to true if the RGB values have
-		been stored premultiplied by alpha.
+		If set to *true*, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Defaut is *false*.<br /><br />
+
+		Note that this property has no effect for [link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap].
+		You need to configure on bitmap creation instead. See [page:ImageBitmapLoader].
 		</p>
 
 		<h3>[property:boolean flipY]</h3>
 		<p>
-		True by default. Flips the image's Y axis to match the WebGL texture coordinate space.
+		If set to *true*, the texture is flipped along the vertical axis when uploaded to the GPU. Default is *true*.<br /><br />
+
+		Note that this property has no effect for [link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap].
+		You need to configure on bitmap creation instead. See [page:ImageBitmapLoader].
 		</p>
 
 		<h3>[property:number unpackAlignment]</h3>

+ 1 - 1
docs/api/zh/core/Object3D.html

@@ -44,7 +44,7 @@
 	</p>
 
 	<h3>[property:Material customDistanceMaterial]</h3>
-	<p>与customDepthMaterial相同,但与[page:PointLight]一起使用。默认值为*undefined*。
+	<p>与[page:.customDepthMaterial customDepthMaterial]相同,但与[page:PointLight]一起使用。默认值为*undefined*。
 	</p>
 
 	<h3>[property:Boolean frustumCulled]</h3>

+ 112 - 0
docs/api/zh/materials/MeshDistanceMaterial.html

@@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		[page:Material] &rarr;
+
+		<h1>[name]</h1>
+
+		<p class="desc">
+			TODO
+		</p>
+
+		<h2>Example</h2>
+
+		[example:webgl_shadowmap_pointlight WebGL / shadowmap / pointlight]
+
+		<script>
+
+		// iOS iframe auto-resize workaround
+
+		if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+			var scene = document.getElementById( 'scene' );
+
+			scene.style.width = getComputedStyle( scene ).width;
+			scene.style.height = getComputedStyle( scene ).height;
+			scene.setAttribute( 'scrolling', 'no' );
+
+		}
+
+		</script>
+
+		<h2>构造函数(Constructor)</h2>
+
+		<h3>[name]( [param:Object parameters] )</h3>
+		<p>[page:Object parameters] - (可选)用于定义材质外观的对象,具有一个或多个属性。
+			材质的任何属性都可以从此处传入(包括从[page:Material]继承的任何属性)。
+		</p>
+
+		<h2>属性(Properties)</h2>
+		<p>常用属性请参见基类[page:Material]。</p>
+
+		<h3>[property:Texture alphaMap]</h3>
+		<p>alpha贴图是一种灰度纹理,用于控制整个表面的不透明度(黑色:完全透明;白色:完全不透明)。默认值为null。<br /><br />
+			仅使用纹理的颜色,忽略alpha通道(如果存在)。对于RGB和RGBA纹理,[page:WebGLRenderer WebGL]渲染器在采样此纹理时将使用绿色通道,
+			因为在DXT压缩和未压缩RGB 565格式中为绿色提供了额外的精度。Luminance-only以及luminance/alpha纹理也仍然有效。
+		</p>
+
+		<h3>[property:Texture displacementMap]</h3>
+		<p> 位移贴图会影响网格顶点的位置,与仅影响材质的光照和阴影的其他贴图不同,移位的顶点可以投射阴影,阻挡其他对象,以及充当真实的几何体。
+			位移纹理是指:网格的所有顶点被映射为图像中每个像素的值(白色是最高的),并且被重定位。
+		</p>
+
+		<h3>[property:Float displacementScale]</h3>
+		<p>位移贴图对网格的影响程度(黑色是无位移,白色是最大位移)。如果没有设置位移贴图,则不会应用此值。默认值为1。
+		</p>
+
+		<h3>[property:Float displacementBias]</h3>
+		<p> 位移贴图在网格顶点上的偏移量。如果没有设置位移贴图,则不会应用此值。默认值为0。
+		</p>
+
+		<h3>[property:Float farDistance]</h3>
+		<p>
+			TODO
+		</p>
+
+		<h3>[property:Boolean fog]</h3>
+		<p> 材质是否受雾影响。默认值为*false*。</p>
+
+		<h3>[property:Boolean isMeshDistanceMaterial]</h3>
+		<p> 用于检查此类或派生类是否为深度网格材质。默认值为 *true*。<br /><br />
+
+			因为其通常用在内部优化,所以不应该更改该属性值。
+		</p>
+
+		<h3>[property:Boolean lights]</h3>
+		<p>材质是否受到光照的影响。默认值为 *false*。</p>
+
+		<h3>[property:Texture map]</h3>
+		<p>颜色贴图。默认为null。</p>
+
+		<h3>[property:boolean morphTargets]</h3>
+		<p>材质是否使用morphTargets。默认值为false。</p>
+
+		<h3>[property:Float nearDistance]</h3>
+		<p>
+			TODO
+		</p>
+
+		<h3>[property:Vector3 referencePosition]</h3>
+		<p>
+			TODO
+		</p>
+
+		<h3>[property:Boolean skinning]</h3>
+		<p>材质是否使用蒙皮。默认值为false。</p>
+
+		<h2>方法(Methods)</h2>
+		<p>常用方法请参见基类[page:Material]。</p>
+
+
+		<h2>源码(Source)</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 120 - 0
docs/api/zh/materials/MeshMatcapMaterial.html

@@ -0,0 +1,120 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		[page:Material] &rarr;
+
+		<h1>[name]</h1>
+
+		<p class="desc">
+			TODO
+		</p>
+
+		<iframe id="scene" src="scenes/material-browser.html#MeshMatcapMaterial"></iframe>
+
+		<script>
+
+		// iOS iframe auto-resize workaround
+
+		if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+			var scene = document.getElementById( 'scene' );
+
+			scene.style.width = getComputedStyle( scene ).width;
+			scene.style.height = getComputedStyle( scene ).height;
+			scene.setAttribute( 'scrolling', 'no' );
+
+		}
+
+		</script>
+
+		<h2>构造函数(Constructor)</h2>
+
+		<h3>[name]( [param:Object parameters] )</h3>
+		<p>[page:Object parameters] - (可选)用于定义材质外观的对象,具有一个或多个属性。
+			材质的任何属性都可以从此处传入(包括从[page:Material]继承的任何属性)。<br /><br />
+			属性[page:Hexadecimal color]例外,其可以作为十六进制字符串传递,默认情况下为 *0xffffff*(白色),内部调用[page:Color.set](color)。
+		</p>
+
+		<h2>属性(Properties)</h2>
+		<p>常用属性请参见基类[page:Material]。</p>
+
+		<h3>[property:Texture alphaMap]</h3>
+		<p>Talpha贴图是一种灰度纹理,用于控制整个表面的不透明度(黑色:完全透明;白色:完全不透明)。默认值为null。<br /><br />
+			仅使用纹理的颜色,忽略alpha通道(如果存在)。对于RGB和RGBA纹理,[page:WebGLRenderer WebGL]渲染器在采样此纹理时将使用绿色通道,
+			因为在DXT压缩和未压缩RGB 565格式中为绿色提供了额外的精度。Luminance-only以及luminance/alpha纹理也仍然有效。
+		</p>
+
+		<h3>[property:Texture bumpMap]</h3>
+		<p> 用于创建凹凸贴图的纹理。黑色和白色值映射到与光照相关的感知深度。凹凸实际上不会影响对象的几何形状,只影响光照。如果定义了法线贴图,则将忽略该贴图。
+		</p>
+
+		<h3>[property:Float bumpScale]</h3>
+		<p> 凹凸贴图会对材质产生多大影响。典型范围是0-1。默认值为1。</p>
+
+		<h3>[property:Color color]</h3>
+		<p>材质的颜色([page:Color]),默认值为白色 (0xffffff)。</p>
+
+		<h3>[property:Texture displacementMap]</h3>
+		<p> 位移贴图会影响网格顶点的位置,与仅影响材质的光照和阴影的其他贴图不同,移位的顶点可以投射阴影,阻挡其他对象,
+			以及充当真实的几何体。位移纹理是指:网格的所有顶点被映射为图像中每个像素的值(白色是最高的),并且被重定位。
+		</p>
+
+		<h3>[property:Float displacementScale]</h3>
+		<p> 位移贴图对网格的影响程度(黑色是无位移,白色是最大位移)。如果没有设置位移贴图,则不会应用此值。默认值为1。
+		</p>
+
+		<h3>[property:Float displacementBias]</h3>
+		<p>
+			位移贴图在网格顶点上的偏移量。如果没有设置位移贴图,则不会应用此值。默认值为0。
+		</p>
+
+		<h3>[property:Boolean isMeshMatcapMaterial]</h3>
+		<p>TODO<br /><br />
+
+			因为其通常用在内部优化,所以不应该更改该属性值。
+		</p>
+
+		<h3>[property:Texture map]</h3>
+		<p>颜色贴图。默认为null。纹理贴图颜色由漫反射颜色[page:.color]调节。</p>
+
+		<h3>[property:Texture matcap]</h3>
+		<p>TODO</p>
+
+		<h3>[property:boolean morphNormals]</h3>
+		<p> 定义是否使用morphNormals。设置为true可将morphNormal属性从[page:Geometry]传递到shader。默认值为*false*。
+		</p>
+
+		<h3>[property:Boolean morphTargets]</h3>
+		<p>定义材质是否使用morphTargets。默认值为false。</p>
+
+		<h3>[property:Texture normalMap]</h3>
+		<p> 用于创建法线贴图的纹理。RGB值会影响每个像素片段的曲面法线,并更改颜色照亮的方式。法线贴图不会改变曲面的实际形状,只会改变光照。
+		</p>
+
+		<h3>[property:Integer normalMapType]</h3>
+		<p> 法线贴图的类型。<br /><br />
+			选项为[page:constant THREE.TangentSpaceNormalMap](默认)和[page:constant THREE.ObjectSpaceNormalMap]。
+		</p>
+
+		<h3>[property:Vector2 normalScale]</h3>
+		<p> 法线贴图对材质的影响程度。典型范围是0-1。默认值是[page:Vector2]设置为(1,1)。
+		</p>
+
+		<h3>[property:Boolean skinning]</h3>
+		<p>材质是否使用蒙皮。默认值为false。</p>
+
+		<h2>方法(Methods)</h2>
+		<p>常用方法请参见基类[page:Material]。</p>
+
+		<h2>源码(Source)</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 42 - 1
docs/api/zh/materials/MeshNormalMaterial.html

@@ -42,6 +42,27 @@
 		<h2>属性(Properties)</h2>
 		<p>常用属性请参见基类[page:Material]。</p>
 
+		<h3>[property:Texture bumpMap]</h3>
+		<p> 用于创建凹凸贴图的纹理。黑色和白色值映射到与光照相关的感知深度。凹凸实际上不会影响对象的几何形状,只影响光照。如果定义了法线贴图,则将忽略该贴图。
+		</p>
+
+		<h3>[property:Float bumpScale]</h3>
+		<p> 凹凸贴图会对材质产生多大影响。典型范围是0-1。默认值为1。</p>
+
+		<h3>[property:Texture displacementMap]</h3>
+		<p> 位移贴图会影响网格顶点的位置,与仅影响材质的光照和阴影的其他贴图不同,移位的顶点可以投射阴影,阻挡其他对象,
+			以及充当真实的几何体。位移纹理是指:网格的所有顶点被映射为图像中每个像素的值(白色是最高的),并且被重定位。
+		</p>
+
+		<h3>[property:Float displacementScale]</h3>
+		<p> 位移贴图对网格的影响程度(黑色是无位移,白色是最大位移)。如果没有设置位移贴图,则不会应用此值。默认值为1。
+		</p>
+
+		<h3>[property:Float displacementBias]</h3>
+		<p>
+			位移贴图在网格顶点上的偏移量。如果没有设置位移贴图,则不会应用此值。默认值为0。
+		</p>
+
 		<h3>[property:Boolean fog]</h3>
 		<p>材质是否受雾影响。默认值为*false*。</p>
 
@@ -54,9 +75,29 @@
 		<h3>[property:Boolean lights]</h3>
 		<p>材质是否受到光照的影响。默认值为 *false*。</p>
 
-		<h3>[property:boolean morphTargets]</h3>
+		<h3>[property:boolean morphNormals]</h3>
+		<p> 定义是否使用morphNormals。设置为true可将morphNormal属性从[page:Geometry]传递到shader。默认值为*false*。
+		</p>
+
+		<h3>[property:Boolean morphTargets]</h3>
 		<p>定义材质是否使用morphTargets。默认值为false。</p>
 
+		<h3>[property:Texture normalMap]</h3>
+		<p> 用于创建法线贴图的纹理。RGB值会影响每个像素片段的曲面法线,并更改颜色照亮的方式。法线贴图不会改变曲面的实际形状,只会改变光照。
+		</p>
+
+		<h3>[property:Integer normalMapType]</h3>
+		<p> 法线贴图的类型。<br /><br />
+			选项为[page:constant THREE.TangentSpaceNormalMap](默认)和[page:constant THREE.ObjectSpaceNormalMap]。
+		</p>
+
+		<h3>[property:Vector2 normalScale]</h3>
+		<p> 法线贴图对材质的影响程度。典型范围是0-1。默认值是[page:Vector2]设置为(1,1)。
+		</p>
+
+		<h3>[property:Boolean skinning]</h3>
+		<p>材质是否使用蒙皮。默认值为false。</p>
+
 		<h3>[property:boolean wireframe]</h3>
 		<p>
 			将几何体渲染为线框。默认值为*false*(即渲染为平滑着色)。

+ 4 - 0
docs/api/zh/textures/Texture.html

@@ -188,11 +188,15 @@
 		<p>
 			默认为false,这是PNG图像的规范。
 			如果RGB值已被Alpha预乘,请将其设为true。
+			Note that this property has no effect for [link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap].
+			You need to configure on bitmap creation instead. See [page:ImageBitmapLoader].
 		</p>
 
 		<h3>[property:boolean flipY]</h3>
 		<p>
 		默认为true。翻转图像的Y轴以匹配WebGL纹理坐标空间。
+		Note that this property has no effect for [link:https://developer.mozilla.org/de/docs/Web/API/ImageBitmap ImageBitmap].
+		You need to configure on bitmap creation instead. See [page:ImageBitmapLoader].
 		</p>
 
 		<h3>[property:number unpackAlignment]</h3>

+ 4 - 0
docs/list.js

@@ -253,7 +253,9 @@ var list = {
 				"Material": "api/en/materials/Material",
 				"MeshBasicMaterial": "api/en/materials/MeshBasicMaterial",
 				"MeshDepthMaterial": "api/en/materials/MeshDepthMaterial",
+				"MeshDistanceMaterial": "api/en/materials/MeshDistanceMaterial",
 				"MeshLambertMaterial": "api/en/materials/MeshLambertMaterial",
+				"MeshMatcapMaterial": "api/en/materials/MeshMatcapMaterial",
 				"MeshNormalMaterial": "api/en/materials/MeshNormalMaterial",
 				"MeshPhongMaterial": "api/en/materials/MeshPhongMaterial",
 				"MeshPhysicalMaterial": "api/en/materials/MeshPhysicalMaterial",
@@ -683,7 +685,9 @@ var list = {
 				"Material": "api/zh/materials/Material",
 				"MeshBasicMaterial": "api/zh/materials/MeshBasicMaterial",
 				"MeshDepthMaterial": "api/zh/materials/MeshDepthMaterial",
+				"MeshDistanceMaterial": "api/zh/materials/MeshDistanceMaterial",
 				"MeshLambertMaterial": "api/zh/materials/MeshLambertMaterial",
+				"MeshMatcapMaterial": "api/zh/materials/MeshMatcapMaterial",
 				"MeshNormalMaterial": "api/zh/materials/MeshNormalMaterial",
 				"MeshPhongMaterial": "api/zh/materials/MeshPhongMaterial",
 				"MeshPhysicalMaterial": "api/zh/materials/MeshPhysicalMaterial",

+ 8 - 1
docs/manual/en/introduction/How-to-dispose-of-objects.html

@@ -54,6 +54,13 @@
 		for realizing custom rendering destinations. These objects are only deallocated by executing [page:WebGLRenderTarget.dispose]().
 	</p>
 
+	<h2>Scenes</h2>
+
+	<p>
+		The renderer maintains for scenes special data structures for sorting and rendering. If for some reasons a scene object becomes obsolete in an application,
+		call [page:Scene.dispose]() in order to free these resources.
+	</p>
+
 	<h2>Miscellaneous</h2>
 
 	<p>
@@ -91,7 +98,7 @@
 		nothing happens. No resources were allocated so there is also no need for clean up.
 	</p>
 
-	<h3>Why happens when you call *dispose()* on a texture but the image is not loaded yet?</h3>
+	<h3>What happens when you call *dispose()* on a texture but the image is not loaded yet?</h3>
 
 	<p>
 		Internal resources for a texture are only allocated if the image has fully loaded. If you dispose a texture before the image was loaded,

+ 97 - 47
docs/scenes/js/material.js

@@ -87,6 +87,9 @@ function getObjectsKeys( obj ) {
 
 }
 
+var textureLoader = new THREE.TextureLoader();
+var cubeTextureLoader = new THREE.CubeTextureLoader();
+
 var envMaps = ( function () {
 
 	var path = '../../examples/textures/cube/SwedishRoyalCastle/';
@@ -97,10 +100,10 @@ var envMaps = ( function () {
 		path + 'pz' + format, path + 'nz' + format
 	];
 
-	var reflectionCube = new THREE.CubeTextureLoader().load( urls );
+	var reflectionCube = cubeTextureLoader.load( urls );
 	reflectionCube.format = THREE.RGBFormat;
 
-	var refractionCube = new THREE.CubeTextureLoader().load( urls );
+	var refractionCube = cubeTextureLoader.load( urls );
 	refractionCube.mapping = THREE.CubeRefractionMapping;
 	refractionCube.format = THREE.RGBFormat;
 
@@ -112,18 +115,47 @@ var envMaps = ( function () {
 
 } )();
 
-var envMapKeys = getObjectsKeys( envMaps );
+var diffuseMaps = ( function () {
+
+	var bricks = textureLoader.load( '../../examples/textures/brick_diffuse.jpg' );
+	bricks.wrapS = THREE.RepeatWrapping;
+	bricks.wrapT = THREE.RepeatWrapping;
+	bricks.repeat.set( 9, 1 );
+
+	return {
+		none: null,
+		bricks: bricks
+	};
+
+} )();
+
+var matcaps = ( function () {
 
-var textureMaps = ( function () {
+	return {
+		none: null,
+		porcelainWhite: textureLoader.load( '../../examples/textures/matcaps/matcap-porcelain-white.jpg' )
+	};
+
+} )();
+
+var alphaMaps = ( function () {
+
+	var fibers = textureLoader.load( '../../examples/textures/alphaMap.jpg' );
+	fibers.wrapT = THREE.RepeatWrapping;
+	fibers.wrapS = THREE.RepeatWrapping;
+	fibers.repeat.set( 9, 1 );
 
 	return {
 		none: null,
-		grass: new THREE.TextureLoader().load( '../../examples/textures/terrain/grasslight-thin.jpg' )
+		fibers: fibers
 	};
 
 } )();
 
-var textureMapKeys = getObjectsKeys( textureMaps );
+var envMapKeys = getObjectsKeys( envMaps );
+var diffuseMapKeys = getObjectsKeys( diffuseMaps );
+var matcapKeys = getObjectsKeys( matcaps );
+var alphaMapKeys = getObjectsKeys( alphaMaps );
 
 function generateVertexColors( geometry ) {
 
@@ -247,7 +279,7 @@ function guiMaterial( gui, mesh, material, geometry ) {
 	var folder = gui.addFolder( 'THREE.Material' );
 
 	folder.add( material, 'transparent' );
-	folder.add( material, 'opacity', 0, 1 );
+	folder.add( material, 'opacity', 0, 1 ).step( 0.01 );
 	// folder.add( material, 'blending', constants.blendingMode );
 	// folder.add( material, 'blendSrc', constants.destinationFactors );
 	// folder.add( material, 'blendDst', constants.destinationFactors );
@@ -257,7 +289,7 @@ function guiMaterial( gui, mesh, material, geometry ) {
 	// folder.add( material, 'polygonOffset' );
 	// folder.add( material, 'polygonOffsetFactor' );
 	// folder.add( material, 'polygonOffsetUnits' );
-	folder.add( material, 'alphaTest', 0, 1 );
+	folder.add( material, 'alphaTest', 0, 1 ).step( 0.01 ).onChange( needsUpdate( material, geometry ) );
 	folder.add( material, 'visible' );
 	folder.add( material, 'side', constants.side ).onChange( needsUpdate( material, geometry ) );
 
@@ -267,10 +299,9 @@ function guiMeshBasicMaterial( gui, mesh, material, geometry ) {
 
 	var data = {
 		color: material.color.getHex(),
-		envMaps: envMapKeys,
-		map: textureMapKeys,
-		specularMap: textureMapKeys,
-		alphaMap: textureMapKeys
+		envMaps: envMapKeys[ 0 ],
+		map: diffuseMapKeys[ 0 ],
+		alphaMap: alphaMapKeys[ 0 ]
 	};
 
 	var folder = gui.addFolder( 'THREE.MeshBasicMaterial' );
@@ -282,9 +313,8 @@ function guiMeshBasicMaterial( gui, mesh, material, geometry ) {
 	folder.add( material, 'fog' );
 
 	folder.add( data, 'envMaps', envMapKeys ).onChange( updateTexture( material, 'envMap', envMaps ) );
-	folder.add( data, 'map', textureMapKeys ).onChange( updateTexture( material, 'map', textureMaps ) );
-	folder.add( data, 'specularMap', textureMapKeys ).onChange( updateTexture( material, 'specularMap', textureMaps ) );
-	folder.add( data, 'alphaMap', textureMapKeys ).onChange( updateTexture( material, 'alphaMap', textureMaps ) );
+	folder.add( data, 'map', diffuseMapKeys ).onChange( updateTexture( material, 'map', diffuseMaps ) );
+	folder.add( data, 'alphaMap', alphaMapKeys ).onChange( updateTexture( material, 'alphaMap', alphaMaps ) );
 	folder.add( material, 'combine', constants.combine );
 	folder.add( material, 'reflectivity', 0, 1 );
 	folder.add( material, 'refractionRatio', 0, 1 );
@@ -293,11 +323,17 @@ function guiMeshBasicMaterial( gui, mesh, material, geometry ) {
 
 function guiMeshDepthMaterial( gui, mesh, material, geometry ) {
 
+	var data = {
+		alphaMap: alphaMapKeys[ 0 ]
+	};
+
 	var folder = gui.addFolder( 'THREE.MeshDepthMaterial' );
 
 	folder.add( material, 'wireframe' );
 	folder.add( material, 'wireframeLinewidth', 0, 10 );
 
+	folder.add( data, 'alphaMap', alphaMapKeys ).onChange( updateTexture( material, 'alphaMap', alphaMaps ) );
+
 }
 
 function guiMeshNormalMaterial( gui, mesh, material, geometry ) {
@@ -332,10 +368,9 @@ function guiMeshLambertMaterial( gui, mesh, material, geometry ) {
 	var data = {
 		color: material.color.getHex(),
 		emissive: material.emissive.getHex(),
-		envMaps: envMapKeys,
-		map: textureMapKeys,
-		specularMap: textureMapKeys,
-		alphaMap: textureMapKeys
+		envMaps: envMapKeys[ 0 ],
+		map: diffuseMapKeys[ 0 ],
+		alphaMap: alphaMapKeys[ 0 ]
 	};
 
 	var folder = gui.addFolder( 'THREE.MeshLambertMaterial' );
@@ -349,26 +384,39 @@ function guiMeshLambertMaterial( gui, mesh, material, geometry ) {
 	folder.add( material, 'fog' );
 
 	folder.add( data, 'envMaps', envMapKeys ).onChange( updateTexture( material, 'envMap', envMaps ) );
-	folder.add( data, 'map', textureMapKeys ).onChange( updateTexture( material, 'map', textureMaps ) );
-	folder.add( data, 'specularMap', textureMapKeys ).onChange( updateTexture( material, 'specularMap', textureMaps ) );
-	folder.add( data, 'alphaMap', textureMapKeys ).onChange( updateTexture( material, 'alphaMap', textureMaps ) );
+	folder.add( data, 'map', diffuseMapKeys ).onChange( updateTexture( material, 'map', diffuseMaps ) );
+	folder.add( data, 'alphaMap', alphaMapKeys ).onChange( updateTexture( material, 'alphaMap', alphaMaps ) );
 	folder.add( material, 'combine', constants.combine );
 	folder.add( material, 'reflectivity', 0, 1 );
 	folder.add( material, 'refractionRatio', 0, 1 );
 
 }
 
+function guiMeshMatcapMaterial( gui, mesh, material ) {
+
+	var data = {
+		color: material.color.getHex(),
+		matcap: matcapKeys[ 1 ],
+		alphaMap: alphaMapKeys[ 0 ]
+	};
+
+	var folder = gui.addFolder( 'THREE.MeshMatcapMaterial' );
+
+	folder.addColor( data, 'color' ).onChange( handleColorChange( material.color ) );
+	folder.add( data, 'matcap', matcapKeys ).onChange( updateTexture( material, 'matcap', matcaps ) );
+	folder.add( data, 'alphaMap', alphaMapKeys ).onChange( updateTexture( material, 'alphaMap', alphaMaps ) );
+
+}
+
 function guiMeshPhongMaterial( gui, mesh, material, geometry ) {
 
 	var data = {
 		color: material.color.getHex(),
 		emissive: material.emissive.getHex(),
 		specular: material.specular.getHex(),
-		envMaps: envMapKeys,
-		map: textureMapKeys,
-		lightMap: textureMapKeys,
-		specularMap: textureMapKeys,
-		alphaMap: textureMapKeys
+		envMaps: envMapKeys[ 0 ],
+		map: diffuseMapKeys[ 0 ],
+		alphaMap: alphaMapKeys[ 0 ]
 	};
 
 	var folder = gui.addFolder( 'THREE.MeshPhongMaterial' );
@@ -384,10 +432,8 @@ function guiMeshPhongMaterial( gui, mesh, material, geometry ) {
 	folder.add( material, 'vertexColors', constants.colors ).onChange( needsUpdate( material, geometry ) );
 	folder.add( material, 'fog' );
 	folder.add( data, 'envMaps', envMapKeys ).onChange( updateTexture( material, 'envMap', envMaps ) );
-	folder.add( data, 'map', textureMapKeys ).onChange( updateTexture( material, 'map', textureMaps ) );
-	folder.add( data, 'lightMap', textureMapKeys ).onChange( updateTexture( material, 'lightMap', textureMaps ) );
-	folder.add( data, 'specularMap', textureMapKeys ).onChange( updateTexture( material, 'specularMap', textureMaps ) );
-	folder.add( data, 'alphaMap', textureMapKeys ).onChange( updateTexture( material, 'alphaMap', textureMaps ) );
+	folder.add( data, 'map', diffuseMapKeys ).onChange( updateTexture( material, 'map', diffuseMaps ) );
+	folder.add( data, 'alphaMap', alphaMapKeys ).onChange( updateTexture( material, 'alphaMap', alphaMaps ) );
 
 }
 
@@ -396,11 +442,9 @@ function guiMeshStandardMaterial( gui, mesh, material, geometry ) {
 	var data = {
 		color: material.color.getHex(),
 		emissive: material.emissive.getHex(),
-		envMaps: envMapKeys,
-		map: textureMapKeys,
-		lightMap: textureMapKeys,
-		specularMap: textureMapKeys,
-		alphaMap: textureMapKeys
+		envMaps: envMapKeys[ 0 ],
+		map: diffuseMapKeys[ 0 ],
+		alphaMap: alphaMapKeys[ 0 ]
 	};
 
 	var folder = gui.addFolder( 'THREE.MeshStandardMaterial' );
@@ -416,9 +460,8 @@ function guiMeshStandardMaterial( gui, mesh, material, geometry ) {
 	folder.add( material, 'vertexColors', constants.colors ).onChange( needsUpdate( material, geometry ) );
 	folder.add( material, 'fog' );
 	folder.add( data, 'envMaps', envMapKeys ).onChange( updateTexture( material, 'envMap', envMaps ) );
-	folder.add( data, 'map', textureMapKeys ).onChange( updateTexture( material, 'map', textureMaps ) );
-	folder.add( data, 'lightMap', textureMapKeys ).onChange( updateTexture( material, 'lightMap', textureMaps ) );
-	folder.add( data, 'alphaMap', textureMapKeys ).onChange( updateTexture( material, 'alphaMap', textureMaps ) );
+	folder.add( data, 'map', diffuseMapKeys ).onChange( updateTexture( material, 'map', diffuseMaps ) );
+	folder.add( data, 'alphaMap', alphaMapKeys ).onChange( updateTexture( material, 'alphaMap', alphaMaps ) );
 
 	// TODO roughnessMap and metalnessMap
 
@@ -429,11 +472,9 @@ function guiMeshPhysicalMaterial( gui, mesh, material, geometry ) {
 	var data = {
 		color: material.color.getHex(),
 		emissive: material.emissive.getHex(),
-		envMaps: envMapKeys,
-		map: textureMapKeys,
-		lightMap: textureMapKeys,
-		specularMap: textureMapKeys,
-		alphaMap: textureMapKeys
+		envMaps: envMapKeys[ 0 ],
+		map: diffuseMapKeys[ 0 ],
+		alphaMap: alphaMapKeys[ 0 ]
 	};
 
 	var folder = gui.addFolder( 'THREE.MeshPhysicalMaterial' );
@@ -452,9 +493,8 @@ function guiMeshPhysicalMaterial( gui, mesh, material, geometry ) {
 	folder.add( material, 'vertexColors', constants.colors ).onChange( needsUpdate( material, geometry ) );
 	folder.add( material, 'fog' );
 	folder.add( data, 'envMaps', envMapKeys ).onChange( updateTexture( material, 'envMap', envMaps ) );
-	folder.add( data, 'map', textureMapKeys ).onChange( updateTexture( material, 'map', textureMaps ) );
-	folder.add( data, 'lightMap', textureMapKeys ).onChange( updateTexture( material, 'lightMap', textureMaps ) );
-	folder.add( data, 'alphaMap', textureMapKeys ).onChange( updateTexture( material, 'alphaMap', textureMaps ) );
+	folder.add( data, 'map', diffuseMapKeys ).onChange( updateTexture( material, 'map', diffuseMaps ) );
+	folder.add( data, 'alphaMap', alphaMapKeys ).onChange( updateTexture( material, 'alphaMap', alphaMaps ) );
 
 	// TODO roughnessMap and metalnessMap
 
@@ -487,6 +527,16 @@ function chooseFromHash( gui, mesh, geometry ) {
 
 			break;
 
+		case 'MeshMatcapMaterial' :
+
+			material = new THREE.MeshMatcapMaterial( { matcap: matcaps.porcelainWhite } );
+			guiMaterial( gui, mesh, material, geometry );
+			guiMeshMatcapMaterial( gui, mesh, material, geometry );
+
+			return material;
+
+			break;
+
 		case 'MeshPhongMaterial' :
 
 			material = new THREE.MeshPhongMaterial( { color: 0x2194CE } );

+ 0 - 2
editor/index.html

@@ -4,8 +4,6 @@
 		<title>three.js / editor</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<link rel="apple-touch-icon" href="images/icon.png">
 		<link rel="manifest" href="manifest.json">
 	</head>

+ 7 - 1
editor/js/Editor.js

@@ -482,7 +482,11 @@ Editor.prototype = {
 
 	focus: function ( object ) {
 
-		this.signals.objectFocused.dispatch( object );
+		if ( object !== undefined ) {
+
+			this.signals.objectFocused.dispatch( object );
+
+		}
 
 	},
 
@@ -498,6 +502,8 @@ Editor.prototype = {
 		this.storage.clear();
 
 		this.camera.copy( this.DEFAULT_CAMERA );
+		this.scene.name = "Scene";
+		this.scene.userData = {};
 		this.scene.background.setHex( 0xaaaaaa );
 		this.scene.fog = null;
 

+ 2 - 0
editor/js/Sidebar.Geometry.js

@@ -179,6 +179,8 @@ Sidebar.Geometry = function ( editor ) {
 
 			}
 
+			if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
+
 			geometryBoundingSphere.setValue( Math.floor( geometry.boundingSphere.radius * 1000 ) / 1000 );
 
 		} else {

+ 136 - 3
editor/js/Sidebar.Material.js

@@ -83,10 +83,14 @@ Sidebar.Material = function ( editor ) {
 		'MeshDepthMaterial': 'MeshDepthMaterial',
 		'MeshNormalMaterial': 'MeshNormalMaterial',
 		'MeshLambertMaterial': 'MeshLambertMaterial',
+		'MeshMatcapMaterial': 'MeshMatcapMaterial',
 		'MeshPhongMaterial': 'MeshPhongMaterial',
+		'MeshToonMaterial': 'MeshToonMaterial',
 		'MeshStandardMaterial': 'MeshStandardMaterial',
 		'MeshPhysicalMaterial': 'MeshPhysicalMaterial',
+		'RawShaderMaterial': 'RawShaderMaterial',
 		'ShaderMaterial': 'ShaderMaterial',
+		'ShadowMaterial': 'ShadowMaterial',
 		'SpriteMaterial': 'SpriteMaterial'
 
 	} ).setWidth( '150px' ).setFontSize( '12px' ).onChange( update );
@@ -257,6 +261,20 @@ Sidebar.Material = function ( editor ) {
 
 	container.add( materialVertexColorsRow );
 
+	// depth packing
+
+	var materialDepthPackingRow = new UI.Row();
+	var materialDepthPacking = new UI.Select().setOptions( {
+		[ THREE.BasicDepthPacking ]: 'BasicDepthPacking',
+		[ THREE.RGBADepthPacking ]: 'RGBADepthPacking'
+	} );
+	materialDepthPacking.onChange( update );
+
+	materialDepthPackingRow.add( new UI.Text( strings.getKey( 'sidebar/material/depthPacking' ) ).setWidth( '90px' ) );
+	materialDepthPackingRow.add( materialDepthPacking );
+
+	container.add( materialDepthPackingRow );
+
 	// skinning
 
 	var materialSkinningRow = new UI.Row();
@@ -279,6 +297,18 @@ Sidebar.Material = function ( editor ) {
 
 	container.add( materialMapRow );
 
+	// matcap map
+
+	var materialMatcapMapRow = new UI.Row();
+	var materialMatcapMapEnabled = new UI.Checkbox( false ).onChange( update );
+	var materialMatcapMap = new UI.Texture().onChange( update );
+
+	materialMatcapMapRow.add( new UI.Text( strings.getKey( 'sidebar/material/matcap' ) ).setWidth( '90px' ) );
+	materialMatcapMapRow.add( materialMatcapMapEnabled );
+	materialMatcapMapRow.add( materialMatcapMap );
+
+	container.add( materialMatcapMapRow );
+
 	// alpha map
 
 	var materialAlphaMapRow = new UI.Row();
@@ -419,6 +449,18 @@ Sidebar.Material = function ( editor ) {
 
 	container.add( materialEmissiveMapRow );
 
+	// gradient map
+
+	var materialGradientMapRow = new UI.Row();
+	var materialGradientMapEnabled = new UI.Checkbox( false ).onChange( update );
+	var materialGradientMap = new UI.Texture().onChange( update );
+
+	materialGradientMapRow.add( new UI.Text( strings.getKey( 'sidebar/material/gradientmap' ) ).setWidth( '90px' ) );
+	materialGradientMapRow.add( materialGradientMapEnabled );
+	materialGradientMapRow.add( materialGradientMap );
+
+	container.add( materialGradientMapRow );
+
 	// side
 
 	var materialSideRow = new UI.Row();
@@ -438,7 +480,7 @@ Sidebar.Material = function ( editor ) {
 	// shading
 
 	var materialShadingRow = new UI.Row();
-	var materialShading = new UI.Checkbox(false).setLeft( '100px' ).onChange( update );
+	var materialShading = new UI.Checkbox( false ).setLeft( '100px' ).onChange( update );
 
 	materialShadingRow.add( new UI.Text( strings.getKey( 'sidebar/material/flatshaded' ) ).setWidth( '90px' ) );
 	materialShadingRow.add( materialShading );
@@ -537,10 +579,16 @@ Sidebar.Material = function ( editor ) {
 
 			}
 
-			if ( material instanceof THREE[ materialClass.getValue() ] === false ) {
+			if ( material.type !== materialClass.getValue() ) {
 
 				material = new THREE[ materialClass.getValue() ]();
 
+				if ( material.type == "RawShaderMaterial" ) {
+
+					material.vertexShader = vertexShaderVariables + material.vertexShader;
+
+				}
+
 				editor.execute( new SetMaterialCommand( currentObject, material, currentMaterialSlot ), 'New Material: ' + materialClass.getValue() );
 				// TODO Copy other references in the scene graph
 				// keeping name and UUID then.
@@ -610,6 +658,17 @@ Sidebar.Material = function ( editor ) {
 
 			}
 
+			if ( material.depthPacking !== undefined ) {
+
+				var depthPacking = parseInt( materialDepthPacking.getValue() );
+				if ( material.depthPacking !== depthPacking ) {
+
+					editor.execute( new SetMaterialValueCommand( currentObject, 'depthPacking', depthPacking, currentMaterialSlot ) );
+
+				}
+
+			}
+
 			if ( material.skinning !== undefined && material.skinning !== materialSkinning.getValue() ) {
 
 				editor.execute( new SetMaterialValueCommand( currentObject, 'skinning', materialSkinning.getValue(), currentMaterialSlot ) );
@@ -637,6 +696,27 @@ Sidebar.Material = function ( editor ) {
 
 			}
 
+			if ( material.matcap !== undefined ) {
+
+				var mapEnabled = materialMatcapMapEnabled.getValue() === true;
+
+				if ( objectHasUvs ) {
+
+					var matcap = mapEnabled ? materialMatcapMap.getValue() : null;
+					if ( material.matcap !== matcap ) {
+
+						editor.execute( new SetMaterialMapCommand( currentObject, 'matcap', matcap, currentMaterialSlot ) );
+
+					}
+
+				} else {
+
+					if ( mapEnabled ) textureWarning = true;
+
+				}
+
+			}
+
 			if ( material.alphaMap !== undefined ) {
 
 				var mapEnabled = materialAlphaMapEnabled.getValue() === true;
@@ -891,6 +971,20 @@ Sidebar.Material = function ( editor ) {
 
 			}
 
+			if ( material.gradientMap !== undefined ) {
+
+				var gradientMapEnabled = materialGradientMapEnabled.getValue() === true;
+
+				var gradientMap = gradientMapEnabled ? materialGradientMap.getValue() : null;
+
+				if ( material.gradientMap !== gradientMap ) {
+
+					editor.execute( new SetMaterialMapCommand( currentObject, 'gradientMap', gradientMap, currentMaterialSlot ) );
+
+				}
+
+			}
+
 			if ( material.side !== undefined ) {
 
 				var side = parseInt( materialSide.getValue() );
@@ -945,7 +1039,7 @@ Sidebar.Material = function ( editor ) {
 
 			if ( material.wireframe !== undefined && material.wireframe !== materialWireframe.getValue() ) {
 
-				editor.execute( new SetMaterialValueCommand( currentObject, 'wireframe', materialWireframe.getValue(), currentMaterialSlot) );
+				editor.execute( new SetMaterialValueCommand( currentObject, 'wireframe', materialWireframe.getValue(), currentMaterialSlot ) );
 
 			}
 
@@ -983,8 +1077,10 @@ Sidebar.Material = function ( editor ) {
 			'clearCoatRoughness': materialClearCoatRoughnessRow,
 			'vertexShader': materialProgramRow,
 			'vertexColors': materialVertexColorsRow,
+			'depthPacking': materialDepthPackingRow,
 			'skinning': materialSkinningRow,
 			'map': materialMapRow,
+			'matcap': materialMatcapMapRow,
 			'alphaMap': materialAlphaMapRow,
 			'bumpMap': materialBumpMapRow,
 			'normalMap': materialNormalMapRow,
@@ -996,6 +1092,7 @@ Sidebar.Material = function ( editor ) {
 			'lightMap': materialLightMapRow,
 			'aoMap': materialAOMapRow,
 			'emissiveMap': materialEmissiveMapRow,
+			'gradientMap': materialGradientMapRow,
 			'side': materialSideRow,
 			'flatShading': materialShadingRow,
 			'blending': materialBlendingRow,
@@ -1122,6 +1219,12 @@ Sidebar.Material = function ( editor ) {
 
 		}
 
+		if ( material.depthPacking !== undefined ) {
+
+			materialDepthPacking.setValue( material.depthPacking );
+
+		}
+
 		if ( material.skinning !== undefined ) {
 
 			materialSkinning.setValue( material.skinning );
@@ -1140,6 +1243,18 @@ Sidebar.Material = function ( editor ) {
 
 		}
 
+		if ( material.matcap !== undefined ) {
+
+			materialMatcapMapEnabled.setValue( material.matcap !== null );
+
+			if ( material.matcap !== null || resetTextureSelectors ) {
+
+				materialMatcapMap.setValue( material.matcap );
+
+			}
+
+		}
+
 		if ( material.alphaMap !== undefined ) {
 
 			materialAlphaMapEnabled.setValue( material.alphaMap !== null );
@@ -1240,6 +1355,18 @@ Sidebar.Material = function ( editor ) {
 
 		}
 
+		if ( material.gradientMap !== undefined ) {
+
+			materialGradientMapEnabled.setValue( material.gradientMap !== null );
+
+			if ( material.gradientMap !== null || resetTextureSelectors ) {
+
+				materialGradientMap.setValue( material.gradientMap );
+
+			}
+
+		}
+
 		if ( material.reflectivity !== undefined ) {
 
 			materialReflectivity.setValue( material.reflectivity );
@@ -1377,6 +1504,12 @@ Sidebar.Material = function ( editor ) {
 
 	} );
 
+	var vertexShaderVariables = [
+		'uniform mat4 projectionMatrix;',
+		'uniform mat4 modelViewMatrix;\n',
+		'attribute vec3 position;\n\n',
+	].join( '\n' );
+
 	return container;
 
 };

+ 4 - 0
editor/js/Strings.js

@@ -183,6 +183,7 @@ var Strings = function ( config ) {
 			'sidebar/material/vertex': 'Vertex',
 			'sidebar/material/fragment': 'fragment',
 			'sidebar/material/color': 'Color',
+			'sidebar/material/depthPacking': 'Depth Packing',
 			'sidebar/material/roughness': 'Roughness',
 			'sidebar/material/metalness': 'Metalness',
 			'sidebar/material/emissive': 'Emissive',
@@ -195,6 +196,7 @@ var Strings = function ( config ) {
 			'sidebar/material/vertexcolors/face': 'Face',
 			'sidebar/material/vertexcolors/vertex': 'Vertex',
 			'sidebar/material/skinning': 'Skinning',
+			'sidebar/material/matcap': 'Matcap',
 			'sidebar/material/map': 'Map',
 			'sidebar/material/alphamap': 'Alpha Map',
 			'sidebar/material/bumpmap': 'Bump Map',
@@ -207,6 +209,7 @@ var Strings = function ( config ) {
 			'sidebar/material/lightmap': 'Light Map',
 			'sidebar/material/aomap': 'AO Map',
 			'sidebar/material/emissivemap': 'Emissive Map',
+			'sidebar/material/gradientmap': 'Gradient Map',
 			'sidebar/material/side': 'Side',
 			'sidebar/material/side/front': 'Front',
 			'sidebar/material/side/back': 'Back',
@@ -299,6 +302,7 @@ var Strings = function ( config ) {
 			'menubar/add/icosahedron': '二十面体',
 			'menubar/add/torus': '圆环体',
 			'menubar/add/torusknot': '环面纽结体',
+			'menubar/add/tube': '管',
 			'menubar/add/lathe': '酒杯',
 			'menubar/add/sprite': '精灵',
 			'menubar/add/pointlight': '点光源',

+ 1 - 0
editor/js/Viewport.js

@@ -413,6 +413,7 @@ var Viewport = function ( editor ) {
 
 	signals.objectRemoved.add( function ( object ) {
 
+		controls.enabled = true; // see #14180
 		if ( object === transformControls.object ) {
 
 			transformControls.detach();

+ 1 - 1
editor/js/libs/codemirror/mode/glsl.js

@@ -205,7 +205,7 @@
     "do for while if else in out inout float int void bool true false " +
     "lowp mediump highp precision invariant discard return mat2 mat3 " +
     "mat4 vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 sampler2D " +
-    "samplerCube struct gl_FragCoord gl_FragColor";
+    "samplerCube struct gl_FragCoord gl_FragColor gl_Position";
   var glslBuiltins = "radians degrees sin cos tan asin acos atan pow " +
     "exp log exp2 log2 sqrt inversesqrt abs sign floor ceil fract mod " +
     "min max clamp mix step smoothstep length distance dot cross " +

+ 38 - 38
editor/js/libs/three.html.js

@@ -2,74 +2,74 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
- THREE.HTMLGroup = function ( dom ) {
+THREE.HTMLGroup = function ( dom ) {
 
- 	THREE.Group.call( this );
+	THREE.Group.call( this );
 
- 	this.type = 'HTMLGroup';
+	this.type = 'HTMLGroup';
 
- 	/*
- 	dom.addEventListener( 'mousemove', function ( event ) {
+	/*
+	dom.addEventListener( 'mousemove', function ( event ) {
 
- 		console.log( 'mousemove' );
+		console.log( 'mousemove' );
 
- 	} );
+	} );
 
- 	dom.addEventListener( 'click', function ( event ) {
+	dom.addEventListener( 'click', function ( event ) {
 
- 		console.log( 'click' );
+		console.log( 'click' );
 
- 	} );
- 	*/
+	} );
+	*/
 
- };
+};
 
- THREE.HTMLGroup.prototype = Object.assign( Object.create( THREE.Group.prototype ), {
+THREE.HTMLGroup.prototype = Object.assign( Object.create( THREE.Group.prototype ), {
 
- 	constructor: THREE.HTMLGroup
+	constructor: THREE.HTMLGroup
 
- } );
+} );
 
- THREE.HTMLMesh = function ( dom ) {
+THREE.HTMLMesh = function ( dom ) {
 
- 	var texture = new THREE.HTMLTexture( dom );
+	var texture = new THREE.HTMLTexture( dom );
 
- 	var geometry = new THREE.PlaneBufferGeometry( texture.image.width * 0.05, texture.image.height * 0.05 );
- 	var material = new THREE.MeshBasicMaterial( { map: texture } );
+	var geometry = new THREE.PlaneBufferGeometry( texture.image.width * 0.05, texture.image.height * 0.05 );
+	var material = new THREE.MeshBasicMaterial( { map: texture } );
 
- 	THREE.Mesh.call( this, geometry, material );
+	THREE.Mesh.call( this, geometry, material );
 
- 	this.type = 'HTMLMesh';
+	this.type = 'HTMLMesh';
 
- };
+};
 
- THREE.HTMLMesh.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {
+THREE.HTMLMesh.prototype = Object.assign( Object.create( THREE.Mesh.prototype ), {
 
- 	constructor: THREE.HTMLMesh
+	constructor: THREE.HTMLMesh
 
- } );
+} );
 
- THREE.HTMLTexture = function ( dom ) {
+THREE.HTMLTexture = function ( dom ) {
 
- 	THREE.CanvasTexture.call( this, html2canvas( dom ) );
+	THREE.CanvasTexture.call( this, html2canvas( dom ) );
 
- 	this.dom = dom;
+	this.dom = dom;
 
- 	this.anisotropy = 16;
+	this.anisotropy = 16;
 
- };
+};
 
- THREE.HTMLTexture.prototype = Object.assign( Object.create( THREE.CanvasTexture.prototype ), {
+THREE.HTMLTexture.prototype = Object.assign( Object.create( THREE.CanvasTexture.prototype ), {
 
- 	constructor: THREE.HTMLTexture,
+	constructor: THREE.HTMLTexture,
 
- 	update: function () {
+	update: function () {
 
- 		console.log( 'yo!', this, this.dom );
+		console.log( 'yo!', this, this.dom );
 
- 		this.image = html2canvas( this.dom );
- 		this.needsUpdate = true;
+		this.image = html2canvas( this.dom );
+		this.needsUpdate = true;
 
- 	}
+	}
 
- } );
+} );

+ 25 - 22
examples/js/animation/MMDPhysics.js

@@ -994,14 +994,8 @@ THREE.MMDPhysics = ( function () {
 		_getWorldTransformForBone: function () {
 
 			var manager = this.manager;
-
-			var tr = manager.allocTransform();
-			this.body.getMotionState().getWorldTransform( tr );
-			var tr2 = manager.multiplyTransforms( tr, this.boneOffsetFormInverse );
-
-			manager.freeTransform( tr );
-
-			return tr2;
+			var tr = this.body.getCenterOfMassTransform();
+			return manager.multiplyTransforms( tr, this.boneOffsetFormInverse );
 
 		},
 
@@ -1057,7 +1051,11 @@ THREE.MMDPhysics = ( function () {
 			//this.bone.quaternion.multiply( thQ2 );
 
 			thQ3.setFromRotationMatrix( this.bone.matrix );
-			this.bone.quaternion.copy( thQ2.multiply( thQ3 ) );
+
+			// Renormalizing quaternion here because repeatedly transforming
+			// quaternion continuously accumulates floating point error and
+			// can end up being overflow. See #15335
+			this.bone.quaternion.copy( thQ2.multiply( thQ3 ).normalize() );
 
 			manager.freeThreeQuaternion( thQ );
 			manager.freeThreeQuaternion( thQ2 );
@@ -1072,19 +1070,24 @@ THREE.MMDPhysics = ( function () {
 
 			var manager = this.manager;
 
-			var tr = this.body.getCenterOfMassTransform();
-			var origin = tr.getOrigin();
-			
-			var matrixInv = manager.allocThreeMatrix4();
-			matrixInv.copy( this.bone.parent.matrixWorld ).getInverse( matrixInv );
-			
-			var pos = manager.allocThreeVector3();
-			pos.set( origin.x(), origin.y(), origin.z() ).applyMatrix4( matrixInv );
-
-			this.bone.position.copy( pos );
-
-			manager.freeThreeVector3( pos );
-			manager.freeThreeMatrix4( matrixInv );
+			var tr = this._getWorldTransformForBone();
+
+			var thV = manager.allocThreeVector3();
+
+			var o = manager.getOrigin( tr );
+			thV.set( o.x(), o.y(), o.z() );
+
+			if ( this.bone.parent ) {
+
+				this.bone.parent.worldToLocal( thV );
+
+			}
+
+			this.bone.position.copy( thV );
+
+			manager.freeThreeVector3( thV );
+
+			manager.freeTransform( tr );
 
 		}
 

+ 3 - 3
examples/js/effects/OutlineEffect.js

@@ -66,9 +66,9 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 	};
 
 	var uniformsChunk = {
-		outlineThickness: { type: "f", value: defaultThickness },
-		outlineColor: { type: "c", value: defaultColor },
-		outlineAlpha: { type: "f", value: defaultAlpha }
+		outlineThickness: { value: defaultThickness },
+		outlineColor: { value: defaultColor },
+		outlineAlpha: { value: defaultAlpha }
 	};
 
 	var vertexShaderChunk = [

+ 37 - 32
examples/js/loaders/GLTFLoader.js

@@ -368,26 +368,26 @@ THREE.GLTFLoader = ( function () {
 	 *
 	 * PR: https://github.com/KhronosGroup/glTF/pull/1163
 	 */
-	function GLTFMaterialsUnlitExtension( json ) {
+	function GLTFMaterialsUnlitExtension() {
 
 		this.name = EXTENSIONS.KHR_MATERIALS_UNLIT;
 
 	}
 
-	GLTFMaterialsUnlitExtension.prototype.getMaterialType = function ( material ) {
+	GLTFMaterialsUnlitExtension.prototype.getMaterialType = function () {
 
 		return THREE.MeshBasicMaterial;
 
 	};
 
-	GLTFMaterialsUnlitExtension.prototype.extendParams = function ( materialParams, material, parser ) {
+	GLTFMaterialsUnlitExtension.prototype.extendParams = function ( materialParams, materialDef, parser ) {
 
 		var pending = [];
 
 		materialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );
 		materialParams.opacity = 1.0;
 
-		var metallicRoughness = material.pbrMetallicRoughness;
+		var metallicRoughness = materialDef.pbrMetallicRoughness;
 
 		if ( metallicRoughness ) {
 
@@ -563,7 +563,7 @@ THREE.GLTFLoader = ( function () {
 	 *
 	 * Specification:
 	 */
-	function GLTFTextureTransformExtension( json ) {
+	function GLTFTextureTransformExtension() {
 
 		this.name = EXTENSIONS.KHR_TEXTURE_TRANSFORM;
 
@@ -646,9 +646,9 @@ THREE.GLTFLoader = ( function () {
 
 			},
 
-			extendParams: function ( params, material, parser ) {
+			extendParams: function ( materialParams, materialDef, parser ) {
 
-				var pbrSpecularGlossiness = material.extensions[ this.name ];
+				var pbrSpecularGlossiness = materialDef.extensions[ this.name ];
 
 				var shader = THREE.ShaderLib[ 'standard' ];
 
@@ -711,13 +711,13 @@ THREE.GLTFLoader = ( function () {
 				uniforms.specularMap = { value: null };
 				uniforms.glossinessMap = { value: null };
 
-				params.vertexShader = shader.vertexShader;
-				params.fragmentShader = fragmentShader;
-				params.uniforms = uniforms;
-				params.defines = { 'STANDARD': '' };
+				materialParams.vertexShader = shader.vertexShader;
+				materialParams.fragmentShader = fragmentShader;
+				materialParams.uniforms = uniforms;
+				materialParams.defines = { 'STANDARD': '' };
 
-				params.color = new THREE.Color( 1.0, 1.0, 1.0 );
-				params.opacity = 1.0;
+				materialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );
+				materialParams.opacity = 1.0;
 
 				var pending = [];
 
@@ -725,32 +725,32 @@ THREE.GLTFLoader = ( function () {
 
 					var array = pbrSpecularGlossiness.diffuseFactor;
 
-					params.color.fromArray( array );
-					params.opacity = array[ 3 ];
+					materialParams.color.fromArray( array );
+					materialParams.opacity = array[ 3 ];
 
 				}
 
 				if ( pbrSpecularGlossiness.diffuseTexture !== undefined ) {
 
-					pending.push( parser.assignTexture( params, 'map', pbrSpecularGlossiness.diffuseTexture ) );
+					pending.push( parser.assignTexture( materialParams, 'map', pbrSpecularGlossiness.diffuseTexture ) );
 
 				}
 
-				params.emissive = new THREE.Color( 0.0, 0.0, 0.0 );
-				params.glossiness = pbrSpecularGlossiness.glossinessFactor !== undefined ? pbrSpecularGlossiness.glossinessFactor : 1.0;
-				params.specular = new THREE.Color( 1.0, 1.0, 1.0 );
+				materialParams.emissive = new THREE.Color( 0.0, 0.0, 0.0 );
+				materialParams.glossiness = pbrSpecularGlossiness.glossinessFactor !== undefined ? pbrSpecularGlossiness.glossinessFactor : 1.0;
+				materialParams.specular = new THREE.Color( 1.0, 1.0, 1.0 );
 
 				if ( Array.isArray( pbrSpecularGlossiness.specularFactor ) ) {
 
-					params.specular.fromArray( pbrSpecularGlossiness.specularFactor );
+					materialParams.specular.fromArray( pbrSpecularGlossiness.specularFactor );
 
 				}
 
 				if ( pbrSpecularGlossiness.specularGlossinessTexture !== undefined ) {
 
 					var specGlossMapDef = pbrSpecularGlossiness.specularGlossinessTexture;
-					pending.push( parser.assignTexture( params, 'glossinessMap', specGlossMapDef ) );
-					pending.push( parser.assignTexture( params, 'specularMap', specGlossMapDef ) );
+					pending.push( parser.assignTexture( materialParams, 'glossinessMap', specGlossMapDef ) );
+					pending.push( parser.assignTexture( materialParams, 'specularMap', specGlossMapDef ) );
 
 				}
 
@@ -793,6 +793,7 @@ THREE.GLTFLoader = ( function () {
 				material.bumpScale = 1;
 
 				material.normalMap = params.normalMap === undefined ? null : params.normalMap;
+
 				if ( params.normalScale ) material.normalScale = params.normalScale;
 
 				material.displacementMap = null;
@@ -2116,15 +2117,19 @@ THREE.GLTFLoader = ( function () {
 
 		return this.getDependency( 'texture', mapDef.index ).then( function ( texture ) {
 
-			switch ( mapName ) {
+			if ( ! texture.isCompressedTexture ) {
 
-				case 'aoMap':
-				case 'emissiveMap':
-				case 'metalnessMap':
-				case 'normalMap':
-				case 'roughnessMap':
-					texture.format = THREE.RGBFormat;
-					break;
+				switch ( mapName ) {
+
+					case 'aoMap':
+					case 'emissiveMap':
+					case 'metalnessMap':
+					case 'normalMap':
+					case 'roughnessMap':
+						texture.format = THREE.RGBFormat;
+						break;
+
+				}
 
 			}
 
@@ -2285,13 +2290,13 @@ THREE.GLTFLoader = ( function () {
 		if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ] ) {
 
 			var sgExtension = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ];
-			materialType = sgExtension.getMaterialType( materialDef );
+			materialType = sgExtension.getMaterialType();
 			pending.push( sgExtension.extendParams( materialParams, materialDef, parser ) );
 
 		} else if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ] ) {
 
 			var kmuExtension = extensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ];
-			materialType = kmuExtension.getMaterialType( materialDef );
+			materialType = kmuExtension.getMaterialType();
 			pending.push( kmuExtension.extendParams( materialParams, materialDef, parser ) );
 
 		} else {

+ 5 - 3
examples/js/loaders/KTXLoader.js

@@ -137,13 +137,15 @@ var KhronosTextureContainer = ( function () {
 		for ( var level = 0; level < mipmapCount; level ++ ) {
 
 			var imageSize = new Int32Array( this.arrayBuffer, dataOffset, 1 )[ 0 ]; // size per face, since not supporting array cubemaps
+			dataOffset += 4; // size of the image + 4 for the imageSize field
+			
 			for ( var face = 0; face < this.numberOfFaces; face ++ ) {
 
-				var byteArray = new Uint8Array( this.arrayBuffer, dataOffset + 4, imageSize );
+				var byteArray = new Uint8Array( this.arrayBuffer, dataOffset, imageSize );
 
 				mipmaps.push( { "data": byteArray, "width": width, "height": height } );
-
-				dataOffset += imageSize + 4; // size of the image + 4 for the imageSize field
+				
+				dataOffset += imageSize;
 				dataOffset += 3 - ( ( imageSize + 3 ) % 4 ); // add padding for odd sized image
 
 			}

+ 167 - 25
examples/js/loaders/LWOLoader.js

@@ -1,12 +1,12 @@
 /**
  * @author Lewy Blue https://github.com/looeee
  *
- * Load files in LWO3 format
+ * Load files in LWO3 and LWO2 format
  *
  * LWO3 format specification:
  * 	http://static.lightwave3d.com/sdk/2018/html/filefmts/lwo3.html
  *
- * LWO2 format specification (not tested, however the loader should be largely backwards compatible)
+ * LWO2 format specification:
  * 	http://static.lightwave3d.com/sdk/2018/html/filefmts/lwo2.html
  *
  */
@@ -291,7 +291,15 @@ THREE.LWOLoader = ( function () {
 
 			for ( var name in lwoTree.materials ) {
 
-				materials.push( this.parseMaterial( lwoTree.materials[ name ], name, lwoTree.textures ) );
+				if ( lwoTree.format === 'LWO3' ) {
+
+					materials.push( this.parseMaterial( lwoTree.materials[ name ], name, lwoTree.textures ) );
+
+				} else if ( lwoTree.format === 'LWO2' ) {
+
+					materials.push( this.parseMaterialLwo2( lwoTree.materials[ name ], name, lwoTree.textures ) );
+
+				}
 
 			}
 
@@ -326,6 +334,20 @@ THREE.LWOLoader = ( function () {
 
 		},
 
+		parseMaterialLwo2( materialData, name, textures ) {
+
+			var params = {
+				name: name,
+				side: this.getSide( materialData.attributes ),
+				flatShading: this.getSmooth( materialData.attributes ),
+			};
+
+			var attributes = this.parseAttributes( materialData.attributes, {} );
+			params = Object.assign( params, attributes );
+			return new THREE[ 'MeshPhongMaterial' ]( params );
+
+		},
+
 		// Note: converting from left to right handed coords by switching x -> -x in vertices, and
 		// then switching mat FrontSide -> BackSide
 		// NB: this means that THREE.FrontSide and THREE.BackSide have been switched!
@@ -404,7 +426,7 @@ THREE.LWOLoader = ( function () {
 
 			var maps = {};
 
-			for ( name in textureNodes ) {
+			for ( var name in textureNodes ) {
 
 				var node = textureNodes[ name ];
 				var path = node.fileName;
@@ -656,7 +678,7 @@ THREE.LWOLoader = ( function () {
 		// In this case, we'll strip out everything and load 'bumpMap.png' from the same directory as the model
 		cleanPath( path ) {
 
-			if ( path.indexOf( 'Images' ) === 0 ) return './' + path;
+			if ( path.toLowerCase().indexOf( 'images' ) === 0 ) return './' + path;
 			return path.split( '/' ).pop().split( '\\' ).pop();
 
 		},
@@ -744,7 +766,17 @@ THREE.LWOLoader = ( function () {
 
 					);
 
-				} else if ( dim > 4 ) console.warn( 'LWOLoader: polygons with greater than 4 sides are not supported' );
+				} else if ( dim > 4 ) {
+
+					for ( var k = 1; k < dim - 1; k ++ ) {
+
+						remappedIndices.push( indices[ i ], indices[ i + k ], indices[ i + k + 1 ] );
+
+					}
+
+					console.warn( 'LWOLoader: polygons with greater than 4 sides are not supported' );
+
+				}
 
 				i += dim;
 
@@ -850,7 +882,16 @@ THREE.LWOLoader = ( function () {
 
 					remappedIndices.push( indices[ i * 2 ], indices[ i * 2 + 1 ], indices[ i * 2 ], indices[ i * 2 + 1 ] );
 
-				} // ignore > 4 for now
+				} else {
+
+					 // ignore > 4 for now
+					for ( var k = 0; k < dim - 2; k ++ ) {
+
+						remappedIndices.push( indices[ i * 2 ], indices[ i * 2 + 1 ] );
+
+					}
+
+				}
 
 			} );
 
@@ -1001,6 +1042,13 @@ THREE.LWOLoader = ( function () {
 
 			var blockID = this.reader.getIDTag();
 			var length = this.reader.getUint32(); // size of data in bytes
+			if ( this.tree.format === 'LWO2' && length > this.reader.dv.byteLength - this.reader.offset ) {
+
+				this.reader.offset -= 4;
+				length = this.reader.getUint16();
+
+			}
+
 
 			// Data types may be found in either LWO2 OR LWO3 spec
 			switch ( blockID ) {
@@ -1080,7 +1128,6 @@ THREE.LWOLoader = ( function () {
 				case 'NPLA':
 				case 'VERS':
 				case 'ENUM':
-				case 'FLAG':
 				case 'TAG ':
 
 				// Car Material CHUNKS
@@ -1096,8 +1143,22 @@ THREE.LWOLoader = ( function () {
 					this.reader.skip( length );
 					break;
 
+				case 'FLAG':
+					if ( this.tree.format === 'LWO2' ) {
+
+						this.reader.skip( 4 ); // not suported
+
+					} else {
+
+						this.reader.skip( length );
+
+					}
+					break;
 				// Skipped LWO2 chunks
 				case 'DIFF': // diffuse level, may be necessary to modulate COLR with this
+					this.currentSurface.diffusePower = this.reader.getFloat32();
+					this.reader.skip( 2 );
+					break;
 				case 'TRNL':
 				case 'REFL':
 				case 'GLOS':
@@ -1113,12 +1174,24 @@ THREE.LWOLoader = ( function () {
 				case 'GLOW':
 				case 'LINE':
 				case 'ALPH':
-				case 'LINE':
 				case 'VCOL':
 				case 'ENAB':
 					this.reader.skip( length );
 					break;
+				case 'SURF':
+					if ( this.tree.format === 'LWO2' ) {
 
+						this.parseSurfaceLwo2( length );
+
+					}
+					break;
+				case 'CLIP':
+					if ( this.tree.format === 'LWO2' ) {
+
+						this.parseClipLwo2( length );
+
+					}
+					break;
 				// Texture node chunks (not in spec)
 				case 'IPIX': // usePixelBlending
 				case 'IMIP': // useMipMaps
@@ -1270,13 +1343,10 @@ THREE.LWOLoader = ( function () {
 					this.currentSurface.attributes.smooth = ( maxSmoothingAngle < 0 ) ? false : true;
 					break;
 
-				case 'ENAB':
-					this.currentForm.enabled = this.reader.getUint16();
-					break;
-
 				// LWO2: Basic Surface Parameters
 				case 'COLR':
-					this.currentSurface.attributes.color = this.reader.getFloat32Array( 3 );
+					this.currentSurface.attributes.Color = {};
+					this.currentSurface.attributes.Color.value = this.reader.getFloat32Array( 3 );
 					this.reader.skip( 2 ); // VX: envelope
 					break;
 
@@ -1290,11 +1360,6 @@ THREE.LWOLoader = ( function () {
 					this.reader.skip( 2 );
 					break;
 
-				case 'REFL':
-					this.currentSurface.attributes.reflectivity = this.reader.getFloat32();
-					this.reader.skip( 2 );
-					break;
-
 				case 'TRAN':
 					this.currentSurface.attributes.opacity = this.reader.getFloat32();
 					this.reader.skip( 2 );
@@ -1323,7 +1388,15 @@ THREE.LWOLoader = ( function () {
 					break;
 
 				case 'IMAP':
-					this.currentSurface.attributes.imageMapIndex = this.reader.getUint32();
+					if ( this.tree.format === 'LWO2' ) {
+
+						this.reader.skip( 2 );
+
+					} else {
+
+						this.currentSurface.attributes.imageMapIndex = this.reader.getUint32();
+
+					}
 					break;
 
 				case 'IUVI': // uv channel name
@@ -1337,6 +1410,11 @@ THREE.LWOLoader = ( function () {
 					this.currentNode.heightWrappingMode = this.reader.getUint32();
 					break;
 
+				// LWO2 USE
+				case 'BLOK':
+					// skip
+					break;
+
 				default:
 					this.parseUnknownCHUNK( blockID, length );
 
@@ -1420,6 +1498,10 @@ THREE.LWOLoader = ( function () {
 					this.parseTextureNodeAttribute( type );
 					break;
 
+				case 'LWO2':
+					this.tree.format = type;
+					break;
+
 				case 'LWO3':
 					this.tree.format = type;
 					break;
@@ -1431,7 +1513,15 @@ THREE.LWOLoader = ( function () {
 					// CLIP FORM AND SUB FORMS
 
 				case 'CLIP':
-					this.parseClip( length );
+					if ( this.tree.format === 'LWO2' ) {
+
+						this.parseForm( length );
+
+					} else {
+
+						this.parseClip( length );
+
+					}
 					break;
 
 				case 'STIL':
@@ -1466,10 +1556,6 @@ THREE.LWOLoader = ( function () {
 					this.parseSubNode( length );
 					break;
 
-				case 'NNDS':
-					this.setupForm( 'nodes', length );
-					break;
-
 				case 'ATTR': // BSDF Node Attributes
 				case 'SATR': // Standard Node Attributes
 					this.setupForm( 'attributes', length );
@@ -1574,6 +1660,29 @@ THREE.LWOLoader = ( function () {
 
 			var name = this.reader.getString();
 
+			var surface = {
+				attributes: {}, // LWO2 style non-node attributes will go here
+				connections: {},
+				name: name,
+				inputName: name,
+				nodes: {},
+				source: this.reader.getString(),
+			};
+
+			this.tree.materials[ name ] = surface;
+			this.currentSurface = surface;
+
+			this.parentForm = this.tree.materials;
+			this.currentForm = surface;
+			this.currentFormEnd = this.reader.offset + length;
+
+		},
+
+		parseSurfaceLwo2( length ) {
+
+			var firstOffset = this.reader.offset;
+			var name = this.reader.getString();
+
 			var surface = {
 				attributes: {}, // LWO2 style non-node attributes will go here
 				connections: {},
@@ -1771,6 +1880,39 @@ THREE.LWOLoader = ( function () {
 
 		},
 
+		parseClipLwo2( length ) {
+
+			var texture = {
+				index: this.reader.getUint32(),
+				fileName: ""
+			};
+
+			var readed = 4;
+			// seach STIL block
+			while ( true ) {
+
+				var tag = this.reader.getIDTag();
+				var n_length = this.reader.getUint16();
+				if ( tag === 'STIL' ) {
+
+					texture.fileName = this.reader.getString();
+					break;
+
+				}
+				readed += 4 + n_length;
+				if ( n_length >= length ) {
+
+					break;
+
+				}
+
+			}
+
+			this.tree.textures.push( texture );
+			this.currentForm = texture;
+
+		},
+
 		parseImage() {
 
 			this.reader.skip( 8 ); // unknown

+ 3 - 0
examples/js/loaders/MMDLoader.js

@@ -1359,6 +1359,9 @@ THREE.MMDLoader = ( function () {
 
 					t.image = scope._getRotatedImage( t.image );
 
+					t.magFilter = THREE.NearestFilter;
+					t.minFilter = THREE.NearestFilter;
+
 				}
 
 				t.flipY = false;

+ 11 - 1
examples/js/loaders/SVGLoader.js

@@ -120,7 +120,17 @@ THREE.SVGLoader.prototype = {
 
 			if ( transform ) {
 
-				currentTransform.copy( transformStack.pop() );
+				transformStack.pop();
+
+				if ( transformStack.length > 0 ) {
+
+					currentTransform.copy( transformStack[ transformStack.length - 1 ] );
+
+				} else {
+
+					currentTransform.identity();
+
+				}
 
 			}
 

+ 8 - 8
examples/js/shaders/DepthLimitedBlurShader.js

@@ -5,14 +5,14 @@ THREE.DepthLimitedBlurShader = {
 		'PERSPECTIVE_CAMERA': 1
 	},
 	uniforms: {
-		'tDiffuse': { type: 't', value: null },
-		'size': { type: 'v2', value: new THREE.Vector2( 512, 512 ) },
-		'sampleUvOffsets': { type: 'v2v', value: [ new THREE.Vector2( 0, 0 ) ] },
-		'sampleWeights': { type: '1fv', value: [ 1.0 ] },
-		'tDepth': { type: 't', value: null },
-		'cameraNear': { type: 'f', value: 10 },
-		'cameraFar': { type: 'f', value: 1000 },
-		'depthCutoff': { type: 'f', value: 10 },
+		'tDiffuse': { value: null },
+		'size': { value: new THREE.Vector2( 512, 512 ) },
+		'sampleUvOffsets': { value: [ new THREE.Vector2( 0, 0 ) ] },
+		'sampleWeights': { value: [ 1.0 ] },
+		'tDepth': { value: null },
+		'cameraNear': { value: 10 },
+		'cameraFar': { value: 1000 },
+		'depthCutoff': { value: 10 },
 	},
 	vertexShader: [
 		"#include <common>",

+ 5 - 5
examples/js/shaders/LuminosityHighPassShader.js

@@ -11,11 +11,11 @@ THREE.LuminosityHighPassShader = {
 
 	uniforms: {
 
-		"tDiffuse": { type: "t", value: null },
-		"luminosityThreshold": { type: "f", value: 1.0 },
-		"smoothWidth": { type: "f", value: 1.0 },
-		"defaultColor": { type: "c", value: new THREE.Color( 0x000000 ) },
-		"defaultOpacity":  { type: "f", value: 0.0 }
+		"tDiffuse": { value: null },
+		"luminosityThreshold": { value: 1.0 },
+		"smoothWidth": { value: 1.0 },
+		"defaultColor": { value: new THREE.Color( 0x000000 ) },
+		"defaultOpacity":  { value: 0.0 }
 
 	},
 

+ 17 - 17
examples/js/shaders/SAOShader.js

@@ -9,23 +9,23 @@ THREE.SAOShader = {
 	},
 	uniforms: {
 
-		'tDepth': { type: 't', value: null },
-		'tDiffuse': { type: 't', value: null },
-		'tNormal': { type: 't', value: null },
-		'size': { type: 'v2', value: new THREE.Vector2( 512, 512 ) },
-
-		'cameraNear': { type: 'f', value: 1 },
-		'cameraFar': { type: 'f', value: 100 },
-		'cameraProjectionMatrix': { type: 'm4', value: new THREE.Matrix4() },
-		'cameraInverseProjectionMatrix': { type: 'm4', value: new THREE.Matrix4() },
-
-		'scale': { type: 'f', value: 1.0 },
-		'intensity': { type: 'f', value: 0.1 },
-		'bias': { type: 'f', value: 0.5 },
-
-		'minResolution': { type: 'f', value: 0.0 },
-		'kernelRadius': { type: 'f', value: 100.0 },
-		'randomSeed': { type: 'f', value: 0.0 }
+		'tDepth': { value: null },
+		'tDiffuse': { value: null },
+		'tNormal': { value: null },
+		'size': { value: new THREE.Vector2( 512, 512 ) },
+
+		'cameraNear': { value: 1 },
+		'cameraFar': { value: 100 },
+		'cameraProjectionMatrix': { value: new THREE.Matrix4() },
+		'cameraInverseProjectionMatrix': { value: new THREE.Matrix4() },
+
+		'scale': { value: 1.0 },
+		'intensity': { value: 0.1 },
+		'bias': { value: 0.5 },
+
+		'minResolution': { value: 0.0 },
+		'kernelRadius': { value: 100.0 },
+		'randomSeed': { value: 0.0 }
 	},
 	vertexShader: [
 		"varying vec2 vUv;",

+ 7 - 0
examples/jsm/exporters/ColladaExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from '../../../src/Three';
+
+export class ColladaExporter {
+	constructor();
+
+	parse(object: Object3D, onDone: (res: any) => void, options: object): null;
+}

+ 3 - 3
examples/jsm/exporters/GLTFExporter.d.ts

@@ -1,7 +1,7 @@
-import { Object3D } from '../../../src/Three';
+import {Object3D} from '../../../src/Three';
 
 export class GLTFExporter {
-  constructor();
+	constructor();
 
-  parse(input: Object3D, onCompleted: (gltf: object) => void, options: object): null;
+	parse(input: Object3D, onCompleted: (gltf: object) => void, options: object): null;
 }

+ 7 - 0
examples/jsm/exporters/MMDExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from "../../..";
+
+export class MMDExporter {
+	constructor();
+
+	parseVpd(skin: Object3D, outputShiftJis: boolean, useOriginalBones: boolean): [] | Uint8Array
+}

+ 7 - 0
examples/jsm/exporters/OBJExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from '../../../src/Three';
+
+export class OBJExporter {
+	constructor();
+
+	parse(object: Object3D): string;
+}

+ 7 - 0
examples/jsm/exporters/PLYExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from "../../..";
+
+export class PLYExporter {
+	constructor();
+
+	parse(object: Object3D, onDone: (res: any) => void, options: object): null;
+}

+ 7 - 0
examples/jsm/exporters/STLExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from "../../..";
+
+export class STLExporter {
+	constructor();
+
+	parse(scene: Object3D, options: {});
+}

+ 7 - 0
examples/jsm/exporters/TypedGeometryExporter.d.ts

@@ -0,0 +1,7 @@
+import {Object3D} from "../../..";
+
+export class TypedGeometryExporterD {
+	constructor();
+
+	parse(scene: Object3D, options: {}): DataView | string;
+}

+ 1 - 6
examples/jsm/pmrem/PMREMCubeUVPacker.d.ts

@@ -1,9 +1,4 @@
-import {
-  CubeTexture,
-  Renderer,
-  ShaderMaterial,
-  WebGLRenderTarget
-} from '../../../src/Three';
+import {CubeTexture, Renderer, WebGLRenderTarget} from '../../../src/Three';
 
 export class PMREMCubeUVPacker {
   CubeUVRenderTarget:WebGLRenderTarget;

+ 5 - 0
examples/jsm/utils/MathUtils.d.ts

@@ -0,0 +1,5 @@
+import {Quaternion} from "../../..";
+
+export namespace MathUtils {
+	export function setQuaternionFromProperEuler(q: Quaternion, a: number, b: number, c: number, order: string): void ;
+}

+ 40 - 32
examples/jsm/utils/MathUtils.js

@@ -7,61 +7,69 @@
 
 var MathUtils = {
 
-    setQuaternionFromProperEuler: function ( q, a, b, c, order ) {
 
-        // Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles
+	/**
+	 * @param {Quaternion} q
+	 * @param {number} a
+	 * @param {number} b
+	 * @param {number} c
+	 * @param {string} order
+	 */
+	setQuaternionFromProperEuler: function (q, a, b, c, order) {
 
-        // rotations are applied to the axes in the order specified by 'order'
-        // rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'
-        // angles are in radians
+		// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles
 
-        var cos = Math.cos;
-        var sin = Math.sin;
+		// rotations are applied to the axes in the order specified by 'order'
+		// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'
+		// angles are in radians
 
-        var c2 = cos( b / 2 );
-        var s2 = sin( b / 2 );
+		var cos = Math.cos;
+		var sin = Math.sin;
 
-        var c13 = cos( ( a + c ) / 2 );
-        var s13 = sin( ( a + c ) / 2 );
+		var c2 = cos(b / 2);
+		var s2 = sin(b / 2);
 
-        var c1_3 = cos( ( a - c ) / 2 );
-        var s1_3 = sin( ( a - c ) / 2 );
+		var c13 = cos((a + c) / 2);
+		var s13 = sin((a + c) / 2);
 
-        var c3_1 = cos( ( c - a ) / 2 );
-        var s3_1 = sin( ( c - a ) / 2 );
+		var c1_3 = cos((a - c) / 2);
+		var s1_3 = sin((a - c) / 2);
 
-        if ( order === 'XYX' ) {
+		var c3_1 = cos((c - a) / 2);
+		var s3_1 = sin((c - a) / 2);
 
-            q.set( c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13 );
+		if (order === 'XYX') {
 
-        } else if ( order === 'YZY' ) {
+			q.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13);
 
-            q.set( s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13 );
+		} else if (order === 'YZY') {
 
-        } else if ( order === 'ZXZ' ) {
+			q.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13);
 
-            q.set( s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13 );
+		} else if (order === 'ZXZ') {
 
-        } else if ( order === 'XZX' ) {
+			q.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13);
 
-            q.set( c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13 );
+		} else if (order === 'XZX') {
 
-        } else if ( order === 'YXY' ) {
+			q.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13);
 
-            q.set( s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13 );
+		} else if (order === 'YXY') {
 
-        } else if ( order === 'ZYZ' ) {
+			q.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13);
 
-            q.set( s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13 );
+		} else if (order === 'ZYZ') {
 
-        } else {
+			q.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13);
 
-            console.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.' );
+		} else {
 
-        }
+			console.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.');
 
-    }
+		}
+
+	}
 
 };
 
-export { MathUtils };
+export {MathUtils};

+ 8 - 0
examples/jsm/utils/ShadowMapViewer.d.ts

@@ -0,0 +1,8 @@
+import {Light} from "../../..";
+
+export class ShadowMapViewer {
+	constructor(light: Light)
+}
+
+
+

+ 32 - 0
examples/jsm/utils/SkeletonUtils.d.ts

@@ -0,0 +1,32 @@
+import {AnimationClip, Bone, Matrix4, Object3D, Skeleton, SkeletonHelper} from "../../..";
+
+export class SkeletonUtils {
+	retarget(target: Object3D | Skeleton,
+					 source: Object3D | Skeleton,
+					 options: {})
+
+	retargetClip(target: Skeleton | Object3D,
+							 source: Skeleton | Object3D,
+							 clip: AnimationClip,
+							 options: {}): AnimationClip;
+
+	getHelperFromSkeleton(skeleton: Skeleton): SkeletonHelper;
+
+	getSkeletonOffsets(target: Object3D | Skeleton,
+										 source: Object3D | Skeleton,
+										 options: {}): Matrix4[];
+
+	renameBones(skeleton: Skeleton, names: {}): any;
+
+	getBones(skeleton: Skeleton | Bone[]): Bone[];
+
+	getBoneByName(name: string, skeleton: Skeleton): Bone;
+
+	getNearestBone(bone: Bone, names: {}): Bone;
+
+	findBoneTrackData(name: string, tracks: any[]): {};
+
+	getEqualsBonesNames(skeleton: Skeleton, targetSkeleton: Skeleton);
+
+	clone(source: Skeleton): Skeleton;
+}

+ 58 - 0
examples/jsm/utils/TypedArrayUtils.d.ts

@@ -0,0 +1,58 @@
+export namespace TypedArrayUtils {
+	export function quicksortIP(arr: any[], eleSize: number, orderElement: number): any[];
+
+
+	export class Kdtree {
+		self: this;
+		root: Node;
+		private maxDepth: number;
+
+		constructor(points: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Float32Array | Float64Array | Uint8ClampedArray, metric: (a: any, b: any) => number, eleSize: number);
+
+		getPointSet(points: any, pos: number);
+
+		buildTree(): Node;
+
+		getMaxDepth(): number;
+
+		nearest(point: [], maxNodes: number, maxDistance: number): any[];
+
+	}
+
+	export namespace Kdtree {
+		export class Node {
+			obj: any;
+			left: Node | null;
+			right: Node | null;
+			parent: Node;
+			depth: number;
+			pos: any;
+
+			constructor(obj: any, depth: number, parent: Node, pos: any)
+		}
+
+
+		export class BinaryHeap {
+			content: any[];
+			scoreFunction: () => any;
+
+			constructor(scoreFunction?: () => any);
+		}
+
+		export namespace BinaryHeap {
+			export function push(element: any): void;
+
+			export function pop(): any;
+
+			export function peek(): any;
+
+			export function remove(node: any): any;
+
+			export function size(): number;
+
+			export function bubbleUp(n: number): void;
+
+			export function sinkDown(n: number): void;
+		}
+	}
+}

+ 3 - 0
examples/jsm/utils/UVsDebug.d.ts

@@ -0,0 +1,3 @@
+import {Geometry} from "../../..";
+
+export function UVsDebug(geometry: Geometry, size: number): HTMLCanvasElement;

TEMPAT SAMPAH
examples/textures/alphaMap.jpg


+ 405 - 319
examples/webgl_animation_multiple.html

@@ -1,322 +1,408 @@
 <!DOCTYPE html>
 <html lang="en">
-<head>
-    <title>Multiple animated objects</title>
-    <meta charset="utf-8">
-    <meta content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" name="viewport">
-    <style>
-        body {
-            overflow: hidden;
-        }
-    </style>
-</head>
-<body>
-<div id="container"></div>
-
-<div id="info"
-     style="position: absolute; left: 0; top: 0; width: 100%; background-color: white; border: 1px solid black; margin: 10px; padding: 10px;">
-    This demo shows how to load several instances of the same 3D model (same .GLTF file) into the
-    scene, position them at different locations and launch different animations for them.
-    To do it, some tricky cloning of SkinnedMesh, Skeleton and Bone objects is necessary (done by SkeletonUtils.clone().
-    Soldier model from <a href="https://www.mixamo.com" target="_blank" rel="noopener">https://www.mixamo.com</a>.
-</div>
-
-<script src="../build/three.js"></script>
-<script src="js/WebGL.js"></script>
-<script src="js/loaders/GLTFLoader.js"></script>
-<script src="js/utils/SkeletonUtils.js"></script>
-
-<script>
-
-    if (WEBGL.isWebGLAvailable() === false) {
-        document.body.appendChild(WEBGL.getWebGLErrorMessage());
-    }
-
-    //////////////////////////////
-    // Global objects
-    //////////////////////////////
-    let worldScene = null; // THREE.Scene where it all will be rendered
-    let renderer = null;
-    let camera = null;
-    let mixers = []; // All the AnimationMixer objects for all the animations in the scene
-    //////////////////////////////
-
-
-    //////////////////////////////
-    // Information about our 3D models and units
-    //////////////////////////////
-
-    // The names of the 3D models to load. One-per file.
-    // A model may have multiple SkinnedMesh objects as well as several rigs (armatures). Units will define which
-    // meshes, armatures and animations to use. We will load the whole scene for each object and clone it for each unit.
-    // Models are from https://www.mixamo.com/
-    const MODELS = [
-        {name: "Soldier"},
-        {name: "Parrot"},
-        // {name: "RiflePunch"},
-    ];
-
-    // Here we define instances of the models that we want to place in the scene, their position, scale and the animations
-    // that must be played.
-    const UNITS = [
-        {
-            modelName: "Soldier", // Will use the 3D model from file models/gltf/Soldier.glb
-            meshName: "vanguard_Mesh", // Name of the main mesh to animate
-            position: {x: 0, y: 0, z: 0}, // Where to put the unit in the scene
-            scale: 1, // Scaling of the unit. 1.0 means: use original size, 0.1 means "10 times smaller", etc.
-            animationName: "Idle" // Name of animation to run
-        },
-        {
-            modelName: "Soldier",
-            meshName: "vanguard_Mesh",
-            position: {x: 3, y: 0, z: 0},
-            scale: 2,
-            animationName: "Walk"
-        },
-        {
-            modelName: "Soldier",
-            meshName: "vanguard_Mesh",
-            position: {x: 1, y: 0, z: 0},
-            scale: 1,
-            animationName: "Run"
-        },
-        {
-            modelName: "Parrot",
-            meshName: "mesh_0",
-            position: {x: -4, y: 0, z: 0},
-            rotation: {x: 0, y: Math.PI, z: 0},
-            scale: 0.01,
-            animationName: "parrot_A_"
-        },
-        {
-            modelName: "Parrot",
-            meshName: "mesh_0",
-            position: {x: -2, y: 0, z: 0},
-            rotation: {x: 0, y: Math.PI / 2, z: 0},
-            scale: 0.02,
-            animationName: null
-        },
-    ];
-
-    //////////////////////////////
-    // The main setup happens here
-    //////////////////////////////
-    let numLoadedModels = 0;
-    initScene();
-    initRenderer();
-    loadModels();
-    animate();
-    //////////////////////////////
-
-
-    //////////////////////////////
-    // Function implementations
-    //////////////////////////////
-    /**
-     * Function that starts loading process for the next model in the queue. The loading process is
-     * asynchronous: it happens "in the background". Therefore we don't load all the models at once. We load one,
-     * wait until it is done, then load the next one. When all models are loaded, we call loadUnits().
-     */
-    function loadModels() {
-        for (let i = 0; i < MODELS.length; ++i) {
-            const m = MODELS[i];
-            loadGltfModel(m, function (model) {
-                console.log("Done loading model", MODELS[i].name);
-                ++numLoadedModels;
-                if (numLoadedModels === MODELS.length) {
-                    console.log("All models loaded, time to instantiate units...");
-                    instantiateUnits();
-                }
-            });
-        }
-    }
-
-    /**
-     * Look at UNITS configuration, clone necessary 3D model scenes, place the armatures and meshes in the scene and
-     * launch necessary animations
-     */
-    function instantiateUnits() {
-        let numSuccess = 0;
-        for (let i = 0; i < UNITS.length; ++i) {
-            const u = UNITS[i];
-            const model = getModelByName(u.modelName);
-            if (model) {
-                const clonedScene = THREE.SkeletonUtils.clone(model.scene);
-                if (clonedScene) {
-                    // Scene is cloned properly, let's find one mesh and launch animation for it
-                    const clonedMesh = clonedScene.getObjectByName(u.meshName);
-                    if (clonedMesh) {
-                        const mixer = startAnimation(clonedMesh, model.animations, u.animationName);
-                        if (mixer) {
-                            // Save the animation mixer in the list, will need it in the animation loop
-                            mixers.push(mixer);
-                            numSuccess++;
-                        }
-                    }
-
-                    // Different models can have different configurations of armatures and meshes. Therefore,
-                    // We can't set position, scale or rotation to individual mesh objects. Instead we set
-                    // it to the whole cloned scene and then add the whole scene to the game world
-                    // Note: this may have weird effects if you have lights or other items in the GLTF file's scene!
-                    worldScene.add(clonedScene);
-                    if (u.position) {
-                        clonedScene.position.set(u.position.x, u.position.y, u.position.z);
-                    }
-                    if (u.scale) {
-                        clonedScene.scale.set(u.scale, u.scale, u.scale);
-                    }
-                    if (u.rotation) {
-                        clonedScene.rotation.x = u.rotation.x;
-                        clonedScene.rotation.y = u.rotation.y;
-                        clonedScene.rotation.z = u.rotation.z;
-                    }
-                }
-            } else {
-                console.error("Can not find model", u.modelName);
-            }
-        }
-
-        console.log(`Successfully instantiated ${numSuccess} units`);
-    }
-
-    /**
-     * Start animation for a specific mesh object. Find the animation by name in the 3D model's animation array
-     * @param skinnedMesh {THREE.SkinnedMesh} The mesh to animate
-     * @param animations {Array} Array containing all the animations for this model
-     * @param animationName {string} Name of the animation to launch
-     * @return {THREE.AnimationMixer} Mixer to be used in the render loop
-     */
-    function startAnimation(skinnedMesh, animations, animationName) {
-        let mixer = new THREE.AnimationMixer(skinnedMesh);
-        const clip = THREE.AnimationClip.findByName(animations, animationName);
-        if (clip) {
-            const action = mixer.clipAction(clip);
-            action.play();
-        }
-        return mixer;
-    }
-
-    /**
-     * Find a model object by name
-     * @param name
-     * @returns {object|null}
-     */
-    function getModelByName(name) {
-        for (let i = 0; i < MODELS.length; ++i) {
-            if (MODELS[i].name === name) {
-                return MODELS[i];
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Load a 3D model from a GLTF file. Use the GLTFLoader.
-     * @param model {object} Model config, one item from the MODELS array. It will be updated inside the function!
-     * @param onLoaded {function} A callback function that will be called when the model is loaded
-     */
-    function loadGltfModel(model, onLoaded) {
-        const loader = new THREE.GLTFLoader();
-        const modelName = "models/gltf/" + model.name + ".glb";
-        loader.load(modelName, function (gltf) {
-            const scene = gltf.scene;
-            model.animations = gltf.animations;
-            model.scene = scene;
-            // Enable Shadows
-            gltf.scene.traverse(function (object) {
-                if (object.isMesh) {
-                    object.castShadow = true;
-                }
-            });
-            onLoaded(model);
-        });
-    }
-
-    /**
-     * Render loop. Renders the next frame of all animations
-     */
-    function animate() {
-        requestAnimationFrame(animate);
-        // Get the time elapsed since the last frame
-        const mixerUpdateDelta = clock.getDelta();
-        // Update all the animation frames
-        for (let i = 0; i < mixers.length; ++i) {
-            mixers[i].update(mixerUpdateDelta);
-        }
-        renderer.render(worldScene, camera);
-    }
-
-    //////////////////////////////
-    // General Three.JS stuff
-    //////////////////////////////
-    // This part is not anyhow related to the cloning of models, it's just setting up the scene.
-
-    /**
-     * Initialize ThreeJS scene renderer
-     */
-    function initRenderer() {
-        const container = document.getElementById('container');
-        renderer = new THREE.WebGLRenderer({antialias: true});
-        renderer.setPixelRatio(window.devicePixelRatio);
-        renderer.setSize(window.innerWidth, window.innerHeight);
-        renderer.gammaOutput = true;
-        renderer.gammaFactor = 2.2;
-        renderer.shadowMap.enabled = true;
-        renderer.shadowMap.type = THREE.PCFSoftShadowMap;
-        container.appendChild(renderer.domElement);
-    }
-
-    /**
-     * Initialize ThreeJS Scene
-     */
-    function initScene() {
-        camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 10000);
-        camera.position.set(3, 6, -10);
-        camera.lookAt(0, 1, 0);
-
-        clock = new THREE.Clock();
-
-        worldScene = new THREE.Scene();
-        worldScene.background = new THREE.Color(0xa0a0a0);
-        worldScene.fog = new THREE.Fog(0xa0a0a0, 10, 22);
-
-        const hemiLight = new THREE.HemisphereLight(0xffffff, 0x444444);
-        hemiLight.position.set(0, 20, 0);
-        worldScene.add(hemiLight);
-
-        const dirLight = new THREE.DirectionalLight(0xffffff);
-        dirLight.position.set(-3, 10, -10);
-        dirLight.castShadow = true;
-        dirLight.shadow.camera.top = 10;
-        dirLight.shadow.camera.bottom = -10;
-        dirLight.shadow.camera.left = -10;
-        dirLight.shadow.camera.right = 10;
-        dirLight.shadow.camera.near = 0.1;
-        dirLight.shadow.camera.far = 40;
-        worldScene.add(dirLight);
-
-        // ground
-        const groundMesh = new THREE.Mesh(new THREE.PlaneBufferGeometry(40, 40), new THREE.MeshPhongMaterial({
-            color: 0x999999,
-            depthWrite: false
-        }));
-        groundMesh.rotation.x = -Math.PI / 2;
-        groundMesh.receiveShadow = true;
-        worldScene.add(groundMesh);
-        window.addEventListener('resize', onWindowResize, false);
-    }
-
-    /**
-     * A callback that will be called whenever the browser window is resized.
-     */
-    function onWindowResize() {
-        camera.aspect = window.innerWidth / window.innerHeight;
-        camera.updateProjectionMatrix();
-        renderer.setSize(window.innerWidth, window.innerHeight);
-    }
-
-
-</script>
-
-</body>
+	<head>
+		<title>Multiple animated objects</title>
+		<meta charset="utf-8">
+		<meta content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" name="viewport">
+		<style>
+			body {
+				overflow: hidden;
+			}
+		</style>
+	</head>
+	<body>
+		<div id="container"></div>
+
+		<div id="info"
+		style="position: absolute; left: 0; top: 0; width: 100%; background-color: white; border: 1px solid black; margin: 10px; padding: 10px;">
+			This demo shows how to load several instances of the same 3D model (same .GLTF file) into the
+			scene, position them at different locations and launch different animations for them.
+			To do it, some tricky cloning of SkinnedMesh, Skeleton and Bone objects is necessary (done by SkeletonUtils.clone().
+			Soldier model from <a href="https://www.mixamo.com" target="_blank" rel="noopener">https://www.mixamo.com</a>.
+		</div>
+
+		<script src="../build/three.js"></script>
+		<script src="js/WebGL.js"></script>
+		<script src="js/loaders/GLTFLoader.js"></script>
+		<script src="js/utils/SkeletonUtils.js"></script>
+
+		<script>
+
+			if ( WEBGL.isWebGLAvailable() === false ) {
+
+				document.body.appendChild( WEBGL.getWebGLErrorMessage() );
+
+			}
+
+			//////////////////////////////
+			// Global objects
+			//////////////////////////////
+			var worldScene = null; // THREE.Scene where it all will be rendered
+			var renderer = null;
+			var camera = null;
+			var mixers = []; // All the AnimationMixer objects for all the animations in the scene
+			//////////////////////////////
+
+
+			//////////////////////////////
+			// Information about our 3D models and units
+			//////////////////////////////
+
+			// The names of the 3D models to load. One-per file.
+			// A model may have multiple SkinnedMesh objects as well as several rigs (armatures). Units will define which
+			// meshes, armatures and animations to use. We will load the whole scene for each object and clone it for each unit.
+			// Models are from https://www.mixamo.com/
+			var MODELS = [
+				{ name: "Soldier" },
+				{ name: "Parrot" },
+				// { name: "RiflePunch" },
+			];
+
+			// Here we define instances of the models that we want to place in the scene, their position, scale and the animations
+			// that must be played.
+			var UNITS = [
+				{
+					modelName: "Soldier", // Will use the 3D model from file models/gltf/Soldier.glb
+					meshName: "vanguard_Mesh", // Name of the main mesh to animate
+					position: { x: 0, y: 0, z: 0 }, // Where to put the unit in the scene
+					scale: 1, // Scaling of the unit. 1.0 means: use original size, 0.1 means "10 times smaller", etc.
+					animationName: "Idle" // Name of animation to run
+				},
+				{
+					modelName: "Soldier",
+					meshName: "vanguard_Mesh",
+					position: { x: 3, y: 0, z: 0 },
+					scale: 2,
+					animationName: "Walk"
+				},
+				{
+					modelName: "Soldier",
+					meshName: "vanguard_Mesh",
+					position: { x: 1, y: 0, z: 0 },
+					scale: 1,
+					animationName: "Run"
+				},
+				{
+					modelName: "Parrot",
+					meshName: "mesh_0",
+					position: { x: - 4, y: 0, z: 0 },
+					rotation: { x: 0, y: Math.PI, z: 0 },
+					scale: 0.01,
+					animationName: "parrot_A_"
+				},
+				{
+					modelName: "Parrot",
+					meshName: "mesh_0",
+					position: { x: - 2, y: 0, z: 0 },
+					rotation: { x: 0, y: Math.PI / 2, z: 0 },
+					scale: 0.02,
+					animationName: null
+				},
+			];
+
+			//////////////////////////////
+			// The main setup happens here
+			//////////////////////////////
+			var numLoadedModels = 0;
+			initScene();
+			initRenderer();
+			loadModels();
+			animate();
+			//////////////////////////////
+
+
+			//////////////////////////////
+			// Function implementations
+			//////////////////////////////
+			/**
+			 * Function that starts loading process for the next model in the queue. The loading process is
+			 * asynchronous: it happens "in the background". Therefore we don't load all the models at once. We load one,
+			 * wait until it is done, then load the next one. When all models are loaded, we call loadUnits().
+			 */
+			function loadModels() {
+
+				for ( var i = 0; i < MODELS.length; ++ i ) {
+
+					var m = MODELS[ i ];
+
+					loadGltfModel( m, function ( model ) {
+
+						++ numLoadedModels;
+
+						if ( numLoadedModels === MODELS.length ) {
+
+							console.log( "All models loaded, time to instantiate units..." );
+							instantiateUnits();
+
+						}
+
+					} );
+
+				}
+
+			}
+
+			/**
+			 * Look at UNITS configuration, clone necessary 3D model scenes, place the armatures and meshes in the scene and
+			 * launch necessary animations
+			 */
+			function instantiateUnits() {
+
+				var numSuccess = 0;
+
+				for ( var i = 0; i < UNITS.length; ++ i ) {
+
+					var u = UNITS[ i ];
+					var model = getModelByName( u.modelName );
+
+					if ( model ) {
+
+						var clonedScene = THREE.SkeletonUtils.clone( model.scene );
+
+						if ( clonedScene ) {
+
+							// Scene is cloned properly, let's find one mesh and launch animation for it
+							var clonedMesh = clonedScene.getObjectByName( u.meshName );
+
+							if ( clonedMesh ) {
+
+								var mixer = startAnimation( clonedMesh, model.animations, u.animationName );
+
+								if ( mixer ) {
+
+									// Save the animation mixer in the list, will need it in the animation loop
+									mixers.push( mixer );
+									numSuccess ++;
+
+								}
+
+							}
+
+							// Different models can have different configurations of armatures and meshes. Therefore,
+							// We can't set position, scale or rotation to individual mesh objects. Instead we set
+							// it to the whole cloned scene and then add the whole scene to the game world
+							// Note: this may have weird effects if you have lights or other items in the GLTF file's scene!
+							worldScene.add( clonedScene );
+
+							if ( u.position ) {
+
+								clonedScene.position.set( u.position.x, u.position.y, u.position.z );
+
+							}
+
+							if ( u.scale ) {
+
+								clonedScene.scale.set( u.scale, u.scale, u.scale );
+
+							}
+
+							if ( u.rotation ) {
+
+								clonedScene.rotation.x = u.rotation.x;
+								clonedScene.rotation.y = u.rotation.y;
+								clonedScene.rotation.z = u.rotation.z;
+
+							}
+
+					        }
+
+					} else {
+
+						console.error( "Can not find model", u.modelName );
+
+					}
+
+				}
+
+				console.log( `Successfully instantiated ${numSuccess} units` );
+
+			}
+
+			/**
+			 * Start animation for a specific mesh object. Find the animation by name in the 3D model's animation array
+			 * @param skinnedMesh {THREE.SkinnedMesh} The mesh to animate
+			 * @param animations {Array} Array containing all the animations for this model
+			 * @param animationName {string} Name of the animation to launch
+			 * @return {THREE.AnimationMixer} Mixer to be used in the render loop
+			 */
+			function startAnimation( skinnedMesh, animations, animationName ) {
+
+				var mixer = new THREE.AnimationMixer( skinnedMesh );
+				var clip = THREE.AnimationClip.findByName( animations, animationName );
+
+				if ( clip ) {
+
+					var action = mixer.clipAction( clip );
+					action.play();
+
+				}
+
+				return mixer;
+
+			}
+
+			/**
+			 * Find a model object by name
+			 * @param name
+			 * @returns {object|null}
+			 */
+			function getModelByName( name ) {
+
+				for ( var i = 0; i < MODELS.length; ++ i ) {
+
+					if ( MODELS[ i ].name === name ) {
+
+						return MODELS[ i ];
+
+					}
+
+				}
+
+				return null;
+
+			}
+
+			/**
+			 * Load a 3D model from a GLTF file. Use the GLTFLoader.
+			 * @param model {object} Model config, one item from the MODELS array. It will be updated inside the function!
+			 * @param onLoaded {function} A callback function that will be called when the model is loaded
+			 */
+			function loadGltfModel( model, onLoaded ) {
+
+				var loader = new THREE.GLTFLoader();
+				var modelName = "models/gltf/" + model.name + ".glb";
+
+				loader.load( modelName, function ( gltf ) {
+
+					var scene = gltf.scene;
+
+					model.animations = gltf.animations;
+					model.scene = scene;
+
+					// Enable Shadows
+
+					gltf.scene.traverse( function ( object ) {
+
+						if ( object.isMesh ) {
+
+							object.castShadow = true;
+
+						}
+
+					} );
+
+					console.log( "Done loading model", model.name );
+
+					onLoaded( model );
+
+				} );
+
+			}
+
+			/**
+			 * Render loop. Renders the next frame of all animations
+			 */
+			function animate() {
+
+				requestAnimationFrame( animate );
+
+				// Get the time elapsed since the last frame
+
+				var mixerUpdateDelta = clock.getDelta();
+
+				// Update all the animation frames
+
+				for ( var i = 0; i < mixers.length; ++ i ) {
+
+					mixers[ i ].update( mixerUpdateDelta );
+
+				}
+
+				renderer.render( worldScene, camera );
+
+			}
+
+			//////////////////////////////
+			// General Three.JS stuff
+			//////////////////////////////
+			// This part is not anyhow related to the cloning of models, it's just setting up the scene.
+
+			/**
+			 * Initialize ThreeJS scene renderer
+			 */
+			function initRenderer() {
+
+				var container = document.getElementById( 'container' );
+				renderer = new THREE.WebGLRenderer( { antialias: true } );
+				renderer.setPixelRatio( window.devicePixelRatio );
+				renderer.setSize( window.innerWidth, window.innerHeight );
+				renderer.gammaOutput = true;
+				renderer.gammaFactor = 2.2;
+				renderer.shadowMap.enabled = true;
+				renderer.shadowMap.type = THREE.PCFSoftShadowMap;
+				container.appendChild( renderer.domElement );
+
+			}
+
+			/**
+			 * Initialize ThreeJS Scene
+			 */
+			function initScene() {
+
+				camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 );
+				camera.position.set( 3, 6, - 10 );
+				camera.lookAt( 0, 1, 0 );
+
+				clock = new THREE.Clock();
+
+				worldScene = new THREE.Scene();
+				worldScene.background = new THREE.Color( 0xa0a0a0 );
+				worldScene.fog = new THREE.Fog( 0xa0a0a0, 10, 22 );
+
+				var hemiLight = new THREE.HemisphereLight( 0xffffff, 0x444444 );
+				hemiLight.position.set( 0, 20, 0 );
+				worldScene.add( hemiLight );
+
+				var dirLight = new THREE.DirectionalLight( 0xffffff );
+				dirLight.position.set( - 3, 10, - 10 );
+				dirLight.castShadow = true;
+				dirLight.shadow.camera.top = 10;
+				dirLight.shadow.camera.bottom = - 10;
+				dirLight.shadow.camera.left = - 10;
+				dirLight.shadow.camera.right = 10;
+				dirLight.shadow.camera.near = 0.1;
+				dirLight.shadow.camera.far = 40;
+				worldScene.add( dirLight );
+
+				// ground
+				var groundMesh = new THREE.Mesh(
+					new THREE.PlaneBufferGeometry( 40, 40 ),
+					new THREE.MeshPhongMaterial( {
+						color: 0x999999,
+						depthWrite: false
+					} )
+				);
+
+				groundMesh.rotation.x = - Math.PI / 2;
+				groundMesh.receiveShadow = true;
+				worldScene.add( groundMesh );
+				window.addEventListener( 'resize', onWindowResize, false );
+
+			}
+
+			/**
+			 * A callback that will be called whenever the browser window is resized.
+			 */
+			function onWindowResize() {
+
+				camera.aspect = window.innerWidth / window.innerHeight;
+				camera.updateProjectionMatrix();
+				renderer.setSize( window.innerWidth, window.innerHeight );
+
+			}
+
+		</script>
+
+	</body>
+
 </html>

+ 1 - 0
examples/webgl_buffergeometry_morphtargets.html

@@ -27,6 +27,7 @@
 		<div id="container"></div>
 		<div id="info">
 			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - buffergeometry - morph targets
+			by <a href="https://discoverthreejs.com/" target="_blank" rel="noopener">Discover three.js</a>
 		</div>
 
 		<script src="../build/three.js"></script>

+ 0 - 2
examples/webgl_custom_attributes_points.html

@@ -38,7 +38,6 @@
 
 		<script type="x-shader/x-vertex" id="vertexshader">
 
-			uniform float amplitude;
 			attribute float size;
 			attribute vec3 customColor;
 
@@ -143,7 +142,6 @@
 			var material = new THREE.ShaderMaterial( {
 
 				uniforms: {
-					amplitude: { value: 1.0 },
 					color: { value: new THREE.Color( 0xffffff ) },
 					texture: { value: new THREE.TextureLoader().load( "textures/sprites/spark1.png" ) }
 				},

+ 0 - 1
examples/webgl_custom_attributes_points2.html

@@ -149,7 +149,6 @@
 			var material = new THREE.ShaderMaterial( {
 
 				uniforms: {
-					amplitude: { value: 1.0 },
 					color: { value: new THREE.Color( 0xffffff ) },
 					texture: { value: texture }
 				},

+ 1 - 1
examples/webgl_loader_lwo.html

@@ -31,7 +31,7 @@
 	<body>
 		<div id="info">
 			<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - LWOLoader<br />
-			<P>Loader for Lightwave LWO V3 file format</P>
+			<P>Loader for Lightwave LWO V3 file format, by <a href="https://discoverthreejs.com/" target="_blank" rel="noopener">Discover three.js</a></P>
 		</div>
 
 		<script src="../build/three.js"></script>

+ 4 - 4
examples/webgl_materials_lightmap.html

@@ -102,10 +102,10 @@
 				var vertexShader = document.getElementById( 'vertexShader' ).textContent;
 				var fragmentShader = document.getElementById( 'fragmentShader' ).textContent;
 				var uniforms = {
-					topColor: { type: "c", value: new THREE.Color( 0x0077ff ) },
-					bottomColor: { type: "c", value: new THREE.Color( 0xffffff ) },
-					offset: { type: "f", value: 400 },
-					exponent: { type: "f", value: 0.6 }
+					topColor: { value: new THREE.Color( 0x0077ff ) },
+					bottomColor: { value: new THREE.Color( 0xffffff ) },
+					offset: { value: 400 },
+					exponent: { value: 0.6 }
 				};
 				uniforms.topColor.value.copy( light.color );
 

+ 3 - 0
examples/webgl_materials_matcap.html

@@ -192,6 +192,9 @@
 				mesh.material.matcap = new THREE.Texture( event.target );
 				mesh.material.matcap.needsUpdate = true;
 
+				mesh.material.matcap.encoding = THREE.sRGBEncoding; // assume it is sRGB
+				mesh.material.needsUpdate = true;
+
 				image.src = mesh.material.matcap.image.src; // corner div
 
 				render();

+ 0 - 2
examples/webvr_ballshooter.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - ball shooter</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			body {
 				font-family: Monospace;

+ 0 - 2
examples/webvr_cubes.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - cubes</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			body {
 				font-family: Monospace;

+ 0 - 2
examples/webvr_dragging.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - dragging</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			body {
 				font-family: Monospace;

+ 0 - 2
examples/webvr_lorenzattractor.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - lorenz attractor</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			body {
 				margin: 0px;

+ 0 - 2
examples/webvr_paint.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - paint</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			body {
 				font-family: Monospace;

+ 0 - 2
examples/webvr_panorama.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - panorama</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			html, body {
 				background-color: #000;

+ 0 - 2
examples/webvr_rollercoaster.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - roller coaster</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			body {
 				margin: 0px;

+ 0 - 2
examples/webvr_sandbox.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - sandbox</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			body {
 				margin: 0px;

+ 0 - 2
examples/webvr_sculpt.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - sculpt</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			body {
 				font-family: Monospace;

+ 0 - 2
examples/webvr_video.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - 360 stereo video</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			body {
 				font-family: Monospace;

+ 0 - 2
examples/webvr_vive_paint.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - htc vive - paint</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			body {
 				font-family: Monospace;

+ 0 - 2
examples/webvr_vive_sculpt.html

@@ -4,8 +4,6 @@
 		<title>three.js webvr - htc vive - sculpt</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
-		<!-- Origin Trial Token, feature = WebXR Device API (For Chrome M69+), origin = https://threejs.org, expires = 2019-03-06 -->
-		<meta http-equiv="origin-trial" data-feature="WebXR Device API (For Chrome M69+)" data-expires="2019-03-06" content="AvDjbxYpoTgOL1PS0JEra7KFCehfTlKnXpU/ORSwNdCQ35cX70cTUkXOnQ26A5XJi3eXHSKpBPchdt5lbcxDuAIAAABTeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZU02OSIsImV4cGlyeSI6MTU1MTgzMDM5OX0=">
 		<style>
 			body {
 				font-family: Monospace;

+ 1 - 0
src/animation/AnimationAction.d.ts

@@ -19,6 +19,7 @@ export class AnimationAction {
   stop(): AnimationAction;
   reset(): AnimationAction;
   isRunning(): boolean;
+  isScheduled(): boolean;
   startAt(time: number): AnimationAction;
   setLoop(
     mode: AnimationActionLoopStyles,

+ 1 - 1
src/animation/PropertyBinding.js

@@ -106,7 +106,7 @@ Object.assign( PropertyBinding, {
 	 * Replaces spaces with underscores and removes unsupported characters from
 	 * node names, to ensure compatibility with parseTrackName().
 	 *
-	 * @param  {string} name Node name to be sanitized.
+	 * @param {string} name Node name to be sanitized.
 	 * @return {string}
 	 */
 	sanitizeNodeName: ( function () {

+ 2 - 2
src/cameras/CubeCamera.js

@@ -11,14 +11,14 @@ import { PerspectiveCamera } from './PerspectiveCamera.js';
  * @author alteredq / http://alteredqualia.com/
  */
 
+var fov = 90, aspect = 1;
+
 function CubeCamera( near, far, cubeResolution, options ) {
 
 	Object3D.call( this );
 
 	this.type = 'CubeCamera';
 
-	var fov = 90, aspect = 1;
-
 	var cameraPX = new PerspectiveCamera( fov, aspect, near, far );
 	cameraPX.up.set( 0, - 1, 0 );
 	cameraPX.lookAt( new Vector3( 1, 0, 0 ) );

+ 5 - 0
src/constants.d.ts

@@ -233,3 +233,8 @@ export const RGBDEncoding: TextureEncoding;
 export enum DepthPackingStrategies {}
 export const BasicDepthPacking: DepthPackingStrategies;
 export const RGBADepthPacking: DepthPackingStrategies;
+
+// Normal Map types
+export enum NormalMapTypes {}
+export const TangentSpaceNormalMap: NormalMapTypes;
+export const ObjectSpaceNormalMap: NormalMapTypes;

+ 1 - 1
src/constants.js

@@ -1,4 +1,4 @@
-export var REVISION = '103';
+export var REVISION = '104dev';
 export var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
 export var CullFaceNone = 0;
 export var CullFaceBack = 1;

+ 0 - 3
src/core/BufferGeometry.d.ts

@@ -9,9 +9,6 @@ import { Geometry } from './Geometry';
 import { DirectGeometry } from './DirectGeometry';
 import { EventDispatcher } from './EventDispatcher';
 import { InterleavedBufferAttribute } from './InterleavedBufferAttribute';
-/**
- * @deprecated Use {@link BufferAttribute#setDynamic THREE.BufferAttribute().setDynamic( true )} instead.
- */
 
 /**
  * This is a superefficent class for geometries because it saves all data in buffers.

+ 1 - 0
src/loaders/MaterialLoader.js

@@ -172,6 +172,7 @@ Object.assign( MaterialLoader.prototype, {
 		// maps
 
 		if ( json.map !== undefined ) material.map = getTexture( json.map );
+		if ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap );
 
 		if ( json.alphaMap !== undefined ) {
 

+ 1 - 0
src/materials/Material.js

@@ -168,6 +168,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 		if ( this.clearCoatRoughness !== undefined ) data.clearCoatRoughness = this.clearCoatRoughness;
 
 		if ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;
+		if ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid;
 		if ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;
 		if ( this.lightMap && this.lightMap.isTexture ) data.lightMap = this.lightMap.toJSON( meta ).uuid;
 

+ 3 - 3
src/materials/Materials.d.ts

@@ -6,13 +6,13 @@ export * from './PointsMaterial';
 export * from './MeshPhysicalMaterial';
 export * from './MeshStandardMaterial';
 export * from './MeshPhongMaterial';
-//export * from './MeshToonMaterial';
+export * from './MeshToonMaterial';
 export * from './MeshNormalMaterial';
 export * from './MeshLambertMaterial';
 export * from './MeshDepthMaterial';
-//export * from './MeshDistanceMaterial';
+export * from './MeshDistanceMaterial';
 export * from './MeshBasicMaterial';
-//export * from './MeshMatcapMaterial';
+export * from './MeshMatcapMaterial';
 export * from './LineDashedMaterial';
 export * from './LineBasicMaterial';
 export * from './Material';

+ 15 - 7
src/materials/MeshDepthMaterial.d.ts

@@ -1,17 +1,25 @@
 import { DepthPackingStrategies } from '../constants';
 import { MaterialParameters, Material } from './Material';
+import { Texture } from './../textures/Texture';
 
 export interface MeshDepthMaterialParameters extends MaterialParameters {
-  wireframe?: boolean;
-  wireframeLinewidth?: number;
+	depthPacking?: DepthPackingStrategies;
+	displacementMap?: Texture;
+	displacementScale?: number;
+	displacementBias?: number;
+	wireframe?: boolean;
+	wireframeLinewidth?: number;
 }
 
 export class MeshDepthMaterial extends Material {
-  constructor(parameters?: MeshDepthMaterialParameters);
+	constructor(parameters?: MeshDepthMaterialParameters);
 
-  wireframe: boolean;
-  wireframeLinewidth: number;
-  depthPacking: DepthPackingStrategies;
+	depthPacking: DepthPackingStrategies;
+	displacementMap: Texture | null;
+	displacementScale: number;
+	displacementBias: number;
+	wireframe: boolean;
+	wireframeLinewidth: number;
 
-  setValues(parameters: MeshDepthMaterialParameters): void;
+	setValues(parameters: MeshDepthMaterialParameters): void;
 }

+ 25 - 0
src/materials/MeshDistanceMaterial.d.ts

@@ -0,0 +1,25 @@
+import { MaterialParameters, Material } from './Material';
+import { Vector3 } from './../math/Vector3';
+import { Texture } from './../textures/Texture';
+
+export interface MeshDistanceMaterialParameters extends MaterialParameters {
+	referencePosition?: Vector3;
+	nearDistance?: number;
+	farDistance?: number;
+	displacementMap?: Texture;
+	displacementScale?: number;
+	displacementBias?: number;
+}
+
+export class MeshDistanceMaterial extends Material {
+	constructor(parameters?: MeshDistanceMaterialParameters);
+
+	referencePosition: Vector3;
+	nearDistance: number;
+	farDistance: number;
+	displacementMap: Texture | null;
+	displacementScale: number;
+	displacementBias: number;
+
+	setValues(parameters: MeshDistanceMaterialParameters): void;
+}

+ 46 - 0
src/materials/MeshMatcapMaterial.d.ts

@@ -0,0 +1,46 @@
+import { Color } from './../math/Color';
+import { Texture } from './../textures/Texture';
+import { Vector2 } from './../math/Vector2';
+import { MaterialParameters, Material } from './Material';
+import { NormalMapTypes } from '../constants';
+
+export interface MeshMatcapMaterialParameters extends MaterialParameters {
+
+	color?: Color | string | number;
+	matMap?: Texture;
+	map?: Texture;
+	bumpMap?: Texture;
+	bumpScale?: number;
+	normalMap?: Texture;
+	normalMapType?: NormalMapTypes;
+	normalScale?: Vector2;
+	displacementMap?: Texture;
+	displacementScale?: number;
+	displacementBias?: number;
+	alphaMap?: Texture;
+	skinning?: boolean;
+	morphTargets?: boolean;
+	morphNormals?: boolean;
+}
+
+export class MeshMatcapMaterial extends Material {
+	constructor(parameters?: MeshMatcapMaterialParameters);
+
+	color: Color;
+	matMap: Texture | null;
+	map: Texture | null;
+	bumpMap: Texture | null;
+	bumpScale: number;
+	normalMap: Texture | null;
+	normalMapType: NormalMapTypes;
+	normalScale: Vector2;
+	displacementMap: Texture | null;
+	displacementScale: number;
+	displacementBias: number;
+	alphaMap: Texture | null;
+	skinning: boolean;
+	morphTargets: boolean;
+	morphNormals: boolean;
+
+	setValues(parameters: MeshMatcapMaterialParameters): void;
+}

+ 32 - 10
src/materials/MeshNormalMaterial.d.ts

@@ -1,19 +1,41 @@
 import { MaterialParameters, Material } from './Material';
+import { Texture } from './../textures/Texture';
+import { Vector2 } from './../math/Vector2';
+import { NormalMapTypes } from '../constants';
 
 export interface MeshNormalMaterialParameters extends MaterialParameters {
-  /** Render geometry as wireframe. Default is false (i.e. render as smooth shaded). */
-  wireframe?: boolean;
-  /** Controls wireframe thickness. Default is 1. */
-  wireframeLinewidth?: number;
-  morphTargets?: boolean;
+
+	bumpMap?: Texture;
+	bumpScale?: number;
+	normalMap?: Texture;
+	normalMapType?: NormalMapTypes;
+	normalScale?: Vector2;
+	displacementMap?: Texture;
+	displacementScale?: number;
+	displacementBias?: number;
+	wireframe?: boolean;
+	wireframeLinewidth?: number;
+	skinning?: boolean;
+	morphTargets?: boolean;
+	morphNormals?: boolean;
 }
 
 export class MeshNormalMaterial extends Material {
-  constructor(parameters?: MeshNormalMaterialParameters);
+	constructor(parameters?: MeshNormalMaterialParameters);
 
-  wireframe: boolean;
-  wireframeLinewidth: number;
-  morphTargets: boolean;
+	bumpMap: Texture | null;
+	bumpScale: number;
+	normalMap: Texture | null;
+	normalMapType: NormalMapTypes;
+	normalScale: Vector2;
+	displacementMap: Texture | null;
+	displacementScale: number;
+	displacementBias: number;
+	wireframe: boolean;
+	wireframeLinewidth: number;
+	skinning: boolean;
+	morphTargets: boolean;
+	morphNormals: boolean;
 
-  setValues(parameters: MeshNormalMaterialParameters): void;
+	setValues(parameters: MeshNormalMaterialParameters): void;
 }

+ 3 - 1
src/materials/MeshPhongMaterial.d.ts

@@ -2,7 +2,7 @@ import { Color } from './../math/Color';
 import { Texture } from './../textures/Texture';
 import { Vector2 } from './../math/Vector2';
 import { MaterialParameters, Material } from './Material';
-import { Combine } from '../constants';
+import { Combine, NormalMapTypes } from '../constants';
 
 export interface MeshPhongMaterialParameters extends MaterialParameters {
   /** geometry color in hexadecimal. Default is 0xffffff. */
@@ -21,6 +21,7 @@ export interface MeshPhongMaterialParameters extends MaterialParameters {
   bumpMap?: Texture;
   bumpScale?: number;
   normalMap?: Texture;
+  normalMapType?: NormalMapTypes;
   normalScale?: Vector2;
   displacementMap?: Texture;
   displacementScale?: number;
@@ -57,6 +58,7 @@ export class MeshPhongMaterial extends Material {
   bumpMap: Texture | null;
   bumpScale: number;
   normalMap: Texture | null;
+  normalMapType: NormalMapTypes;
   normalScale: Vector2;
   displacementMap: Texture | null;
   displacementScale: number;

+ 3 - 0
src/materials/MeshStandardMaterial.d.ts

@@ -2,6 +2,7 @@ import { Color } from './../math/Color';
 import { Texture } from './../textures/Texture';
 import { Vector2 } from './../math/Vector2';
 import { MaterialParameters, Material } from './Material';
+import { NormalMapTypes } from '../constants';
 
 export interface MeshStandardMaterialParameters extends MaterialParameters {
   color?: Color | string | number;
@@ -18,6 +19,7 @@ export interface MeshStandardMaterialParameters extends MaterialParameters {
   bumpMap?: Texture;
   bumpScale?: number;
   normalMap?: Texture;
+  normalMapType?: NormalMapTypes;
   normalScale?: Vector2;
   displacementMap?: Texture;
   displacementScale?: number;
@@ -53,6 +55,7 @@ export class MeshStandardMaterial extends Material {
   bumpMap: Texture | null;
   bumpScale: number;
   normalMap: Texture | null;
+  normalMapType: NormalMapTypes;
   normalScale: number;
   displacementMap: Texture | null;
   displacementScale: number;

+ 14 - 0
src/materials/MeshToonMaterial.d.ts

@@ -0,0 +1,14 @@
+import { Texture } from './../textures/Texture';
+import { MeshPhongMaterialParameters, MeshPhongMaterial } from './MeshPhongMaterial';
+
+export interface MeshToonMaterialParameters extends MeshPhongMaterialParameters {
+	gradientMap?: Texture;
+}
+
+export class MeshToonMaterial extends MeshPhongMaterial {
+	constructor(parameters?: MeshToonMaterialParameters);
+
+	gradientMap: Texture | null;
+
+	setValues(parameters: MeshToonMaterialParameters): void;
+}

+ 1 - 1
src/materials/ShaderMaterial.d.ts

@@ -17,7 +17,7 @@ export interface ShaderMaterialParameters extends MaterialParameters {
   uniforms?: any;
   vertexShader?: string;
   fragmentShader?: string;
-  lineWidth?: number;
+  linewidth?: number;
   wireframe?: boolean;
   wireframeLinewidth?: number;
   lights?: boolean;

+ 21 - 21
src/math/Matrix4.js

@@ -750,27 +750,27 @@ Object.assign( Matrix4.prototype, {
 
 		var sx = scale.x, sy = scale.y, sz = scale.z;
 
-	        te[ 0 ] = ( 1 - ( yy + zz ) ) * sx;
-	        te[ 1 ] = ( xy + wz ) * sx;
-	        te[ 2 ] = ( xz - wy ) * sx;
-	        te[ 3 ] = 0;
-
-	        te[ 4 ] = ( xy - wz ) * sy;
-	        te[ 5 ] = ( 1 - ( xx + zz ) ) * sy;
-	        te[ 6 ] = ( yz + wx ) * sy;
-	        te[ 7 ] = 0;
-
-	        te[ 8 ] = ( xz + wy ) * sz;
-	        te[ 9 ] = ( yz - wx ) * sz;
-	        te[ 10 ] = ( 1 - ( xx + yy ) ) * sz;
-	        te[ 11 ] = 0;
-
-	        te[ 12 ] = position.x;
-	        te[ 13 ] = position.y;
-	        te[ 14 ] = position.z;
-	        te[ 15 ] = 1;
-
-	        return this;
+		te[ 0 ] = ( 1 - ( yy + zz ) ) * sx;
+		te[ 1 ] = ( xy + wz ) * sx;
+		te[ 2 ] = ( xz - wy ) * sx;
+		te[ 3 ] = 0;
+
+		te[ 4 ] = ( xy - wz ) * sy;
+		te[ 5 ] = ( 1 - ( xx + zz ) ) * sy;
+		te[ 6 ] = ( yz + wx ) * sy;
+		te[ 7 ] = 0;
+
+		te[ 8 ] = ( xz + wy ) * sz;
+		te[ 9 ] = ( yz - wx ) * sz;
+		te[ 10 ] = ( 1 - ( xx + yy ) ) * sz;
+		te[ 11 ] = 0;
+
+		te[ 12 ] = position.x;
+		te[ 13 ] = position.y;
+		te[ 14 ] = position.z;
+		te[ 15 ] = 1;
+
+		return this;
 
 	},
 

+ 2 - 0
src/objects/LOD.js

@@ -26,6 +26,8 @@ LOD.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 	constructor: LOD,
 
+	isLOD: true,
+
 	copy: function ( source ) {
 
 		Object3D.prototype.copy.call( this, source, false );

+ 1 - 7
src/renderers/WebGLRenderer.js

@@ -298,13 +298,7 @@ function WebGLRenderer( parameters ) {
 
 	// vr
 
-	var vr = null;
-
-	if ( typeof navigator !== 'undefined' ) {
-
-		vr = ( 'xr' in navigator ) ? new WebXRManager( _this ) : new WebVRManager( _this );
-
-	}
+	var vr = ( typeof navigator !== 'undefined' && 'xr' in navigator ) ? new WebXRManager( _this ) : new WebVRManager( _this );
 
 	this.vr = vr;
 

+ 2 - 2
src/renderers/webvr/WebVRManager.js

@@ -131,7 +131,7 @@ function WebVRManager( renderer ) {
 
 				if ( gamepad.pose === null ) return;
 
-				//  Pose
+				// Pose
 
 				var pose = gamepad.pose;
 
@@ -145,7 +145,7 @@ function WebVRManager( renderer ) {
 				controller.matrixWorldNeedsUpdate = true;
 				controller.visible = true;
 
-				//  Trigger
+				// Trigger
 
 				var buttonId = gamepad.id === 'Daydream Controller' ? 0 : 1;
 

+ 1 - 1
src/textures/Texture.js

@@ -63,7 +63,7 @@ function Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, ty
 	// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.
 	//
 	// Also changing the encoding after already used by a Material will not automatically make the Material
-	// update.  You need to explicitly call Material.needsUpdate to trigger it to recompile.
+	// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.
 	this.encoding = encoding !== undefined ? encoding : LinearEncoding;
 
 	this.version = 0;