Mr.doob 10 anni fa
parent
commit
6257d96f78
2 ha cambiato i file con 391 aggiunte e 384 eliminazioni
  1. 106 99
      build/three.js
  2. 285 285
      build/three.min.js

+ 106 - 99
build/three.js

@@ -12696,6 +12696,8 @@ THREE.XHRLoader.prototype = {
 
 		scope.manager.itemStart( url );
 
+		return request;
+
 	},
 
 	setResponseType: function ( value ) {
@@ -19690,14 +19692,15 @@ THREE.WebGLRenderer = function ( parameters ) {
 		if ( object.hasUvs && ! object.__webglUvBuffer ) object.__webglUvBuffer = _gl.createBuffer();
 		if ( object.hasColors && ! object.__webglColorBuffer ) object.__webglColorBuffer = _gl.createBuffer();
 
+		var attributes = program.getAttributes();
+
 		if ( object.hasPositions ) {
 
 			_gl.bindBuffer( _gl.ARRAY_BUFFER, object.__webglVertexBuffer );
 			_gl.bufferData( _gl.ARRAY_BUFFER, object.positionArray, _gl.DYNAMIC_DRAW );
 
-			state.enableAttribute( program.attributes.position );
-
-			_gl.vertexAttribPointer( program.attributes.position, 3, _gl.FLOAT, false, 0, 0 );
+			state.enableAttribute( attributes.position );
+			_gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 );
 
 		}
 
@@ -19750,9 +19753,9 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			_gl.bufferData( _gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW );
 
-			state.enableAttribute( program.attributes.normal );
+			state.enableAttribute( attributes.normal );
 
-			_gl.vertexAttribPointer( program.attributes.normal, 3, _gl.FLOAT, false, 0, 0 );
+			_gl.vertexAttribPointer( attributes.normal, 3, _gl.FLOAT, false, 0, 0 );
 
 		}
 
@@ -19761,9 +19764,9 @@ THREE.WebGLRenderer = function ( parameters ) {
 			_gl.bindBuffer( _gl.ARRAY_BUFFER, object.__webglUvBuffer );
 			_gl.bufferData( _gl.ARRAY_BUFFER, object.uvArray, _gl.DYNAMIC_DRAW );
 
-			state.enableAttribute( program.attributes.uv );
+			state.enableAttribute( attributes.uv );
 
-			_gl.vertexAttribPointer( program.attributes.uv, 2, _gl.FLOAT, false, 0, 0 );
+			_gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 0, 0 );
 
 		}
 
@@ -19772,9 +19775,9 @@ THREE.WebGLRenderer = function ( parameters ) {
 			_gl.bindBuffer( _gl.ARRAY_BUFFER, object.__webglColorBuffer );
 			_gl.bufferData( _gl.ARRAY_BUFFER, object.colorArray, _gl.DYNAMIC_DRAW );
 
-			state.enableAttribute( program.attributes.color );
+			state.enableAttribute( attributes.color );
 
-			_gl.vertexAttribPointer( program.attributes.color, 3, _gl.FLOAT, false, 0, 0 );
+			_gl.vertexAttribPointer( attributes.color, 3, _gl.FLOAT, false, 0, 0 );
 
 		}
 
@@ -19804,7 +19807,10 @@ THREE.WebGLRenderer = function ( parameters ) {
 		}
 
 		var geometryAttributes = geometry.attributes;
-		var programAttributes = program.attributes;
+
+		var programAttributes = program.getAttributes();
+
+		var materialDefaultAttributeValues = material.defaultAttributeValues;
 
 		for ( var name in programAttributes ) {
 
@@ -19873,17 +19879,27 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 					}
 
-				} else if ( material.defaultAttributeValues !== undefined ) {
+				} else if ( materialDefaultAttributeValues !== undefined ) {
 
-					if ( material.defaultAttributeValues[ name ] !== undefined ) {
+					var value = materialDefaultAttributeValues[ name ];
+					if ( value !== undefined ) {
 
-						if ( material.defaultAttributeValues[ name ].length === 2 ) {
+						switch ( value.length ) {
 
-							_gl.vertexAttrib2fv( programAttribute, material.defaultAttributeValues[ name ] );
+							case 2:
+								_gl.vertexAttrib2fv( programAttribute, value );
+								break;
 
-						} else if ( material.defaultAttributeValues[ name ].length === 3 ) {
+							case 3:
+								_gl.vertexAttrib3fv( programAttribute, value );
+								break;
 
-							_gl.vertexAttrib3fv( programAttribute, material.defaultAttributeValues[ name ] );
+							case 4:
+								_gl.vertexAttrib4fv( programAttribute, value );
+								break;
+
+							default:
+								_gl.vertexAttrib1fv( programAttribute, value );
 
 						}
 
@@ -20894,7 +20910,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		material.program = program;
 
-		var attributes = program.attributes;
+		var attributes = program.getAttributes();
 
 		if ( material.morphTargets ) {
 
@@ -20930,9 +20946,10 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		material.uniformsList = [];
 
+		var uniformLocations = material.program.getUniforms();
 		for ( var u in material.__webglShader.uniforms ) {
 
-			var location = material.program.uniforms[ u ];
+			var location = uniformLocations[ u ];
 
 			if ( location ) {
 				material.uniformsList.push( [ material.__webglShader.uniforms[ u ], location ] );
@@ -20978,7 +20995,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 		var refreshLights = false;
 
 		var program = material.program,
-			p_uniforms = program.uniforms,
+			p_uniforms = program.getUniforms(),
 			m_uniforms = material.__webglShader.uniforms;
 
 		if ( program.id !== _currentProgram ) {
@@ -23425,14 +23442,29 @@ THREE.WebGLProgram = ( function () {
 
 	}
 
-	function cacheUniformLocations( gl, program, identifiers ) {
+	function fetchUniformLocations( gl, program, identifiers ) {
+
 
 		var uniforms = {};
 
-		for ( var i = 0, l = identifiers.length; i < l; i ++ ) {
+		var n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS );
+
+		for ( var i = 0; i < n; i ++ ) {
+
+			var info = gl.getActiveUniform( program , i );
+			var name = info.name;
+			var location = gl.getUniformLocation( program, name );
+
+			//console.log("THREE.WebGLProgram: ACTIVE UNIFORM:", name);
 
-			var id = identifiers[ i ];
-			uniforms[ id ] = gl.getUniformLocation( program, id );
+			var suffixPos = name.lastIndexOf( '[0]' );
+			if ( suffixPos !== -1 && suffixPos === name.length - 3 ) {
+
+				uniforms[ name.substr( 0, suffixPos ) ] = location;
+
+			}
+
+			uniforms[ name ] = location;
 
 		}
 
@@ -23440,14 +23472,20 @@ THREE.WebGLProgram = ( function () {
 
 	}
 
-	function cacheAttributeLocations( gl, program, identifiers ) {
+	function fetchAttributeLocations( gl, program, identifiers ) {
 
 		var attributes = {};
 
-		for ( var i = 0, l = identifiers.length; i < l; i ++ ) {
+		var n = gl.getProgramParameter( program, gl.ACTIVE_ATTRIBUTES );
+
+		for ( var i = 0; i < n; i ++ ) {
+
+			var info = gl.getActiveAttrib( program , i );
+			var name = info.name;
+
+			//console.log("THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:", name);
 
-			var id = identifiers[ i ];
-			attributes[ id ] = gl.getAttribLocation( program, id );
+			attributes[ name ] = gl.getAttribLocation( program, name );
 
 		}
 
@@ -23559,16 +23597,16 @@ THREE.WebGLProgram = ( function () {
 
 		var program = gl.createProgram();
 
-		var prefix_vertex, prefix_fragment;
+		var prefixVertex, prefixFragment;
 
 		if ( material instanceof THREE.RawShaderMaterial ) {
 
-			prefix_vertex = '';
-			prefix_fragment = '';
+			prefixVertex = '';
+			prefixFragment = '';
 
 		} else {
 
-			prefix_vertex = [
+			prefixVertex = [
 
 				'precision ' + parameters.precision + ' float;',
 				'precision ' + parameters.precision + ' int;',
@@ -23675,7 +23713,7 @@ THREE.WebGLProgram = ( function () {
 
 			].filter( filterEmptyLine ).join( '\n' );
 
-			prefix_fragment = [
+			prefixFragment = [
 
 				( parameters.bumpMap || parameters.normalMap || parameters.flatShading || material.derivatives ) ? '#extension GL_OES_standard_derivatives : enable' : '',
 
@@ -23736,8 +23774,11 @@ THREE.WebGLProgram = ( function () {
 
 		}
 
-		var glVertexShader = new THREE.WebGLShader( gl, gl.VERTEX_SHADER, prefix_vertex + vertexShader );
-		var glFragmentShader = new THREE.WebGLShader( gl, gl.FRAGMENT_SHADER, prefix_fragment + fragmentShader );
+		var vertexGlsl = prefixVertex + vertexShader;
+		var fragmentGlsl = prefixFragment + fragmentShader;
+
+		var glVertexShader = new THREE.WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl );
+		var glFragmentShader = new THREE.WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl );
 
 		gl.attachShader( program, glVertexShader );
 		gl.attachShader( program, glFragmentShader );
@@ -23775,91 +23816,57 @@ THREE.WebGLProgram = ( function () {
 		gl.deleteShader( glVertexShader );
 		gl.deleteShader( glFragmentShader );
 
-		// cache uniform locations
-
-		var identifiers = [
-
-			'viewMatrix',
-			'modelViewMatrix',
-			'projectionMatrix',
-			'normalMatrix',
-			'modelMatrix',
-			'cameraPosition',
-			'morphTargetInfluences',
-			'bindMatrix',
-			'bindMatrixInverse'
-
-		];
-
-		if ( parameters.useVertexTexture ) {
+		// set up caching for uniform locations
 
-			identifiers.push( 'boneTexture', 'boneTextureWidth', 'boneTextureHeight' );
+		var getUniforms = function() { return this._cachedUniforms; };
 
-		} else {
-
-			identifiers.push( 'boneGlobalMatrices' );
-
-		}
-
-		if ( parameters.logarithmicDepthBuffer ) {
-
-			identifiers.push( 'logDepthBufFC' );
-
-		}
-
-		for ( var u in uniforms ) {
-
-			identifiers.push( u );
-
-		}
-
-		this.uniforms = cacheUniformLocations( gl, program, identifiers );
+		this.getUniforms = function() {
 
-		// cache attributes locations
+			// fetch, cache, and next time just use a dumb accessor
+			var uniforms = fetchUniformLocations( gl, program );
+			this._cachedUniforms = uniforms;
+			this.getUniforms = getUniforms;
+			return uniforms;
 
-		if ( material instanceof THREE.RawShaderMaterial ) {
+		};
 
-			identifiers = attributes;
+		// set up caching for attribute locations
 
-		} else {
+		var getAttributes = function() { return this._cachedAttributes; };
 
-			identifiers = [
+		this.getAttributes = function() {
 
-				'position',
-				'normal',
-				'uv',
-				'uv2',
-				'tangent',
-				'color',
-				'skinIndex',
-				'skinWeight',
-				'lineDistance'
+			var attributes = fetchAttributeLocations( gl, program );
+			this._cachedAttributes = attributes;
+			this.getAttributes = getAttributes;
+			return attributes;
 
-			];
-
-			for ( var i = 0; i < parameters.maxMorphTargets; i ++ ) {
+		};
 
-				identifiers.push( 'morphTarget' + i );
+		// DEPRECATED
 
-			}
+		Object.defineProperties( this, {
 
-			for ( var i = 0; i < parameters.maxMorphNormals; i ++ ) {
+			uniforms: {
+				get: function() {
 
-				identifiers.push( 'morphNormal' + i );
+					console.warn( 'THREE.WebGLProgram: .uniforms is now .getUniforms().' );
+					return this.getUniforms();
 
-			}
-
-			// ShaderMaterial attributes
+				}
+			},
 
-			if ( Array.isArray( attributes ) ) {
+			attributes: {
+				get: function() {
 
-				identifiers = identifiers.concat( attributes );
+					console.warn( 'THREE.WebGLProgram: .attributes is now .getAttributes().' );
+					return this.getAttributes();
 
+				}
 			}
 
-		}
+		});
 
-		this.attributes = cacheAttributeLocations( gl, program, identifiers );
 
 		//
 

+ 285 - 285
build/three.min.js

@@ -67,8 +67,8 @@ Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return
 fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];this.z=a.array[b+2];this.w=a.array[b+3];return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};
 THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ";
 THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x=
-a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],l=e[9],n=e[2],p=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-l,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(p,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,
-k)):(this._y=Math.atan2(-n,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(p,-1,1)),.99999>Math.abs(p)?(this._y=Math.atan2(-n,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(n,-1,1)),.99999>Math.abs(n)?(this._x=Math.atan2(p,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-n,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=
+a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],l=e[9],m=e[2],p=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-l,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(p,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,
+k)):(this._y=Math.atan2(-m,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(p,-1,1)),.99999>Math.abs(p)?(this._y=Math.atan2(-m,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?(this._x=Math.atan2(p,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=
 Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(p,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-l,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeRotationFromQuaternion(b);this.setFromRotationMatrix(a,c,d);return this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,
 b||this._order)},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this);this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?
 a.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}};THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3};
@@ -94,22 +94,22 @@ void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.
 this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-c[1]*c[4];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");console.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&&console.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,l,n,p,m,q,t,s){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]=l;u[10]=n;u[14]=p;u[3]=m;u[7]=q;u[11]=t;u[15]=s;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){console.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,l,m,p,n,r,t,s){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]=l;u[10]=m;u[14]=p;u[3]=n;u[7]=r;u[11]=t;u[15]=s;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){console.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;return function(b){void 0===a&&(a=new THREE.Vector3);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&&console.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,l=c*h,n=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+l*d;b[5]=a-n*d;b[9]=-c*g;b[2]=n-a*d;b[6]=l+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,l=d*h,n=d*e,b[0]=a+n*c,b[4]=l*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=n+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,l=d*h,n=d*e,b[0]=a-n*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*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,l=c*h,n=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+n,b[1]=g*e,b[5]=n*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*
-g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=f*g,k=f*d,l=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-l,b[2]=l*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){console.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 l=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]=l-f;b[8]=c+h;b[1]=l+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,b,c;return function(d,e,f){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var g=this.elements;c.subVectors(d,
+f*h;var k=f*e,l=c*h,m=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+l*d;b[5]=a-m*d;b[9]=-c*g;b[2]=m-a*d;b[6]=l+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,l=d*h,m=d*e,b[0]=a+m*c,b[4]=l*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=m+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,l=d*h,m=d*e,b[0]=a-m*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=f*h,b[9]=m-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,l=c*h,m=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+m,b[1]=g*e,b[5]=m*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*
+g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,l=c*g,m=c*d,b[0]=g*h,b[4]=m-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-m*e):"XZY"===a.order&&(a=f*g,k=f*d,l=c*g,m=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+m,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=m*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){console.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 l=c*h,c=c*k,m=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(m+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+m);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,b,c;return function(d,e,f){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);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?(console.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],l=c[1],n=c[5],p=c[9],m=c[13],q=c[2],t=c[6],s=c[10],u=c[14],w=c[3],x=c[7],A=c[11],c=c[15],y=d[0],D=d[4],I=d[8],v=d[12],E=d[1],L=d[5],C=d[9],F=d[13],R=d[2],J=d[6],z=d[10],G=d[14],B=d[3],T=d[7],O=d[11],d=d[15];e[0]=f*y+g*E+h*R+k*B;e[4]=f*D+g*L+h*J+k*T;e[8]=f*I+g*C+h*z+k*O;e[12]=f*v+g*F+h*G+k*d;e[1]=l*y+n*E+p*R+m*B;e[5]=l*D+n*L+p*J+m*T;e[9]=l*I+n*C+p*z+m*O;e[13]=l*v+n*F+p*G+m*d;e[2]=q*y+t*E+s*R+u*B;e[6]=q*D+t*L+s*J+u*T;e[10]=q*I+t*C+s*z+u*O;e[14]=
-q*v+t*F+s*G+u*d;e[3]=w*y+x*E+A*R+c*B;e[7]=w*D+x*L+A*J+c*T;e[11]=w*I+x*C+A*z+c*O;e[15]=w*v+x*F+A*G+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]*=
+d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],m=c[5],p=c[9],n=c[13],r=c[2],t=c[6],s=c[10],u=c[14],x=c[3],w=c[7],A=c[11],c=c[15],y=d[0],G=d[4],I=d[8],v=d[12],D=d[1],L=d[5],C=d[9],E=d[13],R=d[2],J=d[6],z=d[10],F=d[14],B=d[3],T=d[7],O=d[11],d=d[15];e[0]=f*y+g*D+h*R+k*B;e[4]=f*G+g*L+h*J+k*T;e[8]=f*I+g*C+h*z+k*O;e[12]=f*v+g*E+h*F+k*d;e[1]=l*y+m*D+p*R+n*B;e[5]=l*G+m*L+p*J+n*T;e[9]=l*I+m*C+p*z+n*O;e[13]=l*v+m*E+p*F+n*d;e[2]=r*y+t*D+s*R+u*B;e[6]=r*G+t*L+s*J+u*T;e[10]=r*I+t*C+s*z+u*O;e[14]=
+r*v+t*E+s*F+u*d;e[3]=x*y+w*D+A*R+c*B;e[7]=x*G+w*L+A*J+c*T;e[11]=x*I+w*C+A*z+c*O;e[15]=x*v+w*E+A*F+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){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
-a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.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],l=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*k*
-n-e*g*p+c*k*p+d*g*m-c*h*m)+a[7]*(+b*h*m-b*k*p+e*f*p-d*f*m+d*k*l-e*h*l)+a[11]*(+b*k*n-b*g*m-e*f*n+c*f*m+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*n+b*g*p+d*f*n-c*f*p+c*h*l)},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]=
+a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.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],l=a[2],m=a[6],p=a[10],n=a[14];return a[3]*(+e*h*m-d*k*
+m-e*g*p+c*k*p+d*g*n-c*h*n)+a[7]*(+b*h*n-b*k*p+e*f*p-d*f*n+d*k*l-e*h*l)+a[11]*(+b*k*m-b*g*n-e*f*m+c*f*n+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*m+b*g*p+d*f*m-c*f*p+c*h*l)},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;return function(){void 0===a&&(a=new THREE.Vector3);console.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],l=d[5],n=d[9],p=d[13],m=d[2],q=d[6],t=d[10],s=d[14],u=d[3],w=d[7],x=d[11],d=d[15];c[0]=n*s*w-p*t*w+p*q*x-l*s*x-n*q*d+l*t*d;c[4]=h*t*w-g*s*w-h*q*x+f*s*x+g*q*d-f*t*d;c[8]=g*p*w-h*n*w+h*l*x-f*p*x-g*l*d+f*n*d;c[12]=h*n*q-g*p*q-h*l*t+f*p*t+g*l*s-f*n*s;c[1]=p*t*u-n*s*u-p*m*x+k*s*x+n*m*d-k*t*d;c[5]=g*s*u-h*t*u+h*m*x-e*s*x-g*m*d+e*t*d;c[9]=h*n*u-g*p*u-h*k*x+e*p*x+g*k*d-e*n*d;c[13]=g*p*m-h*n*m+h*k*t-e*p*t-g*k*s+e*n*s;c[2]=l*s*u-p*q*u+p*m*w-k*s*
-w-l*m*d+k*q*d;c[6]=h*q*u-f*s*u-h*m*w+e*s*w+f*m*d-e*q*d;c[10]=f*p*u-h*l*u+h*k*w-e*p*w-f*k*d+e*l*d;c[14]=h*l*m-f*p*m-h*k*q+e*p*q+f*k*s-e*l*s;c[3]=n*q*u-l*t*u-n*m*w+k*t*w+l*m*x-k*q*x;c[7]=f*t*u-g*q*u+g*m*w-e*t*w-f*m*x+e*q*x;c[11]=g*l*u-f*n*u-g*k*w+e*n*w+f*k*x-e*l*x;c[15]=f*n*m-g*l*m+g*k*q-e*n*q-f*k*t+e*l*t;c=e*c[0]+k*c[4]+m*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
+this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],m=d[9],p=d[13],n=d[2],r=d[6],t=d[10],s=d[14],u=d[3],x=d[7],w=d[11],d=d[15];c[0]=m*s*x-p*t*x+p*r*w-l*s*w-m*r*d+l*t*d;c[4]=h*t*x-g*s*x-h*r*w+f*s*w+g*r*d-f*t*d;c[8]=g*p*x-h*m*x+h*l*w-f*p*w-g*l*d+f*m*d;c[12]=h*m*r-g*p*r-h*l*t+f*p*t+g*l*s-f*m*s;c[1]=p*t*u-m*s*u-p*n*w+k*s*w+m*n*d-k*t*d;c[5]=g*s*u-h*t*u+h*n*w-e*s*w-g*n*d+e*t*d;c[9]=h*m*u-g*p*u-h*k*w+e*p*w+g*k*d-e*m*d;c[13]=g*p*n-h*m*n+h*k*t-e*p*t-g*k*s+e*m*s;c[2]=l*s*u-p*r*u+p*n*x-k*s*
+x-l*n*d+k*r*d;c[6]=h*r*u-f*s*u-h*n*x+e*s*x+f*n*d-e*r*d;c[10]=f*p*u-h*l*u+h*k*x-e*p*x-f*k*d+e*l*d;c[14]=h*l*n-f*p*n-h*k*r+e*p*r+f*k*s-e*l*s;c[3]=m*r*u-l*t*u-m*n*x+k*t*x+l*n*w-k*r*w;c[7]=f*t*u-g*r*u+g*n*x-e*t*x-f*n*w+e*r*w;c[11]=g*l*u-f*m*u-g*k*x+e*m*x+f*k*w-e*l*w;c[15]=f*m*n-g*l*n+g*k*r-e*m*r-f*k*t+e*l*t;c=e*c[0]+k*c[4]+n*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
 this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(a,b){console.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,l=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*g+d*h,l*g+c,l*h-d*f,0,k*h-d*g,l*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,
@@ -119,8 +119,8 @@ a));var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function
 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),l=c.dot(this.direction),n=-c.dot(b),p=c.lengthSq(),m=Math.abs(1-k*k),q;0<m?(d=k*n-l,e=k*l-n,q=h*m,0<=d?e>=-q?e<=q?(h=1/m,d*=h,e*=h,k=d*(d+k*e+2*l)+e*(k*d+e+2*n)+p):(e=h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p):(e=-h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p):e<=-q?(d=Math.max(0,-(-k*h+l)),e=0<d?-h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+p):e<=q?(d=0,e=Math.min(Math.max(-h,-n),h),k=e*(e+
-2*n)+p):(d=Math.max(0,-(k*h+l)),e=0<d?h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+p)):(e=0<k?-h:h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p);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;
+b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),l=c.dot(this.direction),m=-c.dot(b),p=c.lengthSq(),n=Math.abs(1-k*k),r;0<n?(d=k*m-l,e=k*l-m,r=h*n,0<=d?e>=-r?e<=r?(h=1/n,d*=h,e*=h,k=d*(d+k*e+2*l)+e*(k*d+e+2*m)+p):(e=h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+p):(e=-h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+p):e<=-r?(d=Math.max(0,-(-k*h+l)),e=0<d?-h:Math.min(Math.max(-h,-m),h),k=-d*d+e*(e+2*m)+p):e<=r?(d=0,e=Math.min(Math.max(-h,-m),h),k=e*(e+
+2*m)+p):(d=Math.max(0,-(k*h+l)),e=0<d?h:Math.min(Math.max(-h,-m),h),k=-d*d+e*(e+2*m)+p)):(e=0<k?-h:h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+p);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)*
 g,g*=a.min.z-h.z);if(c>g||e>d)return null;if(e>c||c!==c)c=e;if(g<d||d!==d)d=g;return 0>d?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0<f){if(h)return null;h=1}else if(0>f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));
@@ -129,8 +129,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],l=c[7],n=c[8],p=c[9],m=c[10],q=c[11],t=c[12],s=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,l-g,q-n,c-t).normalize();b[1].setComponents(f+
-a,l+g,q+n,c+t).normalize();b[2].setComponents(f+d,l+h,q+p,c+s).normalize();b[3].setComponents(f-d,l-h,q-p,c-s).normalize();b[4].setComponents(f-e,l-k,q-m,c-u).normalize();b[5].setComponents(f+e,l+k,q+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],l=c[7],m=c[8],p=c[9],n=c[10],r=c[11],t=c[12],s=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,l-g,r-m,c-t).normalize();b[1].setComponents(f+
+a,l+g,r+m,c+t).normalize();b[2].setComponents(f+d,l+h,r+p,c+s).normalize();b[3].setComponents(f-d,l-h,r-p,c-s).normalize();b[4].setComponents(f-e,l-k,r-n,c-u).normalize();b[5].setComponents(f+e,l+k,r+n,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,
@@ -141,9 +141,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,l,n,p,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;l=this.points[c[0]];n=this.points[c[1]];p=this.points[c[2]];m=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,n.x,p.x,m.x,g,h,k);d.y=b(l.y,n.y,p.y,m.y,g,h,k);d.z=b(l.z,n.z,p.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),
+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,l,m,p,n;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;l=this.points[c[0]];m=this.points[c[1]];p=this.points[c[2]];n=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,m.x,p.x,n.x,g,h,k);d.y=b(l.y,m.y,p.y,n.y,g,h,k);d.z=b(l.z,m.z,p.z,n.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 l=d*k-e*e;h=h||new THREE.Vector3;if(0===l)return h.set(-2,-1,-1);l=1/l;k=(k*f-e*g)*l;d=(d*g-e*f)*l;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}}();
@@ -193,31 +193,31 @@ setXYZ:function(a,b,c,d){a=a*this.data.stride+this.offset;this.data.array[a+0]=b
 THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=
 this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=this.hasTangents=!1};
 THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;e<f;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=
-this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=[],l=[],n=c=0;c<d.length;c+=3,n+=2)b.vertices.push(new THREE.Vector3(d[c],d[c+1],d[c+2])),void 0!==f&&k.push(new THREE.Vector3(f[c],f[c+1],f[c+2])),void 0!==g&&b.colors.push(new THREE.Color(g[c],g[c+1],g[c+2])),void 0!==h&&l.push(new THREE.Vector2(h[n],
-h[n+1]));var p=function(a,c,d){var e=void 0!==f?[k[a].clone(),k[c].clone(),k[d].clone()]:[],m=void 0!==g?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,m));void 0!==h&&b.faceVertexUvs[0].push([l[a].clone(),l[c].clone(),l[d].clone()])};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var n=d[c],m=n.start,q=n.count,t=n.index,n=m,m=m+q;n<m;n+=3)p(t+e[n],t+e[n+1],t+e[n+2]);else for(c=0;c<e.length;c+=3)p(e[c],e[c+1],e[c+2]);else for(c=
+this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=[],l=[],m=c=0;c<d.length;c+=3,m+=2)b.vertices.push(new THREE.Vector3(d[c],d[c+1],d[c+2])),void 0!==f&&k.push(new THREE.Vector3(f[c],f[c+1],f[c+2])),void 0!==g&&b.colors.push(new THREE.Color(g[c],g[c+1],g[c+2])),void 0!==h&&l.push(new THREE.Vector2(h[m],
+h[m+1]));var p=function(a,c,d){var e=void 0!==f?[k[a].clone(),k[c].clone(),k[d].clone()]:[],n=void 0!==g?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,n));void 0!==h&&b.faceVertexUvs[0].push([l[a].clone(),l[c].clone(),l[d].clone()])};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var m=d[c],n=m.start,r=m.count,t=m.index,m=n,n=n+r;m<n;m+=3)p(t+e[m],t+e[m+1],t+e[m+2]);else for(c=0;c<e.length;c+=3)p(e[c],e[c+1],e[c+2]);else for(c=
 0;c<d.length/3;c+=3)p(c,c+1,c+2);this.computeFaceNormals();null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},normalize:function(){this.computeBoundingSphere();var a=this.boundingSphere.center,b=this.boundingSphere.radius,b=0===b?1:1/b,c=new THREE.Matrix4;
 c.set(b,0,0,-b*a.x,0,b,0,-b*a.y,0,0,b,-b*a.z,0,0,0,1);this.applyMatrix(c);return this},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g);b.subVectors(f,g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,
 f,g,h=new THREE.Vector3,k=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),k.subVectors(e,f),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(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],e=c.vertexNormals,3===e.length?
 (e[0].copy(d[c.a]),e[1].copy(d[c.b]),e[2].copy(d[c.c])):(e[0]=d[c.a].clone(),e[1]=d[c.b].clone(),e[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,l,n,p,m,q,t,s,u,w=[],x=[];c=new THREE.Vector3;var A=new THREE.Vector3,y=new THREE.Vector3,
-D=new THREE.Vector3,I=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[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],l=f[0],n=f[1],p=f[2],f=h.x-g.x,m=k.x-g.x,q=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-l.x,s=p.x-l.x,n=n.y-l.y,l=p.y-l.y,p=1/(k*l-s*n),c.set((l*f-n*m)*p,(l*q-n*t)*p,(l*h-n*g)*p),A.set((k*m-s*f)*p,(k*t-s*q)*p,(k*g-s*h)*p),w[d].add(c),
-w[u].add(c),w[e].add(c),x[d].add(A),x[u].add(A),x[e].add(A);A=["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++)I.copy(e.vertexNormals[c]),d=e[A[c]],u=w[d],y.copy(u),y.sub(I.multiplyScalar(I.dot(u))).normalize(),D.crossVectors(e.vertexNormals[c],u),d=D.dot(x[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(y.x,y.y,y.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<
+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,l,m,p,n,r,t,s,u,x=[],w=[];c=new THREE.Vector3;var A=new THREE.Vector3,y=new THREE.Vector3,
+G=new THREE.Vector3,I=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)x[a]=new THREE.Vector3,w[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],l=f[0],m=f[1],p=f[2],f=h.x-g.x,n=k.x-g.x,r=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=m.x-l.x,s=p.x-l.x,m=m.y-l.y,l=p.y-l.y,p=1/(k*l-s*m),c.set((l*f-m*n)*p,(l*r-m*t)*p,(l*h-m*g)*p),A.set((k*n-s*f)*p,(k*t-s*r)*p,(k*g-s*h)*p),x[d].add(c),
+x[u].add(c),x[e].add(c),w[d].add(A),w[u].add(A),w[e].add(A);A=["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++)I.copy(e.vertexNormals[c]),d=e[A[c]],u=x[d],y.copy(u),y.sub(I.multiplyScalar(I.dot(u))).normalize(),G.crossVectors(e.vertexNormals[c],u),d=G.dot(w[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(y.x,y.y,y.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){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var c,d=this.vertices.length,
-e=this.vertices,f=a.vertices,g=this.faces,h=a.faces,k=this.faceVertexUvs[0],l=a.faceVertexUvs[0];void 0!==b&&(c=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,p=f.length;n<p;n++){var m=f[n].clone();void 0!==b&&m.applyMatrix4(b);e.push(m)}n=0;for(p=h.length;n<p;n++){var q=h[n],t,s=q.vertexNormals,u=q.vertexColors,m=new THREE.Face3(q.a+d,q.b+d,q.c+d);m.normal.copy(q.normal);void 0!==c&&m.normal.applyMatrix3(c).normalize();e=0;for(f=s.length;e<f;e++)t=s[e].clone(),void 0!==c&&t.applyMatrix3(c).normalize(),
-m.vertexNormals.push(t);m.color.copy(q.color);e=0;for(f=u.length;e<f;e++)q=u[e],m.vertexColors.push(q.clone());g.push(m)}n=0;for(p=l.length;n<p;n++)if(c=l[n],d=[],void 0!==c){e=0;for(f=c.length;e<f;e++)d.push(c[e].clone());k.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.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,
+e=this.vertices,f=a.vertices,g=this.faces,h=a.faces,k=this.faceVertexUvs[0],l=a.faceVertexUvs[0];void 0!==b&&(c=(new THREE.Matrix3).getNormalMatrix(b));for(var m=0,p=f.length;m<p;m++){var n=f[m].clone();void 0!==b&&n.applyMatrix4(b);e.push(n)}m=0;for(p=h.length;m<p;m++){var r=h[m],t,s=r.vertexNormals,u=r.vertexColors,n=new THREE.Face3(r.a+d,r.b+d,r.c+d);n.normal.copy(r.normal);void 0!==c&&n.normal.applyMatrix3(c).normalize();e=0;for(f=s.length;e<f;e++)t=s[e].clone(),void 0!==c&&t.applyMatrix3(c).normalize(),
+n.vertexNormals.push(t);n.color.copy(r.color);e=0;for(f=u.length;e<f;e++)r=u[e],n.vertexColors.push(r.clone());g.push(n)}m=0;for(p=l.length;m<p;m++)if(c=l[m],d=[],void 0!==c){e=0;for(f=c.length;e<f;e++)d.push(c[e].clone());k.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.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!==l[b])return l[b];l[b]=k.length/3;k.push(a.x,a.y,a.z);return l[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=n.length;n.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=m.length/2;m.push(a.x,
-a.y);return q[b]}var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.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=[],l={},n=[],p={},m=[],q={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],s=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),w=0<t.vertexNormals.length,
-x=1!==t.color.r||1!==t.color.g||1!==t.color.b,A=0<t.vertexColors.length,y=0,y=a(y,0,0),y=a(y,1,!1),y=a(y,2,!1),y=a(y,3,s),y=a(y,4,u),y=a(y,5,w),y=a(y,6,x),y=a(y,7,A);h.push(y);h.push(t.a,t.b,t.c);s&&(s=this.faceVertexUvs[0][g],h.push(d(s[0]),d(s[1]),d(s[2])));u&&h.push(b(t.normal));w&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));x&&h.push(c(t.color));A&&(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;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,l=g.length;k<l;k++)h.push(g[k].clone());a.faceVertexUvs[c].push(h)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};
+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!==l[b])return l[b];l[b]=k.length/3;k.push(a.x,a.y,a.z);return l[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=m.length;m.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==r[b])return r[b];r[b]=n.length/2;n.push(a.x,
+a.y);return r[b]}var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.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=[],l={},m=[],p={},n=[],r={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],s=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),x=0<t.vertexNormals.length,
+w=1!==t.color.r||1!==t.color.g||1!==t.color.b,A=0<t.vertexColors.length,y=0,y=a(y,0,0),y=a(y,1,!1),y=a(y,2,!1),y=a(y,3,s),y=a(y,4,u),y=a(y,5,x),y=a(y,6,w),y=a(y,7,A);h.push(y);h.push(t.a,t.b,t.c);s&&(s=this.faceVertexUvs[0][g],h.push(d(s[0]),d(s[1]),d(s[2])));u&&h.push(b(t.normal));x&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));w&&h.push(c(t.color));A&&(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<m.length&&(e.data.colors=m);0<n.length&&
+(e.data.uvs=[n]);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,l=g.length;k<l;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.DirectGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="DirectGeometry";this.indices=[];this.vertices=[];this.colors=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=
 !1};
 THREE.DirectGeometry.prototype={constructor:THREE.DirectGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.");return this},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.");return this},fromGeometry:function(a,b){b=
-b||{vertexColors:THREE.NoColors};for(var c=a.faces,d=a.vertices,e=a.faceVertexUvs,f=b.vertexColors,g=e[0]&&0<e[0].length,h=e[1]&&0<e[1].length,k=a.morphTargets,l=k.length,n=0;n<l;n++)this.morphTargets[n]=[];for(var p=a.morphNormals.length,n=0;n<p;n++)this.morphNormals[n]=[];p=a.morphColors.length;for(n=0;n<p;n++)this.morphColors[n]=[];for(var p=a.skinIndices,m=a.skinWeights,q=p.length===d.length,t=m.length===d.length,n=0;n<c.length;n++){var s=c[n];this.vertices.push(d[s.a],d[s.b],d[s.c]);var u=s.vertexNormals;
-3===u.length?this.normals.push(u[0],u[1],u[2]):(u=s.normal,this.normals.push(u,u,u));u=s.vertexColors;f===THREE.VertexColors?this.colors.push(u[0],u[1],u[2]):f===THREE.FaceColors&&(u=s.color,this.colors.push(u,u,u));!0===g&&(u=e[0][n],void 0!==u?this.uvs.push(u[0],u[1],u[2]):(console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv",n),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===h&&(u=e[1][n],void 0!==u?this.uvs2.push(u[0],u[1],u[2]):(console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv2",
-n),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));for(u=0;u<l;u++){var w=k[u].vertices;this.morphTargets[u].push(w[s.a],w[s.b],w[s.c])}q&&this.skinIndices.push(p[s.a],p[s.b],p[s.c]);t&&this.skinWeights.push(m[s.a],m[s.b],m[s.c])}this.verticesNeedUpdate=a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);
+b||{vertexColors:THREE.NoColors};for(var c=a.faces,d=a.vertices,e=a.faceVertexUvs,f=b.vertexColors,g=e[0]&&0<e[0].length,h=e[1]&&0<e[1].length,k=a.morphTargets,l=k.length,m=0;m<l;m++)this.morphTargets[m]=[];for(var p=a.morphNormals.length,m=0;m<p;m++)this.morphNormals[m]=[];p=a.morphColors.length;for(m=0;m<p;m++)this.morphColors[m]=[];for(var p=a.skinIndices,n=a.skinWeights,r=p.length===d.length,t=n.length===d.length,m=0;m<c.length;m++){var s=c[m];this.vertices.push(d[s.a],d[s.b],d[s.c]);var u=s.vertexNormals;
+3===u.length?this.normals.push(u[0],u[1],u[2]):(u=s.normal,this.normals.push(u,u,u));u=s.vertexColors;f===THREE.VertexColors?this.colors.push(u[0],u[1],u[2]):f===THREE.FaceColors&&(u=s.color,this.colors.push(u,u,u));!0===g&&(u=e[0][m],void 0!==u?this.uvs.push(u[0],u[1],u[2]):(console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv",m),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===h&&(u=e[1][m],void 0!==u?this.uvs2.push(u[0],u[1],u[2]):(console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv2",
+m),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));for(u=0;u<l;u++){var x=k[u].vertices;this.morphTargets[u].push(x[s.a],x[s.b],x[s.c])}r&&this.skinIndices.push(p[s.a],p[s.b],p[s.c]);t&&this.skinWeights.push(n[s.a],n[s.b],n[s.c])}this.verticesNeedUpdate=a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);
 THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.morphAttributes=[];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&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},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);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere()},copy:function(a){var b=a.attributes;a=a.offsets;for(var c in b)this.addAttribute(c,b[c].clone());b=0;for(c=a.length;b<c;b++){var d=a[b];this.offsets.push({start:d.start,index:d.index,
@@ -230,15 +230,15 @@ b[c],f=new THREE.Float32Attribute(3*e.length,3);this.morphAttributes.push(f.copy
 a.boundingBox.clone());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.fromArray(b,d),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))&&
 console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),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.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<
 f;e+=3)b.fromArray(c,e),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),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,l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var q=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,count:q.length,index:0}],s=0,u=t.length;s<u;++s){e=t[s].start;f=t[s].count;for(var w=t[s].index,d=e,e=e+f;d<e;d+=3)f=3*(w+q[d]),g=3*(w+q[d+1]),h=3*(w+q[d+2]),k.fromArray(b,f),l.fromArray(b,g),n.fromArray(b,h),p.subVectors(n,l),m.subVectors(k,
-l),p.cross(m),c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),n.fromArray(b,d+6),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);m.fromArray(d,3*b);q.fromArray(d,3*c);t.fromArray(f,
-2*a);s.fromArray(f,2*b);u.fromArray(f,2*c);w=m.x-p.x;x=q.x-p.x;A=m.y-p.y;y=q.y-p.y;D=m.z-p.z;I=q.z-p.z;v=s.x-t.x;E=u.x-t.x;L=s.y-t.y;C=u.y-t.y;F=1/(v*C-E*L);R.set((C*w-L*x)*F,(C*A-L*y)*F,(C*D-L*I)*F);J.set((v*x-E*w)*F,(v*y-E*A)*F,(v*I-E*D)*F);k[a].add(R);k[b].add(R);k[c].add(R);l[a].add(J);l[b].add(J);l[c].add(J)}function b(a){na.fromArray(e,3*a);da.copy(na);ja=k[a];H.copy(ja);H.sub(na.multiplyScalar(na.dot(ja))).normalize();K.crossVectors(da,ja);ua=K.dot(l[a]);ka=0>ua?-1:1;h[4*a]=H.x;h[4*a+1]=H.y;
+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,l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3;if(a.index)for(var r=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,count:r.length,index:0}],s=0,u=t.length;s<u;++s){e=t[s].start;f=t[s].count;for(var x=t[s].index,d=e,e=e+f;d<e;d+=3)f=3*(x+r[d]),g=3*(x+r[d+1]),h=3*(x+r[d+2]),k.fromArray(b,f),l.fromArray(b,g),m.fromArray(b,h),p.subVectors(m,l),n.subVectors(k,
+l),p.cross(n),c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),m.fromArray(b,d+6),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);n.fromArray(d,3*b);r.fromArray(d,3*c);t.fromArray(f,
+2*a);s.fromArray(f,2*b);u.fromArray(f,2*c);x=n.x-p.x;w=r.x-p.x;A=n.y-p.y;y=r.y-p.y;G=n.z-p.z;I=r.z-p.z;v=s.x-t.x;D=u.x-t.x;L=s.y-t.y;C=u.y-t.y;E=1/(v*C-D*L);R.set((C*x-L*w)*E,(C*A-L*y)*E,(C*G-L*I)*E);J.set((v*w-D*x)*E,(v*y-D*A)*E,(v*I-D*G)*E);k[a].add(R);k[b].add(R);k[c].add(R);l[a].add(J);l[b].add(J);l[c].add(J)}function b(a){na.fromArray(e,3*a);da.copy(na);ja=k[a];H.copy(ja);H.sub(na.multiplyScalar(na.dot(ja))).normalize();K.crossVectors(da,ja);ua=K.dot(l[a]);ka=0>ua?-1:1;h[4*a]=H.x;h[4*a+1]=H.y;
 h[4*a+2]=H.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)console.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=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,q=new THREE.Vector3,t=new THREE.Vector2,s=new THREE.Vector2,u=new THREE.Vector2,w,x,A,y,D,I,v,E,L,C,F,R=new THREE.Vector3,J=new THREE.Vector3,z,G,B,T,O;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var S=this.drawcalls,n=0;for(G=S.length;n<G;++n){z=S[n].start;B=S[n].count;var P=S[n].index,g=z;for(z+=B;g<z;g+=3)B=P+c[g],T=P+c[g+1],
-O=P+c[g+2],a(B,T,O)}var H=new THREE.Vector3,K=new THREE.Vector3,na=new THREE.Vector3,da=new THREE.Vector3,ka,ja,ua,n=0;for(G=S.length;n<G;++n)for(z=S[n].start,B=S[n].count,P=S[n].index,g=z,z+=B;g<z;g+=3)B=P+c[g],T=P+c[g+1],O=P+c[g+2],b(B),b(T),b(O)}},computeOffsets:function(a){void 0===a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),
-f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,p=new Int32Array(6),m=new Int32Array(c.length),q=new Int32Array(c.length),t=0;t<c.length;t++)m[t]=-1,q[t]=-1;for(c=0;c<d;c++){for(var s=n=0;3>s;s++)t=b[3*c+s],-1===m[t]?(p[2*s]=t,p[2*s+1]=-1,n++):m[t]<k.index?(p[2*s]=t,p[2*s+1]=-1,l++):(p[2*s]=t,p[2*s+1]=m[t]);if(g+n>k.index+a)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)s=p[n+1],-1<s&&s<k.index&&(p[n+1]=-1);for(n=0;6>n;n+=2)t=p[n],s=p[n+1],-1===s&&(s=g++),m[t]=s,q[s]=t,e[f++]=s-k.index,
-k.count++}this.reorderBuffers(e,q,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.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,l=d[e],n=0;n<k;n++)l[f*k+n]=h[g*k+n]}this.attributes.index.array=a;for(e in this.attributes)"index"!==
+g),4));for(var h=this.attributes.tangent.array,k=[],l=[],m=0;m<g;m++)k[m]=new THREE.Vector3,l[m]=new THREE.Vector3;var p=new THREE.Vector3,n=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector2,s=new THREE.Vector2,u=new THREE.Vector2,x,w,A,y,G,I,v,D,L,C,E,R=new THREE.Vector3,J=new THREE.Vector3,z,F,B,T,O;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var S=this.drawcalls,m=0;for(F=S.length;m<F;++m){z=S[m].start;B=S[m].count;var P=S[m].index,g=z;for(z+=B;g<z;g+=3)B=P+c[g],T=P+c[g+1],
+O=P+c[g+2],a(B,T,O)}var H=new THREE.Vector3,K=new THREE.Vector3,na=new THREE.Vector3,da=new THREE.Vector3,ka,ja,ua,m=0;for(F=S.length;m<F;++m)for(z=S[m].start,B=S[m].count,P=S[m].index,g=z,z+=B;g<z;g+=3)B=P+c[g],T=P+c[g+1],O=P+c[g+2],b(B),b(T),b(O)}},computeOffsets:function(a){void 0===a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),
+f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,m=0,p=new Int32Array(6),n=new Int32Array(c.length),r=new Int32Array(c.length),t=0;t<c.length;t++)n[t]=-1,r[t]=-1;for(c=0;c<d;c++){for(var s=m=0;3>s;s++)t=b[3*c+s],-1===n[t]?(p[2*s]=t,p[2*s+1]=-1,m++):n[t]<k.index?(p[2*s]=t,p[2*s+1]=-1,l++):(p[2*s]=t,p[2*s+1]=n[t]);if(g+m>k.index+a)for(k={start:f,count:0,index:g},h.push(k),m=0;6>m;m+=2)s=p[m+1],-1<s&&s<k.index&&(p[m+1]=-1);for(m=0;6>m;m+=2)t=p[m],s=p[m+1],-1===s&&(s=g++),n[t]=s,r[s]=t,e[f++]=s-k.index,
+k.count++}this.reorderBuffers(e,r,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.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,l=d[e],m=0;m<k;m++)l[f*k+m]=h[g*k+m]}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.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);if(void 0!==this.parameters){var b=this.parameters,c;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data={attributes:{}};var b=this.attributes,d=this.offsets,e=this.boundingSphere;for(c in b){var f=b[c],g=Array.prototype.slice.call(f.array);
 a.data.attributes[c]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}0<d.length&&(a.data.offsets=JSON.parse(JSON.stringify(d)));null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.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);THREE.BufferGeometry.MaxIndex=65535;THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0};THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry;
@@ -246,8 +246,8 @@ THREE.InstancedBufferGeometry.prototype.addDrawCall=function(a,b,c,d){this.drawc
 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){void 0===this.parent&&this.updateMatrixWorld();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);a.setRenderTarget(null)}};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){void 0===this.parent&&this.updateMatrixWorld();var c=this.renderTarget,n=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=n;c.activeCubeFace=5;a.render(b,k,c);a.setRenderTarget(null)}};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};
@@ -273,26 +273,26 @@ a.shadowDarkness=this.shadowDarkness;a.shadowMapWidth=this.shadowMapWidth;a.shad
 THREE.Cache={files:{},add:function(a,b){this.files[a]=b},get:function(a){return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.imageLoader=new THREE.ImageLoader;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/a.total).toFixed(0)+
 "%"):b+((a.loaded/1024).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split("/");if(1===a.length)return"./";a.pop();return a.join("/")+"/"},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=this.createMaterial(a[d],b);return c},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function d(a,
-d,e,g,h,k,s){var u=b+e,w,x=THREE.Loader.Handlers.get(u);null!==x?w=x.load(u):(w=new THREE.Texture,x=f.imageLoader,x.crossOrigin=f.crossOrigin,x.load(u,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);w.image=e}else w.image=a;w.needsUpdate=!0}));w.sourceFile=e;g&&(w.repeat.set(g[0],g[1]),1!==g[0]&&(w.wrapS=THREE.RepeatWrapping),
-1!==g[1]&&(w.wrapT=THREE.RepeatWrapping));h&&w.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(w.wrapS=e[k[0]]),void 0!==e[k[1]]&&(w.wrapT=e[k[1]]));s&&(w.anisotropy=s);a[d]=w}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":
+d,e,g,h,k,s){var u=b+e,x,w=THREE.Loader.Handlers.get(u);null!==w?x=w.load(u):(x=new THREE.Texture,w=f.imageLoader,w.crossOrigin=f.crossOrigin,w.load(u,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);x.image=e}else x.image=a;x.needsUpdate=!0}));x.sourceFile=e;g&&(x.repeat.set(g[0],g[1]),1!==g[0]&&(x.wrapS=THREE.RepeatWrapping),
+1!==g[1]&&(x.wrapT=THREE.RepeatWrapping));h&&x.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(x.wrapS=e[k[0]]),void 0!==e[k[1]]&&(x.wrapT=e[k[1]]));s&&(x.anisotropy=s);a[d]=x}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":
 "basic"===k&&(g="MeshBasicMaterial")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]);void 0!==a.transparent&&(h.transparent=a.transparent);void 0!==a.opacity&&1>a.opacity&&(h.transparent=!0);void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);
 void 0!==a.vertexColors&&("face"===a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorEmissive&&(h.emissive=e(a.colorEmissive));void 0!==a.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),a.opacity=a.transparency);void 0!==a.opacity&&(h.opacity=a.opacity);a.specularCoef&&(h.shininess=
 a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapAO&&b&&d(h,"aoMap",a.mapAO,a.mapAORepeat,a.mapAOOffset,a.mapAOWrap,a.mapAOAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,
 a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy);a.mapAlpha&&b&&d(h,"alphaMap",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy);a.mapBumpScale&&(h.bumpScale=a.mapBumpScale);a.mapNormalFactor&&(h.normalScale=new THREE.Vector2(a.mapNormalFactor,a.mapNormalFactor));g=new THREE[g](h);void 0!==a.DbgName&&(g.name=a.DbgName);return g}};
 THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;b<c;b+=2){var d=this.handlers[b+1];if(this.handlers[b].test(a))return d}return null}};THREE.XHRLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
 THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){var e=this,f=THREE.Cache.get(a);if(void 0!==f)return b&&b(f),f;f=new XMLHttpRequest;f.open("GET",a,!0);f.addEventListener("load",function(c){THREE.Cache.add(a,this.response);b&&b(this.response);e.manager.itemEnd(a)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);void 0!==d&&f.addEventListener("error",function(a){d(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);void 0!==this.responseType&&
-(f.responseType=this.responseType);f.send(null);e.manager.itemStart(a)},setResponseType:function(a){this.responseType=a},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.ImageLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
+(f.responseType=this.responseType);f.send(null);e.manager.itemStart(a);return f},setResponseType:function(a){this.responseType=a},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.ImageLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
 THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=THREE.Cache.get(a);if(void 0!==f)return b&&b(f),f;f=document.createElement("img");f.addEventListener("load",function(c){THREE.Cache.add(a,this);b&&b(this);e.manager.itemEnd(a)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);void 0!==d&&f.addEventListener("error",function(a){d(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);e.manager.itemStart(a);f.src=a;return f},
 setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 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),k=h.metadata;if(void 0!==k){if("object"===k.type){console.error("THREE.JSONLoader: "+b+" should be loaded with THREE.ObjectLoader instead.");return}if("scene"===k.type){console.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 console.error("THREE.JSONLoader: "+b+" seems to be unreachable or the file is empty.");a.onLoadComplete()}else console.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,l,n,p,m,q,t,s,u,w,x=a.faces;n=a.vertices;var A=a.normals,y=a.colors,D=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&D++;for(d=0;d<D;d++)c.faceVertexUvs[d]=[]}k=0;for(l=n.length;k<l;)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(l=x.length;k<l;)if(b=x[k++],q=b&1,h=b&2,d=b&8,p=b&16,t=b&32,n=b&64,b&=128,q){q=new THREE.Face3;
-q.a=x[k];q.b=x[k+1];q.c=x[k+3];s=new THREE.Face3;s.a=x[k+1];s.b=x[k+2];s.c=x[k+3];k+=4;h&&k++;h=c.faces.length;if(d)for(d=0;d<D;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=x[k++],w=u[2*m],m=u[2*m+1],w=new THREE.Vector2(w,m),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);p&&(p=3*x[k++],q.normal.set(A[p++],A[p++],A[p]),s.normal.copy(q.normal));if(t)for(d=0;4>d;d++)p=3*x[k++],t=new THREE.Vector3(A[p++],A[p++],A[p]),2!==d&&q.vertexNormals.push(t),
-0!==d&&s.vertexNormals.push(t);n&&(n=x[k++],n=y[n],q.color.setHex(n),s.color.setHex(n));if(b)for(d=0;4>d;d++)n=x[k++],n=y[n],2!==d&&q.vertexColors.push(new THREE.Color(n)),0!==d&&s.vertexColors.push(new THREE.Color(n));c.faces.push(q);c.faces.push(s)}else{q=new THREE.Face3;q.a=x[k++];q.b=x[k++];q.c=x[k++];h&&k++;h=c.faces.length;if(d)for(d=0;d<D;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=x[k++],w=u[2*m],m=u[2*m+1],w=new THREE.Vector2(w,m),c.faceVertexUvs[d][h].push(w);p&&(p=3*x[k++],
-q.normal.set(A[p++],A[p++],A[p]));if(t)for(d=0;3>d;d++)p=3*x[k++],t=new THREE.Vector3(A[p++],A[p++],A[p]),q.vertexNormals.push(t);n&&(n=x[k++],q.color.setHex(y[n]));if(b)for(d=0;3>d;d++)n=x[k++],q.vertexColors.push(new THREE.Color(y[n]));c.faces.push(q)}})(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?
+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,l,m,p,n,r,t,s,u,x,w=a.faces;m=a.vertices;var A=a.normals,y=a.colors,G=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&G++;for(d=0;d<G;d++)c.faceVertexUvs[d]=[]}k=0;for(l=m.length;k<l;)d=new THREE.Vector3,d.x=m[k++]*b,d.y=m[k++]*b,d.z=m[k++]*b,c.vertices.push(d);k=0;for(l=w.length;k<l;)if(b=w[k++],r=b&1,h=b&2,d=b&8,p=b&16,t=b&32,m=b&64,b&=128,r){r=new THREE.Face3;
+r.a=w[k];r.b=w[k+1];r.c=w[k+3];s=new THREE.Face3;s.a=w[k+1];s.b=w[k+2];s.c=w[k+3];k+=4;h&&k++;h=c.faces.length;if(d)for(d=0;d<G;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)n=w[k++],x=u[2*n],n=u[2*n+1],x=new THREE.Vector2(x,n),2!==g&&c.faceVertexUvs[d][h].push(x),0!==g&&c.faceVertexUvs[d][h+1].push(x);p&&(p=3*w[k++],r.normal.set(A[p++],A[p++],A[p]),s.normal.copy(r.normal));if(t)for(d=0;4>d;d++)p=3*w[k++],t=new THREE.Vector3(A[p++],A[p++],A[p]),2!==d&&r.vertexNormals.push(t),
+0!==d&&s.vertexNormals.push(t);m&&(m=w[k++],m=y[m],r.color.setHex(m),s.color.setHex(m));if(b)for(d=0;4>d;d++)m=w[k++],m=y[m],2!==d&&r.vertexColors.push(new THREE.Color(m)),0!==d&&s.vertexColors.push(new THREE.Color(m));c.faces.push(r);c.faces.push(s)}else{r=new THREE.Face3;r.a=w[k++];r.b=w[k++];r.c=w[k++];h&&k++;h=c.faces.length;if(d)for(d=0;d<G;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)n=w[k++],x=u[2*n],n=u[2*n+1],x=new THREE.Vector2(x,n),c.faceVertexUvs[d][h].push(x);p&&(p=3*w[k++],
+r.normal.set(A[p++],A[p++],A[p]));if(t)for(d=0;3>d;d++)p=3*w[k++],t=new THREE.Vector3(A[p++],A[p++],A[p]),r.vertexNormals.push(t);m&&(m=w[k++],r.color.setHex(y[m]));if(b)for(d=0;3>d;d++)m=w[k++],r.vertexColors.push(new THREE.Color(y[m]));c.faces.push(r)}})(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)&&console.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,l,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=[],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var p=new THREE.Vector3;p.x=n[h]*b;p.y=n[h+1]*b;p.z=n[h+2]*b;l.push(p)}}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,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[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,materials:d}};
+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,m;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=[],l=c.morphTargets[d].vertices,m=a.morphTargets[d].vertices,h=0,k=m.length;h<k;h+=3){var p=new THREE.Vector3;p.x=m[h]*b;p.y=m[h+1]*b;p.z=m[h+2]*b;l.push(p)}}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,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)m=new THREE.Color(16755200),m.setRGB(l[b],l[b+1],l[b+2]),k.push(m)})(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,materials:d}};
 THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
 THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE.BufferGeometry,c=a.data.attributes,d;for(d in c){var e=c[d],f=new self[e.type](e.array);b.addAttribute(d,new THREE.BufferAttribute(f,e.itemSize))}c=a.data.offsets;void 0!==c&&(b.offsets=JSON.parse(JSON.stringify(c)));
 a=a.data.boundingSphere;void 0!==a&&(c=new THREE.Vector3,void 0!==a.center&&c.fromArray(a.center),b.boundingSphere=new THREE.Sphere(c,a.radius));return b}};THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
@@ -358,30 +358,30 @@ THREE.Texture.prototype={constructor:THREE.Texture,get needsUpdate(){return this
 this.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;a.unpackAlignment=this.unpackAlignment;return a},toJSON:function(a){if(void 0!==a.textures[this.uuid])return a.textures[this.uuid];var b={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy};
 if(void 0!==this.image){var c=this.image;void 0===c.uuid&&(c.uuid=THREE.Math.generateUUID());if(void 0===a.images[this.image.uuid]){var d=document.createElement("canvas");d.width=c.width;d.height=c.height;d.getContext("2d").drawImage(c,0,0,c.width,c.height);d=2048<c.width||2048<c.height?d.toDataURL("image/jpeg",.6):d.toDataURL("image/png");a.images[this.image.uuid]={uuid:this.image.uuid,url:d}}b.image=c.uuid}return a.textures[this.uuid]=b},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}};
 THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype);THREE.TextureIdCount=0;THREE.CubeTexture=function(a,b,c,d,e,f,g,h,k){b=void 0!==b?b:THREE.CubeReflectionMapping;THREE.Texture.call(this,a,b,c,d,e,f,g,h,k);this.images=a};THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CubeTexture.prototype.constructor=THREE.CubeTexture;THREE.CubeTexture.clone=function(a){void 0===a&&(a=new THREE.CubeTexture);THREE.Texture.prototype.clone.call(this,a);a.images=this.images;return a};
-THREE.CompressedTexture=function(a,b,c,d,e,f,g,h,k,l,n){THREE.Texture.call(this,null,f,g,h,k,l,d,e,n);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);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,l,n){THREE.Texture.call(this,null,f,g,h,k,l,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 l=this,n=function(){requestAnimationFrame(n);a.readyState===a.HAVE_ENOUGH_DATA&&(l.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.CompressedTexture=function(a,b,c,d,e,f,g,h,k,l,m){THREE.Texture.call(this,null,f,g,h,k,l,d,e,m);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);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,l,m){THREE.Texture.call(this,null,f,g,h,k,l,d,e,m);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 l=this,m=function(){requestAnimationFrame(m);a.readyState===a.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)};m()};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);
-m<c.near||m>c.far||d.push({distance:m,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var l=f.attributes,n=l.position.array;if(void 0!==l.index){var l=l.index.array,p=f.offsets;0===p.length&&(p=[{start:0,count:l.length,index:0}]);for(var m=0,q=p.length;m<q;++m)for(var t=p[m].start,s=p[m].index,f=t,t=t+p[m].count;f<t;f++){var u=s+l[f];k.fromArray(n,3*u);g(k,u)}}else for(l=n.length/3,f=0;f<l;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 n=c.ray.origin.distanceTo(k);
+n<c.near||n>c.far||d.push({distance:n,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var l=f.attributes,m=l.position.array;if(void 0!==l.index){var l=l.index.array,p=f.offsets;0===p.length&&(p=[{start:0,count:l.length,index:0}]);for(var n=0,r=p.length;n<r;++n)for(var t=p[n].start,s=p[n].index,f=t,t=t+p[n].count;f<t;f++){var u=s+l[f];k.fromArray(m,3*u);g(k,u)}}else for(l=m.length/3,f=0;f<l;f++)k.set(m[3*f],m[3*f+1],m[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.PointCloud.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};
 THREE.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};THREE.Line=function(a,b,c){1===c&&console.error("THREE.Line: THREE.LinePieces mode has been removed. Use THREE.LineSegments instead.");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()})};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,l=new THREE.Vector3,n=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(g instanceof
-THREE.BufferGeometry){var m=g.attributes;if(void 0!==m.index){var q=m.index.array,m=m.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:q.length,index:0}]);for(var s=0;s<t.length;s++)for(var u=t[s].start,w=t[s].count,x=t[s].index,g=u;g<u+w-1;g+=p){var A=x+q[g+1];h.fromArray(m,3*(x+q[g]));k.fromArray(m,3*A);A=b.distanceSqToSegment(h,k,n,l);A>f||(A=b.origin.distanceTo(n),A<d.near||A>d.far||e.push({distance:A,point:l.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:s,face:null,faceIndex:null,
-object:this}))}}else for(m=m.position.array,g=0;g<m.length/3-1;g+=p)h.fromArray(m,3*g),k.fromArray(m,3*g+3),A=b.distanceSqToSegment(h,k,n,l),A>f||(A=b.origin.distanceTo(n),A<d.near||A>d.far||e.push({distance:A,point:l.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+=p)A=b.distanceSqToSegment(h[g],h[g+1],n,l),A>f||(A=b.origin.distanceTo(n),A<d.near||A>d.far||e.push({distance:A,point:l.clone().applyMatrix4(this.matrixWorld),
+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,l=new THREE.Vector3,m=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(g instanceof
+THREE.BufferGeometry){var n=g.attributes;if(void 0!==n.index){var r=n.index.array,n=n.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:r.length,index:0}]);for(var s=0;s<t.length;s++)for(var u=t[s].start,x=t[s].count,w=t[s].index,g=u;g<u+x-1;g+=p){var A=w+r[g+1];h.fromArray(n,3*(w+r[g]));k.fromArray(n,3*A);A=b.distanceSqToSegment(h,k,m,l);A>f||(A=b.origin.distanceTo(m),A<d.near||A>d.far||e.push({distance:A,point:l.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:s,face:null,faceIndex:null,
+object:this}))}}else for(n=n.position.array,g=0;g<n.length/3-1;g+=p)h.fromArray(n,3*g),k.fromArray(n,3*g+3),A=b.distanceSqToSegment(h,k,m,l),A>f||(A=b.origin.distanceTo(m),A<d.near||A>d.far||e.push({distance:A,point:l.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+=p)A=b.distanceSqToSegment(h[g],h[g+1],m,l),A>f||(A=b.origin.distanceTo(m),A<d.near||A>d.far||e.push({distance:A,point:l.clone().applyMatrix4(this.matrixWorld),
 index:g,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE[this.type](this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a);return a};
 THREE.Line.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.LineStrip=0;THREE.LinePieces=1;THREE.LineSegments=function(a,b){THREE.Line.call(this,a,b);this.type="LineSegments"};
 THREE.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegments.prototype.constructor=THREE.LineSegments;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];console.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 l=
-this.material;if(void 0!==l){var n=k.attributes,p,m;if(void 0!==n.index){var q=n.index.array,t=n.position.array,s=k.offsets;0===s.length&&(s=[{start:0,count:q.length,index:0}]);for(var u=0,w=s.length;u<w;++u)for(var n=s[u].start,x=s[u].index,k=n,A=n+s[u].count;k<A;k+=3){n=x+q[k];p=x+q[k+1];m=x+q[k+2];d.fromArray(t,3*n);e.fromArray(t,3*p);f.fromArray(t,3*m);var y=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide);if(null!==y){y.applyMatrix4(this.matrixWorld);
-var D=g.ray.origin.distanceTo(y);D<g.near||D>g.far||h.push({distance:D,point:y,face:new THREE.Face3(n,p,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(t=n.position.array,q=k=0,A=t.length;k<A;k+=3,q+=9)n=k,p=k+1,m=k+2,d.fromArray(t,q),e.fromArray(t,q+3),f.fromArray(t,q+6),y=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==y&&(y.applyMatrix4(this.matrixWorld),D=g.ray.origin.distanceTo(y),D<g.near||D>g.far||h.push({distance:D,
-point:y,face:new THREE.Face3(n,p,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(q=this.material instanceof THREE.MeshFaceMaterial,t=!0===q?this.material.materials:null,s=k.vertices,u=0,w=k.faces.length;u<w;u++)if(x=k.faces[u],l=!0===q?t[x.materialIndex]:this.material,void 0!==l){n=s[x.a];p=s[x.b];m=s[x.c];if(!0===l.morphTargets){y=k.morphTargets;D=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,0,0);for(var A=0,I=y.length;A<I;A++){var v=
-D[A];if(0!==v){var E=y[A].vertices;d.x+=(E[x.a].x-n.x)*v;d.y+=(E[x.a].y-n.y)*v;d.z+=(E[x.a].z-n.z)*v;e.x+=(E[x.b].x-p.x)*v;e.y+=(E[x.b].y-p.y)*v;e.z+=(E[x.b].z-p.z)*v;f.x+=(E[x.c].x-m.x)*v;f.y+=(E[x.c].y-m.y)*v;f.z+=(E[x.c].z-m.z)*v}}d.add(n);e.add(p);f.add(m);n=d;p=e;m=f}y=l.side===THREE.BackSide?b.intersectTriangle(m,p,n,!0):b.intersectTriangle(n,p,m,l.side!==THREE.DoubleSide);null!==y&&(y.applyMatrix4(this.matrixWorld),D=g.ray.origin.distanceTo(y),D<g.near||D>g.far||h.push({distance:D,point:y,
-face:x,faceIndex:u,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};
+this.material;if(void 0!==l){var m=k.attributes,p,n;if(void 0!==m.index){var r=m.index.array,t=m.position.array,s=k.offsets;0===s.length&&(s=[{start:0,count:r.length,index:0}]);for(var u=0,x=s.length;u<x;++u)for(var m=s[u].start,w=s[u].index,k=m,A=m+s[u].count;k<A;k+=3){m=w+r[k];p=w+r[k+1];n=w+r[k+2];d.fromArray(t,3*m);e.fromArray(t,3*p);f.fromArray(t,3*n);var y=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide);if(null!==y){y.applyMatrix4(this.matrixWorld);
+var G=g.ray.origin.distanceTo(y);G<g.near||G>g.far||h.push({distance:G,point:y,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(t=m.position.array,r=k=0,A=t.length;k<A;k+=3,r+=9)m=k,p=k+1,n=k+2,d.fromArray(t,r),e.fromArray(t,r+3),f.fromArray(t,r+6),y=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==y&&(y.applyMatrix4(this.matrixWorld),G=g.ray.origin.distanceTo(y),G<g.near||G>g.far||h.push({distance:G,
+point:y,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(r=this.material instanceof THREE.MeshFaceMaterial,t=!0===r?this.material.materials:null,s=k.vertices,u=0,x=k.faces.length;u<x;u++)if(w=k.faces[u],l=!0===r?t[w.materialIndex]:this.material,void 0!==l){m=s[w.a];p=s[w.b];n=s[w.c];if(!0===l.morphTargets){y=k.morphTargets;G=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,0,0);for(var A=0,I=y.length;A<I;A++){var v=
+G[A];if(0!==v){var D=y[A].vertices;d.x+=(D[w.a].x-m.x)*v;d.y+=(D[w.a].y-m.y)*v;d.z+=(D[w.a].z-m.z)*v;e.x+=(D[w.b].x-p.x)*v;e.y+=(D[w.b].y-p.y)*v;e.z+=(D[w.b].z-p.z)*v;f.x+=(D[w.c].x-n.x)*v;f.y+=(D[w.c].y-n.y)*v;f.z+=(D[w.c].z-n.z)*v}}d.add(m);e.add(p);f.add(n);m=d;p=e;n=f}y=l.side===THREE.BackSide?b.intersectTriangle(n,p,m,!0):b.intersectTriangle(m,p,n,l.side!==THREE.DoubleSide);null!==y&&(y.applyMatrix4(this.matrixWorld),G=g.ray.origin.distanceTo(y),G<g.near||G>g.far||h.push({distance:G,point:y,
+face:w,faceIndex:u,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.Mesh.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON(a));void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a));b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};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),
@@ -473,97 +473,96 @@ tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.Sh
 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,b,c,d){var e;if(c instanceof THREE.InstancedBufferGeometry&&(e=V.get("ANGLE_instanced_arrays"),null===e)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}var f=c.attributes;b=b.attributes;for(var g in b){var h=b[g];if(0<=h){var k=f[g];if(void 0!==k){var m=k.itemSize;Q.enableAttribute(h);if(k instanceof THREE.InterleavedBufferAttribute){var l=
-k.data,n=l.stride,p=k.offset;r.bindBuffer(r.ARRAY_BUFFER,k.data.buffer);r.vertexAttribPointer(h,m,r.FLOAT,!1,n*l.array.BYTES_PER_ELEMENT,(d*n+p)*l.array.BYTES_PER_ELEMENT);if(l instanceof THREE.InstancedInterleavedBuffer){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,l.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=
-l.array.length/l.stride*l.meshPerAttribute)}}else if(r.bindBuffer(r.ARRAY_BUFFER,k.buffer),r.vertexAttribPointer(h,m,r.FLOAT,!1,0,d*m*4),k instanceof THREE.InstancedBufferAttribute){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,k.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=k.array.length/k.itemSize*k.meshPerAttribute)}}else void 0!==
-a.defaultAttributeValues&&void 0!==a.defaultAttributeValues[g]&&(2===a.defaultAttributeValues[g].length?r.vertexAttrib2fv(h,a.defaultAttributeValues[g]):3===a.defaultAttributeValues[g].length&&r.vertexAttrib3fv(h,a.defaultAttributeValues[g]))}}Q.disableUnusedAttributes()}function c(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.object.material.id!==b.object.material.id?a.object.material.id-b.object.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function d(a,
-b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function e(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ha.init(a),a instanceof THREE.Light)B.push(a);else if(a instanceof THREE.Sprite)S.push(a);else if(a instanceof THREE.LensFlare)P.push(a);else{var b=ha.objects[a.id];!b||!1!==a.frustumCulled&&!0!==Ha.intersectsObject(a)||(a.material.transparent?
-O.push(b):T.push(b),!0===H.sortObjects&&(ia.setFromMatrixPosition(a.matrixWorld),ia.applyProjection(za),b.z=ia.z))}for(var b=0,c=a.children.length;b<c;b++)e(a.children[b])}}function f(a,b,c,d,e){for(var f,g=0,k=a.length;g<k;g++){var m=a[g].object;f=m;f._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,f.matrixWorld);f._normalMatrix.getNormalMatrix(f._modelViewMatrix);if(e)f=e;else{f=m.material;if(!f)continue;h(f)}H.setMaterialFaces(f);H.renderBufferDirect(b,c,d,f,m)}}function g(a,b,c,d,e,f){for(var g,
-k=0,m=a.length;k<m;k++){g=a[k];var l=g.object;if(!0===l.visible){if(f)g=f;else{g=g[b];if(!g)continue;h(g)}H.renderImmediateObject(c,d,e,g,l)}}}function h(a){!0===a.transparent?Q.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):Q.setBlending(THREE.NoBlending);Q.setDepthFunc(a.depthFunc);Q.setDepthTest(a.depthTest);Q.setDepthWrite(a.depthWrite);Q.setColorWrite(a.colorWrite);Q.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}
-function k(a,b,c,d,e){var f,g,h,k;Va=0;if(d.needsUpdate){a:{for(var s=Sb[d.type],t=0,x=0,y=0,v=0,A=0,L=b.length;A<L;A++){var D=b[A];D.onlyShadow||!1===D.visible||(D instanceof THREE.DirectionalLight&&t++,D instanceof THREE.PointLight&&x++,D instanceof THREE.SpotLight&&y++,D instanceof THREE.HemisphereLight&&v++)}f=t;g=x;h=y;k=v;for(var z,C=0,E=0,F=b.length;E<F;E++){var B=b[E];B.castShadow&&(B instanceof THREE.SpotLight&&C++,B instanceof THREE.DirectionalLight&&!B.shadowCascade&&C++)}z=C;var G;if(bb&&
-e&&e.skeleton&&e.skeleton.useVertexTexture)G=1024;else{var O=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),R=Math.floor((O-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(R=Math.min(e.skeleton.bones.length,R),R<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+R+" (try OpenGL instead of ANGLE)"));G=R}var ja={precision:I,supportsVertexTextures:cb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,
-aoMap:!!d.aoMap,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,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:J,skinning:d.skinning,maxBones:G,useVertexTexture:bb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:H.maxMorphTargets,maxMorphNormals:H.maxMorphNormals,
-maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:z,shadowMapEnabled:ga.enabled&&e.receiveShadow&&0<z,shadowMapType:ga.type,shadowMapDebug:ga.debug,shadowMapCascade:ga.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},S=[];s?S.push(s):(S.push(d.fragmentShader),S.push(d.vertexShader));if(void 0!==d.defines)for(var P in d.defines)S.push(P),S.push(d.defines[P]);for(P in ja)S.push(P),S.push(ja[P]);var T=S.join();
-if(!d.program)d.addEventListener("dispose",Eb);else if(d.program.code!==T)Fb(d);else if(void 0!==s)break a;else if(d.__webglShader.uniforms===d.uniforms)break a;if(s){var V=THREE.ShaderLib[s];d.__webglShader={uniforms:THREE.UniformsUtils.clone(V.uniforms),vertexShader:V.vertexShader,fragmentShader:V.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var ma,ya=0,Ga=K.length;ya<Ga;ya++){var Fa=K[ya];if(Fa.code===T){ma=Fa;ma.usedTimes++;
-break}}void 0===ma&&(ma=new THREE.WebGLProgram(H,T,d,ja),K.push(ma),H.info.memory.programs=K.length);d.program=ma;var Ta=ma.attributes;if(d.morphTargets)for(var ra=d.numSupportedMorphTargets=0;ra<H.maxMorphTargets;ra++)0<=Ta["morphTarget"+ra]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(ra=d.numSupportedMorphNormals=0;ra<H.maxMorphNormals;ra++)0<=Ta["morphNormal"+ra]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var da in d.__webglShader.uniforms){var ha=d.program.uniforms[da];ha&&d.uniformsList.push([d.__webglShader.uniforms[da],
-ha])}}d.needsUpdate=!1}var Ha=!1,za=!1,Wa=!1,Na=d.program,$=Na.uniforms,M=d.__webglShader.uniforms;Na.id!==na&&(r.useProgram(Na.program),na=Na.id,Wa=za=Ha=!0);d.id!==ka&&(-1===ka&&(Wa=!0),ka=d.id,za=!0);if(Ha||a!==ua)r.uniformMatrix4fv($.projectionMatrix,!1,a.projectionMatrix.elements),J&&r.uniform1f($.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==ua&&(ua=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==$.cameraPosition&&(ia.setFromMatrixPosition(a.matrixWorld),
-r.uniform3f($.cameraPosition,ia.x,ia.y,ia.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==$.viewMatrix&&r.uniformMatrix4fv($.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==$.bindMatrix&&r.uniformMatrix4fv($.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==$.bindMatrixInverse&&r.uniformMatrix4fv($.bindMatrixInverse,!1,e.bindMatrixInverse.elements),
-bb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==$.boneTexture){var Ma=n();r.uniform1i($.boneTexture,Ma);H.setTexture(e.skeleton.boneTexture,Ma)}null!==$.boneTextureWidth&&r.uniform1i($.boneTextureWidth,e.skeleton.boneTextureWidth);null!==$.boneTextureHeight&&r.uniform1i($.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==$.boneGlobalMatrices&&r.uniformMatrix4fv($.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(za){c&&d.fog&&(M.fogColor.value=
-c.color,c instanceof THREE.Fog?(M.fogNear.value=c.near,M.fogFar.value=c.far):c instanceof THREE.FogExp2&&(M.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Xa){var Wa=!0,Z,oa,Y,db=0,eb=0,fb=0,Aa,Sa,Ua,Ia,gb,aa=Gb,hb=aa.directional.colors,ib=aa.directional.positions,jb=aa.point.colors,kb=aa.point.positions,$a=aa.point.distances,ab=aa.point.decays,lb=aa.spot.colors,mb=aa.spot.positions,zb=aa.spot.distances,nb=aa.spot.directions,
-Ab=aa.spot.anglesCos,Bb=aa.spot.exponents,Cb=aa.spot.decays,ob=aa.hemi.skyColors,pb=aa.hemi.groundColors,qb=aa.hemi.positions,Oa=0,Ba=0,sa=0,Ja=0,rb=0,sb=0,tb=0,Ya=0,Pa=0,Qa=0,va=0,Ka=0;Z=0;for(oa=b.length;Z<oa;Z++)Y=b[Z],Y.onlyShadow||(Aa=Y.color,Ia=Y.intensity,gb=Y.distance,Y instanceof THREE.AmbientLight?Y.visible&&(db+=Aa.r,eb+=Aa.g,fb+=Aa.b):Y instanceof THREE.DirectionalLight?(rb+=1,Y.visible&&(ca.setFromMatrixPosition(Y.matrixWorld),ia.setFromMatrixPosition(Y.target.matrixWorld),ca.sub(ia),
-ca.normalize(),Pa=3*Oa,ib[Pa+0]=ca.x,ib[Pa+1]=ca.y,ib[Pa+2]=ca.z,p(hb,Pa,Aa,Ia),Oa+=1)):Y instanceof THREE.PointLight?(sb+=1,Y.visible&&(Qa=3*Ba,p(jb,Qa,Aa,Ia),ia.setFromMatrixPosition(Y.matrixWorld),kb[Qa+0]=ia.x,kb[Qa+1]=ia.y,kb[Qa+2]=ia.z,$a[Ba]=gb,ab[Ba]=0===Y.distance?0:Y.decay,Ba+=1)):Y instanceof THREE.SpotLight?(tb+=1,Y.visible&&(va=3*sa,p(lb,va,Aa,Ia),ca.setFromMatrixPosition(Y.matrixWorld),mb[va+0]=ca.x,mb[va+1]=ca.y,mb[va+2]=ca.z,zb[sa]=gb,ia.setFromMatrixPosition(Y.target.matrixWorld),
-ca.sub(ia),ca.normalize(),nb[va+0]=ca.x,nb[va+1]=ca.y,nb[va+2]=ca.z,Ab[sa]=Math.cos(Y.angle),Bb[sa]=Y.exponent,Cb[sa]=0===Y.distance?0:Y.decay,sa+=1)):Y instanceof THREE.HemisphereLight&&(Ya+=1,Y.visible&&(ca.setFromMatrixPosition(Y.matrixWorld),ca.normalize(),Ka=3*Ja,qb[Ka+0]=ca.x,qb[Ka+1]=ca.y,qb[Ka+2]=ca.z,Sa=Y.color,Ua=Y.groundColor,p(ob,Ka,Sa,Ia),p(pb,Ka,Ua,Ia),Ja+=1)));Z=3*Oa;for(oa=Math.max(hb.length,3*rb);Z<oa;Z++)hb[Z]=0;Z=3*Ba;for(oa=Math.max(jb.length,3*sb);Z<oa;Z++)jb[Z]=0;Z=3*sa;for(oa=
-Math.max(lb.length,3*tb);Z<oa;Z++)lb[Z]=0;Z=3*Ja;for(oa=Math.max(ob.length,3*Ya);Z<oa;Z++)ob[Z]=0;Z=3*Ja;for(oa=Math.max(pb.length,3*Ya);Z<oa;Z++)pb[Z]=0;aa.directional.length=Oa;aa.point.length=Ba;aa.spot.length=sa;aa.hemi.length=Ja;aa.ambient[0]=db;aa.ambient[1]=eb;aa.ambient[2]=fb;Xa=!1}if(Wa){var fa=Gb;M.ambientLightColor.value=fa.ambient;M.directionalLightColor.value=fa.directional.colors;M.directionalLightDirection.value=fa.directional.positions;M.pointLightColor.value=fa.point.colors;M.pointLightPosition.value=
-fa.point.positions;M.pointLightDistance.value=fa.point.distances;M.pointLightDecay.value=fa.point.decays;M.spotLightColor.value=fa.spot.colors;M.spotLightPosition.value=fa.spot.positions;M.spotLightDistance.value=fa.spot.distances;M.spotLightDirection.value=fa.spot.directions;M.spotLightAngleCos.value=fa.spot.anglesCos;M.spotLightExponent.value=fa.spot.exponents;M.spotLightDecay.value=fa.spot.decays;M.hemisphereLightSkyColor.value=fa.hemi.skyColors;M.hemisphereLightGroundColor.value=fa.hemi.groundColors;
-M.hemisphereLightDirection.value=fa.hemi.positions;l(M,!0)}else l(M,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){M.opacity.value=d.opacity;M.diffuse.value=d.color;M.map.value=d.map;M.specularMap.value=d.specularMap;M.alphaMap.value=d.alphaMap;d.bumpMap&&(M.bumpMap.value=d.bumpMap,M.bumpScale.value=d.bumpScale);d.normalMap&&(M.normalMap.value=d.normalMap,M.normalScale.value.copy(d.normalScale));var wa;d.map?wa=d.map:d.specularMap?
-wa=d.specularMap:d.normalMap?wa=d.normalMap:d.bumpMap?wa=d.bumpMap:d.alphaMap&&(wa=d.alphaMap);if(void 0!==wa){var Hb=wa.offset,Ib=wa.repeat;M.offsetRepeat.value.set(Hb.x,Hb.y,Ib.x,Ib.y)}M.envMap.value=d.envMap;M.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;M.reflectivity.value=d.reflectivity;M.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)M.diffuse.value=d.color,M.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)M.diffuse.value=
-d.color,M.opacity.value=d.opacity,M.dashSize.value=d.dashSize,M.totalSize.value=d.dashSize+d.gapSize,M.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(M.psColor.value=d.color,M.opacity.value=d.opacity,M.size.value=d.size,M.scale.value=w.height/2,M.map.value=d.map,null!==d.map){var Jb=d.map.offset,Kb=d.map.repeat;M.offsetRepeat.value.set(Jb.x,Jb.y,Kb.x,Kb.y)}}else d instanceof THREE.MeshPhongMaterial?(M.shininess.value=d.shininess,M.emissive.value=d.emissive,M.specular.value=
-d.specular,M.lightMap.value=d.lightMap,M.lightMapIntensity.value=d.lightMapIntensity,M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshLambertMaterial?M.emissive.value=d.emissive:d instanceof THREE.MeshBasicMaterial?(M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshDepthMaterial?(M.mNear.value=a.near,M.mFar.value=a.far,M.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(M.opacity.value=d.opacity);if(e.receiveShadow&&
-!d._shadowPass&&M.shadowMatrix)for(var La=0,ub=0,Db=b.length;ub<Db;ub++){var ta=b[ub];ta.castShadow&&(ta instanceof THREE.SpotLight||ta instanceof THREE.DirectionalLight&&!ta.shadowCascade)&&(M.shadowMap.value[La]=ta.shadowMap,M.shadowMapSize.value[La]=ta.shadowMapSize,M.shadowMatrix.value[La]=ta.shadowMatrix,M.shadowDarkness.value[La]=ta.shadowDarkness,M.shadowBias.value[La]=ta.shadowBias,La++)}for(var vb=d.uniformsList,pa,Ca,qa,Za=0,Tb=vb.length;Za<Tb;Za++){var W=vb[Za][0];if(!1!==W.needsUpdate){var Lb=
-W.type,N=W.value,X=vb[Za][1];switch(Lb){case "1i":r.uniform1i(X,N);break;case "1f":r.uniform1f(X,N);break;case "2f":r.uniform2f(X,N[0],N[1]);break;case "3f":r.uniform3f(X,N[0],N[1],N[2]);break;case "4f":r.uniform4f(X,N[0],N[1],N[2],N[3]);break;case "1iv":r.uniform1iv(X,N);break;case "3iv":r.uniform3iv(X,N);break;case "1fv":r.uniform1fv(X,N);break;case "2fv":r.uniform2fv(X,N);break;case "3fv":r.uniform3fv(X,N);break;case "4fv":r.uniform4fv(X,N);break;case "Matrix3fv":r.uniformMatrix3fv(X,!1,N);break;
-case "Matrix4fv":r.uniformMatrix4fv(X,!1,N);break;case "i":r.uniform1i(X,N);break;case "f":r.uniform1f(X,N);break;case "v2":r.uniform2f(X,N.x,N.y);break;case "v3":r.uniform3f(X,N.x,N.y,N.z);break;case "v4":r.uniform4f(X,N.x,N.y,N.z,N.w);break;case "c":r.uniform3f(X,N.r,N.g,N.b);break;case "iv1":r.uniform1iv(X,N);break;case "iv":r.uniform3iv(X,N);break;case "fv1":r.uniform1fv(X,N);break;case "fv":r.uniform3fv(X,N);break;case "v2v":void 0===W._array&&(W._array=new Float32Array(2*N.length));for(var U=
-0,la=N.length;U<la;U++)qa=2*U,W._array[qa+0]=N[U].x,W._array[qa+1]=N[U].y;r.uniform2fv(X,W._array);break;case "v3v":void 0===W._array&&(W._array=new Float32Array(3*N.length));U=0;for(la=N.length;U<la;U++)qa=3*U,W._array[qa+0]=N[U].x,W._array[qa+1]=N[U].y,W._array[qa+2]=N[U].z;r.uniform3fv(X,W._array);break;case "v4v":void 0===W._array&&(W._array=new Float32Array(4*N.length));U=0;for(la=N.length;U<la;U++)qa=4*U,W._array[qa+0]=N[U].x,W._array[qa+1]=N[U].y,W._array[qa+2]=N[U].z,W._array[qa+3]=N[U].w;
-r.uniform4fv(X,W._array);break;case "m3":r.uniformMatrix3fv(X,!1,N.elements);break;case "m3v":void 0===W._array&&(W._array=new Float32Array(9*N.length));U=0;for(la=N.length;U<la;U++)N[U].flattenToArrayOffset(W._array,9*U);r.uniformMatrix3fv(X,!1,W._array);break;case "m4":r.uniformMatrix4fv(X,!1,N.elements);break;case "m4v":void 0===W._array&&(W._array=new Float32Array(16*N.length));U=0;for(la=N.length;U<la;U++)N[U].flattenToArrayOffset(W._array,16*U);r.uniformMatrix4fv(X,!1,W._array);break;case "t":pa=
-N;Ca=n();r.uniform1i(X,Ca);if(!pa)continue;if(pa instanceof THREE.CubeTexture||Array.isArray(pa.image)&&6===pa.image.length){var ba=pa,Mb=Ca;if(6===ba.image.length)if(ba.needsUpdate){ba.image.__webglTextureCube||(ba.addEventListener("dispose",wb),ba.image.__webglTextureCube=r.createTexture(),H.info.memory.textures++);Q.activeTexture(r.TEXTURE0+Mb);Q.bindTexture(r.TEXTURE_CUBE_MAP,ba.image.__webglTextureCube);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,ba.flipY);for(var Nb=ba instanceof THREE.CompressedTexture,
-xb=ba.image[0]instanceof THREE.DataTexture,Da=[],ea=0;6>ea;ea++)Da[ea]=!H.autoScaleCubemaps||Nb||xb?xb?ba.image[ea].image:ba.image[ea]:q(ba.image[ea],Ub);var Ob=Da[0],Pb=THREE.Math.isPowerOfTwo(Ob.width)&&THREE.Math.isPowerOfTwo(Ob.height),xa=u(ba.format),yb=u(ba.type);m(r.TEXTURE_CUBE_MAP,ba,Pb);for(ea=0;6>ea;ea++)if(Nb)for(var Ea,Qb=Da[ea].mipmaps,Ra=0,Vb=Qb.length;Ra<Vb;Ra++)Ea=Qb[Ra],ba.format!==THREE.RGBAFormat&&ba.format!==THREE.RGBFormat?-1<Rb().indexOf(xa)?Q.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+
-ea,Ra,xa,Ea.width,Ea.height,0,Ea.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):Q.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ea,Ra,xa,Ea.width,Ea.height,0,xa,yb,Ea.data);else xb?Q.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ea,0,xa,Da[ea].width,Da[ea].height,0,xa,yb,Da[ea].data):Q.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ea,0,xa,xa,yb,Da[ea]);ba.generateMipmaps&&Pb&&r.generateMipmap(r.TEXTURE_CUBE_MAP);ba.needsUpdate=!1;if(ba.onUpdate)ba.onUpdate(ba)}else Q.activeTexture(r.TEXTURE0+
-Mb),Q.bindTexture(r.TEXTURE_CUBE_MAP,ba.image.__webglTextureCube)}else if(pa instanceof THREE.WebGLRenderTargetCube){var Wb=pa;Q.activeTexture(r.TEXTURE0+Ca);Q.bindTexture(r.TEXTURE_CUBE_MAP,Wb.__webglTexture)}else H.setTexture(pa,Ca);break;case "tv":void 0===W._array&&(W._array=[]);U=0;for(la=W.value.length;U<la;U++)W._array[U]=n();r.uniform1iv(X,W._array);U=0;for(la=W.value.length;U<la;U++)pa=W.value[U],Ca=W._array[U],pa&&H.setTexture(pa,Ca);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+
-Lb)}}}}r.uniformMatrix4fv($.modelViewMatrix,!1,e._modelViewMatrix.elements);$.normalMatrix&&r.uniformMatrix3fv($.normalMatrix,!1,e._normalMatrix.elements);null!==$.modelMatrix&&r.uniformMatrix4fv($.modelMatrix,!1,e.matrixWorld.elements);return Na}function l(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 n(){var a=Va;a>=Sa&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Sa);Va+=1;return a}
-function p(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function m(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,u(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,u(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,u(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,u(b.minFilter))):(r.texParameteri(a,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+
-b.sourceFile+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,s(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,s(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=V.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||b.__currentAnisotropy)&&
-(r.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,H.getMaxAnisotropy())),b.__currentAnisotropy=b.anisotropy)}function q(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);console.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 t(a,b){r.bindRenderbuffer(r.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,b.width,b.height)}function s(a){return a===
-THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function u(a){var b;if(a===THREE.RepeatWrapping)return r.REPEAT;if(a===THREE.ClampToEdgeWrapping)return r.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return r.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return r.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return r.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return r.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return r.LINEAR;
-if(a===THREE.LinearMipMapNearestFilter)return r.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return r.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return r.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return r.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return r.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return r.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return r.BYTE;if(a===THREE.ShortType)return r.SHORT;if(a===THREE.UnsignedShortType)return r.UNSIGNED_SHORT;
-if(a===THREE.IntType)return r.INT;if(a===THREE.UnsignedIntType)return r.UNSIGNED_INT;if(a===THREE.FloatType)return r.FLOAT;b=V.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return r.ALPHA;if(a===THREE.RGBFormat)return r.RGB;if(a===THREE.RGBAFormat)return r.RGBA;if(a===THREE.LuminanceFormat)return r.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return r.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return r.FUNC_ADD;if(a===THREE.SubtractEquation)return r.FUNC_SUBTRACT;
-if(a===THREE.ReverseSubtractEquation)return r.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return r.ZERO;if(a===THREE.OneFactor)return r.ONE;if(a===THREE.SrcColorFactor)return r.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return r.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return r.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return r.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return r.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return r.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return r.DST_COLOR;
-if(a===THREE.OneMinusDstColorFactor)return r.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return r.SRC_ALPHA_SATURATE;b=V.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=V.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=V.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 w=void 0!==a.canvas?a.canvas:document.createElement("canvas"),x=void 0!==a.context?a.context:null,A=w.width,y=w.height,D=1,I=void 0!==a.precision?a.precision:"highp",v=void 0!==a.alpha?a.alpha:!1,E=void 0!==a.depth?a.depth:!0,L=void 0!==a.stencil?a.stencil:!0,C=void 0!==a.antialias?a.antialias:!1,F=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,R=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,J=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,z=new THREE.Color(0),
-G=0,B=[],T=[],O=[],S=[],P=[];this.domElement=w;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!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 H=this,K=[],na=null,da=null,ka=-1,ja="",ua=null,Va=0,ma=0,Ga=0,Fa=w.width,ya=w.height,Ta=0,ra=0,Ha=new THREE.Frustum,
-za=new THREE.Matrix4,ia=new THREE.Vector3,ca=new THREE.Vector3,Xa=!0,Gb={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:[]}},r;try{a={alpha:v,depth:E,stencil:L,antialias:C,premultipliedAlpha:F,preserveDrawingBuffer:R};r=x||w.getContext("webgl",a)||w.getContext("experimental-webgl",
-a);if(null===r){if(null!==w.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}w.addEventListener("webglcontextlost",function(a){a.preventDefault();Ua();$a();ha.objects={}},!1)}catch(zb){console.error("THREE.WebGLRenderer: "+zb)}var Q=new THREE.WebGLState(r,u);void 0===r.getShaderPrecisionFormat&&(r.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var V=new THREE.WebGLExtensions(r),ha=new THREE.WebGLObjects(r,
-this.info);V.get("OES_texture_float");V.get("OES_texture_float_linear");V.get("OES_texture_half_float");V.get("OES_texture_half_float_linear");V.get("OES_standard_derivatives");V.get("ANGLE_instanced_arrays");V.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);J&&V.get("EXT_frag_depth");var Ma=function(a,b,c,d){!0===F&&(a*=d,b*=d,c*=d);r.clearColor(a,b,c,d)},$a=function(){r.clearColor(0,0,0,1);r.clearDepth(1);r.clearStencil(0);r.enable(r.DEPTH_TEST);r.depthFunc(r.LEQUAL);r.frontFace(r.CCW);
-r.cullFace(r.BACK);r.enable(r.CULL_FACE);r.enable(r.BLEND);r.blendEquation(r.FUNC_ADD);r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA);r.viewport(ma,Ga,Fa,ya);Ma(z.r,z.g,z.b,G)},Ua=function(){ua=na=null;ja="";ka=-1;Xa=!0;Q.reset()};$a();this.context=r;this.extensions=V;this.state=Q;var ga=new THREE.WebGLShadowMap(this,B,ha);this.shadowMap=ga;var Sa=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),x=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ab=r.getParameter(r.MAX_TEXTURE_SIZE),Ub=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),
-cb=0<x,bb=cb&&V.get("OES_texture_float"),Bb=V.get("ANGLE_instanced_arrays"),v=r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT),x=r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT),E=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);a=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT);var Rb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(V.get("WEBGL_compressed_texture_pvrtc")||V.get("WEBGL_compressed_texture_s3tc"))for(var b=r.getParameter(r.COMPRESSED_TEXTURE_FORMATS),
-c=0;c<b.length;c++)a.push(b[c]);return a}}(),v=0<v.precision&&0<E.precision,x=0<x.precision&&0<a.precision;"highp"!==I||v||(x?(I="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(I="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==I||x||(I="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Cb=new THREE.SpritePlugin(this,S),Db=new THREE.LensFlarePlugin(this,P);this.getContext=function(){return r};
-this.forceContextLoss=function(){V.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return cb};this.supportsInstancedArrays=function(){return Bb};this.supportsFloatTextures=function(){return V.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return V.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){return V.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return V.get("WEBGL_compressed_texture_s3tc")};
-this.supportsCompressedTexturePVRTC=function(){return V.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return V.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=V.get("EXT_texture_filter_anisotropic");return a=null!==b?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return I};this.getPixelRatio=function(){return D};this.setPixelRatio=function(a){void 0!==a&&(D=a)};this.getSize=
-function(){return{width:A,height:y}};this.setSize=function(a,b,c){A=a;y=b;w.width=a*D;w.height=b*D;!1!==c&&(w.style.width=a+"px",w.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){ma=a*D;Ga=b*D;Fa=c*D;ya=d*D;r.viewport(ma,Ga,Fa,ya)};this.setScissor=function(a,b,c,d){r.scissor(a*D,b*D,c*D,d*D)};this.enableScissorTest=function(a){a?r.enable(r.SCISSOR_TEST):r.disable(r.SCISSOR_TEST)};this.getClearColor=function(){return z};this.setClearColor=function(a,b){z.set(a);G=
-void 0!==b?b:1;Ma(z.r,z.g,z.b,G)};this.getClearAlpha=function(){return G};this.setClearAlpha=function(a){G=a;Ma(z.r,z.g,z.b,G)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=r.COLOR_BUFFER_BIT;if(void 0===b||b)d|=r.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=r.STENCIL_BUFFER_BIT;r.clear(d)};this.clearColor=function(){r.clear(r.COLOR_BUFFER_BIT)};this.clearDepth=function(){r.clear(r.DEPTH_BUFFER_BIT)};this.clearStencil=function(){r.clear(r.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);
-this.clear(b,c,d)};this.resetGLState=Ua;var wb=function(a){a=a.target;a.removeEventListener("dispose",wb);a.image&&a.image.__webglTextureCube?(r.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(r.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);H.info.memory.textures--},ab=function(a){a=a.target;a.removeEventListener("dispose",ab);if(a&&void 0!==a.__webglTexture){r.deleteTexture(a.__webglTexture);delete a.__webglTexture;
-if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)r.deleteFramebuffer(a.__webglFramebuffer[b]),r.deleteRenderbuffer(a.__webglRenderbuffer[b]);else r.deleteFramebuffer(a.__webglFramebuffer),r.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}H.info.memory.textures--},Eb=function(a){a=a.target;a.removeEventListener("dispose",Eb);Fb(a)},Fb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=K.length;a<
-c;a++)if(d=K[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=K.length;a<c;a++)d=K[a],d.program!==b&&e.push(d);K=e;r.deleteProgram(b);H.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){Q.initAttributes();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=r.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=r.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=r.createBuffer());a.hasColors&&
-!a.__webglColorBuffer&&(a.__webglColorBuffer=r.createBuffer());a.hasPositions&&(r.bindBuffer(r.ARRAY_BUFFER,a.__webglVertexBuffer),r.bufferData(r.ARRAY_BUFFER,a.positionArray,r.DYNAMIC_DRAW),Q.enableAttribute(b.attributes.position),r.vertexAttribPointer(b.attributes.position,3,r.FLOAT,!1,0,0));if(a.hasNormals){r.bindBuffer(r.ARRAY_BUFFER,a.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,k,m,l,n,p,q,s=3*a.count;for(q=0;q<s;q+=9)p=a.normalArray,
-d=p[q],e=p[q+1],f=p[q+2],g=p[q+3],k=p[q+4],l=p[q+5],h=p[q+6],m=p[q+7],n=p[q+8],d=(d+g+h)/3,e=(e+k+m)/3,f=(f+l+n)/3,p[q]=d,p[q+1]=e,p[q+2]=f,p[q+3]=d,p[q+4]=e,p[q+5]=f,p[q+6]=d,p[q+7]=e,p[q+8]=f}r.bufferData(r.ARRAY_BUFFER,a.normalArray,r.DYNAMIC_DRAW);Q.enableAttribute(b.attributes.normal);r.vertexAttribPointer(b.attributes.normal,3,r.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(r.bindBuffer(r.ARRAY_BUFFER,a.__webglUvBuffer),r.bufferData(r.ARRAY_BUFFER,a.uvArray,r.DYNAMIC_DRAW),Q.enableAttribute(b.attributes.uv),
-r.vertexAttribPointer(b.attributes.uv,2,r.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(r.bindBuffer(r.ARRAY_BUFFER,a.__webglColorBuffer),r.bufferData(r.ARRAY_BUFFER,a.colorArray,r.DYNAMIC_DRAW),Q.enableAttribute(b.attributes.color),r.vertexAttribPointer(b.attributes.color,3,r.FLOAT,!1,0,0));Q.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f){if(!1!==e.visible){var g=ha.geometries.get(f);a=k(a,c,d,e,f);c=!1;d=g.id+
-"_"+a.id+"_"+(e.wireframe?1:0);d!==ja&&(ja=d,c=!0);c&&Q.initAttributes();if(f instanceof THREE.Mesh)a:if(f=c,c=!0===e.wireframe?r.LINES:r.TRIANGLES,d=g.attributes.index){var h,m;d.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(h=r.UNSIGNED_INT,m=4):(h=r.UNSIGNED_SHORT,m=2);var l=g.offsets;if(0===l.length){f&&(b(e,a,g,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){var n=V.get("ANGLE_instanced_arrays");if(null===
-n){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}n.drawElementsInstancedANGLE(c,d.array.length,h,0,g.maxInstancedCount)}else r.drawElements(c,d.array.length,h,0);H.info.render.calls++;H.info.render.vertices+=d.array.length;H.info.render.faces+=d.array.length/3}else{f=!0;for(var p=0,q=l.length;p<q;p++){n=l[p].index;f&&(b(e,a,g,n),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof
-THREE.InstancedBufferGeometry&&0<l[p].instances){n=V.get("ANGLE_instanced_arrays");if(null===n){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}n.drawElementsInstancedANGLE(c,l[p].count,h,l[p].start*m,l[p].count,h,l[p].instances)}else r.drawElements(c,l[p].count,h,l[p].start*m);H.info.render.calls++;H.info.render.vertices+=l[p].count;H.info.render.faces+=l[p].count/3}}}else if(l=g.offsets,
-0===l.length){f&&b(e,a,g,0);e=g.attributes.position;if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){n=V.get("ANGLE_instanced_arrays");if(null===n){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}e instanceof THREE.InterleavedBufferAttribute?n.drawArraysInstancedANGLE(c,0,e.data.array.length/e.data.stride,g.maxInstancedCount):n.drawArraysInstancedANGLE(c,0,e.array.length/
-e.itemSize,g.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?r.drawArrays(c,0,e.data.array.length/e.data.stride):r.drawArrays(c,0,e.array.length/e.itemSize);H.info.render.calls++;H.info.render.vertices+=e.array.length/e.itemSize;H.info.render.faces+=e.array.length/(3*e.itemSize)}else for(f&&b(e,a,g,0),p=0,q=l.length;p<q;p++){if(g instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");
-break a}else r.drawArrays(c,l[p].start,l[p].count);H.info.render.calls++;H.info.render.vertices+=l[p].count;H.info.render.faces+=l[p].count/3}else if(f instanceof THREE.Line)if(f=f instanceof THREE.LineSegments?r.LINES:r.LINE_STRIP,Q.setLineWidth((void 0!==e.linewidth?e.linewidth:1)*D),h=g.attributes.index)if(h.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(m=r.UNSIGNED_INT,l=4):(m=r.UNSIGNED_SHORT,l=2),d=g.offsets,0===d.length)c&&(b(e,a,g,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h.buffer)),
-r.drawElements(f,h.array.length,m,0),H.info.render.calls++,H.info.render.vertices+=h.array.length;else for(1<d.length&&(c=!0),n=0,p=d.length;n<p;n++)q=d[n].index,c&&(b(e,a,g,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h.buffer)),r.drawElements(f,d[n].count,m,d[n].start*l),H.info.render.calls++,H.info.render.vertices+=d[n].count;else if(c&&b(e,a,g,0),e=g.attributes.position,d=g.offsets,0===d.length)r.drawArrays(f,0,e.array.length/3),H.info.render.calls++,H.info.render.vertices+=e.array.length/3;else for(n=
-0,p=d.length;n<p;n++)r.drawArrays(f,d[n].index,d[n].count),H.info.render.calls++,H.info.render.vertices+=d[n].count;else if(f instanceof THREE.PointCloud)if(d=c,c=r.POINTS,h=g.attributes.index)if(h.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(m=r.UNSIGNED_INT,l=4):(m=r.UNSIGNED_SHORT,l=2),f=g.offsets,0===f.length)d&&(b(e,a,g,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h.buffer)),r.drawElements(c,h.array.length,m,0),H.info.render.calls++,H.info.render.points+=h.array.length;else for(1<
-f.length&&(d=!0),n=0,p=f.length;n<p;n++)q=f[n].index,d&&(b(e,a,g,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h.buffer)),r.drawElements(c,f[n].count,m,f[n].start*l),H.info.render.calls++,H.info.render.points+=f[n].count;else if(d&&b(e,a,g,0),e=g.attributes.position,f=g.offsets,0===f.length)r.drawArrays(c,0,e.array.length/3),H.info.render.calls++,H.info.render.points+=e.array.length/3;else for(n=0,p=f.length;n<p;n++)r.drawArrays(c,f[n].index,f[n].count),H.info.render.calls++,H.info.render.points+=f[n].count}};
-this.render=function(a,b,k,m){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var l=a.fog;ja="";ka=-1;ua=null;Xa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);za.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ha.setFromMatrix(za);B.length=0;T.length=0;O.length=0;S.length=0;P.length=0;e(a);!0===H.sortObjects&&(T.sort(c),O.sort(d));
-ha.update(T);ha.update(O);ga.render(a,b);H.info.render.calls=0;H.info.render.vertices=0;H.info.render.faces=0;H.info.render.points=0;this.setRenderTarget(k);(this.autoClear||m)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=0;for(var n=ha.objectsImmediate.length;m<n;m++){var p=ha.objectsImmediate[m],q=p.object;if(!0===q.visible){var s=q;s._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,s.matrixWorld);s._normalMatrix.getNormalMatrix(s._modelViewMatrix);q=q.material;
-q.transparent?(p.transparent=q,p.opaque=null):(p.opaque=q,p.transparent=null)}}a.overrideMaterial?(m=a.overrideMaterial,h(m),f(T,b,B,l,m),f(O,b,B,l,m),g(ha.objectsImmediate,"",b,B,l,m)):(Q.setBlending(THREE.NoBlending),f(T,b,B,l,null),g(ha.objectsImmediate,"opaque",b,B,l,null),f(O,b,B,l,null),g(ha.objectsImmediate,"transparent",b,B,l,null));Cb.render(a,b);Db.render(a,b,Ta,ra);k&&k.generateMipmaps&&k.minFilter!==THREE.NearestFilter&&k.minFilter!==THREE.LinearFilter&&(k instanceof THREE.WebGLRenderTargetCube?
-(Q.bindTexture(r.TEXTURE_CUBE_MAP,k.__webglTexture),r.generateMipmap(r.TEXTURE_CUBE_MAP),Q.bindTexture(r.TEXTURE_CUBE_MAP,null)):(Q.bindTexture(r.TEXTURE_2D,k.__webglTexture),r.generateMipmap(r.TEXTURE_2D),Q.bindTexture(r.TEXTURE_2D,null)));Q.setDepthTest(!0);Q.setDepthWrite(!0);Q.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=k(a,b,c,d,e);ja="";H.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,r,Ha):e.render(function(a){H.renderBufferImmediate(a,
-f,d)})};var Sb={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?r.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):a===THREE.CullFaceFront?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),
-r.enable(r.CULL_FACE))};this.setMaterialFaces=function(a){Q.setDoubleSided(a.side===THREE.DoubleSide);Q.setFlipSided(a.side===THREE.BackSide)};this.uploadTexture=function(a,b){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",wb),a.__webglTexture=r.createTexture(),H.info.memory.textures++);Q.activeTexture(r.TEXTURE0+b);Q.bindTexture(r.TEXTURE_2D,a.__webglTexture);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);r.pixelStorei(r.UNPACK_ALIGNMENT,
-a.unpackAlignment);a.image=q(a.image,Ab);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=u(a.format),f=u(a.type);m(r.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],Q.texImage2D(r.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else Q.texImage2D(r.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)c=g[h],
-a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Rb().indexOf(e)?Q.compressedTexImage2D(r.TEXTURE_2D,h,e,c.width,c.height,0,c.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Q.texImage2D(r.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],Q.texImage2D(r.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else Q.texImage2D(r.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);
-a.needsUpdate=!1;if(a.onUpdate)a.onUpdate(a)};this.setTexture=function(a,b){if(!0===a.needsUpdate){var c=a.image;void 0===c?console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a):!1===c.complete?console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a):H.uploadTexture(a,b)}else Q.activeTexture(r.TEXTURE0+b),Q.bindTexture(r.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",ab);a.__webglTexture=r.createTexture();H.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=u(a.format),e=u(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];Q.bindTexture(r.TEXTURE_CUBE_MAP,a.__webglTexture);m(r.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=r.createFramebuffer();
-a.__webglRenderbuffer[f]=r.createRenderbuffer();Q.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=r.TEXTURE_CUBE_MAP_POSITIVE_X+f;r.bindFramebuffer(r.FRAMEBUFFER,a.__webglFramebuffer[f]);r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,h,g.__webglTexture,0);t(a.__webglRenderbuffer[f],a)}a.generateMipmaps&&c&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=r.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:
-r.createRenderbuffer(),Q.bindTexture(r.TEXTURE_2D,a.__webglTexture),m(r.TEXTURE_2D,a,c),Q.texImage2D(r.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=r.TEXTURE_2D,r.bindFramebuffer(r.FRAMEBUFFER,a.__webglFramebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,
-r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a.__webglRenderbuffer):t(a.__webglRenderbuffer,a),a.generateMipmaps&&c&&r.generateMipmap(r.TEXTURE_2D);b?Q.bindTexture(r.TEXTURE_CUBE_MAP,null):Q.bindTexture(r.TEXTURE_2D,null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Fa,a=ya,d=ma,e=Ga);b!==da&&(r.bindFramebuffer(r.FRAMEBUFFER,b),r.viewport(d,e,c,a),da=b);Ta=c;ra=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!==da&&(r.bindFramebuffer(r.FRAMEBUFFER,a.__webglFramebuffer),g=!0);r.checkFramebufferStatus(r.FRAMEBUFFER)===
-r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,r.RGBA,r.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&r.bindFramebuffer(r.FRAMEBUFFER,da)}};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};
-this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return ga.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");ga.enabled=a}},shadowMapType:{get:function(){return ga.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");ga.type=a}},shadowMapCullFace:{get:function(){return ga.cullFace},
-set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");ga.cullFace=a}},shadowMapDebug:{get:function(){return ga.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");ga.debug=a}},shadowMapCascade:{get:function(){return ga.cascade},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCascade is now .shadowMap.cascade.");ga.cascade=a}}})};
+THREE.WebGLRenderer=function(a){function b(a,b,c,d){var e;if(c instanceof THREE.InstancedBufferGeometry&&(e=V.get("ANGLE_instanced_arrays"),null===e)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}var f=c.attributes;b=b.getAttributes();a=a.defaultAttributeValues;for(var g in b){var h=b[g];if(0<=h){var k=f[g];if(void 0!==k){var n=k.itemSize;Q.enableAttribute(h);if(k instanceof THREE.InterleavedBufferAttribute){var l=
+k.data,m=l.stride,p=k.offset;q.bindBuffer(q.ARRAY_BUFFER,k.data.buffer);q.vertexAttribPointer(h,n,q.FLOAT,!1,m*l.array.BYTES_PER_ELEMENT,(d*m+p)*l.array.BYTES_PER_ELEMENT);if(l instanceof THREE.InstancedInterleavedBuffer){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,l.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=
+l.array.length/l.stride*l.meshPerAttribute)}}else if(q.bindBuffer(q.ARRAY_BUFFER,k.buffer),q.vertexAttribPointer(h,n,q.FLOAT,!1,0,d*n*4),k instanceof THREE.InstancedBufferAttribute){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,k.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=k.array.length/k.itemSize*k.meshPerAttribute)}}else if(void 0!==
+a&&(k=a[g],void 0!==k))switch(k.length){case 2:q.vertexAttrib2fv(h,k);break;case 3:q.vertexAttrib3fv(h,k);break;case 4:q.vertexAttrib4fv(h,k);break;default:q.vertexAttrib1fv(h,k)}}}Q.disableUnusedAttributes()}function c(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.object.material.id!==b.object.material.id?a.object.material.id-b.object.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function d(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-
+b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function e(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ga.init(a),a instanceof THREE.Light)B.push(a);else if(a instanceof THREE.Sprite)S.push(a);else if(a instanceof THREE.LensFlare)P.push(a);else{var b=ga.objects[a.id];!b||!1!==a.frustumCulled&&!0!==Ha.intersectsObject(a)||(a.material.transparent?O.push(b):T.push(b),!0===H.sortObjects&&(ia.setFromMatrixPosition(a.matrixWorld),
+ia.applyProjection(Ia),b.z=ia.z))}for(var b=0,c=a.children.length;b<c;b++)e(a.children[b])}}function f(a,b,c,d,e){for(var f,g=0,k=a.length;g<k;g++){var n=a[g].object;f=n;f._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,f.matrixWorld);f._normalMatrix.getNormalMatrix(f._modelViewMatrix);if(e)f=e;else{f=n.material;if(!f)continue;h(f)}H.setMaterialFaces(f);H.renderBufferDirect(b,c,d,f,n)}}function g(a,b,c,d,e,f){for(var g,k=0,n=a.length;k<n;k++){g=a[k];var l=g.object;if(!0===l.visible){if(f)g=
+f;else{g=g[b];if(!g)continue;h(g)}H.renderImmediateObject(c,d,e,g,l)}}}function h(a){!0===a.transparent?Q.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):Q.setBlending(THREE.NoBlending);Q.setDepthFunc(a.depthFunc);Q.setDepthTest(a.depthTest);Q.setDepthWrite(a.depthWrite);Q.setColorWrite(a.colorWrite);Q.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function k(a,b,c,d,e){var f,g,h,k;Wa=0;if(d.needsUpdate){a:{for(var s=
+Sb[d.type],t=0,w=0,y=0,v=0,A=0,L=b.length;A<L;A++){var G=b[A];G.onlyShadow||!1===G.visible||(G instanceof THREE.DirectionalLight&&t++,G instanceof THREE.PointLight&&w++,G instanceof THREE.SpotLight&&y++,G instanceof THREE.HemisphereLight&&v++)}f=t;g=w;h=y;k=v;for(var z,D=0,C=0,E=b.length;C<E;C++){var B=b[C];B.castShadow&&(B instanceof THREE.SpotLight&&D++,B instanceof THREE.DirectionalLight&&!B.shadowCascade&&D++)}z=D;var F;if(bb&&e&&e.skeleton&&e.skeleton.useVertexTexture)F=1024;else{var O=q.getParameter(q.MAX_VERTEX_UNIFORM_VECTORS),
+R=Math.floor((O-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(R=Math.min(e.skeleton.bones.length,R),R<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+R+" (try OpenGL instead of ANGLE)"));F=R}var ja={precision:I,supportsVertexTextures:cb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,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,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:J,skinning:d.skinning,maxBones:F,useVertexTexture:bb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:H.maxMorphTargets,maxMorphNormals:H.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:z,shadowMapEnabled:ha.enabled&&
+e.receiveShadow&&0<z,shadowMapType:ha.type,shadowMapDebug:ha.debug,shadowMapCascade:ha.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},S=[];s?S.push(s):(S.push(d.fragmentShader),S.push(d.vertexShader));if(void 0!==d.defines)for(var P in d.defines)S.push(P),S.push(d.defines[P]);for(P in ja)S.push(P),S.push(ja[P]);var T=S.join();if(!d.program)d.addEventListener("dispose",Eb);else if(d.program.code!==T)Fb(d);else if(void 0!==s)break a;
+else if(d.__webglShader.uniforms===d.uniforms)break a;if(s){var V=THREE.ShaderLib[s];d.__webglShader={uniforms:THREE.UniformsUtils.clone(V.uniforms),vertexShader:V.vertexShader,fragmentShader:V.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var ma,ya=0,Ga=K.length;ya<Ga;ya++){var Ea=K[ya];if(Ea.code===T){ma=Ea;ma.usedTimes++;break}}void 0===ma&&(ma=new THREE.WebGLProgram(H,T,d,ja),K.push(ma),H.info.memory.programs=K.length);
+d.program=ma;var Ta=ma.getAttributes();if(d.morphTargets)for(var ra=d.numSupportedMorphTargets=0;ra<H.maxMorphTargets;ra++)0<=Ta["morphTarget"+ra]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(ra=d.numSupportedMorphNormals=0;ra<H.maxMorphNormals;ra++)0<=Ta["morphNormal"+ra]&&d.numSupportedMorphNormals++;d.uniformsList=[];var da=d.program.getUniforms(),ga;for(ga in d.__webglShader.uniforms){var Ha=da[ga];Ha&&d.uniformsList.push([d.__webglShader.uniforms[ga],Ha])}}d.needsUpdate=!1}var Ia=!1,Fa=
+!1,Xa=!1,Na=d.program,$=Na.getUniforms(),M=d.__webglShader.uniforms;Na.id!==na&&(q.useProgram(Na.program),na=Na.id,Xa=Fa=Ia=!0);d.id!==ka&&(-1===ka&&(Xa=!0),ka=d.id,Fa=!0);if(Ia||a!==ua)q.uniformMatrix4fv($.projectionMatrix,!1,a.projectionMatrix.elements),J&&q.uniform1f($.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==ua&&(ua=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==$.cameraPosition&&(ia.setFromMatrixPosition(a.matrixWorld),q.uniform3f($.cameraPosition,
+ia.x,ia.y,ia.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==$.viewMatrix&&q.uniformMatrix4fv($.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==$.bindMatrix&&q.uniformMatrix4fv($.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==$.bindMatrixInverse&&q.uniformMatrix4fv($.bindMatrixInverse,!1,e.bindMatrixInverse.elements),bb&&
+e.skeleton&&e.skeleton.useVertexTexture){if(null!==$.boneTexture){var Sa=m();q.uniform1i($.boneTexture,Sa);H.setTexture(e.skeleton.boneTexture,Sa)}null!==$.boneTextureWidth&&q.uniform1i($.boneTextureWidth,e.skeleton.boneTextureWidth);null!==$.boneTextureHeight&&q.uniform1i($.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==$.boneGlobalMatrices&&q.uniformMatrix4fv($.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(Fa){c&&d.fog&&(M.fogColor.value=c.color,
+c instanceof THREE.Fog?(M.fogNear.value=c.near,M.fogFar.value=c.far):c instanceof THREE.FogExp2&&(M.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Ya){var Xa=!0,Z,oa,Y,db=0,eb=0,fb=0,za,Ua,Va,Ja,gb,aa=Gb,hb=aa.directional.colors,ib=aa.directional.positions,jb=aa.point.colors,kb=aa.point.positions,ab=aa.point.distances,zb=aa.point.decays,lb=aa.spot.colors,mb=aa.spot.positions,Ab=aa.spot.distances,nb=aa.spot.directions,Bb=aa.spot.anglesCos,
+Cb=aa.spot.exponents,Db=aa.spot.decays,ob=aa.hemi.skyColors,pb=aa.hemi.groundColors,qb=aa.hemi.positions,Oa=0,Aa=0,sa=0,Ka=0,rb=0,sb=0,tb=0,Za=0,Pa=0,Qa=0,va=0,La=0;Z=0;for(oa=b.length;Z<oa;Z++)Y=b[Z],Y.onlyShadow||(za=Y.color,Ja=Y.intensity,gb=Y.distance,Y instanceof THREE.AmbientLight?Y.visible&&(db+=za.r,eb+=za.g,fb+=za.b):Y instanceof THREE.DirectionalLight?(rb+=1,Y.visible&&(ca.setFromMatrixPosition(Y.matrixWorld),ia.setFromMatrixPosition(Y.target.matrixWorld),ca.sub(ia),ca.normalize(),Pa=3*
+Oa,ib[Pa+0]=ca.x,ib[Pa+1]=ca.y,ib[Pa+2]=ca.z,p(hb,Pa,za,Ja),Oa+=1)):Y instanceof THREE.PointLight?(sb+=1,Y.visible&&(Qa=3*Aa,p(jb,Qa,za,Ja),ia.setFromMatrixPosition(Y.matrixWorld),kb[Qa+0]=ia.x,kb[Qa+1]=ia.y,kb[Qa+2]=ia.z,ab[Aa]=gb,zb[Aa]=0===Y.distance?0:Y.decay,Aa+=1)):Y instanceof THREE.SpotLight?(tb+=1,Y.visible&&(va=3*sa,p(lb,va,za,Ja),ca.setFromMatrixPosition(Y.matrixWorld),mb[va+0]=ca.x,mb[va+1]=ca.y,mb[va+2]=ca.z,Ab[sa]=gb,ia.setFromMatrixPosition(Y.target.matrixWorld),ca.sub(ia),ca.normalize(),
+nb[va+0]=ca.x,nb[va+1]=ca.y,nb[va+2]=ca.z,Bb[sa]=Math.cos(Y.angle),Cb[sa]=Y.exponent,Db[sa]=0===Y.distance?0:Y.decay,sa+=1)):Y instanceof THREE.HemisphereLight&&(Za+=1,Y.visible&&(ca.setFromMatrixPosition(Y.matrixWorld),ca.normalize(),La=3*Ka,qb[La+0]=ca.x,qb[La+1]=ca.y,qb[La+2]=ca.z,Ua=Y.color,Va=Y.groundColor,p(ob,La,Ua,Ja),p(pb,La,Va,Ja),Ka+=1)));Z=3*Oa;for(oa=Math.max(hb.length,3*rb);Z<oa;Z++)hb[Z]=0;Z=3*Aa;for(oa=Math.max(jb.length,3*sb);Z<oa;Z++)jb[Z]=0;Z=3*sa;for(oa=Math.max(lb.length,3*tb);Z<
+oa;Z++)lb[Z]=0;Z=3*Ka;for(oa=Math.max(ob.length,3*Za);Z<oa;Z++)ob[Z]=0;Z=3*Ka;for(oa=Math.max(pb.length,3*Za);Z<oa;Z++)pb[Z]=0;aa.directional.length=Oa;aa.point.length=Aa;aa.spot.length=sa;aa.hemi.length=Ka;aa.ambient[0]=db;aa.ambient[1]=eb;aa.ambient[2]=fb;Ya=!1}if(Xa){var fa=Gb;M.ambientLightColor.value=fa.ambient;M.directionalLightColor.value=fa.directional.colors;M.directionalLightDirection.value=fa.directional.positions;M.pointLightColor.value=fa.point.colors;M.pointLightPosition.value=fa.point.positions;
+M.pointLightDistance.value=fa.point.distances;M.pointLightDecay.value=fa.point.decays;M.spotLightColor.value=fa.spot.colors;M.spotLightPosition.value=fa.spot.positions;M.spotLightDistance.value=fa.spot.distances;M.spotLightDirection.value=fa.spot.directions;M.spotLightAngleCos.value=fa.spot.anglesCos;M.spotLightExponent.value=fa.spot.exponents;M.spotLightDecay.value=fa.spot.decays;M.hemisphereLightSkyColor.value=fa.hemi.skyColors;M.hemisphereLightGroundColor.value=fa.hemi.groundColors;M.hemisphereLightDirection.value=
+fa.hemi.positions;l(M,!0)}else l(M,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){M.opacity.value=d.opacity;M.diffuse.value=d.color;M.map.value=d.map;M.specularMap.value=d.specularMap;M.alphaMap.value=d.alphaMap;d.bumpMap&&(M.bumpMap.value=d.bumpMap,M.bumpScale.value=d.bumpScale);d.normalMap&&(M.normalMap.value=d.normalMap,M.normalScale.value.copy(d.normalScale));var wa;d.map?wa=d.map:d.specularMap?wa=d.specularMap:d.normalMap?
+wa=d.normalMap:d.bumpMap?wa=d.bumpMap:d.alphaMap&&(wa=d.alphaMap);if(void 0!==wa){var Hb=wa.offset,Ib=wa.repeat;M.offsetRepeat.value.set(Hb.x,Hb.y,Ib.x,Ib.y)}M.envMap.value=d.envMap;M.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;M.reflectivity.value=d.reflectivity;M.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)M.diffuse.value=d.color,M.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)M.diffuse.value=d.color,M.opacity.value=
+d.opacity,M.dashSize.value=d.dashSize,M.totalSize.value=d.dashSize+d.gapSize,M.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(M.psColor.value=d.color,M.opacity.value=d.opacity,M.size.value=d.size,M.scale.value=x.height/2,M.map.value=d.map,null!==d.map){var Jb=d.map.offset,Kb=d.map.repeat;M.offsetRepeat.value.set(Jb.x,Jb.y,Kb.x,Kb.y)}}else d instanceof THREE.MeshPhongMaterial?(M.shininess.value=d.shininess,M.emissive.value=d.emissive,M.specular.value=d.specular,M.lightMap.value=
+d.lightMap,M.lightMapIntensity.value=d.lightMapIntensity,M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshLambertMaterial?M.emissive.value=d.emissive:d instanceof THREE.MeshBasicMaterial?(M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshDepthMaterial?(M.mNear.value=a.near,M.mFar.value=a.far,M.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(M.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&M.shadowMatrix)for(var Ma=
+0,ub=0,Tb=b.length;ub<Tb;ub++){var ta=b[ub];ta.castShadow&&(ta instanceof THREE.SpotLight||ta instanceof THREE.DirectionalLight&&!ta.shadowCascade)&&(M.shadowMap.value[Ma]=ta.shadowMap,M.shadowMapSize.value[Ma]=ta.shadowMapSize,M.shadowMatrix.value[Ma]=ta.shadowMatrix,M.shadowDarkness.value[Ma]=ta.shadowDarkness,M.shadowBias.value[Ma]=ta.shadowBias,Ma++)}for(var vb=d.uniformsList,pa,Ba,qa,$a=0,Ub=vb.length;$a<Ub;$a++){var W=vb[$a][0];if(!1!==W.needsUpdate){var Lb=W.type,N=W.value,X=vb[$a][1];switch(Lb){case "1i":q.uniform1i(X,
+N);break;case "1f":q.uniform1f(X,N);break;case "2f":q.uniform2f(X,N[0],N[1]);break;case "3f":q.uniform3f(X,N[0],N[1],N[2]);break;case "4f":q.uniform4f(X,N[0],N[1],N[2],N[3]);break;case "1iv":q.uniform1iv(X,N);break;case "3iv":q.uniform3iv(X,N);break;case "1fv":q.uniform1fv(X,N);break;case "2fv":q.uniform2fv(X,N);break;case "3fv":q.uniform3fv(X,N);break;case "4fv":q.uniform4fv(X,N);break;case "Matrix3fv":q.uniformMatrix3fv(X,!1,N);break;case "Matrix4fv":q.uniformMatrix4fv(X,!1,N);break;case "i":q.uniform1i(X,
+N);break;case "f":q.uniform1f(X,N);break;case "v2":q.uniform2f(X,N.x,N.y);break;case "v3":q.uniform3f(X,N.x,N.y,N.z);break;case "v4":q.uniform4f(X,N.x,N.y,N.z,N.w);break;case "c":q.uniform3f(X,N.r,N.g,N.b);break;case "iv1":q.uniform1iv(X,N);break;case "iv":q.uniform3iv(X,N);break;case "fv1":q.uniform1fv(X,N);break;case "fv":q.uniform3fv(X,N);break;case "v2v":void 0===W._array&&(W._array=new Float32Array(2*N.length));for(var U=0,la=N.length;U<la;U++)qa=2*U,W._array[qa+0]=N[U].x,W._array[qa+1]=N[U].y;
+q.uniform2fv(X,W._array);break;case "v3v":void 0===W._array&&(W._array=new Float32Array(3*N.length));U=0;for(la=N.length;U<la;U++)qa=3*U,W._array[qa+0]=N[U].x,W._array[qa+1]=N[U].y,W._array[qa+2]=N[U].z;q.uniform3fv(X,W._array);break;case "v4v":void 0===W._array&&(W._array=new Float32Array(4*N.length));U=0;for(la=N.length;U<la;U++)qa=4*U,W._array[qa+0]=N[U].x,W._array[qa+1]=N[U].y,W._array[qa+2]=N[U].z,W._array[qa+3]=N[U].w;q.uniform4fv(X,W._array);break;case "m3":q.uniformMatrix3fv(X,!1,N.elements);
+break;case "m3v":void 0===W._array&&(W._array=new Float32Array(9*N.length));U=0;for(la=N.length;U<la;U++)N[U].flattenToArrayOffset(W._array,9*U);q.uniformMatrix3fv(X,!1,W._array);break;case "m4":q.uniformMatrix4fv(X,!1,N.elements);break;case "m4v":void 0===W._array&&(W._array=new Float32Array(16*N.length));U=0;for(la=N.length;U<la;U++)N[U].flattenToArrayOffset(W._array,16*U);q.uniformMatrix4fv(X,!1,W._array);break;case "t":pa=N;Ba=m();q.uniform1i(X,Ba);if(!pa)continue;if(pa instanceof THREE.CubeTexture||
+Array.isArray(pa.image)&&6===pa.image.length){var ba=pa,Mb=Ba;if(6===ba.image.length)if(ba.needsUpdate){ba.image.__webglTextureCube||(ba.addEventListener("dispose",wb),ba.image.__webglTextureCube=q.createTexture(),H.info.memory.textures++);Q.activeTexture(q.TEXTURE0+Mb);Q.bindTexture(q.TEXTURE_CUBE_MAP,ba.image.__webglTextureCube);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,ba.flipY);for(var Nb=ba instanceof THREE.CompressedTexture,xb=ba.image[0]instanceof THREE.DataTexture,Ca=[],ea=0;6>ea;ea++)Ca[ea]=!H.autoScaleCubemaps||
+Nb||xb?xb?ba.image[ea].image:ba.image[ea]:r(ba.image[ea],Vb);var Ob=Ca[0],Pb=THREE.Math.isPowerOfTwo(Ob.width)&&THREE.Math.isPowerOfTwo(Ob.height),xa=u(ba.format),yb=u(ba.type);n(q.TEXTURE_CUBE_MAP,ba,Pb);for(ea=0;6>ea;ea++)if(Nb)for(var Da,Qb=Ca[ea].mipmaps,Ra=0,Wb=Qb.length;Ra<Wb;Ra++)Da=Qb[Ra],ba.format!==THREE.RGBAFormat&&ba.format!==THREE.RGBFormat?-1<Rb().indexOf(xa)?Q.compressedTexImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ea,Ra,xa,Da.width,Da.height,0,Da.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):
+Q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ea,Ra,xa,Da.width,Da.height,0,xa,yb,Da.data);else xb?Q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ea,0,xa,Ca[ea].width,Ca[ea].height,0,xa,yb,Ca[ea].data):Q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ea,0,xa,xa,yb,Ca[ea]);ba.generateMipmaps&&Pb&&q.generateMipmap(q.TEXTURE_CUBE_MAP);ba.needsUpdate=!1;if(ba.onUpdate)ba.onUpdate(ba)}else Q.activeTexture(q.TEXTURE0+Mb),Q.bindTexture(q.TEXTURE_CUBE_MAP,ba.image.__webglTextureCube)}else if(pa instanceof THREE.WebGLRenderTargetCube){var Xb=
+pa;Q.activeTexture(q.TEXTURE0+Ba);Q.bindTexture(q.TEXTURE_CUBE_MAP,Xb.__webglTexture)}else H.setTexture(pa,Ba);break;case "tv":void 0===W._array&&(W._array=[]);U=0;for(la=W.value.length;U<la;U++)W._array[U]=m();q.uniform1iv(X,W._array);U=0;for(la=W.value.length;U<la;U++)pa=W.value[U],Ba=W._array[U],pa&&H.setTexture(pa,Ba);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Lb)}}}}q.uniformMatrix4fv($.modelViewMatrix,!1,e._modelViewMatrix.elements);$.normalMatrix&&q.uniformMatrix3fv($.normalMatrix,
+!1,e._normalMatrix.elements);null!==$.modelMatrix&&q.uniformMatrix4fv($.modelMatrix,!1,e.matrixWorld.elements);return Na}function l(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 m(){var a=Wa;a>=Sa&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Sa);Wa+=1;return a}function p(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function n(a,b,c){c?(q.texParameteri(a,q.TEXTURE_WRAP_S,u(b.wrapS)),q.texParameteri(a,
+q.TEXTURE_WRAP_T,u(b.wrapT)),q.texParameteri(a,q.TEXTURE_MAG_FILTER,u(b.magFilter)),q.texParameteri(a,q.TEXTURE_MIN_FILTER,u(b.minFilter))):(q.texParameteri(a,q.TEXTURE_WRAP_S,q.CLAMP_TO_EDGE),q.texParameteri(a,q.TEXTURE_WRAP_T,q.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),q.texParameteri(a,q.TEXTURE_MAG_FILTER,
+s(b.magFilter)),q.texParameteri(a,q.TEXTURE_MIN_FILTER,s(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=V.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||b.__currentAnisotropy)&&(q.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,
+H.getMaxAnisotropy())),b.__currentAnisotropy=b.anisotropy)}function r(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);console.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 t(a,b){q.bindRenderbuffer(q.RENDERBUFFER,a);b.depthBuffer&&
+!b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_COMPONENT16,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_STENCIL,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a)):q.renderbufferStorage(q.RENDERBUFFER,q.RGBA4,b.width,b.height)}function s(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||
+a===THREE.NearestMipMapLinearFilter?q.NEAREST:q.LINEAR}function u(a){var b;if(a===THREE.RepeatWrapping)return q.REPEAT;if(a===THREE.ClampToEdgeWrapping)return q.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return q.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return q.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return q.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return q.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return q.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return q.LINEAR_MIPMAP_NEAREST;
+if(a===THREE.LinearMipMapLinearFilter)return q.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return q.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return q.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return q.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return q.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return q.BYTE;if(a===THREE.ShortType)return q.SHORT;if(a===THREE.UnsignedShortType)return q.UNSIGNED_SHORT;if(a===THREE.IntType)return q.INT;if(a===THREE.UnsignedIntType)return q.UNSIGNED_INT;
+if(a===THREE.FloatType)return q.FLOAT;b=V.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return q.ALPHA;if(a===THREE.RGBFormat)return q.RGB;if(a===THREE.RGBAFormat)return q.RGBA;if(a===THREE.LuminanceFormat)return q.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return q.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return q.FUNC_ADD;if(a===THREE.SubtractEquation)return q.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return q.FUNC_REVERSE_SUBTRACT;
+if(a===THREE.ZeroFactor)return q.ZERO;if(a===THREE.OneFactor)return q.ONE;if(a===THREE.SrcColorFactor)return q.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return q.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return q.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return q.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return q.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return q.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return q.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return q.ONE_MINUS_DST_COLOR;
+if(a===THREE.SrcAlphaSaturateFactor)return q.SRC_ALPHA_SATURATE;b=V.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=V.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=V.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 x=void 0!==a.canvas?a.canvas:document.createElement("canvas"),w=void 0!==
+a.context?a.context:null,A=x.width,y=x.height,G=1,I=void 0!==a.precision?a.precision:"highp",v=void 0!==a.alpha?a.alpha:!1,D=void 0!==a.depth?a.depth:!0,L=void 0!==a.stencil?a.stencil:!0,C=void 0!==a.antialias?a.antialias:!1,E=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,R=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,J=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,z=new THREE.Color(0),F=0,B=[],T=[],O=[],S=[],P=[];this.domElement=x;this.context=null;this.sortObjects=
+this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!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 H=this,K=[],na=null,da=null,ka=-1,ja="",ua=null,Wa=0,ma=0,Ga=0,Ea=x.width,ya=x.height,Ta=0,ra=0,Ha=new THREE.Frustum,Ia=new THREE.Matrix4,ia=new THREE.Vector3,ca=new THREE.Vector3,Ya=!0,Gb=
+{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:[]}},q;try{a={alpha:v,depth:D,stencil:L,antialias:C,premultipliedAlpha:E,preserveDrawingBuffer:R};q=w||x.getContext("webgl",a)||x.getContext("experimental-webgl",a);if(null===q){if(null!==x.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";
+throw"Error creating WebGL context.";}x.addEventListener("webglcontextlost",function(a){a.preventDefault();Ua();Va();ga.objects={}},!1)}catch(zb){console.error("THREE.WebGLRenderer: "+zb)}var Q=new THREE.WebGLState(q,u);void 0===q.getShaderPrecisionFormat&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var V=new THREE.WebGLExtensions(q),ga=new THREE.WebGLObjects(q,this.info);V.get("OES_texture_float");V.get("OES_texture_float_linear");V.get("OES_texture_half_float");
+V.get("OES_texture_half_float_linear");V.get("OES_standard_derivatives");V.get("ANGLE_instanced_arrays");V.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);J&&V.get("EXT_frag_depth");var Fa=function(a,b,c,d){!0===E&&(a*=d,b*=d,c*=d);q.clearColor(a,b,c,d)},Va=function(){q.clearColor(0,0,0,1);q.clearDepth(1);q.clearStencil(0);q.enable(q.DEPTH_TEST);q.depthFunc(q.LEQUAL);q.frontFace(q.CCW);q.cullFace(q.BACK);q.enable(q.CULL_FACE);q.enable(q.BLEND);q.blendEquation(q.FUNC_ADD);
+q.blendFunc(q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA);q.viewport(ma,Ga,Ea,ya);Fa(z.r,z.g,z.b,F)},Ua=function(){ua=na=null;ja="";ka=-1;Ya=!0;Q.reset()};Va();this.context=q;this.extensions=V;this.state=Q;var ha=new THREE.WebGLShadowMap(this,B,ga);this.shadowMap=ha;var Sa=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS),w=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ab=q.getParameter(q.MAX_TEXTURE_SIZE),Vb=q.getParameter(q.MAX_CUBE_MAP_TEXTURE_SIZE),cb=0<w,bb=cb&&V.get("OES_texture_float"),Bb=V.get("ANGLE_instanced_arrays"),
+v=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.HIGH_FLOAT),w=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.MEDIUM_FLOAT),D=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.HIGH_FLOAT);a=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.MEDIUM_FLOAT);var Rb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(V.get("WEBGL_compressed_texture_pvrtc")||V.get("WEBGL_compressed_texture_s3tc"))for(var b=q.getParameter(q.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),v=0<
+v.precision&&0<D.precision,w=0<w.precision&&0<a.precision;"highp"!==I||v||(w?(I="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(I="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==I||w||(I="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Cb=new THREE.SpritePlugin(this,S),Db=new THREE.LensFlarePlugin(this,P);this.getContext=function(){return q};this.forceContextLoss=function(){V.get("WEBGL_lose_context").loseContext()};
+this.supportsVertexTextures=function(){return cb};this.supportsInstancedArrays=function(){return Bb};this.supportsFloatTextures=function(){return V.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return V.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){return V.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return V.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return V.get("WEBGL_compressed_texture_pvrtc")};
+this.supportsBlendMinMax=function(){return V.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=V.get("EXT_texture_filter_anisotropic");return a=null!==b?q.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return I};this.getPixelRatio=function(){return G};this.setPixelRatio=function(a){void 0!==a&&(G=a)};this.getSize=function(){return{width:A,height:y}};this.setSize=function(a,b,c){A=a;y=b;x.width=a*G;x.height=
+b*G;!1!==c&&(x.style.width=a+"px",x.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){ma=a*G;Ga=b*G;Ea=c*G;ya=d*G;q.viewport(ma,Ga,Ea,ya)};this.setScissor=function(a,b,c,d){q.scissor(a*G,b*G,c*G,d*G)};this.enableScissorTest=function(a){a?q.enable(q.SCISSOR_TEST):q.disable(q.SCISSOR_TEST)};this.getClearColor=function(){return z};this.setClearColor=function(a,b){z.set(a);F=void 0!==b?b:1;Fa(z.r,z.g,z.b,F)};this.getClearAlpha=function(){return F};this.setClearAlpha=function(a){F=
+a;Fa(z.r,z.g,z.b,F)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=q.COLOR_BUFFER_BIT;if(void 0===b||b)d|=q.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=q.STENCIL_BUFFER_BIT;q.clear(d)};this.clearColor=function(){q.clear(q.COLOR_BUFFER_BIT)};this.clearDepth=function(){q.clear(q.DEPTH_BUFFER_BIT)};this.clearStencil=function(){q.clear(q.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=Ua;var wb=function(a){a=a.target;a.removeEventListener("dispose",
+wb);a.image&&a.image.__webglTextureCube?(q.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(q.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);H.info.memory.textures--},ab=function(a){a=a.target;a.removeEventListener("dispose",ab);if(a&&void 0!==a.__webglTexture){q.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)q.deleteFramebuffer(a.__webglFramebuffer[b]),
+q.deleteRenderbuffer(a.__webglRenderbuffer[b]);else q.deleteFramebuffer(a.__webglFramebuffer),q.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}H.info.memory.textures--},Eb=function(a){a=a.target;a.removeEventListener("dispose",Eb);Fb(a)},Fb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=K.length;a<c;a++)if(d=K[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=K.length;a<
+c;a++)d=K[a],d.program!==b&&e.push(d);K=e;q.deleteProgram(b);H.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){Q.initAttributes();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=q.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=q.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=q.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=q.createBuffer());b=b.getAttributes();a.hasPositions&&(q.bindBuffer(q.ARRAY_BUFFER,
+a.__webglVertexBuffer),q.bufferData(q.ARRAY_BUFFER,a.positionArray,q.DYNAMIC_DRAW),Q.enableAttribute(b.position),q.vertexAttribPointer(b.position,3,q.FLOAT,!1,0,0));if(a.hasNormals){q.bindBuffer(q.ARRAY_BUFFER,a.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,k,n,l,m,p,r,s=3*a.count;for(r=0;r<s;r+=9)p=a.normalArray,d=p[r],e=p[r+1],f=p[r+2],g=p[r+3],k=p[r+4],l=p[r+5],h=p[r+6],n=p[r+7],m=p[r+8],d=(d+g+h)/3,e=(e+k+n)/3,f=(f+l+m)/3,p[r]=
+d,p[r+1]=e,p[r+2]=f,p[r+3]=d,p[r+4]=e,p[r+5]=f,p[r+6]=d,p[r+7]=e,p[r+8]=f}q.bufferData(q.ARRAY_BUFFER,a.normalArray,q.DYNAMIC_DRAW);Q.enableAttribute(b.normal);q.vertexAttribPointer(b.normal,3,q.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglUvBuffer),q.bufferData(q.ARRAY_BUFFER,a.uvArray,q.DYNAMIC_DRAW),Q.enableAttribute(b.uv),q.vertexAttribPointer(b.uv,2,q.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglColorBuffer),q.bufferData(q.ARRAY_BUFFER,
+a.colorArray,q.DYNAMIC_DRAW),Q.enableAttribute(b.color),q.vertexAttribPointer(b.color,3,q.FLOAT,!1,0,0));Q.disableUnusedAttributes();q.drawArrays(q.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f){if(!1!==e.visible){var g=ga.geometries.get(f);a=k(a,c,d,e,f);c=!1;d=g.id+"_"+a.id+"_"+(e.wireframe?1:0);d!==ja&&(ja=d,c=!0);c&&Q.initAttributes();if(f instanceof THREE.Mesh)a:if(f=c,c=!0===e.wireframe?q.LINES:q.TRIANGLES,d=g.attributes.index){var h,n;d.array instanceof Uint32Array&&
+V.get("OES_element_index_uint")?(h=q.UNSIGNED_INT,n=4):(h=q.UNSIGNED_SHORT,n=2);var l=g.offsets;if(0===l.length){f&&(b(e,a,g,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){var m=V.get("ANGLE_instanced_arrays");if(null===m){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}m.drawElementsInstancedANGLE(c,d.array.length,h,
+0,g.maxInstancedCount)}else q.drawElements(c,d.array.length,h,0);H.info.render.calls++;H.info.render.vertices+=d.array.length;H.info.render.faces+=d.array.length/3}else{f=!0;for(var p=0,r=l.length;p<r;p++){m=l[p].index;f&&(b(e,a,g,m),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&0<l[p].instances){m=V.get("ANGLE_instanced_arrays");if(null===m){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
+break a}m.drawElementsInstancedANGLE(c,l[p].count,h,l[p].start*n,l[p].count,h,l[p].instances)}else q.drawElements(c,l[p].count,h,l[p].start*n);H.info.render.calls++;H.info.render.vertices+=l[p].count;H.info.render.faces+=l[p].count/3}}}else if(l=g.offsets,0===l.length){f&&b(e,a,g,0);e=g.attributes.position;if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){m=V.get("ANGLE_instanced_arrays");if(null===m){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
+break a}e instanceof THREE.InterleavedBufferAttribute?m.drawArraysInstancedANGLE(c,0,e.data.array.length/e.data.stride,g.maxInstancedCount):m.drawArraysInstancedANGLE(c,0,e.array.length/e.itemSize,g.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?q.drawArrays(c,0,e.data.array.length/e.data.stride):q.drawArrays(c,0,e.array.length/e.itemSize);H.info.render.calls++;H.info.render.vertices+=e.array.length/e.itemSize;H.info.render.faces+=e.array.length/(3*e.itemSize)}else for(f&&b(e,
+a,g,0),p=0,r=l.length;p<r;p++){if(g instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else q.drawArrays(c,l[p].start,l[p].count);H.info.render.calls++;H.info.render.vertices+=l[p].count;H.info.render.faces+=l[p].count/3}else if(f instanceof THREE.Line)if(f=f instanceof THREE.LineSegments?q.LINES:q.LINE_STRIP,Q.setLineWidth((void 0!==e.linewidth?e.linewidth:1)*G),h=g.attributes.index)if(h.array instanceof
+Uint32Array&&V.get("OES_element_index_uint")?(n=q.UNSIGNED_INT,l=4):(n=q.UNSIGNED_SHORT,l=2),d=g.offsets,0===d.length)c&&(b(e,a,g,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(f,h.array.length,n,0),H.info.render.calls++,H.info.render.vertices+=h.array.length;else for(1<d.length&&(c=!0),m=0,p=d.length;m<p;m++)r=d[m].index,c&&(b(e,a,g,r),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(f,d[m].count,n,d[m].start*l),H.info.render.calls++,H.info.render.vertices+=d[m].count;
+else if(c&&b(e,a,g,0),e=g.attributes.position,d=g.offsets,0===d.length)q.drawArrays(f,0,e.array.length/3),H.info.render.calls++,H.info.render.vertices+=e.array.length/3;else for(m=0,p=d.length;m<p;m++)q.drawArrays(f,d[m].index,d[m].count),H.info.render.calls++,H.info.render.vertices+=d[m].count;else if(f instanceof THREE.PointCloud)if(d=c,c=q.POINTS,h=g.attributes.index)if(h.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(n=q.UNSIGNED_INT,l=4):(n=q.UNSIGNED_SHORT,l=2),f=g.offsets,0===
+f.length)d&&(b(e,a,g,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(c,h.array.length,n,0),H.info.render.calls++,H.info.render.points+=h.array.length;else for(1<f.length&&(d=!0),m=0,p=f.length;m<p;m++)r=f[m].index,d&&(b(e,a,g,r),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(c,f[m].count,n,f[m].start*l),H.info.render.calls++,H.info.render.points+=f[m].count;else if(d&&b(e,a,g,0),e=g.attributes.position,f=g.offsets,0===f.length)q.drawArrays(c,0,e.array.length/3),H.info.render.calls++,
+H.info.render.points+=e.array.length/3;else for(m=0,p=f.length;m<p;m++)q.drawArrays(c,f[m].index,f[m].count),H.info.render.calls++,H.info.render.points+=f[m].count}};this.render=function(a,b,k,l){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var n=a.fog;ja="";ka=-1;ua=null;Ya=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Ia.multiplyMatrices(b.projectionMatrix,
+b.matrixWorldInverse);Ha.setFromMatrix(Ia);B.length=0;T.length=0;O.length=0;S.length=0;P.length=0;e(a);!0===H.sortObjects&&(T.sort(c),O.sort(d));ga.update(T);ga.update(O);ha.render(a,b);H.info.render.calls=0;H.info.render.vertices=0;H.info.render.faces=0;H.info.render.points=0;this.setRenderTarget(k);(this.autoClear||l)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);l=0;for(var m=ga.objectsImmediate.length;l<m;l++){var p=ga.objectsImmediate[l],r=p.object;if(!0===r.visible){var s=
+r;s._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,s.matrixWorld);s._normalMatrix.getNormalMatrix(s._modelViewMatrix);r=r.material;r.transparent?(p.transparent=r,p.opaque=null):(p.opaque=r,p.transparent=null)}}a.overrideMaterial?(l=a.overrideMaterial,h(l),f(T,b,B,n,l),f(O,b,B,n,l),g(ga.objectsImmediate,"",b,B,n,l)):(Q.setBlending(THREE.NoBlending),f(T,b,B,n,null),g(ga.objectsImmediate,"opaque",b,B,n,null),f(O,b,B,n,null),g(ga.objectsImmediate,"transparent",b,B,n,null));Cb.render(a,b);Db.render(a,
+b,Ta,ra);k&&k.generateMipmaps&&k.minFilter!==THREE.NearestFilter&&k.minFilter!==THREE.LinearFilter&&(k instanceof THREE.WebGLRenderTargetCube?(Q.bindTexture(q.TEXTURE_CUBE_MAP,k.__webglTexture),q.generateMipmap(q.TEXTURE_CUBE_MAP),Q.bindTexture(q.TEXTURE_CUBE_MAP,null)):(Q.bindTexture(q.TEXTURE_2D,k.__webglTexture),q.generateMipmap(q.TEXTURE_2D),Q.bindTexture(q.TEXTURE_2D,null)));Q.setDepthTest(!0);Q.setDepthWrite(!0);Q.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=k(a,
+b,c,d,e);ja="";H.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,q,Ha):e.render(function(a){H.renderBufferImmediate(a,f,d)})};var Sb={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?q.disable(q.CULL_FACE):(b===THREE.FrontFaceDirectionCW?q.frontFace(q.CW):
+q.frontFace(q.CCW),a===THREE.CullFaceBack?q.cullFace(q.BACK):a===THREE.CullFaceFront?q.cullFace(q.FRONT):q.cullFace(q.FRONT_AND_BACK),q.enable(q.CULL_FACE))};this.setMaterialFaces=function(a){Q.setDoubleSided(a.side===THREE.DoubleSide);Q.setFlipSided(a.side===THREE.BackSide)};this.uploadTexture=function(a,b){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",wb),a.__webglTexture=q.createTexture(),H.info.memory.textures++);Q.activeTexture(q.TEXTURE0+b);Q.bindTexture(q.TEXTURE_2D,
+a.__webglTexture);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,a.flipY);q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);q.pixelStorei(q.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=r(a.image,Ab);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=u(a.format),f=u(a.type);n(q.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],Q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);
+a.generateMipmaps=!1}else Q.texImage2D(q.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Rb().indexOf(e)?Q.compressedTexImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,c.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=
+0;for(k=g.length;h<k;h++)c=g[h],Q.texImage2D(q.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else Q.texImage2D(q.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&q.generateMipmap(q.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate(a)};this.setTexture=function(a,b){if(!0===a.needsUpdate){var c=a.image;void 0===c?console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a):!1===c.complete?console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",
+a):H.uploadTexture(a,b)}else Q.activeTexture(q.TEXTURE0+b),Q.bindTexture(q.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",ab);a.__webglTexture=q.createTexture();H.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=u(a.format),e=u(a.type);
+if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];Q.bindTexture(q.TEXTURE_CUBE_MAP,a.__webglTexture);n(q.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=q.createFramebuffer();a.__webglRenderbuffer[f]=q.createRenderbuffer();Q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=q.TEXTURE_CUBE_MAP_POSITIVE_X+f;q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer[f]);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,h,g.__webglTexture,0);
+t(a.__webglRenderbuffer[f],a)}a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=q.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:q.createRenderbuffer(),Q.bindTexture(q.TEXTURE_2D,a.__webglTexture),n(q.TEXTURE_2D,a,c),Q.texImage2D(q.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=q.TEXTURE_2D,q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer),q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,d,a.__webglTexture,
+0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):t(a.__webglRenderbuffer,a),a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_2D);b?Q.bindTexture(q.TEXTURE_CUBE_MAP,null):Q.bindTexture(q.TEXTURE_2D,null);q.bindRenderbuffer(q.RENDERBUFFER,null);q.bindFramebuffer(q.FRAMEBUFFER,
+null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Ea,a=ya,d=ma,e=Ga);b!==da&&(q.bindFramebuffer(q.FRAMEBUFFER,b),q.viewport(d,e,c,a),da=b);Ta=c;ra=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!==da&&(q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer),g=!0);q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?q.readPixels(b,c,d,e,q.RGBA,q.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&q.bindFramebuffer(q.FRAMEBUFFER,da)}};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};
+this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return ha.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");ha.enabled=a}},shadowMapType:{get:function(){return ha.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");
+ha.type=a}},shadowMapCullFace:{get:function(){return ha.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");ha.cullFace=a}},shadowMapDebug:{get:function(){return ha.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");ha.debug=a}},shadowMapCascade:{get:function(){return ha.cascade},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCascade is now .shadowMap.cascade.");ha.cascade=a}}})};
 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){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose()},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=
@@ -573,76 +572,77 @@ break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_t
 THREE.WebGLGeometries=function(a,b){function c(e){e=e.target;e.removeEventListener("dispose",c);e=d[e.id];for(var f in e.attributes){var g=e.attributes[f];void 0!==g.buffer&&(a.deleteBuffer(g.buffer),delete g.buffer)}b.memory.geometries--}var d={};this.get=function(a){var f=a.geometry;if(void 0!==d[f.id])return d[f.id];f.addEventListener("dispose",c);d[f.id]=f instanceof THREE.BufferGeometry?f:(new THREE.BufferGeometry).setFromObject(a);b.memory.geometries++;return d[f.id]}};
 THREE.WebGLObjects=function(a,b){function c(a){a.target.traverse(function(a){a.removeEventListener("remove",c);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete e[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=f,d=b.length-1;0<=d;d--)b[d].object===a&&b.splice(d,1);delete a.__webglInit;delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})}function d(a,b){return b[0]-a[0]}var e={},f=[],g=new Float32Array(8),
 h=new THREE.WebGLGeometries(a,b);this.objects=e;this.objectsImmediate=f;this.geometries=h;this.init=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",c));void 0===a.__webglActive&&(a.__webglActive=!0,a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud?e[a.id]={id:a.id,object:a,z:0}:(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&f.push({id:null,
-object:a,opaque:null,transparent:null,z:0}))};this.update=function(b){for(var c=0,e=b.length;c<e;c++){var f=b[c].object;if(!1!==f.material.visible){var m=f,q=h.get(m);!0===m.geometry.dynamic&&q.updateFromObject(m);if(void 0!==m.morphTargetInfluences){for(var t=[],f=m.morphTargetInfluences,s=0,u=f.length;s<u;s++)t.push([f[s],s]);t.sort(d);8<t.length&&(t.length=8);s=0;for(u=t.length;s<u;s++)g[s]=t[s][0],f=q.morphAttributes[t[s][1]],q.addAttribute("morphTarget"+s,f);f=m.material;void 0!==f.program?null!==
-f.program.uniforms.morphTargetInfluences&&a.uniform1fv(f.program.uniforms.morphTargetInfluences,g):console.warn("TOFIX: material.program is undefined")}q=q.attributes;m=void 0;for(m in q)if(f=q[m],t="index"===m?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,f=f instanceof THREE.InterleavedBufferAttribute?f.data:f,void 0===f.buffer){f.buffer=a.createBuffer();a.bindBuffer(t,f.buffer);s=a.STATIC_DRAW;if(f instanceof THREE.DynamicBufferAttribute||f instanceof THREE.InstancedBufferAttribute&&!0===f.dynamic||f instanceof
+object:a,opaque:null,transparent:null,z:0}))};this.update=function(b){for(var c=0,e=b.length;c<e;c++){var f=b[c].object;if(!1!==f.material.visible){var n=f,r=h.get(n);!0===n.geometry.dynamic&&r.updateFromObject(n);if(void 0!==n.morphTargetInfluences){for(var t=[],f=n.morphTargetInfluences,s=0,u=f.length;s<u;s++)t.push([f[s],s]);t.sort(d);8<t.length&&(t.length=8);s=0;for(u=t.length;s<u;s++)g[s]=t[s][0],f=r.morphAttributes[t[s][1]],r.addAttribute("morphTarget"+s,f);f=n.material;void 0!==f.program?null!==
+f.program.uniforms.morphTargetInfluences&&a.uniform1fv(f.program.uniforms.morphTargetInfluences,g):console.warn("TOFIX: material.program is undefined")}r=r.attributes;n=void 0;for(n in r)if(f=r[n],t="index"===n?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,f=f instanceof THREE.InterleavedBufferAttribute?f.data:f,void 0===f.buffer){f.buffer=a.createBuffer();a.bindBuffer(t,f.buffer);s=a.STATIC_DRAW;if(f instanceof THREE.DynamicBufferAttribute||f instanceof THREE.InstancedBufferAttribute&&!0===f.dynamic||f instanceof
 THREE.InterleavedBuffer&&!0===f.dynamic)s=a.DYNAMIC_DRAW;a.bufferData(t,f.array,s);f.needsUpdate=!1}else!0===f.needsUpdate&&(a.bindBuffer(t,f.buffer),void 0===f.updateRange||-1===f.updateRange.count?a.bufferSubData(t,0,f.array):0===f.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."):(a.bufferSubData(t,f.updateRange.offset*f.array.BYTES_PER_ELEMENT,
 f.array.subarray(f.updateRange.offset,f.updateRange.offset+f.updateRange.count)),f.updateRange.count=0),f.needsUpdate=!1)}}}};
-THREE.WebGLProgram=function(){function a(a){return""!==a}var b=0;return function(c,d,e,f){var g=c.context,h=e.defines,k=e.__webglShader.uniforms,l=e.attributes,n=e.__webglShader.vertexShader,p=e.__webglShader.fragmentShader,m=e.index0AttributeName,q="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?q="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(q="SHADOWMAP_TYPE_PCF_SOFT");var t="ENVMAP_TYPE_CUBE",s="ENVMAP_MODE_REFLECTION",u="ENVMAP_BLENDING_MULTIPLY";if(f.envMap){switch(e.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:t=
-"ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:t="ENVMAP_TYPE_SPHERE"}switch(e.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:s="ENVMAP_MODE_REFRACTION"}switch(e.combine){case THREE.MultiplyOperation:u="ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:u="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:u="ENVMAP_BLENDING_ADD"}}var w=
-0<c.gammaFactor?c.gammaFactor:1,x,A=[];for(x in h){var y=h[x];!1!==y&&A.push("#define "+x+" "+y)}x=A.join("\n");h=g.createProgram();e instanceof THREE.RawShaderMaterial?c=A="":(A=["precision "+f.precision+" float;","precision "+f.precision+" int;",x,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+w,"#define MAX_DIR_LIGHTS "+f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+
-f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,"#define MAX_BONES "+f.maxBones,f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+s:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":
-"",f.skinning?"#define USE_SKINNING":"",f.useVertexTexture?"#define BONE_TEXTURE":"",f.morphTargets?"#define USE_MORPHTARGETS":"",f.morphNormals?"#define USE_MORPHNORMALS":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+q:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",f.sizeAttenuation?"#define USE_SIZEATTENUATION":"",f.logarithmicDepthBuffer?
-"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&c.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;",
-"\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(a).join("\n"),
-c=[f.bumpMap||f.normalMap||f.flatShading||e.derivatives?"#extension GL_OES_standard_derivatives : enable":"","precision "+f.precision+" float;","precision "+f.precision+" int;",x,"#define MAX_DIR_LIGHTS "+f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,f.alphaTest?"#define ALPHATEST "+f.alphaTest:"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":
-"","#define GAMMA_FACTOR "+w,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+t:"",f.envMap?"#define "+s:"",f.envMap?"#define "+u:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",
-f.flatShading?"#define FLAT_SHADED":"",f.metal?"#define METAL":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+q:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&c.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",
-"\n"].filter(a).join("\n"));n=new THREE.WebGLShader(g,g.VERTEX_SHADER,A+n);p=new THREE.WebGLShader(g,g.FRAGMENT_SHADER,c+p);g.attachShader(h,n);g.attachShader(h,p);void 0!==m&&g.bindAttribLocation(h,0,m);g.linkProgram(h);m=g.getProgramInfoLog(h);c=g.getShaderInfoLog(n);q=g.getShaderInfoLog(p);!1===g.getProgramParameter(h,g.LINK_STATUS)&&console.error("THREE.WebGLProgram: shader error: ",g.getError(),"gl.VALIDATE_STATUS",g.getProgramParameter(h,g.VALIDATE_STATUS),"gl.getProgramInfoLog",m,c,q);""!==
-m&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",m);g.deleteShader(n);g.deleteShader(p);m="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");f.useVertexTexture?m.push("boneTexture","boneTextureWidth","boneTextureHeight"):m.push("boneGlobalMatrices");f.logarithmicDepthBuffer&&m.push("logDepthBufFC");for(var D in k)m.push(D);k=m;D={};m=0;for(c=k.length;m<c;m++)q=k[m],D[q]=g.getUniformLocation(h,
-q);this.uniforms=D;if(e instanceof THREE.RawShaderMaterial)m=l;else{m="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(e=0;e<f.maxMorphTargets;e++)m.push("morphTarget"+e);for(e=0;e<f.maxMorphNormals;e++)m.push("morphNormal"+e);Array.isArray(l)&&(m=m.concat(l))}f=m;l={};e=0;for(k=f.length;e<k;e++)D=f[e],l[D]=g.getAttribLocation(h,D);this.attributes=l;this.id=b++;this.code=d;this.usedTimes=1;this.program=h;this.vertexShader=n;this.fragmentShader=p;return this}}();
+THREE.WebGLProgram=function(){function a(a){var b=[],c;for(c in a){var g=a[c];!1!==g&&b.push("#define "+c+" "+g)}return b.join("\n")}function b(a){return""!==a}var c=0;return function(d,e,f,g){var h=d.context,k=f.defines,l=f.__webglShader.vertexShader,m=f.__webglShader.fragmentShader,p=f.index0AttributeName,n="SHADOWMAP_TYPE_BASIC";g.shadowMapType===THREE.PCFShadowMap?n="SHADOWMAP_TYPE_PCF":g.shadowMapType===THREE.PCFSoftShadowMap&&(n="SHADOWMAP_TYPE_PCF_SOFT");var r="ENVMAP_TYPE_CUBE",t="ENVMAP_MODE_REFLECTION",
+s="ENVMAP_BLENDING_MULTIPLY";if(g.envMap){switch(f.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:r="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:r="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:r="ENVMAP_TYPE_SPHERE"}switch(f.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_MODE_REFRACTION"}switch(f.combine){case THREE.MultiplyOperation:s=
+"ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:s="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:s="ENVMAP_BLENDING_ADD"}}var u=0<d.gammaFactor?d.gammaFactor:1,x=a(k),w=h.createProgram();f instanceof THREE.RawShaderMaterial?d=k="":(k=["precision "+g.precision+" float;","precision "+g.precision+" int;",x,g.supportsVertexTextures?"#define VERTEX_TEXTURES":"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+u,"#define MAX_DIR_LIGHTS "+
+g.maxDirLights,"#define MAX_POINT_LIGHTS "+g.maxPointLights,"#define MAX_SPOT_LIGHTS "+g.maxSpotLights,"#define MAX_HEMI_LIGHTS "+g.maxHemiLights,"#define MAX_SHADOWS "+g.maxShadows,"#define MAX_BONES "+g.maxBones,g.map?"#define USE_MAP":"",g.envMap?"#define USE_ENVMAP":"",g.envMap?"#define "+t:"",g.lightMap?"#define USE_LIGHTMAP":"",g.aoMap?"#define USE_AOMAP":"",g.bumpMap?"#define USE_BUMPMAP":"",g.normalMap?"#define USE_NORMALMAP":"",g.specularMap?"#define USE_SPECULARMAP":"",g.alphaMap?"#define USE_ALPHAMAP":
+"",g.vertexColors?"#define USE_COLOR":"",g.flatShading?"#define FLAT_SHADED":"",g.skinning?"#define USE_SKINNING":"",g.useVertexTexture?"#define BONE_TEXTURE":"",g.morphTargets?"#define USE_MORPHTARGETS":"",g.morphNormals?"#define USE_MORPHNORMALS":"",g.doubleSided?"#define DOUBLE_SIDED":"",g.flipSided?"#define FLIP_SIDED":"",g.shadowMapEnabled?"#define USE_SHADOWMAP":"",g.shadowMapEnabled?"#define "+n:"",g.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",g.shadowMapCascade?"#define SHADOWMAP_CASCADE":
+"",g.sizeAttenuation?"#define USE_SIZEATTENUATION":"",g.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",g.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif",
+"#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING",
+"\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(b).join("\n"),d=[g.bumpMap||g.normalMap||g.flatShading||f.derivatives?"#extension GL_OES_standard_derivatives : enable":"","precision "+g.precision+" float;","precision "+g.precision+" int;",x,"#define MAX_DIR_LIGHTS "+g.maxDirLights,"#define MAX_POINT_LIGHTS "+g.maxPointLights,"#define MAX_SPOT_LIGHTS "+g.maxSpotLights,"#define MAX_HEMI_LIGHTS "+g.maxHemiLights,"#define MAX_SHADOWS "+g.maxShadows,g.alphaTest?"#define ALPHATEST "+
+g.alphaTest:"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+u,g.useFog&&g.fog?"#define USE_FOG":"",g.useFog&&g.fogExp?"#define FOG_EXP2":"",g.map?"#define USE_MAP":"",g.envMap?"#define USE_ENVMAP":"",g.envMap?"#define "+r:"",g.envMap?"#define "+t:"",g.envMap?"#define "+s:"",g.lightMap?"#define USE_LIGHTMAP":"",g.aoMap?"#define USE_AOMAP":"",g.bumpMap?"#define USE_BUMPMAP":"",g.normalMap?"#define USE_NORMALMAP":"",g.specularMap?"#define USE_SPECULARMAP":
+"",g.alphaMap?"#define USE_ALPHAMAP":"",g.vertexColors?"#define USE_COLOR":"",g.flatShading?"#define FLAT_SHADED":"",g.metal?"#define METAL":"",g.doubleSided?"#define DOUBLE_SIDED":"",g.flipSided?"#define FLIP_SIDED":"",g.shadowMapEnabled?"#define USE_SHADOWMAP":"",g.shadowMapEnabled?"#define "+n:"",g.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",g.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",g.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",g.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?
+"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(b).join("\n"));m=d+m;l=new THREE.WebGLShader(h,h.VERTEX_SHADER,k+l);m=new THREE.WebGLShader(h,h.FRAGMENT_SHADER,m);h.attachShader(w,l);h.attachShader(w,m);void 0!==p&&h.bindAttribLocation(w,0,p);h.linkProgram(w);p=h.getProgramInfoLog(w);k=h.getShaderInfoLog(l);d=h.getShaderInfoLog(m);!1===h.getProgramParameter(w,h.LINK_STATUS)&&console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",
+h.getProgramParameter(w,h.VALIDATE_STATUS),"gl.getProgramInfoLog",p,k,d);""!==p&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",p);h.deleteShader(l);h.deleteShader(m);var A=function(){return this._cachedUniforms};this.getUniforms=function(){for(var a={},b=h.getProgramParameter(w,h.ACTIVE_UNIFORMS),c=0;c<b;c++){var d=h.getActiveUniform(w,c).name,e=h.getUniformLocation(w,d),f=d.lastIndexOf("[0]");-1!==f&&f===d.length-3&&(a[d.substr(0,f)]=e);a[d]=e}this._cachedUniforms=a;this.getUniforms=
+A;return a};var y=function(){return this._cachedAttributes};this.getAttributes=function(){for(var a={},b=h.getProgramParameter(w,h.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=h.getActiveAttrib(w,c).name;a[d]=h.getAttribLocation(w,d)}this._cachedAttributes=a;this.getAttributes=y;return a};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");
+return this.getAttributes()}}});this.id=c++;this.code=e;this.usedTimes=1;this.program=w;this.vertexShader=l;this.fragmentShader=m;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){var e=b.createShader(c);b.shaderSource(e,d);b.compileShader(e);!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(e)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",c===b.VERTEX_SHADER?"vertex":"fragment",b.getShaderInfoLog(e),a(d));return e}}();
-THREE.WebGLShadowMap=function(a,b,c){function d(a,b){if(!0===a.visible){var e=c.objects[a.id];e&&a.castShadow&&(!1===a.frustumCulled||!0===f.intersectsObject(a))&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),p.push(e));for(var e=0,g=a.children.length;e<g;e++)d(a.children[e],b)}}var e=a.context,f=new THREE.Frustum,g=new THREE.Matrix4,h=new THREE.Vector3,k=new THREE.Vector3,l=c.objectsImmediate,n=new THREE.Vector3,p=[],m=THREE.ShaderLib.depthRGBA,q=THREE.UniformsUtils.clone(m.uniforms),
-t=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}),s=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0}),u=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,skinning:!0}),w=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0,skinning:!0});t._shadowPass=!0;s._shadowPass=!0;u._shadowPass=
-!0;w._shadowPass=!0;var x=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=this.debug=!1;this.render=function(c,m){if(!1!==x.enabled){var q,I,v,E,L,C,F,R=[];E=0;e.clearColor(1,1,1,1);e.disable(e.BLEND);e.enable(e.CULL_FACE);e.frontFace(e.CCW);x.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);a.state.setDepthTest(!0);q=0;for(I=b.length;q<I;q++)if(v=b[q],v.castShadow)if(v instanceof THREE.DirectionalLight&&v.shadowCascade)for(L=0;L<
-v.shadowCascadeCount;L++){var J;if(v.shadowCascadeArray[L])J=v.shadowCascadeArray[L];else{var z=v;F=L;J=new THREE.DirectionalLight;J.isVirtual=!0;J.onlyShadow=!0;J.castShadow=!0;J.shadowCameraNear=z.shadowCameraNear;J.shadowCameraFar=z.shadowCameraFar;J.shadowCameraLeft=z.shadowCameraLeft;J.shadowCameraRight=z.shadowCameraRight;J.shadowCameraBottom=z.shadowCameraBottom;J.shadowCameraTop=z.shadowCameraTop;J.shadowCameraVisible=z.shadowCameraVisible;J.shadowDarkness=z.shadowDarkness;J.shadowBias=z.shadowCascadeBias[F];
-J.shadowMapWidth=z.shadowCascadeWidth[F];J.shadowMapHeight=z.shadowCascadeHeight[F];J.pointsWorld=[];J.pointsFrustum=[];var G=J.pointsWorld;C=J.pointsFrustum;for(var B=0;8>B;B++)G[B]=new THREE.Vector3,C[B]=new THREE.Vector3;G=z.shadowCascadeNearZ[F];z=z.shadowCascadeFarZ[F];C[0].set(-1,-1,G);C[1].set(1,-1,G);C[2].set(-1,1,G);C[3].set(1,1,G);C[4].set(-1,-1,z);C[5].set(1,-1,z);C[6].set(-1,1,z);C[7].set(1,1,z);J.originalCamera=m;C=new THREE.Gyroscope;C.position.copy(v.shadowCascadeOffset);C.add(J);C.add(J.target);
-m.add(C);v.shadowCascadeArray[L]=J}F=v;G=L;z=F.shadowCascadeArray[G];z.position.copy(F.position);z.target.position.copy(F.target.position);z.lookAt(z.target);z.shadowCameraVisible=F.shadowCameraVisible;z.shadowDarkness=F.shadowDarkness;z.shadowBias=F.shadowCascadeBias[G];C=F.shadowCascadeNearZ[G];F=F.shadowCascadeFarZ[G];z=z.pointsFrustum;z[0].z=C;z[1].z=C;z[2].z=C;z[3].z=C;z[4].z=F;z[5].z=F;z[6].z=F;z[7].z=F;R[E]=J;E++}else R[E]=v,E++;q=0;for(I=R.length;q<I;q++){v=R[q];v.shadowMap||(L=THREE.LinearFilter,
-x.type===THREE.PCFSoftShadowMap&&(L=THREE.NearestFilter),v.shadowMap=new THREE.WebGLRenderTarget(v.shadowMapWidth,v.shadowMapHeight,{minFilter:L,magFilter:L,format:THREE.RGBAFormat}),v.shadowMapSize=new THREE.Vector2(v.shadowMapWidth,v.shadowMapHeight),v.shadowMatrix=new THREE.Matrix4);if(!v.shadowCamera){if(v instanceof THREE.SpotLight)v.shadowCamera=new THREE.PerspectiveCamera(v.shadowCameraFov,v.shadowMapWidth/v.shadowMapHeight,v.shadowCameraNear,v.shadowCameraFar);else if(v instanceof THREE.DirectionalLight)v.shadowCamera=
-new THREE.OrthographicCamera(v.shadowCameraLeft,v.shadowCameraRight,v.shadowCameraTop,v.shadowCameraBottom,v.shadowCameraNear,v.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",v);continue}c.add(v.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}v.shadowCameraVisible&&!v.cameraHelper&&(v.cameraHelper=new THREE.CameraHelper(v.shadowCamera),c.add(v.cameraHelper));if(v.isVirtual&&J.originalCamera==m){L=m;E=v.shadowCamera;C=v.pointsFrustum;z=v.pointsWorld;
-h.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(F=0;8>F;F++)G=z[F],G.copy(C[F]),G.unproject(L),G.applyMatrix4(E.matrixWorldInverse),G.x<h.x&&(h.x=G.x),G.x>k.x&&(k.x=G.x),G.y<h.y&&(h.y=G.y),G.y>k.y&&(k.y=G.y),G.z<h.z&&(h.z=G.z),G.z>k.z&&(k.z=G.z);E.left=h.x;E.right=k.x;E.top=k.y;E.bottom=h.y;E.updateProjectionMatrix()}E=v.shadowMap;C=v.shadowMatrix;L=v.shadowCamera;L.position.setFromMatrixPosition(v.matrixWorld);n.setFromMatrixPosition(v.target.matrixWorld);L.lookAt(n);L.updateMatrixWorld();
-L.matrixWorldInverse.getInverse(L.matrixWorld);v.cameraHelper&&(v.cameraHelper.visible=v.shadowCameraVisible);v.shadowCameraVisible&&v.cameraHelper.update();C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);C.multiply(L.projectionMatrix);C.multiply(L.matrixWorldInverse);g.multiplyMatrices(L.projectionMatrix,L.matrixWorldInverse);f.setFromMatrix(g);a.setRenderTarget(E);a.clear();p.length=0;d(c,L);v=0;for(E=p.length;v<E;v++)C=p[v],C=C.object,z=C.material instanceof THREE.MeshFaceMaterial?C.material.materials[0]:
-C.material,F=void 0!==C.geometry.morphTargets&&0<C.geometry.morphTargets.length&&z.morphTargets,G=C instanceof THREE.SkinnedMesh&&z.skinning,F=C.customDepthMaterial?C.customDepthMaterial:G?F?w:u:F?s:t,a.setMaterialFaces(z),a.renderBufferDirect(L,b,null,F,C);v=0;for(E=l.length;v<E;v++)C=l[v],C=C.object,C.visible&&C.castShadow&&(C._modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,C.matrixWorld),a.renderImmediateObject(L,b,null,t,C))}q=a.getClearColor();I=a.getClearAlpha();e.clearColor(q.r,q.g,
-q.b,I);e.enable(e.BLEND);x.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState()}}};
-THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),f=null,g=null,h=null,k=null,l=null,n=null,p=null,m=null,q=null,t=null,s=null,u=null,w=null,x=null,A=null,y=null,D=null,I=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),v=void 0,E={};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&
-(a.disableVertexAttribArray(b),e[b]=0)};this.setBlending=function(c,d,e,m,q,s,t){c!==f&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===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)),f=c);if(c===THREE.CustomBlending){q=q||d;s=s||e;t=t||m;if(d!==g||q!==l)a.blendEquationSeparate(b(d),b(q)),g=d,l=q;if(e!==h||m!==k||s!==n||t!==p)a.blendFuncSeparate(b(e),b(m),b(s),b(t)),h=e,k=m,n=s,p=t}else p=n=l=k=h=g=null};this.setDepthFunc=function(b){if(m!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);
-break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);m=b}};this.setDepthTest=function(b){q!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),q=b)};this.setDepthWrite=function(b){t!==
-b&&(a.depthMask(b),t=b)};this.setColorWrite=function(b){s!==b&&(a.colorMask(b,b,b,b),s=b)};this.setDoubleSided=function(b){u!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),u=b)};this.setFlipSided=function(b){w!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),w=b)};this.setLineWidth=function(b){b!==x&&(a.lineWidth(b),x=b)};this.setPolygonOffset=function(b,c,d){A!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),A=b);!b||y===c&&D===d||(a.polygonOffset(c,d),y=c,D=d)};this.activeTexture=
-function(b){void 0===b&&(b=a.TEXTURE0+I-1);v!==b&&(a.activeTexture(b),v=b)};this.bindTexture=function(b,d){void 0===v&&c.activeTexture();var e=E[v];void 0===e&&(e={type:void 0,texture:void 0},E[v]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=
-0;b<e.length;b++)1===e[b]&&(a.disableVertexAttribArray(b),e[b]=0);w=u=s=t=q=f=null}};
-THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,l,n,p,m=a.context,q,t,s,u,w,x;this.render=function(A,y,D,I){if(0!==b.length){A=new THREE.Vector3;var v=I/D,E=.5*D,L=.5*I,C=16/I,F=new THREE.Vector2(C*v,C),R=new THREE.Vector3(1,1,0),J=new THREE.Vector2(1,1);if(void 0===s){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),z=new Uint16Array([0,1,2,0,2,3]);q=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,q);m.bufferData(m.ARRAY_BUFFER,C,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
-t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,z,m.STATIC_DRAW);w=m.createTexture();x=m.createTexture();a.state.bindTexture(m.TEXTURE_2D,w);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);a.state.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 C=(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.WebGLShadowMap=function(a,b,c){function d(a,b){if(!0===a.visible){var e=c.objects[a.id];e&&a.castShadow&&(!1===a.frustumCulled||!0===f.intersectsObject(a))&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),p.push(e));for(var e=0,g=a.children.length;e<g;e++)d(a.children[e],b)}}var e=a.context,f=new THREE.Frustum,g=new THREE.Matrix4,h=new THREE.Vector3,k=new THREE.Vector3,l=c.objectsImmediate,m=new THREE.Vector3,p=[],n=THREE.ShaderLib.depthRGBA,r=THREE.UniformsUtils.clone(n.uniforms),
+t=new THREE.ShaderMaterial({uniforms:r,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}),s=new THREE.ShaderMaterial({uniforms:r,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,morphTargets:!0}),u=new THREE.ShaderMaterial({uniforms:r,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,skinning:!0}),x=new THREE.ShaderMaterial({uniforms:r,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,morphTargets:!0,skinning:!0});t._shadowPass=!0;s._shadowPass=!0;u._shadowPass=
+!0;x._shadowPass=!0;var w=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=this.debug=!1;this.render=function(c,n){if(!1!==w.enabled){var r,I,v,D,L,C,E,R=[];D=0;e.clearColor(1,1,1,1);e.disable(e.BLEND);e.enable(e.CULL_FACE);e.frontFace(e.CCW);w.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);a.state.setDepthTest(!0);r=0;for(I=b.length;r<I;r++)if(v=b[r],v.castShadow)if(v instanceof THREE.DirectionalLight&&v.shadowCascade)for(L=0;L<
+v.shadowCascadeCount;L++){var J;if(v.shadowCascadeArray[L])J=v.shadowCascadeArray[L];else{var z=v;E=L;J=new THREE.DirectionalLight;J.isVirtual=!0;J.onlyShadow=!0;J.castShadow=!0;J.shadowCameraNear=z.shadowCameraNear;J.shadowCameraFar=z.shadowCameraFar;J.shadowCameraLeft=z.shadowCameraLeft;J.shadowCameraRight=z.shadowCameraRight;J.shadowCameraBottom=z.shadowCameraBottom;J.shadowCameraTop=z.shadowCameraTop;J.shadowCameraVisible=z.shadowCameraVisible;J.shadowDarkness=z.shadowDarkness;J.shadowBias=z.shadowCascadeBias[E];
+J.shadowMapWidth=z.shadowCascadeWidth[E];J.shadowMapHeight=z.shadowCascadeHeight[E];J.pointsWorld=[];J.pointsFrustum=[];var F=J.pointsWorld;C=J.pointsFrustum;for(var B=0;8>B;B++)F[B]=new THREE.Vector3,C[B]=new THREE.Vector3;F=z.shadowCascadeNearZ[E];z=z.shadowCascadeFarZ[E];C[0].set(-1,-1,F);C[1].set(1,-1,F);C[2].set(-1,1,F);C[3].set(1,1,F);C[4].set(-1,-1,z);C[5].set(1,-1,z);C[6].set(-1,1,z);C[7].set(1,1,z);J.originalCamera=n;C=new THREE.Gyroscope;C.position.copy(v.shadowCascadeOffset);C.add(J);C.add(J.target);
+n.add(C);v.shadowCascadeArray[L]=J}E=v;F=L;z=E.shadowCascadeArray[F];z.position.copy(E.position);z.target.position.copy(E.target.position);z.lookAt(z.target);z.shadowCameraVisible=E.shadowCameraVisible;z.shadowDarkness=E.shadowDarkness;z.shadowBias=E.shadowCascadeBias[F];C=E.shadowCascadeNearZ[F];E=E.shadowCascadeFarZ[F];z=z.pointsFrustum;z[0].z=C;z[1].z=C;z[2].z=C;z[3].z=C;z[4].z=E;z[5].z=E;z[6].z=E;z[7].z=E;R[D]=J;D++}else R[D]=v,D++;r=0;for(I=R.length;r<I;r++){v=R[r];v.shadowMap||(L=THREE.LinearFilter,
+w.type===THREE.PCFSoftShadowMap&&(L=THREE.NearestFilter),v.shadowMap=new THREE.WebGLRenderTarget(v.shadowMapWidth,v.shadowMapHeight,{minFilter:L,magFilter:L,format:THREE.RGBAFormat}),v.shadowMapSize=new THREE.Vector2(v.shadowMapWidth,v.shadowMapHeight),v.shadowMatrix=new THREE.Matrix4);if(!v.shadowCamera){if(v instanceof THREE.SpotLight)v.shadowCamera=new THREE.PerspectiveCamera(v.shadowCameraFov,v.shadowMapWidth/v.shadowMapHeight,v.shadowCameraNear,v.shadowCameraFar);else if(v instanceof THREE.DirectionalLight)v.shadowCamera=
+new THREE.OrthographicCamera(v.shadowCameraLeft,v.shadowCameraRight,v.shadowCameraTop,v.shadowCameraBottom,v.shadowCameraNear,v.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",v);continue}c.add(v.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}v.shadowCameraVisible&&!v.cameraHelper&&(v.cameraHelper=new THREE.CameraHelper(v.shadowCamera),c.add(v.cameraHelper));if(v.isVirtual&&J.originalCamera==n){L=n;D=v.shadowCamera;C=v.pointsFrustum;z=v.pointsWorld;
+h.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(E=0;8>E;E++)F=z[E],F.copy(C[E]),F.unproject(L),F.applyMatrix4(D.matrixWorldInverse),F.x<h.x&&(h.x=F.x),F.x>k.x&&(k.x=F.x),F.y<h.y&&(h.y=F.y),F.y>k.y&&(k.y=F.y),F.z<h.z&&(h.z=F.z),F.z>k.z&&(k.z=F.z);D.left=h.x;D.right=k.x;D.top=k.y;D.bottom=h.y;D.updateProjectionMatrix()}D=v.shadowMap;C=v.shadowMatrix;L=v.shadowCamera;L.position.setFromMatrixPosition(v.matrixWorld);m.setFromMatrixPosition(v.target.matrixWorld);L.lookAt(m);L.updateMatrixWorld();
+L.matrixWorldInverse.getInverse(L.matrixWorld);v.cameraHelper&&(v.cameraHelper.visible=v.shadowCameraVisible);v.shadowCameraVisible&&v.cameraHelper.update();C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);C.multiply(L.projectionMatrix);C.multiply(L.matrixWorldInverse);g.multiplyMatrices(L.projectionMatrix,L.matrixWorldInverse);f.setFromMatrix(g);a.setRenderTarget(D);a.clear();p.length=0;d(c,L);v=0;for(D=p.length;v<D;v++)C=p[v],C=C.object,z=C.material instanceof THREE.MeshFaceMaterial?C.material.materials[0]:
+C.material,E=void 0!==C.geometry.morphTargets&&0<C.geometry.morphTargets.length&&z.morphTargets,F=C instanceof THREE.SkinnedMesh&&z.skinning,E=C.customDepthMaterial?C.customDepthMaterial:F?E?x:u:E?s:t,a.setMaterialFaces(z),a.renderBufferDirect(L,b,null,E,C);v=0;for(D=l.length;v<D;v++)C=l[v],C=C.object,C.visible&&C.castShadow&&(C._modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,C.matrixWorld),a.renderImmediateObject(L,b,null,t,C))}r=a.getClearColor();I=a.getClearAlpha();e.clearColor(r.r,r.g,
+r.b,I);e.enable(e.BLEND);w.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState()}}};
+THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),f=null,g=null,h=null,k=null,l=null,m=null,p=null,n=null,r=null,t=null,s=null,u=null,x=null,w=null,A=null,y=null,G=null,I=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),v=void 0,D={};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&
+(a.disableVertexAttribArray(b),e[b]=0)};this.setBlending=function(c,d,e,n,r,s,t){c!==f&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===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)),f=c);if(c===THREE.CustomBlending){r=r||d;s=s||e;t=t||n;if(d!==g||r!==l)a.blendEquationSeparate(b(d),b(r)),g=d,l=r;if(e!==h||n!==k||s!==m||t!==p)a.blendFuncSeparate(b(e),b(n),b(s),b(t)),h=e,k=n,m=s,p=t}else p=m=l=k=h=g=null};this.setDepthFunc=function(b){if(n!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);
+break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);n=b}};this.setDepthTest=function(b){r!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),r=b)};this.setDepthWrite=function(b){t!==
+b&&(a.depthMask(b),t=b)};this.setColorWrite=function(b){s!==b&&(a.colorMask(b,b,b,b),s=b)};this.setDoubleSided=function(b){u!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),u=b)};this.setFlipSided=function(b){x!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),x=b)};this.setLineWidth=function(b){b!==w&&(a.lineWidth(b),w=b)};this.setPolygonOffset=function(b,c,d){A!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),A=b);!b||y===c&&G===d||(a.polygonOffset(c,d),y=c,G=d)};this.activeTexture=
+function(b){void 0===b&&(b=a.TEXTURE0+I-1);v!==b&&(a.activeTexture(b),v=b)};this.bindTexture=function(b,d){void 0===v&&c.activeTexture();var e=D[v];void 0===e&&(e={type:void 0,texture:void 0},D[v]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=
+0;b<e.length;b++)1===e[b]&&(a.disableVertexAttribArray(b),e[b]=0);x=u=s=t=r=f=null}};
+THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,l,m,p,n=a.context,r,t,s,u,x,w;this.render=function(A,y,G,I){if(0!==b.length){A=new THREE.Vector3;var v=I/G,D=.5*G,L=.5*I,C=16/I,E=new THREE.Vector2(C*v,C),R=new THREE.Vector3(1,1,0),J=new THREE.Vector2(1,1);if(void 0===s){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),z=new Uint16Array([0,1,2,0,2,3]);r=n.createBuffer();t=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,r);n.bufferData(n.ARRAY_BUFFER,C,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
+t);n.bufferData(n.ELEMENT_ARRAY_BUFFER,z,n.STATIC_DRAW);x=n.createTexture();w=n.createTexture();a.state.bindTexture(n.TEXTURE_2D,x);n.texImage2D(n.TEXTURE_2D,0,n.RGB,16,16,0,n.RGB,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);a.state.bindTexture(n.TEXTURE_2D,w);n.texImage2D(n.TEXTURE_2D,
+0,n.RGBA,16,16,0,n.RGBA,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);var C=(u=0<n.getParameter(n.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}"},
-z=m.createProgram(),G=m.createShader(m.FRAGMENT_SHADER),B=m.createShader(m.VERTEX_SHADER),T="precision "+a.getPrecision()+" float;\n";m.shaderSource(G,T+C.fragmentShader);m.shaderSource(B,T+C.vertexShader);m.compileShader(G);m.compileShader(B);m.attachShader(z,G);m.attachShader(z,B);m.linkProgram(z);s=z;n=m.getAttribLocation(s,"position");p=m.getAttribLocation(s,"uv");c=m.getUniformLocation(s,"renderType");d=m.getUniformLocation(s,"map");e=m.getUniformLocation(s,"occlusionMap");f=m.getUniformLocation(s,
-"opacity");g=m.getUniformLocation(s,"color");h=m.getUniformLocation(s,"scale");k=m.getUniformLocation(s,"rotation");l=m.getUniformLocation(s,"screenPosition")}m.useProgram(s);a.state.initAttributes();a.state.enableAttribute(n);a.state.enableAttribute(p);a.state.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,q);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);m.disable(m.CULL_FACE);
-m.depthMask(!1);z=0;for(G=b.length;z<G;z++)if(C=16/I,F.set(C*v,C),B=b[z],A.set(B.matrixWorld.elements[12],B.matrixWorld.elements[13],B.matrixWorld.elements[14]),A.applyMatrix4(y.matrixWorldInverse),A.applyProjection(y.projectionMatrix),R.copy(A),J.x=R.x*E+E,J.y=R.y*L+L,u||0<J.x&&J.x<D&&0<J.y&&J.y<I){a.state.activeTexture(m.TEXTURE1);a.state.bindTexture(m.TEXTURE_2D,w);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,J.x-8,J.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,F.x,F.y);m.uniform3f(l,R.x,R.y,R.z);m.disable(m.BLEND);
-m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);a.state.activeTexture(m.TEXTURE0);a.state.bindTexture(m.TEXTURE_2D,x);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,J.x-8,J.y-8,16,16,0);m.uniform1i(c,1);m.disable(m.DEPTH_TEST);a.state.activeTexture(m.TEXTURE1);a.state.bindTexture(m.TEXTURE_2D,w);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);B.positionScreen.copy(R);B.customUpdateCallback?B.customUpdateCallback(B):B.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var T=
-0,O=B.lensFlares.length;T<O;T++){var S=B.lensFlares[T];.001<S.opacity&&.001<S.scale&&(R.x=S.x,R.y=S.y,R.z=S.z,C=S.size*S.scale/I,F.x=C*v,F.y=C,m.uniform3f(l,R.x,R.y,R.z),m.uniform2f(h,F.x,F.y),m.uniform1f(k,S.rotation),m.uniform1f(f,S.opacity),m.uniform3f(g,S.color.r,S.color.g,S.color.b),a.state.setBlending(S.blending,S.blendEquation,S.blendSrc,S.blendDst),a.setTexture(S.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.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,l,n,p,m,q,t,s,u,w,x;function A(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var y=a.context,D,I,v,E,L=new THREE.Vector3,C=new THREE.Quaternion,F=new THREE.Vector3;this.render=function(R,J){if(0!==b.length){if(void 0===v){var z=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),G=new Uint16Array([0,1,2,0,2,3]);D=y.createBuffer();I=y.createBuffer();y.bindBuffer(y.ARRAY_BUFFER,D);y.bufferData(y.ARRAY_BUFFER,z,y.STATIC_DRAW);y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,
-I);y.bufferData(y.ELEMENT_ARRAY_BUFFER,G,y.STATIC_DRAW);var z=y.createProgram(),G=y.createShader(y.VERTEX_SHADER),B=y.createShader(y.FRAGMENT_SHADER);y.shaderSource(G,["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"));
+z=n.createProgram(),F=n.createShader(n.FRAGMENT_SHADER),B=n.createShader(n.VERTEX_SHADER),T="precision "+a.getPrecision()+" float;\n";n.shaderSource(F,T+C.fragmentShader);n.shaderSource(B,T+C.vertexShader);n.compileShader(F);n.compileShader(B);n.attachShader(z,F);n.attachShader(z,B);n.linkProgram(z);s=z;m=n.getAttribLocation(s,"position");p=n.getAttribLocation(s,"uv");c=n.getUniformLocation(s,"renderType");d=n.getUniformLocation(s,"map");e=n.getUniformLocation(s,"occlusionMap");f=n.getUniformLocation(s,
+"opacity");g=n.getUniformLocation(s,"color");h=n.getUniformLocation(s,"scale");k=n.getUniformLocation(s,"rotation");l=n.getUniformLocation(s,"screenPosition")}n.useProgram(s);a.state.initAttributes();a.state.enableAttribute(m);a.state.enableAttribute(p);a.state.disableUnusedAttributes();n.uniform1i(e,0);n.uniform1i(d,1);n.bindBuffer(n.ARRAY_BUFFER,r);n.vertexAttribPointer(m,2,n.FLOAT,!1,16,0);n.vertexAttribPointer(p,2,n.FLOAT,!1,16,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t);n.disable(n.CULL_FACE);
+n.depthMask(!1);z=0;for(F=b.length;z<F;z++)if(C=16/I,E.set(C*v,C),B=b[z],A.set(B.matrixWorld.elements[12],B.matrixWorld.elements[13],B.matrixWorld.elements[14]),A.applyMatrix4(y.matrixWorldInverse),A.applyProjection(y.projectionMatrix),R.copy(A),J.x=R.x*D+D,J.y=R.y*L+L,u||0<J.x&&J.x<G&&0<J.y&&J.y<I){a.state.activeTexture(n.TEXTURE1);a.state.bindTexture(n.TEXTURE_2D,x);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGB,J.x-8,J.y-8,16,16,0);n.uniform1i(c,0);n.uniform2f(h,E.x,E.y);n.uniform3f(l,R.x,R.y,R.z);n.disable(n.BLEND);
+n.enable(n.DEPTH_TEST);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);a.state.activeTexture(n.TEXTURE0);a.state.bindTexture(n.TEXTURE_2D,w);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,J.x-8,J.y-8,16,16,0);n.uniform1i(c,1);n.disable(n.DEPTH_TEST);a.state.activeTexture(n.TEXTURE1);a.state.bindTexture(n.TEXTURE_2D,x);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);B.positionScreen.copy(R);B.customUpdateCallback?B.customUpdateCallback(B):B.updateLensFlares();n.uniform1i(c,2);n.enable(n.BLEND);for(var T=
+0,O=B.lensFlares.length;T<O;T++){var S=B.lensFlares[T];.001<S.opacity&&.001<S.scale&&(R.x=S.x,R.y=S.y,R.z=S.z,C=S.size*S.scale/I,E.x=C*v,E.y=C,n.uniform3f(l,R.x,R.y,R.z),n.uniform2f(h,E.x,E.y),n.uniform1f(k,S.rotation),n.uniform1f(f,S.opacity),n.uniform3f(g,S.color.r,S.color.g,S.color.b),a.state.setBlending(S.blending,S.blendEquation,S.blendSrc,S.blendDst),a.setTexture(S.texture,1),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0))}}n.enable(n.CULL_FACE);n.enable(n.DEPTH_TEST);n.depthMask(!0);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,l,m,p,n,r,t,s,u,x,w;function A(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var y=a.context,G,I,v,D,L=new THREE.Vector3,C=new THREE.Quaternion,E=new THREE.Vector3;this.render=function(R,J){if(0!==b.length){if(void 0===v){var z=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),F=new Uint16Array([0,1,2,0,2,3]);G=y.createBuffer();I=y.createBuffer();y.bindBuffer(y.ARRAY_BUFFER,G);y.bufferData(y.ARRAY_BUFFER,z,y.STATIC_DRAW);y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,
+I);y.bufferData(y.ELEMENT_ARRAY_BUFFER,F,y.STATIC_DRAW);var z=y.createProgram(),F=y.createShader(y.VERTEX_SHADER),B=y.createShader(y.FRAGMENT_SHADER);y.shaderSource(F,["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"));
 y.shaderSource(B,["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;\nfogFactor = 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"));
-y.compileShader(G);y.compileShader(B);y.attachShader(z,G);y.attachShader(z,B);y.linkProgram(z);v=z;w=y.getAttribLocation(v,"position");x=y.getAttribLocation(v,"uv");c=y.getUniformLocation(v,"uvOffset");d=y.getUniformLocation(v,"uvScale");e=y.getUniformLocation(v,"rotation");f=y.getUniformLocation(v,"scale");g=y.getUniformLocation(v,"color");h=y.getUniformLocation(v,"map");k=y.getUniformLocation(v,"opacity");l=y.getUniformLocation(v,"modelViewMatrix");n=y.getUniformLocation(v,"projectionMatrix");p=
-y.getUniformLocation(v,"fogType");m=y.getUniformLocation(v,"fogDensity");q=y.getUniformLocation(v,"fogNear");t=y.getUniformLocation(v,"fogFar");s=y.getUniformLocation(v,"fogColor");u=y.getUniformLocation(v,"alphaTest");z=document.createElement("canvas");z.width=8;z.height=8;G=z.getContext("2d");G.fillStyle="white";G.fillRect(0,0,8,8);E=new THREE.Texture(z);E.needsUpdate=!0}y.useProgram(v);a.state.initAttributes();a.state.enableAttribute(w);a.state.enableAttribute(x);a.state.disableUnusedAttributes();
-y.disable(y.CULL_FACE);y.enable(y.BLEND);y.bindBuffer(y.ARRAY_BUFFER,D);y.vertexAttribPointer(w,2,y.FLOAT,!1,16,0);y.vertexAttribPointer(x,2,y.FLOAT,!1,16,8);y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,I);y.uniformMatrix4fv(n,!1,J.projectionMatrix.elements);a.state.activeTexture(y.TEXTURE0);y.uniform1i(h,0);G=z=0;(B=R.fog)?(y.uniform3f(s,B.color.r,B.color.g,B.color.b),B instanceof THREE.Fog?(y.uniform1f(q,B.near),y.uniform1f(t,B.far),y.uniform1i(p,1),G=z=1):B instanceof THREE.FogExp2&&(y.uniform1f(m,B.density),
-y.uniform1i(p,2),G=z=2)):(y.uniform1i(p,0),G=z=0);for(var B=0,T=b.length;B<T;B++){var O=b[B];O._modelViewMatrix.multiplyMatrices(J.matrixWorldInverse,O.matrixWorld);O.z=-O._modelViewMatrix.elements[14]}b.sort(A);for(var S=[],B=0,T=b.length;B<T;B++){var O=b[B],P=O.material;y.uniform1f(u,P.alphaTest);y.uniformMatrix4fv(l,!1,O._modelViewMatrix.elements);O.matrixWorld.decompose(L,C,F);S[0]=F.x;S[1]=F.y;O=0;R.fog&&P.fog&&(O=G);z!==O&&(y.uniform1i(p,O),z=O);null!==P.map?(y.uniform2f(c,P.map.offset.x,P.map.offset.y),
-y.uniform2f(d,P.map.repeat.x,P.map.repeat.y)):(y.uniform2f(c,0,0),y.uniform2f(d,1,1));y.uniform1f(k,P.opacity);y.uniform3f(g,P.color.r,P.color.g,P.color.b);y.uniform1f(e,P.rotation);y.uniform2fv(f,S);a.state.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst);a.state.setDepthTest(P.depthTest);a.state.setDepthWrite(P.depthWrite);P.map&&P.map.image&&P.map.image.width?a.setTexture(P.map,0):a.setTexture(E,0);y.drawElements(y.TRIANGLES,6,y.UNSIGNED_SHORT,0)}y.enable(y.CULL_FACE);a.resetGLState()}}};
+y.compileShader(F);y.compileShader(B);y.attachShader(z,F);y.attachShader(z,B);y.linkProgram(z);v=z;x=y.getAttribLocation(v,"position");w=y.getAttribLocation(v,"uv");c=y.getUniformLocation(v,"uvOffset");d=y.getUniformLocation(v,"uvScale");e=y.getUniformLocation(v,"rotation");f=y.getUniformLocation(v,"scale");g=y.getUniformLocation(v,"color");h=y.getUniformLocation(v,"map");k=y.getUniformLocation(v,"opacity");l=y.getUniformLocation(v,"modelViewMatrix");m=y.getUniformLocation(v,"projectionMatrix");p=
+y.getUniformLocation(v,"fogType");n=y.getUniformLocation(v,"fogDensity");r=y.getUniformLocation(v,"fogNear");t=y.getUniformLocation(v,"fogFar");s=y.getUniformLocation(v,"fogColor");u=y.getUniformLocation(v,"alphaTest");z=document.createElement("canvas");z.width=8;z.height=8;F=z.getContext("2d");F.fillStyle="white";F.fillRect(0,0,8,8);D=new THREE.Texture(z);D.needsUpdate=!0}y.useProgram(v);a.state.initAttributes();a.state.enableAttribute(x);a.state.enableAttribute(w);a.state.disableUnusedAttributes();
+y.disable(y.CULL_FACE);y.enable(y.BLEND);y.bindBuffer(y.ARRAY_BUFFER,G);y.vertexAttribPointer(x,2,y.FLOAT,!1,16,0);y.vertexAttribPointer(w,2,y.FLOAT,!1,16,8);y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,I);y.uniformMatrix4fv(m,!1,J.projectionMatrix.elements);a.state.activeTexture(y.TEXTURE0);y.uniform1i(h,0);F=z=0;(B=R.fog)?(y.uniform3f(s,B.color.r,B.color.g,B.color.b),B instanceof THREE.Fog?(y.uniform1f(r,B.near),y.uniform1f(t,B.far),y.uniform1i(p,1),F=z=1):B instanceof THREE.FogExp2&&(y.uniform1f(n,B.density),
+y.uniform1i(p,2),F=z=2)):(y.uniform1i(p,0),F=z=0);for(var B=0,T=b.length;B<T;B++){var O=b[B];O._modelViewMatrix.multiplyMatrices(J.matrixWorldInverse,O.matrixWorld);O.z=-O._modelViewMatrix.elements[14]}b.sort(A);for(var S=[],B=0,T=b.length;B<T;B++){var O=b[B],P=O.material;y.uniform1f(u,P.alphaTest);y.uniformMatrix4fv(l,!1,O._modelViewMatrix.elements);O.matrixWorld.decompose(L,C,E);S[0]=E.x;S[1]=E.y;O=0;R.fog&&P.fog&&(O=F);z!==O&&(y.uniform1i(p,O),z=O);null!==P.map?(y.uniform2f(c,P.map.offset.x,P.map.offset.y),
+y.uniform2f(d,P.map.repeat.x,P.map.repeat.y)):(y.uniform2f(c,0,0),y.uniform2f(d,1,1));y.uniform1f(k,P.opacity);y.uniform3f(g,P.color.r,P.color.g,P.color.b);y.uniform1f(e,P.rotation);y.uniform2fv(f,S);a.state.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst);a.state.setDepthTest(P.depthTest);a.state.setDepthWrite(P.depthWrite);P.map&&P.map.image&&P.map.image.width?a.setTexture(P.map,0):a.setTexture(D,0);y.drawElements(y.TRIANGLES,6,y.UNSIGNED_SHORT,0)}y.enable(y.CULL_FACE);a.resetGLState()}}};
 THREE.GeometryUtils={merge:function(a,b,c){console.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){console.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(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.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),l=k.data,n=0;n<d;n++)for(var p=0;p<e;p++){var m=0>p-1?0:p-1,q=p+1>e-1?e-1:p+1,t=0>n-1?0:n-1,s=n+1>d-1?d-1:n+1,u=[],w=[0,0,h[4*(p*d+n)]/255*b];u.push([-1,0,h[4*(p*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+s)]/255*b]);u.push([1,0,h[4*(p*d+s)]/255*b]);u.push([1,1,h[4*(q*d+s)]/255*b]);u.push([0,1,h[4*(q*d+n)]/255*
-b]);u.push([-1,1,h[4*(q*d+t)]/255*b]);m=[];t=u.length;for(q=0;q<t;q++){var s=u[q],x=u[(q+1)%t],s=[s[0]-w[0],s[1]-w[1],s[2]-w[2]],x=[x[0]-w[0],x[1]-w[1],x[2]-w[2]];m.push(c([s[1]*x[2]-s[2]*x[1],s[2]*x[0]-s[0]*x[2],s[0]*x[1]-s[1]*x[0]]))}u=[0,0,0];for(q=0;q<m.length;q++)u[0]+=m[q][0],u[1]+=m[q][1],u[2]+=m[q][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;w=4*(p*d+n);l[w]=(u[0]+1)/2*255|0;l[w+1]=(u[1]+1)/2*255|0;l[w+2]=255*u[2]|0;l[w+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),l=k.data,m=0;m<d;m++)for(var p=0;p<e;p++){var n=0>p-1?0:p-1,r=p+1>e-1?e-1:p+1,t=0>m-1?0:m-1,s=m+1>d-1?d-1:m+1,u=[],x=[0,0,h[4*(p*d+m)]/255*b];u.push([-1,0,h[4*(p*d+t)]/255*b]);u.push([-1,-1,h[4*(n*d+t)]/255*b]);u.push([0,-1,h[4*(n*d+m)]/255*b]);u.push([1,-1,h[4*(n*d+s)]/255*b]);u.push([1,0,h[4*(p*d+s)]/255*b]);u.push([1,1,h[4*(r*d+s)]/255*b]);u.push([0,1,h[4*(r*d+m)]/255*
+b]);u.push([-1,1,h[4*(r*d+t)]/255*b]);n=[];t=u.length;for(r=0;r<t;r++){var s=u[r],w=u[(r+1)%t],s=[s[0]-x[0],s[1]-x[1],s[2]-x[2]],w=[w[0]-x[0],w[1]-x[1],w[2]-x[2]];n.push(c([s[1]*w[2]-s[2]*w[1],s[2]*w[0]-s[0]*w[2],s[0]*w[1]-s[1]*w[0]]))}u=[0,0,0];for(r=0;r<n.length;r++)u[0]+=n[r][0],u[1]+=n[r][1],u[2]+=n[r][2];u[0]/=n.length;u[1]/=n.length;u[2]/=n.length;x=4*(p*d+m);l[x]=(u[0]+1)/2*255|0;l[x+1]=(u[1]+1)/2*255|0;l[x+2]=255*u[2]|0;l[x+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,l,n,p,m,q,t,s,u,w=b.glyphs[a]||b.glyphs["?"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(" ")),l=b.length,a=0;a<l;)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;q=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(q,t,k,n);if(g=f[f.length-1])for(p=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++){var x=g/h;THREE.Shape.Utils.b2(x,p,q,k);THREE.Shape.Utils.b2(x,m,t,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,q=b[a++]*c+d,t=b[a++]*c,s=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(q,t,s,u,k,n),g=f[f.length-1])for(p=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++)x=g/h,THREE.Shape.Utils.b3(x,p,q,s,k),THREE.Shape.Utils.b3(x,
-m,t,u,n)}return{offset:w.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,l,m,p,n,r,t,s,u,x=b.glyphs[a]||b.glyphs["?"];if(x){if(x.o)for(b=x._cachedOutline||(x._cachedOutline=x.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;m=b[a++]*c;e.moveTo(k,m);
+break;case "l":k=b[a++]*c+d;m=b[a++]*c;e.lineTo(k,m);break;case "q":k=b[a++]*c+d;m=b[a++]*c;r=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(r,t,k,m);if(g=f[f.length-1])for(p=g.x,n=g.y,g=1,h=this.divisions;g<=h;g++){var w=g/h;THREE.Shape.Utils.b2(w,p,r,k);THREE.Shape.Utils.b2(w,n,t,m)}break;case "b":if(k=b[a++]*c+d,m=b[a++]*c,r=b[a++]*c+d,t=b[a++]*c,s=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(r,t,s,u,k,m),g=f[f.length-1])for(p=g.x,n=g.y,g=1,h=this.divisions;g<=h;g++)w=g/h,THREE.Shape.Utils.b3(w,p,r,s,k),THREE.Shape.Utils.b3(w,
+n,t,u,m)}return{offset:x.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,l,n;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var m;a:{var q=m=void 0,t=void 0,s=void 0,
-u=void 0,w=void 0,x=void 0,A=void 0,y=void 0,q=a[g[k]].x,t=a[g[k]].y,s=a[g[l]].x,u=a[g[l]].y,w=a[g[n]].x,x=a[g[n]].y;if(1E-10>(s-q)*(x-t)-(u-t)*(w-q))m=!1;else{var D=void 0,I=void 0,v=void 0,E=void 0,L=void 0,C=void 0,F=void 0,R=void 0,J=void 0,z=void 0,J=R=F=y=A=void 0,D=w-s,I=x-u,v=q-w,E=t-x,L=s-q,C=u-t;for(m=0;m<e;m++)if(A=a[g[m]].x,y=a[g[m]].y,!(A===q&&y===t||A===s&&y===u||A===w&&y===x)&&(F=A-q,R=y-t,J=A-s,z=y-u,A-=w,y-=x,J=D*z-I*J,F=L*R-C*F,R=v*y-E*A,-1E-10<=J&&-1E-10<=R&&-1E-10<=F)){m=!1;break a}m=
-!0}}if(m){f.push([a[g[k]],a[g[l]],a[g[n]]]);h.push([g[k],g[l],g[n]]);k=l;for(n=l+1;n<e;k++,n++)g[k]=g[n];e--;p=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.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,l,m;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);m=l+1;e<=m&&(m=0);var n;a:{var r=n=void 0,t=void 0,s=void 0,
+u=void 0,x=void 0,w=void 0,A=void 0,y=void 0,r=a[g[k]].x,t=a[g[k]].y,s=a[g[l]].x,u=a[g[l]].y,x=a[g[m]].x,w=a[g[m]].y;if(1E-10>(s-r)*(w-t)-(u-t)*(x-r))n=!1;else{var G=void 0,I=void 0,v=void 0,D=void 0,L=void 0,C=void 0,E=void 0,R=void 0,J=void 0,z=void 0,J=R=E=y=A=void 0,G=x-s,I=w-u,v=r-x,D=t-w,L=s-r,C=u-t;for(n=0;n<e;n++)if(A=a[g[n]].x,y=a[g[n]].y,!(A===r&&y===t||A===s&&y===u||A===x&&y===w)&&(E=A-r,R=y-t,J=A-s,z=y-u,A-=x,y-=w,J=G*z-I*J,E=L*R-C*E,R=v*y-D*A,-1E-10<=J&&-1E-10<=R&&-1E-10<=E)){n=!1;break a}n=
+!0}}if(n){f.push([a[g[k]],a[g[l]],a[g[m]]]);h.push([g[k],g[l],g[m]]);k=l;for(m=l+1;m<e;k++,m++)g[k]=g[m];e--;p=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.isPlaying=!1};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.autoplay&&b.play()})};c.send();return this};
 THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else{var a=this.context.createBufferSource();a.buffer=this.source.buffer;a.loop=this.source.loop;a.onended=this.source.onended;a.connect(this.panner);a.start(0,this.startTime);this.isPlaying=!0;this.source=a}};THREE.Audio.prototype.pause=function(){this.source.stop();this.startTime=this.context.currentTime};THREE.Audio.prototype.stop=function(){this.source.stop();this.startTime=0};
@@ -657,7 +657,7 @@ THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)
 THREE.Curve.create=function(a,b){a.prototype=Object.create(THREE.Curve.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};THREE.CurvePath=function(){this.curves=[];this.bends=[];this.autoClose=!1};THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype);THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){};
 THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))};THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a<c.length;){if(c[a]>=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]};
 THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;c<d;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a};
-THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,f,g;b=c=Number.NEGATIVE_INFINITY;e=f=Number.POSITIVE_INFINITY;var h,k,l,n,p=a[0]instanceof THREE.Vector3;n=p?new THREE.Vector3:new THREE.Vector2;k=0;for(l=a.length;k<l;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<f&&(f=h.y),p&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),n.add(h);a={minX:e,minY:f,maxX:b,maxY:c};p&&(a.maxZ=d,a.minZ=g);return a};
+THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,f,g;b=c=Number.NEGATIVE_INFINITY;e=f=Number.POSITIVE_INFINITY;var h,k,l,m,p=a[0]instanceof THREE.Vector3;m=p?new THREE.Vector3:new THREE.Vector2;k=0;for(l=a.length;k<l;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<f&&(f=h.y),p&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),m.add(h);a={minX:e,minY:f,maxX:b,maxY:c};p&&(a.maxZ=d,a.minZ=g);return a};
 THREE.CurvePath.prototype.createPointsGeometry=function(a){a=this.getPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createSpacedPointsGeometry=function(a){a=this.getSpacedPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(new THREE.Vector3(a[c].x,a[c].y,a[c].z||0));return b};THREE.CurvePath.prototype.addWrapPath=function(a){this.bends.push(a)};
 THREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c=this.getPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};
 THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),d,e,f,g,h,k;d=0;for(e=a.length;d<e;d++)f=a[d],g=f.x,h=f.y,k=g/c.maxX,k=b.getUtoTmapping(k,g),g=b.getPoint(k),k=b.getTangent(k),k.set(-k.y,k.x).multiplyScalar(h),f.x=g.x+k.x,f.y=g.y+k.y;return a};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype);THREE.Gyroscope.prototype.constructor=THREE.Gyroscope;
@@ -670,22 +670,22 @@ 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,l,n,p,m,q,t,s;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];p=f[0];m=f[1];0<c.length?(g=c[c.length-1],q=g.x,
-t=g.y):(g=this.actions[d-1].args,q=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)s=f/a,g=THREE.Shape.Utils.b2(s,q,p,h),s=THREE.Shape.Utils.b2(s,t,m,k),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];p=f[0];m=f[1];l=f[2];n=f[3];0<c.length?(g=c[c.length-1],q=g.x,t=g.y):(g=this.actions[d-1].args,q=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)s=f/a,g=THREE.Shape.Utils.b3(s,q,p,l,h),s=THREE.Shape.Utils.b3(s,t,m,n,k),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.CSPLINE_THRU:g=
-this.actions[d-1].args;s=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;s=s.concat(f[0]);s=new THREE.SplineCurve(s);for(f=1;f<=g;f++)c.push(s.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];m=f[2];l=f[3];g=f[4];p=!!f[5];q=g-l;t=2*a;for(f=1;f<=t;f++)s=f/t,p||(s=1-s),s=l+s*q,g=h+m*Math.cos(s),s=k+m*Math.sin(s),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],m=f[2],n=f[3],l=f[4],g=f[5],p=!!f[6],q=g-l,t=2*a,f=1;f<=t;f++)s=f/t,p||
-(s=1-s),s=l+s*q,g=h+m*Math.cos(s),s=k+n*Math.sin(s),c.push(new THREE.Vector2(g,s))}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&&
+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,l,m,p,n,r,t,s;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];p=f[0];n=f[1];0<c.length?(g=c[c.length-1],r=g.x,
+t=g.y):(g=this.actions[d-1].args,r=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)s=f/a,g=THREE.Shape.Utils.b2(s,r,p,h),s=THREE.Shape.Utils.b2(s,t,n,k),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];p=f[0];n=f[1];l=f[2];m=f[3];0<c.length?(g=c[c.length-1],r=g.x,t=g.y):(g=this.actions[d-1].args,r=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)s=f/a,g=THREE.Shape.Utils.b3(s,r,p,l,h),s=THREE.Shape.Utils.b3(s,t,n,m,k),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.CSPLINE_THRU:g=
+this.actions[d-1].args;s=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;s=s.concat(f[0]);s=new THREE.SplineCurve(s);for(f=1;f<=g;f++)c.push(s.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];n=f[2];l=f[3];g=f[4];p=!!f[5];r=g-l;t=2*a;for(f=1;f<=t;f++)s=f/t,p||(s=1-s),s=l+s*r,g=h+n*Math.cos(s),s=k+n*Math.sin(s),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],n=f[2],m=f[3],l=f[4],g=f[5],p=!!f[6],r=g-l,t=2*a,f=1;f<=t;f++)s=f/t,p||
+(s=1-s),s=l+s*r,g=h+n*Math.cos(s),s=k+m*Math.sin(s),c.push(new THREE.Vector2(g,s))}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,n=h.y-g.y;if(1E-10<Math.abs(n)){if(0>n&&(g=b[f],k=-k,h=b[e],n=-n),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=n*(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 l=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),
-l=a?!l:l;h=[];var n=[],p=[],m=0,q;n[m]=void 0;p[m]=[];var t,s;t=0;for(s=e.length;t<s;t++)g=e[t],q=g.getPoints(),f=THREE.Shape.Utils.isClockWise(q),(f=a?!f:f)?(!l&&n[m]&&m++,n[m]={s:new THREE.Shape,p:q},n[m].s.actions=g.actions,n[m].s.curves=g.curves,l&&m++,p[m]=[]):p[m].push({h:g,p:q[0]});if(!n[0])return c(e);if(1<n.length){t=!1;s=[];g=0;for(e=n.length;g<e;g++)h[g]=[];g=0;for(e=n.length;g<e;g++)for(f=p[g],l=0;l<f.length;l++){m=f[l];q=!0;for(var u=0;u<n.length;u++)d(m.p,n[u].p)&&(g!==u&&s.push({froms:g,
-tos:u,hole:l}),q?(q=!1,h[u].push(m)):t=!0);q&&h[g].push(m)}0<s.length&&(t||(p=h))}t=0;for(s=n.length;t<s;t++)for(h=n[t].s,k.push(h),g=p[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)};
+l=a?!l:l;h=[];var m=[],p=[],n=0,r;m[n]=void 0;p[n]=[];var t,s;t=0;for(s=e.length;t<s;t++)g=e[t],r=g.getPoints(),f=THREE.Shape.Utils.isClockWise(r),(f=a?!f:f)?(!l&&m[n]&&n++,m[n]={s:new THREE.Shape,p:r},m[n].s.actions=g.actions,m[n].s.curves=g.curves,l&&n++,p[n]=[]):p[n].push({h:g,p:r[0]});if(!m[0])return c(e);if(1<m.length){t=!1;s=[];g=0;for(e=m.length;g<e;g++)h[g]=[];g=0;for(e=m.length;g<e;g++)for(f=p[g],l=0;l<f.length;l++){n=f[l];r=!0;for(var u=0;u<m.length;u++)d(n.p,m[u].p)&&(g!==u&&s.push({froms:g,
+tos:u,hole:l}),r?(r=!1,h[u].push(n)):t=!0);r&&h[g].push(n)}0<s.length&&(t||(p=h))}t=0;for(s=m.length;t<s;t++)for(h=m[t].s,k.push(h),g=p[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,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,v=h*k-g*l,E=h*n-g*p;if(1E-10<Math.abs(v)){if(0<v){if(0>E||E>v)return[];k=l*n-k*p;if(0>k||k>v)return[]}else{if(0<E||E<v)return[];k=l*n-k*p;if(0<k||k<v)return[]}if(0===k)return!f||0!==E&&E!==v?[a]:[];if(k===v)return!f||0!==E&&E!==v?[b]:[];if(0===
-E)return[d];if(E===v)return[e];f=k/v;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==E||l*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;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,v=d.x,l=e,d=e.x):(b=e,v=e.x,l=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,v=d.y,l=e,d=e.y):(b=e,v=e.y,l=d,d=d.y));return k<=v?a<v?[]:a===v?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
-k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}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,l,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++)l=h[f].x+":"+h[f].y,void 0!==n[l]&&console.warn("THREE.Shape: Duplicate point",l),n[l]=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<l.length;e++)for(f=b[l[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,l=[],n,p,I,v,E,L=[],C,F,R,J=0;for(n=b.length;J<n;J++)l.push(J);C=0;for(var z=2*
-l.length;0<l.length;){z--;if(0>z){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=C;p<h.length;p++){I=h[p];n=-1;for(J=0;J<l.length;J++)if(v=l[J],E=I.x+":"+I.y+":"+v,void 0===L[E]){k=b[v];for(F=0;F<k.length;F++)if(v=k[F],c(p,F)&&!f(I,v)&&!g(I,v)){n=F;l.splice(J,1);C=h.slice(0,p+1);v=h.slice(p);F=k.slice(n);R=k.slice(0,n+1);h=C.concat(F).concat(R).concat(v);C=p;break}if(0<=n)break;L[E]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(f,
-!1);f=0;for(g=p.length;f<g;f++)for(k=p[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=n[l],void 0!==l&&(k[h]=l);return p.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-
+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,l=e.y-d.y,m=a.x-d.x,p=a.y-d.y,v=h*k-g*l,D=h*m-g*p;if(1E-10<Math.abs(v)){if(0<v){if(0>D||D>v)return[];k=l*m-k*p;if(0>k||k>v)return[]}else{if(0<D||D<v)return[];k=l*m-k*p;if(0<k||k<v)return[]}if(0===k)return!f||0!==D&&D!==v?[a]:[];if(k===v)return!f||0!==D&&D!==v?[b]:[];if(0===
+D)return[d];if(D===v)return[e];f=k/v;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==D||l*m!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;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,v=d.x,l=e,d=e.x):(b=e,v=e.x,l=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,v=d.y,l=e,d=e.y):(b=e,v=e.y,l=d,d=d.y));return k<=v?a<v?[]:a===v?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
+k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}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,l,m={};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++)l=h[f].x+":"+h[f].y,void 0!==m[l]&&console.warn("THREE.Shape: Duplicate point",l),m[l]=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<l.length;e++)for(f=b[l[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,l=[],m,p,I,v,D,L=[],C,E,R,J=0;for(m=b.length;J<m;J++)l.push(J);C=0;for(var z=2*
+l.length;0<l.length;){z--;if(0>z){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=C;p<h.length;p++){I=h[p];m=-1;for(J=0;J<l.length;J++)if(v=l[J],D=I.x+":"+I.y+":"+v,void 0===L[D]){k=b[v];for(E=0;E<k.length;E++)if(v=k[E],c(p,E)&&!f(I,v)&&!g(I,v)){m=E;l.splice(J,1);C=h.slice(0,p+1);v=h.slice(p);E=k.slice(m);R=k.slice(0,m+1);h=C.concat(E).concat(R).concat(v);C=p;break}if(0<=m)break;L[D]=!0}if(0<=m)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(f,
+!1);f=0;for(g=p.length;f<g;f++)for(k=p[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=m[l],void 0!==l&&(k[h]=l);return p.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;
 THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return b};THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);return b.normalize()};
@@ -698,9 +698,9 @@ THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1
 THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b=new THREE.Vector3;b.x=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b.y=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b.z=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return b});
 THREE.SplineCurve3=THREE.Curve.create(function(a){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3");this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector3;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,
 b.z,a);return c});
-THREE.CatmullRomCurve3=function(){function a(){}var b=new THREE.Vector3,c=new a,d=new a,e=new a;a.prototype.init=function(a,b,c,d){this.c0=a;this.c1=c;this.c2=-3*a+3*b-2*c-d;this.c3=2*a-2*b+c+d};a.prototype.initNonuniformCatmullRom=function(a,b,c,d,e,n,p){a=((b-a)/e-(c-a)/(e+n)+(c-b)/n)*n;d=((c-b)/n-(d-b)/(n+p)+(d-c)/p)*n;this.init(b,c,a,d)};a.prototype.initCatmullRom=function(a,b,c,d,e){this.init(b,c,e*(c-a),e*(d-b))};a.prototype.calc=function(a){var b=a*a;return this.c0+this.c1*a+this.c2*b+this.c3*
-b*a};return THREE.Curve.create(function(a){this.points=a||[]},function(a){var g=this.points,h,k;k=g.length;2>k&&console.log("duh, you need at least 2 points");a*=k-1;h=Math.floor(a);a-=h;0===a&&h===k-1&&(h=k-2,a=1);var l,n,p;0===h?(b.subVectors(g[0],g[1]).add(g[0]),l=b):l=g[h-1];n=g[h];p=g[h+1];h+2<k?g=g[h+2]:(b.subVectors(g[k-1],g[k-2]).add(g[k-2]),g=b);if(void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var m="chordal"===this.type?.5:.25;k=Math.pow(l.distanceToSquared(n),m);
-h=Math.pow(n.distanceToSquared(p),m);m=Math.pow(p.distanceToSquared(g),m);1E-4>h&&(h=1);1E-4>k&&(k=h);1E-4>m&&(m=h);c.initNonuniformCatmullRom(l.x,n.x,p.x,g.x,k,h,m);d.initNonuniformCatmullRom(l.y,n.y,p.y,g.y,k,h,m);e.initNonuniformCatmullRom(l.z,n.z,p.z,g.z,k,h,m)}else"catmullrom"===this.type&&(k=void 0!==this.tension?this.tension:.5,c.initCatmullRom(l.x,n.x,p.x,g.x,k),d.initCatmullRom(l.y,n.y,p.y,g.y,k),e.initCatmullRom(l.z,n.z,p.z,g.z,k));return new THREE.Vector3(c.calc(a),d.calc(a),e.calc(a))})}();
+THREE.CatmullRomCurve3=function(){function a(){}var b=new THREE.Vector3,c=new a,d=new a,e=new a;a.prototype.init=function(a,b,c,d){this.c0=a;this.c1=c;this.c2=-3*a+3*b-2*c-d;this.c3=2*a-2*b+c+d};a.prototype.initNonuniformCatmullRom=function(a,b,c,d,e,m,p){a=((b-a)/e-(c-a)/(e+m)+(c-b)/m)*m;d=((c-b)/m-(d-b)/(m+p)+(d-c)/p)*m;this.init(b,c,a,d)};a.prototype.initCatmullRom=function(a,b,c,d,e){this.init(b,c,e*(c-a),e*(d-b))};a.prototype.calc=function(a){var b=a*a;return this.c0+this.c1*a+this.c2*b+this.c3*
+b*a};return THREE.Curve.create(function(a){this.points=a||[]},function(a){var g=this.points,h,k;k=g.length;2>k&&console.log("duh, you need at least 2 points");a*=k-1;h=Math.floor(a);a-=h;0===a&&h===k-1&&(h=k-2,a=1);var l,m,p;0===h?(b.subVectors(g[0],g[1]).add(g[0]),l=b):l=g[h-1];m=g[h];p=g[h+1];h+2<k?g=g[h+2]:(b.subVectors(g[k-1],g[k-2]).add(g[k-2]),g=b);if(void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var n="chordal"===this.type?.5:.25;k=Math.pow(l.distanceToSquared(m),n);
+h=Math.pow(m.distanceToSquared(p),n);n=Math.pow(p.distanceToSquared(g),n);1E-4>h&&(h=1);1E-4>k&&(k=h);1E-4>n&&(n=h);c.initNonuniformCatmullRom(l.x,m.x,p.x,g.x,k,h,n);d.initNonuniformCatmullRom(l.y,m.y,p.y,g.y,k,h,n);e.initNonuniformCatmullRom(l.z,m.z,p.z,g.z,k,h,n)}else"catmullrom"===this.type&&(k=void 0!==this.tension?this.tension:.5,c.initCatmullRom(l.x,m.x,p.x,g.x,k),d.initCatmullRom(l.y,m.y,p.y,g.y,k),e.initCatmullRom(l.z,m.z,p.z,g.z,k));return new THREE.Vector3(c.calc(a),d.calc(a),e.calc(a))})}();
 THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(0<c?0:(Math.floor(Math.abs(c)/b.length)+1)*b.length),d=b[(c-1)%b.length],e=b[c%b.length],f=b[(c+1)%b.length],b=b[(c+2)%b.length],c=new THREE.Vector3;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a);return c});
 THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){console.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){console.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){console.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(a){if(!0===a.initialized)return a;for(var b=0;b<a.hierarchy.length;b++){for(var c=0;c<a.hierarchy[b].keys.length;c++)if(0>a.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time=
 0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){d={};for(c=0;c<a.hierarchy[b].keys.length;c++)for(var e=0;e<a.hierarchy[b].keys[c].morphTargets.length;e++){var f=a.hierarchy[b].keys[c].morphTargets[e];d[f]=-1}a.hierarchy[b].usedMorphTargets=d;for(c=0;c<a.hierarchy[b].keys.length;c++){var g=
@@ -709,12 +709,12 @@ THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(
 for(b=0;b<this.animations.length;b++)this.animations[b].update(a)}};THREE.Animation=function(a,b){this.root=a;this.data=THREE.AnimationHandler.init(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=!0;this.weight=0;this.interpolationType=THREE.AnimationHandler.LINEAR};
 THREE.Animation.prototype={constructor:THREE.Animation,keyTypes:["pos","rot","scl"],play:function(a,b){this.currentTime=void 0!==a?a:0;this.weight=void 0!==b?b:1;this.isPlaying=!0;this.reset();THREE.AnimationHandler.play(this)},stop:function(){this.isPlaying=!1;THREE.AnimationHandler.stop(this)},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}});
 var d=this.data.name,e=c.animationCache.animations,f=e[d];void 0===f&&(f={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=f);for(c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(d,a,1);g.time<this.currentTime&&g.index>e.index;)e=g,g=this.getNextKeyWith(d,a,g.index+1);f.prevKey[d]=e;f.nextKey[d]=g}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a].animationCache;void 0!==
-c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,p,m,q,t,s;e=(a.length-1)*b;p=Math.floor(e);e-=p;c[0]=0===p?p:p-1;c[1]=p;c[2]=p>a.length-2?p:p+1;c[3]=p>a.length-3?p:p+2;p=a[c[0]];q=a[c[1]];t=a[c[2]];s=a[c[3]];c=e*e;m=e*c;d[0]=f(p[0],q[0],t[0],s[0],e,c,m);d[1]=f(p[1],q[1],t[1],s[1],e,c,m);d[2]=f(p[2],q[2],t[2],s[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],l=k.animationCache.animations[this.data.name],n=k.animationCache.blending,p=0;3>p;p++){var m=this.keyTypes[p],
-q=l.prevKey[m],t=l.nextKey[m];if(0<this.timeScale&&t.time<=this.currentTime||0>this.timeScale&&q.time>=this.currentTime){q=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(m,f,1);t.time<this.currentTime&&t.index>q.index;)q=t,t=this.getNextKeyWith(m,f,t.index+1);l.prevKey[m]=q;l.nextKey[m]=t}var s=(this.currentTime-q.time)/(t.time-q.time),u=q[m],w=t[m];0>s&&(s=0);1<s&&(s=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(w[0]-u[0])*s,c.y=u[1]+(w[1]-u[1])*s,
-c.z=u[2]+(w[2]-u[2])*s,q=this.weight/(this.weight+n.positionWeight),k.position.lerp(c,q),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,q.index-1).pos,a[1]=u,a[2]=w,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,s=.33*s+.33,t=e(a,s),q=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,m=k.position,m.x+=(t[0]-m.x)*q,m.y+=(t[1]-
-m.y)*q,m.z+=(t[2]-m.z)*q,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(s=e(a,1.01*s),b.set(s[0],s[1],s[2]),b.sub(m),b.y=0,b.normalize(),s=Math.atan2(b.x,b.z),k.rotation.set(0,s,0))}else"rot"===m?(THREE.Quaternion.slerp(u,w,d,s),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(q=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,q),n.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+(w[0]-u[0])*s,c.y=
-u[1]+(w[1]-u[1])*s,c.z=u[2]+(w[2]-u[2])*s,q=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,q),n.scaleWeight+=this.weight)}return!0}}}(),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]},getPrevKeyWith:function(a,b,c){var d=
+c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,p,n,r,t,s;e=(a.length-1)*b;p=Math.floor(e);e-=p;c[0]=0===p?p:p-1;c[1]=p;c[2]=p>a.length-2?p:p+1;c[3]=p>a.length-3?p:p+2;p=a[c[0]];r=a[c[1]];t=a[c[2]];s=a[c[3]];c=e*e;n=e*c;d[0]=f(p[0],r[0],t[0],s[0],e,c,n);d[1]=f(p[1],r[1],t[1],s[1],e,c,n);d[2]=f(p[2],r[2],t[2],s[2],e,c,n);return d},f=function(a,b,c,d,
+e,f,n){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*n+(-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],l=k.animationCache.animations[this.data.name],m=k.animationCache.blending,p=0;3>p;p++){var n=this.keyTypes[p],
+r=l.prevKey[n],t=l.nextKey[n];if(0<this.timeScale&&t.time<=this.currentTime||0>this.timeScale&&r.time>=this.currentTime){r=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(n,f,1);t.time<this.currentTime&&t.index>r.index;)r=t,t=this.getNextKeyWith(n,f,t.index+1);l.prevKey[n]=r;l.nextKey[n]=t}var s=(this.currentTime-r.time)/(t.time-r.time),u=r[n],x=t[n];0>s&&(s=0);1<s&&(s=1);if("pos"===n)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(x[0]-u[0])*s,c.y=u[1]+(x[1]-u[1])*s,
+c.z=u[2]+(x[2]-u[2])*s,r=this.weight/(this.weight+m.positionWeight),k.position.lerp(c,r),m.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,r.index-1).pos,a[1]=u,a[2]=x,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,s=.33*s+.33,t=e(a,s),r=this.weight/(this.weight+m.positionWeight),m.positionWeight+=this.weight,n=k.position,n.x+=(t[0]-n.x)*r,n.y+=(t[1]-
+n.y)*r,n.z+=(t[2]-n.z)*r,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(s=e(a,1.01*s),b.set(s[0],s[1],s[2]),b.sub(n),b.y=0,b.normalize(),s=Math.atan2(b.x,b.z),k.rotation.set(0,s,0))}else"rot"===n?(THREE.Quaternion.slerp(u,x,d,s),0===m.quaternionWeight?(k.quaternion.copy(d),m.quaternionWeight=this.weight):(r=this.weight/(this.weight+m.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,r),m.quaternionWeight+=this.weight)):"scl"===n&&(c.x=u[0]+(x[0]-u[0])*s,c.y=
+u[1]+(x[1]-u[1])*s,c.z=u[2]+(x[2]-u[2])*s,r=this.weight/(this.weight+m.scaleWeight),k.scale.lerp(c,r),m.scaleWeight+=this.weight)}return!0}}}(),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]},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();
 d.matrixWorldNeedsUpdate=!0}}};
@@ -725,75 +725,75 @@ f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorld
 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),c=this.mesh.morphTargetInfluences;b!==this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=
 1,c[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);c[b]=this.currentTime%a/a;c[this.lastFrame]=1-c[b]}}};
-THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g){var s,u=h.widthSegments,w=h.heightSegments,x=e/2,A=f/2,y=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)s="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)s="y",w=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)s="x",u=h.depthSegments;var D=u+1,I=w+1,v=e/u,E=f/w,L=new THREE.Vector3;L[s]=0<g?1:-1;for(e=0;e<I;e++)for(f=0;f<D;f++){var C=new THREE.Vector3;C[a]=(f*v-x)*c;C[b]=(e*E-A)*d;C[s]=g;h.vertices.push(C)}for(e=0;e<
-w;e++)for(f=0;f<u;f++)A=f+D*e,a=f+D*(e+1),b=f+1+D*(e+1),c=f+1+D*e,d=new THREE.Vector2(f/u,1-e/w),g=new THREE.Vector2(f/u,1-(e+1)/w),s=new THREE.Vector2((f+1)/u,1-(e+1)/w),x=new THREE.Vector2((f+1)/u,1-e/w),A=new THREE.Face3(A+y,a+y,c+y),A.normal.copy(L),A.vertexNormals.push(L.clone(),L.clone(),L.clone()),h.faces.push(A),h.faceVertexUvs[0].push([d,g,x]),A=new THREE.Face3(a+y,b+y,c+y),A.normal.copy(L),A.vertexNormals.push(L.clone(),L.clone(),L.clone()),h.faces.push(A),h.faceVertexUvs[0].push([g.clone(),
-s,x.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);g("z","y",1,-1,c,b,-d);g("x","z",1,1,a,c,e);g("x","z",1,-1,a,c,-e);g("x","y",1,-1,a,b,f);g("x","y",-1,-1,a,b,-f);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g){var s,u=h.widthSegments,x=h.heightSegments,w=e/2,A=f/2,y=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)s="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)s="y",x=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)s="x",u=h.depthSegments;var G=u+1,I=x+1,v=e/u,D=f/x,L=new THREE.Vector3;L[s]=0<g?1:-1;for(e=0;e<I;e++)for(f=0;f<G;f++){var C=new THREE.Vector3;C[a]=(f*v-w)*c;C[b]=(e*D-A)*d;C[s]=g;h.vertices.push(C)}for(e=0;e<
+x;e++)for(f=0;f<u;f++)A=f+G*e,a=f+G*(e+1),b=f+1+G*(e+1),c=f+1+G*e,d=new THREE.Vector2(f/u,1-e/x),g=new THREE.Vector2(f/u,1-(e+1)/x),s=new THREE.Vector2((f+1)/u,1-(e+1)/x),w=new THREE.Vector2((f+1)/u,1-e/x),A=new THREE.Face3(A+y,a+y,c+y),A.normal.copy(L),A.vertexNormals.push(L.clone(),L.clone(),L.clone()),h.faces.push(A),h.faceVertexUvs[0].push([d,g,w]),A=new THREE.Face3(a+y,b+y,c+y),A.normal.copy(L),A.vertexNormals.push(L.clone(),L.clone(),L.clone()),h.faces.push(A),h.faceVertexUvs[0].push([g.clone(),
+s,w.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);g("z","y",1,-1,c,b,-d);g("x","z",1,1,a,c,e);g("x","z",1,-1,a,c,-e);g("x","y",1,-1,a,b,f);g("x","y",-1,-1,a,b,-f);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.CubeGeometry=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.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";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=b+2,f=new Float32Array(3*e),g=new Float32Array(3*e),e=new Float32Array(2*e);g[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var n=c+h/b*d;f[k]=a*Math.cos(n);f[k+1]=a*Math.sin(n);g[k+2]=1;e[l]=(f[k]/a+1)/2;e[l+1]=(f[k+1]/a+1)/2}c=
+THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";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=b+2,f=new Float32Array(3*e),g=new Float32Array(3*e),e=new Float32Array(2*e);g[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var m=c+h/b*d;f[k]=a*Math.cos(m);f[k+1]=a*Math.sin(m);g[k+2]=1;e[l]=(f[k]/a+1)/2;e[l+1]=(f[k+1]/a+1)/2}c=
 [];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(f,3));this.addAttribute("normal",new THREE.BufferAttribute(g,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
-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,l,n,p=[],m=[];for(n=0;n<=e;n++){var q=[],t=[],s=n/e,u=s*(b-a)+a;for(l=0;l<=d;l++){var w=l/d,x=new THREE.Vector3;x.x=u*Math.sin(w*h+
-g);x.y=-s*c+k;x.z=u*Math.cos(w*h+g);this.vertices.push(x);q.push(this.vertices.length-1);t.push(new THREE.Vector2(w,1-s))}p.push(q);m.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(g=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(g=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+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 q=p[n][l],t=p[n+1][l],s=p[n+1][l+1],u=p[n][l+1],w=g.clone(),x=g.clone(),
-A=h.clone(),y=h.clone(),D=m[n][l].clone(),I=m[n+1][l].clone(),v=m[n+1][l+1].clone(),E=m[n][l+1].clone();this.faces.push(new THREE.Face3(q,t,u,[w,x,y]));this.faceVertexUvs[0].push([D,I,E]);this.faces.push(new THREE.Face3(t,s,u,[x.clone(),A,y.clone()]));this.faceVertexUvs[0].push([I.clone(),v,E.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=p[0][l],t=p[0][l+1],s=this.vertices.length-1,w=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),A=new THREE.Vector3(0,
-1,0),D=m[0][l].clone(),I=m[0][l+1].clone(),v=new THREE.Vector2(I.x,0),this.faces.push(new THREE.Face3(q,t,s,[w,x,A])),this.faceVertexUvs[0].push([D,I,v]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=p[e][l+1],t=p[e][l],s=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),A=new THREE.Vector3(0,-1,0),D=m[e][l+1].clone(),I=m[e][l].clone(),v=new THREE.Vector2(I.x,1),this.faces.push(new THREE.Face3(q,t,s,[w,x,A])),this.faceVertexUvs[0].push([D,
+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,l,m,p=[],n=[];for(m=0;m<=e;m++){var r=[],t=[],s=m/e,u=s*(b-a)+a;for(l=0;l<=d;l++){var x=l/d,w=new THREE.Vector3;w.x=u*Math.sin(x*h+
+g);w.y=-s*c+k;w.z=u*Math.cos(x*h+g);this.vertices.push(w);r.push(this.vertices.length-1);t.push(new THREE.Vector2(x,1-s))}p.push(r);n.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(g=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(g=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+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(),m=0;m<e;m++){var r=p[m][l],t=p[m+1][l],s=p[m+1][l+1],u=p[m][l+1],x=g.clone(),w=g.clone(),
+A=h.clone(),y=h.clone(),G=n[m][l].clone(),I=n[m+1][l].clone(),v=n[m+1][l+1].clone(),D=n[m][l+1].clone();this.faces.push(new THREE.Face3(r,t,u,[x,w,y]));this.faceVertexUvs[0].push([G,I,D]);this.faces.push(new THREE.Face3(t,s,u,[w.clone(),A,y.clone()]));this.faceVertexUvs[0].push([I.clone(),v,D.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)r=p[0][l],t=p[0][l+1],s=this.vertices.length-1,x=new THREE.Vector3(0,1,0),w=new THREE.Vector3(0,1,0),A=new THREE.Vector3(0,
+1,0),G=n[0][l].clone(),I=n[0][l+1].clone(),v=new THREE.Vector2(I.x,0),this.faces.push(new THREE.Face3(r,t,s,[x,w,A])),this.faceVertexUvs[0].push([G,I,v]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)r=p[e][l+1],t=p[e][l],s=this.vertices.length-1,x=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),A=new THREE.Vector3(0,-1,0),G=n[e][l+1].clone(),I=n[e][l].clone(),v=new THREE.Vector2(I.x,1),this.faces.push(new THREE.Face3(r,t,s,[x,w,A])),this.faceVertexUvs[0].push([G,
 I,v]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
-THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,n=h.length;l<n;l++)for(var p=h[l],m=0;3>m;m++){d[0]=p[g[m]];d[1]=p[g[(m+1)%3]];d.sort(f);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:l,
-face2:void 0}:e[q].face2=l}d=[];for(q in e)if(f=e[q],void 0===f.face2||h[f.face1].normal.dot(h[f.face2].normal)<=c)g=k[f.vert1],d.push(g.x),d.push(g.y),d.push(g.z),g=k[f.vert2],d.push(g.x),d.push(g.y),d.push(g.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
+THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,m=h.length;l<m;l++)for(var p=h[l],n=0;3>n;n++){d[0]=p[g[n]];d[1]=p[g[(n+1)%3]];d.sort(f);var r=d.toString();void 0===e[r]?e[r]={vert1:d[0],vert2:d[1],face1:l,
+face2:void 0}:e[r].face2=l}d=[];for(r in e)if(f=e[r],void 0===f.face2||h[f.face1].normal.dot(h[f.face2].normal)<=c)g=k[f.vert1],d.push(g.x),d.push(g.y),d.push(g.z),g=k[f.vert2],d.push(g.x),d.push(g.y),d.push(g.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
 THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?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||console.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(K=a.length;0<=--K;){c=K;d=K-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=S*e,h=S*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+C,g=g+C,l=l+C,h=h+C;L.faces.push(new THREE.Face3(k,g,h));L.faces.push(new THREE.Face3(g,l,h));k=w.generateSideWallUV(L,k,g,l,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+=C;b+=C;c+=C;L.faces.push(new THREE.Face3(a,b,c));a=w.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,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,t=b.extrudePath,
-s,u=!1,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,x,A,y,D;t&&(s=t.getSpacedPoints(q),u=!0,p=!1,x=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,q,!1),A=new THREE.Vector3,y=new THREE.Vector3,D=new THREE.Vector3);p||(l=k=n=0);var I,v,E,L=this,C=this.vertices.length,t=a.extractPoints(m),m=t.shape,F=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();v=0;for(E=F.length;v<E;v++)I=F[v],THREE.Shape.Utils.isClockWise(I)&&(F[v]=I.reverse());t=
-!1}var R=THREE.Shape.Utils.triangulateShape(m,F),J=m;v=0;for(E=F.length;v<E;v++)I=F[v],m=m.concat(I);var z,G,B,T,O,S=m.length,P,H=R.length,t=[],K=0;B=J.length;z=B-1;for(G=K+1;K<B;K++,z++,G++)z===B&&(z=0),G===B&&(G=0),t[K]=d(J[K],J[z],J[G]);var na=[],da,ka=t.concat();v=0;for(E=F.length;v<E;v++){I=F[v];da=[];K=0;B=I.length;z=B-1;for(G=K+1;K<B;K++,z++,G++)z===B&&(z=0),G===B&&(G=0),da[K]=d(I[K],I[z],I[G]);na.push(da);ka=ka.concat(da)}for(z=0;z<n;z++){B=z/n;T=k*(1-B);G=l*Math.sin(B*Math.PI/2);K=0;for(B=
-J.length;K<B;K++)O=c(J[K],t[K],G),f(O.x,O.y,-T);v=0;for(E=F.length;v<E;v++)for(I=F[v],da=na[v],K=0,B=I.length;K<B;K++)O=c(I[K],da[K],G),f(O.x,O.y,-T)}G=l;for(K=0;K<S;K++)O=p?c(m[K],ka[K],G):m[K],u?(y.copy(x.normals[0]).multiplyScalar(O.x),A.copy(x.binormals[0]).multiplyScalar(O.y),D.copy(s[0]).add(y).add(A),f(D.x,D.y,D.z)):f(O.x,O.y,0);for(B=1;B<=q;B++)for(K=0;K<S;K++)O=p?c(m[K],ka[K],G):m[K],u?(y.copy(x.normals[B]).multiplyScalar(O.x),A.copy(x.binormals[B]).multiplyScalar(O.y),D.copy(s[B]).add(y).add(A),
-f(D.x,D.y,D.z)):f(O.x,O.y,h/q*B);for(z=n-1;0<=z;z--){B=z/n;T=k*(1-B);G=l*Math.sin(B*Math.PI/2);K=0;for(B=J.length;K<B;K++)O=c(J[K],t[K],G),f(O.x,O.y,h+T);v=0;for(E=F.length;v<E;v++)for(I=F[v],da=na[v],K=0,B=I.length;K<B;K++)O=c(I[K],da[K],G),u?f(O.x,O.y+s[q-1].y,s[q-1].x+T):f(O.x,O.y,h+T)}(function(){if(p){var a;a=0*S;for(K=0;K<H;K++)P=R[K],g(P[2]+a,P[1]+a,P[0]+a);a=q+2*n;a*=S;for(K=0;K<H;K++)P=R[K],g(P[0]+a,P[1]+a,P[2]+a)}else{for(K=0;K<H;K++)P=R[K],g(P[2],P[1],P[0]);for(K=0;K<H;K++)P=R[K],g(P[0]+
-S*q,P[1]+S*q,P[2]+S*q)}})();(function(){var a=0;e(J,a);a+=J.length;v=0;for(E=F.length;v<E;v++)I=F[v],e(I,a),a+=I.length})()};
+!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(K=a.length;0<=--K;){c=K;d=K-1;0>d&&(d=a.length-1);for(var e=0,f=r+2*m,e=0;e<f;e++){var g=S*e,h=S*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+C,g=g+C,l=l+C,h=h+C;L.faces.push(new THREE.Face3(k,g,h));L.faces.push(new THREE.Face3(g,l,h));k=x.generateSideWallUV(L,k,g,l,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+=C;b+=C;c+=C;L.faces.push(new THREE.Face3(a,b,c));a=x.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,l=void 0!==b.bevelSize?b.bevelSize:k-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,
+s,u=!1,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,A,y,G;t&&(s=t.getSpacedPoints(r),u=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,!1),A=new THREE.Vector3,y=new THREE.Vector3,G=new THREE.Vector3);p||(l=k=m=0);var I,v,D,L=this,C=this.vertices.length,t=a.extractPoints(n),n=t.shape,E=t.holes;if(t=!THREE.Shape.Utils.isClockWise(n)){n=n.reverse();v=0;for(D=E.length;v<D;v++)I=E[v],THREE.Shape.Utils.isClockWise(I)&&(E[v]=I.reverse());t=
+!1}var R=THREE.Shape.Utils.triangulateShape(n,E),J=n;v=0;for(D=E.length;v<D;v++)I=E[v],n=n.concat(I);var z,F,B,T,O,S=n.length,P,H=R.length,t=[],K=0;B=J.length;z=B-1;for(F=K+1;K<B;K++,z++,F++)z===B&&(z=0),F===B&&(F=0),t[K]=d(J[K],J[z],J[F]);var na=[],da,ka=t.concat();v=0;for(D=E.length;v<D;v++){I=E[v];da=[];K=0;B=I.length;z=B-1;for(F=K+1;K<B;K++,z++,F++)z===B&&(z=0),F===B&&(F=0),da[K]=d(I[K],I[z],I[F]);na.push(da);ka=ka.concat(da)}for(z=0;z<m;z++){B=z/m;T=k*(1-B);F=l*Math.sin(B*Math.PI/2);K=0;for(B=
+J.length;K<B;K++)O=c(J[K],t[K],F),f(O.x,O.y,-T);v=0;for(D=E.length;v<D;v++)for(I=E[v],da=na[v],K=0,B=I.length;K<B;K++)O=c(I[K],da[K],F),f(O.x,O.y,-T)}F=l;for(K=0;K<S;K++)O=p?c(n[K],ka[K],F):n[K],u?(y.copy(w.normals[0]).multiplyScalar(O.x),A.copy(w.binormals[0]).multiplyScalar(O.y),G.copy(s[0]).add(y).add(A),f(G.x,G.y,G.z)):f(O.x,O.y,0);for(B=1;B<=r;B++)for(K=0;K<S;K++)O=p?c(n[K],ka[K],F):n[K],u?(y.copy(w.normals[B]).multiplyScalar(O.x),A.copy(w.binormals[B]).multiplyScalar(O.y),G.copy(s[B]).add(y).add(A),
+f(G.x,G.y,G.z)):f(O.x,O.y,h/r*B);for(z=m-1;0<=z;z--){B=z/m;T=k*(1-B);F=l*Math.sin(B*Math.PI/2);K=0;for(B=J.length;K<B;K++)O=c(J[K],t[K],F),f(O.x,O.y,h+T);v=0;for(D=E.length;v<D;v++)for(I=E[v],da=na[v],K=0,B=I.length;K<B;K++)O=c(I[K],da[K],F),u?f(O.x,O.y+s[r-1].y,s[r-1].x+T):f(O.x,O.y,h+T)}(function(){if(p){var a;a=0*S;for(K=0;K<H;K++)P=R[K],g(P[2]+a,P[1]+a,P[0]+a);a=r+2*m;a*=S;for(K=0;K<H;K++)P=R[K],g(P[0]+a,P[1]+a,P[2]+a)}else{for(K=0;K<H;K++)P=R[K],g(P[2],P[1],P[0]);for(K=0;K<H;K++)P=R[K],g(P[0]+
+S*r,P[1]+S*r,P[2]+S*r)}})();(function(){var a=0;e(J,a);a+=J.length;v=0;for(D=E.length;v<D;v++)I=E[v],e(I,a),a+=I.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===Array.isArray(a)&&(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,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],
-k=k.concat(g);l=k.length;f=n.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=n[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,g,l))};
-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,l=Math.cos(k),n=Math.sin(k),k=0,p=a.length;k<p;k++){var m=a[k],q=new THREE.Vector3;q.x=l*m.x-n*m.y;q.y=n*m.x+l*m.y;q.z=m.z;this.vertices.push(q)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,p=a.length-1;k<p;k++){b=n=k+c*g;d=n+c;var l=n+1+c,n=n+1,m=g*f,q=k*e,t=
-m+f,s=q+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(m,q),new THREE.Vector2(t,q),new THREE.Vector2(m,s)]);this.faces.push(new THREE.Face3(d,l,n));this.faceVertexUvs[0].push([new THREE.Vector2(t,q),new THREE.Vector2(t,s),new THREE.Vector2(m,s)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+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,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var m=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],
+k=k.concat(g);l=k.length;f=m.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=m[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,g,l))};
+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,l=Math.cos(k),m=Math.sin(k),k=0,p=a.length;k<p;k++){var n=a[k],r=new THREE.Vector3;r.x=l*n.x-m*n.y;r.y=m*n.x+l*n.y;r.z=n.z;this.vertices.push(r)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,p=a.length-1;k<p;k++){b=m=k+c*g;d=m+c;var l=m+1+c,m=m+1,n=g*f,r=k*e,t=
+n+f,s=r+e;this.faces.push(new THREE.Face3(b,d,m));this.faceVertexUvs[0].push([new THREE.Vector2(n,r),new THREE.Vector2(t,r),new THREE.Vector2(n,s)]);this.faces.push(new THREE.Face3(d,l,m));this.faceVertexUvs[0].push([new THREE.Vector2(t,r),new THREE.Vector2(t,s),new THREE.Vector2(n,s)])}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.log("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=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var n=new Float32Array(g*h*2),p=0,m=0,q=0;q<h;q++)for(var t=q*l-f,s=0;s<g;s++)b[p]=s*k-e,b[p+1]=-t,a[p+2]=1,n[m]=s/c,n[m+1]=1-q/d,p+=3,m+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
-d*6);for(q=0;q<d;q++)for(s=0;s<c;s++)f=s+g*(q+1),h=s+1+g*(q+1),k=s+1+g*q,e[p]=s+g*q,e[p+1]=f,e[p+2]=k,e[p+3]=f,e[p+4]=h,e[p+5]=k,p+=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,l=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var n=new THREE.Vector3,p=e+g/c*f;n.x=k*Math.cos(p);n.y=k*Math.sin(p);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,
-(n.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=p=g+e,l=p+c+1,n=p+c+2,this.faces.push(new THREE.Face3(f,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]),f=p,l=p+c+2,n=p+1,this.faces.push(new THREE.Face3(f,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
+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=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var m=new Float32Array(g*h*2),p=0,n=0,r=0;r<h;r++)for(var t=r*l-f,s=0;s<g;s++)b[p]=s*k-e,b[p+1]=-t,a[p+2]=1,m[n]=s/c,m[n+1]=1-r/d,p+=3,n+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
+d*6);for(r=0;r<d;r++)for(s=0;s<c;s++)f=s+g*(r+1),h=s+1+g*(r+1),k=s+1+g*r,e[p]=s+g*r,e[p+1]=f,e[p+2]=k,e[p+3]=f,e[p+4]=h,e[p+5]=k,p+=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(m,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,l=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var m=new THREE.Vector3,p=e+g/c*f;m.x=k*Math.cos(p);m.y=k*Math.sin(p);this.vertices.push(m);h.push(new THREE.Vector2((m.x/b+1)/2,
+(m.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=p=g+e,l=p+c+1,m=p+c+2,this.faces.push(new THREE.Face3(f,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[m].clone()]),f=p,l=p+c+2,m=p+1,this.faces.push(new THREE.Face3(f,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[m].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){console.log("THREE.SphereGeometry: Consider using THREE.SphereBufferGeometry for lower memory footprint.");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(2,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,l=[],n=[];for(k=0;k<=c;k++){var p=
-[],m=[];for(h=0;h<=b;h++){var q=h/b,t=k/c,s=new THREE.Vector3;s.x=-a*Math.cos(d+q*e)*Math.sin(f+t*g);s.y=a*Math.cos(f+t*g);s.z=a*Math.sin(d+q*e)*Math.sin(f+t*g);this.vertices.push(s);p.push(this.vertices.length-1);m.push(new THREE.Vector2(q,1-t))}l.push(p);n.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),q=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),
-s=n[k][h+1].clone(),u=n[k][h].clone(),w=n[k+1][h].clone(),x=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(s.x=(s.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[p,q,t])),this.faceVertexUvs[0].push([s,w,x])):Math.abs(this.vertices[f].y)===a?(w.x=(w.x+x.x)/2,this.faces.push(new THREE.Face3(d,e,f,[p,m,q])),this.faceVertexUvs[0].push([s,u,w])):(this.faces.push(new THREE.Face3(d,e,g,[p,m,t])),this.faceVertexUvs[0].push([s,u,x]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),q,t.clone()])),this.faceVertexUvs[0].push([u.clone(),
-w,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.SphereGeometry=function(a,b,c,d,e,f,g){console.log("THREE.SphereGeometry: Consider using THREE.SphereBufferGeometry for lower memory footprint.");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(2,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,l=[],m=[];for(k=0;k<=c;k++){var p=
+[],n=[];for(h=0;h<=b;h++){var r=h/b,t=k/c,s=new THREE.Vector3;s.x=-a*Math.cos(d+r*e)*Math.sin(f+t*g);s.y=a*Math.cos(f+t*g);s.z=a*Math.sin(d+r*e)*Math.sin(f+t*g);this.vertices.push(s);p.push(this.vertices.length-1);n.push(new THREE.Vector2(r,1-t))}l.push(p);m.push(n)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),r=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),
+s=m[k][h+1].clone(),u=m[k][h].clone(),x=m[k+1][h].clone(),w=m[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(s.x=(s.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[p,r,t])),this.faceVertexUvs[0].push([s,x,w])):Math.abs(this.vertices[f].y)===a?(x.x=(x.x+w.x)/2,this.faces.push(new THREE.Face3(d,e,f,[p,n,r])),this.faceVertexUvs[0].push([s,u,x])):(this.faces.push(new THREE.Face3(d,e,g,[p,n,t])),this.faceVertexUvs[0].push([s,u,w]),this.faces.push(new THREE.Face3(e,f,g,[n.clone(),r,t.clone()])),this.faceVertexUvs[0].push([u.clone(),
+x,w.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.SphereBufferGeometry=function(a,b,c,d,e,f,g){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(2,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;for(var h=(b+1)*(c+1),k=new THREE.BufferAttribute(new Float32Array(3*h),3),l=new THREE.BufferAttribute(new Float32Array(3*h),
-3),h=new THREE.BufferAttribute(new Float32Array(2*h),2),n=0,p=[],m=new THREE.Vector3,q=0;q<=c;q++){for(var t=[],s=q/c,u=0;u<=b;u++){var w=u/b,x=-a*Math.cos(d+w*e)*Math.sin(f+s*g),A=a*Math.cos(f+s*g),y=a*Math.sin(d+w*e)*Math.sin(f+s*g);m.set(x,A,y).normalize();k.setXYZ(n,x,A,y);l.setXYZ(n,m.x,m.y,m.z);h.setXY(n,w,1-s);t.push(n);n++}p.push(t)}d=[];for(q=0;q<c;q++)for(u=0;u<b;u++)e=p[q][u+1],f=p[q][u],g=p[q+1][u],n=p[q+1][u+1],0!==q&&d.push(e,f,n),q!==c-1&&d.push(f,g,n);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(d),
+3),h=new THREE.BufferAttribute(new Float32Array(2*h),2),m=0,p=[],n=new THREE.Vector3,r=0;r<=c;r++){for(var t=[],s=r/c,u=0;u<=b;u++){var x=u/b,w=-a*Math.cos(d+x*e)*Math.sin(f+s*g),A=a*Math.cos(f+s*g),y=a*Math.sin(d+x*e)*Math.sin(f+s*g);n.set(w,A,y).normalize();k.setXYZ(m,w,A,y);l.setXYZ(m,n.x,n.y,n.z);h.setXY(m,x,1-s);t.push(m);m++}p.push(t)}d=[];for(r=0;r<c;r++)for(u=0;u<b;u++)e=p[r][u+1],f=p[r][u],g=p[r+1][u],m=p[r+1][u+1],0!==r&&d.push(e,f,m),r!==c-1&&d.push(f,g,m);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(d),
 1));this.addAttribute("position",k);this.addAttribute("normal",l);this.addAttribute("uv",h);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
 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 l=0;l<=d;l++){var n=l/d*e,p=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(p))*Math.cos(n);m.y=(a+b*Math.cos(p))*Math.sin(n);m.z=b*Math.sin(p);this.vertices.push(m);g.push(new THREE.Vector2(l/
-d,k/c));h.push(m.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,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 l=0;l<=d;l++){var m=l/d*e,p=k/c*Math.PI*2;f.x=a*Math.cos(m);f.y=a*Math.sin(m);var n=new THREE.Vector3;n.x=(a+b*Math.cos(p))*Math.cos(m);n.y=(a+b*Math.cos(p))*Math.sin(m);n.z=b*Math.sin(p);this.vertices.push(n);g.push(new THREE.Vector2(l/
+d,k/c));h.push(n.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,m=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),m=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(m),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),l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=0;m<c;++m){k[m]=
-Array(d);var q=m/c*2*e*Math.PI,t=h(q,f,e,a,g),q=h(q+.01,f,e,a,g);l.subVectors(q,t);n.addVectors(q,t);p.crossVectors(l,n);n.crossVectors(p,l);p.normalize();n.normalize();for(q=0;q<d;++q){var s=q/d*2*Math.PI,u=-b*Math.cos(s),s=b*Math.sin(s),w=new THREE.Vector3;w.x=t.x+u*n.x+s*p.x;w.y=t.y+u*n.y+s*p.y;w.z=t.z+u*n.z+s*p.z;k[m][q]=this.vertices.push(w)-1}}for(m=0;m<c;++m)for(q=0;q<d;++q)e=(m+1)%c,f=(q+1)%d,a=k[m][q],b=k[e][q],e=k[e][f],f=k[m][f],g=new THREE.Vector2(m/c,q/d),l=new THREE.Vector2((m+1)/c,
-q/d),n=new THREE.Vector2((m+1)/c,(q+1)/d),p=new THREE.Vector2(m/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,p]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),n,p.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,l=b+1,n,p,m,q,t,s=new THREE.Vector3,u,w,x;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);w=u.normals;x=u.binormals;this.tangents=u.tangents;this.normals=w;this.binormals=x;for(u=0;u<l;u++)for(g[u]=[],n=u/(l-1),t=a.getPointAt(n),h=w[u],k=x[u],m=c*f(n),n=0;n<d;n++)p=
-n/d*2*Math.PI,q=-m*Math.cos(p),p=m*Math.sin(p),s.copy(t),s.x+=q*h.x+p*k.x,s.y+=q*h.y+p*k.y,s.z+=q*h.z+p*k.z,g[u][n]=this.vertices.push(new THREE.Vector3(s.x,s.y,s.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)f=e?(u+1)%b:u+1,l=(n+1)%d,a=g[u][n],c=g[f][n],f=g[f][l],l=g[u][l],s=new THREE.Vector2(u/b,n/d),w=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,l)),this.faceVertexUvs[0].push([s,w,h]),this.faces.push(new THREE.Face3(c,
-f,l)),this.faceVertexUvs[0].push([w.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){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,p;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();f[0].crossVectors(e[0],
+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),l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=0;n<c;++n){k[n]=
+Array(d);var r=n/c*2*e*Math.PI,t=h(r,f,e,a,g),r=h(r+.01,f,e,a,g);l.subVectors(r,t);m.addVectors(r,t);p.crossVectors(l,m);m.crossVectors(p,l);p.normalize();m.normalize();for(r=0;r<d;++r){var s=r/d*2*Math.PI,u=-b*Math.cos(s),s=b*Math.sin(s),x=new THREE.Vector3;x.x=t.x+u*m.x+s*p.x;x.y=t.y+u*m.y+s*p.y;x.z=t.z+u*m.z+s*p.z;k[n][r]=this.vertices.push(x)-1}}for(n=0;n<c;++n)for(r=0;r<d;++r)e=(n+1)%c,f=(r+1)%d,a=k[n][r],b=k[e][r],e=k[e][f],f=k[n][f],g=new THREE.Vector2(n/c,r/d),l=new THREE.Vector2((n+1)/c,
+r/d),m=new THREE.Vector2((n+1)/c,(r+1)/d),p=new THREE.Vector2(n/c,(r+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,p]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),m,p.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,l=b+1,m,p,n,r,t,s=new THREE.Vector3,u,x,w;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);x=u.normals;w=u.binormals;this.tangents=u.tangents;this.normals=x;this.binormals=w;for(u=0;u<l;u++)for(g[u]=[],m=u/(l-1),t=a.getPointAt(m),h=x[u],k=w[u],n=c*f(m),m=0;m<d;m++)p=
+m/d*2*Math.PI,r=-n*Math.cos(p),p=n*Math.sin(p),s.copy(t),s.x+=r*h.x+p*k.x,s.y+=r*h.y+p*k.y,s.z+=r*h.z+p*k.z,g[u][m]=this.vertices.push(new THREE.Vector3(s.x,s.y,s.z))-1;for(u=0;u<b;u++)for(m=0;m<d;m++)f=e?(u+1)%b:u+1,l=(m+1)%d,a=g[u][m],c=g[f][m],f=g[f][l],l=g[u][l],s=new THREE.Vector2(u/b,m/d),x=new THREE.Vector2((u+1)/b,m/d),w=new THREE.Vector2((u+1)/b,(m+1)/d),h=new THREE.Vector2(u/b,(m+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([s,x,h]),this.faces.push(new THREE.Face3(c,
+f,l)),this.faceVertexUvs[0].push([x.clone(),w,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){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,m,p;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)m=l/(b-1),e[l]=a.getTangentAt(m),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);m=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));m<=a&&(a=m,d.set(0,1,0));p<=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(l=1;l<b;l++)f[l]=f[l-1].clone(),g[l]=g[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),f[l].applyMatrix4(k.makeRotationAxis(h,d))),g[l].crossVectors(e[l],f[l]);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),l=1;l<b;l++)f[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),g[l].crossVectors(e[l],f[l])};
 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){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],m=0;m<=c;m++){l[m]=[];for(var n=e(d.clone().lerp(h,m/c)),p=e(g.clone().lerp(h,m/c)),q=c-m,s=0;s<=q;s++)l[m][s]=0===s&&m===c?n:e(n.clone().lerp(p,s/q))}for(m=0;m<c;m++)for(s=0;s<2*(c-m)-1;s++)d=Math.floor(s/2),0===s%2?f(l[m][d+1],l[m+1][d],l[m][d]):f(l[m][d+1],l[m+1][d+1],l[m+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,l=0,n=a.length;l<n;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var p=[],m=l=0,n=b.length;l<n;l+=3,m++){var q=a[b[l]],t=a[b[l+1]],s=a[b[l+2]];p[m]=new THREE.Face3(q.index,t.index,s.index,[q.clone(),t.clone(),s.clone()])}for(var u=new THREE.Vector3,l=0,n=p.length;l<n;l++)g(p[l],d);l=0;for(n=this.faceVertexUvs[0].length;l<
-n;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,p=b[2].x,m=Math.max(d,Math.max(a,p)),q=Math.min(d,Math.min(a,p)),.9<m&&.1>q&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));l=0;for(n=this.vertices.length;l<n;l++)this.vertices[l].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;
+b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],m=0;m<=c;m++){l[m]=[];for(var n=e(d.clone().lerp(h,m/c)),p=e(g.clone().lerp(h,m/c)),r=c-m,s=0;s<=r;s++)l[m][s]=0===s&&m===c?n:e(n.clone().lerp(p,s/r))}for(m=0;m<c;m++)for(s=0;s<2*(c-m)-1;s++)d=Math.floor(s/2),0===s%2?f(l[m][d+1],l[m+1][d],l[m][d]):f(l[m][d+1],l[m+1][d+1],l[m+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,l=0,m=a.length;l<m;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var p=[],n=l=0,m=b.length;l<m;l+=3,n++){var r=a[b[l]],t=a[b[l+1]],s=a[b[l+2]];p[n]=new THREE.Face3(r.index,t.index,s.index,[r.clone(),t.clone(),s.clone()])}for(var u=new THREE.Vector3,l=0,m=p.length;l<m;l++)g(p[l],d);l=0;for(m=this.faceVertexUvs[0].length;l<
+m;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,p=b[2].x,n=Math.max(d,Math.max(a,p)),r=Math.min(d,Math.min(a,p)),.9<n&&.1>r&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));l=0;for(m=this.vertices.length;l<m;l++)this.vertices[l].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,l,n=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var p,m,q,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*n+h,d=g*n+h+1,l=(g+1)*n+h+1,k=(g+1)*n+h,p=new THREE.Vector2(h/b,g/c),m=new THREE.Vector2((h+1)/b,g/c),q=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([p,m,t]),e.push(new THREE.Face3(d,l,k)),f.push([m.clone(),q,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
-THREE.WireframeGeometry=function(a){THREE.BufferGeometry.call(this);var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c"];if(a instanceof THREE.Geometry){var f=a.vertices,g=a.faces,h=0,k=new Uint32Array(6*g.length);a=0;for(var l=g.length;a<l;a++)for(var n=g[a],p=0;3>p;p++){b[0]=n[e[p]];b[1]=n[e[(p+1)%3]];b.sort(d);var m=b.toString();void 0===c[m]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[m]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)h=f[k[2*a+p]],e=6*a+3*p,b[e+0]=h.x,b[e+1]=h.y,
-b[e+2]=h.z;this.addAttribute("position",new THREE.BufferAttribute(b,3))}else if(a instanceof THREE.BufferGeometry){if(void 0!==a.attributes.index){f=a.attributes.position;l=a.attributes.index.array;g=a.drawcalls;h=0;0===g.length&&(g=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),n=0,q=g.length;n<q;++n){p=g[n].start;m=g[n].count;e=g[n].index;a=p;for(var t=p+m;a<t;a+=3)for(p=0;3>p;p++)b[0]=e+l[a+p],b[1]=e+l[a+(p+1)%3],b.sort(d),m=b.toString(),void 0===c[m]&&(k[2*h]=b[0],k[2*
-h+1]=b[1],c[m]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)e=6*a+3*p,h=k[2*a+p],b[e+0]=f.getX(h),b[e+1]=f.getY(h),b[e+2]=f.getZ(h)}else for(f=a.attributes.position.array,h=f.length/3,k=h/3,b=new Float32Array(6*h),a=0,l=k;a<l;a++)for(p=0;3>p;p++)e=18*a+6*p,k=9*a+3*p,b[e+0]=f[k],b[e+1]=f[k+1],b[e+2]=f[k+2],h=9*a+(p+1)%3*3,b[e+3]=f[h],b[e+4]=f[h+1],b[e+5]=f[h+2];this.addAttribute("position",new THREE.BufferAttribute(b,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
+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,l,m=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var p,n,r,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*m+h,d=g*m+h+1,l=(g+1)*m+h+1,k=(g+1)*m+h,p=new THREE.Vector2(h/b,g/c),n=new THREE.Vector2((h+1)/b,g/c),r=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([p,n,t]),e.push(new THREE.Face3(d,l,k)),f.push([n.clone(),r,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
+THREE.WireframeGeometry=function(a){THREE.BufferGeometry.call(this);var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c"];if(a instanceof THREE.Geometry){var f=a.vertices,g=a.faces,h=0,k=new Uint32Array(6*g.length);a=0;for(var l=g.length;a<l;a++)for(var m=g[a],p=0;3>p;p++){b[0]=m[e[p]];b[1]=m[e[(p+1)%3]];b.sort(d);var n=b.toString();void 0===c[n]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[n]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)h=f[k[2*a+p]],e=6*a+3*p,b[e+0]=h.x,b[e+1]=h.y,
+b[e+2]=h.z;this.addAttribute("position",new THREE.BufferAttribute(b,3))}else if(a instanceof THREE.BufferGeometry){if(void 0!==a.attributes.index){f=a.attributes.position;l=a.attributes.index.array;g=a.drawcalls;h=0;0===g.length&&(g=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),m=0,r=g.length;m<r;++m){p=g[m].start;n=g[m].count;e=g[m].index;a=p;for(var t=p+n;a<t;a+=3)for(p=0;3>p;p++)b[0]=e+l[a+p],b[1]=e+l[a+(p+1)%3],b.sort(d),n=b.toString(),void 0===c[n]&&(k[2*h]=b[0],k[2*
+h+1]=b[1],c[n]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)e=6*a+3*p,h=k[2*a+p],b[e+0]=f.getX(h),b[e+1]=f.getY(h),b[e+2]=f.getZ(h)}else for(f=a.attributes.position.array,h=f.length/3,k=h/3,b=new Float32Array(6*h),a=0,l=k;a<l;a++)for(p=0;3>p;p++)e=18*a+6*p,k=9*a+3*p,b[e+0]=f[k],b[e+1]=f[k+1],b[e+2]=f[k+2],h=9*a+(p+1)%3*3,b[e+3]=f[h],b[e+4]=f[h+1],b[e+5]=f[h+2];this.addAttribute("position",new THREE.BufferAttribute(b,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
 THREE.WireframeGeometry.prototype.constructor=THREE.WireframeGeometry;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.LineSegments.call(this,a,b)};THREE.AxisHelper.prototype=Object.create(THREE.LineSegments.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);
@@ -831,11 +831,11 @@ 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.LineSegments.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}));this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.LineSegments.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,l=f.length;k<l;k++)for(var n=f[k],p=0,m=n.vertexNormals.length;p<m;p++){var q=n.vertexNormals[p];d[h].copy(e[n[a[p]]]).applyMatrix4(g);b.copy(q).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,l=f.length;k<l;k++)for(var m=f[k],p=0,n=m.vertexNormals.length;p<n;p++){var r=m.vertexNormals[p];d[h].copy(e[m[a[p]]]).applyMatrix4(g);b.copy(r).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.LineSegments.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}));this.matrixAutoUpdate=!1;this.update()};THREE.VertexTangentsHelper.prototype=Object.create(THREE.LineSegments.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,l=f.length;k<l;k++)for(var n=f[k],p=0,m=n.vertexTangents.length;p<m;p++){var q=n.vertexTangents[p];d[h].copy(e[n[a[p]]]).applyMatrix4(g);b.copy(q).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,l=f.length;k<l;k++)for(var m=f[k],p=0,n=m.vertexTangents.length;p<n;p++){var r=m.vertexTangents[p];d[h].copy(e[m[a[p]]]).applyMatrix4(g);b.copy(r).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;THREE.LineSegments.call(this,new THREE.WireframeGeometry(a.geometry),new THREE.LineBasicMaterial({color:c}));this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.WireframeHelper.prototype=Object.create(THREE.LineSegments.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)};