Browse Source

Updated builds.

Mr.doob 10 years ago
parent
commit
c50eed930e
2 changed files with 283 additions and 454 deletions
  1. 33 201
      build/three.js
  2. 250 253
      build/three.min.js

+ 33 - 201
build/three.js

@@ -14544,8 +14544,6 @@ THREE.PointCloud = function ( geometry, material ) {
 	this.geometry = geometry !== undefined ? geometry : new THREE.Geometry();
 	this.material = material !== undefined ? material : new THREE.PointCloudMaterial( { color: Math.random() * 0xffffff } );
 
-	this.sortParticles = false;
-
 };
 
 THREE.PointCloud.prototype = Object.create( THREE.Object3D.prototype );
@@ -14682,8 +14680,6 @@ THREE.PointCloud.prototype.clone = function ( object ) {
 
 	if ( object === undefined ) object = new THREE.PointCloud( this.geometry, this.material );
 
-	object.sortParticles = this.sortParticles;
-
 	THREE.Object3D.prototype.clone.call( this, object );
 
 	return object;
@@ -19081,28 +19077,12 @@ THREE.WebGLRenderer = function ( parameters ) {
 		a, ca, cal, value,
 		customAttribute;
 
-		if ( object.sortParticles ) {
-
-			_projScreenMatrixPS.copy( _projScreenMatrix );
-			_projScreenMatrixPS.multiply( object.matrixWorld );
+		if ( dirtyVertices ) {
 
 			for ( v = 0; v < vl; v ++ ) {
 
 				vertex = vertices[ v ];
 
-				_vector3.copy( vertex );
-				_vector3.applyProjection( _projScreenMatrixPS );
-
-				sortArray[ v ] = [ _vector3.z, v ];
-
-			}
-
-			sortArray.sort( numericalSort );
-
-			for ( v = 0; v < vl; v ++ ) {
-
-				vertex = vertices[ sortArray[ v ][ 1 ] ];
-
 				offset = v * 3;
 
 				vertexArray[ offset ]     = vertex.x;
@@ -19111,11 +19091,18 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			}
 
+			_gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.__webglVertexBuffer );
+			_gl.bufferData( _gl.ARRAY_BUFFER, vertexArray, hint );
+
+		}
+
+		if ( dirtyColors ) {
+
 			for ( c = 0; c < cl; c ++ ) {
 
-				offset = c * 3;
+				color = colors[ c ];
 
-				color = colors[ sortArray[ c ][ 1 ] ];
+				offset = c * 3;
 
 				colorArray[ offset ]     = color.r;
 				colorArray[ offset + 1 ] = color.g;
@@ -19123,25 +19110,28 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			}
 
-			if ( customAttributes ) {
+			_gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.__webglColorBuffer );
+			_gl.bufferData( _gl.ARRAY_BUFFER, colorArray, hint );
 
-				for ( i = 0, il = customAttributes.length; i < il; i ++ ) {
+		}
 
-					customAttribute = customAttributes[ i ];
+		if ( customAttributes ) {
 
-					if ( ! ( customAttribute.boundTo === undefined || customAttribute.boundTo === 'vertices' ) ) continue;
+			for ( i = 0, il = customAttributes.length; i < il; i ++ ) {
 
-					offset = 0;
+				customAttribute = customAttributes[ i ];
+
+				if ( customAttribute.needsUpdate && ( customAttribute.boundTo === undefined ||  customAttribute.boundTo === 'vertices' ) ) {
 
 					cal = customAttribute.value.length;
 
+					offset = 0;
+
 					if ( customAttribute.size === 1 ) {
 
 						for ( ca = 0; ca < cal; ca ++ ) {
 
-							index = sortArray[ ca ][ 1 ];
-
-							customAttribute.array[ ca ] = customAttribute.value[ index ];
+							customAttribute.array[ ca ] = customAttribute.value[ ca ];
 
 						}
 
@@ -19149,9 +19139,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 						for ( ca = 0; ca < cal; ca ++ ) {
 
-							index = sortArray[ ca ][ 1 ];
-
-							value = customAttribute.value[ index ];
+							value = customAttribute.value[ ca ];
 
 							customAttribute.array[ offset ]   = value.x;
 							customAttribute.array[ offset + 1 ] = value.y;
@@ -19166,11 +19154,9 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 							for ( ca = 0; ca < cal; ca ++ ) {
 
-								index = sortArray[ ca ][ 1 ];
-
-								value = customAttribute.value[ index ];
+								value = customAttribute.value[ ca ];
 
-								customAttribute.array[ offset ]     = value.r;
+								customAttribute.array[ offset ]   = value.r;
 								customAttribute.array[ offset + 1 ] = value.g;
 								customAttribute.array[ offset + 2 ] = value.b;
 
@@ -19182,9 +19168,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 							for ( ca = 0; ca < cal; ca ++ ) {
 
-								index = sortArray[ ca ][ 1 ];
-
-								value = customAttribute.value[ index ];
+								value = customAttribute.value[ ca ];
 
 								customAttribute.array[ offset ]   = value.x;
 								customAttribute.array[ offset + 1 ] = value.y;
@@ -19200,9 +19184,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 						for ( ca = 0; ca < cal; ca ++ ) {
 
-							index = sortArray[ ca ][ 1 ];
-
-							value = customAttribute.value[ index ];
+							value = customAttribute.value[ ca ];
 
 							customAttribute.array[ offset ]      = value.x;
 							customAttribute.array[ offset + 1  ] = value.y;
@@ -19217,160 +19199,10 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				}
 
-			}
-
-		} else {
-
-			if ( dirtyVertices ) {
-
-				for ( v = 0; v < vl; v ++ ) {
-
-					vertex = vertices[ v ];
-
-					offset = v * 3;
-
-					vertexArray[ offset ]     = vertex.x;
-					vertexArray[ offset + 1 ] = vertex.y;
-					vertexArray[ offset + 2 ] = vertex.z;
-
-				}
-
-			}
-
-			if ( dirtyColors ) {
-
-				for ( c = 0; c < cl; c ++ ) {
-
-					color = colors[ c ];
-
-					offset = c * 3;
-
-					colorArray[ offset ]     = color.r;
-					colorArray[ offset + 1 ] = color.g;
-					colorArray[ offset + 2 ] = color.b;
-
-				}
-
-			}
-
-			if ( customAttributes ) {
-
-				for ( i = 0, il = customAttributes.length; i < il; i ++ ) {
-
-					customAttribute = customAttributes[ i ];
-
-					if ( customAttribute.needsUpdate &&
-						 ( customAttribute.boundTo === undefined ||
-							 customAttribute.boundTo === 'vertices' ) ) {
-
-						cal = customAttribute.value.length;
-
-						offset = 0;
-
-						if ( customAttribute.size === 1 ) {
-
-							for ( ca = 0; ca < cal; ca ++ ) {
-
-								customAttribute.array[ ca ] = customAttribute.value[ ca ];
-
-							}
-
-						} else if ( customAttribute.size === 2 ) {
-
-							for ( ca = 0; ca < cal; ca ++ ) {
-
-								value = customAttribute.value[ ca ];
-
-								customAttribute.array[ offset ]   = value.x;
-								customAttribute.array[ offset + 1 ] = value.y;
-
-								offset += 2;
-
-							}
-
-						} else if ( customAttribute.size === 3 ) {
-
-							if ( customAttribute.type === 'c' ) {
-
-								for ( ca = 0; ca < cal; ca ++ ) {
-
-									value = customAttribute.value[ ca ];
-
-									customAttribute.array[ offset ]   = value.r;
-									customAttribute.array[ offset + 1 ] = value.g;
-									customAttribute.array[ offset + 2 ] = value.b;
-
-									offset += 3;
-
-								}
-
-							} else {
-
-								for ( ca = 0; ca < cal; ca ++ ) {
-
-									value = customAttribute.value[ ca ];
-
-									customAttribute.array[ offset ]   = value.x;
-									customAttribute.array[ offset + 1 ] = value.y;
-									customAttribute.array[ offset + 2 ] = value.z;
-
-									offset += 3;
-
-								}
-
-							}
-
-						} else if ( customAttribute.size === 4 ) {
-
-							for ( ca = 0; ca < cal; ca ++ ) {
-
-								value = customAttribute.value[ ca ];
-
-								customAttribute.array[ offset ]      = value.x;
-								customAttribute.array[ offset + 1  ] = value.y;
-								customAttribute.array[ offset + 2  ] = value.z;
-								customAttribute.array[ offset + 3  ] = value.w;
-
-								offset += 4;
-
-							}
-
-						}
-
-					}
-
-				}
-
-			}
-
-		}
-
-		if ( dirtyVertices || object.sortParticles ) {
-
-			_gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.__webglVertexBuffer );
-			_gl.bufferData( _gl.ARRAY_BUFFER, vertexArray, hint );
-
-		}
-
-		if ( dirtyColors || object.sortParticles ) {
-
-			_gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.__webglColorBuffer );
-			_gl.bufferData( _gl.ARRAY_BUFFER, colorArray, hint );
-
-		}
-
-		if ( customAttributes ) {
-
-			for ( i = 0, il = customAttributes.length; i < il; i ++ ) {
-
-				customAttribute = customAttributes[ i ];
-
-				if ( customAttribute.needsUpdate || object.sortParticles ) {
-
-					_gl.bindBuffer( _gl.ARRAY_BUFFER, customAttribute.buffer );
-					_gl.bufferData( _gl.ARRAY_BUFFER, customAttribute.array, hint );
+				_gl.bindBuffer( _gl.ARRAY_BUFFER, customAttribute.buffer );
+				_gl.bufferData( _gl.ARRAY_BUFFER, customAttribute.array, hint );
 
-				}
+				customAttribute.needsUpdate = false;
 
 			}
 
@@ -19461,9 +19293,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				customAttribute = customAttributes[ i ];
 
-				if ( customAttribute.needsUpdate &&
-					 ( customAttribute.boundTo === undefined ||
-						 customAttribute.boundTo === 'vertices' ) ) {
+				if ( customAttribute.needsUpdate && ( customAttribute.boundTo === undefined || customAttribute.boundTo === 'vertices' ) ) {
 
 					offset = 0;
 
@@ -19542,6 +19372,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 					_gl.bindBuffer( _gl.ARRAY_BUFFER, customAttribute.buffer );
 					_gl.bufferData( _gl.ARRAY_BUFFER, customAttribute.array, hint );
 
+					customAttribute.needsUpdate = false;
+
 				}
 
 			}
@@ -22016,7 +21848,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			customAttributesDirty = material.attributes && areCustomAttributesDirty( material );
 
-			if ( geometry.verticesNeedUpdate || geometry.colorsNeedUpdate || object.sortParticles || customAttributesDirty ) {
+			if ( geometry.verticesNeedUpdate || geometry.colorsNeedUpdate || customAttributesDirty ) {
 
 				setParticleBuffers( geometry, _gl.DYNAMIC_DRAW, object );
 

+ 250 - 253
build/three.min.js

@@ -91,21 +91,21 @@ a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:funct
 c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");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,n,p,q,m,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]=n;u[10]=p;u[14]=q;u[3]=m;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)},
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,n,p,q,m,t,r,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]=n;u[10]=p;u[14]=q;u[3]=m;u[7]=t;u[11]=r;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},extractRotation:function(){var a=new THREE.Vector3;return function(b){var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),f=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){!1===a instanceof THREE.Euler&&
 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,n=c*h,p=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+n*d;b[5]=a-p*d;b[9]=-c*g;b[2]=p-a*d;b[6]=n+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,n=d*h,p=d*e,b[0]=a+p*c,b[4]=n*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-n,b[6]=p+a*c,
 b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,n=d*h,p=d*e,b[0]=a-p*c,b[4]=-f*e,b[8]=n+k*c,b[1]=k+n*c,b[5]=f*h,b[9]=p-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,n=c*h,p=c*e,b[0]=g*h,b[4]=n*d-k,b[8]=a*d+p,b[1]=g*e,b[5]=p*d+a,b[9]=k*d-n,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,n=c*g,p=c*d,b[0]=g*h,b[4]=p-a*e,b[8]=n*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+n,b[10]=a-p*e):"XZY"===a.order&&(a=f*g,k=f*d,n=c*g,p=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+p,b[5]=f*h,b[9]=k*
 e-n,b[2]=n*e-k,b[6]=c*h,b[10]=p*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 n=c*h,c=c*k,p=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(p+e);b[4]=n-f;b[8]=c+h;b[1]=n+f;b[5]=1-
 (a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+p);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),
-multiply:function(a,b){return void 0!==b?(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],n=c[1],p=c[5],q=c[9],m=c[13],r=c[2],t=c[6],s=c[10],u=c[14],v=c[3],x=c[7],E=c[11],c=c[15],w=d[0],M=d[4],y=d[8],C=d[12],D=d[1],A=d[5],B=d[9],G=d[13],S=d[2],K=d[6],I=d[10],V=d[14],L=d[3],
-J=d[7],R=d[11],d=d[15];e[0]=f*w+g*D+h*S+k*L;e[4]=f*M+g*A+h*K+k*J;e[8]=f*y+g*B+h*I+k*R;e[12]=f*C+g*G+h*V+k*d;e[1]=n*w+p*D+q*S+m*L;e[5]=n*M+p*A+q*K+m*J;e[9]=n*y+p*B+q*I+m*R;e[13]=n*C+p*G+q*V+m*d;e[2]=r*w+t*D+s*S+u*L;e[6]=r*M+t*A+s*K+u*J;e[10]=r*y+t*B+s*I+u*R;e[14]=r*C+t*G+s*V+u*d;e[3]=v*w+x*D+E*S+c*L;e[7]=v*M+x*A+E*K+c*J;e[11]=v*y+x*B+E*I+c*R;e[15]=v*C+x*G+E*V+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]=
+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],n=c[1],p=c[5],q=c[9],m=c[13],t=c[2],r=c[6],s=c[10],u=c[14],v=c[3],x=c[7],J=c[11],c=c[15],w=d[0],P=d[4],y=d[8],C=d[12],D=d[1],A=d[5],B=d[9],G=d[13],V=d[2],M=d[6],H=d[10],K=d[14],N=d[3],
+U=d[7],F=d[11],d=d[15];e[0]=f*w+g*D+h*V+k*N;e[4]=f*P+g*A+h*M+k*U;e[8]=f*y+g*B+h*H+k*F;e[12]=f*C+g*G+h*K+k*d;e[1]=n*w+p*D+q*V+m*N;e[5]=n*P+p*A+q*M+m*U;e[9]=n*y+p*B+q*H+m*F;e[13]=n*C+p*G+q*K+m*d;e[2]=t*w+r*D+s*V+u*N;e[6]=t*P+r*A+s*M+u*U;e[10]=t*y+r*B+s*H+u*F;e[14]=t*C+r*G+s*K+u*d;e[3]=v*w+x*D+J*V+c*N;e[7]=v*P+x*A+J*M+c*U;e[11]=v*y+x*B+J*H+c*F;e[15]=v*C+x*G+J*K+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=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=
 b.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){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],n=a[2],p=a[6],q=a[10],m=a[14];return a[3]*(+e*h*p-d*k*p-e*g*q+c*k*q+d*g*m-c*h*m)+a[7]*(+b*h*m-b*k*q+e*f*q-d*f*m+d*k*n-e*h*n)+a[11]*(+b*k*p-b*g*m-e*f*p+c*f*m+e*g*n-c*k*n)+a[15]*(-d*g*n-b*h*p+b*g*q+d*f*p-c*f*q+c*h*n)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,
 b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=new THREE.Vector3;return function(){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],n=d[5],p=d[9],q=d[13],m=d[2],r=d[6],t=d[10],s=d[14],u=d[3],v=d[7],x=d[11],d=d[15];c[0]=p*s*v-q*t*v+q*r*x-n*s*x-p*r*d+n*t*d;c[4]=h*t*v-g*s*v-h*r*x+f*s*x+g*r*d-f*t*d;c[8]=g*q*v-h*p*v+h*n*x-f*q*x-g*n*d+f*p*d;c[12]=h*p*r-g*q*r-h*n*t+f*q*t+g*n*s-f*p*s;c[1]=q*t*u-p*s*u-q*m*x+k*s*x+p*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*p*u-g*q*u-h*k*
-x+e*q*x+g*k*d-e*p*d;c[13]=g*q*m-h*p*m+h*k*t-e*q*t-g*k*s+e*p*s;c[2]=n*s*u-q*r*u+q*m*v-k*s*v-n*m*d+k*r*d;c[6]=h*r*u-f*s*u-h*m*v+e*s*v+f*m*d-e*r*d;c[10]=f*q*u-h*n*u+h*k*v-e*q*v-f*k*d+e*n*d;c[14]=h*n*m-f*q*m-h*k*r+e*q*r+f*k*s-e*n*s;c[3]=p*r*u-n*t*u-p*m*v+k*t*v+n*m*x-k*r*x;c[7]=f*t*u-g*r*u+g*m*v-e*t*v-f*m*x+e*r*x;c[11]=g*n*u-f*p*u-g*k*v+e*p*v+f*k*x-e*n*x;c[15]=f*p*m-g*n*m+g*k*r-e*p*r-f*k*t+e*n*t;c=e*c[0]+k*c[4]+m*c[8]+u*c[12];if(0==c){if(b)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");
+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],n=d[5],p=d[9],q=d[13],m=d[2],t=d[6],r=d[10],s=d[14],u=d[3],v=d[7],x=d[11],d=d[15];c[0]=p*s*v-q*r*v+q*t*x-n*s*x-p*t*d+n*r*d;c[4]=h*r*v-g*s*v-h*t*x+f*s*x+g*t*d-f*r*d;c[8]=g*q*v-h*p*v+h*n*x-f*q*x-g*n*d+f*p*d;c[12]=h*p*t-g*q*t-h*n*r+f*q*r+g*n*s-f*p*s;c[1]=q*r*u-p*s*u-q*m*x+k*s*x+p*m*d-k*r*d;c[5]=g*s*u-h*r*u+h*m*x-e*s*x-g*m*d+e*r*d;c[9]=h*p*u-g*q*u-h*k*
+x+e*q*x+g*k*d-e*p*d;c[13]=g*q*m-h*p*m+h*k*r-e*q*r-g*k*s+e*p*s;c[2]=n*s*u-q*t*u+q*m*v-k*s*v-n*m*d+k*t*d;c[6]=h*t*u-f*s*u-h*m*v+e*s*v+f*m*d-e*t*d;c[10]=f*q*u-h*n*u+h*k*v-e*q*v-f*k*d+e*n*d;c[14]=h*n*m-f*q*m-h*k*t+e*q*t+f*k*s-e*n*s;c[3]=p*t*u-n*r*u-p*m*v+k*r*v+n*m*x-k*t*x;c[7]=f*r*u-g*t*u+g*m*v-e*r*v-f*m*x+e*t*x;c[11]=g*n*u-f*p*u-g*k*v+e*p*v+f*k*x-e*n*x;c[15]=f*p*m-g*n*m+g*k*t-e*p*t-f*k*r+e*n*r;c=e*c[0]+k*c[4]+m*c[8]+u*c[12];if(0==c){if(b)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");
 console.warn("Matrix4.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.warn("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){console.warn("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){console.warn("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){console.warn("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(a,b){console.warn("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,n=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*g+d*h,n*g+c,n*h-d*f,0,k*h-d*g,n*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,
@@ -125,8 +125,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],n=c[7],p=c[8],q=c[9],m=c[10],r=c[11],t=c[12],s=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,n-g,r-p,c-t).normalize();b[1].setComponents(f+
-a,n+g,r+p,c+t).normalize();b[2].setComponents(f+d,n+h,r+q,c+s).normalize();b[3].setComponents(f-d,n-h,r-q,c-s).normalize();b[4].setComponents(f-e,n-k,r-m,c-u).normalize();b[5].setComponents(f+e,n+k,r+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],n=c[7],p=c[8],q=c[9],m=c[10],t=c[11],r=c[12],s=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,n-g,t-p,c-r).normalize();b[1].setComponents(f+
+a,n+g,t+p,c+r).normalize();b[2].setComponents(f+d,n+h,t+q,c+s).normalize();b[3].setComponents(f-d,n-h,t-q,c-s).normalize();b[4].setComponents(f-e,n-k,t-m,c-u).normalize();b[5].setComponents(f+e,n+k,t+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,
 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,
@@ -181,19 +181,19 @@ THREE.Uint32Attribute=function(a,b){console.warn("THREE.Uint32Attribute has been
 THREE.Float64Attribute=function(a,b){console.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.attributesKeys=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):(this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=
 this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0)},center:function(){},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=0<e[0].length,h=3==d[0].vertexNormals.length,k=new Float32Array(9*d.length);this.addAttribute("position",new THREE.BufferAttribute(k,3));var n=
-new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(n,3));if(f!==THREE.NoColors){var p=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(p,3))}if(!0===g){var q=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(q,2))}for(var m=0,r=0,t=0;m<d.length;m++,r+=6,t+=9){var s=d[m],u=c[s.a],v=c[s.b],x=c[s.c];k[t]=u.x;k[t+1]=u.y;k[t+2]=u.z;k[t+3]=v.x;k[t+4]=v.y;k[t+5]=v.z;k[t+6]=x.x;k[t+7]=x.y;k[t+8]=x.z;!0===h?(u=s.vertexNormals[0],
-v=s.vertexNormals[1],x=s.vertexNormals[2],n[t]=u.x,n[t+1]=u.y,n[t+2]=u.z,n[t+3]=v.x,n[t+4]=v.y,n[t+5]=v.z,n[t+6]=x.x,n[t+7]=x.y,n[t+8]=x.z):(u=s.normal,n[t]=u.x,n[t+1]=u.y,n[t+2]=u.z,n[t+3]=u.x,n[t+4]=u.y,n[t+5]=u.z,n[t+6]=u.x,n[t+7]=u.y,n[t+8]=u.z);f===THREE.FaceColors?(s=s.color,p[t]=s.r,p[t+1]=s.g,p[t+2]=s.b,p[t+3]=s.r,p[t+4]=s.g,p[t+5]=s.b,p[t+6]=s.r,p[t+7]=s.g,p[t+8]=s.b):f===THREE.VertexColors&&(u=s.vertexColors[0],v=s.vertexColors[1],s=s.vertexColors[2],p[t]=u.r,p[t+1]=u.g,p[t+2]=u.b,p[t+3]=
-v.r,p[t+4]=v.g,p[t+5]=v.b,p[t+6]=s.r,p[t+7]=s.g,p[t+8]=s.b);!0===g&&(s=e[0][m][0],u=e[0][m][1],v=e[0][m][2],q[r]=s.x,q[r+1]=s.y,q[r+2]=u.x,q[r+3]=u.y,q[r+4]=v.x,q[r+5]=v.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}if(void 0===
+new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(n,3));if(f!==THREE.NoColors){var p=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(p,3))}if(!0===g){var q=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(q,2))}for(var m=0,t=0,r=0;m<d.length;m++,t+=6,r+=9){var s=d[m],u=c[s.a],v=c[s.b],x=c[s.c];k[r]=u.x;k[r+1]=u.y;k[r+2]=u.z;k[r+3]=v.x;k[r+4]=v.y;k[r+5]=v.z;k[r+6]=x.x;k[r+7]=x.y;k[r+8]=x.z;!0===h?(u=s.vertexNormals[0],
+v=s.vertexNormals[1],x=s.vertexNormals[2],n[r]=u.x,n[r+1]=u.y,n[r+2]=u.z,n[r+3]=v.x,n[r+4]=v.y,n[r+5]=v.z,n[r+6]=x.x,n[r+7]=x.y,n[r+8]=x.z):(u=s.normal,n[r]=u.x,n[r+1]=u.y,n[r+2]=u.z,n[r+3]=u.x,n[r+4]=u.y,n[r+5]=u.z,n[r+6]=u.x,n[r+7]=u.y,n[r+8]=u.z);f===THREE.FaceColors?(s=s.color,p[r]=s.r,p[r+1]=s.g,p[r+2]=s.b,p[r+3]=s.r,p[r+4]=s.g,p[r+5]=s.b,p[r+6]=s.r,p[r+7]=s.g,p[r+8]=s.b):f===THREE.VertexColors&&(u=s.vertexColors[0],v=s.vertexColors[1],s=s.vertexColors[2],p[r]=u.r,p[r+1]=u.g,p[r+2]=u.b,p[r+3]=
+v.r,p[r+4]=v.g,p[r+5]=v.b,p[r+6]=s.r,p[r+7]=s.g,p[r+8]=s.b);!0===g&&(s=e[0][m][0],u=e[0][m][1],v=e[0][m][2],q[t]=s.x,q[t+1]=s.y,q[t+2]=u.x,q[t+3]=u.y,q[t+4]=v.x,q[t+5]=v.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}if(void 0===
 b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;
 if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=
-this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,q=new THREE.Vector3,m=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 v=t[s].index,d=e,e=e+f;d<e;d+=3)f=3*(v+r[d]),g=3*(v+r[d+1]),h=3*(v+r[d+2]),k.fromArray(b,f),n.fromArray(b,g),p.fromArray(b,h),q.subVectors(p,n),m.subVectors(k,n),q.cross(m),c[f]+=q.x,c[f+1]+=q.y,c[f+2]+=q.z,c[g]+=q.x,c[g+1]+=q.y,c[g+2]+=q.z,c[h]+=q.x,c[h+1]+=q.y,c[h+2]+=q.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),n.fromArray(b,d+3),p.fromArray(b,d+6),q.subVectors(p,n),m.subVectors(k,n),q.cross(m),c[d]=q.x,c[d+1]=q.y,c[d+2]=q.z,c[d+3]=q.x,c[d+4]=q.y,c[d+5]=q.z,c[d+6]=q.x,c[d+7]=q.y,
-c[d+8]=q.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q.fromArray(d,3*a);m.fromArray(d,3*b);r.fromArray(d,3*c);t.fromArray(f,2*a);s.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-q.x;x=r.x-q.x;E=m.y-q.y;w=r.y-q.y;M=m.z-q.z;y=r.z-q.z;C=s.x-t.x;D=u.x-t.x;A=s.y-t.y;B=u.y-t.y;G=1/(C*B-D*A);S.set((B*v-A*x)*G,(B*E-A*w)*G,(B*M-A*y)*G);K.set((C*x-D*v)*G,(C*w-D*E)*G,(C*y-D*M)*G);k[a].add(S);k[b].add(S);k[c].add(S);n[a].add(K);n[b].add(K);n[c].add(K)}function b(a){Ca.fromArray(e,
-3*a);O.copy(Ca);xa=k[a];ya.copy(xa);ya.sub(Ca.multiplyScalar(Ca.dot(xa))).normalize();oa.crossVectors(O,xa);za=oa.dot(n[a]);Ga=0>za?-1:1;h[4*a]=ya.x;h[4*a+1]=ya.y;h[4*a+2]=ya.z;h[4*a+3]=Ga}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("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=[],n=[],p=0;p<g;p++)k[p]=new THREE.Vector3,n[p]=new THREE.Vector3;var q=new THREE.Vector3,m=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector2,s=new THREE.Vector2,u=new THREE.Vector2,v,x,E,w,M,y,C,D,A,B,G,S=new THREE.Vector3,K=new THREE.Vector3,I,V,L,J,R;0===this.drawcalls.length&&
-this.addDrawCall(0,c.length,0);var Y=this.drawcalls,p=0;for(V=Y.length;p<V;++p){I=Y[p].start;L=Y[p].count;var T=Y[p].index,g=I;for(I+=L;g<I;g+=3)L=T+c[g],J=T+c[g+1],R=T+c[g+2],a(L,J,R)}var ya=new THREE.Vector3,oa=new THREE.Vector3,Ca=new THREE.Vector3,O=new THREE.Vector3,Ga,xa,za,p=0;for(V=Y.length;p<V;++p)for(I=Y[p].start,L=Y[p].count,T=Y[p].index,g=I,I+=L;g<I;g+=3)L=T+c[g],J=T+c[g+1],R=T+c[g+2],b(L),b(J),b(R)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;
-for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],n=0,p=0,q=new Int32Array(6),m=new Int32Array(c.length),r=new Int32Array(c.length),t=0;t<c.length;t++)m[t]=-1,r[t]=-1;for(c=0;c<d;c++){for(var s=p=0;3>s;s++)t=a[3*c+s],-1==m[t]?(q[2*s]=t,q[2*s+1]=-1,p++):m[t]<k.index?(q[2*s]=t,q[2*s+1]=-1,n++):(q[2*s]=t,q[2*s+1]=m[t]);if(g+p>k.index+b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)s=q[p+1],-1<s&&s<k.index&&(q[p+1]=
--1);for(p=0;6>p;p+=2)t=q[p],s=q[p+1],-1===s&&(s=g++),m[t]=s,r[s]=t,e[f++]=s-k.index,k.count++}this.reorderBuffers(e,r,g);return 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}},
+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,n=new THREE.Vector3,p=new THREE.Vector3,q=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var t=a.index.array,r=0<this.offsets.length?this.offsets:[{start:0,count:t.length,index:0}],s=0,u=r.length;s<u;++s){e=r[s].start;f=r[s].count;
+for(var v=r[s].index,d=e,e=e+f;d<e;d+=3)f=3*(v+t[d]),g=3*(v+t[d+1]),h=3*(v+t[d+2]),k.fromArray(b,f),n.fromArray(b,g),p.fromArray(b,h),q.subVectors(p,n),m.subVectors(k,n),q.cross(m),c[f]+=q.x,c[f+1]+=q.y,c[f+2]+=q.z,c[g]+=q.x,c[g+1]+=q.y,c[g+2]+=q.z,c[h]+=q.x,c[h+1]+=q.y,c[h+2]+=q.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),n.fromArray(b,d+3),p.fromArray(b,d+6),q.subVectors(p,n),m.subVectors(k,n),q.cross(m),c[d]=q.x,c[d+1]=q.y,c[d+2]=q.z,c[d+3]=q.x,c[d+4]=q.y,c[d+5]=q.z,c[d+6]=q.x,c[d+7]=q.y,
+c[d+8]=q.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q.fromArray(d,3*a);m.fromArray(d,3*b);t.fromArray(d,3*c);r.fromArray(f,2*a);s.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-q.x;x=t.x-q.x;J=m.y-q.y;w=t.y-q.y;P=m.z-q.z;y=t.z-q.z;C=s.x-r.x;D=u.x-r.x;A=s.y-r.y;B=u.y-r.y;G=1/(C*B-D*A);V.set((B*v-A*x)*G,(B*J-A*w)*G,(B*P-A*y)*G);M.set((C*x-D*v)*G,(C*w-D*J)*G,(C*y-D*P)*G);k[a].add(V);k[b].add(V);k[c].add(V);n[a].add(M);n[b].add(M);n[c].add(M)}function b(a){va.fromArray(e,
+3*a);L.copy(va);Da=k[a];ja.copy(Da);ja.sub(va.multiplyScalar(va.dot(Da))).normalize();da.crossVectors(L,Da);wa=da.dot(n[a]);Ea=0>wa?-1:1;h[4*a]=ja.x;h[4*a+1]=ja.y;h[4*a+2]=ja.z;h[4*a+3]=Ea}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("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=[],n=[],p=0;p<g;p++)k[p]=new THREE.Vector3,n[p]=new THREE.Vector3;var q=new THREE.Vector3,m=new THREE.Vector3,t=new THREE.Vector3,r=new THREE.Vector2,s=new THREE.Vector2,u=new THREE.Vector2,v,x,J,w,P,y,C,D,A,B,G,V=new THREE.Vector3,M=new THREE.Vector3,H,K,N,U,F;0===this.drawcalls.length&&
+this.addDrawCall(0,c.length,0);var W=this.drawcalls,p=0;for(K=W.length;p<K;++p){H=W[p].start;N=W[p].count;var S=W[p].index,g=H;for(H+=N;g<H;g+=3)N=S+c[g],U=S+c[g+1],F=S+c[g+2],a(N,U,F)}var ja=new THREE.Vector3,da=new THREE.Vector3,va=new THREE.Vector3,L=new THREE.Vector3,Ea,Da,wa,p=0;for(K=W.length;p<K;++p)for(H=W[p].start,N=W[p].count,S=W[p].index,g=H,H+=N;g<H;g+=3)N=S+c[g],U=S+c[g+1],F=S+c[g+2],b(N),b(U),b(F)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;
+for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],n=0,p=0,q=new Int32Array(6),m=new Int32Array(c.length),t=new Int32Array(c.length),r=0;r<c.length;r++)m[r]=-1,t[r]=-1;for(c=0;c<d;c++){for(var s=p=0;3>s;s++)r=a[3*c+s],-1==m[r]?(q[2*s]=r,q[2*s+1]=-1,p++):m[r]<k.index?(q[2*s]=r,q[2*s+1]=-1,n++):(q[2*s]=r,q[2*s+1]=m[r]);if(g+p>k.index+b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)s=q[p+1],-1<s&&s<k.index&&(q[p+1]=
+-1);for(p=0;6>p;p+=2)r=q[p],s=q[p+1],-1===s&&(s=g++),m[r]=s,t[s]=r,e[f++]=s-k.index,k.count++}this.reorderBuffers(e,t,g);return 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,n=d[e],p=0;p<k;p++)n[f*k+p]=h[g*
 k+p]}this.attributes.index.array=a;for(e in this.attributes)"index"!=e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},b=this.attributes,c=this.offsets,d=this.boundingSphere,e;for(e in b){for(var f=b[e],g=[],h=f.array,k=0,n=h.length;k<n;k++)g[k]=h[k];a.data.attributes[e]={itemSize:f.itemSize,type:f.array.constructor.name,
 array:g}}0<c.length&&(a.data.offsets=JSON.parse(JSON.stringify(c)));null!==d&&(a.data.boundingSphere={center:d.center.toArray(),radius:d.radius});return a},clone:function(){var a=new THREE.BufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count})}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);
@@ -207,16 +207,16 @@ g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){
 0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=
 e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=
 this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<
-d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,n,p,q,m,r,t,s,u,v=[],x=[];c=new THREE.Vector3;var E=new THREE.Vector3,w=new THREE.Vector3,M=new THREE.Vector3,y=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,x[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],
-n=f[0],p=f[1],q=f[2],f=h.x-g.x,m=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=p.x-n.x,s=q.x-n.x,p=p.y-n.y,n=q.y-n.y,q=1/(k*n-s*p),c.set((n*f-p*m)*q,(n*r-p*t)*q,(n*h-p*g)*q),E.set((k*m-s*f)*q,(k*t-s*r)*q,(k*g-s*h)*q),v[d].add(c),v[u].add(c),v[e].add(c),x[d].add(E),x[u].add(E),x[e].add(E);E=["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++)y.copy(e.vertexNormals[c]),d=e[E[c]],u=v[d],w.copy(u),w.sub(y.multiplyScalar(y.dot(u))).normalize(),
-M.crossVectors(e.vertexNormals[c],u),d=M.dot(x[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(w.x,w.y,w.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);
+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,n,p,q,m,t,r,s,u,v=[],x=[];c=new THREE.Vector3;var J=new THREE.Vector3,w=new THREE.Vector3,P=new THREE.Vector3,y=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,x[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],
+n=f[0],p=f[1],q=f[2],f=h.x-g.x,m=k.x-g.x,t=h.y-g.y,r=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=p.x-n.x,s=q.x-n.x,p=p.y-n.y,n=q.y-n.y,q=1/(k*n-s*p),c.set((n*f-p*m)*q,(n*t-p*r)*q,(n*h-p*g)*q),J.set((k*m-s*f)*q,(k*r-s*t)*q,(k*g-s*h)*q),v[d].add(c),v[u].add(c),v[e].add(c),x[d].add(J),x[u].add(J),x[e].add(J);J=["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++)y.copy(e.vertexNormals[c]),d=e[J[c]],u=v[d],w.copy(u),w.sub(y.multiplyScalar(y.dot(u))).normalize(),
+P.crossVectors(e.vertexNormals[c],u),d=P.dot(x[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(w.x,w.y,w.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);
 this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,k=a.faces,n=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var p=0,q=g.length;p<q;p++){var m=g[p].clone();void 0!==b&&m.applyMatrix4(b);f.push(m)}p=0;for(q=k.length;p<
-q;p++){var g=k[p],r,t=g.vertexNormals,s=g.vertexColors,m=new THREE.Face3(g.a+e,g.b+e,g.c+e);m.normal.copy(g.normal);void 0!==d&&m.normal.applyMatrix3(d).normalize();b=0;for(f=t.length;b<f;b++)r=t[b].clone(),void 0!==d&&r.applyMatrix3(d).normalize(),m.vertexNormals.push(r);m.color.copy(g.color);b=0;for(f=s.length;b<f;b++)r=s[b],m.vertexColors.push(r.clone());m.materialIndex=g.materialIndex+c;h.push(m)}p=0;for(q=a.length;p<q;p++)if(c=a[p],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());
+q;p++){var g=k[p],t,r=g.vertexNormals,s=g.vertexColors,m=new THREE.Face3(g.a+e,g.b+e,g.c+e);m.normal.copy(g.normal);void 0!==d&&m.normal.applyMatrix3(d).normalize();b=0;for(f=r.length;b<f;b++)t=r[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),m.vertexNormals.push(t);m.color.copy(g.color);b=0;for(f=s.length;b<f;b++)t=s[b],m.vertexColors.push(t.clone());m.materialIndex=g.materialIndex+c;h.push(m)}p=0;for(q=a.length;p<q;p++)if(c=a[p],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());
 n.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!==n[b])return n[b];n[b]=k.length/3;k.push(a.x,a.y,
-a.z);return n[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==q[b])return q[b];q[b]=p.length;p.push(a.getHex());return q[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==r[b])return r[b];r[b]=m.length/2;m.push(a.x,a.y);return r[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==
-f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],n={},p=[],q={},m=[],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(),v=0<t.vertexNormals.length,x=1!==t.color.r||1!==t.color.g||1!==t.color.b,E=0<t.vertexColors.length,w=0,w=a(w,0,0),w=a(w,1,!1),w=a(w,2,!1),w=a(w,3,s),w=a(w,4,u),w=a(w,5,v),w=a(w,6,x),w=a(w,7,E);h.push(w);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));v&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));x&&h.push(c(t.color));E&&(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<p.length&&(e.data.colors=p);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());b=this.faceVertexUvs[0];
+a.z);return n[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==q[b])return q[b];q[b]=p.length;p.push(a.getHex());return q[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==t[b])return t[b];t[b]=m.length/2;m.push(a.x,a.y);return t[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==
+f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],n={},p=[],q={},m=[],t={};for(g=0;g<this.faces.length;g++){var r=this.faces[g],s=void 0!==this.faceVertexUvs[0][g],u=0<r.normal.length(),v=0<r.vertexNormals.length,x=1!==r.color.r||1!==r.color.g||1!==r.color.b,J=0<r.vertexColors.length,w=0,w=a(w,0,0),w=a(w,1,!1),w=a(w,2,!1),w=a(w,3,s),w=a(w,4,u),w=a(w,5,v),w=a(w,6,x),w=a(w,7,J);h.push(w);h.push(r.a,r.b,r.c);s&&(s=this.faceVertexUvs[0][g],
+h.push(d(s[0]),d(s[1]),d(s[2])));u&&h.push(b(r.normal));v&&(u=r.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));x&&h.push(c(r.color));J&&(r=r.vertexColors,h.push(c(r[0]),c(r[1]),c(r[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<p.length&&(e.data.colors=p);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());b=this.faceVertexUvs[0];
 c=0;for(d=b.length;c<d;c++){for(var e=b[c],f=[],g=0,h=e.length;g<h;g++)f.push(new THREE.Vector2(e[g].x,e[g].y));a.faceVertexUvs[0].push(f)}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,-1).applyQuaternion(a)}}();THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
 THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};
@@ -260,10 +260,10 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
 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);if(void 0!==h.metadata&&"scene"===h.metadata.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,n,p,q,m,r,t,s,u,v,x=a.faces;p=a.vertices;var E=a.normals,w=a.colors,M=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&M++;for(d=0;d<M;d++)c.faceVertexUvs[d]=[]}k=0;for(n=p.length;k<n;)d=new THREE.Vector3,d.x=p[k++]*b,d.y=p[k++]*b,d.z=p[k++]*b,c.vertices.push(d);k=0;for(n=x.length;k<n;)if(b=x[k++],r=b&1,h=b&2,d=b&8,q=b&16,t=b&32,p=b&64,b&=128,r){r=new THREE.Face3;
-r.a=x[k];r.b=x[k+1];r.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&&(h=x[k++],r.materialIndex=h,s.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<M;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=x[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);q&&(q=3*x[k++],r.normal.set(E[q++],E[q++],E[q]),s.normal.copy(r.normal));if(t)for(d=0;4>d;d++)q=3*x[k++],t=new THREE.Vector3(E[q++],
-E[q++],E[q]),2!==d&&r.vertexNormals.push(t),0!==d&&s.vertexNormals.push(t);p&&(p=x[k++],p=w[p],r.color.setHex(p),s.color.setHex(p));if(b)for(d=0;4>d;d++)p=x[k++],p=w[p],2!==d&&r.vertexColors.push(new THREE.Color(p)),0!==d&&s.vertexColors.push(new THREE.Color(p));c.faces.push(r);c.faces.push(s)}else{r=new THREE.Face3;r.a=x[k++];r.b=x[k++];r.c=x[k++];h&&(h=x[k++],r.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<M;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=x[k++],v=u[2*m],m=u[2*m+1],
-v=new THREE.Vector2(v,m),c.faceVertexUvs[d][h].push(v);q&&(q=3*x[k++],r.normal.set(E[q++],E[q++],E[q]));if(t)for(d=0;3>d;d++)q=3*x[k++],t=new THREE.Vector3(E[q++],E[q++],E[q]),r.vertexNormals.push(t);p&&(p=x[k++],r.color.setHex(w[p]));if(b)for(d=0;3>d;d++)p=x[k++],r.vertexColors.push(new THREE.Color(w[p]));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],
+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,n,p,q,m,t,r,s,u,v,x=a.faces;p=a.vertices;var J=a.normals,w=a.colors,P=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&P++;for(d=0;d<P;d++)c.faceVertexUvs[d]=[]}k=0;for(n=p.length;k<n;)d=new THREE.Vector3,d.x=p[k++]*b,d.y=p[k++]*b,d.z=p[k++]*b,c.vertices.push(d);k=0;for(n=x.length;k<n;)if(b=x[k++],t=b&1,h=b&2,d=b&8,q=b&16,r=b&32,p=b&64,b&=128,t){t=new THREE.Face3;
+t.a=x[k];t.b=x[k+1];t.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&&(h=x[k++],t.materialIndex=h,s.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<P;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=x[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);q&&(q=3*x[k++],t.normal.set(J[q++],J[q++],J[q]),s.normal.copy(t.normal));if(r)for(d=0;4>d;d++)q=3*x[k++],r=new THREE.Vector3(J[q++],
+J[q++],J[q]),2!==d&&t.vertexNormals.push(r),0!==d&&s.vertexNormals.push(r);p&&(p=x[k++],p=w[p],t.color.setHex(p),s.color.setHex(p));if(b)for(d=0;4>d;d++)p=x[k++],p=w[p],2!==d&&t.vertexColors.push(new THREE.Color(p)),0!==d&&s.vertexColors.push(new THREE.Color(p));c.faces.push(t);c.faces.push(s)}else{t=new THREE.Face3;t.a=x[k++];t.b=x[k++];t.c=x[k++];h&&(h=x[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<P;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=x[k++],v=u[2*m],m=u[2*m+1],
+v=new THREE.Vector2(v,m),c.faceVertexUvs[d][h].push(v);q&&(q=3*x[k++],t.normal.set(J[q++],J[q++],J[q]));if(r)for(d=0;3>d;d++)q=3*x[k++],r=new THREE.Vector3(J[q++],J[q++],J[q]),t.vertexNormals.push(r);p&&(p=x[k++],t.color.setHex(w[p]));if(b)for(d=0;3>d;d++)p=x[k++],t.vertexColors.push(new THREE.Color(w[p]));c.faces.push(t)}})(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("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,n,p;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=[],n=c.morphTargets[d].vertices,p=a.morphTargets[d].vertices,h=0,k=p.length;h<k;h+=3){var q=new THREE.Vector3;q.x=p[h]*b;q.y=p[h+1]*b;q.z=p[h+2]*b;n.push(q)}}if(void 0!==a.morphColors)for(d=
 0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,n=a.morphColors[d].colors,b=0,h=n.length;b<h;b+=3)p=new THREE.Color(16755200),p.setRGB(n[b],n[b+1],n[b+2]),k.push(p)})(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}};
@@ -330,11 +330,10 @@ this.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY
 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,n,p){THREE.Texture.call(this,null,f,g,h,k,n,d,e,p);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,n,p){THREE.Texture.call(this,null,f,g,h,k,n,d,e,p);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 n=this,p=function(){requestAnimationFrame(p);a.readyState===a.HAVE_ENOUGH_DATA&&(n.needsUpdate=!0)};p()};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()});this.sortParticles=!1};THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);
-THREE.PointCloud.prototype.constructor=THREE.PointCloud;
+THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);THREE.Group.prototype.constructor=THREE.Group;THREE.PointCloud=function(a,b){THREE.Object3D.call(this);this.type="PointCloud";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()})};THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);THREE.PointCloud.prototype.constructor=THREE.PointCloud;
 THREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this,f=e.geometry,g=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===f.boundingBox||!1!==b.isIntersectionBox(f.boundingBox)){var h=g/((this.scale.x+this.scale.y+this.scale.z)/3),k=new THREE.Vector3,g=function(a,f){var g=b.distanceToPoint(a);if(g<h){var k=b.closestPointToPoint(a);k.applyMatrix4(e.matrixWorld);var m=c.ray.origin.distanceTo(k);
-d.push({distance:m,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var n=f.attributes,p=n.position.array;if(void 0!==n.index){var n=n.index.array,q=f.offsets;0===q.length&&(q=[{start:0,count:n.length,index:0}]);for(var m=0,r=q.length;m<r;++m)for(var t=q[m].start,s=q[m].index,f=t,t=t+q[m].count;f<t;f++){var u=s+n[f];k.fromArray(p,3*u);g(k,u)}}else for(n=p.length/3,f=0;f<n;f++)k.set(p[3*f],p[3*f+1],p[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));a.sortParticles=this.sortParticles;THREE.Object3D.prototype.clone.call(this,a);return a};THREE.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};
+d.push({distance:m,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var n=f.attributes,p=n.position.array;if(void 0!==n.index){var n=n.index.array,q=f.offsets;0===q.length&&(q=[{start:0,count:n.length,index:0}]);for(var m=0,t=q.length;m<t;++m)for(var r=q[m].start,s=q[m].index,f=r,r=r+q[m].count;f<r;f++){var u=s+n[f];k.fromArray(p,3*u);g(k,u)}}else for(n=p.length/3,f=0;f<n;f++)k.set(p[3*f],p[3*f+1],p[3*f+2]),g(k,f)}else for(k=this.geometry.vertices,
+f=0;f<k.length;f++)g(k[f],f)}}}();THREE.PointCloud.prototype.clone=function(a){void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};
 THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.type="Line";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()});this.mode=void 0!==c?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=Object.create(THREE.Object3D.prototype);THREE.Line.prototype.constructor=THREE.Line;
 THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(d.ray).applyMatrix4(a),g instanceof THREE.Geometry))for(var g=g.vertices,h=g.length,k=new THREE.Vector3,n=new THREE.Vector3,p=this.mode===THREE.LineStrip?
 1:2,q=0;q<h-1;q+=p)if(!(b.distanceSqToSegment(g[q],g[q+1],n,k)>f)){var m=b.origin.distanceTo(n);m<d.near||m>d.far||e.push({distance:m,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.mode));THREE.Object3D.prototype.clone.call(this,a);return a};
@@ -342,11 +341,11 @@ THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometr
 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.log("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 n=
-this.material;if(void 0!==n){var p=k.attributes,q,m,r=g.precision;if(void 0!==p.index){var t=p.index.array,s=p.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:t.length,index:0}]);for(var v=0,x=u.length;v<x;++v)for(var p=u[v].start,E=u[v].index,k=p,w=p+u[v].count;k<w;k+=3){p=E+t[k];q=E+t[k+1];m=E+t[k+2];d.fromArray(s,3*p);e.fromArray(s,3*q);f.fromArray(s,3*m);var M=n.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,n.side!==THREE.DoubleSide);if(null!==M){M.applyMatrix4(this.matrixWorld);
-var y=g.ray.origin.distanceTo(M);y<r||y<g.near||y>g.far||h.push({distance:y,point:M,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(s=p.position.array,t=k=0,w=s.length;k<w;k+=3,t+=9)p=k,q=k+1,m=k+2,d.fromArray(s,t),e.fromArray(s,t+3),f.fromArray(s,t+6),M=n.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,n.side!==THREE.DoubleSide),null!==M&&(M.applyMatrix4(this.matrixWorld),y=g.ray.origin.distanceTo(M),y<r||y<g.near||y>
-g.far||h.push({distance:y,point:M,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,s=!0===t?this.material.materials:null,r=g.precision,u=k.vertices,v=0,x=k.faces.length;v<x;v++)if(E=k.faces[v],n=!0===t?s[E.materialIndex]:this.material,void 0!==n){p=u[E.a];q=u[E.b];m=u[E.c];if(!0===n.morphTargets){M=k.morphTargets;y=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
-0,0);for(var w=0,C=M.length;w<C;w++){var D=y[w];if(0!==D){var A=M[w].vertices;d.x+=(A[E.a].x-p.x)*D;d.y+=(A[E.a].y-p.y)*D;d.z+=(A[E.a].z-p.z)*D;e.x+=(A[E.b].x-q.x)*D;e.y+=(A[E.b].y-q.y)*D;e.z+=(A[E.b].z-q.z)*D;f.x+=(A[E.c].x-m.x)*D;f.y+=(A[E.c].y-m.y)*D;f.z+=(A[E.c].z-m.z)*D}}d.add(p);e.add(q);f.add(m);p=d;q=e;m=f}M=n.side===THREE.BackSide?b.intersectTriangle(m,q,p,!0):b.intersectTriangle(p,q,m,n.side!==THREE.DoubleSide);null!==M&&(M.applyMatrix4(this.matrixWorld),y=g.ray.origin.distanceTo(M),y<r||
-y<g.near||y>g.far||h.push({distance:y,point:M,face:E,faceIndex:v,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;
+this.material;if(void 0!==n){var p=k.attributes,q,m,t=g.precision;if(void 0!==p.index){var r=p.index.array,s=p.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:r.length,index:0}]);for(var v=0,x=u.length;v<x;++v)for(var p=u[v].start,J=u[v].index,k=p,w=p+u[v].count;k<w;k+=3){p=J+r[k];q=J+r[k+1];m=J+r[k+2];d.fromArray(s,3*p);e.fromArray(s,3*q);f.fromArray(s,3*m);var P=n.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,n.side!==THREE.DoubleSide);if(null!==P){P.applyMatrix4(this.matrixWorld);
+var y=g.ray.origin.distanceTo(P);y<t||y<g.near||y>g.far||h.push({distance:y,point:P,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(s=p.position.array,r=k=0,w=s.length;k<w;k+=3,r+=9)p=k,q=k+1,m=k+2,d.fromArray(s,r),e.fromArray(s,r+3),f.fromArray(s,r+6),P=n.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,n.side!==THREE.DoubleSide),null!==P&&(P.applyMatrix4(this.matrixWorld),y=g.ray.origin.distanceTo(P),y<t||y<g.near||y>
+g.far||h.push({distance:y,point:P,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(r=this.material instanceof THREE.MeshFaceMaterial,s=!0===r?this.material.materials:null,t=g.precision,u=k.vertices,v=0,x=k.faces.length;v<x;v++)if(J=k.faces[v],n=!0===r?s[J.materialIndex]:this.material,void 0!==n){p=u[J.a];q=u[J.b];m=u[J.c];if(!0===n.morphTargets){P=k.morphTargets;y=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
+0,0);for(var w=0,C=P.length;w<C;w++){var D=y[w];if(0!==D){var A=P[w].vertices;d.x+=(A[J.a].x-p.x)*D;d.y+=(A[J.a].y-p.y)*D;d.z+=(A[J.a].z-p.z)*D;e.x+=(A[J.b].x-q.x)*D;e.y+=(A[J.b].y-q.y)*D;e.z+=(A[J.b].z-q.z)*D;f.x+=(A[J.c].x-m.x)*D;f.y+=(A[J.c].y-m.y)*D;f.z+=(A[J.c].z-m.z)*D}}d.add(p);e.add(q);f.add(m);p=d;q=e;m=f}P=n.side===THREE.BackSide?b.intersectTriangle(m,q,p,!0):b.intersectTriangle(p,q,m,n.side!==THREE.DoubleSide);null!==P&&(P.applyMatrix4(this.matrixWorld),y=g.ray.origin.distanceTo(P),y<t||
+y<g.near||y>g.far||h.push({distance:y,point:P,face:J,faceIndex:v,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;
 THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),
 this.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};
 THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}};
@@ -439,200 +438,198 @@ THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},v
 THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}};
 THREE.WebGLRenderer=function(a){function b(a){var b=a.geometry;a=a.material;var c=b.vertices.length;if(a.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var d in a.attributes){var e=a.attributes[d];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var f=1;"v2"===e.type?f=2:"v3"===e.type?f=3:"v4"===e.type?f=4:"c"===e.type&&(f=3);e.size=f;e.array=new Float32Array(c*f);e.buffer=l.createBuffer();e.buffer.belongsToAttribute=d;e.needsUpdate=
 !0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){var c=b.geometry,e=a.faces3,f=3*e.length,g=1*e.length,h=3*e.length,e=d(b,a);a.__vertexArray=new Float32Array(3*f);a.__normalArray=new Float32Array(3*f);a.__colorArray=new Float32Array(3*f);a.__uvArray=new Float32Array(2*f);1<c.faceVertexUvs.length&&(a.__uv2Array=new Float32Array(2*f));c.hasTangents&&(a.__tangentArray=new Float32Array(4*f));b.geometry.skinWeights.length&&b.geometry.skinIndices.length&&(a.__skinIndexArray=new Float32Array(4*
-f),a.__skinWeightArray=new Float32Array(4*f));c=null!==ha.get("OES_element_index_uint")&&21845<g?Uint32Array:Uint16Array;a.__typeArray=c;a.__faceArray=new c(3*g);a.__lineArray=new c(2*h);var k;if(a.numMorphTargets)for(a.__morphTargetsArrays=[],c=0,k=a.numMorphTargets;c<k;c++)a.__morphTargetsArrays.push(new Float32Array(3*f));if(a.numMorphNormals)for(a.__morphNormalsArrays=[],c=0,k=a.numMorphNormals;c<k;c++)a.__morphNormalsArrays.push(new Float32Array(3*f));a.__webglFaceCount=3*g;a.__webglLineCount=
+f),a.__skinWeightArray=new Float32Array(4*f));c=null!==ka.get("OES_element_index_uint")&&21845<g?Uint32Array:Uint16Array;a.__typeArray=c;a.__faceArray=new c(3*g);a.__lineArray=new c(2*h);var k;if(a.numMorphTargets)for(a.__morphTargetsArrays=[],c=0,k=a.numMorphTargets;c<k;c++)a.__morphTargetsArrays.push(new Float32Array(3*f));if(a.numMorphNormals)for(a.__morphNormalsArrays=[],c=0,k=a.numMorphNormals;c<k;c++)a.__morphNormalsArrays.push(new Float32Array(3*f));a.__webglFaceCount=3*g;a.__webglLineCount=
 2*h;if(e.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var m in e.attributes){var g=e.attributes[m],h={},n;for(n in g)h[n]=g[n];if(!h.__webglInitialized||h.createUniqueBuffers)h.__webglInitialized=!0,c=1,"v2"===h.type?c=2:"v3"===h.type?c=3:"v4"===h.type?c=4:"c"===h.type&&(c=3),h.size=c,h.array=new Float32Array(f*c),h.buffer=l.createBuffer(),h.buffer.belongsToAttribute=m,g.needsUpdate=!0,h.__original=g;a.__webglCustomAttributesList.push(h)}}a.__inittedArrays=
 !0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var f=0,k=b.length;f<k;f++){var m=b[f],n=e[m];if(0<=n){var p=c[m];void 0!==p?(m=p.itemSize,l.bindBuffer(l.ARRAY_BUFFER,p.buffer),g(n),l.vertexAttribPointer(n,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(n,a.defaultAttributeValues[m]):
-3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(n,a.defaultAttributeValues[m]))}}h()}function f(){for(var a=0,b=Ob.length;a<b;a++)Ob[a]=0}function g(a){Ob[a]=1;0===Za[a]&&(l.enableVertexAttribArray(a),Za[a]=1)}function h(){for(var a=0,b=Za.length;a<b;a++)Za[a]!==Ob[a]&&(l.disableVertexAttribArray(a),Za[a]=0)}function k(a,b){return a.material.id!==b.material.id?b.material.id-a.material.id:a.z!==b.z?b.z-a.z:a.id-b.id}function n(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return b[0]-
-a[0]}function q(a,e){if(!1!==e.visible){if(!(e instanceof THREE.Scene||e instanceof THREE.Group)){void 0===e.__webglInit&&(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrix=new THREE.Matrix3,e.addEventListener("removed",Hc));var f=e.geometry;if(void 0!==f&&void 0===f.__webglInit&&(f.__webglInit=!0,f.addEventListener("dispose",Ic),!(f instanceof THREE.BufferGeometry)))if(e instanceof THREE.Mesh)s(a,e,f);else if(e instanceof THREE.Line){if(void 0===f.__webglVertexBuffer){f.__webglVertexBuffer=
-l.createBuffer();f.__webglColorBuffer=l.createBuffer();f.__webglLineDistanceBuffer=l.createBuffer();H.info.memory.geometries++;var g=f.vertices.length;f.__vertexArray=new Float32Array(3*g);f.__colorArray=new Float32Array(3*g);f.__lineDistanceArray=new Float32Array(1*g);f.__webglLineCount=g;b(e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0;f.lineDistancesNeedUpdate=!0}}else if(e instanceof THREE.PointCloud&&void 0===f.__webglVertexBuffer){f.__webglVertexBuffer=l.createBuffer();f.__webglColorBuffer=
-l.createBuffer();H.info.memory.geometries++;var h=f.vertices.length;f.__vertexArray=new Float32Array(3*h);f.__colorArray=new Float32Array(3*h);f.__sortArray=[];f.__webglParticleCount=h;b(e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0}if(void 0===e.__webglActive)if(e.__webglActive=!0,e instanceof THREE.Mesh)if(f instanceof THREE.BufferGeometry)u(fb,f,e);else{if(f instanceof THREE.Geometry)for(var k=ob[f.id],m=0,n=k.length;m<n;m++)u(fb,k[m],e)}else e instanceof THREE.Line||e instanceof THREE.PointCloud?
-u(fb,f,e):(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)&&pb.push({id:null,object:e,opaque:null,transparent:null,z:0});if(e instanceof THREE.Light)eb.push(e);else if(e instanceof THREE.Sprite)xb.push(e);else if(e instanceof THREE.LensFlare)Ra.push(e);else{var t=fb[e.id];if(t&&(!1===e.frustumCulled||!0===Ec.intersectsObject(e))){var r=e.geometry,w,E;if(r instanceof THREE.BufferGeometry)for(var y=r.attributes,C=r.attributesKeys,D=0,B=C.length;D<B;D++){var A=C[D],M=y[A];void 0===
-M.buffer&&(M.buffer=l.createBuffer(),M.needsUpdate=!0);if(!0===M.needsUpdate){var G="index"===A?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;l.bindBuffer(G,M.buffer);l.bufferData(G,M.array,l.STATIC_DRAW);M.needsUpdate=!1}}else if(e instanceof THREE.Mesh){!0===r.groupsNeedUpdate&&s(a,e,r);for(var L=ob[r.id],K=0,I=L.length;K<I;K++){var R=L[K];E=d(e,R);!0===r.groupsNeedUpdate&&c(R,e);w=E.attributes&&v(E);if(r.verticesNeedUpdate||r.morphTargetsNeedUpdate||r.elementsNeedUpdate||r.uvsNeedUpdate||r.normalsNeedUpdate||
-r.colorsNeedUpdate||r.tangentsNeedUpdate||w){var J=R,O=e,S=l.DYNAMIC_DRAW,T=!r.dynamic,Y=E;if(J.__inittedArrays){var V=Y&&void 0!==Y.shading&&Y.shading===THREE.SmoothShading,P=void 0,Z=void 0,ha=void 0,da=void 0,oa=void 0,ta=void 0,xa=void 0,ya=void 0,db=void 0,za=void 0,Ca=void 0,ba=void 0,aa=void 0,$=void 0,lc=void 0,pa=void 0,N=void 0,Ga=void 0,ma=void 0,mc=void 0,ja=void 0,nc=void 0,oc=void 0,pc=void 0,Ba=void 0,qc=void 0,yb=void 0,Ha=void 0,zb=void 0,Aa=void 0,ua=void 0,Ab=void 0,Oa=void 0,Pb=
-void 0,Ma=void 0,Za=void 0,Ya=void 0,$a=void 0,uc=void 0,Qb=void 0,gb=0,hb=0,rb=0,sb=0,Bb=0,Sa=0,Da=0,Pa=0,Ka=0,ka=0,ra=0,F=0,Ia=void 0,Qa=J.__vertexArray,tb=J.__uvArray,ib=J.__uv2Array,Ta=J.__normalArray,qa=J.__tangentArray,La=J.__colorArray,Ua=J.__skinIndexArray,Va=J.__skinWeightArray,Cb=J.__morphTargetsArrays,Jc=J.__morphNormalsArrays,Hb=J.__webglCustomAttributesList,z=void 0,Rb=J.__faceArray,Ja=J.__lineArray,va=O.geometry,ab=va.elementsNeedUpdate,Kc=va.uvsNeedUpdate,dc=va.normalsNeedUpdate,ea=
-va.tangentsNeedUpdate,Ob=va.colorsNeedUpdate,U=va.morphTargetsNeedUpdate,fa=va.vertices,Q=J.faces3,wa=va.faces,sa=va.faceVertexUvs[0],Lc=va.faceVertexUvs[1],Fc=va.skinIndices,Sb=va.skinWeights,kb=va.morphTargets,Ea=va.morphNormals;if(va.verticesNeedUpdate){P=0;for(Z=Q.length;P<Z;P++)da=wa[Q[P]],ba=fa[da.a],aa=fa[da.b],$=fa[da.c],Qa[hb]=ba.x,Qa[hb+1]=ba.y,Qa[hb+2]=ba.z,Qa[hb+3]=aa.x,Qa[hb+4]=aa.y,Qa[hb+5]=aa.z,Qa[hb+6]=$.x,Qa[hb+7]=$.y,Qa[hb+8]=$.z,hb+=9;l.bindBuffer(l.ARRAY_BUFFER,J.__webglVertexBuffer);
-l.bufferData(l.ARRAY_BUFFER,Qa,S)}if(U)for(Ma=0,Za=kb.length;Ma<Za;Ma++){P=ra=0;for(Z=Q.length;P<Z;P++)uc=Q[P],da=wa[uc],ba=kb[Ma].vertices[da.a],aa=kb[Ma].vertices[da.b],$=kb[Ma].vertices[da.c],Ya=Cb[Ma],Ya[ra]=ba.x,Ya[ra+1]=ba.y,Ya[ra+2]=ba.z,Ya[ra+3]=aa.x,Ya[ra+4]=aa.y,Ya[ra+5]=aa.z,Ya[ra+6]=$.x,Ya[ra+7]=$.y,Ya[ra+8]=$.z,Y.morphNormals&&(V?(Qb=Ea[Ma].vertexNormals[uc],Ga=Qb.a,ma=Qb.b,mc=Qb.c):mc=ma=Ga=Ea[Ma].faceNormals[uc],$a=Jc[Ma],$a[ra]=Ga.x,$a[ra+1]=Ga.y,$a[ra+2]=Ga.z,$a[ra+3]=ma.x,$a[ra+
-4]=ma.y,$a[ra+5]=ma.z,$a[ra+6]=mc.x,$a[ra+7]=mc.y,$a[ra+8]=mc.z),ra+=9;l.bindBuffer(l.ARRAY_BUFFER,J.__webglMorphTargetsBuffers[Ma]);l.bufferData(l.ARRAY_BUFFER,Cb[Ma],S);Y.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,J.__webglMorphNormalsBuffers[Ma]),l.bufferData(l.ARRAY_BUFFER,Jc[Ma],S))}if(Sb.length){P=0;for(Z=Q.length;P<Z;P++)da=wa[Q[P]],pc=Sb[da.a],Ba=Sb[da.b],qc=Sb[da.c],Va[ka]=pc.x,Va[ka+1]=pc.y,Va[ka+2]=pc.z,Va[ka+3]=pc.w,Va[ka+4]=Ba.x,Va[ka+5]=Ba.y,Va[ka+6]=Ba.z,Va[ka+7]=Ba.w,Va[ka+8]=qc.x,
-Va[ka+9]=qc.y,Va[ka+10]=qc.z,Va[ka+11]=qc.w,yb=Fc[da.a],Ha=Fc[da.b],zb=Fc[da.c],Ua[ka]=yb.x,Ua[ka+1]=yb.y,Ua[ka+2]=yb.z,Ua[ka+3]=yb.w,Ua[ka+4]=Ha.x,Ua[ka+5]=Ha.y,Ua[ka+6]=Ha.z,Ua[ka+7]=Ha.w,Ua[ka+8]=zb.x,Ua[ka+9]=zb.y,Ua[ka+10]=zb.z,Ua[ka+11]=zb.w,ka+=12;0<ka&&(l.bindBuffer(l.ARRAY_BUFFER,J.__webglSkinIndicesBuffer),l.bufferData(l.ARRAY_BUFFER,Ua,S),l.bindBuffer(l.ARRAY_BUFFER,J.__webglSkinWeightsBuffer),l.bufferData(l.ARRAY_BUFFER,Va,S))}if(Ob){P=0;for(Z=Q.length;P<Z;P++)da=wa[Q[P]],xa=da.vertexColors,
-ya=da.color,3===xa.length&&Y.vertexColors===THREE.VertexColors?(ja=xa[0],nc=xa[1],oc=xa[2]):oc=nc=ja=ya,La[Ka]=ja.r,La[Ka+1]=ja.g,La[Ka+2]=ja.b,La[Ka+3]=nc.r,La[Ka+4]=nc.g,La[Ka+5]=nc.b,La[Ka+6]=oc.r,La[Ka+7]=oc.g,La[Ka+8]=oc.b,Ka+=9;0<Ka&&(l.bindBuffer(l.ARRAY_BUFFER,J.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,La,S))}if(ea&&va.hasTangents){P=0;for(Z=Q.length;P<Z;P++)da=wa[Q[P]],db=da.vertexTangents,lc=db[0],pa=db[1],N=db[2],qa[Da]=lc.x,qa[Da+1]=lc.y,qa[Da+2]=lc.z,qa[Da+3]=lc.w,qa[Da+4]=pa.x,
-qa[Da+5]=pa.y,qa[Da+6]=pa.z,qa[Da+7]=pa.w,qa[Da+8]=N.x,qa[Da+9]=N.y,qa[Da+10]=N.z,qa[Da+11]=N.w,Da+=12;l.bindBuffer(l.ARRAY_BUFFER,J.__webglTangentBuffer);l.bufferData(l.ARRAY_BUFFER,qa,S)}if(dc){P=0;for(Z=Q.length;P<Z;P++)if(da=wa[Q[P]],oa=da.vertexNormals,ta=da.normal,3===oa.length&&V)for(Aa=0;3>Aa;Aa++)Ab=oa[Aa],Ta[Sa]=Ab.x,Ta[Sa+1]=Ab.y,Ta[Sa+2]=Ab.z,Sa+=3;else for(Aa=0;3>Aa;Aa++)Ta[Sa]=ta.x,Ta[Sa+1]=ta.y,Ta[Sa+2]=ta.z,Sa+=3;l.bindBuffer(l.ARRAY_BUFFER,J.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,
-Ta,S)}if(Kc&&sa){P=0;for(Z=Q.length;P<Z;P++)if(ha=Q[P],za=sa[ha],void 0!==za)for(Aa=0;3>Aa;Aa++)Oa=za[Aa],tb[rb]=Oa.x,tb[rb+1]=Oa.y,rb+=2;0<rb&&(l.bindBuffer(l.ARRAY_BUFFER,J.__webglUVBuffer),l.bufferData(l.ARRAY_BUFFER,tb,S))}if(Kc&&Lc){P=0;for(Z=Q.length;P<Z;P++)if(ha=Q[P],Ca=Lc[ha],void 0!==Ca)for(Aa=0;3>Aa;Aa++)Pb=Ca[Aa],ib[sb]=Pb.x,ib[sb+1]=Pb.y,sb+=2;0<sb&&(l.bindBuffer(l.ARRAY_BUFFER,J.__webglUV2Buffer),l.bufferData(l.ARRAY_BUFFER,ib,S))}if(ab){P=0;for(Z=Q.length;P<Z;P++)Rb[Bb]=gb,Rb[Bb+1]=
-gb+1,Rb[Bb+2]=gb+2,Bb+=3,Ja[Pa]=gb,Ja[Pa+1]=gb+1,Ja[Pa+2]=gb,Ja[Pa+3]=gb+2,Ja[Pa+4]=gb+1,Ja[Pa+5]=gb+2,Pa+=6,gb+=3;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,J.__webglFaceBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,Rb,S);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,J.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,Ja,S)}if(Hb)for(Aa=0,ua=Hb.length;Aa<ua;Aa++)if(z=Hb[Aa],z.__original.needsUpdate){F=0;if(1===z.size)if(void 0===z.boundTo||"vertices"===z.boundTo)for(P=0,Z=Q.length;P<Z;P++)da=wa[Q[P]],z.array[F]=
-z.value[da.a],z.array[F+1]=z.value[da.b],z.array[F+2]=z.value[da.c],F+=3;else{if("faces"===z.boundTo)for(P=0,Z=Q.length;P<Z;P++)Ia=z.value[Q[P]],z.array[F]=Ia,z.array[F+1]=Ia,z.array[F+2]=Ia,F+=3}else if(2===z.size)if(void 0===z.boundTo||"vertices"===z.boundTo)for(P=0,Z=Q.length;P<Z;P++)da=wa[Q[P]],ba=z.value[da.a],aa=z.value[da.b],$=z.value[da.c],z.array[F]=ba.x,z.array[F+1]=ba.y,z.array[F+2]=aa.x,z.array[F+3]=aa.y,z.array[F+4]=$.x,z.array[F+5]=$.y,F+=6;else{if("faces"===z.boundTo)for(P=0,Z=Q.length;P<
-Z;P++)$=aa=ba=Ia=z.value[Q[P]],z.array[F]=ba.x,z.array[F+1]=ba.y,z.array[F+2]=aa.x,z.array[F+3]=aa.y,z.array[F+4]=$.x,z.array[F+5]=$.y,F+=6}else if(3===z.size){var la;la="c"===z.type?["r","g","b"]:["x","y","z"];if(void 0===z.boundTo||"vertices"===z.boundTo)for(P=0,Z=Q.length;P<Z;P++)da=wa[Q[P]],ba=z.value[da.a],aa=z.value[da.b],$=z.value[da.c],z.array[F]=ba[la[0]],z.array[F+1]=ba[la[1]],z.array[F+2]=ba[la[2]],z.array[F+3]=aa[la[0]],z.array[F+4]=aa[la[1]],z.array[F+5]=aa[la[2]],z.array[F+6]=$[la[0]],
-z.array[F+7]=$[la[1]],z.array[F+8]=$[la[2]],F+=9;else if("faces"===z.boundTo)for(P=0,Z=Q.length;P<Z;P++)$=aa=ba=Ia=z.value[Q[P]],z.array[F]=ba[la[0]],z.array[F+1]=ba[la[1]],z.array[F+2]=ba[la[2]],z.array[F+3]=aa[la[0]],z.array[F+4]=aa[la[1]],z.array[F+5]=aa[la[2]],z.array[F+6]=$[la[0]],z.array[F+7]=$[la[1]],z.array[F+8]=$[la[2]],F+=9;else if("faceVertices"===z.boundTo)for(P=0,Z=Q.length;P<Z;P++)Ia=z.value[Q[P]],ba=Ia[0],aa=Ia[1],$=Ia[2],z.array[F]=ba[la[0]],z.array[F+1]=ba[la[1]],z.array[F+2]=ba[la[2]],
-z.array[F+3]=aa[la[0]],z.array[F+4]=aa[la[1]],z.array[F+5]=aa[la[2]],z.array[F+6]=$[la[0]],z.array[F+7]=$[la[1]],z.array[F+8]=$[la[2]],F+=9}else if(4===z.size)if(void 0===z.boundTo||"vertices"===z.boundTo)for(P=0,Z=Q.length;P<Z;P++)da=wa[Q[P]],ba=z.value[da.a],aa=z.value[da.b],$=z.value[da.c],z.array[F]=ba.x,z.array[F+1]=ba.y,z.array[F+2]=ba.z,z.array[F+3]=ba.w,z.array[F+4]=aa.x,z.array[F+5]=aa.y,z.array[F+6]=aa.z,z.array[F+7]=aa.w,z.array[F+8]=$.x,z.array[F+9]=$.y,z.array[F+10]=$.z,z.array[F+11]=
-$.w,F+=12;else if("faces"===z.boundTo)for(P=0,Z=Q.length;P<Z;P++)$=aa=ba=Ia=z.value[Q[P]],z.array[F]=ba.x,z.array[F+1]=ba.y,z.array[F+2]=ba.z,z.array[F+3]=ba.w,z.array[F+4]=aa.x,z.array[F+5]=aa.y,z.array[F+6]=aa.z,z.array[F+7]=aa.w,z.array[F+8]=$.x,z.array[F+9]=$.y,z.array[F+10]=$.z,z.array[F+11]=$.w,F+=12;else if("faceVertices"===z.boundTo)for(P=0,Z=Q.length;P<Z;P++)Ia=z.value[Q[P]],ba=Ia[0],aa=Ia[1],$=Ia[2],z.array[F]=ba.x,z.array[F+1]=ba.y,z.array[F+2]=ba.z,z.array[F+3]=ba.w,z.array[F+4]=aa.x,
-z.array[F+5]=aa.y,z.array[F+6]=aa.z,z.array[F+7]=aa.w,z.array[F+8]=$.x,z.array[F+9]=$.y,z.array[F+10]=$.z,z.array[F+11]=$.w,F+=12;l.bindBuffer(l.ARRAY_BUFFER,z.buffer);l.bufferData(l.ARRAY_BUFFER,z.array,S)}T&&(delete J.__inittedArrays,delete J.__colorArray,delete J.__normalArray,delete J.__tangentArray,delete J.__uvArray,delete J.__uv2Array,delete J.__faceArray,delete J.__vertexArray,delete J.__lineArray,delete J.__skinIndexArray,delete J.__skinWeightArray)}}}r.verticesNeedUpdate=!1;r.morphTargetsNeedUpdate=
-!1;r.elementsNeedUpdate=!1;r.uvsNeedUpdate=!1;r.normalsNeedUpdate=!1;r.colorsNeedUpdate=!1;r.tangentsNeedUpdate=!1;E.attributes&&x(E)}else if(e instanceof THREE.Line){E=d(e,r);w=E.attributes&&v(E);if(r.verticesNeedUpdate||r.colorsNeedUpdate||r.lineDistancesNeedUpdate||w){var Yb=l.DYNAMIC_DRAW,bb,Db,jb,Zb,ga,vc,cc=r.vertices,ec=r.colors,nb=r.lineDistances,Xb=cc.length,jc=ec.length,kc=nb.length,wc=r.__vertexArray,xc=r.__colorArray,ic=r.__lineDistanceArray,sc=r.colorsNeedUpdate,tc=r.lineDistancesNeedUpdate,
-fc=r.__webglCustomAttributesList,yc,Ib,Fa,gc,Wa,na;if(r.verticesNeedUpdate){for(bb=0;bb<Xb;bb++)Zb=cc[bb],ga=3*bb,wc[ga]=Zb.x,wc[ga+1]=Zb.y,wc[ga+2]=Zb.z;l.bindBuffer(l.ARRAY_BUFFER,r.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,wc,Yb)}if(sc){for(Db=0;Db<jc;Db++)vc=ec[Db],ga=3*Db,xc[ga]=vc.r,xc[ga+1]=vc.g,xc[ga+2]=vc.b;l.bindBuffer(l.ARRAY_BUFFER,r.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,xc,Yb)}if(tc){for(jb=0;jb<kc;jb++)ic[jb]=nb[jb];l.bindBuffer(l.ARRAY_BUFFER,r.__webglLineDistanceBuffer);
-l.bufferData(l.ARRAY_BUFFER,ic,Yb)}if(fc)for(yc=0,Ib=fc.length;yc<Ib;yc++)if(na=fc[yc],na.needsUpdate&&(void 0===na.boundTo||"vertices"===na.boundTo)){ga=0;gc=na.value.length;if(1===na.size)for(Fa=0;Fa<gc;Fa++)na.array[Fa]=na.value[Fa];else if(2===na.size)for(Fa=0;Fa<gc;Fa++)Wa=na.value[Fa],na.array[ga]=Wa.x,na.array[ga+1]=Wa.y,ga+=2;else if(3===na.size)if("c"===na.type)for(Fa=0;Fa<gc;Fa++)Wa=na.value[Fa],na.array[ga]=Wa.r,na.array[ga+1]=Wa.g,na.array[ga+2]=Wa.b,ga+=3;else for(Fa=0;Fa<gc;Fa++)Wa=
-na.value[Fa],na.array[ga]=Wa.x,na.array[ga+1]=Wa.y,na.array[ga+2]=Wa.z,ga+=3;else if(4===na.size)for(Fa=0;Fa<gc;Fa++)Wa=na.value[Fa],na.array[ga]=Wa.x,na.array[ga+1]=Wa.y,na.array[ga+2]=Wa.z,na.array[ga+3]=Wa.w,ga+=4;l.bindBuffer(l.ARRAY_BUFFER,na.buffer);l.bufferData(l.ARRAY_BUFFER,na.array,Yb)}}r.verticesNeedUpdate=!1;r.colorsNeedUpdate=!1;r.lineDistancesNeedUpdate=!1;E.attributes&&x(E)}else if(e instanceof THREE.PointCloud){E=d(e,r);w=E.attributes&&v(E);if(r.verticesNeedUpdate||r.colorsNeedUpdate||
-e.sortParticles||w){var Jb=l.DYNAMIC_DRAW,Xa,ub,vb,X,wb,Tb,zc=r.vertices,Kb=zc.length,qb=r.colors,Lb=qb.length,$b=r.__vertexArray,ac=r.__colorArray,Eb=r.__sortArray,Mb=r.verticesNeedUpdate,Wb=r.colorsNeedUpdate,Fb=r.__webglCustomAttributesList,lb,hc,ca,mb,ia,W;if(e.sortParticles){Gc.copy(Ac);Gc.multiply(e.matrixWorld);for(Xa=0;Xa<Kb;Xa++)vb=zc[Xa],Na.copy(vb),Na.applyProjection(Gc),Eb[Xa]=[Na.z,Xa];Eb.sort(p);for(Xa=0;Xa<Kb;Xa++)vb=zc[Eb[Xa][1]],X=3*Xa,$b[X]=vb.x,$b[X+1]=vb.y,$b[X+2]=vb.z;for(ub=
-0;ub<Lb;ub++)X=3*ub,Tb=qb[Eb[ub][1]],ac[X]=Tb.r,ac[X+1]=Tb.g,ac[X+2]=Tb.b;if(Fb)for(lb=0,hc=Fb.length;lb<hc;lb++)if(W=Fb[lb],void 0===W.boundTo||"vertices"===W.boundTo)if(X=0,mb=W.value.length,1===W.size)for(ca=0;ca<mb;ca++)wb=Eb[ca][1],W.array[ca]=W.value[wb];else if(2===W.size)for(ca=0;ca<mb;ca++)wb=Eb[ca][1],ia=W.value[wb],W.array[X]=ia.x,W.array[X+1]=ia.y,X+=2;else if(3===W.size)if("c"===W.type)for(ca=0;ca<mb;ca++)wb=Eb[ca][1],ia=W.value[wb],W.array[X]=ia.r,W.array[X+1]=ia.g,W.array[X+2]=ia.b,
-X+=3;else for(ca=0;ca<mb;ca++)wb=Eb[ca][1],ia=W.value[wb],W.array[X]=ia.x,W.array[X+1]=ia.y,W.array[X+2]=ia.z,X+=3;else if(4===W.size)for(ca=0;ca<mb;ca++)wb=Eb[ca][1],ia=W.value[wb],W.array[X]=ia.x,W.array[X+1]=ia.y,W.array[X+2]=ia.z,W.array[X+3]=ia.w,X+=4}else{if(Mb)for(Xa=0;Xa<Kb;Xa++)vb=zc[Xa],X=3*Xa,$b[X]=vb.x,$b[X+1]=vb.y,$b[X+2]=vb.z;if(Wb)for(ub=0;ub<Lb;ub++)Tb=qb[ub],X=3*ub,ac[X]=Tb.r,ac[X+1]=Tb.g,ac[X+2]=Tb.b;if(Fb)for(lb=0,hc=Fb.length;lb<hc;lb++)if(W=Fb[lb],W.needsUpdate&&(void 0===W.boundTo||
-"vertices"===W.boundTo))if(mb=W.value.length,X=0,1===W.size)for(ca=0;ca<mb;ca++)W.array[ca]=W.value[ca];else if(2===W.size)for(ca=0;ca<mb;ca++)ia=W.value[ca],W.array[X]=ia.x,W.array[X+1]=ia.y,X+=2;else if(3===W.size)if("c"===W.type)for(ca=0;ca<mb;ca++)ia=W.value[ca],W.array[X]=ia.r,W.array[X+1]=ia.g,W.array[X+2]=ia.b,X+=3;else for(ca=0;ca<mb;ca++)ia=W.value[ca],W.array[X]=ia.x,W.array[X+1]=ia.y,W.array[X+2]=ia.z,X+=3;else if(4===W.size)for(ca=0;ca<mb;ca++)ia=W.value[ca],W.array[X]=ia.x,W.array[X+
-1]=ia.y,W.array[X+2]=ia.z,W.array[X+3]=ia.w,X+=4}if(Mb||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,r.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,$b,Jb);if(Wb||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,r.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,ac,Jb);if(Fb)for(lb=0,hc=Fb.length;lb<hc;lb++)if(W=Fb[lb],W.needsUpdate||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,W.buffer),l.bufferData(l.ARRAY_BUFFER,W.array,Jb)}r.verticesNeedUpdate=!1;r.colorsNeedUpdate=!1;E.attributes&&x(E)}for(var bc=
-0,Nb=t.length;bc<Nb;bc++){var Bc=t[bc],Ub=Bc,rc=Ub.object,Cc=Ub.buffer,Dc=rc.geometry,Vb=rc.material;Vb instanceof THREE.MeshFaceMaterial?(Vb=Vb.materials[Dc instanceof THREE.BufferGeometry?0:Cc.materialIndex],Ub.material=Vb,Vb.transparent?Gb.push(Ub):cb.push(Ub)):Vb&&(Ub.material=Vb,Vb.transparent?Gb.push(Ub):cb.push(Ub));Bc.render=!0;!0===H.sortObjects&&(null!==e.renderDepth?Bc.z=e.renderDepth:(Na.setFromMatrixPosition(e.matrixWorld),Na.applyProjection(Ac),Bc.z=Na.z))}}}}bc=0;for(Nb=e.children.length;bc<
-Nb;bc++)q(a,e.children[bc])}}function m(a,b,c,d,e,f){for(var g,h=a.length-1;-1!==h;h--){g=a[h];var k=g.object,l=g.buffer;y(k,b);if(f)g=f;else{g=g.material;if(!g)continue;e&&H.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);H.setDepthTest(g.depthTest);H.setDepthWrite(g.depthWrite);B(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}H.setMaterialFaces(g);l instanceof THREE.BufferGeometry?H.renderBufferDirect(b,c,d,g,l,k):H.renderBuffer(b,c,d,g,l,k)}}function r(a,b,c,d,e,f,g){for(var h,
-k=0,l=a.length;k<l;k++){h=a[k];var m=h.object;if(m.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&H.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);H.setDepthTest(h.depthTest);H.setDepthWrite(h.depthWrite);B(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}H.renderImmediateObject(c,d,e,h,m)}}}function t(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function s(a,b,d){var e=b.material,f=!1;if(void 0===ob[d.id]||!0===
-d.groupsNeedUpdate){delete fb[b.id];a=ob;for(var g=d.id,e=e instanceof THREE.MeshFaceMaterial,h=ha.get("OES_element_index_uint")?4294967296:65535,k,f={},m=d.morphTargets.length,n=d.morphNormals.length,p,r={},q=[],t=0,s=d.faces.length;t<s;t++){k=d.faces[t];var v=e?k.materialIndex:0;v in f||(f[v]={hash:v,counter:0});k=f[v].hash+"_"+f[v].counter;k in r||(p={id:rc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:n},r[k]=p,q.push(p));r[k].vertices+3>h&&(f[v].counter+=1,k=f[v].hash+
-"_"+f[v].counter,k in r||(p={id:rc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:n},r[k]=p,q.push(p)));r[k].faces3.push(t);r[k].vertices+=3}a[g]=q;d.groupsNeedUpdate=!1}a=ob[d.id];g=0;for(e=a.length;g<e;g++){h=a[g];if(void 0===h.__webglVertexBuffer){f=h;f.__webglVertexBuffer=l.createBuffer();f.__webglNormalBuffer=l.createBuffer();f.__webglTangentBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();f.__webglUVBuffer=l.createBuffer();f.__webglUV2Buffer=l.createBuffer();
-f.__webglSkinIndicesBuffer=l.createBuffer();f.__webglSkinWeightsBuffer=l.createBuffer();f.__webglFaceBuffer=l.createBuffer();f.__webglLineBuffer=l.createBuffer();n=m=void 0;if(f.numMorphTargets)for(f.__webglMorphTargetsBuffers=[],m=0,n=f.numMorphTargets;m<n;m++)f.__webglMorphTargetsBuffers.push(l.createBuffer());if(f.numMorphNormals)for(f.__webglMorphNormalsBuffers=[],m=0,n=f.numMorphNormals;m<n;m++)f.__webglMorphNormalsBuffers.push(l.createBuffer());H.info.memory.geometries++;c(h,b);d.verticesNeedUpdate=
-!0;d.morphTargetsNeedUpdate=!0;d.elementsNeedUpdate=!0;d.uvsNeedUpdate=!0;d.normalsNeedUpdate=!0;d.tangentsNeedUpdate=!0;f=d.colorsNeedUpdate=!0}else f=!1;(f||void 0===b.__webglActive)&&u(fb,h,b)}b.__webglActive=!0}function u(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function v(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function x(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function E(a,b,c,d,e){var f,g,
-h,k;cc=0;if(d.needsUpdate){d.program&&Cc(d);d.addEventListener("dispose",Dc);var m;d instanceof THREE.MeshDepthMaterial?m="depth":d instanceof THREE.MeshNormalMaterial?m="normal":d instanceof THREE.MeshBasicMaterial?m="basic":d instanceof THREE.MeshLambertMaterial?m="lambert":d instanceof THREE.MeshPhongMaterial?m="phong":d instanceof THREE.LineBasicMaterial?m="basic":d instanceof THREE.LineDashedMaterial?m="dashed":d instanceof THREE.PointCloudMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];
-d.__webglShader={uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var p=0,r=0,q=0,t=0,s=0,v=b.length;s<v;s++){var u=b[s];u.onlyShadow||!1===u.visible||(u instanceof THREE.DirectionalLight&&p++,u instanceof THREE.PointLight&&r++,u instanceof THREE.SpotLight&&q++,u instanceof THREE.HemisphereLight&&t++)}f=p;g=r;h=q;k=t;for(var x,E=0,y=
-0,B=b.length;y<B;y++){var A=b[y];A.castShadow&&(A instanceof THREE.SpotLight&&E++,A instanceof THREE.DirectionalLight&&!A.shadowCascade&&E++)}x=E;var Z;if(ic&&e&&e.skeleton&&e.skeleton.useVertexTexture)Z=1024;else{var K=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),I=Math.floor((K-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(I=Math.min(e.skeleton.bones.length,I),I<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+I+" (try OpenGL instead of ANGLE)"));
-Z=I}var R={precision:Y,supportsVertexTextures:sc,map:!!d.map,envMap:!!d.envMap,lightMap:!!d.lightMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:xa,skinning:d.skinning,maxBones:Z,useVertexTexture:ic&&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:x,shadowMapEnabled:H.shadowMapEnabled&&e.receiveShadow&&0<x,shadowMapType:H.shadowMapType,shadowMapDebug:H.shadowMapDebug,shadowMapCascade:H.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},O=[];m?O.push(m):(O.push(d.fragmentShader),O.push(d.vertexShader));if(void 0!==d.defines)for(var T in d.defines)O.push(T),
-O.push(d.defines[T]);for(T in R)O.push(T),O.push(R[T]);for(var P=O.join(),V,fb=0,da=db.length;fb<da;fb++){var pb=db[fb];if(pb.code===P){V=pb;V.usedTimes++;break}}void 0===V&&(V=new THREE.WebGLProgram(H,P,d,R),db.push(V),H.info.memory.programs=db.length);d.program=V;var eb=V.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var ha,oa="morphTarget",cb=0;cb<H.maxMorphTargets;cb++)ha=oa+cb,0<=eb[ha]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,oa="morphNormal",
-cb=0;cb<H.maxMorphNormals;cb++)ha=oa+cb,0<=eb[ha]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var ya in d.__webglShader.uniforms){var za=d.program.uniforms[ya];za&&d.uniformsList.push([d.__webglShader.uniforms[ya],za])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(H.maxMorphTargets));var ba=!1,aa=!1,$=!1,xb=d.program,pa=xb.uniforms,N=d.__webglShader.uniforms;xb.id!==tc&&(l.useProgram(xb.program),tc=xb.id,$=aa=ba=!0);d.id!==
-Hb&&(-1===Hb&&($=!0),Hb=d.id,aa=!0);if(ba||a!==dc)l.uniformMatrix4fv(pa.projectionMatrix,!1,a.projectionMatrix.elements),xa&&l.uniform1f(pa.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==dc&&(dc=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==pa.cameraPosition&&(Na.setFromMatrixPosition(a.matrixWorld),l.uniform3f(pa.cameraPosition,Na.x,Na.y,Na.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||
-d instanceof THREE.ShaderMaterial||d.skinning)&&null!==pa.viewMatrix&&l.uniformMatrix4fv(pa.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==pa.bindMatrix&&l.uniformMatrix4fv(pa.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==pa.bindMatrixInverse&&l.uniformMatrix4fv(pa.bindMatrixInverse,!1,e.bindMatrixInverse.elements),ic&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==pa.boneTexture){var Gb=M();l.uniform1i(pa.boneTexture,Gb);H.setTexture(e.skeleton.boneTexture,
-Gb)}null!==pa.boneTextureWidth&&l.uniform1i(pa.boneTextureWidth,e.skeleton.boneTextureWidth);null!==pa.boneTextureHeight&&l.uniform1i(pa.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==pa.boneGlobalMatrices&&l.uniformMatrix4fv(pa.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(aa){c&&d.fog&&(N.fogColor.value=c.color,c instanceof THREE.Fog?(N.fogNear.value=c.near,N.fogFar.value=c.far):c instanceof THREE.FogExp2&&(N.fogDensity.value=c.density));if(d instanceof
-THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(ec){var $=!0,ma,Ra,ja,Ca=0,Ga=0,Oa=0,Ba,Za,yb,Ha,zb,Aa,ua=Mc,Ab=ua.directional.colors,ob=ua.directional.positions,Pb=ua.point.colors,Ma=ua.point.positions,Jb=ua.point.distances,Ya=ua.spot.colors,$a=ua.spot.positions,Kb=ua.spot.distances,Qb=ua.spot.directions,gb=ua.spot.anglesCos,hb=ua.spot.exponents,rb=ua.hemi.skyColors,sb=ua.hemi.groundColors,Bb=ua.hemi.positions,Sa=0,Da=0,Pa=0,Ka=0,ka=0,ra=0,F=0,Ia=0,Qa=0,tb=0,ib=0,Ta=
-0;ma=0;for(Ra=b.length;ma<Ra;ma++)ja=b[ma],ja.onlyShadow||(Ba=ja.color,Ha=ja.intensity,Aa=ja.distance,ja instanceof THREE.AmbientLight?ja.visible&&(H.gammaInput?(Ca+=Ba.r*Ba.r,Ga+=Ba.g*Ba.g,Oa+=Ba.b*Ba.b):(Ca+=Ba.r,Ga+=Ba.g,Oa+=Ba.b)):ja instanceof THREE.DirectionalLight?(ka+=1,ja.visible&&(ta.setFromMatrixPosition(ja.matrixWorld),Na.setFromMatrixPosition(ja.target.matrixWorld),ta.sub(Na),ta.normalize(),Qa=3*Sa,ob[Qa]=ta.x,ob[Qa+1]=ta.y,ob[Qa+2]=ta.z,H.gammaInput?C(Ab,Qa,Ba,Ha*Ha):D(Ab,Qa,Ba,Ha),
-Sa+=1)):ja instanceof THREE.PointLight?(ra+=1,ja.visible&&(tb=3*Da,H.gammaInput?C(Pb,tb,Ba,Ha*Ha):D(Pb,tb,Ba,Ha),Na.setFromMatrixPosition(ja.matrixWorld),Ma[tb]=Na.x,Ma[tb+1]=Na.y,Ma[tb+2]=Na.z,Jb[Da]=Aa,Da+=1)):ja instanceof THREE.SpotLight?(F+=1,ja.visible&&(ib=3*Pa,H.gammaInput?C(Ya,ib,Ba,Ha*Ha):D(Ya,ib,Ba,Ha),ta.setFromMatrixPosition(ja.matrixWorld),$a[ib]=ta.x,$a[ib+1]=ta.y,$a[ib+2]=ta.z,Kb[Pa]=Aa,Na.setFromMatrixPosition(ja.target.matrixWorld),ta.sub(Na),ta.normalize(),Qb[ib]=ta.x,Qb[ib+1]=
-ta.y,Qb[ib+2]=ta.z,gb[Pa]=Math.cos(ja.angle),hb[Pa]=ja.exponent,Pa+=1)):ja instanceof THREE.HemisphereLight&&(Ia+=1,ja.visible&&(ta.setFromMatrixPosition(ja.matrixWorld),ta.normalize(),Ta=3*Ka,Bb[Ta]=ta.x,Bb[Ta+1]=ta.y,Bb[Ta+2]=ta.z,Za=ja.color,yb=ja.groundColor,H.gammaInput?(zb=Ha*Ha,C(rb,Ta,Za,zb),C(sb,Ta,yb,zb)):(D(rb,Ta,Za,Ha),D(sb,Ta,yb,Ha)),Ka+=1)));ma=3*Sa;for(Ra=Math.max(Ab.length,3*ka);ma<Ra;ma++)Ab[ma]=0;ma=3*Da;for(Ra=Math.max(Pb.length,3*ra);ma<Ra;ma++)Pb[ma]=0;ma=3*Pa;for(Ra=Math.max(Ya.length,
-3*F);ma<Ra;ma++)Ya[ma]=0;ma=3*Ka;for(Ra=Math.max(rb.length,3*Ia);ma<Ra;ma++)rb[ma]=0;ma=3*Ka;for(Ra=Math.max(sb.length,3*Ia);ma<Ra;ma++)sb[ma]=0;ua.directional.length=Sa;ua.point.length=Da;ua.spot.length=Pa;ua.hemi.length=Ka;ua.ambient[0]=Ca;ua.ambient[1]=Ga;ua.ambient[2]=Oa;ec=!1}if($){var qa=Mc;N.ambientLightColor.value=qa.ambient;N.directionalLightColor.value=qa.directional.colors;N.directionalLightDirection.value=qa.directional.positions;N.pointLightColor.value=qa.point.colors;N.pointLightPosition.value=
-qa.point.positions;N.pointLightDistance.value=qa.point.distances;N.spotLightColor.value=qa.spot.colors;N.spotLightPosition.value=qa.spot.positions;N.spotLightDistance.value=qa.spot.distances;N.spotLightDirection.value=qa.spot.directions;N.spotLightAngleCos.value=qa.spot.anglesCos;N.spotLightExponent.value=qa.spot.exponents;N.hemisphereLightSkyColor.value=qa.hemi.skyColors;N.hemisphereLightGroundColor.value=qa.hemi.groundColors;N.hemisphereLightDirection.value=qa.hemi.positions;w(N,!0)}else w(N,!1)}if(d instanceof
-THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){N.opacity.value=d.opacity;H.gammaInput?N.diffuse.value.copyGammaToLinear(d.color):N.diffuse.value=d.color;N.map.value=d.map;N.lightMap.value=d.lightMap;N.specularMap.value=d.specularMap;N.alphaMap.value=d.alphaMap;d.bumpMap&&(N.bumpMap.value=d.bumpMap,N.bumpScale.value=d.bumpScale);d.normalMap&&(N.normalMap.value=d.normalMap,N.normalScale.value.copy(d.normalScale));var La;d.map?La=d.map:d.specularMap?
-La=d.specularMap:d.normalMap?La=d.normalMap:d.bumpMap?La=d.bumpMap:d.alphaMap&&(La=d.alphaMap);if(void 0!==La){var Ua=La.offset,Va=La.repeat;N.offsetRepeat.value.set(Ua.x,Ua.y,Va.x,Va.y)}N.envMap.value=d.envMap;N.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;N.reflectivity.value=d.reflectivity;N.refractionRatio.value=d.refractionRatio;N.combine.value=d.combine;N.useRefract.value=d.envMap&&(d.envMap.mapping===THREE.CubeRefractionMapping||d.envMap.mapping===THREE.EquirectangularRefractionMapping)}d instanceof
-THREE.LineBasicMaterial?(N.diffuse.value=d.color,N.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(N.diffuse.value=d.color,N.opacity.value=d.opacity,N.dashSize.value=d.dashSize,N.totalSize.value=d.dashSize+d.gapSize,N.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(N.psColor.value=d.color,N.opacity.value=d.opacity,N.size.value=d.size,N.scale.value=J.height/2,N.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(N.shininess.value=d.shininess,H.gammaInput?(N.ambient.value.copyGammaToLinear(d.ambient),
-N.emissive.value.copyGammaToLinear(d.emissive),N.specular.value.copyGammaToLinear(d.specular)):(N.ambient.value=d.ambient,N.emissive.value=d.emissive,N.specular.value=d.specular),d.wrapAround&&N.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(H.gammaInput?(N.ambient.value.copyGammaToLinear(d.ambient),N.emissive.value.copyGammaToLinear(d.emissive)):(N.ambient.value=d.ambient,N.emissive.value=d.emissive),d.wrapAround&&N.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?
-(N.mNear.value=a.near,N.mFar.value=a.far,N.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(N.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&N.shadowMatrix)for(var Cb=0,qb=0,Nb=b.length;qb<Nb;qb++){var z=b[qb];z.castShadow&&(z instanceof THREE.SpotLight||z instanceof THREE.DirectionalLight&&!z.shadowCascade)&&(N.shadowMap.value[Cb]=z.shadowMap,N.shadowMapSize.value[Cb]=z.shadowMapSize,N.shadowMatrix.value[Cb]=z.shadowMatrix,N.shadowDarkness.value[Cb]=z.shadowDarkness,
-N.shadowBias.value[Cb]=z.shadowBias,Cb++)}for(var Rb=d.uniformsList,Ja,va,ab,nb=0,Ob=Rb.length;nb<Ob;nb++){var ea=Rb[nb][0];if(!1!==ea.needsUpdate){var Ib=ea.type,U=ea.value,fa=Rb[nb][1];switch(Ib){case "1i":l.uniform1i(fa,U);break;case "1f":l.uniform1f(fa,U);break;case "2f":l.uniform2f(fa,U[0],U[1]);break;case "3f":l.uniform3f(fa,U[0],U[1],U[2]);break;case "4f":l.uniform4f(fa,U[0],U[1],U[2],U[3]);break;case "1iv":l.uniform1iv(fa,U);break;case "3iv":l.uniform3iv(fa,U);break;case "1fv":l.uniform1fv(fa,
-U);break;case "2fv":l.uniform2fv(fa,U);break;case "3fv":l.uniform3fv(fa,U);break;case "4fv":l.uniform4fv(fa,U);break;case "Matrix3fv":l.uniformMatrix3fv(fa,!1,U);break;case "Matrix4fv":l.uniformMatrix4fv(fa,!1,U);break;case "i":l.uniform1i(fa,U);break;case "f":l.uniform1f(fa,U);break;case "v2":l.uniform2f(fa,U.x,U.y);break;case "v3":l.uniform3f(fa,U.x,U.y,U.z);break;case "v4":l.uniform4f(fa,U.x,U.y,U.z,U.w);break;case "c":l.uniform3f(fa,U.r,U.g,U.b);break;case "iv1":l.uniform1iv(fa,U);break;case "iv":l.uniform3iv(fa,
-U);break;case "fv1":l.uniform1fv(fa,U);break;case "fv":l.uniform3fv(fa,U);break;case "v2v":void 0===ea._array&&(ea._array=new Float32Array(2*U.length));for(var Q=0,wa=U.length;Q<wa;Q++)ab=2*Q,ea._array[ab]=U[Q].x,ea._array[ab+1]=U[Q].y;l.uniform2fv(fa,ea._array);break;case "v3v":void 0===ea._array&&(ea._array=new Float32Array(3*U.length));Q=0;for(wa=U.length;Q<wa;Q++)ab=3*Q,ea._array[ab]=U[Q].x,ea._array[ab+1]=U[Q].y,ea._array[ab+2]=U[Q].z;l.uniform3fv(fa,ea._array);break;case "v4v":void 0===ea._array&&
-(ea._array=new Float32Array(4*U.length));Q=0;for(wa=U.length;Q<wa;Q++)ab=4*Q,ea._array[ab]=U[Q].x,ea._array[ab+1]=U[Q].y,ea._array[ab+2]=U[Q].z,ea._array[ab+3]=U[Q].w;l.uniform4fv(fa,ea._array);break;case "m3":l.uniformMatrix3fv(fa,!1,U.elements);break;case "m3v":void 0===ea._array&&(ea._array=new Float32Array(9*U.length));Q=0;for(wa=U.length;Q<wa;Q++)U[Q].flattenToArrayOffset(ea._array,9*Q);l.uniformMatrix3fv(fa,!1,ea._array);break;case "m4":l.uniformMatrix4fv(fa,!1,U.elements);break;case "m4v":void 0===
-ea._array&&(ea._array=new Float32Array(16*U.length));Q=0;for(wa=U.length;Q<wa;Q++)U[Q].flattenToArrayOffset(ea._array,16*Q);l.uniformMatrix4fv(fa,!1,ea._array);break;case "t":Ja=U;va=M();l.uniform1i(fa,va);if(!Ja)continue;if(Ja instanceof THREE.CubeTexture||Ja.image instanceof Array&&6===Ja.image.length){var sa=Ja,Lb=va;if(6===sa.image.length)if(sa.needsUpdate){sa.image.__webglTextureCube||(sa.addEventListener("dispose",fc),sa.image.__webglTextureCube=l.createTexture(),H.info.memory.textures++);l.activeTexture(l.TEXTURE0+
-Lb);l.bindTexture(l.TEXTURE_CUBE_MAP,sa.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,sa.flipY);for(var Mb=sa instanceof THREE.CompressedTexture,Sb=sa.image[0]instanceof THREE.DataTexture,kb=[],Ea=0;6>Ea;Ea++)kb[Ea]=!H.autoScaleCubemaps||Mb||Sb?Sb?sa.image[Ea].image:sa.image[Ea]:S(sa.image[Ea],bd);var la=kb[0],Yb=THREE.Math.isPowerOfTwo(la.width)&&THREE.Math.isPowerOfTwo(la.height),bb=L(sa.format),Db=L(sa.type);G(l.TEXTURE_CUBE_MAP,sa,Yb);for(Ea=0;6>Ea;Ea++)if(Mb)for(var jb,Zb=kb[Ea].mipmaps,
-ga=0,Wb=Zb.length;ga<Wb;ga++)jb=Zb[ga],sa.format!==THREE.RGBAFormat&&sa.format!==THREE.RGBFormat?-1<Nc().indexOf(bb)?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Ea,ga,bb,jb.width,jb.height,0,jb.data):console.warn("Attempt to load unsupported compressed texture format"):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Ea,ga,bb,jb.width,jb.height,0,bb,Db,jb.data);else Sb?l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Ea,0,bb,kb[Ea].width,kb[Ea].height,0,bb,Db,kb[Ea].data):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+
-Ea,0,bb,bb,Db,kb[Ea]);sa.generateMipmaps&&Yb&&l.generateMipmap(l.TEXTURE_CUBE_MAP);sa.needsUpdate=!1;if(sa.onUpdate)sa.onUpdate()}else l.activeTexture(l.TEXTURE0+Lb),l.bindTexture(l.TEXTURE_CUBE_MAP,sa.image.__webglTextureCube)}else if(Ja instanceof THREE.WebGLRenderTargetCube){var Xb=Ja;l.activeTexture(l.TEXTURE0+va);l.bindTexture(l.TEXTURE_CUBE_MAP,Xb.__webglTexture)}else H.setTexture(Ja,va);break;case "tv":void 0===ea._array&&(ea._array=[]);Q=0;for(wa=ea.value.length;Q<wa;Q++)ea._array[Q]=M();
-l.uniform1iv(fa,ea._array);Q=0;for(wa=ea.value.length;Q<wa;Q++)Ja=ea.value[Q],va=ea._array[Q],Ja&&H.setTexture(Ja,va);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Ib)}}}}l.uniformMatrix4fv(pa.modelViewMatrix,!1,e._modelViewMatrix.elements);pa.normalMatrix&&l.uniformMatrix3fv(pa.normalMatrix,!1,e._normalMatrix.elements);null!==pa.modelMatrix&&l.uniformMatrix4fv(pa.modelMatrix,!1,e.matrixWorld.elements);return xb}function w(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=
-b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function M(){var a=cc;a>=Oc&&
-console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Oc);cc+=1;return a}function y(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function C(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function D(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function A(a){a!==Pc&&(l.lineWidth(a),Pc=a)}function B(a,b,c){Qc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),
-Qc=a);!a||Rc===b&&Sc===c||(l.polygonOffset(b,c),Rc=b,Sc=c)}function G(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,L(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,L(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,L(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,L(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT is set to THREE.ClampToEdgeWrapping. ( "+
-b.sourceFile+" )"),l.texParameteri(a,l.TEXTURE_MAG_FILTER,V(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,V(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( "+b.sourceFile+" )"));(c=ha.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(l.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,
-Math.min(b.anisotropy,H.getMaxAnisotropy())),b.__oldAnisotropy=b.anisotropy)}function S(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.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+".");return d}return a}function K(a,b){l.bindRenderbuffer(l.RENDERBUFFER,
-a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function I(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,
-a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function V(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?l.NEAREST:l.LINEAR}function L(a){var b;if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT;
-if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return l.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return l.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return l.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return l.UNSIGNED_SHORT_5_5_5_1;
-if(a===THREE.UnsignedShort565Type)return l.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return l.BYTE;if(a===THREE.ShortType)return l.SHORT;if(a===THREE.UnsignedShortType)return l.UNSIGNED_SHORT;if(a===THREE.IntType)return l.INT;if(a===THREE.UnsignedIntType)return l.UNSIGNED_INT;if(a===THREE.FloatType)return l.FLOAT;if(a===THREE.AlphaFormat)return l.ALPHA;if(a===THREE.RGBFormat)return l.RGB;if(a===THREE.RGBAFormat)return l.RGBA;if(a===THREE.LuminanceFormat)return l.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return l.LUMINANCE_ALPHA;
-if(a===THREE.AddEquation)return l.FUNC_ADD;if(a===THREE.SubtractEquation)return l.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return l.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return l.ZERO;if(a===THREE.OneFactor)return l.ONE;if(a===THREE.SrcColorFactor)return l.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return l.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return l.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return l.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return l.DST_ALPHA;
-if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return l.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return l.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return l.SRC_ALPHA_SATURATE;b=ha.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=ha.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=ha.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 J=void 0!==a.canvas?a.canvas:document.createElement("canvas"),R=void 0!==a.context?a.context:null,Y=void 0!==a.precision?a.precision:"highp",T=void 0!==a.alpha?a.alpha:!1,ya=void 0!==a.depth?a.depth:!0,oa=void 0!==a.stencil?a.stencil:!0,Ca=void 0!==a.antialias?a.antialias:!1,O=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Ga=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:
-!1,xa=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,za=new THREE.Color(0),Z=0,eb=[],fb={},pb=[],cb=[],Gb=[],xb=[],Ra=[];this.domElement=J;this.context=null;this.devicePixelRatio=void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=
-this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var H=this,db=[],tc=null,Tc=null,Hb=-1,Oa=-1,dc=null,cc=0,Ib=-1,Jb=-1,Kb=-1,qb=-1,Lb=-1,Mb=-1,Wb=-1,Nb=-1,Qc=null,Rc=null,Sc=null,Pc=null,nb=0,Xb=0,jc=J.width,kc=J.height,Uc=0,Vc=0,Ob=new Uint8Array(16),Za=new Uint8Array(16),Ec=new THREE.Frustum,Ac=new THREE.Matrix4,Gc=new THREE.Matrix4,Na=new THREE.Vector3,
-ta=new THREE.Vector3,ec=!0,Mc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},l;try{var Wc={alpha:T,depth:ya,stencil:oa,antialias:Ca,premultipliedAlpha:O,preserveDrawingBuffer:Ga};l=R||J.getContext("webgl",Wc)||J.getContext("experimental-webgl",Wc);if(null===l){if(null!==J.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";
-throw"Error creating WebGL context.";}J.addEventListener("webglcontextlost",function(a){a.preventDefault();Xc();Yc();fb={}},!1)}catch(cd){console.error(cd)}void 0===l.getShaderPrecisionFormat&&(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var ha=new THREE.WebGLExtensions(l);ha.get("OES_texture_float");ha.get("OES_texture_float_linear");ha.get("OES_standard_derivatives");xa&&ha.get("EXT_frag_depth");var Yc=function(){l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);
-l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(nb,Xb,jc,kc);l.clearColor(za.r,za.g,za.b,Z)},Xc=function(){dc=tc=null;Hb=Oa=Jb=Ib=Nb=Wb=Kb=-1;ec=!0;for(var a=0;a<Za.length;a++)Za[a]=0};Yc();this.context=l;var Oc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),dd=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),ed=l.getParameter(l.MAX_TEXTURE_SIZE),
-bd=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),sc=0<dd,ic=sc&&ha.get("OES_texture_float"),fd=l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.HIGH_FLOAT),gd=l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_FLOAT);var hd=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT),id=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT);var Nc=function(){var a;return function(){if(void 0!==
-a)return a;a=[];if(ha.get("WEBGL_compressed_texture_pvrtc")||ha.get("WEBGL_compressed_texture_s3tc"))for(var b=l.getParameter(l.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),jd=0<fd.precision&&0<hd.precision,Zc=0<gd.precision&&0<id.precision;"highp"!==Y||jd||(Zc?(Y="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(Y="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==Y||Zc||(Y="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));
-var kd=new THREE.ShadowMapPlugin(this,eb,fb,pb),ld=new THREE.SpritePlugin(this,xb),md=new THREE.LensFlarePlugin(this,Ra);this.getContext=function(){return l};this.forceContextLoss=function(){ha.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return sc};this.supportsFloatTextures=function(){return ha.get("OES_texture_float")};this.supportsStandardDerivatives=function(){return ha.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return ha.get("WEBGL_compressed_texture_s3tc")};
-this.supportsCompressedTexturePVRTC=function(){return ha.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return ha.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=ha.get("EXT_texture_filter_anisotropic");return a=null!==b?l.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return Y};this.setSize=function(a,b,c){J.width=a*this.devicePixelRatio;J.height=b*this.devicePixelRatio;!1!==
-c&&(J.style.width=a+"px",J.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){nb=a*this.devicePixelRatio;Xb=b*this.devicePixelRatio;jc=c*this.devicePixelRatio;kc=d*this.devicePixelRatio;l.viewport(nb,Xb,jc,kc)};this.setScissor=function(a,b,c,d){l.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.setClearColor=function(a,
-b){za.set(a);Z=void 0!==b?b:1;l.clearColor(za.r,za.g,za.b,Z)};this.setClearColorHex=function(a,b){console.warn("THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return za};this.getClearAlpha=function(){return Z};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=l.COLOR_BUFFER_BIT;if(void 0===b||b)d|=l.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};this.clearColor=function(){l.clear(l.COLOR_BUFFER_BIT)};
-this.clearDepth=function(){l.clear(l.DEPTH_BUFFER_BIT)};this.clearStencil=function(){l.clear(l.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=Xc;var Hc=function(a){a.target.traverse(function(a){a.removeEventListener("remove",Hc);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete fb[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=pb,c=b.length-1;0<=
-c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})},Ic=function(a){a=a.target;a.removeEventListener("dispose",Ic);delete a.__webglInit;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(l.deleteBuffer(c.buffer),delete c.buffer)}H.info.memory.geometries--}else if(b=ob[a.id],void 0!==b){for(var c=0,d=b.length;c<d;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=
-0,g=e.numMorphTargets;f<g;f++)l.deleteBuffer(e.__webglMorphTargetsBuffers[f]);delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)l.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}$c(e)}delete ob[a.id]}else $c(a);Oa=-1},fc=function(a){a=a.target;a.removeEventListener("dispose",fc);a.image&&a.image.__webglTextureCube?(l.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&
-(l.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);H.info.memory.textures--},ad=function(a){a=a.target;a.removeEventListener("dispose",ad);if(a&&void 0!==a.__webglTexture){l.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);
-delete a.__webglFramebuffer;delete a.__webglRenderbuffer}H.info.memory.textures--},Dc=function(a){a=a.target;a.removeEventListener("dispose",Dc);Cc(a)},$c=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),c=0,d=b.length;c<d;c++){var e=b[c];void 0!==a[e]&&(l.deleteBuffer(a[e]),delete a[e])}if(void 0!==
-a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)l.deleteBuffer(a.__webglCustomAttributesList[e].buffer);delete a.__webglCustomAttributesList}H.info.memory.geometries--},Cc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=db.length;a<c;a++)if(d=db[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=db.length;a<c;a++)d=db[a],d.program!==b&&e.push(d);db=e;l.deleteProgram(b);H.info.memory.programs--}}};
-this.renderBufferImmediate=function(a,b,c){f();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=l.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=l.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=l.createBuffer());a.hasPositions&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,a.positionArray,l.DYNAMIC_DRAW),g(b.attributes.position),
-l.vertexAttribPointer(b.attributes.position,3,l.FLOAT,!1,0,0));if(a.hasNormals){l.bindBuffer(l.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,k,m,n,p,r,q,t,s,v,u=3*a.count;for(v=0;v<u;v+=9)s=a.normalArray,d=s[v],e=s[v+1],k=s[v+2],m=s[v+3],p=s[v+4],q=s[v+5],n=s[v+6],r=s[v+7],t=s[v+8],d=(d+m+n)/3,e=(e+p+r)/3,k=(k+q+t)/3,s[v]=d,s[v+1]=e,s[v+2]=k,s[v+3]=d,s[v+4]=e,s[v+5]=k,s[v+6]=d,s[v+7]=e,s[v+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);g(b.attributes.normal);
-l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),l.bufferData(l.ARRAY_BUFFER,a.uvArray,l.DYNAMIC_DRAW),g(b.attributes.uv),l.vertexAttribPointer(b.attributes.uv,2,l.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,a.colorArray,l.DYNAMIC_DRAW),g(b.attributes.color),l.vertexAttribPointer(b.attributes.color,3,l.FLOAT,!1,0,0));h();l.drawArrays(l.TRIANGLES,
-0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,g,h){if(!1!==d.visible)if(a=E(a,b,c,d,h),b=!1,c=16777215*g.id+2*a.id+(d.wireframe?1:0),c!==Oa&&(Oa=c,b=!0),b&&f(),h instanceof THREE.Mesh)if(h=!0===d.wireframe?l.LINES:l.TRIANGLES,c=g.attributes.index){var k,m;c.array instanceof Uint32Array&&ha.get("OES_element_index_uint")?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2);var n=g.offsets;if(0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,
-k,0),H.info.render.calls++,H.info.render.vertices+=c.array.length,H.info.render.faces+=c.array.length/3;else{b=!0;for(var p=0,r=n.length;p<r;p++){var q=n[p].index;b&&(e(d,a,g,q),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer));l.drawElements(h,n[p].count,k,n[p].start*m);H.info.render.calls++;H.info.render.vertices+=n[p].count;H.info.render.faces+=n[p].count/3}}}else b&&e(d,a,g,0),d=g.attributes.position,l.drawArrays(h,0,d.array.length/3),H.info.render.calls++,H.info.render.vertices+=d.array.length/
-3,H.info.render.faces+=d.array.length/9;else if(h instanceof THREE.PointCloud)if(h=l.POINTS,c=g.attributes.index)if(c.array instanceof Uint32Array&&ha.get("OES_element_index_uint")?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=g.offsets,0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),H.info.render.calls++,H.info.render.points+=c.array.length;else for(1<n.length&&(b=!0),p=0,r=n.length;p<r;p++)q=n[p].index,b&&(e(d,a,g,q),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
-c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),H.info.render.calls++,H.info.render.points+=n[p].count;else b&&e(d,a,g,0),d=g.attributes.position,l.drawArrays(h,0,d.array.length/3),H.info.render.calls++,H.info.render.points+=d.array.length/3;else if(h instanceof THREE.Line)if(h=h.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,A(d.linewidth),c=g.attributes.index)if(c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=g.offsets,0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
-c.buffer)),l.drawElements(h,c.array.length,k,0),H.info.render.calls++,H.info.render.vertices+=c.array.length;else for(1<n.length&&(b=!0),p=0,r=n.length;p<r;p++)q=n[p].index,b&&(e(d,a,g,q),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),H.info.render.calls++,H.info.render.vertices+=n[p].count;else b&&e(d,a,g,0),d=g.attributes.position,l.drawArrays(h,0,d.array.length/3),H.info.render.calls++,H.info.render.points+=d.array.length/3};this.renderBuffer=function(a,
-b,c,d,e,k){if(!1!==d.visible){c=E(a,b,c,d,k);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==Oa&&(Oa=c,a=!0);a&&f();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),g(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k.morphTargetBase]),g(c.position),l.vertexAttribPointer(c.position,
-3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),g(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length)for(var m=0,n=k.morphTargetForcedOrder,r=k.morphTargetInfluences;m<d.numSupportedMorphTargets&&m<n.length;)0<=c["morphTarget"+m]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[n[m]]),g(c["morphTarget"+m]),l.vertexAttribPointer(c["morphTarget"+m],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&
-(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[n[m]]),g(c["morphNormal"+m]),l.vertexAttribPointer(c["morphNormal"+m],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[m]=r[n[m]],m++;else{var n=[],r=k.morphTargetInfluences,q,s=r.length;for(q=0;q<s;q++)m=r[q],0<m&&n.push([m,q]);n.length>d.numSupportedMorphTargets?(n.sort(p),n.length=d.numSupportedMorphTargets):n.length>d.numSupportedMorphNormals?n.sort(p):0===n.length&&n.push([0,0]);for(m=0;m<d.numSupportedMorphTargets;)n[m]?(q=n[m][1],0<=
-c["morphTarget"+m]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[q]),g(c["morphTarget"+m]),l.vertexAttribPointer(c["morphTarget"+m],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[q]),g(c["morphNormal"+m]),l.vertexAttribPointer(c["morphNormal"+m],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[m]=r[q]):k.__webglMorphTargetInfluences[m]=0,m++}null!==d.program.uniforms.morphTargetInfluences&&l.uniform1fv(d.program.uniforms.morphTargetInfluences,
-k.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(c=0,r=e.__webglCustomAttributesList.length;c<r;c++)n=e.__webglCustomAttributesList[c],0<=b[n.buffer.belongsToAttribute]&&(l.bindBuffer(l.ARRAY_BUFFER,n.buffer),g(b[n.buffer.belongsToAttribute]),l.vertexAttribPointer(b[n.buffer.belongsToAttribute],n.size,l.FLOAT,!1,0,0));0<=b.color&&(0<k.geometry.colors.length||0<k.geometry.faces.length?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglColorBuffer),g(b.color),l.vertexAttribPointer(b.color,
-3,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglNormalBuffer),g(b.normal),l.vertexAttribPointer(b.normal,3,l.FLOAT,!1,0,0));0<=b.tangent&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglTangentBuffer),g(b.tangent),l.vertexAttribPointer(b.tangent,4,l.FLOAT,!1,0,0));0<=b.uv&&(k.geometry.faceVertexUvs[0]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUVBuffer),g(b.uv),l.vertexAttribPointer(b.uv,2,l.FLOAT,
-!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(k.geometry.faceVertexUvs[1]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUV2Buffer),g(b.uv2),l.vertexAttribPointer(b.uv2,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),g(b.skinIndex),l.vertexAttribPointer(b.skinIndex,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,
-e.__webglSkinWeightsBuffer),g(b.skinWeight),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0));0<=b.lineDistance&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglLineDistanceBuffer),g(b.lineDistance),l.vertexAttribPointer(b.lineDistance,1,l.FLOAT,!1,0,0))}h();k instanceof THREE.Mesh?(k=e.__typeArray===Uint32Array?l.UNSIGNED_INT:l.UNSIGNED_SHORT,d.wireframe?(A(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),l.drawElements(l.LINES,e.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
-e.__webglFaceBuffer),l.drawElements(l.TRIANGLES,e.__webglFaceCount,k,0)),H.info.render.calls++,H.info.render.vertices+=e.__webglFaceCount,H.info.render.faces+=e.__webglFaceCount/3):k instanceof THREE.Line?(k=k.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,A(d.linewidth),l.drawArrays(k,0,e.__webglLineCount),H.info.render.calls++):k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,e.__webglParticleCount),H.info.render.calls++,H.info.render.points+=e.__webglParticleCount)}};this.render=function(a,
-b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;Hb=Oa=-1;dc=null;ec=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);Ac.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ec.setFromMatrix(Ac);eb.length=0;cb.length=0;Gb.length=0;xb.length=
-0;Ra.length=0;q(a,a);!0===H.sortObjects&&(cb.sort(k),Gb.sort(n));kd.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(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);d=0;for(var f=pb.length;d<f;d++){var g=pb[d],h=g.object;h.visible&&(y(h,b),t(g))}a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),
-this.setDepthWrite(d.depthWrite),B(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),m(cb,b,eb,e,!0,d),m(Gb,b,eb,e,!0,d),r(pb,"",b,eb,e,!1,d)):(d=null,this.setBlending(THREE.NoBlending),m(cb,b,eb,e,!1,d),r(pb,"opaque",b,eb,e,!1,d),m(Gb,b,eb,e,!0,d),r(pb,"transparent",b,eb,e,!0,d));ld.render(a,b);md.render(a,b,Uc,Vc);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&I(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,
-b,c,d,e){var f=E(a,b,c,d,e);Oa=-1;H.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,Ec):e.render(function(a){H.renderBufferImmediate(a,f,d)})};var ob={},rc=0;this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):l.frontFace(l.CCW),a===THREE.CullFaceBack?l.cullFace(l.BACK):a===THREE.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK),l.enable(l.CULL_FACE))};this.setMaterialFaces=function(a){var b=
-a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;Ib!==b&&(b?l.disable(l.CULL_FACE):l.enable(l.CULL_FACE),Ib=b);Jb!==a&&(a?l.frontFace(l.CW):l.frontFace(l.CCW),Jb=a)};this.setDepthTest=function(a){Wb!==a&&(a?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),Wb=a)};this.setDepthWrite=function(a){Nb!==a&&(l.depthMask(a),Nb=a)};this.setBlending=function(a,b,c,d){a!==Kb&&(a===THREE.NoBlending?l.disable(l.BLEND):a===THREE.AdditiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,
-l.ONE)):a===THREE.SubtractiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.SRC_COLOR)):a===THREE.CustomBlending?l.enable(l.BLEND):(l.enable(l.BLEND),l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),Kb=a);if(a===THREE.CustomBlending){if(b!==qb&&(l.blendEquation(L(b)),qb=b),
-c!==Lb||d!==Mb)l.blendFunc(L(c),L(d)),Lb=c,Mb=d}else Mb=Lb=qb=null};this.uploadTexture=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",fc),a.__webglTexture=l.createTexture(),H.info.memory.textures++);l.bindTexture(l.TEXTURE_2D,a.__webglTexture);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,a.flipY);l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);l.pixelStorei(l.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=S(a.image,ed);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&
-THREE.Math.isPowerOfTwo(b.height),d=L(a.format),e=L(a.type);G(l.TEXTURE_2D,a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<f.length&&c){for(var g=0,h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(g=0,h=f.length;g<h;g++)b=f[g],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Nc().indexOf(d)?l.compressedTexImage2D(l.TEXTURE_2D,
-g,d,b.width,b.height,0,b.data):console.warn("Attempt to load unsupported compressed texture format"):l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);else if(0<f.length&&c){g=0;for(h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&l.generateMipmap(l.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()};this.setTexture=function(a,b){l.activeTexture(l.TEXTURE0+b);a.needsUpdate?H.uploadTexture(a):
-l.bindTexture(l.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",ad);a.__webglTexture=l.createTexture();H.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=L(a.format),e=L(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];
-l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture);G(l.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=l.createFramebuffer();a.__webglRenderbuffer[f]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+f;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[f]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,h,g.__webglTexture,0);K(a.__webglRenderbuffer[f],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=
-l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),G(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,
-l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):K(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=jc,a=kc,
-d=nb,e=Xb);b!==Tc&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),Tc=b);Uc=c;Vc=a};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.")}};
+3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(n,a.defaultAttributeValues[m]))}}h()}function f(){for(var a=0,b=Eb.length;a<b;a++)Eb[a]=0}function g(a){Eb[a]=1;0===Ya[a]&&(l.enableVertexAttribArray(a),Ya[a]=1)}function h(){for(var a=0,b=Ya.length;a<b;a++)Ya[a]!==Eb[a]&&(l.disableVertexAttribArray(a),Ya[a]=0)}function k(a,b){return a.material.id!==b.material.id?b.material.id-a.material.id:a.z!==b.z?b.z-a.z:a.id-b.id}function n(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return b[0]-
+a[0]}function q(a,e){if(!1!==e.visible){if(!(e instanceof THREE.Scene||e instanceof THREE.Group)){void 0===e.__webglInit&&(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrix=new THREE.Matrix3,e.addEventListener("removed",Dc));var f=e.geometry;if(void 0!==f&&void 0===f.__webglInit&&(f.__webglInit=!0,f.addEventListener("dispose",Ec),!(f instanceof THREE.BufferGeometry)))if(e instanceof THREE.Mesh)s(a,e,f);else if(e instanceof THREE.Line){if(void 0===f.__webglVertexBuffer){f.__webglVertexBuffer=
+l.createBuffer();f.__webglColorBuffer=l.createBuffer();f.__webglLineDistanceBuffer=l.createBuffer();I.info.memory.geometries++;var g=f.vertices.length;f.__vertexArray=new Float32Array(3*g);f.__colorArray=new Float32Array(3*g);f.__lineDistanceArray=new Float32Array(1*g);f.__webglLineCount=g;b(e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0;f.lineDistancesNeedUpdate=!0}}else if(e instanceof THREE.PointCloud&&void 0===f.__webglVertexBuffer){f.__webglVertexBuffer=l.createBuffer();f.__webglColorBuffer=
+l.createBuffer();I.info.memory.geometries++;var h=f.vertices.length;f.__vertexArray=new Float32Array(3*h);f.__colorArray=new Float32Array(3*h);f.__sortArray=[];f.__webglParticleCount=h;b(e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0}if(void 0===e.__webglActive)if(e.__webglActive=!0,e instanceof THREE.Mesh)if(f instanceof THREE.BufferGeometry)u(cb,f,e);else{if(f instanceof THREE.Geometry)for(var k=jb[f.id],m=0,n=k.length;m<n;m++)u(cb,k[m],e)}else e instanceof THREE.Line||e instanceof THREE.PointCloud?
+u(cb,f,e):(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)&&kb.push({id:null,object:e,opaque:null,transparent:null,z:0});if(e instanceof THREE.Light)bb.push(e);else if(e instanceof THREE.Sprite)pb.push(e);else if(e instanceof THREE.LensFlare)Pa.push(e);else{var p=cb[e.id];if(p&&(!1===e.frustumCulled||!0===zc.intersectsObject(e))){var r=e.geometry,t,w;if(r instanceof THREE.BufferGeometry)for(var J=r.attributes,y=r.attributesKeys,C=0,D=y.length;C<D;C++){var B=y[C],A=J[B];void 0===
+A.buffer&&(A.buffer=l.createBuffer(),A.needsUpdate=!0);if(!0===A.needsUpdate){var P="index"===B?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;l.bindBuffer(P,A.buffer);l.bufferData(P,A.array,l.STATIC_DRAW);A.needsUpdate=!1}}else if(e instanceof THREE.Mesh){!0===r.groupsNeedUpdate&&s(a,e,r);for(var G=jb[r.id],N=0,M=G.length;N<M;N++){var H=G[N];w=d(e,H);!0===r.groupsNeedUpdate&&c(H,e);t=w.attributes&&v(w);if(r.verticesNeedUpdate||r.morphTargetsNeedUpdate||r.elementsNeedUpdate||r.uvsNeedUpdate||r.normalsNeedUpdate||
+r.colorsNeedUpdate||r.tangentsNeedUpdate||t){var F=H,U=e,L=l.DYNAMIC_DRAW,V=!r.dynamic,S=w;if(F.__inittedArrays){var W=S&&void 0!==S.shading&&S.shading===THREE.SmoothShading,Q=void 0,K=void 0,Ma=void 0,$=void 0,ka=void 0,da=void 0,pa=void 0,Da=void 0,ja=void 0,hb=void 0,wa=void 0,Z=void 0,Y=void 0,X=void 0,va=void 0,ma=void 0,O=void 0,Ea=void 0,la=void 0,Zb=void 0,ea=void 0,$b=void 0,ac=void 0,bc=void 0,ya=void 0,cc=void 0,qb=void 0,Fa=void 0,rb=void 0,xa=void 0,sa=void 0,sb=void 0,La=void 0,Fb=void 0,
+Ka=void 0,Ya=void 0,Wa=void 0,Za=void 0,mc=void 0,Gb=void 0,db=0,eb=0,mb=0,nb=0,tb=0,Qa=0,za=0,Na=0,Ia=0,fa=0,qa=0,E=0,Ga=void 0,Oa=F.__vertexArray,ob=F.__uvArray,fb=F.__uv2Array,Ra=F.__normalArray,na=F.__tangentArray,Ja=F.__colorArray,Sa=F.__skinIndexArray,Ta=F.__skinWeightArray,ub=F.__morphTargetsArrays,Fc=F.__morphNormalsArrays,yb=F.__webglCustomAttributesList,z=void 0,Hb=F.__faceArray,Ha=F.__lineArray,ta=U.geometry,$a=ta.elementsNeedUpdate,Ob=ta.uvsNeedUpdate,Tb=ta.normalsNeedUpdate,aa=ta.tangentsNeedUpdate,
+Eb=ta.colorsNeedUpdate,T=ta.morphTargetsNeedUpdate,ba=ta.vertices,R=F.faces3,ua=ta.faces,ra=ta.faceVertexUvs[0],Gc=ta.faceVertexUvs[1],Ac=ta.skinIndices,Ib=ta.skinWeights,ib=ta.morphTargets,Aa=ta.morphNormals;if(ta.verticesNeedUpdate){Q=0;for(K=R.length;Q<K;Q++)$=ua[R[Q]],Z=ba[$.a],Y=ba[$.b],X=ba[$.c],Oa[eb]=Z.x,Oa[eb+1]=Z.y,Oa[eb+2]=Z.z,Oa[eb+3]=Y.x,Oa[eb+4]=Y.y,Oa[eb+5]=Y.z,Oa[eb+6]=X.x,Oa[eb+7]=X.y,Oa[eb+8]=X.z,eb+=9;l.bindBuffer(l.ARRAY_BUFFER,F.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,
+Oa,L)}if(T)for(Ka=0,Ya=ib.length;Ka<Ya;Ka++){Q=qa=0;for(K=R.length;Q<K;Q++)mc=R[Q],$=ua[mc],Z=ib[Ka].vertices[$.a],Y=ib[Ka].vertices[$.b],X=ib[Ka].vertices[$.c],Wa=ub[Ka],Wa[qa]=Z.x,Wa[qa+1]=Z.y,Wa[qa+2]=Z.z,Wa[qa+3]=Y.x,Wa[qa+4]=Y.y,Wa[qa+5]=Y.z,Wa[qa+6]=X.x,Wa[qa+7]=X.y,Wa[qa+8]=X.z,S.morphNormals&&(W?(Gb=Aa[Ka].vertexNormals[mc],Ea=Gb.a,la=Gb.b,Zb=Gb.c):Zb=la=Ea=Aa[Ka].faceNormals[mc],Za=Fc[Ka],Za[qa]=Ea.x,Za[qa+1]=Ea.y,Za[qa+2]=Ea.z,Za[qa+3]=la.x,Za[qa+4]=la.y,Za[qa+5]=la.z,Za[qa+6]=Zb.x,Za[qa+
+7]=Zb.y,Za[qa+8]=Zb.z),qa+=9;l.bindBuffer(l.ARRAY_BUFFER,F.__webglMorphTargetsBuffers[Ka]);l.bufferData(l.ARRAY_BUFFER,ub[Ka],L);S.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,F.__webglMorphNormalsBuffers[Ka]),l.bufferData(l.ARRAY_BUFFER,Fc[Ka],L))}if(Ib.length){Q=0;for(K=R.length;Q<K;Q++)$=ua[R[Q]],bc=Ib[$.a],ya=Ib[$.b],cc=Ib[$.c],Ta[fa]=bc.x,Ta[fa+1]=bc.y,Ta[fa+2]=bc.z,Ta[fa+3]=bc.w,Ta[fa+4]=ya.x,Ta[fa+5]=ya.y,Ta[fa+6]=ya.z,Ta[fa+7]=ya.w,Ta[fa+8]=cc.x,Ta[fa+9]=cc.y,Ta[fa+10]=cc.z,Ta[fa+11]=cc.w,qb=
+Ac[$.a],Fa=Ac[$.b],rb=Ac[$.c],Sa[fa]=qb.x,Sa[fa+1]=qb.y,Sa[fa+2]=qb.z,Sa[fa+3]=qb.w,Sa[fa+4]=Fa.x,Sa[fa+5]=Fa.y,Sa[fa+6]=Fa.z,Sa[fa+7]=Fa.w,Sa[fa+8]=rb.x,Sa[fa+9]=rb.y,Sa[fa+10]=rb.z,Sa[fa+11]=rb.w,fa+=12;0<fa&&(l.bindBuffer(l.ARRAY_BUFFER,F.__webglSkinIndicesBuffer),l.bufferData(l.ARRAY_BUFFER,Sa,L),l.bindBuffer(l.ARRAY_BUFFER,F.__webglSkinWeightsBuffer),l.bufferData(l.ARRAY_BUFFER,Ta,L))}if(Eb){Q=0;for(K=R.length;Q<K;Q++)$=ua[R[Q]],pa=$.vertexColors,Da=$.color,3===pa.length&&S.vertexColors===THREE.VertexColors?
+(ea=pa[0],$b=pa[1],ac=pa[2]):ac=$b=ea=Da,Ja[Ia]=ea.r,Ja[Ia+1]=ea.g,Ja[Ia+2]=ea.b,Ja[Ia+3]=$b.r,Ja[Ia+4]=$b.g,Ja[Ia+5]=$b.b,Ja[Ia+6]=ac.r,Ja[Ia+7]=ac.g,Ja[Ia+8]=ac.b,Ia+=9;0<Ia&&(l.bindBuffer(l.ARRAY_BUFFER,F.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,Ja,L))}if(aa&&ta.hasTangents){Q=0;for(K=R.length;Q<K;Q++)$=ua[R[Q]],ja=$.vertexTangents,va=ja[0],ma=ja[1],O=ja[2],na[za]=va.x,na[za+1]=va.y,na[za+2]=va.z,na[za+3]=va.w,na[za+4]=ma.x,na[za+5]=ma.y,na[za+6]=ma.z,na[za+7]=ma.w,na[za+8]=O.x,na[za+9]=
+O.y,na[za+10]=O.z,na[za+11]=O.w,za+=12;l.bindBuffer(l.ARRAY_BUFFER,F.__webglTangentBuffer);l.bufferData(l.ARRAY_BUFFER,na,L)}if(Tb){Q=0;for(K=R.length;Q<K;Q++)if($=ua[R[Q]],ka=$.vertexNormals,da=$.normal,3===ka.length&&W)for(xa=0;3>xa;xa++)sb=ka[xa],Ra[Qa]=sb.x,Ra[Qa+1]=sb.y,Ra[Qa+2]=sb.z,Qa+=3;else for(xa=0;3>xa;xa++)Ra[Qa]=da.x,Ra[Qa+1]=da.y,Ra[Qa+2]=da.z,Qa+=3;l.bindBuffer(l.ARRAY_BUFFER,F.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,Ra,L)}if(Ob&&ra){Q=0;for(K=R.length;Q<K;Q++)if(Ma=R[Q],hb=
+ra[Ma],void 0!==hb)for(xa=0;3>xa;xa++)La=hb[xa],ob[mb]=La.x,ob[mb+1]=La.y,mb+=2;0<mb&&(l.bindBuffer(l.ARRAY_BUFFER,F.__webglUVBuffer),l.bufferData(l.ARRAY_BUFFER,ob,L))}if(Ob&&Gc){Q=0;for(K=R.length;Q<K;Q++)if(Ma=R[Q],wa=Gc[Ma],void 0!==wa)for(xa=0;3>xa;xa++)Fb=wa[xa],fb[nb]=Fb.x,fb[nb+1]=Fb.y,nb+=2;0<nb&&(l.bindBuffer(l.ARRAY_BUFFER,F.__webglUV2Buffer),l.bufferData(l.ARRAY_BUFFER,fb,L))}if($a){Q=0;for(K=R.length;Q<K;Q++)Hb[tb]=db,Hb[tb+1]=db+1,Hb[tb+2]=db+2,tb+=3,Ha[Na]=db,Ha[Na+1]=db+1,Ha[Na+2]=
+db,Ha[Na+3]=db+2,Ha[Na+4]=db+1,Ha[Na+5]=db+2,Na+=6,db+=3;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,F.__webglFaceBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,Hb,L);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,F.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,Ha,L)}if(yb)for(xa=0,sa=yb.length;xa<sa;xa++)if(z=yb[xa],z.__original.needsUpdate){E=0;if(1===z.size)if(void 0===z.boundTo||"vertices"===z.boundTo)for(Q=0,K=R.length;Q<K;Q++)$=ua[R[Q]],z.array[E]=z.value[$.a],z.array[E+1]=z.value[$.b],z.array[E+2]=z.value[$.c],
+E+=3;else{if("faces"===z.boundTo)for(Q=0,K=R.length;Q<K;Q++)Ga=z.value[R[Q]],z.array[E]=Ga,z.array[E+1]=Ga,z.array[E+2]=Ga,E+=3}else if(2===z.size)if(void 0===z.boundTo||"vertices"===z.boundTo)for(Q=0,K=R.length;Q<K;Q++)$=ua[R[Q]],Z=z.value[$.a],Y=z.value[$.b],X=z.value[$.c],z.array[E]=Z.x,z.array[E+1]=Z.y,z.array[E+2]=Y.x,z.array[E+3]=Y.y,z.array[E+4]=X.x,z.array[E+5]=X.y,E+=6;else{if("faces"===z.boundTo)for(Q=0,K=R.length;Q<K;Q++)X=Y=Z=Ga=z.value[R[Q]],z.array[E]=Z.x,z.array[E+1]=Z.y,z.array[E+
+2]=Y.x,z.array[E+3]=Y.y,z.array[E+4]=X.x,z.array[E+5]=X.y,E+=6}else if(3===z.size){var ga;ga="c"===z.type?["r","g","b"]:["x","y","z"];if(void 0===z.boundTo||"vertices"===z.boundTo)for(Q=0,K=R.length;Q<K;Q++)$=ua[R[Q]],Z=z.value[$.a],Y=z.value[$.b],X=z.value[$.c],z.array[E]=Z[ga[0]],z.array[E+1]=Z[ga[1]],z.array[E+2]=Z[ga[2]],z.array[E+3]=Y[ga[0]],z.array[E+4]=Y[ga[1]],z.array[E+5]=Y[ga[2]],z.array[E+6]=X[ga[0]],z.array[E+7]=X[ga[1]],z.array[E+8]=X[ga[2]],E+=9;else if("faces"===z.boundTo)for(Q=0,K=
+R.length;Q<K;Q++)X=Y=Z=Ga=z.value[R[Q]],z.array[E]=Z[ga[0]],z.array[E+1]=Z[ga[1]],z.array[E+2]=Z[ga[2]],z.array[E+3]=Y[ga[0]],z.array[E+4]=Y[ga[1]],z.array[E+5]=Y[ga[2]],z.array[E+6]=X[ga[0]],z.array[E+7]=X[ga[1]],z.array[E+8]=X[ga[2]],E+=9;else if("faceVertices"===z.boundTo)for(Q=0,K=R.length;Q<K;Q++)Ga=z.value[R[Q]],Z=Ga[0],Y=Ga[1],X=Ga[2],z.array[E]=Z[ga[0]],z.array[E+1]=Z[ga[1]],z.array[E+2]=Z[ga[2]],z.array[E+3]=Y[ga[0]],z.array[E+4]=Y[ga[1]],z.array[E+5]=Y[ga[2]],z.array[E+6]=X[ga[0]],z.array[E+
+7]=X[ga[1]],z.array[E+8]=X[ga[2]],E+=9}else if(4===z.size)if(void 0===z.boundTo||"vertices"===z.boundTo)for(Q=0,K=R.length;Q<K;Q++)$=ua[R[Q]],Z=z.value[$.a],Y=z.value[$.b],X=z.value[$.c],z.array[E]=Z.x,z.array[E+1]=Z.y,z.array[E+2]=Z.z,z.array[E+3]=Z.w,z.array[E+4]=Y.x,z.array[E+5]=Y.y,z.array[E+6]=Y.z,z.array[E+7]=Y.w,z.array[E+8]=X.x,z.array[E+9]=X.y,z.array[E+10]=X.z,z.array[E+11]=X.w,E+=12;else if("faces"===z.boundTo)for(Q=0,K=R.length;Q<K;Q++)X=Y=Z=Ga=z.value[R[Q]],z.array[E]=Z.x,z.array[E+1]=
+Z.y,z.array[E+2]=Z.z,z.array[E+3]=Z.w,z.array[E+4]=Y.x,z.array[E+5]=Y.y,z.array[E+6]=Y.z,z.array[E+7]=Y.w,z.array[E+8]=X.x,z.array[E+9]=X.y,z.array[E+10]=X.z,z.array[E+11]=X.w,E+=12;else if("faceVertices"===z.boundTo)for(Q=0,K=R.length;Q<K;Q++)Ga=z.value[R[Q]],Z=Ga[0],Y=Ga[1],X=Ga[2],z.array[E]=Z.x,z.array[E+1]=Z.y,z.array[E+2]=Z.z,z.array[E+3]=Z.w,z.array[E+4]=Y.x,z.array[E+5]=Y.y,z.array[E+6]=Y.z,z.array[E+7]=Y.w,z.array[E+8]=X.x,z.array[E+9]=X.y,z.array[E+10]=X.z,z.array[E+11]=X.w,E+=12;l.bindBuffer(l.ARRAY_BUFFER,
+z.buffer);l.bufferData(l.ARRAY_BUFFER,z.array,L)}V&&(delete F.__inittedArrays,delete F.__colorArray,delete F.__normalArray,delete F.__tangentArray,delete F.__uvArray,delete F.__uv2Array,delete F.__faceArray,delete F.__vertexArray,delete F.__lineArray,delete F.__skinIndexArray,delete F.__skinWeightArray)}}}r.verticesNeedUpdate=!1;r.morphTargetsNeedUpdate=!1;r.elementsNeedUpdate=!1;r.uvsNeedUpdate=!1;r.normalsNeedUpdate=!1;r.colorsNeedUpdate=!1;r.tangentsNeedUpdate=!1;w.attributes&&x(w)}else if(e instanceof
+THREE.Line){w=d(e,r);t=w.attributes&&v(w);if(r.verticesNeedUpdate||r.colorsNeedUpdate||r.lineDistancesNeedUpdate||t){var Pb=l.DYNAMIC_DRAW,ab,vb,gb,Qb,ca,nc,Sb=r.vertices,Ub=r.colors,lb=r.lineDistances,Db=Sb.length,Mb=Ub.length,Nb=lb.length,oc=r.__vertexArray,pc=r.__colorArray,Yb=r.__lineDistanceArray,hc=r.colorsNeedUpdate,ic=r.lineDistancesNeedUpdate,Vb=r.__webglCustomAttributesList,qc,Lb,Ba,Wb,Ua,ha;if(r.verticesNeedUpdate){for(ab=0;ab<Db;ab++)Qb=Sb[ab],ca=3*ab,oc[ca]=Qb.x,oc[ca+1]=Qb.y,oc[ca+2]=
+Qb.z;l.bindBuffer(l.ARRAY_BUFFER,r.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,oc,Pb)}if(hc){for(vb=0;vb<Mb;vb++)nc=Ub[vb],ca=3*vb,pc[ca]=nc.r,pc[ca+1]=nc.g,pc[ca+2]=nc.b;l.bindBuffer(l.ARRAY_BUFFER,r.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,pc,Pb)}if(ic){for(gb=0;gb<Nb;gb++)Yb[gb]=lb[gb];l.bindBuffer(l.ARRAY_BUFFER,r.__webglLineDistanceBuffer);l.bufferData(l.ARRAY_BUFFER,Yb,Pb)}if(Vb)for(qc=0,Lb=Vb.length;qc<Lb;qc++)if(ha=Vb[qc],ha.needsUpdate&&(void 0===ha.boundTo||"vertices"===ha.boundTo)){ca=
+0;Wb=ha.value.length;if(1===ha.size)for(Ba=0;Ba<Wb;Ba++)ha.array[Ba]=ha.value[Ba];else if(2===ha.size)for(Ba=0;Ba<Wb;Ba++)Ua=ha.value[Ba],ha.array[ca]=Ua.x,ha.array[ca+1]=Ua.y,ca+=2;else if(3===ha.size)if("c"===ha.type)for(Ba=0;Ba<Wb;Ba++)Ua=ha.value[Ba],ha.array[ca]=Ua.r,ha.array[ca+1]=Ua.g,ha.array[ca+2]=Ua.b,ca+=3;else for(Ba=0;Ba<Wb;Ba++)Ua=ha.value[Ba],ha.array[ca]=Ua.x,ha.array[ca+1]=Ua.y,ha.array[ca+2]=Ua.z,ca+=3;else if(4===ha.size)for(Ba=0;Ba<Wb;Ba++)Ua=ha.value[Ba],ha.array[ca]=Ua.x,ha.array[ca+
+1]=Ua.y,ha.array[ca+2]=Ua.z,ha.array[ca+3]=Ua.w,ca+=4;l.bindBuffer(l.ARRAY_BUFFER,ha.buffer);l.bufferData(l.ARRAY_BUFFER,ha.array,Pb);ha.needsUpdate=!1}}r.verticesNeedUpdate=!1;r.colorsNeedUpdate=!1;r.lineDistancesNeedUpdate=!1;w.attributes&&x(w)}else if(e instanceof THREE.PointCloud){w=d(e,r);t=w.attributes&&v(w);if(r.verticesNeedUpdate||r.colorsNeedUpdate||t){var zb=l.DYNAMIC_DRAW,dc,ec,rc,oa,sc,Ab=r.vertices,jc=Ab.length,Bb=r.colors,kc=Bb.length,tc=r.__vertexArray,uc=r.__colorArray,lc=r.colorsNeedUpdate,
+Cb=r.__webglCustomAttributesList,vc,fc,Ca,Xb,Va,ia;if(r.verticesNeedUpdate){for(dc=0;dc<jc;dc++)rc=Ab[dc],oa=3*dc,tc[oa]=rc.x,tc[oa+1]=rc.y,tc[oa+2]=rc.z;l.bindBuffer(l.ARRAY_BUFFER,r.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,tc,zb)}if(lc){for(ec=0;ec<kc;ec++)sc=Bb[ec],oa=3*ec,uc[oa]=sc.r,uc[oa+1]=sc.g,uc[oa+2]=sc.b;l.bindBuffer(l.ARRAY_BUFFER,r.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,uc,zb)}if(Cb)for(vc=0,fc=Cb.length;vc<fc;vc++){ia=Cb[vc];if(ia.needsUpdate&&(void 0===ia.boundTo||
+"vertices"===ia.boundTo))if(Xb=ia.value.length,oa=0,1===ia.size)for(Ca=0;Ca<Xb;Ca++)ia.array[Ca]=ia.value[Ca];else if(2===ia.size)for(Ca=0;Ca<Xb;Ca++)Va=ia.value[Ca],ia.array[oa]=Va.x,ia.array[oa+1]=Va.y,oa+=2;else if(3===ia.size)if("c"===ia.type)for(Ca=0;Ca<Xb;Ca++)Va=ia.value[Ca],ia.array[oa]=Va.r,ia.array[oa+1]=Va.g,ia.array[oa+2]=Va.b,oa+=3;else for(Ca=0;Ca<Xb;Ca++)Va=ia.value[Ca],ia.array[oa]=Va.x,ia.array[oa+1]=Va.y,ia.array[oa+2]=Va.z,oa+=3;else if(4===ia.size)for(Ca=0;Ca<Xb;Ca++)Va=ia.value[Ca],
+ia.array[oa]=Va.x,ia.array[oa+1]=Va.y,ia.array[oa+2]=Va.z,ia.array[oa+3]=Va.w,oa+=4;l.bindBuffer(l.ARRAY_BUFFER,ia.buffer);l.bufferData(l.ARRAY_BUFFER,ia.array,zb);ia.needsUpdate=!1}}r.verticesNeedUpdate=!1;r.colorsNeedUpdate=!1;w.attributes&&x(w)}for(var Rb=0,Bc=p.length;Rb<Bc;Rb++){var wc=p[Rb],Jb=wc,gc=Jb.object,xc=Jb.buffer,yc=gc.geometry,Kb=gc.material;Kb instanceof THREE.MeshFaceMaterial?(Kb=Kb.materials[yc instanceof THREE.BufferGeometry?0:xc.materialIndex],Jb.material=Kb,Kb.transparent?wb.push(Jb):
+xb.push(Jb)):Kb&&(Jb.material=Kb,Kb.transparent?wb.push(Jb):xb.push(Jb));wc.render=!0;!0===I.sortObjects&&(null!==e.renderDepth?wc.z=e.renderDepth:(Xa.setFromMatrixPosition(e.matrixWorld),Xa.applyProjection(Cc),wc.z=Xa.z))}}}}Rb=0;for(Bc=e.children.length;Rb<Bc;Rb++)q(a,e.children[Rb])}}function m(a,b,c,d,e,f){for(var g,h=a.length-1;-1!==h;h--){g=a[h];var k=g.object,l=g.buffer;y(k,b);if(f)g=f;else{g=g.material;if(!g)continue;e&&I.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);I.setDepthTest(g.depthTest);
+I.setDepthWrite(g.depthWrite);B(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}I.setMaterialFaces(g);l instanceof THREE.BufferGeometry?I.renderBufferDirect(b,c,d,g,l,k):I.renderBuffer(b,c,d,g,l,k)}}function t(a,b,c,d,e,f,g){for(var h,k=0,l=a.length;k<l;k++){h=a[k];var m=h.object;if(m.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&I.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);I.setDepthTest(h.depthTest);I.setDepthWrite(h.depthWrite);B(h.polygonOffset,h.polygonOffsetFactor,
+h.polygonOffsetUnits)}I.renderImmediateObject(c,d,e,h,m)}}}function r(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function s(a,b,d){var e=b.material,f=!1;if(void 0===jb[d.id]||!0===d.groupsNeedUpdate){delete cb[b.id];a=jb;for(var g=d.id,e=e instanceof THREE.MeshFaceMaterial,h=ka.get("OES_element_index_uint")?4294967296:65535,k,f={},m=d.morphTargets.length,n=d.morphNormals.length,p,r={},q=[],t=0,s=d.faces.length;t<s;t++){k=d.faces[t];var v=
+e?k.materialIndex:0;v in f||(f[v]={hash:v,counter:0});k=f[v].hash+"_"+f[v].counter;k in r||(p={id:fc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:n},r[k]=p,q.push(p));r[k].vertices+3>h&&(f[v].counter+=1,k=f[v].hash+"_"+f[v].counter,k in r||(p={id:fc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:n},r[k]=p,q.push(p)));r[k].faces3.push(t);r[k].vertices+=3}a[g]=q;d.groupsNeedUpdate=!1}a=jb[d.id];g=0;for(e=a.length;g<e;g++){h=a[g];if(void 0===h.__webglVertexBuffer){f=
+h;f.__webglVertexBuffer=l.createBuffer();f.__webglNormalBuffer=l.createBuffer();f.__webglTangentBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();f.__webglUVBuffer=l.createBuffer();f.__webglUV2Buffer=l.createBuffer();f.__webglSkinIndicesBuffer=l.createBuffer();f.__webglSkinWeightsBuffer=l.createBuffer();f.__webglFaceBuffer=l.createBuffer();f.__webglLineBuffer=l.createBuffer();n=m=void 0;if(f.numMorphTargets)for(f.__webglMorphTargetsBuffers=[],m=0,n=f.numMorphTargets;m<n;m++)f.__webglMorphTargetsBuffers.push(l.createBuffer());
+if(f.numMorphNormals)for(f.__webglMorphNormalsBuffers=[],m=0,n=f.numMorphNormals;m<n;m++)f.__webglMorphNormalsBuffers.push(l.createBuffer());I.info.memory.geometries++;c(h,b);d.verticesNeedUpdate=!0;d.morphTargetsNeedUpdate=!0;d.elementsNeedUpdate=!0;d.uvsNeedUpdate=!0;d.normalsNeedUpdate=!0;d.tangentsNeedUpdate=!0;f=d.colorsNeedUpdate=!0}else f=!1;(f||void 0===b.__webglActive)&&u(cb,h,b)}b.__webglActive=!0}function u(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,
+z:0})}function v(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function x(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function J(a,b,c,d,e){var f,g,h,k;Sb=0;if(d.needsUpdate){d.program&&gc(d);d.addEventListener("dispose",xc);var m;d instanceof THREE.MeshDepthMaterial?m="depth":d instanceof THREE.MeshNormalMaterial?m="normal":d instanceof THREE.MeshBasicMaterial?m="basic":d instanceof THREE.MeshLambertMaterial?m="lambert":d instanceof THREE.MeshPhongMaterial?
+m="phong":d instanceof THREE.LineBasicMaterial?m="basic":d instanceof THREE.LineDashedMaterial?m="dashed":d instanceof THREE.PointCloudMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var p=0,r=0,q=0,t=0,s=0,v=b.length;s<v;s++){var u=b[s];u.onlyShadow||!1===
+u.visible||(u instanceof THREE.DirectionalLight&&p++,u instanceof THREE.PointLight&&r++,u instanceof THREE.SpotLight&&q++,u instanceof THREE.HemisphereLight&&t++)}f=p;g=r;h=q;k=t;for(var x,J=0,y=0,A=b.length;y<A;y++){var B=b[y];B.castShadow&&(B instanceof THREE.SpotLight&&J++,B instanceof THREE.DirectionalLight&&!B.shadowCascade&&J++)}x=J;var F;if(Yb&&e&&e.skeleton&&e.skeleton.useVertexTexture)F=1024;else{var K=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),H=Math.floor((K-20)/4);void 0!==e&&e instanceof
+THREE.SkinnedMesh&&(H=Math.min(e.skeleton.bones.length,H),H<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+H+" (try OpenGL instead of ANGLE)"));F=H}var M={precision:W,supportsVertexTextures:hc,map:!!d.map,envMap:!!d.envMap,lightMap:!!d.lightMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:d.sizeAttenuation,
+logarithmicDepthBuffer:Da,skinning:d.skinning,maxBones:F,useVertexTexture:Yb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:I.maxMorphTargets,maxMorphNormals:I.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:x,shadowMapEnabled:I.shadowMapEnabled&&e.receiveShadow&&0<x,shadowMapType:I.shadowMapType,shadowMapDebug:I.shadowMapDebug,shadowMapCascade:I.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,
+wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},L=[];m?L.push(m):(L.push(d.fragmentShader),L.push(d.vertexShader));if(void 0!==d.defines)for(var S in d.defines)L.push(S),L.push(d.defines[S]);for(S in M)L.push(S),L.push(M[S]);for(var Q=L.join(),Ma,cb=0,$=hb.length;cb<$;cb++){var kb=hb[cb];if(kb.code===Q){Ma=kb;Ma.usedTimes++;break}}void 0===Ma&&(Ma=new THREE.WebGLProgram(I,Q,d,M),hb.push(Ma),I.info.memory.programs=hb.length);d.program=Ma;var bb=Ma.attributes;
+if(d.morphTargets){d.numSupportedMorphTargets=0;for(var da,ka="morphTarget",ja=0;ja<I.maxMorphTargets;ja++)da=ka+ja,0<=bb[da]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,ka="morphNormal",ja=0;ja<I.maxMorphNormals;ja++)da=ka+ja,0<=bb[da]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var xb in d.__webglShader.uniforms){var wa=d.program.uniforms[xb];wa&&d.uniformsList.push([d.__webglShader.uniforms[xb],wa])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&
+(e.__webglMorphTargetInfluences=new Float32Array(I.maxMorphTargets));var Z=!1,Y=!1,X=!1,pb=d.program,ma=pb.uniforms,O=d.__webglShader.uniforms;pb.id!==ic&&(l.useProgram(pb.program),ic=pb.id,X=Y=Z=!0);d.id!==yb&&(-1===yb&&(X=!0),yb=d.id,Y=!0);if(Z||a!==Tb)l.uniformMatrix4fv(ma.projectionMatrix,!1,a.projectionMatrix.elements),Da&&l.uniform1f(ma.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Tb&&(Tb=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==ma.cameraPosition&&
+(Xa.setFromMatrixPosition(a.matrixWorld),l.uniform3f(ma.cameraPosition,Xa.x,Xa.y,Xa.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==ma.viewMatrix&&l.uniformMatrix4fv(ma.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==ma.bindMatrix&&l.uniformMatrix4fv(ma.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==ma.bindMatrixInverse&&
+l.uniformMatrix4fv(ma.bindMatrixInverse,!1,e.bindMatrixInverse.elements),Yb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==ma.boneTexture){var wb=P();l.uniform1i(ma.boneTexture,wb);I.setTexture(e.skeleton.boneTexture,wb)}null!==ma.boneTextureWidth&&l.uniform1i(ma.boneTextureWidth,e.skeleton.boneTextureWidth);null!==ma.boneTextureHeight&&l.uniform1i(ma.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==ma.boneGlobalMatrices&&l.uniformMatrix4fv(ma.boneGlobalMatrices,
+!1,e.skeleton.boneMatrices);if(Y){c&&d.fog&&(O.fogColor.value=c.color,c instanceof THREE.Fog?(O.fogNear.value=c.near,O.fogFar.value=c.far):c instanceof THREE.FogExp2&&(O.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Ub){var X=!0,la,Pa,ea,va=0,Ea=0,La=0,ya,Ya,qb,Fa,rb,xa,sa=yc,sb=sa.directional.colors,jb=sa.directional.positions,Fb=sa.point.colors,Ka=sa.point.positions,zb=sa.point.distances,Wa=sa.spot.colors,Za=sa.spot.positions,
+Cb=sa.spot.distances,Gb=sa.spot.directions,db=sa.spot.anglesCos,eb=sa.spot.exponents,mb=sa.hemi.skyColors,nb=sa.hemi.groundColors,tb=sa.hemi.positions,Qa=0,za=0,Na=0,Ia=0,fa=0,qa=0,E=0,Ga=0,Oa=0,ob=0,fb=0,Ra=0;la=0;for(Pa=b.length;la<Pa;la++)ea=b[la],ea.onlyShadow||(ya=ea.color,Fa=ea.intensity,xa=ea.distance,ea instanceof THREE.AmbientLight?ea.visible&&(I.gammaInput?(va+=ya.r*ya.r,Ea+=ya.g*ya.g,La+=ya.b*ya.b):(va+=ya.r,Ea+=ya.g,La+=ya.b)):ea instanceof THREE.DirectionalLight?(fa+=1,ea.visible&&(pa.setFromMatrixPosition(ea.matrixWorld),
+Xa.setFromMatrixPosition(ea.target.matrixWorld),pa.sub(Xa),pa.normalize(),Oa=3*Qa,jb[Oa]=pa.x,jb[Oa+1]=pa.y,jb[Oa+2]=pa.z,I.gammaInput?C(sb,Oa,ya,Fa*Fa):D(sb,Oa,ya,Fa),Qa+=1)):ea instanceof THREE.PointLight?(qa+=1,ea.visible&&(ob=3*za,I.gammaInput?C(Fb,ob,ya,Fa*Fa):D(Fb,ob,ya,Fa),Xa.setFromMatrixPosition(ea.matrixWorld),Ka[ob]=Xa.x,Ka[ob+1]=Xa.y,Ka[ob+2]=Xa.z,zb[za]=xa,za+=1)):ea instanceof THREE.SpotLight?(E+=1,ea.visible&&(fb=3*Na,I.gammaInput?C(Wa,fb,ya,Fa*Fa):D(Wa,fb,ya,Fa),pa.setFromMatrixPosition(ea.matrixWorld),
+Za[fb]=pa.x,Za[fb+1]=pa.y,Za[fb+2]=pa.z,Cb[Na]=xa,Xa.setFromMatrixPosition(ea.target.matrixWorld),pa.sub(Xa),pa.normalize(),Gb[fb]=pa.x,Gb[fb+1]=pa.y,Gb[fb+2]=pa.z,db[Na]=Math.cos(ea.angle),eb[Na]=ea.exponent,Na+=1)):ea instanceof THREE.HemisphereLight&&(Ga+=1,ea.visible&&(pa.setFromMatrixPosition(ea.matrixWorld),pa.normalize(),Ra=3*Ia,tb[Ra]=pa.x,tb[Ra+1]=pa.y,tb[Ra+2]=pa.z,Ya=ea.color,qb=ea.groundColor,I.gammaInput?(rb=Fa*Fa,C(mb,Ra,Ya,rb),C(nb,Ra,qb,rb)):(D(mb,Ra,Ya,Fa),D(nb,Ra,qb,Fa)),Ia+=1)));
+la=3*Qa;for(Pa=Math.max(sb.length,3*fa);la<Pa;la++)sb[la]=0;la=3*za;for(Pa=Math.max(Fb.length,3*qa);la<Pa;la++)Fb[la]=0;la=3*Na;for(Pa=Math.max(Wa.length,3*E);la<Pa;la++)Wa[la]=0;la=3*Ia;for(Pa=Math.max(mb.length,3*Ga);la<Pa;la++)mb[la]=0;la=3*Ia;for(Pa=Math.max(nb.length,3*Ga);la<Pa;la++)nb[la]=0;sa.directional.length=Qa;sa.point.length=za;sa.spot.length=Na;sa.hemi.length=Ia;sa.ambient[0]=va;sa.ambient[1]=Ea;sa.ambient[2]=La;Ub=!1}if(X){var na=yc;O.ambientLightColor.value=na.ambient;O.directionalLightColor.value=
+na.directional.colors;O.directionalLightDirection.value=na.directional.positions;O.pointLightColor.value=na.point.colors;O.pointLightPosition.value=na.point.positions;O.pointLightDistance.value=na.point.distances;O.spotLightColor.value=na.spot.colors;O.spotLightPosition.value=na.spot.positions;O.spotLightDistance.value=na.spot.distances;O.spotLightDirection.value=na.spot.directions;O.spotLightAngleCos.value=na.spot.anglesCos;O.spotLightExponent.value=na.spot.exponents;O.hemisphereLightSkyColor.value=
+na.hemi.skyColors;O.hemisphereLightGroundColor.value=na.hemi.groundColors;O.hemisphereLightDirection.value=na.hemi.positions;w(O,!0)}else w(O,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){O.opacity.value=d.opacity;I.gammaInput?O.diffuse.value.copyGammaToLinear(d.color):O.diffuse.value=d.color;O.map.value=d.map;O.lightMap.value=d.lightMap;O.specularMap.value=d.specularMap;O.alphaMap.value=d.alphaMap;d.bumpMap&&(O.bumpMap.value=
+d.bumpMap,O.bumpScale.value=d.bumpScale);d.normalMap&&(O.normalMap.value=d.normalMap,O.normalScale.value.copy(d.normalScale));var Ja;d.map?Ja=d.map:d.specularMap?Ja=d.specularMap:d.normalMap?Ja=d.normalMap:d.bumpMap?Ja=d.bumpMap:d.alphaMap&&(Ja=d.alphaMap);if(void 0!==Ja){var Sa=Ja.offset,Ta=Ja.repeat;O.offsetRepeat.value.set(Sa.x,Sa.y,Ta.x,Ta.y)}O.envMap.value=d.envMap;O.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;O.reflectivity.value=d.reflectivity;O.refractionRatio.value=
+d.refractionRatio;O.combine.value=d.combine;O.useRefract.value=d.envMap&&(d.envMap.mapping===THREE.CubeRefractionMapping||d.envMap.mapping===THREE.EquirectangularRefractionMapping)}d instanceof THREE.LineBasicMaterial?(O.diffuse.value=d.color,O.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(O.diffuse.value=d.color,O.opacity.value=d.opacity,O.dashSize.value=d.dashSize,O.totalSize.value=d.dashSize+d.gapSize,O.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(O.psColor.value=
+d.color,O.opacity.value=d.opacity,O.size.value=d.size,O.scale.value=U.height/2,O.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(O.shininess.value=d.shininess,I.gammaInput?(O.ambient.value.copyGammaToLinear(d.ambient),O.emissive.value.copyGammaToLinear(d.emissive),O.specular.value.copyGammaToLinear(d.specular)):(O.ambient.value=d.ambient,O.emissive.value=d.emissive,O.specular.value=d.specular),d.wrapAround&&O.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(I.gammaInput?
+(O.ambient.value.copyGammaToLinear(d.ambient),O.emissive.value.copyGammaToLinear(d.emissive)):(O.ambient.value=d.ambient,O.emissive.value=d.emissive),d.wrapAround&&O.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(O.mNear.value=a.near,O.mFar.value=a.far,O.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(O.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&O.shadowMatrix)for(var ub=0,lb=0,Eb=b.length;lb<Eb;lb++){var z=b[lb];z.castShadow&&(z instanceof
+THREE.SpotLight||z instanceof THREE.DirectionalLight&&!z.shadowCascade)&&(O.shadowMap.value[ub]=z.shadowMap,O.shadowMapSize.value[ub]=z.shadowMapSize,O.shadowMatrix.value[ub]=z.shadowMatrix,O.shadowDarkness.value[ub]=z.shadowDarkness,O.shadowBias.value[ub]=z.shadowBias,ub++)}for(var Hb=d.uniformsList,Ha,ta,$a,Ob=0,Lb=Hb.length;Ob<Lb;Ob++){var aa=Hb[Ob][0];if(!1!==aa.needsUpdate){var Ab=aa.type,T=aa.value,ba=Hb[Ob][1];switch(Ab){case "1i":l.uniform1i(ba,T);break;case "1f":l.uniform1f(ba,T);break;case "2f":l.uniform2f(ba,
+T[0],T[1]);break;case "3f":l.uniform3f(ba,T[0],T[1],T[2]);break;case "4f":l.uniform4f(ba,T[0],T[1],T[2],T[3]);break;case "1iv":l.uniform1iv(ba,T);break;case "3iv":l.uniform3iv(ba,T);break;case "1fv":l.uniform1fv(ba,T);break;case "2fv":l.uniform2fv(ba,T);break;case "3fv":l.uniform3fv(ba,T);break;case "4fv":l.uniform4fv(ba,T);break;case "Matrix3fv":l.uniformMatrix3fv(ba,!1,T);break;case "Matrix4fv":l.uniformMatrix4fv(ba,!1,T);break;case "i":l.uniform1i(ba,T);break;case "f":l.uniform1f(ba,T);break;case "v2":l.uniform2f(ba,
+T.x,T.y);break;case "v3":l.uniform3f(ba,T.x,T.y,T.z);break;case "v4":l.uniform4f(ba,T.x,T.y,T.z,T.w);break;case "c":l.uniform3f(ba,T.r,T.g,T.b);break;case "iv1":l.uniform1iv(ba,T);break;case "iv":l.uniform3iv(ba,T);break;case "fv1":l.uniform1fv(ba,T);break;case "fv":l.uniform3fv(ba,T);break;case "v2v":void 0===aa._array&&(aa._array=new Float32Array(2*T.length));for(var R=0,ua=T.length;R<ua;R++)$a=2*R,aa._array[$a]=T[R].x,aa._array[$a+1]=T[R].y;l.uniform2fv(ba,aa._array);break;case "v3v":void 0===
+aa._array&&(aa._array=new Float32Array(3*T.length));R=0;for(ua=T.length;R<ua;R++)$a=3*R,aa._array[$a]=T[R].x,aa._array[$a+1]=T[R].y,aa._array[$a+2]=T[R].z;l.uniform3fv(ba,aa._array);break;case "v4v":void 0===aa._array&&(aa._array=new Float32Array(4*T.length));R=0;for(ua=T.length;R<ua;R++)$a=4*R,aa._array[$a]=T[R].x,aa._array[$a+1]=T[R].y,aa._array[$a+2]=T[R].z,aa._array[$a+3]=T[R].w;l.uniform4fv(ba,aa._array);break;case "m3":l.uniformMatrix3fv(ba,!1,T.elements);break;case "m3v":void 0===aa._array&&
+(aa._array=new Float32Array(9*T.length));R=0;for(ua=T.length;R<ua;R++)T[R].flattenToArrayOffset(aa._array,9*R);l.uniformMatrix3fv(ba,!1,aa._array);break;case "m4":l.uniformMatrix4fv(ba,!1,T.elements);break;case "m4v":void 0===aa._array&&(aa._array=new Float32Array(16*T.length));R=0;for(ua=T.length;R<ua;R++)T[R].flattenToArrayOffset(aa._array,16*R);l.uniformMatrix4fv(ba,!1,aa._array);break;case "t":Ha=T;ta=P();l.uniform1i(ba,ta);if(!Ha)continue;if(Ha instanceof THREE.CubeTexture||Ha.image instanceof
+Array&&6===Ha.image.length){var ra=Ha,Bb=ta;if(6===ra.image.length)if(ra.needsUpdate){ra.image.__webglTextureCube||(ra.addEventListener("dispose",Vb),ra.image.__webglTextureCube=l.createTexture(),I.info.memory.textures++);l.activeTexture(l.TEXTURE0+Bb);l.bindTexture(l.TEXTURE_CUBE_MAP,ra.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,ra.flipY);for(var Db=ra instanceof THREE.CompressedTexture,Ib=ra.image[0]instanceof THREE.DataTexture,ib=[],Aa=0;6>Aa;Aa++)ib[Aa]=!I.autoScaleCubemaps||
+Db||Ib?Ib?ra.image[Aa].image:ra.image[Aa]:V(ra.image[Aa],Wc);var ga=ib[0],Pb=THREE.Math.isPowerOfTwo(ga.width)&&THREE.Math.isPowerOfTwo(ga.height),ab=N(ra.format),vb=N(ra.type);G(l.TEXTURE_CUBE_MAP,ra,Pb);for(Aa=0;6>Aa;Aa++)if(Db)for(var gb,Qb=ib[Aa].mipmaps,ca=0,Mb=Qb.length;ca<Mb;ca++)gb=Qb[ca],ra.format!==THREE.RGBAFormat&&ra.format!==THREE.RGBFormat?-1<Hc().indexOf(ab)?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Aa,ca,ab,gb.width,gb.height,0,gb.data):console.warn("Attempt to load unsupported compressed texture format"):
+l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Aa,ca,ab,gb.width,gb.height,0,ab,vb,gb.data);else Ib?l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Aa,0,ab,ib[Aa].width,ib[Aa].height,0,ab,vb,ib[Aa].data):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Aa,0,ab,ab,vb,ib[Aa]);ra.generateMipmaps&&Pb&&l.generateMipmap(l.TEXTURE_CUBE_MAP);ra.needsUpdate=!1;if(ra.onUpdate)ra.onUpdate()}else l.activeTexture(l.TEXTURE0+Bb),l.bindTexture(l.TEXTURE_CUBE_MAP,ra.image.__webglTextureCube)}else if(Ha instanceof THREE.WebGLRenderTargetCube){var Nb=
+Ha;l.activeTexture(l.TEXTURE0+ta);l.bindTexture(l.TEXTURE_CUBE_MAP,Nb.__webglTexture)}else I.setTexture(Ha,ta);break;case "tv":void 0===aa._array&&(aa._array=[]);R=0;for(ua=aa.value.length;R<ua;R++)aa._array[R]=P();l.uniform1iv(ba,aa._array);R=0;for(ua=aa.value.length;R<ua;R++)Ha=aa.value[R],ta=aa._array[R],Ha&&I.setTexture(Ha,ta);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Ab)}}}}l.uniformMatrix4fv(ma.modelViewMatrix,!1,e._modelViewMatrix.elements);ma.normalMatrix&&l.uniformMatrix3fv(ma.normalMatrix,
+!1,e._normalMatrix.elements);null!==ma.modelMatrix&&l.uniformMatrix4fv(ma.modelMatrix,!1,e.matrixWorld.elements);return pb}function w(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=
+b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function P(){var a=Sb;a>=Ic&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Ic);Sb+=1;return a}function y(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function C(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=
+c.b*c.b*d}function D(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function A(a){a!==Jc&&(l.lineWidth(a),Jc=a)}function B(a,b,c){Kc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),Kc=a);!a||Lc===b&&Mc===c||(l.polygonOffset(b,c),Lc=b,Mc=c)}function G(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,N(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,N(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,N(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,N(b.minFilter))):(l.texParameteri(a,
+l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT is set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),l.texParameteri(a,l.TEXTURE_MAG_FILTER,K(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,K(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( "+
+b.sourceFile+" )"));(c=ka.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(l.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,I.getMaxAnisotropy())),b.__oldAnisotropy=b.anisotropy)}function V(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.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+".");return d}return a}function M(a,b){l.bindRenderbuffer(l.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,
+l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function H(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function K(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?
+l.NEAREST:l.LINEAR}function N(a){var b;if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;if(a===
+THREE.LinearMipMapLinearFilter)return l.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return l.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return l.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return l.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return l.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return l.BYTE;if(a===THREE.ShortType)return l.SHORT;if(a===THREE.UnsignedShortType)return l.UNSIGNED_SHORT;if(a===THREE.IntType)return l.INT;if(a===THREE.UnsignedIntType)return l.UNSIGNED_INT;
+if(a===THREE.FloatType)return l.FLOAT;if(a===THREE.AlphaFormat)return l.ALPHA;if(a===THREE.RGBFormat)return l.RGB;if(a===THREE.RGBAFormat)return l.RGBA;if(a===THREE.LuminanceFormat)return l.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return l.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return l.FUNC_ADD;if(a===THREE.SubtractEquation)return l.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return l.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return l.ZERO;if(a===THREE.OneFactor)return l.ONE;if(a===
+THREE.SrcColorFactor)return l.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return l.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return l.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return l.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return l.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return l.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return l.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return l.SRC_ALPHA_SATURATE;
+b=ka.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=ka.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=ka.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 U=void 0!==a.canvas?a.canvas:document.createElement("canvas"),F=void 0!==a.context?a.context:null,W=void 0!==a.precision?a.precision:"highp",S=void 0!==
+a.alpha?a.alpha:!1,ja=void 0!==a.depth?a.depth:!0,da=void 0!==a.stencil?a.stencil:!0,va=void 0!==a.antialias?a.antialias:!1,L=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Ea=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Da=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,wa=new THREE.Color(0),Ma=0,bb=[],cb={},kb=[],xb=[],wb=[],pb=[],Pa=[];this.domElement=U;this.context=null;this.devicePixelRatio=void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=
+this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var I=this,hb=[],ic=null,Nc=null,yb=-1,La=-1,Tb=null,Sb=0,Lb=-1,
+zb=-1,Ab=-1,jc=-1,Bb=-1,kc=-1,lc=-1,Cb=-1,Kc=null,Lc=null,Mc=null,Jc=null,lb=0,Db=0,Mb=U.width,Nb=U.height,Oc=0,Pc=0,Eb=new Uint8Array(16),Ya=new Uint8Array(16),zc=new THREE.Frustum,Cc=new THREE.Matrix4;new THREE.Matrix4;var Xa=new THREE.Vector3,pa=new THREE.Vector3,Ub=!0,yc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],
+groundColors:[],positions:[]}},l;try{var Qc={alpha:S,depth:ja,stencil:da,antialias:va,premultipliedAlpha:L,preserveDrawingBuffer:Ea};l=F||U.getContext("webgl",Qc)||U.getContext("experimental-webgl",Qc);if(null===l){if(null!==U.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}U.addEventListener("webglcontextlost",function(a){a.preventDefault();Rc();Sc();cb={}},!1)}catch(Xc){console.error(Xc)}void 0===l.getShaderPrecisionFormat&&
+(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var ka=new THREE.WebGLExtensions(l);ka.get("OES_texture_float");ka.get("OES_texture_float_linear");ka.get("OES_standard_derivatives");Da&&ka.get("EXT_frag_depth");var Sc=function(){l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);
+l.viewport(lb,Db,Mb,Nb);l.clearColor(wa.r,wa.g,wa.b,Ma)},Rc=function(){Tb=ic=null;yb=La=zb=Lb=Cb=lc=Ab=-1;Ub=!0;for(var a=0;a<Ya.length;a++)Ya[a]=0};Sc();this.context=l;var Ic=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Yc=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Zc=l.getParameter(l.MAX_TEXTURE_SIZE),Wc=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),hc=0<Yc,Yb=hc&&ka.get("OES_texture_float"),$c=l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.HIGH_FLOAT),ad=l.getShaderPrecisionFormat(l.VERTEX_SHADER,
+l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_FLOAT);var bd=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT),cd=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT);var Hc=function(){var a;return function(){if(void 0!==a)return a;a=[];if(ka.get("WEBGL_compressed_texture_pvrtc")||ka.get("WEBGL_compressed_texture_s3tc"))for(var b=l.getParameter(l.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);
+return a}}(),dd=0<$c.precision&&0<bd.precision,Tc=0<ad.precision&&0<cd.precision;"highp"!==W||dd||(Tc?(W="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(W="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==W||Tc||(W="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var ed=new THREE.ShadowMapPlugin(this,bb,cb,kb),fd=new THREE.SpritePlugin(this,pb),gd=new THREE.LensFlarePlugin(this,
+Pa);this.getContext=function(){return l};this.forceContextLoss=function(){ka.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return hc};this.supportsFloatTextures=function(){return ka.get("OES_texture_float")};this.supportsStandardDerivatives=function(){return ka.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return ka.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return ka.get("WEBGL_compressed_texture_pvrtc")};
+this.supportsBlendMinMax=function(){return ka.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=ka.get("EXT_texture_filter_anisotropic");return a=null!==b?l.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return W};this.setSize=function(a,b,c){U.width=a*this.devicePixelRatio;U.height=b*this.devicePixelRatio;!1!==c&&(U.style.width=a+"px",U.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=
+function(a,b,c,d){lb=a*this.devicePixelRatio;Db=b*this.devicePixelRatio;Mb=c*this.devicePixelRatio;Nb=d*this.devicePixelRatio;l.viewport(lb,Db,Mb,Nb)};this.setScissor=function(a,b,c,d){l.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.setClearColor=function(a,b){wa.set(a);Ma=void 0!==b?b:1;l.clearColor(wa.r,wa.g,wa.b,Ma)};this.setClearColorHex=function(a,
+b){console.warn("THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return wa};this.getClearAlpha=function(){return Ma};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=l.COLOR_BUFFER_BIT;if(void 0===b||b)d|=l.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};this.clearColor=function(){l.clear(l.COLOR_BUFFER_BIT)};this.clearDepth=function(){l.clear(l.DEPTH_BUFFER_BIT)};this.clearStencil=
+function(){l.clear(l.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=Rc;var Dc=function(a){a.target.traverse(function(a){a.removeEventListener("remove",Dc);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete cb[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=kb,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;delete a._modelViewMatrix;
+delete a._normalMatrix;delete a.__webglActive})},Ec=function(a){a=a.target;a.removeEventListener("dispose",Ec);delete a.__webglInit;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(l.deleteBuffer(c.buffer),delete c.buffer)}I.info.memory.geometries--}else if(b=jb[a.id],void 0!==b){for(var c=0,d=b.length;c<d;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=0,g=e.numMorphTargets;f<g;f++)l.deleteBuffer(e.__webglMorphTargetsBuffers[f]);
+delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)l.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}Uc(e)}delete jb[a.id]}else Uc(a);La=-1},Vb=function(a){a=a.target;a.removeEventListener("dispose",Vb);a.image&&a.image.__webglTextureCube?(l.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(l.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);
+I.info.memory.textures--},Vc=function(a){a=a.target;a.removeEventListener("dispose",Vc);if(a&&void 0!==a.__webglTexture){l.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}I.info.memory.textures--},
+xc=function(a){a=a.target;a.removeEventListener("dispose",xc);gc(a)},Uc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),c=0,d=b.length;c<d;c++){var e=b[c];void 0!==a[e]&&(l.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)l.deleteBuffer(a.__webglCustomAttributesList[e].buffer);
+delete a.__webglCustomAttributesList}I.info.memory.geometries--},gc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=hb.length;a<c;a++)if(d=hb[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=hb.length;a<c;a++)d=hb[a],d.program!==b&&e.push(d);hb=e;l.deleteProgram(b);I.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){f();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());
+a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=l.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=l.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=l.createBuffer());a.hasPositions&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,a.positionArray,l.DYNAMIC_DRAW),g(b.attributes.position),l.vertexAttribPointer(b.attributes.position,3,l.FLOAT,!1,0,0));if(a.hasNormals){l.bindBuffer(l.ARRAY_BUFFER,a.__webglNormalBuffer);
+if(c.shading===THREE.FlatShading){var d,e,k,m,n,p,r,q,t,s,v,u=3*a.count;for(v=0;v<u;v+=9)s=a.normalArray,d=s[v],e=s[v+1],k=s[v+2],m=s[v+3],p=s[v+4],q=s[v+5],n=s[v+6],r=s[v+7],t=s[v+8],d=(d+m+n)/3,e=(e+p+r)/3,k=(k+q+t)/3,s[v]=d,s[v+1]=e,s[v+2]=k,s[v+3]=d,s[v+4]=e,s[v+5]=k,s[v+6]=d,s[v+7]=e,s[v+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);g(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),
+l.bufferData(l.ARRAY_BUFFER,a.uvArray,l.DYNAMIC_DRAW),g(b.attributes.uv),l.vertexAttribPointer(b.attributes.uv,2,l.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,a.colorArray,l.DYNAMIC_DRAW),g(b.attributes.color),l.vertexAttribPointer(b.attributes.color,3,l.FLOAT,!1,0,0));h();l.drawArrays(l.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,g,h){if(!1!==d.visible)if(a=J(a,b,c,d,h),b=
+!1,c=16777215*g.id+2*a.id+(d.wireframe?1:0),c!==La&&(La=c,b=!0),b&&f(),h instanceof THREE.Mesh)if(h=!0===d.wireframe?l.LINES:l.TRIANGLES,c=g.attributes.index){var k,m;c.array instanceof Uint32Array&&ka.get("OES_element_index_uint")?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2);var n=g.offsets;if(0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),I.info.render.calls++,I.info.render.vertices+=c.array.length,I.info.render.faces+=c.array.length/
+3;else{b=!0;for(var p=0,r=n.length;p<r;p++){var q=n[p].index;b&&(e(d,a,g,q),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer));l.drawElements(h,n[p].count,k,n[p].start*m);I.info.render.calls++;I.info.render.vertices+=n[p].count;I.info.render.faces+=n[p].count/3}}}else b&&e(d,a,g,0),d=g.attributes.position,l.drawArrays(h,0,d.array.length/3),I.info.render.calls++,I.info.render.vertices+=d.array.length/3,I.info.render.faces+=d.array.length/9;else if(h instanceof THREE.PointCloud)if(h=l.POINTS,c=g.attributes.index)if(c.array instanceof
+Uint32Array&&ka.get("OES_element_index_uint")?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=g.offsets,0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),I.info.render.calls++,I.info.render.points+=c.array.length;else for(1<n.length&&(b=!0),p=0,r=n.length;p<r;p++)q=n[p].index,b&&(e(d,a,g,q),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),I.info.render.calls++,I.info.render.points+=n[p].count;
+else b&&e(d,a,g,0),d=g.attributes.position,l.drawArrays(h,0,d.array.length/3),I.info.render.calls++,I.info.render.points+=d.array.length/3;else if(h instanceof THREE.Line)if(h=h.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,A(d.linewidth),c=g.attributes.index)if(c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=g.offsets,0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),I.info.render.calls++,I.info.render.vertices+=
+c.array.length;else for(1<n.length&&(b=!0),p=0,r=n.length;p<r;p++)q=n[p].index,b&&(e(d,a,g,q),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),I.info.render.calls++,I.info.render.vertices+=n[p].count;else b&&e(d,a,g,0),d=g.attributes.position,l.drawArrays(h,0,d.array.length/3),I.info.render.calls++,I.info.render.points+=d.array.length/3};this.renderBuffer=function(a,b,c,d,e,k){if(!1!==d.visible){c=J(a,b,c,d,k);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?
+1:0);c!==La&&(La=c,a=!0);a&&f();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),g(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k.morphTargetBase]),g(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),g(c.position),l.vertexAttribPointer(c.position,
+3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length)for(var m=0,n=k.morphTargetForcedOrder,r=k.morphTargetInfluences;m<d.numSupportedMorphTargets&&m<n.length;)0<=c["morphTarget"+m]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[n[m]]),g(c["morphTarget"+m]),l.vertexAttribPointer(c["morphTarget"+m],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[n[m]]),g(c["morphNormal"+m]),l.vertexAttribPointer(c["morphNormal"+m],3,l.FLOAT,
+!1,0,0)),k.__webglMorphTargetInfluences[m]=r[n[m]],m++;else{var n=[],r=k.morphTargetInfluences,q,s=r.length;for(q=0;q<s;q++)m=r[q],0<m&&n.push([m,q]);n.length>d.numSupportedMorphTargets?(n.sort(p),n.length=d.numSupportedMorphTargets):n.length>d.numSupportedMorphNormals?n.sort(p):0===n.length&&n.push([0,0]);for(m=0;m<d.numSupportedMorphTargets;)n[m]?(q=n[m][1],0<=c["morphTarget"+m]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[q]),g(c["morphTarget"+m]),l.vertexAttribPointer(c["morphTarget"+
+m],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[q]),g(c["morphNormal"+m]),l.vertexAttribPointer(c["morphNormal"+m],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[m]=r[q]):k.__webglMorphTargetInfluences[m]=0,m++}null!==d.program.uniforms.morphTargetInfluences&&l.uniform1fv(d.program.uniforms.morphTargetInfluences,k.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(c=0,r=e.__webglCustomAttributesList.length;c<
+r;c++)n=e.__webglCustomAttributesList[c],0<=b[n.buffer.belongsToAttribute]&&(l.bindBuffer(l.ARRAY_BUFFER,n.buffer),g(b[n.buffer.belongsToAttribute]),l.vertexAttribPointer(b[n.buffer.belongsToAttribute],n.size,l.FLOAT,!1,0,0));0<=b.color&&(0<k.geometry.colors.length||0<k.geometry.faces.length?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglColorBuffer),g(b.color),l.vertexAttribPointer(b.color,3,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=
+b.normal&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglNormalBuffer),g(b.normal),l.vertexAttribPointer(b.normal,3,l.FLOAT,!1,0,0));0<=b.tangent&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglTangentBuffer),g(b.tangent),l.vertexAttribPointer(b.tangent,4,l.FLOAT,!1,0,0));0<=b.uv&&(k.geometry.faceVertexUvs[0]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUVBuffer),g(b.uv),l.vertexAttribPointer(b.uv,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(k.geometry.faceVertexUvs[1]?
+(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUV2Buffer),g(b.uv2),l.vertexAttribPointer(b.uv2,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),g(b.skinIndex),l.vertexAttribPointer(b.skinIndex,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),g(b.skinWeight),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0));0<=b.lineDistance&&
+(l.bindBuffer(l.ARRAY_BUFFER,e.__webglLineDistanceBuffer),g(b.lineDistance),l.vertexAttribPointer(b.lineDistance,1,l.FLOAT,!1,0,0))}h();k instanceof THREE.Mesh?(k=e.__typeArray===Uint32Array?l.UNSIGNED_INT:l.UNSIGNED_SHORT,d.wireframe?(A(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),l.drawElements(l.LINES,e.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),l.drawElements(l.TRIANGLES,e.__webglFaceCount,k,0)),I.info.render.calls++,
+I.info.render.vertices+=e.__webglFaceCount,I.info.render.faces+=e.__webglFaceCount/3):k instanceof THREE.Line?(k=k.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,A(d.linewidth),l.drawArrays(k,0,e.__webglLineCount),I.info.render.calls++):k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,e.__webglParticleCount),I.info.render.calls++,I.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
+else{var e=a.fog;yb=La=-1;Tb=null;Ub=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);Cc.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);zc.setFromMatrix(Cc);bb.length=0;xb.length=0;wb.length=0;pb.length=0;Pa.length=0;q(a,a);!0===I.sortObjects&&(xb.sort(k),wb.sort(n));ed.render(a,b);I.info.render.calls=0;I.info.render.vertices=0;
+I.info.render.faces=0;I.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);d=0;for(var f=kb.length;d<f;d++){var g=kb[d],h=g.object;h.visible&&(y(h,b),r(g))}a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),B(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),m(xb,b,bb,e,!0,d),m(wb,
+b,bb,e,!0,d),t(kb,"",b,bb,e,!1,d)):(d=null,this.setBlending(THREE.NoBlending),m(xb,b,bb,e,!1,d),t(kb,"opaque",b,bb,e,!1,d),m(wb,b,bb,e,!0,d),t(kb,"transparent",b,bb,e,!0,d));fd.render(a,b);gd.render(a,b,Oc,Pc);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&H(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=J(a,b,c,d,e);La=-1;I.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,
+l,zc):e.render(function(a){I.renderBufferImmediate(a,f,d)})};var jb={},fc=0;this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):l.frontFace(l.CCW),a===THREE.CullFaceBack?l.cullFace(l.BACK):a===THREE.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK),l.enable(l.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;Lb!==b&&(b?l.disable(l.CULL_FACE):l.enable(l.CULL_FACE),
+Lb=b);zb!==a&&(a?l.frontFace(l.CW):l.frontFace(l.CCW),zb=a)};this.setDepthTest=function(a){lc!==a&&(a?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),lc=a)};this.setDepthWrite=function(a){Cb!==a&&(l.depthMask(a),Cb=a)};this.setBlending=function(a,b,c,d){a!==Ab&&(a===THREE.NoBlending?l.disable(l.BLEND):a===THREE.AdditiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,l.ONE)):a===THREE.SubtractiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,
+l.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.SRC_COLOR)):a===THREE.CustomBlending?l.enable(l.BLEND):(l.enable(l.BLEND),l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),Ab=a);if(a===THREE.CustomBlending){if(b!==jc&&(l.blendEquation(N(b)),jc=b),c!==Bb||d!==kc)l.blendFunc(N(c),N(d)),Bb=c,kc=d}else kc=Bb=jc=null};this.uploadTexture=function(a){void 0===
+a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Vb),a.__webglTexture=l.createTexture(),I.info.memory.textures++);l.bindTexture(l.TEXTURE_2D,a.__webglTexture);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,a.flipY);l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);l.pixelStorei(l.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=V(a.image,Zc);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=N(a.format),e=N(a.type);G(l.TEXTURE_2D,a,c);var f=a.mipmaps;
+if(a instanceof THREE.DataTexture)if(0<f.length&&c){for(var g=0,h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(g=0,h=f.length;g<h;g++)b=f[g],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Hc().indexOf(d)?l.compressedTexImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,b.data):console.warn("Attempt to load unsupported compressed texture format"):
+l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);else if(0<f.length&&c){g=0;for(h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&l.generateMipmap(l.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()};this.setTexture=function(a,b){l.activeTexture(l.TEXTURE0+b);a.needsUpdate?I.uploadTexture(a):l.bindTexture(l.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof
+THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Vc);a.__webglTexture=l.createTexture();I.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=N(a.format),e=N(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture);G(l.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=
+l.createFramebuffer();a.__webglRenderbuffer[f]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+f;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[f]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,h,g.__webglTexture,0);M(a.__webglRenderbuffer[f],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:
+l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),G(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,
+l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):M(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Mb,a=Nb,d=lb,e=Db);b!==Nc&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),Nc=b);Oc=c;Pc=a};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.")}};
 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=null};
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;
 a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
 THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
 break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.log("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}};
-THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,n=d.__webglShader.vertexShader,p=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var r=null;if(e.envMap)switch(d.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"}var t,s;t=[];for(var u in g)s=g[u],!1!==s&&(s="#define "+u+" "+s,t.push(s));t=t.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",t,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":
+THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,n=d.__webglShader.vertexShader,p=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var t=null;if(e.envMap)switch(d.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"}var r,s;r=[];for(var u in g)s=g[u],!1!==s&&(s="#define "+u+" "+s,r.push(s));r=r.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",r,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":
 "",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?
 "#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":
 "",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"),
-b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",t,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG":
-"",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",r?"#define "+r:"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?
+b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",r,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG":
+"",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",t?"#define "+t:"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?
 "#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));n=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+n);p=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+p);f.attachShader(g,n);f.attachShader(g,p);void 0!==q&&f.bindAttribLocation(g,0,q);f.linkProgram(g);!1===f.getProgramParameter(g,
 f.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."),console.error("gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS)),console.error("gl.getError()",f.getError()));""!==f.getProgramInfoLog(g)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f.getProgramInfoLog(g));f.deleteShader(n);f.deleteShader(p);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");
 e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var v in h)q.push(v);h=q;v={};q=0;for(b=h.length;q<b;q++)m=h[q],v[m]=f.getUniformLocation(g,m);this.uniforms=v;q="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)q.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)q.push("morphNormal"+h);for(var x in k)q.push(x);
 e=q;k={};x=0;for(h=e.length;x<h;x++)v=e[x],k[v]=f.getAttribLocation(g,v);this.attributes=k;this.attributesKeys=Object.keys(this.attributes);this.id=a++;this.code=c;this.usedTimes=1;this.program=g;this.vertexShader=n;this.fragmentShader=p;return this}}();
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){c=b.createShader(c);b.shaderSource(c,d);b.compileShader(c);!1===b.getShaderParameter(c,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(c)&&(console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",b.getShaderInfoLog(c)),console.warn(a(d)));return c}}();
-THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,n,p,q,m=a.context,r,t,s,u,v,x;this.render=function(E,w,M,y){if(0!==b.length){E=new THREE.Vector3;var C=y/M,D=.5*M,A=.5*y,B=16/y,G=new THREE.Vector2(B*C,B),S=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1);if(void 0===s){var B=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),I=new Uint16Array([0,1,2,0,2,3]);r=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,r);m.bufferData(m.ARRAY_BUFFER,B,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
-t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,I,m.STATIC_DRAW);v=m.createTexture();x=m.createTexture();m.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);m.bindTexture(m.TEXTURE_2D,x);m.texImage2D(m.TEXTURE_2D,0,
+THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,n,p,q,m=a.context,t,r,s,u,v,x;this.render=function(J,w,P,y){if(0!==b.length){J=new THREE.Vector3;var C=y/P,D=.5*P,A=.5*y,B=16/y,G=new THREE.Vector2(B*C,B),V=new THREE.Vector3(1,1,0),M=new THREE.Vector2(1,1);if(void 0===s){var B=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),H=new Uint16Array([0,1,2,0,2,3]);t=m.createBuffer();r=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,t);m.bufferData(m.ARRAY_BUFFER,B,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
+r);m.bufferData(m.ELEMENT_ARRAY_BUFFER,H,m.STATIC_DRAW);v=m.createTexture();x=m.createTexture();m.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);m.bindTexture(m.TEXTURE_2D,x);m.texImage2D(m.TEXTURE_2D,0,
 m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var B=(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}",
 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}"},
-I=m.createProgram(),V=m.createShader(m.FRAGMENT_SHADER),L=m.createShader(m.VERTEX_SHADER),J="precision "+a.getPrecision()+" float;\n";m.shaderSource(V,J+B.fragmentShader);m.shaderSource(L,J+B.vertexShader);m.compileShader(V);m.compileShader(L);m.attachShader(I,V);m.attachShader(I,L);m.linkProgram(I);s=I;p=m.getAttribLocation(s,"position");q=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");n=m.getUniformLocation(s,"screenPosition")}m.useProgram(s);m.enableVertexAttribArray(p);m.enableVertexAttribArray(q);m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,r);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(q,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);m.disable(m.CULL_FACE);m.depthMask(!1);I=0;for(V=b.length;I<V;I++)if(B=16/y,G.set(B*
-C,B),L=b[I],E.set(L.matrixWorld.elements[12],L.matrixWorld.elements[13],L.matrixWorld.elements[14]),E.applyMatrix4(w.matrixWorldInverse),E.applyProjection(w.projectionMatrix),S.copy(E),K.x=S.x*D+D,K.y=S.y*A+A,u||0<K.x&&K.x<M&&0<K.y&&K.y<y){m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,K.x-8,K.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,G.x,G.y);m.uniform3f(n,S.x,S.y,S.z);m.disable(m.BLEND);m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,
-0);m.activeTexture(m.TEXTURE0);m.bindTexture(m.TEXTURE_2D,x);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,K.x-8,K.y-8,16,16,0);m.uniform1i(c,1);m.disable(m.DEPTH_TEST);m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);L.positionScreen.copy(S);L.customUpdateCallback?L.customUpdateCallback(L):L.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var J=0,R=L.lensFlares.length;J<R;J++){var Y=L.lensFlares[J];.001<Y.opacity&&.001<Y.scale&&(S.x=Y.x,
-S.y=Y.y,S.z=Y.z,B=Y.size*Y.scale/y,G.x=B*C,G.y=B,m.uniform3f(n,S.x,S.y,S.z),m.uniform2f(h,G.x,G.y),m.uniform1f(k,Y.rotation),m.uniform1f(f,Y.opacity),m.uniform3f(g,Y.color.r,Y.color.g,Y.color.b),a.setBlending(Y.blending,Y.blendEquation,Y.blendSrc,Y.blendDst),a.setTexture(Y.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
-THREE.ShadowMapPlugin=function(a,b,c,d){function e(a,b,d){if(b.visible){var f=c[b.id];if(f&&b.castShadow&&(!1===b.frustumCulled||!0===p.intersectsObject(b)))for(var g=0,h=f.length;g<h;g++){var k=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld);s.push(k)}g=0;for(h=b.children.length;g<h;g++)e(a,b.children[g],d)}}var f=a.context,g,h,k,n,p=new THREE.Frustum,q=new THREE.Matrix4,m=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector3,s=[],u=THREE.ShaderLib.depthRGBA,v=THREE.UniformsUtils.clone(u.uniforms);
+H=m.createProgram(),K=m.createShader(m.FRAGMENT_SHADER),N=m.createShader(m.VERTEX_SHADER),U="precision "+a.getPrecision()+" float;\n";m.shaderSource(K,U+B.fragmentShader);m.shaderSource(N,U+B.vertexShader);m.compileShader(K);m.compileShader(N);m.attachShader(H,K);m.attachShader(H,N);m.linkProgram(H);s=H;p=m.getAttribLocation(s,"position");q=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");n=m.getUniformLocation(s,"screenPosition")}m.useProgram(s);m.enableVertexAttribArray(p);m.enableVertexAttribArray(q);m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,t);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(q,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,r);m.disable(m.CULL_FACE);m.depthMask(!1);H=0;for(K=b.length;H<K;H++)if(B=16/y,G.set(B*
+C,B),N=b[H],J.set(N.matrixWorld.elements[12],N.matrixWorld.elements[13],N.matrixWorld.elements[14]),J.applyMatrix4(w.matrixWorldInverse),J.applyProjection(w.projectionMatrix),V.copy(J),M.x=V.x*D+D,M.y=V.y*A+A,u||0<M.x&&M.x<P&&0<M.y&&M.y<y){m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,M.x-8,M.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,G.x,G.y);m.uniform3f(n,V.x,V.y,V.z);m.disable(m.BLEND);m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,
+0);m.activeTexture(m.TEXTURE0);m.bindTexture(m.TEXTURE_2D,x);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,M.x-8,M.y-8,16,16,0);m.uniform1i(c,1);m.disable(m.DEPTH_TEST);m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);N.positionScreen.copy(V);N.customUpdateCallback?N.customUpdateCallback(N):N.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var U=0,F=N.lensFlares.length;U<F;U++){var W=N.lensFlares[U];.001<W.opacity&&.001<W.scale&&(V.x=W.x,
+V.y=W.y,V.z=W.z,B=W.size*W.scale/y,G.x=B*C,G.y=B,m.uniform3f(n,V.x,V.y,V.z),m.uniform2f(h,G.x,G.y),m.uniform1f(k,W.rotation),m.uniform1f(f,W.opacity),m.uniform3f(g,W.color.r,W.color.g,W.color.b),a.setBlending(W.blending,W.blendEquation,W.blendSrc,W.blendDst),a.setTexture(W.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
+THREE.ShadowMapPlugin=function(a,b,c,d){function e(a,b,d){if(b.visible){var f=c[b.id];if(f&&b.castShadow&&(!1===b.frustumCulled||!0===p.intersectsObject(b)))for(var g=0,h=f.length;g<h;g++){var k=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld);s.push(k)}g=0;for(h=b.children.length;g<h;g++)e(a,b.children[g],d)}}var f=a.context,g,h,k,n,p=new THREE.Frustum,q=new THREE.Matrix4,m=new THREE.Vector3,t=new THREE.Vector3,r=new THREE.Vector3,s=[],u=THREE.ShaderLib.depthRGBA,v=THREE.UniformsUtils.clone(u.uniforms);
 g=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader});h=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0});k=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,skinning:!0});n=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0,skinning:!0});g._shadowPass=!0;h._shadowPass=!0;k._shadowPass=
-!0;n._shadowPass=!0;this.render=function(c,v){if(!1!==a.shadowMapEnabled){var u,M,y,C,D,A,B,G,S=[];C=0;f.clearColor(1,1,1,1);f.disable(f.BLEND);f.enable(f.CULL_FACE);f.frontFace(f.CCW);a.shadowMapCullFace===THREE.CullFaceFront?f.cullFace(f.FRONT):f.cullFace(f.BACK);a.setDepthTest(!0);u=0;for(M=b.length;u<M;u++)if(y=b[u],y.castShadow)if(y instanceof THREE.DirectionalLight&&y.shadowCascade)for(D=0;D<y.shadowCascadeCount;D++){var K;if(y.shadowCascadeArray[D])K=y.shadowCascadeArray[D];else{B=y;var I=
-D;K=new THREE.DirectionalLight;K.isVirtual=!0;K.onlyShadow=!0;K.castShadow=!0;K.shadowCameraNear=B.shadowCameraNear;K.shadowCameraFar=B.shadowCameraFar;K.shadowCameraLeft=B.shadowCameraLeft;K.shadowCameraRight=B.shadowCameraRight;K.shadowCameraBottom=B.shadowCameraBottom;K.shadowCameraTop=B.shadowCameraTop;K.shadowCameraVisible=B.shadowCameraVisible;K.shadowDarkness=B.shadowDarkness;K.shadowBias=B.shadowCascadeBias[I];K.shadowMapWidth=B.shadowCascadeWidth[I];K.shadowMapHeight=B.shadowCascadeHeight[I];
-K.pointsWorld=[];K.pointsFrustum=[];G=K.pointsWorld;A=K.pointsFrustum;for(var V=0;8>V;V++)G[V]=new THREE.Vector3,A[V]=new THREE.Vector3;G=B.shadowCascadeNearZ[I];B=B.shadowCascadeFarZ[I];A[0].set(-1,-1,G);A[1].set(1,-1,G);A[2].set(-1,1,G);A[3].set(1,1,G);A[4].set(-1,-1,B);A[5].set(1,-1,B);A[6].set(-1,1,B);A[7].set(1,1,B);K.originalCamera=v;A=new THREE.Gyroscope;A.position.copy(y.shadowCascadeOffset);A.add(K);A.add(K.target);v.add(A);y.shadowCascadeArray[D]=K;console.log("Created virtualLight",K)}I=
-y;G=D;B=I.shadowCascadeArray[G];B.position.copy(I.position);B.target.position.copy(I.target.position);B.lookAt(B.target);B.shadowCameraVisible=I.shadowCameraVisible;B.shadowDarkness=I.shadowDarkness;B.shadowBias=I.shadowCascadeBias[G];A=I.shadowCascadeNearZ[G];I=I.shadowCascadeFarZ[G];B=B.pointsFrustum;B[0].z=A;B[1].z=A;B[2].z=A;B[3].z=A;B[4].z=I;B[5].z=I;B[6].z=I;B[7].z=I;S[C]=K;C++}else S[C]=y,C++;u=0;for(M=S.length;u<M;u++){y=S[u];y.shadowMap||(D=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&
+!0;n._shadowPass=!0;this.render=function(c,v){if(!1!==a.shadowMapEnabled){var u,P,y,C,D,A,B,G,V=[];C=0;f.clearColor(1,1,1,1);f.disable(f.BLEND);f.enable(f.CULL_FACE);f.frontFace(f.CCW);a.shadowMapCullFace===THREE.CullFaceFront?f.cullFace(f.FRONT):f.cullFace(f.BACK);a.setDepthTest(!0);u=0;for(P=b.length;u<P;u++)if(y=b[u],y.castShadow)if(y instanceof THREE.DirectionalLight&&y.shadowCascade)for(D=0;D<y.shadowCascadeCount;D++){var M;if(y.shadowCascadeArray[D])M=y.shadowCascadeArray[D];else{B=y;var H=
+D;M=new THREE.DirectionalLight;M.isVirtual=!0;M.onlyShadow=!0;M.castShadow=!0;M.shadowCameraNear=B.shadowCameraNear;M.shadowCameraFar=B.shadowCameraFar;M.shadowCameraLeft=B.shadowCameraLeft;M.shadowCameraRight=B.shadowCameraRight;M.shadowCameraBottom=B.shadowCameraBottom;M.shadowCameraTop=B.shadowCameraTop;M.shadowCameraVisible=B.shadowCameraVisible;M.shadowDarkness=B.shadowDarkness;M.shadowBias=B.shadowCascadeBias[H];M.shadowMapWidth=B.shadowCascadeWidth[H];M.shadowMapHeight=B.shadowCascadeHeight[H];
+M.pointsWorld=[];M.pointsFrustum=[];G=M.pointsWorld;A=M.pointsFrustum;for(var K=0;8>K;K++)G[K]=new THREE.Vector3,A[K]=new THREE.Vector3;G=B.shadowCascadeNearZ[H];B=B.shadowCascadeFarZ[H];A[0].set(-1,-1,G);A[1].set(1,-1,G);A[2].set(-1,1,G);A[3].set(1,1,G);A[4].set(-1,-1,B);A[5].set(1,-1,B);A[6].set(-1,1,B);A[7].set(1,1,B);M.originalCamera=v;A=new THREE.Gyroscope;A.position.copy(y.shadowCascadeOffset);A.add(M);A.add(M.target);v.add(A);y.shadowCascadeArray[D]=M;console.log("Created virtualLight",M)}H=
+y;G=D;B=H.shadowCascadeArray[G];B.position.copy(H.position);B.target.position.copy(H.target.position);B.lookAt(B.target);B.shadowCameraVisible=H.shadowCameraVisible;B.shadowDarkness=H.shadowDarkness;B.shadowBias=H.shadowCascadeBias[G];A=H.shadowCascadeNearZ[G];H=H.shadowCascadeFarZ[G];B=B.pointsFrustum;B[0].z=A;B[1].z=A;B[2].z=A;B[3].z=A;B[4].z=H;B[5].z=H;B[6].z=H;B[7].z=H;V[C]=M;C++}else V[C]=y,C++;u=0;for(P=V.length;u<P;u++){y=V[u];y.shadowMap||(D=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&
 (D=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:D,magFilter:D,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4);if(!y.shadowCamera){if(y instanceof THREE.SpotLight)y.shadowCamera=new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,y.shadowCameraNear,y.shadowCameraFar);else if(y instanceof THREE.DirectionalLight)y.shadowCamera=new THREE.OrthographicCamera(y.shadowCameraLeft,
-y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}c.add(y.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),c.add(y.cameraHelper));if(y.isVirtual&&K.originalCamera==v){D=v;C=y.shadowCamera;A=y.pointsFrustum;B=y.pointsWorld;m.set(Infinity,Infinity,Infinity);r.set(-Infinity,-Infinity,-Infinity);
-for(I=0;8>I;I++)G=B[I],G.copy(A[I]),G.unproject(D),G.applyMatrix4(C.matrixWorldInverse),G.x<m.x&&(m.x=G.x),G.x>r.x&&(r.x=G.x),G.y<m.y&&(m.y=G.y),G.y>r.y&&(r.y=G.y),G.z<m.z&&(m.z=G.z),G.z>r.z&&(r.z=G.z);C.left=m.x;C.right=r.x;C.top=r.y;C.bottom=m.y;C.updateProjectionMatrix()}C=y.shadowMap;A=y.shadowMatrix;D=y.shadowCamera;D.position.setFromMatrixPosition(y.matrixWorld);t.setFromMatrixPosition(y.target.matrixWorld);D.lookAt(t);D.updateMatrixWorld();D.matrixWorldInverse.getInverse(D.matrixWorld);y.cameraHelper&&
-(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);A.multiply(D.projectionMatrix);A.multiply(D.matrixWorldInverse);q.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse);p.setFromMatrix(q);a.setRenderTarget(C);a.clear();s.length=0;e(c,c,D);y=0;for(C=s.length;y<C;y++)B=s[y],A=B.object,B=B.buffer,I=A.material instanceof THREE.MeshFaceMaterial?A.material.materials[0]:A.material,G=void 0!==A.geometry.morphTargets&&
-0<A.geometry.morphTargets.length&&I.morphTargets,V=A instanceof THREE.SkinnedMesh&&I.skinning,G=A.customDepthMaterial?A.customDepthMaterial:V?G?n:k:G?h:g,a.setMaterialFaces(I),B instanceof THREE.BufferGeometry?a.renderBufferDirect(D,b,null,G,B,A):a.renderBuffer(D,b,null,G,B,A);y=0;for(C=d.length;y<C;y++)B=d[y],A=B.object,A.visible&&A.castShadow&&(A._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,A.matrixWorld),a.renderImmediateObject(D,b,null,g,A))}u=a.getClearColor();M=a.getClearAlpha();f.clearColor(u.r,
-u.g,u.b,M);f.enable(f.BLEND);a.shadowMapCullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,n,p,q,m,r,t,s,u,v,x;function E(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,M,y,C,D,A=new THREE.Vector3,B=new THREE.Quaternion,G=new THREE.Vector3;this.render=function(S,K){if(0!==b.length){if(void 0===C){var I=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),V=new Uint16Array([0,1,2,0,2,3]);M=w.createBuffer();y=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,M);w.bufferData(w.ARRAY_BUFFER,I,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
-y);w.bufferData(w.ELEMENT_ARRAY_BUFFER,V,w.STATIC_DRAW);var I=w.createProgram(),V=w.createShader(w.VERTEX_SHADER),L=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(V,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
-w.shaderSource(L,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
-w.compileShader(V);w.compileShader(L);w.attachShader(I,V);w.attachShader(I,L);w.linkProgram(I);C=I;v=w.getAttribLocation(C,"position");x=w.getAttribLocation(C,"uv");c=w.getUniformLocation(C,"uvOffset");d=w.getUniformLocation(C,"uvScale");e=w.getUniformLocation(C,"rotation");f=w.getUniformLocation(C,"scale");g=w.getUniformLocation(C,"color");h=w.getUniformLocation(C,"map");k=w.getUniformLocation(C,"opacity");n=w.getUniformLocation(C,"modelViewMatrix");p=w.getUniformLocation(C,"projectionMatrix");q=
-w.getUniformLocation(C,"fogType");m=w.getUniformLocation(C,"fogDensity");r=w.getUniformLocation(C,"fogNear");t=w.getUniformLocation(C,"fogFar");s=w.getUniformLocation(C,"fogColor");u=w.getUniformLocation(C,"alphaTest");I=document.createElement("canvas");I.width=8;I.height=8;V=I.getContext("2d");V.fillStyle="white";V.fillRect(0,0,8,8);D=new THREE.Texture(I);D.needsUpdate=!0}w.useProgram(C);w.enableVertexAttribArray(v);w.enableVertexAttribArray(x);w.disable(w.CULL_FACE);w.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,
-M);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,y);w.uniformMatrix4fv(p,!1,K.projectionMatrix.elements);w.activeTexture(w.TEXTURE0);w.uniform1i(h,0);V=I=0;(L=S.fog)?(w.uniform3f(s,L.color.r,L.color.g,L.color.b),L instanceof THREE.Fog?(w.uniform1f(r,L.near),w.uniform1f(t,L.far),w.uniform1i(q,1),V=I=1):L instanceof THREE.FogExp2&&(w.uniform1f(m,L.density),w.uniform1i(q,2),V=I=2)):(w.uniform1i(q,0),V=I=0);for(var L=0,J=b.length;L<
-J;L++){var R=b[L];R._modelViewMatrix.multiplyMatrices(K.matrixWorldInverse,R.matrixWorld);R.z=null===R.renderDepth?-R._modelViewMatrix.elements[14]:R.renderDepth}b.sort(E);for(var Y=[],L=0,J=b.length;L<J;L++){var R=b[L],T=R.material;w.uniform1f(u,T.alphaTest);w.uniformMatrix4fv(n,!1,R._modelViewMatrix.elements);R.matrixWorld.decompose(A,B,G);Y[0]=G.x;Y[1]=G.y;R=0;S.fog&&T.fog&&(R=V);I!==R&&(w.uniform1i(q,R),I=R);null!==T.map?(w.uniform2f(c,T.map.offset.x,T.map.offset.y),w.uniform2f(d,T.map.repeat.x,
-T.map.repeat.y)):(w.uniform2f(c,0,0),w.uniform2f(d,1,1));w.uniform1f(k,T.opacity);w.uniform3f(g,T.color.r,T.color.g,T.color.b);w.uniform1f(e,T.rotation);w.uniform2fv(f,Y);a.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst);a.setDepthTest(T.depthTest);a.setDepthWrite(T.depthWrite);T.map&&T.map.image&&T.map.image.width?a.setTexture(T.map,0):a.setTexture(D,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}w.enable(w.CULL_FACE);a.resetGLState()}}};
+y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}c.add(y.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),c.add(y.cameraHelper));if(y.isVirtual&&M.originalCamera==v){D=v;C=y.shadowCamera;A=y.pointsFrustum;B=y.pointsWorld;m.set(Infinity,Infinity,Infinity);t.set(-Infinity,-Infinity,-Infinity);
+for(H=0;8>H;H++)G=B[H],G.copy(A[H]),G.unproject(D),G.applyMatrix4(C.matrixWorldInverse),G.x<m.x&&(m.x=G.x),G.x>t.x&&(t.x=G.x),G.y<m.y&&(m.y=G.y),G.y>t.y&&(t.y=G.y),G.z<m.z&&(m.z=G.z),G.z>t.z&&(t.z=G.z);C.left=m.x;C.right=t.x;C.top=t.y;C.bottom=m.y;C.updateProjectionMatrix()}C=y.shadowMap;A=y.shadowMatrix;D=y.shadowCamera;D.position.setFromMatrixPosition(y.matrixWorld);r.setFromMatrixPosition(y.target.matrixWorld);D.lookAt(r);D.updateMatrixWorld();D.matrixWorldInverse.getInverse(D.matrixWorld);y.cameraHelper&&
+(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);A.multiply(D.projectionMatrix);A.multiply(D.matrixWorldInverse);q.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse);p.setFromMatrix(q);a.setRenderTarget(C);a.clear();s.length=0;e(c,c,D);y=0;for(C=s.length;y<C;y++)B=s[y],A=B.object,B=B.buffer,H=A.material instanceof THREE.MeshFaceMaterial?A.material.materials[0]:A.material,G=void 0!==A.geometry.morphTargets&&
+0<A.geometry.morphTargets.length&&H.morphTargets,K=A instanceof THREE.SkinnedMesh&&H.skinning,G=A.customDepthMaterial?A.customDepthMaterial:K?G?n:k:G?h:g,a.setMaterialFaces(H),B instanceof THREE.BufferGeometry?a.renderBufferDirect(D,b,null,G,B,A):a.renderBuffer(D,b,null,G,B,A);y=0;for(C=d.length;y<C;y++)B=d[y],A=B.object,A.visible&&A.castShadow&&(A._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,A.matrixWorld),a.renderImmediateObject(D,b,null,g,A))}u=a.getClearColor();P=a.getClearAlpha();f.clearColor(u.r,
+u.g,u.b,P);f.enable(f.BLEND);a.shadowMapCullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,n,p,q,m,t,r,s,u,v,x;function J(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,P,y,C,D,A=new THREE.Vector3,B=new THREE.Quaternion,G=new THREE.Vector3;this.render=function(V,M){if(0!==b.length){if(void 0===C){var H=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),K=new Uint16Array([0,1,2,0,2,3]);P=w.createBuffer();y=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,P);w.bufferData(w.ARRAY_BUFFER,H,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
+y);w.bufferData(w.ELEMENT_ARRAY_BUFFER,K,w.STATIC_DRAW);var H=w.createProgram(),K=w.createShader(w.VERTEX_SHADER),N=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(K,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
+w.shaderSource(N,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
+w.compileShader(K);w.compileShader(N);w.attachShader(H,K);w.attachShader(H,N);w.linkProgram(H);C=H;v=w.getAttribLocation(C,"position");x=w.getAttribLocation(C,"uv");c=w.getUniformLocation(C,"uvOffset");d=w.getUniformLocation(C,"uvScale");e=w.getUniformLocation(C,"rotation");f=w.getUniformLocation(C,"scale");g=w.getUniformLocation(C,"color");h=w.getUniformLocation(C,"map");k=w.getUniformLocation(C,"opacity");n=w.getUniformLocation(C,"modelViewMatrix");p=w.getUniformLocation(C,"projectionMatrix");q=
+w.getUniformLocation(C,"fogType");m=w.getUniformLocation(C,"fogDensity");t=w.getUniformLocation(C,"fogNear");r=w.getUniformLocation(C,"fogFar");s=w.getUniformLocation(C,"fogColor");u=w.getUniformLocation(C,"alphaTest");H=document.createElement("canvas");H.width=8;H.height=8;K=H.getContext("2d");K.fillStyle="white";K.fillRect(0,0,8,8);D=new THREE.Texture(H);D.needsUpdate=!0}w.useProgram(C);w.enableVertexAttribArray(v);w.enableVertexAttribArray(x);w.disable(w.CULL_FACE);w.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,
+P);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,y);w.uniformMatrix4fv(p,!1,M.projectionMatrix.elements);w.activeTexture(w.TEXTURE0);w.uniform1i(h,0);K=H=0;(N=V.fog)?(w.uniform3f(s,N.color.r,N.color.g,N.color.b),N instanceof THREE.Fog?(w.uniform1f(t,N.near),w.uniform1f(r,N.far),w.uniform1i(q,1),K=H=1):N instanceof THREE.FogExp2&&(w.uniform1f(m,N.density),w.uniform1i(q,2),K=H=2)):(w.uniform1i(q,0),K=H=0);for(var N=0,U=b.length;N<
+U;N++){var F=b[N];F._modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,F.matrixWorld);F.z=null===F.renderDepth?-F._modelViewMatrix.elements[14]:F.renderDepth}b.sort(J);for(var W=[],N=0,U=b.length;N<U;N++){var F=b[N],S=F.material;w.uniform1f(u,S.alphaTest);w.uniformMatrix4fv(n,!1,F._modelViewMatrix.elements);F.matrixWorld.decompose(A,B,G);W[0]=G.x;W[1]=G.y;F=0;V.fog&&S.fog&&(F=K);H!==F&&(w.uniform1i(q,F),H=F);null!==S.map?(w.uniform2f(c,S.map.offset.x,S.map.offset.y),w.uniform2f(d,S.map.repeat.x,
+S.map.repeat.y)):(w.uniform2f(c,0,0),w.uniform2f(d,1,1));w.uniform1f(k,S.opacity);w.uniform3f(g,S.color.r,S.color.g,S.color.b);w.uniform1f(e,S.rotation);w.uniform2fv(f,W);a.setBlending(S.blending,S.blendEquation,S.blendSrc,S.blendDst);a.setDepthTest(S.depthTest);a.setDepthWrite(S.depthWrite);S.map&&S.map.image&&S.map.image.width?a.setTexture(S.map,0):a.setTexture(D,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}w.enable(w.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))})};d=0;for(var h=a.length;d<h;++d)b(d);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),n=k.data,p=0;p<d;p++)for(var q=0;q<e;q++){var m=0>q-1?0:q-1,r=q+1>e-1?e-1:q+1,t=0>p-1?0:p-1,s=p+1>d-1?d-1:p+1,u=[],v=[0,0,h[4*(q*d+p)]/255*b];u.push([-1,0,h[4*(q*d+t)]/255*b]);u.push([-1,-1,h[4*(m*d+t)]/255*b]);u.push([0,-1,h[4*(m*d+p)]/255*b]);u.push([1,-1,h[4*(m*d+s)]/255*b]);u.push([1,0,h[4*(q*d+s)]/255*b]);u.push([1,1,h[4*(r*d+s)]/255*b]);u.push([0,1,h[4*(r*d+p)]/255*
-b]);u.push([-1,1,h[4*(r*d+t)]/255*b]);m=[];t=u.length;for(r=0;r<t;r++){var s=u[r],x=u[(r+1)%t],s=[s[0]-v[0],s[1]-v[1],s[2]-v[2]],x=[x[0]-v[0],x[1]-v[1],x[2]-v[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(r=0;r<m.length;r++)u[0]+=m[r][0],u[1]+=m[r][1],u[2]+=m[r][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;v=4*(q*d+p);n[v]=(u[0]+1)/2*255|0;n[v+1]=(u[1]+1)/2*255|0;n[v+2]=255*u[2]|0;n[v+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
+f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),n=k.data,p=0;p<d;p++)for(var q=0;q<e;q++){var m=0>q-1?0:q-1,t=q+1>e-1?e-1:q+1,r=0>p-1?0:p-1,s=p+1>d-1?d-1:p+1,u=[],v=[0,0,h[4*(q*d+p)]/255*b];u.push([-1,0,h[4*(q*d+r)]/255*b]);u.push([-1,-1,h[4*(m*d+r)]/255*b]);u.push([0,-1,h[4*(m*d+p)]/255*b]);u.push([1,-1,h[4*(m*d+s)]/255*b]);u.push([1,0,h[4*(q*d+s)]/255*b]);u.push([1,1,h[4*(t*d+s)]/255*b]);u.push([0,1,h[4*(t*d+p)]/255*
+b]);u.push([-1,1,h[4*(t*d+r)]/255*b]);m=[];r=u.length;for(t=0;t<r;t++){var s=u[t],x=u[(t+1)%r],s=[s[0]-v[0],s[1]-v[1],s[2]-v[2]],x=[x[0]-v[0],x[1]-v[1],x[2]-v[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(t=0;t<m.length;t++)u[0]+=m[t][0],u[1]+=m[t][1],u[2]+=m[t][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;v=4*(q*d+p);n[v]=(u[0]+1)/2*255|0;n[v+1]=(u[1]+1)/2*255|0;n[v+2]=255*u[2]|0;n[v+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
 b,c){var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
 THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing.";}},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=
-a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,n,p,q,m,r,t,s,u,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),n=b.length,a=0;a<n;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;p=b[a++]*c;e.moveTo(k,p);
-break;case "l":k=b[a++]*c+d;p=b[a++]*c;e.lineTo(k,p);break;case "q":k=b[a++]*c+d;p=b[a++]*c;r=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(r,t,k,p);if(g=f[f.length-1])for(q=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++){var x=g/h;THREE.Shape.Utils.b2(x,q,r,k);THREE.Shape.Utils.b2(x,m,t,p)}break;case "b":if(k=b[a++]*c+d,p=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,p),g=f[f.length-1])for(q=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++)x=g/h,THREE.Shape.Utils.b3(x,q,r,s,k),THREE.Shape.Utils.b3(x,
-m,t,u,p)}return{offset:v.ha*c,path:e}}}};
+a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,n,p,q,m,t,r,s,u,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),n=b.length,a=0;a<n;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;p=b[a++]*c;e.moveTo(k,p);
+break;case "l":k=b[a++]*c+d;p=b[a++]*c;e.lineTo(k,p);break;case "q":k=b[a++]*c+d;p=b[a++]*c;t=b[a++]*c+d;r=b[a++]*c;e.quadraticCurveTo(t,r,k,p);if(g=f[f.length-1])for(q=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++){var x=g/h;THREE.Shape.Utils.b2(x,q,t,k);THREE.Shape.Utils.b2(x,m,r,p)}break;case "b":if(k=b[a++]*c+d,p=b[a++]*c,t=b[a++]*c+d,r=b[a++]*c,s=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(t,r,s,u,k,p),g=f[f.length-1])for(q=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++)x=g/h,THREE.Shape.Utils.b3(x,q,t,s,k),THREE.Shape.Utils.b3(x,
+m,r,u,p)}return{offset:v.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,n,p;if(0<b(a))for(n=0;n<e;n++)g[n]=n;else for(n=0;n<e;n++)g[n]=e-1-n;var q=2*e;for(n=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=n;e<=k&&(k=0);n=k+1;e<=n&&(n=0);p=n+1;e<=p&&(p=0);var m;a:{var r=m=void 0,t=void 0,s=void 0,u=void 0,v=void 0,x=void 0,E=void 0,w=void 0,
-r=a[g[k]].x,t=a[g[k]].y,s=a[g[n]].x,u=a[g[n]].y,v=a[g[p]].x,x=a[g[p]].y;if(1E-10>(s-r)*(x-t)-(u-t)*(v-r))m=!1;else{var M=void 0,y=void 0,C=void 0,D=void 0,A=void 0,B=void 0,G=void 0,S=void 0,K=void 0,I=void 0,K=S=G=w=E=void 0,M=v-s,y=x-u,C=r-v,D=t-x,A=s-r,B=u-t;for(m=0;m<e;m++)if(E=a[g[m]].x,w=a[g[m]].y,!(E===r&&w===t||E===s&&w===u||E===v&&w===x)&&(G=E-r,S=w-t,K=E-s,I=w-u,E-=v,w-=x,K=M*I-y*K,G=A*S-B*G,S=C*w-D*E,-1E-10<=K&&-1E-10<=S&&-1E-10<=G)){m=!1;break a}m=!0}}if(m){f.push([a[g[k]],a[g[n]],a[g[p]]]);
+(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,n,p;if(0<b(a))for(n=0;n<e;n++)g[n]=n;else for(n=0;n<e;n++)g[n]=e-1-n;var q=2*e;for(n=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=n;e<=k&&(k=0);n=k+1;e<=n&&(n=0);p=n+1;e<=p&&(p=0);var m;a:{var t=m=void 0,r=void 0,s=void 0,u=void 0,v=void 0,x=void 0,J=void 0,w=void 0,
+t=a[g[k]].x,r=a[g[k]].y,s=a[g[n]].x,u=a[g[n]].y,v=a[g[p]].x,x=a[g[p]].y;if(1E-10>(s-t)*(x-r)-(u-r)*(v-t))m=!1;else{var P=void 0,y=void 0,C=void 0,D=void 0,A=void 0,B=void 0,G=void 0,V=void 0,M=void 0,H=void 0,M=V=G=w=J=void 0,P=v-s,y=x-u,C=t-v,D=r-x,A=s-t,B=u-r;for(m=0;m<e;m++)if(J=a[g[m]].x,w=a[g[m]].y,!(J===t&&w===r||J===s&&w===u||J===v&&w===x)&&(G=J-t,V=w-r,M=J-s,H=w-u,J-=v,w-=x,M=P*H-y*M,G=A*V-B*G,V=C*w-D*J,-1E-10<=M&&-1E-10<=V&&-1E-10<=G)){m=!1;break a}m=!0}}if(m){f.push([a[g[k]],a[g[n]],a[g[p]]]);
 h.push([g[k],g[n],g[p]]);k=n;for(p=n+1;p<e;k++,p++)g[k]=g[p];e--;q=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain)};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);THREE.Audio.prototype.constructor=THREE.Audio;
 THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.source.connect(b.panner);b.source.start(0)})};c.send();return this};THREE.Audio.prototype.setLoop=function(a){this.source.loop=a};THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a};THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a};
@@ -659,21 +656,21 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.s
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(k);k=k.getPoint(1);h.push(k.x);h.push(k.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})};
 THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};
-THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,n,p,q,m,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];q=f[0];m=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,q,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];q=f[0];m=f[1];n=f[2];p=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,q,n,h),s=THREE.Shape.Utils.b3(s,t,m,p,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];n=f[3];g=f[4];q=!!f[5];r=g-n;t=2*a;for(f=1;f<=t;f++)s=f/t,q||(s=1-s),s=n+s*r,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],p=f[3],n=f[4],g=f[5],q=!!f[6],r=g-n,t=2*a,f=1;f<=t;f++)s=f/t,q||
-(s=1-s),s=n+s*r,g=h+m*Math.cos(s),s=k+p*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.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,n,p,q,m,t,r,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];q=f[0];m=f[1];0<c.length?(g=c[c.length-1],t=g.x,
+r=g.y):(g=this.actions[d-1].args,t=g[g.length-2],r=g[g.length-1]);for(f=1;f<=a;f++)s=f/a,g=THREE.Shape.Utils.b2(s,t,q,h),s=THREE.Shape.Utils.b2(s,r,m,k),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];q=f[0];m=f[1];n=f[2];p=f[3];0<c.length?(g=c[c.length-1],t=g.x,r=g.y):(g=this.actions[d-1].args,t=g[g.length-2],r=g[g.length-1]);for(f=1;f<=a;f++)s=f/a,g=THREE.Shape.Utils.b3(s,t,q,n,h),s=THREE.Shape.Utils.b3(s,r,m,p,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];n=f[3];g=f[4];q=!!f[5];t=g-n;r=2*a;for(f=1;f<=r;f++)s=f/r,q||(s=1-s),s=n+s*t,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],p=f[3],n=f[4],g=f[5],q=!!f[6],t=g-n,r=2*a,f=1;f<=r;f++)s=f/r,q||
+(s=1-s),s=n+s*t,g=h+m*Math.cos(s),s=k+p*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&&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 n=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),n=a?!n:n;
-h=[];var p=[],q=[],m=0,r;p[m]=void 0;q[m]=[];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)?(!n&&p[m]&&m++,p[m]={s:new THREE.Shape,p:r},p[m].s.actions=g.actions,p[m].s.curves=g.curves,n&&m++,q[m]=[]):q[m].push({h:g,p:r[0]});if(!p[0])return c(e);if(1<p.length){t=!1;s=[];g=0;for(e=p.length;g<e;g++)h[g]=[];g=0;for(e=p.length;g<e;g++)for(f=q[g],n=0;n<f.length;n++){m=f[n];r=!0;for(var u=0;u<p.length;u++)d(m.p,p[u].p)&&(g!=u&&s.push({froms:g,tos:u,
-hole:n}),r?(r=!1,h[u].push(m)):t=!0);r&&h[g].push(m)}0<s.length&&(t||(q=h))}t=0;for(s=p.length;t<s;t++)for(h=p[t].s,k.push(h),g=q[t],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
+h=[];var p=[],q=[],m=0,t;p[m]=void 0;q[m]=[];var r,s;r=0;for(s=e.length;r<s;r++)g=e[r],t=g.getPoints(),f=THREE.Shape.Utils.isClockWise(t),(f=a?!f:f)?(!n&&p[m]&&m++,p[m]={s:new THREE.Shape,p:t},p[m].s.actions=g.actions,p[m].s.curves=g.curves,n&&m++,q[m]=[]):q[m].push({h:g,p:t[0]});if(!p[0])return c(e);if(1<p.length){r=!1;s=[];g=0;for(e=p.length;g<e;g++)h[g]=[];g=0;for(e=p.length;g<e;g++)for(f=q[g],n=0;n<f.length;n++){m=f[n];t=!0;for(var u=0;u<p.length;u++)d(m.p,p[u].p)&&(g!=u&&s.push({froms:g,tos:u,
+hole:n}),t?(t=!1,h[u].push(m)):r=!0);t&&h[g].push(m)}0<s.length&&(r||(q=h))}r=0;for(s=p.length;r<s;r++)for(h=p[r].s,k.push(h),g=q[r],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
 THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
 THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,n=e.y-d.y,p=a.x-d.x,q=a.y-d.y,C=h*k-g*n,D=h*p-g*q;if(1E-10<Math.abs(C)){if(0<C){if(0>D||D>C)return[];k=n*p-k*q;if(0>k||k>C)return[]}else{if(0<D||D<C)return[];k=n*p-k*q;if(0<k||k<C)return[]}if(0==k)return!f||0!=D&&D!=C?[a]:[];if(k==C)return!f||0!=D&&D!=C?[b]:[];if(0==D)return[d];
 if(D==C)return[e];f=k/C;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=D||n*p!=k*q)return[];h=0==g&&0==h;k=0==k&&0==n;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,C=d.x,n=e,d=e.x):(b=e,C=e.x,n=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,C=d.y,n=e,d=e.y):(b=e,C=e.y,n=d,d=d.y));return k<=C?a<C?[]:a==C?f?[]:[b]:a<=d?[b,h]:[b,n]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
 [g,n]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,n,p={};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++)n=h[f].x+":"+h[f].y,void 0!==p[n]&&console.log("Duplicate point",n),p[n]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;
-d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<n.length;e++)for(f=b[n[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,n=[],p,q,y,C,D,A=[],B,G,S,K=0;for(p=b.length;K<p;K++)n.push(K);B=0;for(var I=2*n.length;0<n.length;){I--;if(0>I){console.log("Infinite Loop! Holes left:"+
-n.length+", Probably Hole outside Shape!");break}for(q=B;q<h.length;q++){y=h[q];p=-1;for(K=0;K<n.length;K++)if(C=n[K],D=y.x+":"+y.y+":"+C,void 0===A[D]){k=b[C];for(G=0;G<k.length;G++)if(C=k[G],c(q,G)&&!f(y,C)&&!g(y,C)){p=G;n.splice(K,1);B=h.slice(0,q+1);C=h.slice(q);G=k.slice(p);S=k.slice(0,p+1);h=B.concat(G).concat(S).concat(C);B=q;break}if(0<=p)break;A[D]=!0}if(0<=p)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)n=k[h].x+":"+k[h].y,
+d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<n.length;e++)for(f=b[n[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,n=[],p,q,y,C,D,A=[],B,G,V,M=0;for(p=b.length;M<p;M++)n.push(M);B=0;for(var H=2*n.length;0<n.length;){H--;if(0>H){console.log("Infinite Loop! Holes left:"+
+n.length+", Probably Hole outside Shape!");break}for(q=B;q<h.length;q++){y=h[q];p=-1;for(M=0;M<n.length;M++)if(C=n[M],D=y.x+":"+y.y+":"+C,void 0===A[D]){k=b[C];for(G=0;G<k.length;G++)if(C=k[G],c(q,G)&&!f(y,C)&&!g(y,C)){p=G;n.splice(M,1);B=h.slice(0,q+1);C=h.slice(q);G=k.slice(p);V=k.slice(0,p+1);h=B.concat(G).concat(V).concat(C);B=q;break}if(0<=p)break;A[D]=!0}if(0<=p)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)n=k[h].x+":"+k[h].y,
 n=p[n],void 0!==n&&(k[h]=n);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
 b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};
 THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;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};
@@ -696,12 +693,12 @@ THREE.Animation.prototype.play=function(a,b){this.currentTime=void 0!==a?a:0;thi
 THREE.Animation.prototype.reset=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];c.matrixAutoUpdate=!0;void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});void 0===c.animationCache.animations[this.data.name]&&(c.animationCache.animations[this.data.name]={},c.animationCache.animations[this.data.name].prevKey={pos:0,rot:0,scl:0},c.animationCache.animations[this.data.name].nextKey={pos:0,rot:0,scl:0},
 c.animationCache.animations[this.data.name].originalMatrix=c.matrix);for(var c=c.animationCache.animations[this.data.name],d=0;3>d;d++){for(var e=this.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.time<this.currentTime&&g.index>f.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}};
 THREE.Animation.prototype.resetBlendWeights=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];void 0!==c.animationCache&&(c.animationCache.blending.positionWeight=0,c.animationCache.blending.quaternionWeight=0,c.animationCache.blending.scaleWeight=0)}};
-THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,m,r,t,s;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];r=a[c[1]];t=a[c[2]];s=a[c[3]];c=e*e;m=e*c;d[0]=f(q[0],r[0],t[0],s[0],e,c,m);d[1]=f(q[1],r[1],t[1],s[1],e,c,m);d[2]=f(q[2],r[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)if(this.loop)this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset();else{this.stop();return}f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],n=k.animationCache.animations[this.data.name],p=k.animationCache.blending,q=0;3>q;q++){var m=this.keyTypes[q],r=n.prevKey[m],t=n.nextKey[m];
-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(m,f,1);t.time<this.currentTime&&t.index>r.index;)r=t,t=this.getNextKeyWith(m,f,t.index+1);n.prevKey[m]=r;n.nextKey[m]=t}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var s=(this.currentTime-r.time)/(t.time-r.time),u=r[m],v=t[m];0>s&&(s=0);1<s&&(s=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*s,c.y=
-u[1]+(v[1]-u[1])*s,c.z=u[2]+(v[2]-u[2])*s,r=this.weight/(this.weight+p.positionWeight),k.position.lerp(c,r),p.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]=v,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,s=.33*s+.33,t=e(a,s),r=this.weight/(this.weight+p.positionWeight),p.positionWeight+=this.weight,m=k.position,m.x+=(t[0]-
-m.x)*r,m.y+=(t[1]-m.y)*r,m.z+=(t[2]-m.z)*r,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,v,d,s),0===p.quaternionWeight?(k.quaternion.copy(d),p.quaternionWeight=this.weight):(r=this.weight/(this.weight+p.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,r),p.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+
-(v[0]-u[0])*s,c.y=u[1]+(v[1]-u[1])*s,c.z=u[2]+(v[2]-u[2])*s,r=this.weight/(this.weight+p.scaleWeight),k.scale.lerp(c,r),p.scaleWeight+=this.weight)}return!0}}}();THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
+THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,m,t,r,s;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];r=a[c[2]];s=a[c[3]];c=e*e;m=e*c;d[0]=f(q[0],t[0],r[0],s[0],e,c,m);d[1]=f(q[1],t[1],r[1],s[1],e,c,m);d[2]=f(q[2],t[2],r[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)if(this.loop)this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset();else{this.stop();return}f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],n=k.animationCache.animations[this.data.name],p=k.animationCache.blending,q=0;3>q;q++){var m=this.keyTypes[q],t=n.prevKey[m],r=n.nextKey[m];
+if(0<this.timeScale&&r.time<=this.currentTime||0>this.timeScale&&t.time>=this.currentTime){t=this.data.hierarchy[f].keys[0];for(r=this.getNextKeyWith(m,f,1);r.time<this.currentTime&&r.index>t.index;)t=r,r=this.getNextKeyWith(m,f,r.index+1);n.prevKey[m]=t;n.nextKey[m]=r}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var s=(this.currentTime-t.time)/(r.time-t.time),u=t[m],v=r[m];0>s&&(s=0);1<s&&(s=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*s,c.y=
+u[1]+(v[1]-u[1])*s,c.z=u[2]+(v[2]-u[2])*s,t=this.weight/(this.weight+p.positionWeight),k.position.lerp(c,t),p.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,t.index-1).pos,a[1]=u,a[2]=v,a[3]=this.getNextKeyWith("pos",f,r.index+1).pos,s=.33*s+.33,r=e(a,s),t=this.weight/(this.weight+p.positionWeight),p.positionWeight+=this.weight,m=k.position,m.x+=(r[0]-
+m.x)*t,m.y+=(r[1]-m.y)*t,m.z+=(r[2]-m.z)*t,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,v,d,s),0===p.quaternionWeight?(k.quaternion.copy(d),p.quaternionWeight=this.weight):(t=this.weight/(this.weight+p.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,t),p.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+
+(v[0]-u[0])*s,c.y=u[1]+(v[1]-u[1])*s,c.z=u[2]+(v[2]-u[2])*s,t=this.weight/(this.weight+p.scaleWeight),k.scale.lerp(c,t),p.scaleWeight+=this.weight)}return!0}}}();THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};
 THREE.KeyFrameAnimation=function(a){this.root=a.node;this.data=THREE.AnimationHandler.init(a);this.hierarchy=THREE.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=.001;this.isPlaying=!1;this.loop=this.isPaused=!0;a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 d.matrixWorldNeedsUpdate=!0}}};
@@ -712,67 +709,67 @@ f;d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.inter
 THREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
 THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);a=this.duration/this.frames;var b=Math.floor(this.currentTime/a);b!=this.currentFrame&&(this.mesh.morphTargetInfluences[this.lastFrame]=0,this.mesh.morphTargetInfluences[this.currentFrame]=
 1,this.mesh.morphTargetInfluences[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);this.mesh.morphTargetInfluences[b]=this.currentTime%a/a;this.mesh.morphTargetInfluences[this.lastFrame]=1-this.mesh.morphTargetInfluences[b]}}};
-THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,s){var u,v=h.widthSegments,x=h.heightSegments,E=e/2,w=f/2,M=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",x=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var y=v+1,C=x+1,D=e/v,A=f/x,B=new THREE.Vector3;B[u]=0<g?1:-1;for(e=0;e<C;e++)for(f=0;f<y;f++){var G=new THREE.Vector3;G[a]=(f*D-E)*c;G[b]=(e*A-w)*d;G[u]=g;h.vertices.push(G)}for(e=
-0;e<x;e++)for(f=0;f<v;f++)w=f+y*e,a=f+y*(e+1),b=f+1+y*(e+1),c=f+1+y*e,d=new THREE.Vector2(f/v,1-e/x),g=new THREE.Vector2(f/v,1-(e+1)/x),u=new THREE.Vector2((f+1)/v,1-(e+1)/x),E=new THREE.Vector2((f+1)/v,1-e/x),w=new THREE.Face3(w+M,a+M,c+M),w.normal.copy(B),w.vertexNormals.push(B.clone(),B.clone(),B.clone()),w.materialIndex=s,h.faces.push(w),h.faceVertexUvs[0].push([d,g,E]),w=new THREE.Face3(a+M,b+M,c+M),w.normal.copy(B),w.vertexNormals.push(B.clone(),B.clone(),B.clone()),w.materialIndex=s,h.faces.push(w),
-h.faceVertexUvs[0].push([g.clone(),u,E.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,s){var u,v=h.widthSegments,x=h.heightSegments,J=e/2,w=f/2,P=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",x=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var y=v+1,C=x+1,D=e/v,A=f/x,B=new THREE.Vector3;B[u]=0<g?1:-1;for(e=0;e<C;e++)for(f=0;f<y;f++){var G=new THREE.Vector3;G[a]=(f*D-J)*c;G[b]=(e*A-w)*d;G[u]=g;h.vertices.push(G)}for(e=
+0;e<x;e++)for(f=0;f<v;f++)w=f+y*e,a=f+y*(e+1),b=f+1+y*(e+1),c=f+1+y*e,d=new THREE.Vector2(f/v,1-e/x),g=new THREE.Vector2(f/v,1-(e+1)/x),u=new THREE.Vector2((f+1)/v,1-(e+1)/x),J=new THREE.Vector2((f+1)/v,1-e/x),w=new THREE.Face3(w+P,a+P,c+P),w.normal.copy(B),w.vertexNormals.push(B.clone(),B.clone(),B.clone()),w.materialIndex=s,h.faces.push(w),h.faceVertexUvs[0].push([d,g,J]),w=new THREE.Face3(a+P,b+P,c+P),w.normal.copy(B),w.vertexNormals.push(B.clone(),B.clone(),B.clone()),w.materialIndex=s,h.faces.push(w),
+h.faceVertexUvs[0].push([g.clone(),u,J.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;
 THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
 THREE.CubeGeometry=function(a,b,c,d,e,f){console.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry.");return new THREE.BoxGeometry(a,b,c,d,e,f)};
-THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f};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;var g=c/2,h,k,n=[],p=[];for(k=0;k<=e;k++){var q=[],m=[],r=k/e,t=r*(b-a)+a;for(h=0;h<=d;h++){var s=h/d,u=new THREE.Vector3;u.x=t*Math.sin(s*Math.PI*2);u.y=-r*c+g;u.z=t*Math.cos(s*Math.PI*2);this.vertices.push(u);q.push(this.vertices.length-
-1);m.push(new THREE.Vector2(s,1-r))}n.push(q);p.push(m)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[n[0][h]].clone(),m=this.vertices[n[0][h+1]].clone()):(q=this.vertices[n[1][h]].clone(),m=this.vertices[n[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),m.setY(Math.sqrt(m.x*m.x+m.z*m.z)*c).normalize(),k=0;k<e;k++){var r=n[k][h],t=n[k+1][h],s=n[k+1][h+1],u=n[k][h+1],v=q.clone(),x=q.clone(),E=m.clone(),w=m.clone(),M=p[k][h].clone(),y=p[k+1][h].clone(),C=p[k+1][h+1].clone(),
-D=p[k][h+1].clone();this.faces.push(new THREE.Face3(r,t,u,[v,x,w]));this.faceVertexUvs[0].push([M,y,D]);this.faces.push(new THREE.Face3(t,s,u,[x.clone(),E,w.clone()]));this.faceVertexUvs[0].push([y.clone(),C,D.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)r=n[0][h],t=n[0][h+1],s=this.vertices.length-1,v=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),E=new THREE.Vector3(0,1,0),M=p[0][h].clone(),y=p[0][h+1].clone(),C=new THREE.Vector2(y.x,0),this.faces.push(new THREE.Face3(r,
-t,s,[v,x,E])),this.faceVertexUvs[0].push([M,y,C]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)r=n[k][h+1],t=n[k][h],s=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),E=new THREE.Vector3(0,-1,0),M=p[k][h+1].clone(),y=p[k][h].clone(),C=new THREE.Vector2(y.x,1),this.faces.push(new THREE.Face3(r,t,s,[v,x,E])),this.faceVertexUvs[0].push([M,y,C]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f};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;var g=c/2,h,k,n=[],p=[];for(k=0;k<=e;k++){var q=[],m=[],t=k/e,r=t*(b-a)+a;for(h=0;h<=d;h++){var s=h/d,u=new THREE.Vector3;u.x=r*Math.sin(s*Math.PI*2);u.y=-t*c+g;u.z=r*Math.cos(s*Math.PI*2);this.vertices.push(u);q.push(this.vertices.length-
+1);m.push(new THREE.Vector2(s,1-t))}n.push(q);p.push(m)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[n[0][h]].clone(),m=this.vertices[n[0][h+1]].clone()):(q=this.vertices[n[1][h]].clone(),m=this.vertices[n[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),m.setY(Math.sqrt(m.x*m.x+m.z*m.z)*c).normalize(),k=0;k<e;k++){var t=n[k][h],r=n[k+1][h],s=n[k+1][h+1],u=n[k][h+1],v=q.clone(),x=q.clone(),J=m.clone(),w=m.clone(),P=p[k][h].clone(),y=p[k+1][h].clone(),C=p[k+1][h+1].clone(),
+D=p[k][h+1].clone();this.faces.push(new THREE.Face3(t,r,u,[v,x,w]));this.faceVertexUvs[0].push([P,y,D]);this.faces.push(new THREE.Face3(r,s,u,[x.clone(),J,w.clone()]));this.faceVertexUvs[0].push([y.clone(),C,D.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)t=n[0][h],r=n[0][h+1],s=this.vertices.length-1,v=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),J=new THREE.Vector3(0,1,0),P=p[0][h].clone(),y=p[0][h+1].clone(),C=new THREE.Vector2(y.x,0),this.faces.push(new THREE.Face3(t,
+r,s,[v,x,J])),this.faceVertexUvs[0].push([P,y,C]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)t=n[k][h+1],r=n[k][h],s=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),J=new THREE.Vector3(0,-1,0),P=p[k][h+1].clone(),y=p[k][h].clone(),C=new THREE.Vector2(y.x,1),this.faces.push(new THREE.Face3(t,r,s,[v,x,J])),this.faceVertexUvs[0].push([P,y,C]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
 THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),m=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)==
-Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(O=a.length;0<=--O;){c=O;d=O-1;0>d&&(d=a.length-1);for(var e=0,f=r+2*p,e=0;e<f;e++){var g=ya*e,h=ya*(e+1),k=b+c+g,g=b+d+g,m=b+d+h,h=b+c+h,k=k+S,g=g+S,m=m+S,h=h+S;G.faces.push(new THREE.Face3(k,g,h,null,null,x));G.faces.push(new THREE.Face3(g,m,h,null,null,x));k=E.generateSideWallUV(G,k,g,m,h);G.faceVertexUvs[0].push([k[0],k[1],k[3]]);G.faceVertexUvs[0].push([k[1],
-k[2],k[3]])}}}function f(a,b,c){G.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=S;b+=S;c+=S;G.faces.push(new THREE.Face3(a,b,c,null,null,v));a=E.generateTopUV(G,a,b,c);G.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,n=void 0!==b.bevelSize?b.bevelSize:k-2,p=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,
-s,u=!1,v=b.material,x=b.extrudeMaterial,E=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,M,y,C;t&&(s=t.getSpacedPoints(r),u=!0,q=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,!1),M=new THREE.Vector3,y=new THREE.Vector3,C=new THREE.Vector3);q||(n=k=p=0);var D,A,B,G=this,S=this.vertices.length,t=a.extractPoints(m),m=t.shape,K=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();A=0;for(B=K.length;A<B;A++)D=K[A],THREE.Shape.Utils.isClockWise(D)&&
-(K[A]=D.reverse());t=!1}var I=THREE.Shape.Utils.triangulateShape(m,K),V=m;A=0;for(B=K.length;A<B;A++)D=K[A],m=m.concat(D);var L,J,R,Y,T,ya=m.length,oa,Ca=I.length,t=[],O=0;R=V.length;L=R-1;for(J=O+1;O<R;O++,L++,J++)L===R&&(L=0),J===R&&(J=0),t[O]=d(V[O],V[L],V[J]);var Ga=[],xa,za=t.concat();A=0;for(B=K.length;A<B;A++){D=K[A];xa=[];O=0;R=D.length;L=R-1;for(J=O+1;O<R;O++,L++,J++)L===R&&(L=0),J===R&&(J=0),xa[O]=d(D[O],D[L],D[J]);Ga.push(xa);za=za.concat(xa)}for(L=0;L<p;L++){R=L/p;Y=k*(1-R);J=n*Math.sin(R*
-Math.PI/2);O=0;for(R=V.length;O<R;O++)T=c(V[O],t[O],J),f(T.x,T.y,-Y);A=0;for(B=K.length;A<B;A++)for(D=K[A],xa=Ga[A],O=0,R=D.length;O<R;O++)T=c(D[O],xa[O],J),f(T.x,T.y,-Y)}J=n;for(O=0;O<ya;O++)T=q?c(m[O],za[O],J):m[O],u?(y.copy(w.normals[0]).multiplyScalar(T.x),M.copy(w.binormals[0]).multiplyScalar(T.y),C.copy(s[0]).add(y).add(M),f(C.x,C.y,C.z)):f(T.x,T.y,0);for(R=1;R<=r;R++)for(O=0;O<ya;O++)T=q?c(m[O],za[O],J):m[O],u?(y.copy(w.normals[R]).multiplyScalar(T.x),M.copy(w.binormals[R]).multiplyScalar(T.y),
-C.copy(s[R]).add(y).add(M),f(C.x,C.y,C.z)):f(T.x,T.y,h/r*R);for(L=p-1;0<=L;L--){R=L/p;Y=k*(1-R);J=n*Math.sin(R*Math.PI/2);O=0;for(R=V.length;O<R;O++)T=c(V[O],t[O],J),f(T.x,T.y,h+Y);A=0;for(B=K.length;A<B;A++)for(D=K[A],xa=Ga[A],O=0,R=D.length;O<R;O++)T=c(D[O],xa[O],J),u?f(T.x,T.y+s[r-1].y,s[r-1].x+Y):f(T.x,T.y,h+Y)}(function(){if(q){var a;a=0*ya;for(O=0;O<Ca;O++)oa=I[O],g(oa[2]+a,oa[1]+a,oa[0]+a);a=r+2*p;a*=ya;for(O=0;O<Ca;O++)oa=I[O],g(oa[0]+a,oa[1]+a,oa[2]+a)}else{for(O=0;O<Ca;O++)oa=I[O],g(oa[2],
-oa[1],oa[0]);for(O=0;O<Ca;O++)oa=I[O],g(oa[0]+ya*r,oa[1]+ya*r,oa[2]+ya*r)}})();(function(){var a=0;e(V,a);a+=V.length;A=0;for(B=K.length;A<B;A++)D=K[A],e(D,a),a+=D.length})()};
+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(L=a.length;0<=--L;){c=L;d=L-1;0>d&&(d=a.length-1);for(var e=0,f=t+2*p,e=0;e<f;e++){var g=ja*e,h=ja*(e+1),k=b+c+g,g=b+d+g,m=b+d+h,h=b+c+h,k=k+V,g=g+V,m=m+V,h=h+V;G.faces.push(new THREE.Face3(k,g,h,null,null,x));G.faces.push(new THREE.Face3(g,m,h,null,null,x));k=J.generateSideWallUV(G,k,g,m,h);G.faceVertexUvs[0].push([k[0],k[1],k[3]]);G.faceVertexUvs[0].push([k[1],
+k[2],k[3]])}}}function f(a,b,c){G.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=V;b+=V;c+=V;G.faces.push(new THREE.Face3(a,b,c,null,null,v));a=J.generateTopUV(G,a,b,c);G.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,n=void 0!==b.bevelSize?b.bevelSize:k-2,p=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,r=b.extrudePath,
+s,u=!1,v=b.material,x=b.extrudeMaterial,J=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,P,y,C;r&&(s=r.getSpacedPoints(t),u=!0,q=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(r,t,!1),P=new THREE.Vector3,y=new THREE.Vector3,C=new THREE.Vector3);q||(n=k=p=0);var D,A,B,G=this,V=this.vertices.length,r=a.extractPoints(m),m=r.shape,M=r.holes;if(r=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();A=0;for(B=M.length;A<B;A++)D=M[A],THREE.Shape.Utils.isClockWise(D)&&
+(M[A]=D.reverse());r=!1}var H=THREE.Shape.Utils.triangulateShape(m,M),K=m;A=0;for(B=M.length;A<B;A++)D=M[A],m=m.concat(D);var N,U,F,W,S,ja=m.length,da,va=H.length,r=[],L=0;F=K.length;N=F-1;for(U=L+1;L<F;L++,N++,U++)N===F&&(N=0),U===F&&(U=0),r[L]=d(K[L],K[N],K[U]);var Ea=[],Da,wa=r.concat();A=0;for(B=M.length;A<B;A++){D=M[A];Da=[];L=0;F=D.length;N=F-1;for(U=L+1;L<F;L++,N++,U++)N===F&&(N=0),U===F&&(U=0),Da[L]=d(D[L],D[N],D[U]);Ea.push(Da);wa=wa.concat(Da)}for(N=0;N<p;N++){F=N/p;W=k*(1-F);U=n*Math.sin(F*
+Math.PI/2);L=0;for(F=K.length;L<F;L++)S=c(K[L],r[L],U),f(S.x,S.y,-W);A=0;for(B=M.length;A<B;A++)for(D=M[A],Da=Ea[A],L=0,F=D.length;L<F;L++)S=c(D[L],Da[L],U),f(S.x,S.y,-W)}U=n;for(L=0;L<ja;L++)S=q?c(m[L],wa[L],U):m[L],u?(y.copy(w.normals[0]).multiplyScalar(S.x),P.copy(w.binormals[0]).multiplyScalar(S.y),C.copy(s[0]).add(y).add(P),f(C.x,C.y,C.z)):f(S.x,S.y,0);for(F=1;F<=t;F++)for(L=0;L<ja;L++)S=q?c(m[L],wa[L],U):m[L],u?(y.copy(w.normals[F]).multiplyScalar(S.x),P.copy(w.binormals[F]).multiplyScalar(S.y),
+C.copy(s[F]).add(y).add(P),f(C.x,C.y,C.z)):f(S.x,S.y,h/t*F);for(N=p-1;0<=N;N--){F=N/p;W=k*(1-F);U=n*Math.sin(F*Math.PI/2);L=0;for(F=K.length;L<F;L++)S=c(K[L],r[L],U),f(S.x,S.y,h+W);A=0;for(B=M.length;A<B;A++)for(D=M[A],Da=Ea[A],L=0,F=D.length;L<F;L++)S=c(D[L],Da[L],U),u?f(S.x,S.y+s[t-1].y,s[t-1].x+W):f(S.x,S.y,h+W)}(function(){if(q){var a;a=0*ja;for(L=0;L<va;L++)da=H[L],g(da[2]+a,da[1]+a,da[0]+a);a=t+2*p;a*=ja;for(L=0;L<va;L++)da=H[L],g(da[0]+a,da[1]+a,da[2]+a)}else{for(L=0;L<va;L++)da=H[L],g(da[2],
+da[1],da[0]);for(L=0;L<va;L++)da=H[L],g(da[0]+ja*t,da[1]+ja*t,da[2]+ja*t)}})();(function(){var a=0;e(K,a);a+=K.length;A=0;for(B=M.length;A<B;A++)D=M[A],e(D,a),a+=D.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,n=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=n.length;e<f;e++)g=n[e],THREE.Shape.Utils.isClockWise(g)&&(n[e]=g.reverse());var p=THREE.Shape.Utils.triangulateShape(k,n);e=0;for(f=n.length;e<f;e++)g=n[e],
 k=k.concat(g);n=k.length;f=p.length;for(e=0;e<n;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)n=p[e],k=n[0]+h,g=n[1]+h,n=n[2]+h,this.faces.push(new THREE.Face3(k,g,n,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,g,n))};
-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,n=Math.cos(k),p=Math.sin(k),k=0,q=a.length;k<q;k++){var m=a[k],r=new THREE.Vector3;r.x=n*m.x-p*m.y;r.y=p*m.x+n*m.y;r.z=m.z;this.vertices.push(r)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,q=a.length-1;k<q;k++){b=p=k+c*g;d=p+c;var n=p+1+c,p=p+1,m=g*f,r=k*e,t=
-m+f,s=r+e;this.faces.push(new THREE.Face3(b,d,p));this.faceVertexUvs[0].push([new THREE.Vector2(m,r),new THREE.Vector2(t,r),new THREE.Vector2(m,s)]);this.faces.push(new THREE.Face3(d,n,p));this.faceVertexUvs[0].push([new THREE.Vector2(t,r),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.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,n=Math.cos(k),p=Math.sin(k),k=0,q=a.length;k<q;k++){var m=a[k],t=new THREE.Vector3;t.x=n*m.x-p*m.y;t.y=p*m.x+n*m.y;t.z=m.z;this.vertices.push(t)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,q=a.length-1;k<q;k++){b=p=k+c*g;d=p+c;var n=p+1+c,p=p+1,m=g*f,t=k*e,r=
+m+f,s=t+e;this.faces.push(new THREE.Face3(b,d,p));this.faceVertexUvs[0].push([new THREE.Vector2(m,t),new THREE.Vector2(r,t),new THREE.Vector2(m,s)]);this.faces.push(new THREE.Face3(d,n,p));this.faceVertexUvs[0].push([new THREE.Vector2(r,t),new THREE.Vector2(r,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.PlaneGeometry=function(a,b,c,d){console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,n=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var p=new Float32Array(g*h*2),q=0,m=0,r=0;r<h;r++)for(var t=r*n-f,s=0;s<g;s++)b[q]=s*k-e,b[q+1]=-t,a[q+2]=1,p[m]=s/c,p[m+1]=1-r/d,q+=3,m+=2;q=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[q]=s+g*r,e[q+1]=f,e[q+2]=k,e[q+3]=f,e[q+4]=h,e[q+5]=k,q+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(p,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
+THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,n=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var p=new Float32Array(g*h*2),q=0,m=0,t=0;t<h;t++)for(var r=t*n-f,s=0;s<g;s++)b[q]=s*k-e,b[q+1]=-r,a[q+2]=1,p[m]=s/c,p[m+1]=1-t/d,q+=3,m+=2;q=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*d*6);for(t=0;t<d;t++)for(s=
+0;s<c;s++)f=s+g*(t+1),h=s+1+g*(t+1),k=s+1+g*t,e[q]=s+g*t,e[q+1]=f,e[q+2]=k,e[q+3]=f,e[q+4]=h,e[q+5]=k,q+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(p,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,n=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var p=new THREE.Vector3,q=e+g/c*f;p.x=k*Math.cos(q);p.y=k*Math.sin(q);this.vertices.push(p);h.push(new THREE.Vector2((p.x/b+1)/2,
 (p.y/b+1)/2))}k+=n}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=q=g+e,n=q+c+1,p=q+c+2,this.faces.push(new THREE.Face3(f,n,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[n].clone(),h[p].clone()]),f=q,n=q+c+2,p=q+1,this.faces.push(new THREE.Face3(f,n,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[n].clone(),h[p].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
 THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;
-THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,n=[],p=[];for(k=0;k<=c;k++){var q=[],m=[];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);q.push(this.vertices.length-1);m.push(new THREE.Vector2(r,1-t))}n.push(q);p.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=n[k][h+1];e=n[k][h];f=n[k+1][h];g=n[k+1][h+1];var q=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),r=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),s=p[k][h+1].clone(),u=p[k][h].clone(),v=p[k+1][h].clone(),x=p[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,[q,r,t])),this.faceVertexUvs[0].push([s,v,x])):Math.abs(this.vertices[f].y)===a?(v.x=(v.x+x.x)/2,this.faces.push(new THREE.Face3(d,e,f,[q,m,r])),this.faceVertexUvs[0].push([s,u,v])):(this.faces.push(new THREE.Face3(d,e,g,[q,m,t])),this.faceVertexUvs[0].push([s,u,x]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),r,t.clone()])),this.faceVertexUvs[0].push([u.clone(),v,x.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
+THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,n=[],p=[];for(k=0;k<=c;k++){var q=[],m=[];for(h=0;h<=b;h++){var t=h/b,r=k/c,s=new THREE.Vector3;s.x=-a*Math.cos(d+t*e)*Math.sin(f+r*g);
+s.y=a*Math.cos(f+r*g);s.z=a*Math.sin(d+t*e)*Math.sin(f+r*g);this.vertices.push(s);q.push(this.vertices.length-1);m.push(new THREE.Vector2(t,1-r))}n.push(q);p.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=n[k][h+1];e=n[k][h];f=n[k+1][h];g=n[k+1][h+1];var q=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),t=this.vertices[f].clone().normalize(),r=this.vertices[g].clone().normalize(),s=p[k][h+1].clone(),u=p[k][h].clone(),v=p[k+1][h].clone(),x=p[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,[q,t,r])),this.faceVertexUvs[0].push([s,v,x])):Math.abs(this.vertices[f].y)===a?(v.x=(v.x+x.x)/2,this.faces.push(new THREE.Face3(d,e,f,[q,m,t])),this.faceVertexUvs[0].push([s,u,v])):(this.faces.push(new THREE.Face3(d,e,g,[q,m,r])),this.faceVertexUvs[0].push([s,u,x]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),t,r.clone()])),this.faceVertexUvs[0].push([u.clone(),v,x.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
 a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b);this.type="TextGeometry"};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var n=0;n<=d;n++){var p=n/d*e,q=k/c*Math.PI*2;f.x=a*Math.cos(p);f.y=a*Math.sin(p);var m=new THREE.Vector3;m.x=(a+b*Math.cos(q))*Math.cos(p);m.y=(a+b*Math.cos(q))*Math.sin(p);m.z=b*Math.sin(q);this.vertices.push(m);g.push(new THREE.Vector2(n/
 d,k/c));h.push(m.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(n=1;n<=d;n++)a=(d+1)*k+n-1,b=(d+1)*(k-1)+n-1,e=(d+1)*(k-1)+n,f=(d+1)*k+n,p=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(p),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),p=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(p),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),n=new THREE.Vector3,p=new THREE.Vector3,q=new THREE.Vector3,m=0;m<c;++m){k[m]=
-Array(d);var r=m/c*2*e*Math.PI,t=h(r,f,e,a,g),r=h(r+.01,f,e,a,g);n.subVectors(r,t);p.addVectors(r,t);q.crossVectors(n,p);p.crossVectors(q,n);q.normalize();p.normalize();for(r=0;r<d;++r){var s=r/d*2*Math.PI,u=-b*Math.cos(s),s=b*Math.sin(s),v=new THREE.Vector3;v.x=t.x+u*p.x+s*q.x;v.y=t.y+u*p.y+s*q.y;v.z=t.z+u*p.z+s*q.z;k[m][r]=this.vertices.push(v)-1}}for(m=0;m<c;++m)for(r=0;r<d;++r)e=(m+1)%c,f=(r+1)%d,a=k[m][r],b=k[e][r],e=k[e][f],f=k[m][f],g=new THREE.Vector2(m/c,r/d),n=new THREE.Vector2((m+1)/c,
-r/d),p=new THREE.Vector2((m+1)/c,(r+1)/d),q=new THREE.Vector2(m/c,(r+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,n,q]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([n.clone(),p,q.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
-THREE.TubeGeometry=function(a,b,c,d,e){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;var f=[],g,h,k=b+1,n,p,q,m,r=new THREE.Vector3,t,s,u;t=new THREE.TubeGeometry.FrenetFrames(a,b,e);s=t.normals;u=t.binormals;this.tangents=t.tangents;this.normals=s;this.binormals=u;for(t=0;t<k;t++)for(f[t]=[],n=t/(k-1),m=a.getPointAt(n),g=s[t],h=u[t],n=0;n<d;n++)p=n/d*2*Math.PI,q=-c*Math.cos(p),p=c*Math.sin(p),
-r.copy(m),r.x+=q*g.x+p*h.x,r.y+=q*g.y+p*h.y,r.z+=q*g.z+p*h.z,f[t][n]=this.vertices.push(new THREE.Vector3(r.x,r.y,r.z))-1;for(t=0;t<b;t++)for(n=0;n<d;n++)k=e?(t+1)%b:t+1,r=(n+1)%d,a=f[t][n],c=f[k][n],k=f[k][r],r=f[t][r],s=new THREE.Vector2(t/b,n/d),u=new THREE.Vector2((t+1)/b,n/d),g=new THREE.Vector2((t+1)/b,(n+1)/d),h=new THREE.Vector2(t/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,r)),this.faceVertexUvs[0].push([s,u,h]),this.faces.push(new THREE.Face3(c,k,r)),this.faceVertexUvs[0].push([u.clone(),
+Array(d);var t=m/c*2*e*Math.PI,r=h(t,f,e,a,g),t=h(t+.01,f,e,a,g);n.subVectors(t,r);p.addVectors(t,r);q.crossVectors(n,p);p.crossVectors(q,n);q.normalize();p.normalize();for(t=0;t<d;++t){var s=t/d*2*Math.PI,u=-b*Math.cos(s),s=b*Math.sin(s),v=new THREE.Vector3;v.x=r.x+u*p.x+s*q.x;v.y=r.y+u*p.y+s*q.y;v.z=r.z+u*p.z+s*q.z;k[m][t]=this.vertices.push(v)-1}}for(m=0;m<c;++m)for(t=0;t<d;++t)e=(m+1)%c,f=(t+1)%d,a=k[m][t],b=k[e][t],e=k[e][f],f=k[m][f],g=new THREE.Vector2(m/c,t/d),n=new THREE.Vector2((m+1)/c,
+t/d),p=new THREE.Vector2((m+1)/c,(t+1)/d),q=new THREE.Vector2(m/c,(t+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,n,q]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([n.clone(),p,q.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
+THREE.TubeGeometry=function(a,b,c,d,e){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;var f=[],g,h,k=b+1,n,p,q,m,t=new THREE.Vector3,r,s,u;r=new THREE.TubeGeometry.FrenetFrames(a,b,e);s=r.normals;u=r.binormals;this.tangents=r.tangents;this.normals=s;this.binormals=u;for(r=0;r<k;r++)for(f[r]=[],n=r/(k-1),m=a.getPointAt(n),g=s[r],h=u[r],n=0;n<d;n++)p=n/d*2*Math.PI,q=-c*Math.cos(p),p=c*Math.sin(p),
+t.copy(m),t.x+=q*g.x+p*h.x,t.y+=q*g.y+p*h.y,t.z+=q*g.z+p*h.z,f[r][n]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(r=0;r<b;r++)for(n=0;n<d;n++)k=e?(r+1)%b:r+1,t=(n+1)%d,a=f[r][n],c=f[k][n],k=f[k][t],t=f[r][t],s=new THREE.Vector2(r/b,n/d),u=new THREE.Vector2((r+1)/b,n/d),g=new THREE.Vector2((r+1)/b,(n+1)/d),h=new THREE.Vector2(r/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,t)),this.faceVertexUvs[0].push([s,u,h]),this.faces.push(new THREE.Face3(c,k,t)),this.faceVertexUvs[0].push([u.clone(),
 g,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var n,p,q;this.tangents=e;this.normals=f;this.binormals=g;for(n=0;n<b;n++)p=n/(b-1),e[n]=a.getTangentAt(p),e[n].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;n=Math.abs(e[0].x);p=Math.abs(e[0].y);q=Math.abs(e[0].z);n<=a&&(a=n,d.set(1,0,0));p<=a&&(a=p,d.set(0,1,0));q<=a&&d.set(0,0,1);h.crossVectors(e[0],
 d).normalize();f[0].crossVectors(e[0],h);g[0].crossVectors(e[0],f[0]);for(n=1;n<b;n++)f[n]=f[n-1].clone(),g[n]=g[n-1].clone(),h.crossVectors(e[n-1],e[n]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[n-1].dot(e[n]),-1,1)),f[n].applyMatrix4(k.makeRotationAxis(h,d))),g[n].crossVectors(e[n],f[n]);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),n=1;n<b;n++)f[n].applyMatrix4(k.makeRotationAxis(e[n],d*n)),g[n].crossVectors(e[n],
 f[n])};
 THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);u.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(u.z,-u.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,b){var c=
 Math.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),m=[],n=0;n<=c;n++){m[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(g.clone().lerp(h,n/c)),r=c-n,s=0;s<=r;s++)m[n][s]=0==s&&n==c?p:e(p.clone().lerp(q,s/r))}for(n=0;n<c;n++)for(s=0;s<2*(c-n)-1;s++)d=Math.floor(s/2),0==s%2?f(m[n][d+1],m[n+1][d],m[n][d]):f(m[n][d+1],m[n+1][d+1],m[n+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,
-a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,n=0,p=a.length;n<p;n+=3)e(new THREE.Vector3(a[n],a[n+1],a[n+2]));a=this.vertices;for(var q=[],m=n=0,p=b.length;n<p;n+=3,m++){var r=a[b[n]],t=a[b[n+1]],s=a[b[n+2]];q[m]=new THREE.Face3(r.index,t.index,s.index,[r.clone(),t.clone(),s.clone()])}for(var u=new THREE.Vector3,n=0,p=q.length;n<p;n++)g(q[n],d);n=0;for(p=this.faceVertexUvs[0].length;n<
-p;n++)b=this.faceVertexUvs[0][n],d=b[0].x,a=b[1].x,q=b[2].x,m=Math.max(d,Math.max(a,q)),r=Math.min(d,Math.min(a,q)),.9<m&&.1>r&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));n=0;for(p=this.vertices.length;n<p;n++)this.vertices[n].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;
+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,n=0,p=a.length;n<p;n+=3)e(new THREE.Vector3(a[n],a[n+1],a[n+2]));a=this.vertices;for(var q=[],m=n=0,p=b.length;n<p;n+=3,m++){var t=a[b[n]],r=a[b[n+1]],s=a[b[n+2]];q[m]=new THREE.Face3(t.index,r.index,s.index,[t.clone(),r.clone(),s.clone()])}for(var u=new THREE.Vector3,n=0,p=q.length;n<p;n++)g(q[n],d);n=0;for(p=this.faceVertexUvs[0].length;n<
+p;n++)b=this.faceVertexUvs[0][n],d=b[0].x,a=b[1].x,q=b[2].x,m=Math.max(d,Math.max(a,q)),t=Math.min(d,Math.min(a,q)),.9<m&&.1>t&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));n=0;for(p=this.vertices.length;n<p;n++)this.vertices[n].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,n,p=b+1;for(g=0;g<=c;g++)for(n=g/c,h=0;h<=b;h++)k=h/b,k=a(k,n),d.push(k);var q,m,r,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*p+h,d=g*p+h+1,n=(g+1)*p+h+1,k=(g+1)*p+h,q=new THREE.Vector2(h/b,g/c),m=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([q,m,t]),e.push(new THREE.Face3(d,n,k)),f.push([m.clone(),r,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
+THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,n,p=b+1;for(g=0;g<=c;g++)for(n=g/c,h=0;h<=b;h++)k=h/b,k=a(k,n),d.push(k);var q,m,t,r;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*p+h,d=g*p+h+1,n=(g+1)*p+h+1,k=(g+1)*p+h,q=new THREE.Vector2(h/b,g/c),m=new THREE.Vector2((h+1)/b,g/c),t=new THREE.Vector2((h+1)/b,(g+1)/c),r=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,
+d,k)),f.push([q,m,r]),e.push(new THREE.Face3(d,n,k)),f.push([m.clone(),t,r.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
 THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry;a.addAttribute("position",new THREE.BufferAttribute(b,3));a.addAttribute("color",new THREE.BufferAttribute(c,3));b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,a,b,THREE.LinePieces)};THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.AxisHelper.prototype.constructor=THREE.AxisHelper;
 THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0));return function(c,d,e,f,g,h){THREE.Object3D.call(this);void 0===f&&(f=16776960);void 0===e&&(e=1);void 0===g&&(g=.2*e);void 0===h&&(h=.2*g);this.position.copy(d);this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f}));this.line.matrixAutoUpdate=!1;this.add(this.line);
@@ -791,7 +788,7 @@ THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=
 c=new THREE.Geometry;c.vertices.push(new THREE.Vector3,new THREE.Vector3);d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(c,d);this.add(this.targetLine);this.update()};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper;
 THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};
 THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(c);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();
-THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var n=k.vertices,k=k.faces,p=0,q=0,m=k.length;q<m;q++)for(var r=k[q],t=0;3>t;t++){d[0]=r[g[t]];d[1]=r[g[(t+1)%3]];d.sort(f);var s=d.toString();void 0===e[s]?(e[s]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},p++):e[s].face2=q}d=new Float32Array(6*p);f=0;for(s in e)if(g=e[s],void 0===g.face2||
+THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var n=k.vertices,k=k.faces,p=0,q=0,m=k.length;q<m;q++)for(var t=k[q],r=0;3>r;r++){d[0]=t[g[r]];d[1]=t[g[(r+1)%3]];d.sort(f);var s=d.toString();void 0===e[s]?(e[s]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},p++):e[s].face2=q}d=new Float32Array(6*p);f=0;for(s in e)if(g=e[s],void 0===g.face2||
 .9999>k[g.face1].normal.dot(k[g.face2].normal))p=n[g.vert1],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z,p=n[g.vert2],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3));THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper;
 THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper;
@@ -811,15 +808,15 @@ THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper;THREE.SpotLigh
 THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1E4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();
 THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:16711680;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexNormals.length;g<h;g++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper;
-THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,n=f.length;k<n;k++)for(var p=f[k],q=0,m=p.vertexNormals.length;q<m;q++){var r=p.vertexNormals[q];d[h].copy(e[p[a[q]]]).applyMatrix4(g);b.copy(r).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,n=f.length;k<n;k++)for(var p=f[k],q=0,m=p.vertexNormals.length;q<m;q++){var t=p.vertexNormals[q];d[h].copy(e[p[a[q]]]).applyMatrix4(g);b.copy(t).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
 b.add(d[h]);h+=1;d[h].copy(b);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();
 THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:255;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexTangents.length;g<h;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.update()};THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper;
-THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,n=f.length;k<n;k++)for(var p=f[k],q=0,m=p.vertexTangents.length;q<m;q++){var r=p.vertexTangents[q];d[h].copy(e[p[a[q]]]).applyMatrix4(g);b.copy(r).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,n=f.length;k<n;k++)for(var p=f[k],q=0,m=p.vertexTangents.length;q<m;q++){var t=p.vertexTangents[q];d[h].copy(e[p[a[q]]]).applyMatrix4(g);b.copy(t).transformDirection(g).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
 h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();
-THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,n=a.geometry.faces,p=0,q=new Uint32Array(6*n.length),m=0,r=n.length;m<r;m++)for(var t=n[m],s=0;3>s;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var u=d.toString();void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++)}d=new Float32Array(6*p);m=0;for(r=p;m<r;m++)for(s=0;2>s;s++)p=
-k[q[2*m+s]],g=6*m+3*s,d[g+0]=p.x,d[g+1]=p.y,d[g+2]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){k=a.geometry.attributes.position.array;r=a.geometry.attributes.index.array;n=a.geometry.drawcalls;p=0;0===n.length&&(n=[{count:r.length,index:0,start:0}]);for(var q=new Uint32Array(2*r.length),t=0,v=n.length;t<v;++t)for(var s=n[t].start,u=n[t].count,g=n[t].index,m=s,x=s+u;m<x;m+=3)for(s=0;3>s;s++)d[0]=
-g+r[m+s],d[1]=g+r[m+(s+1)%3],d.sort(f),u=d.toString(),void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++);d=new Float32Array(6*p);m=0;for(r=p;m<r;m++)for(s=0;2>s;s++)g=6*m+3*s,p=3*q[2*m+s],d[g+0]=k[p],d[g+1]=k[p+1],d[g+2]=k[p+2]}else for(k=a.geometry.attributes.position.array,p=k.length/3,q=p/3,d=new Float32Array(6*p),m=0,r=q;m<r;m++)for(s=0;3>s;s++)g=18*m+6*s,q=9*m+3*s,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],p=9*m+(s+1)%3*3,d[g+3]=k[p],d[g+4]=k[p+1],d[g+5]=k[p+2];h.addAttribute("position",new THREE.BufferAttribute(d,
+THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,n=a.geometry.faces,p=0,q=new Uint32Array(6*n.length),m=0,t=n.length;m<t;m++)for(var r=n[m],s=0;3>s;s++){d[0]=r[g[s]];d[1]=r[g[(s+1)%3]];d.sort(f);var u=d.toString();void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++)}d=new Float32Array(6*p);m=0;for(t=p;m<t;m++)for(s=0;2>s;s++)p=
+k[q[2*m+s]],g=6*m+3*s,d[g+0]=p.x,d[g+1]=p.y,d[g+2]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){k=a.geometry.attributes.position.array;t=a.geometry.attributes.index.array;n=a.geometry.drawcalls;p=0;0===n.length&&(n=[{count:t.length,index:0,start:0}]);for(var q=new Uint32Array(2*t.length),r=0,v=n.length;r<v;++r)for(var s=n[r].start,u=n[r].count,g=n[r].index,m=s,x=s+u;m<x;m+=3)for(s=0;3>s;s++)d[0]=
+g+t[m+s],d[1]=g+t[m+(s+1)%3],d.sort(f),u=d.toString(),void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++);d=new Float32Array(6*p);m=0;for(t=p;m<t;m++)for(s=0;2>s;s++)g=6*m+3*s,p=3*q[2*m+s],d[g+0]=k[p],d[g+1]=k[p+1],d[g+2]=k[p+2]}else for(k=a.geometry.attributes.position.array,p=k.length/3,q=p/3,d=new Float32Array(6*p),m=0,t=q;m<t;m++)for(s=0;3>s;s++)g=18*m+6*s,q=9*m+3*s,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],p=9*m+(s+1)%3*3,d[g+3]=k[p],d[g+4]=k[p+1],d[g+5]=k[p+2];h.addAttribute("position",new THREE.BufferAttribute(d,
 3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper;THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;
 THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh;
 THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=b;this.animationsList.push(b)};