浏览代码

Updated builds.

Mr.doob 10 年之前
父节点
当前提交
3ab982bc4a
共有 2 个文件被更改,包括 558 次插入529 次删除
  1. 289 260
      build/three.js
  2. 269 269
      build/three.min.js

+ 289 - 260
build/three.js

@@ -17829,29 +17829,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	_usedTextureUnits = 0,
 
-	// GL state cache
-
-	_oldDoubleSided = - 1,
-	_oldFlipSided = - 1,
-
-	_oldBlending = - 1,
-
-	_oldBlendEquation = - 1,
-	_oldBlendSrc = - 1,
-	_oldBlendDst = - 1,
-	_oldBlendEquationAlpha = - 1,
-	_oldBlendSrcAlpha = - 1,
-	_oldBlendDstAlpha = - 1,
-
-	_oldDepthTest = - 1,
-	_oldDepthWrite = - 1,
-
-	_oldPolygonOffset = null,
-	_oldPolygonOffsetFactor = null,
-	_oldPolygonOffsetUnits = null,
-
-	_oldLineWidth = null,
-
 	_viewportX = 0,
 	_viewportY = 0,
 	_viewportWidth = _canvas.width,
@@ -17937,6 +17914,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	}
 
+	var state = new THREE.WebGLState( _gl, paramThreeToGL );
+
 	if ( _gl.getShaderPrecisionFormat === undefined ) {
 
 		_gl.getShaderPrecisionFormat = function () {
@@ -18007,11 +17986,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 		_currentProgram = null;
 		_currentCamera = null;
 
-		_oldBlending = - 1;
-		_oldDepthTest = - 1;
-		_oldDepthWrite = - 1;
-		_oldDoubleSided = - 1;
-		_oldFlipSided = - 1;
 		_currentGeometryProgram = '';
 		_currentMaterialId = - 1;
 
@@ -18023,11 +17997,14 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		}
 
+		state.reset();
+
 	};
 
 	setDefaultGLState();
 
 	this.context = _gl;
+	this.state = state;
 
 	// GPU capabilities
 
@@ -20439,7 +20416,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			var mode = ( object.mode === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES;
 
-			setLineWidth( material.linewidth );
+			state.setLineWidth( material.linewidth );
 
 			var index = geometry.attributes.index;
 
@@ -20733,7 +20710,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			if ( material.wireframe ) {
 
-				setLineWidth( material.wireframeLinewidth );
+				state.setLineWidth( material.wireframeLinewidth );
+
 				if ( updateBuffers ) _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, geometryGroup.__webglLineBuffer );
 				_gl.drawElements( _gl.LINES, geometryGroup.__webglLineCount, type, 0 );
 
@@ -20756,7 +20734,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			var mode = ( object.mode === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES;
 
-			setLineWidth( material.linewidth );
+			state.setLineWidth( material.linewidth );
 
 			_gl.drawArrays( mode, 0, geometryGroup.__webglLineCount );
 
@@ -21117,32 +21095,27 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		if ( scene.overrideMaterial ) {
 
-			var material = scene.overrideMaterial;
+			var overrideMaterial = scene.overrideMaterial;
 
-			this.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha );
-			this.setDepthTest( material.depthTest );
-			this.setDepthWrite( material.depthWrite );
-			setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );
+			setMaterial( overrideMaterial );
 
-			renderObjects( opaqueObjects, camera, lights, fog, true, material );
-			renderObjects( transparentObjects, camera, lights, fog, true, material );
-			renderObjectsImmediate( _webglObjectsImmediate, '', camera, lights, fog, false, material );
+			renderObjects( opaqueObjects, camera, lights, fog, overrideMaterial );
+			renderObjects( transparentObjects, camera, lights, fog, overrideMaterial );
+			renderObjectsImmediate( _webglObjectsImmediate, '', camera, lights, fog, overrideMaterial );
 
 		} else {
 
-			var material = null;
-
 			// opaque pass (front-to-back order)
 
-			this.setBlending( THREE.NoBlending );
+			state.setBlending( THREE.NoBlending );
 
-			renderObjects( opaqueObjects, camera, lights, fog, false, material );
-			renderObjectsImmediate( _webglObjectsImmediate, 'opaque', camera, lights, fog, false, material );
+			renderObjects( opaqueObjects, camera, lights, fog, null );
+			renderObjectsImmediate( _webglObjectsImmediate, 'opaque', camera, lights, fog, null );
 
 			// transparent pass (back-to-front order)
 
-			renderObjects( transparentObjects, camera, lights, fog, true, material );
-			renderObjectsImmediate( _webglObjectsImmediate, 'transparent', camera, lights, fog, true, material );
+			renderObjects( transparentObjects, camera, lights, fog, null );
+			renderObjectsImmediate( _webglObjectsImmediate, 'transparent', camera, lights, fog, null );
 
 		}
 
@@ -21161,8 +21134,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		// Ensure depth buffer writing is enabled so it can be cleared on next render
 
-		this.setDepthTest( true );
-		this.setDepthWrite( true );
+		state.setDepthTest( true );
+		state.setDepthWrite( true );
 
 		// _gl.finish();
 
@@ -21231,7 +21204,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	}
 
-	function renderObjects( renderList, camera, lights, fog, useBlending, overrideMaterial ) {
+	function renderObjects( renderList, camera, lights, fog, overrideMaterial ) {
 
 		var material;
 
@@ -21254,11 +21227,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				if ( ! material ) continue;
 
-				if ( useBlending ) _this.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha );
-
-				_this.setDepthTest( material.depthTest );
-				_this.setDepthWrite( material.depthWrite );
-				setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );
+				setMaterial( material );
 
 			}
 
@@ -21278,7 +21247,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	}
 
-	function renderObjectsImmediate ( renderList, materialType, camera, lights, fog, useBlending, overrideMaterial ) {
+	function renderObjectsImmediate ( renderList, materialType, camera, lights, fog, overrideMaterial ) {
 
 		var material;
 
@@ -21299,11 +21268,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 					if ( ! material ) continue;
 
-					if ( useBlending ) _this.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha );
-
-					_this.setDepthTest( material.depthTest );
-					_this.setDepthWrite( material.depthWrite );
-					setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );
+					setMaterial( material );
 
 				}
 
@@ -22070,6 +22035,24 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	}
 
+	function setMaterial( material ) {
+
+		if ( material.transparent === true ) {
+
+			state.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha );
+
+		} else {
+
+			state.setBlending( THREE.NoBlending );
+
+		}
+
+		state.setDepthTest( material.depthTest );
+		state.setDepthWrite( material.depthWrite );
+		state.setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );
+
+	}
+
 	function setProgram( camera, lights, fog, material, object ) {
 
 		_usedTextureUnits = 0;
@@ -23165,197 +23148,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	this.setMaterialFaces = function ( material ) {
 
-		var doubleSided = material.side === THREE.DoubleSide;
-		var flipSided = material.side === THREE.BackSide;
-
-		if ( _oldDoubleSided !== doubleSided ) {
-
-			if ( doubleSided ) {
-
-				_gl.disable( _gl.CULL_FACE );
-
-			} else {
-
-				_gl.enable( _gl.CULL_FACE );
-
-			}
-
-			_oldDoubleSided = doubleSided;
-
-		}
-
-		if ( _oldFlipSided !== flipSided ) {
-
-			if ( flipSided ) {
-
-				_gl.frontFace( _gl.CW );
-
-			} else {
-
-				_gl.frontFace( _gl.CCW );
-
-			}
-
-			_oldFlipSided = flipSided;
-
-		}
-
-	};
-
-	this.setDepthTest = function ( depthTest ) {
-
-		if ( _oldDepthTest !== depthTest ) {
-
-			if ( depthTest ) {
-
-				_gl.enable( _gl.DEPTH_TEST );
-
-			} else {
-
-				_gl.disable( _gl.DEPTH_TEST );
-
-			}
-
-			_oldDepthTest = depthTest;
-
-		}
-
-	};
-
-	this.setDepthWrite = function ( depthWrite ) {
-
-		if ( _oldDepthWrite !== depthWrite ) {
-
-			_gl.depthMask( depthWrite );
-			_oldDepthWrite = depthWrite;
-
-		}
-
-	};
-
-	function setLineWidth ( width ) {
-
-		width *= pixelRatio;
-
-		if ( width !== _oldLineWidth ) {
-
-			_gl.lineWidth( width );
-
-			_oldLineWidth = width;
-
-		}
-
-	}
-
-	function setPolygonOffset ( polygonoffset, factor, units ) {
-
-		if ( _oldPolygonOffset !== polygonoffset ) {
-
-			if ( polygonoffset ) {
-
-				_gl.enable( _gl.POLYGON_OFFSET_FILL );
-
-			} else {
-
-				_gl.disable( _gl.POLYGON_OFFSET_FILL );
-
-			}
-
-			_oldPolygonOffset = polygonoffset;
-
-		}
-
-		if ( polygonoffset && ( _oldPolygonOffsetFactor !== factor || _oldPolygonOffsetUnits !== units ) ) {
-
-			_gl.polygonOffset( factor, units );
-
-			_oldPolygonOffsetFactor = factor;
-			_oldPolygonOffsetUnits = units;
-
-		}
-
-	}
-
-	this.setBlending = function ( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha ) {
-
-		if ( blending !== _oldBlending ) {
-
-			if ( blending === THREE.NoBlending ) {
-
-				_gl.disable( _gl.BLEND );
-
-			} else if ( blending === THREE.AdditiveBlending ) {
-
-				_gl.enable( _gl.BLEND );
-				_gl.blendEquation( _gl.FUNC_ADD );
-				_gl.blendFunc( _gl.SRC_ALPHA, _gl.ONE );
-
-			} else if ( blending === THREE.SubtractiveBlending ) {
-
-				// TODO: Find blendFuncSeparate() combination
-				_gl.enable( _gl.BLEND );
-				_gl.blendEquation( _gl.FUNC_ADD );
-				_gl.blendFunc( _gl.ZERO, _gl.ONE_MINUS_SRC_COLOR );
-
-			} else if ( blending === THREE.MultiplyBlending ) {
-
-				// TODO: Find blendFuncSeparate() combination
-				_gl.enable( _gl.BLEND );
-				_gl.blendEquation( _gl.FUNC_ADD );
-				_gl.blendFunc( _gl.ZERO, _gl.SRC_COLOR );
-
-			} else if ( blending === THREE.CustomBlending ) {
-
-				_gl.enable( _gl.BLEND );
-
-			} else {
-
-				_gl.enable( _gl.BLEND );
-				_gl.blendEquationSeparate( _gl.FUNC_ADD, _gl.FUNC_ADD );
-				_gl.blendFuncSeparate( _gl.SRC_ALPHA, _gl.ONE_MINUS_SRC_ALPHA, _gl.ONE, _gl.ONE_MINUS_SRC_ALPHA );
-
-			}
-
-			_oldBlending = blending;
-
-		}
-
-		if ( blending === THREE.CustomBlending ) {
-
-			blendEquationAlpha = blendEquationAlpha || blendEquation;
-			blendSrcAlpha = blendSrcAlpha || blendSrc;
-			blendDstAlpha = blendDstAlpha || blendDst;
-
-			if ( blendEquation !== _oldBlendEquation || blendEquationAlpha !== _oldBlendEquationAlpha ) {
-
-				_gl.blendEquationSeparate( paramThreeToGL( blendEquation ), paramThreeToGL( blendEquationAlpha ) );
-
-				_oldBlendEquation = blendEquation;
-				_oldBlendEquationAlpha = blendEquationAlpha;
-
-			}
-
-			if ( blendSrc !== _oldBlendSrc || blendDst !== _oldBlendDst || blendSrcAlpha !== _oldBlendSrcAlpha || blendDstAlpha !== _oldBlendDstAlpha ) {
-
-				_gl.blendFuncSeparate( paramThreeToGL( blendSrc ), paramThreeToGL( blendDst ), paramThreeToGL( blendSrcAlpha ), paramThreeToGL( blendDstAlpha ) );
-
-				_oldBlendSrc = blendSrc;
-				_oldBlendDst = blendDst;
-				_oldBlendSrcAlpha = blendSrcAlpha;
-				_oldBlendDstAlpha = blendDstAlpha;
-
-			}
-
-		} else {
-
-			_oldBlendEquation = null;
-			_oldBlendSrc = null;
-			_oldBlendDst = null;
-			_oldBlendEquationAlpha = null;
-			_oldBlendSrcAlpha = null;
-			_oldBlendDstAlpha = null;
-
-		}
+		state.setDoubleSided( material.side === THREE.DoubleSide );
+		state.setFlipSided( material.side === THREE.BackSide );
 
 	};
 
@@ -23399,10 +23193,10 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		if ( extension && texture.type !== THREE.FloatType && texture.type !== THREE.HalfFloatType ) {
 
-			if ( texture.anisotropy > 1 || texture.__oldAnisotropy ) {
+			if ( texture.anisotropy > 1 || texture.__currentAnisotropy ) {
 
 				_gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, _this.getMaxAnisotropy() ) );
-				texture.__oldAnisotropy = texture.anisotropy;
+				texture.__currentAnisotropy = texture.anisotropy;
 
 			}
 
@@ -24821,6 +24615,241 @@ THREE.WebGLShader = ( function () {
 
 } )();
 
+// File:src/renderers/webgl/WebGLState.js
+
+/**
+* @author mrdoob / http://mrdoob.com/
+*/
+
+THREE.WebGLState = function ( gl, paramThreeToGL ) {
+
+	var currentBlending = - 1;
+	var currentBlendEquation = - 1;
+	var currentBlendSrc = - 1;
+	var currentBlendDst = - 1;
+	var currentBlendEquationAlpha = - 1;
+	var currentBlendSrcAlpha = - 1;
+	var currentBlendDstAlpha = - 1;
+
+	var currentDepthTest = - 1;
+	var currentDepthWrite = - 1;
+
+	var currentDoubleSided = - 1;
+	var currentFlipSided = - 1;
+
+	var currentLineWidth = null;
+
+	var currentPolygonOffset = null;
+	var currentPolygonOffsetFactor = null;
+	var currentPolygonOffsetUnits = null;
+
+	this.setBlending = function ( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha ) {
+
+		if ( blending !== currentBlending ) {
+
+			if ( blending === THREE.NoBlending ) {
+
+				gl.disable( gl.BLEND );
+
+			} else if ( blending === THREE.AdditiveBlending ) {
+
+				gl.enable( gl.BLEND );
+				gl.blendEquation( gl.FUNC_ADD );
+				gl.blendFunc( gl.SRC_ALPHA, gl.ONE );
+
+			} else if ( blending === THREE.SubtractiveBlending ) {
+
+				// TODO: Find blendFuncSeparate() combination
+				gl.enable( gl.BLEND );
+				gl.blendEquation( gl.FUNC_ADD );
+				gl.blendFunc( gl.ZERO, gl.ONE_MINUS_SRC_COLOR );
+
+			} else if ( blending === THREE.MultiplyBlending ) {
+
+				// TODO: Find blendFuncSeparate() combination
+				gl.enable( gl.BLEND );
+				gl.blendEquation( gl.FUNC_ADD );
+				gl.blendFunc( gl.ZERO, gl.SRC_COLOR );
+
+			} else if ( blending === THREE.CustomBlending ) {
+
+				gl.enable( gl.BLEND );
+
+			} else {
+
+				gl.enable( gl.BLEND );
+				gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD );
+				gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA );
+
+			}
+
+			currentBlending = blending;
+
+		}
+
+		if ( blending === THREE.CustomBlending ) {
+
+			blendEquationAlpha = blendEquationAlpha || blendEquation;
+			blendSrcAlpha = blendSrcAlpha || blendSrc;
+			blendDstAlpha = blendDstAlpha || blendDst;
+
+			if ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) {
+
+				gl.blendEquationSeparate( paramThreeToGL( blendEquation ), paramThreeToGL( blendEquationAlpha ) );
+
+				currentBlendEquation = blendEquation;
+				currentBlendEquationAlpha = blendEquationAlpha;
+
+			}
+
+			if ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) {
+
+				gl.blendFuncSeparate( paramThreeToGL( blendSrc ), paramThreeToGL( blendDst ), paramThreeToGL( blendSrcAlpha ), paramThreeToGL( blendDstAlpha ) );
+
+				currentBlendSrc = blendSrc;
+				currentBlendDst = blendDst;
+				currentBlendSrcAlpha = blendSrcAlpha;
+				currentBlendDstAlpha = blendDstAlpha;
+
+			}
+
+		} else {
+
+			currentBlendEquation = null;
+			currentBlendSrc = null;
+			currentBlendDst = null;
+			currentBlendEquationAlpha = null;
+			currentBlendSrcAlpha = null;
+			currentBlendDstAlpha = null;
+
+		}
+
+	};
+
+	this.setDepthTest = function ( depthTest ) {
+
+		if ( currentDepthTest !== depthTest ) {
+
+			if ( depthTest ) {
+
+				gl.enable( gl.DEPTH_TEST );
+
+			} else {
+
+				gl.disable( gl.DEPTH_TEST );
+
+			}
+
+			currentDepthTest = depthTest;
+
+		}
+
+	};
+
+	this.setDepthWrite = function ( depthWrite ) {
+
+		if ( currentDepthWrite !== depthWrite ) {
+
+			gl.depthMask( depthWrite );
+			currentDepthWrite = depthWrite;
+
+		}
+
+	};
+
+	this.setDoubleSided = function ( doubleSided ) {
+
+		if ( currentDoubleSided !== doubleSided ) {
+
+			if ( doubleSided ) {
+
+				gl.disable( gl.CULL_FACE );
+
+			} else {
+
+				gl.enable( gl.CULL_FACE );
+
+			}
+
+			currentDoubleSided = doubleSided;
+
+		}
+
+	};
+
+	this.setFlipSided = function ( flipSided ) {
+
+		if ( currentFlipSided !== flipSided ) {
+
+			if ( flipSided ) {
+
+				gl.frontFace( gl.CW );
+
+			} else {
+
+				gl.frontFace( gl.CCW );
+
+			}
+
+			currentFlipSided = flipSided;
+
+		}
+
+	};
+
+	this.setLineWidth = function ( width ) {
+
+		if ( width !== currentLineWidth ) {
+
+			gl.lineWidth( width );
+
+			currentLineWidth = width;
+
+		}
+
+	};
+
+	this.setPolygonOffset = function ( polygonoffset, factor, units ) {
+
+		if ( currentPolygonOffset !== polygonoffset ) {
+
+			if ( polygonoffset ) {
+
+				gl.enable( gl.POLYGON_OFFSET_FILL );
+
+			} else {
+
+				gl.disable( gl.POLYGON_OFFSET_FILL );
+
+			}
+
+			currentPolygonOffset = polygonoffset;
+
+		}
+
+		if ( polygonoffset && ( currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units ) ) {
+
+			gl.polygonOffset( factor, units );
+
+			currentPolygonOffsetFactor = factor;
+			currentPolygonOffsetUnits = units;
+
+		}
+
+	};
+
+	this.reset = function () {
+
+		currentBlending = - 1;
+		currentDepthTest = - 1;
+		currentDepthWrite = - 1;
+		currentDoubleSided = - 1;
+		currentFlipSided = - 1;
+
+	};
+
+};
+
 // File:src/renderers/webgl/plugins/LensFlarePlugin.js
 
 /**
@@ -25146,7 +25175,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
 			// calc object screen position
 
 			var flare = flares[ i ];
-			
+
 			tempPosition.set( flare.matrixWorld.elements[12], flare.matrixWorld.elements[13], flare.matrixWorld.elements[14] );
 
 			tempPosition.applyMatrix4( camera.matrixWorldInverse );
@@ -25244,7 +25273,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
 						gl.uniform1f( uniforms.opacity, sprite.opacity );
 						gl.uniform3f( uniforms.color, sprite.color.r, sprite.color.g, sprite.color.b );
 
-						renderer.setBlending( sprite.blending, sprite.blendEquation, sprite.blendSrc, sprite.blendDst );
+						renderer.state.setBlending( sprite.blending, sprite.blendEquation, sprite.blendSrc, sprite.blendDst );
 						renderer.setTexture( sprite.texture, 1 );
 
 						gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 );
@@ -25312,7 +25341,7 @@ THREE.ShadowMapPlugin = function ( _renderer, _lights, _webglObjects, _webglObje
 	_max = new THREE.Vector3(),
 
 	_matrixPosition = new THREE.Vector3(),
-	
+
 	_renderList = [];
 
 	// init
@@ -25386,7 +25415,7 @@ THREE.ShadowMapPlugin = function ( _renderer, _lights, _webglObjects, _webglObje
 
 		}
 
-		_renderer.setDepthTest( true );
+		_renderer.state.setDepthTest( true );
 
 		// preprocess lights
 		// 	- skip lights that are not casting shadows
@@ -26036,9 +26065,9 @@ THREE.SpritePlugin = function ( renderer, sprites ) {
 			gl.uniform1f( uniforms.rotation, material.rotation );
 			gl.uniform2fv( uniforms.scale, scale );
 
-			renderer.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst );
-			renderer.setDepthTest( material.depthTest );
-			renderer.setDepthWrite( material.depthWrite );
+			renderer.state.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst );
+			renderer.state.setDepthTest( material.depthTest );
+			renderer.state.setDepthWrite( material.depthWrite );
 
 			if ( material.map && material.map.image && material.map.image.width ) {
 

+ 269 - 269
build/three.min.js

@@ -94,21 +94,21 @@ a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:funct
 c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");THREE.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];
 a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}};
 THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);0<arguments.length&&THREE.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,p,n,q,m,s,t,r){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=f;u[9]=g;u[13]=h;u[2]=k;u[6]=p;u[10]=n;u[14]=q;u[3]=m;u[7]=s;u[11]=t;u[15]=r;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){THREE.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,p,n,q,l,s,t,r){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=f;u[9]=g;u[13]=h;u[2]=k;u[6]=p;u[10]=n;u[14]=q;u[3]=l;u[7]=s;u[11]=t;u[15]=r;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){THREE.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
 copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){var d=this.elements;a.set(d[0],d[1],d[2]);b.set(d[4],d[5],d[6]);c.set(d[8],d[9],d[10]);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a=new THREE.Vector3;return function(b){var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),
 f=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){!1===a instanceof THREE.Euler&&THREE.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=f*h;var k=f*e,
 p=c*h,n=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+p*d;b[5]=a-n*d;b[9]=-c*g;b[2]=n-a*d;b[6]=p+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,p=d*h,n=d*e,b[0]=a+n*c,b[4]=p*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-p,b[6]=n+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,p=d*h,n=d*e,b[0]=a-n*c,b[4]=-f*e,b[8]=p+k*c,b[1]=k+p*c,b[5]=f*h,b[9]=n-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,p=c*h,n=c*e,b[0]=g*h,b[4]=p*d-k,b[8]=a*d+n,b[1]=g*e,b[5]=n*d+a,b[9]=k*d-p,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===
 a.order?(a=f*g,k=f*d,p=c*g,n=c*d,b[0]=g*h,b[4]=n-a*e,b[8]=p*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+p,b[10]=a-n*e):"XZY"===a.order&&(a=f*g,k=f*d,p=c*g,n=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=f*h,b[9]=k*e-p,b[2]=p*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){THREE.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
 makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var p=c*h,c=c*k,n=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(n+e);b[4]=p-f;b[8]=c+h;b[1]=p+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,
 c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(THREE.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],
-k=c[12],p=c[1],n=c[5],q=c[9],m=c[13],s=c[2],t=c[6],r=c[10],u=c[14],v=c[3],x=c[7],C=c[11],c=c[15],w=d[0],y=d[4],A=d[8],F=d[12],G=d[1],E=d[5],z=d[9],L=d[13],J=d[2],M=d[6],K=d[10],S=d[14],O=d[3],N=d[7],P=d[11],d=d[15];e[0]=f*w+g*G+h*J+k*O;e[4]=f*y+g*E+h*M+k*N;e[8]=f*A+g*z+h*K+k*P;e[12]=f*F+g*L+h*S+k*d;e[1]=p*w+n*G+q*J+m*O;e[5]=p*y+n*E+q*M+m*N;e[9]=p*A+n*z+q*K+m*P;e[13]=p*F+n*L+q*S+m*d;e[2]=s*w+t*G+r*J+u*O;e[6]=s*y+t*E+r*M+u*N;e[10]=s*A+t*z+r*K+u*P;e[14]=s*F+t*L+r*S+u*d;e[3]=v*w+x*G+C*J+c*O;e[7]=v*y+
-x*E+C*M+c*N;e[11]=v*A+x*z+C*K+c*P;e[15]=v*F+x*L+C*S+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=
+k=c[12],p=c[1],n=c[5],q=c[9],l=c[13],s=c[2],t=c[6],r=c[10],u=c[14],v=c[3],x=c[7],C=c[11],c=c[15],w=d[0],y=d[4],A=d[8],E=d[12],H=d[1],F=d[5],z=d[9],J=d[13],M=d[2],N=d[6],K=d[10],T=d[14],O=d[3],U=d[7],Q=d[11],d=d[15];e[0]=f*w+g*H+h*M+k*O;e[4]=f*y+g*F+h*N+k*U;e[8]=f*A+g*z+h*K+k*Q;e[12]=f*E+g*J+h*T+k*d;e[1]=p*w+n*H+q*M+l*O;e[5]=p*y+n*F+q*N+l*U;e[9]=p*A+n*z+q*K+l*Q;e[13]=p*E+n*J+q*T+l*d;e[2]=s*w+t*H+r*M+u*O;e[6]=s*y+t*F+r*N+u*U;e[10]=s*A+t*z+r*K+u*Q;e[14]=s*E+t*J+r*T+u*d;e[3]=v*w+x*H+C*M+c*O;e[7]=v*y+
+x*F+C*N+c*U;e[11]=v*A+x*z+C*K+c*Q;e[15]=v*E+x*J+C*T+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=
 a;b[15]*=a;return this},multiplyVector3:function(a){THREE.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){THREE.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){THREE.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){THREE.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){THREE.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");
-return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],p=a[2],n=a[6],q=a[10],m=a[14];return a[3]*(+e*h*n-d*k*n-e*g*q+c*k*q+d*g*m-c*h*m)+a[7]*(+b*h*m-b*k*q+e*f*q-d*f*m+d*k*p-e*h*p)+a[11]*(+b*k*n-b*g*m-e*f*n+c*f*m+e*g*p-c*k*p)+a[15]*(-d*g*p-b*h*n+b*g*q+d*f*n-c*f*q+c*h*p)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];
+return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],p=a[2],n=a[6],q=a[10],l=a[14];return a[3]*(+e*h*n-d*k*n-e*g*q+c*k*q+d*g*l-c*h*l)+a[7]*(+b*h*l-b*k*q+e*f*q-d*f*l+d*k*p-e*h*p)+a[11]*(+b*k*n-b*g*l-e*f*n+c*f*l+e*g*p-c*k*p)+a[15]*(-d*g*p-b*h*n+b*g*q+d*f*n-c*f*q+c*h*p)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];
 a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=new THREE.Vector3;return function(){THREE.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=
-this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],p=d[5],n=d[9],q=d[13],m=d[2],s=d[6],t=d[10],r=d[14],u=d[3],v=d[7],x=d[11],d=d[15];c[0]=n*r*v-q*t*v+q*s*x-p*r*x-n*s*d+p*t*d;c[4]=h*t*v-g*r*v-h*s*x+f*r*x+g*s*d-f*t*d;c[8]=g*q*v-h*n*v+h*p*x-f*q*x-g*p*d+f*n*d;c[12]=h*n*s-g*q*s-h*p*t+f*q*t+g*p*r-f*n*r;c[1]=q*t*u-n*r*u-q*m*x+
-k*r*x+n*m*d-k*t*d;c[5]=g*r*u-h*t*u+h*m*x-e*r*x-g*m*d+e*t*d;c[9]=h*n*u-g*q*u-h*k*x+e*q*x+g*k*d-e*n*d;c[13]=g*q*m-h*n*m+h*k*t-e*q*t-g*k*r+e*n*r;c[2]=p*r*u-q*s*u+q*m*v-k*r*v-p*m*d+k*s*d;c[6]=h*s*u-f*r*u-h*m*v+e*r*v+f*m*d-e*s*d;c[10]=f*q*u-h*p*u+h*k*v-e*q*v-f*k*d+e*p*d;c[14]=h*p*m-f*q*m-h*k*s+e*q*s+f*k*r-e*p*r;c[3]=n*s*u-p*t*u-n*m*v+k*t*v+p*m*x-k*s*x;c[7]=f*t*u-g*s*u+g*m*v-e*t*v-f*m*x+e*s*x;c[11]=g*p*u-f*n*u-g*k*v+e*n*v+f*k*x-e*p*x;c[15]=f*n*m-g*p*m+g*k*s-e*n*s-f*k*t+e*p*t;c=e*c[0]+k*c[4]+m*c[8]+u*c[12];
+this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],p=d[5],n=d[9],q=d[13],l=d[2],s=d[6],t=d[10],r=d[14],u=d[3],v=d[7],x=d[11],d=d[15];c[0]=n*r*v-q*t*v+q*s*x-p*r*x-n*s*d+p*t*d;c[4]=h*t*v-g*r*v-h*s*x+f*r*x+g*s*d-f*t*d;c[8]=g*q*v-h*n*v+h*p*x-f*q*x-g*p*d+f*n*d;c[12]=h*n*s-g*q*s-h*p*t+f*q*t+g*p*r-f*n*r;c[1]=q*t*u-n*r*u-q*l*x+
+k*r*x+n*l*d-k*t*d;c[5]=g*r*u-h*t*u+h*l*x-e*r*x-g*l*d+e*t*d;c[9]=h*n*u-g*q*u-h*k*x+e*q*x+g*k*d-e*n*d;c[13]=g*q*l-h*n*l+h*k*t-e*q*t-g*k*r+e*n*r;c[2]=p*r*u-q*s*u+q*l*v-k*r*v-p*l*d+k*s*d;c[6]=h*s*u-f*r*u-h*l*v+e*r*v+f*l*d-e*s*d;c[10]=f*q*u-h*p*u+h*k*v-e*q*v-f*k*d+e*p*d;c[14]=h*p*l-f*q*l-h*k*s+e*q*s+f*k*r-e*p*r;c[3]=n*s*u-p*t*u-n*l*v+k*t*v+p*l*x-k*s*x;c[7]=f*t*u-g*s*u+g*l*v-e*t*v-f*l*x+e*s*x;c[11]=g*p*u-f*n*u-g*k*v+e*n*v+f*k*x-e*p*x;c[15]=f*n*l-g*p*l+g*k*s-e*n*s-f*k*t+e*p*t;c=e*c[0]+k*c[4]+l*c[8]+u*c[12];
 if(0==c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");THREE.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){THREE.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){THREE.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){THREE.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){THREE.error("THREE.Matrix4: .rotateZ() has been removed.")},
 rotateByAxis:function(a,b){THREE.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,
 c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,k=e*f,p=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*g+
@@ -118,7 +118,7 @@ g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THR
 a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3};
 THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);
 var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;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),p=c.dot(this.direction),n=-c.dot(b),q=c.lengthSq(),m=Math.abs(1-k*k),s;0<m?(d=k*n-p,e=k*p-n,s=h*m,0<=d?e>=-s?e<=s?(h=1/m,d*=h,e*=h,k=d*(d+k*e+2*p)+e*(k*d+e+2*n)+q):(e=h,d=Math.max(0,-(k*e+p)),k=-d*d+e*(e+2*n)+q):(e=-h,d=Math.max(0,-(k*e+p)),k=-d*d+e*(e+2*n)+q):e<=-s?(d=Math.max(0,-(-k*h+p)),e=0<d?-h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+q):e<=s?(d=0,e=Math.min(Math.max(-h,-n),h),k=e*(e+
+b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),p=c.dot(this.direction),n=-c.dot(b),q=c.lengthSq(),l=Math.abs(1-k*k),s;0<l?(d=k*n-p,e=k*p-n,s=h*l,0<=d?e>=-s?e<=s?(h=1/l,d*=h,e*=h,k=d*(d+k*e+2*p)+e*(k*d+e+2*n)+q):(e=h,d=Math.max(0,-(k*e+p)),k=-d*d+e*(e+2*n)+q):(e=-h,d=Math.max(0,-(k*e+p)),k=-d*d+e*(e+2*n)+q):e<=-s?(d=Math.max(0,-(-k*h+p)),e=0<d?-h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+q):e<=s?(d=0,e=Math.min(Math.max(-h,-n),h),k=e*(e+
 2*n)+q):(d=Math.max(0,-(k*h+p)),e=0<d?h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+q)):(e=0<k?-h:h,d=Math.max(0,-(k*e+p)),k=-d*d+e*(e+2*n)+q);f&&f.copy(this.direction).multiplyScalar(d).add(this.origin);g&&g.copy(b).multiplyScalar(e).add(a);return k}}(),isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;
 if(e>f)return null;f=Math.sqrt(f-e);e=d-f;d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},
 isIntersectionBox:function(){var a=new THREE.Vector3;return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(f<d||d!==d)d=f;0<=g?(e=(a.min.z-h.z)*g,g*=a.max.z-h.z):(e=(a.max.z-h.z)*
@@ -128,8 +128,8 @@ THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.c
 this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);
 return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};
 THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};
-THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],p=c[7],n=c[8],q=c[9],m=c[10],s=c[11],t=c[12],r=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,p-g,s-n,c-t).normalize();b[1].setComponents(f+
-a,p+g,s+n,c+t).normalize();b[2].setComponents(f+d,p+h,s+q,c+r).normalize();b[3].setComponents(f-d,p-h,s-q,c-r).normalize();b[4].setComponents(f-e,p-k,s-m,c-u).normalize();b[5].setComponents(f+e,p+k,s+m,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
+THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],p=c[7],n=c[8],q=c[9],l=c[10],s=c[11],t=c[12],r=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,p-g,s-n,c-t).normalize();b[1].setComponents(f+
+a,p+g,s+n,c+t).normalize();b[2].setComponents(f+d,p+h,s+q,c+r).normalize();b[3].setComponents(f-d,p-h,s-q,c-r).normalize();b[4].setComponents(f-e,p-k,s-l,c-u).normalize();b[5].setComponents(f+e,p+k,s+l,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
 c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var g=f.distanceToPoint(a),f=f.distanceToPoint(b);if(0>g&&0>f)return!1}return!0}}(),
 containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
 THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,
@@ -140,9 +140,9 @@ a.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}}
 THREE.Math={generateUUID:function(){var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),b=Array(36),c=0,d;return function(){for(var e=0;36>e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){if(a<=
 b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return Math.floor(this.randFloat(a,b))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a=
 180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},nextPowerOfTwo:function(a){a--;a|=a>>1;a|=a>>2;a|=a>>4;a|=a>>8;a|=a>>16;a++;return a}};
-THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,p,n,q,m;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+
-2;p=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];m=this.points[c[3]];h=g*g;k=g*h;d.x=b(p.x,n.x,q.x,m.x,g,h,k);d.y=b(p.y,n.y,q.y,m.y,g,h,k);d.z=b(p.z,n.z,q.z,m.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=
-a/c,d=this.getPoint(b),g.copy(d),k+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],k=new THREE.Vector3,m=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=m.chunks[b]-m.chunks[b-1];g=Math.ceil(a*c/m.total);e=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<g-1;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),h.push(k.copy(d).clone());
+THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,p,n,q,l;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+
+2;p=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];l=this.points[c[3]];h=g*g;k=g*h;d.x=b(p.x,n.x,q.x,l.x,g,h,k);d.y=b(p.y,n.y,q.y,l.y,g,h,k);d.z=b(p.z,n.z,q.z,l.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=
+a/c,d=this.getPoint(b),g.copy(d),k+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],k=new THREE.Vector3,l=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=l.chunks[b]-l.chunks[b-1];g=Math.ceil(a*c/l.total);e=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<g-1;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),h.push(k.copy(d).clone());
 h.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();
 THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g,h){a.subVectors(g,e);b.subVectors(f,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);f=a.dot(c);var k=b.dot(b);g=b.dot(c);var p=d*k-e*e;h=h||new THREE.Vector3;if(0==p)return h.set(-2,-1,-1);p=1/p;k=(k*f-e*g)*p;d=(d*g-e*f)*p;return h.set(1-k-d,d,k)}}();
 THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}();
@@ -186,19 +186,19 @@ THREE.Float64Attribute=function(a,b){THREE.warn("THREE.Float64Attribute has been
 THREE.DynamicBufferAttribute.prototype.clone=function(){return new THREE.DynamicBufferAttribute(new this.array.constructor(this.array),this.itemSize)};THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.attributesKeys=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute?(THREE.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):(this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=
 this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0)},center:function(){},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=0<e[0].length,h=3==d[0].vertexNormals.length,k=new Float32Array(9*d.length);this.addAttribute("position",new THREE.BufferAttribute(k,3));var p=
-new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(p,3));if(f!==THREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(n,3))}if(!0===g){var q=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(q,2))}for(var m=0,s=0,t=0;m<d.length;m++,s+=6,t+=9){var r=d[m],u=c[r.a],v=c[r.b],x=c[r.c];k[t]=u.x;k[t+1]=u.y;k[t+2]=u.z;k[t+3]=v.x;k[t+4]=v.y;k[t+5]=v.z;k[t+6]=x.x;k[t+7]=x.y;k[t+8]=x.z;!0===h?(u=r.vertexNormals[0],
+new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(p,3));if(f!==THREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(n,3))}if(!0===g){var q=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(q,2))}for(var l=0,s=0,t=0;l<d.length;l++,s+=6,t+=9){var r=d[l],u=c[r.a],v=c[r.b],x=c[r.c];k[t]=u.x;k[t+1]=u.y;k[t+2]=u.z;k[t+3]=v.x;k[t+4]=v.y;k[t+5]=v.z;k[t+6]=x.x;k[t+7]=x.y;k[t+8]=x.z;!0===h?(u=r.vertexNormals[0],
 v=r.vertexNormals[1],x=r.vertexNormals[2],p[t]=u.x,p[t+1]=u.y,p[t+2]=u.z,p[t+3]=v.x,p[t+4]=v.y,p[t+5]=v.z,p[t+6]=x.x,p[t+7]=x.y,p[t+8]=x.z):(u=r.normal,p[t]=u.x,p[t+1]=u.y,p[t+2]=u.z,p[t+3]=u.x,p[t+4]=u.y,p[t+5]=u.z,p[t+6]=u.x,p[t+7]=u.y,p[t+8]=u.z);f===THREE.FaceColors?(r=r.color,n[t]=r.r,n[t+1]=r.g,n[t+2]=r.b,n[t+3]=r.r,n[t+4]=r.g,n[t+5]=r.b,n[t+6]=r.r,n[t+7]=r.g,n[t+8]=r.b):f===THREE.VertexColors&&(u=r.vertexColors[0],v=r.vertexColors[1],r=r.vertexColors[2],n[t]=u.r,n[t+1]=u.g,n[t+2]=u.b,n[t+3]=
-v.r,n[t+4]=v.g,n[t+5]=v.b,n[t+6]=r.r,n[t+7]=r.g,n[t+8]=r.b);!0===g&&(r=e[0][m][0],u=e[0][m][1],v=e[0][m][2],q[s]=r.x,q[s+1]=r.y,q[s+2]=u.x,q[s+3]=u.y,q[s+4]=v.x,q[s+5]=v.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}if(void 0===
+v.r,n[t+4]=v.g,n[t+5]=v.b,n[t+6]=r.r,n[t+7]=r.g,n[t+8]=r.b);!0===g&&(r=e[0][l][0],u=e[0][l][1],v=e[0][l][2],q[s]=r.x,q[s+1]=r.y,q[s+2]=u.x,q[s+3]=u.y,q[s+4]=v.x,q[s+5]=v.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}if(void 0===
 b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&THREE.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;
 if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&THREE.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=
-this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var s=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,count:s.length,index:0}],r=0,u=t.length;r<u;++r){e=t[r].start;f=t[r].count;
-for(var v=t[r].index,d=e,e=e+f;d<e;d+=3)f=3*(v+s[d]),g=3*(v+s[d+1]),h=3*(v+s[d+2]),k.fromArray(b,f),p.fromArray(b,g),n.fromArray(b,h),q.subVectors(n,p),m.subVectors(k,p),q.cross(m),c[f]+=q.x,c[f+1]+=q.y,c[f+2]+=q.z,c[g]+=q.x,c[g+1]+=q.y,c[g+2]+=q.z,c[h]+=q.x,c[h+1]+=q.y,c[h+2]+=q.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),p.fromArray(b,d+3),n.fromArray(b,d+6),q.subVectors(n,p),m.subVectors(k,p),q.cross(m),c[d]=q.x,c[d+1]=q.y,c[d+2]=q.z,c[d+3]=q.x,c[d+4]=q.y,c[d+5]=q.z,c[d+6]=q.x,c[d+7]=q.y,
-c[d+8]=q.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q.fromArray(d,3*a);m.fromArray(d,3*b);s.fromArray(d,3*c);t.fromArray(f,2*a);r.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-q.x;x=s.x-q.x;C=m.y-q.y;w=s.y-q.y;y=m.z-q.z;A=s.z-q.z;F=r.x-t.x;G=u.x-t.x;E=r.y-t.y;z=u.y-t.y;L=1/(F*z-G*E);J.set((z*v-E*x)*L,(z*C-E*w)*L,(z*y-E*A)*L);M.set((F*x-G*v)*L,(F*w-G*C)*L,(F*A-G*y)*L);k[a].add(J);k[b].add(J);k[c].add(J);p[a].add(M);p[b].add(M);p[c].add(M)}function b(a){qa.fromArray(e,
-3*a);Q.copy(qa);pa=k[a];ma.copy(pa);ma.sub(qa.multiplyScalar(qa.dot(pa))).normalize();ca.crossVectors(Q,pa);ja=ca.dot(p[a]);ua=0>ja?-1:1;h[4*a]=ma.x;h[4*a+1]=ma.y;h[4*a+2]=ma.z;h[4*a+3]=ua}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,
-e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],p=[],n=0;n<g;n++)k[n]=new THREE.Vector3,p[n]=new THREE.Vector3;var q=new THREE.Vector3,m=new THREE.Vector3,s=new THREE.Vector3,t=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,v,x,C,w,y,A,F,G,E,z,L,J=new THREE.Vector3,M=new THREE.Vector3,K,S,O,N,P;0===this.drawcalls.length&&
-this.addDrawCall(0,c.length,0);var V=this.drawcalls,n=0;for(S=V.length;n<S;++n){K=V[n].start;O=V[n].count;var I=V[n].index,g=K;for(K+=O;g<K;g+=3)O=I+c[g],N=I+c[g+1],P=I+c[g+2],a(O,N,P)}var ma=new THREE.Vector3,ca=new THREE.Vector3,qa=new THREE.Vector3,Q=new THREE.Vector3,ua,pa,ja,n=0;for(S=V.length;n<S;++n)for(K=V[n].start,O=V[n].count,I=V[n].index,g=K,K+=O;g<K;g+=3)O=I+c[g],N=I+c[g+1],P=I+c[g+2],b(O),b(N),b(P)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;
-for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],p=0,n=0,q=new Int32Array(6),m=new Int32Array(c.length),s=new Int32Array(c.length),t=0;t<c.length;t++)m[t]=-1,s[t]=-1;for(c=0;c<d;c++){for(var r=n=0;3>r;r++)t=a[3*c+r],-1==m[t]?(q[2*r]=t,q[2*r+1]=-1,n++):m[t]<k.index?(q[2*r]=t,q[2*r+1]=-1,p++):(q[2*r]=t,q[2*r+1]=m[t]);if(g+n>k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)r=q[n+1],-1<r&&r<k.index&&(q[n+1]=
--1);for(n=0;6>n;n+=2)t=q[n],r=q[n+1],-1===r&&(r=g++),m[t]=r,s[r]=t,e[f++]=r-k.index,k.count++}this.reorderBuffers(e,s,g);return this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=
+this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,l=new THREE.Vector3;if(a.index)for(var s=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,count:s.length,index:0}],r=0,u=t.length;r<u;++r){e=t[r].start;f=t[r].count;
+for(var v=t[r].index,d=e,e=e+f;d<e;d+=3)f=3*(v+s[d]),g=3*(v+s[d+1]),h=3*(v+s[d+2]),k.fromArray(b,f),p.fromArray(b,g),n.fromArray(b,h),q.subVectors(n,p),l.subVectors(k,p),q.cross(l),c[f]+=q.x,c[f+1]+=q.y,c[f+2]+=q.z,c[g]+=q.x,c[g+1]+=q.y,c[g+2]+=q.z,c[h]+=q.x,c[h+1]+=q.y,c[h+2]+=q.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),p.fromArray(b,d+3),n.fromArray(b,d+6),q.subVectors(n,p),l.subVectors(k,p),q.cross(l),c[d]=q.x,c[d+1]=q.y,c[d+2]=q.z,c[d+3]=q.x,c[d+4]=q.y,c[d+5]=q.z,c[d+6]=q.x,c[d+7]=q.y,
+c[d+8]=q.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q.fromArray(d,3*a);l.fromArray(d,3*b);s.fromArray(d,3*c);t.fromArray(f,2*a);r.fromArray(f,2*b);u.fromArray(f,2*c);v=l.x-q.x;x=s.x-q.x;C=l.y-q.y;w=s.y-q.y;y=l.z-q.z;A=s.z-q.z;E=r.x-t.x;H=u.x-t.x;F=r.y-t.y;z=u.y-t.y;J=1/(E*z-H*F);M.set((z*v-F*x)*J,(z*C-F*w)*J,(z*y-F*A)*J);N.set((E*x-H*v)*J,(E*w-H*C)*J,(E*A-H*y)*J);k[a].add(M);k[b].add(M);k[c].add(M);p[a].add(N);p[b].add(N);p[c].add(N)}function b(a){ra.fromArray(e,
+3*a);G.copy(ra);aa=k[a];ma.copy(aa);ma.sub(ra.multiplyScalar(ra.dot(aa))).normalize();ba.crossVectors(G,aa);na=ba.dot(p[a]);Ka=0>na?-1:1;h[4*a]=ma.x;h[4*a+1]=ma.y;h[4*a+2]=ma.z;h[4*a+3]=Ka}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,
+e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],p=[],n=0;n<g;n++)k[n]=new THREE.Vector3,p[n]=new THREE.Vector3;var q=new THREE.Vector3,l=new THREE.Vector3,s=new THREE.Vector3,t=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,v,x,C,w,y,A,E,H,F,z,J,M=new THREE.Vector3,N=new THREE.Vector3,K,T,O,U,Q;0===this.drawcalls.length&&
+this.addDrawCall(0,c.length,0);var V=this.drawcalls,n=0;for(T=V.length;n<T;++n){K=V[n].start;O=V[n].count;var L=V[n].index,g=K;for(K+=O;g<K;g+=3)O=L+c[g],U=L+c[g+1],Q=L+c[g+2],a(O,U,Q)}var ma=new THREE.Vector3,ba=new THREE.Vector3,ra=new THREE.Vector3,G=new THREE.Vector3,Ka,aa,na,n=0;for(T=V.length;n<T;++n)for(K=V[n].start,O=V[n].count,L=V[n].index,g=K,K+=O;g<K;g+=3)O=L+c[g],U=L+c[g+1],Q=L+c[g+2],b(O),b(U),b(Q)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;
+for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],p=0,n=0,q=new Int32Array(6),l=new Int32Array(c.length),s=new Int32Array(c.length),t=0;t<c.length;t++)l[t]=-1,s[t]=-1;for(c=0;c<d;c++){for(var r=n=0;3>r;r++)t=a[3*c+r],-1==l[t]?(q[2*r]=t,q[2*r+1]=-1,n++):l[t]<k.index?(q[2*r]=t,q[2*r+1]=-1,p++):(q[2*r]=t,q[2*r+1]=l[t]);if(g+n>k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)r=q[n+1],-1<r&&r<k.index&&(q[n+1]=
+-1);for(n=0;6>n;n+=2)t=q[n],r=q[n+1],-1===r&&(r=g++),l[t]=r,s[r]=t,e[f++]=r-k.index,k.count++}this.reorderBuffers(e,s,g);return this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=
 this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!=e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*c));for(var f=0;f<c;f++){var g=b[f];for(e in this.attributes)if("index"!=e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,p=d[e],n=0;n<k;n++)p[f*k+n]=h[g*k+n]}this.attributes.index.array=a;
 for(e in this.attributes)"index"!=e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},b=this.attributes,c=this.offsets,d=this.boundingSphere,e;for(e in b){for(var f=b[e],g=[],h=f.array,k=0,p=h.length;k<p;k++)g[k]=h[k];a.data.attributes[e]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}0<c.length&&
 (a.data.offsets=JSON.parse(JSON.stringify(c)));null!==d&&(a.data.boundingSphere={center:d.center.toArray(),radius:d.radius});return a},clone:function(){var a=new THREE.BufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count})}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);
@@ -212,22 +212,22 @@ g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){
 0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=
 e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=
 this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<
-d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,p,n,q,m,s,t,r,u,v=[],x=[];c=new THREE.Vector3;var C=new THREE.Vector3,w=new THREE.Vector3,y=new THREE.Vector3,A=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,x[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],
-p=f[0],n=f[1],q=f[2],f=h.x-g.x,m=k.x-g.x,s=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-p.x,r=q.x-p.x,n=n.y-p.y,p=q.y-p.y,q=1/(k*p-r*n),c.set((p*f-n*m)*q,(p*s-n*t)*q,(p*h-n*g)*q),C.set((k*m-r*f)*q,(k*t-r*s)*q,(k*g-r*h)*q),v[d].add(c),v[u].add(c),v[e].add(c),x[d].add(C),x[u].add(C),x[e].add(C);C=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)A.copy(e.vertexNormals[c]),d=e[C[c]],u=v[d],w.copy(u),w.sub(A.multiplyScalar(A.dot(u))).normalize(),
+d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,p,n,q,l,s,t,r,u,v=[],x=[];c=new THREE.Vector3;var C=new THREE.Vector3,w=new THREE.Vector3,y=new THREE.Vector3,A=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,x[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],
+p=f[0],n=f[1],q=f[2],f=h.x-g.x,l=k.x-g.x,s=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-p.x,r=q.x-p.x,n=n.y-p.y,p=q.y-p.y,q=1/(k*p-r*n),c.set((p*f-n*l)*q,(p*s-n*t)*q,(p*h-n*g)*q),C.set((k*l-r*f)*q,(k*t-r*s)*q,(k*g-r*h)*q),v[d].add(c),v[u].add(c),v[e].add(c),x[d].add(C),x[u].add(C),x[e].add(C);C=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)A.copy(e.vertexNormals[c]),d=e[C[c]],u=v[d],w.copy(u),w.sub(A.multiplyScalar(A.dot(u))).normalize(),
 y.crossVectors(e.vertexNormals[c],u),d=y.dot(x[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(w.x,w.y,w.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);
-this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof THREE.Geometry)THREE.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,k=a.faces,p=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,q=g.length;n<q;n++){var m=g[n].clone();void 0!==b&&m.applyMatrix4(b);f.push(m)}n=0;for(q=k.length;n<
-q;n++){var g=k[n],s,t=g.vertexNormals,r=g.vertexColors,m=new THREE.Face3(g.a+e,g.b+e,g.c+e);m.normal.copy(g.normal);void 0!==d&&m.normal.applyMatrix3(d).normalize();b=0;for(f=t.length;b<f;b++)s=t[b].clone(),void 0!==d&&s.applyMatrix3(d).normalize(),m.vertexNormals.push(s);m.color.copy(g.color);b=0;for(f=r.length;b<f;b++)s=r[b],m.vertexColors.push(s.clone());m.materialIndex=g.materialIndex+c;h.push(m)}n=0;for(q=a.length;n<q;n++)if(c=a[n],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());
+this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof THREE.Geometry)THREE.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,k=a.faces,p=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,q=g.length;n<q;n++){var l=g[n].clone();void 0!==b&&l.applyMatrix4(b);f.push(l)}n=0;for(q=k.length;n<
+q;n++){var g=k[n],s,t=g.vertexNormals,r=g.vertexColors,l=new THREE.Face3(g.a+e,g.b+e,g.c+e);l.normal.copy(g.normal);void 0!==d&&l.normal.applyMatrix3(d).normalize();b=0;for(f=t.length;b<f;b++)s=t[b].clone(),void 0!==d&&s.applyMatrix3(d).normalize(),l.vertexNormals.push(s);l.color.copy(g.color);b=0;for(f=r.length;b<f;b++)s=r[b],l.vertexColors.push(s.clone());l.materialIndex=g.materialIndex+c;h.push(l)}n=0;for(q=a.length;n<q;n++)if(c=a[n],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());
 p.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?THREE.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<
 g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=this.vertices.length-b.length;this.vertices=b;return f},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==p[b])return p[b];p[b]=k.length/3;k.push(a.x,a.y,
-a.z);return p[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==q[b])return q[b];q[b]=n.length;n.push(a.getHex());return q[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==s[b])return s[b];s[b]=m.length/2;m.push(a.x,a.y);return s[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==
-f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],p={},n=[],q={},m=[],s={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],r=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),v=0<t.vertexNormals.length,x=1!==t.color.r||1!==t.color.g||1!==t.color.b,C=0<t.vertexColors.length,w=0,w=a(w,0,0),w=a(w,1,!1),w=a(w,2,!1),w=a(w,3,r),w=a(w,4,u),w=a(w,5,v),w=a(w,6,x),w=a(w,7,C);h.push(w);h.push(t.a,t.b,t.c);r&&(r=this.faceVertexUvs[0][g],
-h.push(d(r[0]),d(r[1]),d(r[2])));u&&h.push(b(t.normal));v&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));x&&h.push(c(t.color));C&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<n.length&&(e.data.colors=n);0<m.length&&(e.data.uvs=[m]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());c=0;
+a.z);return p[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==q[b])return q[b];q[b]=n.length;n.push(a.getHex());return q[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==s[b])return s[b];s[b]=l.length/2;l.push(a.x,a.y);return s[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==
+f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],p={},n=[],q={},l=[],s={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],r=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),v=0<t.vertexNormals.length,x=1!==t.color.r||1!==t.color.g||1!==t.color.b,C=0<t.vertexColors.length,w=0,w=a(w,0,0),w=a(w,1,!1),w=a(w,2,!1),w=a(w,3,r),w=a(w,4,u),w=a(w,5,v),w=a(w,6,x),w=a(w,7,C);h.push(w);h.push(t.a,t.b,t.c);r&&(r=this.faceVertexUvs[0][g],
+h.push(d(r[0]),d(r[1]),d(r[2])));u&&h.push(b(t.normal));v&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));x&&h.push(c(t.color));C&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<n.length&&(e.data.colors=n);0<l.length&&(e.data.uvs=[l]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());c=0;
 for(d=this.faceVertexUvs.length;c<d;c++){b=this.faceVertexUvs[c];void 0===a.faceVertexUvs[c]&&(a.faceVertexUvs[c]=[]);for(var e=0,f=b.length;e<f;e++){for(var g=b[e],h=[],k=0,p=g.length;k<p;k++)h.push(g[k].clone());a.faceVertexUvs[c].push(h)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;
 THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,-1).applyQuaternion(a)}}();
 THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};
 THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1);f.lookAt(new THREE.Vector3(0,1,0));this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new THREE.Vector3(0,-1,0));
-this.add(g);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){var c=this.renderTarget,m=c.generateMipmaps;c.generateMipmaps=!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=
-1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,f,c);c.activeCubeFace=3;a.render(b,g,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=m;c.activeCubeFace=5;a.render(b,k,c)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.CubeCamera.prototype.constructor=THREE.CubeCamera;
+this.add(g);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){var c=this.renderTarget,l=c.generateMipmaps;c.generateMipmaps=!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=
+1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,f,c);c.activeCubeFace=3;a.render(b,g,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=l;c.activeCubeFace=5;a.render(b,k,c)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.CubeCamera.prototype.constructor=THREE.CubeCamera;
 THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.type="OrthographicCamera";this.zoom=1;this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;
 THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var a=(this.right-this.left)/(2*this.zoom),b=(this.top-this.bottom)/(2*this.zoom),c=(this.right+this.left)/2,d=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(c-a,c+a,d+b,d-b,this.near,this.far)};
 THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.zoom=this.zoom;a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;a.projectionMatrix.copy(this.projectionMatrix);return a};
@@ -265,10 +265,10 @@ a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText);if(void 0!==h.metadata&&4<=h.metadata.version){console.error('THREE.JSONLoader: "'+b+'" should be loaded with THREE.ObjectLoader instead.');return}if(void 0!==h.metadata&&"scene"===h.metadata.type){THREE.error('THREE.JSONLoader: "'+b+'" seems to be a Scene. Use THREE.SceneLoader instead.');
 return}h=a.parse(h,d);c(h.geometry,h.materials)}else THREE.error('THREE.JSONLoader: "'+b+'" seems to be unreachable or the file is empty.');a.onLoadComplete()}else THREE.error("THREE.JSONLoader: Couldn't load \""+b+'" ('+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;
 f.send(null)};
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,p,n,q,m,s,t,r,u,v,x=a.faces;n=a.vertices;var C=a.normals,w=a.colors,y=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&y++;for(d=0;d<y;d++)c.faceVertexUvs[d]=[]}k=0;for(p=n.length;k<p;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(p=x.length;k<p;)if(b=x[k++],s=b&1,h=b&2,d=b&8,q=b&16,t=b&32,n=b&64,b&=128,s){s=new THREE.Face3;
-s.a=x[k];s.b=x[k+1];s.c=x[k+3];r=new THREE.Face3;r.a=x[k+1];r.b=x[k+2];r.c=x[k+3];k+=4;h&&(h=x[k++],s.materialIndex=h,r.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<y;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=x[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);q&&(q=3*x[k++],s.normal.set(C[q++],C[q++],C[q]),r.normal.copy(s.normal));if(t)for(d=0;4>d;d++)q=3*x[k++],t=new THREE.Vector3(C[q++],
-C[q++],C[q]),2!==d&&s.vertexNormals.push(t),0!==d&&r.vertexNormals.push(t);n&&(n=x[k++],n=w[n],s.color.setHex(n),r.color.setHex(n));if(b)for(d=0;4>d;d++)n=x[k++],n=w[n],2!==d&&s.vertexColors.push(new THREE.Color(n)),0!==d&&r.vertexColors.push(new THREE.Color(n));c.faces.push(s);c.faces.push(r)}else{s=new THREE.Face3;s.a=x[k++];s.b=x[k++];s.c=x[k++];h&&(h=x[k++],s.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<y;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=x[k++],v=u[2*m],m=u[2*m+1],
-v=new THREE.Vector2(v,m),c.faceVertexUvs[d][h].push(v);q&&(q=3*x[k++],s.normal.set(C[q++],C[q++],C[q]));if(t)for(d=0;3>d;d++)q=3*x[k++],t=new THREE.Vector3(C[q++],C[q++],C[q]),s.vertexNormals.push(t);n&&(n=x[k++],s.color.setHex(w[n]));if(b)for(d=0;3>d;d++)n=x[k++],s.vertexColors.push(new THREE.Color(w[n]));c.faces.push(s)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,p,n,q,l,s,t,r,u,v,x=a.faces;n=a.vertices;var C=a.normals,w=a.colors,y=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&y++;for(d=0;d<y;d++)c.faceVertexUvs[d]=[]}k=0;for(p=n.length;k<p;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(p=x.length;k<p;)if(b=x[k++],s=b&1,h=b&2,d=b&8,q=b&16,t=b&32,n=b&64,b&=128,s){s=new THREE.Face3;
+s.a=x[k];s.b=x[k+1];s.c=x[k+3];r=new THREE.Face3;r.a=x[k+1];r.b=x[k+2];r.c=x[k+3];k+=4;h&&(h=x[k++],s.materialIndex=h,r.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<y;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)l=x[k++],v=u[2*l],l=u[2*l+1],v=new THREE.Vector2(v,l),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);q&&(q=3*x[k++],s.normal.set(C[q++],C[q++],C[q]),r.normal.copy(s.normal));if(t)for(d=0;4>d;d++)q=3*x[k++],t=new THREE.Vector3(C[q++],
+C[q++],C[q]),2!==d&&s.vertexNormals.push(t),0!==d&&r.vertexNormals.push(t);n&&(n=x[k++],n=w[n],s.color.setHex(n),r.color.setHex(n));if(b)for(d=0;4>d;d++)n=x[k++],n=w[n],2!==d&&s.vertexColors.push(new THREE.Color(n)),0!==d&&r.vertexColors.push(new THREE.Color(n));c.faces.push(s);c.faces.push(r)}else{s=new THREE.Face3;s.a=x[k++];s.b=x[k++];s.c=x[k++];h&&(h=x[k++],s.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<y;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)l=x[k++],v=u[2*l],l=u[2*l+1],
+v=new THREE.Vector2(v,l),c.faceVertexUvs[d][h].push(v);q&&(q=3*x[k++],s.normal.set(C[q++],C[q++],C[q]));if(t)for(d=0;3>d;d++)q=3*x[k++],t=new THREE.Vector3(C[q++],C[q++],C[q]),s.vertexNormals.push(t);n&&(n=x[k++],s.color.setHex(w[n]));if(b)for(d=0;3>d;d++)n=x[k++],s.vertexColors.push(new THREE.Color(w[n]));c.faces.push(s)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
 1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&THREE.warn("THREE.JSONLoader: When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+
 c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,p,n;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],p=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var q=new THREE.Vector3;q.x=n[h]*b;q.y=n[h+1]*b;q.z=n[h+2]*b;p.push(q)}}if(void 0!==
 a.morphColors)for(d=0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,p=a.morphColors[d].colors,b=0,h=p.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(p[b],p[b+1],p[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,
@@ -339,21 +339,21 @@ THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CubeTex
 THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture;THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.DataTexture=function(a,b,c,d,e,f,g,h,k,p,n){THREE.Texture.call(this,null,f,g,h,k,p,d,e,n);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.constructor=THREE.DataTexture;
 THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.VideoTexture=function(a,b,c,d,e,f,g,h,k){THREE.Texture.call(this,a,b,c,d,e,f,g,h,k);this.generateMipmaps=!1;var p=this,n=function(){requestAnimationFrame(n);a.readyState===a.HAVE_ENOUGH_DATA&&(p.needsUpdate=!0)};n()};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.VideoTexture.prototype.constructor=THREE.VideoTexture;
 THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);THREE.Group.prototype.constructor=THREE.Group;THREE.PointCloud=function(a,b){THREE.Object3D.call(this);this.type="PointCloud";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()})};THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);THREE.PointCloud.prototype.constructor=THREE.PointCloud;
-THREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this,f=e.geometry,g=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===f.boundingBox||!1!==b.isIntersectionBox(f.boundingBox)){var h=g/((this.scale.x+this.scale.y+this.scale.z)/3),k=new THREE.Vector3,g=function(a,f){var g=b.distanceToPoint(a);if(g<h){var k=b.closestPointToPoint(a);k.applyMatrix4(e.matrixWorld);var m=c.ray.origin.distanceTo(k);
-d.push({distance:m,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var p=f.attributes,n=p.position.array;if(void 0!==p.index){var p=p.index.array,q=f.offsets;0===q.length&&(q=[{start:0,count:p.length,index:0}]);for(var m=0,s=q.length;m<s;++m)for(var t=q[m].start,r=q[m].index,f=t,t=t+q[m].count;f<t;f++){var u=r+p[f];k.fromArray(n,3*u);g(k,u)}}else for(p=n.length/3,f=0;f<p;f++)k.set(n[3*f],n[3*f+1],n[3*f+2]),g(k,f)}else for(k=this.geometry.vertices,
+THREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this,f=e.geometry,g=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===f.boundingBox||!1!==b.isIntersectionBox(f.boundingBox)){var h=g/((this.scale.x+this.scale.y+this.scale.z)/3),k=new THREE.Vector3,g=function(a,f){var g=b.distanceToPoint(a);if(g<h){var k=b.closestPointToPoint(a);k.applyMatrix4(e.matrixWorld);var l=c.ray.origin.distanceTo(k);
+d.push({distance:l,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var p=f.attributes,n=p.position.array;if(void 0!==p.index){var p=p.index.array,q=f.offsets;0===q.length&&(q=[{start:0,count:p.length,index:0}]);for(var l=0,s=q.length;l<s;++l)for(var t=q[l].start,r=q[l].index,f=t,t=t+q[l].count;f<t;f++){var u=r+p[f];k.fromArray(n,3*u);g(k,u)}}else for(p=n.length/3,f=0;f<p;f++)k.set(n[3*f],n[3*f+1],n[3*f+2]),g(k,f)}else for(k=this.geometry.vertices,
 f=0;f<k.length;f++)g(k[f],f)}}}();THREE.PointCloud.prototype.clone=function(a){void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.ParticleSystem=function(a,b){THREE.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};
 THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.type="Line";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()});this.mode=void 0!==c?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=Object.create(THREE.Object3D.prototype);THREE.Line.prototype.constructor=THREE.Line;
 THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,k=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3,q=this.mode===THREE.LineStrip?1:2;if(g instanceof
-THREE.BufferGeometry){var m=g.attributes;if(void 0!==m.index){var s=m.index.array,m=m.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:s.length,index:0}]);for(var r=0;r<t.length;r++)for(var u=t[r].start,v=t[r].count,x=t[r].index,g=u;g<u+v-1;g+=q){var C=x+s[g+1];h.fromArray(m,3*(x+s[g]));k.fromArray(m,3*C);C=b.distanceSqToSegment(h,k,n,p);C>f||(C=b.origin.distanceTo(n),C<d.near||C>d.far||e.push({distance:C,point:p.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:r,face:null,faceIndex:null,
-object:this}))}}else for(m=m.position.array,g=0;g<m.length/3-1;g+=q)h.fromArray(m,3*g),k.fromArray(m,3*g+3),C=b.distanceSqToSegment(h,k,n,p),C>f||(C=b.origin.distanceTo(n),C<d.near||C>d.far||e.push({distance:C,point:p.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,k=h.length,g=0;g<k-1;g+=q)C=b.distanceSqToSegment(h[g],h[g+1],n,p),C>f||(C=b.origin.distanceTo(n),C<d.near||C>d.far||e.push({distance:C,point:p.clone().applyMatrix4(this.matrixWorld),
+THREE.BufferGeometry){var l=g.attributes;if(void 0!==l.index){var s=l.index.array,l=l.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:s.length,index:0}]);for(var r=0;r<t.length;r++)for(var u=t[r].start,v=t[r].count,x=t[r].index,g=u;g<u+v-1;g+=q){var C=x+s[g+1];h.fromArray(l,3*(x+s[g]));k.fromArray(l,3*C);C=b.distanceSqToSegment(h,k,n,p);C>f||(C=b.origin.distanceTo(n),C<d.near||C>d.far||e.push({distance:C,point:p.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:r,face:null,faceIndex:null,
+object:this}))}}else for(l=l.position.array,g=0;g<l.length/3-1;g+=q)h.fromArray(l,3*g),k.fromArray(l,3*g+3),C=b.distanceSqToSegment(h,k,n,p),C>f||(C=b.origin.distanceTo(n),C<d.near||C>d.far||e.push({distance:C,point:p.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,k=h.length,g=0;g<k-1;g+=q)C=b.distanceSqToSegment(h[g],h[g+1],n,p),C>f||(C=b.origin.distanceTo(n),C<d.near||C>d.far||e.push({distance:C,point:p.clone().applyMatrix4(this.matrixWorld),
 index:g,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.mode));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
 THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];THREE.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var p=
-this.material;if(void 0!==p){var n=k.attributes,q,m,s=g.precision;if(void 0!==n.index){var t=n.index.array,r=n.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:t.length,index:0}]);for(var v=0,x=u.length;v<x;++v)for(var n=u[v].start,C=u[v].index,k=n,w=n+u[v].count;k<w;k+=3){n=C+t[k];q=C+t[k+1];m=C+t[k+2];d.fromArray(r,3*n);e.fromArray(r,3*q);f.fromArray(r,3*m);var y=p.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,p.side!==THREE.DoubleSide);if(null!==y){y.applyMatrix4(this.matrixWorld);
-var A=g.ray.origin.distanceTo(y);A<s||A<g.near||A>g.far||h.push({distance:A,point:y,face:new THREE.Face3(n,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(r=n.position.array,t=k=0,w=r.length;k<w;k+=3,t+=9)n=k,q=k+1,m=k+2,d.fromArray(r,t),e.fromArray(r,t+3),f.fromArray(r,t+6),y=p.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,p.side!==THREE.DoubleSide),null!==y&&(y.applyMatrix4(this.matrixWorld),A=g.ray.origin.distanceTo(y),A<s||A<g.near||A>
-g.far||h.push({distance:A,point:y,face:new THREE.Face3(n,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,r=!0===t?this.material.materials:null,s=g.precision,u=k.vertices,v=0,x=k.faces.length;v<x;v++)if(C=k.faces[v],p=!0===t?r[C.materialIndex]:this.material,void 0!==p){n=u[C.a];q=u[C.b];m=u[C.c];if(!0===p.morphTargets){y=k.morphTargets;A=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
-0,0);for(var w=0,F=y.length;w<F;w++){var G=A[w];if(0!==G){var E=y[w].vertices;d.x+=(E[C.a].x-n.x)*G;d.y+=(E[C.a].y-n.y)*G;d.z+=(E[C.a].z-n.z)*G;e.x+=(E[C.b].x-q.x)*G;e.y+=(E[C.b].y-q.y)*G;e.z+=(E[C.b].z-q.z)*G;f.x+=(E[C.c].x-m.x)*G;f.y+=(E[C.c].y-m.y)*G;f.z+=(E[C.c].z-m.z)*G}}d.add(n);e.add(q);f.add(m);n=d;q=e;m=f}y=p.side===THREE.BackSide?b.intersectTriangle(m,q,n,!0):b.intersectTriangle(n,q,m,p.side!==THREE.DoubleSide);null!==y&&(y.applyMatrix4(this.matrixWorld),A=g.ray.origin.distanceTo(y),A<s||
+this.material;if(void 0!==p){var n=k.attributes,q,l,s=g.precision;if(void 0!==n.index){var t=n.index.array,r=n.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:t.length,index:0}]);for(var v=0,x=u.length;v<x;++v)for(var n=u[v].start,C=u[v].index,k=n,w=n+u[v].count;k<w;k+=3){n=C+t[k];q=C+t[k+1];l=C+t[k+2];d.fromArray(r,3*n);e.fromArray(r,3*q);f.fromArray(r,3*l);var y=p.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,p.side!==THREE.DoubleSide);if(null!==y){y.applyMatrix4(this.matrixWorld);
+var A=g.ray.origin.distanceTo(y);A<s||A<g.near||A>g.far||h.push({distance:A,point:y,face:new THREE.Face3(n,q,l,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(r=n.position.array,t=k=0,w=r.length;k<w;k+=3,t+=9)n=k,q=k+1,l=k+2,d.fromArray(r,t),e.fromArray(r,t+3),f.fromArray(r,t+6),y=p.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,p.side!==THREE.DoubleSide),null!==y&&(y.applyMatrix4(this.matrixWorld),A=g.ray.origin.distanceTo(y),A<s||A<g.near||A>
+g.far||h.push({distance:A,point:y,face:new THREE.Face3(n,q,l,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,r=!0===t?this.material.materials:null,s=g.precision,u=k.vertices,v=0,x=k.faces.length;v<x;v++)if(C=k.faces[v],p=!0===t?r[C.materialIndex]:this.material,void 0!==p){n=u[C.a];q=u[C.b];l=u[C.c];if(!0===p.morphTargets){y=k.morphTargets;A=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
+0,0);for(var w=0,E=y.length;w<E;w++){var H=A[w];if(0!==H){var F=y[w].vertices;d.x+=(F[C.a].x-n.x)*H;d.y+=(F[C.a].y-n.y)*H;d.z+=(F[C.a].z-n.z)*H;e.x+=(F[C.b].x-q.x)*H;e.y+=(F[C.b].y-q.y)*H;e.z+=(F[C.b].z-q.z)*H;f.x+=(F[C.c].x-l.x)*H;f.y+=(F[C.c].y-l.y)*H;f.z+=(F[C.c].z-l.z)*H}}d.add(n);e.add(q);f.add(l);n=d;q=e;l=f}y=p.side===THREE.BackSide?b.intersectTriangle(l,q,n,!0):b.intersectTriangle(n,q,l,p.side!==THREE.DoubleSide);null!==y&&(y.applyMatrix4(this.matrixWorld),A=g.ray.origin.distanceTo(y),A<s||
 A<g.near||A>g.far||h.push({distance:A,point:y,face:C,faceIndex:v,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;
 THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),
 this.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):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(THREE.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};
@@ -437,205 +437,205 @@ THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main(
 THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,
 "}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",
 THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}};
-THREE.WebGLRenderer=function(a){function b(a){var b=a.geometry;a=a.material;var c=b.vertices.length;if(a.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var d in a.attributes){var e=a.attributes[d];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var f=1;"v2"===e.type?f=2:"v3"===e.type?f=3:"v4"===e.type?f=4:"c"===e.type&&(f=3);e.size=f;e.array=new Float32Array(c*f);e.buffer=l.createBuffer();e.buffer.belongsToAttribute=d;e.needsUpdate=
-!0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function d(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var h=0,k=b.length;h<k;h++){var m=b[h],p=e[m];if(0<=p){var n=c[m];void 0!==n?(m=n.itemSize,l.bindBuffer(l.ARRAY_BUFFER,n.buffer),f(p),l.vertexAttribPointer(p,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(p,
-a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(p,a.defaultAttributeValues[m]))}}g()}function e(){for(var a=0,b=ob.length;a<b;a++)ob[a]=0}function f(a){ob[a]=1;0===Qa[a]&&(l.enableVertexAttribArray(a),Qa[a]=1)}function g(){for(var a=0,b=Qa.length;a<b;a++)Qa[a]!==ob[a]&&(l.disableVertexAttribArray(a),Qa[a]=0)}function h(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-
-b.z:a.id-b.id}function k(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function p(a,b){return b[0]-a[0]}function n(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group)){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",kc));var c=a.geometry;if(void 0!==c&&void 0===c.__webglInit)if(c.__webglInit=!0,c.addEventListener("dispose",lc),
-c instanceof THREE.BufferGeometry)B.info.memory.geometries++;else if(a instanceof THREE.Mesh)t(a,c);else if(a instanceof THREE.Line){if(void 0===c.__webglVertexBuffer){c.__webglVertexBuffer=l.createBuffer();c.__webglColorBuffer=l.createBuffer();c.__webglLineDistanceBuffer=l.createBuffer();B.info.memory.geometries++;var d=c.vertices.length;c.__vertexArray=new Float32Array(3*d);c.__colorArray=new Float32Array(3*d);c.__lineDistanceArray=new Float32Array(1*d);c.__webglLineCount=d;b(a);c.verticesNeedUpdate=
-!0;c.colorsNeedUpdate=!0;c.lineDistancesNeedUpdate=!0}}else a instanceof THREE.PointCloud&&void 0===c.__webglVertexBuffer&&(c.__webglVertexBuffer=l.createBuffer(),c.__webglColorBuffer=l.createBuffer(),B.info.memory.geometries++,d=c.vertices.length,c.__vertexArray=new Float32Array(3*d),c.__colorArray=new Float32Array(3*d),c.__sortArray=[],c.__webglParticleCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0);if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh)if(c instanceof
-THREE.BufferGeometry)r(ya,c,a);else{if(c instanceof THREE.Geometry)for(var c=fb[c.id],d=0,e=c.length;d<e;d++)r(ya,c[d],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?r(ya,c,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&Ma.push({id:null,object:a,opaque:null,transparent:null,z:0});if(a instanceof THREE.Light)xa.push(a);else if(a instanceof THREE.Sprite)Da.push(a);else if(a instanceof THREE.LensFlare)pb.push(a);else if((c=ya[a.id])&&(!1===a.frustumCulled||
-!0===hb.intersectsObject(a)))for(d=0,e=c.length;d<e;d++){var f=c[d],g=f,h=g.object,k=g.buffer,m=h.geometry,h=h.material;h instanceof THREE.MeshFaceMaterial?(h=h.materials[m instanceof THREE.BufferGeometry?0:k.materialIndex],g.material=h,h.transparent?Ra.push(g):Ea.push(g)):h&&(g.material=h,h.transparent?Ra.push(g):Ea.push(g));f.render=!0;!0===B.sortObjects&&(Aa.setFromMatrixPosition(a.matrixWorld),Aa.applyProjection(ub),f.z=Aa.z)}}d=0;for(e=a.children.length;d<e;d++)n(a.children[d])}}function q(a,
-b,c,d,e,f){for(var g,h=0,l=a.length;h<l;h++){g=a[h];var k=g.object,m=g.buffer;A(k,b);if(f)g=f;else{g=g.material;if(!g)continue;e&&B.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst,g.blendEquationAlpha,g.blendSrcAlpha,g.blendDstAlpha);B.setDepthTest(g.depthTest);B.setDepthWrite(g.depthWrite);E(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}B.setMaterialFaces(g);m instanceof THREE.BufferGeometry?B.renderBufferDirect(b,c,d,g,m,k):B.renderBuffer(b,c,d,g,m,k)}}function m(a,b,
-c,d,e,f,g){for(var h,l=0,k=a.length;l<k;l++){h=a[l];var m=h.object;if(m.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&B.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst,h.blendEquationAlpha,h.blendSrcAlpha,h.blendDstAlpha);B.setDepthTest(h.depthTest);B.setDepthWrite(h.depthWrite);E(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}B.renderImmediateObject(c,d,e,h,m)}}}function s(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=
-null)}function t(a,b){var d=a.material,e=!1;if(void 0===fb[b.id]||!0===b.groupsNeedUpdate){delete ya[a.id];for(var f=fb,g=b.id,d=d instanceof THREE.MeshFaceMaterial,h=aa.get("OES_element_index_uint")?4294967296:65535,k,e={},m=b.morphTargets.length,p=b.morphNormals.length,n,q={},s=[],t=0,u=b.faces.length;t<u;t++){k=b.faces[t];var v=d?k.materialIndex:0;v in e||(e[v]={hash:v,counter:0});k=e[v].hash+"_"+e[v].counter;k in q||(n={id:mc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:p},
-q[k]=n,s.push(n));q[k].vertices+3>h&&(e[v].counter+=1,k=e[v].hash+"_"+e[v].counter,k in q||(n={id:mc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:p},q[k]=n,s.push(n)));q[k].faces3.push(t);q[k].vertices+=3}f[g]=s;b.groupsNeedUpdate=!1}f=fb[b.id];g=0;for(d=f.length;g<d;g++){h=f[g];if(void 0===h.__webglVertexBuffer){e=h;e.__webglVertexBuffer=l.createBuffer();e.__webglNormalBuffer=l.createBuffer();e.__webglTangentBuffer=l.createBuffer();e.__webglColorBuffer=l.createBuffer();
-e.__webglUVBuffer=l.createBuffer();e.__webglUV2Buffer=l.createBuffer();e.__webglSkinIndicesBuffer=l.createBuffer();e.__webglSkinWeightsBuffer=l.createBuffer();e.__webglFaceBuffer=l.createBuffer();e.__webglLineBuffer=l.createBuffer();if(p=e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],m=0;m<p;m++)e.__webglMorphTargetsBuffers.push(l.createBuffer());if(p=e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],m=0;m<p;m++)e.__webglMorphNormalsBuffers.push(l.createBuffer());B.info.memory.geometries++;
-e=h;t=a;u=t.geometry;p=e.faces3;m=3*p.length;q=1*p.length;s=3*p.length;p=c(t,e);e.__vertexArray=new Float32Array(3*m);e.__normalArray=new Float32Array(3*m);e.__colorArray=new Float32Array(3*m);e.__uvArray=new Float32Array(2*m);1<u.faceVertexUvs.length&&(e.__uv2Array=new Float32Array(2*m));u.hasTangents&&(e.__tangentArray=new Float32Array(4*m));t.geometry.skinWeights.length&&t.geometry.skinIndices.length&&(e.__skinIndexArray=new Float32Array(4*m),e.__skinWeightArray=new Float32Array(4*m));t=null!==
-aa.get("OES_element_index_uint")&&21845<q?Uint32Array:Uint16Array;e.__typeArray=t;e.__faceArray=new t(3*q);e.__lineArray=new t(2*s);if(u=e.numMorphTargets)for(e.__morphTargetsArrays=[],t=0;t<u;t++)e.__morphTargetsArrays.push(new Float32Array(3*m));if(u=e.numMorphNormals)for(e.__morphNormalsArrays=[],t=0;t<u;t++)e.__morphNormalsArrays.push(new Float32Array(3*m));e.__webglFaceCount=3*q;e.__webglLineCount=2*s;if(p.attributes)for(q in void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=
-[]),q=void 0,p.attributes){var s=p.attributes[q],t={},w;for(w in s)t[w]=s[w];if(!t.__webglInitialized||t.createUniqueBuffers)t.__webglInitialized=!0,u=1,"v2"===t.type?u=2:"v3"===t.type?u=3:"v4"===t.type?u=4:"c"===t.type&&(u=3),t.size=u,t.array=new Float32Array(m*u),t.buffer=l.createBuffer(),t.buffer.belongsToAttribute=q,s.needsUpdate=!0,t.__original=s;e.__webglCustomAttributesList.push(t)}e.__inittedArrays=!0;b.verticesNeedUpdate=!0;b.morphTargetsNeedUpdate=!0;b.elementsNeedUpdate=!0;b.uvsNeedUpdate=
-!0;b.normalsNeedUpdate=!0;b.tangentsNeedUpdate=!0;e=b.colorsNeedUpdate=!0}else e=!1;(e||void 0===a.__webglActive)&&r(ya,h,a)}a.__webglActive=!0}function r(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function u(a){var b=a.geometry;if(b instanceof THREE.BufferGeometry)for(var d=b.attributes,e=b.attributesKeys,f=0,g=e.length;f<g;f++){var h=e[f],k=d[h],m="index"===h?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;void 0===k.buffer?(k.buffer=l.createBuffer(),l.bindBuffer(m,
-k.buffer),l.bufferData(m,k.array,k instanceof THREE.DynamicBufferAttribute?l.DYNAMIC_DRAW:l.STATIC_DRAW),k.needsUpdate=!1):!0===k.needsUpdate&&(l.bindBuffer(m,k.buffer),void 0===k.updateRange||-1===k.updateRange.count?l.bufferSubData(m,0,k.array):0===k.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(l.bufferSubData(m,k.updateRange.offset*
-k.array.BYTES_PER_ELEMENT,k.array.subarray(k.updateRange.offset,k.updateRange.offset+k.updateRange.count)),k.updateRange.count=0),k.needsUpdate=!1)}else if(a instanceof THREE.Mesh){!0===b.groupsNeedUpdate&&t(a,b);for(var p=fb[b.id],f=0,n=p.length;f<n;f++){var q=p[f],r=c(a,q),s=r.attributes&&v(r);if(b.verticesNeedUpdate||b.morphTargetsNeedUpdate||b.elementsNeedUpdate||b.uvsNeedUpdate||b.normalsNeedUpdate||b.colorsNeedUpdate||b.tangentsNeedUpdate||s){var u=q,w=a,C=l.DYNAMIC_DRAW,A=!b.dynamic,F=r;if(u.__inittedArrays){var G=
-F&&void 0!==F.shading&&F.shading===THREE.SmoothShading,y=void 0,z=void 0,E=void 0,B=void 0,L=void 0,P=void 0,O=void 0,K=void 0,M=void 0,S=void 0,Q=void 0,J=void 0,I=void 0,N=void 0,V=void 0,ta=void 0,ya=void 0,Ma=void 0,xa=void 0,aa=void 0,Ea=void 0,ca=void 0,Da=void 0,Ra=void 0,ga=void 0,R=void 0,la=void 0,fa=void 0,ja=void 0,X=void 0,pb=void 0,pa=void 0,ma=void 0,cb=void 0,Fa=void 0,Aa=void 0,Ga=void 0,Xa=void 0,ka=void 0,qa=void 0,Sa=0,Ta=0,qb=0,ua=0,La=0,Ya=0,Ba=0,ib=0,Na=0,ha=0,na=0,H=0,za=void 0,
-Za=u.__vertexArray,Qa=u.__uvArray,rb=u.__uv2Array,Ua=u.__normalArray,oa=u.__tangentArray,Ha=u.__colorArray,Ia=u.__skinIndexArray,Ja=u.__skinWeightArray,nc=u.__morphTargetsArrays,Ab=u.__morphNormalsArrays,sb=u.__webglCustomAttributesList,D=void 0,ab=u.__faceArray,$a=u.__lineArray,ba=w.geometry,jb=ba.elementsNeedUpdate,xb=ba.uvsNeedUpdate,Fb=ba.normalsNeedUpdate,ob=ba.tangentsNeedUpdate,Nb=ba.colorsNeedUpdate,vb=ba.morphTargetsNeedUpdate,Bb=ba.vertices,Z=u.faces3,va=ba.faces,Ib=ba.faceVertexUvs[0],
-Va=ba.faceVertexUvs[1],gb=ba.skinIndices,Ka=ba.skinWeights,tb=ba.morphTargets,Gb=ba.morphNormals;if(ba.verticesNeedUpdate){y=0;for(z=Z.length;y<z;y++)B=va[Z[y]],J=Bb[B.a],I=Bb[B.b],N=Bb[B.c],Za[Ta]=J.x,Za[Ta+1]=J.y,Za[Ta+2]=J.z,Za[Ta+3]=I.x,Za[Ta+4]=I.y,Za[Ta+5]=I.z,Za[Ta+6]=N.x,Za[Ta+7]=N.y,Za[Ta+8]=N.z,Ta+=9;l.bindBuffer(l.ARRAY_BUFFER,u.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,Za,C)}if(vb)for(Fa=0,Aa=tb.length;Fa<Aa;Fa++){y=na=0;for(z=Z.length;y<z;y++)ka=Z[y],B=va[ka],J=tb[Fa].vertices[B.a],
-I=tb[Fa].vertices[B.b],N=tb[Fa].vertices[B.c],Ga=nc[Fa],Ga[na]=J.x,Ga[na+1]=J.y,Ga[na+2]=J.z,Ga[na+3]=I.x,Ga[na+4]=I.y,Ga[na+5]=I.z,Ga[na+6]=N.x,Ga[na+7]=N.y,Ga[na+8]=N.z,F.morphNormals&&(G?(qa=Gb[Fa].vertexNormals[ka],Ma=qa.a,xa=qa.b,aa=qa.c):aa=xa=Ma=Gb[Fa].faceNormals[ka],Xa=Ab[Fa],Xa[na]=Ma.x,Xa[na+1]=Ma.y,Xa[na+2]=Ma.z,Xa[na+3]=xa.x,Xa[na+4]=xa.y,Xa[na+5]=xa.z,Xa[na+6]=aa.x,Xa[na+7]=aa.y,Xa[na+8]=aa.z),na+=9;l.bindBuffer(l.ARRAY_BUFFER,u.__webglMorphTargetsBuffers[Fa]);l.bufferData(l.ARRAY_BUFFER,
-nc[Fa],C);F.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,u.__webglMorphNormalsBuffers[Fa]),l.bufferData(l.ARRAY_BUFFER,Ab[Fa],C))}if(Ka.length){y=0;for(z=Z.length;y<z;y++)B=va[Z[y]],Ra=Ka[B.a],ga=Ka[B.b],R=Ka[B.c],Ja[ha]=Ra.x,Ja[ha+1]=Ra.y,Ja[ha+2]=Ra.z,Ja[ha+3]=Ra.w,Ja[ha+4]=ga.x,Ja[ha+5]=ga.y,Ja[ha+6]=ga.z,Ja[ha+7]=ga.w,Ja[ha+8]=R.x,Ja[ha+9]=R.y,Ja[ha+10]=R.z,Ja[ha+11]=R.w,la=gb[B.a],fa=gb[B.b],ja=gb[B.c],Ia[ha]=la.x,Ia[ha+1]=la.y,Ia[ha+2]=la.z,Ia[ha+3]=la.w,Ia[ha+4]=fa.x,Ia[ha+5]=fa.y,Ia[ha+6]=fa.z,
-Ia[ha+7]=fa.w,Ia[ha+8]=ja.x,Ia[ha+9]=ja.y,Ia[ha+10]=ja.z,Ia[ha+11]=ja.w,ha+=12;0<ha&&(l.bindBuffer(l.ARRAY_BUFFER,u.__webglSkinIndicesBuffer),l.bufferData(l.ARRAY_BUFFER,Ia,C),l.bindBuffer(l.ARRAY_BUFFER,u.__webglSkinWeightsBuffer),l.bufferData(l.ARRAY_BUFFER,Ja,C))}if(Nb){y=0;for(z=Z.length;y<z;y++)B=va[Z[y]],O=B.vertexColors,K=B.color,3===O.length&&F.vertexColors===THREE.VertexColors?(Ea=O[0],ca=O[1],Da=O[2]):Da=ca=Ea=K,Ha[Na]=Ea.r,Ha[Na+1]=Ea.g,Ha[Na+2]=Ea.b,Ha[Na+3]=ca.r,Ha[Na+4]=ca.g,Ha[Na+5]=
-ca.b,Ha[Na+6]=Da.r,Ha[Na+7]=Da.g,Ha[Na+8]=Da.b,Na+=9;0<Na&&(l.bindBuffer(l.ARRAY_BUFFER,u.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,Ha,C))}if(ob&&ba.hasTangents){y=0;for(z=Z.length;y<z;y++)B=va[Z[y]],M=B.vertexTangents,V=M[0],ta=M[1],ya=M[2],oa[Ba]=V.x,oa[Ba+1]=V.y,oa[Ba+2]=V.z,oa[Ba+3]=V.w,oa[Ba+4]=ta.x,oa[Ba+5]=ta.y,oa[Ba+6]=ta.z,oa[Ba+7]=ta.w,oa[Ba+8]=ya.x,oa[Ba+9]=ya.y,oa[Ba+10]=ya.z,oa[Ba+11]=ya.w,Ba+=12;l.bindBuffer(l.ARRAY_BUFFER,u.__webglTangentBuffer);l.bufferData(l.ARRAY_BUFFER,oa,
-C)}if(Fb){y=0;for(z=Z.length;y<z;y++)if(B=va[Z[y]],L=B.vertexNormals,P=B.normal,3===L.length&&G)for(X=0;3>X;X++)pa=L[X],Ua[Ya]=pa.x,Ua[Ya+1]=pa.y,Ua[Ya+2]=pa.z,Ya+=3;else for(X=0;3>X;X++)Ua[Ya]=P.x,Ua[Ya+1]=P.y,Ua[Ya+2]=P.z,Ya+=3;l.bindBuffer(l.ARRAY_BUFFER,u.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,Ua,C)}if(xb&&Ib){y=0;for(z=Z.length;y<z;y++)if(E=Z[y],S=Ib[E],void 0!==S)for(X=0;3>X;X++)ma=S[X],Qa[qb]=ma.x,Qa[qb+1]=ma.y,qb+=2;0<qb&&(l.bindBuffer(l.ARRAY_BUFFER,u.__webglUVBuffer),l.bufferData(l.ARRAY_BUFFER,
-Qa,C))}if(xb&&Va){y=0;for(z=Z.length;y<z;y++)if(E=Z[y],Q=Va[E],void 0!==Q)for(X=0;3>X;X++)cb=Q[X],rb[ua]=cb.x,rb[ua+1]=cb.y,ua+=2;0<ua&&(l.bindBuffer(l.ARRAY_BUFFER,u.__webglUV2Buffer),l.bufferData(l.ARRAY_BUFFER,rb,C))}if(jb){y=0;for(z=Z.length;y<z;y++)ab[La]=Sa,ab[La+1]=Sa+1,ab[La+2]=Sa+2,La+=3,$a[ib]=Sa,$a[ib+1]=Sa+1,$a[ib+2]=Sa,$a[ib+3]=Sa+2,$a[ib+4]=Sa+1,$a[ib+5]=Sa+2,ib+=6,Sa+=3;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u.__webglFaceBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,ab,C);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
-u.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,$a,C)}if(sb)for(X=0,pb=sb.length;X<pb;X++)if(D=sb[X],D.__original.needsUpdate){H=0;if(1===D.size)if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=0,z=Z.length;y<z;y++)B=va[Z[y]],D.array[H]=D.value[B.a],D.array[H+1]=D.value[B.b],D.array[H+2]=D.value[B.c],H+=3;else{if("faces"===D.boundTo)for(y=0,z=Z.length;y<z;y++)za=D.value[Z[y]],D.array[H]=za,D.array[H+1]=za,D.array[H+2]=za,H+=3}else if(2===D.size)if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=
-0,z=Z.length;y<z;y++)B=va[Z[y]],J=D.value[B.a],I=D.value[B.b],N=D.value[B.c],D.array[H]=J.x,D.array[H+1]=J.y,D.array[H+2]=I.x,D.array[H+3]=I.y,D.array[H+4]=N.x,D.array[H+5]=N.y,H+=6;else{if("faces"===D.boundTo)for(y=0,z=Z.length;y<z;y++)N=I=J=za=D.value[Z[y]],D.array[H]=J.x,D.array[H+1]=J.y,D.array[H+2]=I.x,D.array[H+3]=I.y,D.array[H+4]=N.x,D.array[H+5]=N.y,H+=6}else if(3===D.size){var U;U="c"===D.type?["r","g","b"]:["x","y","z"];if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=0,z=Z.length;y<
-z;y++)B=va[Z[y]],J=D.value[B.a],I=D.value[B.b],N=D.value[B.c],D.array[H]=J[U[0]],D.array[H+1]=J[U[1]],D.array[H+2]=J[U[2]],D.array[H+3]=I[U[0]],D.array[H+4]=I[U[1]],D.array[H+5]=I[U[2]],D.array[H+6]=N[U[0]],D.array[H+7]=N[U[1]],D.array[H+8]=N[U[2]],H+=9;else if("faces"===D.boundTo)for(y=0,z=Z.length;y<z;y++)N=I=J=za=D.value[Z[y]],D.array[H]=J[U[0]],D.array[H+1]=J[U[1]],D.array[H+2]=J[U[2]],D.array[H+3]=I[U[0]],D.array[H+4]=I[U[1]],D.array[H+5]=I[U[2]],D.array[H+6]=N[U[0]],D.array[H+7]=N[U[1]],D.array[H+
-8]=N[U[2]],H+=9;else if("faceVertices"===D.boundTo)for(y=0,z=Z.length;y<z;y++)za=D.value[Z[y]],J=za[0],I=za[1],N=za[2],D.array[H]=J[U[0]],D.array[H+1]=J[U[1]],D.array[H+2]=J[U[2]],D.array[H+3]=I[U[0]],D.array[H+4]=I[U[1]],D.array[H+5]=I[U[2]],D.array[H+6]=N[U[0]],D.array[H+7]=N[U[1]],D.array[H+8]=N[U[2]],H+=9}else if(4===D.size)if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=0,z=Z.length;y<z;y++)B=va[Z[y]],J=D.value[B.a],I=D.value[B.b],N=D.value[B.c],D.array[H]=J.x,D.array[H+1]=J.y,D.array[H+
-2]=J.z,D.array[H+3]=J.w,D.array[H+4]=I.x,D.array[H+5]=I.y,D.array[H+6]=I.z,D.array[H+7]=I.w,D.array[H+8]=N.x,D.array[H+9]=N.y,D.array[H+10]=N.z,D.array[H+11]=N.w,H+=12;else if("faces"===D.boundTo)for(y=0,z=Z.length;y<z;y++)N=I=J=za=D.value[Z[y]],D.array[H]=J.x,D.array[H+1]=J.y,D.array[H+2]=J.z,D.array[H+3]=J.w,D.array[H+4]=I.x,D.array[H+5]=I.y,D.array[H+6]=I.z,D.array[H+7]=I.w,D.array[H+8]=N.x,D.array[H+9]=N.y,D.array[H+10]=N.z,D.array[H+11]=N.w,H+=12;else if("faceVertices"===D.boundTo)for(y=0,z=
-Z.length;y<z;y++)za=D.value[Z[y]],J=za[0],I=za[1],N=za[2],D.array[H]=J.x,D.array[H+1]=J.y,D.array[H+2]=J.z,D.array[H+3]=J.w,D.array[H+4]=I.x,D.array[H+5]=I.y,D.array[H+6]=I.z,D.array[H+7]=I.w,D.array[H+8]=N.x,D.array[H+9]=N.y,D.array[H+10]=N.z,D.array[H+11]=N.w,H+=12;l.bindBuffer(l.ARRAY_BUFFER,D.buffer);l.bufferData(l.ARRAY_BUFFER,D.array,C)}A&&(delete u.__inittedArrays,delete u.__colorArray,delete u.__normalArray,delete u.__tangentArray,delete u.__uvArray,delete u.__uv2Array,delete u.__faceArray,
-delete u.__vertexArray,delete u.__lineArray,delete u.__skinIndexArray,delete u.__skinWeightArray)}}}b.verticesNeedUpdate=!1;b.morphTargetsNeedUpdate=!1;b.elementsNeedUpdate=!1;b.uvsNeedUpdate=!1;b.normalsNeedUpdate=!1;b.colorsNeedUpdate=!1;b.tangentsNeedUpdate=!1;r.attributes&&x(r)}else if(a instanceof THREE.Line){r=c(a,b);s=r.attributes&&v(r);if(b.verticesNeedUpdate||b.colorsNeedUpdate||b.lineDistancesNeedUpdate||s){var Cb=l.DYNAMIC_DRAW,T,$,Y,Ca,W,Db,Vb=b.vertices,Jb=b.colors,kb=b.lineDistances,
-wa=Vb.length,yb=Jb.length,mb=kb.length,bb=b.__vertexArray,wb=b.__colorArray,lb=b.__lineDistanceArray,nb=b.colorsNeedUpdate,Eb=b.lineDistancesNeedUpdate,Wb=b.__webglCustomAttributesList,Kb,Wa,ra,Lb,Oa,da;if(b.verticesNeedUpdate){for(T=0;T<wa;T++)Ca=Vb[T],W=3*T,bb[W]=Ca.x,bb[W+1]=Ca.y,bb[W+2]=Ca.z;l.bindBuffer(l.ARRAY_BUFFER,b.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,bb,Cb)}if(nb){for($=0;$<yb;$++)Db=Jb[$],W=3*$,wb[W]=Db.r,wb[W+1]=Db.g,wb[W+2]=Db.b;l.bindBuffer(l.ARRAY_BUFFER,b.__webglColorBuffer);
-l.bufferData(l.ARRAY_BUFFER,wb,Cb)}if(Eb){for(Y=0;Y<mb;Y++)lb[Y]=kb[Y];l.bindBuffer(l.ARRAY_BUFFER,b.__webglLineDistanceBuffer);l.bufferData(l.ARRAY_BUFFER,lb,Cb)}if(Wb)for(Kb=0,Wa=Wb.length;Kb<Wa;Kb++)if(da=Wb[Kb],da.needsUpdate&&(void 0===da.boundTo||"vertices"===da.boundTo)){W=0;Lb=da.value.length;if(1===da.size)for(ra=0;ra<Lb;ra++)da.array[ra]=da.value[ra];else if(2===da.size)for(ra=0;ra<Lb;ra++)Oa=da.value[ra],da.array[W]=Oa.x,da.array[W+1]=Oa.y,W+=2;else if(3===da.size)if("c"===da.type)for(ra=
-0;ra<Lb;ra++)Oa=da.value[ra],da.array[W]=Oa.r,da.array[W+1]=Oa.g,da.array[W+2]=Oa.b,W+=3;else for(ra=0;ra<Lb;ra++)Oa=da.value[ra],da.array[W]=Oa.x,da.array[W+1]=Oa.y,da.array[W+2]=Oa.z,W+=3;else if(4===da.size)for(ra=0;ra<Lb;ra++)Oa=da.value[ra],da.array[W]=Oa.x,da.array[W+1]=Oa.y,da.array[W+2]=Oa.z,da.array[W+3]=Oa.w,W+=4;l.bindBuffer(l.ARRAY_BUFFER,da.buffer);l.bufferData(l.ARRAY_BUFFER,da.array,Cb);da.needsUpdate=!1}}b.verticesNeedUpdate=!1;b.colorsNeedUpdate=!1;b.lineDistancesNeedUpdate=!1;r.attributes&&
-x(r)}else if(a instanceof THREE.PointCloud){r=c(a,b);s=r.attributes&&v(r);if(b.verticesNeedUpdate||b.colorsNeedUpdate||s){var eb=l.DYNAMIC_DRAW,Xb,Yb,bc,ia,cc,hb=b.vertices,ub=hb.length,Ob=b.colors,Zb=Ob.length,dc=b.__vertexArray,ec=b.__colorArray,$b=b.colorsNeedUpdate,Hb=b.__webglCustomAttributesList,fc,zb,sa,Mb,Pa,ea;if(b.verticesNeedUpdate){for(Xb=0;Xb<ub;Xb++)bc=hb[Xb],ia=3*Xb,dc[ia]=bc.x,dc[ia+1]=bc.y,dc[ia+2]=bc.z;l.bindBuffer(l.ARRAY_BUFFER,b.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,
-dc,eb)}if($b){for(Yb=0;Yb<Zb;Yb++)cc=Ob[Yb],ia=3*Yb,ec[ia]=cc.r,ec[ia+1]=cc.g,ec[ia+2]=cc.b;l.bindBuffer(l.ARRAY_BUFFER,b.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,ec,eb)}if(Hb)for(fc=0,zb=Hb.length;fc<zb;fc++){ea=Hb[fc];if(ea.needsUpdate&&(void 0===ea.boundTo||"vertices"===ea.boundTo))if(Mb=ea.value.length,ia=0,1===ea.size)for(sa=0;sa<Mb;sa++)ea.array[sa]=ea.value[sa];else if(2===ea.size)for(sa=0;sa<Mb;sa++)Pa=ea.value[sa],ea.array[ia]=Pa.x,ea.array[ia+1]=Pa.y,ia+=2;else if(3===ea.size)if("c"===
-ea.type)for(sa=0;sa<Mb;sa++)Pa=ea.value[sa],ea.array[ia]=Pa.r,ea.array[ia+1]=Pa.g,ea.array[ia+2]=Pa.b,ia+=3;else for(sa=0;sa<Mb;sa++)Pa=ea.value[sa],ea.array[ia]=Pa.x,ea.array[ia+1]=Pa.y,ea.array[ia+2]=Pa.z,ia+=3;else if(4===ea.size)for(sa=0;sa<Mb;sa++)Pa=ea.value[sa],ea.array[ia]=Pa.x,ea.array[ia+1]=Pa.y,ea.array[ia+2]=Pa.z,ea.array[ia+3]=Pa.w,ia+=4;l.bindBuffer(l.ARRAY_BUFFER,ea.buffer);l.bufferData(l.ARRAY_BUFFER,ea.array,eb);ea.needsUpdate=!1}}b.verticesNeedUpdate=!1;b.colorsNeedUpdate=!1;r.attributes&&
-x(r)}}function v(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function x(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function C(a,b,c,d,e){var f,g,h,k;Nb=0;if(d.needsUpdate){d.program&&oc(d);d.addEventListener("dispose",pc);var m=Fc[d.type];if(m){var p=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(p.uniforms),vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,
-fragmentShader:d.fragmentShader};for(var n=0,q=0,r=0,t=0,s=0,u=b.length;s<u;s++){var v=b[s];v.onlyShadow||!1===v.visible||(v instanceof THREE.DirectionalLight&&n++,v instanceof THREE.PointLight&&q++,v instanceof THREE.SpotLight&&r++,v instanceof THREE.HemisphereLight&&t++)}f=n;g=q;h=r;k=t;for(var x,C=0,A=0,G=b.length;A<G;A++){var E=b[A];E.castShadow&&(E instanceof THREE.SpotLight&&C++,E instanceof THREE.DirectionalLight&&!E.shadowCascade&&C++)}x=C;var J;if(Ob&&e&&e.skeleton&&e.skeleton.useVertexTexture)J=
-1024;else{var I=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),N=Math.floor((I-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(N=Math.min(e.skeleton.bones.length,N),N<e.skeleton.bones.length&&THREE.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+N+" (try OpenGL instead of ANGLE)"));J=N}var P={precision:V,supportsVertexTextures:Zb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,
-specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:pa,skinning:d.skinning,maxBones:J,useVertexTexture:Ob&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:B.maxMorphTargets,maxMorphNormals:B.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:x,
-shadowMapEnabled:B.shadowMapEnabled&&e.receiveShadow&&0<x,shadowMapType:B.shadowMapType,shadowMapDebug:B.shadowMapDebug,shadowMapCascade:B.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},M=[];m?M.push(m):(M.push(d.fragmentShader),M.push(d.vertexShader));if(void 0!==d.defines)for(var K in d.defines)M.push(K),M.push(d.defines[K]);for(K in P)M.push(K),M.push(P[K]);for(var Q=M.join(),ta,ya=0,Ma=cb.length;ya<
-Ma;ya++){var xa=cb[ya];if(xa.code===Q){ta=xa;ta.usedTimes++;break}}void 0===ta&&(ta=new THREE.WebGLProgram(B,Q,d,P),cb.push(ta),B.info.memory.programs=cb.length);d.program=ta;var aa=ta.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var Ea,ca="morphTarget",Da=0;Da<B.maxMorphTargets;Da++)Ea=ca+Da,0<=aa[Ea]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,ca="morphNormal",Da=0;Da<B.maxMorphNormals;Da++)Ea=ca+Da,0<=aa[Ea]&&d.numSupportedMorphNormals++;d.uniformsList=
-[];for(var Ra in d.__webglShader.uniforms){var ja=d.program.uniforms[Ra];ja&&d.uniformsList.push([d.__webglShader.uniforms[Ra],ja])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(B.maxMorphTargets));var pb=!1,ma=!1,qa=!1,ua=d.program,ga=ua.uniforms,R=d.__webglShader.uniforms;ua.id!==$b&&(l.useProgram(ua.program),$b=ua.id,qa=ma=pb=!0);d.id!==xb&&(-1===xb&&(qa=!0),xb=d.id,ma=!0);if(pb||a!==Fb)l.uniformMatrix4fv(ga.projectionMatrix,
-!1,a.projectionMatrix.elements),pa&&l.uniform1f(ga.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Fb&&(Fb=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==ga.cameraPosition&&(Aa.setFromMatrixPosition(a.matrixWorld),l.uniform3f(ga.cameraPosition,Aa.x,Aa.y,Aa.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==ga.viewMatrix&&l.uniformMatrix4fv(ga.viewMatrix,
-!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==ga.bindMatrix&&l.uniformMatrix4fv(ga.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==ga.bindMatrixInverse&&l.uniformMatrix4fv(ga.bindMatrixInverse,!1,e.bindMatrixInverse.elements),Ob&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==ga.boneTexture){var La=y();l.uniform1i(ga.boneTexture,La);B.setTexture(e.skeleton.boneTexture,La)}null!==ga.boneTextureWidth&&l.uniform1i(ga.boneTextureWidth,e.skeleton.boneTextureWidth);
-null!==ga.boneTextureHeight&&l.uniform1i(ga.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==ga.boneGlobalMatrices&&l.uniformMatrix4fv(ga.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(ma){c&&d.fog&&(R.fogColor.value=c.color,c instanceof THREE.Fog?(R.fogNear.value=c.near,R.fogFar.value=c.far):c instanceof THREE.FogExp2&&(R.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Gb){var qa=
-!0,fa,db,X,Qa=0,eb=0,fb=0,Wa,Fa,ob,Ga,Xa,ka=qc,hb=ka.directional.colors,Sa=ka.directional.positions,Ta=ka.point.colors,qb=ka.point.positions,yb=ka.point.distances,zb=ka.point.decays,Ya=ka.spot.colors,Ba=ka.spot.positions,ib=ka.spot.distances,Na=ka.spot.directions,ha=ka.spot.anglesCos,na=ka.spot.exponents,H=ka.spot.decays,za=ka.hemi.skyColors,Za=ka.hemi.groundColors,mb=ka.hemi.positions,rb=0,Ua=0,oa=0,Ha=0,Ia=0,Ja=0,nb=0,Ab=0,sb=0,D=0,ab=0,$a=0;fa=0;for(db=b.length;fa<db;fa++)X=b[fa],X.onlyShadow||
-(Wa=X.color,Ga=X.intensity,Xa=X.distance,X instanceof THREE.AmbientLight?X.visible&&(Qa+=Wa.r,eb+=Wa.g,fb+=Wa.b):X instanceof THREE.DirectionalLight?(Ia+=1,X.visible&&(la.setFromMatrixPosition(X.matrixWorld),Aa.setFromMatrixPosition(X.target.matrixWorld),la.sub(Aa),la.normalize(),sb=3*rb,Sa[sb]=la.x,Sa[sb+1]=la.y,Sa[sb+2]=la.z,F(hb,sb,Wa,Ga),rb+=1)):X instanceof THREE.PointLight?(Ja+=1,X.visible&&(D=3*Ua,F(Ta,D,Wa,Ga),Aa.setFromMatrixPosition(X.matrixWorld),qb[D]=Aa.x,qb[D+1]=Aa.y,qb[D+2]=Aa.z,yb[Ua]=
-Xa,zb[Ua]=0===X.distance?0:X.decay,Ua+=1)):X instanceof THREE.SpotLight?(nb+=1,X.visible&&(ab=3*oa,F(Ya,ab,Wa,Ga),la.setFromMatrixPosition(X.matrixWorld),Ba[ab]=la.x,Ba[ab+1]=la.y,Ba[ab+2]=la.z,ib[oa]=Xa,Aa.setFromMatrixPosition(X.target.matrixWorld),la.sub(Aa),la.normalize(),Na[ab]=la.x,Na[ab+1]=la.y,Na[ab+2]=la.z,ha[oa]=Math.cos(X.angle),na[oa]=X.exponent,H[oa]=0===X.distance?0:X.decay,oa+=1)):X instanceof THREE.HemisphereLight&&(Ab+=1,X.visible&&(la.setFromMatrixPosition(X.matrixWorld),la.normalize(),
-$a=3*Ha,mb[$a]=la.x,mb[$a+1]=la.y,mb[$a+2]=la.z,Fa=X.color,ob=X.groundColor,F(za,$a,Fa,Ga),F(Za,$a,ob,Ga),Ha+=1)));fa=3*rb;for(db=Math.max(hb.length,3*Ia);fa<db;fa++)hb[fa]=0;fa=3*Ua;for(db=Math.max(Ta.length,3*Ja);fa<db;fa++)Ta[fa]=0;fa=3*oa;for(db=Math.max(Ya.length,3*nb);fa<db;fa++)Ya[fa]=0;fa=3*Ha;for(db=Math.max(za.length,3*Ab);fa<db;fa++)za[fa]=0;fa=3*Ha;for(db=Math.max(Za.length,3*Ab);fa<db;fa++)Za[fa]=0;ka.directional.length=rb;ka.point.length=Ua;ka.spot.length=oa;ka.hemi.length=Ha;ka.ambient[0]=
-Qa;ka.ambient[1]=eb;ka.ambient[2]=fb;Gb=!1}if(qa){var ba=qc;R.ambientLightColor.value=ba.ambient;R.directionalLightColor.value=ba.directional.colors;R.directionalLightDirection.value=ba.directional.positions;R.pointLightColor.value=ba.point.colors;R.pointLightPosition.value=ba.point.positions;R.pointLightDistance.value=ba.point.distances;R.pointLightDecay.value=ba.point.decays;R.spotLightColor.value=ba.spot.colors;R.spotLightPosition.value=ba.spot.positions;R.spotLightDistance.value=ba.spot.distances;
-R.spotLightDirection.value=ba.spot.directions;R.spotLightAngleCos.value=ba.spot.anglesCos;R.spotLightExponent.value=ba.spot.exponents;R.spotLightDecay.value=ba.spot.decays;R.hemisphereLightSkyColor.value=ba.hemi.skyColors;R.hemisphereLightGroundColor.value=ba.hemi.groundColors;R.hemisphereLightDirection.value=ba.hemi.positions;w(R,!0)}else w(R,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){R.opacity.value=d.opacity;R.diffuse.value=
-d.color;R.map.value=d.map;R.lightMap.value=d.lightMap;R.specularMap.value=d.specularMap;R.alphaMap.value=d.alphaMap;d.bumpMap&&(R.bumpMap.value=d.bumpMap,R.bumpScale.value=d.bumpScale);d.normalMap&&(R.normalMap.value=d.normalMap,R.normalScale.value.copy(d.normalScale));var jb;d.map?jb=d.map:d.specularMap?jb=d.specularMap:d.normalMap?jb=d.normalMap:d.bumpMap?jb=d.bumpMap:d.alphaMap&&(jb=d.alphaMap);if(void 0!==jb){var ub=jb.offset,Pb=jb.repeat;R.offsetRepeat.value.set(ub.x,ub.y,Pb.x,Pb.y)}R.envMap.value=
-d.envMap;R.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;R.reflectivity.value=d.reflectivity;R.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)R.diffuse.value=d.color,R.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)R.diffuse.value=d.color,R.opacity.value=d.opacity,R.dashSize.value=d.dashSize,R.totalSize.value=d.dashSize+d.gapSize,R.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(R.psColor.value=d.color,
-R.opacity.value=d.opacity,R.size.value=d.size,R.scale.value=O.height/2,R.map.value=d.map,null!==d.map){var Qb=d.map.offset,Rb=d.map.repeat;R.offsetRepeat.value.set(Qb.x,Qb.y,Rb.x,Rb.y)}}else d instanceof THREE.MeshPhongMaterial?(R.shininess.value=d.shininess,R.emissive.value=d.emissive,R.specular.value=d.specular,d.wrapAround&&R.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(R.emissive.value=d.emissive,d.wrapAround&&R.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?
-(R.mNear.value=a.near,R.mFar.value=a.far,R.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(R.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&R.shadowMatrix)for(var vb=0,Bb=0,Z=b.length;Bb<Z;Bb++){var va=b[Bb];va.castShadow&&(va instanceof THREE.SpotLight||va instanceof THREE.DirectionalLight&&!va.shadowCascade)&&(R.shadowMap.value[vb]=va.shadowMap,R.shadowMapSize.value[vb]=va.shadowMapSize,R.shadowMatrix.value[vb]=va.shadowMatrix,R.shadowDarkness.value[vb]=va.shadowDarkness,
-R.shadowBias.value[vb]=va.shadowBias,vb++)}for(var Ib=d.uniformsList,Va,gb,Ka,tb=0,ac=Ib.length;tb<ac;tb++){var U=Ib[tb][0];if(!1!==U.needsUpdate){var Cb=U.type,T=U.value,$=Ib[tb][1];switch(Cb){case "1i":l.uniform1i($,T);break;case "1f":l.uniform1f($,T);break;case "2f":l.uniform2f($,T[0],T[1]);break;case "3f":l.uniform3f($,T[0],T[1],T[2]);break;case "4f":l.uniform4f($,T[0],T[1],T[2],T[3]);break;case "1iv":l.uniform1iv($,T);break;case "3iv":l.uniform3iv($,T);break;case "1fv":l.uniform1fv($,T);break;
-case "2fv":l.uniform2fv($,T);break;case "3fv":l.uniform3fv($,T);break;case "4fv":l.uniform4fv($,T);break;case "Matrix3fv":l.uniformMatrix3fv($,!1,T);break;case "Matrix4fv":l.uniformMatrix4fv($,!1,T);break;case "i":l.uniform1i($,T);break;case "f":l.uniform1f($,T);break;case "v2":l.uniform2f($,T.x,T.y);break;case "v3":l.uniform3f($,T.x,T.y,T.z);break;case "v4":l.uniform4f($,T.x,T.y,T.z,T.w);break;case "c":l.uniform3f($,T.r,T.g,T.b);break;case "iv1":l.uniform1iv($,T);break;case "iv":l.uniform3iv($,T);
-break;case "fv1":l.uniform1fv($,T);break;case "fv":l.uniform3fv($,T);break;case "v2v":void 0===U._array&&(U._array=new Float32Array(2*T.length));for(var Y=0,Ca=T.length;Y<Ca;Y++)Ka=2*Y,U._array[Ka]=T[Y].x,U._array[Ka+1]=T[Y].y;l.uniform2fv($,U._array);break;case "v3v":void 0===U._array&&(U._array=new Float32Array(3*T.length));Y=0;for(Ca=T.length;Y<Ca;Y++)Ka=3*Y,U._array[Ka]=T[Y].x,U._array[Ka+1]=T[Y].y,U._array[Ka+2]=T[Y].z;l.uniform3fv($,U._array);break;case "v4v":void 0===U._array&&(U._array=new Float32Array(4*
-T.length));Y=0;for(Ca=T.length;Y<Ca;Y++)Ka=4*Y,U._array[Ka]=T[Y].x,U._array[Ka+1]=T[Y].y,U._array[Ka+2]=T[Y].z,U._array[Ka+3]=T[Y].w;l.uniform4fv($,U._array);break;case "m3":l.uniformMatrix3fv($,!1,T.elements);break;case "m3v":void 0===U._array&&(U._array=new Float32Array(9*T.length));Y=0;for(Ca=T.length;Y<Ca;Y++)T[Y].flattenToArrayOffset(U._array,9*Y);l.uniformMatrix3fv($,!1,U._array);break;case "m4":l.uniformMatrix4fv($,!1,T.elements);break;case "m4v":void 0===U._array&&(U._array=new Float32Array(16*
-T.length));Y=0;for(Ca=T.length;Y<Ca;Y++)T[Y].flattenToArrayOffset(U._array,16*Y);l.uniformMatrix4fv($,!1,U._array);break;case "t":Va=T;gb=y();l.uniform1i($,gb);if(!Va)continue;if(Va instanceof THREE.CubeTexture||Va.image instanceof Array&&6===Va.image.length){var W=Va,Db=gb;if(6===W.image.length)if(W.needsUpdate){W.image.__webglTextureCube||(W.addEventListener("dispose",Hb),W.image.__webglTextureCube=l.createTexture(),B.info.memory.textures++);l.activeTexture(l.TEXTURE0+Db);l.bindTexture(l.TEXTURE_CUBE_MAP,
-W.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,W.flipY);for(var Vb=W instanceof THREE.CompressedTexture,Jb=W.image[0]instanceof THREE.DataTexture,kb=[],wa=0;6>wa;wa++)kb[wa]=!B.autoScaleCubemaps||Vb||Jb?Jb?W.image[wa].image:W.image[wa]:L(W.image[wa],Gc);var Sb=kb[0],Tb=THREE.Math.isPowerOfTwo(Sb.width)&&THREE.Math.isPowerOfTwo(Sb.height),bb=S(W.format),wb=S(W.type);z(l.TEXTURE_CUBE_MAP,W,Tb);for(wa=0;6>wa;wa++)if(Vb)for(var lb,Ub=kb[wa].mipmaps,Eb=0,Wb=Ub.length;Eb<Wb;Eb++)lb=Ub[Eb],
-W.format!==THREE.RGBAFormat&&W.format!==THREE.RGBFormat?-1<rc().indexOf(bb)?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+wa,Eb,bb,lb.width,lb.height,0,lb.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+wa,Eb,bb,lb.width,lb.height,0,bb,wb,lb.data);else Jb?l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+wa,0,bb,kb[wa].width,kb[wa].height,0,bb,wb,kb[wa].data):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+
-wa,0,bb,bb,wb,kb[wa]);W.generateMipmaps&&Tb&&l.generateMipmap(l.TEXTURE_CUBE_MAP);W.needsUpdate=!1;if(W.onUpdate)W.onUpdate()}else l.activeTexture(l.TEXTURE0+Db),l.bindTexture(l.TEXTURE_CUBE_MAP,W.image.__webglTextureCube)}else if(Va instanceof THREE.WebGLRenderTargetCube){var Kb=Va;l.activeTexture(l.TEXTURE0+gb);l.bindTexture(l.TEXTURE_CUBE_MAP,Kb.__webglTexture)}else B.setTexture(Va,gb);break;case "tv":void 0===U._array&&(U._array=[]);Y=0;for(Ca=U.value.length;Y<Ca;Y++)U._array[Y]=y();l.uniform1iv($,
-U._array);Y=0;for(Ca=U.value.length;Y<Ca;Y++)Va=U.value[Y],gb=U._array[Y],Va&&B.setTexture(Va,gb);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+Cb)}}}}l.uniformMatrix4fv(ga.modelViewMatrix,!1,e._modelViewMatrix.elements);ga.normalMatrix&&l.uniformMatrix3fv(ga.normalMatrix,!1,e._normalMatrix.elements);null!==ga.modelMatrix&&l.uniformMatrix4fv(ga.modelMatrix,!1,e.matrixWorld.elements);return ua}function w(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=
-b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=
-b}function y(){var a=Nb;a>=sc&&THREE.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+sc);Nb+=1;return a}function A(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function F(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function G(a){a*=P;a!==tc&&(l.lineWidth(a),tc=a)}function E(a,b,c){uc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),uc=a);!a||vc===b&&wc===
-c||(l.polygonOffset(b,c),vc=b,wc=c)}function z(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,S(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,S(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,S(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,S(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+
-b.sourceFile+" )"),l.texParameteri(a,l.TEXTURE_MAG_FILTER,K(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,K(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=aa.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&
-(l.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,B.getMaxAnisotropy())),b.__oldAnisotropy=b.anisotropy)}function L(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);THREE.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}
-function J(a,b){l.bindRenderbuffer(l.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function M(a){a instanceof
-THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function K(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?l.NEAREST:l.LINEAR}function S(a){var b;if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;
-if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return l.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return l.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return l.UNSIGNED_SHORT_4_4_4_4;
-if(a===THREE.UnsignedShort5551Type)return l.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return l.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return l.BYTE;if(a===THREE.ShortType)return l.SHORT;if(a===THREE.UnsignedShortType)return l.UNSIGNED_SHORT;if(a===THREE.IntType)return l.INT;if(a===THREE.UnsignedIntType)return l.UNSIGNED_INT;if(a===THREE.FloatType)return l.FLOAT;b=aa.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return l.ALPHA;
-if(a===THREE.RGBFormat)return l.RGB;if(a===THREE.RGBAFormat)return l.RGBA;if(a===THREE.LuminanceFormat)return l.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return l.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return l.FUNC_ADD;if(a===THREE.SubtractEquation)return l.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return l.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return l.ZERO;if(a===THREE.OneFactor)return l.ONE;if(a===THREE.SrcColorFactor)return l.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return l.ONE_MINUS_SRC_COLOR;
-if(a===THREE.SrcAlphaFactor)return l.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return l.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return l.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return l.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return l.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return l.SRC_ALPHA_SATURATE;b=aa.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;
-if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=aa.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
-if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=aa.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var O=void 0!==a.canvas?a.canvas:document.createElement("canvas"),N=void 0!==a.context?a.context:null,P=1,V=void 0!==a.precision?a.precision:"highp",I=void 0!==a.alpha?a.alpha:!1,ma=void 0!==a.depth?a.depth:!0,ca=void 0!==a.stencil?
-a.stencil:!0,qa=void 0!==a.antialias?a.antialias:!1,Q=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,ua=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,pa=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,ja=new THREE.Color(0),ta=0,xa=[],ya={},Ma=[],Ea=[],Ra=[],Da=[],pb=[];this.domElement=O;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=
-!1;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var B=this,cb=[],$b=null,yb=null,xb=-1,La="",Fb=null,Nb=0,zb=-1,Pb=-1,Qb=-1,Rb=-1,ac=-1,Sb=-1,Tb=-1,Ub=-1,gc=-1,hc=-1,ic=-1,uc=null,vc=null,wc=null,tc=null,mb=0,nb=0,Wa=O.width,eb=O.height,xc=0,yc=0,
-ob=new Uint8Array(16),Qa=new Uint8Array(16),hb=new THREE.Frustum,ub=new THREE.Matrix4;new THREE.Matrix4;var Aa=new THREE.Vector3,la=new THREE.Vector3,Gb=!0,qc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},l;try{var zc={alpha:I,depth:ma,stencil:ca,antialias:qa,
-premultipliedAlpha:Q,preserveDrawingBuffer:ua};l=N||O.getContext("webgl",zc)||O.getContext("experimental-webgl",zc);if(null===l){if(null!==O.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}O.addEventListener("webglcontextlost",function(a){a.preventDefault();Ac();Bc();ya={}},!1)}catch(Hc){THREE.error("THREE.WebGLRenderer: "+Hc)}void 0===l.getShaderPrecisionFormat&&(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,
-precision:1}});var aa=new THREE.WebGLExtensions(l);aa.get("OES_texture_float");aa.get("OES_texture_float_linear");aa.get("OES_texture_half_float");aa.get("OES_texture_half_float_linear");aa.get("OES_standard_derivatives");pa&&aa.get("EXT_frag_depth");var jc=function(a,b,c,d){!0===Q&&(a*=d,b*=d,c*=d);l.clearColor(a,b,c,d)},Bc=function(){l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);
-l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(mb,nb,Wa,eb);jc(ja.r,ja.g,ja.b,ta)},Ac=function(){Fb=$b=null;Pb=zb=ic=hc=Qb=-1;La="";xb=-1;Gb=!0;for(var a=0;a<Qa.length;a++)Qa[a]=0};Bc();this.context=l;var sc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Ic=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Jc=l.getParameter(l.MAX_TEXTURE_SIZE),Gc=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),Zb=0<Ic,Ob=Zb&&aa.get("OES_texture_float"),Kc=l.getShaderPrecisionFormat(l.VERTEX_SHADER,
-l.HIGH_FLOAT),Lc=l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_FLOAT);var Mc=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT),Nc=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT);var rc=function(){var a;return function(){if(void 0!==a)return a;a=[];if(aa.get("WEBGL_compressed_texture_pvrtc")||aa.get("WEBGL_compressed_texture_s3tc"))for(var b=l.getParameter(l.COMPRESSED_TEXTURE_FORMATS),
-c=0;c<b.length;c++)a.push(b[c]);return a}}(),Oc=0<Kc.precision&&0<Mc.precision,Cc=0<Lc.precision&&0<Nc.precision;"highp"!==V||Oc||(Cc?(V="mediump",THREE.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(V="lowp",THREE.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==V||Cc||(V="lowp",THREE.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Pc=new THREE.ShadowMapPlugin(this,xa,ya,Ma),Qc=new THREE.SpritePlugin(this,Da),Rc=new THREE.LensFlarePlugin(this,
-pb);this.getContext=function(){return l};this.forceContextLoss=function(){aa.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return Zb};this.supportsFloatTextures=function(){return aa.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return aa.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){return aa.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return aa.get("WEBGL_compressed_texture_s3tc")};
-this.supportsCompressedTexturePVRTC=function(){return aa.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return aa.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=aa.get("EXT_texture_filter_anisotropic");return a=null!==b?l.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return V};this.getPixelRatio=function(){return P};this.setPixelRatio=function(a){P=a};this.setSize=function(a,
-b,c){O.width=a*P;O.height=b*P;!1!==c&&(O.style.width=a+"px",O.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){mb=a*P;nb=b*P;Wa=c*P;eb=d*P;l.viewport(mb,nb,Wa,eb)};this.setScissor=function(a,b,c,d){l.scissor(a*P,b*P,c*P,d*P)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.getClearColor=function(){return ja};this.setClearColor=function(a,b){ja.set(a);ta=void 0!==b?b:1;jc(ja.r,ja.g,ja.b,ta)};this.getClearAlpha=function(){return ta};
-this.setClearAlpha=function(a){ta=a;jc(ja.r,ja.g,ja.b,ta)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=l.COLOR_BUFFER_BIT;if(void 0===b||b)d|=l.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};this.clearColor=function(){l.clear(l.COLOR_BUFFER_BIT)};this.clearDepth=function(){l.clear(l.DEPTH_BUFFER_BIT)};this.clearStencil=function(){l.clear(l.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=Ac;var kc=
-function(a){a.target.traverse(function(a){a.removeEventListener("remove",kc);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete ya[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=Ma,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})},lc=function(a){a=a.target;a.removeEventListener("dispose",lc);delete a.__webglInit;if(a instanceof
-THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(l.deleteBuffer(c.buffer),delete c.buffer)}B.info.memory.geometries--}else if(b=fb[a.id],void 0!==b){for(var c=0,d=b.length;c<d;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=0,g=e.numMorphTargets;f<g;f++)l.deleteBuffer(e.__webglMorphTargetsBuffers[f]);delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)l.deleteBuffer(e.__webglMorphNormalsBuffers[f]);
-delete e.__webglMorphNormalsBuffers}Dc(e)}delete fb[a.id]}else Dc(a);La=""},Hb=function(a){a=a.target;a.removeEventListener("dispose",Hb);a.image&&a.image.__webglTextureCube?(l.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(l.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);B.info.memory.textures--},Ec=function(a){a=a.target;a.removeEventListener("dispose",Ec);if(a&&void 0!==a.__webglTexture){l.deleteTexture(a.__webglTexture);
-delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}B.info.memory.textures--},pc=function(a){a=a.target;a.removeEventListener("dispose",pc);oc(a)},Dc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),
-c=0,d=b.length;c<d;c++){var e=b[c];void 0!==a[e]&&(l.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)l.deleteBuffer(a.__webglCustomAttributesList[e].buffer);delete a.__webglCustomAttributesList}B.info.memory.geometries--},oc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=cb.length;a<c;a++)if(d=cb[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=cb.length;a<
-c;a++)d=cb[a],d.program!==b&&e.push(d);cb=e;l.deleteProgram(b);B.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){e();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=l.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=l.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=l.createBuffer());a.hasPositions&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),
-l.bufferData(l.ARRAY_BUFFER,a.positionArray,l.DYNAMIC_DRAW),f(b.attributes.position),l.vertexAttribPointer(b.attributes.position,3,l.FLOAT,!1,0,0));if(a.hasNormals){l.bindBuffer(l.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,h,k,m,p,n,q,r,t,s,u,v=3*a.count;for(u=0;u<v;u+=9)s=a.normalArray,d=s[u],h=s[u+1],k=s[u+2],m=s[u+3],n=s[u+4],r=s[u+5],p=s[u+6],q=s[u+7],t=s[u+8],d=(d+m+p)/3,h=(h+n+q)/3,k=(k+r+t)/3,s[u]=d,s[u+1]=h,s[u+2]=k,s[u+3]=d,s[u+4]=h,s[u+5]=k,s[u+6]=d,s[u+
-7]=h,s[u+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);f(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),l.bufferData(l.ARRAY_BUFFER,a.uvArray,l.DYNAMIC_DRAW),f(b.attributes.uv),l.vertexAttribPointer(b.attributes.uv,2,l.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,a.colorArray,l.DYNAMIC_DRAW),
-f(b.attributes.color),l.vertexAttribPointer(b.attributes.color,3,l.FLOAT,!1,0,0));g();l.drawArrays(l.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,f,g,h){if(!1!==f.visible)if(u(h),a=C(a,b,c,f,h),b=!1,c="direct_"+g.id+"_"+a.id+"_"+(f.wireframe?1:0),c!==La&&(La=c,b=!0),b&&e(),h instanceof THREE.Mesh){h=!0===f.wireframe?l.LINES:l.TRIANGLES;var k=g.attributes.index;if(k){var m,p;k.array instanceof Uint32Array&&aa.get("OES_element_index_uint")?(m=l.UNSIGNED_INT,p=4):(m=l.UNSIGNED_SHORT,
-p=2);c=g.offsets;if(0===c.length)b&&(d(f,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,k.array.length,m,0),B.info.render.calls++,B.info.render.vertices+=k.array.length,B.info.render.faces+=k.array.length/3;else{b=!0;for(var n=0,q=c.length;n<q;n++){var s=c[n].index;b&&(d(f,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer));l.drawElements(h,c[n].count,m,c[n].start*p);B.info.render.calls++;B.info.render.vertices+=c[n].count;B.info.render.faces+=c[n].count/3}}}else b&&d(f,
-a,g,0),f=g.attributes.position,l.drawArrays(h,0,f.array.length/f.itemSize),B.info.render.calls++,B.info.render.vertices+=f.array.length/f.itemSize,B.info.render.faces+=f.array.length/(3*f.itemsize)}else if(h instanceof THREE.PointCloud)if(h=l.POINTS,k=g.attributes.index)if(k.array instanceof Uint32Array&&aa.get("OES_element_index_uint")?(m=l.UNSIGNED_INT,p=4):(m=l.UNSIGNED_SHORT,p=2),c=g.offsets,0===c.length)b&&(d(f,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,k.array.length,
-m,0),B.info.render.calls++,B.info.render.points+=k.array.length;else for(1<c.length&&(b=!0),n=0,q=c.length;n<q;n++)s=c[n].index,b&&(d(f,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,c[n].count,m,c[n].start*p),B.info.render.calls++,B.info.render.points+=c[n].count;else if(b&&d(f,a,g,0),f=g.attributes.position,c=g.offsets,0===c.length)l.drawArrays(h,0,f.array.length/3),B.info.render.calls++,B.info.render.points+=f.array.length/3;else for(n=0,q=c.length;n<q;n++)l.drawArrays(h,
-c[n].index,c[n].count),B.info.render.calls++,B.info.render.points+=c[n].count;else if(h instanceof THREE.Line)if(h=h.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,G(f.linewidth),k=g.attributes.index)if(k.array instanceof Uint32Array?(m=l.UNSIGNED_INT,p=4):(m=l.UNSIGNED_SHORT,p=2),c=g.offsets,0===c.length)b&&(d(f,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,k.array.length,m,0),B.info.render.calls++,B.info.render.vertices+=k.array.length;else for(1<c.length&&(b=!0),n=0,q=c.length;n<
-q;n++)s=c[n].index,b&&(d(f,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,c[n].count,m,c[n].start*p),B.info.render.calls++,B.info.render.vertices+=c[n].count;else if(b&&d(f,a,g,0),f=g.attributes.position,c=g.offsets,0===c.length)l.drawArrays(h,0,f.array.length/3),B.info.render.calls++,B.info.render.vertices+=f.array.length/3;else for(n=0,q=c.length;n<q;n++)l.drawArrays(h,c[n].index,c[n].count),B.info.render.calls++,B.info.render.vertices+=c[n].count};this.renderBuffer=function(a,
-b,c,d,h,k){if(!1!==d.visible){u(k);c=C(a,b,c,d,k);b=c.attributes;a=!1;c=h.id+"_"+c.id+"_"+(d.wireframe?1:0);c!==La&&(La=c,a=!0);a&&e();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglVertexBuffer),f(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(l.bindBuffer(l.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[k.morphTargetBase]),f(c.position),l.vertexAttribPointer(c.position,
-3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglVertexBuffer),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length)for(var m=0,n=k.morphTargetForcedOrder,q=k.morphTargetInfluences,s;m<d.numSupportedMorphTargets&&m<n.length;)s=c["morphTarget"+m],0<=s&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[n[m]]),f(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0)),s=c["morphNormal"+m],0<=s&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,
-h.__webglMorphNormalsBuffers[n[m]]),f(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[m]=q[n[m]],m++;else{n=[];q=k.morphTargetInfluences;m=k.geometry.morphTargets;q.length>m.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),q.length=m.length);m=0;for(s=q.length;m<s;m++)n.push([q[m],m]);n.length>d.numSupportedMorphTargets?(n.sort(p),n.length=d.numSupportedMorphTargets):n.length>d.numSupportedMorphNormals?n.sort(p):0===n.length&&
-n.push([0,0]);for(var m=0,r=d.numSupportedMorphTargets;m<r;m++)if(n[m]){var t=n[m][1];s=c["morphTarget"+m];0<=s&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[t]),f(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0));s=c["morphNormal"+m];0<=s&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglMorphNormalsBuffers[t]),f(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0));k.__webglMorphTargetInfluences[m]=q[t]}else k.__webglMorphTargetInfluences[m]=0}null!==d.program.uniforms.morphTargetInfluences&&
-l.uniform1fv(d.program.uniforms.morphTargetInfluences,k.__webglMorphTargetInfluences)}if(a){if(h.__webglCustomAttributesList)for(c=0,q=h.__webglCustomAttributesList.length;c<q;c++)n=h.__webglCustomAttributesList[c],0<=b[n.buffer.belongsToAttribute]&&(l.bindBuffer(l.ARRAY_BUFFER,n.buffer),f(b[n.buffer.belongsToAttribute]),l.vertexAttribPointer(b[n.buffer.belongsToAttribute],n.size,l.FLOAT,!1,0,0));0<=b.color&&(0<k.geometry.colors.length||0<k.geometry.faces.length?(l.bindBuffer(l.ARRAY_BUFFER,h.__webglColorBuffer),
-f(b.color),l.vertexAttribPointer(b.color,3,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglNormalBuffer),f(b.normal),l.vertexAttribPointer(b.normal,3,l.FLOAT,!1,0,0));0<=b.tangent&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglTangentBuffer),f(b.tangent),l.vertexAttribPointer(b.tangent,4,l.FLOAT,!1,0,0));0<=b.uv&&(k.geometry.faceVertexUvs[0]?(l.bindBuffer(l.ARRAY_BUFFER,h.__webglUVBuffer),f(b.uv),
-l.vertexAttribPointer(b.uv,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(k.geometry.faceVertexUvs[1]?(l.bindBuffer(l.ARRAY_BUFFER,h.__webglUV2Buffer),f(b.uv2),l.vertexAttribPointer(b.uv2,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),f(b.skinIndex),l.vertexAttribPointer(b.skinIndex,
-4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),f(b.skinWeight),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0));0<=b.lineDistance&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglLineDistanceBuffer),f(b.lineDistance),l.vertexAttribPointer(b.lineDistance,1,l.FLOAT,!1,0,0))}g();k instanceof THREE.Mesh?(k=h.__typeArray===Uint32Array?l.UNSIGNED_INT:l.UNSIGNED_SHORT,d.wireframe?(G(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),l.drawElements(l.LINES,
-h.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),l.drawElements(l.TRIANGLES,h.__webglFaceCount,k,0)),B.info.render.calls++,B.info.render.vertices+=h.__webglFaceCount,B.info.render.faces+=h.__webglFaceCount/3):k instanceof THREE.Line?(k=k.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,G(d.linewidth),l.drawArrays(k,0,h.__webglLineCount),B.info.render.calls++):k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,h.__webglParticleCount),B.info.render.calls++,B.info.render.points+=
-h.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)THREE.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;La="";xb=-1;Fb=null;Gb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);ub.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);hb.setFromMatrix(ub);
-xa.length=0;Ea.length=0;Ra.length=0;Da.length=0;pb.length=0;n(a);!0===B.sortObjects&&(Ea.sort(h),Ra.sort(k));Pc.render(a,b);B.info.render.calls=0;B.info.render.vertices=0;B.info.render.faces=0;B.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);d=0;for(var f=Ma.length;d<f;d++){var g=Ma[d],l=g.object;l.visible&&(A(l,b),s(g))}a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,
-d.blendSrc,d.blendDst,d.blendEquationAlpha,d.blendSrcAlpha,d.blendDstAlpha),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),E(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),q(Ea,b,xa,e,!0,d),q(Ra,b,xa,e,!0,d),m(Ma,"",b,xa,e,!1,d)):(d=null,this.setBlending(THREE.NoBlending),q(Ea,b,xa,e,!1,d),m(Ma,"opaque",b,xa,e,!1,d),q(Ra,b,xa,e,!0,d),m(Ma,"transparent",b,xa,e,!0,d));Qc.render(a,b);Rc.render(a,b,xc,yc);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==
-THREE.LinearFilter&&M(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=C(a,b,c,d,e);La="";B.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,hb):e.render(function(a){B.renderBufferImmediate(a,f,d)})};var fb={},mc=0,Fc={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};
-this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):l.frontFace(l.CCW),a===THREE.CullFaceBack?l.cullFace(l.BACK):a===THREE.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK),l.enable(l.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;zb!==b&&(b?l.disable(l.CULL_FACE):l.enable(l.CULL_FACE),zb=b);Pb!==a&&(a?l.frontFace(l.CW):l.frontFace(l.CCW),Pb=a)};this.setDepthTest=
-function(a){hc!==a&&(a?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),hc=a)};this.setDepthWrite=function(a){ic!==a&&(l.depthMask(a),ic=a)};this.setBlending=function(a,b,c,d,e,f,g){a!==Qb&&(a===THREE.NoBlending?l.disable(l.BLEND):a===THREE.AdditiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,l.ONE)):a===THREE.SubtractiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(l.enable(l.BLEND),
-l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.SRC_COLOR)):a===THREE.CustomBlending?l.enable(l.BLEND):(l.enable(l.BLEND),l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),Qb=a);if(a===THREE.CustomBlending){e=e||b;f=f||c;g=g||d;if(b!==Rb||e!==Tb)l.blendEquationSeparate(S(b),S(e)),Rb=b,Tb=e;if(c!==ac||d!==Sb||f!==Ub||g!==gc)l.blendFuncSeparate(S(c),S(d),S(f),S(g)),ac=c,Sb=d,Ub=f,gc=g}else gc=Ub=Tb=Sb=ac=Rb=null};this.uploadTexture=
-function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Hb),a.__webglTexture=l.createTexture(),B.info.memory.textures++);l.bindTexture(l.TEXTURE_2D,a.__webglTexture);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,a.flipY);l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);l.pixelStorei(l.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=L(a.image,Jc);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=S(a.format),e=S(a.type);z(l.TEXTURE_2D,
-a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<f.length&&c){for(var g=0,h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(g=0,h=f.length;g<h;g++)b=f[g],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<rc().indexOf(d)?l.compressedTexImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,b.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):
-l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);else if(0<f.length&&c){g=0;for(h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&l.generateMipmap(l.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()};this.setTexture=function(a,b){l.activeTexture(l.TEXTURE0+b);a.needsUpdate?B.uploadTexture(a):l.bindTexture(l.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof
-THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Ec);a.__webglTexture=l.createTexture();B.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=S(a.format),e=S(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture);z(l.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=
-l.createFramebuffer();a.__webglRenderbuffer[f]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+f;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[f]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,h,g.__webglTexture,0);J(a.__webglRenderbuffer[f],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:
-l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),z(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,
-l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):J(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Wa,a=eb,d=mb,e=nb);b!==yb&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),yb=b);xc=c;yc=a};this.readRenderTargetPixels=
-function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(a.__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;a.__webglFramebuffer!==yb&&(l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),g=!0);l.checkFramebufferStatus(l.FRAMEBUFFER)===
-l.FRAMEBUFFER_COMPLETE?l.readPixels(b,c,d,e,l.RGBA,l.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&l.bindFramebuffer(l.FRAMEBUFFER,yb)}};this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};
-this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}};
+THREE.WebGLRenderer=function(a){function b(a){var b=a.geometry;a=a.material;var c=b.vertices.length;if(a.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var d in a.attributes){var e=a.attributes[d];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var f=1;"v2"===e.type?f=2:"v3"===e.type?f=3:"v4"===e.type?f=4:"c"===e.type&&(f=3);e.size=f;e.array=new Float32Array(c*f);e.buffer=m.createBuffer();e.buffer.belongsToAttribute=d;e.needsUpdate=
+!0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function d(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var h=0,k=b.length;h<k;h++){var l=b[h],p=e[l];if(0<=p){var n=c[l];void 0!==n?(l=n.itemSize,m.bindBuffer(m.ARRAY_BUFFER,n.buffer),f(p),m.vertexAttribPointer(p,l,m.FLOAT,!1,0,d*l*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[l].length?m.vertexAttrib2fv(p,
+a.defaultAttributeValues[l]):3===a.defaultAttributeValues[l].length&&m.vertexAttrib3fv(p,a.defaultAttributeValues[l]))}}g()}function e(){for(var a=0,b=ib.length;a<b;a++)ib[a]=0}function f(a){ib[a]=1;0===Pa[a]&&(m.enableVertexAttribArray(a),Pa[a]=1)}function g(){for(var a=0,b=Pa.length;a<b;a++)Pa[a]!==ib[a]&&(m.disableVertexAttribArray(a),Pa[a]=0)}function h(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-
+b.z:a.id-b.id}function k(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function p(a,b){return b[0]-a[0]}function n(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group)){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",ub));var c=a.geometry;if(void 0!==c&&void 0===c.__webglInit)if(c.__webglInit=!0,c.addEventListener("dispose",Qb),
+c instanceof THREE.BufferGeometry)B.info.memory.geometries++;else if(a instanceof THREE.Mesh)t(a,c);else if(a instanceof THREE.Line){if(void 0===c.__webglVertexBuffer){c.__webglVertexBuffer=m.createBuffer();c.__webglColorBuffer=m.createBuffer();c.__webglLineDistanceBuffer=m.createBuffer();B.info.memory.geometries++;var d=c.vertices.length;c.__vertexArray=new Float32Array(3*d);c.__colorArray=new Float32Array(3*d);c.__lineDistanceArray=new Float32Array(1*d);c.__webglLineCount=d;b(a);c.verticesNeedUpdate=
+!0;c.colorsNeedUpdate=!0;c.lineDistancesNeedUpdate=!0}}else a instanceof THREE.PointCloud&&void 0===c.__webglVertexBuffer&&(c.__webglVertexBuffer=m.createBuffer(),c.__webglColorBuffer=m.createBuffer(),B.info.memory.geometries++,d=c.vertices.length,c.__vertexArray=new Float32Array(3*d),c.__colorArray=new Float32Array(3*d),c.__sortArray=[],c.__webglParticleCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0);if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh)if(c instanceof
+THREE.BufferGeometry)r(Ca,c,a);else{if(c instanceof THREE.Geometry)for(var c=fb[c.id],d=0,e=c.length;d<e;d++)r(Ca,c[d],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?r(Ca,c,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&za.push({id:null,object:a,opaque:null,transparent:null,z:0});if(a instanceof THREE.Light)wa.push(a);else if(a instanceof THREE.Sprite)gb.push(a);else if(a instanceof THREE.LensFlare)cb.push(a);else if((c=Ca[a.id])&&(!1===a.frustumCulled||
+!0===jb.intersectsObject(a)))for(d=0,e=c.length;d<e;d++){var f=c[d],g=f,h=g.object,k=g.buffer,l=h.geometry,h=h.material;h instanceof THREE.MeshFaceMaterial?(h=h.materials[l instanceof THREE.BufferGeometry?0:k.materialIndex],g.material=h,h.transparent?La.push(g):Qa.push(g)):h&&(g.material=h,h.transparent?La.push(g):Qa.push(g));f.render=!0;!0===B.sortObjects&&(xa.setFromMatrixPosition(a.matrixWorld),xa.applyProjection(vb),f.z=xa.z)}}d=0;for(e=a.children.length;d<e;d++)n(a.children[d])}}function q(a,
+b,c,d,e){for(var f,g=0,h=a.length;g<h;g++){f=a[g];var k=f.object,m=f.buffer;E(k,b);if(e)f=e;else{f=f.material;if(!f)continue;C(f)}B.setMaterialFaces(f);m instanceof THREE.BufferGeometry?B.renderBufferDirect(b,c,d,f,m,k):B.renderBuffer(b,c,d,f,m,k)}}function l(a,b,c,d,e,f){for(var g,h=0,k=a.length;h<k;h++){g=a[h];var m=g.object;if(m.visible){if(f)g=f;else{g=g[b];if(!g)continue;C(g)}B.renderImmediateObject(c,d,e,g,m)}}}function s(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):
+(a.opaque=b,a.transparent=null)}function t(a,b){var d=a.material,e=!1;if(void 0===fb[b.id]||!0===b.groupsNeedUpdate){delete Ca[a.id];for(var f=fb,g=b.id,d=d instanceof THREE.MeshFaceMaterial,h=ca.get("OES_element_index_uint")?4294967296:65535,k,e={},l=b.morphTargets.length,p=b.morphNormals.length,n,q={},s=[],t=0,v=b.faces.length;t<v;t++){k=b.faces[t];var u=d?k.materialIndex:0;u in e||(e[u]={hash:u,counter:0});k=e[u].hash+"_"+e[u].counter;k in q||(n={id:Rb++,faces3:[],materialIndex:u,vertices:0,numMorphTargets:l,
+numMorphNormals:p},q[k]=n,s.push(n));q[k].vertices+3>h&&(e[u].counter+=1,k=e[u].hash+"_"+e[u].counter,k in q||(n={id:Rb++,faces3:[],materialIndex:u,vertices:0,numMorphTargets:l,numMorphNormals:p},q[k]=n,s.push(n)));q[k].faces3.push(t);q[k].vertices+=3}f[g]=s;b.groupsNeedUpdate=!1}f=fb[b.id];g=0;for(d=f.length;g<d;g++){h=f[g];if(void 0===h.__webglVertexBuffer){e=h;e.__webglVertexBuffer=m.createBuffer();e.__webglNormalBuffer=m.createBuffer();e.__webglTangentBuffer=m.createBuffer();e.__webglColorBuffer=
+m.createBuffer();e.__webglUVBuffer=m.createBuffer();e.__webglUV2Buffer=m.createBuffer();e.__webglSkinIndicesBuffer=m.createBuffer();e.__webglSkinWeightsBuffer=m.createBuffer();e.__webglFaceBuffer=m.createBuffer();e.__webglLineBuffer=m.createBuffer();if(p=e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],l=0;l<p;l++)e.__webglMorphTargetsBuffers.push(m.createBuffer());if(p=e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],l=0;l<p;l++)e.__webglMorphNormalsBuffers.push(m.createBuffer());B.info.memory.geometries++;
+e=h;t=a;v=t.geometry;p=e.faces3;l=3*p.length;q=1*p.length;s=3*p.length;p=c(t,e);e.__vertexArray=new Float32Array(3*l);e.__normalArray=new Float32Array(3*l);e.__colorArray=new Float32Array(3*l);e.__uvArray=new Float32Array(2*l);1<v.faceVertexUvs.length&&(e.__uv2Array=new Float32Array(2*l));v.hasTangents&&(e.__tangentArray=new Float32Array(4*l));t.geometry.skinWeights.length&&t.geometry.skinIndices.length&&(e.__skinIndexArray=new Float32Array(4*l),e.__skinWeightArray=new Float32Array(4*l));t=null!==
+ca.get("OES_element_index_uint")&&21845<q?Uint32Array:Uint16Array;e.__typeArray=t;e.__faceArray=new t(3*q);e.__lineArray=new t(2*s);if(v=e.numMorphTargets)for(e.__morphTargetsArrays=[],t=0;t<v;t++)e.__morphTargetsArrays.push(new Float32Array(3*l));if(v=e.numMorphNormals)for(e.__morphNormalsArrays=[],t=0;t<v;t++)e.__morphNormalsArrays.push(new Float32Array(3*l));e.__webglFaceCount=3*q;e.__webglLineCount=2*s;if(p.attributes)for(q in void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=
+[]),q=void 0,p.attributes){var s=p.attributes[q],t={},w;for(w in s)t[w]=s[w];if(!t.__webglInitialized||t.createUniqueBuffers)t.__webglInitialized=!0,v=1,"v2"===t.type?v=2:"v3"===t.type?v=3:"v4"===t.type?v=4:"c"===t.type&&(v=3),t.size=v,t.array=new Float32Array(l*v),t.buffer=m.createBuffer(),t.buffer.belongsToAttribute=q,s.needsUpdate=!0,t.__original=s;e.__webglCustomAttributesList.push(t)}e.__inittedArrays=!0;b.verticesNeedUpdate=!0;b.morphTargetsNeedUpdate=!0;b.elementsNeedUpdate=!0;b.uvsNeedUpdate=
+!0;b.normalsNeedUpdate=!0;b.tangentsNeedUpdate=!0;e=b.colorsNeedUpdate=!0}else e=!1;(e||void 0===a.__webglActive)&&r(Ca,h,a)}a.__webglActive=!0}function r(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function u(a){var b=a.geometry;if(b instanceof THREE.BufferGeometry)for(var d=b.attributes,e=b.attributesKeys,f=0,g=e.length;f<g;f++){var h=e[f],k=d[h],l="index"===h?m.ELEMENT_ARRAY_BUFFER:m.ARRAY_BUFFER;void 0===k.buffer?(k.buffer=m.createBuffer(),m.bindBuffer(l,
+k.buffer),m.bufferData(l,k.array,k instanceof THREE.DynamicBufferAttribute?m.DYNAMIC_DRAW:m.STATIC_DRAW),k.needsUpdate=!1):!0===k.needsUpdate&&(m.bindBuffer(l,k.buffer),void 0===k.updateRange||-1===k.updateRange.count?m.bufferSubData(l,0,k.array):0===k.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(m.bufferSubData(l,k.updateRange.offset*
+k.array.BYTES_PER_ELEMENT,k.array.subarray(k.updateRange.offset,k.updateRange.offset+k.updateRange.count)),k.updateRange.count=0),k.needsUpdate=!1)}else if(a instanceof THREE.Mesh){!0===b.groupsNeedUpdate&&t(a,b);for(var p=fb[b.id],f=0,n=p.length;f<n;f++){var q=p[f],r=c(a,q),s=r.attributes&&v(r);if(b.verticesNeedUpdate||b.morphTargetsNeedUpdate||b.elementsNeedUpdate||b.uvsNeedUpdate||b.normalsNeedUpdate||b.colorsNeedUpdate||b.tangentsNeedUpdate||s){var u=q,w=a,C=m.DYNAMIC_DRAW,A=!b.dynamic,E=r;if(u.__inittedArrays){var H=
+E&&void 0!==E.shading&&E.shading===THREE.SmoothShading,y=void 0,z=void 0,F=void 0,B=void 0,K=void 0,J=void 0,N=void 0,Q=void 0,O=void 0,U=void 0,T=void 0,G=void 0,M=void 0,L=void 0,wa=void 0,V=void 0,za=void 0,Ca=void 0,Qa=void 0,ca=void 0,aa=void 0,Va=void 0,La=void 0,ba=void 0,ha=void 0,P=void 0,cb=void 0,ga=void 0,la=void 0,X=void 0,ma=void 0,gb=void 0,xa=void 0,qa=void 0,Da=void 0,na=void 0,Ea=void 0,Xa=void 0,ka=void 0,ra=void 0,Ra=0,Sa=0,tb=0,Ka=0,Ja=0,Ya=0,Aa=0,kb=0,Ma=0,ia=0,oa=0,I=0,ya=void 0,
+Za=u.__vertexArray,Pa=u.__uvArray,qb=u.__uv2Array,Ta=u.__normalArray,pa=u.__tangentArray,Fa=u.__colorArray,Ga=u.__skinIndexArray,Ha=u.__skinWeightArray,Ib=u.__morphTargetsArrays,Bb=u.__morphNormalsArrays,rb=u.__webglCustomAttributesList,D=void 0,ab=u.__faceArray,$a=u.__lineArray,da=w.geometry,lb=da.elementsNeedUpdate,yb=da.uvsNeedUpdate,Gb=da.normalsNeedUpdate,ib=da.tangentsNeedUpdate,Ob=da.colorsNeedUpdate,wb=da.morphTargetsNeedUpdate,Cb=da.vertices,Z=u.faces3,ua=da.faces,Jb=da.faceVertexUvs[0],
+Ua=da.faceVertexUvs[1],hb=da.skinIndices,Ia=da.skinWeights,sb=da.morphTargets,Hb=da.morphNormals;if(da.verticesNeedUpdate){y=0;for(z=Z.length;y<z;y++)B=ua[Z[y]],G=Cb[B.a],M=Cb[B.b],L=Cb[B.c],Za[Sa]=G.x,Za[Sa+1]=G.y,Za[Sa+2]=G.z,Za[Sa+3]=M.x,Za[Sa+4]=M.y,Za[Sa+5]=M.z,Za[Sa+6]=L.x,Za[Sa+7]=L.y,Za[Sa+8]=L.z,Sa+=9;m.bindBuffer(m.ARRAY_BUFFER,u.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,Za,C)}if(wb)for(Da=0,na=sb.length;Da<na;Da++){y=oa=0;for(z=Z.length;y<z;y++)ka=Z[y],B=ua[ka],G=sb[Da].vertices[B.a],
+M=sb[Da].vertices[B.b],L=sb[Da].vertices[B.c],Ea=Ib[Da],Ea[oa]=G.x,Ea[oa+1]=G.y,Ea[oa+2]=G.z,Ea[oa+3]=M.x,Ea[oa+4]=M.y,Ea[oa+5]=M.z,Ea[oa+6]=L.x,Ea[oa+7]=L.y,Ea[oa+8]=L.z,E.morphNormals&&(H?(ra=Hb[Da].vertexNormals[ka],Ca=ra.a,Qa=ra.b,ca=ra.c):ca=Qa=Ca=Hb[Da].faceNormals[ka],Xa=Bb[Da],Xa[oa]=Ca.x,Xa[oa+1]=Ca.y,Xa[oa+2]=Ca.z,Xa[oa+3]=Qa.x,Xa[oa+4]=Qa.y,Xa[oa+5]=Qa.z,Xa[oa+6]=ca.x,Xa[oa+7]=ca.y,Xa[oa+8]=ca.z),oa+=9;m.bindBuffer(m.ARRAY_BUFFER,u.__webglMorphTargetsBuffers[Da]);m.bufferData(m.ARRAY_BUFFER,
+Ib[Da],C);E.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,u.__webglMorphNormalsBuffers[Da]),m.bufferData(m.ARRAY_BUFFER,Bb[Da],C))}if(Ia.length){y=0;for(z=Z.length;y<z;y++)B=ua[Z[y]],ba=Ia[B.a],ha=Ia[B.b],P=Ia[B.c],Ha[ia]=ba.x,Ha[ia+1]=ba.y,Ha[ia+2]=ba.z,Ha[ia+3]=ba.w,Ha[ia+4]=ha.x,Ha[ia+5]=ha.y,Ha[ia+6]=ha.z,Ha[ia+7]=ha.w,Ha[ia+8]=P.x,Ha[ia+9]=P.y,Ha[ia+10]=P.z,Ha[ia+11]=P.w,cb=hb[B.a],ga=hb[B.b],la=hb[B.c],Ga[ia]=cb.x,Ga[ia+1]=cb.y,Ga[ia+2]=cb.z,Ga[ia+3]=cb.w,Ga[ia+4]=ga.x,Ga[ia+5]=ga.y,Ga[ia+6]=ga.z,
+Ga[ia+7]=ga.w,Ga[ia+8]=la.x,Ga[ia+9]=la.y,Ga[ia+10]=la.z,Ga[ia+11]=la.w,ia+=12;0<ia&&(m.bindBuffer(m.ARRAY_BUFFER,u.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Ga,C),m.bindBuffer(m.ARRAY_BUFFER,u.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,Ha,C))}if(Ob){y=0;for(z=Z.length;y<z;y++)B=ua[Z[y]],N=B.vertexColors,Q=B.color,3===N.length&&E.vertexColors===THREE.VertexColors?(aa=N[0],Va=N[1],La=N[2]):La=Va=aa=Q,Fa[Ma]=aa.r,Fa[Ma+1]=aa.g,Fa[Ma+2]=aa.b,Fa[Ma+3]=Va.r,Fa[Ma+4]=Va.g,Fa[Ma+5]=
+Va.b,Fa[Ma+6]=La.r,Fa[Ma+7]=La.g,Fa[Ma+8]=La.b,Ma+=9;0<Ma&&(m.bindBuffer(m.ARRAY_BUFFER,u.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,Fa,C))}if(ib&&da.hasTangents){y=0;for(z=Z.length;y<z;y++)B=ua[Z[y]],O=B.vertexTangents,wa=O[0],V=O[1],za=O[2],pa[Aa]=wa.x,pa[Aa+1]=wa.y,pa[Aa+2]=wa.z,pa[Aa+3]=wa.w,pa[Aa+4]=V.x,pa[Aa+5]=V.y,pa[Aa+6]=V.z,pa[Aa+7]=V.w,pa[Aa+8]=za.x,pa[Aa+9]=za.y,pa[Aa+10]=za.z,pa[Aa+11]=za.w,Aa+=12;m.bindBuffer(m.ARRAY_BUFFER,u.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,pa,
+C)}if(Gb){y=0;for(z=Z.length;y<z;y++)if(B=ua[Z[y]],K=B.vertexNormals,J=B.normal,3===K.length&&H)for(X=0;3>X;X++)gb=K[X],Ta[Ya]=gb.x,Ta[Ya+1]=gb.y,Ta[Ya+2]=gb.z,Ya+=3;else for(X=0;3>X;X++)Ta[Ya]=J.x,Ta[Ya+1]=J.y,Ta[Ya+2]=J.z,Ya+=3;m.bindBuffer(m.ARRAY_BUFFER,u.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,Ta,C)}if(yb&&Jb){y=0;for(z=Z.length;y<z;y++)if(F=Z[y],U=Jb[F],void 0!==U)for(X=0;3>X;X++)xa=U[X],Pa[tb]=xa.x,Pa[tb+1]=xa.y,tb+=2;0<tb&&(m.bindBuffer(m.ARRAY_BUFFER,u.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,
+Pa,C))}if(yb&&Ua){y=0;for(z=Z.length;y<z;y++)if(F=Z[y],T=Ua[F],void 0!==T)for(X=0;3>X;X++)qa=T[X],qb[Ka]=qa.x,qb[Ka+1]=qa.y,Ka+=2;0<Ka&&(m.bindBuffer(m.ARRAY_BUFFER,u.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,qb,C))}if(lb){y=0;for(z=Z.length;y<z;y++)ab[Ja]=Ra,ab[Ja+1]=Ra+1,ab[Ja+2]=Ra+2,Ja+=3,$a[kb]=Ra,$a[kb+1]=Ra+1,$a[kb+2]=Ra,$a[kb+3]=Ra+2,$a[kb+4]=Ra+1,$a[kb+5]=Ra+2,kb+=6,Ra+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,u.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,ab,C);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
+u.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,$a,C)}if(rb)for(X=0,ma=rb.length;X<ma;X++)if(D=rb[X],D.__original.needsUpdate){I=0;if(1===D.size)if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=0,z=Z.length;y<z;y++)B=ua[Z[y]],D.array[I]=D.value[B.a],D.array[I+1]=D.value[B.b],D.array[I+2]=D.value[B.c],I+=3;else{if("faces"===D.boundTo)for(y=0,z=Z.length;y<z;y++)ya=D.value[Z[y]],D.array[I]=ya,D.array[I+1]=ya,D.array[I+2]=ya,I+=3}else if(2===D.size)if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=
+0,z=Z.length;y<z;y++)B=ua[Z[y]],G=D.value[B.a],M=D.value[B.b],L=D.value[B.c],D.array[I]=G.x,D.array[I+1]=G.y,D.array[I+2]=M.x,D.array[I+3]=M.y,D.array[I+4]=L.x,D.array[I+5]=L.y,I+=6;else{if("faces"===D.boundTo)for(y=0,z=Z.length;y<z;y++)L=M=G=ya=D.value[Z[y]],D.array[I]=G.x,D.array[I+1]=G.y,D.array[I+2]=M.x,D.array[I+3]=M.y,D.array[I+4]=L.x,D.array[I+5]=L.y,I+=6}else if(3===D.size){var S;S="c"===D.type?["r","g","b"]:["x","y","z"];if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=0,z=Z.length;y<
+z;y++)B=ua[Z[y]],G=D.value[B.a],M=D.value[B.b],L=D.value[B.c],D.array[I]=G[S[0]],D.array[I+1]=G[S[1]],D.array[I+2]=G[S[2]],D.array[I+3]=M[S[0]],D.array[I+4]=M[S[1]],D.array[I+5]=M[S[2]],D.array[I+6]=L[S[0]],D.array[I+7]=L[S[1]],D.array[I+8]=L[S[2]],I+=9;else if("faces"===D.boundTo)for(y=0,z=Z.length;y<z;y++)L=M=G=ya=D.value[Z[y]],D.array[I]=G[S[0]],D.array[I+1]=G[S[1]],D.array[I+2]=G[S[2]],D.array[I+3]=M[S[0]],D.array[I+4]=M[S[1]],D.array[I+5]=M[S[2]],D.array[I+6]=L[S[0]],D.array[I+7]=L[S[1]],D.array[I+
+8]=L[S[2]],I+=9;else if("faceVertices"===D.boundTo)for(y=0,z=Z.length;y<z;y++)ya=D.value[Z[y]],G=ya[0],M=ya[1],L=ya[2],D.array[I]=G[S[0]],D.array[I+1]=G[S[1]],D.array[I+2]=G[S[2]],D.array[I+3]=M[S[0]],D.array[I+4]=M[S[1]],D.array[I+5]=M[S[2]],D.array[I+6]=L[S[0]],D.array[I+7]=L[S[1]],D.array[I+8]=L[S[2]],I+=9}else if(4===D.size)if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=0,z=Z.length;y<z;y++)B=ua[Z[y]],G=D.value[B.a],M=D.value[B.b],L=D.value[B.c],D.array[I]=G.x,D.array[I+1]=G.y,D.array[I+
+2]=G.z,D.array[I+3]=G.w,D.array[I+4]=M.x,D.array[I+5]=M.y,D.array[I+6]=M.z,D.array[I+7]=M.w,D.array[I+8]=L.x,D.array[I+9]=L.y,D.array[I+10]=L.z,D.array[I+11]=L.w,I+=12;else if("faces"===D.boundTo)for(y=0,z=Z.length;y<z;y++)L=M=G=ya=D.value[Z[y]],D.array[I]=G.x,D.array[I+1]=G.y,D.array[I+2]=G.z,D.array[I+3]=G.w,D.array[I+4]=M.x,D.array[I+5]=M.y,D.array[I+6]=M.z,D.array[I+7]=M.w,D.array[I+8]=L.x,D.array[I+9]=L.y,D.array[I+10]=L.z,D.array[I+11]=L.w,I+=12;else if("faceVertices"===D.boundTo)for(y=0,z=
+Z.length;y<z;y++)ya=D.value[Z[y]],G=ya[0],M=ya[1],L=ya[2],D.array[I]=G.x,D.array[I+1]=G.y,D.array[I+2]=G.z,D.array[I+3]=G.w,D.array[I+4]=M.x,D.array[I+5]=M.y,D.array[I+6]=M.z,D.array[I+7]=M.w,D.array[I+8]=L.x,D.array[I+9]=L.y,D.array[I+10]=L.z,D.array[I+11]=L.w,I+=12;m.bindBuffer(m.ARRAY_BUFFER,D.buffer);m.bufferData(m.ARRAY_BUFFER,D.array,C)}A&&(delete u.__inittedArrays,delete u.__colorArray,delete u.__normalArray,delete u.__tangentArray,delete u.__uvArray,delete u.__uv2Array,delete u.__faceArray,
+delete u.__vertexArray,delete u.__lineArray,delete u.__skinIndexArray,delete u.__skinWeightArray)}}}b.verticesNeedUpdate=!1;b.morphTargetsNeedUpdate=!1;b.elementsNeedUpdate=!1;b.uvsNeedUpdate=!1;b.normalsNeedUpdate=!1;b.colorsNeedUpdate=!1;b.tangentsNeedUpdate=!1;r.attributes&&x(r)}else if(a instanceof THREE.Line){r=c(a,b);s=r.attributes&&v(r);if(b.verticesNeedUpdate||b.colorsNeedUpdate||b.lineDistancesNeedUpdate||s){var Db=m.DYNAMIC_DRAW,R,$,Y,Ba,W,Eb,Sb=b.vertices,Kb=b.colors,mb=b.lineDistances,
+va=Sb.length,zb=Kb.length,Ab=mb.length,bb=b.__vertexArray,xb=b.__colorArray,nb=b.__lineDistanceArray,ob=b.colorsNeedUpdate,Fb=b.lineDistancesNeedUpdate,Tb=b.__webglCustomAttributesList,Lb,Wa,sa,Mb,Na,ea;if(b.verticesNeedUpdate){for(R=0;R<va;R++)Ba=Sb[R],W=3*R,bb[W]=Ba.x,bb[W+1]=Ba.y,bb[W+2]=Ba.z;m.bindBuffer(m.ARRAY_BUFFER,b.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,bb,Db)}if(ob){for($=0;$<zb;$++)Eb=Kb[$],W=3*$,xb[W]=Eb.r,xb[W+1]=Eb.g,xb[W+2]=Eb.b;m.bindBuffer(m.ARRAY_BUFFER,b.__webglColorBuffer);
+m.bufferData(m.ARRAY_BUFFER,xb,Db)}if(Fb){for(Y=0;Y<Ab;Y++)nb[Y]=mb[Y];m.bindBuffer(m.ARRAY_BUFFER,b.__webglLineDistanceBuffer);m.bufferData(m.ARRAY_BUFFER,nb,Db)}if(Tb)for(Lb=0,Wa=Tb.length;Lb<Wa;Lb++)if(ea=Tb[Lb],ea.needsUpdate&&(void 0===ea.boundTo||"vertices"===ea.boundTo)){W=0;Mb=ea.value.length;if(1===ea.size)for(sa=0;sa<Mb;sa++)ea.array[sa]=ea.value[sa];else if(2===ea.size)for(sa=0;sa<Mb;sa++)Na=ea.value[sa],ea.array[W]=Na.x,ea.array[W+1]=Na.y,W+=2;else if(3===ea.size)if("c"===ea.type)for(sa=
+0;sa<Mb;sa++)Na=ea.value[sa],ea.array[W]=Na.r,ea.array[W+1]=Na.g,ea.array[W+2]=Na.b,W+=3;else for(sa=0;sa<Mb;sa++)Na=ea.value[sa],ea.array[W]=Na.x,ea.array[W+1]=Na.y,ea.array[W+2]=Na.z,W+=3;else if(4===ea.size)for(sa=0;sa<Mb;sa++)Na=ea.value[sa],ea.array[W]=Na.x,ea.array[W+1]=Na.y,ea.array[W+2]=Na.z,ea.array[W+3]=Na.w,W+=4;m.bindBuffer(m.ARRAY_BUFFER,ea.buffer);m.bufferData(m.ARRAY_BUFFER,ea.array,Db);ea.needsUpdate=!1}}b.verticesNeedUpdate=!1;b.colorsNeedUpdate=!1;b.lineDistancesNeedUpdate=!1;r.attributes&&
+x(r)}else if(a instanceof THREE.PointCloud){r=c(a,b);s=r.attributes&&v(r);if(b.verticesNeedUpdate||b.colorsNeedUpdate||s){var eb=m.DYNAMIC_DRAW,Ub,Vb,ac,ja,bc,jb=b.vertices,vb=jb.length,Pb=b.colors,Wb=Pb.length,cc=b.__vertexArray,dc=b.__colorArray,Xb=b.colorsNeedUpdate,pb=b.__webglCustomAttributesList,ec,ub,ta,Nb,Oa,fa;if(b.verticesNeedUpdate){for(Ub=0;Ub<vb;Ub++)ac=jb[Ub],ja=3*Ub,cc[ja]=ac.x,cc[ja+1]=ac.y,cc[ja+2]=ac.z;m.bindBuffer(m.ARRAY_BUFFER,b.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,
+cc,eb)}if(Xb){for(Vb=0;Vb<Wb;Vb++)bc=Pb[Vb],ja=3*Vb,dc[ja]=bc.r,dc[ja+1]=bc.g,dc[ja+2]=bc.b;m.bindBuffer(m.ARRAY_BUFFER,b.__webglColorBuffer);m.bufferData(m.ARRAY_BUFFER,dc,eb)}if(pb)for(ec=0,ub=pb.length;ec<ub;ec++){fa=pb[ec];if(fa.needsUpdate&&(void 0===fa.boundTo||"vertices"===fa.boundTo))if(Nb=fa.value.length,ja=0,1===fa.size)for(ta=0;ta<Nb;ta++)fa.array[ta]=fa.value[ta];else if(2===fa.size)for(ta=0;ta<Nb;ta++)Oa=fa.value[ta],fa.array[ja]=Oa.x,fa.array[ja+1]=Oa.y,ja+=2;else if(3===fa.size)if("c"===
+fa.type)for(ta=0;ta<Nb;ta++)Oa=fa.value[ta],fa.array[ja]=Oa.r,fa.array[ja+1]=Oa.g,fa.array[ja+2]=Oa.b,ja+=3;else for(ta=0;ta<Nb;ta++)Oa=fa.value[ta],fa.array[ja]=Oa.x,fa.array[ja+1]=Oa.y,fa.array[ja+2]=Oa.z,ja+=3;else if(4===fa.size)for(ta=0;ta<Nb;ta++)Oa=fa.value[ta],fa.array[ja]=Oa.x,fa.array[ja+1]=Oa.y,fa.array[ja+2]=Oa.z,fa.array[ja+3]=Oa.w,ja+=4;m.bindBuffer(m.ARRAY_BUFFER,fa.buffer);m.bufferData(m.ARRAY_BUFFER,fa.array,eb);fa.needsUpdate=!1}}b.verticesNeedUpdate=!1;b.colorsNeedUpdate=!1;r.attributes&&
+x(r)}}function v(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function x(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function C(a){!0===a.transparent?qa.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):qa.setBlending(THREE.NoBlending);qa.setDepthTest(a.depthTest);qa.setDepthWrite(a.depthWrite);qa.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function w(a,
+b,c,d,e){var f,g,h,k;Ob=0;if(d.needsUpdate){d.program&&gc(d);d.addEventListener("dispose",hc);var l=pc[d.type];if(l){var p=THREE.ShaderLib[l];d.__webglShader={uniforms:THREE.UniformsUtils.clone(p.uniforms),vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var n=0,q=0,r=0,t=0,s=0,u=b.length;s<u;s++){var v=b[s];v.onlyShadow||!1===v.visible||(v instanceof THREE.DirectionalLight&&n++,
+v instanceof THREE.PointLight&&q++,v instanceof THREE.SpotLight&&r++,v instanceof THREE.HemisphereLight&&t++)}f=n;g=q;h=r;k=t;for(var w,x=0,C=0,E=b.length;C<E;C++){var G=b[C];G.castShadow&&(G instanceof THREE.SpotLight&&x++,G instanceof THREE.DirectionalLight&&!G.shadowCascade&&x++)}w=x;var M;if(Pb&&e&&e.skeleton&&e.skeleton.useVertexTexture)M=1024;else{var L=m.getParameter(m.MAX_VERTEX_UNIFORM_VECTORS),J=Math.floor((L-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(J=Math.min(e.skeleton.bones.length,
+J),J<e.skeleton.bones.length&&THREE.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+J+" (try OpenGL instead of ANGLE)"));M=J}var N={precision:Q,supportsVertexTextures:Wb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:d.sizeAttenuation,
+logarithmicDepthBuffer:Ka,skinning:d.skinning,maxBones:M,useVertexTexture:Pb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:B.maxMorphTargets,maxMorphNormals:B.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:w,shadowMapEnabled:B.shadowMapEnabled&&e.receiveShadow&&0<w,shadowMapType:B.shadowMapType,shadowMapDebug:B.shadowMapDebug,shadowMapCascade:B.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,
+wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},O=[];l?O.push(l):(O.push(d.fragmentShader),O.push(d.vertexShader));if(void 0!==d.defines)for(var U in d.defines)O.push(U),O.push(d.defines[U]);for(U in N)O.push(U),O.push(N[U]);for(var wa=O.join(),V,za=0,Ca=Va.length;za<Ca;za++){var Qa=Va[za];if(Qa.code===wa){V=Qa;V.usedTimes++;break}}void 0===V&&(V=new THREE.WebGLProgram(B,wa,d,N),Va.push(V),B.info.memory.programs=Va.length);d.program=V;var ca=V.attributes;
+if(d.morphTargets){d.numSupportedMorphTargets=0;for(var aa,La="morphTarget",ba=0;ba<B.maxMorphTargets;ba++)aa=La+ba,0<=ca[aa]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,La="morphNormal",ba=0;ba<B.maxMorphNormals;ba++)aa=La+ba,0<=ca[aa]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var cb in d.__webglShader.uniforms){var gb=d.program.uniforms[cb];gb&&d.uniformsList.push([d.__webglShader.uniforms[cb],gb])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&
+(e.__webglMorphTargetInfluences=new Float32Array(B.maxMorphTargets));var ma=!1,qa=!1,ra=!1,na=d.program,ha=na.uniforms,P=d.__webglShader.uniforms;na.id!==tb&&(m.useProgram(na.program),tb=na.id,ra=qa=ma=!0);d.id!==yb&&(-1===yb&&(ra=!0),yb=d.id,qa=!0);if(ma||a!==Gb)m.uniformMatrix4fv(ha.projectionMatrix,!1,a.projectionMatrix.elements),Ka&&m.uniform1f(ha.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Gb&&(Gb=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==
+ha.cameraPosition&&(xa.setFromMatrixPosition(a.matrixWorld),m.uniform3f(ha.cameraPosition,xa.x,xa.y,xa.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==ha.viewMatrix&&m.uniformMatrix4fv(ha.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==ha.bindMatrix&&m.uniformMatrix4fv(ha.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==
+ha.bindMatrixInverse&&m.uniformMatrix4fv(ha.bindMatrixInverse,!1,e.bindMatrixInverse.elements),Pb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==ha.boneTexture){var Ja=A();m.uniform1i(ha.boneTexture,Ja);B.setTexture(e.skeleton.boneTexture,Ja)}null!==ha.boneTextureWidth&&m.uniform1i(ha.boneTextureWidth,e.skeleton.boneTextureWidth);null!==ha.boneTextureHeight&&m.uniform1i(ha.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==ha.boneGlobalMatrices&&
+m.uniformMatrix4fv(ha.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(qa){c&&d.fog&&(P.fogColor.value=c.color,c instanceof THREE.Fog?(P.fogNear.value=c.near,P.fogFar.value=c.far):c instanceof THREE.FogExp2&&(P.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Hb){var ra=!0,ga,db,X,Pa=0,eb=0,fb=0,Wa,Da,pb,Ea,Xa,ka=ic,ib=ka.directional.colors,Ra=ka.directional.positions,Sa=ka.point.colors,jb=ka.point.positions,zb=ka.point.distances,
+Ab=ka.point.decays,Ya=ka.spot.colors,Aa=ka.spot.positions,kb=ka.spot.distances,Ma=ka.spot.directions,ia=ka.spot.anglesCos,oa=ka.spot.exponents,I=ka.spot.decays,ya=ka.hemi.skyColors,Za=ka.hemi.groundColors,ob=ka.hemi.positions,qb=0,Ta=0,pa=0,Fa=0,Ga=0,Ha=0,Ib=0,Bb=0,rb=0,D=0,ab=0,$a=0;ga=0;for(db=b.length;ga<db;ga++)X=b[ga],X.onlyShadow||(Wa=X.color,Ea=X.intensity,Xa=X.distance,X instanceof THREE.AmbientLight?X.visible&&(Pa+=Wa.r,eb+=Wa.g,fb+=Wa.b):X instanceof THREE.DirectionalLight?(Ga+=1,X.visible&&
+(la.setFromMatrixPosition(X.matrixWorld),xa.setFromMatrixPosition(X.target.matrixWorld),la.sub(xa),la.normalize(),rb=3*qb,Ra[rb]=la.x,Ra[rb+1]=la.y,Ra[rb+2]=la.z,H(ib,rb,Wa,Ea),qb+=1)):X instanceof THREE.PointLight?(Ha+=1,X.visible&&(D=3*Ta,H(Sa,D,Wa,Ea),xa.setFromMatrixPosition(X.matrixWorld),jb[D]=xa.x,jb[D+1]=xa.y,jb[D+2]=xa.z,zb[Ta]=Xa,Ab[Ta]=0===X.distance?0:X.decay,Ta+=1)):X instanceof THREE.SpotLight?(Ib+=1,X.visible&&(ab=3*pa,H(Ya,ab,Wa,Ea),la.setFromMatrixPosition(X.matrixWorld),Aa[ab]=la.x,
+Aa[ab+1]=la.y,Aa[ab+2]=la.z,kb[pa]=Xa,xa.setFromMatrixPosition(X.target.matrixWorld),la.sub(xa),la.normalize(),Ma[ab]=la.x,Ma[ab+1]=la.y,Ma[ab+2]=la.z,ia[pa]=Math.cos(X.angle),oa[pa]=X.exponent,I[pa]=0===X.distance?0:X.decay,pa+=1)):X instanceof THREE.HemisphereLight&&(Bb+=1,X.visible&&(la.setFromMatrixPosition(X.matrixWorld),la.normalize(),$a=3*Fa,ob[$a]=la.x,ob[$a+1]=la.y,ob[$a+2]=la.z,Da=X.color,pb=X.groundColor,H(ya,$a,Da,Ea),H(Za,$a,pb,Ea),Fa+=1)));ga=3*qb;for(db=Math.max(ib.length,3*Ga);ga<
+db;ga++)ib[ga]=0;ga=3*Ta;for(db=Math.max(Sa.length,3*Ha);ga<db;ga++)Sa[ga]=0;ga=3*pa;for(db=Math.max(Ya.length,3*Ib);ga<db;ga++)Ya[ga]=0;ga=3*Fa;for(db=Math.max(ya.length,3*Bb);ga<db;ga++)ya[ga]=0;ga=3*Fa;for(db=Math.max(Za.length,3*Bb);ga<db;ga++)Za[ga]=0;ka.directional.length=qb;ka.point.length=Ta;ka.spot.length=pa;ka.hemi.length=Fa;ka.ambient[0]=Pa;ka.ambient[1]=eb;ka.ambient[2]=fb;Hb=!1}if(ra){var da=ic;P.ambientLightColor.value=da.ambient;P.directionalLightColor.value=da.directional.colors;P.directionalLightDirection.value=
+da.directional.positions;P.pointLightColor.value=da.point.colors;P.pointLightPosition.value=da.point.positions;P.pointLightDistance.value=da.point.distances;P.pointLightDecay.value=da.point.decays;P.spotLightColor.value=da.spot.colors;P.spotLightPosition.value=da.spot.positions;P.spotLightDistance.value=da.spot.distances;P.spotLightDirection.value=da.spot.directions;P.spotLightAngleCos.value=da.spot.anglesCos;P.spotLightExponent.value=da.spot.exponents;P.spotLightDecay.value=da.spot.decays;P.hemisphereLightSkyColor.value=
+da.hemi.skyColors;P.hemisphereLightGroundColor.value=da.hemi.groundColors;P.hemisphereLightDirection.value=da.hemi.positions;y(P,!0)}else y(P,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){P.opacity.value=d.opacity;P.diffuse.value=d.color;P.map.value=d.map;P.lightMap.value=d.lightMap;P.specularMap.value=d.specularMap;P.alphaMap.value=d.alphaMap;d.bumpMap&&(P.bumpMap.value=d.bumpMap,P.bumpScale.value=d.bumpScale);d.normalMap&&
+(P.normalMap.value=d.normalMap,P.normalScale.value.copy(d.normalScale));var lb;d.map?lb=d.map:d.specularMap?lb=d.specularMap:d.normalMap?lb=d.normalMap:d.bumpMap?lb=d.bumpMap:d.alphaMap&&(lb=d.alphaMap);if(void 0!==lb){var ub=lb.offset,vb=lb.repeat;P.offsetRepeat.value.set(ub.x,ub.y,vb.x,vb.y)}P.envMap.value=d.envMap;P.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;P.reflectivity.value=d.reflectivity;P.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)P.diffuse.value=
+d.color,P.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)P.diffuse.value=d.color,P.opacity.value=d.opacity,P.dashSize.value=d.dashSize,P.totalSize.value=d.dashSize+d.gapSize,P.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(P.psColor.value=d.color,P.opacity.value=d.opacity,P.size.value=d.size,P.scale.value=T.height/2,P.map.value=d.map,null!==d.map){var Qb=d.map.offset,Rb=d.map.repeat;P.offsetRepeat.value.set(Qb.x,Qb.y,Rb.x,Rb.y)}}else d instanceof THREE.MeshPhongMaterial?
+(P.shininess.value=d.shininess,P.emissive.value=d.emissive,P.specular.value=d.specular,d.wrapAround&&P.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(P.emissive.value=d.emissive,d.wrapAround&&P.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(P.mNear.value=a.near,P.mFar.value=a.far,P.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(P.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&P.shadowMatrix)for(var wb=0,Cb=0,Z=b.length;Cb<
+Z;Cb++){var ua=b[Cb];ua.castShadow&&(ua instanceof THREE.SpotLight||ua instanceof THREE.DirectionalLight&&!ua.shadowCascade)&&(P.shadowMap.value[wb]=ua.shadowMap,P.shadowMapSize.value[wb]=ua.shadowMapSize,P.shadowMatrix.value[wb]=ua.shadowMatrix,P.shadowDarkness.value[wb]=ua.shadowDarkness,P.shadowBias.value[wb]=ua.shadowBias,wb++)}for(var Jb=d.uniformsList,Ua,hb,Ia,sb=0,fc=Jb.length;sb<fc;sb++){var S=Jb[sb][0];if(!1!==S.needsUpdate){var Db=S.type,R=S.value,$=Jb[sb][1];switch(Db){case "1i":m.uniform1i($,
+R);break;case "1f":m.uniform1f($,R);break;case "2f":m.uniform2f($,R[0],R[1]);break;case "3f":m.uniform3f($,R[0],R[1],R[2]);break;case "4f":m.uniform4f($,R[0],R[1],R[2],R[3]);break;case "1iv":m.uniform1iv($,R);break;case "3iv":m.uniform3iv($,R);break;case "1fv":m.uniform1fv($,R);break;case "2fv":m.uniform2fv($,R);break;case "3fv":m.uniform3fv($,R);break;case "4fv":m.uniform4fv($,R);break;case "Matrix3fv":m.uniformMatrix3fv($,!1,R);break;case "Matrix4fv":m.uniformMatrix4fv($,!1,R);break;case "i":m.uniform1i($,
+R);break;case "f":m.uniform1f($,R);break;case "v2":m.uniform2f($,R.x,R.y);break;case "v3":m.uniform3f($,R.x,R.y,R.z);break;case "v4":m.uniform4f($,R.x,R.y,R.z,R.w);break;case "c":m.uniform3f($,R.r,R.g,R.b);break;case "iv1":m.uniform1iv($,R);break;case "iv":m.uniform3iv($,R);break;case "fv1":m.uniform1fv($,R);break;case "fv":m.uniform3fv($,R);break;case "v2v":void 0===S._array&&(S._array=new Float32Array(2*R.length));for(var Y=0,Ba=R.length;Y<Ba;Y++)Ia=2*Y,S._array[Ia]=R[Y].x,S._array[Ia+1]=R[Y].y;
+m.uniform2fv($,S._array);break;case "v3v":void 0===S._array&&(S._array=new Float32Array(3*R.length));Y=0;for(Ba=R.length;Y<Ba;Y++)Ia=3*Y,S._array[Ia]=R[Y].x,S._array[Ia+1]=R[Y].y,S._array[Ia+2]=R[Y].z;m.uniform3fv($,S._array);break;case "v4v":void 0===S._array&&(S._array=new Float32Array(4*R.length));Y=0;for(Ba=R.length;Y<Ba;Y++)Ia=4*Y,S._array[Ia]=R[Y].x,S._array[Ia+1]=R[Y].y,S._array[Ia+2]=R[Y].z,S._array[Ia+3]=R[Y].w;m.uniform4fv($,S._array);break;case "m3":m.uniformMatrix3fv($,!1,R.elements);
+break;case "m3v":void 0===S._array&&(S._array=new Float32Array(9*R.length));Y=0;for(Ba=R.length;Y<Ba;Y++)R[Y].flattenToArrayOffset(S._array,9*Y);m.uniformMatrix3fv($,!1,S._array);break;case "m4":m.uniformMatrix4fv($,!1,R.elements);break;case "m4v":void 0===S._array&&(S._array=new Float32Array(16*R.length));Y=0;for(Ba=R.length;Y<Ba;Y++)R[Y].flattenToArrayOffset(S._array,16*Y);m.uniformMatrix4fv($,!1,S._array);break;case "t":Ua=R;hb=A();m.uniform1i($,hb);if(!Ua)continue;if(Ua instanceof THREE.CubeTexture||
+Ua.image instanceof Array&&6===Ua.image.length){var W=Ua,Eb=hb;if(6===W.image.length)if(W.needsUpdate){W.image.__webglTextureCube||(W.addEventListener("dispose",Xb),W.image.__webglTextureCube=m.createTexture(),B.info.memory.textures++);m.activeTexture(m.TEXTURE0+Eb);m.bindTexture(m.TEXTURE_CUBE_MAP,W.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,W.flipY);for(var Sb=W instanceof THREE.CompressedTexture,Kb=W.image[0]instanceof THREE.DataTexture,mb=[],va=0;6>va;va++)mb[va]=!B.autoScaleCubemaps||
+Sb||Kb?Kb?W.image[va].image:W.image[va]:z(W.image[va],qc);var Yb=mb[0],Zb=THREE.Math.isPowerOfTwo(Yb.width)&&THREE.Math.isPowerOfTwo(Yb.height),bb=K(W.format),xb=K(W.type);F(m.TEXTURE_CUBE_MAP,W,Zb);for(va=0;6>va;va++)if(Sb)for(var nb,$b=mb[va].mipmaps,Fb=0,Tb=$b.length;Fb<Tb;Fb++)nb=$b[Fb],W.format!==THREE.RGBAFormat&&W.format!==THREE.RGBFormat?-1<jc().indexOf(bb)?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+va,Fb,bb,nb.width,nb.height,0,nb.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):
+m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+va,Fb,bb,nb.width,nb.height,0,bb,xb,nb.data);else Kb?m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+va,0,bb,mb[va].width,mb[va].height,0,bb,xb,mb[va].data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+va,0,bb,bb,xb,mb[va]);W.generateMipmaps&&Zb&&m.generateMipmap(m.TEXTURE_CUBE_MAP);W.needsUpdate=!1;if(W.onUpdate)W.onUpdate()}else m.activeTexture(m.TEXTURE0+Eb),m.bindTexture(m.TEXTURE_CUBE_MAP,W.image.__webglTextureCube)}else if(Ua instanceof THREE.WebGLRenderTargetCube){var Lb=
+Ua;m.activeTexture(m.TEXTURE0+hb);m.bindTexture(m.TEXTURE_CUBE_MAP,Lb.__webglTexture)}else B.setTexture(Ua,hb);break;case "tv":void 0===S._array&&(S._array=[]);Y=0;for(Ba=S.value.length;Y<Ba;Y++)S._array[Y]=A();m.uniform1iv($,S._array);Y=0;for(Ba=S.value.length;Y<Ba;Y++)Ua=S.value[Y],hb=S._array[Y],Ua&&B.setTexture(Ua,hb);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+Db)}}}}m.uniformMatrix4fv(ha.modelViewMatrix,!1,e._modelViewMatrix.elements);ha.normalMatrix&&m.uniformMatrix3fv(ha.normalMatrix,
+!1,e._normalMatrix.elements);null!==ha.modelMatrix&&m.uniformMatrix4fv(ha.modelMatrix,!1,e.matrixWorld.elements);return na}function y(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=
+b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function A(){var a=Ob;a>=fc&&THREE.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+fc);Ob+=1;return a}function E(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}
+function H(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function F(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,K(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,K(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,K(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,K(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+
+b.sourceFile+" )"),m.texParameteri(a,m.TEXTURE_MAG_FILTER,N(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,N(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=ca.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||b.__currentAnisotropy)&&
+(m.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,B.getMaxAnisotropy())),b.__currentAnisotropy=b.anisotropy)}function z(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);THREE.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}
+function J(a,b){m.bindRenderbuffer(m.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,b.width,b.height)}function M(a){a instanceof
+THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function N(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?m.NEAREST:m.LINEAR}function K(a){var b;if(a===THREE.RepeatWrapping)return m.REPEAT;if(a===THREE.ClampToEdgeWrapping)return m.CLAMP_TO_EDGE;
+if(a===THREE.MirroredRepeatWrapping)return m.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return m.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return m.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return m.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return m.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return m.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return m.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return m.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return m.UNSIGNED_SHORT_4_4_4_4;
+if(a===THREE.UnsignedShort5551Type)return m.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return m.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return m.BYTE;if(a===THREE.ShortType)return m.SHORT;if(a===THREE.UnsignedShortType)return m.UNSIGNED_SHORT;if(a===THREE.IntType)return m.INT;if(a===THREE.UnsignedIntType)return m.UNSIGNED_INT;if(a===THREE.FloatType)return m.FLOAT;b=ca.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return m.ALPHA;
+if(a===THREE.RGBFormat)return m.RGB;if(a===THREE.RGBAFormat)return m.RGBA;if(a===THREE.LuminanceFormat)return m.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return m.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return m.FUNC_ADD;if(a===THREE.SubtractEquation)return m.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return m.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return m.ZERO;if(a===THREE.OneFactor)return m.ONE;if(a===THREE.SrcColorFactor)return m.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return m.ONE_MINUS_SRC_COLOR;
+if(a===THREE.SrcAlphaFactor)return m.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return m.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return m.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return m.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return m.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return m.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return m.SRC_ALPHA_SATURATE;b=ca.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;
+if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=ca.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
+if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=ca.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var T=void 0!==a.canvas?a.canvas:document.createElement("canvas"),O=void 0!==a.context?a.context:null,U=1,Q=void 0!==a.precision?a.precision:"highp",V=void 0!==a.alpha?a.alpha:!1,L=void 0!==a.depth?a.depth:!0,ma=void 0!==a.stencil?
+a.stencil:!0,ba=void 0!==a.antialias?a.antialias:!1,ra=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,G=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Ka=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,aa=new THREE.Color(0),na=0,wa=[],Ca={},za=[],Qa=[],La=[],gb=[],cb=[];this.domElement=T;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=
+!1;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var B=this,Va=[],tb=null,zb=null,yb=-1,Ja="",Gb=null,Ob=0,Ab=0,ob=0,Wa=T.width,eb=T.height,Yb=0,Zb=0,ib=new Uint8Array(16),Pa=new Uint8Array(16),jb=new THREE.Frustum,vb=new THREE.Matrix4;new THREE.Matrix4;
+var xa=new THREE.Vector3,la=new THREE.Vector3,Hb=!0,ic={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},m;try{var $b={alpha:V,depth:L,stencil:ma,antialias:ba,premultipliedAlpha:ra,preserveDrawingBuffer:G};m=O||T.getContext("webgl",$b)||T.getContext("experimental-webgl",
+$b);if(null===m){if(null!==T.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}T.addEventListener("webglcontextlost",function(a){a.preventDefault();kc();lc();Ca={}},!1)}catch(rc){THREE.error("THREE.WebGLRenderer: "+rc)}var qa=new THREE.WebGLState(m,K);void 0===m.getShaderPrecisionFormat&&(m.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var ca=new THREE.WebGLExtensions(m);ca.get("OES_texture_float");
+ca.get("OES_texture_float_linear");ca.get("OES_texture_half_float");ca.get("OES_texture_half_float_linear");ca.get("OES_standard_derivatives");Ka&&ca.get("EXT_frag_depth");var pb=function(a,b,c,d){!0===ra&&(a*=d,b*=d,c*=d);m.clearColor(a,b,c,d)},lc=function(){m.clearColor(0,0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);
+m.viewport(Ab,ob,Wa,eb);pb(aa.r,aa.g,aa.b,na)},kc=function(){Gb=tb=null;Ja="";yb=-1;Hb=!0;for(var a=0;a<Pa.length;a++)Pa[a]=0;qa.reset()};lc();this.context=m;this.state=qa;var fc=m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),sc=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS),tc=m.getParameter(m.MAX_TEXTURE_SIZE),qc=m.getParameter(m.MAX_CUBE_MAP_TEXTURE_SIZE),Wb=0<sc,Pb=Wb&&ca.get("OES_texture_float"),uc=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.HIGH_FLOAT),vc=m.getShaderPrecisionFormat(m.VERTEX_SHADER,
+m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.LOW_FLOAT);var wc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_FLOAT),xc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.LOW_FLOAT);var jc=function(){var a;return function(){if(void 0!==a)return a;a=[];if(ca.get("WEBGL_compressed_texture_pvrtc")||ca.get("WEBGL_compressed_texture_s3tc"))for(var b=m.getParameter(m.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);
+return a}}(),yc=0<uc.precision&&0<wc.precision,mc=0<vc.precision&&0<xc.precision;"highp"!==Q||yc||(mc?(Q="mediump",THREE.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(Q="lowp",THREE.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==Q||mc||(Q="lowp",THREE.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var zc=new THREE.ShadowMapPlugin(this,wa,Ca,za),Ac=new THREE.SpritePlugin(this,gb),Bc=new THREE.LensFlarePlugin(this,cb);this.getContext=
+function(){return m};this.forceContextLoss=function(){ca.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return Wb};this.supportsFloatTextures=function(){return ca.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return ca.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){return ca.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return ca.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=
+function(){return ca.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return ca.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=ca.get("EXT_texture_filter_anisotropic");return a=null!==b?m.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return Q};this.getPixelRatio=function(){return U};this.setPixelRatio=function(a){U=a};this.setSize=function(a,b,c){T.width=a*U;T.height=b*U;!1!==
+c&&(T.style.width=a+"px",T.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ab=a*U;ob=b*U;Wa=c*U;eb=d*U;m.viewport(Ab,ob,Wa,eb)};this.setScissor=function(a,b,c,d){m.scissor(a*U,b*U,c*U,d*U)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.getClearColor=function(){return aa};this.setClearColor=function(a,b){aa.set(a);na=void 0!==b?b:1;pb(aa.r,aa.g,aa.b,na)};this.getClearAlpha=function(){return na};this.setClearAlpha=function(a){na=
+a;pb(aa.r,aa.g,aa.b,na)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=m.COLOR_BUFFER_BIT;if(void 0===b||b)d|=m.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=m.STENCIL_BUFFER_BIT;m.clear(d)};this.clearColor=function(){m.clear(m.COLOR_BUFFER_BIT)};this.clearDepth=function(){m.clear(m.DEPTH_BUFFER_BIT)};this.clearStencil=function(){m.clear(m.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=kc;var ub=function(a){a.target.traverse(function(a){a.removeEventListener("remove",
+ub);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete Ca[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=za,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})},Qb=function(a){a=a.target;a.removeEventListener("dispose",Qb);delete a.__webglInit;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];
+void 0!==c.buffer&&(m.deleteBuffer(c.buffer),delete c.buffer)}B.info.memory.geometries--}else if(b=fb[a.id],void 0!==b){for(var c=0,d=b.length;c<d;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=0,g=e.numMorphTargets;f<g;f++)m.deleteBuffer(e.__webglMorphTargetsBuffers[f]);delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)m.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}nc(e)}delete fb[a.id]}else nc(a);
+Ja=""},Xb=function(a){a=a.target;a.removeEventListener("dispose",Xb);a.image&&a.image.__webglTextureCube?(m.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(m.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);B.info.memory.textures--},oc=function(a){a=a.target;a.removeEventListener("dispose",oc);if(a&&void 0!==a.__webglTexture){m.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=
+0;6>b;b++)m.deleteFramebuffer(a.__webglFramebuffer[b]),m.deleteRenderbuffer(a.__webglRenderbuffer[b]);else m.deleteFramebuffer(a.__webglFramebuffer),m.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}B.info.memory.textures--},hc=function(a){a=a.target;a.removeEventListener("dispose",hc);gc(a)},nc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),
+c=0,d=b.length;c<d;c++){var e=b[c];void 0!==a[e]&&(m.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)m.deleteBuffer(a.__webglCustomAttributesList[e].buffer);delete a.__webglCustomAttributesList}B.info.memory.geometries--},gc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Va.length;a<c;a++)if(d=Va[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=Va.length;a<
+c;a++)d=Va[a],d.program!==b&&e.push(d);Va=e;m.deleteProgram(b);B.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){e();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=m.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=m.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=m.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=m.createBuffer());a.hasPositions&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),
+m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),f(b.attributes.position),m.vertexAttribPointer(b.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormals){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,h,k,l,p,n,q,r,t,s,u,v=3*a.count;for(u=0;u<v;u+=9)s=a.normalArray,d=s[u],h=s[u+1],k=s[u+2],l=s[u+3],n=s[u+4],r=s[u+5],p=s[u+6],q=s[u+7],t=s[u+8],d=(d+l+p)/3,h=(h+n+q)/3,k=(k+r+t)/3,s[u]=d,s[u+1]=h,s[u+2]=k,s[u+3]=d,s[u+4]=h,s[u+5]=k,s[u+6]=d,s[u+
+7]=h,s[u+8]=k}m.bufferData(m.ARRAY_BUFFER,a.normalArray,m.DYNAMIC_DRAW);f(b.attributes.normal);m.vertexAttribPointer(b.attributes.normal,3,m.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglUvBuffer),m.bufferData(m.ARRAY_BUFFER,a.uvArray,m.DYNAMIC_DRAW),f(b.attributes.uv),m.vertexAttribPointer(b.attributes.uv,2,m.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),
+f(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));g();m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,f,g,h){if(!1!==f.visible)if(u(h),a=w(a,b,c,f,h),b=!1,c="direct_"+g.id+"_"+a.id+"_"+(f.wireframe?1:0),c!==Ja&&(Ja=c,b=!0),b&&e(),h instanceof THREE.Mesh){h=!0===f.wireframe?m.LINES:m.TRIANGLES;var k=g.attributes.index;if(k){var l,p;k.array instanceof Uint32Array&&ca.get("OES_element_index_uint")?(l=m.UNSIGNED_INT,p=4):(l=m.UNSIGNED_SHORT,
+p=2);c=g.offsets;if(0===c.length)b&&(d(f,a,g,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,k.buffer)),m.drawElements(h,k.array.length,l,0),B.info.render.calls++,B.info.render.vertices+=k.array.length,B.info.render.faces+=k.array.length/3;else{b=!0;for(var n=0,q=c.length;n<q;n++){var s=c[n].index;b&&(d(f,a,g,s),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,k.buffer));m.drawElements(h,c[n].count,l,c[n].start*p);B.info.render.calls++;B.info.render.vertices+=c[n].count;B.info.render.faces+=c[n].count/3}}}else b&&d(f,
+a,g,0),f=g.attributes.position,m.drawArrays(h,0,f.array.length/f.itemSize),B.info.render.calls++,B.info.render.vertices+=f.array.length/f.itemSize,B.info.render.faces+=f.array.length/(3*f.itemsize)}else if(h instanceof THREE.PointCloud)if(h=m.POINTS,k=g.attributes.index)if(k.array instanceof Uint32Array&&ca.get("OES_element_index_uint")?(l=m.UNSIGNED_INT,p=4):(l=m.UNSIGNED_SHORT,p=2),c=g.offsets,0===c.length)b&&(d(f,a,g,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,k.buffer)),m.drawElements(h,k.array.length,
+l,0),B.info.render.calls++,B.info.render.points+=k.array.length;else for(1<c.length&&(b=!0),n=0,q=c.length;n<q;n++)s=c[n].index,b&&(d(f,a,g,s),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,k.buffer)),m.drawElements(h,c[n].count,l,c[n].start*p),B.info.render.calls++,B.info.render.points+=c[n].count;else if(b&&d(f,a,g,0),f=g.attributes.position,c=g.offsets,0===c.length)m.drawArrays(h,0,f.array.length/3),B.info.render.calls++,B.info.render.points+=f.array.length/3;else for(n=0,q=c.length;n<q;n++)m.drawArrays(h,
+c[n].index,c[n].count),B.info.render.calls++,B.info.render.points+=c[n].count;else if(h instanceof THREE.Line)if(h=h.mode===THREE.LineStrip?m.LINE_STRIP:m.LINES,qa.setLineWidth(f.linewidth),k=g.attributes.index)if(k.array instanceof Uint32Array?(l=m.UNSIGNED_INT,p=4):(l=m.UNSIGNED_SHORT,p=2),c=g.offsets,0===c.length)b&&(d(f,a,g,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,k.buffer)),m.drawElements(h,k.array.length,l,0),B.info.render.calls++,B.info.render.vertices+=k.array.length;else for(1<c.length&&(b=
+!0),n=0,q=c.length;n<q;n++)s=c[n].index,b&&(d(f,a,g,s),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,k.buffer)),m.drawElements(h,c[n].count,l,c[n].start*p),B.info.render.calls++,B.info.render.vertices+=c[n].count;else if(b&&d(f,a,g,0),f=g.attributes.position,c=g.offsets,0===c.length)m.drawArrays(h,0,f.array.length/3),B.info.render.calls++,B.info.render.vertices+=f.array.length/3;else for(n=0,q=c.length;n<q;n++)m.drawArrays(h,c[n].index,c[n].count),B.info.render.calls++,B.info.render.vertices+=c[n].count};this.renderBuffer=
+function(a,b,c,d,h,k){if(!1!==d.visible){u(k);c=w(a,b,c,d,k);b=c.attributes;a=!1;c=h.id+"_"+c.id+"_"+(d.wireframe?1:0);c!==Ja&&(Ja=c,a=!0);a&&e();if(!d.morphTargets&&0<=b.position)a&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglVertexBuffer),f(b.position),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(m.bindBuffer(m.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[k.morphTargetBase]),f(c.position),m.vertexAttribPointer(c.position,
+3,m.FLOAT,!1,0,0)):0<=c.position&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglVertexBuffer),f(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length)for(var l=0,n=k.morphTargetForcedOrder,q=k.morphTargetInfluences,s;l<d.numSupportedMorphTargets&&l<n.length;)s=c["morphTarget"+l],0<=s&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[n[l]]),f(s),m.vertexAttribPointer(s,3,m.FLOAT,!1,0,0)),s=c["morphNormal"+l],0<=s&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,
+h.__webglMorphNormalsBuffers[n[l]]),f(s),m.vertexAttribPointer(s,3,m.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[l]=q[n[l]],l++;else{n=[];q=k.morphTargetInfluences;l=k.geometry.morphTargets;q.length>l.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),q.length=l.length);l=0;for(s=q.length;l<s;l++)n.push([q[l],l]);n.length>d.numSupportedMorphTargets?(n.sort(p),n.length=d.numSupportedMorphTargets):n.length>d.numSupportedMorphNormals?n.sort(p):0===n.length&&
+n.push([0,0]);for(var l=0,r=d.numSupportedMorphTargets;l<r;l++)if(n[l]){var t=n[l][1];s=c["morphTarget"+l];0<=s&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[t]),f(s),m.vertexAttribPointer(s,3,m.FLOAT,!1,0,0));s=c["morphNormal"+l];0<=s&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglMorphNormalsBuffers[t]),f(s),m.vertexAttribPointer(s,3,m.FLOAT,!1,0,0));k.__webglMorphTargetInfluences[l]=q[t]}else k.__webglMorphTargetInfluences[l]=0}null!==d.program.uniforms.morphTargetInfluences&&
+m.uniform1fv(d.program.uniforms.morphTargetInfluences,k.__webglMorphTargetInfluences)}if(a){if(h.__webglCustomAttributesList)for(c=0,q=h.__webglCustomAttributesList.length;c<q;c++)n=h.__webglCustomAttributesList[c],0<=b[n.buffer.belongsToAttribute]&&(m.bindBuffer(m.ARRAY_BUFFER,n.buffer),f(b[n.buffer.belongsToAttribute]),m.vertexAttribPointer(b[n.buffer.belongsToAttribute],n.size,m.FLOAT,!1,0,0));0<=b.color&&(0<k.geometry.colors.length||0<k.geometry.faces.length?(m.bindBuffer(m.ARRAY_BUFFER,h.__webglColorBuffer),
+f(b.color),m.vertexAttribPointer(b.color,3,m.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&m.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglNormalBuffer),f(b.normal),m.vertexAttribPointer(b.normal,3,m.FLOAT,!1,0,0));0<=b.tangent&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglTangentBuffer),f(b.tangent),m.vertexAttribPointer(b.tangent,4,m.FLOAT,!1,0,0));0<=b.uv&&(k.geometry.faceVertexUvs[0]?(m.bindBuffer(m.ARRAY_BUFFER,h.__webglUVBuffer),f(b.uv),
+m.vertexAttribPointer(b.uv,2,m.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(k.geometry.faceVertexUvs[1]?(m.bindBuffer(m.ARRAY_BUFFER,h.__webglUV2Buffer),f(b.uv2),m.vertexAttribPointer(b.uv2,2,m.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),f(b.skinIndex),m.vertexAttribPointer(b.skinIndex,
+4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),f(b.skinWeight),m.vertexAttribPointer(b.skinWeight,4,m.FLOAT,!1,0,0));0<=b.lineDistance&&(m.bindBuffer(m.ARRAY_BUFFER,h.__webglLineDistanceBuffer),f(b.lineDistance),m.vertexAttribPointer(b.lineDistance,1,m.FLOAT,!1,0,0))}g();k instanceof THREE.Mesh?(k=h.__typeArray===Uint32Array?m.UNSIGNED_INT:m.UNSIGNED_SHORT,d.wireframe?(qa.setLineWidth(d.wireframeLinewidth),a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),m.drawElements(m.LINES,
+h.__webglLineCount,k,0)):(a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),m.drawElements(m.TRIANGLES,h.__webglFaceCount,k,0)),B.info.render.calls++,B.info.render.vertices+=h.__webglFaceCount,B.info.render.faces+=h.__webglFaceCount/3):k instanceof THREE.Line?(k=k.mode===THREE.LineStrip?m.LINE_STRIP:m.LINES,qa.setLineWidth(d.linewidth),m.drawArrays(k,0,h.__webglLineCount),B.info.render.calls++):k instanceof THREE.PointCloud&&(m.drawArrays(m.POINTS,0,h.__webglParticleCount),B.info.render.calls++,
+B.info.render.points+=h.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)THREE.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;Ja="";yb=-1;Gb=null;Hb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);vb.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);
+jb.setFromMatrix(vb);wa.length=0;Qa.length=0;La.length=0;gb.length=0;cb.length=0;n(a);!0===B.sortObjects&&(Qa.sort(h),La.sort(k));zc.render(a,b);B.info.render.calls=0;B.info.render.vertices=0;B.info.render.faces=0;B.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);d=0;for(var f=za.length;d<f;d++){var g=za[d],m=g.object;m.visible&&(E(m,b),s(g))}a.overrideMaterial?(d=a.overrideMaterial,C(d),q(Qa,b,wa,e,d),q(La,
+b,wa,e,d),l(za,"",b,wa,e,d)):(qa.setBlending(THREE.NoBlending),q(Qa,b,wa,e,null),l(za,"opaque",b,wa,e,null),q(La,b,wa,e,null),l(za,"transparent",b,wa,e,null));Ac.render(a,b);Bc.render(a,b,Yb,Zb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&M(c);qa.setDepthTest(!0);qa.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=w(a,b,c,d,e);Ja="";B.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,m,jb):e.render(function(a){B.renderBufferImmediate(a,
+f,d)})};var fb={},Rb=0,pc={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?m.disable(m.CULL_FACE):(b===THREE.FrontFaceDirectionCW?m.frontFace(m.CW):m.frontFace(m.CCW),a===THREE.CullFaceBack?m.cullFace(m.BACK):a===THREE.CullFaceFront?m.cullFace(m.FRONT):m.cullFace(m.FRONT_AND_BACK),
+m.enable(m.CULL_FACE))};this.setMaterialFaces=function(a){qa.setDoubleSided(a.side===THREE.DoubleSide);qa.setFlipSided(a.side===THREE.BackSide)};this.uploadTexture=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Xb),a.__webglTexture=m.createTexture(),B.info.memory.textures++);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);m.pixelStorei(m.UNPACK_ALIGNMENT,
+a.unpackAlignment);a.image=z(a.image,tc);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=K(a.format),e=K(a.type);F(m.TEXTURE_2D,a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<f.length&&c){for(var g=0,h=f.length;g<h;g++)b=f[g],m.texImage2D(m.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(g=0,h=f.length;g<h;g++)b=f[g],
+a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<jc().indexOf(d)?m.compressedTexImage2D(m.TEXTURE_2D,g,d,b.width,b.height,0,b.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):m.texImage2D(m.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);else if(0<f.length&&c){g=0;for(h=f.length;g<h;g++)b=f[g],m.texImage2D(m.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&m.generateMipmap(m.TEXTURE_2D);
+a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()};this.setTexture=function(a,b){m.activeTexture(m.TEXTURE0+b);a.needsUpdate?B.uploadTexture(a):m.bindTexture(m.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",oc);a.__webglTexture=m.createTexture();B.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&
+THREE.Math.isPowerOfTwo(a.height),d=K(a.format),e=K(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);F(m.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,
+m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);J(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),F(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,
+d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):J(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,
+null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Wa,a=eb,d=Ab,e=ob);b!==zb&&(m.bindFramebuffer(m.FRAMEBUFFER,b),m.viewport(d,e,c,a),zb=b);Yb=c;Zb=a};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(a.__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");
+else{var g=!1;a.__webglFramebuffer!==zb&&(m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),g=!0);m.checkFramebufferStatus(m.FRAMEBUFFER)===m.FRAMEBUFFER_COMPLETE?m.readPixels(b,c,d,e,m.RGBA,m.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&m.bindFramebuffer(m.FRAMEBUFFER,zb)}};this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};
+this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}};
 THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:
 THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null};
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;
 a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
 THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
 break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&THREE.warn("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}};
-THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,p=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var s="ENVMAP_TYPE_CUBE",t="ENVMAP_MODE_REFLECTION",r="ENVMAP_BLENDING_MULTIPLY";
+THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,p=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var l="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?l="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(l="SHADOWMAP_TYPE_PCF_SOFT");var s="ENVMAP_TYPE_CUBE",t="ENVMAP_MODE_REFLECTION",r="ENVMAP_BLENDING_MULTIPLY";
 if(e.envMap){switch(d.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:s="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:s="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:s="ENVMAP_TYPE_SPHERE"}switch(d.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_MODE_REFRACTION"}switch(d.combine){case THREE.MultiplyOperation:r="ENVMAP_BLENDING_MULTIPLY";
 break;case THREE.MixOperation:r="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:r="ENVMAP_BLENDING_ADD"}}var u=0<b.gammaFactor?b.gammaFactor:1,v,x;v=[];for(var C in g)x=g[C],!1!==x&&(x="#define "+C+" "+x,v.push(x));v=v.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",v,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":
 "","#define GAMMA_FACTOR "+u,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+t:"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":
-"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?
+"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?
 "#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"),
 b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",v,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+
 u,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+s:"",e.envMap?"#define "+t:"",e.envMap?"#define "+r:"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":
-"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));p=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+p);n=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+n);f.attachShader(g,p);f.attachShader(g,
+"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));p=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+p);n=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+n);f.attachShader(g,p);f.attachShader(g,
 n);void 0!==q&&f.bindAttribLocation(g,0,q);f.linkProgram(g);q=f.getProgramInfoLog(g);!1===f.getProgramParameter(g,f.LINK_STATUS)&&THREE.error("THREE.WebGLProgram: shader error: "+f.getError(),"gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS),"gl.getPRogramInfoLog",q);""!==q&&THREE.warn("THREE.WebGLProgram: gl.getProgramInfoLog()"+q);f.deleteShader(p);f.deleteShader(n);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");
-e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var w in h)q.push(w);h=q;w={};q=0;for(b=h.length;q<b;q++)m=h[q],w[m]=f.getUniformLocation(g,m);this.uniforms=w;q="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)q.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)q.push("morphNormal"+h);for(var y in k)q.push(y);
+e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var w in h)q.push(w);h=q;w={};q=0;for(b=h.length;q<b;q++)l=h[q],w[l]=f.getUniformLocation(g,l);this.uniforms=w;q="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)q.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)q.push("morphNormal"+h);for(var y in k)q.push(y);
 e=q;k={};y=0;for(h=e.length;y<h;y++)w=e[y],k[w]=f.getAttribLocation(g,w);this.attributes=k;this.attributesKeys=Object.keys(this.attributes);this.id=a++;this.code=c;this.usedTimes=1;this.program=g;this.vertexShader=p;this.fragmentShader=n;return this}}();
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){c=b.createShader(c);b.shaderSource(c,d);b.compileShader(c);!1===b.getShaderParameter(c,b.COMPILE_STATUS)&&THREE.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(c)&&THREE.warn("THREE.WebGLShader: gl.getShaderInfoLog()",b.getShaderInfoLog(c),a(d));return c}}();
-THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,p,n,q,m=a.context,s,t,r,u,v,x;this.render=function(C,w,y,A){if(0!==b.length){C=new THREE.Vector3;var F=A/y,G=.5*y,E=.5*A,z=16/A,L=new THREE.Vector2(z*F,z),J=new THREE.Vector3(1,1,0),M=new THREE.Vector2(1,1);if(void 0===r){var z=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),K=new Uint16Array([0,1,2,0,2,3]);s=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,s);m.bufferData(m.ARRAY_BUFFER,z,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
-t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,K,m.STATIC_DRAW);v=m.createTexture();x=m.createTexture();m.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);m.bindTexture(m.TEXTURE_2D,x);m.texImage2D(m.TEXTURE_2D,0,
-m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var z=(u=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
+THREE.WebGLState=function(a,b){var c=-1,d=-1,e=-1,f=-1,g=-1,h=-1,k=-1,p=-1,n=-1,q=-1,l=-1,s=null,t=null,r=null,u=null;this.setBlending=function(l,n,p,q,s,r,t){l!==c&&(l===THREE.NoBlending?a.disable(a.BLEND):l===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):l===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):l===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),
+a.blendFunc(a.ZERO,a.SRC_COLOR)):l===THREE.CustomBlending?a.enable(a.BLEND):(a.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),c=l);if(l===THREE.CustomBlending){s=s||n;r=r||p;t=t||q;if(n!==d||s!==g)a.blendEquationSeparate(b(n),b(s)),d=n,g=s;if(p!==e||q!==f||r!==h||t!==k)a.blendFuncSeparate(b(p),b(q),b(r),b(t)),e=p,f=q,h=r,k=t}else k=h=g=f=e=d=null};this.setDepthTest=function(b){p!==b&&(b?a.enable(a.DEPTH_TEST):
+a.disable(a.DEPTH_TEST),p=b)};this.setDepthWrite=function(b){n!==b&&(a.depthMask(b),n=b)};this.setDoubleSided=function(b){q!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),q=b)};this.setFlipSided=function(b){l!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),l=b)};this.setLineWidth=function(b){b!==s&&(a.lineWidth(b),s=b)};this.setPolygonOffset=function(b,c,d){t!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),t=b);!b||r===c&&u===d||(a.polygonOffset(c,d),r=c,u=d)};this.reset=
+function(){l=q=n=p=c=-1}};
+THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,p,n,q,l=a.context,s,t,r,u,v,x;this.render=function(C,w,y,A){if(0!==b.length){C=new THREE.Vector3;var E=A/y,H=.5*y,F=.5*A,z=16/A,J=new THREE.Vector2(z*E,z),M=new THREE.Vector3(1,1,0),N=new THREE.Vector2(1,1);if(void 0===r){var z=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),K=new Uint16Array([0,1,2,0,2,3]);s=l.createBuffer();t=l.createBuffer();l.bindBuffer(l.ARRAY_BUFFER,s);l.bufferData(l.ARRAY_BUFFER,z,l.STATIC_DRAW);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
+t);l.bufferData(l.ELEMENT_ARRAY_BUFFER,K,l.STATIC_DRAW);v=l.createTexture();x=l.createTexture();l.bindTexture(l.TEXTURE_2D,v);l.texImage2D(l.TEXTURE_2D,0,l.RGB,16,16,0,l.RGB,l.UNSIGNED_BYTE,null);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST);l.bindTexture(l.TEXTURE_2D,x);l.texImage2D(l.TEXTURE_2D,0,
+l.RGBA,16,16,0,l.RGBA,l.UNSIGNED_BYTE,null);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST);var z=(u=0<l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
-K=m.createProgram(),S=m.createShader(m.FRAGMENT_SHADER),O=m.createShader(m.VERTEX_SHADER),N="precision "+a.getPrecision()+" float;\n";m.shaderSource(S,N+z.fragmentShader);m.shaderSource(O,N+z.vertexShader);m.compileShader(S);m.compileShader(O);m.attachShader(K,S);m.attachShader(K,O);m.linkProgram(K);r=K;n=m.getAttribLocation(r,"position");q=m.getAttribLocation(r,"uv");c=m.getUniformLocation(r,"renderType");d=m.getUniformLocation(r,"map");e=m.getUniformLocation(r,"occlusionMap");f=m.getUniformLocation(r,
-"opacity");g=m.getUniformLocation(r,"color");h=m.getUniformLocation(r,"scale");k=m.getUniformLocation(r,"rotation");p=m.getUniformLocation(r,"screenPosition")}m.useProgram(r);m.enableVertexAttribArray(n);m.enableVertexAttribArray(q);m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,s);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(q,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);m.disable(m.CULL_FACE);m.depthMask(!1);K=0;for(S=b.length;K<S;K++)if(z=16/A,L.set(z*
-F,z),O=b[K],C.set(O.matrixWorld.elements[12],O.matrixWorld.elements[13],O.matrixWorld.elements[14]),C.applyMatrix4(w.matrixWorldInverse),C.applyProjection(w.projectionMatrix),J.copy(C),M.x=J.x*G+G,M.y=J.y*E+E,u||0<M.x&&M.x<y&&0<M.y&&M.y<A){m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,M.x-8,M.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,L.x,L.y);m.uniform3f(p,J.x,J.y,J.z);m.disable(m.BLEND);m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,
-0);m.activeTexture(m.TEXTURE0);m.bindTexture(m.TEXTURE_2D,x);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,M.x-8,M.y-8,16,16,0);m.uniform1i(c,1);m.disable(m.DEPTH_TEST);m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);O.positionScreen.copy(J);O.customUpdateCallback?O.customUpdateCallback(O):O.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var N=0,P=O.lensFlares.length;N<P;N++){var V=O.lensFlares[N];.001<V.opacity&&.001<V.scale&&(J.x=V.x,
-J.y=V.y,J.z=V.z,z=V.size*V.scale/A,L.x=z*F,L.y=z,m.uniform3f(p,J.x,J.y,J.z),m.uniform2f(h,L.x,L.y),m.uniform1f(k,V.rotation),m.uniform1f(f,V.opacity),m.uniform3f(g,V.color.r,V.color.g,V.color.b),a.setBlending(V.blending,V.blendEquation,V.blendSrc,V.blendDst),a.setTexture(V.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
-THREE.ShadowMapPlugin=function(a,b,c,d){function e(a,b,d){if(b.visible){var f=c[b.id];if(f&&b.castShadow&&(!1===b.frustumCulled||!0===n.intersectsObject(b)))for(var g=0,h=f.length;g<h;g++){var k=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld);r.push(k)}g=0;for(h=b.children.length;g<h;g++)e(a,b.children[g],d)}}var f=a.context,g,h,k,p,n=new THREE.Frustum,q=new THREE.Matrix4,m=new THREE.Vector3,s=new THREE.Vector3,t=new THREE.Vector3,r=[],u=THREE.ShaderLib.depthRGBA,v=THREE.UniformsUtils.clone(u.uniforms);
+K=l.createProgram(),T=l.createShader(l.FRAGMENT_SHADER),O=l.createShader(l.VERTEX_SHADER),U="precision "+a.getPrecision()+" float;\n";l.shaderSource(T,U+z.fragmentShader);l.shaderSource(O,U+z.vertexShader);l.compileShader(T);l.compileShader(O);l.attachShader(K,T);l.attachShader(K,O);l.linkProgram(K);r=K;n=l.getAttribLocation(r,"position");q=l.getAttribLocation(r,"uv");c=l.getUniformLocation(r,"renderType");d=l.getUniformLocation(r,"map");e=l.getUniformLocation(r,"occlusionMap");f=l.getUniformLocation(r,
+"opacity");g=l.getUniformLocation(r,"color");h=l.getUniformLocation(r,"scale");k=l.getUniformLocation(r,"rotation");p=l.getUniformLocation(r,"screenPosition")}l.useProgram(r);l.enableVertexAttribArray(n);l.enableVertexAttribArray(q);l.uniform1i(e,0);l.uniform1i(d,1);l.bindBuffer(l.ARRAY_BUFFER,s);l.vertexAttribPointer(n,2,l.FLOAT,!1,16,0);l.vertexAttribPointer(q,2,l.FLOAT,!1,16,8);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,t);l.disable(l.CULL_FACE);l.depthMask(!1);K=0;for(T=b.length;K<T;K++)if(z=16/A,J.set(z*
+E,z),O=b[K],C.set(O.matrixWorld.elements[12],O.matrixWorld.elements[13],O.matrixWorld.elements[14]),C.applyMatrix4(w.matrixWorldInverse),C.applyProjection(w.projectionMatrix),M.copy(C),N.x=M.x*H+H,N.y=M.y*F+F,u||0<N.x&&N.x<y&&0<N.y&&N.y<A){l.activeTexture(l.TEXTURE1);l.bindTexture(l.TEXTURE_2D,v);l.copyTexImage2D(l.TEXTURE_2D,0,l.RGB,N.x-8,N.y-8,16,16,0);l.uniform1i(c,0);l.uniform2f(h,J.x,J.y);l.uniform3f(p,M.x,M.y,M.z);l.disable(l.BLEND);l.enable(l.DEPTH_TEST);l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,
+0);l.activeTexture(l.TEXTURE0);l.bindTexture(l.TEXTURE_2D,x);l.copyTexImage2D(l.TEXTURE_2D,0,l.RGBA,N.x-8,N.y-8,16,16,0);l.uniform1i(c,1);l.disable(l.DEPTH_TEST);l.activeTexture(l.TEXTURE1);l.bindTexture(l.TEXTURE_2D,v);l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0);O.positionScreen.copy(M);O.customUpdateCallback?O.customUpdateCallback(O):O.updateLensFlares();l.uniform1i(c,2);l.enable(l.BLEND);for(var U=0,Q=O.lensFlares.length;U<Q;U++){var V=O.lensFlares[U];.001<V.opacity&&.001<V.scale&&(M.x=V.x,
+M.y=V.y,M.z=V.z,z=V.size*V.scale/A,J.x=z*E,J.y=z,l.uniform3f(p,M.x,M.y,M.z),l.uniform2f(h,J.x,J.y),l.uniform1f(k,V.rotation),l.uniform1f(f,V.opacity),l.uniform3f(g,V.color.r,V.color.g,V.color.b),a.state.setBlending(V.blending,V.blendEquation,V.blendSrc,V.blendDst),a.setTexture(V.texture,1),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0))}}l.enable(l.CULL_FACE);l.enable(l.DEPTH_TEST);l.depthMask(!0);a.resetGLState()}}};
+THREE.ShadowMapPlugin=function(a,b,c,d){function e(a,b,d){if(b.visible){var f=c[b.id];if(f&&b.castShadow&&(!1===b.frustumCulled||!0===n.intersectsObject(b)))for(var g=0,h=f.length;g<h;g++){var k=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld);r.push(k)}g=0;for(h=b.children.length;g<h;g++)e(a,b.children[g],d)}}var f=a.context,g,h,k,p,n=new THREE.Frustum,q=new THREE.Matrix4,l=new THREE.Vector3,s=new THREE.Vector3,t=new THREE.Vector3,r=[],u=THREE.ShaderLib.depthRGBA,v=THREE.UniformsUtils.clone(u.uniforms);
 g=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader});h=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0});k=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,skinning:!0});p=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0,skinning:!0});g._shadowPass=!0;h._shadowPass=!0;k._shadowPass=
-!0;p._shadowPass=!0;this.render=function(c,u){if(!1!==a.shadowMapEnabled){var v,y,A,F,G,E,z,L,J=[];F=0;f.clearColor(1,1,1,1);f.disable(f.BLEND);f.enable(f.CULL_FACE);f.frontFace(f.CCW);a.shadowMapCullFace===THREE.CullFaceFront?f.cullFace(f.FRONT):f.cullFace(f.BACK);a.setDepthTest(!0);v=0;for(y=b.length;v<y;v++)if(A=b[v],A.castShadow)if(A instanceof THREE.DirectionalLight&&A.shadowCascade)for(G=0;G<A.shadowCascadeCount;G++){var M;if(A.shadowCascadeArray[G])M=A.shadowCascadeArray[G];else{z=A;var K=
-G;M=new THREE.DirectionalLight;M.isVirtual=!0;M.onlyShadow=!0;M.castShadow=!0;M.shadowCameraNear=z.shadowCameraNear;M.shadowCameraFar=z.shadowCameraFar;M.shadowCameraLeft=z.shadowCameraLeft;M.shadowCameraRight=z.shadowCameraRight;M.shadowCameraBottom=z.shadowCameraBottom;M.shadowCameraTop=z.shadowCameraTop;M.shadowCameraVisible=z.shadowCameraVisible;M.shadowDarkness=z.shadowDarkness;M.shadowBias=z.shadowCascadeBias[K];M.shadowMapWidth=z.shadowCascadeWidth[K];M.shadowMapHeight=z.shadowCascadeHeight[K];
-M.pointsWorld=[];M.pointsFrustum=[];L=M.pointsWorld;E=M.pointsFrustum;for(var S=0;8>S;S++)L[S]=new THREE.Vector3,E[S]=new THREE.Vector3;L=z.shadowCascadeNearZ[K];z=z.shadowCascadeFarZ[K];E[0].set(-1,-1,L);E[1].set(1,-1,L);E[2].set(-1,1,L);E[3].set(1,1,L);E[4].set(-1,-1,z);E[5].set(1,-1,z);E[6].set(-1,1,z);E[7].set(1,1,z);M.originalCamera=u;E=new THREE.Gyroscope;E.position.copy(A.shadowCascadeOffset);E.add(M);E.add(M.target);u.add(E);A.shadowCascadeArray[G]=M}K=A;L=G;z=K.shadowCascadeArray[L];z.position.copy(K.position);
-z.target.position.copy(K.target.position);z.lookAt(z.target);z.shadowCameraVisible=K.shadowCameraVisible;z.shadowDarkness=K.shadowDarkness;z.shadowBias=K.shadowCascadeBias[L];E=K.shadowCascadeNearZ[L];K=K.shadowCascadeFarZ[L];z=z.pointsFrustum;z[0].z=E;z[1].z=E;z[2].z=E;z[3].z=E;z[4].z=K;z[5].z=K;z[6].z=K;z[7].z=K;J[F]=M;F++}else J[F]=A,F++;v=0;for(y=J.length;v<y;v++){A=J[v];A.shadowMap||(G=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&(G=THREE.NearestFilter),A.shadowMap=new THREE.WebGLRenderTarget(A.shadowMapWidth,
-A.shadowMapHeight,{minFilter:G,magFilter:G,format:THREE.RGBAFormat}),A.shadowMapSize=new THREE.Vector2(A.shadowMapWidth,A.shadowMapHeight),A.shadowMatrix=new THREE.Matrix4);if(!A.shadowCamera){if(A instanceof THREE.SpotLight)A.shadowCamera=new THREE.PerspectiveCamera(A.shadowCameraFov,A.shadowMapWidth/A.shadowMapHeight,A.shadowCameraNear,A.shadowCameraFar);else if(A instanceof THREE.DirectionalLight)A.shadowCamera=new THREE.OrthographicCamera(A.shadowCameraLeft,A.shadowCameraRight,A.shadowCameraTop,
-A.shadowCameraBottom,A.shadowCameraNear,A.shadowCameraFar);else{THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",A);continue}c.add(A.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}A.shadowCameraVisible&&!A.cameraHelper&&(A.cameraHelper=new THREE.CameraHelper(A.shadowCamera),c.add(A.cameraHelper));if(A.isVirtual&&M.originalCamera==u){G=u;F=A.shadowCamera;E=A.pointsFrustum;z=A.pointsWorld;m.set(Infinity,Infinity,Infinity);s.set(-Infinity,-Infinity,-Infinity);for(K=0;8>
-K;K++)L=z[K],L.copy(E[K]),L.unproject(G),L.applyMatrix4(F.matrixWorldInverse),L.x<m.x&&(m.x=L.x),L.x>s.x&&(s.x=L.x),L.y<m.y&&(m.y=L.y),L.y>s.y&&(s.y=L.y),L.z<m.z&&(m.z=L.z),L.z>s.z&&(s.z=L.z);F.left=m.x;F.right=s.x;F.top=s.y;F.bottom=m.y;F.updateProjectionMatrix()}F=A.shadowMap;E=A.shadowMatrix;G=A.shadowCamera;G.position.setFromMatrixPosition(A.matrixWorld);t.setFromMatrixPosition(A.target.matrixWorld);G.lookAt(t);G.updateMatrixWorld();G.matrixWorldInverse.getInverse(G.matrixWorld);A.cameraHelper&&
-(A.cameraHelper.visible=A.shadowCameraVisible);A.shadowCameraVisible&&A.cameraHelper.update();E.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);E.multiply(G.projectionMatrix);E.multiply(G.matrixWorldInverse);q.multiplyMatrices(G.projectionMatrix,G.matrixWorldInverse);n.setFromMatrix(q);a.setRenderTarget(F);a.clear();r.length=0;e(c,c,G);A=0;for(F=r.length;A<F;A++)z=r[A],E=z.object,z=z.buffer,K=E.material instanceof THREE.MeshFaceMaterial?E.material.materials[0]:E.material,L=void 0!==E.geometry.morphTargets&&
-0<E.geometry.morphTargets.length&&K.morphTargets,S=E instanceof THREE.SkinnedMesh&&K.skinning,L=E.customDepthMaterial?E.customDepthMaterial:S?L?p:k:L?h:g,a.setMaterialFaces(K),z instanceof THREE.BufferGeometry?a.renderBufferDirect(G,b,null,L,z,E):a.renderBuffer(G,b,null,L,z,E);A=0;for(F=d.length;A<F;A++)z=d[A],E=z.object,E.visible&&E.castShadow&&(E._modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,E.matrixWorld),a.renderImmediateObject(G,b,null,g,E))}v=a.getClearColor();y=a.getClearAlpha();f.clearColor(v.r,
+!0;p._shadowPass=!0;this.render=function(c,u){if(!1!==a.shadowMapEnabled){var v,y,A,E,H,F,z,J,M=[];E=0;f.clearColor(1,1,1,1);f.disable(f.BLEND);f.enable(f.CULL_FACE);f.frontFace(f.CCW);a.shadowMapCullFace===THREE.CullFaceFront?f.cullFace(f.FRONT):f.cullFace(f.BACK);a.state.setDepthTest(!0);v=0;for(y=b.length;v<y;v++)if(A=b[v],A.castShadow)if(A instanceof THREE.DirectionalLight&&A.shadowCascade)for(H=0;H<A.shadowCascadeCount;H++){var N;if(A.shadowCascadeArray[H])N=A.shadowCascadeArray[H];else{z=A;
+var K=H;N=new THREE.DirectionalLight;N.isVirtual=!0;N.onlyShadow=!0;N.castShadow=!0;N.shadowCameraNear=z.shadowCameraNear;N.shadowCameraFar=z.shadowCameraFar;N.shadowCameraLeft=z.shadowCameraLeft;N.shadowCameraRight=z.shadowCameraRight;N.shadowCameraBottom=z.shadowCameraBottom;N.shadowCameraTop=z.shadowCameraTop;N.shadowCameraVisible=z.shadowCameraVisible;N.shadowDarkness=z.shadowDarkness;N.shadowBias=z.shadowCascadeBias[K];N.shadowMapWidth=z.shadowCascadeWidth[K];N.shadowMapHeight=z.shadowCascadeHeight[K];
+N.pointsWorld=[];N.pointsFrustum=[];J=N.pointsWorld;F=N.pointsFrustum;for(var T=0;8>T;T++)J[T]=new THREE.Vector3,F[T]=new THREE.Vector3;J=z.shadowCascadeNearZ[K];z=z.shadowCascadeFarZ[K];F[0].set(-1,-1,J);F[1].set(1,-1,J);F[2].set(-1,1,J);F[3].set(1,1,J);F[4].set(-1,-1,z);F[5].set(1,-1,z);F[6].set(-1,1,z);F[7].set(1,1,z);N.originalCamera=u;F=new THREE.Gyroscope;F.position.copy(A.shadowCascadeOffset);F.add(N);F.add(N.target);u.add(F);A.shadowCascadeArray[H]=N}K=A;J=H;z=K.shadowCascadeArray[J];z.position.copy(K.position);
+z.target.position.copy(K.target.position);z.lookAt(z.target);z.shadowCameraVisible=K.shadowCameraVisible;z.shadowDarkness=K.shadowDarkness;z.shadowBias=K.shadowCascadeBias[J];F=K.shadowCascadeNearZ[J];K=K.shadowCascadeFarZ[J];z=z.pointsFrustum;z[0].z=F;z[1].z=F;z[2].z=F;z[3].z=F;z[4].z=K;z[5].z=K;z[6].z=K;z[7].z=K;M[E]=N;E++}else M[E]=A,E++;v=0;for(y=M.length;v<y;v++){A=M[v];A.shadowMap||(H=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&(H=THREE.NearestFilter),A.shadowMap=new THREE.WebGLRenderTarget(A.shadowMapWidth,
+A.shadowMapHeight,{minFilter:H,magFilter:H,format:THREE.RGBAFormat}),A.shadowMapSize=new THREE.Vector2(A.shadowMapWidth,A.shadowMapHeight),A.shadowMatrix=new THREE.Matrix4);if(!A.shadowCamera){if(A instanceof THREE.SpotLight)A.shadowCamera=new THREE.PerspectiveCamera(A.shadowCameraFov,A.shadowMapWidth/A.shadowMapHeight,A.shadowCameraNear,A.shadowCameraFar);else if(A instanceof THREE.DirectionalLight)A.shadowCamera=new THREE.OrthographicCamera(A.shadowCameraLeft,A.shadowCameraRight,A.shadowCameraTop,
+A.shadowCameraBottom,A.shadowCameraNear,A.shadowCameraFar);else{THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",A);continue}c.add(A.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}A.shadowCameraVisible&&!A.cameraHelper&&(A.cameraHelper=new THREE.CameraHelper(A.shadowCamera),c.add(A.cameraHelper));if(A.isVirtual&&N.originalCamera==u){H=u;E=A.shadowCamera;F=A.pointsFrustum;z=A.pointsWorld;l.set(Infinity,Infinity,Infinity);s.set(-Infinity,-Infinity,-Infinity);for(K=0;8>
+K;K++)J=z[K],J.copy(F[K]),J.unproject(H),J.applyMatrix4(E.matrixWorldInverse),J.x<l.x&&(l.x=J.x),J.x>s.x&&(s.x=J.x),J.y<l.y&&(l.y=J.y),J.y>s.y&&(s.y=J.y),J.z<l.z&&(l.z=J.z),J.z>s.z&&(s.z=J.z);E.left=l.x;E.right=s.x;E.top=s.y;E.bottom=l.y;E.updateProjectionMatrix()}E=A.shadowMap;F=A.shadowMatrix;H=A.shadowCamera;H.position.setFromMatrixPosition(A.matrixWorld);t.setFromMatrixPosition(A.target.matrixWorld);H.lookAt(t);H.updateMatrixWorld();H.matrixWorldInverse.getInverse(H.matrixWorld);A.cameraHelper&&
+(A.cameraHelper.visible=A.shadowCameraVisible);A.shadowCameraVisible&&A.cameraHelper.update();F.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);F.multiply(H.projectionMatrix);F.multiply(H.matrixWorldInverse);q.multiplyMatrices(H.projectionMatrix,H.matrixWorldInverse);n.setFromMatrix(q);a.setRenderTarget(E);a.clear();r.length=0;e(c,c,H);A=0;for(E=r.length;A<E;A++)z=r[A],F=z.object,z=z.buffer,K=F.material instanceof THREE.MeshFaceMaterial?F.material.materials[0]:F.material,J=void 0!==F.geometry.morphTargets&&
+0<F.geometry.morphTargets.length&&K.morphTargets,T=F instanceof THREE.SkinnedMesh&&K.skinning,J=F.customDepthMaterial?F.customDepthMaterial:T?J?p:k:J?h:g,a.setMaterialFaces(K),z instanceof THREE.BufferGeometry?a.renderBufferDirect(H,b,null,J,z,F):a.renderBuffer(H,b,null,J,z,F);A=0;for(E=d.length;A<E;A++)z=d[A],F=z.object,F.visible&&F.castShadow&&(F._modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,F.matrixWorld),a.renderImmediateObject(H,b,null,g,F))}v=a.getClearColor();y=a.getClearAlpha();f.clearColor(v.r,
 v.g,v.b,y);f.enable(f.BLEND);a.shadowMapCullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,p,n,q,m,s,t,r,u,v,x;function C(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,y,A,F,G,E=new THREE.Vector3,z=new THREE.Quaternion,L=new THREE.Vector3;this.render=function(J,M){if(0!==b.length){if(void 0===F){var K=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),S=new Uint16Array([0,1,2,0,2,3]);y=w.createBuffer();A=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,y);w.bufferData(w.ARRAY_BUFFER,K,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
-A);w.bufferData(w.ELEMENT_ARRAY_BUFFER,S,w.STATIC_DRAW);var K=w.createProgram(),S=w.createShader(w.VERTEX_SHADER),O=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(S,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
+THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,p,n,q,l,s,t,r,u,v,x;function C(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,y,A,E,H,F=new THREE.Vector3,z=new THREE.Quaternion,J=new THREE.Vector3;this.render=function(M,N){if(0!==b.length){if(void 0===E){var K=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),T=new Uint16Array([0,1,2,0,2,3]);y=w.createBuffer();A=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,y);w.bufferData(w.ARRAY_BUFFER,K,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
+A);w.bufferData(w.ELEMENT_ARRAY_BUFFER,T,w.STATIC_DRAW);var K=w.createProgram(),T=w.createShader(w.VERTEX_SHADER),O=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(T,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
 w.shaderSource(O,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
-w.compileShader(S);w.compileShader(O);w.attachShader(K,S);w.attachShader(K,O);w.linkProgram(K);F=K;v=w.getAttribLocation(F,"position");x=w.getAttribLocation(F,"uv");c=w.getUniformLocation(F,"uvOffset");d=w.getUniformLocation(F,"uvScale");e=w.getUniformLocation(F,"rotation");f=w.getUniformLocation(F,"scale");g=w.getUniformLocation(F,"color");h=w.getUniformLocation(F,"map");k=w.getUniformLocation(F,"opacity");p=w.getUniformLocation(F,"modelViewMatrix");n=w.getUniformLocation(F,"projectionMatrix");q=
-w.getUniformLocation(F,"fogType");m=w.getUniformLocation(F,"fogDensity");s=w.getUniformLocation(F,"fogNear");t=w.getUniformLocation(F,"fogFar");r=w.getUniformLocation(F,"fogColor");u=w.getUniformLocation(F,"alphaTest");K=document.createElement("canvas");K.width=8;K.height=8;S=K.getContext("2d");S.fillStyle="white";S.fillRect(0,0,8,8);G=new THREE.Texture(K);G.needsUpdate=!0}w.useProgram(F);w.enableVertexAttribArray(v);w.enableVertexAttribArray(x);w.disable(w.CULL_FACE);w.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,
-y);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,A);w.uniformMatrix4fv(n,!1,M.projectionMatrix.elements);w.activeTexture(w.TEXTURE0);w.uniform1i(h,0);S=K=0;(O=J.fog)?(w.uniform3f(r,O.color.r,O.color.g,O.color.b),O instanceof THREE.Fog?(w.uniform1f(s,O.near),w.uniform1f(t,O.far),w.uniform1i(q,1),S=K=1):O instanceof THREE.FogExp2&&(w.uniform1f(m,O.density),w.uniform1i(q,2),S=K=2)):(w.uniform1i(q,0),S=K=0);for(var O=0,N=b.length;O<
-N;O++){var P=b[O];P._modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,P.matrixWorld);P.z=-P._modelViewMatrix.elements[14]}b.sort(C);for(var V=[],O=0,N=b.length;O<N;O++){var P=b[O],I=P.material;w.uniform1f(u,I.alphaTest);w.uniformMatrix4fv(p,!1,P._modelViewMatrix.elements);P.matrixWorld.decompose(E,z,L);V[0]=L.x;V[1]=L.y;P=0;J.fog&&I.fog&&(P=S);K!==P&&(w.uniform1i(q,P),K=P);null!==I.map?(w.uniform2f(c,I.map.offset.x,I.map.offset.y),w.uniform2f(d,I.map.repeat.x,I.map.repeat.y)):(w.uniform2f(c,
-0,0),w.uniform2f(d,1,1));w.uniform1f(k,I.opacity);w.uniform3f(g,I.color.r,I.color.g,I.color.b);w.uniform1f(e,I.rotation);w.uniform2fv(f,V);a.setBlending(I.blending,I.blendEquation,I.blendSrc,I.blendDst);a.setDepthTest(I.depthTest);a.setDepthWrite(I.depthWrite);I.map&&I.map.image&&I.map.image.width?a.setTexture(I.map,0):a.setTexture(G,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}w.enable(w.CULL_FACE);a.resetGLState()}}};
+w.compileShader(T);w.compileShader(O);w.attachShader(K,T);w.attachShader(K,O);w.linkProgram(K);E=K;v=w.getAttribLocation(E,"position");x=w.getAttribLocation(E,"uv");c=w.getUniformLocation(E,"uvOffset");d=w.getUniformLocation(E,"uvScale");e=w.getUniformLocation(E,"rotation");f=w.getUniformLocation(E,"scale");g=w.getUniformLocation(E,"color");h=w.getUniformLocation(E,"map");k=w.getUniformLocation(E,"opacity");p=w.getUniformLocation(E,"modelViewMatrix");n=w.getUniformLocation(E,"projectionMatrix");q=
+w.getUniformLocation(E,"fogType");l=w.getUniformLocation(E,"fogDensity");s=w.getUniformLocation(E,"fogNear");t=w.getUniformLocation(E,"fogFar");r=w.getUniformLocation(E,"fogColor");u=w.getUniformLocation(E,"alphaTest");K=document.createElement("canvas");K.width=8;K.height=8;T=K.getContext("2d");T.fillStyle="white";T.fillRect(0,0,8,8);H=new THREE.Texture(K);H.needsUpdate=!0}w.useProgram(E);w.enableVertexAttribArray(v);w.enableVertexAttribArray(x);w.disable(w.CULL_FACE);w.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,
+y);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,A);w.uniformMatrix4fv(n,!1,N.projectionMatrix.elements);w.activeTexture(w.TEXTURE0);w.uniform1i(h,0);T=K=0;(O=M.fog)?(w.uniform3f(r,O.color.r,O.color.g,O.color.b),O instanceof THREE.Fog?(w.uniform1f(s,O.near),w.uniform1f(t,O.far),w.uniform1i(q,1),T=K=1):O instanceof THREE.FogExp2&&(w.uniform1f(l,O.density),w.uniform1i(q,2),T=K=2)):(w.uniform1i(q,0),T=K=0);for(var O=0,U=b.length;O<
+U;O++){var Q=b[O];Q._modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,Q.matrixWorld);Q.z=-Q._modelViewMatrix.elements[14]}b.sort(C);for(var V=[],O=0,U=b.length;O<U;O++){var Q=b[O],L=Q.material;w.uniform1f(u,L.alphaTest);w.uniformMatrix4fv(p,!1,Q._modelViewMatrix.elements);Q.matrixWorld.decompose(F,z,J);V[0]=J.x;V[1]=J.y;Q=0;M.fog&&L.fog&&(Q=T);K!==Q&&(w.uniform1i(q,Q),K=Q);null!==L.map?(w.uniform2f(c,L.map.offset.x,L.map.offset.y),w.uniform2f(d,L.map.repeat.x,L.map.repeat.y)):(w.uniform2f(c,
+0,0),w.uniform2f(d,1,1));w.uniform1f(k,L.opacity);w.uniform3f(g,L.color.r,L.color.g,L.color.b);w.uniform1f(e,L.rotation);w.uniform2fv(f,V);a.state.setBlending(L.blending,L.blendEquation,L.blendSrc,L.blendDst);a.state.setDepthTest(L.depthTest);a.state.setDepthWrite(L.depthWrite);L.map&&L.map.image&&L.map.image.width?a.setTexture(L.map,0):a.setTexture(H,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}w.enable(w.CULL_FACE);a.resetGLState()}}};
 THREE.GeometryUtils={merge:function(a,b,c){THREE.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){THREE.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
 THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);e.load(a,function(a){f.image=a;f.needsUpdate=!0;c&&c(f)},void 0,function(a){d&&d(a)});f.sourceFile=a;return f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a;g+=1;6===g&&(f.needsUpdate=!0,c&&
 c(f))},void 0,d)};for(var h=0,k=a.length;h<k;++h)b(h);return f},loadCompressedTexture:function(){THREE.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){THREE.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");
-f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),p=k.data,n=0;n<d;n++)for(var q=0;q<e;q++){var m=0>q-1?0:q-1,s=q+1>e-1?e-1:q+1,t=0>n-1?0:n-1,r=n+1>d-1?d-1:n+1,u=[],v=[0,0,h[4*(q*d+n)]/255*b];u.push([-1,0,h[4*(q*d+t)]/255*b]);u.push([-1,-1,h[4*(m*d+t)]/255*b]);u.push([0,-1,h[4*(m*d+n)]/255*b]);u.push([1,-1,h[4*(m*d+r)]/255*b]);u.push([1,0,h[4*(q*d+r)]/255*b]);u.push([1,1,h[4*(s*d+r)]/255*b]);u.push([0,1,h[4*(s*d+n)]/255*
-b]);u.push([-1,1,h[4*(s*d+t)]/255*b]);m=[];t=u.length;for(s=0;s<t;s++){var r=u[s],x=u[(s+1)%t],r=[r[0]-v[0],r[1]-v[1],r[2]-v[2]],x=[x[0]-v[0],x[1]-v[1],x[2]-v[2]];m.push(c([r[1]*x[2]-r[2]*x[1],r[2]*x[0]-r[0]*x[2],r[0]*x[1]-r[1]*x[0]]))}u=[0,0,0];for(s=0;s<m.length;s++)u[0]+=m[s][0],u[1]+=m[s][1],u[2]+=m[s][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;v=4*(q*d+n);p[v]=(u[0]+1)/2*255|0;p[v+1]=(u[1]+1)/2*255|0;p[v+2]=255*u[2]|0;p[v+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
+f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),p=k.data,n=0;n<d;n++)for(var q=0;q<e;q++){var l=0>q-1?0:q-1,s=q+1>e-1?e-1:q+1,t=0>n-1?0:n-1,r=n+1>d-1?d-1:n+1,u=[],v=[0,0,h[4*(q*d+n)]/255*b];u.push([-1,0,h[4*(q*d+t)]/255*b]);u.push([-1,-1,h[4*(l*d+t)]/255*b]);u.push([0,-1,h[4*(l*d+n)]/255*b]);u.push([1,-1,h[4*(l*d+r)]/255*b]);u.push([1,0,h[4*(q*d+r)]/255*b]);u.push([1,1,h[4*(s*d+r)]/255*b]);u.push([0,1,h[4*(s*d+n)]/255*
+b]);u.push([-1,1,h[4*(s*d+t)]/255*b]);l=[];t=u.length;for(s=0;s<t;s++){var r=u[s],x=u[(s+1)%t],r=[r[0]-v[0],r[1]-v[1],r[2]-v[2]],x=[x[0]-v[0],x[1]-v[1],x[2]-v[2]];l.push(c([r[1]*x[2]-r[2]*x[1],r[2]*x[0]-r[0]*x[2],r[0]*x[1]-r[1]*x[0]]))}u=[0,0,0];for(s=0;s<l.length;s++)u[0]+=l[s][0],u[1]+=l[s][1],u[2]+=l[s][2];u[0]/=l.length;u[1]/=l.length;u[2]/=l.length;v=4*(q*d+n);p[v]=(u[0]+1)/2*255|0;p[v+1]=(u[1]+1)/2*255|0;p[v+2]=255*u[2]|0;p[v+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
 b,c){var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
 THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing.";}},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=
-a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,p,n,q,m,s,t,r,u,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),p=b.length,a=0;a<p;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);
-break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d;n=b[a++]*c;s=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(s,t,k,n);if(g=f[f.length-1])for(q=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++){var x=g/h;THREE.Shape.Utils.b2(x,q,s,k);THREE.Shape.Utils.b2(x,m,t,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,s=b[a++]*c+d,t=b[a++]*c,r=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(s,t,r,u,k,n),g=f[f.length-1])for(q=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++)x=g/h,THREE.Shape.Utils.b3(x,q,s,r,k),THREE.Shape.Utils.b3(x,
-m,t,u,n)}return{offset:v.ha*c,path:e}}}};
+a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,p,n,q,l,s,t,r,u,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),p=b.length,a=0;a<p;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);
+break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d;n=b[a++]*c;s=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(s,t,k,n);if(g=f[f.length-1])for(q=g.x,l=g.y,g=1,h=this.divisions;g<=h;g++){var x=g/h;THREE.Shape.Utils.b2(x,q,s,k);THREE.Shape.Utils.b2(x,l,t,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,s=b[a++]*c+d,t=b[a++]*c,r=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(s,t,r,u,k,n),g=f[f.length-1])for(q=g.x,l=g.y,g=1,h=this.divisions;g<=h;g++)x=g/h,THREE.Shape.Utils.b3(x,q,s,r,k),THREE.Shape.Utils.b3(x,
+l,t,u,n)}return{offset:v.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,p,n;if(0<b(a))for(p=0;p<e;p++)g[p]=p;else for(p=0;p<e;p++)g[p]=e-1-p;var q=2*e;for(p=e-1;2<e;){if(0>=q--){THREE.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=p;e<=k&&(k=0);p=k+1;e<=p&&(p=0);n=p+1;e<=n&&(n=0);var m;a:{var s=m=void 0,t=void 0,r=void 0,
-u=void 0,v=void 0,x=void 0,C=void 0,w=void 0,s=a[g[k]].x,t=a[g[k]].y,r=a[g[p]].x,u=a[g[p]].y,v=a[g[n]].x,x=a[g[n]].y;if(1E-10>(r-s)*(x-t)-(u-t)*(v-s))m=!1;else{var y=void 0,A=void 0,F=void 0,G=void 0,E=void 0,z=void 0,L=void 0,J=void 0,M=void 0,K=void 0,M=J=L=w=C=void 0,y=v-r,A=x-u,F=s-v,G=t-x,E=r-s,z=u-t;for(m=0;m<e;m++)if(C=a[g[m]].x,w=a[g[m]].y,!(C===s&&w===t||C===r&&w===u||C===v&&w===x)&&(L=C-s,J=w-t,M=C-r,K=w-u,C-=v,w-=x,M=y*K-A*M,L=E*J-z*L,J=F*w-G*C,-1E-10<=M&&-1E-10<=J&&-1E-10<=L)){m=!1;break a}m=
-!0}}if(m){f.push([a[g[k]],a[g[p]],a[g[n]]]);h.push([g[k],g[p],g[n]]);k=p;for(n=p+1;n<e;k++,n++)g[k]=g[n];e--;q=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;
+(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,p,n;if(0<b(a))for(p=0;p<e;p++)g[p]=p;else for(p=0;p<e;p++)g[p]=e-1-p;var q=2*e;for(p=e-1;2<e;){if(0>=q--){THREE.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=p;e<=k&&(k=0);p=k+1;e<=p&&(p=0);n=p+1;e<=n&&(n=0);var l;a:{var s=l=void 0,t=void 0,r=void 0,
+u=void 0,v=void 0,x=void 0,C=void 0,w=void 0,s=a[g[k]].x,t=a[g[k]].y,r=a[g[p]].x,u=a[g[p]].y,v=a[g[n]].x,x=a[g[n]].y;if(1E-10>(r-s)*(x-t)-(u-t)*(v-s))l=!1;else{var y=void 0,A=void 0,E=void 0,H=void 0,F=void 0,z=void 0,J=void 0,M=void 0,N=void 0,K=void 0,N=M=J=w=C=void 0,y=v-r,A=x-u,E=s-v,H=t-x,F=r-s,z=u-t;for(l=0;l<e;l++)if(C=a[g[l]].x,w=a[g[l]].y,!(C===s&&w===t||C===r&&w===u||C===v&&w===x)&&(J=C-s,M=w-t,N=C-r,K=w-u,C-=v,w-=x,N=y*K-A*N,J=F*M-z*J,M=E*w-H*C,-1E-10<=N&&-1E-10<=M&&-1E-10<=J)){l=!1;break a}l=
+!0}}if(l){f.push([a[g[k]],a[g[p]],a[g[n]]]);h.push([g[k],g[p],g[n]]);k=p;for(n=p+1;n<e;k++,n++)g[k]=g[n];e--;q=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain)};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);THREE.Audio.prototype.constructor=THREE.Audio;
 THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.source.connect(b.panner);b.source.start(0)})};c.send();return this};THREE.Audio.prototype.setLoop=function(a){this.source.loop=a};THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a};THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a};
 THREE.Audio.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3;return function(b){THREE.Object3D.prototype.updateMatrixWorld.call(this,b);a.setFromMatrixPosition(this.matrixWorld);this.panner.setPosition(a.x,a.y,a.z)}}();THREE.AudioListener=function(){THREE.Object3D.call(this);this.type="AudioListener";this.context=new (window.AudioContext||window.webkitAudioContext)};THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype);THREE.AudioListener.prototype.constructor=THREE.AudioListener;
@@ -661,21 +661,21 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.s
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(k);k=k.getPoint(1);h.push(k.x);h.push(k.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})};
 THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};
-THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,p,n,q,m,s,t,r;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];q=f[0];m=f[1];0<c.length?(g=c[c.length-1],s=g.x,
-t=g.y):(g=this.actions[d-1].args,s=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)r=f/a,g=THREE.Shape.Utils.b2(r,s,q,h),r=THREE.Shape.Utils.b2(r,t,m,k),c.push(new THREE.Vector2(g,r));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];q=f[0];m=f[1];p=f[2];n=f[3];0<c.length?(g=c[c.length-1],s=g.x,t=g.y):(g=this.actions[d-1].args,s=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)r=f/a,g=THREE.Shape.Utils.b3(r,s,q,p,h),r=THREE.Shape.Utils.b3(r,t,m,n,k),c.push(new THREE.Vector2(g,r));break;case THREE.PathActions.CSPLINE_THRU:g=
-this.actions[d-1].args;r=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;r=r.concat(f[0]);r=new THREE.SplineCurve(r);for(f=1;f<=g;f++)c.push(r.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];m=f[2];p=f[3];g=f[4];q=!!f[5];s=g-p;t=2*a;for(f=1;f<=t;f++)r=f/t,q||(r=1-r),r=p+r*s,g=h+m*Math.cos(r),r=k+m*Math.sin(r),c.push(new THREE.Vector2(g,r));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],m=f[2],n=f[3],p=f[4],g=f[5],q=!!f[6],s=g-p,t=2*a,f=1;f<=t;f++)r=f/t,q||
-(r=1-r),r=p+r*s,g=h+m*Math.cos(r),r=k+n*Math.sin(r),c.push(new THREE.Vector2(g,r))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
-THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;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(1E-10<Math.abs(m)){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<=
+THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,p,n,q,l,s,t,r;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];q=f[0];l=f[1];0<c.length?(g=c[c.length-1],s=g.x,
+t=g.y):(g=this.actions[d-1].args,s=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)r=f/a,g=THREE.Shape.Utils.b2(r,s,q,h),r=THREE.Shape.Utils.b2(r,t,l,k),c.push(new THREE.Vector2(g,r));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];q=f[0];l=f[1];p=f[2];n=f[3];0<c.length?(g=c[c.length-1],s=g.x,t=g.y):(g=this.actions[d-1].args,s=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)r=f/a,g=THREE.Shape.Utils.b3(r,s,q,p,h),r=THREE.Shape.Utils.b3(r,t,l,n,k),c.push(new THREE.Vector2(g,r));break;case THREE.PathActions.CSPLINE_THRU:g=
+this.actions[d-1].args;r=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;r=r.concat(f[0]);r=new THREE.SplineCurve(r);for(f=1;f<=g;f++)c.push(r.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];l=f[2];p=f[3];g=f[4];q=!!f[5];s=g-p;t=2*a;for(f=1;f<=t;f++)r=f/t,q||(r=1-r),r=p+r*s,g=h+l*Math.cos(r),r=k+l*Math.sin(r),c.push(new THREE.Vector2(g,r));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],l=f[2],n=f[3],p=f[4],g=f[5],q=!!f[6],s=g-p,t=2*a,f=1;f<=t;f++)r=f/t,q||
+(r=1-r),r=p+r*s,g=h+l*Math.cos(r),r=k+n*Math.sin(r),c.push(new THREE.Vector2(g,r))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
+THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;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,l=h.y-g.y;if(1E-10<Math.abs(l)){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.y<g.y||a.y>h.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=l*(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=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;b<c;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);0!=g.actions.length&&f.push(g);return f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var f,g,h,k=[];if(1==e.length)return g=e[0],h=new THREE.Shape,h.actions=g.actions,h.curves=g.curves,k.push(h),k;var p=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),p=a?!p:p;
-h=[];var n=[],q=[],m=0,s;n[m]=void 0;q[m]=[];var t,r;t=0;for(r=e.length;t<r;t++)g=e[t],s=g.getPoints(),f=THREE.Shape.Utils.isClockWise(s),(f=a?!f:f)?(!p&&n[m]&&m++,n[m]={s:new THREE.Shape,p:s},n[m].s.actions=g.actions,n[m].s.curves=g.curves,p&&m++,q[m]=[]):q[m].push({h:g,p:s[0]});if(!n[0])return c(e);if(1<n.length){t=!1;r=[];g=0;for(e=n.length;g<e;g++)h[g]=[];g=0;for(e=n.length;g<e;g++)for(f=q[g],p=0;p<f.length;p++){m=f[p];s=!0;for(var u=0;u<n.length;u++)d(m.p,n[u].p)&&(g!=u&&r.push({froms:g,tos:u,
-hole:p}),s?(s=!1,h[u].push(m)):t=!0);s&&h[g].push(m)}0<r.length&&(t||(q=h))}t=0;for(r=n.length;t<r;t++)for(h=n[t].s,k.push(h),g=q[t],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
+h=[];var n=[],q=[],l=0,s;n[l]=void 0;q[l]=[];var t,r;t=0;for(r=e.length;t<r;t++)g=e[t],s=g.getPoints(),f=THREE.Shape.Utils.isClockWise(s),(f=a?!f:f)?(!p&&n[l]&&l++,n[l]={s:new THREE.Shape,p:s},n[l].s.actions=g.actions,n[l].s.curves=g.curves,p&&l++,q[l]=[]):q[l].push({h:g,p:s[0]});if(!n[0])return c(e);if(1<n.length){t=!1;r=[];g=0;for(e=n.length;g<e;g++)h[g]=[];g=0;for(e=n.length;g<e;g++)for(f=q[g],p=0;p<f.length;p++){l=f[p];s=!0;for(var u=0;u<n.length;u++)d(l.p,n[u].p)&&(g!=u&&r.push({froms:g,tos:u,
+hole:p}),s?(s=!1,h[u].push(l)):t=!0);s&&h[g].push(l)}0<r.length&&(t||(q=h))}t=0;for(r=n.length;t<r;t++)for(h=n[t].s,k.push(h),g=q[t],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
 THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,n=e.y-d.y,p=a.x-d.x,q=a.y-d.y,F=h*k-g*n,G=h*p-g*q;if(1E-10<Math.abs(F)){if(0<F){if(0>G||G>F)return[];k=n*p-k*q;if(0>k||k>F)return[]}else{if(0<G||G<F)return[];k=n*p-k*q;if(0<k||k<F)return[]}if(0==k)return!f||0!=G&&G!=F?[a]:[];if(k==F)return!f||0!=G&&G!=F?[b]:[];if(0==G)return[d];
-if(G==F)return[e];f=k/F;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=G||n*p!=k*q)return[];h=0==g&&0==h;k=0==k&&0==n;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,F=d.x,n=e,d=e.x):(b=e,F=e.x,n=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,F=d.y,n=e,d=e.y):(b=e,F=e.y,n=d,d=d.y));return k<=F?a<F?[]:a==F?f?[]:[b]:a<=d?[b,h]:[b,n]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,n=e.y-d.y,p=a.x-d.x,q=a.y-d.y,E=h*k-g*n,H=h*p-g*q;if(1E-10<Math.abs(E)){if(0<E){if(0>H||H>E)return[];k=n*p-k*q;if(0>k||k>E)return[]}else{if(0<H||H<E)return[];k=n*p-k*q;if(0<k||k<E)return[]}if(0==k)return!f||0!=H&&H!=E?[a]:[];if(k==E)return!f||0!=H&&H!=E?[b]:[];if(0==H)return[d];
+if(H==E)return[e];f=k/E;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=H||n*p!=k*q)return[];h=0==g&&0==h;k=0==k&&0==n;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,E=d.x,n=e,d=e.x):(b=e,E=e.x,n=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,E=d.y,n=e,d=e.y):(b=e,E=e.y,n=d,d=d.y));return k<=E?a<E?[]:a==E?f?[]:[b]:a<=d?[b,h]:[b,n]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
 [g,n]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,p,n={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)p=h[f].x+":"+h[f].y,void 0!==n[p]&&THREE.warn("THREE.Shape: Duplicate point",p),n[p]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);
-if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<n.length;e++)for(f=b[n[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,n=[],p,q,A,F,G,E=[],z,L,J,M=0;for(p=b.length;M<p;M++)n.push(M);z=0;for(var K=2*n.length;0<n.length;){K--;if(0>
-K){console.log("Infinite Loop! Holes left:"+n.length+", Probably Hole outside Shape!");break}for(q=z;q<h.length;q++){A=h[q];p=-1;for(M=0;M<n.length;M++)if(F=n[M],G=A.x+":"+A.y+":"+F,void 0===E[G]){k=b[F];for(L=0;L<k.length;L++)if(F=k[L],c(q,L)&&!f(A,F)&&!g(A,F)){p=L;n.splice(M,1);z=h.slice(0,q+1);F=h.slice(q);L=k.slice(p);J=k.slice(0,p+1);h=z.concat(L).concat(J).concat(F);z=q;break}if(0<=p)break;E[G]=!0}if(0<=p)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=
+if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<n.length;e++)for(f=b[n[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,n=[],p,q,A,E,H,F=[],z,J,M,N=0;for(p=b.length;N<p;N++)n.push(N);z=0;for(var K=2*n.length;0<n.length;){K--;if(0>
+K){console.log("Infinite Loop! Holes left:"+n.length+", Probably Hole outside Shape!");break}for(q=z;q<h.length;q++){A=h[q];p=-1;for(N=0;N<n.length;N++)if(E=n[N],H=A.x+":"+A.y+":"+E,void 0===F[H]){k=b[E];for(J=0;J<k.length;J++)if(E=k[J],c(q,J)&&!f(A,E)&&!g(A,E)){p=J;n.splice(N,1);z=h.slice(0,q+1);E=h.slice(q);J=k.slice(p);M=k.slice(0,p+1);h=z.concat(J).concat(M).concat(E);z=q;break}if(0<=p)break;F[H]=!0}if(0<=p)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=
 q[f],h=0;3>h;h++)p=k[h].x+":"+k[h].y,p=n[p],void 0!==p&&(k[h]=p);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*
 a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};
 THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
@@ -698,11 +698,11 @@ THREE.Animation.prototype.play=function(a,b){this.currentTime=void 0!==a?a:0;thi
 THREE.Animation.prototype.reset=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});void 0===c.animationCache.animations[this.data.name]&&(c.animationCache.animations[this.data.name]={},c.animationCache.animations[this.data.name].prevKey={pos:0,rot:0,scl:0},c.animationCache.animations[this.data.name].nextKey={pos:0,rot:0,scl:0},c.animationCache.animations[this.data.name].originalMatrix=
 c.matrix);for(var c=c.animationCache.animations[this.data.name],d=0;3>d;d++){for(var e=this.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.time<this.currentTime&&g.index>f.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}};
 THREE.Animation.prototype.resetBlendWeights=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];void 0!==c.animationCache&&(c.animationCache.blending.positionWeight=0,c.animationCache.blending.quaternionWeight=0,c.animationCache.blending.scaleWeight=0)}};
-THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,m,s,t,r;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];s=a[c[1]];t=a[c[2]];r=a[c[3]];c=e*e;m=e*c;d[0]=f(q[0],s[0],t[0],r[0],e,c,m);d[1]=f(q[1],s[1],t[1],r[1],e,c,m);d[2]=f(q[2],s[2],t[2],r[2],e,c,m);return d},f=function(a,b,c,d,e,f,m){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*m+
-(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],p=k.animationCache.animations[this.data.name],n=k.animationCache.blending,q=0;3>q;q++){var m=this.keyTypes[q],s=p.prevKey[m],t=p.nextKey[m];if(0<this.timeScale&&
-t.time<=this.currentTime||0>this.timeScale&&s.time>=this.currentTime){s=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(m,f,1);t.time<this.currentTime&&t.index>s.index;)s=t,t=this.getNextKeyWith(m,f,t.index+1);p.prevKey[m]=s;p.nextKey[m]=t}var r=(this.currentTime-s.time)/(t.time-s.time),u=s[m],v=t[m];0>r&&(r=0);1<r&&(r=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*r,c.y=u[1]+(v[1]-u[1])*r,c.z=u[2]+(v[2]-u[2])*r,s=this.weight/(this.weight+n.positionWeight),
-k.position.lerp(c,s),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,s.index-1).pos,a[1]=u,a[2]=v,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,r=.33*r+.33,t=e(a,r),s=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,m=k.position,m.x+=(t[0]-m.x)*s,m.y+=(t[1]-m.y)*s,m.z+=(t[2]-m.z)*s,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&
-(r=e(a,1.01*r),b.set(r[0],r[1],r[2]),b.sub(m),b.y=0,b.normalize(),r=Math.atan2(b.x,b.z),k.rotation.set(0,r,0))}else"rot"===m?(THREE.Quaternion.slerp(u,v,d,r),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(s=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,s),n.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+(v[0]-u[0])*r,c.y=u[1]+(v[1]-u[1])*r,c.z=u[2]+(v[2]-u[2])*r,s=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,
+THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,l,s,t,r;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];s=a[c[1]];t=a[c[2]];r=a[c[3]];c=e*e;l=e*c;d[0]=f(q[0],s[0],t[0],r[0],e,c,l);d[1]=f(q[1],s[1],t[1],r[1],e,c,l);d[2]=f(q[2],s[2],t[2],r[2],e,c,l);return d},f=function(a,b,c,d,e,f,l){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*l+
+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],p=k.animationCache.animations[this.data.name],n=k.animationCache.blending,q=0;3>q;q++){var l=this.keyTypes[q],s=p.prevKey[l],t=p.nextKey[l];if(0<this.timeScale&&
+t.time<=this.currentTime||0>this.timeScale&&s.time>=this.currentTime){s=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(l,f,1);t.time<this.currentTime&&t.index>s.index;)s=t,t=this.getNextKeyWith(l,f,t.index+1);p.prevKey[l]=s;p.nextKey[l]=t}var r=(this.currentTime-s.time)/(t.time-s.time),u=s[l],v=t[l];0>r&&(r=0);1<r&&(r=1);if("pos"===l)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*r,c.y=u[1]+(v[1]-u[1])*r,c.z=u[2]+(v[2]-u[2])*r,s=this.weight/(this.weight+n.positionWeight),
+k.position.lerp(c,s),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,s.index-1).pos,a[1]=u,a[2]=v,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,r=.33*r+.33,t=e(a,r),s=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,l=k.position,l.x+=(t[0]-l.x)*s,l.y+=(t[1]-l.y)*s,l.z+=(t[2]-l.z)*s,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&
+(r=e(a,1.01*r),b.set(r[0],r[1],r[2]),b.sub(l),b.y=0,b.normalize(),r=Math.atan2(b.x,b.z),k.rotation.set(0,r,0))}else"rot"===l?(THREE.Quaternion.slerp(u,v,d,r),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(s=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,s),n.quaternionWeight+=this.weight)):"scl"===l&&(c.x=u[0]+(v[0]-u[0])*r,c.y=u[1]+(v[1]-u[1])*r,c.z=u[2]+(v[2]-u[2])*r,s=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,
 s),n.scaleWeight+=this.weight)}return!0}}}();THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};
 THREE.KeyFrameAnimation=function(a){this.root=a.node;this.data=THREE.AnimationHandler.init(a);this.hierarchy=THREE.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=.001;this.isPlaying=!1;this.loop=this.isPaused=!0;a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
@@ -714,67 +714,67 @@ f;d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.inter
 THREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
 THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);a=this.duration/this.frames;var b=Math.floor(this.currentTime/a);b!=this.currentFrame&&(this.mesh.morphTargetInfluences[this.lastFrame]=0,this.mesh.morphTargetInfluences[this.currentFrame]=
 1,this.mesh.morphTargetInfluences[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);this.mesh.morphTargetInfluences[b]=this.currentTime%a/a;this.mesh.morphTargetInfluences[this.lastFrame]=1-this.mesh.morphTargetInfluences[b]}}};
-THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,r){var u,v=h.widthSegments,x=h.heightSegments,C=e/2,w=f/2,y=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",x=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var A=v+1,F=x+1,G=e/v,E=f/x,z=new THREE.Vector3;z[u]=0<g?1:-1;for(e=0;e<F;e++)for(f=0;f<A;f++){var L=new THREE.Vector3;L[a]=(f*G-C)*c;L[b]=(e*E-w)*d;L[u]=g;h.vertices.push(L)}for(e=
+THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,r){var u,v=h.widthSegments,x=h.heightSegments,C=e/2,w=f/2,y=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",x=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var A=v+1,E=x+1,H=e/v,F=f/x,z=new THREE.Vector3;z[u]=0<g?1:-1;for(e=0;e<E;e++)for(f=0;f<A;f++){var J=new THREE.Vector3;J[a]=(f*H-C)*c;J[b]=(e*F-w)*d;J[u]=g;h.vertices.push(J)}for(e=
 0;e<x;e++)for(f=0;f<v;f++)w=f+A*e,a=f+A*(e+1),b=f+1+A*(e+1),c=f+1+A*e,d=new THREE.Vector2(f/v,1-e/x),g=new THREE.Vector2(f/v,1-(e+1)/x),u=new THREE.Vector2((f+1)/v,1-(e+1)/x),C=new THREE.Vector2((f+1)/v,1-e/x),w=new THREE.Face3(w+y,a+y,c+y),w.normal.copy(z),w.vertexNormals.push(z.clone(),z.clone(),z.clone()),w.materialIndex=r,h.faces.push(w),h.faceVertexUvs[0].push([d,g,C]),w=new THREE.Face3(a+y,b+y,c+y),w.normal.copy(z),w.vertexNormals.push(z.clone(),z.clone(),z.clone()),w.materialIndex=r,h.faces.push(w),
 h.faceVertexUvs[0].push([g.clone(),u,C.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;
 THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
 THREE.CubeGeometry=function(a,b,c,d,e,f){THREE.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry.");return new THREE.BoxGeometry(a,b,c,d,e,f)};
-THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=c/2,p,n,q=[],m=[];for(n=0;n<=e;n++){var s=[],t=[],r=n/e,u=r*(b-a)+a;for(p=0;p<=d;p++){var v=p/d,x=new THREE.Vector3;x.x=u*Math.sin(v*h+
-g);x.y=-r*c+k;x.z=u*Math.cos(v*h+g);this.vertices.push(x);s.push(this.vertices.length-1);t.push(new THREE.Vector2(v,1-r))}q.push(s);m.push(t)}c=(b-a)/c;for(p=0;p<d;p++)for(0!==a?(g=this.vertices[q[0][p]].clone(),h=this.vertices[q[0][p+1]].clone()):(g=this.vertices[q[1][p]].clone(),h=this.vertices[q[1][p+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var s=q[n][p],t=q[n+1][p],r=q[n+1][p+1],u=q[n][p+1],v=g.clone(),x=g.clone(),
-C=h.clone(),w=h.clone(),y=m[n][p].clone(),A=m[n+1][p].clone(),F=m[n+1][p+1].clone(),G=m[n][p+1].clone();this.faces.push(new THREE.Face3(s,t,u,[v,x,w]));this.faceVertexUvs[0].push([y,A,G]);this.faces.push(new THREE.Face3(t,r,u,[x.clone(),C,w.clone()]));this.faceVertexUvs[0].push([A.clone(),F,G.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),p=0;p<d;p++)s=q[0][p],t=q[0][p+1],r=this.vertices.length-1,v=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),C=new THREE.Vector3(0,
-1,0),y=m[0][p].clone(),A=m[0][p+1].clone(),F=new THREE.Vector2(A.x,0),this.faces.push(new THREE.Face3(s,t,r,[v,x,C])),this.faceVertexUvs[0].push([y,A,F]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),p=0;p<d;p++)s=q[e][p+1],t=q[e][p],r=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),C=new THREE.Vector3(0,-1,0),y=m[e][p+1].clone(),A=m[e][p].clone(),F=new THREE.Vector2(A.x,1),this.faces.push(new THREE.Face3(s,t,r,[v,x,C])),this.faceVertexUvs[0].push([y,
-A,F]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
+THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=c/2,p,n,q=[],l=[];for(n=0;n<=e;n++){var s=[],t=[],r=n/e,u=r*(b-a)+a;for(p=0;p<=d;p++){var v=p/d,x=new THREE.Vector3;x.x=u*Math.sin(v*h+
+g);x.y=-r*c+k;x.z=u*Math.cos(v*h+g);this.vertices.push(x);s.push(this.vertices.length-1);t.push(new THREE.Vector2(v,1-r))}q.push(s);l.push(t)}c=(b-a)/c;for(p=0;p<d;p++)for(0!==a?(g=this.vertices[q[0][p]].clone(),h=this.vertices[q[0][p+1]].clone()):(g=this.vertices[q[1][p]].clone(),h=this.vertices[q[1][p+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var s=q[n][p],t=q[n+1][p],r=q[n+1][p+1],u=q[n][p+1],v=g.clone(),x=g.clone(),
+C=h.clone(),w=h.clone(),y=l[n][p].clone(),A=l[n+1][p].clone(),E=l[n+1][p+1].clone(),H=l[n][p+1].clone();this.faces.push(new THREE.Face3(s,t,u,[v,x,w]));this.faceVertexUvs[0].push([y,A,H]);this.faces.push(new THREE.Face3(t,r,u,[x.clone(),C,w.clone()]));this.faceVertexUvs[0].push([A.clone(),E,H.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),p=0;p<d;p++)s=q[0][p],t=q[0][p+1],r=this.vertices.length-1,v=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),C=new THREE.Vector3(0,
+1,0),y=l[0][p].clone(),A=l[0][p+1].clone(),E=new THREE.Vector2(A.x,0),this.faces.push(new THREE.Face3(s,t,r,[v,x,C])),this.faceVertexUvs[0].push([y,A,E]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),p=0;p<d;p++)s=q[e][p+1],t=q[e][p],r=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),C=new THREE.Vector3(0,-1,0),y=l[e][p+1].clone(),A=l[e][p].clone(),E=new THREE.Vector2(A.x,1),this.faces.push(new THREE.Face3(s,t,r,[v,x,C])),this.faceVertexUvs[0].push([y,
+A,E]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
 THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
-THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||THREE.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),m=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=!0):
--1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)==Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(Q=a.length;0<=--Q;){c=Q;d=Q-1;0>d&&(d=a.length-1);for(var e=0,f=s+2*n,e=0;e<f;e++){var g=ma*e,h=ma*(e+1),k=b+c+g,g=b+d+g,m=b+d+h,h=b+c+h,k=k+J,g=g+J,m=m+J,h=h+J;L.faces.push(new THREE.Face3(k,g,h,null,null,x));L.faces.push(new THREE.Face3(g,m,h,null,null,x));k=C.generateSideWallUV(L,k,g,m,h);L.faceVertexUvs[0].push([k[0],
-k[1],k[3]]);L.faceVertexUvs[0].push([k[1],k[2],k[3]])}}}function f(a,b,c){L.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=J;b+=J;c+=J;L.faces.push(new THREE.Face3(a,b,c,null,null,v));a=C.generateTopUV(L,a,b,c);L.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,p=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:
-12,s=void 0!==b.steps?b.steps:1,t=b.extrudePath,r,u=!1,v=b.material,x=b.extrudeMaterial,C=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,y,A,F;t&&(r=t.getSpacedPoints(s),u=!0,q=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),y=new THREE.Vector3,A=new THREE.Vector3,F=new THREE.Vector3);q||(p=k=n=0);var G,E,z,L=this,J=this.vertices.length,t=a.extractPoints(m),m=t.shape,M=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();E=0;for(z=
-M.length;E<z;E++)G=M[E],THREE.Shape.Utils.isClockWise(G)&&(M[E]=G.reverse());t=!1}var K=THREE.Shape.Utils.triangulateShape(m,M),S=m;E=0;for(z=M.length;E<z;E++)G=M[E],m=m.concat(G);var O,N,P,V,I,ma=m.length,ca,qa=K.length,t=[],Q=0;P=S.length;O=P-1;for(N=Q+1;Q<P;Q++,O++,N++)O===P&&(O=0),N===P&&(N=0),t[Q]=d(S[Q],S[O],S[N]);var ua=[],pa,ja=t.concat();E=0;for(z=M.length;E<z;E++){G=M[E];pa=[];Q=0;P=G.length;O=P-1;for(N=Q+1;Q<P;Q++,O++,N++)O===P&&(O=0),N===P&&(N=0),pa[Q]=d(G[Q],G[O],G[N]);ua.push(pa);ja=
-ja.concat(pa)}for(O=0;O<n;O++){P=O/n;V=k*(1-P);N=p*Math.sin(P*Math.PI/2);Q=0;for(P=S.length;Q<P;Q++)I=c(S[Q],t[Q],N),f(I.x,I.y,-V);E=0;for(z=M.length;E<z;E++)for(G=M[E],pa=ua[E],Q=0,P=G.length;Q<P;Q++)I=c(G[Q],pa[Q],N),f(I.x,I.y,-V)}N=p;for(Q=0;Q<ma;Q++)I=q?c(m[Q],ja[Q],N):m[Q],u?(A.copy(w.normals[0]).multiplyScalar(I.x),y.copy(w.binormals[0]).multiplyScalar(I.y),F.copy(r[0]).add(A).add(y),f(F.x,F.y,F.z)):f(I.x,I.y,0);for(P=1;P<=s;P++)for(Q=0;Q<ma;Q++)I=q?c(m[Q],ja[Q],N):m[Q],u?(A.copy(w.normals[P]).multiplyScalar(I.x),
-y.copy(w.binormals[P]).multiplyScalar(I.y),F.copy(r[P]).add(A).add(y),f(F.x,F.y,F.z)):f(I.x,I.y,h/s*P);for(O=n-1;0<=O;O--){P=O/n;V=k*(1-P);N=p*Math.sin(P*Math.PI/2);Q=0;for(P=S.length;Q<P;Q++)I=c(S[Q],t[Q],N),f(I.x,I.y,h+V);E=0;for(z=M.length;E<z;E++)for(G=M[E],pa=ua[E],Q=0,P=G.length;Q<P;Q++)I=c(G[Q],pa[Q],N),u?f(I.x,I.y+r[s-1].y,r[s-1].x+V):f(I.x,I.y,h+V)}(function(){if(q){var a;a=0*ma;for(Q=0;Q<qa;Q++)ca=K[Q],g(ca[2]+a,ca[1]+a,ca[0]+a);a=s+2*n;a*=ma;for(Q=0;Q<qa;Q++)ca=K[Q],g(ca[0]+a,ca[1]+a,ca[2]+
-a)}else{for(Q=0;Q<qa;Q++)ca=K[Q],g(ca[2],ca[1],ca[0]);for(Q=0;Q<qa;Q++)ca=K[Q],g(ca[0]+ma*s,ca[1]+ma*s,ca[2]+ma*s)}})();(function(){var a=0;e(S,a);a+=S.length;E=0;for(z=M.length;E<z;E++)G=M[E],e(G,a),a+=G.length})()};
+THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||THREE.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=!0):
+-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)==Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(G=a.length;0<=--G;){c=G;d=G-1;0>d&&(d=a.length-1);for(var e=0,f=s+2*n,e=0;e<f;e++){var g=ma*e,h=ma*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+M,g=g+M,l=l+M,h=h+M;J.faces.push(new THREE.Face3(k,g,h,null,null,x));J.faces.push(new THREE.Face3(g,l,h,null,null,x));k=C.generateSideWallUV(J,k,g,l,h);J.faceVertexUvs[0].push([k[0],
+k[1],k[3]]);J.faceVertexUvs[0].push([k[1],k[2],k[3]])}}}function f(a,b,c){J.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=M;b+=M;c+=M;J.faces.push(new THREE.Face3(a,b,c,null,null,v));a=C.generateTopUV(J,a,b,c);J.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,p=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,l=void 0!==b.curveSegments?b.curveSegments:
+12,s=void 0!==b.steps?b.steps:1,t=b.extrudePath,r,u=!1,v=b.material,x=b.extrudeMaterial,C=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,y,A,E;t&&(r=t.getSpacedPoints(s),u=!0,q=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),y=new THREE.Vector3,A=new THREE.Vector3,E=new THREE.Vector3);q||(p=k=n=0);var H,F,z,J=this,M=this.vertices.length,t=a.extractPoints(l),l=t.shape,N=t.holes;if(t=!THREE.Shape.Utils.isClockWise(l)){l=l.reverse();F=0;for(z=
+N.length;F<z;F++)H=N[F],THREE.Shape.Utils.isClockWise(H)&&(N[F]=H.reverse());t=!1}var K=THREE.Shape.Utils.triangulateShape(l,N),T=l;F=0;for(z=N.length;F<z;F++)H=N[F],l=l.concat(H);var O,U,Q,V,L,ma=l.length,ba,ra=K.length,t=[],G=0;Q=T.length;O=Q-1;for(U=G+1;G<Q;G++,O++,U++)O===Q&&(O=0),U===Q&&(U=0),t[G]=d(T[G],T[O],T[U]);var Ka=[],aa,na=t.concat();F=0;for(z=N.length;F<z;F++){H=N[F];aa=[];G=0;Q=H.length;O=Q-1;for(U=G+1;G<Q;G++,O++,U++)O===Q&&(O=0),U===Q&&(U=0),aa[G]=d(H[G],H[O],H[U]);Ka.push(aa);na=
+na.concat(aa)}for(O=0;O<n;O++){Q=O/n;V=k*(1-Q);U=p*Math.sin(Q*Math.PI/2);G=0;for(Q=T.length;G<Q;G++)L=c(T[G],t[G],U),f(L.x,L.y,-V);F=0;for(z=N.length;F<z;F++)for(H=N[F],aa=Ka[F],G=0,Q=H.length;G<Q;G++)L=c(H[G],aa[G],U),f(L.x,L.y,-V)}U=p;for(G=0;G<ma;G++)L=q?c(l[G],na[G],U):l[G],u?(A.copy(w.normals[0]).multiplyScalar(L.x),y.copy(w.binormals[0]).multiplyScalar(L.y),E.copy(r[0]).add(A).add(y),f(E.x,E.y,E.z)):f(L.x,L.y,0);for(Q=1;Q<=s;Q++)for(G=0;G<ma;G++)L=q?c(l[G],na[G],U):l[G],u?(A.copy(w.normals[Q]).multiplyScalar(L.x),
+y.copy(w.binormals[Q]).multiplyScalar(L.y),E.copy(r[Q]).add(A).add(y),f(E.x,E.y,E.z)):f(L.x,L.y,h/s*Q);for(O=n-1;0<=O;O--){Q=O/n;V=k*(1-Q);U=p*Math.sin(Q*Math.PI/2);G=0;for(Q=T.length;G<Q;G++)L=c(T[G],t[G],U),f(L.x,L.y,h+V);F=0;for(z=N.length;F<z;F++)for(H=N[F],aa=Ka[F],G=0,Q=H.length;G<Q;G++)L=c(H[G],aa[G],U),u?f(L.x,L.y+r[s-1].y,r[s-1].x+V):f(L.x,L.y,h+V)}(function(){if(q){var a;a=0*ma;for(G=0;G<ra;G++)ba=K[G],g(ba[2]+a,ba[1]+a,ba[0]+a);a=s+2*n;a*=ma;for(G=0;G<ra;G++)ba=K[G],g(ba[0]+a,ba[1]+a,ba[2]+
+a)}else{for(G=0;G<ra;G++)ba=K[G],g(ba[2],ba[1],ba[0]);for(G=0;G<ra;G++)ba=K[G],g(ba[0]+ma*s,ba[1]+ma*s,ba[2]+ma*s)}})();(function(){var a=0;e(T,a);a+=T.length;F=0;for(z=N.length;F<z;F++)H=N[F],e(H,a),a+=H.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,p=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=p.length;e<f;e++)g=p[e],THREE.Shape.Utils.isClockWise(g)&&(p[e]=g.reverse());var n=THREE.Shape.Utils.triangulateShape(k,p);e=0;for(f=p.length;e<f;e++)g=p[e],
 k=k.concat(g);p=k.length;f=n.length;for(e=0;e<p;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)p=n[e],k=p[0]+h,g=p[1]+h,p=p[2]+h,this.faces.push(new THREE.Face3(k,g,p,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,g,p))};
-THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,p=Math.cos(k),n=Math.sin(k),k=0,q=a.length;k<q;k++){var m=a[k],s=new THREE.Vector3;s.x=p*m.x-n*m.y;s.y=n*m.x+p*m.y;s.z=m.z;this.vertices.push(s)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,q=a.length-1;k<q;k++){b=n=k+c*g;d=n+c;var p=n+1+c,n=n+1,m=g*f,s=k*e,t=
-m+f,r=s+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(m,s),new THREE.Vector2(t,s),new THREE.Vector2(m,r)]);this.faces.push(new THREE.Face3(d,p,n));this.faceVertexUvs[0].push([new THREE.Vector2(t,s),new THREE.Vector2(t,r),new THREE.Vector2(m,r)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,p=Math.cos(k),n=Math.sin(k),k=0,q=a.length;k<q;k++){var l=a[k],s=new THREE.Vector3;s.x=p*l.x-n*l.y;s.y=n*l.x+p*l.y;s.z=l.z;this.vertices.push(s)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,q=a.length-1;k<q;k++){b=n=k+c*g;d=n+c;var p=n+1+c,n=n+1,l=g*f,s=k*e,t=
+l+f,r=s+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(l,s),new THREE.Vector2(t,s),new THREE.Vector2(l,r)]);this.faces.push(new THREE.Face3(d,p,n));this.faceVertexUvs[0].push([new THREE.Vector2(t,s),new THREE.Vector2(t,r),new THREE.Vector2(l,r)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
 THREE.PlaneGeometry=function(a,b,c,d){console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,p=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var n=new Float32Array(g*h*2),q=0,m=0,s=0;s<h;s++)for(var t=s*p-f,r=0;r<g;r++)b[q]=r*k-e,b[q+1]=-t,a[q+2]=1,n[m]=r/c,n[m+1]=1-s/d,q+=3,m+=2;q=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*d*6);for(s=0;s<d;s++)for(r=
+THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,p=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var n=new Float32Array(g*h*2),q=0,l=0,s=0;s<h;s++)for(var t=s*p-f,r=0;r<g;r++)b[q]=r*k-e,b[q+1]=-t,a[q+2]=1,n[l]=r/c,n[l+1]=1-s/d,q+=3,l+=2;q=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*d*6);for(s=0;s<d;s++)for(r=
 0;r<c;r++)f=r+g*(s+1),h=r+1+g*(s+1),k=r+1+g*s,e[q]=r+g*s,e[q+1]=f,e[q+2]=k,e[q+3]=f,e[q+4]=h,e[q+5]=k,q+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(n,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
 THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var g,h=[],k=a,p=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var n=new THREE.Vector3,q=e+g/c*f;n.x=k*Math.cos(q);n.y=k*Math.sin(q);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,
 (n.y/b+1)/2))}k+=p}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=q=g+e,p=q+c+1,n=q+c+2,this.faces.push(new THREE.Face3(f,p,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[p].clone(),h[n].clone()]),f=q,p=q+c+2,n=q+1,this.faces.push(new THREE.Face3(f,p,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[p].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
 THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;
-THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,p=[],n=[];for(k=0;k<=c;k++){var q=[],m=[];for(h=0;h<=b;h++){var s=h/b,t=k/c,r=new THREE.Vector3;r.x=-a*Math.cos(d+s*e)*Math.sin(f+t*g);
-r.y=a*Math.cos(f+t*g);r.z=a*Math.sin(d+s*e)*Math.sin(f+t*g);this.vertices.push(r);q.push(this.vertices.length-1);m.push(new THREE.Vector2(s,1-t))}p.push(q);n.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=p[k][h+1];e=p[k][h];f=p[k+1][h];g=p[k+1][h+1];var q=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),s=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),r=n[k][h+1].clone(),u=n[k][h].clone(),v=n[k+1][h].clone(),x=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===
-a?(r.x=(r.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[q,s,t])),this.faceVertexUvs[0].push([r,v,x])):Math.abs(this.vertices[f].y)===a?(v.x=(v.x+x.x)/2,this.faces.push(new THREE.Face3(d,e,f,[q,m,s])),this.faceVertexUvs[0].push([r,u,v])):(this.faces.push(new THREE.Face3(d,e,g,[q,m,t])),this.faceVertexUvs[0].push([r,u,x]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),s,t.clone()])),this.faceVertexUvs[0].push([u.clone(),v,x.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
+THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,p=[],n=[];for(k=0;k<=c;k++){var q=[],l=[];for(h=0;h<=b;h++){var s=h/b,t=k/c,r=new THREE.Vector3;r.x=-a*Math.cos(d+s*e)*Math.sin(f+t*g);
+r.y=a*Math.cos(f+t*g);r.z=a*Math.sin(d+s*e)*Math.sin(f+t*g);this.vertices.push(r);q.push(this.vertices.length-1);l.push(new THREE.Vector2(s,1-t))}p.push(q);n.push(l)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=p[k][h+1];e=p[k][h];f=p[k+1][h];g=p[k+1][h+1];var q=this.vertices[d].clone().normalize(),l=this.vertices[e].clone().normalize(),s=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),r=n[k][h+1].clone(),u=n[k][h].clone(),v=n[k+1][h].clone(),x=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===
+a?(r.x=(r.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[q,s,t])),this.faceVertexUvs[0].push([r,v,x])):Math.abs(this.vertices[f].y)===a?(v.x=(v.x+x.x)/2,this.faces.push(new THREE.Face3(d,e,f,[q,l,s])),this.faceVertexUvs[0].push([r,u,v])):(this.faces.push(new THREE.Face3(d,e,g,[q,l,t])),this.faceVertexUvs[0].push([r,u,x]),this.faces.push(new THREE.Face3(e,f,g,[l.clone(),s,t.clone()])),this.faceVertexUvs[0].push([u.clone(),v,x.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
 a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b);this.type="TextGeometry"};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
-THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var p=0;p<=d;p++){var n=p/d*e,q=k/c*Math.PI*2;f.x=a*Math.cos(n);f.y=a*Math.sin(n);var m=new THREE.Vector3;m.x=(a+b*Math.cos(q))*Math.cos(n);m.y=(a+b*Math.cos(q))*Math.sin(n);m.z=b*Math.sin(q);this.vertices.push(m);g.push(new THREE.Vector2(p/
-d,k/c));h.push(m.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(p=1;p<=d;p++)a=(d+1)*k+p-1,b=(d+1)*(k-1)+p-1,e=(d+1)*(k-1)+p,f=(d+1)*k+p,n=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),n=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};
+THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var p=0;p<=d;p++){var n=p/d*e,q=k/c*Math.PI*2;f.x=a*Math.cos(n);f.y=a*Math.sin(n);var l=new THREE.Vector3;l.x=(a+b*Math.cos(q))*Math.cos(n);l.y=(a+b*Math.cos(q))*Math.sin(n);l.z=b*Math.sin(q);this.vertices.push(l);g.push(new THREE.Vector2(p/
+d,k/c));h.push(l.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(p=1;p<=d;p++)a=(d+1)*k+p-1,b=(d+1)*(k-1)+p-1,e=(d+1)*(k-1)+p,f=(d+1)*k+p,n=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),n=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};
 THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
-THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),p=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,m=0;m<c;++m){k[m]=
-Array(d);var s=m/c*2*e*Math.PI,t=h(s,f,e,a,g),s=h(s+.01,f,e,a,g);p.subVectors(s,t);n.addVectors(s,t);q.crossVectors(p,n);n.crossVectors(q,p);q.normalize();n.normalize();for(s=0;s<d;++s){var r=s/d*2*Math.PI,u=-b*Math.cos(r),r=b*Math.sin(r),v=new THREE.Vector3;v.x=t.x+u*n.x+r*q.x;v.y=t.y+u*n.y+r*q.y;v.z=t.z+u*n.z+r*q.z;k[m][s]=this.vertices.push(v)-1}}for(m=0;m<c;++m)for(s=0;s<d;++s)e=(m+1)%c,f=(s+1)%d,a=k[m][s],b=k[e][s],e=k[e][f],f=k[m][f],g=new THREE.Vector2(m/c,s/d),p=new THREE.Vector2((m+1)/c,
-s/d),n=new THREE.Vector2((m+1)/c,(s+1)/d),q=new THREE.Vector2(m/c,(s+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,p,q]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([p.clone(),n,q.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
-THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,k,p=b+1,n,q,m,s,t,r=new THREE.Vector3,u,v,x;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);v=u.normals;x=u.binormals;this.tangents=u.tangents;this.normals=v;this.binormals=x;for(u=0;u<p;u++)for(g[u]=[],n=u/(p-1),t=a.getPointAt(n),h=v[u],k=x[u],m=c*f(n),n=0;n<d;n++)q=
-n/d*2*Math.PI,s=-m*Math.cos(q),q=m*Math.sin(q),r.copy(t),r.x+=s*h.x+q*k.x,r.y+=s*h.y+q*k.y,r.z+=s*h.z+q*k.z,g[u][n]=this.vertices.push(new THREE.Vector3(r.x,r.y,r.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)f=e?(u+1)%b:u+1,p=(n+1)%d,a=g[u][n],c=g[f][n],f=g[f][p],p=g[u][p],r=new THREE.Vector2(u/b,n/d),v=new THREE.Vector2((u+1)/b,n/d),x=new THREE.Vector2((u+1)/b,(n+1)/d),h=new THREE.Vector2(u/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,p)),this.faceVertexUvs[0].push([r,v,h]),this.faces.push(new THREE.Face3(c,
+THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),p=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,l=0;l<c;++l){k[l]=
+Array(d);var s=l/c*2*e*Math.PI,t=h(s,f,e,a,g),s=h(s+.01,f,e,a,g);p.subVectors(s,t);n.addVectors(s,t);q.crossVectors(p,n);n.crossVectors(q,p);q.normalize();n.normalize();for(s=0;s<d;++s){var r=s/d*2*Math.PI,u=-b*Math.cos(r),r=b*Math.sin(r),v=new THREE.Vector3;v.x=t.x+u*n.x+r*q.x;v.y=t.y+u*n.y+r*q.y;v.z=t.z+u*n.z+r*q.z;k[l][s]=this.vertices.push(v)-1}}for(l=0;l<c;++l)for(s=0;s<d;++s)e=(l+1)%c,f=(s+1)%d,a=k[l][s],b=k[e][s],e=k[e][f],f=k[l][f],g=new THREE.Vector2(l/c,s/d),p=new THREE.Vector2((l+1)/c,
+s/d),n=new THREE.Vector2((l+1)/c,(s+1)/d),q=new THREE.Vector2(l/c,(s+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,p,q]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([p.clone(),n,q.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
+THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,k,p=b+1,n,q,l,s,t,r=new THREE.Vector3,u,v,x;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);v=u.normals;x=u.binormals;this.tangents=u.tangents;this.normals=v;this.binormals=x;for(u=0;u<p;u++)for(g[u]=[],n=u/(p-1),t=a.getPointAt(n),h=v[u],k=x[u],l=c*f(n),n=0;n<d;n++)q=
+n/d*2*Math.PI,s=-l*Math.cos(q),q=l*Math.sin(q),r.copy(t),r.x+=s*h.x+q*k.x,r.y+=s*h.y+q*k.y,r.z+=s*h.z+q*k.z,g[u][n]=this.vertices.push(new THREE.Vector3(r.x,r.y,r.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)f=e?(u+1)%b:u+1,p=(n+1)%d,a=g[u][n],c=g[f][n],f=g[f][p],p=g[u][p],r=new THREE.Vector2(u/b,n/d),v=new THREE.Vector2((u+1)/b,n/d),x=new THREE.Vector2((u+1)/b,(n+1)/d),h=new THREE.Vector2(u/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,p)),this.faceVertexUvs[0].push([r,v,h]),this.faces.push(new THREE.Face3(c,
 f,p)),this.faceVertexUvs[0].push([v.clone(),x,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var p,n,q;this.tangents=e;this.normals=f;this.binormals=g;for(p=0;p<b;p++)n=p/(b-1),e[p]=a.getTangentAt(n),e[p].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;p=Math.abs(e[0].x);n=Math.abs(e[0].y);q=Math.abs(e[0].z);p<=a&&(a=p,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));q<=a&&d.set(0,0,1);h.crossVectors(e[0],
 d).normalize();f[0].crossVectors(e[0],h);g[0].crossVectors(e[0],f[0]);for(p=1;p<b;p++)f[p]=f[p-1].clone(),g[p]=g[p-1].clone(),h.crossVectors(e[p-1],e[p]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[p-1].dot(e[p]),-1,1)),f[p].applyMatrix4(k.makeRotationAxis(h,d))),g[p].crossVectors(e[p],f[p]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),p=1;p<b;p++)f[p].applyMatrix4(k.makeRotationAxis(e[p],d*p)),g[p].crossVectors(e[p],
 f[p])};
 THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);u.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(u.z,-u.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,b){var c=
-Math.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),m=[],n=0;n<=c;n++){m[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(g.clone().lerp(h,n/c)),r=c-n,s=0;s<=r;s++)m[n][s]=0==s&&n==c?p:e(p.clone().lerp(q,s/r))}for(n=0;n<c;n++)for(s=0;s<2*(c-n)-1;s++)d=Math.floor(s/2),0==s%2?f(m[n][d+1],m[n+1][d],m[n][d]):f(m[n][d+1],m[n+1][d+1],m[n+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,
-a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,p=0,n=a.length;p<n;p+=3)e(new THREE.Vector3(a[p],a[p+1],a[p+2]));a=this.vertices;for(var q=[],m=p=0,n=b.length;p<n;p+=3,m++){var s=a[b[p]],t=a[b[p+1]],r=a[b[p+2]];q[m]=new THREE.Face3(s.index,t.index,r.index,[s.clone(),t.clone(),r.clone()])}for(var u=new THREE.Vector3,p=0,n=q.length;p<n;p++)g(q[p],d);p=0;for(n=this.faceVertexUvs[0].length;p<
-n;p++)b=this.faceVertexUvs[0][p],d=b[0].x,a=b[1].x,q=b[2].x,m=Math.max(d,Math.max(a,q)),s=Math.min(d,Math.min(a,q)),.9<m&&.1>s&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));p=0;for(n=this.vertices.length;p<n;p++)this.vertices[p].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
+Math.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],n=0;n<=c;n++){l[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(g.clone().lerp(h,n/c)),r=c-n,s=0;s<=r;s++)l[n][s]=0==s&&n==c?p:e(p.clone().lerp(q,s/r))}for(n=0;n<c;n++)for(s=0;s<2*(c-n)-1;s++)d=Math.floor(s/2),0==s%2?f(l[n][d+1],l[n+1][d],l[n][d]):f(l[n][d+1],l[n+1][d+1],l[n+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,
+a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,p=0,n=a.length;p<n;p+=3)e(new THREE.Vector3(a[p],a[p+1],a[p+2]));a=this.vertices;for(var q=[],l=p=0,n=b.length;p<n;p+=3,l++){var s=a[b[p]],t=a[b[p+1]],r=a[b[p+2]];q[l]=new THREE.Face3(s.index,t.index,r.index,[s.clone(),t.clone(),r.clone()])}for(var u=new THREE.Vector3,p=0,n=q.length;p<n;p++)g(q[p],d);p=0;for(n=this.faceVertexUvs[0].length;p<
+n;p++)b=this.faceVertexUvs[0][p],d=b[0].x,a=b[1].x,q=b[2].x,l=Math.max(d,Math.max(a,q)),s=Math.min(d,Math.min(a,q)),.9<l&&.1>s&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));p=0;for(n=this.vertices.length;p<n;p++)this.vertices[p].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
 THREE.DodecahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.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)};THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry;
 THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.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="IcosahedronGeometry";this.parameters={radius:a,detail:b}};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};THREE.PolyhedronGeometry.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="OctahedronGeometry";this.parameters={radius:a,detail:b}};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
 THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.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="TetrahedronGeometry";this.parameters={radius:a,detail:b}};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;
-THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,p,n=b+1;for(g=0;g<=c;g++)for(p=g/c,h=0;h<=b;h++)k=h/b,k=a(k,p),d.push(k);var q,m,s,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*n+h,d=g*n+h+1,p=(g+1)*n+h+1,k=(g+1)*n+h,q=new THREE.Vector2(h/b,g/c),m=new THREE.Vector2((h+1)/b,g/c),s=new THREE.Vector2((h+1)/b,(g+1)/c),t=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,
-d,k)),f.push([q,m,t]),e.push(new THREE.Face3(d,p,k)),f.push([m.clone(),s,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
+THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,p,n=b+1;for(g=0;g<=c;g++)for(p=g/c,h=0;h<=b;h++)k=h/b,k=a(k,p),d.push(k);var q,l,s,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*n+h,d=g*n+h+1,p=(g+1)*n+h+1,k=(g+1)*n+h,q=new THREE.Vector2(h/b,g/c),l=new THREE.Vector2((h+1)/b,g/c),s=new THREE.Vector2((h+1)/b,(g+1)/c),t=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,
+d,k)),f.push([q,l,t]),e.push(new THREE.Face3(d,p,k)),f.push([l.clone(),s,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
 THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry;a.addAttribute("position",new THREE.BufferAttribute(b,3));a.addAttribute("color",new THREE.BufferAttribute(c,3));b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,a,b,THREE.LinePieces)};THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.AxisHelper.prototype.constructor=THREE.AxisHelper;
 THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0));return function(c,d,e,f,g,h){THREE.Object3D.call(this);void 0===f&&(f=16776960);void 0===e&&(e=1);void 0===g&&(g=.2*e);void 0===h&&(h=.2*g);this.position.copy(d);this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f}));this.line.matrixAutoUpdate=!1;this.add(this.line);
@@ -793,7 +793,7 @@ THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=
 c=new THREE.Geometry;c.vertices.push(new THREE.Vector3,new THREE.Vector3);d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(c,d);this.add(this.targetLine);this.update()};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper;
 THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};
 THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(c);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();
-THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry,k;a.geometry instanceof THREE.BufferGeometry?(k=new THREE.Geometry,k.fromBufferGeometry(a.geometry)):k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();var p=k.vertices;k=k.faces;for(var n=0,q=0,m=k.length;q<m;q++)for(var s=k[q],t=0;3>t;t++){d[0]=s[g[t]];d[1]=s[g[(t+1)%3]];d.sort(f);var r=d.toString();void 0===e[r]?(e[r]={vert1:d[0],vert2:d[1],
+THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry,k;a.geometry instanceof THREE.BufferGeometry?(k=new THREE.Geometry,k.fromBufferGeometry(a.geometry)):k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();var p=k.vertices;k=k.faces;for(var n=0,q=0,l=k.length;q<l;q++)for(var s=k[q],t=0;3>t;t++){d[0]=s[g[t]];d[1]=s[g[(t+1)%3]];d.sort(f);var r=d.toString();void 0===e[r]?(e[r]={vert1:d[0],vert2:d[1],
 face1:q,face2:void 0},n++):e[r].face2=q}d=new Float32Array(6*n);f=0;for(r in e)if(g=e[r],void 0===g.face2||.9999>k[g.face1].normal.dot(k[g.face2].normal))n=p[g.vert1],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z,n=p[g.vert2],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3));THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper;THREE.FaceNormalsHelper=function(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=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};
 THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper;
@@ -813,15 +813,15 @@ THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper;THREE.SpotLigh
 THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1E4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();
 THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:16711680;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexNormals.length;g<h;g++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper;
-THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,p=f.length;k<p;k++)for(var n=f[k],q=0,m=n.vertexNormals.length;q<m;q++){var s=n.vertexNormals[q];d[h].copy(e[n[a[q]]]).applyMatrix4(g);b.copy(s).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
+THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,p=f.length;k<p;k++)for(var n=f[k],q=0,l=n.vertexNormals.length;q<l;q++){var s=n.vertexNormals[q];d[h].copy(e[n[a[q]]]).applyMatrix4(g);b.copy(s).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
 b.add(d[h]);h+=1;d[h].copy(b);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();
 THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:255;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexTangents.length;g<h;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.update()};THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper;
-THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,p=f.length;k<p;k++)for(var n=f[k],q=0,m=n.vertexTangents.length;q<m;q++){var s=n.vertexTangents[q];d[h].copy(e[n[a[q]]]).applyMatrix4(g);b.copy(s).transformDirection(g).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
+THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,p=f.length;k<p;k++)for(var n=f[k],q=0,l=n.vertexTangents.length;q<l;q++){var s=n.vertexTangents[q];d[h].copy(e[n[a[q]]]).applyMatrix4(g);b.copy(s).transformDirection(g).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
 h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();
-THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,p=a.geometry.faces,n=0,q=new Uint32Array(6*p.length),m=0,s=p.length;m<s;m++)for(var t=p[m],r=0;3>r;r++){d[0]=t[g[r]];d[1]=t[g[(r+1)%3]];d.sort(f);var u=d.toString();void 0===e[u]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[u]=!0,n++)}d=new Float32Array(6*n);m=0;for(s=n;m<s;m++)for(r=0;2>r;r++)n=
-k[q[2*m+r]],g=6*m+3*r,d[g+0]=n.x,d[g+1]=n.y,d[g+2]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){k=a.geometry.attributes.position.array;s=a.geometry.attributes.index.array;p=a.geometry.drawcalls;n=0;0===p.length&&(p=[{count:s.length,index:0,start:0}]);for(var q=new Uint32Array(2*s.length),t=0,v=p.length;t<v;++t)for(var r=p[t].start,u=p[t].count,g=p[t].index,m=r,x=r+u;m<x;m+=3)for(r=0;3>r;r++)d[0]=
-g+s[m+r],d[1]=g+s[m+(r+1)%3],d.sort(f),u=d.toString(),void 0===e[u]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[u]=!0,n++);d=new Float32Array(6*n);m=0;for(s=n;m<s;m++)for(r=0;2>r;r++)g=6*m+3*r,n=3*q[2*m+r],d[g+0]=k[n],d[g+1]=k[n+1],d[g+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,q=n/3,d=new Float32Array(6*n),m=0,s=q;m<s;m++)for(r=0;3>r;r++)g=18*m+6*r,q=9*m+3*r,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],n=9*m+(r+1)%3*3,d[g+3]=k[n],d[g+4]=k[n+1],d[g+5]=k[n+2];h.addAttribute("position",new THREE.BufferAttribute(d,
+THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,p=a.geometry.faces,n=0,q=new Uint32Array(6*p.length),l=0,s=p.length;l<s;l++)for(var t=p[l],r=0;3>r;r++){d[0]=t[g[r]];d[1]=t[g[(r+1)%3]];d.sort(f);var u=d.toString();void 0===e[u]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[u]=!0,n++)}d=new Float32Array(6*n);l=0;for(s=n;l<s;l++)for(r=0;2>r;r++)n=
+k[q[2*l+r]],g=6*l+3*r,d[g+0]=n.x,d[g+1]=n.y,d[g+2]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){k=a.geometry.attributes.position.array;s=a.geometry.attributes.index.array;p=a.geometry.drawcalls;n=0;0===p.length&&(p=[{count:s.length,index:0,start:0}]);for(var q=new Uint32Array(2*s.length),t=0,v=p.length;t<v;++t)for(var r=p[t].start,u=p[t].count,g=p[t].index,l=r,x=r+u;l<x;l+=3)for(r=0;3>r;r++)d[0]=
+g+s[l+r],d[1]=g+s[l+(r+1)%3],d.sort(f),u=d.toString(),void 0===e[u]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[u]=!0,n++);d=new Float32Array(6*n);l=0;for(s=n;l<s;l++)for(r=0;2>r;r++)g=6*l+3*r,n=3*q[2*l+r],d[g+0]=k[n],d[g+1]=k[n+1],d[g+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,q=n/3,d=new Float32Array(6*n),l=0,s=q;l<s;l++)for(r=0;3>r;r++)g=18*l+6*r,q=9*l+3*r,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],n=9*l+(r+1)%3*3,d[g+3]=k[n],d[g+4]=k[n+1],d[g+5]=k[n+2];h.addAttribute("position",new THREE.BufferAttribute(d,
 3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper;THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;
 THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh;
 THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=b;this.animationsList.push(b)};