Browse Source

Updated builds.

Mr.doob 10 years ago
parent
commit
b6ae9bdf11
2 changed files with 223 additions and 230 deletions
  1. 31 38
      build/three.js
  2. 192 192
      build/three.min.js

+ 31 - 38
build/three.js

@@ -10339,9 +10339,7 @@ THREE.DirectGeometry = function () {
 	this.uvs2 = [];
 	this.uvs2 = [];
 	this.tangents = [];
 	this.tangents = [];
 
 
-	this.morphTargets = [];
-	this.morphColors = [];
-	this.morphNormals = [];
+	this.morphTargets = { position: [], normal: [] };
 
 
 	this.skinWeights = [];
 	this.skinWeights = [];
 	this.skinIndices = [];
 	this.skinIndices = [];
@@ -10406,27 +10404,22 @@ THREE.DirectGeometry.prototype = {
 		var morphTargets = geometry.morphTargets;
 		var morphTargets = geometry.morphTargets;
 		var morphTargetsLength = morphTargets.length;
 		var morphTargetsLength = morphTargets.length;
 
 
+		var morphTargetsPosition = this.morphTargets.position;
+
 		for ( var i = 0; i < morphTargetsLength; i ++ ) {
 		for ( var i = 0; i < morphTargetsLength; i ++ ) {
 
 
-			this.morphTargets[ i ] = [];
+			morphTargetsPosition[ i ] = [];
 
 
 		}
 		}
 
 
 		var morphNormals = geometry.morphNormals;
 		var morphNormals = geometry.morphNormals;
 		var morphNormalsLength = morphNormals.length;
 		var morphNormalsLength = morphNormals.length;
 
 
-		for ( var i = 0; i < morphNormalsLength; i ++ ) {
-
-			this.morphNormals[ i ] = [];
+		var morphTargetsNormal = this.morphTargets.normal;
 
 
-		}
-
-		var morphColors = geometry.morphColors;
-		var morphColorsLength = morphColors.length;
-
-		for ( var i = 0; i < morphColorsLength; i ++ ) {
+		for ( var i = 0; i < morphNormalsLength; i ++ ) {
 
 
-			this.morphColors[ i ] = [];
+			morphTargetsNormal[ i ] = [];
 
 
 		}
 		}
 
 
@@ -10534,27 +10527,18 @@ THREE.DirectGeometry.prototype = {
 
 
 				var morphTarget = morphTargets[ j ].vertices;
 				var morphTarget = morphTargets[ j ].vertices;
 
 
-				this.morphTargets[ j ].push( morphTarget[ face.a ], morphTarget[ face.b ], morphTarget[ face.c ] );
+				morphTargetsPosition[ j ].push( morphTarget[ face.a ], morphTarget[ face.b ], morphTarget[ face.c ] );
 
 
 			}
 			}
-			/*
+
 			for ( var j = 0; j < morphNormalsLength; j ++ ) {
 			for ( var j = 0; j < morphNormalsLength; j ++ ) {
 
 
 				var morphNormal = morphNormals[ j ].vertexNormals[ i ];
 				var morphNormal = morphNormals[ j ].vertexNormals[ i ];
 
 
-				this.morphNormals[ j ].push( morphNormal.a, morphNormal.b, morphNormal.c );
+				morphTargetsNormal[ j ].push( morphNormal.a, morphNormal.b, morphNormal.c );
 
 
 			}
 			}
 
 
-			for ( var j = 0; j < morphColorsLength; j ++ ) {
-
-				var morphColor = morphColors[ j ].colors;
-
-				this.morphColors[ j ].push( morphColor[ face.a ], morphColor[ face.b ], morphColor[ face.c ] );
-
-			}
-			*/
-
 			// skins
 			// skins
 
 
 			if ( hasSkinIndices ) {
 			if ( hasSkinIndices ) {
@@ -10609,7 +10593,7 @@ THREE.BufferGeometry = function () {
 
 
 	this.attributes = {};
 	this.attributes = {};
 
 
-	this.morphAttributes = [];
+	this.morphAttributes = {};
 
 
 	this.drawcalls = [];
 	this.drawcalls = [];
 
 
@@ -10937,9 +10921,10 @@ THREE.BufferGeometry.prototype = {
 
 
 		// morphs
 		// morphs
 
 
-		if ( geometry.morphTargets.length > 0 ) {
+		for ( var name in geometry.morphTargets ) {
 
 
-			var morphTargets = geometry.morphTargets;
+			var array = [];
+			var morphTargets = geometry.morphTargets[ name ];
 
 
 			for ( var i = 0, l = morphTargets.length; i < l; i ++ ) {
 			for ( var i = 0, l = morphTargets.length; i < l; i ++ ) {
 
 
@@ -10947,11 +10932,11 @@ THREE.BufferGeometry.prototype = {
 
 
 				var attribute = new THREE.Float32Attribute( morphTarget.length * 3, 3 );
 				var attribute = new THREE.Float32Attribute( morphTarget.length * 3, 3 );
 
 
-				this.morphAttributes.push( attribute.copyVector3sArray( morphTarget ) );
+				array.push( attribute.copyVector3sArray( morphTarget ) );
 
 
 			}
 			}
 
 
-			// TODO normals, colors
+			this.morphAttributes[ name ] = array;
 
 
 		}
 		}
 
 
@@ -20593,6 +20578,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 			}
 			}
 
 
+			var morphAttributes = geometry.morphAttributes;
+
 			for ( var i = 0, l = activeInfluences.length; i < l; i ++ ) {
 			for ( var i = 0, l = activeInfluences.length; i < l; i ++ ) {
 
 
 				var influence = activeInfluences[ i ];
 				var influence = activeInfluences[ i ];
@@ -20600,13 +20587,15 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 				if ( influence[ 0 ] !== 0 ) {
 				if ( influence[ 0 ] !== 0 ) {
 
 
-					var attribute = geometry.morphAttributes[ influence[ 1 ] ];
+					var index = influence[ 1 ];
 
 
-					geometry.addAttribute( 'morphTarget' + i, attribute );
+					if ( material.morphTargets === true ) geometry.addAttribute( 'morphTarget' + i, morphAttributes.position[ index ] );
+					if ( material.morphNormals === true ) geometry.addAttribute( 'morphNormal' + i, morphAttributes.normal[ index ] );
 
 
 				} else {
 				} else {
 
 
-					geometry.removeAttribute( 'morphTarget' + i );
+					if ( material.morphTargets === true ) geometry.removeAttribute( 'morphTarget' + i );
+					if ( material.morphNormals === true ) geometry.removeAttribute( 'morphNormal' + i );
 
 
 				}
 				}
 
 
@@ -22921,8 +22910,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 	};
 	};
 
 
-	this.setMaterialFaces = setMaterialFaces;
-
 	// Textures
 	// Textures
 
 
 	function setTextureParameters ( textureType, texture, isImagePowerOfTwo ) {
 	function setTextureParameters ( textureType, texture, isImagePowerOfTwo ) {
@@ -24194,9 +24181,15 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
 
 
 		var morphAttributes = geometry.morphAttributes;
 		var morphAttributes = geometry.morphAttributes;
 
 
-		for ( var i = 0, l = morphAttributes.length; i < l; i ++ ) {
+		for ( var name in morphAttributes ) {
+
+			var array = morphAttributes[ name ];
+
+			for ( var i = 0, l = array.length; i < l; i ++ ) {
 
 
-			updateAttribute( morphAttributes[ i ], i );
+				updateAttribute( array[ i ], i );
+
+			}
 
 
 		}
 		}
 
 

+ 192 - 192
build/three.min.js

@@ -105,15 +105,15 @@ g*h;var k=g*e,l=c*h,n=c*e;b[0]=f*h;b[4]=-f*e;b[8]=d;b[1]=k+l*d;b[5]=a-n*d;b[9]=-
 f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
 f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
 makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var l=c*h,c=c*k,n=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(n+e);b[4]=l-g;b[8]=c+h;b[1]=l+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var f=this.elements;c.subVectors(d,
 makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var l=c*h,c=c*k,n=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(n+e);b[4]=l-g;b[8]=c+h;b[1]=l+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var f=this.elements;c.subVectors(d,
 e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[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,
 e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[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,g=c[0],f=c[4],h=c[8],k=c[12],l=c[1],n=c[5],p=c[9],m=c[13],q=c[2],s=c[6],t=c[10],u=c[14],v=c[3],w=c[7],B=c[11],c=c[15],y=d[0],H=d[4],G=d[8],x=d[12],A=d[1],K=d[5],D=d[9],z=d[13],Q=d[2],E=d[6],F=d[10],C=d[14],I=d[3],M=d[7],R=d[11],d=d[15];e[0]=g*y+f*A+h*Q+k*I;e[4]=g*H+f*K+h*E+k*M;e[8]=g*G+f*D+h*F+k*R;e[12]=g*x+f*z+h*C+k*d;e[1]=l*y+n*A+p*Q+m*I;e[5]=l*H+n*K+p*E+m*M;e[9]=l*G+n*D+p*F+m*R;e[13]=l*x+n*z+p*C+m*d;e[2]=q*y+s*A+t*Q+u*I;e[6]=q*H+s*K+t*E+u*M;e[10]=q*G+s*D+t*F+u*R;e[14]=
-q*x+s*z+t*C+u*d;e[3]=v*y+w*A+B*Q+c*I;e[7]=v*H+w*K+B*E+c*M;e[11]=v*G+w*D+B*F+c*R;e[15]=v*x+w*z+B*C+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=
+d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],l=c[1],n=c[5],p=c[9],m=c[13],q=c[2],s=c[6],t=c[10],u=c[14],w=c[3],v=c[7],z=c[11],c=c[15],x=d[0],H=d[4],F=d[8],y=d[12],B=d[1],J=d[5],D=d[9],A=d[13],P=d[2],G=d[6],C=d[10],E=d[14],I=d[3],M=d[7],S=d[11],d=d[15];e[0]=g*x+f*B+h*P+k*I;e[4]=g*H+f*J+h*G+k*M;e[8]=g*F+f*D+h*C+k*S;e[12]=g*y+f*A+h*E+k*d;e[1]=l*x+n*B+p*P+m*I;e[5]=l*H+n*J+p*G+m*M;e[9]=l*F+n*D+p*C+m*S;e[13]=l*y+n*A+p*E+m*d;e[2]=q*x+s*B+t*P+u*I;e[6]=q*H+s*J+t*G+u*M;e[10]=q*F+s*D+t*C+u*S;e[14]=
+q*y+s*A+t*E+u*d;e[3]=w*x+v*B+z*P+c*I;e[7]=w*H+v*J+z*G+c*M;e[11]=w*F+v*D+z*C+c*S;e[15]=w*y+v*A+z*E+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.");
 a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
 a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],l=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*k*
 a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],l=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*k*
 n-e*f*p+c*k*p+d*f*m-c*h*m)+a[7]*(+b*h*m-b*k*p+e*g*p-d*g*m+d*k*l-e*h*l)+a[11]*(+b*k*n-b*f*m-e*g*n+c*g*m+e*f*l-c*k*l)+a[15]*(-d*f*l-b*h*n+b*f*p+d*g*n-c*g*p+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=
 n-e*f*p+c*k*p+d*f*m-c*h*m)+a[7]*(+b*h*m-b*k*p+e*g*p-d*g*m+d*k*l-e*h*l)+a[11]*(+b*k*n-b*f*m-e*g*n+c*g*m+e*f*l-c*k*l)+a[15]*(-d*f*l-b*h*n+b*f*p+d*g*n-c*g*p+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=
 c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a;return function(){void 0===a&&(a=new THREE.Vector3);console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=
 c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a;return function(){void 0===a&&(a=new THREE.Vector3);console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=
-this.elements,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[12],k=d[1],l=d[5],n=d[9],p=d[13],m=d[2],q=d[6],s=d[10],t=d[14],u=d[3],v=d[7],w=d[11],d=d[15];c[0]=n*t*v-p*s*v+p*q*w-l*t*w-n*q*d+l*s*d;c[4]=h*s*v-f*t*v-h*q*w+g*t*w+f*q*d-g*s*d;c[8]=f*p*v-h*n*v+h*l*w-g*p*w-f*l*d+g*n*d;c[12]=h*n*q-f*p*q-h*l*s+g*p*s+f*l*t-g*n*t;c[1]=p*s*u-n*t*u-p*m*w+k*t*w+n*m*d-k*s*d;c[5]=f*t*u-h*s*u+h*m*w-e*t*w-f*m*d+e*s*d;c[9]=h*n*u-f*p*u-h*k*w+e*p*w+f*k*d-e*n*d;c[13]=f*p*m-h*n*m+h*k*s-e*p*s-f*k*t+e*n*t;c[2]=l*t*u-p*q*u+p*m*v-k*t*
-v-l*m*d+k*q*d;c[6]=h*q*u-g*t*u-h*m*v+e*t*v+g*m*d-e*q*d;c[10]=g*p*u-h*l*u+h*k*v-e*p*v-g*k*d+e*l*d;c[14]=h*l*m-g*p*m-h*k*q+e*p*q+g*k*t-e*l*t;c[3]=n*q*u-l*s*u-n*m*v+k*s*v+l*m*w-k*q*w;c[7]=g*s*u-f*q*u+f*m*v-e*s*v-g*m*w+e*q*w;c[11]=f*l*u-g*n*u-f*k*v+e*n*v+g*k*w-e*l*w;c[15]=g*n*m-f*l*m+f*k*q-e*n*q-g*k*s+e*l*s;c=e*c[0]+k*c[4]+m*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
+this.elements,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[12],k=d[1],l=d[5],n=d[9],p=d[13],m=d[2],q=d[6],s=d[10],t=d[14],u=d[3],w=d[7],v=d[11],d=d[15];c[0]=n*t*w-p*s*w+p*q*v-l*t*v-n*q*d+l*s*d;c[4]=h*s*w-f*t*w-h*q*v+g*t*v+f*q*d-g*s*d;c[8]=f*p*w-h*n*w+h*l*v-g*p*v-f*l*d+g*n*d;c[12]=h*n*q-f*p*q-h*l*s+g*p*s+f*l*t-g*n*t;c[1]=p*s*u-n*t*u-p*m*v+k*t*v+n*m*d-k*s*d;c[5]=f*t*u-h*s*u+h*m*v-e*t*v-f*m*d+e*s*d;c[9]=h*n*u-f*p*u-h*k*v+e*p*v+f*k*d-e*n*d;c[13]=f*p*m-h*n*m+h*k*s-e*p*s-f*k*t+e*n*t;c[2]=l*t*u-p*q*u+p*m*w-k*t*
+w-l*m*d+k*q*d;c[6]=h*q*u-g*t*u-h*m*w+e*t*w+g*m*d-e*q*d;c[10]=g*p*u-h*l*u+h*k*w-e*p*w-g*k*d+e*l*d;c[14]=h*l*m-g*p*m-h*k*q+e*p*q+g*k*t-e*l*t;c[3]=n*q*u-l*s*u-n*m*w+k*s*w+l*m*v-k*q*v;c[7]=g*s*u-f*q*u+f*m*w-e*s*w-g*m*v+e*q*v;c[11]=f*l*u-g*n*u-f*k*w+e*n*w+g*k*v-e*l*v;c[15]=g*n*m-f*l*m+f*k*q-e*n*q-g*k*s+e*l*s;c=e*c[0]+k*c[4]+m*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
 this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(a,b){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=
 this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(a,b){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=
 this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,
 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,g=a.x,f=a.y,h=a.z,k=e*g,l=e*f;this.set(k*g+c,k*f-d*h,k*h+d*f,0,k*f+d*h,l*f+c,l*h-d*g,0,k*h-d*f,l*h+d*g,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,
 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,g=a.x,f=a.y,h=a.z,k=e*g,l=e*f;this.set(k*g+c,k*f-d*h,k*h+d*f,0,k*f+d*h,l*f+c,l*h-d*g,0,k*h-d*f,l*h+d*g,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,
@@ -148,7 +148,7 @@ THREE.Math={generateUUID:function(){var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZa
 180;return function(b){return b*a}}(),radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},nextPowerOfTwo:function(a){a--;a|=a>>1;a|=a>>2;a|=a>>4;a|=a>>8;a|=a>>16;a++;return a}};
 180;return function(b){return b*a}}(),radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},nextPowerOfTwo:function(a){a--;a|=a>>1;a|=a>>2;a|=a>>4;a|=a>>8;a|=a>>16;a++;return a}};
 THREE.Spline=function(a){function b(a,b,c,d,e,g,f){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,h,k,l,n,p,m;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;g=Math.floor(e);f=e-g;c[0]=0===g?g:g-1;c[1]=g;c[2]=g>this.points.length-2?this.points.length-1:g+1;c[3]=g>this.points.length-3?this.points.length-1:g+
 THREE.Spline=function(a){function b(a,b,c,d,e,g,f){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,h,k,l,n,p,m;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;g=Math.floor(e);f=e-g;c[0]=0===g?g:g-1;c[1]=g;c[2]=g>this.points.length-2?this.points.length-1:g+1;c[3]=g>this.points.length-3?this.points.length-1:g+
 2;l=this.points[c[0]];n=this.points[c[1]];p=this.points[c[2]];m=this.points[c[3]];h=f*f;k=f*h;d.x=b(l.x,n.x,p.x,m.x,f,h,k);d.y=b(l.y,n.y,p.y,m.y,f,h,k);d.z=b(l.z,n.z,p.z,m.z,f,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,g=new THREE.Vector3,f=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;g.copy(this.points[0]);for(a=1;a<c;a++)b=
 2;l=this.points[c[0]];n=this.points[c[1]];p=this.points[c[2]];m=this.points[c[3]];h=f*f;k=f*h;d.x=b(l.x,n.x,p.x,m.x,f,h,k);d.y=b(l.y,n.y,p.y,m.y,f,h,k);d.z=b(l.z,n.z,p.z,m.z,f,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,g=new THREE.Vector3,f=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;g.copy(this.points[0]);for(a=1;a<c;a++)b=
-a/c,d=this.getPoint(b),f.copy(d),k+=f.distanceTo(g),g.copy(d),b*=this.points.length-1,b=Math.floor(b),b!==e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,g,f,h=[],k=new THREE.Vector3,l=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=l.chunks[b]-l.chunks[b-1];f=Math.ceil(a*c/l.total);e=(b-1)/(this.points.length-1);g=b/(this.points.length-1);for(c=1;c<f-1;c++)d=e+1/f*c*(g-e),d=this.getPoint(d),
+a/c,d=this.getPoint(b),f.copy(d),k+=f.distanceTo(g),g.copy(d),b*=this.points.length-1,b=Math.floor(b),b!==e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,g,f,h=[],k=new THREE.Vector3,m=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=m.chunks[b]-m.chunks[b-1];f=Math.ceil(a*c/m.total);e=(b-1)/(this.points.length-1);g=b/(this.points.length-1);for(c=1;c<f-1;c++)d=e+1/f*c*(g-e),d=this.getPoint(d),
 h.push(k.copy(d).clone());h.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();
 h.push(k.copy(d).clone());h.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();
 THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,g,f,h){a.subVectors(f,e);b.subVectors(g,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);g=a.dot(c);var k=b.dot(b);f=b.dot(c);var l=d*k-e*e;h=h||new THREE.Vector3;if(0===l)return h.set(-2,-1,-1);l=1/l;k=(k*g-e*f)*l;d=(d*f-e*g)*l;return h.set(1-k-d,d,k)}}();
 THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,g,f,h){a.subVectors(f,e);b.subVectors(g,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);g=a.dot(c);var k=b.dot(b);f=b.dot(c);var l=d*k-e*e;h=h||new THREE.Vector3;if(0===l)return h.set(-2,-1,-1);l=1/l;k=(k*g-e*f)*l;d=(d*f-e*g)*l;return h.set(1-k-d,d,k)}}();
 THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}();
 THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}();
@@ -201,32 +201,32 @@ this.elementsNeedUpdate=this.verticesNeedUpdate=this.hasTangents=!1};
 THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,g=a.vertexNormals.length;e<g;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=
 THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,g=a.vertexNormals.length;e<g;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=
 this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,g=void 0!==c.normal?c.normal.array:void 0,f=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=void 0!==c.uv2?c.uv2.array:void 0,l=void 0!==c.tangent?c.tangent.array:void 0;void 0!==k&&(this.faceVertexUvs[1]=[]);void 0!==l&&(this.hasTangents=!0);for(var n=[],p=[],m=[],q=[],s=c=0,t=0;c<d.length;c+=3,s+=2,t+=4)b.vertices.push(new THREE.Vector3(d[c],
 this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,g=void 0!==c.normal?c.normal.array:void 0,f=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=void 0!==c.uv2?c.uv2.array:void 0,l=void 0!==c.tangent?c.tangent.array:void 0;void 0!==k&&(this.faceVertexUvs[1]=[]);void 0!==l&&(this.hasTangents=!0);for(var n=[],p=[],m=[],q=[],s=c=0,t=0;c<d.length;c+=3,s+=2,t+=4)b.vertices.push(new THREE.Vector3(d[c],
 d[c+1],d[c+2])),void 0!==g&&n.push(new THREE.Vector3(g[c],g[c+1],g[c+2])),void 0!==f&&b.colors.push(new THREE.Color(f[c],f[c+1],f[c+2])),void 0!==h&&p.push(new THREE.Vector2(h[s],h[s+1])),void 0!==k&&m.push(new THREE.Vector2(k[s],k[s+1])),void 0!==l&&q.push(new THREE.Vector4(l[t],l[t+1],l[t+2],l[t+3]));t=function(a,c,d){var e=void 0!==g?[n[a].clone(),n[c].clone(),n[d].clone()]:[],s=void 0!==f?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[],e=new THREE.Face3(a,c,d,e,s);b.faces.push(e);
 d[c+1],d[c+2])),void 0!==g&&n.push(new THREE.Vector3(g[c],g[c+1],g[c+2])),void 0!==f&&b.colors.push(new THREE.Color(f[c],f[c+1],f[c+2])),void 0!==h&&p.push(new THREE.Vector2(h[s],h[s+1])),void 0!==k&&m.push(new THREE.Vector2(k[s],k[s+1])),void 0!==l&&q.push(new THREE.Vector4(l[t],l[t+1],l[t+2],l[t+3]));t=function(a,c,d){var e=void 0!==g?[n[a].clone(),n[c].clone(),n[d].clone()]:[],s=void 0!==f?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[],e=new THREE.Face3(a,c,d,e,s);b.faces.push(e);
-void 0!==h&&b.faceVertexUvs[0].push([p[a].clone(),p[c].clone(),p[d].clone()]);void 0!==k&&b.faceVertexUvs[1].push([m[a].clone(),m[c].clone(),m[d].clone()]);void 0!==l&&e.vertexTangents.push(q[a].clone(),q[c].clone(),q[d].clone())};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var s=d[c],u=s.start,v=s.count,w=s.index,s=u,u=u+v;s<u;s+=3)t(w+e[s],w+e[s+1],w+e[s+2]);else for(c=0;c<e.length;c+=3)t(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)t(c,c+1,c+2);this.computeFaceNormals();
+void 0!==h&&b.faceVertexUvs[0].push([p[a].clone(),p[c].clone(),p[d].clone()]);void 0!==k&&b.faceVertexUvs[1].push([m[a].clone(),m[c].clone(),m[d].clone()]);void 0!==l&&e.vertexTangents.push(q[a].clone(),q[c].clone(),q[d].clone())};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var s=d[c],u=s.start,w=s.count,v=s.index,s=u,u=u+w;s<u;s+=3)t(v+e[s],v+e[s+1],v+e[s+2]);else for(c=0;c<e.length;c+=3)t(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)t(c,c+1,c+2);this.computeFaceNormals();
 null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},normalize:function(){this.computeBoundingSphere();var a=this.boundingSphere.center,b=this.boundingSphere.radius,b=0===b?1:1/b,c=new THREE.Matrix4;c.set(b,0,0,-b*a.x,0,b,0,-b*a.y,0,0,b,-b*a.z,0,0,0,1);this.applyMatrix(c);
 null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},normalize:function(){this.computeBoundingSphere();var a=this.boundingSphere.center,b=this.boundingSphere.radius,b=0===b?1:1/b,c=new THREE.Matrix4;c.set(b,0,0,-b*a.x,0,b,0,-b*a.y,0,0,b,-b*a.z,0,0,0,1);this.applyMatrix(c);
 return this},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],g=this.vertices[e.a],f=this.vertices[e.b];a.subVectors(this.vertices[e.c],f);b.subVectors(g,f);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,g,f,h=new THREE.Vector3,k=new THREE.Vector3;a=0;for(b=this.faces.length;a<
 return this},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],g=this.vertices[e.a],f=this.vertices[e.b];a.subVectors(this.vertices[e.c],f);b.subVectors(g,f);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,g,f,h=new THREE.Vector3,k=new THREE.Vector3;a=0;for(b=this.faces.length;a<
 b;a++)c=this.faces[a],e=this.vertices[c.a],g=this.vertices[c.b],f=this.vertices[c.c],h.subVectors(f,g),k.subVectors(e,g),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=c.vertexNormals,3===e.length?(e[0].copy(d[c.a]),e[1].copy(d[c.b]),e[2].copy(d[c.c])):(e[0]=d[c.a].clone(),
 b;a++)c=this.faces[a],e=this.vertices[c.a],g=this.vertices[c.b],f=this.vertices[c.c],h.subVectors(f,g),k.subVectors(e,g),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=c.vertexNormals,3===e.length?(e[0].copy(d[c.a]),e[1].copy(d[c.b]),e[2].copy(d[c.c])):(e[0]=d[c.a].clone(),
 e[1]=d[c.b].clone(),e[2]=d[c.c].clone())},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var g=new THREE.Geometry;
 e[1]=d[c.b].clone(),e[2]=d[c.c].clone())},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var g=new THREE.Geometry;
 g.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 f=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),f.push(k)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();g.computeVertexNormals();
 g.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 f=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),f.push(k)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();g.computeVertexNormals();
-c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.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,g,f,h,k,l,n,p,m,q,s,t,u,v=[],w=[];c=new THREE.Vector3;var B=new THREE.Vector3,y=new THREE.Vector3,H=new THREE.Vector3,G=new THREE.Vector3;
-a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,w[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,f=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=g[0],n=g[1],p=g[2],g=h.x-f.x,m=k.x-f.x,q=h.y-f.y,s=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=n.x-l.x,t=p.x-l.x,n=n.y-l.y,l=p.y-l.y,p=1/(k*l-t*n),c.set((l*g-n*m)*p,(l*q-n*s)*p,(l*h-n*f)*p),B.set((k*m-t*g)*p,(k*s-t*q)*p,(k*f-t*h)*p),v[d].add(c),v[u].add(c),v[e].add(c),w[d].add(B),
-w[u].add(B),w[e].add(B);B=["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++)G.copy(e.vertexNormals[c]),d=e[B[c]],u=v[d],y.copy(u),y.sub(G.multiplyScalar(G.dot(u))).normalize(),H.crossVectors(e.vertexNormals[c],u),d=H.dot(w[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(y.x,y.y,y.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=
+c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.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,g,f,h,k,l,n,p,m,q,s,t,u,w=[],v=[];c=new THREE.Vector3;var z=new THREE.Vector3,x=new THREE.Vector3,H=new THREE.Vector3,F=new THREE.Vector3;
+a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,v[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,f=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=g[0],n=g[1],p=g[2],g=h.x-f.x,m=k.x-f.x,q=h.y-f.y,s=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=n.x-l.x,t=p.x-l.x,n=n.y-l.y,l=p.y-l.y,p=1/(k*l-t*n),c.set((l*g-n*m)*p,(l*q-n*s)*p,(l*h-n*f)*p),z.set((k*m-t*g)*p,(k*s-t*q)*p,(k*f-t*h)*p),w[d].add(c),w[u].add(c),w[e].add(c),v[d].add(z),
+v[u].add(z),v[e].add(z);z=["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++)F.copy(e.vertexNormals[c]),d=e[z[c]],u=w[d],x.copy(u),x.sub(F.multiplyScalar(F.dot(u))).normalize(),H.crossVectors(e.vertexNormals[c],u),d=H.dot(v[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,x.y,x.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,g=this.vertices,f=a.vertices,h=this.faces,
 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,g=this.vertices,f=a.vertices,h=this.faces,
 k=a.faces,l=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,p=f.length;n<p;n++){var m=f[n].clone();void 0!==b&&m.applyMatrix4(b);g.push(m)}n=0;for(p=k.length;n<p;n++){var f=k[n],q,s=f.vertexNormals,t=f.vertexColors,m=new THREE.Face3(f.a+e,f.b+e,f.c+e);m.normal.copy(f.normal);void 0!==d&&m.normal.applyMatrix3(d).normalize();b=0;for(g=s.length;b<g;b++)q=s[b].clone(),void 0!==d&&q.applyMatrix3(d).normalize(),m.vertexNormals.push(q);
 k=a.faces,l=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,p=f.length;n<p;n++){var m=f[n].clone();void 0!==b&&m.applyMatrix4(b);g.push(m)}n=0;for(p=k.length;n<p;n++){var f=k[n],q,s=f.vertexNormals,t=f.vertexColors,m=new THREE.Face3(f.a+e,f.b+e,f.c+e);m.normal.copy(f.normal);void 0!==d&&m.normal.applyMatrix3(d).normalize();b=0;for(g=s.length;b<g;b++)q=s[b].clone(),void 0!==d&&q.applyMatrix3(d).normalize(),m.vertexNormals.push(q);
 m.color.copy(f.color);b=0;for(g=t.length;b<g;b++)q=t[b],m.vertexColors.push(q.clone());m.materialIndex=f.materialIndex+c;h.push(m)}n=0;for(p=a.length;n<p;n++)if(c=a[n],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(c[b].clone());l.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,
 m.color.copy(f.color);b=0;for(g=t.length;b<g;b++)q=t[b],m.vertexColors.push(q.clone());m.materialIndex=f.materialIndex+c;h.push(m)}n=0;for(p=a.length;n<p;n++)if(c=a[n],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(c[b].clone());l.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),g,f;g=0;for(f=this.vertices.length;g<f;g++)d=this.vertices[g],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[d]];a=[];g=0;for(f=this.faces.length;g<f;g++)for(e=this.faces[g],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(g);break}for(g=a.length-1;0<=g;g--)for(e=a[g],this.faces.splice(e,1),c=0,f=this.faceVertexUvs.length;c<f;c++)this.faceVertexUvs[c].splice(e,1);g=
 4),g,f;g=0;for(f=this.vertices.length;g<f;g++)d=this.vertices[g],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[d]];a=[];g=0;for(f=this.faces.length;g<f;g++)for(e=this.faces[g],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(g);break}for(g=a.length-1;0<=g;g--)for(e=a[g],this.faces.splice(e,1),c=0,f=this.faceVertexUvs.length;c<f;c++)this.faceVertexUvs[c].splice(e,1);g=
 this.vertices.length-b.length;this.vertices=b;return g},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==l[b])return l[b];l[b]=k.length/3;k.push(a.x,a.y,a.z);return l[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=n.length;n.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=m.length/2;m.push(a.x,
 this.vertices.length-b.length;this.vertices=b;return g},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==l[b])return l[b];l[b]=k.length/3;k.push(a.x,a.y,a.z);return l[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=n.length;n.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=m.length/2;m.push(a.x,
-a.y);return q[b]}var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],l={},n=[],p={},m=[],q={};for(f=0;f<this.faces.length;f++){var s=this.faces[f],t=void 0!==this.faceVertexUvs[0][f],u=0<s.normal.length(),v=0<s.vertexNormals.length,
-w=1!==s.color.r||1!==s.color.g||1!==s.color.b,B=0<s.vertexColors.length,y=0,y=a(y,0,0),y=a(y,1,!1),y=a(y,2,!1),y=a(y,3,t),y=a(y,4,u),y=a(y,5,v),y=a(y,6,w),y=a(y,7,B);h.push(y);h.push(s.a,s.b,s.c);t&&(t=this.faceVertexUvs[0][f],h.push(d(t[0]),d(t[1]),d(t[2])));u&&h.push(b(s.normal));v&&(u=s.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));w&&h.push(c(s.color));B&&(s=s.vertexColors,h.push(c(s[0]),c(s[1]),c(s[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<n.length&&(e.data.colors=n);0<m.length&&
+a.y);return q[b]}var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],l={},n=[],p={},m=[],q={};for(f=0;f<this.faces.length;f++){var s=this.faces[f],t=void 0!==this.faceVertexUvs[0][f],u=0<s.normal.length(),w=0<s.vertexNormals.length,
+v=1!==s.color.r||1!==s.color.g||1!==s.color.b,z=0<s.vertexColors.length,x=0,x=a(x,0,0),x=a(x,1,!1),x=a(x,2,!1),x=a(x,3,t),x=a(x,4,u),x=a(x,5,w),x=a(x,6,v),x=a(x,7,z);h.push(x);h.push(s.a,s.b,s.c);t&&(t=this.faceVertexUvs[0][f],h.push(d(t[0]),d(t[1]),d(t[2])));u&&h.push(b(s.normal));w&&(u=s.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));v&&h.push(c(s.color));z&&(s=s.vertexColors,h.push(c(s[0]),c(s[1]),c(s[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<n.length&&(e.data.colors=n);0<m.length&&
 (e.data.uvs=[m]);e.data.faces=h;return e},clone:function(){return(new THREE.Geometry).copy(this)},copy:function(a){this.vertices=[];this.faces=[];this.faceVertexUvs=[[]];for(var b=a.vertices,c=0,d=b.length;c<d;c++)this.vertices.push(b[c].clone());b=a.faces;c=0;for(d=b.length;c<d;c++)this.faces.push(b[c].clone());c=0;for(d=a.faceVertexUvs.length;c<d;c++){b=a.faceVertexUvs[c];void 0===this.faceVertexUvs[c]&&(this.faceVertexUvs[c]=[]);for(var e=0,g=b.length;e<g;e++){for(var f=b[e],h=[],k=0,l=f.length;k<
 (e.data.uvs=[m]);e.data.faces=h;return e},clone:function(){return(new THREE.Geometry).copy(this)},copy:function(a){this.vertices=[];this.faces=[];this.faceVertexUvs=[[]];for(var b=a.vertices,c=0,d=b.length;c<d;c++)this.vertices.push(b[c].clone());b=a.faces;c=0;for(d=b.length;c<d;c++)this.faces.push(b[c].clone());c=0;for(d=a.faceVertexUvs.length;c<d;c++){b=a.faceVertexUvs[c];void 0===this.faceVertexUvs[c]&&(this.faceVertexUvs[c]=[]);for(var e=0,g=b.length;e<g;e++){for(var f=b[e],h=[],k=0,l=f.length;k<
 l;k++)h.push(f[k].clone());this.faceVertexUvs[c].push(h)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})},set groupsNeedUpdate(a){!0===a&&this.dispose()}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;
 l;k++)h.push(f[k].clone());this.faceVertexUvs[c].push(h)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})},set groupsNeedUpdate(a){!0===a&&this.dispose()}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;
-THREE.DirectGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="DirectGeometry";this.indices=[];this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.tangents=[];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.tangentsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=
-this.verticesNeedUpdate=!1};
-THREE.DirectGeometry.prototype={constructor:THREE.DirectGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.");return this},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.");return this},computeTangents:function(){console.warn("THREE.DirectGeometry: computeTangents() is not a method of this type of geometry.");
-return this},fromGeometry:function(a){for(var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,g=d[1]&&0<d[1].length,f=a.hasTangents,h=a.morphTargets,k=h.length,l=0;l<k;l++)this.morphTargets[l]=[];for(var n=a.morphNormals.length,l=0;l<n;l++)this.morphNormals[l]=[];n=a.morphColors.length;for(l=0;l<n;l++)this.morphColors[l]=[];for(var n=a.skinIndices,p=a.skinWeights,m=n.length===c.length,q=p.length===c.length,l=0;l<b.length;l++){var s=b[l];this.vertices.push(c[s.a],c[s.b],c[s.c]);var t=
-s.vertexNormals;3===t.length?this.normals.push(t[0],t[1],t[2]):(t=s.normal,this.normals.push(t,t,t));t=s.vertexColors;3===t.length?this.colors.push(t[0],t[1],t[2]):(t=s.color,this.colors.push(t,t,t));!0===e&&(t=d[0][l],void 0!==t?this.uvs.push(t[0],t[1],t[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===g&&(t=d[1][l],void 0!==t?this.uvs2.push(t[0],t[1],t[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",
-l),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===f&&(t=s.vertexTangents,3===t.length?this.tangents.push(t[0],t[1],t[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",l),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(t=0;t<k;t++){var u=h[t].vertices;this.morphTargets[t].push(u[s.a],u[s.b],u[s.c])}m&&this.skinIndices.push(n[s.a],n[s.b],n[s.c]);q&&this.skinWeights.push(p[s.a],p[s.b],p[s.c])}this.verticesNeedUpdate=
+THREE.DirectGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="DirectGeometry";this.indices=[];this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.tangents=[];this.morphTargets={position:[],normal:[]};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.tangentsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=
+!1};
+THREE.DirectGeometry.prototype={constructor:THREE.DirectGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.");return this},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.");return this},computeTangents:function(){console.warn("THREE.DirectGeometry: computeTangents() is not a method of this type of geometry.");return this},
+fromGeometry:function(a){for(var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,g=d[1]&&0<d[1].length,f=a.hasTangents,h=a.morphTargets,k=h.length,l=this.morphTargets.position,n=0;n<k;n++)l[n]=[];for(var p=a.morphNormals,m=p.length,q=this.morphTargets.normal,n=0;n<m;n++)q[n]=[];for(var s=a.skinIndices,t=a.skinWeights,u=s.length===c.length,w=t.length===c.length,n=0;n<b.length;n++){var v=b[n];this.vertices.push(c[v.a],c[v.b],c[v.c]);var z=v.vertexNormals;3===z.length?this.normals.push(z[0],
+z[1],z[2]):(z=v.normal,this.normals.push(z,z,z));z=v.vertexColors;3===z.length?this.colors.push(z[0],z[1],z[2]):(z=v.color,this.colors.push(z,z,z));!0===e&&(z=d[0][n],void 0!==z?this.uvs.push(z[0],z[1],z[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",n),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===g&&(z=d[1][n],void 0!==z?this.uvs2.push(z[0],z[1],z[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",n),this.uvs2.push(new THREE.Vector2,
+new THREE.Vector2,new THREE.Vector2)));!0===f&&(z=v.vertexTangents,3===z.length?this.tangents.push(z[0],z[1],z[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",n),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(z=0;z<k;z++){var x=h[z].vertices;l[z].push(x[v.a],x[v.b],x[v.c])}for(z=0;z<m;z++)x=p[z].vertexNormals[n],q[z].push(x.a,x.b,x.c);u&&this.skinIndices.push(s[v.a],s[v.b],s[v.c]);w&&this.skinWeights.push(t[v.a],t[v.b],t[v.c])}this.verticesNeedUpdate=
 a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.tangentsNeedUpdate=a.tangentsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);
 a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.tangentsNeedUpdate=a.tangentsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);
-THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.morphAttributes=[];this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
+THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.morphAttributes={};this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a]},get offsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .drawcalls.");
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a]},get offsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .drawcalls.");
 return this.drawcalls},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},clearDrawCalls:function(){this.drawcalls=[]},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere()},
 return this.drawcalls},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},clearDrawCalls:function(){this.drawcalls=[]},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere()},
 center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},setFromObject:function(a){var b=a.geometry;if(a instanceof THREE.PointCloud||a instanceof THREE.Line){a=new THREE.Float32Attribute(3*b.vertices.length,3);var c=new THREE.Float32Attribute(3*b.colors.length,3);this.addAttribute("position",a.copyVector3sArray(b.vertices));this.addAttribute("color",c.copyColorsArray(b.colors));b.lineDistances&&b.lineDistances.length===
 center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},setFromObject:function(a){var b=a.geometry;if(a instanceof THREE.PointCloud||a instanceof THREE.Line){a=new THREE.Float32Attribute(3*b.vertices.length,3);var c=new THREE.Float32Attribute(3*b.colors.length,3);this.addAttribute("position",a.copyVector3sArray(b.vertices));this.addAttribute("color",c.copyColorsArray(b.colors));b.lineDistances&&b.lineDistances.length===
@@ -235,16 +235,16 @@ a.verticesNeedUpdate=b.verticesNeedUpdate;a.normalsNeedUpdate=b.normalsNeedUpdat
 void 0!==a&&(a.copyVector3sArray(b.normals),a.needsUpdate=!0),b.normalsNeedUpdate=!1);!0===b.colorsNeedUpdate&&(a=this.attributes.color,void 0!==a&&(a.copyColorsArray(b.colors),a.needsUpdate=!0),b.colorsNeedUpdate=!1);!0===b.tangentsNeedUpdate&&(a=this.attributes.tangent,void 0!==a&&(a.copyVector4sArray(b.tangents),a.needsUpdate=!0),b.tangentsNeedUpdate=!1);b.lineDistancesNeedUpdate&&(a=this.attributes.lineDistance,void 0!==a&&(a.copyArray(b.lineDistances),a.needsUpdate=!0),b.lineDistancesNeedUpdate=
 void 0!==a&&(a.copyVector3sArray(b.normals),a.needsUpdate=!0),b.normalsNeedUpdate=!1);!0===b.colorsNeedUpdate&&(a=this.attributes.color,void 0!==a&&(a.copyColorsArray(b.colors),a.needsUpdate=!0),b.colorsNeedUpdate=!1);!0===b.tangentsNeedUpdate&&(a=this.attributes.tangent,void 0!==a&&(a.copyVector4sArray(b.tangents),a.needsUpdate=!0),b.tangentsNeedUpdate=!1);b.lineDistancesNeedUpdate&&(a=this.attributes.lineDistance,void 0!==a&&(a.copyArray(b.lineDistances),a.needsUpdate=!0),b.lineDistancesNeedUpdate=
 !1);return this},fromGeometry:function(a){a.__directGeometry=(new THREE.DirectGeometry).fromGeometry(a);return this.fromDirectGeometry(a.__directGeometry)},fromDirectGeometry:function(a){var b=new Float32Array(3*a.vertices.length);this.addAttribute("position",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.vertices));0<a.normals.length&&(b=new Float32Array(3*a.normals.length),this.addAttribute("normal",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.normals)));0<a.colors.length&&(b=new Float32Array(3*
 !1);return this},fromGeometry:function(a){a.__directGeometry=(new THREE.DirectGeometry).fromGeometry(a);return this.fromDirectGeometry(a.__directGeometry)},fromDirectGeometry:function(a){var b=new Float32Array(3*a.vertices.length);this.addAttribute("position",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.vertices));0<a.normals.length&&(b=new Float32Array(3*a.normals.length),this.addAttribute("normal",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.normals)));0<a.colors.length&&(b=new Float32Array(3*
 a.colors.length),this.addAttribute("color",(new THREE.BufferAttribute(b,3)).copyColorsArray(a.colors)));0<a.uvs.length&&(b=new Float32Array(2*a.uvs.length),this.addAttribute("uv",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs)));0<a.uvs2.length&&(b=new Float32Array(2*a.uvs2.length),this.addAttribute("uv2",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs2)));0<a.tangents.length&&(b=new Float32Array(4*a.tangents.length),this.addAttribute("tangent",(new THREE.BufferAttribute(b,4)).copyVector4sArray(a.tangents)));
 a.colors.length),this.addAttribute("color",(new THREE.BufferAttribute(b,3)).copyColorsArray(a.colors)));0<a.uvs.length&&(b=new Float32Array(2*a.uvs.length),this.addAttribute("uv",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs)));0<a.uvs2.length&&(b=new Float32Array(2*a.uvs2.length),this.addAttribute("uv2",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs2)));0<a.tangents.length&&(b=new Float32Array(4*a.tangents.length),this.addAttribute("tangent",(new THREE.BufferAttribute(b,4)).copyVector4sArray(a.tangents)));
-0<a.indices.length&&(b=new Uint16Array(3*a.indices.length),this.addAttribute("index",(new THREE.BufferAttribute(b,1)).copyIndicesArray(a.indices)));if(0<a.morphTargets.length)for(var b=a.morphTargets,c=0,d=b.length;c<d;c++){var e=b[c],g=new THREE.Float32Attribute(3*e.length,3);this.morphAttributes.push(g.copyVector3sArray(e))}0<a.skinIndices.length&&(b=new THREE.Float32Attribute(4*a.skinIndices.length,4),this.addAttribute("skinIndex",b.copyVector4sArray(a.skinIndices)));0<a.skinWeights.length&&(b=
-new THREE.Float32Attribute(4*a.skinWeights.length,4),this.addAttribute("skinWeight",b.copyVector4sArray(a.skinWeights)));null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<
+0<a.indices.length&&(b=new Uint16Array(3*a.indices.length),this.addAttribute("index",(new THREE.BufferAttribute(b,1)).copyIndicesArray(a.indices)));for(var c in a.morphTargets){for(var b=[],d=a.morphTargets[c],e=0,g=d.length;e<g;e++){var f=d[e],h=new THREE.Float32Attribute(3*f.length,3);b.push(h.copyVector3sArray(f))}this.morphAttributes[c]=b}0<a.skinIndices.length&&(c=new THREE.Float32Attribute(4*a.skinIndices.length,4),this.addAttribute("skinIndex",c.copyVector4sArray(a.skinIndices)));0<a.skinWeights.length&&
+(c=new THREE.Float32Attribute(4*a.skinWeights.length,4),this.addAttribute("skinWeight",c.copyVector4sArray(a.skinWeights)));null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<
 e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&
 e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&
 (this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
 (this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
 this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,g,f,h,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3;if(a.index){var q=a.index.array;0===this.drawcalls.length&&this.addDrawCall(0,
 this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,g,f,h,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3;if(a.index){var q=a.index.array;0===this.drawcalls.length&&this.addDrawCall(0,
 q.length);for(var s=0,t=this.drawcalls.length;s<t;++s){e=this.drawcalls[s].start;g=this.drawcalls[s].count;for(var u=this.drawcalls[s].index,d=e,e=e+g;d<e;d+=3)g=3*(u+q[d]),f=3*(u+q[d+1]),h=3*(u+q[d+2]),k.fromArray(b,g),l.fromArray(b,f),n.fromArray(b,h),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),n.fromArray(b,d+6),p.subVectors(n,
 q.length);for(var s=0,t=this.drawcalls.length;s<t;++s){e=this.drawcalls[s].start;g=this.drawcalls[s].count;for(var u=this.drawcalls[s].index,d=e,e=e+g;d<e;d+=3)g=3*(u+q[d]),f=3*(u+q[d+1]),h=3*(u+q[d+2]),k.fromArray(b,g),l.fromArray(b,f),n.fromArray(b,h),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),n.fromArray(b,d+6),p.subVectors(n,
-l),m.subVectors(k,l),p.cross(m),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);m.fromArray(d,3*b);q.fromArray(d,3*c);s.fromArray(g,2*a);t.fromArray(g,2*b);u.fromArray(g,2*c);v=m.x-p.x;w=q.x-p.x;B=m.y-p.y;y=q.y-p.y;H=m.z-p.z;G=q.z-p.z;x=t.x-s.x;A=u.x-s.x;K=t.y-s.y;D=u.y-s.y;z=1/(x*D-A*K);Q.set((D*v-K*w)*z,(D*B-K*y)*z,(D*H-K*G)*z);E.set((x*
-w-A*v)*z,(x*y-A*B)*z,(x*G-A*H)*z);k[a].add(Q);k[b].add(Q);k[c].add(Q);l[a].add(E);l[b].add(E);l[c].add(E)}function b(a){qa.fromArray(e,3*a);$.copy(qa);ga=k[a];T.copy(ga);T.sub(qa.multiplyScalar(qa.dot(ga))).normalize();J.crossVectors($,ga);ra=J.dot(l[a]);ja=0>ra?-1:1;h[4*a]=T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=ja}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
-else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<f;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,q=new THREE.Vector3,s=new THREE.Vector2,t=new THREE.Vector2,u=new THREE.Vector2,v,w,B,y,H,G,
-x,A,K,D,z,Q=new THREE.Vector3,E=new THREE.Vector3,F,C,I,M,R;0===this.drawcalls.length&&this.addDrawCall(0,c.length);var U=this.drawcalls,n=0;for(C=U.length;n<C;++n){F=U[n].start;I=U[n].count;var S=U[n].index,f=F;for(F+=I;f<F;f+=3)I=S+c[f],M=S+c[f+1],R=S+c[f+2],a(I,M,R)}var T=new THREE.Vector3,J=new THREE.Vector3,qa=new THREE.Vector3,$=new THREE.Vector3,ja,ga,ra,n=0;for(C=U.length;n<C;++n)for(F=U[n].start,I=U[n].count,S=U[n].index,f=F,F+=I;f<F;f+=3)I=S+c[f],M=S+c[f+1],R=S+c[f+2],b(I),b(M),b(R)}},computeOffsets:function(a){void 0===
+l),m.subVectors(k,l),p.cross(m),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);m.fromArray(d,3*b);q.fromArray(d,3*c);s.fromArray(g,2*a);t.fromArray(g,2*b);u.fromArray(g,2*c);w=m.x-p.x;v=q.x-p.x;z=m.y-p.y;x=q.y-p.y;H=m.z-p.z;F=q.z-p.z;y=t.x-s.x;B=u.x-s.x;J=t.y-s.y;D=u.y-s.y;A=1/(y*D-B*J);P.set((D*w-J*v)*A,(D*z-J*x)*A,(D*H-J*F)*A);G.set((y*
+v-B*w)*A,(y*x-B*z)*A,(y*F-B*H)*A);k[a].add(P);k[b].add(P);k[c].add(P);l[a].add(G);l[b].add(G);l[c].add(G)}function b(a){$.fromArray(e,3*a);ea.copy($);ma=k[a];T.copy(ma);T.sub($.multiplyScalar($.dot(ma))).normalize();L.crossVectors(ea,ma);oa=L.dot(l[a]);fa=0>oa?-1:1;h[4*a]=T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=fa}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
+else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<f;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,q=new THREE.Vector3,s=new THREE.Vector2,t=new THREE.Vector2,u=new THREE.Vector2,w,v,z,x,H,F,
+y,B,J,D,A,P=new THREE.Vector3,G=new THREE.Vector3,C,E,I,M,S;0===this.drawcalls.length&&this.addDrawCall(0,c.length);var U=this.drawcalls,n=0;for(E=U.length;n<E;++n){C=U[n].start;I=U[n].count;var R=U[n].index,f=C;for(C+=I;f<C;f+=3)I=R+c[f],M=R+c[f+1],S=R+c[f+2],a(I,M,S)}var T=new THREE.Vector3,L=new THREE.Vector3,$=new THREE.Vector3,ea=new THREE.Vector3,fa,ma,oa,n=0;for(E=U.length;n<E;++n)for(C=U[n].start,I=U[n].count,R=U[n].index,f=C,C+=I;f<C;f+=3)I=R+c[f],M=R+c[f+1],S=R+c[f+2],b(I),b(M),b(S)}},computeOffsets:function(a){void 0===
 a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,p=new Int32Array(6),m=new Int32Array(c.length),q=new Int32Array(c.length),s=0;s<c.length;s++)m[s]=-1,q[s]=-1;for(c=0;c<d;c++){for(var t=n=0;3>t;t++)s=b[3*c+t],-1===m[s]?(p[2*t]=s,p[2*t+1]=-1,n++):m[s]<k.index?(p[2*t]=s,p[2*t+1]=-1,
 a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,p=new Int32Array(6),m=new Int32Array(c.length),q=new Int32Array(c.length),s=0;s<c.length;s++)m[s]=-1,q[s]=-1;for(c=0;c<d;c++){for(var t=n=0;3>t;t++)s=b[3*c+t],-1===m[s]?(p[2*t]=s,p[2*t+1]=-1,n++):m[s]<k.index?(p[2*t]=s,p[2*t+1]=-1,
 l++):(p[2*t]=s,p[2*t+1]=m[s]);if(f+n>k.index+a)for(k={start:g,count:0,index:f},h.push(k),n=0;6>n;n+=2)t=p[n+1],-1<t&&t<k.index&&(p[n+1]=-1);for(n=0;6>n;n+=2)s=p[n],t=p[n+1],-1===t&&(t=f++),m[s]=t,q[t]=s,e[g++]=t-k.index,k.count++}this.reorderBuffers(e,q,f);this.clearDrawCalls();for(a=0;a<h.length;a++)b=h[a],this.addDrawCall(b.start,b.count,b.index)},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
 l++):(p[2*t]=s,p[2*t+1]=m[s]);if(f+n>k.index+a)for(k={start:g,count:0,index:f},h.push(k),n=0;6>n;n+=2)t=p[n+1],-1<t&&t<k.index&&(p[n+1]=-1);for(n=0;6>n;n+=2)s=p[n],t=p[n+1],-1===t&&(t=f++),m[s]=t,q[t]=s,e[g++]=t-k.index,k.count++}this.reorderBuffers(e,q,f);this.clearDrawCalls();for(a=0;a<h.length;a++)b=h[a],this.addDrawCall(b.start,b.count,b.index)},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,g=a.attributes[d],f=g.array,h=0,g=g.itemSize*b;h<f.length;h++,g++)e[g]=f[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;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*
 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,g=a.attributes[d],f=g.array,h=0,g=g.itemSize*b;h<f.length;h++,g++)e[g]=f[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;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*
@@ -284,8 +284,8 @@ THREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;a.copy(this
 a.shadowMapWidth=this.shadowMapWidth;a.shadowMapHeight=this.shadowMapHeight;return a};THREE.SpotLight.prototype.toJSON=function(a){a=THREE.Object3D.prototype.toJSON.call(this,a);a.object.color=this.color.getHex();a.object.intensity=this.intensity;a.object.distance=this.distance;a.object.angle=this.angle;a.object.exponent=this.exponent;a.object.decay=this.decay;return a};
 a.shadowMapWidth=this.shadowMapWidth;a.shadowMapHeight=this.shadowMapHeight;return a};THREE.SpotLight.prototype.toJSON=function(a){a=THREE.Object3D.prototype.toJSON.call(this,a);a.object.color=this.color.getHex();a.object.intensity=this.intensity;a.object.distance=this.distance;a.object.angle=this.angle;a.object.exponent=this.exponent;a.object.decay=this.decay;return a};
 THREE.Cache={enabled:!1,files:{},add:function(a,b){!1!==this.enabled&&(this.files[a]=b)},get:function(a){if(!1!==this.enabled)return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};THREE.Loader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Cache={enabled:!1,files:{},add:function(a,b){!1!==this.enabled&&(this.files[a]=b)},get:function(a){if(!1!==this.enabled)return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};THREE.Loader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,extractUrlBase:function(a){a=a.split("/");if(1===a.length)return"./";a.pop();return a.join("/")+"/"},initMaterials:function(a,b,c){for(var d=[],e=0;e<a.length;++e)d[e]=this.createMaterial(a[e],b,c);return d},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(){var a;return function(b,c,d){function e(a){a=Math.log(a)/Math.LN2;return Math.pow(2,
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,extractUrlBase:function(a){a=a.split("/");if(1===a.length)return"./";a.pop();return a.join("/")+"/"},initMaterials:function(a,b,c){for(var d=[],e=0;e<a.length;++e)d[e]=this.createMaterial(a[e],b,c);return d},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(){var a;return function(b,c,d){function e(a){a=Math.log(a)/Math.LN2;return Math.pow(2,
-Math.round(a))}function g(b,g,f,h,k,l,u){var v=c+f,w,B=THREE.Loader.Handlers.get(v);null!==B?w=B.load(v):(w=new THREE.Texture,B=a,B.setCrossOrigin(d),B.load(v,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=e(a.width),c=e(a.height),d=document.createElement("canvas");d.width=b;d.height=c;d.getContext("2d").drawImage(a,0,0,b,c);w.image=d}else w.image=a;w.needsUpdate=!0}));w.sourceFile=f;h&&(w.repeat.set(h[0],h[1]),1!==h[0]&&(w.wrapS=THREE.RepeatWrapping),
-1!==h[1]&&(w.wrapT=THREE.RepeatWrapping));k&&w.offset.set(k[0],k[1]);l&&(f={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==f[l[0]]&&(w.wrapS=f[l[0]]),void 0!==f[l[1]]&&(w.wrapT=f[l[1]]));u&&(w.anisotropy=u);b[g]=w}function f(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}void 0===d&&void 0!==this.crossOrigin&&(d=this.crossOrigin);void 0===a&&(a=new THREE.ImageLoader);var h="MeshLambertMaterial",k={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,
+Math.round(a))}function g(b,g,f,h,k,l,u){var w=c+f,v,z=THREE.Loader.Handlers.get(w);null!==z?v=z.load(w):(v=new THREE.Texture,z=a,z.setCrossOrigin(d),z.load(w,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=e(a.width),c=e(a.height),d=document.createElement("canvas");d.width=b;d.height=c;d.getContext("2d").drawImage(a,0,0,b,c);v.image=d}else v.image=a;v.needsUpdate=!0}));v.sourceFile=f;h&&(v.repeat.set(h[0],h[1]),1!==h[0]&&(v.wrapS=THREE.RepeatWrapping),
+1!==h[1]&&(v.wrapT=THREE.RepeatWrapping));k&&v.offset.set(k[0],k[1]);l&&(f={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==f[l[0]]&&(v.wrapS=f[l[0]]),void 0!==f[l[1]]&&(v.wrapT=f[l[1]]));u&&(v.anisotropy=u);b[g]=v}function f(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}void 0===d&&void 0!==this.crossOrigin&&(d=this.crossOrigin);void 0===a&&(a=new THREE.ImageLoader);var h="MeshLambertMaterial",k={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,
 wireframe:!1};if(b.shading){var l=b.shading.toLowerCase();"phong"===l?h="MeshPhongMaterial":"basic"===l&&(h="MeshBasicMaterial")}void 0!==b.blending&&void 0!==THREE[b.blending]&&(k.blending=THREE[b.blending]);void 0!==b.transparent&&(k.transparent=b.transparent);void 0!==b.opacity&&1>b.opacity&&(k.transparent=!0);void 0!==b.depthTest&&(k.depthTest=b.depthTest);void 0!==b.depthWrite&&(k.depthWrite=b.depthWrite);void 0!==b.visible&&(k.visible=b.visible);void 0!==b.flipSided&&(k.side=THREE.BackSide);
 wireframe:!1};if(b.shading){var l=b.shading.toLowerCase();"phong"===l?h="MeshPhongMaterial":"basic"===l&&(h="MeshBasicMaterial")}void 0!==b.blending&&void 0!==THREE[b.blending]&&(k.blending=THREE[b.blending]);void 0!==b.transparent&&(k.transparent=b.transparent);void 0!==b.opacity&&1>b.opacity&&(k.transparent=!0);void 0!==b.depthTest&&(k.depthTest=b.depthTest);void 0!==b.depthWrite&&(k.depthWrite=b.depthWrite);void 0!==b.visible&&(k.visible=b.visible);void 0!==b.flipSided&&(k.side=THREE.BackSide);
 void 0!==b.doubleSided&&(k.side=THREE.DoubleSide);void 0!==b.wireframe&&(k.wireframe=b.wireframe);void 0!==b.vertexColors&&("face"===b.vertexColors?k.vertexColors=THREE.FaceColors:b.vertexColors&&(k.vertexColors=THREE.VertexColors));b.colorDiffuse?k.color=f(b.colorDiffuse):b.DbgColor&&(k.color=b.DbgColor);b.colorSpecular&&(k.specular=f(b.colorSpecular));b.colorEmissive&&(k.emissive=f(b.colorEmissive));void 0!==b.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),
 void 0!==b.doubleSided&&(k.side=THREE.DoubleSide);void 0!==b.wireframe&&(k.wireframe=b.wireframe);void 0!==b.vertexColors&&("face"===b.vertexColors?k.vertexColors=THREE.FaceColors:b.vertexColors&&(k.vertexColors=THREE.VertexColors));b.colorDiffuse?k.color=f(b.colorDiffuse):b.DbgColor&&(k.color=b.DbgColor);b.colorSpecular&&(k.specular=f(b.colorSpecular));b.colorEmissive&&(k.emissive=f(b.colorEmissive));void 0!==b.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),
 b.opacity=b.transparency);void 0!==b.opacity&&(k.opacity=b.opacity);b.specularCoef&&(k.shininess=b.specularCoef);b.mapDiffuse&&c&&g(k,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap,b.mapDiffuseAnisotropy);b.mapLight&&c&&g(k,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap,b.mapLightAnisotropy);b.mapAO&&c&&g(k,"aoMap",b.mapAO,b.mapAORepeat,b.mapAOOffset,b.mapAOWrap,b.mapAOAnisotropy);b.mapBump&&c&&g(k,"bumpMap",b.mapBump,b.mapBumpRepeat,b.mapBumpOffset,
 b.opacity=b.transparency);void 0!==b.opacity&&(k.opacity=b.opacity);b.specularCoef&&(k.shininess=b.specularCoef);b.mapDiffuse&&c&&g(k,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap,b.mapDiffuseAnisotropy);b.mapLight&&c&&g(k,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap,b.mapLightAnisotropy);b.mapAO&&c&&g(k,"aoMap",b.mapAO,b.mapAORepeat,b.mapAOOffset,b.mapAOWrap,b.mapAOAnisotropy);b.mapBump&&c&&g(k,"bumpMap",b.mapBump,b.mapBumpRepeat,b.mapBumpOffset,
@@ -296,10 +296,10 @@ void 0!==this.responseType&&(f.responseType=this.responseType);void 0!==this.wit
 THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,g=THREE.Cache.get(a);if(void 0!==g)return b&&setTimeout(function(){b(g)},0),g;var f=document.createElement("img");f.addEventListener("load",function(c){THREE.Cache.add(a,this);b&&b(this);e.manager.itemEnd(a)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);void 0!==d&&f.addEventListener("error",function(a){d(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);e.manager.itemStart(a);
 THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,g=THREE.Cache.get(a);if(void 0!==g)return b&&setTimeout(function(){b(g)},0),g;var f=document.createElement("img");f.addEventListener("load",function(c){THREE.Cache.add(a,this);b&&b(this);e.manager.itemEnd(a)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);void 0!==d&&f.addEventListener("error",function(a){d(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);e.manager.itemStart(a);
 f.src=a;return f},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager;this.withCredentials=!1};
 f.src=a;return f},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager;this.withCredentials=!1};
 THREE.JSONLoader.prototype={constructor:THREE.JSONLoader,load:function(a,b,c,d){var e=this,g=this.texturePath&&"string"===typeof this.texturePath?this.texturePath:THREE.Loader.prototype.extractUrlBase(a);c=new THREE.XHRLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.setWithCredentials(this.withCredentials);c.load(a,function(c){c=JSON.parse(c);var d=c.metadata;if(void 0!==d){if("object"===d.type){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.ObjectLoader instead.");return}if("scene"===
 THREE.JSONLoader.prototype={constructor:THREE.JSONLoader,load:function(a,b,c,d){var e=this,g=this.texturePath&&"string"===typeof this.texturePath?this.texturePath:THREE.Loader.prototype.extractUrlBase(a);c=new THREE.XHRLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.setWithCredentials(this.withCredentials);c.load(a,function(c){c=JSON.parse(c);var d=c.metadata;if(void 0!==d){if("object"===d.type){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.ObjectLoader instead.");return}if("scene"===
-d.type){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.SceneLoader instead.");return}}c=e.parse(c,g);b(c.geometry,c.materials)})},setCrossOrigin:function(a){this.crossOrigin=a},setTexturePath:function(a){this.texturePath=a},parse:function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,f,h,k,l,n,p,m,q,s,t,u,v,w=a.faces;n=a.vertices;var B=a.normals,y=a.colors,H=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&H++;for(d=0;d<H;d++)c.faceVertexUvs[d]=
-[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=w.length;k<l;)if(b=w[k++],q=b&1,h=b&2,d=b&8,p=b&16,s=b&32,n=b&64,b&=128,q){q=new THREE.Face3;q.a=w[k];q.b=w[k+1];q.c=w[k+3];t=new THREE.Face3;t.a=w[k+1];t.b=w[k+2];t.c=w[k+3];k+=4;h&&(h=w[k++],q.materialIndex=h,t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<H;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)m=w[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,
-m),2!==f&&c.faceVertexUvs[d][h].push(v),0!==f&&c.faceVertexUvs[d][h+1].push(v);p&&(p=3*w[k++],q.normal.set(B[p++],B[p++],B[p]),t.normal.copy(q.normal));if(s)for(d=0;4>d;d++)p=3*w[k++],s=new THREE.Vector3(B[p++],B[p++],B[p]),2!==d&&q.vertexNormals.push(s),0!==d&&t.vertexNormals.push(s);n&&(n=w[k++],n=y[n],q.color.setHex(n),t.color.setHex(n));if(b)for(d=0;4>d;d++)n=w[k++],n=y[n],2!==d&&q.vertexColors.push(new THREE.Color(n)),0!==d&&t.vertexColors.push(new THREE.Color(n));c.faces.push(q);c.faces.push(t)}else{q=
-new THREE.Face3;q.a=w[k++];q.b=w[k++];q.c=w[k++];h&&(h=w[k++],q.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<H;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)m=w[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),c.faceVertexUvs[d][h].push(v);p&&(p=3*w[k++],q.normal.set(B[p++],B[p++],B[p]));if(s)for(d=0;3>d;d++)p=3*w[k++],s=new THREE.Vector3(B[p++],B[p++],B[p]),q.vertexNormals.push(s);n&&(n=w[k++],q.color.setHex(y[n]));if(b)for(d=0;3>d;d++)n=w[k++],q.vertexColors.push(new THREE.Color(y[n]));
+d.type){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.SceneLoader instead.");return}}c=e.parse(c,g);b(c.geometry,c.materials)})},setCrossOrigin:function(a){this.crossOrigin=a},setTexturePath:function(a){this.texturePath=a},parse:function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,f,h,k,l,n,p,m,q,s,t,u,w,v=a.faces;n=a.vertices;var z=a.normals,x=a.colors,H=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&H++;for(d=0;d<H;d++)c.faceVertexUvs[d]=
+[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=v.length;k<l;)if(b=v[k++],q=b&1,h=b&2,d=b&8,p=b&16,s=b&32,n=b&64,b&=128,q){q=new THREE.Face3;q.a=v[k];q.b=v[k+1];q.c=v[k+3];t=new THREE.Face3;t.a=v[k+1];t.b=v[k+2];t.c=v[k+3];k+=4;h&&(h=v[k++],q.materialIndex=h,t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<H;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)m=v[k++],w=u[2*m],m=u[2*m+1],w=new THREE.Vector2(w,
+m),2!==f&&c.faceVertexUvs[d][h].push(w),0!==f&&c.faceVertexUvs[d][h+1].push(w);p&&(p=3*v[k++],q.normal.set(z[p++],z[p++],z[p]),t.normal.copy(q.normal));if(s)for(d=0;4>d;d++)p=3*v[k++],s=new THREE.Vector3(z[p++],z[p++],z[p]),2!==d&&q.vertexNormals.push(s),0!==d&&t.vertexNormals.push(s);n&&(n=v[k++],n=x[n],q.color.setHex(n),t.color.setHex(n));if(b)for(d=0;4>d;d++)n=v[k++],n=x[n],2!==d&&q.vertexColors.push(new THREE.Color(n)),0!==d&&t.vertexColors.push(new THREE.Color(n));c.faces.push(q);c.faces.push(t)}else{q=
+new THREE.Face3;q.a=v[k++];q.b=v[k++];q.c=v[k++];h&&(h=v[k++],q.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<H;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)m=v[k++],w=u[2*m],m=u[2*m+1],w=new THREE.Vector2(w,m),c.faceVertexUvs[d][h].push(w);p&&(p=3*v[k++],q.normal.set(z[p++],z[p++],z[p]));if(s)for(d=0;3>d;d++)p=3*v[k++],s=new THREE.Vector3(z[p++],z[p++],z[p]),q.vertexNormals.push(s);n&&(n=v[k++],q.color.setHex(x[n]));if(b)for(d=0;3>d;d++)n=v[k++],q.vertexColors.push(new THREE.Color(x[n]));
 c.faces.push(q)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,f=a.skinWeights.length;d<f;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,f=a.skinIndices.length;d<f;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.faces.push(q)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,f=a.skinWeights.length;d<f;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,f=a.skinIndices.length;d<f;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,f,h,k,l,n;d=0;for(f=a.morphTargets.length;d<f;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=
 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,f,h,k,l,n;d=0;for(f=a.morphTargets.length;d<f;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=
 [],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var p=new THREE.Vector3;p.x=n[h]*b;p.y=n[h+1]*b;p.z=n[h+2]*b;l.push(p)}}if(void 0!==a.morphColors)for(d=0,f=a.morphColors.length;d<f;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();
 [],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var p=new THREE.Vector3;p.x=n[h]*b;p.y=n[h+1]*b;p.z=n[h+2]*b;l.push(p)}}if(void 0!==a.morphColors)for(d=0,f=a.morphColors.length;d<f;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();
@@ -328,7 +328,7 @@ THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b
 THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(a,b,c,d){var e=this,g=new THREE.DataTexture,f=new THREE.XHRLoader(this.manager);f.setCrossOrigin(this.crossOrigin);f.setResponseType("arraybuffer");f.load(a,function(a){if(a=e._parser(a))void 0!==a.image?g.image=a.image:void 0!==a.data&&(g.image.width=a.width,g.image.height=a.height,g.image.data=a.data),g.wrapS=void 0!==a.wrapS?a.wrapS:THREE.ClampToEdgeWrapping,g.wrapT=void 0!==a.wrapT?a.wrapT:THREE.ClampToEdgeWrapping,
 THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(a,b,c,d){var e=this,g=new THREE.DataTexture,f=new THREE.XHRLoader(this.manager);f.setCrossOrigin(this.crossOrigin);f.setResponseType("arraybuffer");f.load(a,function(a){if(a=e._parser(a))void 0!==a.image?g.image=a.image:void 0!==a.data&&(g.image.width=a.width,g.image.height=a.height,g.image.data=a.data),g.wrapS=void 0!==a.wrapS?a.wrapS:THREE.ClampToEdgeWrapping,g.wrapT=void 0!==a.wrapT?a.wrapT:THREE.ClampToEdgeWrapping,
 g.magFilter=void 0!==a.magFilter?a.magFilter:THREE.LinearFilter,g.minFilter=void 0!==a.minFilter?a.minFilter:THREE.LinearMipMapLinearFilter,g.anisotropy=void 0!==a.anisotropy?a.anisotropy:1,void 0!==a.format&&(g.format=a.format),void 0!==a.type&&(g.type=a.type),void 0!==a.mipmaps&&(g.mipmaps=a.mipmaps),1===a.mipmapCount&&(g.minFilter=THREE.LinearFilter),g.needsUpdate=!0,b&&b(g,a)},c,d);return g},setCrossOrigin:function(a){this.crossOrigin=a}};
 g.magFilter=void 0!==a.magFilter?a.magFilter:THREE.LinearFilter,g.minFilter=void 0!==a.minFilter?a.minFilter:THREE.LinearMipMapLinearFilter,g.anisotropy=void 0!==a.anisotropy?a.anisotropy:1,void 0!==a.format&&(g.format=a.format),void 0!==a.type&&(g.type=a.type),void 0!==a.mipmaps&&(g.mipmaps=a.mipmaps),1===a.mipmapCount&&(g.minFilter=THREE.LinearFilter),g.needsUpdate=!0,b&&b(g,a)},c,d);return g},setCrossOrigin:function(a){this.crossOrigin=a}};
 THREE.CompressedTextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager;this._parser=null};
 THREE.CompressedTextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager;this._parser=null};
-THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c,d){var e=this,g=[],f=new THREE.CompressedTexture;f.image=g;var h=new THREE.XHRLoader(this.manager);h.setCrossOrigin(this.crossOrigin);h.setResponseType("arraybuffer");if(Array.isArray(a))for(var k=0,l=function(l){h.load(a[l],function(a){a=e._parser(a,!0);g[l]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};k+=1;6===k&&(1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.format=
+THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c,d){var e=this,g=[],f=new THREE.CompressedTexture;f.image=g;var h=new THREE.XHRLoader(this.manager);h.setCrossOrigin(this.crossOrigin);h.setResponseType("arraybuffer");if(Array.isArray(a))for(var k=0,l=function(m){h.load(a[m],function(a){a=e._parser(a,!0);g[m]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};k+=1;6===k&&(1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.format=
 a.format,f.needsUpdate=!0,b&&b(f))},c,d)},n=0,p=a.length;n<p;++n)l(n);else h.load(a,function(a){a=e._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,d=0;d<c;d++){g[d]={mipmaps:[]};for(var h=0;h<a.mipmapCount;h++)g[d].mipmaps.push(a.mipmaps[d*a.mipmapCount+h]),g[d].format=a.format,g[d].width=a.width,g[d].height=a.height}else f.image.width=a.width,f.image.height=a.height,f.mipmaps=a.mipmaps;1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter);f.format=a.format;f.needsUpdate=!0;b&&
 a.format,f.needsUpdate=!0,b&&b(f))},c,d)},n=0,p=a.length;n<p;++n)l(n);else h.load(a,function(a){a=e._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,d=0;d<c;d++){g[d]={mipmaps:[]};for(var h=0;h<a.mipmapCount;h++)g[d].mipmaps.push(a.mipmaps[d*a.mipmapCount+h]),g[d].format=a.format,g[d].width=a.width,g[d].height=a.height}else f.image.width=a.width,f.image.height=a.height,f.mipmaps=a.mipmaps;1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter);f.format=a.format;f.needsUpdate=!0;b&&
 b(f)},c,d);return f},setCrossOrigin:function(a){this.crossOrigin=a}};
 b(f)},c,d);return f},setCrossOrigin:function(a){this.crossOrigin=a}};
 THREE.Material=function(){Object.defineProperty(this,"id",{value:THREE.MaterialIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Material";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=THREE.LessEqualDepth;this.colorWrite=this.depthWrite=
 THREE.Material=function(){Object.defineProperty(this,"id",{value:THREE.MaterialIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Material";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=THREE.LessEqualDepth;this.colorWrite=this.depthWrite=
@@ -386,8 +386,8 @@ THREE.PointCloud.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJ
 THREE.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};THREE.Line=function(a,b,c){1===c&&console.error("THREE.Line: THREE.LinePieces mode has been removed. Use THREE.LineSegments instead.");THREE.Object3D.call(this);this.type="Line";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()})};THREE.Line.prototype=Object.create(THREE.Object3D.prototype);
 THREE.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};THREE.Line=function(a,b,c){1===c&&console.error("THREE.Line: THREE.LinePieces mode has been removed. Use THREE.LineSegments instead.");THREE.Object3D.call(this);this.type="Line";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()})};THREE.Line.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Line.prototype.constructor=THREE.Line;
 THREE.Line.prototype.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 g=d.linePrecision,g=g*g,f=this.geometry;null===f.boundingSphere&&f.computeBoundingSphere();c.copy(f.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(f instanceof
 THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var g=d.linePrecision,g=g*g,f=this.geometry;null===f.boundingSphere&&f.computeBoundingSphere();c.copy(f.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(f instanceof
-THREE.BufferGeometry){var m=f.attributes;if(void 0!==m.index){var q=m.index.array,m=m.position.array,s=f.drawcalls;0===s.length&&(s=[{start:0,count:q.length,index:0}]);for(var t=0;t<s.length;t++)for(var u=s[t].start,v=s[t].count,w=s[t].index,f=u;f<u+v-1;f+=p){var B=w+q[f+1];h.fromArray(m,3*(w+q[f]));k.fromArray(m,3*B);B=b.distanceSqToSegment(h,k,n,l);B>g||(B=b.origin.distanceTo(n),B<d.near||B>d.far||e.push({distance:B,point:l.clone().applyMatrix4(this.matrixWorld),index:f,offsetIndex:t,face:null,
-faceIndex:null,object:this}))}}else for(m=m.position.array,f=0;f<m.length/3-1;f+=p)h.fromArray(m,3*f),k.fromArray(m,3*f+3),B=b.distanceSqToSegment(h,k,n,l),B>g||(B=b.origin.distanceTo(n),B<d.near||B>d.far||e.push({distance:B,point:l.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}else if(f instanceof THREE.Geometry)for(h=f.vertices,k=h.length,f=0;f<k-1;f+=p)B=b.distanceSqToSegment(h[f],h[f+1],n,l),B>g||(B=b.origin.distanceTo(n),B<d.near||B>d.far||e.push({distance:B,
+THREE.BufferGeometry){var m=f.attributes;if(void 0!==m.index){var q=m.index.array,m=m.position.array,s=f.drawcalls;0===s.length&&(s=[{start:0,count:q.length,index:0}]);for(var t=0;t<s.length;t++)for(var u=s[t].start,w=s[t].count,v=s[t].index,f=u;f<u+w-1;f+=p){var z=v+q[f+1];h.fromArray(m,3*(v+q[f]));k.fromArray(m,3*z);z=b.distanceSqToSegment(h,k,n,l);z>g||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:f,offsetIndex:t,face:null,
+faceIndex:null,object:this}))}}else for(m=m.position.array,f=0;f<m.length/3-1;f+=p)h.fromArray(m,3*f),k.fromArray(m,3*f+3),z=b.distanceSqToSegment(h,k,n,l),z>g||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}else if(f instanceof THREE.Geometry)for(h=f.vertices,k=h.length,f=0;f<k-1;f+=p)z=b.distanceSqToSegment(h[f],h[f+1],n,l),z>g||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,
 point:l.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(){return(new THREE.Line(this.geometry,this.material)).copy(this)};THREE.Line.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);return this};
 point:l.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(){return(new THREE.Line(this.geometry,this.material)).copy(this)};THREE.Line.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);return this};
 THREE.Line.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.LineStrip=0;THREE.LinePieces=1;THREE.LineSegments=function(a,b){THREE.Line.call(this,a,b);this.type="LineSegments"};
 THREE.Line.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.LineStrip=0;THREE.LinePieces=1;THREE.LineSegments=function(a,b){THREE.Line.call(this,a,b);this.type="LineSegments"};
 THREE.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegments.prototype.constructor=THREE.LineSegments;THREE.LineSegments.prototype.clone=function(){var a=new THREE.LineSegments(this.geometry,this.material);a.copy(this);return a};THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};
 THREE.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegments.prototype.constructor=THREE.LineSegments;THREE.LineSegments.prototype.clone=function(){var a=new THREE.LineSegments(this.geometry,this.material);a.copy(this);return a};THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};
@@ -395,10 +395,10 @@ THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);THREE.Mesh.prototyp
 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.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
 THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector3;return function(l,n){var p=this.geometry,m=this.material;if(void 0!==m&&(null===p.boundingSphere&&p.computeBoundingSphere(),c.copy(p.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==l.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(l.ray).applyMatrix4(a),null===
 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,g=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector3;return function(l,n){var p=this.geometry,m=this.material;if(void 0!==m&&(null===p.boundingSphere&&p.computeBoundingSphere(),c.copy(p.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==l.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(l.ray).applyMatrix4(a),null===
-p.boundingBox||!1!==b.isIntersectionBox(p.boundingBox)))){var q,s,t;if(p instanceof THREE.BufferGeometry)if(q=p.attributes,void 0!==q.index){var u=q.index.array,v=q.position.array,p=p.drawcalls;0===p.length&&(p=[{start:0,count:u.length,index:0}]);for(var w=0,B=p.length;w<B;++w){q=p[w].start;for(var y=p[w].index,H=q,G=q+p[w].count;H<G;H+=3){q=y+u[H];s=y+u[H+1];t=y+u[H+2];d.fromArray(v,3*q);e.fromArray(v,3*s);g.fromArray(v,3*t);var x=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,
-e,g,m.side!==THREE.DoubleSide);if(null!==x){x.applyMatrix4(this.matrixWorld);var A=l.ray.origin.distanceTo(x);A<l.near||A>l.far||n.push({distance:A,point:x,face:new THREE.Face3(q,s,t,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(H/3),object:this})}}}}else for(v=q.position.array,H=0,G=v.length;H<G;H+=9)d.fromArray(v,H),e.fromArray(v,H+3),g.fromArray(v,H+6),x=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==THREE.DoubleSide),null!==x&&(x.applyMatrix4(this.matrixWorld),
-A=l.ray.origin.distanceTo(x),A<l.near||A>l.far||(q=H/3,s=q+1,t=q+2,n.push({distance:A,point:x,face:new THREE.Face3(q,s,t,THREE.Triangle.normal(d,e,g)),index:q,object:this})));else if(p instanceof THREE.Geometry)for(u=m instanceof THREE.MeshFaceMaterial,v=!0===u?m.materials:null,w=p.vertices,B=p.faces,y=0,H=B.length;y<H;y++)if(G=B[y],x=!0===u?v[G.materialIndex]:m,void 0!==x){q=w[G.a];s=w[G.b];t=w[G.c];if(!0===x.morphTargets){var A=p.morphTargets,K=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,
-0);g.set(0,0,0);for(var D=0,z=A.length;D<z;D++){var Q=K[D];if(0!==Q){var E=A[D].vertices;d.addScaledVector(f.subVectors(E[G.a],q),Q);e.addScaledVector(h.subVectors(E[G.b],s),Q);g.addScaledVector(k.subVectors(E[G.c],t),Q)}}d.add(q);e.add(s);g.add(t);q=d;s=e;t=g}x=x.side===THREE.BackSide?b.intersectTriangle(t,s,q,!0):b.intersectTriangle(q,s,t,x.side!==THREE.DoubleSide);null!==x&&(x.applyMatrix4(this.matrixWorld),A=l.ray.origin.distanceTo(x),A<l.near||A>l.far||n.push({distance:A,point:x,face:G,faceIndex:y,
+p.boundingBox||!1!==b.isIntersectionBox(p.boundingBox)))){var q,s,t;if(p instanceof THREE.BufferGeometry)if(q=p.attributes,void 0!==q.index){var u=q.index.array,w=q.position.array,p=p.drawcalls;0===p.length&&(p=[{start:0,count:u.length,index:0}]);for(var v=0,z=p.length;v<z;++v){q=p[v].start;for(var x=p[v].index,H=q,F=q+p[v].count;H<F;H+=3){q=x+u[H];s=x+u[H+1];t=x+u[H+2];d.fromArray(w,3*q);e.fromArray(w,3*s);g.fromArray(w,3*t);var y=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,
+e,g,m.side!==THREE.DoubleSide);if(null!==y){y.applyMatrix4(this.matrixWorld);var B=l.ray.origin.distanceTo(y);B<l.near||B>l.far||n.push({distance:B,point:y,face:new THREE.Face3(q,s,t,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(H/3),object:this})}}}}else for(w=q.position.array,H=0,F=w.length;H<F;H+=9)d.fromArray(w,H),e.fromArray(w,H+3),g.fromArray(w,H+6),y=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==THREE.DoubleSide),null!==y&&(y.applyMatrix4(this.matrixWorld),
+B=l.ray.origin.distanceTo(y),B<l.near||B>l.far||(q=H/3,s=q+1,t=q+2,n.push({distance:B,point:y,face:new THREE.Face3(q,s,t,THREE.Triangle.normal(d,e,g)),index:q,object:this})));else if(p instanceof THREE.Geometry)for(u=m instanceof THREE.MeshFaceMaterial,w=!0===u?m.materials:null,v=p.vertices,z=p.faces,x=0,H=z.length;x<H;x++)if(F=z[x],y=!0===u?w[F.materialIndex]:m,void 0!==y){q=v[F.a];s=v[F.b];t=v[F.c];if(!0===y.morphTargets){var B=p.morphTargets,J=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,
+0);g.set(0,0,0);for(var D=0,A=B.length;D<A;D++){var P=J[D];if(0!==P){var G=B[D].vertices;d.addScaledVector(f.subVectors(G[F.a],q),P);e.addScaledVector(h.subVectors(G[F.b],s),P);g.addScaledVector(k.subVectors(G[F.c],t),P)}}d.add(q);e.add(s);g.add(t);q=d;s=e;t=g}y=y.side===THREE.BackSide?b.intersectTriangle(t,s,q,!0):b.intersectTriangle(q,s,t,y.side!==THREE.DoubleSide);null!==y&&(y.applyMatrix4(this.matrixWorld),B=l.ray.origin.distanceTo(y),B<l.near||B>l.far||n.push({distance:B,point:y,face:F,faceIndex:x,
 object:this}))}}}}();THREE.Mesh.prototype.clone=function(){return(new THREE.Mesh(this.geometry,this.material)).copy(this)};THREE.Mesh.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);return this};
 object:this}))}}}}();THREE.Mesh.prototype.clone=function(){return(new THREE.Mesh(this.geometry,this.material)).copy(this)};THREE.Mesh.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);return this};
 THREE.Mesh.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON(a));void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a));b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Mesh.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON(a));void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a));b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.clone=function(){return(new THREE.Bone(this.skin)).copy(this)};THREE.Bone.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
 THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.clone=function(){return(new THREE.Bone(this.skin)).copy(this)};THREE.Bone.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
@@ -493,97 +493,97 @@ tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.Sh
 THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,
 THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,
 "}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",
 "}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",
 THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}};
 THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}};
-THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===T&&(a*=d,b*=d,c*=d);r.clearColor(a,b,c,d)}function c(){N.init();r.viewport(Ia,Ca,ya,Ja);b($.r,$.g,$.b,ja)}function d(){Ya=mb=null;Da="";Za=-1;gb=!0;N.reset()}function e(a){a=a.target;a.removeEventListener("dispose",e);a:{var b=aa.get(a);if(a.image&&b.__image__webglTextureCube)r.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;r.deleteTexture(b.__webglTexture)}aa.delete(a)}Ea.textures--}function g(a){a=a.target;
-a.removeEventListener("dispose",g);var b=aa.get(a);if(a&&void 0!==b.__webglTexture){r.deleteTexture(b.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(var c=0;6>c;c++)r.deleteFramebuffer(b.__webglFramebuffer[c]),r.deleteRenderbuffer(b.__webglRenderbuffer[c]);else r.deleteFramebuffer(b.__webglFramebuffer),r.deleteRenderbuffer(b.__webglRenderbuffer);aa.delete(a)}Ea.textures--}function f(a){a=a.target;a.removeEventListener("dispose",f);h(a);aa.delete(a)}function h(a){var b=aa.get(a).program.program;
-if(void 0!==b){a.program=void 0;a=0;for(var c=wa.length;a!==c;++a){var d=wa[a];if(d.program===b){0===--d.usedTimes&&(c-=1,wa[a]=wa[c],wa.pop(),r.deleteProgram(b),Ea.programs=c);break}}}}function k(a,b,c,d){var e;if(c instanceof THREE.InstancedBufferGeometry&&(e=W.get("ANGLE_instanced_arrays"),null===e)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}N.initAttributes();var f=c.attributes;
-b=b.getAttributes();a=a.defaultAttributeValues;for(var g in b){var h=b[g];if(0<=h){var k=f[g];if(void 0!==k){N.enableAttribute(h);var l=k.itemSize,m=ma.getAttributeBuffer(k);if(k instanceof THREE.InterleavedBufferAttribute){var n=k.data,p=n.stride,k=k.offset;r.bindBuffer(r.ARRAY_BUFFER,m);r.vertexAttribPointer(h,l,r.FLOAT,!1,p*n.array.BYTES_PER_ELEMENT,(d*p+k)*n.array.BYTES_PER_ELEMENT);if(n instanceof THREE.InstancedInterleavedBuffer){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");
+THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===R&&(a*=d,b*=d,c*=d);r.clearColor(a,b,c,d)}function c(){N.init();r.viewport(Ha,Ia,Ca,wa);b($.r,$.g,$.b,ea)}function d(){Xa=lb=null;xa="";Ya=-1;fb=!0;N.reset()}function e(a){a=a.target;a.removeEventListener("dispose",e);a:{var b=aa.get(a);if(a.image&&b.__image__webglTextureCube)r.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;r.deleteTexture(b.__webglTexture)}aa.delete(a)}Da.textures--}function g(a){a=a.target;
+a.removeEventListener("dispose",g);var b=aa.get(a);if(a&&void 0!==b.__webglTexture){r.deleteTexture(b.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(var c=0;6>c;c++)r.deleteFramebuffer(b.__webglFramebuffer[c]),r.deleteRenderbuffer(b.__webglRenderbuffer[c]);else r.deleteFramebuffer(b.__webglFramebuffer),r.deleteRenderbuffer(b.__webglRenderbuffer);aa.delete(a)}Da.textures--}function f(a){a=a.target;a.removeEventListener("dispose",f);h(a);aa.delete(a)}function h(a){var b=aa.get(a).program.program;
+if(void 0!==b){a.program=void 0;a=0;for(var c=va.length;a!==c;++a){var d=va[a];if(d.program===b){0===--d.usedTimes&&(c-=1,va[a]=va[c],va.pop(),r.deleteProgram(b),Da.programs=c);break}}}}function k(a,b,c,d){var e;if(c instanceof THREE.InstancedBufferGeometry&&(e=V.get("ANGLE_instanced_arrays"),null===e)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}N.initAttributes();var f=c.attributes;
+b=b.getAttributes();a=a.defaultAttributeValues;for(var g in b){var h=b[g];if(0<=h){var k=f[g];if(void 0!==k){N.enableAttribute(h);var l=k.itemSize,m=pa.getAttributeBuffer(k);if(k instanceof THREE.InterleavedBufferAttribute){var n=k.data,p=n.stride,k=k.offset;r.bindBuffer(r.ARRAY_BUFFER,m);r.vertexAttribPointer(h,l,r.FLOAT,!1,p*n.array.BYTES_PER_ELEMENT,(d*p+k)*n.array.BYTES_PER_ELEMENT);if(n instanceof THREE.InstancedInterleavedBuffer){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");
 return}e.vertexAttribDivisorANGLE(h,n.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=n.meshPerAttribute*n.count)}}else if(r.bindBuffer(r.ARRAY_BUFFER,m),r.vertexAttribPointer(h,l,r.FLOAT,!1,0,d*l*4),k instanceof THREE.InstancedBufferAttribute){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,k.meshPerAttribute);void 0===
 return}e.vertexAttribDivisorANGLE(h,n.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=n.meshPerAttribute*n.count)}}else if(r.bindBuffer(r.ARRAY_BUFFER,m),r.vertexAttribPointer(h,l,r.FLOAT,!1,0,d*l*4),k instanceof THREE.InstancedBufferAttribute){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,k.meshPerAttribute);void 0===
 c.maxInstancedCount&&(c.maxInstancedCount=k.meshPerAttribute*k.count)}}else if(void 0!==a&&(l=a[g],void 0!==l))switch(l.length){case 2:r.vertexAttrib2fv(h,l);break;case 3:r.vertexAttrib3fv(h,l);break;case 4:r.vertexAttrib4fv(h,l);break;default:r.vertexAttrib1fv(h,l)}}}N.disableUnusedAttributes()}function l(a,b){return b[0]-a[0]}function n(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.object.material.id!==b.object.material.id?a.object.material.id-
 c.maxInstancedCount&&(c.maxInstancedCount=k.meshPerAttribute*k.count)}}else if(void 0!==a&&(l=a[g],void 0!==l))switch(l.length){case 2:r.vertexAttrib2fv(h,l);break;case 3:r.vertexAttrib3fv(h,l);break;case 4:r.vertexAttrib4fv(h,l);break;default:r.vertexAttrib1fv(h,l)}}}N.disableUnusedAttributes()}function l(a,b){return b[0]-a[0]}function n(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.object.material.id!==b.object.material.id?a.object.material.id-
-b.object.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ma.init(a),a instanceof THREE.Light)ga.push(a);else if(a instanceof THREE.Sprite)Ra.push(a);else if(a instanceof THREE.LensFlare)Sa.push(a);else if(a instanceof THREE.ImmediateRenderObject){var b=
-a.material;b.transparent?Qa.push(a):pa.push(a)}else{var c=ma.objects[a.id];!c||!1!==a.frustumCulled&&!0!==$a.intersectsObject(a)||(b=a.material,aa.get(b)&&(b.program=aa.get(b).program),b.transparent?va.push(c):ra.push(c),!0===ka.sortObjects&&(na.setFromMatrixPosition(a.matrixWorld),na.applyProjection(Ka),c.z=na.z))}b=0;for(c=a.children.length;b<c;b++)m(a.children[b])}}function q(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g].object,l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
+b.object.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),pa.init(a),a instanceof THREE.Light)fa.push(a);else if(a instanceof THREE.Sprite)ua.push(a);else if(a instanceof THREE.LensFlare)Ja.push(a);else if(a instanceof THREE.ImmediateRenderObject){var b=
+a.material;b.transparent?Ga.push(a):Ba.push(a)}else{var c=pa.objects[a.id];!c||!1!==a.frustumCulled&&!0!==Za.intersectsObject(a)||(b=a.material,aa.get(b)&&(b.program=aa.get(b).program),b.transparent?oa.push(c):ma.push(c),!0===ka.sortObjects&&(na.setFromMatrixPosition(a.matrixWorld),na.applyProjection(Ka),c.z=na.z))}b=0;for(c=a.children.length;b<c;b++)m(a.children[b])}}function q(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g].object,l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
 l.matrixWorld);l._normalMatrix.getNormalMatrix(l._modelViewMatrix);null===e&&(f=k.material);if(f instanceof THREE.MeshFaceMaterial)for(var l=f.materials,m=0,n=l.length;m<n;m++)ka.renderBufferDirect(b,c,d,l[m],k);else ka.renderBufferDirect(b,c,d,f,k)}}function s(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g],l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l._normalMatrix.getNormalMatrix(l._modelViewMatrix);!0===k.visible&&(null===e&&(f=k.material),ka.renderImmediateObject(b,
 l.matrixWorld);l._normalMatrix.getNormalMatrix(l._modelViewMatrix);null===e&&(f=k.material);if(f instanceof THREE.MeshFaceMaterial)for(var l=f.materials,m=0,n=l.length;m<n;m++)ka.renderBufferDirect(b,c,d,l[m],k);else ka.renderBufferDirect(b,c,d,f,k)}}function s(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g],l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l._normalMatrix.getNormalMatrix(l._modelViewMatrix);!0===k.visible&&(null===e&&(f=k.material),ka.renderImmediateObject(b,
-c,d,f,k))}}function t(a){u(a);!0===a.transparent?N.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):N.setBlending(THREE.NoBlending);N.setDepthFunc(a.depthFunc);N.setDepthTest(a.depthTest);N.setDepthWrite(a.depthWrite);N.setColorWrite(a.colorWrite);N.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function u(a){a.side!==THREE.DoubleSide?N.enable(r.CULL_FACE):N.disable(r.CULL_FACE);N.setFlipSided(a.side===
-THREE.BackSide)}function v(a,b,c,d,g){var k,l,m,n;hb=0;var p=aa.get(d);if(d.needsUpdate||!p.program){a:{for(var q=aa.get(d),s=Zb[d.type],t=0,x=0,u=0,v=0,A=0,C=b.length;A<C;A++){var E=b[A];E.onlyShadow||!1===E.visible||(E instanceof THREE.DirectionalLight&&t++,E instanceof THREE.PointLight&&x++,E instanceof THREE.SpotLight&&u++,E instanceof THREE.HemisphereLight&&v++)}k=t;l=x;m=u;n=v;for(var K,F=0,M=0,Q=b.length;M<Q;M++){var R=b[M];R.castShadow&&(R instanceof THREE.SpotLight&&F++,R instanceof THREE.DirectionalLight&&
-!R.shadowCascade&&F++)}K=F;var J;if(nb&&g&&g.skeleton&&g.skeleton.useVertexTexture)J=1024;else{var ga=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),S=Math.floor((ga-20)/4);void 0!==g&&g instanceof THREE.SkinnedMesh&&(S=Math.min(g.skeleton.bones.length,S),S<g.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+g.skeleton.bones.length+", this GPU supports just "+S+" (try OpenGL instead of ANGLE)"));J=S}var U={precision:I,supportsVertexTextures:ob,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&
-d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,emissiveMap:!!d.emissiveMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:qa,skinning:d.skinning,maxBones:J,useVertexTexture:nb&&g&&g.skeleton&&g.skeleton.useVertexTexture,morphTargets:d.morphTargets,
-morphNormals:d.morphNormals,maxMorphTargets:ka.maxMorphTargets,maxMorphNormals:ka.maxMorphNormals,maxDirLights:k,maxPointLights:l,maxSpotLights:m,maxHemiLights:n,maxShadows:K,shadowMapEnabled:la.enabled&&g.receiveShadow&&0<K,shadowMapType:la.type,shadowMapDebug:la.debug,shadowMapCascade:la.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},P=[];s?P.push(s):(P.push(d.fragmentShader),P.push(d.vertexShader));if(void 0!==d.defines)for(var T in d.defines)P.push(T),
-P.push(d.defines[T]);for(T in U)P.push(T),P.push(U[T]);var W=P.join(),ra=!0;if(q.program)if(q.program.code!==W)h(d);else if(void 0!==s)break a;else ra=!1;else d.addEventListener("dispose",f);if(s){var va=THREE.ShaderLib[s];q.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(va.uniforms),vertexShader:va.vertexShader,fragmentShader:va.fragmentShader}}else q.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var pa,$=0,Qa=wa.length;$<
-Qa;$++){var Ra=wa[$];if(Ra.code===W){pa=Ra;ra&&pa.usedTimes++;break}}void 0===pa&&(d.__webglShader=q.__webglShader,pa=new THREE.WebGLProgram(ka,W,d,U),wa.push(pa),Ea.programs=wa.length);q.program=pa;var Sa=pa.getAttributes();if(d.morphTargets)for(var xa=d.numSupportedMorphTargets=0;xa<ka.maxMorphTargets;xa++)0<=Sa["morphTarget"+xa]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(xa=d.numSupportedMorphNormals=0;xa<ka.maxMorphNormals;xa++)0<=Sa["morphNormal"+xa]&&d.numSupportedMorphNormals++;q.uniformsList=
-[];var ja=q.program.getUniforms(),ma;for(ma in q.__webglShader.uniforms){var Da=ja[ma];Da&&q.uniformsList.push([q.__webglShader.uniforms[ma],Da])}}d.needsUpdate=!1}var Ia=!1,Ca=!1,ya=!1,ab=p.program,ca=ab.getUniforms(),L=p.__webglShader.uniforms;ab.id!==mb&&(r.useProgram(ab.program),mb=ab.id,ya=Ca=Ia=!0);d.id!==Za&&(-1===Za&&(ya=!0),Za=d.id,Ca=!0);if(Ia||a!==Ya)r.uniformMatrix4fv(ca.projectionMatrix,!1,a.projectionMatrix.elements),qa&&r.uniform1f(ca.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==
-Ya&&(Ya=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&void 0!==ca.cameraPosition&&(na.setFromMatrixPosition(a.matrixWorld),r.uniform3f(ca.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)&&void 0!==ca.viewMatrix&&r.uniformMatrix4fv(ca.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(g.bindMatrix&&void 0!==
-ca.bindMatrix&&r.uniformMatrix4fv(ca.bindMatrix,!1,g.bindMatrix.elements),g.bindMatrixInverse&&void 0!==ca.bindMatrixInverse&&r.uniformMatrix4fv(ca.bindMatrixInverse,!1,g.bindMatrixInverse.elements),nb&&g.skeleton&&g.skeleton.useVertexTexture){if(void 0!==ca.boneTexture){var Ja=B();r.uniform1i(ca.boneTexture,Ja);ka.setTexture(g.skeleton.boneTexture,Ja)}void 0!==ca.boneTextureWidth&&r.uniform1i(ca.boneTextureWidth,g.skeleton.boneTextureWidth);void 0!==ca.boneTextureHeight&&r.uniform1i(ca.boneTextureHeight,
-g.skeleton.boneTextureHeight)}else g.skeleton&&g.skeleton.boneMatrices&&void 0!==ca.boneGlobalMatrices&&r.uniformMatrix4fv(ca.boneGlobalMatrices,!1,g.skeleton.boneMatrices);if(Ca){c&&d.fog&&(L.fogColor.value=c.color,c instanceof THREE.Fog?(L.fogNear.value=c.near,L.fogFar.value=c.far):c instanceof THREE.FogExp2&&(L.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(gb){var ya=!0,ba,sa,Z,Ha=0,Ka=0,pb=0,La,$a,fb,Ta,qb,da=Nb,rb=da.directional.colors,
-sb=da.directional.positions,tb=da.point.colors,ub=da.point.positions,kb=da.point.distances,lb=da.point.decays,vb=da.spot.colors,wb=da.spot.positions,Ib=da.spot.distances,xb=da.spot.directions,Jb=da.spot.anglesCos,Kb=da.spot.exponents,Lb=da.spot.decays,yb=da.hemi.skyColors,zb=da.hemi.groundColors,Ab=da.hemi.positions,bb=0,Ma=0,za=0,Ua=0,Bb=0,Cb=0,Db=0,ib=0,cb=0,db=0,Fa=0,Va=0;ba=0;for(sa=b.length;ba<sa;ba++)Z=b[ba],Z.onlyShadow||(La=Z.color,Ta=Z.intensity,qb=Z.distance,Z instanceof THREE.AmbientLight?
-Z.visible&&(Ha+=La.r,Ka+=La.g,pb+=La.b):Z instanceof THREE.DirectionalLight?(Bb+=1,Z.visible&&(fa.setFromMatrixPosition(Z.matrixWorld),na.setFromMatrixPosition(Z.target.matrixWorld),fa.sub(na),fa.normalize(),cb=3*bb,sb[cb+0]=fa.x,sb[cb+1]=fa.y,sb[cb+2]=fa.z,y(rb,cb,La,Ta),bb+=1)):Z instanceof THREE.PointLight?(Cb+=1,Z.visible&&(db=3*Ma,y(tb,db,La,Ta),na.setFromMatrixPosition(Z.matrixWorld),ub[db+0]=na.x,ub[db+1]=na.y,ub[db+2]=na.z,kb[Ma]=qb,lb[Ma]=0===Z.distance?0:Z.decay,Ma+=1)):Z instanceof THREE.SpotLight?
-(Db+=1,Z.visible&&(Fa=3*za,y(vb,Fa,La,Ta),fa.setFromMatrixPosition(Z.matrixWorld),wb[Fa+0]=fa.x,wb[Fa+1]=fa.y,wb[Fa+2]=fa.z,Ib[za]=qb,na.setFromMatrixPosition(Z.target.matrixWorld),fa.sub(na),fa.normalize(),xb[Fa+0]=fa.x,xb[Fa+1]=fa.y,xb[Fa+2]=fa.z,Jb[za]=Math.cos(Z.angle),Kb[za]=Z.exponent,Lb[za]=0===Z.distance?0:Z.decay,za+=1)):Z instanceof THREE.HemisphereLight&&(ib+=1,Z.visible&&(fa.setFromMatrixPosition(Z.matrixWorld),fa.normalize(),Va=3*Ua,Ab[Va+0]=fa.x,Ab[Va+1]=fa.y,Ab[Va+2]=fa.z,$a=Z.color,
-fb=Z.groundColor,y(yb,Va,$a,Ta),y(zb,Va,fb,Ta),Ua+=1)));ba=3*bb;for(sa=Math.max(rb.length,3*Bb);ba<sa;ba++)rb[ba]=0;ba=3*Ma;for(sa=Math.max(tb.length,3*Cb);ba<sa;ba++)tb[ba]=0;ba=3*za;for(sa=Math.max(vb.length,3*Db);ba<sa;ba++)vb[ba]=0;ba=3*Ua;for(sa=Math.max(yb.length,3*ib);ba<sa;ba++)yb[ba]=0;ba=3*Ua;for(sa=Math.max(zb.length,3*ib);ba<sa;ba++)zb[ba]=0;da.directional.length=bb;da.point.length=Ma;da.spot.length=za;da.hemi.length=Ua;da.ambient[0]=Ha;da.ambient[1]=Ka;da.ambient[2]=pb;gb=!1}if(ya){var ia=
-Nb;L.ambientLightColor.value=ia.ambient;L.directionalLightColor.value=ia.directional.colors;L.directionalLightDirection.value=ia.directional.positions;L.pointLightColor.value=ia.point.colors;L.pointLightPosition.value=ia.point.positions;L.pointLightDistance.value=ia.point.distances;L.pointLightDecay.value=ia.point.decays;L.spotLightColor.value=ia.spot.colors;L.spotLightPosition.value=ia.spot.positions;L.spotLightDistance.value=ia.spot.distances;L.spotLightDirection.value=ia.spot.directions;L.spotLightAngleCos.value=
-ia.spot.anglesCos;L.spotLightExponent.value=ia.spot.exponents;L.spotLightDecay.value=ia.spot.decays;L.hemisphereLightSkyColor.value=ia.hemi.skyColors;L.hemisphereLightGroundColor.value=ia.hemi.groundColors;L.hemisphereLightDirection.value=ia.hemi.positions;w(L,!0)}else w(L,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){L.opacity.value=d.opacity;L.diffuse.value=d.color;L.map.value=d.map;L.specularMap.value=d.specularMap;L.alphaMap.value=
-d.alphaMap;d.bumpMap&&(L.bumpMap.value=d.bumpMap,L.bumpScale.value=d.bumpScale);d.normalMap&&(L.normalMap.value=d.normalMap,L.normalScale.value.copy(d.normalScale));var Aa;d.map?Aa=d.map:d.specularMap?Aa=d.specularMap:d.normalMap?Aa=d.normalMap:d.bumpMap?Aa=d.bumpMap:d.alphaMap?Aa=d.alphaMap:d.emissiveMap&&(Aa=d.emissiveMap);if(void 0!==Aa){var Ob=Aa.offset,Pb=Aa.repeat;L.offsetRepeat.value.set(Ob.x,Ob.y,Pb.x,Pb.y)}L.envMap.value=d.envMap;L.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?
-1:-1;L.reflectivity.value=d.reflectivity;L.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)L.diffuse.value=d.color,L.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)L.diffuse.value=d.color,L.opacity.value=d.opacity,L.dashSize.value=d.dashSize,L.totalSize.value=d.dashSize+d.gapSize,L.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(L.psColor.value=d.color,L.opacity.value=d.opacity,L.size.value=d.size,L.scale.value=z.height/
-2,L.map.value=d.map,null!==d.map){var Qb=d.map.offset,Rb=d.map.repeat;L.offsetRepeat.value.set(Qb.x,Qb.y,Rb.x,Rb.y)}}else d instanceof THREE.MeshPhongMaterial?(L.shininess.value=d.shininess,L.emissive.value=d.emissive,L.specular.value=d.specular,L.lightMap.value=d.lightMap,L.lightMapIntensity.value=d.lightMapIntensity,L.aoMap.value=d.aoMap,L.aoMapIntensity.value=d.aoMapIntensity,L.emissiveMap.value=d.emissiveMap):d instanceof THREE.MeshLambertMaterial?L.emissive.value=d.emissive:d instanceof THREE.MeshBasicMaterial?
-(L.aoMap.value=d.aoMap,L.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshDepthMaterial?(L.mNear.value=a.near,L.mFar.value=a.far,L.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(L.opacity.value=d.opacity);if(g.receiveShadow&&!d._shadowPass&&L.shadowMatrix)for(var Wa=0,Eb=0,Mb=b.length;Eb<Mb;Eb++){var Ba=b[Eb];Ba.castShadow&&(Ba instanceof THREE.SpotLight||Ba instanceof THREE.DirectionalLight&&!Ba.shadowCascade)&&(L.shadowMap.value[Wa]=Ba.shadowMap,L.shadowMapSize.value[Wa]=
-Ba.shadowMapSize,L.shadowMatrix.value[Wa]=Ba.shadowMatrix,L.shadowDarkness.value[Wa]=Ba.shadowDarkness,L.shadowBias.value[Wa]=Ba.shadowBias,Wa++)}for(var Fb=p.uniformsList,ta,Na,ua,jb=0,$b=Fb.length;jb<$b;jb++){var X=Fb[jb][0];if(!1!==X.needsUpdate){var Sb=X.type,O=X.value,Y=Fb[jb][1];switch(Sb){case "1i":r.uniform1i(Y,O);break;case "1f":r.uniform1f(Y,O);break;case "2f":r.uniform2f(Y,O[0],O[1]);break;case "3f":r.uniform3f(Y,O[0],O[1],O[2]);break;case "4f":r.uniform4f(Y,O[0],O[1],O[2],O[3]);break;
+c,d,f,k))}}function t(a){a.side!==THREE.DoubleSide?N.enable(r.CULL_FACE):N.disable(r.CULL_FACE);N.setFlipSided(a.side===THREE.BackSide);!0===a.transparent?N.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):N.setBlending(THREE.NoBlending);N.setDepthFunc(a.depthFunc);N.setDepthTest(a.depthTest);N.setDepthWrite(a.depthWrite);N.setColorWrite(a.colorWrite);N.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function u(a,
+b,c,d,g){var k,l,m,n;gb=0;var p=aa.get(d);if(d.needsUpdate||!p.program){a:{for(var q=aa.get(d),s=Zb[d.type],t=0,y=0,u=0,B=0,A=0,F=b.length;A<F;A++){var C=b[A];C.onlyShadow||!1===C.visible||(C instanceof THREE.DirectionalLight&&t++,C instanceof THREE.PointLight&&y++,C instanceof THREE.SpotLight&&u++,C instanceof THREE.HemisphereLight&&B++)}k=t;l=y;m=u;n=B;for(var G,I=0,M=0,S=b.length;M<S;M++){var P=b[M];P.castShadow&&(P instanceof THREE.SpotLight&&I++,P instanceof THREE.DirectionalLight&&!P.shadowCascade&&
+I++)}G=I;var ma;if(mb&&g&&g.skeleton&&g.skeleton.useVertexTexture)ma=1024;else{var R=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),U=Math.floor((R-20)/4);void 0!==g&&g instanceof THREE.SkinnedMesh&&(U=Math.min(g.skeleton.bones.length,U),U<g.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+g.skeleton.bones.length+", this GPU supports just "+U+" (try OpenGL instead of ANGLE)"));ma=U}var Q={precision:E,supportsVertexTextures:nb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&
+d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,emissiveMap:!!d.emissiveMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:L,skinning:d.skinning,maxBones:ma,useVertexTexture:mb&&g&&g.skeleton&&g.skeleton.useVertexTexture,morphTargets:d.morphTargets,
+morphNormals:d.morphNormals,maxMorphTargets:ka.maxMorphTargets,maxMorphNormals:ka.maxMorphNormals,maxDirLights:k,maxPointLights:l,maxSpotLights:m,maxHemiLights:n,maxShadows:G,shadowMapEnabled:la.enabled&&g.receiveShadow&&0<G,shadowMapType:la.type,shadowMapDebug:la.debug,shadowMapCascade:la.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},T=[];s?T.push(s):(T.push(d.fragmentShader),T.push(d.vertexShader));if(void 0!==d.defines)for(var V in d.defines)T.push(V),
+T.push(d.defines[V]);for(V in Q)T.push(V),T.push(Q[V]);var oa=T.join(),Ga=!0;if(q.program)if(q.program.code!==oa)h(d);else if(void 0!==s)break a;else Ga=!1;else d.addEventListener("dispose",f);if(s){var Ba=THREE.ShaderLib[s];q.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(Ba.uniforms),vertexShader:Ba.vertexShader,fragmentShader:Ba.fragmentShader}}else q.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var $,Ja=0,fa=va.length;Ja<
+fa;Ja++){var Wa=va[Ja];if(Wa.code===oa){$=Wa;Ga&&$.usedTimes++;break}}void 0===$&&(d.__webglShader=q.__webglShader,$=new THREE.WebGLProgram(ka,oa,d,Q),va.push($),Da.programs=va.length);q.program=$;var ea=$.getAttributes();if(d.morphTargets)for(var ua=d.numSupportedMorphTargets=0;ua<ka.maxMorphTargets;ua++)0<=ea["morphTarget"+ua]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(ua=d.numSupportedMorphNormals=0;ua<ka.maxMorphNormals;ua++)0<=ea["morphNormal"+ua]&&d.numSupportedMorphNormals++;q.uniformsList=
+[];var pa=q.program.getUniforms(),xa;for(xa in q.__webglShader.uniforms){var Ha=pa[xa];Ha&&q.uniformsList.push([q.__webglShader.uniforms[xa],Ha])}}d.needsUpdate=!1}var Ia=!1,Ca=!1,wa=!1,$a=p.program,ca=$a.getUniforms(),K=p.__webglShader.uniforms;$a.id!==lb&&(r.useProgram($a.program),lb=$a.id,wa=Ca=Ia=!0);d.id!==Ya&&(-1===Ya&&(wa=!0),Ya=d.id,Ca=!0);if(Ia||a!==Xa)r.uniformMatrix4fv(ca.projectionMatrix,!1,a.projectionMatrix.elements),L&&r.uniform1f(ca.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==
+Xa&&(Xa=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&void 0!==ca.cameraPosition&&(na.setFromMatrixPosition(a.matrixWorld),r.uniform3f(ca.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)&&void 0!==ca.viewMatrix&&r.uniformMatrix4fv(ca.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(g.bindMatrix&&void 0!==
+ca.bindMatrix&&r.uniformMatrix4fv(ca.bindMatrix,!1,g.bindMatrix.elements),g.bindMatrixInverse&&void 0!==ca.bindMatrixInverse&&r.uniformMatrix4fv(ca.bindMatrixInverse,!1,g.bindMatrixInverse.elements),mb&&g.skeleton&&g.skeleton.useVertexTexture){if(void 0!==ca.boneTexture){var Qa=v();r.uniform1i(ca.boneTexture,Qa);ka.setTexture(g.skeleton.boneTexture,Qa)}void 0!==ca.boneTextureWidth&&r.uniform1i(ca.boneTextureWidth,g.skeleton.boneTextureWidth);void 0!==ca.boneTextureHeight&&r.uniform1i(ca.boneTextureHeight,
+g.skeleton.boneTextureHeight)}else g.skeleton&&g.skeleton.boneMatrices&&void 0!==ca.boneGlobalMatrices&&r.uniformMatrix4fv(ca.boneGlobalMatrices,!1,g.skeleton.boneMatrices);if(Ca){c&&d.fog&&(K.fogColor.value=c.color,c instanceof THREE.Fog?(K.fogNear.value=c.near,K.fogFar.value=c.far):c instanceof THREE.FogExp2&&(K.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(fb){var wa=!0,ba,ra,Z,Ka=0,ob=0,pb=0,La,Za,eb,Ra,qb,da=Nb,rb=da.directional.colors,
+sb=da.directional.positions,tb=da.point.colors,ub=da.point.positions,jb=da.point.distances,kb=da.point.decays,vb=da.spot.colors,wb=da.spot.positions,Ib=da.spot.distances,xb=da.spot.directions,Jb=da.spot.anglesCos,Kb=da.spot.exponents,Lb=da.spot.decays,yb=da.hemi.skyColors,zb=da.hemi.groundColors,Ab=da.hemi.positions,ab=0,Ma=0,ya=0,Sa=0,Bb=0,Cb=0,Db=0,hb=0,bb=0,cb=0,Ea=0,Ta=0;ba=0;for(ra=b.length;ba<ra;ba++)Z=b[ba],Z.onlyShadow||(La=Z.color,Ra=Z.intensity,qb=Z.distance,Z instanceof THREE.AmbientLight?
+Z.visible&&(Ka+=La.r,ob+=La.g,pb+=La.b):Z instanceof THREE.DirectionalLight?(Bb+=1,Z.visible&&(ha.setFromMatrixPosition(Z.matrixWorld),na.setFromMatrixPosition(Z.target.matrixWorld),ha.sub(na),ha.normalize(),bb=3*ab,sb[bb+0]=ha.x,sb[bb+1]=ha.y,sb[bb+2]=ha.z,z(rb,bb,La,Ra),ab+=1)):Z instanceof THREE.PointLight?(Cb+=1,Z.visible&&(cb=3*Ma,z(tb,cb,La,Ra),na.setFromMatrixPosition(Z.matrixWorld),ub[cb+0]=na.x,ub[cb+1]=na.y,ub[cb+2]=na.z,jb[Ma]=qb,kb[Ma]=0===Z.distance?0:Z.decay,Ma+=1)):Z instanceof THREE.SpotLight?
+(Db+=1,Z.visible&&(Ea=3*ya,z(vb,Ea,La,Ra),ha.setFromMatrixPosition(Z.matrixWorld),wb[Ea+0]=ha.x,wb[Ea+1]=ha.y,wb[Ea+2]=ha.z,Ib[ya]=qb,na.setFromMatrixPosition(Z.target.matrixWorld),ha.sub(na),ha.normalize(),xb[Ea+0]=ha.x,xb[Ea+1]=ha.y,xb[Ea+2]=ha.z,Jb[ya]=Math.cos(Z.angle),Kb[ya]=Z.exponent,Lb[ya]=0===Z.distance?0:Z.decay,ya+=1)):Z instanceof THREE.HemisphereLight&&(hb+=1,Z.visible&&(ha.setFromMatrixPosition(Z.matrixWorld),ha.normalize(),Ta=3*Sa,Ab[Ta+0]=ha.x,Ab[Ta+1]=ha.y,Ab[Ta+2]=ha.z,Za=Z.color,
+eb=Z.groundColor,z(yb,Ta,Za,Ra),z(zb,Ta,eb,Ra),Sa+=1)));ba=3*ab;for(ra=Math.max(rb.length,3*Bb);ba<ra;ba++)rb[ba]=0;ba=3*Ma;for(ra=Math.max(tb.length,3*Cb);ba<ra;ba++)tb[ba]=0;ba=3*ya;for(ra=Math.max(vb.length,3*Db);ba<ra;ba++)vb[ba]=0;ba=3*Sa;for(ra=Math.max(yb.length,3*hb);ba<ra;ba++)yb[ba]=0;ba=3*Sa;for(ra=Math.max(zb.length,3*hb);ba<ra;ba++)zb[ba]=0;da.directional.length=ab;da.point.length=Ma;da.spot.length=ya;da.hemi.length=Sa;da.ambient[0]=Ka;da.ambient[1]=ob;da.ambient[2]=pb;fb=!1}if(wa){var ja=
+Nb;K.ambientLightColor.value=ja.ambient;K.directionalLightColor.value=ja.directional.colors;K.directionalLightDirection.value=ja.directional.positions;K.pointLightColor.value=ja.point.colors;K.pointLightPosition.value=ja.point.positions;K.pointLightDistance.value=ja.point.distances;K.pointLightDecay.value=ja.point.decays;K.spotLightColor.value=ja.spot.colors;K.spotLightPosition.value=ja.spot.positions;K.spotLightDistance.value=ja.spot.distances;K.spotLightDirection.value=ja.spot.directions;K.spotLightAngleCos.value=
+ja.spot.anglesCos;K.spotLightExponent.value=ja.spot.exponents;K.spotLightDecay.value=ja.spot.decays;K.hemisphereLightSkyColor.value=ja.hemi.skyColors;K.hemisphereLightGroundColor.value=ja.hemi.groundColors;K.hemisphereLightDirection.value=ja.hemi.positions;w(K,!0)}else w(K,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){K.opacity.value=d.opacity;K.diffuse.value=d.color;K.map.value=d.map;K.specularMap.value=d.specularMap;K.alphaMap.value=
+d.alphaMap;d.bumpMap&&(K.bumpMap.value=d.bumpMap,K.bumpScale.value=d.bumpScale);d.normalMap&&(K.normalMap.value=d.normalMap,K.normalScale.value.copy(d.normalScale));var za;d.map?za=d.map:d.specularMap?za=d.specularMap:d.normalMap?za=d.normalMap:d.bumpMap?za=d.bumpMap:d.alphaMap?za=d.alphaMap:d.emissiveMap&&(za=d.emissiveMap);if(void 0!==za){var Ob=za.offset,Pb=za.repeat;K.offsetRepeat.value.set(Ob.x,Ob.y,Pb.x,Pb.y)}K.envMap.value=d.envMap;K.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?
+1:-1;K.reflectivity.value=d.reflectivity;K.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)K.diffuse.value=d.color,K.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)K.diffuse.value=d.color,K.opacity.value=d.opacity,K.dashSize.value=d.dashSize,K.totalSize.value=d.dashSize+d.gapSize,K.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(K.psColor.value=d.color,K.opacity.value=d.opacity,K.size.value=d.size,K.scale.value=D.height/
+2,K.map.value=d.map,null!==d.map){var Qb=d.map.offset,Rb=d.map.repeat;K.offsetRepeat.value.set(Qb.x,Qb.y,Rb.x,Rb.y)}}else d instanceof THREE.MeshPhongMaterial?(K.shininess.value=d.shininess,K.emissive.value=d.emissive,K.specular.value=d.specular,K.lightMap.value=d.lightMap,K.lightMapIntensity.value=d.lightMapIntensity,K.aoMap.value=d.aoMap,K.aoMapIntensity.value=d.aoMapIntensity,K.emissiveMap.value=d.emissiveMap):d instanceof THREE.MeshLambertMaterial?K.emissive.value=d.emissive:d instanceof THREE.MeshBasicMaterial?
+(K.aoMap.value=d.aoMap,K.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshDepthMaterial?(K.mNear.value=a.near,K.mFar.value=a.far,K.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(K.opacity.value=d.opacity);if(g.receiveShadow&&!d._shadowPass&&K.shadowMatrix)for(var Ua=0,Eb=0,Mb=b.length;Eb<Mb;Eb++){var Aa=b[Eb];Aa.castShadow&&(Aa instanceof THREE.SpotLight||Aa instanceof THREE.DirectionalLight&&!Aa.shadowCascade)&&(K.shadowMap.value[Ua]=Aa.shadowMap,K.shadowMapSize.value[Ua]=
+Aa.shadowMapSize,K.shadowMatrix.value[Ua]=Aa.shadowMatrix,K.shadowDarkness.value[Ua]=Aa.shadowDarkness,K.shadowBias.value[Ua]=Aa.shadowBias,Ua++)}for(var Fb=p.uniformsList,sa,Na,ta,ib=0,$b=Fb.length;ib<$b;ib++){var X=Fb[ib][0];if(!1!==X.needsUpdate){var Sb=X.type,O=X.value,Y=Fb[ib][1];switch(Sb){case "1i":r.uniform1i(Y,O);break;case "1f":r.uniform1f(Y,O);break;case "2f":r.uniform2f(Y,O[0],O[1]);break;case "3f":r.uniform3f(Y,O[0],O[1],O[2]);break;case "4f":r.uniform4f(Y,O[0],O[1],O[2],O[3]);break;
 case "1iv":r.uniform1iv(Y,O);break;case "3iv":r.uniform3iv(Y,O);break;case "1fv":r.uniform1fv(Y,O);break;case "2fv":r.uniform2fv(Y,O);break;case "3fv":r.uniform3fv(Y,O);break;case "4fv":r.uniform4fv(Y,O);break;case "Matrix3fv":r.uniformMatrix3fv(Y,!1,O);break;case "Matrix4fv":r.uniformMatrix4fv(Y,!1,O);break;case "i":r.uniform1i(Y,O);break;case "f":r.uniform1f(Y,O);break;case "v2":r.uniform2f(Y,O.x,O.y);break;case "v3":r.uniform3f(Y,O.x,O.y,O.z);break;case "v4":r.uniform4f(Y,O.x,O.y,O.z,O.w);break;
 case "1iv":r.uniform1iv(Y,O);break;case "3iv":r.uniform3iv(Y,O);break;case "1fv":r.uniform1fv(Y,O);break;case "2fv":r.uniform2fv(Y,O);break;case "3fv":r.uniform3fv(Y,O);break;case "4fv":r.uniform4fv(Y,O);break;case "Matrix3fv":r.uniformMatrix3fv(Y,!1,O);break;case "Matrix4fv":r.uniformMatrix4fv(Y,!1,O);break;case "i":r.uniform1i(Y,O);break;case "f":r.uniform1f(Y,O);break;case "v2":r.uniform2f(Y,O.x,O.y);break;case "v3":r.uniform3f(Y,O.x,O.y,O.z);break;case "v4":r.uniform4f(Y,O.x,O.y,O.z,O.w);break;
-case "c":r.uniform3f(Y,O.r,O.g,O.b);break;case "iv1":r.uniform1iv(Y,O);break;case "iv":r.uniform3iv(Y,O);break;case "fv1":r.uniform1fv(Y,O);break;case "fv":r.uniform3fv(Y,O);break;case "v2v":void 0===X._array&&(X._array=new Float32Array(2*O.length));for(var V=0,oa=O.length;V<oa;V++)ua=2*V,X._array[ua+0]=O[V].x,X._array[ua+1]=O[V].y;r.uniform2fv(Y,X._array);break;case "v3v":void 0===X._array&&(X._array=new Float32Array(3*O.length));V=0;for(oa=O.length;V<oa;V++)ua=3*V,X._array[ua+0]=O[V].x,X._array[ua+
-1]=O[V].y,X._array[ua+2]=O[V].z;r.uniform3fv(Y,X._array);break;case "v4v":void 0===X._array&&(X._array=new Float32Array(4*O.length));V=0;for(oa=O.length;V<oa;V++)ua=4*V,X._array[ua+0]=O[V].x,X._array[ua+1]=O[V].y,X._array[ua+2]=O[V].z,X._array[ua+3]=O[V].w;r.uniform4fv(Y,X._array);break;case "m3":r.uniformMatrix3fv(Y,!1,O.elements);break;case "m3v":void 0===X._array&&(X._array=new Float32Array(9*O.length));V=0;for(oa=O.length;V<oa;V++)O[V].flattenToArrayOffset(X._array,9*V);r.uniformMatrix3fv(Y,!1,
-X._array);break;case "m4":r.uniformMatrix4fv(Y,!1,O.elements);break;case "m4v":void 0===X._array&&(X._array=new Float32Array(16*O.length));V=0;for(oa=O.length;V<oa;V++)O[V].flattenToArrayOffset(X._array,16*V);r.uniformMatrix4fv(Y,!1,X._array);break;case "t":ta=O;Na=B();r.uniform1i(Y,Na);if(!ta)continue;if(ta instanceof THREE.CubeTexture||Array.isArray(ta.image)&&6===ta.image.length){var ea=ta,Tb=Na,Xa=aa.get(ea);if(6===ea.image.length)if(0<ea.version&&Xa.__version!==ea.version){Xa.__image__webglTextureCube||
-(ea.addEventListener("dispose",e),Xa.__image__webglTextureCube=r.createTexture(),Ea.textures++);N.activeTexture(r.TEXTURE0+Tb);N.bindTexture(r.TEXTURE_CUBE_MAP,Xa.__image__webglTextureCube);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,ea.flipY);for(var Ub=ea instanceof THREE.CompressedTexture,Gb=ea.image[0]instanceof THREE.DataTexture,Oa=[],ha=0;6>ha;ha++)Oa[ha]=!ka.autoScaleCubemaps||Ub||Gb?Gb?ea.image[ha].image:ea.image[ha]:G(ea.image[ha],ac);var Vb=Oa[0],Wb=THREE.Math.isPowerOfTwo(Vb.width)&&THREE.Math.isPowerOfTwo(Vb.height),
-Ga=D(ea.format),Hb=D(ea.type);H(r.TEXTURE_CUBE_MAP,ea,Wb);for(ha=0;6>ha;ha++)if(Ub)for(var Pa,Xb=Oa[ha].mipmaps,eb=0,bc=Xb.length;eb<bc;eb++)Pa=Xb[eb],ea.format!==THREE.RGBAFormat&&ea.format!==THREE.RGBFormat?-1<Yb().indexOf(Ga)?N.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ha,eb,Ga,Pa.width,Pa.height,0,Pa.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):N.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ha,eb,Ga,Pa.width,Pa.height,
-0,Ga,Hb,Pa.data);else Gb?N.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Ga,Oa[ha].width,Oa[ha].height,0,Ga,Hb,Oa[ha].data):N.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Ga,Ga,Hb,Oa[ha]);ea.generateMipmaps&&Wb&&r.generateMipmap(r.TEXTURE_CUBE_MAP);Xa.__version=ea.version;if(ea.onUpdate)ea.onUpdate(ea)}else N.activeTexture(r.TEXTURE0+Tb),N.bindTexture(r.TEXTURE_CUBE_MAP,Xa.__image__webglTextureCube)}else if(ta instanceof THREE.WebGLRenderTargetCube){var cc=ta;N.activeTexture(r.TEXTURE0+Na);N.bindTexture(r.TEXTURE_CUBE_MAP,
-aa.get(cc).__webglTexture)}else ka.setTexture(ta,Na);break;case "tv":void 0===X._array&&(X._array=[]);V=0;for(oa=X.value.length;V<oa;V++)X._array[V]=B();r.uniform1iv(Y,X._array);V=0;for(oa=X.value.length;V<oa;V++)ta=X.value[V],Na=X._array[V],ta&&ka.setTexture(ta,Na);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Sb)}}}}r.uniformMatrix4fv(ca.modelViewMatrix,!1,g._modelViewMatrix.elements);ca.normalMatrix&&r.uniformMatrix3fv(ca.normalMatrix,!1,g._normalMatrix.elements);void 0!==
-ca.modelMatrix&&r.uniformMatrix4fv(ca.modelMatrix,!1,g.matrixWorld.elements);return ab}function w(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=
-b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function B(){var a=hb;a>=fb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+fb);hb+=1;return a}function y(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function H(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,D(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,D(b.wrapT)),
-r.texParameteri(a,r.TEXTURE_MAG_FILTER,D(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,D(b.minFilter))):(r.texParameteri(a,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,K(b.magFilter)),
-r.texParameteri(a,r.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 should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=W.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||aa.get(b).__currentAnisotropy)&&(r.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,
-ka.getMaxAnisotropy())),aa.get(b).__currentAnisotropy=b.anisotropy)}function G(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function x(a,b,c){r.bindFramebuffer(r.FRAMEBUFFER,
-a);r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,c,aa.get(b).__webglTexture,0)}function A(a,b){r.bindRenderbuffer(r.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,
-a)):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,b.width,b.height)}function K(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function D(a){var b;if(a===THREE.RepeatWrapping)return r.REPEAT;if(a===THREE.ClampToEdgeWrapping)return r.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return r.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return r.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return r.NEAREST_MIPMAP_NEAREST;
+case "c":r.uniform3f(Y,O.r,O.g,O.b);break;case "iv1":r.uniform1iv(Y,O);break;case "iv":r.uniform3iv(Y,O);break;case "fv1":r.uniform1fv(Y,O);break;case "fv":r.uniform3fv(Y,O);break;case "v2v":void 0===X._array&&(X._array=new Float32Array(2*O.length));for(var W=0,qa=O.length;W<qa;W++)ta=2*W,X._array[ta+0]=O[W].x,X._array[ta+1]=O[W].y;r.uniform2fv(Y,X._array);break;case "v3v":void 0===X._array&&(X._array=new Float32Array(3*O.length));W=0;for(qa=O.length;W<qa;W++)ta=3*W,X._array[ta+0]=O[W].x,X._array[ta+
+1]=O[W].y,X._array[ta+2]=O[W].z;r.uniform3fv(Y,X._array);break;case "v4v":void 0===X._array&&(X._array=new Float32Array(4*O.length));W=0;for(qa=O.length;W<qa;W++)ta=4*W,X._array[ta+0]=O[W].x,X._array[ta+1]=O[W].y,X._array[ta+2]=O[W].z,X._array[ta+3]=O[W].w;r.uniform4fv(Y,X._array);break;case "m3":r.uniformMatrix3fv(Y,!1,O.elements);break;case "m3v":void 0===X._array&&(X._array=new Float32Array(9*O.length));W=0;for(qa=O.length;W<qa;W++)O[W].flattenToArrayOffset(X._array,9*W);r.uniformMatrix3fv(Y,!1,
+X._array);break;case "m4":r.uniformMatrix4fv(Y,!1,O.elements);break;case "m4v":void 0===X._array&&(X._array=new Float32Array(16*O.length));W=0;for(qa=O.length;W<qa;W++)O[W].flattenToArrayOffset(X._array,16*W);r.uniformMatrix4fv(Y,!1,X._array);break;case "t":sa=O;Na=v();r.uniform1i(Y,Na);if(!sa)continue;if(sa instanceof THREE.CubeTexture||Array.isArray(sa.image)&&6===sa.image.length){var ga=sa,Tb=Na,Va=aa.get(ga);if(6===ga.image.length)if(0<ga.version&&Va.__version!==ga.version){Va.__image__webglTextureCube||
+(ga.addEventListener("dispose",e),Va.__image__webglTextureCube=r.createTexture(),Da.textures++);N.activeTexture(r.TEXTURE0+Tb);N.bindTexture(r.TEXTURE_CUBE_MAP,Va.__image__webglTextureCube);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,ga.flipY);for(var Ub=ga instanceof THREE.CompressedTexture,Gb=ga.image[0]instanceof THREE.DataTexture,Oa=[],ia=0;6>ia;ia++)Oa[ia]=!ka.autoScaleCubemaps||Ub||Gb?Gb?ga.image[ia].image:ga.image[ia]:H(ga.image[ia],ac);var Vb=Oa[0],Wb=THREE.Math.isPowerOfTwo(Vb.width)&&THREE.Math.isPowerOfTwo(Vb.height),
+Fa=J(ga.format),Hb=J(ga.type);x(r.TEXTURE_CUBE_MAP,ga,Wb);for(ia=0;6>ia;ia++)if(Ub)for(var Pa,Xb=Oa[ia].mipmaps,db=0,bc=Xb.length;db<bc;db++)Pa=Xb[db],ga.format!==THREE.RGBAFormat&&ga.format!==THREE.RGBFormat?-1<Yb().indexOf(Fa)?N.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ia,db,Fa,Pa.width,Pa.height,0,Pa.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):N.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ia,db,Fa,Pa.width,Pa.height,
+0,Fa,Hb,Pa.data);else Gb?N.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ia,0,Fa,Oa[ia].width,Oa[ia].height,0,Fa,Hb,Oa[ia].data):N.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ia,0,Fa,Fa,Hb,Oa[ia]);ga.generateMipmaps&&Wb&&r.generateMipmap(r.TEXTURE_CUBE_MAP);Va.__version=ga.version;if(ga.onUpdate)ga.onUpdate(ga)}else N.activeTexture(r.TEXTURE0+Tb),N.bindTexture(r.TEXTURE_CUBE_MAP,Va.__image__webglTextureCube)}else if(sa instanceof THREE.WebGLRenderTargetCube){var cc=sa;N.activeTexture(r.TEXTURE0+Na);N.bindTexture(r.TEXTURE_CUBE_MAP,
+aa.get(cc).__webglTexture)}else ka.setTexture(sa,Na);break;case "tv":void 0===X._array&&(X._array=[]);W=0;for(qa=X.value.length;W<qa;W++)X._array[W]=v();r.uniform1iv(Y,X._array);W=0;for(qa=X.value.length;W<qa;W++)sa=X.value[W],Na=X._array[W],sa&&ka.setTexture(sa,Na);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Sb)}}}}r.uniformMatrix4fv(ca.modelViewMatrix,!1,g._modelViewMatrix.elements);ca.normalMatrix&&r.uniformMatrix3fv(ca.normalMatrix,!1,g._normalMatrix.elements);void 0!==
+ca.modelMatrix&&r.uniformMatrix4fv(ca.modelMatrix,!1,g.matrixWorld.elements);return $a}function w(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=
+b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function v(){var a=gb;a>=eb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+eb);gb+=1;return a}function z(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function x(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,J(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,J(b.wrapT)),
+r.texParameteri(a,r.TEXTURE_MAG_FILTER,J(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,J(b.minFilter))):(r.texParameteri(a,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,B(b.magFilter)),
+r.texParameteri(a,r.TEXTURE_MIN_FILTER,B(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=V.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||aa.get(b).__currentAnisotropy)&&(r.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,
+ka.getMaxAnisotropy())),aa.get(b).__currentAnisotropy=b.anisotropy)}function H(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function F(a,b,c){r.bindFramebuffer(r.FRAMEBUFFER,
+a);r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,c,aa.get(b).__webglTexture,0)}function y(a,b){r.bindRenderbuffer(r.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,
+a)):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,b.width,b.height)}function B(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function J(a){var b;if(a===THREE.RepeatWrapping)return r.REPEAT;if(a===THREE.ClampToEdgeWrapping)return r.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return r.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return r.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return r.NEAREST_MIPMAP_NEAREST;
 if(a===THREE.NearestMipMapLinearFilter)return r.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return r.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return r.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return r.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return r.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return r.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return r.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return r.UNSIGNED_SHORT_5_6_5;
 if(a===THREE.NearestMipMapLinearFilter)return r.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return r.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return r.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return r.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return r.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return r.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return r.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return r.UNSIGNED_SHORT_5_6_5;
-if(a===THREE.ByteType)return r.BYTE;if(a===THREE.ShortType)return r.SHORT;if(a===THREE.UnsignedShortType)return r.UNSIGNED_SHORT;if(a===THREE.IntType)return r.INT;if(a===THREE.UnsignedIntType)return r.UNSIGNED_INT;if(a===THREE.FloatType)return r.FLOAT;b=W.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return r.ALPHA;if(a===THREE.RGBFormat)return r.RGB;if(a===THREE.RGBAFormat)return r.RGBA;if(a===THREE.LuminanceFormat)return r.LUMINANCE;
+if(a===THREE.ByteType)return r.BYTE;if(a===THREE.ShortType)return r.SHORT;if(a===THREE.UnsignedShortType)return r.UNSIGNED_SHORT;if(a===THREE.IntType)return r.INT;if(a===THREE.UnsignedIntType)return r.UNSIGNED_INT;if(a===THREE.FloatType)return r.FLOAT;b=V.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return r.ALPHA;if(a===THREE.RGBFormat)return r.RGB;if(a===THREE.RGBAFormat)return r.RGBA;if(a===THREE.LuminanceFormat)return r.LUMINANCE;
 if(a===THREE.LuminanceAlphaFormat)return r.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return r.FUNC_ADD;if(a===THREE.SubtractEquation)return r.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return r.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return r.ZERO;if(a===THREE.OneFactor)return r.ONE;if(a===THREE.SrcColorFactor)return r.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return r.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return r.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return r.ONE_MINUS_SRC_ALPHA;
 if(a===THREE.LuminanceAlphaFormat)return r.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return r.FUNC_ADD;if(a===THREE.SubtractEquation)return r.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return r.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return r.ZERO;if(a===THREE.OneFactor)return r.ONE;if(a===THREE.SrcColorFactor)return r.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return r.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return r.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return r.ONE_MINUS_SRC_ALPHA;
-if(a===THREE.DstAlphaFactor)return r.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return r.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return r.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return r.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return r.SRC_ALPHA_SATURATE;b=W.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=W.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=W.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 z=void 0!==a.canvas?a.canvas:document.createElement("canvas"),Q=void 0!==a.context?a.context:null,E=z.width,F=z.height,C=1,I=void 0!==a.precision?a.precision:"highp",M=void 0!==a.alpha?a.alpha:!1,R=void 0!==a.depth?a.depth:!0,U=void 0!==a.stencil?a.stencil:!0,S=void 0!==a.antialias?a.antialias:!1,T=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,J=void 0!==a.preserveDrawingBuffer?
-a.preserveDrawingBuffer:!1,qa=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,$=new THREE.Color(0),ja=0,ga=[],ra=[],va=[],pa=[],Qa=[],xa=new Float32Array(8),Ra=[],Sa=[];this.domElement=z;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;var ka=this,wa=[],mb=null,Ha=null,Za=-1,Da="",Ya=null,hb=0,
-Ia=0,Ca=0,ya=z.width,Ja=z.height,kb=0,lb=0,$a=new THREE.Frustum,Ka=new THREE.Matrix4,na=new THREE.Vector3,fa=new THREE.Vector3,gb=!0,Nb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},Ea={programs:0,geometries:0,textures:0},P={calls:0,vertices:0,faces:0,points:0};
-this.info={render:P,memory:Ea,programs:wa};var r;try{a={alpha:M,depth:R,stencil:U,antialias:S,premultipliedAlpha:T,preserveDrawingBuffer:J};r=Q||z.getContext("webgl",a)||z.getContext("experimental-webgl",a);if(null===r){if(null!==z.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}z.addEventListener("webglcontextlost",function(a){a.preventDefault();d();c();ma.clear();aa.clear()},!1)}catch(Ib){console.error("THREE.WebGLRenderer: "+
-Ib)}var N=new THREE.WebGLState(r,D);void 0===r.getShaderPrecisionFormat&&(r.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var aa=new THREE.WebGLProperties,ma=new THREE.WebGLObjects(r,aa,this.info),W=new THREE.WebGLExtensions(r);W.get("OES_texture_float");W.get("OES_texture_float_linear");W.get("OES_texture_half_float");W.get("OES_texture_half_float_linear");W.get("OES_standard_derivatives");W.get("ANGLE_instanced_arrays");W.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=
-4294967296);qa&&W.get("EXT_frag_depth");c();this.context=r;this.extensions=W;this.state=N;var la=new THREE.WebGLShadowMap(this,ga,ma);this.shadowMap=la;var fb=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),Q=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Jb=r.getParameter(r.MAX_TEXTURE_SIZE),ac=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),ob=0<Q,nb=ob&&W.get("OES_texture_float"),Kb=W.get("ANGLE_instanced_arrays"),M=r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT),Q=r.getShaderPrecisionFormat(r.VERTEX_SHADER,
-r.MEDIUM_FLOAT),R=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);a=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT);var Yb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(W.get("WEBGL_compressed_texture_pvrtc")||W.get("WEBGL_compressed_texture_s3tc"))for(var b=r.getParameter(r.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),M=0<M.precision&&0<R.precision,Q=0<Q.precision&&0<a.precision;"highp"!==I||M||(Q?(I="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):
-(I="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==I||Q||(I="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Lb=new THREE.SpritePlugin(this,Ra),Mb=new THREE.LensFlarePlugin(this,Sa);this.getContext=function(){return r};this.getContextAttributes=function(){return r.getContextAttributes()};this.forceContextLoss=function(){W.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return ob};
-this.supportsInstancedArrays=function(){return Kb};this.supportsFloatTextures=function(){return W.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return W.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){return W.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return W.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return W.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=
-function(){return W.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=W.get("EXT_texture_filter_anisotropic");return a=null!==b?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return I};this.getPixelRatio=function(){return C};this.setPixelRatio=function(a){void 0!==a&&(C=a)};this.getSize=function(){return{width:E,height:F}};this.setSize=function(a,b,c){E=a;F=b;z.width=a*C;z.height=b*C;!1!==c&&(z.style.width=
-a+"px",z.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ia=a*C;Ca=b*C;ya=c*C;Ja=d*C;r.viewport(Ia,Ca,ya,Ja)};this.setScissor=function(a,b,c,d){r.scissor(a*C,b*C,c*C,d*C)};this.enableScissorTest=function(a){N.setScissorTest(a)};this.getClearColor=function(){return $};this.setClearColor=function(a,c){$.set(a);ja=void 0!==c?c:1;b($.r,$.g,$.b,ja)};this.getClearAlpha=function(){return ja};this.setClearAlpha=function(a){ja=a;b($.r,$.g,$.b,ja)};this.clear=function(a,b,
+if(a===THREE.DstAlphaFactor)return r.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return r.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return r.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return r.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return r.SRC_ALPHA_SATURATE;b=V.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;
+if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=V.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=V.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;
+if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var D=void 0!==a.canvas?a.canvas:document.createElement("canvas"),A=void 0!==a.context?a.context:null,P=D.width,G=D.height,C=1,E=void 0!==a.precision?a.precision:"highp",I=void 0!==a.alpha?a.alpha:!1,M=void 0!==a.depth?a.depth:!0,S=void 0!==a.stencil?a.stencil:!0,U=void 0!==a.antialias?a.antialias:!1,R=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,T=void 0!==a.preserveDrawingBuffer?
+a.preserveDrawingBuffer:!1,L=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,$=new THREE.Color(0),ea=0,fa=[],ma=[],oa=[],Ba=[],Ga=[],Wa=new Float32Array(8),ua=[],Ja=[];this.domElement=D;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;var ka=this,va=[],lb=null,Qa=null,Ya=-1,xa="",Xa=null,gb=0,
+Ha=0,Ia=0,Ca=D.width,wa=D.height,jb=0,kb=0,Za=new THREE.Frustum,Ka=new THREE.Matrix4,na=new THREE.Vector3,ha=new THREE.Vector3,fb=!0,Nb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},Da={programs:0,geometries:0,textures:0},Q={calls:0,vertices:0,faces:0,points:0};
+this.info={render:Q,memory:Da,programs:va};var r;try{a={alpha:I,depth:M,stencil:S,antialias:U,premultipliedAlpha:R,preserveDrawingBuffer:T};r=A||D.getContext("webgl",a)||D.getContext("experimental-webgl",a);if(null===r){if(null!==D.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}D.addEventListener("webglcontextlost",function(a){a.preventDefault();d();c();pa.clear();aa.clear()},!1)}catch(Ib){console.error("THREE.WebGLRenderer: "+
+Ib)}var N=new THREE.WebGLState(r,J);void 0===r.getShaderPrecisionFormat&&(r.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var aa=new THREE.WebGLProperties,pa=new THREE.WebGLObjects(r,aa,this.info),V=new THREE.WebGLExtensions(r);V.get("OES_texture_float");V.get("OES_texture_float_linear");V.get("OES_texture_half_float");V.get("OES_texture_half_float_linear");V.get("OES_standard_derivatives");V.get("ANGLE_instanced_arrays");V.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=
+4294967296);L&&V.get("EXT_frag_depth");c();this.context=r;this.extensions=V;this.state=N;var la=new THREE.WebGLShadowMap(this,fa,pa);this.shadowMap=la;var eb=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),A=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Jb=r.getParameter(r.MAX_TEXTURE_SIZE),ac=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),nb=0<A,mb=nb&&V.get("OES_texture_float"),Kb=V.get("ANGLE_instanced_arrays"),I=r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT),A=r.getShaderPrecisionFormat(r.VERTEX_SHADER,
+r.MEDIUM_FLOAT),M=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);a=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT);var Yb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(V.get("WEBGL_compressed_texture_pvrtc")||V.get("WEBGL_compressed_texture_s3tc"))for(var b=r.getParameter(r.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),I=0<I.precision&&0<M.precision,A=0<A.precision&&0<a.precision;"highp"!==E||I||(A?(E="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):
+(E="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==E||A||(E="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Lb=new THREE.SpritePlugin(this,ua),Mb=new THREE.LensFlarePlugin(this,Ja);this.getContext=function(){return r};this.getContextAttributes=function(){return r.getContextAttributes()};this.forceContextLoss=function(){V.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return nb};
+this.supportsInstancedArrays=function(){return Kb};this.supportsFloatTextures=function(){return V.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return V.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){return V.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return V.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return V.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=
+function(){return V.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=V.get("EXT_texture_filter_anisotropic");return a=null!==b?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return E};this.getPixelRatio=function(){return C};this.setPixelRatio=function(a){void 0!==a&&(C=a)};this.getSize=function(){return{width:P,height:G}};this.setSize=function(a,b,c){P=a;G=b;D.width=a*C;D.height=b*C;!1!==c&&(D.style.width=
+a+"px",D.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ha=a*C;Ia=b*C;Ca=c*C;wa=d*C;r.viewport(Ha,Ia,Ca,wa)};this.setScissor=function(a,b,c,d){r.scissor(a*C,b*C,c*C,d*C)};this.enableScissorTest=function(a){N.setScissorTest(a)};this.getClearColor=function(){return $};this.setClearColor=function(a,c){$.set(a);ea=void 0!==c?c:1;b($.r,$.g,$.b,ea)};this.getClearAlpha=function(){return ea};this.setClearAlpha=function(a){ea=a;b($.r,$.g,$.b,ea)};this.clear=function(a,b,
 c){var d=0;if(void 0===a||a)d|=r.COLOR_BUFFER_BIT;if(void 0===b||b)d|=r.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=r.STENCIL_BUFFER_BIT;r.clear(d)};this.clearColor=function(){r.clear(r.COLOR_BUFFER_BIT)};this.clearDepth=function(){r.clear(r.DEPTH_BUFFER_BIT)};this.clearStencil=function(){r.clear(r.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.renderBufferImmediate=function(a,b,c){N.initAttributes();var d=aa.get(a);a.hasPositions&&
 c){var d=0;if(void 0===a||a)d|=r.COLOR_BUFFER_BIT;if(void 0===b||b)d|=r.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=r.STENCIL_BUFFER_BIT;r.clear(d)};this.clearColor=function(){r.clear(r.COLOR_BUFFER_BIT)};this.clearDepth=function(){r.clear(r.DEPTH_BUFFER_BIT)};this.clearStencil=function(){r.clear(r.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.renderBufferImmediate=function(a,b,c){N.initAttributes();var d=aa.get(a);a.hasPositions&&
 !d.__webglVertexBuffer&&(d.__webglVertexBuffer=r.createBuffer());a.hasNormals&&!d.__webglNormalBuffer&&(d.__webglNormalBuffer=r.createBuffer());a.hasUvs&&!d.__webglUvBuffer&&(d.__webglUvBuffer=r.createBuffer());a.hasColors&&!d.__webglColorBuffer&&(d.__webglColorBuffer=r.createBuffer());b=b.getAttributes();a.hasPositions&&(r.bindBuffer(r.ARRAY_BUFFER,d.__webglVertexBuffer),r.bufferData(r.ARRAY_BUFFER,a.positionArray,r.DYNAMIC_DRAW),N.enableAttribute(b.position),r.vertexAttribPointer(b.position,3,r.FLOAT,
 !d.__webglVertexBuffer&&(d.__webglVertexBuffer=r.createBuffer());a.hasNormals&&!d.__webglNormalBuffer&&(d.__webglNormalBuffer=r.createBuffer());a.hasUvs&&!d.__webglUvBuffer&&(d.__webglUvBuffer=r.createBuffer());a.hasColors&&!d.__webglColorBuffer&&(d.__webglColorBuffer=r.createBuffer());b=b.getAttributes();a.hasPositions&&(r.bindBuffer(r.ARRAY_BUFFER,d.__webglVertexBuffer),r.bufferData(r.ARRAY_BUFFER,a.positionArray,r.DYNAMIC_DRAW),N.enableAttribute(b.position),r.vertexAttribPointer(b.position,3,r.FLOAT,
 !1,0,0));if(a.hasNormals){r.bindBuffer(r.ARRAY_BUFFER,d.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var e,f,g,h,k,l,m,n,p,q,s,t=3*a.count;for(s=0;s<t;s+=9)q=a.normalArray,e=q[s],f=q[s+1],g=q[s+2],h=q[s+3],l=q[s+4],n=q[s+5],k=q[s+6],m=q[s+7],p=q[s+8],e=(e+h+k)/3,f=(f+l+m)/3,g=(g+n+p)/3,q[s]=e,q[s+1]=f,q[s+2]=g,q[s+3]=e,q[s+4]=f,q[s+5]=g,q[s+6]=e,q[s+7]=f,q[s+8]=g}r.bufferData(r.ARRAY_BUFFER,a.normalArray,r.DYNAMIC_DRAW);N.enableAttribute(b.normal);
 !1,0,0));if(a.hasNormals){r.bindBuffer(r.ARRAY_BUFFER,d.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var e,f,g,h,k,l,m,n,p,q,s,t=3*a.count;for(s=0;s<t;s+=9)q=a.normalArray,e=q[s],f=q[s+1],g=q[s+2],h=q[s+3],l=q[s+4],n=q[s+5],k=q[s+6],m=q[s+7],p=q[s+8],e=(e+h+k)/3,f=(f+l+m)/3,g=(g+n+p)/3,q[s]=e,q[s+1]=f,q[s+2]=g,q[s+3]=e,q[s+4]=f,q[s+5]=g,q[s+6]=e,q[s+7]=f,q[s+8]=g}r.bufferData(r.ARRAY_BUFFER,a.normalArray,r.DYNAMIC_DRAW);N.enableAttribute(b.normal);
 r.vertexAttribPointer(b.normal,3,r.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(r.bindBuffer(r.ARRAY_BUFFER,d.__webglUvBuffer),r.bufferData(r.ARRAY_BUFFER,a.uvArray,r.DYNAMIC_DRAW),N.enableAttribute(b.uv),r.vertexAttribPointer(b.uv,2,r.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(r.bindBuffer(r.ARRAY_BUFFER,d.__webglColorBuffer),r.bufferData(r.ARRAY_BUFFER,a.colorArray,r.DYNAMIC_DRAW),N.enableAttribute(b.color),r.vertexAttribPointer(b.color,3,r.FLOAT,!1,0,0));N.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,
 r.vertexAttribPointer(b.normal,3,r.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(r.bindBuffer(r.ARRAY_BUFFER,d.__webglUvBuffer),r.bufferData(r.ARRAY_BUFFER,a.uvArray,r.DYNAMIC_DRAW),N.enableAttribute(b.uv),r.vertexAttribPointer(b.uv,2,r.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(r.bindBuffer(r.ARRAY_BUFFER,d.__webglColorBuffer),r.bufferData(r.ARRAY_BUFFER,a.colorArray,r.DYNAMIC_DRAW),N.enableAttribute(b.color),r.vertexAttribPointer(b.color,3,r.FLOAT,!1,0,0));N.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,
-0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e){if(!1!==d.visible){t(d);var f=ma.geometries.get(e);a=v(a,b,c,d,e);c=!1;b=f.id+"_"+a.id+"_"+(d.wireframe?1:0);b!==Da&&(Da=b,c=!0);b=e.morphTargetInfluences;if(void 0!==b){c=[];for(var g=0,h=b.length;g<h;g++){var m=b[g];c.push([m,g])}c.sort(l);8<c.length&&(c.length=8);g=0;for(h=c.length;g<h;g++)m=c[g],xa[g]=m[0],0!==m[0]?f.addAttribute("morphTarget"+g,f.morphAttributes[m[1]]):f.removeAttribute("morphTarget"+g);b=a.getUniforms();null!==
-b.morphTargetInfluences&&r.uniform1fv(b.morphTargetInfluences,xa);c=!0}if(e instanceof THREE.Mesh)a:{b=c;e=r.TRIANGLES;!0===d.wireframe&&(e=r.LINES,N.setLineWidth(d.wireframeLinewidth*C));var n=f.attributes.index;if(n)if(h=ma.getAttributeBuffer(n),n.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(c=r.UNSIGNED_INT,g=4):(c=r.UNSIGNED_SHORT,g=2),m=f.drawcalls,0===m.length){b&&(k(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h));if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){var p=
-W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}p.drawElementsInstancedANGLE(e,n.array.length,c,0,f.maxInstancedCount)}else r.drawElements(e,n.array.length,c,0);P.calls++;P.vertices+=n.array.length;P.faces+=n.array.length/3}else{b=!0;for(var n=0,q=m.length;n<q;n++){p=m[n].index;b&&(k(d,a,f,p),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h));if(f instanceof
-THREE.InstancedBufferGeometry&&0<m[n].instances){p=W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}p.drawElementsInstancedANGLE(e,m[n].count,c,m[n].start*g,m[n].count,c,m[n].instances)}else r.drawElements(e,m[n].count,c,m[n].start*g);P.calls++;P.vertices+=m[n].count;P.faces+=m[n].count/3}}else if(m=f.drawcalls,0===m.length){b&&k(d,a,f,0);d=f.attributes.position;
-if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){p=W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}d instanceof THREE.InterleavedBufferAttribute?p.drawArraysInstancedANGLE(e,0,d.data.count,f.maxInstancedCount):p.drawArraysInstancedANGLE(e,0,d.count,f.maxInstancedCount)}else d instanceof THREE.InterleavedBufferAttribute?r.drawArrays(e,
-0,d.data.count):r.drawArrays(e,0,d.count);P.calls++;P.vertices+=d.count;P.faces+=d.array.length/3}else for(b&&k(d,a,f,0),n=0,q=m.length;n<q;n++){if(f instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else r.drawArrays(e,m[n].start,m[n].count);P.calls++;P.vertices+=m[n].count;P.faces+=m[n].count/3}}else if(e instanceof THREE.Line)if(b=c,e=e instanceof THREE.LineSegments?r.LINES:r.LINE_STRIP,N.setLineWidth((void 0!==
-d.linewidth?d.linewidth:1)*C),p=f.attributes.index)if(m=ma.getAttributeBuffer(p),p.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(g=r.UNSIGNED_INT,h=4):(g=r.UNSIGNED_SHORT,h=2),c=f.drawcalls,0===c.length)b&&(k(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,m)),r.drawElements(e,p.array.length,g,0),P.calls++,P.vertices+=p.array.length;else for(1<c.length&&(b=!0),p=0,n=c.length;p<n;p++)q=c[p].index,b&&(k(d,a,f,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,m)),r.drawElements(e,c[p].count,g,c[p].start*
-h),P.calls++,P.vertices+=c[p].count;else if(b&&k(d,a,f,0),d=f.attributes.position,c=f.drawcalls,0===c.length)r.drawArrays(e,0,d.array.length/3),P.calls++,P.vertices+=d.array.length/3;else for(p=0,n=c.length;p<n;p++)r.drawArrays(e,c[p].index,c[p].count),P.calls++,P.vertices+=c[p].count;else if(e instanceof THREE.PointCloud)if(e=r.POINTS,p=f.attributes.index)if(m=ma.getAttributeBuffer(p),p.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(g=r.UNSIGNED_INT,h=4):(g=r.UNSIGNED_SHORT,h=2),
-b=f.drawcalls,0===b.length)c&&(k(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,m)),r.drawElements(e,p.array.length,g,0),P.calls++,P.points+=p.array.length;else for(1<b.length&&(c=!0),p=0,n=b.length;p<n;p++)q=b[p].index,c&&(k(d,a,f,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,m)),r.drawElements(e,b[p].count,g,b[p].start*h),P.calls++,P.points+=b[p].count;else if(c&&k(d,a,f,0),d=f.attributes.position,b=f.drawcalls,0===b.length)r.drawArrays(e,0,d.array.length/3),P.calls++,P.points+=d.array.length/3;else for(p=
-0,n=b.length;p<n;p++)r.drawArrays(e,b[p].index,b[p].count),P.calls++,P.points+=b[p].count}};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;Da="";Za=-1;Ya=null;gb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Ka.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);$a.setFromMatrix(Ka);ga.length=
-0;ra.length=0;va.length=0;pa.length=0;Qa.length=0;Ra.length=0;Sa.length=0;m(a);!0===ka.sortObjects&&(ra.sort(n),va.sort(p));ma.update(ra);ma.update(va);la.render(a,b);P.calls=0;P.vertices=0;P.faces=0;P.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,q(ra,b,ga,e,d),q(va,b,ga,e,d),s(pa,b,ga,e,d),s(Qa,b,ga,e,d)):(N.setBlending(THREE.NoBlending),q(ra,b,ga,e,null),s(pa,b,ga,e,null),
-q(va,b,ga,e,null),s(Qa,b,ga,e,null));Lb.render(a,b);Mb.render(a,b,kb,lb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(N.bindTexture(r.TEXTURE_CUBE_MAP,aa.get(c).__webglTexture),r.generateMipmap(r.TEXTURE_CUBE_MAP),N.bindTexture(r.TEXTURE_CUBE_MAP,null)):(N.bindTexture(r.TEXTURE_2D,aa.get(c).__webglTexture),r.generateMipmap(r.TEXTURE_2D),N.bindTexture(r.TEXTURE_2D,null)));N.setDepthTest(!0);N.setDepthWrite(!0);
-N.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){t(d);var f=v(a,b,c,d,e);Da="";e.render(function(a){ka.renderBufferImmediate(a,f,d)})};var Zb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?N.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?
-r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):a===THREE.CullFaceFront?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),N.enable(r.CULL_FACE))};this.setMaterialFaces=u;this.setTexture=function(a,b){var c=aa.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",
-a);else{void 0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",e),c.__webglTexture=r.createTexture(),Ea.textures++);N.activeTexture(r.TEXTURE0+b);N.bindTexture(r.TEXTURE_2D,c.__webglTexture);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);r.pixelStorei(r.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=G(a.image,Jb);var f=a.image,d=THREE.Math.isPowerOfTwo(f.width)&&THREE.Math.isPowerOfTwo(f.height),g=D(a.format),
-h=D(a.type);H(r.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<k.length&&d){for(var l=0,m=k.length;l<m;l++)f=k[l],N.texImage2D(r.TEXTURE_2D,l,g,f.width,f.height,0,g,h,f.data);a.generateMipmaps=!1}else N.texImage2D(r.TEXTURE_2D,0,g,f.width,f.height,0,g,h,f.data);else if(a instanceof THREE.CompressedTexture)for(l=0,m=k.length;l<m;l++)f=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Yb().indexOf(g)?N.compressedTexImage2D(r.TEXTURE_2D,l,g,f.width,f.height,0,f.data):
-console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):N.texImage2D(r.TEXTURE_2D,l,g,f.width,f.height,0,g,h,f.data);else if(0<k.length&&d){l=0;for(m=k.length;l<m;l++)f=k[l],N.texImage2D(r.TEXTURE_2D,l,g,g,h,f);a.generateMipmaps=!1}else N.texImage2D(r.TEXTURE_2D,0,g,g,h,a.image);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else N.activeTexture(r.TEXTURE0+b),N.bindTexture(r.TEXTURE_2D,
-c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===aa.get(a).__webglFramebuffer){var c=aa.get(a);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",g);c.__webglTexture=r.createTexture();Ea.textures++;var d=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),e=D(a.format),f=D(a.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];N.bindTexture(r.TEXTURE_CUBE_MAP,
-c.__webglTexture);H(r.TEXTURE_CUBE_MAP,a,d);for(var h=0;6>h;h++)c.__webglFramebuffer[h]=r.createFramebuffer(),c.__webglRenderbuffer[h]=r.createRenderbuffer(),N.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,e,a.width,a.height,0,e,f,null),x(c.__webglFramebuffer[h],a,r.TEXTURE_CUBE_MAP_POSITIVE_X+h),A(c.__webglRenderbuffer[h],a);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=r.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:
-r.createRenderbuffer(),N.bindTexture(r.TEXTURE_2D,c.__webglTexture),H(r.TEXTURE_2D,a,d),N.texImage2D(r.TEXTURE_2D,0,e,a.width,a.height,0,e,f,null),x(c.__webglFramebuffer,a,r.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):A(c.__webglRenderbuffer,a),a.generateMipmaps&&
-d&&r.generateMipmap(r.TEXTURE_2D);b?N.bindTexture(r.TEXTURE_CUBE_MAP,null):N.bindTexture(r.TEXTURE_2D,null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(c=aa.get(a),b=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=ya,a=Ja,d=Ia,e=Ca);b!==Ha&&(r.bindFramebuffer(r.FRAMEBUFFER,b),r.viewport(d,e,c,a),Ha=b);kb=c;lb=a};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
-else if(aa.get(a).__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;aa.get(a).__webglFramebuffer!==Ha&&(r.bindFramebuffer(r.FRAMEBUFFER,aa.get(a).__webglFramebuffer),g=!0);r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,r.RGBA,r.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");
-g&&r.bindFramebuffer(r.FRAMEBUFFER,Ha)}};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return la.enabled},
-set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");la.enabled=a}},shadowMapType:{get:function(){return la.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");la.type=a}},shadowMapCullFace:{get:function(){return la.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");la.cullFace=a}},shadowMapDebug:{get:function(){return la.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");
-la.debug=a}},shadowMapCascade:{get:function(){return la.cascade},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCascade is now .shadowMap.cascade.");la.cascade=a}}})};
+0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e){if(!1!==d.visible){t(d);var f=pa.geometries.get(e);a=u(a,b,c,d,e);b=!1;c=f.id+"_"+a.id+"_"+(d.wireframe?1:0);c!==xa&&(xa=c,b=!0);var g=e.morphTargetInfluences;if(void 0!==g){b=[];c=0;for(var h=g.length;c<h;c++){var m=g[c];b.push([m,c])}b.sort(l);8<b.length&&(b.length=8);g=f.morphAttributes;c=0;for(h=b.length;c<h;c++)m=b[c],Wa[c]=m[0],0!==m[0]?(m=m[1],!0===d.morphTargets&&f.addAttribute("morphTarget"+c,g.position[m]),!0===d.morphNormals&&
+f.addAttribute("morphNormal"+c,g.normal[m])):(!0===d.morphTargets&&f.removeAttribute("morphTarget"+c),!0===d.morphNormals&&f.removeAttribute("morphNormal"+c));b=a.getUniforms();null!==b.morphTargetInfluences&&r.uniform1fv(b.morphTargetInfluences,Wa);b=!0}if(e instanceof THREE.Mesh)a:{e=r.TRIANGLES;!0===d.wireframe&&(e=r.LINES,N.setLineWidth(d.wireframeLinewidth*C));var n=f.attributes.index;if(n)if(g=pa.getAttributeBuffer(n),n.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(c=r.UNSIGNED_INT,
+h=4):(c=r.UNSIGNED_SHORT,h=2),m=f.drawcalls,0===m.length){b&&(k(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,g));if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){var p=V.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}p.drawElementsInstancedANGLE(e,n.array.length,c,0,f.maxInstancedCount)}else r.drawElements(e,n.array.length,c,
+0);Q.calls++;Q.vertices+=n.array.length;Q.faces+=n.array.length/3}else{b=!0;for(var n=0,q=m.length;n<q;n++){p=m[n].index;b&&(k(d,a,f,p),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,g));if(f instanceof THREE.InstancedBufferGeometry&&0<m[n].instances){p=V.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}p.drawElementsInstancedANGLE(e,m[n].count,c,m[n].start*h,
+m[n].count,c,m[n].instances)}else r.drawElements(e,m[n].count,c,m[n].start*h);Q.calls++;Q.vertices+=m[n].count;Q.faces+=m[n].count/3}}else if(m=f.drawcalls,0===m.length){b&&k(d,a,f,0);d=f.attributes.position;if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){p=V.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}d instanceof THREE.InterleavedBufferAttribute?
+p.drawArraysInstancedANGLE(e,0,d.data.count,f.maxInstancedCount):p.drawArraysInstancedANGLE(e,0,d.count,f.maxInstancedCount)}else d instanceof THREE.InterleavedBufferAttribute?r.drawArrays(e,0,d.data.count):r.drawArrays(e,0,d.count);Q.calls++;Q.vertices+=d.count;Q.faces+=d.array.length/3}else for(b&&k(d,a,f,0),n=0,q=m.length;n<q;n++){if(f instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else r.drawArrays(e,
+m[n].start,m[n].count);Q.calls++;Q.vertices+=m[n].count;Q.faces+=m[n].count/3}}else if(e instanceof THREE.Line)if(e=e instanceof THREE.LineSegments?r.LINES:r.LINE_STRIP,N.setLineWidth((void 0!==d.linewidth?d.linewidth:1)*C),p=f.attributes.index)if(m=pa.getAttributeBuffer(p),p.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(h=r.UNSIGNED_INT,g=4):(h=r.UNSIGNED_SHORT,g=2),c=f.drawcalls,0===c.length)b&&(k(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,m)),r.drawElements(e,p.array.length,
+h,0),Q.calls++,Q.vertices+=p.array.length;else for(1<c.length&&(b=!0),p=0,n=c.length;p<n;p++)q=c[p].index,b&&(k(d,a,f,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,m)),r.drawElements(e,c[p].count,h,c[p].start*g),Q.calls++,Q.vertices+=c[p].count;else if(b&&k(d,a,f,0),d=f.attributes.position,c=f.drawcalls,0===c.length)r.drawArrays(e,0,d.array.length/3),Q.calls++,Q.vertices+=d.array.length/3;else for(p=0,n=c.length;p<n;p++)r.drawArrays(e,c[p].index,c[p].count),Q.calls++,Q.vertices+=c[p].count;else if(e instanceof
+THREE.PointCloud)if(c=b,e=r.POINTS,p=f.attributes.index)if(m=pa.getAttributeBuffer(p),p.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(h=r.UNSIGNED_INT,g=4):(h=r.UNSIGNED_SHORT,g=2),b=f.drawcalls,0===b.length)c&&(k(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,m)),r.drawElements(e,p.array.length,h,0),Q.calls++,Q.points+=p.array.length;else for(1<b.length&&(c=!0),p=0,n=b.length;p<n;p++)q=b[p].index,c&&(k(d,a,f,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,m)),r.drawElements(e,b[p].count,h,
+b[p].start*g),Q.calls++,Q.points+=b[p].count;else if(c&&k(d,a,f,0),d=f.attributes.position,b=f.drawcalls,0===b.length)r.drawArrays(e,0,d.array.length/3),Q.calls++,Q.points+=d.array.length/3;else for(p=0,n=b.length;p<n;p++)r.drawArrays(e,b[p].index,b[p].count),Q.calls++,Q.points+=b[p].count}};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;xa="";Ya=-1;Xa=null;fb=!0;!0===a.autoUpdate&&
+a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Ka.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Za.setFromMatrix(Ka);fa.length=0;ma.length=0;oa.length=0;Ba.length=0;Ga.length=0;ua.length=0;Ja.length=0;m(a);!0===ka.sortObjects&&(ma.sort(n),oa.sort(p));pa.update(ma);pa.update(oa);la.render(a,b);Q.calls=0;Q.vertices=0;Q.faces=0;Q.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,
+this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,q(ma,b,fa,e,d),q(oa,b,fa,e,d),s(Ba,b,fa,e,d),s(Ga,b,fa,e,d)):(N.setBlending(THREE.NoBlending),q(ma,b,fa,e,null),s(Ba,b,fa,e,null),q(oa,b,fa,e,null),s(Ga,b,fa,e,null));Lb.render(a,b);Mb.render(a,b,jb,kb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(N.bindTexture(r.TEXTURE_CUBE_MAP,aa.get(c).__webglTexture),r.generateMipmap(r.TEXTURE_CUBE_MAP),N.bindTexture(r.TEXTURE_CUBE_MAP,
+null)):(N.bindTexture(r.TEXTURE_2D,aa.get(c).__webglTexture),r.generateMipmap(r.TEXTURE_2D),N.bindTexture(r.TEXTURE_2D,null)));N.setDepthTest(!0);N.setDepthWrite(!0);N.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){t(d);var f=u(a,b,c,d,e);xa="";e.render(function(a){ka.renderBufferImmediate(a,f,d)})};var Zb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",
+PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?N.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):a===THREE.CullFaceFront?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),N.enable(r.CULL_FACE))};this.setTexture=function(a,b){var c=aa.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",
+a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a);else{void 0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",e),c.__webglTexture=r.createTexture(),Da.textures++);N.activeTexture(r.TEXTURE0+b);N.bindTexture(r.TEXTURE_2D,c.__webglTexture);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);r.pixelStorei(r.UNPACK_ALIGNMENT,a.unpackAlignment);
+a.image=H(a.image,Jb);var f=a.image,d=THREE.Math.isPowerOfTwo(f.width)&&THREE.Math.isPowerOfTwo(f.height),g=J(a.format),h=J(a.type);x(r.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<k.length&&d){for(var m=0,l=k.length;m<l;m++)f=k[m],N.texImage2D(r.TEXTURE_2D,m,g,f.width,f.height,0,g,h,f.data);a.generateMipmaps=!1}else N.texImage2D(r.TEXTURE_2D,0,g,f.width,f.height,0,g,h,f.data);else if(a instanceof THREE.CompressedTexture)for(m=0,l=k.length;m<l;m++)f=k[m],a.format!==THREE.RGBAFormat&&
+a.format!==THREE.RGBFormat?-1<Yb().indexOf(g)?N.compressedTexImage2D(r.TEXTURE_2D,m,g,f.width,f.height,0,f.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):N.texImage2D(r.TEXTURE_2D,m,g,f.width,f.height,0,g,h,f.data);else if(0<k.length&&d){m=0;for(l=k.length;m<l;m++)f=k[m],N.texImage2D(r.TEXTURE_2D,m,g,g,h,f);a.generateMipmaps=!1}else N.texImage2D(r.TEXTURE_2D,0,g,g,h,a.image);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);
+c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else N.activeTexture(r.TEXTURE0+b),N.bindTexture(r.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===aa.get(a).__webglFramebuffer){var c=aa.get(a);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",g);c.__webglTexture=r.createTexture();Da.textures++;var d=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),
+e=J(a.format),f=J(a.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];N.bindTexture(r.TEXTURE_CUBE_MAP,c.__webglTexture);x(r.TEXTURE_CUBE_MAP,a,d);for(var h=0;6>h;h++)c.__webglFramebuffer[h]=r.createFramebuffer(),c.__webglRenderbuffer[h]=r.createRenderbuffer(),N.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,e,a.width,a.height,0,e,f,null),F(c.__webglFramebuffer[h],a,r.TEXTURE_CUBE_MAP_POSITIVE_X+h),y(c.__webglRenderbuffer[h],a);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=
+r.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:r.createRenderbuffer(),N.bindTexture(r.TEXTURE_2D,c.__webglTexture),x(r.TEXTURE_2D,a,d),N.texImage2D(r.TEXTURE_2D,0,e,a.width,a.height,0,e,f,null),F(c.__webglFramebuffer,a,r.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,
+r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):y(c.__webglRenderbuffer,a),a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);b?N.bindTexture(r.TEXTURE_CUBE_MAP,null):N.bindTexture(r.TEXTURE_2D,null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(c=aa.get(a),b=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Ca,a=wa,d=Ha,e=Ia);b!==Qa&&(r.bindFramebuffer(r.FRAMEBUFFER,b),r.viewport(d,e,c,a),Qa=b);
+jb=c;kb=a};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(aa.get(a).__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;aa.get(a).__webglFramebuffer!==Qa&&(r.bindFramebuffer(r.FRAMEBUFFER,aa.get(a).__webglFramebuffer),
+g=!0);r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,r.RGBA,r.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&r.bindFramebuffer(r.FRAMEBUFFER,Qa)}};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=
+function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return la.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");la.enabled=a}},shadowMapType:{get:function(){return la.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");
+la.type=a}},shadowMapCullFace:{get:function(){return la.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");la.cullFace=a}},shadowMapDebug:{get:function(){return la.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");la.debug=a}},shadowMapCascade:{get:function(){return la.cascade},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCascade is now .shadowMap.cascade.");la.cascade=a}}})};
 THREE.WebGLRenderTarget=function(a,b,c){this.uuid=THREE.Math.generateUUID();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,
 THREE.WebGLRenderTarget=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,
 1);this.format=void 0!==c.format?c.format:THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null};
 1);this.format=void 0!==c.format?c.format:THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null};
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose()},copy:function(a){this.width=a.width;this.height=a.height;this.wrapS=a.wrapS;this.wrapT=a.wrapT;this.magFilter=a.magFilter;this.minFilter=a.minFilter;this.anisotropy=a.anisotropy;this.offset.copy(a.offset);this.repeat.copy(a.repeat);this.format=a.format;this.type=a.type;this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose()},copy:function(a){this.width=a.width;this.height=a.height;this.wrapS=a.wrapS;this.wrapT=a.wrapT;this.magFilter=a.magFilter;this.minFilter=a.minFilter;this.anisotropy=a.anisotropy;this.offset.copy(a.offset);this.repeat.copy(a.repeat);this.format=a.format;this.type=a.type;this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;
@@ -596,11 +596,11 @@ d);b instanceof THREE.BufferGeometry?e[b.id]=b:b instanceof THREE.Geometry&&(voi
 THREE.WebGLObjects=function(a,b,c){function d(a){a.target.traverse(function(a){a.removeEventListener("remove",d);(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)&&delete g[a.id];delete a._modelViewMatrix;delete a._normalMatrix;b.delete(a)})}function e(c,d){var e="index"===d?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,f=c instanceof THREE.InterleavedBufferAttribute?c.data:c,g=b.get(f);if(void 0===g.__webglBuffer){g.__webglBuffer=a.createBuffer();a.bindBuffer(e,g.__webglBuffer);
 THREE.WebGLObjects=function(a,b,c){function d(a){a.target.traverse(function(a){a.removeEventListener("remove",d);(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)&&delete g[a.id];delete a._modelViewMatrix;delete a._normalMatrix;b.delete(a)})}function e(c,d){var e="index"===d?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,f=c instanceof THREE.InterleavedBufferAttribute?c.data:c,g=b.get(f);if(void 0===g.__webglBuffer){g.__webglBuffer=a.createBuffer();a.bindBuffer(e,g.__webglBuffer);
 var m=a.STATIC_DRAW;if(f instanceof THREE.DynamicBufferAttribute||f instanceof THREE.InstancedBufferAttribute&&!0===f.dynamic||f instanceof THREE.InterleavedBuffer&&!0===f.dynamic)m=a.DYNAMIC_DRAW;a.bufferData(e,f.array,m);g.version=f.version}else g.version!==f.version&&(a.bindBuffer(e,g.__webglBuffer),void 0===f.updateRange||-1===f.updateRange.count?a.bufferSubData(e,0,f.array):0===f.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
 var m=a.STATIC_DRAW;if(f instanceof THREE.DynamicBufferAttribute||f instanceof THREE.InstancedBufferAttribute&&!0===f.dynamic||f instanceof THREE.InterleavedBuffer&&!0===f.dynamic)m=a.DYNAMIC_DRAW;a.bufferData(e,f.array,m);g.version=f.version}else g.version!==f.version&&(a.bindBuffer(e,g.__webglBuffer),void 0===f.updateRange||-1===f.updateRange.count?a.bufferSubData(e,0,f.array):0===f.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
 (a.bufferSubData(e,f.updateRange.offset*f.array.BYTES_PER_ELEMENT,f.array.subarray(f.updateRange.offset,f.updateRange.offset+f.updateRange.count)),f.updateRange.count=0),g.version=f.version)}var g={},f=new THREE.WebGLGeometries(a,b,c);this.objects=g;this.geometries=f;this.init=function(a){var c=b.get(a);void 0===c.__webglInit&&(c.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",d));void 0===c.__webglActive&&(c.__webglActive=!0,a instanceof
 (a.bufferSubData(e,f.updateRange.offset*f.array.BYTES_PER_ELEMENT,f.array.subarray(f.updateRange.offset,f.updateRange.offset+f.updateRange.count)),f.updateRange.count=0),g.version=f.version)}var g={},f=new THREE.WebGLGeometries(a,b,c);this.objects=g;this.geometries=f;this.init=function(a){var c=b.get(a);void 0===c.__webglInit&&(c.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",d));void 0===c.__webglActive&&(c.__webglActive=!0,a instanceof
-THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud)&&(g[a.id]={id:a.id,object:a,z:0})};this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.update=function(a){for(var b=0,c=a.length;b<c;b++){var d=a[b].object;if(!1!==d.material.visible){var g=d,d=f.get(g);g.geometry instanceof THREE.Geometry&&d.updateFromObject(g);var g=d.attributes,m=void 0;for(m in g)e(g[m],m);d=d.morphAttributes;g=0;for(m=
-d.length;g<m;g++)e(d[g],g)}}};this.clear=function(){g={}}};
+THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud)&&(g[a.id]={id:a.id,object:a,z:0})};this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.update=function(a){for(var b=0,c=a.length;b<c;b++){var d=a[b].object;if(!1!==d.material.visible){var g=f.get(d);d.geometry instanceof THREE.Geometry&&g.updateFromObject(d);var m=g.attributes,d=void 0;for(d in m)e(m[d],d);g=g.morphAttributes;for(d in g)for(var m=
+g[d],q=0,s=m.length;q<s;q++)e(m[q],q)}}};this.clear=function(){g={}}};
 THREE.WebGLProgram=function(){function a(a){var b=[],c;for(c in a){var f=a[c];!1!==f&&b.push("#define "+c+" "+f)}return b.join("\n")}function b(a){return""!==a}var c=0;return function(d,e,g,f){var h=d.context,k=g.defines,l=g.__webglShader.vertexShader,n=g.__webglShader.fragmentShader,p="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?p="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(p="SHADOWMAP_TYPE_PCF_SOFT");var m="ENVMAP_TYPE_CUBE",q="ENVMAP_MODE_REFLECTION",s="ENVMAP_BLENDING_MULTIPLY";
 THREE.WebGLProgram=function(){function a(a){var b=[],c;for(c in a){var f=a[c];!1!==f&&b.push("#define "+c+" "+f)}return b.join("\n")}function b(a){return""!==a}var c=0;return function(d,e,g,f){var h=d.context,k=g.defines,l=g.__webglShader.vertexShader,n=g.__webglShader.fragmentShader,p="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?p="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(p="SHADOWMAP_TYPE_PCF_SOFT");var m="ENVMAP_TYPE_CUBE",q="ENVMAP_MODE_REFLECTION",s="ENVMAP_BLENDING_MULTIPLY";
 if(f.envMap){switch(g.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:m="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:m="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:m="ENVMAP_TYPE_SPHERE"}switch(g.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:q="ENVMAP_MODE_REFRACTION"}switch(g.combine){case THREE.MultiplyOperation:s="ENVMAP_BLENDING_MULTIPLY";
 if(f.envMap){switch(g.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:m="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:m="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:m="ENVMAP_TYPE_SPHERE"}switch(g.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:q="ENVMAP_MODE_REFRACTION"}switch(g.combine){case THREE.MultiplyOperation:s="ENVMAP_BLENDING_MULTIPLY";
-break;case THREE.MixOperation:s="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:s="ENVMAP_BLENDING_ADD"}}var t=0<d.gammaFactor?d.gammaFactor:1,u=a(k),v=h.createProgram();g instanceof THREE.RawShaderMaterial?d=k="":(k=["precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+g.__webglShader.name,u,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+t,"#define MAX_DIR_LIGHTS "+
+break;case THREE.MixOperation:s="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:s="ENVMAP_BLENDING_ADD"}}var t=0<d.gammaFactor?d.gammaFactor:1,u=a(k),w=h.createProgram();g instanceof THREE.RawShaderMaterial?d=k="":(k=["precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+g.__webglShader.name,u,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+t,"#define MAX_DIR_LIGHTS "+
 f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,"#define MAX_BONES "+f.maxBones,f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+q:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":
 f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,"#define MAX_BONES "+f.maxBones,f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+q:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":
 "",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.skinning?"#define USE_SKINNING":"",f.useVertexTexture?"#define BONE_TEXTURE":"",f.morphTargets?"#define USE_MORPHTARGETS":"",f.morphNormals?"#define USE_MORPHNORMALS":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+p:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?
 "",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.skinning?"#define USE_SKINNING":"",f.useVertexTexture?"#define BONE_TEXTURE":"",f.morphTargets?"#define USE_MORPHTARGETS":"",f.morphNormals?"#define USE_MORPHNORMALS":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+p:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?
 "#define SHADOWMAP_CASCADE":"",f.sizeAttenuation?"#define USE_SIZEATTENUATION":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR",
 "#define SHADOWMAP_CASCADE":"",f.sizeAttenuation?"#define USE_SIZEATTENUATION":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR",
@@ -608,63 +608,63 @@ f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LI
 "\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(b).join("\n"),d=[f.bumpMap||f.normalMap||f.flatShading||g.derivatives?"#extension GL_OES_standard_derivatives : enable":"","precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+g.__webglShader.name,u,"#define MAX_DIR_LIGHTS "+f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+
 "\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(b).join("\n"),d=[f.bumpMap||f.normalMap||f.flatShading||g.derivatives?"#extension GL_OES_standard_derivatives : enable":"","precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+g.__webglShader.name,u,"#define MAX_DIR_LIGHTS "+f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+
 f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,f.alphaTest?"#define ALPHATEST "+f.alphaTest:"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+t,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+m:"",f.envMap?"#define "+q:"",f.envMap?"#define "+s:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":
 f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,f.alphaTest?"#define ALPHATEST "+f.alphaTest:"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+t,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+m:"",f.envMap?"#define "+q:"",f.envMap?"#define "+s:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":
 "",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.metal?"#define METAL":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+p:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?"#define SHADOWMAP_CASCADE":
 "",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.metal?"#define METAL":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+p:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?"#define SHADOWMAP_CASCADE":
-"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(b).join("\n"));n=d+n;l=THREE.WebGLShader(h,h.VERTEX_SHADER,k+l);n=THREE.WebGLShader(h,h.FRAGMENT_SHADER,n);h.attachShader(v,l);h.attachShader(v,n);void 0!==g.index0AttributeName?h.bindAttribLocation(v,0,g.index0AttributeName):!0===f.morphTargets&&h.bindAttribLocation(v,0,"position");
-h.linkProgram(v);f=h.getProgramInfoLog(v);p=h.getShaderInfoLog(l);m=h.getShaderInfoLog(n);s=q=!0;if(!1===h.getProgramParameter(v,h.LINK_STATUS))q=!1,console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(v,h.VALIDATE_STATUS),"gl.getProgramInfoLog",f,p,m);else if(""!==f)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f);else if(""===p||""===m)s=!1;s&&(this.diagnostics={runnable:q,material:g,programLog:f,vertexShader:{log:p,prefix:k},fragmentShader:{log:m,
-prefix:d}});h.deleteShader(l);h.deleteShader(n);var w;this.getUniforms=function(){if(void 0===w){for(var a={},b=h.getProgramParameter(v,h.ACTIVE_UNIFORMS),c=0;c<b;c++){var d=h.getActiveUniform(v,c).name,e=h.getUniformLocation(v,d),f=d.lastIndexOf("[0]");-1!==f&&f===d.length-3&&(a[d.substr(0,f)]=e);a[d]=e}w=a}return w};var B;this.getAttributes=function(){if(void 0===B){for(var a={},b=h.getProgramParameter(v,h.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=h.getActiveAttrib(v,c).name;a[d]=h.getAttribLocation(v,
-d)}B=a}return B};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");return this.getAttributes()}}});this.id=c++;this.code=e;this.usedTimes=1;this.program=v;this.vertexShader=l;this.fragmentShader=n;return this}}();
+"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(b).join("\n"));n=d+n;l=THREE.WebGLShader(h,h.VERTEX_SHADER,k+l);n=THREE.WebGLShader(h,h.FRAGMENT_SHADER,n);h.attachShader(w,l);h.attachShader(w,n);void 0!==g.index0AttributeName?h.bindAttribLocation(w,0,g.index0AttributeName):!0===f.morphTargets&&h.bindAttribLocation(w,0,"position");
+h.linkProgram(w);f=h.getProgramInfoLog(w);p=h.getShaderInfoLog(l);m=h.getShaderInfoLog(n);s=q=!0;if(!1===h.getProgramParameter(w,h.LINK_STATUS))q=!1,console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(w,h.VALIDATE_STATUS),"gl.getProgramInfoLog",f,p,m);else if(""!==f)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f);else if(""===p||""===m)s=!1;s&&(this.diagnostics={runnable:q,material:g,programLog:f,vertexShader:{log:p,prefix:k},fragmentShader:{log:m,
+prefix:d}});h.deleteShader(l);h.deleteShader(n);var v;this.getUniforms=function(){if(void 0===v){for(var a={},b=h.getProgramParameter(w,h.ACTIVE_UNIFORMS),c=0;c<b;c++){var d=h.getActiveUniform(w,c).name,e=h.getUniformLocation(w,d),f=d.lastIndexOf("[0]");-1!==f&&f===d.length-3&&(a[d.substr(0,f)]=e);a[d]=e}v=a}return v};var z;this.getAttributes=function(){if(void 0===z){for(var a={},b=h.getProgramParameter(w,h.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=h.getActiveAttrib(w,c).name;a[d]=h.getAttribLocation(w,
+d)}z=a}return z};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");return this.getAttributes()}}});this.id=c++;this.code=e;this.usedTimes=1;this.program=w;this.vertexShader=l;this.fragmentShader=n;return this}}();
 THREE.WebGLProperties=function(){var a={};this.get=function(b){b=b.uuid;var c=a[b];void 0===c&&(c={},a[b]=c);return c};this.delete=function(b){delete a[b.uuid]};this.clear=function(){a={}}};
 THREE.WebGLProperties=function(){var a={};this.get=function(b){b=b.uuid;var c=a[b];void 0===c&&(c={},a[b]=c);return c};this.delete=function(b){delete a[b.uuid]};this.clear=function(){a={}}};
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){var e=b.createShader(c);b.shaderSource(e,d);b.compileShader(e);!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(e)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",c===b.VERTEX_SHADER?"vertex":"fragment",b.getShaderInfoLog(e),a(d));return e}}();
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){var e=b.createShader(c);b.shaderSource(e,d);b.compileShader(e);!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(e)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",c===b.VERTEX_SHADER?"vertex":"fragment",b.getShaderInfoLog(e),a(d));return e}}();
 THREE.WebGLShadowMap=function(a,b,c){function d(a,b){if(!0===a.visible){var e=c.objects[a.id];e&&a.castShadow&&(!1===a.frustumCulled||!0===f.intersectsObject(a))&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),p.push(e));for(var e=0,g=a.children.length;e<g;e++)d(a.children[e],b)}}var e=a.context,g=a.state,f=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=[],m=THREE.ShaderLib.depthRGBA,q=THREE.UniformsUtils.clone(m.uniforms),
 THREE.WebGLShadowMap=function(a,b,c){function d(a,b){if(!0===a.visible){var e=c.objects[a.id];e&&a.castShadow&&(!1===a.frustumCulled||!0===f.intersectsObject(a))&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),p.push(e));for(var e=0,g=a.children.length;e<g;e++)d(a.children[e],b)}}var e=a.context,g=a.state,f=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=[],m=THREE.ShaderLib.depthRGBA,q=THREE.UniformsUtils.clone(m.uniforms),
-s=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}),t=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0}),u=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,skinning:!0}),v=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0,skinning:!0});s._shadowPass=!0;t._shadowPass=!0;u._shadowPass=
-!0;v._shadowPass=!0;var w=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=!1;this.render=function(c,m){if(!1!==w.enabled&&(!1!==w.autoUpdate||!1!==w.needsUpdate)){var q,G,x,A,K,D,z,Q=[];A=0;e.clearColor(1,1,1,1);g.disable(e.BLEND);g.enable(e.CULL_FACE);e.frontFace(e.CCW);w.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);g.setDepthTest(!0);q=0;for(G=b.length;q<G;q++)if(x=b[q],x.castShadow)if(x instanceof
-THREE.DirectionalLight&&x.shadowCascade)for(K=0;K<x.shadowCascadeCount;K++){var E;if(x.shadowCascadeArray[K])E=x.shadowCascadeArray[K];else{z=x;var F=K;E=new THREE.DirectionalLight;E.isVirtual=!0;E.onlyShadow=!0;E.castShadow=!0;E.shadowCameraNear=z.shadowCameraNear;E.shadowCameraFar=z.shadowCameraFar;E.shadowCameraLeft=z.shadowCameraLeft;E.shadowCameraRight=z.shadowCameraRight;E.shadowCameraBottom=z.shadowCameraBottom;E.shadowCameraTop=z.shadowCameraTop;E.shadowCameraVisible=z.shadowCameraVisible;
-E.shadowDarkness=z.shadowDarkness;E.shadowBias=z.shadowCascadeBias[F];E.shadowMapWidth=z.shadowCascadeWidth[F];E.shadowMapHeight=z.shadowCascadeHeight[F];E.pointsWorld=[];E.pointsFrustum=[];var C=E.pointsWorld;D=E.pointsFrustum;for(var I=0;8>I;I++)C[I]=new THREE.Vector3,D[I]=new THREE.Vector3;C=z.shadowCascadeNearZ[F];z=z.shadowCascadeFarZ[F];D[0].set(-1,-1,C);D[1].set(1,-1,C);D[2].set(-1,1,C);D[3].set(1,1,C);D[4].set(-1,-1,z);D[5].set(1,-1,z);D[6].set(-1,1,z);D[7].set(1,1,z);E.originalCamera=m;D=
-new THREE.Gyroscope;D.position.copy(x.shadowCascadeOffset);D.add(E);D.add(E.target);m.add(D);x.shadowCascadeArray[K]=E}F=x;C=K;z=F.shadowCascadeArray[C];z.position.copy(F.position);z.target.position.copy(F.target.position);z.lookAt(z.target);z.shadowCameraVisible=F.shadowCameraVisible;z.shadowDarkness=F.shadowDarkness;z.shadowBias=F.shadowCascadeBias[C];D=F.shadowCascadeNearZ[C];F=F.shadowCascadeFarZ[C];z=z.pointsFrustum;z[0].z=D;z[1].z=D;z[2].z=D;z[3].z=D;z[4].z=F;z[5].z=F;z[6].z=F;z[7].z=F;Q[A]=
-E;A++}else Q[A]=x,A++;q=0;for(G=Q.length;q<G;q++){x=Q[q];x.shadowMap||(K=THREE.LinearFilter,w.type===THREE.PCFSoftShadowMap&&(K=THREE.NearestFilter),x.shadowMap=new THREE.WebGLRenderTarget(x.shadowMapWidth,x.shadowMapHeight,{minFilter:K,magFilter:K,format:THREE.RGBAFormat}),x.shadowMapSize=new THREE.Vector2(x.shadowMapWidth,x.shadowMapHeight),x.shadowMatrix=new THREE.Matrix4);if(!x.shadowCamera){if(x instanceof THREE.SpotLight)x.shadowCamera=new THREE.PerspectiveCamera(x.shadowCameraFov,x.shadowMapWidth/
-x.shadowMapHeight,x.shadowCameraNear,x.shadowCameraFar);else if(x instanceof THREE.DirectionalLight)x.shadowCamera=new THREE.OrthographicCamera(x.shadowCameraLeft,x.shadowCameraRight,x.shadowCameraTop,x.shadowCameraBottom,x.shadowCameraNear,x.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",x);continue}c.add(x.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}x.shadowCameraVisible&&!x.cameraHelper&&(x.cameraHelper=new THREE.CameraHelper(x.shadowCamera),
-c.add(x.cameraHelper));if(x.isVirtual&&E.originalCamera==m){K=m;A=x.shadowCamera;D=x.pointsFrustum;z=x.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(F=0;8>F;F++)C=z[F],C.copy(D[F]),C.unproject(K),C.applyMatrix4(A.matrixWorldInverse),C.x<k.x&&(k.x=C.x),C.x>l.x&&(l.x=C.x),C.y<k.y&&(k.y=C.y),C.y>l.y&&(l.y=C.y),C.z<k.z&&(k.z=C.z),C.z>l.z&&(l.z=C.z);A.left=k.x;A.right=l.x;A.top=l.y;A.bottom=k.y;A.updateProjectionMatrix()}A=x.shadowMap;D=x.shadowMatrix;K=x.shadowCamera;
-K.position.setFromMatrixPosition(x.matrixWorld);n.setFromMatrixPosition(x.target.matrixWorld);K.lookAt(n);K.updateMatrixWorld();K.matrixWorldInverse.getInverse(K.matrixWorld);x.cameraHelper&&(x.cameraHelper.visible=x.shadowCameraVisible);x.shadowCameraVisible&&x.cameraHelper.update();D.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);D.multiply(K.projectionMatrix);D.multiply(K.matrixWorldInverse);h.multiplyMatrices(K.projectionMatrix,K.matrixWorldInverse);f.setFromMatrix(h);a.setRenderTarget(A);a.clear();
-p.length=0;d(c,K);x=0;for(A=p.length;x<A;x++)D=p[x],D=D.object,F=D.material instanceof THREE.MeshFaceMaterial?D.material.materials[0]:D.material,z=void 0!==D.geometry.morphTargets&&0<D.geometry.morphTargets.length&&F.morphTargets,F=D instanceof THREE.SkinnedMesh&&F.skinning,z=D.customDepthMaterial?D.customDepthMaterial:F?z?v:u:z?t:s,a.renderBufferDirect(K,b,null,z,D)}q=a.getClearColor();G=a.getClearAlpha();e.clearColor(q.r,q.g,q.b,G);g.enable(e.BLEND);w.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);
-a.resetGLState();w.needsUpdate=!1}}};
-THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),g={},f=null,h=null,k=null,l=null,n=null,p=null,m=null,q=null,s=null,t=null,u=null,v=null,w=null,B=null,y=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),H=void 0,G={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.SRC_ALPHA,
+s=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}),t=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0}),u=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,skinning:!0}),w=new THREE.ShaderMaterial({uniforms:q,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0,skinning:!0});s._shadowPass=!0;t._shadowPass=!0;u._shadowPass=
+!0;w._shadowPass=!0;var v=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=!1;this.render=function(c,m){if(!1!==v.enabled&&(!1!==v.autoUpdate||!1!==v.needsUpdate)){var q,F,y,B,J,D,A,P=[];B=0;e.clearColor(1,1,1,1);g.disable(e.BLEND);g.enable(e.CULL_FACE);e.frontFace(e.CCW);v.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);g.setDepthTest(!0);q=0;for(F=b.length;q<F;q++)if(y=b[q],y.castShadow)if(y instanceof
+THREE.DirectionalLight&&y.shadowCascade)for(J=0;J<y.shadowCascadeCount;J++){var G;if(y.shadowCascadeArray[J])G=y.shadowCascadeArray[J];else{A=y;var C=J;G=new THREE.DirectionalLight;G.isVirtual=!0;G.onlyShadow=!0;G.castShadow=!0;G.shadowCameraNear=A.shadowCameraNear;G.shadowCameraFar=A.shadowCameraFar;G.shadowCameraLeft=A.shadowCameraLeft;G.shadowCameraRight=A.shadowCameraRight;G.shadowCameraBottom=A.shadowCameraBottom;G.shadowCameraTop=A.shadowCameraTop;G.shadowCameraVisible=A.shadowCameraVisible;
+G.shadowDarkness=A.shadowDarkness;G.shadowBias=A.shadowCascadeBias[C];G.shadowMapWidth=A.shadowCascadeWidth[C];G.shadowMapHeight=A.shadowCascadeHeight[C];G.pointsWorld=[];G.pointsFrustum=[];var E=G.pointsWorld;D=G.pointsFrustum;for(var I=0;8>I;I++)E[I]=new THREE.Vector3,D[I]=new THREE.Vector3;E=A.shadowCascadeNearZ[C];A=A.shadowCascadeFarZ[C];D[0].set(-1,-1,E);D[1].set(1,-1,E);D[2].set(-1,1,E);D[3].set(1,1,E);D[4].set(-1,-1,A);D[5].set(1,-1,A);D[6].set(-1,1,A);D[7].set(1,1,A);G.originalCamera=m;D=
+new THREE.Gyroscope;D.position.copy(y.shadowCascadeOffset);D.add(G);D.add(G.target);m.add(D);y.shadowCascadeArray[J]=G}C=y;E=J;A=C.shadowCascadeArray[E];A.position.copy(C.position);A.target.position.copy(C.target.position);A.lookAt(A.target);A.shadowCameraVisible=C.shadowCameraVisible;A.shadowDarkness=C.shadowDarkness;A.shadowBias=C.shadowCascadeBias[E];D=C.shadowCascadeNearZ[E];C=C.shadowCascadeFarZ[E];A=A.pointsFrustum;A[0].z=D;A[1].z=D;A[2].z=D;A[3].z=D;A[4].z=C;A[5].z=C;A[6].z=C;A[7].z=C;P[B]=
+G;B++}else P[B]=y,B++;q=0;for(F=P.length;q<F;q++){y=P[q];y.shadowMap||(J=THREE.LinearFilter,v.type===THREE.PCFSoftShadowMap&&(J=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:J,magFilter:J,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("THREE.ShadowMapPlugin: Unsupported light type for shadow",y);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&&G.originalCamera==m){J=m;B=y.shadowCamera;D=y.pointsFrustum;A=y.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(C=0;8>C;C++)E=A[C],E.copy(D[C]),E.unproject(J),E.applyMatrix4(B.matrixWorldInverse),E.x<k.x&&(k.x=E.x),E.x>l.x&&(l.x=E.x),E.y<k.y&&(k.y=E.y),E.y>l.y&&(l.y=E.y),E.z<k.z&&(k.z=E.z),E.z>l.z&&(l.z=E.z);B.left=k.x;B.right=l.x;B.top=l.y;B.bottom=k.y;B.updateProjectionMatrix()}B=y.shadowMap;D=y.shadowMatrix;J=y.shadowCamera;
+J.position.setFromMatrixPosition(y.matrixWorld);n.setFromMatrixPosition(y.target.matrixWorld);J.lookAt(n);J.updateMatrixWorld();J.matrixWorldInverse.getInverse(J.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();D.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);D.multiply(J.projectionMatrix);D.multiply(J.matrixWorldInverse);h.multiplyMatrices(J.projectionMatrix,J.matrixWorldInverse);f.setFromMatrix(h);a.setRenderTarget(B);a.clear();
+p.length=0;d(c,J);y=0;for(B=p.length;y<B;y++)D=p[y],D=D.object,C=D.material instanceof THREE.MeshFaceMaterial?D.material.materials[0]:D.material,A=void 0!==D.geometry.morphTargets&&0<D.geometry.morphTargets.length&&C.morphTargets,C=D instanceof THREE.SkinnedMesh&&C.skinning,A=D.customDepthMaterial?D.customDepthMaterial:C?A?w:u:A?t:s,a.renderBufferDirect(J,b,null,A,D)}q=a.getClearColor();F=a.getClearAlpha();e.clearColor(q.r,q.g,q.b,F);g.enable(e.BLEND);v.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);
+a.resetGLState();v.needsUpdate=!1}}};
+THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),g={},f=null,h=null,k=null,l=null,n=null,p=null,m=null,q=null,s=null,t=null,u=null,w=null,v=null,z=null,x=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),H=void 0,F={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.SRC_ALPHA,
 a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&(a.disableVertexAttribArray(b),e[b]=0)};this.enable=function(b){!0!==g[b]&&(a.enable(b),g[b]=!0)};this.disable=function(b){!1!==g[b]&&(a.disable(b),g[b]=!1)};this.setBlending=function(c,d,e,g,q,s,t){c!==f&&(c===THREE.NoBlending?this.disable(a.BLEND):
 a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&(a.disableVertexAttribArray(b),e[b]=0)};this.enable=function(b){!0!==g[b]&&(a.enable(b),g[b]=!0)};this.disable=function(b){!1!==g[b]&&(a.disable(b),g[b]=!1)};this.setBlending=function(c,d,e,g,q,s,t){c!==f&&(c===THREE.NoBlending?this.disable(a.BLEND):
 c===THREE.AdditiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?this.enable(a.BLEND):(this.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,
 c===THREE.AdditiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?this.enable(a.BLEND):(this.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,
 a.ONE,a.ONE_MINUS_SRC_ALPHA)),f=c);if(c===THREE.CustomBlending){q=q||d;s=s||e;t=t||g;if(d!==h||q!==n)a.blendEquationSeparate(b(d),b(q)),h=d,n=q;if(e!==k||g!==l||s!==p||t!==m)a.blendFuncSeparate(b(e),b(g),b(s),b(t)),k=e,l=g,p=s,m=t}else m=p=n=l=k=h=null};this.setDepthFunc=function(b){if(q!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);
 a.ONE,a.ONE_MINUS_SRC_ALPHA)),f=c);if(c===THREE.CustomBlending){q=q||d;s=s||e;t=t||g;if(d!==h||q!==n)a.blendEquationSeparate(b(d),b(q)),h=d,n=q;if(e!==k||g!==l||s!==p||t!==m)a.blendFuncSeparate(b(e),b(g),b(s),b(t)),k=e,l=g,p=s,m=t}else m=p=n=l=k=h=null};this.setDepthFunc=function(b){if(q!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);
 break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);q=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){s!==b&&(a.depthMask(b),s=b)};this.setColorWrite=function(b){t!==b&&(a.colorMask(b,b,b,b),t=b)};this.setFlipSided=
 break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);q=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){s!==b&&(a.depthMask(b),s=b)};this.setColorWrite=function(b){t!==b&&(a.colorMask(b,b,b,b),t=b)};this.setFlipSided=
-function(b){u!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),u=b)};this.setLineWidth=function(b){b!==v&&(a.lineWidth(b),v=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||w===c&&B===d||(a.polygonOffset(c,d),w=c,B=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+y-1);H!==b&&(a.activeTexture(b),H=b)};this.bindTexture=function(b,d){void 0===
-H&&c.activeTexture();var e=G[H];void 0===e&&(e={type:void 0,texture:void 0},G[H]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<e.length;b++)1===e[b]&&(a.disableVertexAttribArray(b),e[b]=0);g={};u=t=s=f=null}};
-THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,l,n,p,m=a.context,q=a.state,s,t,u,v,w,B;this.render=function(y,H,G,x){if(0!==b.length){y=new THREE.Vector3;var A=x/G,K=.5*G,D=.5*x,z=16/x,Q=new THREE.Vector2(z*A,z),E=new THREE.Vector3(1,1,0),F=new THREE.Vector2(1,1);if(void 0===u){var z=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),C=new Uint16Array([0,1,2,0,2,3]);s=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,s);m.bufferData(m.ARRAY_BUFFER,z,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
-t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,C,m.STATIC_DRAW);w=m.createTexture();B=m.createTexture();q.bindTexture(m.TEXTURE_2D,w);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);q.bindTexture(m.TEXTURE_2D,B);m.texImage2D(m.TEXTURE_2D,0,
-m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var z=(v=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}",
+function(b){u!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),u=b)};this.setLineWidth=function(b){b!==w&&(a.lineWidth(b),w=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||v===c&&z===d||(a.polygonOffset(c,d),v=c,z=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+x-1);H!==b&&(a.activeTexture(b),H=b)};this.bindTexture=function(b,d){void 0===
+H&&c.activeTexture();var e=F[H];void 0===e&&(e={type:void 0,texture:void 0},F[H]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<e.length;b++)1===e[b]&&(a.disableVertexAttribArray(b),e[b]=0);g={};u=t=s=f=null}};
+THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,l,n,p,m=a.context,q=a.state,s,t,u,w,v,z;this.render=function(x,H,F,y){if(0!==b.length){x=new THREE.Vector3;var B=y/F,J=.5*F,D=.5*y,A=16/y,P=new THREE.Vector2(A*B,A),G=new THREE.Vector3(1,1,0),C=new THREE.Vector2(1,1);if(void 0===u){var A=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),E=new Uint16Array([0,1,2,0,2,3]);s=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,s);m.bufferData(m.ARRAY_BUFFER,A,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
+t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,E,m.STATIC_DRAW);v=m.createTexture();z=m.createTexture();q.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);q.bindTexture(m.TEXTURE_2D,z);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 A=(w=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:"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}"},
 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}"},
-C=m.createProgram(),I=m.createShader(m.FRAGMENT_SHADER),M=m.createShader(m.VERTEX_SHADER),R="precision "+a.getPrecision()+" float;\n";m.shaderSource(I,R+z.fragmentShader);m.shaderSource(M,R+z.vertexShader);m.compileShader(I);m.compileShader(M);m.attachShader(C,I);m.attachShader(C,M);m.linkProgram(C);u=C;n=m.getAttribLocation(u,"position");p=m.getAttribLocation(u,"uv");c=m.getUniformLocation(u,"renderType");d=m.getUniformLocation(u,"map");e=m.getUniformLocation(u,"occlusionMap");g=m.getUniformLocation(u,
-"opacity");f=m.getUniformLocation(u,"color");h=m.getUniformLocation(u,"scale");k=m.getUniformLocation(u,"rotation");l=m.getUniformLocation(u,"screenPosition")}m.useProgram(u);q.initAttributes();q.enableAttribute(n);q.enableAttribute(p);q.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,s);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);q.disable(m.CULL_FACE);m.depthMask(!1);C=0;for(I=
-b.length;C<I;C++)if(z=16/x,Q.set(z*A,z),M=b[C],y.set(M.matrixWorld.elements[12],M.matrixWorld.elements[13],M.matrixWorld.elements[14]),y.applyMatrix4(H.matrixWorldInverse),y.applyProjection(H.projectionMatrix),E.copy(y),F.x=E.x*K+K,F.y=E.y*D+D,v||0<F.x&&F.x<G&&0<F.y&&F.y<x){q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,null);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,w);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,F.x-8,F.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,Q.x,Q.y);m.uniform3f(l,
-E.x,E.y,E.z);q.disable(m.BLEND);q.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,B);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,F.x-8,F.y-8,16,16,0);m.uniform1i(c,1);q.disable(m.DEPTH_TEST);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,w);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);M.positionScreen.copy(E);M.customUpdateCallback?M.customUpdateCallback(M):M.updateLensFlares();m.uniform1i(c,2);q.enable(m.BLEND);for(var R=
-0,U=M.lensFlares.length;R<U;R++){var S=M.lensFlares[R];.001<S.opacity&&.001<S.scale&&(E.x=S.x,E.y=S.y,E.z=S.z,z=S.size*S.scale/x,Q.x=z*A,Q.y=z,m.uniform3f(l,E.x,E.y,E.z),m.uniform2f(h,Q.x,Q.y),m.uniform1f(k,S.rotation),m.uniform1f(g,S.opacity),m.uniform3f(f,S.color.r,S.color.g,S.color.b),q.setBlending(S.blending,S.blendEquation,S.blendSrc,S.blendDst),a.setTexture(S.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}q.enable(m.CULL_FACE);q.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,l,n,p,m,q,s,t,u,v,w;function B(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var y=a.context,H=a.state,G,x,A,K,D=new THREE.Vector3,z=new THREE.Quaternion,Q=new THREE.Vector3;this.render=function(E,F){if(0!==b.length){if(void 0===A){var C=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),I=new Uint16Array([0,1,2,0,2,3]);G=y.createBuffer();x=y.createBuffer();y.bindBuffer(y.ARRAY_BUFFER,G);y.bufferData(y.ARRAY_BUFFER,C,y.STATIC_DRAW);y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,
-x);y.bufferData(y.ELEMENT_ARRAY_BUFFER,I,y.STATIC_DRAW);var C=y.createProgram(),I=y.createShader(y.VERTEX_SHADER),M=y.createShader(y.FRAGMENT_SHADER);y.shaderSource(I,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
-y.shaderSource(M,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
-y.compileShader(I);y.compileShader(M);y.attachShader(C,I);y.attachShader(C,M);y.linkProgram(C);A=C;v=y.getAttribLocation(A,"position");w=y.getAttribLocation(A,"uv");c=y.getUniformLocation(A,"uvOffset");d=y.getUniformLocation(A,"uvScale");e=y.getUniformLocation(A,"rotation");g=y.getUniformLocation(A,"scale");f=y.getUniformLocation(A,"color");h=y.getUniformLocation(A,"map");k=y.getUniformLocation(A,"opacity");l=y.getUniformLocation(A,"modelViewMatrix");n=y.getUniformLocation(A,"projectionMatrix");p=
-y.getUniformLocation(A,"fogType");m=y.getUniformLocation(A,"fogDensity");q=y.getUniformLocation(A,"fogNear");s=y.getUniformLocation(A,"fogFar");t=y.getUniformLocation(A,"fogColor");u=y.getUniformLocation(A,"alphaTest");C=document.createElement("canvas");C.width=8;C.height=8;I=C.getContext("2d");I.fillStyle="white";I.fillRect(0,0,8,8);K=new THREE.Texture(C);K.needsUpdate=!0}y.useProgram(A);H.initAttributes();H.enableAttribute(v);H.enableAttribute(w);H.disableUnusedAttributes();H.disable(y.CULL_FACE);
-H.enable(y.BLEND);y.bindBuffer(y.ARRAY_BUFFER,G);y.vertexAttribPointer(v,2,y.FLOAT,!1,16,0);y.vertexAttribPointer(w,2,y.FLOAT,!1,16,8);y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,x);y.uniformMatrix4fv(n,!1,F.projectionMatrix.elements);H.activeTexture(y.TEXTURE0);y.uniform1i(h,0);I=C=0;(M=E.fog)?(y.uniform3f(t,M.color.r,M.color.g,M.color.b),M instanceof THREE.Fog?(y.uniform1f(q,M.near),y.uniform1f(s,M.far),y.uniform1i(p,1),I=C=1):M instanceof THREE.FogExp2&&(y.uniform1f(m,M.density),y.uniform1i(p,2),I=C=2)):
-(y.uniform1i(p,0),I=C=0);for(var M=0,R=b.length;M<R;M++){var U=b[M];U._modelViewMatrix.multiplyMatrices(F.matrixWorldInverse,U.matrixWorld);U.z=-U._modelViewMatrix.elements[14]}b.sort(B);for(var S=[],M=0,R=b.length;M<R;M++){var U=b[M],T=U.material;y.uniform1f(u,T.alphaTest);y.uniformMatrix4fv(l,!1,U._modelViewMatrix.elements);U.matrixWorld.decompose(D,z,Q);S[0]=Q.x;S[1]=Q.y;U=0;E.fog&&T.fog&&(U=I);C!==U&&(y.uniform1i(p,U),C=U);null!==T.map?(y.uniform2f(c,T.map.offset.x,T.map.offset.y),y.uniform2f(d,
-T.map.repeat.x,T.map.repeat.y)):(y.uniform2f(c,0,0),y.uniform2f(d,1,1));y.uniform1f(k,T.opacity);y.uniform3f(f,T.color.r,T.color.g,T.color.b);y.uniform1f(e,T.rotation);y.uniform2fv(g,S);H.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst);H.setDepthTest(T.depthTest);H.setDepthWrite(T.depthWrite);T.map&&T.map.image&&T.map.image.width?a.setTexture(T.map,0):a.setTexture(K,0);y.drawElements(y.TRIANGLES,6,y.UNSIGNED_SHORT,0)}H.enable(y.CULL_FACE);a.resetGLState()}}};
+E=m.createProgram(),I=m.createShader(m.FRAGMENT_SHADER),M=m.createShader(m.VERTEX_SHADER),S="precision "+a.getPrecision()+" float;\n";m.shaderSource(I,S+A.fragmentShader);m.shaderSource(M,S+A.vertexShader);m.compileShader(I);m.compileShader(M);m.attachShader(E,I);m.attachShader(E,M);m.linkProgram(E);u=E;n=m.getAttribLocation(u,"position");p=m.getAttribLocation(u,"uv");c=m.getUniformLocation(u,"renderType");d=m.getUniformLocation(u,"map");e=m.getUniformLocation(u,"occlusionMap");g=m.getUniformLocation(u,
+"opacity");f=m.getUniformLocation(u,"color");h=m.getUniformLocation(u,"scale");k=m.getUniformLocation(u,"rotation");l=m.getUniformLocation(u,"screenPosition")}m.useProgram(u);q.initAttributes();q.enableAttribute(n);q.enableAttribute(p);q.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,s);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);q.disable(m.CULL_FACE);m.depthMask(!1);E=0;for(I=
+b.length;E<I;E++)if(A=16/y,P.set(A*B,A),M=b[E],x.set(M.matrixWorld.elements[12],M.matrixWorld.elements[13],M.matrixWorld.elements[14]),x.applyMatrix4(H.matrixWorldInverse),x.applyProjection(H.projectionMatrix),G.copy(x),C.x=G.x*J+J,C.y=G.y*D+D,w||0<C.x&&C.x<F&&0<C.y&&C.y<y){q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,null);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,C.x-8,C.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,P.x,P.y);m.uniform3f(l,
+G.x,G.y,G.z);q.disable(m.BLEND);q.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,z);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,C.x-8,C.y-8,16,16,0);m.uniform1i(c,1);q.disable(m.DEPTH_TEST);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);M.positionScreen.copy(G);M.customUpdateCallback?M.customUpdateCallback(M):M.updateLensFlares();m.uniform1i(c,2);q.enable(m.BLEND);for(var S=
+0,U=M.lensFlares.length;S<U;S++){var R=M.lensFlares[S];.001<R.opacity&&.001<R.scale&&(G.x=R.x,G.y=R.y,G.z=R.z,A=R.size*R.scale/y,P.x=A*B,P.y=A,m.uniform3f(l,G.x,G.y,G.z),m.uniform2f(h,P.x,P.y),m.uniform1f(k,R.rotation),m.uniform1f(g,R.opacity),m.uniform3f(f,R.color.r,R.color.g,R.color.b),q.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),a.setTexture(R.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}q.enable(m.CULL_FACE);q.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,l,n,p,m,q,s,t,u,w,v;function z(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,H=a.state,F,y,B,J,D=new THREE.Vector3,A=new THREE.Quaternion,P=new THREE.Vector3;this.render=function(G,C){if(0!==b.length){if(void 0===B){var E=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),I=new Uint16Array([0,1,2,0,2,3]);F=x.createBuffer();y=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,F);x.bufferData(x.ARRAY_BUFFER,E,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,
+y);x.bufferData(x.ELEMENT_ARRAY_BUFFER,I,x.STATIC_DRAW);var E=x.createProgram(),I=x.createShader(x.VERTEX_SHADER),M=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(I,["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"));
+x.shaderSource(M,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
+x.compileShader(I);x.compileShader(M);x.attachShader(E,I);x.attachShader(E,M);x.linkProgram(E);B=E;w=x.getAttribLocation(B,"position");v=x.getAttribLocation(B,"uv");c=x.getUniformLocation(B,"uvOffset");d=x.getUniformLocation(B,"uvScale");e=x.getUniformLocation(B,"rotation");g=x.getUniformLocation(B,"scale");f=x.getUniformLocation(B,"color");h=x.getUniformLocation(B,"map");k=x.getUniformLocation(B,"opacity");l=x.getUniformLocation(B,"modelViewMatrix");n=x.getUniformLocation(B,"projectionMatrix");p=
+x.getUniformLocation(B,"fogType");m=x.getUniformLocation(B,"fogDensity");q=x.getUniformLocation(B,"fogNear");s=x.getUniformLocation(B,"fogFar");t=x.getUniformLocation(B,"fogColor");u=x.getUniformLocation(B,"alphaTest");E=document.createElement("canvas");E.width=8;E.height=8;I=E.getContext("2d");I.fillStyle="white";I.fillRect(0,0,8,8);J=new THREE.Texture(E);J.needsUpdate=!0}x.useProgram(B);H.initAttributes();H.enableAttribute(w);H.enableAttribute(v);H.disableUnusedAttributes();H.disable(x.CULL_FACE);
+H.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,F);x.vertexAttribPointer(w,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,y);x.uniformMatrix4fv(n,!1,C.projectionMatrix.elements);H.activeTexture(x.TEXTURE0);x.uniform1i(h,0);I=E=0;(M=G.fog)?(x.uniform3f(t,M.color.r,M.color.g,M.color.b),M instanceof THREE.Fog?(x.uniform1f(q,M.near),x.uniform1f(s,M.far),x.uniform1i(p,1),I=E=1):M instanceof THREE.FogExp2&&(x.uniform1f(m,M.density),x.uniform1i(p,2),I=E=2)):
+(x.uniform1i(p,0),I=E=0);for(var M=0,S=b.length;M<S;M++){var U=b[M];U._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,U.matrixWorld);U.z=-U._modelViewMatrix.elements[14]}b.sort(z);for(var R=[],M=0,S=b.length;M<S;M++){var U=b[M],T=U.material;x.uniform1f(u,T.alphaTest);x.uniformMatrix4fv(l,!1,U._modelViewMatrix.elements);U.matrixWorld.decompose(D,A,P);R[0]=P.x;R[1]=P.y;U=0;G.fog&&T.fog&&(U=I);E!==U&&(x.uniform1i(p,U),E=U);null!==T.map?(x.uniform2f(c,T.map.offset.x,T.map.offset.y),x.uniform2f(d,
+T.map.repeat.x,T.map.repeat.y)):(x.uniform2f(c,0,0),x.uniform2f(d,1,1));x.uniform1f(k,T.opacity);x.uniform3f(f,T.color.r,T.color.g,T.color.b);x.uniform1f(e,T.rotation);x.uniform2fv(g,R);H.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst);H.setDepthTest(T.depthTest);H.setDepthWrite(T.depthWrite);T.map&&T.map.image&&T.map.image.width?a.setTexture(T.map,0):a.setTexture(J,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}H.enable(x.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.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 g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture([],b),f=0;b=function(b){e.load(a[b],function(a){g.images[b]=a;f+=1;6===f&&(g.needsUpdate=!0,c&&c(g))},void 0,
 THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture([],b),f=0;b=function(b){e.load(a[b],function(a){g.images[b]=a;f+=1;6===f&&(g.needsUpdate=!0,c&&c(g))},void 0,
 d)};for(var h=0,k=a.length;h<k;++h)b(h);return g},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,g=document.createElement("canvas");
 d)};for(var h=0,k=a.length;h<k;++h)b(h);return g},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,g=document.createElement("canvas");
-g.width=d;g.height=e;var f=g.getContext("2d");f.drawImage(a,0,0);for(var h=f.getImageData(0,0,d,e).data,k=f.createImageData(d,e),l=k.data,n=0;n<d;n++)for(var p=0;p<e;p++){var m=0>p-1?0:p-1,q=p+1>e-1?e-1:p+1,s=0>n-1?0:n-1,t=n+1>d-1?d-1:n+1,u=[],v=[0,0,h[4*(p*d+n)]/255*b];u.push([-1,0,h[4*(p*d+s)]/255*b]);u.push([-1,-1,h[4*(m*d+s)]/255*b]);u.push([0,-1,h[4*(m*d+n)]/255*b]);u.push([1,-1,h[4*(m*d+t)]/255*b]);u.push([1,0,h[4*(p*d+t)]/255*b]);u.push([1,1,h[4*(q*d+t)]/255*b]);u.push([0,1,h[4*(q*d+n)]/255*
-b]);u.push([-1,1,h[4*(q*d+s)]/255*b]);m=[];s=u.length;for(q=0;q<s;q++){var t=u[q],w=u[(q+1)%s],t=[t[0]-v[0],t[1]-v[1],t[2]-v[2]],w=[w[0]-v[0],w[1]-v[1],w[2]-v[2]];m.push(c([t[1]*w[2]-t[2]*w[1],t[2]*w[0]-t[0]*w[2],t[0]*w[1]-t[1]*w[0]]))}u=[0,0,0];for(q=0;q<m.length;q++)u[0]+=m[q][0],u[1]+=m[q][1],u[2]+=m[q][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;v=4*(p*d+n);l[v]=(u[0]+1)/2*255|0;l[v+1]=(u[1]+1)/2*255|0;l[v+2]=255*u[2]|0;l[v+3]=255}f.putImageData(k,0,0);return g},generateDataTexture:function(a,
+g.width=d;g.height=e;var f=g.getContext("2d");f.drawImage(a,0,0);for(var h=f.getImageData(0,0,d,e).data,k=f.createImageData(d,e),l=k.data,n=0;n<d;n++)for(var p=0;p<e;p++){var m=0>p-1?0:p-1,q=p+1>e-1?e-1:p+1,s=0>n-1?0:n-1,t=n+1>d-1?d-1:n+1,u=[],w=[0,0,h[4*(p*d+n)]/255*b];u.push([-1,0,h[4*(p*d+s)]/255*b]);u.push([-1,-1,h[4*(m*d+s)]/255*b]);u.push([0,-1,h[4*(m*d+n)]/255*b]);u.push([1,-1,h[4*(m*d+t)]/255*b]);u.push([1,0,h[4*(p*d+t)]/255*b]);u.push([1,1,h[4*(q*d+t)]/255*b]);u.push([0,1,h[4*(q*d+n)]/255*
+b]);u.push([-1,1,h[4*(q*d+s)]/255*b]);m=[];s=u.length;for(q=0;q<s;q++){var t=u[q],v=u[(q+1)%s],t=[t[0]-w[0],t[1]-w[1],t[2]-w[2]],v=[v[0]-w[0],v[1]-w[1],v[2]-w[2]];m.push(c([t[1]*v[2]-t[2]*v[1],t[2]*v[0]-t[0]*v[2],t[0]*v[1]-t[1]*v[0]]))}u=[0,0,0];for(q=0;q<m.length;q++)u[0]+=m[q][0],u[1]+=m[q][1],u[2]+=m[q][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;w=4*(p*d+n);l[w]=(u[0]+1)/2*255|0;l[w+1]=(u[1]+1)/2*255|0;l[w+2]=255*u[2]|0;l[w+3]=255}f.putImageData(k,0,0);return g},generateDataTexture:function(a,
 b,c){var d=a*b,e=new Uint8Array(3*d),g=Math.floor(255*c.r),f=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=g,e[3*h+1]=f,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
 b,c){var d=a*b,e=new Uint8Array(3*d),g=Math.floor(255*c.r),f=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=g,e[3*h+1]=f,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.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.toLowerCase()][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]=
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face.toLowerCase()][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(""),g=e.length,f=[];for(a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;f.push(h.path)}return{paths:f,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var g=[],f,h,k,l,n,p,m,q,s,t,u,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);
-break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d;n=b[a++]*c;q=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(q,s,k,n);if(f=g[g.length-1])for(p=f.x,m=f.y,f=1,h=this.divisions;f<=h;f++){var w=f/h;THREE.Shape.Utils.b2(w,p,q,k);THREE.Shape.Utils.b2(w,m,s,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,q=b[a++]*c+d,s=b[a++]*c,t=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(q,s,t,u,k,n),f=g[g.length-1])for(p=f.x,m=f.y,f=1,h=this.divisions;f<=h;f++)w=f/h,THREE.Shape.Utils.b3(w,p,q,t,k),THREE.Shape.Utils.b3(w,
-m,s,u,n)}return{offset:v.ha*c,path:e}}}};
+a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),g=e.length,f=[];for(a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;f.push(h.path)}return{paths:f,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var g=[],f,h,k,l,n,p,m,q,s,t,u,w=b.glyphs[a]||b.glyphs["?"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);
+break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d;n=b[a++]*c;q=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(q,s,k,n);if(f=g[g.length-1])for(p=f.x,m=f.y,f=1,h=this.divisions;f<=h;f++){var v=f/h;THREE.Shape.Utils.b2(v,p,q,k);THREE.Shape.Utils.b2(v,m,s,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,q=b[a++]*c+d,s=b[a++]*c,t=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(q,s,t,u,k,n),f=g[g.length-1])for(p=f.x,m=f.y,f=1,h=this.divisions;f<=h;f++)v=f/h,THREE.Shape.Utils.b3(v,p,q,t,k),THREE.Shape.Utils.b3(v,
+m,s,u,n)}return{offset:w.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",g=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=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
 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",g=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=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
 (function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)f[l]=l;else for(l=0;l<e;l++)f[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var m;a:{var q=m=void 0,s=void 0,t=void 0,
 (function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)f[l]=l;else for(l=0;l<e;l++)f[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var m;a:{var q=m=void 0,s=void 0,t=void 0,
-u=void 0,v=void 0,w=void 0,B=void 0,y=void 0,q=a[f[k]].x,s=a[f[k]].y,t=a[f[l]].x,u=a[f[l]].y,v=a[f[n]].x,w=a[f[n]].y;if(1E-10>(t-q)*(w-s)-(u-s)*(v-q))m=!1;else{var H=void 0,G=void 0,x=void 0,A=void 0,K=void 0,D=void 0,z=void 0,Q=void 0,E=void 0,F=void 0,E=Q=z=y=B=void 0,H=v-t,G=w-u,x=q-v,A=s-w,K=t-q,D=u-s;for(m=0;m<e;m++)if(B=a[f[m]].x,y=a[f[m]].y,!(B===q&&y===s||B===t&&y===u||B===v&&y===w)&&(z=B-q,Q=y-s,E=B-t,F=y-u,B-=v,y-=w,E=H*F-G*E,z=K*Q-D*z,Q=x*y-A*B,-1E-10<=E&&-1E-10<=Q&&-1E-10<=z)){m=!1;break a}m=
+u=void 0,w=void 0,v=void 0,z=void 0,x=void 0,q=a[f[k]].x,s=a[f[k]].y,t=a[f[l]].x,u=a[f[l]].y,w=a[f[n]].x,v=a[f[n]].y;if(1E-10>(t-q)*(v-s)-(u-s)*(w-q))m=!1;else{var H=void 0,F=void 0,y=void 0,B=void 0,J=void 0,D=void 0,A=void 0,P=void 0,G=void 0,C=void 0,G=P=A=x=z=void 0,H=w-t,F=v-u,y=q-w,B=s-v,J=t-q,D=u-s;for(m=0;m<e;m++)if(z=a[f[m]].x,x=a[f[m]].y,!(z===q&&x===s||z===t&&x===u||z===w&&x===v)&&(A=z-q,P=x-s,G=z-t,C=x-u,z-=w,x-=v,G=H*C-F*G,A=J*P-D*A,P=y*x-B*z,-1E-10<=G&&-1E-10<=P&&-1E-10<=A)){m=!1;break a}m=
 !0}}if(m){g.push([a[f[k]],a[f[l]],a[f[n]]]);h.push([f[k],f[l],f[n]]);k=l;for(n=l+1;n<e;k++,n++)f[k]=f[n];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
 !0}}if(m){g.push([a[f[k]],a[f[l]],a[f[n]]]);h.push([f[k],f[l],f[n]]);k=l;for(n=l+1;n<e;k++,n++)f[k]=f[n];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.playbackRate=1;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.playbackRate=1;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Audio.prototype.constructor=THREE.Audio;THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this};
 THREE.Audio.prototype.constructor=THREE.Audio;THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this};
@@ -700,17 +700,17 @@ THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return this
 1].args,q=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)t=g/a,f=THREE.Shape.Utils.b2(t,q,p,h),t=THREE.Shape.Utils.b2(t,s,m,k),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];p=g[0];m=g[1];l=g[2];n=g[3];0<c.length?(f=c[c.length-1],q=f.x,s=f.y):(f=this.actions[d-1].args,q=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)t=g/a,f=THREE.Shape.Utils.b3(t,q,p,l,h),t=THREE.Shape.Utils.b3(t,s,m,n,k),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.CSPLINE_THRU:f=
 1].args,q=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)t=g/a,f=THREE.Shape.Utils.b2(t,q,p,h),t=THREE.Shape.Utils.b2(t,s,m,k),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];p=g[0];m=g[1];l=g[2];n=g[3];0<c.length?(f=c[c.length-1],q=f.x,s=f.y):(f=this.actions[d-1].args,q=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)t=g/a,f=THREE.Shape.Utils.b3(t,q,p,l,h),t=THREE.Shape.Utils.b3(t,s,m,n,k),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.CSPLINE_THRU:f=
 this.actions[d-1].args;t=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;t=t.concat(g[0]);t=new THREE.SplineCurve(t);for(g=1;g<=f;g++)c.push(t.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];m=g[2];l=g[3];f=g[4];p=!!g[5];q=f-l;s=2*a;for(g=1;g<=s;g++)t=g/s,p||(t=1-t),t=l+t*q,f=h+m*Math.cos(t),t=k+m*Math.sin(t),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.ELLIPSE:for(h=g[0],k=g[1],m=g[2],n=g[3],l=g[4],f=g[5],p=!!g[6],q=f-l,s=2*a,g=1;g<=s;g++)t=g/s,p||
 this.actions[d-1].args;t=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;t=t.concat(g[0]);t=new THREE.SplineCurve(t);for(g=1;g<=f;g++)c.push(t.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];m=g[2];l=g[3];f=g[4];p=!!g[5];q=f-l;s=2*a;for(g=1;g<=s;g++)t=g/s,p||(t=1-t),t=l+t*q,f=h+m*Math.cos(t),t=k+m*Math.sin(t),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.ELLIPSE:for(h=g[0],k=g[1],m=g[2],n=g[3],l=g[4],f=g[5],p=!!g[6],q=f-l,s=2*a,g=1;g<=s;g++)t=g/s,p||
 (t=1-t),t=l+t*q,f=h+m*Math.cos(t),t=k+n*Math.sin(t),c.push(new THREE.Vector2(f,t))}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};
 (t=1-t),t=l+t*q,f=h+m*Math.cos(t),t=k+n*Math.sin(t),c.push(new THREE.Vector2(f,t))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
-THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,l=h.y-g.y;if(1E-10<Math.abs(l)){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&
+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 g,f,h,k=[];if(1===e.length)return f=e[0],h=new THREE.Shape,h.actions=f.actions,h.curves=f.curves,k.push(h),k;var l=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),
 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 g,f,h,k=[];if(1===e.length)return f=e[0],h=new THREE.Shape,h.actions=f.actions,h.curves=f.curves,k.push(h),k;var l=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),
 l=a?!l:l;h=[];var n=[],p=[],m=0,q;n[m]=void 0;p[m]=[];var s,t;s=0;for(t=e.length;s<t;s++)f=e[s],q=f.getPoints(),g=THREE.Shape.Utils.isClockWise(q),(g=a?!g:g)?(!l&&n[m]&&m++,n[m]={s:new THREE.Shape,p:q},n[m].s.actions=f.actions,n[m].s.curves=f.curves,l&&m++,p[m]=[]):p[m].push({h:f,p:q[0]});if(!n[0])return c(e);if(1<n.length){s=!1;t=[];f=0;for(e=n.length;f<e;f++)h[f]=[];f=0;for(e=n.length;f<e;f++)for(g=p[f],l=0;l<g.length;l++){m=g[l];q=!0;for(var u=0;u<n.length;u++)d(m.p,n[u].p)&&(f!==u&&t.push({froms:f,
 l=a?!l:l;h=[];var n=[],p=[],m=0,q;n[m]=void 0;p[m]=[];var s,t;s=0;for(t=e.length;s<t;s++)f=e[s],q=f.getPoints(),g=THREE.Shape.Utils.isClockWise(q),(g=a?!g:g)?(!l&&n[m]&&m++,n[m]={s:new THREE.Shape,p:q},n[m].s.actions=f.actions,n[m].s.curves=f.curves,l&&m++,p[m]=[]):p[m].push({h:f,p:q[0]});if(!n[0])return c(e);if(1<n.length){s=!1;t=[];f=0;for(e=n.length;f<e;f++)h[f]=[];f=0;for(e=n.length;f<e;f++)for(g=p[f],l=0;l<g.length;l++){m=g[l];q=!0;for(var u=0;u<n.length;u++)d(m.p,n[u].p)&&(f!==u&&t.push({froms:f,
 tos:u,hole:l}),q?(q=!1,h[u].push(m)):s=!0);q&&h[f].push(m)}0<t.length&&(s||(p=h))}s=0;for(t=n.length;s<t;s++)for(h=n[s].s,k.push(h),f=p[s],e=0,g=f.length;e<g;e++)h.holes.push(f[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)};
 tos:u,hole:l}),q?(q=!1,h[u].push(m)):s=!0);q&&h[f].push(m)}0<t.length&&(s||(p=h))}s=0;for(t=n.length;s<t;s++)for(h=n[s].s,k.push(h),f=p[s],e=0,g=f.length;e<g;e++)h.holes.push(f[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.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.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,x=h*k-g*l,A=h*n-g*p;if(1E-10<Math.abs(x)){if(0<x){if(0>A||A>x)return[];k=l*n-k*p;if(0>k||k>x)return[]}else{if(0<A||A<x)return[];k=l*n-k*p;if(0<k||k<x)return[]}if(0===k)return!f||0!==A&&A!==x?[a]:[];if(k===x)return!f||0!==A&&A!==x?[b]:[];if(0===
-A)return[d];if(A===x)return[e];f=k/x;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==A||l*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,x=d.x,l=e,d=e.x):(b=e,x=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,x=d.y,l=e,d=e.y):(b=e,x=e.y,l=d,d=d.y));return k<=x?a<x?[]:a===x?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,y=h*k-g*l,B=h*n-g*p;if(1E-10<Math.abs(y)){if(0<y){if(0>B||B>y)return[];k=l*n-k*p;if(0>k||k>y)return[]}else{if(0<B||B<y)return[];k=l*n-k*p;if(0<k||k<y)return[]}if(0===k)return!f||0!==B&&B!==y?[a]:[];if(k===y)return!f||0!==B&&B!==y?[b]:[];if(0===
+B)return[d];if(B===y)return[e];f=k/y;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==B||l*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,y=d.x,l=e,d=e.x):(b=e,y=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,y=d.y,l=e,d=e.y):(b=e,y=e.y,l=d,d=d.y));return k<=y?a<y?[]:a===y?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
 k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,k,l,n={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)l=h[g].x+":"+h[g].y,void 0!==n[l]&&console.warn("THREE.Shape: Duplicate point",l),n[l]=g;g=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=
 k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,k,l,n={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)l=h[g].x+":"+h[g].y,void 0!==n[l]&&console.warn("THREE.Shape: Duplicate point",l),n[l]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
-0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,G,x,A,K=[],D,z,Q,E=0;for(n=b.length;E<n;E++)l.push(E);D=0;for(var F=2*
-l.length;0<l.length;){F--;if(0>F){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=D;p<h.length;p++){G=h[p];n=-1;for(E=0;E<l.length;E++)if(x=l[E],A=G.x+":"+G.y+":"+x,void 0===K[A]){k=b[x];for(z=0;z<k.length;z++)if(x=k[z],c(p,z)&&!f(G,x)&&!g(G,x)){n=z;l.splice(E,1);D=h.slice(0,p+1);x=h.slice(p);z=k.slice(n);Q=k.slice(0,n+1);h=D.concat(z).concat(Q).concat(x);D=p;break}if(0<=n)break;K[A]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g,
+0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,F,y,B,J=[],D,A,P,G=0;for(n=b.length;G<n;G++)l.push(G);D=0;for(var C=2*
+l.length;0<l.length;){C--;if(0>C){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=D;p<h.length;p++){F=h[p];n=-1;for(G=0;G<l.length;G++)if(y=l[G],B=F.x+":"+F.y+":"+y,void 0===J[B]){k=b[y];for(A=0;A<k.length;A++)if(y=k[A],c(p,A)&&!f(F,y)&&!g(F,y)){n=A;l.splice(G,1);D=h.slice(0,p+1);y=h.slice(p);A=k.slice(n);P=k.slice(0,n+1);h=D.concat(A).concat(P).concat(y);D=p;break}if(0<=n)break;J[B]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g,
 !1);g=0;for(f=p.length;g<f;g++)for(k=p[g],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=n[l],void 0!==l&&(k[h]=l);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
 !1);g=0;for(f=p.length;g<f;g++)for(k=p[g],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=n[l],void 0!==l&&(k[h]=l);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
 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)};
 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.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;
@@ -737,10 +737,10 @@ THREE.Animation.prototype={constructor:THREE.Animation,keyTypes:["pos","rot","sc
 var d=this.data.name,e=c.animationCache.animations,g=e[d];void 0===g&&(g={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=g);for(c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],f=this.getNextKeyWith(d,a,1);f.time<this.currentTime&&f.index>e.index;)e=f,f=this.getNextKeyWith(d,a,f.index+1);g.prevKey[d]=e;g.nextKey[d]=f}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a].animationCache;void 0!==
 var d=this.data.name,e=c.animationCache.animations,g=e[d];void 0===g&&(g={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=g);for(c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],f=this.getNextKeyWith(d,a,1);f.time<this.currentTime&&f.index>e.index;)e=f,f=this.getNextKeyWith(d,a,f.index+1);g.prevKey[d]=e;g.nextKey[d]=f}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a].animationCache;void 0!==
 c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,p,m,q,s,t;e=(a.length-1)*b;p=Math.floor(e);e-=p;c[0]=0===p?p:p-1;c[1]=p;c[2]=p>a.length-2?p:p+1;c[3]=p>a.length-3?p:p+2;p=a[c[0]];q=a[c[1]];s=a[c[2]];t=a[c[3]];c=e*e;m=e*c;d[0]=g(p[0],q[0],s[0],t[0],e,c,m);d[1]=g(p[1],q[1],s[1],t[1],e,c,m);d[2]=g(p[2],q[2],s[2],t[2],e,c,m);return d},g=function(a,b,c,d,
 c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,p,m,q,s,t;e=(a.length-1)*b;p=Math.floor(e);e-=p;c[0]=0===p?p:p-1;c[1]=p;c[2]=p>a.length-2?p:p+1;c[3]=p>a.length-3?p:p+2;p=a[c[0]];q=a[c[1]];s=a[c[2]];t=a[c[3]];c=e*e;m=e*c;d[0]=g(p[0],q[0],s[0],t[0],e,c,m);d[1]=g(p[1],q[1],s[1],t[1],e,c,m);d[2]=g(p[2],q[2],s[2],t[2],e,c,m);return d},g=function(a,b,c,d,
 e,g,m){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*m+(-3*(b-c)-2*a-d)*g+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var g=this.hierarchy.length;f<g;f++)for(var k=this.hierarchy[f],l=k.animationCache.animations[this.data.name],n=k.animationCache.blending,p=0;3>p;p++){var m=this.keyTypes[p],
 e,g,m){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*m+(-3*(b-c)-2*a-d)*g+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var g=this.hierarchy.length;f<g;f++)for(var k=this.hierarchy[f],l=k.animationCache.animations[this.data.name],n=k.animationCache.blending,p=0;3>p;p++){var m=this.keyTypes[p],
-q=l.prevKey[m],s=l.nextKey[m];if(0<this.timeScale&&s.time<=this.currentTime||0>this.timeScale&&q.time>=this.currentTime){q=this.data.hierarchy[f].keys[0];for(s=this.getNextKeyWith(m,f,1);s.time<this.currentTime&&s.index>q.index;)q=s,s=this.getNextKeyWith(m,f,s.index+1);l.prevKey[m]=q;l.nextKey[m]=s}var t=(this.currentTime-q.time)/(s.time-q.time),u=q[m],v=s[m];0>t&&(t=0);1<t&&(t=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*t,c.y=u[1]+(v[1]-u[1])*t,
-c.z=u[2]+(v[2]-u[2])*t,q=this.weight/(this.weight+n.positionWeight),k.position.lerp(c,q),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,q.index-1).pos,a[1]=u,a[2]=v,a[3]=this.getNextKeyWith("pos",f,s.index+1).pos,t=.33*t+.33,s=e(a,t),q=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,m=k.position,m.x+=(s[0]-m.x)*q,m.y+=(s[1]-
-m.y)*q,m.z+=(s[2]-m.z)*q,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(t=e(a,1.01*t),b.set(t[0],t[1],t[2]),b.sub(m),b.y=0,b.normalize(),t=Math.atan2(b.x,b.z),k.rotation.set(0,t,0))}else"rot"===m?(THREE.Quaternion.slerp(u,v,d,t),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(q=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,q),n.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+(v[0]-u[0])*t,c.y=
-u[1]+(v[1]-u[1])*t,c.z=u[2]+(v[2]-u[2])*t,q=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,q),n.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]},getPrevKeyWith:function(a,b,c){var d=
+q=l.prevKey[m],s=l.nextKey[m];if(0<this.timeScale&&s.time<=this.currentTime||0>this.timeScale&&q.time>=this.currentTime){q=this.data.hierarchy[f].keys[0];for(s=this.getNextKeyWith(m,f,1);s.time<this.currentTime&&s.index>q.index;)q=s,s=this.getNextKeyWith(m,f,s.index+1);l.prevKey[m]=q;l.nextKey[m]=s}var t=(this.currentTime-q.time)/(s.time-q.time),u=q[m],w=s[m];0>t&&(t=0);1<t&&(t=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(w[0]-u[0])*t,c.y=u[1]+(w[1]-u[1])*t,
+c.z=u[2]+(w[2]-u[2])*t,q=this.weight/(this.weight+n.positionWeight),k.position.lerp(c,q),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,q.index-1).pos,a[1]=u,a[2]=w,a[3]=this.getNextKeyWith("pos",f,s.index+1).pos,t=.33*t+.33,s=e(a,t),q=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,m=k.position,m.x+=(s[0]-m.x)*q,m.y+=(s[1]-
+m.y)*q,m.z+=(s[2]-m.z)*q,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(t=e(a,1.01*t),b.set(t[0],t[1],t[2]),b.sub(m),b.y=0,b.normalize(),t=Math.atan2(b.x,b.z),k.rotation.set(0,t,0))}else"rot"===m?(THREE.Quaternion.slerp(u,w,d,t),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(q=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,q),n.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+(w[0]-u[0])*t,c.y=
+u[1]+(w[1]-u[1])*t,c.z=u[2]+(w[2]-u[2])*t,q=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,q),n.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]},getPrevKeyWith:function(a,b,c){var d=
 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]}};
 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 g=c[e],f=this.getNextKeyWith(g,a,0);f&&f.apply(g)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 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 g=c[e],f=this.getNextKeyWith(g,a,0);f&&f.apply(g)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 d.matrixWorldNeedsUpdate=!0}}};
 d.matrixWorldNeedsUpdate=!0}}};
@@ -751,9 +751,9 @@ g.interpolate(f,f.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorld
 THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
 THREE.MorphAnimation=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);var b=this.duration/this.frames;a=Math.floor(this.currentTime/b);var c=this.mesh.morphTargetInfluences;a!==this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=
 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);var b=this.duration/this.frames;a=Math.floor(this.currentTime/b);var c=this.mesh.morphTargetInfluences;a!==this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=
 1,c[a]=0,this.lastFrame=this.currentFrame,this.currentFrame=a);b=this.currentTime%b/b;c[a]=b;c[this.lastFrame]=1-b}}};
 1,c[a]=0,this.lastFrame=this.currentFrame,this.currentFrame=a);b=this.currentTime%b/b;c[a]=b;c[this.lastFrame]=1-b}}};
-THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,t){var u,v=h.widthSegments,w=h.heightSegments,B=e/2,y=f/2,H=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",w=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var G=v+1,x=w+1,A=e/v,K=f/w,D=new THREE.Vector3;D[u]=0<g?1:-1;for(e=0;e<x;e++)for(f=0;f<G;f++){var z=new THREE.Vector3;z[a]=(f*A-B)*c;z[b]=(e*K-y)*d;z[u]=g;h.vertices.push(z)}for(e=
-0;e<w;e++)for(f=0;f<v;f++)y=f+G*e,a=f+G*(e+1),b=f+1+G*(e+1),c=f+1+G*e,d=new THREE.Vector2(f/v,1-e/w),g=new THREE.Vector2(f/v,1-(e+1)/w),u=new THREE.Vector2((f+1)/v,1-(e+1)/w),B=new THREE.Vector2((f+1)/v,1-e/w),y=new THREE.Face3(y+H,a+H,c+H),y.normal.copy(D),y.vertexNormals.push(D.clone(),D.clone(),D.clone()),y.materialIndex=t,h.faces.push(y),h.faceVertexUvs[0].push([d,g,B]),y=new THREE.Face3(a+H,b+H,c+H),y.normal.copy(D),y.vertexNormals.push(D.clone(),D.clone(),D.clone()),y.materialIndex=t,h.faces.push(y),
-h.faceVertexUvs[0].push([g.clone(),u,B.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d,0);f("z","y",1,-1,c,b,-d,1);f("x","z",1,1,a,c,e,2);f("x","z",1,-1,a,c,-e,3);f("x","y",1,-1,a,b,g,4);f("x","y",-1,-1,a,b,-g,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,t){var u,w=h.widthSegments,v=h.heightSegments,z=e/2,x=f/2,H=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",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",w=h.depthSegments;var F=w+1,y=v+1,B=e/w,J=f/v,D=new THREE.Vector3;D[u]=0<g?1:-1;for(e=0;e<y;e++)for(f=0;f<F;f++){var A=new THREE.Vector3;A[a]=(f*B-z)*c;A[b]=(e*J-x)*d;A[u]=g;h.vertices.push(A)}for(e=
+0;e<v;e++)for(f=0;f<w;f++)x=f+F*e,a=f+F*(e+1),b=f+1+F*(e+1),c=f+1+F*e,d=new THREE.Vector2(f/w,1-e/v),g=new THREE.Vector2(f/w,1-(e+1)/v),u=new THREE.Vector2((f+1)/w,1-(e+1)/v),z=new THREE.Vector2((f+1)/w,1-e/v),x=new THREE.Face3(x+H,a+H,c+H),x.normal.copy(D),x.vertexNormals.push(D.clone(),D.clone(),D.clone()),x.materialIndex=t,h.faces.push(x),h.faceVertexUvs[0].push([d,g,z]),x=new THREE.Face3(a+H,b+H,c+H),x.normal.copy(D),x.vertexNormals.push(D.clone(),D.clone(),D.clone()),x.materialIndex=t,h.faces.push(x),
+h.faceVertexUvs[0].push([g.clone(),u,z.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d,0);f("z","y",1,-1,c,b,-d,1);f("x","z",1,1,a,c,e,2);f("x","z",1,-1,a,c,-e,3);f("x","y",1,-1,a,b,g,4);f("x","y",-1,-1,a,b,-g,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.BoxGeometry.prototype.clone=function(){return new THREE.BoxGeometry(this.parameters.width,this.parameters.height,this.parameters.depth,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.depthSegments)};THREE.CubeGeometry=THREE.BoxGeometry;
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.BoxGeometry.prototype.clone=function(){return new THREE.BoxGeometry(this.parameters.width,this.parameters.height,this.parameters.depth,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.depthSegments)};THREE.CubeGeometry=THREE.BoxGeometry;
 THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,g=[];e=new THREE.Vector3;var f=new THREE.Vector2(.5,.5);this.vertices.push(e);g.push(f);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);g.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 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,g=[];e=new THREE.Vector3;var f=new THREE.Vector2(.5,.5);this.vertices.push(e);g.push(f);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);g.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([g[e].clone(),g[e+1].clone(),f.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;
 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([g[e].clone(),g[e+1].clone(),f.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;
@@ -761,22 +761,22 @@ THREE.CircleGeometry.prototype.clone=function(){return new THREE.CircleGeometry(
 THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,g=new Float32Array(3*e),f=new Float32Array(3*e),e=new Float32Array(2*e);f[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var n=c+h/b*d;g[k]=a*Math.cos(n);g[k+1]=a*Math.sin(n);f[k+2]=1;e[l]=(g[k]/a+1)/2;e[l+1]=(g[k+1]/a+1)/2}c=
 THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,g=new Float32Array(3*e),f=new Float32Array(3*e),e=new Float32Array(2*e);f[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var n=c+h/b*d;g[k]=a*Math.cos(n);g[k+1]=a*Math.sin(n);f[k+2]=1;e[l]=(g[k]/a+1)/2;e[l+1]=(g[k+1]/a+1)/2}c=
 [];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(g,3));this.addAttribute("normal",new THREE.BufferAttribute(f,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
 [];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(g,3));this.addAttribute("normal",new THREE.BufferAttribute(f,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
 THREE.CircleBufferGeometry.prototype.clone=function(){var a=new THREE.CircleBufferGeometry(this.parameters.radius,this.parameters.segments,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a};
 THREE.CircleBufferGeometry.prototype.clone=function(){var a=new THREE.CircleBufferGeometry(this.parameters.radius,this.parameters.segments,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a};
-THREE.CylinderGeometry=function(a,b,c,d,e,g,f,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g,thetaStart:f,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;f=void 0!==f?f:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,n,p=[],m=[];for(n=0;n<=e;n++){var q=[],s=[],t=n/e,u=t*(b-a)+a;for(l=0;l<=d;l++){var v=l/d,w=new THREE.Vector3;w.x=u*Math.sin(v*h+
-f);w.y=-t*c+k;w.z=u*Math.cos(v*h+f);this.vertices.push(w);q.push(this.vertices.length-1);s.push(new THREE.Vector2(v,1-t))}p.push(q);m.push(s)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(f=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(f=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),f.setY(Math.sqrt(f.x*f.x+f.z*f.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var q=p[n][l],s=p[n+1][l],t=p[n+1][l+1],u=p[n][l+1],v=f.clone(),w=f.clone(),
-B=h.clone(),y=h.clone(),H=m[n][l].clone(),G=m[n+1][l].clone(),x=m[n+1][l+1].clone(),A=m[n][l+1].clone();this.faces.push(new THREE.Face3(q,s,u,[v,w,y]));this.faceVertexUvs[0].push([H,G,A]);this.faces.push(new THREE.Face3(s,t,u,[w.clone(),B,y.clone()]));this.faceVertexUvs[0].push([G.clone(),x,A.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=p[0][l],s=p[0][l+1],t=this.vertices.length-1,v=new THREE.Vector3(0,1,0),w=new THREE.Vector3(0,1,0),B=new THREE.Vector3(0,
-1,0),H=m[0][l].clone(),G=m[0][l+1].clone(),x=new THREE.Vector2(G.x,0),this.faces.push(new THREE.Face3(q,s,t,[v,w,B])),this.faceVertexUvs[0].push([H,G,x]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=p[e][l+1],s=p[e][l],t=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),B=new THREE.Vector3(0,-1,0),H=m[e][l+1].clone(),G=m[e][l].clone(),x=new THREE.Vector2(G.x,1),this.faces.push(new THREE.Face3(q,s,t,[v,w,B])),this.faceVertexUvs[0].push([H,
-G,x]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.CylinderGeometry.prototype.clone=function(){return new THREE.CylinderGeometry(this.parameters.radiusTop,this.parameters.radiusBottom,this.parameters.height,this.parameters.radialSegments,this.parameters.heightSegments,this.parameters.openEnded,this.parameters.thetaStart,this.parameters.thetaLength)};
+THREE.CylinderGeometry=function(a,b,c,d,e,g,f,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g,thetaStart:f,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;f=void 0!==f?f:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,n,p=[],m=[];for(n=0;n<=e;n++){var q=[],s=[],t=n/e,u=t*(b-a)+a;for(l=0;l<=d;l++){var w=l/d,v=new THREE.Vector3;v.x=u*Math.sin(w*h+
+f);v.y=-t*c+k;v.z=u*Math.cos(w*h+f);this.vertices.push(v);q.push(this.vertices.length-1);s.push(new THREE.Vector2(w,1-t))}p.push(q);m.push(s)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(f=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(f=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),f.setY(Math.sqrt(f.x*f.x+f.z*f.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var q=p[n][l],s=p[n+1][l],t=p[n+1][l+1],u=p[n][l+1],w=f.clone(),v=f.clone(),
+z=h.clone(),x=h.clone(),H=m[n][l].clone(),F=m[n+1][l].clone(),y=m[n+1][l+1].clone(),B=m[n][l+1].clone();this.faces.push(new THREE.Face3(q,s,u,[w,v,x]));this.faceVertexUvs[0].push([H,F,B]);this.faces.push(new THREE.Face3(s,t,u,[v.clone(),z,x.clone()]));this.faceVertexUvs[0].push([F.clone(),y,B.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=p[0][l],s=p[0][l+1],t=this.vertices.length-1,w=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,
+1,0),H=m[0][l].clone(),F=m[0][l+1].clone(),y=new THREE.Vector2(F.x,0),this.faces.push(new THREE.Face3(q,s,t,[w,v,z])),this.faceVertexUvs[0].push([H,F,y]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=p[e][l+1],s=p[e][l],t=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),H=m[e][l+1].clone(),F=m[e][l].clone(),y=new THREE.Vector2(F.x,1),this.faces.push(new THREE.Face3(q,s,t,[w,v,z])),this.faceVertexUvs[0].push([H,
+F,y]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.CylinderGeometry.prototype.clone=function(){return new THREE.CylinderGeometry(this.parameters.radiusTop,this.parameters.radiusBottom,this.parameters.height,this.parameters.radialSegments,this.parameters.heightSegments,this.parameters.openEnded,this.parameters.thetaStart,this.parameters.thetaLength)};
 THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,n=h.length;l<n;l++)for(var p=h[l],m=0;3>m;m++){d[0]=p[f[m]];d[1]=p[f[(m+1)%3]];d.sort(g);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:l,
 THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,n=h.length;l<n;l++)for(var p=h[l],m=0;3>m;m++){d[0]=p[f[m]];d[1]=p[f[(m+1)%3]];d.sort(g);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:l,
 face2:void 0}:e[q].face2=l}d=[];for(q in e)if(g=e[q],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=c)f=k[g.vert1],d.push(f.x),d.push(f.y),d.push(f.z),f=k[g.vert2],d.push(f.x),d.push(f.y),d.push(f.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
 face2:void 0}:e[q].face2=l}d=[];for(q in e)if(g=e[q],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=c)f=k[g.vert1],d.push(f.x),d.push(f.y),d.push(f.z),f=k[g.vert2],d.push(f.x),d.push(f.y),d.push(f.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
 THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=
-!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(J=a.length;0<=--J;){c=J;d=J-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=U*e,h=U*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+D,g=g+D,l=l+D,h=h+D;K.faces.push(new THREE.Face3(k,g,h));K.faces.push(new THREE.Face3(g,l,h));k=v.generateSideWallUV(K,k,g,l,h);K.faceVertexUvs[0].push([k[0],k[1],k[3]]);K.faceVertexUvs[0].push([k[1],
-k[2],k[3]])}}}function g(a,b,c){K.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=D;b+=D;c+=D;K.faces.push(new THREE.Face3(a,b,c));a=v.generateTopUV(K,a,b,c);K.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,s=b.extrudePath,
-t,u=!1,v=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,B,y,H;s&&(t=s.getSpacedPoints(q),u=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,q,!1),B=new THREE.Vector3,y=new THREE.Vector3,H=new THREE.Vector3);p||(l=k=n=0);var G,x,A,K=this,D=this.vertices.length,s=a.extractPoints(m),m=s.shape,z=s.holes;if(s=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();x=0;for(A=z.length;x<A;x++)G=z[x],THREE.Shape.Utils.isClockWise(G)&&(z[x]=G.reverse());s=
-!1}var Q=THREE.Shape.Utils.triangulateShape(m,z),E=m;x=0;for(A=z.length;x<A;x++)G=z[x],m=m.concat(G);var F,C,I,M,R,U=m.length,S,T=Q.length,s=[],J=0;I=E.length;F=I-1;for(C=J+1;J<I;J++,F++,C++)F===I&&(F=0),C===I&&(C=0),s[J]=d(E[J],E[F],E[C]);var qa=[],$,ja=s.concat();x=0;for(A=z.length;x<A;x++){G=z[x];$=[];J=0;I=G.length;F=I-1;for(C=J+1;J<I;J++,F++,C++)F===I&&(F=0),C===I&&(C=0),$[J]=d(G[J],G[F],G[C]);qa.push($);ja=ja.concat($)}for(F=0;F<n;F++){I=F/n;M=k*(1-I);C=l*Math.sin(I*Math.PI/2);J=0;for(I=E.length;J<
-I;J++)R=c(E[J],s[J],C),g(R.x,R.y,-M);x=0;for(A=z.length;x<A;x++)for(G=z[x],$=qa[x],J=0,I=G.length;J<I;J++)R=c(G[J],$[J],C),g(R.x,R.y,-M)}C=l;for(J=0;J<U;J++)R=p?c(m[J],ja[J],C):m[J],u?(y.copy(w.normals[0]).multiplyScalar(R.x),B.copy(w.binormals[0]).multiplyScalar(R.y),H.copy(t[0]).add(y).add(B),g(H.x,H.y,H.z)):g(R.x,R.y,0);for(I=1;I<=q;I++)for(J=0;J<U;J++)R=p?c(m[J],ja[J],C):m[J],u?(y.copy(w.normals[I]).multiplyScalar(R.x),B.copy(w.binormals[I]).multiplyScalar(R.y),H.copy(t[I]).add(y).add(B),g(H.x,
-H.y,H.z)):g(R.x,R.y,h/q*I);for(F=n-1;0<=F;F--){I=F/n;M=k*(1-I);C=l*Math.sin(I*Math.PI/2);J=0;for(I=E.length;J<I;J++)R=c(E[J],s[J],C),g(R.x,R.y,h+M);x=0;for(A=z.length;x<A;x++)for(G=z[x],$=qa[x],J=0,I=G.length;J<I;J++)R=c(G[J],$[J],C),u?g(R.x,R.y+t[q-1].y,t[q-1].x+M):g(R.x,R.y,h+M)}(function(){if(p){var a;a=0*U;for(J=0;J<T;J++)S=Q[J],f(S[2]+a,S[1]+a,S[0]+a);a=q+2*n;a*=U;for(J=0;J<T;J++)S=Q[J],f(S[0]+a,S[1]+a,S[2]+a)}else{for(J=0;J<T;J++)S=Q[J],f(S[2],S[1],S[0]);for(J=0;J<T;J++)S=Q[J],f(S[0]+U*q,S[1]+
-U*q,S[2]+U*q)}})();(function(){var a=0;e(E,a);a+=E.length;x=0;for(A=z.length;x<A;x++)G=z[x],e(G,a),a+=G.length})()};
+!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(L=a.length;0<=--L;){c=L;d=L-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=U*e,h=U*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+D,g=g+D,l=l+D,h=h+D;J.faces.push(new THREE.Face3(k,g,h));J.faces.push(new THREE.Face3(g,l,h));k=w.generateSideWallUV(J,k,g,l,h);J.faceVertexUvs[0].push([k[0],k[1],k[3]]);J.faceVertexUvs[0].push([k[1],
+k[2],k[3]])}}}function g(a,b,c){J.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=D;b+=D;c+=D;J.faces.push(new THREE.Face3(a,b,c));a=w.generateTopUV(J,a,b,c);J.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,s=b.extrudePath,
+t,u=!1,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,z,x,H;s&&(t=s.getSpacedPoints(q),u=!0,p=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,q,!1),z=new THREE.Vector3,x=new THREE.Vector3,H=new THREE.Vector3);p||(l=k=n=0);var F,y,B,J=this,D=this.vertices.length,s=a.extractPoints(m),m=s.shape,A=s.holes;if(s=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();y=0;for(B=A.length;y<B;y++)F=A[y],THREE.Shape.Utils.isClockWise(F)&&(A[y]=F.reverse());s=
+!1}var P=THREE.Shape.Utils.triangulateShape(m,A),G=m;y=0;for(B=A.length;y<B;y++)F=A[y],m=m.concat(F);var C,E,I,M,S,U=m.length,R,T=P.length,s=[],L=0;I=G.length;C=I-1;for(E=L+1;L<I;L++,C++,E++)C===I&&(C=0),E===I&&(E=0),s[L]=d(G[L],G[C],G[E]);var $=[],ea,fa=s.concat();y=0;for(B=A.length;y<B;y++){F=A[y];ea=[];L=0;I=F.length;C=I-1;for(E=L+1;L<I;L++,C++,E++)C===I&&(C=0),E===I&&(E=0),ea[L]=d(F[L],F[C],F[E]);$.push(ea);fa=fa.concat(ea)}for(C=0;C<n;C++){I=C/n;M=k*(1-I);E=l*Math.sin(I*Math.PI/2);L=0;for(I=
+G.length;L<I;L++)S=c(G[L],s[L],E),g(S.x,S.y,-M);y=0;for(B=A.length;y<B;y++)for(F=A[y],ea=$[y],L=0,I=F.length;L<I;L++)S=c(F[L],ea[L],E),g(S.x,S.y,-M)}E=l;for(L=0;L<U;L++)S=p?c(m[L],fa[L],E):m[L],u?(x.copy(v.normals[0]).multiplyScalar(S.x),z.copy(v.binormals[0]).multiplyScalar(S.y),H.copy(t[0]).add(x).add(z),g(H.x,H.y,H.z)):g(S.x,S.y,0);for(I=1;I<=q;I++)for(L=0;L<U;L++)S=p?c(m[L],fa[L],E):m[L],u?(x.copy(v.normals[I]).multiplyScalar(S.x),z.copy(v.binormals[I]).multiplyScalar(S.y),H.copy(t[I]).add(x).add(z),
+g(H.x,H.y,H.z)):g(S.x,S.y,h/q*I);for(C=n-1;0<=C;C--){I=C/n;M=k*(1-I);E=l*Math.sin(I*Math.PI/2);L=0;for(I=G.length;L<I;L++)S=c(G[L],s[L],E),g(S.x,S.y,h+M);y=0;for(B=A.length;y<B;y++)for(F=A[y],ea=$[y],L=0,I=F.length;L<I;L++)S=c(F[L],ea[L],E),u?g(S.x,S.y+t[q-1].y,t[q-1].x+M):g(S.x,S.y,h+M)}(function(){if(p){var a;a=0*U;for(L=0;L<T;L++)R=P[L],f(R[2]+a,R[1]+a,R[0]+a);a=q+2*n;a*=U;for(L=0;L<T;L++)R=P[L],f(R[0]+a,R[1]+a,R[2]+a)}else{for(L=0;L<T;L++)R=P[L],f(R[2],R[1],R[0]);for(L=0;L<T;L++)R=P[L],f(R[0]+
+U*q,R[1]+U*q,R[2]+U*q)}})();(function(){var a=0;e(G,a);a+=G.length;y=0;for(B=A.length;y<B;y++)F=A[y],e(F,a),a+=F.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,
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=l.length;e<g;e++)f=l[e],THREE.Shape.Utils.isClockWise(f)&&(l[e]=f.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(g=l.length;e<g;e++)f=l[e],
 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,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=l.length;e<g;e++)f=l[e],THREE.Shape.Utils.isClockWise(f)&&(l[e]=f.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(g=l.length;e<g;e++)f=l[e],
@@ -793,10 +793,10 @@ THREE.RingGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="Ri
 THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;THREE.RingGeometry.prototype.clone=function(){return new THREE.RingGeometry(this.parameters.innerRadius,this.parameters.outerRadius,this.parameters.thetaSegments,this.parameters.phiSegments,this.parameters.thetaStart,this.parameters.thetaLength)};
 THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;THREE.RingGeometry.prototype.clone=function(){return new THREE.RingGeometry(this.parameters.innerRadius,this.parameters.outerRadius,this.parameters.thetaSegments,this.parameters.phiSegments,this.parameters.thetaStart,this.parameters.thetaLength)};
 THREE.SphereGeometry=function(a,b,c,d,e,g,f){console.log("THREE.SphereGeometry: Consider using THREE.SphereBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};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;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;var h,k,l=[],n=[];for(k=0;k<=c;k++){var p=
 THREE.SphereGeometry=function(a,b,c,d,e,g,f){console.log("THREE.SphereGeometry: Consider using THREE.SphereBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};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;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;var h,k,l=[],n=[];for(k=0;k<=c;k++){var p=
 [],m=[];for(h=0;h<=b;h++){var q=h/b,s=k/c,t=new THREE.Vector3;t.x=-a*Math.cos(d+q*e)*Math.sin(g+s*f);t.y=a*Math.cos(g+s*f);t.z=a*Math.sin(d+q*e)*Math.sin(g+s*f);this.vertices.push(t);p.push(this.vertices.length-1);m.push(new THREE.Vector2(q,1-s))}l.push(p);n.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];g=l[k+1][h];f=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),q=this.vertices[g].clone().normalize(),s=this.vertices[f].clone().normalize(),
 [],m=[];for(h=0;h<=b;h++){var q=h/b,s=k/c,t=new THREE.Vector3;t.x=-a*Math.cos(d+q*e)*Math.sin(g+s*f);t.y=a*Math.cos(g+s*f);t.z=a*Math.sin(d+q*e)*Math.sin(g+s*f);this.vertices.push(t);p.push(this.vertices.length-1);m.push(new THREE.Vector2(q,1-s))}l.push(p);n.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];g=l[k+1][h];f=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),q=this.vertices[g].clone().normalize(),s=this.vertices[f].clone().normalize(),
-t=n[k][h+1].clone(),u=n[k][h].clone(),v=n[k+1][h].clone(),w=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(t.x=(t.x+u.x)/2,this.faces.push(new THREE.Face3(d,g,f,[p,q,s])),this.faceVertexUvs[0].push([t,v,w])):Math.abs(this.vertices[g].y)===a?(v.x=(v.x+w.x)/2,this.faces.push(new THREE.Face3(d,e,g,[p,m,q])),this.faceVertexUvs[0].push([t,u,v])):(this.faces.push(new THREE.Face3(d,e,f,[p,m,s])),this.faceVertexUvs[0].push([t,u,w]),this.faces.push(new THREE.Face3(e,g,f,[m.clone(),q,s.clone()])),this.faceVertexUvs[0].push([u.clone(),
-v,w.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.SphereGeometry.prototype.clone=function(){return new THREE.SphereGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength)};
+t=n[k][h+1].clone(),u=n[k][h].clone(),w=n[k+1][h].clone(),v=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(t.x=(t.x+u.x)/2,this.faces.push(new THREE.Face3(d,g,f,[p,q,s])),this.faceVertexUvs[0].push([t,w,v])):Math.abs(this.vertices[g].y)===a?(w.x=(w.x+v.x)/2,this.faces.push(new THREE.Face3(d,e,g,[p,m,q])),this.faceVertexUvs[0].push([t,u,w])):(this.faces.push(new THREE.Face3(d,e,f,[p,m,s])),this.faceVertexUvs[0].push([t,u,v]),this.faces.push(new THREE.Face3(e,g,f,[m.clone(),q,s.clone()])),this.faceVertexUvs[0].push([u.clone(),
+w,v.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.SphereGeometry.prototype.clone=function(){return new THREE.SphereGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength)};
 THREE.SphereBufferGeometry=function(a,b,c,d,e,g,f){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};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;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;for(var h=g+f,k=(b+1)*(c+1),l=new THREE.BufferAttribute(new Float32Array(3*k),3),n=new THREE.BufferAttribute(new Float32Array(3*
 THREE.SphereBufferGeometry=function(a,b,c,d,e,g,f){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};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;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;for(var h=g+f,k=(b+1)*(c+1),l=new THREE.BufferAttribute(new Float32Array(3*k),3),n=new THREE.BufferAttribute(new Float32Array(3*
-k),3),k=new THREE.BufferAttribute(new Float32Array(2*k),2),p=0,m=[],q=new THREE.Vector3,s=0;s<=c;s++){for(var t=[],u=s/c,v=0;v<=b;v++){var w=v/b,B=-a*Math.cos(d+w*e)*Math.sin(g+u*f),y=a*Math.cos(g+u*f),H=a*Math.sin(d+w*e)*Math.sin(g+u*f);q.set(B,y,H).normalize();l.setXYZ(p,B,y,H);n.setXYZ(p,q.x,q.y,q.z);k.setXY(p,w,1-u);t.push(p);p++}m.push(t)}d=[];for(s=0;s<c;s++)for(v=0;v<b;v++)e=m[s][v+1],f=m[s][v],p=m[s+1][v],q=m[s+1][v+1],(0!==s||0<g)&&d.push(e,f,q),(s!==c-1||h<Math.PI)&&d.push(f,p,q);this.addAttribute("index",
+k),3),k=new THREE.BufferAttribute(new Float32Array(2*k),2),p=0,m=[],q=new THREE.Vector3,s=0;s<=c;s++){for(var t=[],u=s/c,w=0;w<=b;w++){var v=w/b,z=-a*Math.cos(d+v*e)*Math.sin(g+u*f),x=a*Math.cos(g+u*f),H=a*Math.sin(d+v*e)*Math.sin(g+u*f);q.set(z,x,H).normalize();l.setXYZ(p,z,x,H);n.setXYZ(p,q.x,q.y,q.z);k.setXY(p,v,1-u);t.push(p);p++}m.push(t)}d=[];for(s=0;s<c;s++)for(w=0;w<b;w++)e=m[s][w+1],f=m[s][w],p=m[s+1][w],q=m[s+1][w+1],(0!==s||0<g)&&d.push(e,f,q),(s!==c-1||h<Math.PI)&&d.push(f,p,q);this.addAttribute("index",
 new THREE.BufferAttribute(new Uint16Array(d),1));this.addAttribute("position",l);this.addAttribute("normal",n);this.addAttribute("uv",k);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
 new THREE.BufferAttribute(new Uint16Array(d),1));this.addAttribute("position",l);this.addAttribute("normal",n);this.addAttribute("uv",k);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
 THREE.SphereBufferGeometry.prototype.clone=function(){var a=new THREE.SphereBufferGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a};
 THREE.SphereBufferGeometry.prototype.clone=function(){var a=new THREE.SphereBufferGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a};
 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.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;
@@ -804,12 +804,12 @@ THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="Tor
 d,k/c));h.push(m.clone().sub(g).normalize())}for(k=1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,g=(d+1)*k+l,n=new THREE.Face3(a,b,g,[h[a].clone(),h[b].clone(),h[g].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([f[a].clone(),f[b].clone(),f[g].clone()]),n=new THREE.Face3(b,e,g,[h[b].clone(),h[e].clone(),h[g].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([f[b].clone(),f[e].clone(),f[g].clone()]);this.computeFaceNormals()};
 d,k/c));h.push(m.clone().sub(g).normalize())}for(k=1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,g=(d+1)*k+l,n=new THREE.Face3(a,b,g,[h[a].clone(),h[b].clone(),h[g].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([f[a].clone(),f[b].clone(),f[g].clone()]),n=new THREE.Face3(b,e,g,[h[b].clone(),h[e].clone(),h[g].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([f[b].clone(),f[e].clone(),f[g].clone()]);this.computeFaceNormals()};
 THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;THREE.TorusGeometry.prototype.clone=function(){return new THREE.TorusGeometry(this.parameters.radius,this.parameters.tube,this.parameters.radialSegments,this.parameters.tubularSegments,this.parameters.arc)};
 THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;THREE.TorusGeometry.prototype.clone=function(){return new THREE.TorusGeometry(this.parameters.radius,this.parameters.tube,this.parameters.radialSegments,this.parameters.tubularSegments,this.parameters.arc)};
 THREE.TorusKnotGeometry=function(a,b,c,d,e,g,f){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:g,heightScale:f};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;g=g||3;f=f||1;for(var k=Array(c),l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=0;m<c;++m){k[m]=
 THREE.TorusKnotGeometry=function(a,b,c,d,e,g,f){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:g,heightScale:f};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;g=g||3;f=f||1;for(var k=Array(c),l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=0;m<c;++m){k[m]=
-Array(d);var q=m/c*2*e*Math.PI,s=h(q,g,e,a,f),q=h(q+.01,g,e,a,f);l.subVectors(q,s);n.addVectors(q,s);p.crossVectors(l,n);n.crossVectors(p,l);p.normalize();n.normalize();for(q=0;q<d;++q){var t=q/d*2*Math.PI,u=-b*Math.cos(t),t=b*Math.sin(t),v=new THREE.Vector3;v.x=s.x+u*n.x+t*p.x;v.y=s.y+u*n.y+t*p.y;v.z=s.z+u*n.z+t*p.z;k[m][q]=this.vertices.push(v)-1}}for(m=0;m<c;++m)for(q=0;q<d;++q)e=(m+1)%c,g=(q+1)%d,a=k[m][q],b=k[e][q],e=k[e][g],g=k[m][g],f=new THREE.Vector2(m/c,q/d),l=new THREE.Vector2((m+1)/c,
+Array(d);var q=m/c*2*e*Math.PI,s=h(q,g,e,a,f),q=h(q+.01,g,e,a,f);l.subVectors(q,s);n.addVectors(q,s);p.crossVectors(l,n);n.crossVectors(p,l);p.normalize();n.normalize();for(q=0;q<d;++q){var t=q/d*2*Math.PI,u=-b*Math.cos(t),t=b*Math.sin(t),w=new THREE.Vector3;w.x=s.x+u*n.x+t*p.x;w.y=s.y+u*n.y+t*p.y;w.z=s.z+u*n.z+t*p.z;k[m][q]=this.vertices.push(w)-1}}for(m=0;m<c;++m)for(q=0;q<d;++q)e=(m+1)%c,g=(q+1)%d,a=k[m][q],b=k[e][q],e=k[e][g],g=k[m][g],f=new THREE.Vector2(m/c,q/d),l=new THREE.Vector2((m+1)/c,
 q/d),n=new THREE.Vector2((m+1)/c,(q+1)/d),p=new THREE.Vector2(m/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,l,p]),this.faces.push(new THREE.Face3(b,e,g)),this.faceVertexUvs[0].push([l.clone(),n,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
 q/d),n=new THREE.Vector2((m+1)/c,(q+1)/d),p=new THREE.Vector2(m/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,l,p]),this.faces.push(new THREE.Face3(b,e,g)),this.faceVertexUvs[0].push([l.clone(),n,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
 THREE.TorusKnotGeometry.prototype.clone=function(){return new THREE.TorusKnotGeometry(this.parameters.radius,this.parameters.tube,this.parameters.radialSegments,this.parameters.tubularSegments,this.parameters.p,this.parameters.q,this.parameters.heightScale)};
 THREE.TorusKnotGeometry.prototype.clone=function(){return new THREE.TorusKnotGeometry(this.parameters.radius,this.parameters.tube,this.parameters.radialSegments,this.parameters.tubularSegments,this.parameters.p,this.parameters.q,this.parameters.heightScale)};
-THREE.TubeGeometry=function(a,b,c,d,e,g){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;g=g||THREE.TubeGeometry.NoTaper;var f=[],h,k,l=b+1,n,p,m,q,s,t=new THREE.Vector3,u,v,w;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);v=u.normals;w=u.binormals;this.tangents=u.tangents;this.normals=v;this.binormals=w;for(u=0;u<l;u++)for(f[u]=[],n=u/(l-1),s=a.getPointAt(n),h=v[u],k=w[u],m=c*g(n),n=0;n<d;n++)p=
-n/d*2*Math.PI,q=-m*Math.cos(p),p=m*Math.sin(p),t.copy(s),t.x+=q*h.x+p*k.x,t.y+=q*h.y+p*k.y,t.z+=q*h.z+p*k.z,f[u][n]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)g=e?(u+1)%b:u+1,l=(n+1)%d,a=f[u][n],c=f[g][n],g=f[g][l],l=f[u][l],t=new THREE.Vector2(u/b,n/d),v=new THREE.Vector2((u+1)/b,n/d),w=new THREE.Vector2((u+1)/b,(n+1)/d),h=new THREE.Vector2(u/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([t,v,h]),this.faces.push(new THREE.Face3(c,
-g,l)),this.faceVertexUvs[0].push([v.clone(),w,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
+THREE.TubeGeometry=function(a,b,c,d,e,g){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;g=g||THREE.TubeGeometry.NoTaper;var f=[],h,k,l=b+1,n,p,m,q,s,t=new THREE.Vector3,u,w,v;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);w=u.normals;v=u.binormals;this.tangents=u.tangents;this.normals=w;this.binormals=v;for(u=0;u<l;u++)for(f[u]=[],n=u/(l-1),s=a.getPointAt(n),h=w[u],k=v[u],m=c*g(n),n=0;n<d;n++)p=
+n/d*2*Math.PI,q=-m*Math.cos(p),p=m*Math.sin(p),t.copy(s),t.x+=q*h.x+p*k.x,t.y+=q*h.y+p*k.y,t.z+=q*h.z+p*k.z,f[u][n]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)g=e?(u+1)%b:u+1,l=(n+1)%d,a=f[u][n],c=f[g][n],g=f[g][l],l=f[u][l],t=new THREE.Vector2(u/b,n/d),w=new THREE.Vector2((u+1)/b,n/d),v=new THREE.Vector2((u+1)/b,(n+1)/d),h=new THREE.Vector2(u/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([t,w,h]),this.faces.push(new THREE.Face3(c,
+g,l)),this.faceVertexUvs[0].push([w.clone(),v,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],g=[],f=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,p;this.tangents=e;this.normals=g;this.binormals=f;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();g[0].crossVectors(e[0],
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],g=[],f=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,p;this.tangents=e;this.normals=g;this.binormals=f;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();g[0].crossVectors(e[0],
 h);f[0].crossVectors(e[0],g[0]);for(l=1;l<b;l++)g[l]=g[l-1].clone(),f[l]=f[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),g[l].applyMatrix4(k.makeRotationAxis(h,d))),f[l].crossVectors(e[l],g[l]);if(c)for(d=Math.acos(THREE.Math.clamp(g[0].dot(g[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(g[0],g[b-1]))&&(d=-d),l=1;l<b;l++)g[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),f[l].crossVectors(e[l],g[l])};
 h);f[0].crossVectors(e[0],g[0]);for(l=1;l<b;l++)g[l]=g[l-1].clone(),f[l]=f[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),g[l].applyMatrix4(k.makeRotationAxis(h,d))),f[l].crossVectors(e[l],g[l]);if(c)for(d=Math.acos(THREE.Math.clamp(g[0].dot(g[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(g[0],g[b-1]))&&(d=-d),l=1;l<b;l++)g[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),f[l].crossVectors(e[l],g[l])};
 THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function g(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 f(a,
 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 g(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 f(a,