瀏覽代碼

Updated builds.

Mr.doob 10 年之前
父節點
當前提交
ffda14bcf1
共有 2 個文件被更改,包括 168 次插入165 次删除
  1. 42 37
      build/three.js
  2. 126 128
      build/three.min.js

+ 42 - 37
build/three.js

@@ -10143,12 +10143,12 @@ THREE.DirectGeometry.prototype = {
 				this.morphTargets[ j ].push( morphTarget[ face.a ], morphTarget[ face.b ], morphTarget[ face.c ] );
 
 			}
-
+			/*
 			for ( var j = 0; j < morphNormalsLength; j ++ ) {
 
-				var morphNormal = morphNormals[ j ].normals;
+				var morphNormal = morphNormals[ j ].vertexNormals[ i ];
 
-				this.morphNormals[ j ].push( morphNormal[ face.a ], morphNormal[ face.b ], morphNormal[ face.c ] );
+				this.morphNormals[ j ].push( morphNormal.a, morphNormal.b, morphNormal.c );
 
 			}
 
@@ -10159,6 +10159,7 @@ THREE.DirectGeometry.prototype = {
 				this.morphColors[ j ].push( morphColor[ face.a ], morphColor[ face.b ], morphColor[ face.c ] );
 
 			}
+			*/
 
 			// skins
 
@@ -10373,40 +10374,6 @@ THREE.BufferGeometry.prototype = {
 
 				this.fromGeometry( geometry );
 
-				var directgeometry = geometry.__directGeometry;
-
-				// morphs
-
-				if ( object.morphTargetInfluences !== undefined ) {
-
-					var morphTargets = directgeometry.morphTargets;
-
-					for ( var i = 0, l = morphTargets.length; i < l; i ++ ) {
-
-						var morphTarget = morphTargets[ i ];
-
-						var attribute = new THREE.Float32Attribute( morphTarget.length * 3, 3 );
-
-						this.morphAttributes.push( attribute.copyVector3sArray( morphTarget ) );
-
-					}
-
-					// TODO normals, colors
-
-				}
-
-				// skinning
-
-				if ( object instanceof THREE.SkinnedMesh ) {
-
-					var skinIndices = new THREE.Float32Attribute( directgeometry.skinIndices.length * 4, 4 );
-					var skinWeights = new THREE.Float32Attribute( directgeometry.skinWeights.length * 4, 4 );
-
-					this.addAttribute( 'skinIndex', skinIndices.copyVector4sArray( directgeometry.skinIndices ) );
-					this.addAttribute( 'skinWeight', skinWeights.copyVector4sArray( directgeometry.skinWeights ) );
-
-				}
-
 			}
 
 		}
@@ -10531,6 +10498,44 @@ THREE.BufferGeometry.prototype = {
 
 		}
 
+		// morphs
+
+		if ( geometry.morphTargets.length > 0 ) {
+
+			var morphTargets = geometry.morphTargets;
+
+			for ( var i = 0, l = morphTargets.length; i < l; i ++ ) {
+
+				var morphTarget = morphTargets[ i ];
+
+				var attribute = new THREE.Float32Attribute( morphTarget.length * 3, 3 );
+
+				this.morphAttributes.push( attribute.copyVector3sArray( morphTarget ) );
+
+			}
+
+			// TODO normals, colors
+
+		}
+
+		// skinning
+
+		if ( geometry.skinIndices.length > 0 ) {
+
+			var skinIndices = new THREE.Float32Attribute( geometry.skinIndices.length * 4, 4 );
+			this.addAttribute( 'skinIndex', skinIndices.copyVector4sArray( geometry.skinIndices ) );
+
+		}
+
+		if ( geometry.skinWeights.length > 0 ) {
+
+			var skinWeights = new THREE.Float32Attribute( geometry.skinWeights.length * 4, 4 );
+			this.addAttribute( 'skinWeight', skinWeights.copyVector4sArray( geometry.skinWeights ) );
+
+		}
+
+		//
+
 		if ( geometry.boundingSphere !== null ) {
 
 			this.boundingSphere = geometry.boundingSphere.clone();

+ 126 - 128
build/three.min.js

@@ -101,15 +101,15 @@ f*h;var k=f*e,l=c*h,n=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+l*d;b[5]=a-n*d;b[9]=-
 g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
 makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*h,c=c*k,n=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(n+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,f){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var g=this.elements;c.subVectors(d,
 e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,
-d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],n=c[5],p=c[9],m=c[13],r=c[2],t=c[6],s=c[10],u=c[14],w=c[3],y=c[7],z=c[11],c=c[15],v=d[0],B=d[4],E=d[8],x=d[12],F=d[1],I=d[5],D=d[9],G=d[13],R=d[2],K=d[6],A=d[10],H=d[14],C=d[3],T=d[7],O=d[11],d=d[15];e[0]=f*v+g*F+h*R+k*C;e[4]=f*B+g*I+h*K+k*T;e[8]=f*E+g*D+h*A+k*O;e[12]=f*x+g*G+h*H+k*d;e[1]=l*v+n*F+p*R+m*C;e[5]=l*B+n*I+p*K+m*T;e[9]=l*E+n*D+p*A+m*O;e[13]=l*x+n*G+p*H+m*d;e[2]=r*v+t*F+s*R+u*C;e[6]=r*B+t*I+s*K+u*T;e[10]=r*E+t*D+s*A+u*O;e[14]=
-r*x+t*G+s*H+u*d;e[3]=w*v+y*F+z*R+c*C;e[7]=w*B+y*I+z*K+c*T;e[11]=w*E+y*D+z*A+c*O;e[15]=w*x+y*G+z*H+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=
+d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],n=c[5],p=c[9],m=c[13],r=c[2],t=c[6],s=c[10],u=c[14],v=c[3],y=c[7],z=c[11],c=c[15],x=d[0],D=d[4],E=d[8],w=d[12],F=d[1],I=d[5],C=d[9],G=d[13],R=d[2],K=d[6],A=d[10],H=d[14],B=d[3],T=d[7],O=d[11],d=d[15];e[0]=f*x+g*F+h*R+k*B;e[4]=f*D+g*I+h*K+k*T;e[8]=f*E+g*C+h*A+k*O;e[12]=f*w+g*G+h*H+k*d;e[1]=l*x+n*F+p*R+m*B;e[5]=l*D+n*I+p*K+m*T;e[9]=l*E+n*C+p*A+m*O;e[13]=l*w+n*G+p*H+m*d;e[2]=r*x+t*F+s*R+u*B;e[6]=r*D+t*I+s*K+u*T;e[10]=r*E+t*C+s*A+u*O;e[14]=
+r*w+t*G+s*H+u*d;e[3]=v*x+y*F+z*R+c*B;e[7]=v*D+y*I+z*K+c*T;e[11]=v*E+y*C+z*A+c*O;e[15]=v*w+y*G+z*H+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=
 a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
 a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],l=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*k*
 n-e*g*p+c*k*p+d*g*m-c*h*m)+a[7]*(+b*h*m-b*k*p+e*f*p-d*f*m+d*k*l-e*h*l)+a[11]*(+b*k*n-b*g*m-e*f*n+c*f*m+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*n+b*g*p+d*f*n-c*f*p+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=
 c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a;return function(){void 0===a&&(a=new THREE.Vector3);console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=
-this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],n=d[9],p=d[13],m=d[2],r=d[6],t=d[10],s=d[14],u=d[3],w=d[7],y=d[11],d=d[15];c[0]=n*s*w-p*t*w+p*r*y-l*s*y-n*r*d+l*t*d;c[4]=h*t*w-g*s*w-h*r*y+f*s*y+g*r*d-f*t*d;c[8]=g*p*w-h*n*w+h*l*y-f*p*y-g*l*d+f*n*d;c[12]=h*n*r-g*p*r-h*l*t+f*p*t+g*l*s-f*n*s;c[1]=p*t*u-n*s*u-p*m*y+k*s*y+n*m*d-k*t*d;c[5]=g*s*u-h*t*u+h*m*y-e*s*y-g*m*d+e*t*d;c[9]=h*n*u-g*p*u-h*k*y+e*p*y+g*k*d-e*n*d;c[13]=g*p*m-h*n*m+h*k*t-e*p*t-g*k*s+e*n*s;c[2]=l*s*u-p*r*u+p*m*w-k*s*
-w-l*m*d+k*r*d;c[6]=h*r*u-f*s*u-h*m*w+e*s*w+f*m*d-e*r*d;c[10]=f*p*u-h*l*u+h*k*w-e*p*w-f*k*d+e*l*d;c[14]=h*l*m-f*p*m-h*k*r+e*p*r+f*k*s-e*l*s;c[3]=n*r*u-l*t*u-n*m*w+k*t*w+l*m*y-k*r*y;c[7]=f*t*u-g*r*u+g*m*w-e*t*w-f*m*y+e*r*y;c[11]=g*l*u-f*n*u-g*k*w+e*n*w+f*k*y-e*l*y;c[15]=f*n*m-g*l*m+g*k*r-e*n*r-f*k*t+e*l*t;c=e*c[0]+k*c[4]+m*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
+this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],n=d[9],p=d[13],m=d[2],r=d[6],t=d[10],s=d[14],u=d[3],v=d[7],y=d[11],d=d[15];c[0]=n*s*v-p*t*v+p*r*y-l*s*y-n*r*d+l*t*d;c[4]=h*t*v-g*s*v-h*r*y+f*s*y+g*r*d-f*t*d;c[8]=g*p*v-h*n*v+h*l*y-f*p*y-g*l*d+f*n*d;c[12]=h*n*r-g*p*r-h*l*t+f*p*t+g*l*s-f*n*s;c[1]=p*t*u-n*s*u-p*m*y+k*s*y+n*m*d-k*t*d;c[5]=g*s*u-h*t*u+h*m*y-e*s*y-g*m*d+e*t*d;c[9]=h*n*u-g*p*u-h*k*y+e*p*y+g*k*d-e*n*d;c[13]=g*p*m-h*n*m+h*k*t-e*p*t-g*k*s+e*n*s;c[2]=l*s*u-p*r*u+p*m*v-k*s*
+v-l*m*d+k*r*d;c[6]=h*r*u-f*s*u-h*m*v+e*s*v+f*m*d-e*r*d;c[10]=f*p*u-h*l*u+h*k*v-e*p*v-f*k*d+e*l*d;c[14]=h*l*m-f*p*m-h*k*r+e*p*r+f*k*s-e*l*s;c[3]=n*r*u-l*t*u-n*m*v+k*t*v+l*m*y-k*r*y;c[7]=f*t*u-g*r*u+g*m*v-e*t*v-f*m*y+e*r*y;c[11]=g*l*u-f*n*u-g*k*v+e*n*v+f*k*y-e*l*y;c[15]=f*n*m-g*l*m+g*k*r-e*n*r-f*k*t+e*l*t;c=e*c[0]+k*c[4]+m*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
 this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(a,b){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=
 this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,
 0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,k=e*f,l=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*g+d*h,l*g+c,l*h-d*f,0,k*h-d*g,l*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,
@@ -200,51 +200,49 @@ 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
 f,g,h=new THREE.Vector3,k=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),k.subVectors(e,f),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=c.vertexNormals,3===e.length?
 (e[0].copy(d[c.a]),e[1].copy(d[c.b]),e[2].copy(d[c.c])):(e[0]=d[c.a].clone(),e[1]=d[c.b].clone(),e[2]=d[c.c].clone())},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=
 e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;
-f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,n,p,m,r,t,s,u,w=[],y=[];c=new THREE.Vector3;var z=new THREE.Vector3,v=new THREE.Vector3,
-B=new THREE.Vector3,E=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,y[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=f[0],n=f[1],p=f[2],f=h.x-g.x,m=k.x-g.x,r=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-l.x,s=p.x-l.x,n=n.y-l.y,l=p.y-l.y,p=1/(k*l-s*n),c.set((l*f-n*m)*p,(l*r-n*t)*p,(l*h-n*g)*p),z.set((k*m-s*f)*p,(k*t-s*r)*p,(k*g-s*h)*p),w[d].add(c),
-w[u].add(c),w[e].add(c),y[d].add(z),y[u].add(z),y[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++)E.copy(e.vertexNormals[c]),d=e[z[c]],u=w[d],v.copy(u),v.sub(E.multiplyScalar(E.dot(u))).normalize(),B.crossVectors(e.vertexNormals[c],u),d=B.dot(y[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(v.x,v.y,v.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<
+f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,n,p,m,r,t,s,u,v=[],y=[];c=new THREE.Vector3;var z=new THREE.Vector3,x=new THREE.Vector3,
+D=new THREE.Vector3,E=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,y[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=f[0],n=f[1],p=f[2],f=h.x-g.x,m=k.x-g.x,r=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-l.x,s=p.x-l.x,n=n.y-l.y,l=p.y-l.y,p=1/(k*l-s*n),c.set((l*f-n*m)*p,(l*r-n*t)*p,(l*h-n*g)*p),z.set((k*m-s*f)*p,(k*t-s*r)*p,(k*g-s*h)*p),v[d].add(c),
+v[u].add(c),v[e].add(c),y[d].add(z),y[u].add(z),y[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++)E.copy(e.vertexNormals[c]),d=e[z[c]],u=v[d],x.copy(u),x.sub(E.multiplyScalar(E.dot(u))).normalize(),D.crossVectors(e.vertexNormals[c],u),d=D.dot(y[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){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var c,d=this.vertices.length,
 e=this.vertices,f=a.vertices,g=this.faces,h=a.faces,k=this.faceVertexUvs[0],l=a.faceVertexUvs[0];void 0!==b&&(c=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,p=f.length;n<p;n++){var m=f[n].clone();void 0!==b&&m.applyMatrix4(b);e.push(m)}n=0;for(p=h.length;n<p;n++){var r=h[n],t,s=r.vertexNormals,u=r.vertexColors,m=new THREE.Face3(r.a+d,r.b+d,r.c+d);m.normal.copy(r.normal);void 0!==c&&m.normal.applyMatrix3(c).normalize();e=0;for(f=s.length;e<f;e++)t=s[e].clone(),void 0!==c&&t.applyMatrix3(c).normalize(),
 m.vertexNormals.push(t);m.color.copy(r.color);e=0;for(f=u.length;e<f;e++)r=u[e],m.vertexColors.push(r.clone());g.push(m)}n=0;for(p=l.length;n<p;n++)if(c=l[n],d=[],void 0!==c){e=0;for(f=c.length;e<f;e++)d.push(c[e].clone());k.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,
 4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]===e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=
 this.vertices.length-b.length;this.vertices=b;return f},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==l[b])return l[b];l[b]=k.length/3;k.push(a.x,a.y,a.z);return l[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=n.length;n.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==r[b])return r[b];r[b]=m.length/2;m.push(a.x,
-a.y);return r[b]}var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],l={},n=[],p={},m=[],r={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],s=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),w=0<t.vertexNormals.length,
-y=1!==t.color.r||1!==t.color.g||1!==t.color.b,z=0<t.vertexColors.length,v=0,v=a(v,0,0),v=a(v,1,!1),v=a(v,2,!1),v=a(v,3,s),v=a(v,4,u),v=a(v,5,w),v=a(v,6,y),v=a(v,7,z);h.push(v);h.push(t.a,t.b,t.c);s&&(s=this.faceVertexUvs[0][g],h.push(d(s[0]),d(s[1]),d(s[2])));u&&h.push(b(t.normal));w&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));y&&h.push(c(t.color));z&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<n.length&&(e.data.colors=n);0<m.length&&
+a.y);return r[b]}var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],l={},n=[],p={},m=[],r={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],s=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),v=0<t.vertexNormals.length,
+y=1!==t.color.r||1!==t.color.g||1!==t.color.b,z=0<t.vertexColors.length,x=0,x=a(x,0,0),x=a(x,1,!1),x=a(x,2,!1),x=a(x,3,s),x=a(x,4,u),x=a(x,5,v),x=a(x,6,y),x=a(x,7,z);h.push(x);h.push(t.a,t.b,t.c);s&&(s=this.faceVertexUvs[0][g],h.push(d(s[0]),d(s[1]),d(s[2])));u&&h.push(b(t.normal));v&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));y&&h.push(c(t.color));z&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<n.length&&(e.data.colors=n);0<m.length&&
 (e.data.uvs=[m]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());c=0;for(d=this.faceVertexUvs.length;c<d;c++){b=this.faceVertexUvs[c];void 0===a.faceVertexUvs[c]&&(a.faceVertexUvs[c]=[]);for(var e=0,f=b.length;e<f;e++){for(var g=b[e],h=[],k=0,l=g.length;k<l;k++)h.push(g[k].clone());a.faceVertexUvs[c].push(h)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};
 THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;
 THREE.DirectGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="DirectGeometry";this.indices=[];this.vertices=[];this.colors=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=
 !1};
 THREE.DirectGeometry.prototype={constructor:THREE.DirectGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.");return this},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.");return this},fromGeometry:function(a,b){b=
-b||{vertexColors:THREE.NoColors};for(var c=a.faces,d=a.vertices,e=a.faceVertexUvs,f=b.vertexColors,g=e[0]&&0<e[0].length,h=e[1]&&0<e[1].length,k=a.morphTargets,l=k.length,n=0;n<l;n++)this.morphTargets[n]=[];for(var p=a.morphNormals,m=p.length,n=0;n<m;n++)this.morphNormals[n]=[];for(var r=a.morphColors,t=r.length,n=0;n<t;n++)this.morphColors[n]=[];for(var s=a.skinIndices,u=a.skinWeights,w=s.length===d.length,y=u.length===d.length,n=0;n<c.length;n++){var z=c[n];this.vertices.push(d[z.a],d[z.b],d[z.c]);
-var v=z.vertexNormals;3===v.length?this.normals.push(v[0],v[1],v[2]):(v=z.normal,this.normals.push(v,v,v));v=z.vertexColors;f===THREE.VertexColors?this.colors.push(v[0],v[1],v[2]):f===THREE.FaceColors&&(v=z.color,this.colors.push(v,v,v));!0===g&&(v=e[0][n],void 0!==v?this.uvs.push(v[0],v[1],v[2]):(console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv",n),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===h&&(v=e[1][n],void 0!==v?this.uvs2.push(v[0],v[1],v[2]):
-(console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv2",n),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));for(v=0;v<l;v++){var B=k[v].vertices;this.morphTargets[v].push(B[z.a],B[z.b],B[z.c])}for(v=0;v<m;v++)B=p[v].normals,this.morphNormals[v].push(B[z.a],B[z.b],B[z.c]);for(v=0;v<t;v++)B=r[v].colors,this.morphColors[v].push(B[z.a],B[z.b],B[z.c]);w&&this.skinIndices.push(s[z.a],s[z.b],s[z.c]);y&&this.skinWeights.push(u[z.a],u[z.b],u[z.c])}this.verticesNeedUpdate=
-a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);
+b||{vertexColors:THREE.NoColors};for(var c=a.faces,d=a.vertices,e=a.faceVertexUvs,f=b.vertexColors,g=e[0]&&0<e[0].length,h=e[1]&&0<e[1].length,k=a.morphTargets,l=k.length,n=0;n<l;n++)this.morphTargets[n]=[];for(var p=a.morphNormals.length,n=0;n<p;n++)this.morphNormals[n]=[];p=a.morphColors.length;for(n=0;n<p;n++)this.morphColors[n]=[];for(var p=a.skinIndices,m=a.skinWeights,r=p.length===d.length,t=m.length===d.length,n=0;n<c.length;n++){var s=c[n];this.vertices.push(d[s.a],d[s.b],d[s.c]);var u=s.vertexNormals;
+3===u.length?this.normals.push(u[0],u[1],u[2]):(u=s.normal,this.normals.push(u,u,u));u=s.vertexColors;f===THREE.VertexColors?this.colors.push(u[0],u[1],u[2]):f===THREE.FaceColors&&(u=s.color,this.colors.push(u,u,u));!0===g&&(u=e[0][n],void 0!==u?this.uvs.push(u[0],u[1],u[2]):(console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv",n),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===h&&(u=e[1][n],void 0!==u?this.uvs2.push(u[0],u[1],u[2]):(console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv2",
+n),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));for(u=0;u<l;u++){var v=k[u].vertices;this.morphTargets[u].push(v[s.a],v[s.b],v[s.c])}r&&this.skinIndices.push(p[s.a],p[s.b],p[s.c]);t&&this.skinWeights.push(m[s.a],m[s.b],m[s.c])}this.verticesNeedUpdate=a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);
 THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.morphAttributes=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=
 this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere()},copy:function(a){var b=a.attributes;a=a.offsets;for(var c in b)this.addAttribute(c,b[c].clone());b=0;for(c=a.length;b<c;b++){var d=a[b];this.offsets.push({start:d.start,index:d.index,
 count:d.count})}return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},setFromObject:function(a){console.log("THREE.BufferGeometry.setFromObject(). Converting",a,this);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));null!==b.boundingSphere&&(this.boundingSphere=b.boundingSphere.clone());null!==b.boundingBox&&(this.boundingBox=b.boundingBox.clone())}else if(a instanceof THREE.Mesh&&b instanceof THREE.Geometry){this.fromGeometry(b);b=b.__directGeometry;if(void 0!==a.morphTargetInfluences)for(var c=b.morphTargets,d=0,e=c.length;d<e;d++){var f=c[d],g=new THREE.Float32Attribute(3*f.length,3);this.morphAttributes.push(g.copyVector3sArray(f))}a instanceof THREE.SkinnedMesh&&
-(a=new THREE.Float32Attribute(4*b.skinIndices.length,4),c=new THREE.Float32Attribute(4*b.skinWeights.length,4),this.addAttribute("skinIndex",a.copyVector4sArray(b.skinIndices)),this.addAttribute("skinWeight",c.copyVector4sArray(b.skinWeights)))}return this},updateFromObject:function(a){var b=a.geometry;a instanceof THREE.Mesh&&(a=b.__directGeometry,a.verticesNeedUpdate=b.verticesNeedUpdate,a.normalsNeedUpdate=b.normalsNeedUpdate,a.colorsNeedUpdate=b.colorsNeedUpdate,a.uvsNeedUpdate=b.uvsNeedUpdate,
-b.verticesNeedUpdate=!1,b.normalsNeedUpdate=!1,b.colorsNeedUpdate=!1,b.uvsNeedUpdate=!1,b=a);!0===b.verticesNeedUpdate&&(a=this.attributes.position,void 0!==a&&(a.copyVector3sArray(b.vertices),a.needsUpdate=!0),b.verticesNeedUpdate=!1);!0===b.normalsNeedUpdate&&(a=this.attributes.normal,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=
+this.addAttribute("color",c.copyColorsArray(b.colors));null!==b.boundingSphere&&(this.boundingSphere=b.boundingSphere.clone());null!==b.boundingBox&&(this.boundingBox=b.boundingBox.clone())}else a instanceof THREE.Mesh&&b instanceof THREE.Geometry&&this.fromGeometry(b);return this},updateFromObject:function(a){var b=a.geometry;a instanceof THREE.Mesh&&(a=b.__directGeometry,a.verticesNeedUpdate=b.verticesNeedUpdate,a.normalsNeedUpdate=b.normalsNeedUpdate,a.colorsNeedUpdate=b.colorsNeedUpdate,a.uvsNeedUpdate=
+b.uvsNeedUpdate,b.verticesNeedUpdate=!1,b.normalsNeedUpdate=!1,b.colorsNeedUpdate=!1,b.uvsNeedUpdate=!1,b=a);!0===b.verticesNeedUpdate&&(a=this.attributes.position,void 0!==a&&(a.copyVector3sArray(b.vertices),a.needsUpdate=!0),b.verticesNeedUpdate=!1);!0===b.normalsNeedUpdate&&(a=this.attributes.normal,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);return this},fromGeometry:function(a,b){a.__directGeometry=(new THREE.DirectGeometry).fromGeometry(a,b);return this.fromDirectGeometry(a.__directGeometry)},fromDirectGeometry:function(a){if(0<a.indices.length){var b=new Uint16Array(3*a.indices.length);this.addAttribute("index",(new THREE.BufferAttribute(b,1)).copyIndicesArray(a.indices))}0<a.vertices.length&&(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)));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&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),a.expandByPoint(b);
-a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",
-new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var r=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,count:r.length,index:0}],s=0,u=t.length;s<u;++s){e=t[s].start;f=t[s].count;for(var w=t[s].index,d=e,e=e+f;d<e;d+=3)f=3*(w+r[d]),g=3*(w+r[d+1]),h=3*(w+r[d+2]),k.fromArray(b,f),
-l.fromArray(b,g),n.fromArray(b,h),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),n.fromArray(b,d+6),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,
-b,c){p.fromArray(d,3*a);m.fromArray(d,3*b);r.fromArray(d,3*c);t.fromArray(f,2*a);s.fromArray(f,2*b);u.fromArray(f,2*c);w=m.x-p.x;y=r.x-p.x;z=m.y-p.y;v=r.y-p.y;B=m.z-p.z;E=r.z-p.z;x=s.x-t.x;F=u.x-t.x;I=s.y-t.y;D=u.y-t.y;G=1/(x*D-F*I);R.set((D*w-I*y)*G,(D*z-I*v)*G,(D*B-I*E)*G);K.set((x*y-F*w)*G,(x*v-F*z)*G,(x*E-F*B)*G);k[a].add(R);k[b].add(R);k[c].add(R);l[a].add(K);l[b].add(K);l[c].add(K)}function b(a){na.fromArray(e,3*a);da.copy(na);ja=k[a];J.copy(ja);J.sub(na.multiplyScalar(na.dot(ja))).normalize();
-L.crossVectors(da,ja);ua=L.dot(l[a]);ka=0>ua?-1:1;h[4*a]=J.x;h[4*a+1]=J.y;h[4*a+2]=J.z;h[4*a+3]=ka}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/
-3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector2,s=new THREE.Vector2,u=new THREE.Vector2,w,y,z,v,B,E,x,F,I,D,G,R=new THREE.Vector3,K=new THREE.Vector3,A,H,C,T,O;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var S=this.drawcalls,n=
-0;for(H=S.length;n<H;++n){A=S[n].start;C=S[n].count;var P=S[n].index,g=A;for(A+=C;g<A;g+=3)C=P+c[g],T=P+c[g+1],O=P+c[g+2],a(C,T,O)}var J=new THREE.Vector3,L=new THREE.Vector3,na=new THREE.Vector3,da=new THREE.Vector3,ka,ja,ua,n=0;for(H=S.length;n<H;++n)for(A=S[n].start,C=S[n].count,P=S[n].index,g=A,A+=C;g<A;g+=3)C=P+c[g],T=P+c[g+1],O=P+c[g+2],b(C),b(T),b(O)}},computeOffsets:function(a){void 0===a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,
-d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,p=new Int32Array(6),m=new Int32Array(c.length),r=new Int32Array(c.length),t=0;t<c.length;t++)m[t]=-1,r[t]=-1;for(c=0;c<d;c++){for(var s=n=0;3>s;s++)t=b[3*c+s],-1===m[t]?(p[2*s]=t,p[2*s+1]=-1,n++):m[t]<k.index?(p[2*s]=t,p[2*s+1]=-1,l++):(p[2*s]=t,p[2*s+1]=m[t]);if(g+n>k.index+a)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)s=p[n+
-1],-1<s&&s<k.index&&(p[n+1]=-1);for(n=0;6>n;n+=2)t=p[n],s=p[n+1],-1===s&&(s=g++),m[t]=s,r[s]=t,e[f++]=s-k.index,k.count++}this.reorderBuffers(e,r,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<
-g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!==e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*c));for(var f=0;f<c;f++){var g=b[f];for(e in this.attributes)if("index"!==e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,
-l=d[e],n=0;n<k;n++)l[f*k+n]=h[g*k+n]}this.attributes.index.array=a;for(e in this.attributes)"index"!==e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);if(void 0!==this.parameters){var b=this.parameters,c;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data={attributes:{}};var b=this.attributes,
-d=this.offsets,e=this.boundingSphere;for(c in b){var f=b[c],g=Array.prototype.slice.call(f.array);a.data.attributes[c]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}0<d.length&&(a.data.offsets=JSON.parse(JSON.stringify(d)));null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.radius});return a},clone:function(){var a=new THREE.BufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];
-a.offsets.push({start:d.start,index:d.index,count:d.count})}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.BufferGeometry.MaxIndex=65535;THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0};THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
-THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry;THREE.InstancedBufferGeometry.prototype.addDrawCall=function(a,b,c,d){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0,instances:d})};
-THREE.InstancedBufferGeometry.prototype.clone=function(){var a=new THREE.InstancedBufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count,instances:d.instances})}return a};THREE.EventDispatcher.prototype.apply(THREE.InstancedBufferGeometry.prototype);
+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)));if(0<a.morphTargets.length)for(var b=a.morphTargets,c=0,d=b.length;c<d;c++){var e=
+b[c],f=new THREE.Float32Attribute(3*e.length,3);this.morphAttributes.push(f.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<e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&
+console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<
+f;e+=3)b.fromArray(c,e),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),
+3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var r=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,count:r.length,index:0}],s=0,u=t.length;s<u;++s){e=t[s].start;f=t[s].count;for(var v=t[s].index,d=e,e=e+f;d<e;d+=3)f=3*(v+r[d]),g=3*(v+r[d+1]),h=3*(v+r[d+2]),k.fromArray(b,f),l.fromArray(b,g),n.fromArray(b,h),p.subVectors(n,l),m.subVectors(k,
+l),p.cross(m),c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),n.fromArray(b,d+6),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);m.fromArray(d,3*b);r.fromArray(d,3*c);t.fromArray(f,
+2*a);s.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-p.x;y=r.x-p.x;z=m.y-p.y;x=r.y-p.y;D=m.z-p.z;E=r.z-p.z;w=s.x-t.x;F=u.x-t.x;I=s.y-t.y;C=u.y-t.y;G=1/(w*C-F*I);R.set((C*v-I*y)*G,(C*z-I*x)*G,(C*D-I*E)*G);K.set((w*y-F*v)*G,(w*x-F*z)*G,(w*E-F*D)*G);k[a].add(R);k[b].add(R);k[c].add(R);l[a].add(K);l[b].add(K);l[c].add(K)}function b(a){na.fromArray(e,3*a);da.copy(na);ja=k[a];J.copy(ja);J.sub(na.multiplyScalar(na.dot(ja))).normalize();L.crossVectors(da,ja);ua=L.dot(l[a]);ka=0>ua?-1:1;h[4*a]=J.x;h[4*a+1]=J.y;
+h[4*a+2]=J.z;h[4*a+3]=ka}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*
+g),4));for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector2,s=new THREE.Vector2,u=new THREE.Vector2,v,y,z,x,D,E,w,F,I,C,G,R=new THREE.Vector3,K=new THREE.Vector3,A,H,B,T,O;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var S=this.drawcalls,n=0;for(H=S.length;n<H;++n){A=S[n].start;B=S[n].count;var P=S[n].index,g=A;for(A+=B;g<A;g+=3)B=P+c[g],T=P+c[g+1],
+O=P+c[g+2],a(B,T,O)}var J=new THREE.Vector3,L=new THREE.Vector3,na=new THREE.Vector3,da=new THREE.Vector3,ka,ja,ua,n=0;for(H=S.length;n<H;++n)for(A=S[n].start,B=S[n].count,P=S[n].index,g=A,A+=B;g<A;g+=3)B=P+c[g],T=P+c[g+1],O=P+c[g+2],b(B),b(T),b(O)}},computeOffsets:function(a){void 0===a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),
+f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,p=new Int32Array(6),m=new Int32Array(c.length),r=new Int32Array(c.length),t=0;t<c.length;t++)m[t]=-1,r[t]=-1;for(c=0;c<d;c++){for(var s=n=0;3>s;s++)t=b[3*c+s],-1===m[t]?(p[2*s]=t,p[2*s+1]=-1,n++):m[t]<k.index?(p[2*s]=t,p[2*s+1]=-1,l++):(p[2*s]=t,p[2*s+1]=m[t]);if(g+n>k.index+a)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)s=p[n+1],-1<s&&s<k.index&&(p[n+1]=-1);for(n=0;6>n;n+=2)t=p[n],s=p[n+1],-1===s&&(s=g++),m[t]=s,r[s]=t,e[f++]=s-k.index,
+k.count++}this.reorderBuffers(e,r,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,
+c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!==e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*c));for(var f=0;f<c;f++){var g=b[f];for(e in this.attributes)if("index"!==e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,l=d[e],n=0;n<k;n++)l[f*k+n]=h[g*k+n]}this.attributes.index.array=a;for(e in this.attributes)"index"!==
+e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);if(void 0!==this.parameters){var b=this.parameters,c;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data={attributes:{}};var b=this.attributes,d=this.offsets,e=this.boundingSphere;for(c in b){var f=b[c],g=Array.prototype.slice.call(f.array);
+a.data.attributes[c]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}0<d.length&&(a.data.offsets=JSON.parse(JSON.stringify(d)));null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.radius});return a},clone:function(){var a=new THREE.BufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count})}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};
+THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.BufferGeometry.MaxIndex=65535;THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0};THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry;
+THREE.InstancedBufferGeometry.prototype.addDrawCall=function(a,b,c,d){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0,instances:d})};THREE.InstancedBufferGeometry.prototype.clone=function(){var a=new THREE.InstancedBufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count,instances:d.instances})}return a};THREE.EventDispatcher.prototype.apply(THREE.InstancedBufferGeometry.prototype);
 THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,-1).applyQuaternion(a)}}();
 THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};
 THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1);f.lookAt(new THREE.Vector3(0,1,0));this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new THREE.Vector3(0,-1,0));
@@ -275,8 +273,8 @@ a.shadowDarkness=this.shadowDarkness;a.shadowMapWidth=this.shadowMapWidth;a.shad
 THREE.Cache={files:{},add:function(a,b){this.files[a]=b},get:function(a){return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.imageLoader=new THREE.ImageLoader;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/a.total).toFixed(0)+
 "%"):b+((a.loaded/1024).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split("/");if(1===a.length)return"./";a.pop();return a.join("/")+"/"},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=this.createMaterial(a[d],b);return c},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function d(a,
-d,e,g,h,k,s){var u=b+e,w,y=THREE.Loader.Handlers.get(u);null!==y?w=y.load(u):(w=new THREE.Texture,y=f.imageLoader,y.crossOrigin=f.crossOrigin,y.load(u,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);w.image=e}else w.image=a;w.needsUpdate=!0}));w.sourceFile=e;g&&(w.repeat.set(g[0],g[1]),1!==g[0]&&(w.wrapS=THREE.RepeatWrapping),
-1!==g[1]&&(w.wrapT=THREE.RepeatWrapping));h&&w.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(w.wrapS=e[k[0]]),void 0!==e[k[1]]&&(w.wrapT=e[k[1]]));s&&(w.anisotropy=s);a[d]=w}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":
+d,e,g,h,k,s){var u=b+e,v,y=THREE.Loader.Handlers.get(u);null!==y?v=y.load(u):(v=new THREE.Texture,y=f.imageLoader,y.crossOrigin=f.crossOrigin,y.load(u,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);v.image=e}else v.image=a;v.needsUpdate=!0}));v.sourceFile=e;g&&(v.repeat.set(g[0],g[1]),1!==g[0]&&(v.wrapS=THREE.RepeatWrapping),
+1!==g[1]&&(v.wrapT=THREE.RepeatWrapping));h&&v.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(v.wrapS=e[k[0]]),void 0!==e[k[1]]&&(v.wrapT=e[k[1]]));s&&(v.anisotropy=s);a[d]=v}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":
 "basic"===k&&(g="MeshBasicMaterial")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]);void 0!==a.transparent&&(h.transparent=a.transparent);void 0!==a.opacity&&1>a.opacity&&(h.transparent=!0);void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);
 void 0!==a.vertexColors&&("face"===a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorEmissive&&(h.emissive=e(a.colorEmissive));void 0!==a.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),a.opacity=a.transparency);void 0!==a.opacity&&(h.opacity=a.opacity);a.specularCoef&&(h.shininess=
 a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapAO&&b&&d(h,"aoMap",a.mapAO,a.mapAORepeat,a.mapAOOffset,a.mapAOWrap,a.mapAOAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,
@@ -288,10 +286,10 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
 setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText),k=h.metadata;if(void 0!==k){if("object"===k.type){console.error("THREE.JSONLoader: "+b+" should be loaded with THREE.ObjectLoader instead.");return}if("scene"===k.type){console.error("THREE.JSONLoader: "+b+" seems to be a Scene. Use THREE.SceneLoader instead.");return}}h=
 a.parse(h,d);c(h.geometry,h.materials)}else console.error("THREE.JSONLoader: "+b+" seems to be unreachable or the file is empty.");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load "+b+" ("+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)};
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,n,p,m,r,t,s,u,w,y=a.faces;n=a.vertices;var z=a.normals,v=a.colors,B=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&B++;for(d=0;d<B;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=y.length;k<l;)if(b=y[k++],r=b&1,h=b&2,d=b&8,p=b&16,t=b&32,n=b&64,b&=128,r){r=new THREE.Face3;
-r.a=y[k];r.b=y[k+1];r.c=y[k+3];s=new THREE.Face3;s.a=y[k+1];s.b=y[k+2];s.c=y[k+3];k+=4;h&&k++;h=c.faces.length;if(d)for(d=0;d<B;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=y[k++],w=u[2*m],m=u[2*m+1],w=new THREE.Vector2(w,m),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);p&&(p=3*y[k++],r.normal.set(z[p++],z[p++],z[p]),s.normal.copy(r.normal));if(t)for(d=0;4>d;d++)p=3*y[k++],t=new THREE.Vector3(z[p++],z[p++],z[p]),2!==d&&r.vertexNormals.push(t),
-0!==d&&s.vertexNormals.push(t);n&&(n=y[k++],n=v[n],r.color.setHex(n),s.color.setHex(n));if(b)for(d=0;4>d;d++)n=y[k++],n=v[n],2!==d&&r.vertexColors.push(new THREE.Color(n)),0!==d&&s.vertexColors.push(new THREE.Color(n));c.faces.push(r);c.faces.push(s)}else{r=new THREE.Face3;r.a=y[k++];r.b=y[k++];r.c=y[k++];h&&k++;h=c.faces.length;if(d)for(d=0;d<B;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=y[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*y[k++],
-r.normal.set(z[p++],z[p++],z[p]));if(t)for(d=0;3>d;d++)p=3*y[k++],t=new THREE.Vector3(z[p++],z[p++],z[p]),r.vertexNormals.push(t);n&&(n=y[k++],r.color.setHex(v[n]));if(b)for(d=0;3>d;d++)n=y[k++],r.vertexColors.push(new THREE.Color(v[n]));c.faces.push(r)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,n,p,m,r,t,s,u,v,y=a.faces;n=a.vertices;var z=a.normals,x=a.colors,D=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&D++;for(d=0;d<D;d++)c.faceVertexUvs[d]=[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=y.length;k<l;)if(b=y[k++],r=b&1,h=b&2,d=b&8,p=b&16,t=b&32,n=b&64,b&=128,r){r=new THREE.Face3;
+r.a=y[k];r.b=y[k+1];r.c=y[k+3];s=new THREE.Face3;s.a=y[k+1];s.b=y[k+2];s.c=y[k+3];k+=4;h&&k++;h=c.faces.length;if(d)for(d=0;d<D;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=y[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);p&&(p=3*y[k++],r.normal.set(z[p++],z[p++],z[p]),s.normal.copy(r.normal));if(t)for(d=0;4>d;d++)p=3*y[k++],t=new THREE.Vector3(z[p++],z[p++],z[p]),2!==d&&r.vertexNormals.push(t),
+0!==d&&s.vertexNormals.push(t);n&&(n=y[k++],n=x[n],r.color.setHex(n),s.color.setHex(n));if(b)for(d=0;4>d;d++)n=y[k++],n=x[n],2!==d&&r.vertexColors.push(new THREE.Color(n)),0!==d&&s.vertexColors.push(new THREE.Color(n));c.faces.push(r);c.faces.push(s)}else{r=new THREE.Face3;r.a=y[k++];r.b=y[k++];r.c=y[k++];h&&k++;h=c.faces.length;if(d)for(d=0;d<D;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=y[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*y[k++],
+r.normal.set(z[p++],z[p++],z[p]));if(t)for(d=0;3>d;d++)p=3*y[k++],t=new THREE.Vector3(z[p++],z[p++],z[p]),r.vertexNormals.push(t);n&&(n=y[k++],r.color.setHex(x[n]));if(b)for(d=0;3>d;d++)n=y[k++],r.vertexColors.push(new THREE.Color(x[n]));c.faces.push(r)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?
 a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("THREE.JSONLoader: When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+
 ") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,n;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var p=new THREE.Vector3;p.x=n[h]*b;p.y=n[h+1]*b;p.z=n[h+2]*b;l.push(p)}}if(void 0!==a.morphColors)for(d=0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]=
 {},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};
@@ -371,7 +369,7 @@ 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.Line.prototype.constructor=THREE.Line;
 THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(g instanceof
-THREE.BufferGeometry){var m=g.attributes;if(void 0!==m.index){var r=m.index.array,m=m.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:r.length,index:0}]);for(var s=0;s<t.length;s++)for(var u=t[s].start,w=t[s].count,y=t[s].index,g=u;g<u+w-1;g+=p){var z=y+r[g+1];h.fromArray(m,3*(y+r[g]));k.fromArray(m,3*z);z=b.distanceSqToSegment(h,k,n,l);z>f||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:s,face:null,faceIndex:null,
+THREE.BufferGeometry){var m=g.attributes;if(void 0!==m.index){var r=m.index.array,m=m.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:r.length,index:0}]);for(var s=0;s<t.length;s++)for(var u=t[s].start,v=t[s].count,y=t[s].index,g=u;g<u+v-1;g+=p){var z=y+r[g+1];h.fromArray(m,3*(y+r[g]));k.fromArray(m,3*z);z=b.distanceSqToSegment(h,k,n,l);z>f||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:s,face:null,faceIndex:null,
 object:this}))}}else for(m=m.position.array,g=0;g<m.length/3-1;g+=p)h.fromArray(m,3*g),k.fromArray(m,3*g+3),z=b.distanceSqToSegment(h,k,n,l),z>f||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,k=h.length,g=0;g<k-1;g+=p)z=b.distanceSqToSegment(h[g],h[g+1],n,l),z>f||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),
 index:g,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE[this.type](this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a);return a};
 THREE.Line.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.LineStrip=0;THREE.LinePieces=1;THREE.LineSegments=function(a,b){THREE.Line.call(this,a,b);this.type="LineSegments"};
@@ -379,11 +377,11 @@ THREE.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegme
 THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
 THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var l=
-this.material;if(void 0!==l){var n=k.attributes,p,m,r=g.precision;if(void 0!==n.index){var t=n.index.array,s=n.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:t.length,index:0}]);for(var w=0,y=u.length;w<y;++w)for(var n=u[w].start,z=u[w].index,k=n,v=n+u[w].count;k<v;k+=3){n=z+t[k];p=z+t[k+1];m=z+t[k+2];d.fromArray(s,3*n);e.fromArray(s,3*p);f.fromArray(s,3*m);var B=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide);if(null!==B){B.applyMatrix4(this.matrixWorld);
-var E=g.ray.origin.distanceTo(B);E<r||E<g.near||E>g.far||h.push({distance:E,point:B,face:new THREE.Face3(n,p,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(s=n.position.array,t=k=0,v=s.length;k<v;k+=3,t+=9)n=k,p=k+1,m=k+2,d.fromArray(s,t),e.fromArray(s,t+3),f.fromArray(s,t+6),B=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==B&&(B.applyMatrix4(this.matrixWorld),E=g.ray.origin.distanceTo(B),E<r||E<g.near||E>
-g.far||h.push({distance:E,point:B,face:new THREE.Face3(n,p,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,s=!0===t?this.material.materials:null,r=g.precision,u=k.vertices,w=0,y=k.faces.length;w<y;w++)if(z=k.faces[w],l=!0===t?s[z.materialIndex]:this.material,void 0!==l){n=u[z.a];p=u[z.b];m=u[z.c];if(!0===l.morphTargets){B=k.morphTargets;E=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
-0,0);for(var v=0,x=B.length;v<x;v++){var F=E[v];if(0!==F){var I=B[v].vertices;d.x+=(I[z.a].x-n.x)*F;d.y+=(I[z.a].y-n.y)*F;d.z+=(I[z.a].z-n.z)*F;e.x+=(I[z.b].x-p.x)*F;e.y+=(I[z.b].y-p.y)*F;e.z+=(I[z.b].z-p.z)*F;f.x+=(I[z.c].x-m.x)*F;f.y+=(I[z.c].y-m.y)*F;f.z+=(I[z.c].z-m.z)*F}}d.add(n);e.add(p);f.add(m);n=d;p=e;m=f}B=l.side===THREE.BackSide?b.intersectTriangle(m,p,n,!0):b.intersectTriangle(n,p,m,l.side!==THREE.DoubleSide);null!==B&&(B.applyMatrix4(this.matrixWorld),E=g.ray.origin.distanceTo(B),E<r||
-E<g.near||E>g.far||h.push({distance:E,point:B,face:z,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};
+this.material;if(void 0!==l){var n=k.attributes,p,m,r=g.precision;if(void 0!==n.index){var t=n.index.array,s=n.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:t.length,index:0}]);for(var v=0,y=u.length;v<y;++v)for(var n=u[v].start,z=u[v].index,k=n,x=n+u[v].count;k<x;k+=3){n=z+t[k];p=z+t[k+1];m=z+t[k+2];d.fromArray(s,3*n);e.fromArray(s,3*p);f.fromArray(s,3*m);var D=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide);if(null!==D){D.applyMatrix4(this.matrixWorld);
+var E=g.ray.origin.distanceTo(D);E<r||E<g.near||E>g.far||h.push({distance:E,point:D,face:new THREE.Face3(n,p,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(s=n.position.array,t=k=0,x=s.length;k<x;k+=3,t+=9)n=k,p=k+1,m=k+2,d.fromArray(s,t),e.fromArray(s,t+3),f.fromArray(s,t+6),D=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==D&&(D.applyMatrix4(this.matrixWorld),E=g.ray.origin.distanceTo(D),E<r||E<g.near||E>
+g.far||h.push({distance:E,point:D,face:new THREE.Face3(n,p,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,s=!0===t?this.material.materials:null,r=g.precision,u=k.vertices,v=0,y=k.faces.length;v<y;v++)if(z=k.faces[v],l=!0===t?s[z.materialIndex]:this.material,void 0!==l){n=u[z.a];p=u[z.b];m=u[z.c];if(!0===l.morphTargets){D=k.morphTargets;E=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
+0,0);for(var x=0,w=D.length;x<w;x++){var F=E[x];if(0!==F){var I=D[x].vertices;d.x+=(I[z.a].x-n.x)*F;d.y+=(I[z.a].y-n.y)*F;d.z+=(I[z.a].z-n.z)*F;e.x+=(I[z.b].x-p.x)*F;e.y+=(I[z.b].y-p.y)*F;e.z+=(I[z.b].z-p.z)*F;f.x+=(I[z.c].x-m.x)*F;f.y+=(I[z.c].y-m.y)*F;f.z+=(I[z.c].z-m.z)*F}}d.add(n);e.add(p);f.add(m);n=d;p=e;m=f}D=l.side===THREE.BackSide?b.intersectTriangle(m,p,n,!0):b.intersectTriangle(n,p,m,l.side!==THREE.DoubleSide);null!==D&&(D.applyMatrix4(this.matrixWorld),E=g.ray.origin.distanceTo(D),E<r||
+E<g.near||E>g.far||h.push({distance:E,point:D,face:z,faceIndex:v,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};
 THREE.Mesh.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON(a));void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a));b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Bone.prototype.constructor=THREE.Bone;
 THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),
@@ -479,10 +477,10 @@ THREE.WebGLRenderer=function(a){function b(a,b,c,d){var e;if(c instanceof THREE.
 k.data,n=l.stride,p=k.offset;q.bindBuffer(q.ARRAY_BUFFER,k.data.buffer);q.vertexAttribPointer(h,m,q.FLOAT,!1,n*l.array.BYTES_PER_ELEMENT,(d*n+p)*l.array.BYTES_PER_ELEMENT);if(l instanceof THREE.InstancedInterleavedBuffer){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,l.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=
 l.array.length/l.stride*l.meshPerAttribute)}}else if(q.bindBuffer(q.ARRAY_BUFFER,k.buffer),q.vertexAttribPointer(h,m,q.FLOAT,!1,0,d*m*4),k instanceof THREE.InstancedBufferAttribute){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,k.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=k.array.length/k.itemSize*k.meshPerAttribute)}}else void 0!==
 a.defaultAttributeValues&&void 0!==a.defaultAttributeValues[g]&&(2===a.defaultAttributeValues[g].length?q.vertexAttrib2fv(h,a.defaultAttributeValues[g]):3===a.defaultAttributeValues[g].length&&q.vertexAttrib3fv(h,a.defaultAttributeValues[g]))}}Q.disableUnusedAttributes()}function c(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.object.material.id!==b.object.material.id?a.object.material.id-b.object.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function d(a,
-b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function e(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ha.init(a),a instanceof THREE.Light)C.push(a);else if(a instanceof THREE.Sprite)S.push(a);else if(a instanceof THREE.LensFlare)P.push(a);else{var b=ha.objects[a.id];!b||!1!==a.frustumCulled&&!0!==Ha.intersectsObject(a)||(a.material.transparent?
+b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function e(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ha.init(a),a instanceof THREE.Light)B.push(a);else if(a instanceof THREE.Sprite)S.push(a);else if(a instanceof THREE.LensFlare)P.push(a);else{var b=ha.objects[a.id];!b||!1!==a.frustumCulled&&!0!==Ha.intersectsObject(a)||(a.material.transparent?
 O.push(b):T.push(b),!0===J.sortObjects&&(ia.setFromMatrixPosition(a.matrixWorld),ia.applyProjection(za),b.z=ia.z))}for(var b=0,c=a.children.length;b<c;b++)e(a.children[b])}}function f(a,b,c,d,e){for(var f,g=0,k=a.length;g<k;g++){var m=a[g].object;f=m;f._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,f.matrixWorld);f._normalMatrix.getNormalMatrix(f._modelViewMatrix);if(e)f=e;else{f=m.material;if(!f)continue;h(f)}J.setMaterialFaces(f);J.renderBufferDirect(b,c,d,f,m)}}function g(a,b,c,d,e,f){for(var g,
 k=0,m=a.length;k<m;k++){g=a[k];var l=g.object;if(!0===l.visible){if(f)g=f;else{g=g[b];if(!g)continue;h(g)}J.renderImmediateObject(c,d,e,g,l)}}}function h(a){!0===a.transparent?Q.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):Q.setBlending(THREE.NoBlending);Q.setDepthFunc(a.depthFunc);Q.setDepthTest(a.depthTest);Q.setDepthWrite(a.depthWrite);Q.setColorWrite(a.colorWrite);Q.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}
-function k(a,b,c,d,e){var f,g,h,k;Va=0;if(d.needsUpdate){a:{for(var s=Sb[d.type],t=0,v=0,z=0,y=0,x=0,I=b.length;x<I;x++){var B=b[x];B.onlyShadow||!1===B.visible||(B instanceof THREE.DirectionalLight&&t++,B instanceof THREE.PointLight&&v++,B instanceof THREE.SpotLight&&z++,B instanceof THREE.HemisphereLight&&y++)}f=t;g=v;h=z;k=y;for(var A,D=0,F=0,G=b.length;F<G;F++){var C=b[F];C.castShadow&&(C instanceof THREE.SpotLight&&D++,C instanceof THREE.DirectionalLight&&!C.shadowCascade&&D++)}A=D;var H;if(bb&&
+function k(a,b,c,d,e){var f,g,h,k;Va=0;if(d.needsUpdate){a:{for(var s=Sb[d.type],t=0,x=0,y=0,z=0,w=0,I=b.length;w<I;w++){var D=b[w];D.onlyShadow||!1===D.visible||(D instanceof THREE.DirectionalLight&&t++,D instanceof THREE.PointLight&&x++,D instanceof THREE.SpotLight&&y++,D instanceof THREE.HemisphereLight&&z++)}f=t;g=x;h=y;k=z;for(var A,C=0,F=0,G=b.length;F<G;F++){var B=b[F];B.castShadow&&(B instanceof THREE.SpotLight&&C++,B instanceof THREE.DirectionalLight&&!B.shadowCascade&&C++)}A=C;var H;if(bb&&
 e&&e.skeleton&&e.skeleton.useVertexTexture)H=1024;else{var O=q.getParameter(q.MAX_VERTEX_UNIFORM_VECTORS),R=Math.floor((O-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(R=Math.min(e.skeleton.bones.length,R),R<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+R+" (try OpenGL instead of ANGLE)"));H=R}var ja={precision:E,supportsVertexTextures:cb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,
 aoMap:!!d.aoMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:K,skinning:d.skinning,maxBones:H,useVertexTexture:bb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:J.maxMorphTargets,maxMorphNormals:J.maxMorphNormals,
 maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:A,shadowMapEnabled:ga.enabled&&e.receiveShadow&&0<A,shadowMapType:ga.type,shadowMapDebug:ga.debug,shadowMapCascade:ga.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},S=[];s?S.push(s):(S.push(d.fragmentShader),S.push(d.vertexShader));if(void 0!==d.defines)for(var P in d.defines)S.push(P),S.push(d.defines[P]);for(P in ja)S.push(P),S.push(ja[P]);var T=S.join();
@@ -499,7 +497,7 @@ Math.max(lb.length,3*tb);Z<oa;Z++)lb[Z]=0;Z=3*Ja;for(oa=Math.max(ob.length,3*Ya)
 fa.point.positions;M.pointLightDistance.value=fa.point.distances;M.pointLightDecay.value=fa.point.decays;M.spotLightColor.value=fa.spot.colors;M.spotLightPosition.value=fa.spot.positions;M.spotLightDistance.value=fa.spot.distances;M.spotLightDirection.value=fa.spot.directions;M.spotLightAngleCos.value=fa.spot.anglesCos;M.spotLightExponent.value=fa.spot.exponents;M.spotLightDecay.value=fa.spot.decays;M.hemisphereLightSkyColor.value=fa.hemi.skyColors;M.hemisphereLightGroundColor.value=fa.hemi.groundColors;
 M.hemisphereLightDirection.value=fa.hemi.positions;l(M,!0)}else l(M,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){M.opacity.value=d.opacity;M.diffuse.value=d.color;M.map.value=d.map;M.specularMap.value=d.specularMap;M.alphaMap.value=d.alphaMap;d.bumpMap&&(M.bumpMap.value=d.bumpMap,M.bumpScale.value=d.bumpScale);d.normalMap&&(M.normalMap.value=d.normalMap,M.normalScale.value.copy(d.normalScale));var wa;d.map?wa=d.map:d.specularMap?
 wa=d.specularMap:d.normalMap?wa=d.normalMap:d.bumpMap?wa=d.bumpMap:d.alphaMap&&(wa=d.alphaMap);if(void 0!==wa){var Hb=wa.offset,Ib=wa.repeat;M.offsetRepeat.value.set(Hb.x,Hb.y,Ib.x,Ib.y)}M.envMap.value=d.envMap;M.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;M.reflectivity.value=d.reflectivity;M.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)M.diffuse.value=d.color,M.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)M.diffuse.value=
-d.color,M.opacity.value=d.opacity,M.dashSize.value=d.dashSize,M.totalSize.value=d.dashSize+d.gapSize,M.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(M.psColor.value=d.color,M.opacity.value=d.opacity,M.size.value=d.size,M.scale.value=w.height/2,M.map.value=d.map,null!==d.map){var Jb=d.map.offset,Kb=d.map.repeat;M.offsetRepeat.value.set(Jb.x,Jb.y,Kb.x,Kb.y)}}else d instanceof THREE.MeshPhongMaterial?(M.shininess.value=d.shininess,M.emissive.value=d.emissive,M.specular.value=
+d.color,M.opacity.value=d.opacity,M.dashSize.value=d.dashSize,M.totalSize.value=d.dashSize+d.gapSize,M.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(M.psColor.value=d.color,M.opacity.value=d.opacity,M.size.value=d.size,M.scale.value=v.height/2,M.map.value=d.map,null!==d.map){var Jb=d.map.offset,Kb=d.map.repeat;M.offsetRepeat.value.set(Jb.x,Jb.y,Kb.x,Kb.y)}}else d instanceof THREE.MeshPhongMaterial?(M.shininess.value=d.shininess,M.emissive.value=d.emissive,M.specular.value=
 d.specular,M.lightMap.value=d.lightMap,M.lightMapIntensity.value=d.lightMapIntensity,M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshLambertMaterial?M.emissive.value=d.emissive:d instanceof THREE.MeshBasicMaterial?(M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshDepthMaterial?(M.mNear.value=a.near,M.mFar.value=a.far,M.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(M.opacity.value=d.opacity);if(e.receiveShadow&&
 !d._shadowPass&&M.shadowMatrix)for(var La=0,ub=0,Db=b.length;ub<Db;ub++){var ta=b[ub];ta.castShadow&&(ta instanceof THREE.SpotLight||ta instanceof THREE.DirectionalLight&&!ta.shadowCascade)&&(M.shadowMap.value[La]=ta.shadowMap,M.shadowMapSize.value[La]=ta.shadowMapSize,M.shadowMatrix.value[La]=ta.shadowMatrix,M.shadowDarkness.value[La]=ta.shadowDarkness,M.shadowBias.value[La]=ta.shadowBias,La++)}for(var vb=d.uniformsList,pa,Ca,qa,Za=0,Tb=vb.length;Za<Tb;Za++){var V=vb[Za][0];if(!1!==V.needsUpdate){var Lb=
 V.type,N=V.value,X=vb[Za][1];switch(Lb){case "1i":q.uniform1i(X,N);break;case "1f":q.uniform1f(X,N);break;case "2f":q.uniform2f(X,N[0],N[1]);break;case "3f":q.uniform3f(X,N[0],N[1],N[2]);break;case "4f":q.uniform4f(X,N[0],N[1],N[2],N[3]);break;case "1iv":q.uniform1iv(X,N);break;case "3iv":q.uniform3iv(X,N);break;case "1fv":q.uniform1fv(X,N);break;case "2fv":q.uniform2fv(X,N);break;case "3fv":q.uniform3fv(X,N);break;case "4fv":q.uniform4fv(X,N);break;case "Matrix3fv":q.uniformMatrix3fv(X,!1,N);break;
@@ -522,17 +520,17 @@ if(a===THREE.IntType)return q.INT;if(a===THREE.UnsignedIntType)return q.UNSIGNED
 if(a===THREE.ReverseSubtractEquation)return q.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return q.ZERO;if(a===THREE.OneFactor)return q.ONE;if(a===THREE.SrcColorFactor)return q.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return q.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return q.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return q.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return q.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return q.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return q.DST_COLOR;
 if(a===THREE.OneMinusDstColorFactor)return q.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return q.SRC_ALPHA_SATURATE;b=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 w=void 0!==a.canvas?a.canvas:document.createElement("canvas"),y=void 0!==a.context?a.context:null,z=w.width,v=w.height,B=1,E=void 0!==a.precision?a.precision:"highp",x=void 0!==a.alpha?a.alpha:!1,F=void 0!==a.depth?a.depth:!0,I=void 0!==a.stencil?a.stencil:!0,D=void 0!==a.antialias?a.antialias:!1,G=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,R=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,K=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,A=new THREE.Color(0),
-H=0,C=[],T=[],O=[],S=[],P=[];this.domElement=w;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var J=this,L=[],na=null,da=null,ka=-1,ja="",ua=null,Va=0,ma=0,Ga=0,Fa=w.width,ya=w.height,Ta=0,ra=0,Ha=new THREE.Frustum,
-za=new THREE.Matrix4,ia=new THREE.Vector3,ca=new THREE.Vector3,Xa=!0,Gb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},q;try{a={alpha:x,depth:F,stencil:I,antialias:D,premultipliedAlpha:G,preserveDrawingBuffer:R};q=y||w.getContext("webgl",a)||w.getContext("experimental-webgl",
-a);if(null===q){if(null!==w.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}w.addEventListener("webglcontextlost",function(a){a.preventDefault();Ua();$a();ha.objects={}},!1)}catch(zb){console.error("THREE.WebGLRenderer: "+zb)}var Q=new THREE.WebGLState(q,u);void 0===q.getShaderPrecisionFormat&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var W=new THREE.WebGLExtensions(q),ha=new THREE.WebGLObjects(q,
+a=a||{};var v=void 0!==a.canvas?a.canvas:document.createElement("canvas"),y=void 0!==a.context?a.context:null,z=v.width,x=v.height,D=1,E=void 0!==a.precision?a.precision:"highp",w=void 0!==a.alpha?a.alpha:!1,F=void 0!==a.depth?a.depth:!0,I=void 0!==a.stencil?a.stencil:!0,C=void 0!==a.antialias?a.antialias:!1,G=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,R=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,K=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,A=new THREE.Color(0),
+H=0,B=[],T=[],O=[],S=[],P=[];this.domElement=v;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var J=this,L=[],na=null,da=null,ka=-1,ja="",ua=null,Va=0,ma=0,Ga=0,Fa=v.width,ya=v.height,Ta=0,ra=0,Ha=new THREE.Frustum,
+za=new THREE.Matrix4,ia=new THREE.Vector3,ca=new THREE.Vector3,Xa=!0,Gb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},q;try{a={alpha:w,depth:F,stencil:I,antialias:C,premultipliedAlpha:G,preserveDrawingBuffer:R};q=y||v.getContext("webgl",a)||v.getContext("experimental-webgl",
+a);if(null===q){if(null!==v.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}v.addEventListener("webglcontextlost",function(a){a.preventDefault();Ua();$a();ha.objects={}},!1)}catch(zb){console.error("THREE.WebGLRenderer: "+zb)}var Q=new THREE.WebGLState(q,u);void 0===q.getShaderPrecisionFormat&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var W=new THREE.WebGLExtensions(q),ha=new THREE.WebGLObjects(q,
 this.info);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);K&&W.get("EXT_frag_depth");var Ma=function(a,b,c,d){!0===G&&(a*=d,b*=d,c*=d);q.clearColor(a,b,c,d)},$a=function(){q.clearColor(0,0,0,1);q.clearDepth(1);q.clearStencil(0);q.enable(q.DEPTH_TEST);q.depthFunc(q.LEQUAL);q.frontFace(q.CCW);
-q.cullFace(q.BACK);q.enable(q.CULL_FACE);q.enable(q.BLEND);q.blendEquation(q.FUNC_ADD);q.blendFunc(q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA);q.viewport(ma,Ga,Fa,ya);Ma(A.r,A.g,A.b,H)},Ua=function(){ua=na=null;ja="";ka=-1;Xa=!0;Q.reset()};$a();this.context=q;this.extensions=W;this.state=Q;var ga=new THREE.WebGLShadowMap(this,C,ha);this.shadowMap=ga;var Sa=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS),y=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ab=q.getParameter(q.MAX_TEXTURE_SIZE),Ub=q.getParameter(q.MAX_CUBE_MAP_TEXTURE_SIZE),
-cb=0<y,bb=cb&&W.get("OES_texture_float"),Bb=W.get("ANGLE_instanced_arrays"),x=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.HIGH_FLOAT),y=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.MEDIUM_FLOAT),F=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.HIGH_FLOAT);a=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.MEDIUM_FLOAT);var Rb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(W.get("WEBGL_compressed_texture_pvrtc")||W.get("WEBGL_compressed_texture_s3tc"))for(var b=q.getParameter(q.COMPRESSED_TEXTURE_FORMATS),
-c=0;c<b.length;c++)a.push(b[c]);return a}}(),x=0<x.precision&&0<F.precision,y=0<y.precision&&0<a.precision;"highp"!==E||x||(y?(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||y||(E="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Cb=new THREE.SpritePlugin(this,S),Db=new THREE.LensFlarePlugin(this,P);this.getContext=function(){return q};
+q.cullFace(q.BACK);q.enable(q.CULL_FACE);q.enable(q.BLEND);q.blendEquation(q.FUNC_ADD);q.blendFunc(q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA);q.viewport(ma,Ga,Fa,ya);Ma(A.r,A.g,A.b,H)},Ua=function(){ua=na=null;ja="";ka=-1;Xa=!0;Q.reset()};$a();this.context=q;this.extensions=W;this.state=Q;var ga=new THREE.WebGLShadowMap(this,B,ha);this.shadowMap=ga;var Sa=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS),y=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ab=q.getParameter(q.MAX_TEXTURE_SIZE),Ub=q.getParameter(q.MAX_CUBE_MAP_TEXTURE_SIZE),
+cb=0<y,bb=cb&&W.get("OES_texture_float"),Bb=W.get("ANGLE_instanced_arrays"),w=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.HIGH_FLOAT),y=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.MEDIUM_FLOAT),F=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.HIGH_FLOAT);a=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.MEDIUM_FLOAT);var Rb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(W.get("WEBGL_compressed_texture_pvrtc")||W.get("WEBGL_compressed_texture_s3tc"))for(var b=q.getParameter(q.COMPRESSED_TEXTURE_FORMATS),
+c=0;c<b.length;c++)a.push(b[c]);return a}}(),w=0<w.precision&&0<F.precision,y=0<y.precision&&0<a.precision;"highp"!==E||w||(y?(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||y||(E="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Cb=new THREE.SpritePlugin(this,S),Db=new THREE.LensFlarePlugin(this,P);this.getContext=function(){return q};
 this.forceContextLoss=function(){W.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return cb};this.supportsInstancedArrays=function(){return Bb};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?q.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return E};this.getPixelRatio=function(){return B};this.setPixelRatio=function(a){B=a};this.getSize=function(){return{width:z,
-height:v}};this.setSize=function(a,b,c){z=a;v=b;w.width=a*B;w.height=b*B;!1!==c&&(w.style.width=a+"px",w.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){ma=a*B;Ga=b*B;Fa=c*B;ya=d*B;q.viewport(ma,Ga,Fa,ya)};this.setScissor=function(a,b,c,d){q.scissor(a*B,b*B,c*B,d*B)};this.enableScissorTest=function(a){a?q.enable(q.SCISSOR_TEST):q.disable(q.SCISSOR_TEST)};this.getClearColor=function(){return A};this.setClearColor=function(a,b){A.set(a);H=void 0!==b?b:1;Ma(A.r,A.g,
+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?q.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return E};this.getPixelRatio=function(){return D};this.setPixelRatio=function(a){D=a};this.getSize=function(){return{width:z,
+height:x}};this.setSize=function(a,b,c){z=a;x=b;v.width=a*D;v.height=b*D;!1!==c&&(v.style.width=a+"px",v.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){ma=a*D;Ga=b*D;Fa=c*D;ya=d*D;q.viewport(ma,Ga,Fa,ya)};this.setScissor=function(a,b,c,d){q.scissor(a*D,b*D,c*D,d*D)};this.enableScissorTest=function(a){a?q.enable(q.SCISSOR_TEST):q.disable(q.SCISSOR_TEST)};this.getClearColor=function(){return A};this.setClearColor=function(a,b){A.set(a);H=void 0!==b?b:1;Ma(A.r,A.g,
 A.b,H)};this.getClearAlpha=function(){return H};this.setClearAlpha=function(a){H=a;Ma(A.r,A.g,A.b,H)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=q.COLOR_BUFFER_BIT;if(void 0===b||b)d|=q.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=q.STENCIL_BUFFER_BIT;q.clear(d)};this.clearColor=function(){q.clear(q.COLOR_BUFFER_BIT)};this.clearDepth=function(){q.clear(q.DEPTH_BUFFER_BIT)};this.clearStencil=function(){q.clear(q.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,
 c,d)};this.resetGLState=Ua;var wb=function(a){a=a.target;a.removeEventListener("dispose",wb);a.image&&a.image.__webglTextureCube?(q.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(q.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);J.info.memory.textures--},ab=function(a){a=a.target;a.removeEventListener("dispose",ab);if(a&&void 0!==a.__webglTexture){q.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof
 THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)q.deleteFramebuffer(a.__webglFramebuffer[b]),q.deleteRenderbuffer(a.__webglRenderbuffer[b]);else q.deleteFramebuffer(a.__webglFramebuffer),q.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}J.info.memory.textures--},Eb=function(a){a=a.target;a.removeEventListener("dispose",Eb);Fb(a)},Fb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=L.length;a<c;a++)if(d=L[a],
@@ -544,13 +542,13 @@ d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;f
 break a}n.drawElementsInstancedANGLE(c,d.array.length,h,0,g.maxInstancedCount)}else q.drawElements(c,d.array.length,h,0);J.info.render.calls++;J.info.render.vertices+=d.array.length;J.info.render.faces+=d.array.length/3}else{f=!0;for(var p=0,r=l.length;p<r;p++){n=l[p].index;f&&(b(e,a,g,n),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&0<l[p].instances){n=W.get("ANGLE_instanced_arrays");if(null===n){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
 break a}n.drawElementsInstancedANGLE(c,l[p].count,h,l[p].start*m,l[p].count,h,l[p].instances)}else q.drawElements(c,l[p].count,h,l[p].start*m);J.info.render.calls++;J.info.render.vertices+=l[p].count;J.info.render.faces+=l[p].count/3}}}else if(l=g.offsets,0===l.length){f&&b(e,a,g,0);e=g.attributes.position;if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){n=W.get("ANGLE_instanced_arrays");if(null===n){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
 break a}e instanceof THREE.InterleavedBufferAttribute?n.drawArraysInstancedANGLE(c,0,e.data.array.length/e.data.stride,g.maxInstancedCount):n.drawArraysInstancedANGLE(c,0,e.array.length/e.itemSize,g.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?q.drawArrays(c,0,e.data.array.length/e.data.stride):q.drawArrays(c,0,e.array.length/e.itemSize);J.info.render.calls++;J.info.render.vertices+=e.array.length/e.itemSize;J.info.render.faces+=e.array.length/(3*e.itemSize)}else for(f&&b(e,
-a,g,0),p=0,r=l.length;p<r;p++){if(g instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else q.drawArrays(c,l[p].start,l[p].count);J.info.render.calls++;J.info.render.vertices+=l[p].count;J.info.render.faces+=l[p].count/3}else if(f instanceof THREE.Line)if(f=f instanceof THREE.LineSegments?q.LINES:q.LINE_STRIP,Q.setLineWidth((void 0!==e.linewidth?e.linewidth:1)*B),h=g.attributes.index)if(h.array instanceof
+a,g,0),p=0,r=l.length;p<r;p++){if(g instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else q.drawArrays(c,l[p].start,l[p].count);J.info.render.calls++;J.info.render.vertices+=l[p].count;J.info.render.faces+=l[p].count/3}else if(f instanceof THREE.Line)if(f=f instanceof THREE.LineSegments?q.LINES:q.LINE_STRIP,Q.setLineWidth((void 0!==e.linewidth?e.linewidth:1)*D),h=g.attributes.index)if(h.array instanceof
 Uint32Array?(m=q.UNSIGNED_INT,l=4):(m=q.UNSIGNED_SHORT,l=2),d=g.offsets,0===d.length)c&&(b(e,a,g,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(f,h.array.length,m,0),J.info.render.calls++,J.info.render.vertices+=h.array.length;else for(1<d.length&&(c=!0),n=0,p=d.length;n<p;n++)r=d[n].index,c&&(b(e,a,g,r),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(f,d[n].count,m,d[n].start*l),J.info.render.calls++,J.info.render.vertices+=d[n].count;else if(c&&b(e,a,g,0),e=g.attributes.position,
 d=g.offsets,0===d.length)q.drawArrays(f,0,e.array.length/3),J.info.render.calls++,J.info.render.vertices+=e.array.length/3;else for(n=0,p=d.length;n<p;n++)q.drawArrays(f,d[n].index,d[n].count),J.info.render.calls++,J.info.render.vertices+=d[n].count;else if(f instanceof THREE.PointCloud)if(d=c,c=q.POINTS,h=g.attributes.index)if(h.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(m=q.UNSIGNED_INT,l=4):(m=q.UNSIGNED_SHORT,l=2),f=g.offsets,0===f.length)d&&(b(e,a,g,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,
 h.buffer)),q.drawElements(c,h.array.length,m,0),J.info.render.calls++,J.info.render.points+=h.array.length;else for(1<f.length&&(d=!0),n=0,p=f.length;n<p;n++)r=f[n].index,d&&(b(e,a,g,r),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(c,f[n].count,m,f[n].start*l),J.info.render.calls++,J.info.render.points+=f[n].count;else if(d&&b(e,a,g,0),e=g.attributes.position,f=g.offsets,0===f.length)q.drawArrays(c,0,e.array.length/3),J.info.render.calls++,J.info.render.points+=e.array.length/3;else for(n=
 0,p=f.length;n<p;n++)q.drawArrays(c,f[n].index,f[n].count),J.info.render.calls++,J.info.render.points+=f[n].count}};this.render=function(a,b,k,m){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var l=a.fog;ja="";ka=-1;ua=null;Xa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);za.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);
-Ha.setFromMatrix(za);C.length=0;T.length=0;O.length=0;S.length=0;P.length=0;e(a);!0===J.sortObjects&&(T.sort(c),O.sort(d));ha.update(T);ha.update(O);ga.render(a,b);J.info.render.calls=0;J.info.render.vertices=0;J.info.render.faces=0;J.info.render.points=0;this.setRenderTarget(k);(this.autoClear||m)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=0;for(var n=ha.objectsImmediate.length;m<n;m++){var p=ha.objectsImmediate[m],r=p.object;if(!0===r.visible){var s=r;s._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
-s.matrixWorld);s._normalMatrix.getNormalMatrix(s._modelViewMatrix);r=r.material;r.transparent?(p.transparent=r,p.opaque=null):(p.opaque=r,p.transparent=null)}}a.overrideMaterial?(m=a.overrideMaterial,h(m),f(T,b,C,l,m),f(O,b,C,l,m),g(ha.objectsImmediate,"",b,C,l,m)):(Q.setBlending(THREE.NoBlending),f(T,b,C,l,null),g(ha.objectsImmediate,"opaque",b,C,l,null),f(O,b,C,l,null),g(ha.objectsImmediate,"transparent",b,C,l,null));Cb.render(a,b);Db.render(a,b,Ta,ra);k&&k.generateMipmaps&&k.minFilter!==THREE.NearestFilter&&
+Ha.setFromMatrix(za);B.length=0;T.length=0;O.length=0;S.length=0;P.length=0;e(a);!0===J.sortObjects&&(T.sort(c),O.sort(d));ha.update(T);ha.update(O);ga.render(a,b);J.info.render.calls=0;J.info.render.vertices=0;J.info.render.faces=0;J.info.render.points=0;this.setRenderTarget(k);(this.autoClear||m)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=0;for(var n=ha.objectsImmediate.length;m<n;m++){var p=ha.objectsImmediate[m],r=p.object;if(!0===r.visible){var s=r;s._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
+s.matrixWorld);s._normalMatrix.getNormalMatrix(s._modelViewMatrix);r=r.material;r.transparent?(p.transparent=r,p.opaque=null):(p.opaque=r,p.transparent=null)}}a.overrideMaterial?(m=a.overrideMaterial,h(m),f(T,b,B,l,m),f(O,b,B,l,m),g(ha.objectsImmediate,"",b,B,l,m)):(Q.setBlending(THREE.NoBlending),f(T,b,B,l,null),g(ha.objectsImmediate,"opaque",b,B,l,null),f(O,b,B,l,null),g(ha.objectsImmediate,"transparent",b,B,l,null));Cb.render(a,b);Db.render(a,b,Ta,ra);k&&k.generateMipmaps&&k.minFilter!==THREE.NearestFilter&&
 k.minFilter!==THREE.LinearFilter&&(k instanceof THREE.WebGLRenderTargetCube?(Q.bindTexture(q.TEXTURE_CUBE_MAP,k.__webglTexture),q.generateMipmap(q.TEXTURE_CUBE_MAP),Q.bindTexture(q.TEXTURE_CUBE_MAP,null)):(Q.bindTexture(q.TEXTURE_2D,k.__webglTexture),q.generateMipmap(q.TEXTURE_2D),Q.bindTexture(q.TEXTURE_2D,null)));Q.setDepthTest(!0);Q.setDepthWrite(!0);Q.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=k(a,b,c,d,e);ja="";J.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,
 q,Ha):e.render(function(a){J.renderBufferImmediate(a,f,d)})};var Sb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?q.disable(q.CULL_FACE):(b===THREE.FrontFaceDirectionCW?q.frontFace(q.CW):q.frontFace(q.CCW),a===THREE.CullFaceBack?q.cullFace(q.BACK):a===THREE.CullFaceFront?
 q.cullFace(q.FRONT):q.cullFace(q.FRONT_AND_BACK),q.enable(q.CULL_FACE))};this.setMaterialFaces=function(a){Q.setDoubleSided(a.side===THREE.DoubleSide);Q.setFlipSided(a.side===THREE.BackSide)};this.uploadTexture=function(a,b){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",wb),a.__webglTexture=q.createTexture(),J.info.memory.textures++);Q.activeTexture(q.TEXTURE0+b);Q.bindTexture(q.TEXTURE_2D,a.__webglTexture);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,a.flipY);q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
@@ -580,70 +578,70 @@ THREE.InterleavedBuffer&&!0===f.dynamic)s=a.DYNAMIC_DRAW;a.bufferData(t,f.array,
 f.array.subarray(f.updateRange.offset,f.updateRange.offset+f.updateRange.count)),f.updateRange.count=0),f.needsUpdate=!1)}}}};
 THREE.WebGLProgram=function(){function a(a,b,e,f){return""!==b&&void 0!==b&&null!==b?a+b+"\n":a}var b=0;return function(c,d,e,f){var g=c.context,h=e.defines,k=e.__webglShader.uniforms,l=e.attributes,n=e.__webglShader.vertexShader,p=e.__webglShader.fragmentShader,m=e.index0AttributeName,r="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?r="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(r="SHADOWMAP_TYPE_PCF_SOFT");var t="ENVMAP_TYPE_CUBE",s="ENVMAP_MODE_REFLECTION",u="ENVMAP_BLENDING_MULTIPLY";
 if(f.envMap){switch(e.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:t="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:t="ENVMAP_TYPE_SPHERE"}switch(e.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:s="ENVMAP_MODE_REFRACTION"}switch(e.combine){case THREE.MultiplyOperation:u="ENVMAP_BLENDING_MULTIPLY";
-break;case THREE.MixOperation:u="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:u="ENVMAP_BLENDING_ADD"}}var w=0<c.gammaFactor?c.gammaFactor:1,y,z=[];for(y in h){var v=h[y];!1!==v&&z.push("#define "+y+" "+v)}y=z.join("\n");h=g.createProgram();e instanceof THREE.RawShaderMaterial?c=z="":(z=["precision "+f.precision+" float;","precision "+f.precision+" int;",y,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+
-w,"#define MAX_DIR_LIGHTS "+f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,"#define MAX_BONES "+f.maxBones,f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+s:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":
+break;case THREE.MixOperation:u="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:u="ENVMAP_BLENDING_ADD"}}var v=0<c.gammaFactor?c.gammaFactor:1,y,z=[];for(y in h){var x=h[y];!1!==x&&z.push("#define "+y+" "+x)}y=z.join("\n");h=g.createProgram();e instanceof THREE.RawShaderMaterial?c=z="":(z=["precision "+f.precision+" float;","precision "+f.precision+" int;",y,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+
+v,"#define MAX_DIR_LIGHTS "+f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,"#define MAX_BONES "+f.maxBones,f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+s:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":
 "",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.skinning?"#define USE_SKINNING":"",f.useVertexTexture?"#define BONE_TEXTURE":"",f.morphTargets?"#define USE_MORPHTARGETS":"",f.morphNormals?"#define USE_MORPHNORMALS":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+r:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?
 "#define SHADOWMAP_CASCADE":"",f.sizeAttenuation?"#define USE_SIZEATTENUATION":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&c.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR",
 "\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;",
 "\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif",""].reduce(a,""),c=[f.bumpMap||f.normalMap||f.flatShading||e.derivatives?"#extension GL_OES_standard_derivatives : enable":"","precision "+f.precision+" float;","precision "+f.precision+" int;",y,"#define MAX_DIR_LIGHTS "+f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+
-f.maxShadows,f.alphaTest?"#define ALPHATEST "+f.alphaTest:"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+w,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+t:"",f.envMap?"#define "+s:"",f.envMap?"#define "+u:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":
+f.maxShadows,f.alphaTest?"#define ALPHATEST "+f.alphaTest:"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+v,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+t:"",f.envMap?"#define "+s:"",f.envMap?"#define "+u:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":
 "",f.specularMap?"#define USE_SPECULARMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.metal?"#define METAL":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+r:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&
 c.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",""].reduce(a,""));n=new THREE.WebGLShader(g,g.VERTEX_SHADER,z+n);p=new THREE.WebGLShader(g,g.FRAGMENT_SHADER,c+p);g.attachShader(h,n);g.attachShader(h,p);void 0!==m&&g.bindAttribLocation(h,0,m);g.linkProgram(h);m=g.getProgramInfoLog(h);c=g.getShaderInfoLog(n);r=g.getShaderInfoLog(p);!1===g.getProgramParameter(h,g.LINK_STATUS)&&console.error("THREE.WebGLProgram: shader error: ",
 g.getError(),"gl.VALIDATE_STATUS",g.getProgramParameter(h,g.VALIDATE_STATUS),"gl.getProgramInfoLog",m,c,r);""!==m&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",m);g.deleteShader(n);g.deleteShader(p);m="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");f.useVertexTexture?m.push("boneTexture","boneTextureWidth","boneTextureHeight"):m.push("boneGlobalMatrices");f.logarithmicDepthBuffer&&m.push("logDepthBufFC");
-for(var B in k)m.push(B);k=m;B={};m=0;for(c=k.length;m<c;m++)r=k[m],B[r]=g.getUniformLocation(h,r);this.uniforms=B;if(e instanceof THREE.RawShaderMaterial)m=l;else{m="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(e=0;e<f.maxMorphTargets;e++)m.push("morphTarget"+e);for(e=0;e<f.maxMorphNormals;e++)m.push("morphNormal"+e);Array.isArray(l)&&(m=m.concat(l))}f=m;l={};e=0;for(k=f.length;e<k;e++)B=f[e],l[B]=g.getAttribLocation(h,B);this.attributes=l;this.id=b++;this.code=
+for(var D in k)m.push(D);k=m;D={};m=0;for(c=k.length;m<c;m++)r=k[m],D[r]=g.getUniformLocation(h,r);this.uniforms=D;if(e instanceof THREE.RawShaderMaterial)m=l;else{m="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(e=0;e<f.maxMorphTargets;e++)m.push("morphTarget"+e);for(e=0;e<f.maxMorphNormals;e++)m.push("morphNormal"+e);Array.isArray(l)&&(m=m.concat(l))}f=m;l={};e=0;for(k=f.length;e<k;e++)D=f[e],l[D]=g.getAttribLocation(h,D);this.attributes=l;this.id=b++;this.code=
 d;this.usedTimes=1;this.program=h;this.vertexShader=n;this.fragmentShader=p;return this}}();
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){var e=b.createShader(c);b.shaderSource(e,d);b.compileShader(e);!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(e)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",c===b.VERTEX_SHADER?"vertex":"fragment",b.getShaderInfoLog(e),a(d));return e}}();
 THREE.WebGLShadowMap=function(a,b,c){function d(a,b){if(!0===a.visible){var e=c.objects[a.id];e&&a.castShadow&&(!1===a.frustumCulled||!0===f.intersectsObject(a))&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),p.push(e));for(var e=0,g=a.children.length;e<g;e++)d(a.children[e],b)}}var e=a.context,f=new THREE.Frustum,g=new THREE.Matrix4,h=new THREE.Vector3,k=new THREE.Vector3,l=c.objectsImmediate,n=new THREE.Vector3,p=[],m=THREE.ShaderLib.depthRGBA,r=THREE.UniformsUtils.clone(m.uniforms),
-t=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}),s=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0}),u=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,skinning:!0}),w=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0,skinning:!0});t._shadowPass=!0;s._shadowPass=!0;u._shadowPass=
-!0;w._shadowPass=!0;var y=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=this.debug=!1;this.render=function(c,m){if(!1!==y.enabled){var r,E,x,F,I,D,G,R=[];F=0;e.clearColor(1,1,1,1);e.disable(e.BLEND);e.enable(e.CULL_FACE);e.frontFace(e.CCW);y.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);a.state.setDepthTest(!0);r=0;for(E=b.length;r<E;r++)if(x=b[r],x.castShadow)if(x instanceof THREE.DirectionalLight&&x.shadowCascade)for(I=0;I<
-x.shadowCascadeCount;I++){var K;if(x.shadowCascadeArray[I])K=x.shadowCascadeArray[I];else{var A=x;G=I;K=new THREE.DirectionalLight;K.isVirtual=!0;K.onlyShadow=!0;K.castShadow=!0;K.shadowCameraNear=A.shadowCameraNear;K.shadowCameraFar=A.shadowCameraFar;K.shadowCameraLeft=A.shadowCameraLeft;K.shadowCameraRight=A.shadowCameraRight;K.shadowCameraBottom=A.shadowCameraBottom;K.shadowCameraTop=A.shadowCameraTop;K.shadowCameraVisible=A.shadowCameraVisible;K.shadowDarkness=A.shadowDarkness;K.shadowBias=A.shadowCascadeBias[G];
-K.shadowMapWidth=A.shadowCascadeWidth[G];K.shadowMapHeight=A.shadowCascadeHeight[G];K.pointsWorld=[];K.pointsFrustum=[];var H=K.pointsWorld;D=K.pointsFrustum;for(var C=0;8>C;C++)H[C]=new THREE.Vector3,D[C]=new THREE.Vector3;H=A.shadowCascadeNearZ[G];A=A.shadowCascadeFarZ[G];D[0].set(-1,-1,H);D[1].set(1,-1,H);D[2].set(-1,1,H);D[3].set(1,1,H);D[4].set(-1,-1,A);D[5].set(1,-1,A);D[6].set(-1,1,A);D[7].set(1,1,A);K.originalCamera=m;D=new THREE.Gyroscope;D.position.copy(x.shadowCascadeOffset);D.add(K);D.add(K.target);
-m.add(D);x.shadowCascadeArray[I]=K}G=x;H=I;A=G.shadowCascadeArray[H];A.position.copy(G.position);A.target.position.copy(G.target.position);A.lookAt(A.target);A.shadowCameraVisible=G.shadowCameraVisible;A.shadowDarkness=G.shadowDarkness;A.shadowBias=G.shadowCascadeBias[H];D=G.shadowCascadeNearZ[H];G=G.shadowCascadeFarZ[H];A=A.pointsFrustum;A[0].z=D;A[1].z=D;A[2].z=D;A[3].z=D;A[4].z=G;A[5].z=G;A[6].z=G;A[7].z=G;R[F]=K;F++}else R[F]=x,F++;r=0;for(E=R.length;r<E;r++){x=R[r];x.shadowMap||(I=THREE.LinearFilter,
-y.type===THREE.PCFSoftShadowMap&&(I=THREE.NearestFilter),x.shadowMap=new THREE.WebGLRenderTarget(x.shadowMapWidth,x.shadowMapHeight,{minFilter:I,magFilter:I,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&&K.originalCamera==m){I=m;F=x.shadowCamera;D=x.pointsFrustum;A=x.pointsWorld;
-h.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(G=0;8>G;G++)H=A[G],H.copy(D[G]),H.unproject(I),H.applyMatrix4(F.matrixWorldInverse),H.x<h.x&&(h.x=H.x),H.x>k.x&&(k.x=H.x),H.y<h.y&&(h.y=H.y),H.y>k.y&&(k.y=H.y),H.z<h.z&&(h.z=H.z),H.z>k.z&&(k.z=H.z);F.left=h.x;F.right=k.x;F.top=k.y;F.bottom=h.y;F.updateProjectionMatrix()}F=x.shadowMap;D=x.shadowMatrix;I=x.shadowCamera;I.position.setFromMatrixPosition(x.matrixWorld);n.setFromMatrixPosition(x.target.matrixWorld);I.lookAt(n);I.updateMatrixWorld();
-I.matrixWorldInverse.getInverse(I.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(I.projectionMatrix);D.multiply(I.matrixWorldInverse);g.multiplyMatrices(I.projectionMatrix,I.matrixWorldInverse);f.setFromMatrix(g);a.setRenderTarget(F);a.clear();p.length=0;d(c,I);x=0;for(F=p.length;x<F;x++)D=p[x],D=D.object,A=D.material instanceof THREE.MeshFaceMaterial?D.material.materials[0]:
-D.material,G=void 0!==D.geometry.morphTargets&&0<D.geometry.morphTargets.length&&A.morphTargets,H=D instanceof THREE.SkinnedMesh&&A.skinning,G=D.customDepthMaterial?D.customDepthMaterial:H?G?w:u:G?s:t,a.setMaterialFaces(A),a.renderBufferDirect(I,b,null,G,D);x=0;for(F=l.length;x<F;x++)D=l[x],D=D.object,D.visible&&D.castShadow&&(D._modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,D.matrixWorld),a.renderImmediateObject(I,b,null,t,D))}r=a.getClearColor();E=a.getClearAlpha();e.clearColor(r.r,r.g,
+t=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}),s=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0}),u=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,skinning:!0}),v=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0,skinning:!0});t._shadowPass=!0;s._shadowPass=!0;u._shadowPass=
+!0;v._shadowPass=!0;var y=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=this.debug=!1;this.render=function(c,m){if(!1!==y.enabled){var r,E,w,F,I,C,G,R=[];F=0;e.clearColor(1,1,1,1);e.disable(e.BLEND);e.enable(e.CULL_FACE);e.frontFace(e.CCW);y.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);a.state.setDepthTest(!0);r=0;for(E=b.length;r<E;r++)if(w=b[r],w.castShadow)if(w instanceof THREE.DirectionalLight&&w.shadowCascade)for(I=0;I<
+w.shadowCascadeCount;I++){var K;if(w.shadowCascadeArray[I])K=w.shadowCascadeArray[I];else{var A=w;G=I;K=new THREE.DirectionalLight;K.isVirtual=!0;K.onlyShadow=!0;K.castShadow=!0;K.shadowCameraNear=A.shadowCameraNear;K.shadowCameraFar=A.shadowCameraFar;K.shadowCameraLeft=A.shadowCameraLeft;K.shadowCameraRight=A.shadowCameraRight;K.shadowCameraBottom=A.shadowCameraBottom;K.shadowCameraTop=A.shadowCameraTop;K.shadowCameraVisible=A.shadowCameraVisible;K.shadowDarkness=A.shadowDarkness;K.shadowBias=A.shadowCascadeBias[G];
+K.shadowMapWidth=A.shadowCascadeWidth[G];K.shadowMapHeight=A.shadowCascadeHeight[G];K.pointsWorld=[];K.pointsFrustum=[];var H=K.pointsWorld;C=K.pointsFrustum;for(var B=0;8>B;B++)H[B]=new THREE.Vector3,C[B]=new THREE.Vector3;H=A.shadowCascadeNearZ[G];A=A.shadowCascadeFarZ[G];C[0].set(-1,-1,H);C[1].set(1,-1,H);C[2].set(-1,1,H);C[3].set(1,1,H);C[4].set(-1,-1,A);C[5].set(1,-1,A);C[6].set(-1,1,A);C[7].set(1,1,A);K.originalCamera=m;C=new THREE.Gyroscope;C.position.copy(w.shadowCascadeOffset);C.add(K);C.add(K.target);
+m.add(C);w.shadowCascadeArray[I]=K}G=w;H=I;A=G.shadowCascadeArray[H];A.position.copy(G.position);A.target.position.copy(G.target.position);A.lookAt(A.target);A.shadowCameraVisible=G.shadowCameraVisible;A.shadowDarkness=G.shadowDarkness;A.shadowBias=G.shadowCascadeBias[H];C=G.shadowCascadeNearZ[H];G=G.shadowCascadeFarZ[H];A=A.pointsFrustum;A[0].z=C;A[1].z=C;A[2].z=C;A[3].z=C;A[4].z=G;A[5].z=G;A[6].z=G;A[7].z=G;R[F]=K;F++}else R[F]=w,F++;r=0;for(E=R.length;r<E;r++){w=R[r];w.shadowMap||(I=THREE.LinearFilter,
+y.type===THREE.PCFSoftShadowMap&&(I=THREE.NearestFilter),w.shadowMap=new THREE.WebGLRenderTarget(w.shadowMapWidth,w.shadowMapHeight,{minFilter:I,magFilter:I,format:THREE.RGBAFormat}),w.shadowMapSize=new THREE.Vector2(w.shadowMapWidth,w.shadowMapHeight),w.shadowMatrix=new THREE.Matrix4);if(!w.shadowCamera){if(w instanceof THREE.SpotLight)w.shadowCamera=new THREE.PerspectiveCamera(w.shadowCameraFov,w.shadowMapWidth/w.shadowMapHeight,w.shadowCameraNear,w.shadowCameraFar);else if(w instanceof THREE.DirectionalLight)w.shadowCamera=
+new THREE.OrthographicCamera(w.shadowCameraLeft,w.shadowCameraRight,w.shadowCameraTop,w.shadowCameraBottom,w.shadowCameraNear,w.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",w);continue}c.add(w.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}w.shadowCameraVisible&&!w.cameraHelper&&(w.cameraHelper=new THREE.CameraHelper(w.shadowCamera),c.add(w.cameraHelper));if(w.isVirtual&&K.originalCamera==m){I=m;F=w.shadowCamera;C=w.pointsFrustum;A=w.pointsWorld;
+h.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(G=0;8>G;G++)H=A[G],H.copy(C[G]),H.unproject(I),H.applyMatrix4(F.matrixWorldInverse),H.x<h.x&&(h.x=H.x),H.x>k.x&&(k.x=H.x),H.y<h.y&&(h.y=H.y),H.y>k.y&&(k.y=H.y),H.z<h.z&&(h.z=H.z),H.z>k.z&&(k.z=H.z);F.left=h.x;F.right=k.x;F.top=k.y;F.bottom=h.y;F.updateProjectionMatrix()}F=w.shadowMap;C=w.shadowMatrix;I=w.shadowCamera;I.position.setFromMatrixPosition(w.matrixWorld);n.setFromMatrixPosition(w.target.matrixWorld);I.lookAt(n);I.updateMatrixWorld();
+I.matrixWorldInverse.getInverse(I.matrixWorld);w.cameraHelper&&(w.cameraHelper.visible=w.shadowCameraVisible);w.shadowCameraVisible&&w.cameraHelper.update();C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);C.multiply(I.projectionMatrix);C.multiply(I.matrixWorldInverse);g.multiplyMatrices(I.projectionMatrix,I.matrixWorldInverse);f.setFromMatrix(g);a.setRenderTarget(F);a.clear();p.length=0;d(c,I);w=0;for(F=p.length;w<F;w++)C=p[w],C=C.object,A=C.material instanceof THREE.MeshFaceMaterial?C.material.materials[0]:
+C.material,G=void 0!==C.geometry.morphTargets&&0<C.geometry.morphTargets.length&&A.morphTargets,H=C instanceof THREE.SkinnedMesh&&A.skinning,G=C.customDepthMaterial?C.customDepthMaterial:H?G?v:u:G?s:t,a.setMaterialFaces(A),a.renderBufferDirect(I,b,null,G,C);w=0;for(F=l.length;w<F;w++)C=l[w],C=C.object,C.visible&&C.castShadow&&(C._modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,C.matrixWorld),a.renderImmediateObject(I,b,null,t,C))}r=a.getClearColor();E=a.getClearAlpha();e.clearColor(r.r,r.g,
 r.b,E);e.enable(e.BLEND);y.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState()}}};
-THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),f=null,g=null,h=null,k=null,l=null,n=null,p=null,m=null,r=null,t=null,s=null,u=null,w=null,y=null,z=null,v=null,B=null,E=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),x=void 0,F={};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]&&
+THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),f=null,g=null,h=null,k=null,l=null,n=null,p=null,m=null,r=null,t=null,s=null,u=null,v=null,y=null,z=null,x=null,D=null,E=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),w=void 0,F={};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&
 (a.disableVertexAttribArray(b),e[b]=0)};this.setBlending=function(c,d,e,m,r,s,t){c!==f&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?a.enable(a.BLEND):
 (a.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),f=c);if(c===THREE.CustomBlending){r=r||d;s=s||e;t=t||m;if(d!==g||r!==l)a.blendEquationSeparate(b(d),b(r)),g=d,l=r;if(e!==h||m!==k||s!==n||t!==p)a.blendFuncSeparate(b(e),b(m),b(s),b(t)),h=e,k=m,n=s,p=t}else p=n=l=k=h=g=null};this.setDepthFunc=function(b){if(m!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);
 break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);m=b}};this.setDepthTest=function(b){r!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),r=b)};this.setDepthWrite=function(b){t!==
-b&&(a.depthMask(b),t=b)};this.setColorWrite=function(b){s!==b&&(a.colorMask(b,b,b,b),s=b)};this.setDoubleSided=function(b){u!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),u=b)};this.setFlipSided=function(b){w!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),w=b)};this.setLineWidth=function(b){b!==y&&(a.lineWidth(b),y=b)};this.setPolygonOffset=function(b,c,d){z!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),z=b);!b||v===c&&B===d||(a.polygonOffset(c,d),v=c,B=d)};this.activeTexture=
-function(b){void 0===b&&(b=a.TEXTURE0+E-1);x!==b&&(a.activeTexture(b),x=b)};this.bindTexture=function(b,d){void 0===x&&c.activeTexture();var e=F[x];void 0===e&&(e={type:void 0,texture:void 0},F[x]=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 a=
-0;a<e.length;a++)e[a]=0;w=u=s=t=r=f=null}};
-THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,l,n,p,m=a.context,r,t,s,u,w,y;this.render=function(z,v,B,E){if(0!==b.length){z=new THREE.Vector3;var x=E/B,F=.5*B,I=.5*E,D=16/E,G=new THREE.Vector2(D*x,D),R=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1);if(void 0===s){var D=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),A=new Uint16Array([0,1,2,0,2,3]);r=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,r);m.bufferData(m.ARRAY_BUFFER,D,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
-t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,A,m.STATIC_DRAW);w=m.createTexture();y=m.createTexture();a.state.bindTexture(m.TEXTURE_2D,w);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);a.state.bindTexture(m.TEXTURE_2D,y);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 D=(u=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
+b&&(a.depthMask(b),t=b)};this.setColorWrite=function(b){s!==b&&(a.colorMask(b,b,b,b),s=b)};this.setDoubleSided=function(b){u!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),u=b)};this.setFlipSided=function(b){v!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),v=b)};this.setLineWidth=function(b){b!==y&&(a.lineWidth(b),y=b)};this.setPolygonOffset=function(b,c,d){z!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),z=b);!b||x===c&&D===d||(a.polygonOffset(c,d),x=c,D=d)};this.activeTexture=
+function(b){void 0===b&&(b=a.TEXTURE0+E-1);w!==b&&(a.activeTexture(b),w=b)};this.bindTexture=function(b,d){void 0===w&&c.activeTexture();var e=F[w];void 0===e&&(e={type:void 0,texture:void 0},F[w]=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 a=
+0;a<e.length;a++)e[a]=0;v=u=s=t=r=f=null}};
+THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,l,n,p,m=a.context,r,t,s,u,v,y;this.render=function(z,x,D,E){if(0!==b.length){z=new THREE.Vector3;var w=E/D,F=.5*D,I=.5*E,C=16/E,G=new THREE.Vector2(C*w,C),R=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1);if(void 0===s){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),A=new Uint16Array([0,1,2,0,2,3]);r=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,r);m.bufferData(m.ARRAY_BUFFER,C,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
+t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,A,m.STATIC_DRAW);v=m.createTexture();y=m.createTexture();a.state.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);a.state.bindTexture(m.TEXTURE_2D,y);m.texImage2D(m.TEXTURE_2D,
+0,m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var C=(u=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 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}"},
-A=m.createProgram(),H=m.createShader(m.FRAGMENT_SHADER),C=m.createShader(m.VERTEX_SHADER),T="precision "+a.getPrecision()+" float;\n";m.shaderSource(H,T+D.fragmentShader);m.shaderSource(C,T+D.vertexShader);m.compileShader(H);m.compileShader(C);m.attachShader(A,H);m.attachShader(A,C);m.linkProgram(A);s=A;n=m.getAttribLocation(s,"position");p=m.getAttribLocation(s,"uv");c=m.getUniformLocation(s,"renderType");d=m.getUniformLocation(s,"map");e=m.getUniformLocation(s,"occlusionMap");f=m.getUniformLocation(s,
+A=m.createProgram(),H=m.createShader(m.FRAGMENT_SHADER),B=m.createShader(m.VERTEX_SHADER),T="precision "+a.getPrecision()+" float;\n";m.shaderSource(H,T+C.fragmentShader);m.shaderSource(B,T+C.vertexShader);m.compileShader(H);m.compileShader(B);m.attachShader(A,H);m.attachShader(A,B);m.linkProgram(A);s=A;n=m.getAttribLocation(s,"position");p=m.getAttribLocation(s,"uv");c=m.getUniformLocation(s,"renderType");d=m.getUniformLocation(s,"map");e=m.getUniformLocation(s,"occlusionMap");f=m.getUniformLocation(s,
 "opacity");g=m.getUniformLocation(s,"color");h=m.getUniformLocation(s,"scale");k=m.getUniformLocation(s,"rotation");l=m.getUniformLocation(s,"screenPosition")}m.useProgram(s);a.state.initAttributes();a.state.enableAttribute(n);a.state.enableAttribute(p);a.state.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,r);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);m.disable(m.CULL_FACE);
-m.depthMask(!1);A=0;for(H=b.length;A<H;A++)if(D=16/E,G.set(D*x,D),C=b[A],z.set(C.matrixWorld.elements[12],C.matrixWorld.elements[13],C.matrixWorld.elements[14]),z.applyMatrix4(v.matrixWorldInverse),z.applyProjection(v.projectionMatrix),R.copy(z),K.x=R.x*F+F,K.y=R.y*I+I,u||0<K.x&&K.x<B&&0<K.y&&K.y<E){a.state.activeTexture(m.TEXTURE1);a.state.bindTexture(m.TEXTURE_2D,w);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,K.x-8,K.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,G.x,G.y);m.uniform3f(l,R.x,R.y,R.z);m.disable(m.BLEND);
-m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);a.state.activeTexture(m.TEXTURE0);a.state.bindTexture(m.TEXTURE_2D,y);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,K.x-8,K.y-8,16,16,0);m.uniform1i(c,1);m.disable(m.DEPTH_TEST);a.state.activeTexture(m.TEXTURE1);a.state.bindTexture(m.TEXTURE_2D,w);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);C.positionScreen.copy(R);C.customUpdateCallback?C.customUpdateCallback(C):C.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var T=
-0,O=C.lensFlares.length;T<O;T++){var S=C.lensFlares[T];.001<S.opacity&&.001<S.scale&&(R.x=S.x,R.y=S.y,R.z=S.z,D=S.size*S.scale/E,G.x=D*x,G.y=D,m.uniform3f(l,R.x,R.y,R.z),m.uniform2f(h,G.x,G.y),m.uniform1f(k,S.rotation),m.uniform1f(f,S.opacity),m.uniform3f(g,S.color.r,S.color.g,S.color.b),a.state.setBlending(S.blending,S.blendEquation,S.blendSrc,S.blendDst),a.setTexture(S.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,l,n,p,m,r,t,s,u,w,y;function z(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var v=a.context,B,E,x,F,I=new THREE.Vector3,D=new THREE.Quaternion,G=new THREE.Vector3;this.render=function(R,K){if(0!==b.length){if(void 0===x){var A=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),H=new Uint16Array([0,1,2,0,2,3]);B=v.createBuffer();E=v.createBuffer();v.bindBuffer(v.ARRAY_BUFFER,B);v.bufferData(v.ARRAY_BUFFER,A,v.STATIC_DRAW);v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,
-E);v.bufferData(v.ELEMENT_ARRAY_BUFFER,H,v.STATIC_DRAW);var A=v.createProgram(),H=v.createShader(v.VERTEX_SHADER),C=v.createShader(v.FRAGMENT_SHADER);v.shaderSource(H,["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"));
-v.shaderSource(C,["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"));
-v.compileShader(H);v.compileShader(C);v.attachShader(A,H);v.attachShader(A,C);v.linkProgram(A);x=A;w=v.getAttribLocation(x,"position");y=v.getAttribLocation(x,"uv");c=v.getUniformLocation(x,"uvOffset");d=v.getUniformLocation(x,"uvScale");e=v.getUniformLocation(x,"rotation");f=v.getUniformLocation(x,"scale");g=v.getUniformLocation(x,"color");h=v.getUniformLocation(x,"map");k=v.getUniformLocation(x,"opacity");l=v.getUniformLocation(x,"modelViewMatrix");n=v.getUniformLocation(x,"projectionMatrix");p=
-v.getUniformLocation(x,"fogType");m=v.getUniformLocation(x,"fogDensity");r=v.getUniformLocation(x,"fogNear");t=v.getUniformLocation(x,"fogFar");s=v.getUniformLocation(x,"fogColor");u=v.getUniformLocation(x,"alphaTest");A=document.createElement("canvas");A.width=8;A.height=8;H=A.getContext("2d");H.fillStyle="white";H.fillRect(0,0,8,8);F=new THREE.Texture(A);F.needsUpdate=!0}v.useProgram(x);a.state.initAttributes();a.state.enableAttribute(w);a.state.enableAttribute(y);a.state.disableUnusedAttributes();
-v.disable(v.CULL_FACE);v.enable(v.BLEND);v.bindBuffer(v.ARRAY_BUFFER,B);v.vertexAttribPointer(w,2,v.FLOAT,!1,16,0);v.vertexAttribPointer(y,2,v.FLOAT,!1,16,8);v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,E);v.uniformMatrix4fv(n,!1,K.projectionMatrix.elements);a.state.activeTexture(v.TEXTURE0);v.uniform1i(h,0);H=A=0;(C=R.fog)?(v.uniform3f(s,C.color.r,C.color.g,C.color.b),C instanceof THREE.Fog?(v.uniform1f(r,C.near),v.uniform1f(t,C.far),v.uniform1i(p,1),H=A=1):C instanceof THREE.FogExp2&&(v.uniform1f(m,C.density),
-v.uniform1i(p,2),H=A=2)):(v.uniform1i(p,0),H=A=0);for(var C=0,T=b.length;C<T;C++){var O=b[C];O._modelViewMatrix.multiplyMatrices(K.matrixWorldInverse,O.matrixWorld);O.z=-O._modelViewMatrix.elements[14]}b.sort(z);for(var S=[],C=0,T=b.length;C<T;C++){var O=b[C],P=O.material;v.uniform1f(u,P.alphaTest);v.uniformMatrix4fv(l,!1,O._modelViewMatrix.elements);O.matrixWorld.decompose(I,D,G);S[0]=G.x;S[1]=G.y;O=0;R.fog&&P.fog&&(O=H);A!==O&&(v.uniform1i(p,O),A=O);null!==P.map?(v.uniform2f(c,P.map.offset.x,P.map.offset.y),
-v.uniform2f(d,P.map.repeat.x,P.map.repeat.y)):(v.uniform2f(c,0,0),v.uniform2f(d,1,1));v.uniform1f(k,P.opacity);v.uniform3f(g,P.color.r,P.color.g,P.color.b);v.uniform1f(e,P.rotation);v.uniform2fv(f,S);a.state.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst);a.state.setDepthTest(P.depthTest);a.state.setDepthWrite(P.depthWrite);P.map&&P.map.image&&P.map.image.width?a.setTexture(P.map,0):a.setTexture(F,0);v.drawElements(v.TRIANGLES,6,v.UNSIGNED_SHORT,0)}v.enable(v.CULL_FACE);a.resetGLState()}}};
+m.depthMask(!1);A=0;for(H=b.length;A<H;A++)if(C=16/E,G.set(C*w,C),B=b[A],z.set(B.matrixWorld.elements[12],B.matrixWorld.elements[13],B.matrixWorld.elements[14]),z.applyMatrix4(x.matrixWorldInverse),z.applyProjection(x.projectionMatrix),R.copy(z),K.x=R.x*F+F,K.y=R.y*I+I,u||0<K.x&&K.x<D&&0<K.y&&K.y<E){a.state.activeTexture(m.TEXTURE1);a.state.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,K.x-8,K.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,G.x,G.y);m.uniform3f(l,R.x,R.y,R.z);m.disable(m.BLEND);
+m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);a.state.activeTexture(m.TEXTURE0);a.state.bindTexture(m.TEXTURE_2D,y);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,K.x-8,K.y-8,16,16,0);m.uniform1i(c,1);m.disable(m.DEPTH_TEST);a.state.activeTexture(m.TEXTURE1);a.state.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);B.positionScreen.copy(R);B.customUpdateCallback?B.customUpdateCallback(B):B.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var T=
+0,O=B.lensFlares.length;T<O;T++){var S=B.lensFlares[T];.001<S.opacity&&.001<S.scale&&(R.x=S.x,R.y=S.y,R.z=S.z,C=S.size*S.scale/E,G.x=C*w,G.y=C,m.uniform3f(l,R.x,R.y,R.z),m.uniform2f(h,G.x,G.y),m.uniform1f(k,S.rotation),m.uniform1f(f,S.opacity),m.uniform3f(g,S.color.r,S.color.g,S.color.b),a.state.setBlending(S.blending,S.blendEquation,S.blendSrc,S.blendDst),a.setTexture(S.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,l,n,p,m,r,t,s,u,v,y;function z(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,D,E,w,F,I=new THREE.Vector3,C=new THREE.Quaternion,G=new THREE.Vector3;this.render=function(R,K){if(0!==b.length){if(void 0===w){var A=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),H=new Uint16Array([0,1,2,0,2,3]);D=x.createBuffer();E=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,D);x.bufferData(x.ARRAY_BUFFER,A,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,
+E);x.bufferData(x.ELEMENT_ARRAY_BUFFER,H,x.STATIC_DRAW);var A=x.createProgram(),H=x.createShader(x.VERTEX_SHADER),B=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(H,["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(B,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
+x.compileShader(H);x.compileShader(B);x.attachShader(A,H);x.attachShader(A,B);x.linkProgram(A);w=A;v=x.getAttribLocation(w,"position");y=x.getAttribLocation(w,"uv");c=x.getUniformLocation(w,"uvOffset");d=x.getUniformLocation(w,"uvScale");e=x.getUniformLocation(w,"rotation");f=x.getUniformLocation(w,"scale");g=x.getUniformLocation(w,"color");h=x.getUniformLocation(w,"map");k=x.getUniformLocation(w,"opacity");l=x.getUniformLocation(w,"modelViewMatrix");n=x.getUniformLocation(w,"projectionMatrix");p=
+x.getUniformLocation(w,"fogType");m=x.getUniformLocation(w,"fogDensity");r=x.getUniformLocation(w,"fogNear");t=x.getUniformLocation(w,"fogFar");s=x.getUniformLocation(w,"fogColor");u=x.getUniformLocation(w,"alphaTest");A=document.createElement("canvas");A.width=8;A.height=8;H=A.getContext("2d");H.fillStyle="white";H.fillRect(0,0,8,8);F=new THREE.Texture(A);F.needsUpdate=!0}x.useProgram(w);a.state.initAttributes();a.state.enableAttribute(v);a.state.enableAttribute(y);a.state.disableUnusedAttributes();
+x.disable(x.CULL_FACE);x.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,D);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(y,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,E);x.uniformMatrix4fv(n,!1,K.projectionMatrix.elements);a.state.activeTexture(x.TEXTURE0);x.uniform1i(h,0);H=A=0;(B=R.fog)?(x.uniform3f(s,B.color.r,B.color.g,B.color.b),B instanceof THREE.Fog?(x.uniform1f(r,B.near),x.uniform1f(t,B.far),x.uniform1i(p,1),H=A=1):B instanceof THREE.FogExp2&&(x.uniform1f(m,B.density),
+x.uniform1i(p,2),H=A=2)):(x.uniform1i(p,0),H=A=0);for(var B=0,T=b.length;B<T;B++){var O=b[B];O._modelViewMatrix.multiplyMatrices(K.matrixWorldInverse,O.matrixWorld);O.z=-O._modelViewMatrix.elements[14]}b.sort(z);for(var S=[],B=0,T=b.length;B<T;B++){var O=b[B],P=O.material;x.uniform1f(u,P.alphaTest);x.uniformMatrix4fv(l,!1,O._modelViewMatrix.elements);O.matrixWorld.decompose(I,C,G);S[0]=G.x;S[1]=G.y;O=0;R.fog&&P.fog&&(O=H);A!==O&&(x.uniform1i(p,O),A=O);null!==P.map?(x.uniform2f(c,P.map.offset.x,P.map.offset.y),
+x.uniform2f(d,P.map.repeat.x,P.map.repeat.y)):(x.uniform2f(c,0,0),x.uniform2f(d,1,1));x.uniform1f(k,P.opacity);x.uniform3f(g,P.color.r,P.color.g,P.color.b);x.uniform1f(e,P.rotation);x.uniform2fv(f,S);a.state.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst);a.state.setDepthTest(P.depthTest);a.state.setDepthWrite(P.depthWrite);P.map&&P.map.image&&P.map.image.width?a.setTexture(P.map,0):a.setTexture(F,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}x.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.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);e.load(a,function(a){f.image=a;f.needsUpdate=!0;c&&c(f)},void 0,function(a){d&&d(a)});f.sourceFile=a;return f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a;g+=1;6===g&&(f.needsUpdate=!0,c&&
 c(f))},void 0,d)};for(var h=0,k=a.length;h<k;++h)b(h);return f},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");
-f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),l=k.data,n=0;n<d;n++)for(var p=0;p<e;p++){var m=0>p-1?0:p-1,r=p+1>e-1?e-1:p+1,t=0>n-1?0:n-1,s=n+1>d-1?d-1:n+1,u=[],w=[0,0,h[4*(p*d+n)]/255*b];u.push([-1,0,h[4*(p*d+t)]/255*b]);u.push([-1,-1,h[4*(m*d+t)]/255*b]);u.push([0,-1,h[4*(m*d+n)]/255*b]);u.push([1,-1,h[4*(m*d+s)]/255*b]);u.push([1,0,h[4*(p*d+s)]/255*b]);u.push([1,1,h[4*(r*d+s)]/255*b]);u.push([0,1,h[4*(r*d+n)]/255*
-b]);u.push([-1,1,h[4*(r*d+t)]/255*b]);m=[];t=u.length;for(r=0;r<t;r++){var s=u[r],y=u[(r+1)%t],s=[s[0]-w[0],s[1]-w[1],s[2]-w[2]],y=[y[0]-w[0],y[1]-w[1],y[2]-w[2]];m.push(c([s[1]*y[2]-s[2]*y[1],s[2]*y[0]-s[0]*y[2],s[0]*y[1]-s[1]*y[0]]))}u=[0,0,0];for(r=0;r<m.length;r++)u[0]+=m[r][0],u[1]+=m[r][1],u[2]+=m[r][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;w=4*(p*d+n);l[w]=(u[0]+1)/2*255|0;l[w+1]=(u[1]+1)/2*255|0;l[w+2]=255*u[2]|0;l[w+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
+f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),l=k.data,n=0;n<d;n++)for(var p=0;p<e;p++){var m=0>p-1?0:p-1,r=p+1>e-1?e-1:p+1,t=0>n-1?0:n-1,s=n+1>d-1?d-1:n+1,u=[],v=[0,0,h[4*(p*d+n)]/255*b];u.push([-1,0,h[4*(p*d+t)]/255*b]);u.push([-1,-1,h[4*(m*d+t)]/255*b]);u.push([0,-1,h[4*(m*d+n)]/255*b]);u.push([1,-1,h[4*(m*d+s)]/255*b]);u.push([1,0,h[4*(p*d+s)]/255*b]);u.push([1,1,h[4*(r*d+s)]/255*b]);u.push([0,1,h[4*(r*d+n)]/255*
+b]);u.push([-1,1,h[4*(r*d+t)]/255*b]);m=[];t=u.length;for(r=0;r<t;r++){var s=u[r],y=u[(r+1)%t],s=[s[0]-v[0],s[1]-v[1],s[2]-v[2]],y=[y[0]-v[0],y[1]-v[1],y[2]-v[2]];m.push(c([s[1]*y[2]-s[2]*y[1],s[2]*y[0]-s[0]*y[2],s[0]*y[1]-s[1]*y[0]]))}u=[0,0,0];for(r=0;r<m.length;r++)u[0]+=m[r][0],u[1]+=m[r][1],u[2]+=m[r][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;v=4*(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}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
 b,c){var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
 THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing.";}},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=
-a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,n,p,m,r,t,s,u,w=b.glyphs[a]||b.glyphs["?"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);
+a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,n,p,m,r,t,s,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;r=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(r,t,k,n);if(g=f[f.length-1])for(p=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++){var y=g/h;THREE.Shape.Utils.b2(y,p,r,k);THREE.Shape.Utils.b2(y,m,t,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,r=b[a++]*c+d,t=b[a++]*c,s=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(r,t,s,u,k,n),g=f[f.length-1])for(p=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++)y=g/h,THREE.Shape.Utils.b3(y,p,r,s,k),THREE.Shape.Utils.b3(y,
-m,t,u,n)}return{offset:w.ha*c,path:e}}}};
+m,t,u,n)}return{offset:v.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
 (function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var m;a:{var r=m=void 0,t=void 0,s=void 0,
-u=void 0,w=void 0,y=void 0,z=void 0,v=void 0,r=a[g[k]].x,t=a[g[k]].y,s=a[g[l]].x,u=a[g[l]].y,w=a[g[n]].x,y=a[g[n]].y;if(1E-10>(s-r)*(y-t)-(u-t)*(w-r))m=!1;else{var B=void 0,E=void 0,x=void 0,F=void 0,I=void 0,D=void 0,G=void 0,R=void 0,K=void 0,A=void 0,K=R=G=v=z=void 0,B=w-s,E=y-u,x=r-w,F=t-y,I=s-r,D=u-t;for(m=0;m<e;m++)if(z=a[g[m]].x,v=a[g[m]].y,!(z===r&&v===t||z===s&&v===u||z===w&&v===y)&&(G=z-r,R=v-t,K=z-s,A=v-u,z-=w,v-=y,K=B*A-E*K,G=I*R-D*G,R=x*v-F*z,-1E-10<=K&&-1E-10<=R&&-1E-10<=G)){m=!1;break a}m=
+u=void 0,v=void 0,y=void 0,z=void 0,x=void 0,r=a[g[k]].x,t=a[g[k]].y,s=a[g[l]].x,u=a[g[l]].y,v=a[g[n]].x,y=a[g[n]].y;if(1E-10>(s-r)*(y-t)-(u-t)*(v-r))m=!1;else{var D=void 0,E=void 0,w=void 0,F=void 0,I=void 0,C=void 0,G=void 0,R=void 0,K=void 0,A=void 0,K=R=G=x=z=void 0,D=v-s,E=y-u,w=r-v,F=t-y,I=s-r,C=u-t;for(m=0;m<e;m++)if(z=a[g[m]].x,x=a[g[m]].y,!(z===r&&x===t||z===s&&x===u||z===v&&x===y)&&(G=z-r,R=x-t,K=z-s,A=x-u,z-=v,x-=y,K=D*A-E*K,G=I*R-C*G,R=w*x-F*z,-1E-10<=K&&-1E-10<=R&&-1E-10<=G)){m=!1;break a}m=
 !0}}if(m){f.push([a[g[k]],a[g[l]],a[g[n]]]);h.push([g[k],g[l],g[n]]);k=l;for(n=l+1;n<e;k++,n++)g[k]=g[n];e--;p=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);THREE.Audio.prototype.constructor=THREE.Audio;
 THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this};
@@ -682,11 +680,11 @@ l=a?!l:l;h=[];var n=[],p=[],m=0,r;n[m]=void 0;p[m]=[];var t,s;t=0;for(s=e.length
 tos:u,hole:l}),r?(r=!1,h[u].push(m)):t=!0);r&&h[g].push(m)}0<s.length&&(t||(p=h))}t=0;for(s=n.length;t<s;t++)for(h=n[t].s,k.push(h),g=p[t],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
 THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,x=h*k-g*l,F=h*n-g*p;if(1E-10<Math.abs(x)){if(0<x){if(0>F||F>x)return[];k=l*n-k*p;if(0>k||k>x)return[]}else{if(0<F||F<x)return[];k=l*n-k*p;if(0<k||k<x)return[]}if(0===k)return!f||0!==F&&F!==x?[a]:[];if(k===x)return!f||0!==F&&F!==x?[b]:[];if(0===
-F)return[d];if(F===x)return[e];f=k/x;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==F||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,w=h*k-g*l,F=h*n-g*p;if(1E-10<Math.abs(w)){if(0<w){if(0>F||F>w)return[];k=l*n-k*p;if(0>k||k>w)return[]}else{if(0<F||F<w)return[];k=l*n-k*p;if(0<k||k<w)return[]}if(0===k)return!f||0!==F&&F!==w?[a]:[];if(k===w)return!f||0!==F&&F!==w?[b]:[];if(0===
+F)return[d];if(F===w)return[e];f=k/w;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==F||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,w=d.x,l=e,d=e.x):(b=e,w=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,w=d.y,l=e,d=e.y):(b=e,w=e.y,l=d,d=d.y));return k<=w?a<w?[]:a===w?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
 k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,n={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+":"+h[f].y,void 0!==n[l]&&console.warn("THREE.Shape: Duplicate point",l),n[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
-0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,E,x,F,I=[],D,G,R,K=0;for(n=b.length;K<n;K++)l.push(K);D=0;for(var A=2*
-l.length;0<l.length;){A--;if(0>A){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=D;p<h.length;p++){E=h[p];n=-1;for(K=0;K<l.length;K++)if(x=l[K],F=E.x+":"+E.y+":"+x,void 0===I[F]){k=b[x];for(G=0;G<k.length;G++)if(x=k[G],c(p,G)&&!f(E,x)&&!g(E,x)){n=G;l.splice(K,1);D=h.slice(0,p+1);x=h.slice(p);G=k.slice(n);R=k.slice(0,n+1);h=D.concat(G).concat(R).concat(x);D=p;break}if(0<=n)break;I[F]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(f,
+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,E,w,F,I=[],C,G,R,K=0;for(n=b.length;K<n;K++)l.push(K);C=0;for(var A=2*
+l.length;0<l.length;){A--;if(0>A){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=C;p<h.length;p++){E=h[p];n=-1;for(K=0;K<l.length;K++)if(w=l[K],F=E.x+":"+E.y+":"+w,void 0===I[F]){k=b[w];for(G=0;G<k.length;G++)if(w=k[G],c(p,G)&&!f(E,w)&&!g(E,w)){n=G;l.splice(K,1);C=h.slice(0,p+1);w=h.slice(p);G=k.slice(n);R=k.slice(0,n+1);h=C.concat(G).concat(R).concat(w);C=p;break}if(0<=n)break;I[F]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(f,
 !1);f=0;for(g=p.length;f<g;f++)for(k=p[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=n[l],void 0!==l&&(k[h]=l);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
 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;
@@ -713,10 +711,10 @@ THREE.Animation.prototype={constructor:THREE.Animation,keyTypes:["pos","rot","sc
 var d=this.data.name,e=c.animationCache.animations,f=e[d];void 0===f&&(f={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=f);for(c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(d,a,1);g.time<this.currentTime&&g.index>e.index;)e=g,g=this.getNextKeyWith(d,a,g.index+1);f.prevKey[d]=e;f.nextKey[d]=g}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a].animationCache;void 0!==
 c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,p,m,r,t,s;e=(a.length-1)*b;p=Math.floor(e);e-=p;c[0]=0===p?p:p-1;c[1]=p;c[2]=p>a.length-2?p:p+1;c[3]=p>a.length-3?p:p+2;p=a[c[0]];r=a[c[1]];t=a[c[2]];s=a[c[3]];c=e*e;m=e*c;d[0]=f(p[0],r[0],t[0],s[0],e,c,m);d[1]=f(p[1],r[1],t[1],s[1],e,c,m);d[2]=f(p[2],r[2],t[2],s[2],e,c,m);return d},f=function(a,b,c,d,
 e,f,m){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*m+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],l=k.animationCache.animations[this.data.name],n=k.animationCache.blending,p=0;3>p;p++){var m=this.keyTypes[p],
-r=l.prevKey[m],t=l.nextKey[m];if(0<this.timeScale&&t.time<=this.currentTime||0>this.timeScale&&r.time>=this.currentTime){r=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(m,f,1);t.time<this.currentTime&&t.index>r.index;)r=t,t=this.getNextKeyWith(m,f,t.index+1);l.prevKey[m]=r;l.nextKey[m]=t}var s=(this.currentTime-r.time)/(t.time-r.time),u=r[m],w=t[m];0>s&&(s=0);1<s&&(s=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(w[0]-u[0])*s,c.y=u[1]+(w[1]-u[1])*s,
-c.z=u[2]+(w[2]-u[2])*s,r=this.weight/(this.weight+n.positionWeight),k.position.lerp(c,r),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,r.index-1).pos,a[1]=u,a[2]=w,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,s=.33*s+.33,t=e(a,s),r=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,m=k.position,m.x+=(t[0]-m.x)*r,m.y+=(t[1]-
-m.y)*r,m.z+=(t[2]-m.z)*r,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(s=e(a,1.01*s),b.set(s[0],s[1],s[2]),b.sub(m),b.y=0,b.normalize(),s=Math.atan2(b.x,b.z),k.rotation.set(0,s,0))}else"rot"===m?(THREE.Quaternion.slerp(u,w,d,s),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(r=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,r),n.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+(w[0]-u[0])*s,c.y=
-u[1]+(w[1]-u[1])*s,c.z=u[2]+(w[2]-u[2])*s,r=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,r),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=
+r=l.prevKey[m],t=l.nextKey[m];if(0<this.timeScale&&t.time<=this.currentTime||0>this.timeScale&&r.time>=this.currentTime){r=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(m,f,1);t.time<this.currentTime&&t.index>r.index;)r=t,t=this.getNextKeyWith(m,f,t.index+1);l.prevKey[m]=r;l.nextKey[m]=t}var s=(this.currentTime-r.time)/(t.time-r.time),u=r[m],v=t[m];0>s&&(s=0);1<s&&(s=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*s,c.y=u[1]+(v[1]-u[1])*s,
+c.z=u[2]+(v[2]-u[2])*s,r=this.weight/(this.weight+n.positionWeight),k.position.lerp(c,r),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,r.index-1).pos,a[1]=u,a[2]=v,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,s=.33*s+.33,t=e(a,s),r=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,m=k.position,m.x+=(t[0]-m.x)*r,m.y+=(t[1]-
+m.y)*r,m.z+=(t[2]-m.z)*r,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(s=e(a,1.01*s),b.set(s[0],s[1],s[2]),b.sub(m),b.y=0,b.normalize(),s=Math.atan2(b.x,b.z),k.rotation.set(0,s,0))}else"rot"===m?(THREE.Quaternion.slerp(u,v,d,s),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(r=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,r),n.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+(v[0]-u[0])*s,c.y=
+u[1]+(v[1]-u[1])*s,c.z=u[2]+(v[2]-u[2])*s,r=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,r),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]}};
 THREE.KeyFrameAnimation=function(a){this.root=a.node;this.data=THREE.AnimationHandler.init(a);this.hierarchy=THREE.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=.001;this.isPlaying=!1;this.loop=this.isPaused=!0;a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 d.matrixWorldNeedsUpdate=!0}}};
@@ -727,30 +725,30 @@ f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorld
 THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
 THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);a=this.duration/this.frames;var b=Math.floor(this.currentTime/a),c=this.mesh.morphTargetInfluences;b!==this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=
 1,c[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);c[b]=this.currentTime%a/a;c[this.lastFrame]=1-c[b]}}};
-THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g){var s,u=h.widthSegments,w=h.heightSegments,y=e/2,z=f/2,v=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)s="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)s="y",w=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)s="x",u=h.depthSegments;var B=u+1,E=w+1,x=e/u,F=f/w,I=new THREE.Vector3;I[s]=0<g?1:-1;for(e=0;e<E;e++)for(f=0;f<B;f++){var D=new THREE.Vector3;D[a]=(f*x-y)*c;D[b]=(e*F-z)*d;D[s]=g;h.vertices.push(D)}for(e=0;e<
-w;e++)for(f=0;f<u;f++)z=f+B*e,a=f+B*(e+1),b=f+1+B*(e+1),c=f+1+B*e,d=new THREE.Vector2(f/u,1-e/w),g=new THREE.Vector2(f/u,1-(e+1)/w),s=new THREE.Vector2((f+1)/u,1-(e+1)/w),y=new THREE.Vector2((f+1)/u,1-e/w),z=new THREE.Face3(z+v,a+v,c+v),z.normal.copy(I),z.vertexNormals.push(I.clone(),I.clone(),I.clone()),h.faces.push(z),h.faceVertexUvs[0].push([d,g,y]),z=new THREE.Face3(a+v,b+v,c+v),z.normal.copy(I),z.vertexNormals.push(I.clone(),I.clone(),I.clone()),h.faces.push(z),h.faceVertexUvs[0].push([g.clone(),
+THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g){var s,u=h.widthSegments,v=h.heightSegments,y=e/2,z=f/2,x=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)s="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)s="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)s="x",u=h.depthSegments;var D=u+1,E=v+1,w=e/u,F=f/v,I=new THREE.Vector3;I[s]=0<g?1:-1;for(e=0;e<E;e++)for(f=0;f<D;f++){var C=new THREE.Vector3;C[a]=(f*w-y)*c;C[b]=(e*F-z)*d;C[s]=g;h.vertices.push(C)}for(e=0;e<
+v;e++)for(f=0;f<u;f++)z=f+D*e,a=f+D*(e+1),b=f+1+D*(e+1),c=f+1+D*e,d=new THREE.Vector2(f/u,1-e/v),g=new THREE.Vector2(f/u,1-(e+1)/v),s=new THREE.Vector2((f+1)/u,1-(e+1)/v),y=new THREE.Vector2((f+1)/u,1-e/v),z=new THREE.Face3(z+x,a+x,c+x),z.normal.copy(I),z.vertexNormals.push(I.clone(),I.clone(),I.clone()),h.faces.push(z),h.faceVertexUvs[0].push([d,g,y]),z=new THREE.Face3(a+x,b+x,c+x),z.normal.copy(I),z.vertexNormals.push(I.clone(),I.clone(),I.clone()),h.faces.push(z),h.faceVertexUvs[0].push([g.clone(),
 s,y.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d);g("z","y",1,-1,c,b,-d);g("x","z",1,1,a,c,e);g("x","z",1,-1,a,c,-e);g("x","y",1,-1,a,b,f);g("x","y",-1,-1,a,b,-f);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.CubeGeometry=THREE.BoxGeometry;
 THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
 THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,f=new Float32Array(3*e),g=new Float32Array(3*e),e=new Float32Array(2*e);g[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var n=c+h/b*d;f[k]=a*Math.cos(n);f[k+1]=a*Math.sin(n);g[k+2]=1;e[l]=(f[k]/a+1)/2;e[l+1]=(f[k+1]/a+1)/2}c=
 [];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(f,3));this.addAttribute("normal",new THREE.BufferAttribute(g,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
-THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,n,p=[],m=[];for(n=0;n<=e;n++){var r=[],t=[],s=n/e,u=s*(b-a)+a;for(l=0;l<=d;l++){var w=l/d,y=new THREE.Vector3;y.x=u*Math.sin(w*h+
-g);y.y=-s*c+k;y.z=u*Math.cos(w*h+g);this.vertices.push(y);r.push(this.vertices.length-1);t.push(new THREE.Vector2(w,1-s))}p.push(r);m.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(g=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(g=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var r=p[n][l],t=p[n+1][l],s=p[n+1][l+1],u=p[n][l+1],w=g.clone(),y=g.clone(),
-z=h.clone(),v=h.clone(),B=m[n][l].clone(),E=m[n+1][l].clone(),x=m[n+1][l+1].clone(),F=m[n][l+1].clone();this.faces.push(new THREE.Face3(r,t,u,[w,y,v]));this.faceVertexUvs[0].push([B,E,F]);this.faces.push(new THREE.Face3(t,s,u,[y.clone(),z,v.clone()]));this.faceVertexUvs[0].push([E.clone(),x,F.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)r=p[0][l],t=p[0][l+1],s=this.vertices.length-1,w=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,
-1,0),B=m[0][l].clone(),E=m[0][l+1].clone(),x=new THREE.Vector2(E.x,0),this.faces.push(new THREE.Face3(r,t,s,[w,y,z])),this.faceVertexUvs[0].push([B,E,x]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)r=p[e][l+1],t=p[e][l],s=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),B=m[e][l+1].clone(),E=m[e][l].clone(),x=new THREE.Vector2(E.x,1),this.faces.push(new THREE.Face3(r,t,s,[w,y,z])),this.faceVertexUvs[0].push([B,
-E,x]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
+THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,n,p=[],m=[];for(n=0;n<=e;n++){var r=[],t=[],s=n/e,u=s*(b-a)+a;for(l=0;l<=d;l++){var v=l/d,y=new THREE.Vector3;y.x=u*Math.sin(v*h+
+g);y.y=-s*c+k;y.z=u*Math.cos(v*h+g);this.vertices.push(y);r.push(this.vertices.length-1);t.push(new THREE.Vector2(v,1-s))}p.push(r);m.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(g=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(g=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var r=p[n][l],t=p[n+1][l],s=p[n+1][l+1],u=p[n][l+1],v=g.clone(),y=g.clone(),
+z=h.clone(),x=h.clone(),D=m[n][l].clone(),E=m[n+1][l].clone(),w=m[n+1][l+1].clone(),F=m[n][l+1].clone();this.faces.push(new THREE.Face3(r,t,u,[v,y,x]));this.faceVertexUvs[0].push([D,E,F]);this.faces.push(new THREE.Face3(t,s,u,[y.clone(),z,x.clone()]));this.faceVertexUvs[0].push([E.clone(),w,F.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)r=p[0][l],t=p[0][l+1],s=this.vertices.length-1,v=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,
+1,0),D=m[0][l].clone(),E=m[0][l+1].clone(),w=new THREE.Vector2(E.x,0),this.faces.push(new THREE.Face3(r,t,s,[v,y,z])),this.faceVertexUvs[0].push([D,E,w]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)r=p[e][l+1],t=p[e][l],s=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),D=m[e][l+1].clone(),E=m[e][l].clone(),w=new THREE.Vector2(E.x,1),this.faces.push(new THREE.Face3(r,t,s,[v,y,z])),this.faceVertexUvs[0].push([D,
+E,w]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
 THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,n=h.length;l<n;l++)for(var p=h[l],m=0;3>m;m++){d[0]=p[g[m]];d[1]=p[g[(m+1)%3]];d.sort(f);var r=d.toString();void 0===e[r]?e[r]={vert1:d[0],vert2:d[1],face1:l,
 face2:void 0}:e[r].face2=l}d=[];for(r in e)if(f=e[r],void 0===f.face2||h[f.face1].normal.dot(h[f.face2].normal)<=c)g=k[f.vert1],d.push(g.x),d.push(g.y),d.push(g.z),g=k[f.vert2],d.push(g.x),d.push(g.y),d.push(g.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
 THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=
-!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(L=a.length;0<=--L;){c=L;d=L-1;0>d&&(d=a.length-1);for(var e=0,f=r+2*n,e=0;e<f;e++){var g=S*e,h=S*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+D,g=g+D,l=l+D,h=h+D;I.faces.push(new THREE.Face3(k,g,h));I.faces.push(new THREE.Face3(g,l,h));k=w.generateSideWallUV(I,k,g,l,h);I.faceVertexUvs[0].push([k[0],k[1],k[3]]);I.faceVertexUvs[0].push([k[1],
-k[2],k[3]])}}}function f(a,b,c){I.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=D;b+=D;c+=D;I.faces.push(new THREE.Face3(a,b,c));a=w.generateTopUV(I,a,b,c);I.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,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,
-s,u=!1,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,y,z,v,B;t&&(s=t.getSpacedPoints(r),u=!0,p=!1,y=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,!1),z=new THREE.Vector3,v=new THREE.Vector3,B=new THREE.Vector3);p||(l=k=n=0);var E,x,F,I=this,D=this.vertices.length,t=a.extractPoints(m),m=t.shape,G=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();x=0;for(F=G.length;x<F;x++)E=G[x],THREE.Shape.Utils.isClockWise(E)&&(G[x]=E.reverse());t=
-!1}var R=THREE.Shape.Utils.triangulateShape(m,G),K=m;x=0;for(F=G.length;x<F;x++)E=G[x],m=m.concat(E);var A,H,C,T,O,S=m.length,P,J=R.length,t=[],L=0;C=K.length;A=C-1;for(H=L+1;L<C;L++,A++,H++)A===C&&(A=0),H===C&&(H=0),t[L]=d(K[L],K[A],K[H]);var na=[],da,ka=t.concat();x=0;for(F=G.length;x<F;x++){E=G[x];da=[];L=0;C=E.length;A=C-1;for(H=L+1;L<C;L++,A++,H++)A===C&&(A=0),H===C&&(H=0),da[L]=d(E[L],E[A],E[H]);na.push(da);ka=ka.concat(da)}for(A=0;A<n;A++){C=A/n;T=k*(1-C);H=l*Math.sin(C*Math.PI/2);L=0;for(C=
-K.length;L<C;L++)O=c(K[L],t[L],H),f(O.x,O.y,-T);x=0;for(F=G.length;x<F;x++)for(E=G[x],da=na[x],L=0,C=E.length;L<C;L++)O=c(E[L],da[L],H),f(O.x,O.y,-T)}H=l;for(L=0;L<S;L++)O=p?c(m[L],ka[L],H):m[L],u?(v.copy(y.normals[0]).multiplyScalar(O.x),z.copy(y.binormals[0]).multiplyScalar(O.y),B.copy(s[0]).add(v).add(z),f(B.x,B.y,B.z)):f(O.x,O.y,0);for(C=1;C<=r;C++)for(L=0;L<S;L++)O=p?c(m[L],ka[L],H):m[L],u?(v.copy(y.normals[C]).multiplyScalar(O.x),z.copy(y.binormals[C]).multiplyScalar(O.y),B.copy(s[C]).add(v).add(z),
-f(B.x,B.y,B.z)):f(O.x,O.y,h/r*C);for(A=n-1;0<=A;A--){C=A/n;T=k*(1-C);H=l*Math.sin(C*Math.PI/2);L=0;for(C=K.length;L<C;L++)O=c(K[L],t[L],H),f(O.x,O.y,h+T);x=0;for(F=G.length;x<F;x++)for(E=G[x],da=na[x],L=0,C=E.length;L<C;L++)O=c(E[L],da[L],H),u?f(O.x,O.y+s[r-1].y,s[r-1].x+T):f(O.x,O.y,h+T)}(function(){if(p){var a;a=0*S;for(L=0;L<J;L++)P=R[L],g(P[2]+a,P[1]+a,P[0]+a);a=r+2*n;a*=S;for(L=0;L<J;L++)P=R[L],g(P[0]+a,P[1]+a,P[2]+a)}else{for(L=0;L<J;L++)P=R[L],g(P[2],P[1],P[0]);for(L=0;L<J;L++)P=R[L],g(P[0]+
-S*r,P[1]+S*r,P[2]+S*r)}})();(function(){var a=0;e(K,a);a+=K.length;x=0;for(F=G.length;x<F;x++)E=G[x],e(E,a),a+=E.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=r+2*n,e=0;e<f;e++){var g=S*e,h=S*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+C,g=g+C,l=l+C,h=h+C;I.faces.push(new THREE.Face3(k,g,h));I.faces.push(new THREE.Face3(g,l,h));k=v.generateSideWallUV(I,k,g,l,h);I.faceVertexUvs[0].push([k[0],k[1],k[3]]);I.faceVertexUvs[0].push([k[1],
+k[2],k[3]])}}}function f(a,b,c){I.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=C;b+=C;c+=C;I.faces.push(new THREE.Face3(a,b,c));a=v.generateTopUV(I,a,b,c);I.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,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,
+s,u=!1,v=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,y,z,x,D;t&&(s=t.getSpacedPoints(r),u=!0,p=!1,y=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,!1),z=new THREE.Vector3,x=new THREE.Vector3,D=new THREE.Vector3);p||(l=k=n=0);var E,w,F,I=this,C=this.vertices.length,t=a.extractPoints(m),m=t.shape,G=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();w=0;for(F=G.length;w<F;w++)E=G[w],THREE.Shape.Utils.isClockWise(E)&&(G[w]=E.reverse());t=
+!1}var R=THREE.Shape.Utils.triangulateShape(m,G),K=m;w=0;for(F=G.length;w<F;w++)E=G[w],m=m.concat(E);var A,H,B,T,O,S=m.length,P,J=R.length,t=[],L=0;B=K.length;A=B-1;for(H=L+1;L<B;L++,A++,H++)A===B&&(A=0),H===B&&(H=0),t[L]=d(K[L],K[A],K[H]);var na=[],da,ka=t.concat();w=0;for(F=G.length;w<F;w++){E=G[w];da=[];L=0;B=E.length;A=B-1;for(H=L+1;L<B;L++,A++,H++)A===B&&(A=0),H===B&&(H=0),da[L]=d(E[L],E[A],E[H]);na.push(da);ka=ka.concat(da)}for(A=0;A<n;A++){B=A/n;T=k*(1-B);H=l*Math.sin(B*Math.PI/2);L=0;for(B=
+K.length;L<B;L++)O=c(K[L],t[L],H),f(O.x,O.y,-T);w=0;for(F=G.length;w<F;w++)for(E=G[w],da=na[w],L=0,B=E.length;L<B;L++)O=c(E[L],da[L],H),f(O.x,O.y,-T)}H=l;for(L=0;L<S;L++)O=p?c(m[L],ka[L],H):m[L],u?(x.copy(y.normals[0]).multiplyScalar(O.x),z.copy(y.binormals[0]).multiplyScalar(O.y),D.copy(s[0]).add(x).add(z),f(D.x,D.y,D.z)):f(O.x,O.y,0);for(B=1;B<=r;B++)for(L=0;L<S;L++)O=p?c(m[L],ka[L],H):m[L],u?(x.copy(y.normals[B]).multiplyScalar(O.x),z.copy(y.binormals[B]).multiplyScalar(O.y),D.copy(s[B]).add(x).add(z),
+f(D.x,D.y,D.z)):f(O.x,O.y,h/r*B);for(A=n-1;0<=A;A--){B=A/n;T=k*(1-B);H=l*Math.sin(B*Math.PI/2);L=0;for(B=K.length;L<B;L++)O=c(K[L],t[L],H),f(O.x,O.y,h+T);w=0;for(F=G.length;w<F;w++)for(E=G[w],da=na[w],L=0,B=E.length;L<B;L++)O=c(E[L],da[L],H),u?f(O.x,O.y+s[r-1].y,s[r-1].x+T):f(O.x,O.y,h+T)}(function(){if(p){var a;a=0*S;for(L=0;L<J;L++)P=R[L],g(P[2]+a,P[1]+a,P[0]+a);a=r+2*n;a*=S;for(L=0;L<J;L++)P=R[L],g(P[0]+a,P[1]+a,P[2]+a)}else{for(L=0;L<J;L++)P=R[L],g(P[2],P[1],P[0]);for(L=0;L<J;L++)P=R[L],g(P[0]+
+S*r,P[1]+S*r,P[2]+S*r)}})();(function(){var a=0;e(K,a);a+=K.length;w=0;for(F=G.length;w<F;w++)E=G[w],e(E,a),a+=E.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],
@@ -765,21 +763,21 @@ THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="Ri
 THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;
 THREE.SphereGeometry=function(a,b,c,d,e,f,g){console.log("THREE.SphereGeometry: Consider using THREE.SphereBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(2,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],n=[];for(k=0;k<=c;k++){var p=
 [],m=[];for(h=0;h<=b;h++){var r=h/b,t=k/c,s=new THREE.Vector3;s.x=-a*Math.cos(d+r*e)*Math.sin(f+t*g);s.y=a*Math.cos(f+t*g);s.z=a*Math.sin(d+r*e)*Math.sin(f+t*g);this.vertices.push(s);p.push(this.vertices.length-1);m.push(new THREE.Vector2(r,1-t))}l.push(p);n.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),r=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),
-s=n[k][h+1].clone(),u=n[k][h].clone(),w=n[k+1][h].clone(),y=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(s.x=(s.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[p,r,t])),this.faceVertexUvs[0].push([s,w,y])):Math.abs(this.vertices[f].y)===a?(w.x=(w.x+y.x)/2,this.faces.push(new THREE.Face3(d,e,f,[p,m,r])),this.faceVertexUvs[0].push([s,u,w])):(this.faces.push(new THREE.Face3(d,e,g,[p,m,t])),this.faceVertexUvs[0].push([s,u,y]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),r,t.clone()])),this.faceVertexUvs[0].push([u.clone(),
-w,y.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;
+s=n[k][h+1].clone(),u=n[k][h].clone(),v=n[k+1][h].clone(),y=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(s.x=(s.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[p,r,t])),this.faceVertexUvs[0].push([s,v,y])):Math.abs(this.vertices[f].y)===a?(v.x=(v.x+y.x)/2,this.faces.push(new THREE.Face3(d,e,f,[p,m,r])),this.faceVertexUvs[0].push([s,u,v])):(this.faces.push(new THREE.Face3(d,e,g,[p,m,t])),this.faceVertexUvs[0].push([s,u,y]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),r,t.clone()])),this.faceVertexUvs[0].push([u.clone(),
+v,y.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 THREE.SphereBufferGeometry=function(a,b,c,d,e,f,g){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(2,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;for(var h=(b+1)*(c+1),k=new THREE.BufferAttribute(new Float32Array(3*h),3),l=new THREE.BufferAttribute(new Float32Array(3*h),
-3),h=new THREE.BufferAttribute(new Float32Array(2*h),2),n=0,p=[],m=new THREE.Vector3,r=0;r<=c;r++){for(var t=[],s=r/c,u=0;u<=b;u++){var w=u/b,y=-a*Math.cos(d+w*e)*Math.sin(f+s*g),z=a*Math.cos(f+s*g),v=a*Math.sin(d+w*e)*Math.sin(f+s*g);m.set(y,z,v).normalize();k.setXYZ(n,y,z,v);l.setXYZ(n,m.x,m.y,m.z);h.setXY(n,w,1-s);t.push(n);n++}p.push(t)}d=[];for(r=0;r<c;r++)for(u=0;u<b;u++)e=p[r][u+1],f=p[r][u],g=p[r+1][u],n=p[r+1][u+1],0!==r&&d.push(e,f,n),r!==c-1&&d.push(f,g,n);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(d),
+3),h=new THREE.BufferAttribute(new Float32Array(2*h),2),n=0,p=[],m=new THREE.Vector3,r=0;r<=c;r++){for(var t=[],s=r/c,u=0;u<=b;u++){var v=u/b,y=-a*Math.cos(d+v*e)*Math.sin(f+s*g),z=a*Math.cos(f+s*g),x=a*Math.sin(d+v*e)*Math.sin(f+s*g);m.set(y,z,x).normalize();k.setXYZ(n,y,z,x);l.setXYZ(n,m.x,m.y,m.z);h.setXY(n,v,1-s);t.push(n);n++}p.push(t)}d=[];for(r=0;r<c;r++)for(u=0;u<b;u++)e=p[r][u+1],f=p[r][u],g=p[r+1][u],n=p[r+1][u+1],0!==r&&d.push(e,f,n),r!==c-1&&d.push(f,g,n);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(d),
 1));this.addAttribute("position",k);this.addAttribute("normal",l);this.addAttribute("uv",h);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
 THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b);this.type="TextGeometry"};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var n=l/d*e,p=k/c*Math.PI*2;f.x=a*Math.cos(n);f.y=a*Math.sin(n);var m=new THREE.Vector3;m.x=(a+b*Math.cos(p))*Math.cos(n);m.y=(a+b*Math.cos(p))*Math.sin(n);m.z=b*Math.sin(p);this.vertices.push(m);g.push(new THREE.Vector2(l/
 d,k/c));h.push(m.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,n=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),n=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};
 THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
 THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=0;m<c;++m){k[m]=
-Array(d);var r=m/c*2*e*Math.PI,t=h(r,f,e,a,g),r=h(r+.01,f,e,a,g);l.subVectors(r,t);n.addVectors(r,t);p.crossVectors(l,n);n.crossVectors(p,l);p.normalize();n.normalize();for(r=0;r<d;++r){var s=r/d*2*Math.PI,u=-b*Math.cos(s),s=b*Math.sin(s),w=new THREE.Vector3;w.x=t.x+u*n.x+s*p.x;w.y=t.y+u*n.y+s*p.y;w.z=t.z+u*n.z+s*p.z;k[m][r]=this.vertices.push(w)-1}}for(m=0;m<c;++m)for(r=0;r<d;++r)e=(m+1)%c,f=(r+1)%d,a=k[m][r],b=k[e][r],e=k[e][f],f=k[m][f],g=new THREE.Vector2(m/c,r/d),l=new THREE.Vector2((m+1)/c,
+Array(d);var r=m/c*2*e*Math.PI,t=h(r,f,e,a,g),r=h(r+.01,f,e,a,g);l.subVectors(r,t);n.addVectors(r,t);p.crossVectors(l,n);n.crossVectors(p,l);p.normalize();n.normalize();for(r=0;r<d;++r){var s=r/d*2*Math.PI,u=-b*Math.cos(s),s=b*Math.sin(s),v=new THREE.Vector3;v.x=t.x+u*n.x+s*p.x;v.y=t.y+u*n.y+s*p.y;v.z=t.z+u*n.z+s*p.z;k[m][r]=this.vertices.push(v)-1}}for(m=0;m<c;++m)for(r=0;r<d;++r)e=(m+1)%c,f=(r+1)%d,a=k[m][r],b=k[e][r],e=k[e][f],f=k[m][f],g=new THREE.Vector2(m/c,r/d),l=new THREE.Vector2((m+1)/c,
 r/d),n=new THREE.Vector2((m+1)/c,(r+1)/d),p=new THREE.Vector2(m/c,(r+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,p]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),n,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
-THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,k,l=b+1,n,p,m,r,t,s=new THREE.Vector3,u,w,y;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);w=u.normals;y=u.binormals;this.tangents=u.tangents;this.normals=w;this.binormals=y;for(u=0;u<l;u++)for(g[u]=[],n=u/(l-1),t=a.getPointAt(n),h=w[u],k=y[u],m=c*f(n),n=0;n<d;n++)p=
-n/d*2*Math.PI,r=-m*Math.cos(p),p=m*Math.sin(p),s.copy(t),s.x+=r*h.x+p*k.x,s.y+=r*h.y+p*k.y,s.z+=r*h.z+p*k.z,g[u][n]=this.vertices.push(new THREE.Vector3(s.x,s.y,s.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)f=e?(u+1)%b:u+1,l=(n+1)%d,a=g[u][n],c=g[f][n],f=g[f][l],l=g[u][l],s=new THREE.Vector2(u/b,n/d),w=new THREE.Vector2((u+1)/b,n/d),y=new THREE.Vector2((u+1)/b,(n+1)/d),h=new THREE.Vector2(u/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([s,w,h]),this.faces.push(new THREE.Face3(c,
-f,l)),this.faceVertexUvs[0].push([w.clone(),y,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,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,k,l=b+1,n,p,m,r,t,s=new THREE.Vector3,u,v,y;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);v=u.normals;y=u.binormals;this.tangents=u.tangents;this.normals=v;this.binormals=y;for(u=0;u<l;u++)for(g[u]=[],n=u/(l-1),t=a.getPointAt(n),h=v[u],k=y[u],m=c*f(n),n=0;n<d;n++)p=
+n/d*2*Math.PI,r=-m*Math.cos(p),p=m*Math.sin(p),s.copy(t),s.x+=r*h.x+p*k.x,s.y+=r*h.y+p*k.y,s.z+=r*h.z+p*k.z,g[u][n]=this.vertices.push(new THREE.Vector3(s.x,s.y,s.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)f=e?(u+1)%b:u+1,l=(n+1)%d,a=g[u][n],c=g[f][n],f=g[f][l],l=g[u][l],s=new THREE.Vector2(u/b,n/d),v=new THREE.Vector2((u+1)/b,n/d),y=new THREE.Vector2((u+1)/b,(n+1)/d),h=new THREE.Vector2(u/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([s,v,h]),this.faces.push(new THREE.Face3(c,
+f,l)),this.faceVertexUvs[0].push([v.clone(),y,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,p;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();f[0].crossVectors(e[0],
 h);g[0].crossVectors(e[0],f[0]);for(l=1;l<b;l++)f[l]=f[l-1].clone(),g[l]=g[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),f[l].applyMatrix4(k.makeRotationAxis(h,d))),g[l].crossVectors(e[l],f[l]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),l=1;l<b;l++)f[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),g[l].crossVectors(e[l],f[l])};
 THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);u.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(u.z,-u.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,