Browse Source

Updated builds.

Mr.doob 12 years ago
parent
commit
4dcb67f0e0
2 changed files with 378 additions and 275 deletions
  1. 158 56
      build/three.js
  2. 220 219
      build/three.min.js

+ 158 - 56
build/three.js

@@ -10572,7 +10572,7 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) {
 
 		var i, j, fi,
 
-		offset, zLength, nVertices,
+		offset, zLength,
 
 		colorIndex, normalIndex, uvIndex, materialIndex,
 
@@ -10583,9 +10583,9 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) {
 		hasFaceNormal, hasFaceVertexNormal,
 		hasFaceColor, hasFaceVertexColor,
 
-		vertex, face, color, normal,
+		vertex, face, faceA, faceB, color, hex, normal,
 
-		uvLayer, uvs, u, v,
+		uvLayer, uv, u, v,
 
 		faces = json.faces,
 		vertices = json.vertices,
@@ -10647,114 +10647,216 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) {
 
 			if ( isQuad ) {
 
-				face = new THREE.Face4();
+				faceA = new THREE.Face3();
+				faceA.a = faces[ offset ];
+				faceA.b = faces[ offset + 1 ];
+				faceA.c = faces[ offset + 3 ];
 
-				face.a = faces[ offset ++ ];
-				face.b = faces[ offset ++ ];
-				face.c = faces[ offset ++ ];
-				face.d = faces[ offset ++ ];
+				faceB = new THREE.Face3();
+				faceB.a = faces[ offset + 1 ];
+				faceB.b = faces[ offset + 2 ];
+				faceB.c = faces[ offset + 3 ];
 
-				nVertices = 4;
+				offset += 4;
 
-			} else {
+				if ( hasMaterial ) {
 
-				face = new THREE.Face3();
+					materialIndex = faces[ offset ++ ];
+					faceA.materialIndex = materialIndex;
+					faceB.materialIndex = materialIndex;
 
-				face.a = faces[ offset ++ ];
-				face.b = faces[ offset ++ ];
-				face.c = faces[ offset ++ ];
+				}
 
-				nVertices = 3;
+				// to get face <=> uv index correspondence
 
-			}
+				fi = geometry.faces.length;
 
-			if ( hasMaterial ) {
+				if ( hasFaceVertexUv ) {
 
-				materialIndex = faces[ offset ++ ];
-				face.materialIndex = materialIndex;
+					for ( i = 0; i < nUvLayers; i++ ) {
 
-			}
+						uvLayer = json.uvs[ i ];
+
+						geometry.faceVertexUvs[ i ][ fi ] = [];
+						geometry.faceVertexUvs[ i ][ fi + 1 ] = []
+
+						for ( j = 0; j < 4; j ++ ) {
+
+							uvIndex = faces[ offset ++ ];
+
+							u = uvLayer[ uvIndex * 2 ];
+							v = uvLayer[ uvIndex * 2 + 1 ];
+
+							uv = new THREE.Vector2( u, v );
+
+							if ( j !== 2 ) geometry.faceVertexUvs[ i ][ fi ].push( uv );
+							if ( j !== 0 ) geometry.faceVertexUvs[ i ][ fi + 1 ].push( uv );
+
+						}
+
+					}
+
+				}
 
-			// to get face <=> uv index correspondence
+				if ( hasFaceNormal ) {
 
-			fi = geometry.faces.length;
+					normalIndex = faces[ offset ++ ] * 3;
 
-			if ( hasFaceVertexUv ) {
+					faceA.normal.set(
+						normals[ normalIndex ++ ],
+						normals[ normalIndex ++ ],
+						normals[ normalIndex ]
+					);
 
-				for ( i = 0; i < nUvLayers; i++ ) {
+					faceB.normal.copy( faceA.normal );
 
-					uvLayer = json.uvs[ i ];
+				}
+
+				if ( hasFaceVertexNormal ) {
 
-					uvs = [];
+					for ( i = 0; i < 4; i++ ) {
 
-					for ( j = 0; j < nVertices; j ++ ) {
+						normalIndex = faces[ offset ++ ] * 3;
 
-						uvIndex = faces[ offset ++ ];
+						normal = new THREE.Vector3(
+							normals[ normalIndex ++ ],
+							normals[ normalIndex ++ ],
+							normals[ normalIndex ]
+						);
 
-						u = uvLayer[ uvIndex * 2 ];
-						v = uvLayer[ uvIndex * 2 + 1 ];
 
-						uvs[ j ] = new THREE.Vector2( u, v );
+						if ( i !== 2 ) faceA.vertexNormals.push( normal );
+						if ( i !== 0 ) faceB.vertexNormals.push( normal );
 
 					}
 
-					geometry.faceVertexUvs[ i ][ fi ] = uvs;
+				}
+
+
+				if ( hasFaceColor ) {
+
+					colorIndex = faces[ offset ++ ];
+					hex = colors[ colorIndex ];
+
+					faceA.color.setHex( hex );
+					faceB.color.setHex( hex );
 
 				}
 
-			}
 
-			if ( hasFaceNormal ) {
+				if ( hasFaceVertexColor ) {
 
-				normalIndex = faces[ offset ++ ] * 3;
+					for ( i = 0; i < 4; i++ ) {
 
-				face.normal.set(
-					normals[ normalIndex ++ ],
-					normals[ normalIndex ++ ],
-					normals[ normalIndex ]
-				);
+						colorIndex = faces[ offset ++ ];
+						hex = colors[ colorIndex ];
 
-			}
+						if ( i !== 2 ) faceA.vertexColors.push( new THREE.Color( hex ) );
+						if ( i !== 0 ) faceB.vertexColors.push( new THREE.Color( hex ) );
+
+					}
+
+				}
+
+				geometry.faces.push( faceA );
+				geometry.faces.push( faceB );
 
-			if ( hasFaceVertexNormal ) {
+			} else {
+
+				face = new THREE.Face3();
+				face.a = faces[ offset ++ ];
+				face.b = faces[ offset ++ ];
+				face.c = faces[ offset ++ ];
+
+				if ( hasMaterial ) {
+
+					materialIndex = faces[ offset ++ ];
+					face.materialIndex = materialIndex;
+
+				}
+
+				// to get face <=> uv index correspondence
+
+				fi = geometry.faces.length;
+
+				if ( hasFaceVertexUv ) {
+
+					for ( i = 0; i < nUvLayers; i++ ) {
+
+						uvLayer = json.uvs[ i ];
+
+						geometry.faceVertexUvs[ i ][ fi ] = [];
+
+						for ( j = 0; j < 3; j ++ ) {
+
+							uvIndex = faces[ offset ++ ];
+
+							u = uvLayer[ uvIndex * 2 ];
+							v = uvLayer[ uvIndex * 2 + 1 ];
+
+							uv = new THREE.Vector2( u, v );
+
+							geometry.faceVertexUvs[ i ][ fi ].push( uv );
 
-				for ( i = 0; i < nVertices; i++ ) {
+						}
+
+					}
+
+				}
+
+				if ( hasFaceNormal ) {
 
 					normalIndex = faces[ offset ++ ] * 3;
 
-					normal = new THREE.Vector3(
+					face.normal.set(
 						normals[ normalIndex ++ ],
 						normals[ normalIndex ++ ],
 						normals[ normalIndex ]
 					);
 
-					face.vertexNormals.push( normal );
-
 				}
 
-			}
+				if ( hasFaceVertexNormal ) {
 
+					for ( i = 0; i < 3; i++ ) {
 
-			if ( hasFaceColor ) {
+						normalIndex = faces[ offset ++ ] * 3;
 
-				colorIndex = faces[ offset ++ ];
-				face.color.setHex( colors[ colorIndex ] );
+						normal = new THREE.Vector3(
+							normals[ normalIndex ++ ],
+							normals[ normalIndex ++ ],
+							normals[ normalIndex ]
+						);
 
-			}
+						face.vertexNormals.push( normal );
 
+					}
+
+				}
 
-			if ( hasFaceVertexColor ) {
 
-				for ( i = 0; i < nVertices; i++ ) {
+				if ( hasFaceColor ) {
 
 					colorIndex = faces[ offset ++ ];
-					face.vertexColors.push( new THREE.Color( colors[ colorIndex ] ) );
+					face.color.setHex( colors[ colorIndex ] );
 
 				}
 
-			}
 
-			geometry.faces.push( face );
+				if ( hasFaceVertexColor ) {
+
+					for ( i = 0; i < 3; i++ ) {
+
+						colorIndex = faces[ offset ++ ];
+						face.vertexColors.push( new THREE.Color( colors[ colorIndex ] ) );
+
+					}
+
+				}
+
+				geometry.faces.push( face );
+
+			}
 
 		}
 

+ 220 - 219
build/three.min.js

@@ -82,22 +82,22 @@ this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a
 THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,h,g,i){var k=this.elements;k[0]=a;k[3]=b;k[6]=c;k[1]=d;k[4]=e;k[7]=f;k[2]=h;k[5]=g;k[8]=i;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn("DEPRECATED: Matrix3's .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)},
 multiplyVector3Array:function(){var a=new THREE.Vector3;return function(b){for(var c=0,d=b.length;c<d;c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix3(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[3]*=a;b[6]*=a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],h=a[5],g=a[6],i=a[7],a=a[8];return b*f*a-b*h*i-c*e*a+c*h*g+d*e*i-d*f*g},getInverse:function(a,
 b){var c=a.elements,d=this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-c[1]*c[4];c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");console.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/
-c);return this},transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},clone:function(){var a=this.elements;return new THREE.Matrix3(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8])}};THREE.Matrix4=function(a,b,c,d,e,f,h,g,i,k,l,m,n,t,s,p){var q=this.elements=new Float32Array(16);q[0]=void 0!==a?a:1;q[4]=b||0;q[8]=c||0;q[12]=d||0;q[1]=e||0;q[5]=void 0!==f?f:1;q[9]=h||0;q[13]=g||0;q[2]=i||0;q[6]=k||0;q[10]=void 0!==l?l:1;q[14]=m||0;q[3]=n||0;q[7]=t||0;q[11]=s||0;q[15]=void 0!==p?p:1};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,h,g,i,k,l,m,n,t,s,p){var q=this.elements;q[0]=a;q[4]=b;q[8]=c;q[12]=d;q[1]=e;q[5]=f;q[9]=h;q[13]=g;q[2]=i;q[6]=k;q[10]=l;q[14]=m;q[3]=n;q[7]=t;q[11]=s;q[15]=p;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("DEPRECATED: Matrix4's .extractPosition() has been renamed to .copyPosition().");
+c);return this},transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},clone:function(){var a=this.elements;return new THREE.Matrix3(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8])}};THREE.Matrix4=function(a,b,c,d,e,f,h,g,i,k,l,m,n,r,t,p){var s=this.elements=new Float32Array(16);s[0]=void 0!==a?a:1;s[4]=b||0;s[8]=c||0;s[12]=d||0;s[1]=e||0;s[5]=void 0!==f?f:1;s[9]=h||0;s[13]=g||0;s[2]=i||0;s[6]=k||0;s[10]=void 0!==l?l:1;s[14]=m||0;s[3]=n||0;s[7]=r||0;s[11]=t||0;s[15]=void 0!==p?p:1};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,h,g,i,k,l,m,n,r,t,p){var s=this.elements;s[0]=a;s[4]=b;s[8]=c;s[12]=d;s[1]=e;s[5]=f;s[9]=h;s[13]=g;s[2]=i;s[6]=k;s[10]=l;s[14]=m;s[3]=n;s[7]=r;s[11]=t;s[15]=p;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("DEPRECATED: Matrix4's .extractPosition() has been renamed to .copyPosition().");
 return this.copyPosition(a)},copyPosition:function(a){var b=this.elements,a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractRotation:function(){var a=new THREE.Vector3;return function(b){var c=this.elements,b=b.elements,d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),f=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){void 0===
 typeof a.order&&console.error("ERROR: Matrix's .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.  Please update your code.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),h=Math.cos(d),d=Math.sin(d),g=Math.cos(e),e=Math.sin(e);if(void 0===a.order||"XYZ"===a.order){var a=f*g,i=f*e,k=c*g,l=c*e;b[0]=h*g;b[4]=-h*e;b[8]=d;b[1]=i+k*d;b[5]=a-l*d;b[9]=-c*h;b[2]=l-a*d;b[6]=k+i*d;b[10]=f*h}else"YXZ"===a.order?(a=h*g,i=h*e,k=d*g,l=d*e,b[0]=a+l*c,b[4]=
 k*c-i,b[8]=f*d,b[1]=f*e,b[5]=f*g,b[9]=-c,b[2]=i*c-k,b[6]=l+a*c,b[10]=f*h):"ZXY"===a.order?(a=h*g,i=h*e,k=d*g,l=d*e,b[0]=a-l*c,b[4]=-f*e,b[8]=k+i*c,b[1]=i+k*c,b[5]=f*g,b[9]=l-a*c,b[2]=-f*d,b[6]=c,b[10]=f*h):"ZYX"===a.order?(a=f*g,i=f*e,k=c*g,l=c*e,b[0]=h*g,b[4]=k*d-i,b[8]=a*d+l,b[1]=h*e,b[5]=l*d+a,b[9]=i*d-k,b[2]=-d,b[6]=c*h,b[10]=f*h):"YZX"===a.order?(a=f*h,i=f*d,k=c*h,l=c*d,b[0]=h*g,b[4]=l-a*e,b[8]=k*e+i,b[1]=e,b[5]=f*g,b[9]=-c*g,b[2]=-d*g,b[6]=i*e+k,b[10]=a-l*e):"XZY"===a.order&&(a=f*h,i=f*d,k=
 c*h,l=c*d,b[0]=h*g,b[4]=-e,b[8]=d*g,b[1]=a*e+l,b[5]=f*g,b[9]=i*e-k,b[2]=k*e-i,b[6]=c*g,b[10]=l*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("DEPRECATED: Matrix4's .setRotationFromQuaternion() has been deprecated in favor of makeRotationFromQuaternion.  Please update your code.");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,h=c+c,g=d+d,i=e+e,
 a=c*h,k=c*g,c=c*i,l=d*g,d=d*i,e=e*i,h=f*h,g=f*g,f=f*i;b[0]=1-(l+e);b[4]=k-f;b[8]=c+g;b[1]=k+f;b[5]=1-(a+e);b[9]=d-h;b[2]=c-g;b[6]=d+h;b[10]=1-(a+l);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var h=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);h[0]=a.x;h[4]=b.x;h[8]=c.x;h[1]=a.y;h[5]=b.y;h[9]=c.y;h[2]=a.z;h[6]=b.z;h[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Matrix4's .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],h=c[4],g=c[8],i=c[12],k=c[1],l=c[5],m=c[9],n=c[13],t=c[2],s=c[6],p=c[10],q=c[14],r=c[3],u=c[7],
-w=c[11],c=c[15],E=d[0],C=d[4],F=d[8],z=d[12],D=d[1],y=d[5],O=d[9],x=d[13],B=d[2],I=d[6],v=d[10],A=d[14],G=d[3],R=d[7],J=d[11],d=d[15];e[0]=f*E+h*D+g*B+i*G;e[4]=f*C+h*y+g*I+i*R;e[8]=f*F+h*O+g*v+i*J;e[12]=f*z+h*x+g*A+i*d;e[1]=k*E+l*D+m*B+n*G;e[5]=k*C+l*y+m*I+n*R;e[9]=k*F+l*O+m*v+n*J;e[13]=k*z+l*x+m*A+n*d;e[2]=t*E+s*D+p*B+q*G;e[6]=t*C+s*y+p*I+q*R;e[10]=t*F+s*O+p*v+q*J;e[14]=t*z+s*x+p*A+q*d;e[3]=r*E+u*D+w*B+c*G;e[7]=r*C+u*y+w*I+c*R;e[11]=r*F+u*O+w*v+c*J;e[15]=r*z+u*x+w*A+c*d;return this},multiplyToArray:function(a,
+a);h[0]=a.x;h[4]=b.x;h[8]=c.x;h[1]=a.y;h[5]=b.y;h[9]=c.y;h[2]=a.z;h[6]=b.z;h[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Matrix4's .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],h=c[4],g=c[8],i=c[12],k=c[1],l=c[5],m=c[9],n=c[13],r=c[2],t=c[6],p=c[10],s=c[14],q=c[3],u=c[7],
+w=c[11],c=c[15],v=d[0],C=d[4],z=d[8],y=d[12],F=d[1],x=d[5],O=d[9],B=d[13],E=d[2],I=d[6],D=d[10],A=d[14],G=d[3],R=d[7],J=d[11],d=d[15];e[0]=f*v+h*F+g*E+i*G;e[4]=f*C+h*x+g*I+i*R;e[8]=f*z+h*O+g*D+i*J;e[12]=f*y+h*B+g*A+i*d;e[1]=k*v+l*F+m*E+n*G;e[5]=k*C+l*x+m*I+n*R;e[9]=k*z+l*O+m*D+n*J;e[13]=k*y+l*B+m*A+n*d;e[2]=r*v+t*F+p*E+s*G;e[6]=r*C+t*x+p*I+s*R;e[10]=r*z+t*O+p*D+s*J;e[14]=r*y+t*B+p*A+s*d;e[3]=q*v+u*F+w*E+c*G;e[7]=q*C+u*x+w*I+c*R;e[11]=q*z+u*O+w*D+c*J;e[15]=q*y+u*B+w*A+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("DEPRECATED: Matrix4's .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
 return a.applyProjection(this)},multiplyVector4:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(){var a=new THREE.Vector3;return function(b){for(var c=0,d=b.length;c<d;c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyProjection(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("DEPRECATED: Matrix4's .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");
 a.transformDirection(this)},crossVector:function(a){console.warn("DEPRECATED: Matrix4's .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],h=a[5],g=a[9],i=a[13],k=a[2],l=a[6],m=a[10],n=a[14];return a[3]*(+e*g*l-d*i*l-e*h*m+c*i*m+d*h*n-c*g*n)+a[7]*(+b*g*n-b*i*m+e*f*m-d*f*n+d*i*k-e*g*k)+a[11]*(+b*i*l-b*h*n-e*f*l+c*f*n+e*h*k-c*i*k)+a[15]*(-d*h*k-b*g*l+b*h*m+d*f*l-c*f*
 m+c*g*k)},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},flattenToArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a},flattenToArrayOffset:function(a,b){var c=this.elements;
 a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=new THREE.Vector3;return function(){console.warn("DEPRECATED: Matrix4's .getPosition() has been removed. Use Vector3.getPositionFromMatrix( 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],h=d[8],g=d[12],i=d[1],k=d[5],l=d[9],m=d[13],n=d[2],t=d[6],s=d[10],p=d[14],q=d[3],r=d[7],u=d[11],d=d[15];c[0]=l*p*r-m*s*r+m*t*u-k*p*u-l*t*d+k*s*d;c[4]=g*s*r-h*p*r-g*t*u+f*p*u+h*t*d-f*s*d;c[8]=h*m*r-g*l*r+g*k*u-f*m*u-h*k*d+f*l*d;c[12]=g*l*t-h*m*t-g*k*s+f*m*s+h*k*p-f*l*p;c[1]=m*s*q-l*p*q-m*n*u+i*p*u+l*n*d-i*s*d;c[5]=h*p*q-g*s*q+g*n*u-e*p*u-h*n*d+e*s*d;c[9]=g*l*q-h*m*q-g*i*u+e*m*u+h*i*d-
-e*l*d;c[13]=h*m*n-g*l*n+g*i*s-e*m*s-h*i*p+e*l*p;c[2]=k*p*q-m*t*q+m*n*r-i*p*r-k*n*d+i*t*d;c[6]=g*t*q-f*p*q-g*n*r+e*p*r+f*n*d-e*t*d;c[10]=f*m*q-g*k*q+g*i*r-e*m*r-f*i*d+e*k*d;c[14]=g*k*n-f*m*n-g*i*t+e*m*t+f*i*p-e*k*p;c[3]=l*t*q-k*s*q-l*n*r+i*s*r+k*n*u-i*t*u;c[7]=f*s*q-h*t*q+h*n*r-e*s*r-f*n*u+e*t*u;c[11]=h*k*q-f*l*q-h*i*r+e*l*r+f*i*u-e*k*u;c[15]=f*l*n-h*k*n+h*i*t-e*l*t-f*i*s+e*k*s;c=e*c[0]+i*c[4]+n*c[8]+q*c[12];if(0==c){if(b)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("Matrix4.getInverse(): can't invert matrix, determinant is 0");
+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],h=d[8],g=d[12],i=d[1],k=d[5],l=d[9],m=d[13],n=d[2],r=d[6],t=d[10],p=d[14],s=d[3],q=d[7],u=d[11],d=d[15];c[0]=l*p*q-m*t*q+m*r*u-k*p*u-l*r*d+k*t*d;c[4]=g*t*q-h*p*q-g*r*u+f*p*u+h*r*d-f*t*d;c[8]=h*m*q-g*l*q+g*k*u-f*m*u-h*k*d+f*l*d;c[12]=g*l*r-h*m*r-g*k*t+f*m*t+h*k*p-f*l*p;c[1]=m*t*s-l*p*s-m*n*u+i*p*u+l*n*d-i*t*d;c[5]=h*p*s-g*t*s+g*n*u-e*p*u-h*n*d+e*t*d;c[9]=g*l*s-h*m*s-g*i*u+e*m*u+h*i*d-
+e*l*d;c[13]=h*m*n-g*l*n+g*i*t-e*m*t-h*i*p+e*l*p;c[2]=k*p*s-m*r*s+m*n*q-i*p*q-k*n*d+i*r*d;c[6]=g*r*s-f*p*s-g*n*q+e*p*q+f*n*d-e*r*d;c[10]=f*m*s-g*k*s+g*i*q-e*m*q-f*i*d+e*k*d;c[14]=g*k*n-f*m*n-g*i*r+e*m*r+f*i*p-e*k*p;c[3]=l*r*s-k*t*s-l*n*q+i*t*q+k*n*u-i*r*u;c[7]=f*t*s-h*r*s+h*n*q-e*t*q-f*n*u+e*r*u;c[11]=h*k*s-f*l*s-h*i*q+e*l*q+f*i*u-e*k*u;c[15]=f*l*n-h*k*n+h*i*r-e*l*r-f*i*t+e*k*t;c=e*c[0]+i*c[4]+n*c[8]+s*c[12];if(0==c){if(b)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("Matrix4.getInverse(): can't invert matrix, determinant is 0");
 this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(){console.warn("DEPRECATED: Matrix4's .translate() has been removed.")},rotateX:function(){console.warn("DEPRECATED: Matrix4's .rotateX() has been removed.")},rotateY:function(){console.warn("DEPRECATED: Matrix4's .rotateY() has been removed.")},rotateZ:function(){console.warn("DEPRECATED: Matrix4's .rotateZ() has been removed.")},rotateByAxis:function(){console.warn("DEPRECATED: Matrix4's .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,h=a.y,g=a.z,i=e*f,k=e*h;this.set(i*f+c,i*h-d*g,i*g+d*h,0,i*h+d*g,k*h+c,k*g-d*f,0,i*g-d*h,k*g+d*f,e*g*g+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,
@@ -113,8 +113,8 @@ g=this.origin.clone().sub(e),a=-this.direction.dot(f),b=g.dot(this.direction),i=
 THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(a){for(var b,c=0,d=0,e=a.length;d<e;d++)b=a[d].lengthSq(),c=Math.max(c,b);this.center.set(0,0,0);this.radius=Math.sqrt(c);return this},copy:function(a){this.center.copy(a.center);this.radius=a.radius;return this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-
 this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);
 this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};
-THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var h=this.planes;h[0].copy(a);h[1].copy(b);h[2].copy(c);h[3].copy(d);h[4].copy(e);h[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements,a=c[0],d=c[1],e=c[2],f=c[3],h=c[4],g=c[5],i=c[6],k=c[7],l=c[8],m=c[9],n=c[10],t=c[11],s=c[12],p=c[13],q=c[14],c=c[15];b[0].setComponents(f-a,k-h,t-l,c-s).normalize();b[1].setComponents(f+
-a,k+h,t+l,c+s).normalize();b[2].setComponents(f+d,k+g,t+m,c+p).normalize();b[3].setComponents(f-d,k-g,t-m,c-p).normalize();b[4].setComponents(f-e,k-i,t-n,c-q).normalize();b[5].setComponents(f+e,k+i,t+n,c+q).normalize();return this},intersectsObject:function(){var a=new THREE.Vector3;return function(b){var c=b.geometry,b=b.matrixWorld;null===c.boundingSphere&&c.computeBoundingSphere();c=-c.boundingSphere.radius*b.getMaxScaleOnAxis();a.getPositionFromMatrix(b);for(var b=this.planes,d=0;6>d;d++)if(b[d].distanceToPoint(a)<
+THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var h=this.planes;h[0].copy(a);h[1].copy(b);h[2].copy(c);h[3].copy(d);h[4].copy(e);h[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements,a=c[0],d=c[1],e=c[2],f=c[3],h=c[4],g=c[5],i=c[6],k=c[7],l=c[8],m=c[9],n=c[10],r=c[11],t=c[12],p=c[13],s=c[14],c=c[15];b[0].setComponents(f-a,k-h,r-l,c-t).normalize();b[1].setComponents(f+
+a,k+h,r+l,c+t).normalize();b[2].setComponents(f+d,k+g,r+m,c+p).normalize();b[3].setComponents(f-d,k-g,r-m,c-p).normalize();b[4].setComponents(f-e,k-i,r-n,c-s).normalize();b[5].setComponents(f+e,k+i,r+n,c+s).normalize();return this},intersectsObject:function(){var a=new THREE.Vector3;return function(b){var c=b.geometry,b=b.matrixWorld;null===c.boundingSphere&&c.computeBoundingSphere();c=-c.boundingSphere.radius*b.getMaxScaleOnAxis();a.getPositionFromMatrix(b);for(var b=this.planes,d=0;6>d;d++)if(b[d].distanceToPoint(a)<
 c)return!1;return!0}}(),intersectsSphere:function(a){for(var b=this.planes,c=a.center,a=-a.radius,d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var h=f.distanceToPoint(a),
 f=f.distanceToPoint(b);if(0>h&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
 THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,
@@ -137,11 +137,11 @@ THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=thi
 a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){};
 THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&
 c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners,d=c[a].indexOf(b);-1!==d&&c[a].splice(d,1)}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=0,d=b.length;c<d;c++)b[c].call(this,a)}}}};(function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c);this.near=d||0;this.far=e||Infinity};var b=new a.Sphere,c=new a.Ray;new a.Plane;new a.Vector3;var d=new a.Vector3,e=new a.Matrix4,f=function(a,b){return a.distance-b.distance},h=function(f,g,l){if(f instanceof a.Particle){d.getPositionFromMatrix(f.matrixWorld);var m=g.ray.distanceToPoint(d);if(m>f.scale.x)return l;l.push({distance:m,point:f.position,face:null,object:f})}else if(f instanceof a.LOD)d.getPositionFromMatrix(f.matrixWorld),
-m=g.ray.origin.distanceTo(d),h(f.getObjectForDistance(m),g,l);else if(f instanceof a.Mesh){var n=f.geometry;d.getPositionFromMatrix(f.matrixWorld);null===n.boundingSphere&&n.computeBoundingSphere();b.set(d,n.boundingSphere.radius*f.matrixWorld.getMaxScaleOnAxis());if(!1===g.ray.isIntersectionSphere(b))return l;var t=n.vertices;if(n instanceof a.BufferGeometry){var s=f.material;if(void 0===s||!1===n.dynamic)return l;var p,q,r=g.precision;e.getInverse(f.matrixWorld);c.copy(g.ray).applyMatrix4(e);var u,
-t=!1;n.attributes.index&&(t=!0);u=new a.Vector3;for(var w=new a.Vector3,E=new a.Vector3,C=n.offsets,F=n.attributes.index.array,z=n.attributes.position.array,D=n.offsets.length,y=0;y<D;++y)for(var m=C[y].start,O=C[y].index,n=m,x=m+C[y].count;n<x;n+=3)if(t?(m=O+F[n],p=O+F[n+1],q=O+F[n+2]):(m=O,p=O+1,q=O+2),u.set(z[3*m],z[3*m+1],z[3*m+2]),w.set(z[3*p],z[3*p+1],z[3*p+2]),E.set(z[3*q],z[3*q+1],z[3*q+2]),p=a.Triangle.intersectionRay(c,u,w,E,s.side!==a.DoubleSide))p.applyMatrix4(f.matrixWorld),m=g.ray.origin.distanceTo(p),
-m<r||m<g.near||m>g.far||l.push({distance:m,point:p,face:null,faceIndex:null,object:f})}else if(n instanceof a.Geometry){w=f.material instanceof a.MeshFaceMaterial;E=!0===w?f.material.materials:null;r=g.precision;e.getInverse(f.matrixWorld);c.copy(g.ray).applyMatrix4(e);C=0;for(u=n.faces.length;C<u;C++)if(F=n.faces[C],s=!0===w?E[F.materialIndex]:f.material,void 0!==s&&(m=t[F.a],p=t[F.b],q=t[F.c],p=a.Triangle.intersectionRay(c,m,p,q,s.side!==a.DoubleSide)))p.applyMatrix4(f.matrixWorld),m=g.ray.origin.distanceTo(p),
-m<r||m<g.near||m>g.far||l.push({distance:m,point:p,face:F,faceIndex:C,object:f})}}else if(f instanceof a.Line){r=g.linePrecision;s=r*r;n=f.geometry;null===n.boundingSphere&&n.computeBoundingSphere();d.getPositionFromMatrix(f.matrixWorld);b.set(d,n.boundingSphere.radius*f.matrixWorld.getMaxScaleOnAxis());if(!1===g.ray.isIntersectionSphere(b))return l;e.getInverse(f.matrixWorld);c.copy(g.ray).applyMatrix4(e);t=n.vertices;r=t.length;p=new a.Vector3;q=new a.Vector3;u=f.type===a.LineStrip?1:2;for(n=0;n<
-r-1;n+=u)c.distanceSqToSegment(t[n],t[n+1],q,p)<=s&&(m=c.origin.distanceTo(q),g.near<=m&&m<=g.far&&l.push({distance:m,point:p.clone().applyMatrix4(f.matrixWorld),face:null,faceIndex:null,object:f}))}},g=function(a,b,c){for(var a=a.getDescendants(),d=0,e=a.length;d<e;d++)h(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b)};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===b&&g(a,this,c);h(a,
+m=g.ray.origin.distanceTo(d),h(f.getObjectForDistance(m),g,l);else if(f instanceof a.Mesh){var n=f.geometry;d.getPositionFromMatrix(f.matrixWorld);null===n.boundingSphere&&n.computeBoundingSphere();b.set(d,n.boundingSphere.radius*f.matrixWorld.getMaxScaleOnAxis());if(!1===g.ray.isIntersectionSphere(b))return l;var r=n.vertices;if(n instanceof a.BufferGeometry){var t=f.material;if(void 0===t||!1===n.dynamic)return l;var p,s,q=g.precision;e.getInverse(f.matrixWorld);c.copy(g.ray).applyMatrix4(e);var u,
+r=!1;n.attributes.index&&(r=!0);u=new a.Vector3;for(var w=new a.Vector3,v=new a.Vector3,C=n.offsets,z=n.attributes.index.array,y=n.attributes.position.array,F=n.offsets.length,x=0;x<F;++x)for(var m=C[x].start,O=C[x].index,n=m,B=m+C[x].count;n<B;n+=3)if(r?(m=O+z[n],p=O+z[n+1],s=O+z[n+2]):(m=O,p=O+1,s=O+2),u.set(y[3*m],y[3*m+1],y[3*m+2]),w.set(y[3*p],y[3*p+1],y[3*p+2]),v.set(y[3*s],y[3*s+1],y[3*s+2]),p=a.Triangle.intersectionRay(c,u,w,v,t.side!==a.DoubleSide))p.applyMatrix4(f.matrixWorld),m=g.ray.origin.distanceTo(p),
+m<q||m<g.near||m>g.far||l.push({distance:m,point:p,face:null,faceIndex:null,object:f})}else if(n instanceof a.Geometry){w=f.material instanceof a.MeshFaceMaterial;v=!0===w?f.material.materials:null;q=g.precision;e.getInverse(f.matrixWorld);c.copy(g.ray).applyMatrix4(e);C=0;for(u=n.faces.length;C<u;C++)if(z=n.faces[C],t=!0===w?v[z.materialIndex]:f.material,void 0!==t&&(m=r[z.a],p=r[z.b],s=r[z.c],p=a.Triangle.intersectionRay(c,m,p,s,t.side!==a.DoubleSide)))p.applyMatrix4(f.matrixWorld),m=g.ray.origin.distanceTo(p),
+m<q||m<g.near||m>g.far||l.push({distance:m,point:p,face:z,faceIndex:C,object:f})}}else if(f instanceof a.Line){q=g.linePrecision;t=q*q;n=f.geometry;null===n.boundingSphere&&n.computeBoundingSphere();d.getPositionFromMatrix(f.matrixWorld);b.set(d,n.boundingSphere.radius*f.matrixWorld.getMaxScaleOnAxis());if(!1===g.ray.isIntersectionSphere(b))return l;e.getInverse(f.matrixWorld);c.copy(g.ray).applyMatrix4(e);r=n.vertices;q=r.length;p=new a.Vector3;s=new a.Vector3;u=f.type===a.LineStrip?1:2;for(n=0;n<
+q-1;n+=u)c.distanceSqToSegment(r[n],r[n+1],s,p)<=t&&(m=c.origin.distanceTo(s),g.near<=m&&m<=g.far&&l.push({distance:m,point:p.clone().applyMatrix4(f.matrixWorld),face:null,faceIndex:null,object:f}))}},g=function(a,b,c){for(var a=a.getDescendants(),d=0,e=a.length;d<e;d++)h(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b)};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===b&&g(a,this,c);h(a,
 this,c);c.sort(f);return c};a.Raycaster.prototype.intersectObjects=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)h(a[d],this,c),!0===b&&g(a[d],this,c);c.sort(f);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Euler;this.quaternion=new THREE.Quaternion;this.scale=new THREE.Vector3(1,1,1);this.rotation._quaternion=this.quaternion;this.quaternion._euler=this.rotation;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;
 this.visible=this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};
 THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){console.warn("DEPRECATED: Object3D's .eulerOrder has been moved to Object3D's .rotation.order.");return this.rotation.order},set eulerOrder(a){console.warn("DEPRECATED: Object3D's .eulerOrder has been moved to Object3D's .rotation.order.");this.rotation.order=a},get useQuaternion(){console.warn("DEPRECATED: Object3D's .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){console.warn("DEPRECATED: Object3D's .useQuaternion has been removed. The library now uses quaternions by default.")},
@@ -155,17 +155,17 @@ e))return e}},getChildByName:function(a,b){console.warn("DEPRECATED: Object3D's
 this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);
 a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());
 return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(i===l){var a=new THREE.RenderableVertex;k.push(a);l++;i++;return a}return k[i++]}function b(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,h=-a.z+a.w,g=-b.z+b.w;if(0<=e&&0<=f&&0<=h&&0<=g)return!0;if(0>e&&0>f||0>h&&0>g)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>h?c=Math.max(c,h/(h-g)):0>g&&(d=Math.min(d,h/(h-g)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var d,e,f=[],h=
-0,g,i,k=[],l=0,m,n,t=[],s=0,p,q,r=[],u=0,w,E,C=[],F=0,z={objects:[],sprites:[],lights:[],elements:[]},D=new THREE.Vector3,y=new THREE.Vector4,O=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),x=new THREE.Box3,B=Array(3),I=new THREE.Matrix4,v=new THREE.Matrix4,A,G=new THREE.Matrix4,R=new THREE.Matrix3,J=new THREE.Matrix3,ba=new THREE.Vector3,qa=new THREE.Frustum,ra=new THREE.Vector4,N=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);
-v.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(v)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);v.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyProjection(v)};this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var M=function(a){if(e===h){var b=new THREE.RenderableObject;
-f.push(b);h++;e++;d=b}else d=f[e++];d.id=a.id;d.object=a;null!==a.renderDepth?d.z=a.renderDepth:(D.getPositionFromMatrix(a.matrixWorld),D.applyProjection(v),d.z=D.z);return d},Q=function(a){if(!1!==a.visible){a instanceof THREE.Light?z.lights.push(a):a instanceof THREE.Mesh||a instanceof THREE.Line?(!1===a.frustumCulled||!0===qa.intersectsObject(a))&&z.objects.push(M(a)):(a instanceof THREE.Sprite||a instanceof THREE.Particle)&&z.sprites.push(M(a));for(var b=0,c=a.children.length;b<c;b++)Q(a.children[b])}};
-this.projectScene=function(d,f,h,l){var ea=!1,D,M,fa,V,aa,P,T,ma,va,ja,Pa,Ja;E=q=n=0;z.elements.length=0;!0===d.autoUpdate&&d.updateMatrixWorld();void 0===f.parent&&f.updateMatrixWorld();I.copy(f.matrixWorldInverse.getInverse(f.matrixWorld));v.multiplyMatrices(f.projectionMatrix,I);J.getNormalMatrix(I);qa.setFromMatrix(v);e=0;z.objects.length=0;z.sprites.length=0;z.lights.length=0;Q(d);!0===h&&z.objects.sort(b);d=0;for(h=z.objects.length;d<h;d++)if(T=z.objects[d].object,A=T.matrixWorld,i=0,T instanceof
-THREE.Mesh){ma=T.geometry;fa=ma.vertices;va=ma.faces;ma=ma.faceVertexUvs;R.getNormalMatrix(A);Pa=T.material instanceof THREE.MeshFaceMaterial;Ja=!0===Pa?T.material:null;D=0;for(M=fa.length;D<M;D++){g=a();g.positionWorld.copy(fa[D]).applyMatrix4(A);g.positionScreen.copy(g.positionWorld).applyMatrix4(v);var ga=1/g.positionScreen.w;g.positionScreen.x*=ga;g.positionScreen.y*=ga;g.positionScreen.z*=ga;g.visible=!(-1>g.positionScreen.x||1<g.positionScreen.x||-1>g.positionScreen.y||1<g.positionScreen.y||
--1>g.positionScreen.z||1<g.positionScreen.z)}fa=0;for(D=va.length;fa<D;fa++)if(M=va[fa],ga=!0===Pa?Ja.materials[M.materialIndex]:T.material,void 0!==ga&&(P=ga.side,V=k[M.a],aa=k[M.b],ja=k[M.c],B[0]=V.positionScreen,B[1]=aa.positionScreen,B[2]=ja.positionScreen,!0===V.visible||!0===aa.visible||!0===ja.visible||O.isIntersectionBox(x.setFromPoints(B))))if(ea=0>(ja.positionScreen.x-V.positionScreen.x)*(aa.positionScreen.y-V.positionScreen.y)-(ja.positionScreen.y-V.positionScreen.y)*(aa.positionScreen.x-
-V.positionScreen.x),P===THREE.DoubleSide||ea===(P===THREE.FrontSide)){if(n===s){var Ha=new THREE.RenderableFace3;t.push(Ha);s++;n++;m=Ha}else m=t[n++];m.id=T.id;m.v1.copy(V);m.v2.copy(aa);m.v3.copy(ja);m.normalModel.copy(M.normal);!1===ea&&(P===THREE.BackSide||P===THREE.DoubleSide)&&m.normalModel.negate();m.normalModel.applyMatrix3(R).normalize();m.normalModelView.copy(m.normalModel).applyMatrix3(J);m.centroidModel.copy(M.centroid).applyMatrix4(A);ja=M.vertexNormals;V=0;for(aa=Math.min(ja.length,
-3);V<aa;V++)Ha=m.vertexNormalsModel[V],Ha.copy(ja[V]),!1===ea&&(P===THREE.BackSide||P===THREE.DoubleSide)&&Ha.negate(),Ha.applyMatrix3(R).normalize(),m.vertexNormalsModelView[V].copy(Ha).applyMatrix3(J);m.vertexNormalsLength=ja.length;ea=0;for(V=Math.min(ma.length,3);ea<V;ea++)if(ja=ma[ea][fa],void 0!==ja){aa=0;for(P=ja.length;aa<P;aa++)m.uvs[ea][aa]=ja[aa]}m.color=M.color;m.material=ga;ba.copy(m.centroidModel).applyProjection(v);m.z=ba.z;z.elements.push(m)}}else if(T instanceof THREE.Line){G.multiplyMatrices(v,
-A);fa=T.geometry.vertices;V=a();V.positionScreen.copy(fa[0]).applyMatrix4(G);va=T.type===THREE.LinePieces?2:1;D=1;for(M=fa.length;D<M;D++)V=a(),V.positionScreen.copy(fa[D]).applyMatrix4(G),0<(D+1)%va||(aa=k[i-2],ra.copy(V.positionScreen),N.copy(aa.positionScreen),!0===c(ra,N)&&(ra.multiplyScalar(1/ra.w),N.multiplyScalar(1/N.w),q===u?(ma=new THREE.RenderableLine,r.push(ma),u++,q++,p=ma):p=r[q++],p.id=T.id,p.v1.positionScreen.copy(ra),p.v2.positionScreen.copy(N),p.z=Math.max(ra.z,N.z),p.material=T.material,
-T.material.vertexColors===THREE.VertexColors&&(p.vertexColors[0].copy(T.geometry.colors[D]),p.vertexColors[1].copy(T.geometry.colors[D-1])),z.elements.push(p)))}d=0;for(h=z.sprites.length;d<h;d++)T=z.sprites[d].object,A=T.matrixWorld,T instanceof THREE.Particle&&(y.set(A.elements[12],A.elements[13],A.elements[14],1),y.applyMatrix4(v),ga=1/y.w,y.z*=ga,0<y.z&&1>y.z&&(E===F?(va=new THREE.RenderableParticle,C.push(va),F++,E++,w=va):w=C[E++],w.id=T.id,w.x=y.x*ga,w.y=y.y*ga,w.z=y.z,w.object=T,w.rotation=
-T.rotation.z,w.scale.x=T.scale.x*Math.abs(w.x-(y.x+f.projectionMatrix.elements[0])/(y.w+f.projectionMatrix.elements[12])),w.scale.y=T.scale.y*Math.abs(w.y-(y.y+f.projectionMatrix.elements[5])/(y.w+f.projectionMatrix.elements[13])),w.material=T.material,z.elements.push(w)));!0===l&&z.elements.sort(b);return z}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
+0,g,i,k=[],l=0,m,n,r=[],t=0,p,s,q=[],u=0,w,v,C=[],z=0,y={objects:[],sprites:[],lights:[],elements:[]},F=new THREE.Vector3,x=new THREE.Vector4,O=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),B=new THREE.Box3,E=Array(3),I=new THREE.Matrix4,D=new THREE.Matrix4,A,G=new THREE.Matrix4,R=new THREE.Matrix3,J=new THREE.Matrix3,ba=new THREE.Vector3,qa=new THREE.Frustum,ra=new THREE.Vector4,N=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);
+D.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(D)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);D.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyProjection(D)};this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var M=function(a){if(e===h){var b=new THREE.RenderableObject;
+f.push(b);h++;e++;d=b}else d=f[e++];d.id=a.id;d.object=a;null!==a.renderDepth?d.z=a.renderDepth:(F.getPositionFromMatrix(a.matrixWorld),F.applyProjection(D),d.z=F.z);return d},Q=function(a){if(!1!==a.visible){a instanceof THREE.Light?y.lights.push(a):a instanceof THREE.Mesh||a instanceof THREE.Line?(!1===a.frustumCulled||!0===qa.intersectsObject(a))&&y.objects.push(M(a)):(a instanceof THREE.Sprite||a instanceof THREE.Particle)&&y.sprites.push(M(a));for(var b=0,c=a.children.length;b<c;b++)Q(a.children[b])}};
+this.projectScene=function(d,f,h,l){var ea=!1,F,M,fa,V,aa,P,T,ma,va,ja,Pa,Ja;v=s=n=0;y.elements.length=0;!0===d.autoUpdate&&d.updateMatrixWorld();void 0===f.parent&&f.updateMatrixWorld();I.copy(f.matrixWorldInverse.getInverse(f.matrixWorld));D.multiplyMatrices(f.projectionMatrix,I);J.getNormalMatrix(I);qa.setFromMatrix(D);e=0;y.objects.length=0;y.sprites.length=0;y.lights.length=0;Q(d);!0===h&&y.objects.sort(b);d=0;for(h=y.objects.length;d<h;d++)if(T=y.objects[d].object,A=T.matrixWorld,i=0,T instanceof
+THREE.Mesh){ma=T.geometry;fa=ma.vertices;va=ma.faces;ma=ma.faceVertexUvs;R.getNormalMatrix(A);Pa=T.material instanceof THREE.MeshFaceMaterial;Ja=!0===Pa?T.material:null;F=0;for(M=fa.length;F<M;F++){g=a();g.positionWorld.copy(fa[F]).applyMatrix4(A);g.positionScreen.copy(g.positionWorld).applyMatrix4(D);var ga=1/g.positionScreen.w;g.positionScreen.x*=ga;g.positionScreen.y*=ga;g.positionScreen.z*=ga;g.visible=!(-1>g.positionScreen.x||1<g.positionScreen.x||-1>g.positionScreen.y||1<g.positionScreen.y||
+-1>g.positionScreen.z||1<g.positionScreen.z)}fa=0;for(F=va.length;fa<F;fa++)if(M=va[fa],ga=!0===Pa?Ja.materials[M.materialIndex]:T.material,void 0!==ga&&(P=ga.side,V=k[M.a],aa=k[M.b],ja=k[M.c],E[0]=V.positionScreen,E[1]=aa.positionScreen,E[2]=ja.positionScreen,!0===V.visible||!0===aa.visible||!0===ja.visible||O.isIntersectionBox(B.setFromPoints(E))))if(ea=0>(ja.positionScreen.x-V.positionScreen.x)*(aa.positionScreen.y-V.positionScreen.y)-(ja.positionScreen.y-V.positionScreen.y)*(aa.positionScreen.x-
+V.positionScreen.x),P===THREE.DoubleSide||ea===(P===THREE.FrontSide)){if(n===t){var Ha=new THREE.RenderableFace3;r.push(Ha);t++;n++;m=Ha}else m=r[n++];m.id=T.id;m.v1.copy(V);m.v2.copy(aa);m.v3.copy(ja);m.normalModel.copy(M.normal);!1===ea&&(P===THREE.BackSide||P===THREE.DoubleSide)&&m.normalModel.negate();m.normalModel.applyMatrix3(R).normalize();m.normalModelView.copy(m.normalModel).applyMatrix3(J);m.centroidModel.copy(M.centroid).applyMatrix4(A);ja=M.vertexNormals;V=0;for(aa=Math.min(ja.length,
+3);V<aa;V++)Ha=m.vertexNormalsModel[V],Ha.copy(ja[V]),!1===ea&&(P===THREE.BackSide||P===THREE.DoubleSide)&&Ha.negate(),Ha.applyMatrix3(R).normalize(),m.vertexNormalsModelView[V].copy(Ha).applyMatrix3(J);m.vertexNormalsLength=ja.length;ea=0;for(V=Math.min(ma.length,3);ea<V;ea++)if(ja=ma[ea][fa],void 0!==ja){aa=0;for(P=ja.length;aa<P;aa++)m.uvs[ea][aa]=ja[aa]}m.color=M.color;m.material=ga;ba.copy(m.centroidModel).applyProjection(D);m.z=ba.z;y.elements.push(m)}}else if(T instanceof THREE.Line){G.multiplyMatrices(D,
+A);fa=T.geometry.vertices;V=a();V.positionScreen.copy(fa[0]).applyMatrix4(G);va=T.type===THREE.LinePieces?2:1;F=1;for(M=fa.length;F<M;F++)V=a(),V.positionScreen.copy(fa[F]).applyMatrix4(G),0<(F+1)%va||(aa=k[i-2],ra.copy(V.positionScreen),N.copy(aa.positionScreen),!0===c(ra,N)&&(ra.multiplyScalar(1/ra.w),N.multiplyScalar(1/N.w),s===u?(ma=new THREE.RenderableLine,q.push(ma),u++,s++,p=ma):p=q[s++],p.id=T.id,p.v1.positionScreen.copy(ra),p.v2.positionScreen.copy(N),p.z=Math.max(ra.z,N.z),p.material=T.material,
+T.material.vertexColors===THREE.VertexColors&&(p.vertexColors[0].copy(T.geometry.colors[F]),p.vertexColors[1].copy(T.geometry.colors[F-1])),y.elements.push(p)))}d=0;for(h=y.sprites.length;d<h;d++)T=y.sprites[d].object,A=T.matrixWorld,T instanceof THREE.Particle&&(x.set(A.elements[12],A.elements[13],A.elements[14],1),x.applyMatrix4(D),ga=1/x.w,x.z*=ga,0<x.z&&1>x.z&&(v===z?(va=new THREE.RenderableParticle,C.push(va),z++,v++,w=va):w=C[v++],w.id=T.id,w.x=x.x*ga,w.y=x.y*ga,w.z=x.z,w.object=T,w.rotation=
+T.rotation.z,w.scale.x=T.scale.x*Math.abs(w.x-(x.x+f.projectionMatrix.elements[0])/(x.w+f.projectionMatrix.elements[12])),w.scale.y=T.scale.y*Math.abs(w.y-(x.y+f.projectionMatrix.elements[5])/(x.w+f.projectionMatrix.elements[13])),w.material=T.material,y.elements.push(w)));!0===l&&y.elements.sort(b);return y}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
 return a}};THREE.Face4=function(a,b,c,d,e,f,h){return new THREE.Face3(a,b,c,e,f,h)};THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.vertices=[];this.colors=[];this.normals=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=
 this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1};
@@ -175,21 +175,21 @@ h);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){
 new THREE.Vector3;new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],a=this.vertices[d.a],f=this.vertices[d.b],h=this.vertices[d.c],g.subVectors(h,f),i.subVectors(a,f),g.cross(i),e[d.a].add(g),e[d.b].add(g),e[d.c].add(g)}else{b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],e[d.a].add(d.normal),e[d.b].add(d.normal),e[d.c].add(d.normal)}b=0;for(c=this.vertices.length;b<c;b++)e[b].normalize();b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d.vertexNormals[0].copy(e[d.a]),d.vertexNormals[1].copy(e[d.b]),
 d.vertexNormals[2].copy(e[d.c])},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++){e=this.faces[c];e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone();e.__originalVertexNormals||(e.__originalVertexNormals=[]);a=0;for(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 h=this.morphNormals[a].vertexNormals,g,i;c=0;for(d=this.faces.length;c<d;c++)g=new THREE.Vector3,i={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(g),h.push(i)}h=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],g=h.faceNormals[c],i=h.vertexNormals[c],g.copy(e.normal),i.a.copy(e.vertexNormals[0]),i.b.copy(e.vertexNormals[1]),i.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,h,g,i,k,l,m,n,t,s,p,q,r=[],u=[];c=new THREE.Vector3;var w=new THREE.Vector3,E=new THREE.Vector3,C=new THREE.Vector3,F=new THREE.Vector3;
-a=0;for(b=this.vertices.length;a<b;a++)r[a]=new THREE.Vector3,u[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,q=e.b,e=e.c,h=this.vertices[d],g=this.vertices[q],i=this.vertices[e],k=f[0],l=f[1],m=f[2],f=g.x-h.x,n=i.x-h.x,t=g.y-h.y,s=i.y-h.y,g=g.z-h.z,h=i.z-h.z,i=l.x-k.x,p=m.x-k.x,l=l.y-k.y,k=m.y-k.y,m=1/(i*k-p*l),c.set((k*f-l*n)*m,(k*t-l*s)*m,(k*g-l*h)*m),w.set((i*n-p*f)*m,(i*s-p*t)*m,(i*h-p*g)*m),r[d].add(c),r[q].add(c),r[e].add(c),u[d].add(w),
-u[q].add(w),u[e].add(w);w=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++){e=this.faces[a];for(c=0;c<Math.min(e.vertexNormals.length,3);c++)F.copy(e.vertexNormals[c]),d=e[w[c]],q=r[d],E.copy(q),E.sub(F.multiplyScalar(F.dot(q))).normalize(),C.crossVectors(e.vertexNormals[c],q),d=C.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(E.x,E.y,E.z,d)}this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=
+c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],g=h.faceNormals[c],i=h.vertexNormals[c],g.copy(e.normal),i.a.copy(e.vertexNormals[0]),i.b.copy(e.vertexNormals[1]),i.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,h,g,i,k,l,m,n,r,t,p,s,q=[],u=[];c=new THREE.Vector3;var w=new THREE.Vector3,v=new THREE.Vector3,C=new THREE.Vector3,z=new THREE.Vector3;
+a=0;for(b=this.vertices.length;a<b;a++)q[a]=new THREE.Vector3,u[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,s=e.b,e=e.c,h=this.vertices[d],g=this.vertices[s],i=this.vertices[e],k=f[0],l=f[1],m=f[2],f=g.x-h.x,n=i.x-h.x,r=g.y-h.y,t=i.y-h.y,g=g.z-h.z,h=i.z-h.z,i=l.x-k.x,p=m.x-k.x,l=l.y-k.y,k=m.y-k.y,m=1/(i*k-p*l),c.set((k*f-l*n)*m,(k*r-l*t)*m,(k*g-l*h)*m),w.set((i*n-p*f)*m,(i*t-p*r)*m,(i*h-p*g)*m),q[d].add(c),q[s].add(c),q[e].add(c),u[d].add(w),
+u[s].add(w),u[e].add(w);w=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++){e=this.faces[a];for(c=0;c<Math.min(e.vertexNormals.length,3);c++)z.copy(e.vertexNormals[c]),d=e[w[c]],s=q[d],v.copy(s),v.sub(z.multiplyScalar(z.dot(s))).normalize(),C.crossVectors(e.vertexNormals[c],s),d=C.dot(u[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<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)},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,h;this.__tmpVertices=void 0;f=0;for(h=this.vertices.length;f<h;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(h=this.faces.length;f<h;f++){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];for(d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}}for(f=a.length-1;0<=f;f--){this.faces.splice(f,1);c=0;for(h=this.faceVertexUvs.length;c<h;c++)this.faceVertexUvs[c].splice(f,1)}f=this.vertices.length-b.length;this.vertices=b;return f},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<
 d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],f=[],h=0,g=e.length;h<g;h++)f.push(new THREE.Vector2(e[h].x,e[h].y));a.faceVertexUvs[0].push(f)}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.BufferGeometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.attributes={};this.dynamic=!0;this.offsets=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.morphTargets=[]};
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,applyMatrix:function(a){var b,c;this.attributes.position&&(b=this.attributes.position.array);this.attributes.normal&&(c=this.attributes.normal.array);void 0!==b&&(a.multiplyVector3Array(b),this.verticesNeedUpdate=!0);void 0!==c&&((new THREE.Matrix3).getNormalMatrix(a).multiplyVector3Array(c),this.normalizeNormals(),this.normalsNeedUpdate=!0)},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var a=
 this.attributes.position.array;if(a){var b=this.boundingBox,c,d,e;3<=a.length&&(b.min.x=b.max.x=a[0],b.min.y=b.max.y=a[1],b.min.z=b.max.z=a[2]);for(var f=3,h=a.length;f<h;f+=3)c=a[f],d=a[f+1],e=a[f+2],c<b.min.x?b.min.x=c:c>b.max.x&&(b.max.x=c),d<b.min.y?b.min.y=d:d>b.max.y&&(b.max.y=d),e<b.min.z?b.min.z=e:e>b.max.z&&(b.max.z=e)}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=
 new THREE.Sphere);var a=this.attributes.position.array;if(a){for(var b,c=0,d,e,f=0,h=a.length;f<h;f+=3)b=a[f],d=a[f+1],e=a[f+2],b=b*b+d*d+e*e,b>c&&(c=b);this.boundingSphere.radius=Math.sqrt(c)}},computeVertexNormals:function(){if(this.attributes.position){var a,b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else{a=0;for(b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0}var e=
-this.attributes.position.array,f=this.attributes.normal.array,h,g,i,k,l,m,n=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,p=new THREE.Vector3,q=new THREE.Vector3;if(this.attributes.index){var r=this.attributes.index.array,u=this.offsets;c=0;for(d=u.length;c<d;++c){b=u[c].start;h=u[c].count;var w=u[c].index;a=b;for(b+=h;a<b;a+=3)h=w+r[a],g=w+r[a+1],i=w+r[a+2],k=e[3*h],l=e[3*h+1],m=e[3*h+2],n.set(k,l,m),k=e[3*g],l=e[3*g+1],m=e[3*g+2],t.set(k,l,m),k=e[3*i],l=e[3*i+1],m=e[3*i+2],s.set(k,l,
-m),p.subVectors(s,t),q.subVectors(n,t),p.cross(q),f[3*h]+=p.x,f[3*h+1]+=p.y,f[3*h+2]+=p.z,f[3*g]+=p.x,f[3*g+1]+=p.y,f[3*g+2]+=p.z,f[3*i]+=p.x,f[3*i+1]+=p.y,f[3*i+2]+=p.z}}else{a=0;for(b=e.length;a<b;a+=9)k=e[a],l=e[a+1],m=e[a+2],n.set(k,l,m),k=e[a+3],l=e[a+4],m=e[a+5],t.set(k,l,m),k=e[a+6],l=e[a+7],m=e[a+8],s.set(k,l,m),p.subVectors(s,t),q.subVectors(n,t),p.cross(q),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z}this.normalizeNormals();this.normalsNeedUpdate=
+this.attributes.position.array,f=this.attributes.normal.array,h,g,i,k,l,m,n=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector3,p=new THREE.Vector3,s=new THREE.Vector3;if(this.attributes.index){var q=this.attributes.index.array,u=this.offsets;c=0;for(d=u.length;c<d;++c){b=u[c].start;h=u[c].count;var w=u[c].index;a=b;for(b+=h;a<b;a+=3)h=w+q[a],g=w+q[a+1],i=w+q[a+2],k=e[3*h],l=e[3*h+1],m=e[3*h+2],n.set(k,l,m),k=e[3*g],l=e[3*g+1],m=e[3*g+2],r.set(k,l,m),k=e[3*i],l=e[3*i+1],m=e[3*i+2],t.set(k,l,
+m),p.subVectors(t,r),s.subVectors(n,r),p.cross(s),f[3*h]+=p.x,f[3*h+1]+=p.y,f[3*h+2]+=p.z,f[3*g]+=p.x,f[3*g+1]+=p.y,f[3*g+2]+=p.z,f[3*i]+=p.x,f[3*i+1]+=p.y,f[3*i+2]+=p.z}}else{a=0;for(b=e.length;a<b;a+=9)k=e[a],l=e[a+1],m=e[a+2],n.set(k,l,m),k=e[a+3],l=e[a+4],m=e[a+5],r.set(k,l,m),k=e[a+6],l=e[a+7],m=e[a+8],t.set(k,l,m),p.subVectors(t,r),s.subVectors(n,r),p.cross(s),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z}this.normalizeNormals();this.normalsNeedUpdate=
 !0}},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},computeTangents:function(){function a(a){qa.x=d[3*a];qa.y=d[3*a+1];qa.z=d[3*a+2];ra.copy(qa);M=g[a];J.copy(M);J.sub(qa.multiplyScalar(qa.dot(M))).normalize();ba.crossVectors(ra,M);Q=ba.dot(i[a]);N=0>Q?-1:1;h[4*a]=J.x;h[4*a+1]=J.y;h[4*a+2]=J.z;h[4*a+3]=N}if(void 0===this.attributes.index||void 0===this.attributes.position||
 void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var b=this.attributes.index.array,c=this.attributes.position.array,d=this.attributes.normal.array,e=this.attributes.uv.array,f=c.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent={itemSize:4,array:new Float32Array(4*f)});for(var h=this.attributes.tangent.array,g=[],i=[],k=0;k<f;k++)g[k]=new THREE.Vector3,
-i[k]=new THREE.Vector3;var l,m,n,t,s,p,q,r,u,w,E,C,F,z,D,f=new THREE.Vector3,k=new THREE.Vector3,y,O,x,B,I,v,A,G=this.offsets;x=0;for(B=G.length;x<B;++x){O=G[x].start;I=G[x].count;var R=G[x].index;y=O;for(O+=I;y<O;y+=3)I=R+b[y],v=R+b[y+1],A=R+b[y+2],l=c[3*I],m=c[3*I+1],n=c[3*I+2],t=c[3*v],s=c[3*v+1],p=c[3*v+2],q=c[3*A],r=c[3*A+1],u=c[3*A+2],w=e[2*I],E=e[2*I+1],C=e[2*v],F=e[2*v+1],z=e[2*A],D=e[2*A+1],t-=l,l=q-l,s-=m,m=r-m,p-=n,n=u-n,C-=w,w=z-w,F-=E,E=D-E,D=1/(C*E-w*F),f.set((E*t-F*l)*D,(E*s-F*m)*D,
-(E*p-F*n)*D),k.set((C*l-w*t)*D,(C*m-w*s)*D,(C*n-w*p)*D),g[I].add(f),g[v].add(f),g[A].add(f),i[I].add(k),i[v].add(k),i[A].add(k)}var J=new THREE.Vector3,ba=new THREE.Vector3,qa=new THREE.Vector3,ra=new THREE.Vector3,N,M,Q;x=0;for(B=G.length;x<B;++x){O=G[x].start;I=G[x].count;R=G[x].index;y=O;for(O+=I;y<O;y+=3)I=R+b[y],v=R+b[y+1],A=R+b[y+2],a(I),a(v),a(A)}this.tangentsNeedUpdate=this.hasTangents=!0}},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);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.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
+i[k]=new THREE.Vector3;var l,m,n,r,t,p,s,q,u,w,v,C,z,y,F,f=new THREE.Vector3,k=new THREE.Vector3,x,O,B,E,I,D,A,G=this.offsets;B=0;for(E=G.length;B<E;++B){O=G[B].start;I=G[B].count;var R=G[B].index;x=O;for(O+=I;x<O;x+=3)I=R+b[x],D=R+b[x+1],A=R+b[x+2],l=c[3*I],m=c[3*I+1],n=c[3*I+2],r=c[3*D],t=c[3*D+1],p=c[3*D+2],s=c[3*A],q=c[3*A+1],u=c[3*A+2],w=e[2*I],v=e[2*I+1],C=e[2*D],z=e[2*D+1],y=e[2*A],F=e[2*A+1],r-=l,l=s-l,t-=m,m=q-m,p-=n,n=u-n,C-=w,w=y-w,z-=v,v=F-v,F=1/(C*v-w*z),f.set((v*r-z*l)*F,(v*t-z*m)*F,
+(v*p-z*n)*F),k.set((C*l-w*r)*F,(C*m-w*t)*F,(C*n-w*p)*F),g[I].add(f),g[D].add(f),g[A].add(f),i[I].add(k),i[D].add(k),i[A].add(k)}var J=new THREE.Vector3,ba=new THREE.Vector3,qa=new THREE.Vector3,ra=new THREE.Vector3,N,M,Q;B=0;for(E=G.length;B<E;++B){O=G[B].start;I=G[B].count;R=G[B].index;x=O;for(O+=I;x<O;x+=3)I=R+b[x],D=R+b[x+1],A=R+b[x+2],a(I),a(D),a(A)}this.tangentsNeedUpdate=this.hasTangents=!0}},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);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.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(THREE.Math.degToRad(0.5*this.fov))*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.Light.prototype.clone=function(a){void 0===a&&(a=new THREE.Light);THREE.Object3D.prototype.clone.call(this,a);a.color.copy(this.color);return a};THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);THREE.AmbientLight.prototype.clone=function(){var a=new THREE.AmbientLight;THREE.Light.prototype.clone.call(this,a);return a};THREE.AreaLight=function(a,b){THREE.Light.call(this,a);this.normal=new THREE.Vector3(0,-1,0);this.right=new THREE.Vector3(1,0,0);this.intensity=void 0!==b?b:1;this.height=this.width=1;this.constantAttenuation=1.5;this.linearAttenuation=0.5;this.quadraticAttenuation=0.1};THREE.AreaLight.prototype=Object.create(THREE.Light.prototype);THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position.set(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCascade=!1;this.shadowCascadeOffset=new THREE.Vector3(0,
 0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);
@@ -197,8 +197,8 @@ THREE.DirectionalLight.prototype.clone=function(){var a=new THREE.DirectionalLig
 this.shadowMap=null};THREE.SpotLight.prototype=Object.create(THREE.Light.prototype);THREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;THREE.Light.prototype.clone.call(this,a);a.target=this.target.clone();a.intensity=this.intensity;a.distance=this.distance;a.angle=this.angle;a.exponent=this.exponent;a.castShadow=this.castShadow;a.onlyShadow=this.onlyShadow;return a};THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:"anonymous",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/1E3).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split("/");a.pop();return(1>a.length?".":a.join("/"))+"/"},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=THREE.Loader.prototype.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.floor(a)==
-a}function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function e(a,e,f,g,i,k,q){var r=/\.dds$/i.test(f),u=b+"/"+f;if(r){var w=THREE.ImageUtils.loadCompressedTexture(u);a[e]=w}else w=document.createElement("canvas"),a[e]=new THREE.Texture(w);a[e].sourceFile=f;g&&(a[e].repeat.set(g[0],g[1]),1!==g[0]&&(a[e].wrapS=THREE.RepeatWrapping),1!==g[1]&&(a[e].wrapT=THREE.RepeatWrapping));i&&a[e].offset.set(i[0],i[1]);k&&(f={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==
-f[k[0]]&&(a[e].wrapS=f[k[0]]),void 0!==f[k[1]]&&(a[e].wrapT=f[k[1]]));q&&(a[e].anisotropy=q);if(!r){var E=a[e],a=new Image;a.onload=function(){if(!c(this.width)||!c(this.height)){var a=d(this.width),b=d(this.height);E.image.width=a;E.image.height=b;E.image.getContext("2d").drawImage(this,0,0,a,b)}else E.image=this;E.needsUpdate=!0};a.crossOrigin=h.crossOrigin;a.src=u}}function f(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var h=this,g="MeshLambertMaterial",i={color:15658734,opacity:1,map:null,
+a}function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function e(a,e,f,g,i,k,s){var q=/\.dds$/i.test(f),u=b+"/"+f;if(q){var w=THREE.ImageUtils.loadCompressedTexture(u);a[e]=w}else w=document.createElement("canvas"),a[e]=new THREE.Texture(w);a[e].sourceFile=f;g&&(a[e].repeat.set(g[0],g[1]),1!==g[0]&&(a[e].wrapS=THREE.RepeatWrapping),1!==g[1]&&(a[e].wrapT=THREE.RepeatWrapping));i&&a[e].offset.set(i[0],i[1]);k&&(f={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==
+f[k[0]]&&(a[e].wrapS=f[k[0]]),void 0!==f[k[1]]&&(a[e].wrapT=f[k[1]]));s&&(a[e].anisotropy=s);if(!q){var v=a[e],a=new Image;a.onload=function(){if(!c(this.width)||!c(this.height)){var a=d(this.width),b=d(this.height);v.image.width=a;v.image.height=b;v.image.getContext("2d").drawImage(this,0,0,a,b)}else v.image=this;v.needsUpdate=!0};a.crossOrigin=h.crossOrigin;a.src=u}}function f(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var h=this,g="MeshLambertMaterial",i={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]&&(i.blending=THREE[a.blending]);if(void 0!==a.transparent||1>a.opacity)i.transparent=a.transparent;void 0!==a.depthTest&&(i.depthTest=a.depthTest);void 0!==a.depthWrite&&(i.depthWrite=a.depthWrite);void 0!==a.visible&&(i.visible=a.visible);void 0!==a.flipSided&&(i.side=THREE.BackSide);
 void 0!==a.doubleSided&&(i.side=THREE.DoubleSide);void 0!==a.wireframe&&(i.wireframe=a.wireframe);void 0!==a.vertexColors&&("face"===a.vertexColors?i.vertexColors=THREE.FaceColors:a.vertexColors&&(i.vertexColors=THREE.VertexColors));a.colorDiffuse?i.color=f(a.colorDiffuse):a.DbgColor&&(i.color=a.DbgColor);a.colorSpecular&&(i.specular=f(a.colorSpecular));a.colorAmbient&&(i.ambient=f(a.colorAmbient));a.transparency&&(i.opacity=a.transparency);a.specularCoef&&(i.shininess=a.specularCoef);a.mapDiffuse&&
 b&&e(i,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy);a.mapLight&&b&&e(i,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&e(i,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&e(i,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&e(i,"specularMap",a.mapSpecular,a.mapSpecularRepeat,
@@ -208,11 +208,12 @@ THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){va
 THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=document.createElement("img");void 0!==b&&f.addEventListener("load",function(){e.manager.itemEnd(a);b(this)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);void 0!==d&&f.addEventListener("error",function(a){d(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);f.src=a;e.manager.itemStart(a)},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.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,h=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var g=JSON.parse(f.responseText),g=a.parse(g,d);c(g.geometry,g.materials)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+f.status+"]");else f.readyState===f.LOADING?e&&(0===h&&
 (h=f.getResponseHeader("Content-Length")),e({total:h,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(h=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,e,f,h,g,i,k,l,m,n,t,s,p,q,r,u,w=a.faces;l=a.vertices;var E=a.normals,C=a.colors,F=0;if(void 0!==a.uvs){for(e=0;e<a.uvs.length;e++)a.uvs[e].length&&F++;for(e=0;e<F;e++)c.faceVertexUvs[e]=[]}g=0;for(i=l.length;g<i;)t=new THREE.Vector3,t.x=l[g++]*d,t.y=l[g++]*d,t.z=l[g++]*d,c.vertices.push(t);g=0;for(i=w.length;g<i;){t=w[g++];k=t&1;h=t&2;e=t&8;m=t&16;s=t&32;l=t&64;t&=128;k?(p=new THREE.Face4,p.a=w[g++],
-p.b=w[g++],p.c=w[g++],p.d=w[g++],k=4):(p=new THREE.Face3,p.a=w[g++],p.b=w[g++],p.c=w[g++],k=3);h&&(h=w[g++],p.materialIndex=h);h=c.faces.length;if(e)for(e=0;e<F;e++){q=a.uvs[e];r=[];for(f=0;f<k;f++)n=w[g++],u=q[2*n],n=q[2*n+1],r[f]=new THREE.Vector2(u,n);c.faceVertexUvs[e][h]=r}m&&(m=3*w[g++],p.normal.set(E[m++],E[m++],E[m]));if(s)for(e=0;e<k;e++)m=3*w[g++],s=new THREE.Vector3(E[m++],E[m++],E[m]),p.vertexNormals.push(s);l&&(l=w[g++],p.color.setHex(C[l]));if(t)for(e=0;e<k;e++)l=w[g++],p.vertexColors.push(new THREE.Color(C[l]));
-c.faces.push(p)}if(a.skinWeights){g=0;for(i=a.skinWeights.length;g<i;g+=2)w=a.skinWeights[g],E=a.skinWeights[g+1],c.skinWeights.push(new THREE.Vector4(w,E,0,0))}if(a.skinIndices){g=0;for(i=a.skinIndices.length;g<i;g+=2)w=a.skinIndices[g],E=a.skinIndices[g+1],c.skinIndices.push(new THREE.Vector4(w,E,0,0))}c.bones=a.bones;c.animation=a.animation;if(void 0!==a.morphTargets){g=0;for(i=a.morphTargets.length;g<i;g++){c.morphTargets[g]={};c.morphTargets[g].name=a.morphTargets[g].name;c.morphTargets[g].vertices=
-[];C=c.morphTargets[g].vertices;F=a.morphTargets[g].vertices;w=0;for(E=F.length;w<E;w+=3)l=new THREE.Vector3,l.x=F[w]*d,l.y=F[w+1]*d,l.z=F[w+2]*d,C.push(l)}}if(void 0!==a.morphColors){g=0;for(i=a.morphColors.length;g<i;g++){c.morphColors[g]={};c.morphColors[g].name=a.morphColors[g].name;c.morphColors[g].colors=[];E=c.morphColors[g].colors;C=a.morphColors[g].colors;d=0;for(w=C.length;d<w;d+=3)F=new THREE.Color(16755200),F.setRGB(C[d],C[d+1],C[d+2]),E.push(F)}}c.computeCentroids();c.computeFaceNormals();
-c.computeBoundingSphere();if(void 0===a.materials)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1,e,f,h,g,i,k,l,m,n,r,t,p,s,q,u=a.faces;n=a.vertices;var w=a.normals,v=a.colors,C=0;if(void 0!==a.uvs){for(e=0;e<a.uvs.length;e++)a.uvs[e].length&&C++;for(e=0;e<C;e++)c.faceVertexUvs[e]=[]}g=0;for(i=n.length;g<i;)k=new THREE.Vector3,k.x=n[g++]*d,k.y=n[g++]*d,k.z=n[g++]*d,c.vertices.push(k);g=0;for(i=u.length;g<i;)if(n=u[g++],r=n&1,h=n&2,e=n&8,l=n&16,t=n&32,k=n&64,n&=128,r){r=new THREE.Face3;r.a=u[g];
+r.b=u[g+1];r.c=u[g+3];p=new THREE.Face3;p.a=u[g+1];p.b=u[g+2];p.c=u[g+3];g+=4;h&&(h=u[g++],r.materialIndex=h,p.materialIndex=h);h=c.faces.length;if(e)for(e=0;e<C;e++){s=a.uvs[e];c.faceVertexUvs[e][h]=[];c.faceVertexUvs[e][h+1]=[];for(f=0;4>f;f++)m=u[g++],q=s[2*m],m=s[2*m+1],q=new THREE.Vector2(q,m),2!==f&&c.faceVertexUvs[e][h].push(q),0!==f&&c.faceVertexUvs[e][h+1].push(q)}l&&(l=3*u[g++],r.normal.set(w[l++],w[l++],w[l]),p.normal.copy(r.normal));if(t)for(e=0;4>e;e++)l=3*u[g++],t=new THREE.Vector3(w[l++],
+w[l++],w[l]),2!==e&&r.vertexNormals.push(t),0!==e&&p.vertexNormals.push(t);k&&(k=u[g++],k=v[k],r.color.setHex(k),p.color.setHex(k));if(n)for(e=0;4>e;e++)k=u[g++],k=v[k],2!==e&&r.vertexColors.push(new THREE.Color(k)),0!==e&&p.vertexColors.push(new THREE.Color(k));c.faces.push(r);c.faces.push(p)}else{r=new THREE.Face3;r.a=u[g++];r.b=u[g++];r.c=u[g++];h&&(h=u[g++],r.materialIndex=h);h=c.faces.length;if(e)for(e=0;e<C;e++){s=a.uvs[e];c.faceVertexUvs[e][h]=[];for(f=0;3>f;f++)m=u[g++],q=s[2*m],m=s[2*m+1],
+q=new THREE.Vector2(q,m),c.faceVertexUvs[e][h].push(q)}l&&(l=3*u[g++],r.normal.set(w[l++],w[l++],w[l]));if(t)for(e=0;3>e;e++)l=3*u[g++],t=new THREE.Vector3(w[l++],w[l++],w[l]),r.vertexNormals.push(t);k&&(k=u[g++],r.color.setHex(v[k]));if(n)for(e=0;3>e;e++)k=u[g++],r.vertexColors.push(new THREE.Color(v[k]));c.faces.push(r)}if(a.skinWeights){g=0;for(i=a.skinWeights.length;g<i;g+=2)u=a.skinWeights[g],w=a.skinWeights[g+1],c.skinWeights.push(new THREE.Vector4(u,w,0,0))}if(a.skinIndices){g=0;for(i=a.skinIndices.length;g<
+i;g+=2)u=a.skinIndices[g],w=a.skinIndices[g+1],c.skinIndices.push(new THREE.Vector4(u,w,0,0))}c.bones=a.bones;c.animation=a.animation;if(void 0!==a.morphTargets){g=0;for(i=a.morphTargets.length;g<i;g++){c.morphTargets[g]={};c.morphTargets[g].name=a.morphTargets[g].name;c.morphTargets[g].vertices=[];v=c.morphTargets[g].vertices;C=a.morphTargets[g].vertices;u=0;for(w=C.length;u<w;u+=3)n=new THREE.Vector3,n.x=C[u]*d,n.y=C[u+1]*d,n.z=C[u+2]*d,v.push(n)}}if(void 0!==a.morphColors){g=0;for(i=a.morphColors.length;g<
+i;g++){c.morphColors[g]={};c.morphColors[g].name=a.morphColors[g].name;c.morphColors[g].colors=[];w=c.morphColors[g].colors;v=a.morphColors[g].colors;d=0;for(u=v.length;d<u;d+=3)C=new THREE.Color(16755200),C.setRGB(v[d],v[d+1],v[d+2]),w.push(C)}}c.computeCentroids();c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
 THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader;d.setCrossOrigin(this.crossOrigin);d.load(a,function(a){b(c.parse(JSON.parse(a)))})},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE.BufferGeometry,c=a.attributes,d=a.offsets,a=a.boundingSphere,e;for(e in c){var f=c[e];b.attributes[e]={itemSize:f.itemSize,array:new self[f.type](f.array)}}void 0!==d&&(b.offsets=JSON.parse(JSON.stringify(d)));
 void 0!==a&&(b.boundingSphere=new THREE.Sphere(void 0,a.radius));return b}};THREE.GeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.GeometryLoader.prototype={constructor:THREE.GeometryLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader;d.setCrossOrigin(this.crossOrigin);d.load(a,function(a){b(c.parse(JSON.parse(a)))})},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(){}};THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
 THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader;d.setCrossOrigin(this.crossOrigin);d.load(a,function(a){b(c.parse(JSON.parse(a)))})},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE[a.type];void 0!==a.color&&b.color.setHex(a.color);void 0!==a.ambient&&b.ambient.setHex(a.ambient);void 0!==a.emissive&&b.emissive.setHex(a.emissive);void 0!==a.specular&&b.specular.setHex(a.specular);void 0!==a.shininess&&
@@ -224,28 +225,28 @@ g.phiStart,g.phiLength,g.thetaStart,g.thetaLength);break;case "IcosahedronGeomet
 b.right,b.top,b.bottom,b.near,b.far);break;case "AmbientLight":e=new THREE.AmbientLight(b.color);break;case "DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case "PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance);break;case "SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent);break;case "HemisphereLight":e=new THREE.HemisphereLight(b.color,b.groundColor,b.intensity);break;case "Mesh":e=c[b.geometry];var f=d[b.material];void 0===
 e&&console.error("THREE.ObjectLoader: Undefined geometry "+b.geometry);void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,f);break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&(e.name=b.name);void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==
 b.visible&&(e.visible=b.visible);void 0!==b.userData&&(e.userData=b.userData);if(void 0!==b.children)for(var h in b.children)e.add(this.parseObject(b.children[h],c,d));return e}}()};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){};this.geometryHandlers={};this.hierarchyHandlers={};this.addGeometryHandler("ascii",THREE.JSONLoader)};
-THREE.SceneLoader.prototype={constructor:THREE.SceneLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader(c.manager);d.setCrossOrigin(this.crossOrigin);d.load(a,function(d){c.parse(JSON.parse(d),b,a)})},setCrossOrigin:function(a){this.crossOrigin=a},addGeometryHandler:function(a,b){this.geometryHandlers[a]={loaderClass:b}},addHierarchyHandler:function(a,b){this.hierarchyHandlers[a]={loaderClass:b}},parse:function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:n+"/"+a}function e(){f(y.scene,
-x.objects)}function f(a,b){var c,e,h,i,k,l,n;for(n in b){var q=y.objects[n],r=b[n];if(void 0===q){if(r.type&&r.type in m.hierarchyHandlers){if(void 0===r.loading){e={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,userData:1,skin:1,morph:1,mirroredLoop:1,duration:1};h={};for(var C in r)C in e||(h[C]=r[C]);s=y.materials[r.material];r.loading=!0;e=m.hierarchyHandlers[r.type].loaderObject;e.options?e.load(d(r.url,x.urlBaseType),g(n,a,s,r)):e.load(d(r.url,x.urlBaseType),g(n,
-a,s,r),h)}}else if(void 0!==r.geometry){if(t=y.geometries[r.geometry]){q=!1;s=y.materials[r.material];q=s instanceof THREE.ShaderMaterial;h=r.position;i=r.rotation;k=r.scale;c=r.matrix;l=r.quaternion;r.material||(s=new THREE.MeshFaceMaterial(y.face_materials[r.geometry]));s instanceof THREE.MeshFaceMaterial&&0===s.materials.length&&(s=new THREE.MeshFaceMaterial(y.face_materials[r.geometry]));if(s instanceof THREE.MeshFaceMaterial)for(e=0;e<s.materials.length;e++)q=q||s.materials[e]instanceof THREE.ShaderMaterial;
-q&&t.computeTangents();r.skin?q=new THREE.SkinnedMesh(t,s):r.morph?(q=new THREE.MorphAnimMesh(t,s),void 0!==r.duration&&(q.duration=r.duration),void 0!==r.time&&(q.time=r.time),void 0!==r.mirroredLoop&&(q.mirroredLoop=r.mirroredLoop),s.morphNormals&&t.computeMorphNormals()):q=new THREE.Mesh(t,s);q.name=n;c?(q.matrixAutoUpdate=!1,q.matrix.set(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])):(q.position.fromArray(h),l?q.quaternion.fromArray(l):q.rotation.fromArray(i),
-q.scale.fromArray(k));q.visible=r.visible;q.castShadow=r.castShadow;q.receiveShadow=r.receiveShadow;a.add(q);y.objects[n]=q}}else"DirectionalLight"===r.type||"PointLight"===r.type||"AmbientLight"===r.type?(w=void 0!==r.color?r.color:16777215,E=void 0!==r.intensity?r.intensity:1,"DirectionalLight"===r.type?(h=r.direction,u=new THREE.DirectionalLight(w,E),u.position.fromArray(h),r.target&&(O.push({object:u,targetName:r.target}),u.target=null)):"PointLight"===r.type?(h=r.position,e=r.distance,u=new THREE.PointLight(w,
-E,e),u.position.fromArray(h)):"AmbientLight"===r.type&&(u=new THREE.AmbientLight(w)),a.add(u),u.name=n,y.lights[n]=u,y.objects[n]=u):"PerspectiveCamera"===r.type||"OrthographicCamera"===r.type?(h=r.position,i=r.rotation,l=r.quaternion,"PerspectiveCamera"===r.type?p=new THREE.PerspectiveCamera(r.fov,r.aspect,r.near,r.far):"OrthographicCamera"===r.type&&(p=new THREE.OrthographicCamera(r.left,r.right,r.top,r.bottom,r.near,r.far)),p.name=n,p.position.fromArray(h),void 0!==l?p.quaternion.fromArray(l):
-void 0!==i&&p.rotation.fromArray(i),a.add(p),y.cameras[n]=p,y.objects[n]=p):(h=r.position,i=r.rotation,k=r.scale,l=r.quaternion,q=new THREE.Object3D,q.name=n,q.position.fromArray(h),l?q.quaternion.fromArray(l):q.rotation.fromArray(i),q.scale.fromArray(k),q.visible=void 0!==r.visible?r.visible:!1,a.add(q),y.objects[n]=q,y.empties[n]=q);if(q){if(void 0!==r.userData)for(var D in r.userData)q.userData[D]=r.userData[D];if(void 0!==r.groups)for(e=0;e<r.groups.length;e++)h=r.groups[e],void 0===y.groups[h]&&
-(y.groups[h]=[]),y.groups[h].push(n)}}void 0!==q&&void 0!==r.children&&f(q,r.children)}}function h(a){return function(b,c){b.name=a;y.geometries[a]=b;y.face_materials[a]=c;e();C-=1;m.onLoadComplete();k()}}function g(a,b,c,d){return function(f){var f=f.content?f.content:f.dae?f.scene:f,h=d.rotation,g=d.quaternion,i=d.scale;f.position.fromArray(d.position);g?f.quaternion.fromArray(g):f.rotation.fromArray(h);f.scale.fromArray(i);c&&f.traverse(function(a){a.material=c});var l=void 0!==d.visible?d.visible:
-!0;f.traverse(function(a){a.visible=l});b.add(f);f.name=a;y.objects[a]=f;e();C-=1;m.onLoadComplete();k()}}function i(a){return function(b,c){b.name=a;y.geometries[a]=b;y.face_materials[a]=c}}function k(){m.callbackProgress({totalModels:z,totalTextures:D,loadedModels:z-C,loadedTextures:D-F},y);m.onLoadProgress();if(0===C&&0===F){for(var a=0;a<O.length;a++){var c=O[a],d=y.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,y.scene.add(c.object.target));c.object.target.userData.targetInverse=
-c.object}b(y)}}function l(a,b){b(a);if(void 0!==a.children)for(var c in a.children)l(a.children[c],b)}var m=this,n=THREE.Loader.prototype.extractUrlBase(c),t,s,p,q,r,u,w,E,C,F,z,D,y,O=[],x=a,B;for(B in this.geometryHandlers)a=this.geometryHandlers[B].loaderClass,this.geometryHandlers[B].loaderObject=new a;for(B in this.hierarchyHandlers)a=this.hierarchyHandlers[B].loaderClass,this.hierarchyHandlers[B].loaderObject=new a;F=C=0;y={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},
-objects:{},cameras:{},lights:{},fogs:{},empties:{},groups:{}};if(x.transform&&(B=x.transform.position,a=x.transform.rotation,c=x.transform.scale,B&&y.scene.position.fromArray(B),a&&y.scene.rotation.fromArray(a),c&&y.scene.scale.fromArray(c),B||a||c))y.scene.updateMatrix(),y.scene.updateMatrixWorld();B=function(a){return function(){F-=a;k();m.onLoadComplete()}};for(var I in x.fogs)a=x.fogs[I],"linear"===a.type?q=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(q=new THREE.FogExp2(0,a.density)),a=a.color,
-q.color.setRGB(a[0],a[1],a[2]),y.fogs[I]=q;for(var v in x.geometries)q=x.geometries[v],q.type in this.geometryHandlers&&(C+=1,m.onLoadStart());for(var A in x.objects)l(x.objects[A],function(a){a.type&&a.type in m.hierarchyHandlers&&(C+=1,m.onLoadStart())});z=C;for(v in x.geometries)if(q=x.geometries[v],"cube"===q.type)t=new THREE.CubeGeometry(q.width,q.height,q.depth,q.widthSegments,q.heightSegments,q.depthSegments),t.name=v,y.geometries[v]=t;else if("plane"===q.type)t=new THREE.PlaneGeometry(q.width,
-q.height,q.widthSegments,q.heightSegments),t.name=v,y.geometries[v]=t;else if("sphere"===q.type)t=new THREE.SphereGeometry(q.radius,q.widthSegments,q.heightSegments),t.name=v,y.geometries[v]=t;else if("cylinder"===q.type)t=new THREE.CylinderGeometry(q.topRad,q.botRad,q.height,q.radSegs,q.heightSegs),t.name=v,y.geometries[v]=t;else if("torus"===q.type)t=new THREE.TorusGeometry(q.radius,q.tube,q.segmentsR,q.segmentsT),t.name=v,y.geometries[v]=t;else if("icosahedron"===q.type)t=new THREE.IcosahedronGeometry(q.radius,
-q.subdivisions),t.name=v,y.geometries[v]=t;else if(q.type in this.geometryHandlers){A={};for(r in q)"type"!==r&&"url"!==r&&(A[r]=q[r]);this.geometryHandlers[q.type].loaderObject.load(d(q.url,x.urlBaseType),h(v),A)}else"embedded"===q.type&&(A=x.embeds[q.id],A.metadata=x.metadata,A&&(A=this.geometryHandlers.ascii.loaderObject.parse(A,""),i(v)(A.geometry,A.materials)));for(var G in x.textures)if(v=x.textures[G],v.url instanceof Array){F+=v.url.length;for(r=0;r<v.url.length;r++)m.onLoadStart()}else F+=
-1,m.onLoadStart();D=F;for(G in x.textures){v=x.textures[G];void 0!==v.mapping&&void 0!==THREE[v.mapping]&&(v.mapping=new THREE[v.mapping]);if(v.url instanceof Array){A=v.url.length;q=[];for(r=0;r<A;r++)q[r]=d(v.url[r],x.urlBaseType);r=(r=/\.dds$/i.test(q[0]))?THREE.ImageUtils.loadCompressedTextureCube(q,v.mapping,B(A)):THREE.ImageUtils.loadTextureCube(q,v.mapping,B(A))}else r=/\.dds$/i.test(v.url),A=d(v.url,x.urlBaseType),q=B(1),r=r?THREE.ImageUtils.loadCompressedTexture(A,v.mapping,q):THREE.ImageUtils.loadTexture(A,
-v.mapping,q),void 0!==THREE[v.minFilter]&&(r.minFilter=THREE[v.minFilter]),void 0!==THREE[v.magFilter]&&(r.magFilter=THREE[v.magFilter]),v.anisotropy&&(r.anisotropy=v.anisotropy),v.repeat&&(r.repeat.set(v.repeat[0],v.repeat[1]),1!==v.repeat[0]&&(r.wrapS=THREE.RepeatWrapping),1!==v.repeat[1]&&(r.wrapT=THREE.RepeatWrapping)),v.offset&&r.offset.set(v.offset[0],v.offset[1]),v.wrap&&(A={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==A[v.wrap[0]]&&(r.wrapS=A[v.wrap[0]]),void 0!==
-A[v.wrap[1]]&&(r.wrapT=A[v.wrap[1]]));y.textures[G]=r}var R,J;for(R in x.materials){G=x.materials[R];for(J in G.parameters)"envMap"===J||"map"===J||"lightMap"===J||"bumpMap"===J?G.parameters[J]=y.textures[G.parameters[J]]:"shading"===J?G.parameters[J]="flat"===G.parameters[J]?THREE.FlatShading:THREE.SmoothShading:"side"===J?G.parameters[J]="double"==G.parameters[J]?THREE.DoubleSide:"back"==G.parameters[J]?THREE.BackSide:THREE.FrontSide:"blending"===J?G.parameters[J]=G.parameters[J]in THREE?THREE[G.parameters[J]]:
-THREE.NormalBlending:"combine"===J?G.parameters[J]=G.parameters[J]in THREE?THREE[G.parameters[J]]:THREE.MultiplyOperation:"vertexColors"===J?"face"==G.parameters[J]?G.parameters[J]=THREE.FaceColors:G.parameters[J]&&(G.parameters[J]=THREE.VertexColors):"wrapRGB"===J&&(B=G.parameters[J],G.parameters[J]=new THREE.Vector3(B[0],B[1],B[2]));void 0!==G.parameters.opacity&&1>G.parameters.opacity&&(G.parameters.transparent=!0);G.parameters.normalMap?(B=THREE.ShaderLib.normalmap,v=THREE.UniformsUtils.clone(B.uniforms),
-r=G.parameters.color,A=G.parameters.specular,q=G.parameters.ambient,I=G.parameters.shininess,v.tNormal.value=y.textures[G.parameters.normalMap],G.parameters.normalScale&&v.uNormalScale.value.set(G.parameters.normalScale[0],G.parameters.normalScale[1]),G.parameters.map&&(v.tDiffuse.value=G.parameters.map,v.enableDiffuse.value=!0),G.parameters.envMap&&(v.tCube.value=G.parameters.envMap,v.enableReflection.value=!0,v.uReflectivity.value=G.parameters.reflectivity),G.parameters.lightMap&&(v.tAO.value=G.parameters.lightMap,
-v.enableAO.value=!0),G.parameters.specularMap&&(v.tSpecular.value=y.textures[G.parameters.specularMap],v.enableSpecular.value=!0),G.parameters.displacementMap&&(v.tDisplacement.value=y.textures[G.parameters.displacementMap],v.enableDisplacement.value=!0,v.uDisplacementBias.value=G.parameters.displacementBias,v.uDisplacementScale.value=G.parameters.displacementScale),v.uDiffuseColor.value.setHex(r),v.uSpecularColor.value.setHex(A),v.uAmbientColor.value.setHex(q),v.uShininess.value=I,G.parameters.opacity&&
-(v.uOpacity.value=G.parameters.opacity),s=new THREE.ShaderMaterial({fragmentShader:B.fragmentShader,vertexShader:B.vertexShader,uniforms:v,lights:!0,fog:!0})):s=new THREE[G.type](G.parameters);s.name=R;y.materials[R]=s}for(R in x.materials)if(G=x.materials[R],G.parameters.materials){J=[];for(r=0;r<G.parameters.materials.length;r++)J.push(y.materials[G.parameters.materials[r]]);y.materials[R].materials=J}e();y.cameras&&x.defaults.camera&&(y.currentCamera=y.cameras[x.defaults.camera]);y.fogs&&x.defaults.fog&&
-(y.scene.fog=y.fogs[x.defaults.fog]);m.callbackSync(y);k()}};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b){var c=new THREE.ImageLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)})},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};
+THREE.SceneLoader.prototype={constructor:THREE.SceneLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader(c.manager);d.setCrossOrigin(this.crossOrigin);d.load(a,function(d){c.parse(JSON.parse(d),b,a)})},setCrossOrigin:function(a){this.crossOrigin=a},addGeometryHandler:function(a,b){this.geometryHandlers[a]={loaderClass:b}},addHierarchyHandler:function(a,b){this.hierarchyHandlers[a]={loaderClass:b}},parse:function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:n+"/"+a}function e(){f(x.scene,
+B.objects)}function f(a,b){var c,e,h,i,k,l,n;for(n in b){var s=x.objects[n],q=b[n];if(void 0===s){if(q.type&&q.type in m.hierarchyHandlers){if(void 0===q.loading){e={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,userData:1,skin:1,morph:1,mirroredLoop:1,duration:1};h={};for(var C in q)C in e||(h[C]=q[C]);t=x.materials[q.material];q.loading=!0;e=m.hierarchyHandlers[q.type].loaderObject;e.options?e.load(d(q.url,B.urlBaseType),g(n,a,t,q)):e.load(d(q.url,B.urlBaseType),g(n,
+a,t,q),h)}}else if(void 0!==q.geometry){if(r=x.geometries[q.geometry]){s=!1;t=x.materials[q.material];s=t instanceof THREE.ShaderMaterial;h=q.position;i=q.rotation;k=q.scale;c=q.matrix;l=q.quaternion;q.material||(t=new THREE.MeshFaceMaterial(x.face_materials[q.geometry]));t instanceof THREE.MeshFaceMaterial&&0===t.materials.length&&(t=new THREE.MeshFaceMaterial(x.face_materials[q.geometry]));if(t instanceof THREE.MeshFaceMaterial)for(e=0;e<t.materials.length;e++)s=s||t.materials[e]instanceof THREE.ShaderMaterial;
+s&&r.computeTangents();q.skin?s=new THREE.SkinnedMesh(r,t):q.morph?(s=new THREE.MorphAnimMesh(r,t),void 0!==q.duration&&(s.duration=q.duration),void 0!==q.time&&(s.time=q.time),void 0!==q.mirroredLoop&&(s.mirroredLoop=q.mirroredLoop),t.morphNormals&&r.computeMorphNormals()):s=new THREE.Mesh(r,t);s.name=n;c?(s.matrixAutoUpdate=!1,s.matrix.set(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])):(s.position.fromArray(h),l?s.quaternion.fromArray(l):s.rotation.fromArray(i),
+s.scale.fromArray(k));s.visible=q.visible;s.castShadow=q.castShadow;s.receiveShadow=q.receiveShadow;a.add(s);x.objects[n]=s}}else"DirectionalLight"===q.type||"PointLight"===q.type||"AmbientLight"===q.type?(w=void 0!==q.color?q.color:16777215,v=void 0!==q.intensity?q.intensity:1,"DirectionalLight"===q.type?(h=q.direction,u=new THREE.DirectionalLight(w,v),u.position.fromArray(h),q.target&&(O.push({object:u,targetName:q.target}),u.target=null)):"PointLight"===q.type?(h=q.position,e=q.distance,u=new THREE.PointLight(w,
+v,e),u.position.fromArray(h)):"AmbientLight"===q.type&&(u=new THREE.AmbientLight(w)),a.add(u),u.name=n,x.lights[n]=u,x.objects[n]=u):"PerspectiveCamera"===q.type||"OrthographicCamera"===q.type?(h=q.position,i=q.rotation,l=q.quaternion,"PerspectiveCamera"===q.type?p=new THREE.PerspectiveCamera(q.fov,q.aspect,q.near,q.far):"OrthographicCamera"===q.type&&(p=new THREE.OrthographicCamera(q.left,q.right,q.top,q.bottom,q.near,q.far)),p.name=n,p.position.fromArray(h),void 0!==l?p.quaternion.fromArray(l):
+void 0!==i&&p.rotation.fromArray(i),a.add(p),x.cameras[n]=p,x.objects[n]=p):(h=q.position,i=q.rotation,k=q.scale,l=q.quaternion,s=new THREE.Object3D,s.name=n,s.position.fromArray(h),l?s.quaternion.fromArray(l):s.rotation.fromArray(i),s.scale.fromArray(k),s.visible=void 0!==q.visible?q.visible:!1,a.add(s),x.objects[n]=s,x.empties[n]=s);if(s){if(void 0!==q.userData)for(var F in q.userData)s.userData[F]=q.userData[F];if(void 0!==q.groups)for(e=0;e<q.groups.length;e++)h=q.groups[e],void 0===x.groups[h]&&
+(x.groups[h]=[]),x.groups[h].push(n)}}void 0!==s&&void 0!==q.children&&f(s,q.children)}}function h(a){return function(b,c){b.name=a;x.geometries[a]=b;x.face_materials[a]=c;e();C-=1;m.onLoadComplete();k()}}function g(a,b,c,d){return function(f){var f=f.content?f.content:f.dae?f.scene:f,h=d.rotation,g=d.quaternion,i=d.scale;f.position.fromArray(d.position);g?f.quaternion.fromArray(g):f.rotation.fromArray(h);f.scale.fromArray(i);c&&f.traverse(function(a){a.material=c});var l=void 0!==d.visible?d.visible:
+!0;f.traverse(function(a){a.visible=l});b.add(f);f.name=a;x.objects[a]=f;e();C-=1;m.onLoadComplete();k()}}function i(a){return function(b,c){b.name=a;x.geometries[a]=b;x.face_materials[a]=c}}function k(){m.callbackProgress({totalModels:y,totalTextures:F,loadedModels:y-C,loadedTextures:F-z},x);m.onLoadProgress();if(0===C&&0===z){for(var a=0;a<O.length;a++){var c=O[a],d=x.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,x.scene.add(c.object.target));c.object.target.userData.targetInverse=
+c.object}b(x)}}function l(a,b){b(a);if(void 0!==a.children)for(var c in a.children)l(a.children[c],b)}var m=this,n=THREE.Loader.prototype.extractUrlBase(c),r,t,p,s,q,u,w,v,C,z,y,F,x,O=[],B=a,E;for(E in this.geometryHandlers)a=this.geometryHandlers[E].loaderClass,this.geometryHandlers[E].loaderObject=new a;for(E in this.hierarchyHandlers)a=this.hierarchyHandlers[E].loaderClass,this.hierarchyHandlers[E].loaderObject=new a;z=C=0;x={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},
+objects:{},cameras:{},lights:{},fogs:{},empties:{},groups:{}};if(B.transform&&(E=B.transform.position,a=B.transform.rotation,c=B.transform.scale,E&&x.scene.position.fromArray(E),a&&x.scene.rotation.fromArray(a),c&&x.scene.scale.fromArray(c),E||a||c))x.scene.updateMatrix(),x.scene.updateMatrixWorld();E=function(a){return function(){z-=a;k();m.onLoadComplete()}};for(var I in B.fogs)a=B.fogs[I],"linear"===a.type?s=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(s=new THREE.FogExp2(0,a.density)),a=a.color,
+s.color.setRGB(a[0],a[1],a[2]),x.fogs[I]=s;for(var D in B.geometries)s=B.geometries[D],s.type in this.geometryHandlers&&(C+=1,m.onLoadStart());for(var A in B.objects)l(B.objects[A],function(a){a.type&&a.type in m.hierarchyHandlers&&(C+=1,m.onLoadStart())});y=C;for(D in B.geometries)if(s=B.geometries[D],"cube"===s.type)r=new THREE.CubeGeometry(s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments),r.name=D,x.geometries[D]=r;else if("plane"===s.type)r=new THREE.PlaneGeometry(s.width,
+s.height,s.widthSegments,s.heightSegments),r.name=D,x.geometries[D]=r;else if("sphere"===s.type)r=new THREE.SphereGeometry(s.radius,s.widthSegments,s.heightSegments),r.name=D,x.geometries[D]=r;else if("cylinder"===s.type)r=new THREE.CylinderGeometry(s.topRad,s.botRad,s.height,s.radSegs,s.heightSegs),r.name=D,x.geometries[D]=r;else if("torus"===s.type)r=new THREE.TorusGeometry(s.radius,s.tube,s.segmentsR,s.segmentsT),r.name=D,x.geometries[D]=r;else if("icosahedron"===s.type)r=new THREE.IcosahedronGeometry(s.radius,
+s.subdivisions),r.name=D,x.geometries[D]=r;else if(s.type in this.geometryHandlers){A={};for(q in s)"type"!==q&&"url"!==q&&(A[q]=s[q]);this.geometryHandlers[s.type].loaderObject.load(d(s.url,B.urlBaseType),h(D),A)}else"embedded"===s.type&&(A=B.embeds[s.id],A.metadata=B.metadata,A&&(A=this.geometryHandlers.ascii.loaderObject.parse(A,""),i(D)(A.geometry,A.materials)));for(var G in B.textures)if(D=B.textures[G],D.url instanceof Array){z+=D.url.length;for(q=0;q<D.url.length;q++)m.onLoadStart()}else z+=
+1,m.onLoadStart();F=z;for(G in B.textures){D=B.textures[G];void 0!==D.mapping&&void 0!==THREE[D.mapping]&&(D.mapping=new THREE[D.mapping]);if(D.url instanceof Array){A=D.url.length;s=[];for(q=0;q<A;q++)s[q]=d(D.url[q],B.urlBaseType);q=(q=/\.dds$/i.test(s[0]))?THREE.ImageUtils.loadCompressedTextureCube(s,D.mapping,E(A)):THREE.ImageUtils.loadTextureCube(s,D.mapping,E(A))}else q=/\.dds$/i.test(D.url),A=d(D.url,B.urlBaseType),s=E(1),q=q?THREE.ImageUtils.loadCompressedTexture(A,D.mapping,s):THREE.ImageUtils.loadTexture(A,
+D.mapping,s),void 0!==THREE[D.minFilter]&&(q.minFilter=THREE[D.minFilter]),void 0!==THREE[D.magFilter]&&(q.magFilter=THREE[D.magFilter]),D.anisotropy&&(q.anisotropy=D.anisotropy),D.repeat&&(q.repeat.set(D.repeat[0],D.repeat[1]),1!==D.repeat[0]&&(q.wrapS=THREE.RepeatWrapping),1!==D.repeat[1]&&(q.wrapT=THREE.RepeatWrapping)),D.offset&&q.offset.set(D.offset[0],D.offset[1]),D.wrap&&(A={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==A[D.wrap[0]]&&(q.wrapS=A[D.wrap[0]]),void 0!==
+A[D.wrap[1]]&&(q.wrapT=A[D.wrap[1]]));x.textures[G]=q}var R,J;for(R in B.materials){G=B.materials[R];for(J in G.parameters)"envMap"===J||"map"===J||"lightMap"===J||"bumpMap"===J?G.parameters[J]=x.textures[G.parameters[J]]:"shading"===J?G.parameters[J]="flat"===G.parameters[J]?THREE.FlatShading:THREE.SmoothShading:"side"===J?G.parameters[J]="double"==G.parameters[J]?THREE.DoubleSide:"back"==G.parameters[J]?THREE.BackSide:THREE.FrontSide:"blending"===J?G.parameters[J]=G.parameters[J]in THREE?THREE[G.parameters[J]]:
+THREE.NormalBlending:"combine"===J?G.parameters[J]=G.parameters[J]in THREE?THREE[G.parameters[J]]:THREE.MultiplyOperation:"vertexColors"===J?"face"==G.parameters[J]?G.parameters[J]=THREE.FaceColors:G.parameters[J]&&(G.parameters[J]=THREE.VertexColors):"wrapRGB"===J&&(E=G.parameters[J],G.parameters[J]=new THREE.Vector3(E[0],E[1],E[2]));void 0!==G.parameters.opacity&&1>G.parameters.opacity&&(G.parameters.transparent=!0);G.parameters.normalMap?(E=THREE.ShaderLib.normalmap,D=THREE.UniformsUtils.clone(E.uniforms),
+q=G.parameters.color,A=G.parameters.specular,s=G.parameters.ambient,I=G.parameters.shininess,D.tNormal.value=x.textures[G.parameters.normalMap],G.parameters.normalScale&&D.uNormalScale.value.set(G.parameters.normalScale[0],G.parameters.normalScale[1]),G.parameters.map&&(D.tDiffuse.value=G.parameters.map,D.enableDiffuse.value=!0),G.parameters.envMap&&(D.tCube.value=G.parameters.envMap,D.enableReflection.value=!0,D.uReflectivity.value=G.parameters.reflectivity),G.parameters.lightMap&&(D.tAO.value=G.parameters.lightMap,
+D.enableAO.value=!0),G.parameters.specularMap&&(D.tSpecular.value=x.textures[G.parameters.specularMap],D.enableSpecular.value=!0),G.parameters.displacementMap&&(D.tDisplacement.value=x.textures[G.parameters.displacementMap],D.enableDisplacement.value=!0,D.uDisplacementBias.value=G.parameters.displacementBias,D.uDisplacementScale.value=G.parameters.displacementScale),D.uDiffuseColor.value.setHex(q),D.uSpecularColor.value.setHex(A),D.uAmbientColor.value.setHex(s),D.uShininess.value=I,G.parameters.opacity&&
+(D.uOpacity.value=G.parameters.opacity),t=new THREE.ShaderMaterial({fragmentShader:E.fragmentShader,vertexShader:E.vertexShader,uniforms:D,lights:!0,fog:!0})):t=new THREE[G.type](G.parameters);t.name=R;x.materials[R]=t}for(R in B.materials)if(G=B.materials[R],G.parameters.materials){J=[];for(q=0;q<G.parameters.materials.length;q++)J.push(x.materials[G.parameters.materials[q]]);x.materials[R].materials=J}e();x.cameras&&B.defaults.camera&&(x.currentCamera=x.cameras[B.defaults.camera]);x.fogs&&B.defaults.fog&&
+(x.scene.fog=x.fogs[B.defaults.fog]);m.callbackSync(x);k()}};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b){var c=new THREE.ImageLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)})},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};
 THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;
 a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);
 THREE.MaterialIdCount=0;THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=!1;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);
@@ -288,30 +289,30 @@ THREE.LOD.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector
 THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__objects=[];this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&-1===this.__objects.indexOf(a)){this.__objects.push(a);this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}for(b=0;b<a.children.length;b++)this.__addObject(a.children[b])};
 THREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){var b=this.__lights.indexOf(a);-1!==b&&this.__lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.__objects.indexOf(a),-1!==b&&(this.__objects.splice(b,1),this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),-1!==b&&this.__objectsAdded.splice(b,1)));for(b=0;b<a.children.length;b++)this.__removeObject(a.children[b])};
-THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Object3D.prototype.clone.call(this,a);null!==this.fog&&(a.fog=this.fog.clone());null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone());a.autoUpdate=this.autoUpdate;a.matrixAutoUpdate=this.matrixAutoUpdate;return a};THREE.Fog=function(a,b,c){this.name="";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name="";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};THREE.CanvasRenderer=function(a){function b(a,b,c){for(var d=0,e=E.length;d<e;d++){var f=E[d];Pa.copy(f.color);if(f instanceof THREE.DirectionalLight){var h=wa.getPositionFromMatrix(f.matrixWorld).normalize(),g=b.dot(h);0>=g||(g*=f.intensity,c.add(Pa.multiplyScalar(g)))}else f instanceof THREE.PointLight&&(h=wa.getPositionFromMatrix(f.matrixWorld),g=b.dot(wa.subVectors(h,a).normalize()),0>=g||(g*=0==f.distance?1:1-Math.min(a.distanceTo(h)/f.distance,1),0!=g&&(g*=f.intensity,c.add(Pa.multiplyScalar(g)))))}}
-function c(a,b,c,d){l(b);m(c);n(d);t(a.getStyle());x.stroke();ta.expandByScalar(2*b)}function d(a){s(a.getStyle());x.fill()}function e(a,b,c,e,f,h,g,j,i,k,m,l,n){if(!(n instanceof THREE.DataTexture||void 0===n.image||0==n.image.width)){if(!0===n.needsUpdate){var p=n.wrapS==THREE.RepeatWrapping,q=n.wrapT==THREE.RepeatWrapping;Ja[n.id]=x.createPattern(n.image,!0===p&&!0===q?"repeat":!0===p&&!1===q?"repeat-x":!1===p&&!0===q?"repeat-y":"no-repeat");n.needsUpdate=!1}void 0===Ja[n.id]?s("rgba(0,0,0,1)"):
-s(Ja[n.id]);var p=n.offset.x/n.repeat.x,q=n.offset.y/n.repeat.y,t=n.image.width*n.repeat.x,r=n.image.height*n.repeat.y,g=(g+p)*t,j=(1-j+q)*r,c=c-a,e=e-b,f=f-a,h=h-b,i=(i+p)*t-g,k=(1-k+q)*r-j,m=(m+p)*t-g,l=(1-l+q)*r-j,p=i*l-m*k;0===p?(void 0===ga[n.id]&&(b=document.createElement("canvas"),b.width=n.image.width,b.height=n.image.height,b=b.getContext("2d"),b.drawImage(n.image,0,0),ga[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data),b=ga[n.id],g=4*(Math.floor(g)+Math.floor(j)*n.image.width),
-V.setRGB(b[g]/255,b[g+1]/255,b[g+2]/255),d(V)):(p=1/p,n=(l*c-k*f)*p,k=(l*e-k*h)*p,c=(i*f-m*c)*p,e=(i*h-m*e)*p,a=a-n*g-c*j,g=b-k*g-e*j,x.save(),x.transform(n,k,c,e,a,g),x.fill(),x.restore())}}function f(a,b,c,d,e,f,h,g,j,i,k,m,l){var n,p;n=l.width-1;p=l.height-1;h*=n;g*=p;c-=a;d-=b;e-=a;f-=b;j=j*n-h;i=i*p-g;k=k*n-h;m=m*p-g;p=1/(j*m-k*i);n=(m*c-i*e)*p;i=(m*d-i*f)*p;c=(j*e-k*c)*p;d=(j*f-k*d)*p;a=a-n*h-c*g;b=b-i*h-d*g;x.save();x.transform(n,i,c,d,a,b);x.clip();x.drawImage(l,0,0);x.restore()}function h(a,
-b,c,d){xa[0]=255*a.r|0;xa[1]=255*a.g|0;xa[2]=255*a.b|0;xa[4]=255*b.r|0;xa[5]=255*b.g|0;xa[6]=255*b.b|0;xa[8]=255*c.r|0;xa[9]=255*c.g|0;xa[10]=255*c.b|0;xa[12]=255*d.r|0;xa[13]=255*d.g|0;xa[14]=255*d.b|0;j.putImageData(Wa,0,0);Ia.drawImage(Ra,0,0);return ya}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function i(a){v!==a&&(v=x.globalAlpha=a)}function k(a){A!==a&&(a===THREE.NormalBlending?x.globalCompositeOperation="source-over":
-a===THREE.AdditiveBlending?x.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(x.globalCompositeOperation="darker"),A=a)}function l(a){J!==a&&(J=x.lineWidth=a)}function m(a){ba!==a&&(ba=x.lineCap=a)}function n(a){qa!==a&&(qa=x.lineJoin=a)}function t(a){G!==a&&(G=x.strokeStyle=a)}function s(a){R!==a&&(R=x.fillStyle=a)}function p(a,b){if(ra!==a||N!==b)x.setLineDash([a,b]),ra=a,N=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var q=THREE.Math.smoothstep,a=a||{},r=this,u,w,E,C=
-new THREE.Projector,F=void 0!==a.canvas?a.canvas:document.createElement("canvas"),z,D,y,O,x=F.getContext("2d"),B=new THREE.Color(0),I=0,v=1,A=0,G=null,R=null,J=null,ba=null,qa=null,ra=null,N=0,M,Q,K,da;new THREE.RenderableVertex;new THREE.RenderableVertex;var za,Fa,ea,Ea,Z,fa,V=new THREE.Color,aa=new THREE.Color,P=new THREE.Color,T=new THREE.Color,ma=new THREE.Color,va=new THREE.Color,ja=new THREE.Color,Pa=new THREE.Color,Ja={},ga={},Ha,Xa,Sa,Aa,hb,ib,tb,ub,vb,jb,Ka=new THREE.Box2,na=new THREE.Box2,
-ta=new THREE.Box2,kb=new THREE.Color,ua=new THREE.Color,ha=new THREE.Color,wa=new THREE.Vector3,Ra,j,Wa,xa,ya,Ia,Ta=16;Ra=document.createElement("canvas");Ra.width=Ra.height=2;j=Ra.getContext("2d");j.fillStyle="rgba(0,0,0,1)";j.fillRect(0,0,2,2);Wa=j.getImageData(0,0,2,2);xa=Wa.data;ya=document.createElement("canvas");ya.width=ya.height=Ta;Ia=ya.getContext("2d");Ia.translate(-Ta/2,-Ta/2);Ia.scale(Ta,Ta);Ta--;void 0===x.setLineDash&&(x.setLineDash=void 0!==x.mozDash?function(a){x.mozDash=null!==a[0]?
-a:null}:function(){});this.domElement=F;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){z=a*this.devicePixelRatio;D=b*this.devicePixelRatio;y=Math.floor(z/2);O=Math.floor(D/2);F.width=z;F.height=D;1!==this.devicePixelRatio&&!1!==
-c&&(F.style.width=a+"px",F.style.height=b+"px");Ka.set(new THREE.Vector2(-y,-O),new THREE.Vector2(y,O));na.set(new THREE.Vector2(-y,-O),new THREE.Vector2(y,O));v=1;A=0;qa=ba=J=R=G=null};this.setClearColor=function(a,b){B.set(a);I=void 0!==b?b:1;na.set(new THREE.Vector2(-y,-O),new THREE.Vector2(y,O))};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};
-this.clear=function(){x.setTransform(1,0,0,-1,y,O);!1===na.empty()&&(na.intersect(Ka),na.expandByScalar(2),1>I&&x.clearRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0),0<I&&(k(THREE.NormalBlending),i(1),s("rgba("+Math.floor(255*B.r)+","+Math.floor(255*B.g)+","+Math.floor(255*B.b)+","+I+")"),x.fillRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0)),na.makeEmpty())};this.render=function(a,j){if(!1===j instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
-else{!0===this.autoClear&&this.clear();x.setTransform(1,0,0,-1,y,O);r.info.render.vertices=0;r.info.render.faces=0;u=C.projectScene(a,j,this.sortObjects,this.sortElements);w=u.elements;E=u.lights;M=j;kb.setRGB(0,0,0);ua.setRGB(0,0,0);ha.setRGB(0,0,0);for(var D=0,G=E.length;D<G;D++){var z=E[D],F=z.color;z instanceof THREE.AmbientLight?kb.add(F):z instanceof THREE.DirectionalLight?ua.add(F):z instanceof THREE.PointLight&&ha.add(F)}D=0;for(G=w.length;D<G;D++){var v=w[D],A=v.material;if(!(void 0===A||
-!1===A.visible)){ta.makeEmpty();if(v instanceof THREE.RenderableParticle){Q=v;Q.x*=y;Q.y*=O;var z=Q,F=v,J=A;i(J.opacity);k(J.blending);var N=A=v=void 0,B=void 0,I=void 0,R=void 0,ba=void 0;J instanceof THREE.ParticleBasicMaterial?null===J.map?(N=F.object.scale.x,B=F.object.scale.y,N*=F.scale.x*y,B*=F.scale.y*O,ta.min.set(z.x-N,z.y-B),ta.max.set(z.x+N,z.y+B),!1===Ka.isIntersectionBox(ta)?ta.makeEmpty():(s(J.color.getStyle()),x.save(),x.translate(z.x,z.y),x.rotate(-F.rotation),x.scale(N,B),x.fillRect(-1,
--1,2,2),x.restore())):(I=J.map.image,R=I.width>>1,ba=I.height>>1,N=F.scale.x*y,B=F.scale.y*O,v=N*R,A=B*ba,ta.min.set(z.x-v,z.y-A),ta.max.set(z.x+v,z.y+A),!1===Ka.isIntersectionBox(ta)?ta.makeEmpty():(x.save(),x.translate(z.x,z.y),x.rotate(-F.rotation),x.scale(N,-B),x.translate(-R,-ba),x.drawImage(I,0,0),x.restore())):J instanceof THREE.ParticleCanvasMaterial&&(v=F.scale.x*y,A=F.scale.y*O,ta.min.set(z.x-v,z.y-A),ta.max.set(z.x+v,z.y+A),!1===Ka.isIntersectionBox(ta)?ta.makeEmpty():(t(J.color.getStyle()),
-s(J.color.getStyle()),x.save(),x.translate(z.x,z.y),x.rotate(-F.rotation),x.scale(v,A),J.program(x),x.restore()))}else if(v instanceof THREE.RenderableLine){if(Q=v.v1,K=v.v2,Q.positionScreen.x*=y,Q.positionScreen.y*=O,K.positionScreen.x*=y,K.positionScreen.y*=O,ta.setFromPoints([Q.positionScreen,K.positionScreen]),!0===Ka.isIntersectionBox(ta))if(z=Q,F=K,J=v,v=A,i(v.opacity),k(v.blending),x.beginPath(),x.moveTo(z.positionScreen.x,z.positionScreen.y),x.lineTo(F.positionScreen.x,F.positionScreen.y),
-v instanceof THREE.LineBasicMaterial){l(v.linewidth);m(v.linecap);n(v.linejoin);if(v.vertexColors!==THREE.VertexColors)t(v.color.getStyle());else if(A=J.vertexColors[0].getStyle(),J=J.vertexColors[1].getStyle(),A===J)t(A);else{try{var ga=x.createLinearGradient(z.positionScreen.x,z.positionScreen.y,F.positionScreen.x,F.positionScreen.y);ga.addColorStop(0,A);ga.addColorStop(1,J)}catch(qa){ga=A}t(ga)}x.stroke();ta.expandByScalar(2*v.linewidth)}else v instanceof THREE.LineDashedMaterial&&(l(v.linewidth),
-m(v.linecap),n(v.linejoin),t(v.color.getStyle()),p(v.dashSize,v.gapSize),x.stroke(),ta.expandByScalar(2*v.linewidth),p(null,null))}else if(v instanceof THREE.RenderableFace3){Q=v.v1;K=v.v2;da=v.v3;if(-1>Q.positionScreen.z||1<Q.positionScreen.z)continue;if(-1>K.positionScreen.z||1<K.positionScreen.z)continue;if(-1>da.positionScreen.z||1<da.positionScreen.z)continue;Q.positionScreen.x*=y;Q.positionScreen.y*=O;K.positionScreen.x*=y;K.positionScreen.y*=O;da.positionScreen.x*=y;da.positionScreen.y*=O;
-0<A.overdraw&&(g(Q.positionScreen,K.positionScreen,A.overdraw),g(K.positionScreen,da.positionScreen,A.overdraw),g(da.positionScreen,Q.positionScreen,A.overdraw));ta.setFromPoints([Q.positionScreen,K.positionScreen,da.positionScreen]);if(!0===Ka.isIntersectionBox(ta)){z=Q;F=K;J=da;r.info.render.vertices+=3;r.info.render.faces++;i(A.opacity);k(A.blending);za=z.positionScreen.x;Fa=z.positionScreen.y;ea=F.positionScreen.x;Ea=F.positionScreen.y;Z=J.positionScreen.x;fa=J.positionScreen.y;var N=za,B=Fa,
-I=ea,R=Ea,ba=Z,ra=fa;x.beginPath();x.moveTo(N,B);x.lineTo(I,R);x.lineTo(ba,ra);x.closePath();(A instanceof THREE.MeshLambertMaterial||A instanceof THREE.MeshPhongMaterial)&&null===A.map?(va.copy(A.color),ja.copy(A.emissive),A.vertexColors===THREE.FaceColors&&va.multiply(v.color),!1===A.wireframe&&A.shading==THREE.SmoothShading&&3==v.vertexNormalsLength?(aa.copy(kb),P.copy(kb),T.copy(kb),b(v.v1.positionWorld,v.vertexNormalsModel[0],aa),b(v.v2.positionWorld,v.vertexNormalsModel[1],P),b(v.v3.positionWorld,
-v.vertexNormalsModel[2],T),aa.multiply(va).add(ja),P.multiply(va).add(ja),T.multiply(va).add(ja),ma.addColors(P,T).multiplyScalar(0.5),Sa=h(aa,P,T,ma),f(za,Fa,ea,Ea,Z,fa,0,0,1,0,0,1,Sa)):(V.copy(kb),b(v.centroidModel,v.normalModel,V),V.multiply(va).add(ja),!0===A.wireframe?c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V))):A instanceof THREE.MeshBasicMaterial||A instanceof THREE.MeshLambertMaterial||A instanceof THREE.MeshPhongMaterial?null!==A.map?A.map.mapping instanceof THREE.UVMapping&&
-(Aa=v.uvs[0],e(za,Fa,ea,Ea,Z,fa,Aa[0].x,Aa[0].y,Aa[1].x,Aa[1].y,Aa[2].x,Aa[2].y,A.map)):null!==A.envMap?A.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(wa.copy(v.vertexNormalsModelView[0]),hb=0.5*wa.x+0.5,ib=0.5*wa.y+0.5,wa.copy(v.vertexNormalsModelView[1]),tb=0.5*wa.x+0.5,ub=0.5*wa.y+0.5,wa.copy(v.vertexNormalsModelView[2]),vb=0.5*wa.x+0.5,jb=0.5*wa.y+0.5,e(za,Fa,ea,Ea,Z,fa,hb,ib,tb,ub,vb,jb,A.envMap)):(V.copy(A.color),A.vertexColors===THREE.FaceColors&&V.multiply(v.color),!0===A.wireframe?
-c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V)):A instanceof THREE.MeshDepthMaterial?(Ha=M.near,Xa=M.far,aa.r=aa.g=aa.b=1-q(z.positionScreen.z*z.positionScreen.w,Ha,Xa),P.r=P.g=P.b=1-q(F.positionScreen.z*F.positionScreen.w,Ha,Xa),T.r=T.g=T.b=1-q(J.positionScreen.z*J.positionScreen.w,Ha,Xa),ma.addColors(P,T).multiplyScalar(0.5),Sa=h(aa,P,T,ma),f(za,Fa,ea,Ea,Z,fa,0,0,1,0,0,1,Sa)):A instanceof THREE.MeshNormalMaterial&&(z=void 0,A.shading==THREE.FlatShading?(z=v.normalModelView,
-V.setRGB(z.x,z.y,z.z).multiplyScalar(0.5).addScalar(0.5),!0===A.wireframe?c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V)):A.shading==THREE.SmoothShading&&(z=v.vertexNormalsModelView[0],aa.setRGB(z.x,z.y,z.z).multiplyScalar(0.5).addScalar(0.5),z=v.vertexNormalsModelView[1],P.setRGB(z.x,z.y,z.z).multiplyScalar(0.5).addScalar(0.5),z=v.vertexNormalsModelView[2],T.setRGB(z.x,z.y,z.z).multiplyScalar(0.5).addScalar(0.5),ma.addColors(P,T).multiplyScalar(0.5),Sa=h(aa,P,T,ma),f(za,Fa,
-ea,Ea,Z,fa,0,0,1,0,0,1,Sa)))}}na.union(ta)}}x.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
+THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Object3D.prototype.clone.call(this,a);null!==this.fog&&(a.fog=this.fog.clone());null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone());a.autoUpdate=this.autoUpdate;a.matrixAutoUpdate=this.matrixAutoUpdate;return a};THREE.Fog=function(a,b,c){this.name="";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name="";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};THREE.CanvasRenderer=function(a){function b(a,b,c){for(var d=0,e=v.length;d<e;d++){var f=v[d];Pa.copy(f.color);if(f instanceof THREE.DirectionalLight){var h=wa.getPositionFromMatrix(f.matrixWorld).normalize(),g=b.dot(h);0>=g||(g*=f.intensity,c.add(Pa.multiplyScalar(g)))}else f instanceof THREE.PointLight&&(h=wa.getPositionFromMatrix(f.matrixWorld),g=b.dot(wa.subVectors(h,a).normalize()),0>=g||(g*=0==f.distance?1:1-Math.min(a.distanceTo(h)/f.distance,1),0!=g&&(g*=f.intensity,c.add(Pa.multiplyScalar(g)))))}}
+function c(a,b,c,d){l(b);m(c);n(d);r(a.getStyle());B.stroke();ta.expandByScalar(2*b)}function d(a){t(a.getStyle());B.fill()}function e(a,b,c,e,f,h,g,j,i,k,m,l,n){if(!(n instanceof THREE.DataTexture||void 0===n.image||0==n.image.width)){if(!0===n.needsUpdate){var p=n.wrapS==THREE.RepeatWrapping,r=n.wrapT==THREE.RepeatWrapping;Ja[n.id]=B.createPattern(n.image,!0===p&&!0===r?"repeat":!0===p&&!1===r?"repeat-x":!1===p&&!0===r?"repeat-y":"no-repeat");n.needsUpdate=!1}void 0===Ja[n.id]?t("rgba(0,0,0,1)"):
+t(Ja[n.id]);var p=n.offset.x/n.repeat.x,r=n.offset.y/n.repeat.y,s=n.image.width*n.repeat.x,q=n.image.height*n.repeat.y,g=(g+p)*s,j=(1-j+r)*q,c=c-a,e=e-b,f=f-a,h=h-b,i=(i+p)*s-g,k=(1-k+r)*q-j,m=(m+p)*s-g,l=(1-l+r)*q-j,p=i*l-m*k;0===p?(void 0===ga[n.id]&&(b=document.createElement("canvas"),b.width=n.image.width,b.height=n.image.height,b=b.getContext("2d"),b.drawImage(n.image,0,0),ga[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data),b=ga[n.id],g=4*(Math.floor(g)+Math.floor(j)*n.image.width),
+V.setRGB(b[g]/255,b[g+1]/255,b[g+2]/255),d(V)):(p=1/p,n=(l*c-k*f)*p,k=(l*e-k*h)*p,c=(i*f-m*c)*p,e=(i*h-m*e)*p,a=a-n*g-c*j,g=b-k*g-e*j,B.save(),B.transform(n,k,c,e,a,g),B.fill(),B.restore())}}function f(a,b,c,d,e,f,h,g,j,i,k,m,l){var n,p;n=l.width-1;p=l.height-1;h*=n;g*=p;c-=a;d-=b;e-=a;f-=b;j=j*n-h;i=i*p-g;k=k*n-h;m=m*p-g;p=1/(j*m-k*i);n=(m*c-i*e)*p;i=(m*d-i*f)*p;c=(j*e-k*c)*p;d=(j*f-k*d)*p;a=a-n*h-c*g;b=b-i*h-d*g;B.save();B.transform(n,i,c,d,a,b);B.clip();B.drawImage(l,0,0);B.restore()}function h(a,
+b,c,d){xa[0]=255*a.r|0;xa[1]=255*a.g|0;xa[2]=255*a.b|0;xa[4]=255*b.r|0;xa[5]=255*b.g|0;xa[6]=255*b.b|0;xa[8]=255*c.r|0;xa[9]=255*c.g|0;xa[10]=255*c.b|0;xa[12]=255*d.r|0;xa[13]=255*d.g|0;xa[14]=255*d.b|0;j.putImageData(Wa,0,0);Ia.drawImage(Ra,0,0);return ya}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function i(a){D!==a&&(D=B.globalAlpha=a)}function k(a){A!==a&&(a===THREE.NormalBlending?B.globalCompositeOperation="source-over":
+a===THREE.AdditiveBlending?B.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(B.globalCompositeOperation="darker"),A=a)}function l(a){J!==a&&(J=B.lineWidth=a)}function m(a){ba!==a&&(ba=B.lineCap=a)}function n(a){qa!==a&&(qa=B.lineJoin=a)}function r(a){G!==a&&(G=B.strokeStyle=a)}function t(a){R!==a&&(R=B.fillStyle=a)}function p(a,b){if(ra!==a||N!==b)B.setLineDash([a,b]),ra=a,N=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var s=THREE.Math.smoothstep,a=a||{},q=this,u,w,v,C=
+new THREE.Projector,z=void 0!==a.canvas?a.canvas:document.createElement("canvas"),y,F,x,O,B=z.getContext("2d"),E=new THREE.Color(0),I=0,D=1,A=0,G=null,R=null,J=null,ba=null,qa=null,ra=null,N=0,M,Q,K,da;new THREE.RenderableVertex;new THREE.RenderableVertex;var za,Fa,ea,Ea,Z,fa,V=new THREE.Color,aa=new THREE.Color,P=new THREE.Color,T=new THREE.Color,ma=new THREE.Color,va=new THREE.Color,ja=new THREE.Color,Pa=new THREE.Color,Ja={},ga={},Ha,Xa,Sa,Aa,hb,ib,tb,ub,vb,jb,Ka=new THREE.Box2,na=new THREE.Box2,
+ta=new THREE.Box2,kb=new THREE.Color,ua=new THREE.Color,ha=new THREE.Color,wa=new THREE.Vector3,Ra,j,Wa,xa,ya,Ia,Ta=16;Ra=document.createElement("canvas");Ra.width=Ra.height=2;j=Ra.getContext("2d");j.fillStyle="rgba(0,0,0,1)";j.fillRect(0,0,2,2);Wa=j.getImageData(0,0,2,2);xa=Wa.data;ya=document.createElement("canvas");ya.width=ya.height=Ta;Ia=ya.getContext("2d");Ia.translate(-Ta/2,-Ta/2);Ia.scale(Ta,Ta);Ta--;void 0===B.setLineDash&&(B.setLineDash=void 0!==B.mozDash?function(a){B.mozDash=null!==a[0]?
+a:null}:function(){});this.domElement=z;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){y=a*this.devicePixelRatio;F=b*this.devicePixelRatio;x=Math.floor(y/2);O=Math.floor(F/2);z.width=y;z.height=F;1!==this.devicePixelRatio&&!1!==
+c&&(z.style.width=a+"px",z.style.height=b+"px");Ka.set(new THREE.Vector2(-x,-O),new THREE.Vector2(x,O));na.set(new THREE.Vector2(-x,-O),new THREE.Vector2(x,O));D=1;A=0;qa=ba=J=R=G=null};this.setClearColor=function(a,b){E.set(a);I=void 0!==b?b:1;na.set(new THREE.Vector2(-x,-O),new THREE.Vector2(x,O))};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};
+this.clear=function(){B.setTransform(1,0,0,-1,x,O);!1===na.empty()&&(na.intersect(Ka),na.expandByScalar(2),1>I&&B.clearRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0),0<I&&(k(THREE.NormalBlending),i(1),t("rgba("+Math.floor(255*E.r)+","+Math.floor(255*E.g)+","+Math.floor(255*E.b)+","+I+")"),B.fillRect(na.min.x|0,na.min.y|0,na.max.x-na.min.x|0,na.max.y-na.min.y|0)),na.makeEmpty())};this.render=function(a,j){if(!1===j instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
+else{!0===this.autoClear&&this.clear();B.setTransform(1,0,0,-1,x,O);q.info.render.vertices=0;q.info.render.faces=0;u=C.projectScene(a,j,this.sortObjects,this.sortElements);w=u.elements;v=u.lights;M=j;kb.setRGB(0,0,0);ua.setRGB(0,0,0);ha.setRGB(0,0,0);for(var F=0,G=v.length;F<G;F++){var y=v[F],D=y.color;y instanceof THREE.AmbientLight?kb.add(D):y instanceof THREE.DirectionalLight?ua.add(D):y instanceof THREE.PointLight&&ha.add(D)}F=0;for(G=w.length;F<G;F++){var z=w[F],A=z.material;if(!(void 0===A||
+!1===A.visible)){ta.makeEmpty();if(z instanceof THREE.RenderableParticle){Q=z;Q.x*=x;Q.y*=O;var y=Q,D=z,J=A;i(J.opacity);k(J.blending);var N=A=z=void 0,E=void 0,I=void 0,R=void 0,ba=void 0;J instanceof THREE.ParticleBasicMaterial?null===J.map?(N=D.object.scale.x,E=D.object.scale.y,N*=D.scale.x*x,E*=D.scale.y*O,ta.min.set(y.x-N,y.y-E),ta.max.set(y.x+N,y.y+E),!1===Ka.isIntersectionBox(ta)?ta.makeEmpty():(t(J.color.getStyle()),B.save(),B.translate(y.x,y.y),B.rotate(-D.rotation),B.scale(N,E),B.fillRect(-1,
+-1,2,2),B.restore())):(I=J.map.image,R=I.width>>1,ba=I.height>>1,N=D.scale.x*x,E=D.scale.y*O,z=N*R,A=E*ba,ta.min.set(y.x-z,y.y-A),ta.max.set(y.x+z,y.y+A),!1===Ka.isIntersectionBox(ta)?ta.makeEmpty():(B.save(),B.translate(y.x,y.y),B.rotate(-D.rotation),B.scale(N,-E),B.translate(-R,-ba),B.drawImage(I,0,0),B.restore())):J instanceof THREE.ParticleCanvasMaterial&&(z=D.scale.x*x,A=D.scale.y*O,ta.min.set(y.x-z,y.y-A),ta.max.set(y.x+z,y.y+A),!1===Ka.isIntersectionBox(ta)?ta.makeEmpty():(r(J.color.getStyle()),
+t(J.color.getStyle()),B.save(),B.translate(y.x,y.y),B.rotate(-D.rotation),B.scale(z,A),J.program(B),B.restore()))}else if(z instanceof THREE.RenderableLine){if(Q=z.v1,K=z.v2,Q.positionScreen.x*=x,Q.positionScreen.y*=O,K.positionScreen.x*=x,K.positionScreen.y*=O,ta.setFromPoints([Q.positionScreen,K.positionScreen]),!0===Ka.isIntersectionBox(ta))if(y=Q,D=K,J=z,z=A,i(z.opacity),k(z.blending),B.beginPath(),B.moveTo(y.positionScreen.x,y.positionScreen.y),B.lineTo(D.positionScreen.x,D.positionScreen.y),
+z instanceof THREE.LineBasicMaterial){l(z.linewidth);m(z.linecap);n(z.linejoin);if(z.vertexColors!==THREE.VertexColors)r(z.color.getStyle());else if(A=J.vertexColors[0].getStyle(),J=J.vertexColors[1].getStyle(),A===J)r(A);else{try{var ga=B.createLinearGradient(y.positionScreen.x,y.positionScreen.y,D.positionScreen.x,D.positionScreen.y);ga.addColorStop(0,A);ga.addColorStop(1,J)}catch(qa){ga=A}r(ga)}B.stroke();ta.expandByScalar(2*z.linewidth)}else z instanceof THREE.LineDashedMaterial&&(l(z.linewidth),
+m(z.linecap),n(z.linejoin),r(z.color.getStyle()),p(z.dashSize,z.gapSize),B.stroke(),ta.expandByScalar(2*z.linewidth),p(null,null))}else if(z instanceof THREE.RenderableFace3){Q=z.v1;K=z.v2;da=z.v3;if(-1>Q.positionScreen.z||1<Q.positionScreen.z)continue;if(-1>K.positionScreen.z||1<K.positionScreen.z)continue;if(-1>da.positionScreen.z||1<da.positionScreen.z)continue;Q.positionScreen.x*=x;Q.positionScreen.y*=O;K.positionScreen.x*=x;K.positionScreen.y*=O;da.positionScreen.x*=x;da.positionScreen.y*=O;
+0<A.overdraw&&(g(Q.positionScreen,K.positionScreen,A.overdraw),g(K.positionScreen,da.positionScreen,A.overdraw),g(da.positionScreen,Q.positionScreen,A.overdraw));ta.setFromPoints([Q.positionScreen,K.positionScreen,da.positionScreen]);if(!0===Ka.isIntersectionBox(ta)){y=Q;D=K;J=da;q.info.render.vertices+=3;q.info.render.faces++;i(A.opacity);k(A.blending);za=y.positionScreen.x;Fa=y.positionScreen.y;ea=D.positionScreen.x;Ea=D.positionScreen.y;Z=J.positionScreen.x;fa=J.positionScreen.y;var N=za,E=Fa,
+I=ea,R=Ea,ba=Z,ra=fa;B.beginPath();B.moveTo(N,E);B.lineTo(I,R);B.lineTo(ba,ra);B.closePath();(A instanceof THREE.MeshLambertMaterial||A instanceof THREE.MeshPhongMaterial)&&null===A.map?(va.copy(A.color),ja.copy(A.emissive),A.vertexColors===THREE.FaceColors&&va.multiply(z.color),!1===A.wireframe&&A.shading==THREE.SmoothShading&&3==z.vertexNormalsLength?(aa.copy(kb),P.copy(kb),T.copy(kb),b(z.v1.positionWorld,z.vertexNormalsModel[0],aa),b(z.v2.positionWorld,z.vertexNormalsModel[1],P),b(z.v3.positionWorld,
+z.vertexNormalsModel[2],T),aa.multiply(va).add(ja),P.multiply(va).add(ja),T.multiply(va).add(ja),ma.addColors(P,T).multiplyScalar(0.5),Sa=h(aa,P,T,ma),f(za,Fa,ea,Ea,Z,fa,0,0,1,0,0,1,Sa)):(V.copy(kb),b(z.centroidModel,z.normalModel,V),V.multiply(va).add(ja),!0===A.wireframe?c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V))):A instanceof THREE.MeshBasicMaterial||A instanceof THREE.MeshLambertMaterial||A instanceof THREE.MeshPhongMaterial?null!==A.map?A.map.mapping instanceof THREE.UVMapping&&
+(Aa=z.uvs[0],e(za,Fa,ea,Ea,Z,fa,Aa[0].x,Aa[0].y,Aa[1].x,Aa[1].y,Aa[2].x,Aa[2].y,A.map)):null!==A.envMap?A.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(wa.copy(z.vertexNormalsModelView[0]),hb=0.5*wa.x+0.5,ib=0.5*wa.y+0.5,wa.copy(z.vertexNormalsModelView[1]),tb=0.5*wa.x+0.5,ub=0.5*wa.y+0.5,wa.copy(z.vertexNormalsModelView[2]),vb=0.5*wa.x+0.5,jb=0.5*wa.y+0.5,e(za,Fa,ea,Ea,Z,fa,hb,ib,tb,ub,vb,jb,A.envMap)):(V.copy(A.color),A.vertexColors===THREE.FaceColors&&V.multiply(z.color),!0===A.wireframe?
+c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V)):A instanceof THREE.MeshDepthMaterial?(Ha=M.near,Xa=M.far,aa.r=aa.g=aa.b=1-s(y.positionScreen.z*y.positionScreen.w,Ha,Xa),P.r=P.g=P.b=1-s(D.positionScreen.z*D.positionScreen.w,Ha,Xa),T.r=T.g=T.b=1-s(J.positionScreen.z*J.positionScreen.w,Ha,Xa),ma.addColors(P,T).multiplyScalar(0.5),Sa=h(aa,P,T,ma),f(za,Fa,ea,Ea,Z,fa,0,0,1,0,0,1,Sa)):A instanceof THREE.MeshNormalMaterial&&(y=void 0,A.shading==THREE.FlatShading?(y=z.normalModelView,
+V.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),!0===A.wireframe?c(V,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):d(V)):A.shading==THREE.SmoothShading&&(y=z.vertexNormalsModelView[0],aa.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),y=z.vertexNormalsModelView[1],P.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),y=z.vertexNormalsModelView[2],T.setRGB(y.x,y.y,y.z).multiplyScalar(0.5).addScalar(0.5),ma.addColors(P,T).multiplyScalar(0.5),Sa=h(aa,P,T,ma),f(za,Fa,
+ea,Ea,Z,fa,0,0,1,0,0,1,Sa)))}}na.union(ta)}}B.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
 envmap_pars_fragment:"#ifdef USE_ENVMAP\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nuniform bool useRefract;\nuniform float refractionRatio;\n#else\nvarying vec3 vReflect;\n#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec3 reflectVec;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\nif ( useRefract ) {\nreflectVec = refract( cameraToVertex, normal, refractionRatio );\n} else { \nreflectVec = reflect( cameraToVertex, normal );\n}\n#else\nreflectVec = vReflect;\n#endif\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n} else if ( combine == 2 ) {\ngl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n} else {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n}\n#endif",
 envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
 envmap_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\nworldNormal = normalize( worldNormal );\nvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\nif ( useRefract ) {\nvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n} else {\nvReflect = reflect( cameraToVertex, worldNormal );\n}\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",
@@ -364,26 +365,26 @@ cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexSha
 depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask  = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var e in d.attributes){var f=d.attributes[e];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var h=1;"v2"===f.type?h=2:"v3"===f.type?h=3:"v4"===f.type?h=4:"c"===f.type&&(h=3);f.size=h;f.array=new Float32Array(c*h);f.buffer=j.createBuffer();f.buffer.belongsToAttribute=e;f.needsUpdate=!0}a.__webglCustomAttributesList.push(f)}}}
 function c(a,b){var c=b.geometry,h=a.faces3,g=3*h.length,i=1*h.length,k=3*h.length,h=d(b,a),m=f(h),l=e(h),n=h.vertexColors?h.vertexColors:!1;a.__vertexArray=new Float32Array(3*g);l&&(a.__normalArray=new Float32Array(3*g));c.hasTangents&&(a.__tangentArray=new Float32Array(4*g));n&&(a.__colorArray=new Float32Array(3*g));m&&(0<c.faceVertexUvs.length&&(a.__uvArray=new Float32Array(2*g)),1<c.faceVertexUvs.length&&(a.__uv2Array=new Float32Array(2*g)));b.geometry.skinWeights.length&&b.geometry.skinIndices.length&&
 (a.__skinIndexArray=new Float32Array(4*g),a.__skinWeightArray=new Float32Array(4*g));a.__faceArray=new Uint16Array(3*i);a.__lineArray=new Uint16Array(2*k);if(a.numMorphTargets){a.__morphTargetsArrays=[];c=0;for(m=a.numMorphTargets;c<m;c++)a.__morphTargetsArrays.push(new Float32Array(3*g))}if(a.numMorphNormals){a.__morphNormalsArrays=[];c=0;for(m=a.numMorphNormals;c<m;c++)a.__morphNormalsArrays.push(new Float32Array(3*g))}a.__webglFaceCount=3*i;a.__webglLineCount=2*k;if(h.attributes){void 0===a.__webglCustomAttributesList&&
-(a.__webglCustomAttributesList=[]);for(var p in h.attributes){var i=h.attributes[p],k={},q;for(q in i)k[q]=i[q];if(!k.__webglInitialized||k.createUniqueBuffers)k.__webglInitialized=!0,c=1,"v2"===k.type?c=2:"v3"===k.type?c=3:"v4"===k.type?c=4:"c"===k.type&&(c=3),k.size=c,k.array=new Float32Array(g*c),k.buffer=j.createBuffer(),k.buffer.belongsToAttribute=p,i.needsUpdate=!0,k.__original=i;a.__webglCustomAttributesList.push(k)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?
+(a.__webglCustomAttributesList=[]);for(var p in h.attributes){var i=h.attributes[p],k={},r;for(r in i)k[r]=i[r];if(!k.__webglInitialized||k.createUniqueBuffers)k.__webglInitialized=!0,c=1,"v2"===k.type?c=2:"v3"===k.type?c=3:"v4"===k.type?c=4:"c"===k.type&&(c=3),k.size=c,k.array=new Float32Array(g*c),k.buffer=j.createBuffer(),k.buffer.belongsToAttribute=p,i.needsUpdate=!0,k.__original=i;a.__webglCustomAttributesList.push(k)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?
 a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function h(a){Ka[a]||(j.enableVertexAttribArray(a),Ka[a]=!0)}function g(){for(var a in Ka)Ka[a]&&(j.disableVertexAttribArray(a),Ka[a]=
 !1)}function i(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function k(a,b){return b[0]-a[0]}function l(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)fa=Fa=null,Ea=Z=T=P=ga=Ja=ma=-1,wa=!0,a[d].render(b,c,vb,jb),fa=Fa=null,Ea=Z=T=P=ga=Ja=ma=-1,wa=!0}function m(a,b,c,d,e,f,h,g){var j,i,k,m;b?(i=a.length-1,m=b=-1):(i=0,b=a.length,m=1);for(var l=i;l!==b;l+=m)if(j=a[l],j.render){i=j.object;k=j.buffer;if(g)j=g;else{j=j[c];if(!j)continue;h&&K.setBlending(j.blending,j.blendEquation,j.blendSrc,j.blendDst);
-K.setDepthTest(j.depthTest);K.setDepthWrite(j.depthWrite);y(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits)}K.setMaterialFaces(j);k instanceof THREE.BufferGeometry?K.renderBufferDirect(d,e,f,j,k,i):K.renderBuffer(d,e,f,j,k,i)}}function n(a,b,c,d,e,f,h){for(var g,j,i=0,k=a.length;i<k;i++)if(g=a[i],j=g.object,j.visible){if(h)g=h;else{g=g[b];if(!g)continue;f&&K.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);K.setDepthTest(g.depthTest);K.setDepthWrite(g.depthWrite);y(g.polygonOffset,
-g.polygonOffsetFactor,g.polygonOffsetUnits)}K.renderImmediateObject(c,d,e,g,j)}}function t(a,d){var e,f,h,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,void 0!==a.geometry&&void 0===a.geometry.__webglInit&&(a.geometry.__webglInit=!0,a.geometry.addEventListener("dispose",Jb)),f=a.geometry,void 0!==f))if(f instanceof THREE.BufferGeometry){var i,k;for(i in f.attributes)k="index"===i?j.ELEMENT_ARRAY_BUFFER:j.ARRAY_BUFFER,g=f.attributes[i],
-void 0===g.numItems&&(g.numItems=g.array.length),g.buffer=j.createBuffer(),j.bindBuffer(k,g.buffer),j.bufferData(k,g.array,j.STATIC_DRAW)}else if(a instanceof THREE.Mesh){h=a.material;if(void 0===f.geometryGroups){i=f;var m,l,n;k={};var p=i.morphTargets.length,q=i.morphNormals.length,t=h instanceof THREE.MeshFaceMaterial;i.geometryGroups={};h=0;for(m=i.faces.length;h<m;h++)l=i.faces[h],l=t?l.materialIndex:0,void 0===k[l]&&(k[l]={hash:l,counter:0}),n=k[l].hash+"_"+k[l].counter,void 0===i.geometryGroups[n]&&
-(i.geometryGroups[n]={faces3:[],materialIndex:l,vertices:0,numMorphTargets:p,numMorphNormals:q}),65535<i.geometryGroups[n].vertices+3&&(k[l].counter+=1,n=k[l].hash+"_"+k[l].counter,void 0===i.geometryGroups[n]&&(i.geometryGroups[n]={faces3:[],materialIndex:l,vertices:0,numMorphTargets:p,numMorphNormals:q})),i.geometryGroups[n].faces3.push(h),i.geometryGroups[n].vertices+=3;i.geometryGroupsList=[];for(g in i.geometryGroups)i.geometryGroups[g].id=V++,i.geometryGroupsList.push(i.geometryGroups[g])}for(e in f.geometryGroups)if(g=
+K.setDepthTest(j.depthTest);K.setDepthWrite(j.depthWrite);x(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits)}K.setMaterialFaces(j);k instanceof THREE.BufferGeometry?K.renderBufferDirect(d,e,f,j,k,i):K.renderBuffer(d,e,f,j,k,i)}}function n(a,b,c,d,e,f,h){for(var g,j,i=0,k=a.length;i<k;i++)if(g=a[i],j=g.object,j.visible){if(h)g=h;else{g=g[b];if(!g)continue;f&&K.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);K.setDepthTest(g.depthTest);K.setDepthWrite(g.depthWrite);x(g.polygonOffset,
+g.polygonOffsetFactor,g.polygonOffsetUnits)}K.renderImmediateObject(c,d,e,g,j)}}function r(a,d){var e,f,h,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,void 0!==a.geometry&&void 0===a.geometry.__webglInit&&(a.geometry.__webglInit=!0,a.geometry.addEventListener("dispose",Jb)),f=a.geometry,void 0!==f))if(f instanceof THREE.BufferGeometry){var i,k;for(i in f.attributes)k="index"===i?j.ELEMENT_ARRAY_BUFFER:j.ARRAY_BUFFER,g=f.attributes[i],
+void 0===g.numItems&&(g.numItems=g.array.length),g.buffer=j.createBuffer(),j.bindBuffer(k,g.buffer),j.bufferData(k,g.array,j.STATIC_DRAW)}else if(a instanceof THREE.Mesh){h=a.material;if(void 0===f.geometryGroups){i=f;var m,l,n;k={};var p=i.morphTargets.length,r=i.morphNormals.length,s=h instanceof THREE.MeshFaceMaterial;i.geometryGroups={};h=0;for(m=i.faces.length;h<m;h++)l=i.faces[h],l=s?l.materialIndex:0,void 0===k[l]&&(k[l]={hash:l,counter:0}),n=k[l].hash+"_"+k[l].counter,void 0===i.geometryGroups[n]&&
+(i.geometryGroups[n]={faces3:[],materialIndex:l,vertices:0,numMorphTargets:p,numMorphNormals:r}),65535<i.geometryGroups[n].vertices+3&&(k[l].counter+=1,n=k[l].hash+"_"+k[l].counter,void 0===i.geometryGroups[n]&&(i.geometryGroups[n]={faces3:[],materialIndex:l,vertices:0,numMorphTargets:p,numMorphNormals:r})),i.geometryGroups[n].faces3.push(h),i.geometryGroups[n].vertices+=3;i.geometryGroupsList=[];for(g in i.geometryGroups)i.geometryGroups[g].id=V++,i.geometryGroupsList.push(i.geometryGroups[g])}for(e in f.geometryGroups)if(g=
 f.geometryGroups[e],!g.__webglVertexBuffer){i=g;i.__webglVertexBuffer=j.createBuffer();i.__webglNormalBuffer=j.createBuffer();i.__webglTangentBuffer=j.createBuffer();i.__webglColorBuffer=j.createBuffer();i.__webglUVBuffer=j.createBuffer();i.__webglUV2Buffer=j.createBuffer();i.__webglSkinIndicesBuffer=j.createBuffer();i.__webglSkinWeightsBuffer=j.createBuffer();i.__webglFaceBuffer=j.createBuffer();i.__webglLineBuffer=j.createBuffer();p=k=void 0;if(i.numMorphTargets){i.__webglMorphTargetsBuffers=[];
 k=0;for(p=i.numMorphTargets;k<p;k++)i.__webglMorphTargetsBuffers.push(j.createBuffer())}if(i.numMorphNormals){i.__webglMorphNormalsBuffers=[];k=0;for(p=i.numMorphNormals;k<p;k++)i.__webglMorphNormalsBuffers.push(j.createBuffer())}K.info.memory.geometries++;c(g,a);f.verticesNeedUpdate=!0;f.morphTargetsNeedUpdate=!0;f.elementsNeedUpdate=!0;f.uvsNeedUpdate=!0;f.normalsNeedUpdate=!0;f.tangentsNeedUpdate=!0;f.colorsNeedUpdate=!0}}else a instanceof THREE.Ribbon?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=
 j.createBuffer(),g.__webglColorBuffer=j.createBuffer(),g.__webglNormalBuffer=j.createBuffer(),K.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*i),g.__normalArray=new Float32Array(3*i),g.__webglVertexCount=i,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.normalsNeedUpdate=!0):a instanceof THREE.Line?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=j.createBuffer(),g.__webglColorBuffer=j.createBuffer(),g.__webglLineDistanceBuffer=
 j.createBuffer(),K.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*i),g.__lineDistanceArray=new Float32Array(1*i),g.__webglLineCount=i,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof THREE.ParticleSystem&&!f.__webglVertexBuffer&&(g=f,g.__webglVertexBuffer=j.createBuffer(),g.__webglColorBuffer=j.createBuffer(),K.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*
-i),g.__colorArray=new Float32Array(3*i),g.__sortArray=[],g.__webglParticleCount=i,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)s(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=f.geometryGroups[e],s(d.__webglObjects,g,a)}else a instanceof THREE.Ribbon||a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,s(d.__webglObjects,f,a)):
-a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?d.__webglObjectsImmediate.push({id:null,object:a,opaque:null,transparent:null,z:0}):a instanceof THREE.Sprite?d.__webglSprites.push(a):a instanceof THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function s(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function q(a){for(var b in a.attributes)a.attributes[b].needsUpdate=
-!1}function r(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Ribbon||a instanceof THREE.Line?u(b.__webglObjects,a):a instanceof THREE.Sprite?w(b.__webglSprites,a):a instanceof THREE.LensFlare?w(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&u(b.__webglObjectsImmediate,a);delete a.__webglActive}function u(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function w(a,b){for(var c=a.length-1;0<=c;c--)a[c]===
-b&&a.splice(c,1)}function E(a,b,c,d,e){aa=0;d.needsUpdate&&(d.program&&Ob(d),K.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(K.maxMorphTargets));var f=!1,g=d.program,h=g.uniforms,i=d.uniforms;g!==Fa&&(j.useProgram(g),Fa=g,f=!0);d.id!==Ea&&(Ea=d.id,f=!0);if(f||a!==fa)j.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),a!==fa&&(fa=a);if(d.skinning)if(Eb&&e.useVertexTexture){if(null!==h.boneTexture){var k=
-C();j.uniform1i(h.boneTexture,k);K.setTexture(e.boneTexture,k)}}else null!==h.boneGlobalMatrices&&j.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(i.fogColor.value=c.color,c instanceof THREE.Fog?(i.fogNear.value=c.near,i.fogFar.value=c.far):c instanceof THREE.FogExp2&&(i.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(wa){for(var m,l=k=0,n=0,p,q,t,r=Ra,s=r.directional.colors,u=r.directional.positions,
-w=r.point.colors,v=r.point.positions,y=r.point.distances,E=r.spot.colors,x=r.spot.positions,D=r.spot.distances,J=r.spot.directions,N=r.spot.anglesCos,O=r.spot.exponents,I=r.hemi.skyColors,V=r.hemi.groundColors,R=r.hemi.positions,M=0,T=0,ea=0,za=0,P=0,wc=0,X=0,W=0,Q=m=0,c=t=Q=0,f=b.length;c<f;c++)m=b[c],m.onlyShadow||(p=m.color,q=m.intensity,t=m.distance,m instanceof THREE.AmbientLight?m.visible&&(K.gammaInput?(k+=p.r*p.r,l+=p.g*p.g,n+=p.b*p.b):(k+=p.r,l+=p.g,n+=p.b)):m instanceof THREE.DirectionalLight?
-(P+=1,m.visible&&(ha.getPositionFromMatrix(m.matrixWorld),ua.getPositionFromMatrix(m.target.matrixWorld),ha.sub(ua),ha.normalize(),0===ha.x&&0===ha.y&&0===ha.z||(m=3*M,u[m]=ha.x,u[m+1]=ha.y,u[m+2]=ha.z,K.gammaInput?F(s,m,p,q*q):z(s,m,p,q),M+=1))):m instanceof THREE.PointLight?(wc+=1,m.visible&&(Q=3*T,K.gammaInput?F(w,Q,p,q*q):z(w,Q,p,q),ua.getPositionFromMatrix(m.matrixWorld),v[Q]=ua.x,v[Q+1]=ua.y,v[Q+2]=ua.z,y[T]=t,T+=1)):m instanceof THREE.SpotLight?(X+=1,m.visible&&(Q=3*ea,K.gammaInput?F(E,Q,p,
-q*q):z(E,Q,p,q),ua.getPositionFromMatrix(m.matrixWorld),x[Q]=ua.x,x[Q+1]=ua.y,x[Q+2]=ua.z,D[ea]=t,ha.copy(ua),ua.getPositionFromMatrix(m.target.matrixWorld),ha.sub(ua),ha.normalize(),J[Q]=ha.x,J[Q+1]=ha.y,J[Q+2]=ha.z,N[ea]=Math.cos(m.angle),O[ea]=m.exponent,ea+=1)):m instanceof THREE.HemisphereLight&&(W+=1,m.visible&&(ha.getPositionFromMatrix(m.matrixWorld),ha.normalize(),0===ha.x&&0===ha.y&&0===ha.z||(t=3*za,R[t]=ha.x,R[t+1]=ha.y,R[t+2]=ha.z,p=m.color,m=m.groundColor,K.gammaInput?(q*=q,F(I,t,p,q),
-F(V,t,m,q)):(z(I,t,p,q),z(V,t,m,q)),za+=1))));c=3*M;for(f=Math.max(s.length,3*P);c<f;c++)s[c]=0;c=3*T;for(f=Math.max(w.length,3*wc);c<f;c++)w[c]=0;c=3*ea;for(f=Math.max(E.length,3*X);c<f;c++)E[c]=0;c=3*za;for(f=Math.max(I.length,3*W);c<f;c++)I[c]=0;c=3*za;for(f=Math.max(V.length,3*W);c<f;c++)V[c]=0;r.directional.length=M;r.point.length=T;r.spot.length=ea;r.hemi.length=za;r.ambient[0]=k;r.ambient[1]=l;r.ambient[2]=n;wa=!1}c=Ra;i.ambientLightColor.value=c.ambient;i.directionalLightColor.value=c.directional.colors;
+i),g.__colorArray=new Float32Array(3*i),g.__sortArray=[],g.__webglParticleCount=i,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)t(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=f.geometryGroups[e],t(d.__webglObjects,g,a)}else a instanceof THREE.Ribbon||a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,t(d.__webglObjects,f,a)):
+a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?d.__webglObjectsImmediate.push({id:null,object:a,opaque:null,transparent:null,z:0}):a instanceof THREE.Sprite?d.__webglSprites.push(a):a instanceof THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function t(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function s(a){for(var b in a.attributes)a.attributes[b].needsUpdate=
+!1}function q(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Ribbon||a instanceof THREE.Line?u(b.__webglObjects,a):a instanceof THREE.Sprite?w(b.__webglSprites,a):a instanceof THREE.LensFlare?w(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&u(b.__webglObjectsImmediate,a);delete a.__webglActive}function u(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function w(a,b){for(var c=a.length-1;0<=c;c--)a[c]===
+b&&a.splice(c,1)}function v(a,b,c,d,e){aa=0;d.needsUpdate&&(d.program&&Ob(d),K.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(K.maxMorphTargets));var f=!1,g=d.program,h=g.uniforms,i=d.uniforms;g!==Fa&&(j.useProgram(g),Fa=g,f=!0);d.id!==Ea&&(Ea=d.id,f=!0);if(f||a!==fa)j.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),a!==fa&&(fa=a);if(d.skinning)if(Eb&&e.useVertexTexture){if(null!==h.boneTexture){var k=
+C();j.uniform1i(h.boneTexture,k);K.setTexture(e.boneTexture,k)}}else null!==h.boneGlobalMatrices&&j.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(i.fogColor.value=c.color,c instanceof THREE.Fog?(i.fogNear.value=c.near,i.fogFar.value=c.far):c instanceof THREE.FogExp2&&(i.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(wa){for(var m,l=k=0,n=0,p,r,s,q=Ra,t=q.directional.colors,u=q.directional.positions,
+w=q.point.colors,x=q.point.positions,v=q.point.distances,B=q.spot.colors,D=q.spot.positions,F=q.spot.distances,J=q.spot.directions,N=q.spot.anglesCos,O=q.spot.exponents,I=q.hemi.skyColors,V=q.hemi.groundColors,R=q.hemi.positions,M=0,T=0,ea=0,za=0,P=0,wc=0,X=0,W=0,Q=m=0,c=s=Q=0,f=b.length;c<f;c++)m=b[c],m.onlyShadow||(p=m.color,r=m.intensity,s=m.distance,m instanceof THREE.AmbientLight?m.visible&&(K.gammaInput?(k+=p.r*p.r,l+=p.g*p.g,n+=p.b*p.b):(k+=p.r,l+=p.g,n+=p.b)):m instanceof THREE.DirectionalLight?
+(P+=1,m.visible&&(ha.getPositionFromMatrix(m.matrixWorld),ua.getPositionFromMatrix(m.target.matrixWorld),ha.sub(ua),ha.normalize(),0===ha.x&&0===ha.y&&0===ha.z||(m=3*M,u[m]=ha.x,u[m+1]=ha.y,u[m+2]=ha.z,K.gammaInput?z(t,m,p,r*r):y(t,m,p,r),M+=1))):m instanceof THREE.PointLight?(wc+=1,m.visible&&(Q=3*T,K.gammaInput?z(w,Q,p,r*r):y(w,Q,p,r),ua.getPositionFromMatrix(m.matrixWorld),x[Q]=ua.x,x[Q+1]=ua.y,x[Q+2]=ua.z,v[T]=s,T+=1)):m instanceof THREE.SpotLight?(X+=1,m.visible&&(Q=3*ea,K.gammaInput?z(B,Q,p,
+r*r):y(B,Q,p,r),ua.getPositionFromMatrix(m.matrixWorld),D[Q]=ua.x,D[Q+1]=ua.y,D[Q+2]=ua.z,F[ea]=s,ha.copy(ua),ua.getPositionFromMatrix(m.target.matrixWorld),ha.sub(ua),ha.normalize(),J[Q]=ha.x,J[Q+1]=ha.y,J[Q+2]=ha.z,N[ea]=Math.cos(m.angle),O[ea]=m.exponent,ea+=1)):m instanceof THREE.HemisphereLight&&(W+=1,m.visible&&(ha.getPositionFromMatrix(m.matrixWorld),ha.normalize(),0===ha.x&&0===ha.y&&0===ha.z||(s=3*za,R[s]=ha.x,R[s+1]=ha.y,R[s+2]=ha.z,p=m.color,m=m.groundColor,K.gammaInput?(r*=r,z(I,s,p,r),
+z(V,s,m,r)):(y(I,s,p,r),y(V,s,m,r)),za+=1))));c=3*M;for(f=Math.max(t.length,3*P);c<f;c++)t[c]=0;c=3*T;for(f=Math.max(w.length,3*wc);c<f;c++)w[c]=0;c=3*ea;for(f=Math.max(B.length,3*X);c<f;c++)B[c]=0;c=3*za;for(f=Math.max(I.length,3*W);c<f;c++)I[c]=0;c=3*za;for(f=Math.max(V.length,3*W);c<f;c++)V[c]=0;q.directional.length=M;q.point.length=T;q.spot.length=ea;q.hemi.length=za;q.ambient[0]=k;q.ambient[1]=l;q.ambient[2]=n;wa=!1}c=Ra;i.ambientLightColor.value=c.ambient;i.directionalLightColor.value=c.directional.colors;
 i.directionalLightDirection.value=c.directional.positions;i.pointLightColor.value=c.point.colors;i.pointLightPosition.value=c.point.positions;i.pointLightDistance.value=c.point.distances;i.spotLightColor.value=c.spot.colors;i.spotLightPosition.value=c.spot.positions;i.spotLightDistance.value=c.spot.distances;i.spotLightDirection.value=c.spot.directions;i.spotLightAngleCos.value=c.spot.anglesCos;i.spotLightExponent.value=c.spot.exponents;i.hemisphereLightSkyColor.value=c.hemi.skyColors;i.hemisphereLightGroundColor.value=
 c.hemi.groundColors;i.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){i.opacity.value=d.opacity;K.gammaInput?i.diffuse.value.copyGammaToLinear(d.color):i.diffuse.value=d.color;i.map.value=d.map;i.lightMap.value=d.lightMap;i.specularMap.value=d.specularMap;d.bumpMap&&(i.bumpMap.value=d.bumpMap,i.bumpScale.value=d.bumpScale);d.normalMap&&(i.normalMap.value=d.normalMap,i.normalScale.value.copy(d.normalScale));
 var Z;d.map?Z=d.map:d.specularMap?Z=d.specularMap:d.normalMap?Z=d.normalMap:d.bumpMap&&(Z=d.bumpMap);void 0!==Z&&(c=Z.offset,Z=Z.repeat,i.offsetRepeat.value.set(c.x,c.y,Z.x,Z.y));i.envMap.value=d.envMap;i.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;i.reflectivity.value=d.reflectivity;i.refractionRatio.value=d.refractionRatio;i.combine.value=d.combine;i.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?
@@ -391,17 +392,17 @@ var Z;d.map?Z=d.map:d.specularMap?Z=d.specularMap:d.normalMap?Z=d.normalMap:d.bu
 i.emissive.value.copyGammaToLinear(d.emissive),i.specular.value.copyGammaToLinear(d.specular)):(i.ambient.value=d.ambient,i.emissive.value=d.emissive,i.specular.value=d.specular),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(K.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),i.emissive.value.copyGammaToLinear(d.emissive)):(i.ambient.value=d.ambient,i.emissive.value=d.emissive),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?
 (i.mNear.value=a.near,i.mFar.value=a.far,i.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(i.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&i.shadowMatrix){c=Z=0;for(f=b.length;c<f;c++)if(k=b[c],k.castShadow&&(k instanceof THREE.SpotLight||k instanceof THREE.DirectionalLight&&!k.shadowCascade))i.shadowMap.value[Z]=k.shadowMap,i.shadowMapSize.value[Z]=k.shadowMapSize,i.shadowMatrix.value[Z]=k.shadowMatrix,i.shadowDarkness.value[Z]=k.shadowDarkness,i.shadowBias.value[Z]=
 k.shadowBias,Z++}b=d.uniformsList;i=0;for(Z=b.length;i<Z;i++)if(f=g.uniforms[b[i][1]])if(c=b[i][0],l=c.type,k=c.value,"i"===l)j.uniform1i(f,k);else if("f"===l)j.uniform1f(f,k);else if("v2"===l)j.uniform2f(f,k.x,k.y);else if("v3"===l)j.uniform3f(f,k.x,k.y,k.z);else if("v4"===l)j.uniform4f(f,k.x,k.y,k.z,k.w);else if("c"===l)j.uniform3f(f,k.r,k.g,k.b);else if("iv1"===l)j.uniform1iv(f,k);else if("iv"===l)j.uniform3iv(f,k);else if("fv1"===l)j.uniform1fv(f,k);else if("fv"===l)j.uniform3fv(f,k);else if("v2v"===
-l){void 0===c._array&&(c._array=new Float32Array(2*k.length));l=0;for(n=k.length;l<n;l++)r=2*l,c._array[r]=k[l].x,c._array[r+1]=k[l].y;j.uniform2fv(f,c._array)}else if("v3v"===l){void 0===c._array&&(c._array=new Float32Array(3*k.length));l=0;for(n=k.length;l<n;l++)r=3*l,c._array[r]=k[l].x,c._array[r+1]=k[l].y,c._array[r+2]=k[l].z;j.uniform3fv(f,c._array)}else if("v4v"===l){void 0===c._array&&(c._array=new Float32Array(4*k.length));l=0;for(n=k.length;l<n;l++)r=4*l,c._array[r]=k[l].x,c._array[r+1]=
-k[l].y,c._array[r+2]=k[l].z,c._array[r+3]=k[l].w;j.uniform4fv(f,c._array)}else if("m4"===l)void 0===c._array&&(c._array=new Float32Array(16)),k.flattenToArray(c._array),j.uniformMatrix4fv(f,!1,c._array);else if("m4v"===l){void 0===c._array&&(c._array=new Float32Array(16*k.length));l=0;for(n=k.length;l<n;l++)k[l].flattenToArrayOffset(c._array,16*l);j.uniformMatrix4fv(f,!1,c._array)}else if("t"===l){if(r=k,k=C(),j.uniform1i(f,k),r)if(r.image instanceof Array&&6===r.image.length){if(c=r,f=k,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||
-(c.addEventListener("dispose",Kb),c.image.__webglTextureCube=j.createTexture(),K.info.memory.textures++);j.activeTexture(j.TEXTURE0+f);j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;k=[];for(l=0;6>l;l++)K.autoScaleCubemaps&&!f?(n=k,r=l,s=c.image[l],w=qc,s.width<=w&&s.height<=w||(v=Math.max(s.width,s.height),u=Math.floor(s.width*w/v),w=Math.floor(s.height*w/v),v=document.createElement("canvas"),v.width=
-u,v.height=w,v.getContext("2d").drawImage(s,0,0,s.width,s.height,0,0,u,w),s=v),n[r]=s):k[l]=c.image[l];l=k[0];n=0===(l.width&l.width-1)&&0===(l.height&l.height-1);r=A(c.format);s=A(c.type);B(j.TEXTURE_CUBE_MAP,c,n);for(l=0;6>l;l++)if(f){w=k[l].mipmaps;v=0;for(y=w.length;v<y;v++)u=w[v],j.compressedTexImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,v,r,u.width,u.height,0,u.data)}else j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,r,r,s,k[l]);c.generateMipmaps&&n&&j.generateMipmap(j.TEXTURE_CUBE_MAP);c.needsUpdate=
-!1;if(c.onUpdate)c.onUpdate()}else j.activeTexture(j.TEXTURE0+f),j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else r instanceof THREE.WebGLRenderTargetCube?(c=r,j.activeTexture(j.TEXTURE0+k),j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture)):K.setTexture(r,k)}else if("tv"===l){void 0===c._array&&(c._array=[]);l=0;for(n=c.value.length;l<n;l++)c._array[l]=C();j.uniform1iv(f,c._array);l=0;for(n=c.value.length;l<n;l++)r=c.value[l],k=c._array[l],r&&K.setTexture(r,k)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+
+l){void 0===c._array&&(c._array=new Float32Array(2*k.length));l=0;for(n=k.length;l<n;l++)q=2*l,c._array[q]=k[l].x,c._array[q+1]=k[l].y;j.uniform2fv(f,c._array)}else if("v3v"===l){void 0===c._array&&(c._array=new Float32Array(3*k.length));l=0;for(n=k.length;l<n;l++)q=3*l,c._array[q]=k[l].x,c._array[q+1]=k[l].y,c._array[q+2]=k[l].z;j.uniform3fv(f,c._array)}else if("v4v"===l){void 0===c._array&&(c._array=new Float32Array(4*k.length));l=0;for(n=k.length;l<n;l++)q=4*l,c._array[q]=k[l].x,c._array[q+1]=
+k[l].y,c._array[q+2]=k[l].z,c._array[q+3]=k[l].w;j.uniform4fv(f,c._array)}else if("m4"===l)void 0===c._array&&(c._array=new Float32Array(16)),k.flattenToArray(c._array),j.uniformMatrix4fv(f,!1,c._array);else if("m4v"===l){void 0===c._array&&(c._array=new Float32Array(16*k.length));l=0;for(n=k.length;l<n;l++)k[l].flattenToArrayOffset(c._array,16*l);j.uniformMatrix4fv(f,!1,c._array)}else if("t"===l){if(q=k,k=C(),j.uniform1i(f,k),q)if(q.image instanceof Array&&6===q.image.length){if(c=q,f=k,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||
+(c.addEventListener("dispose",Kb),c.image.__webglTextureCube=j.createTexture(),K.info.memory.textures++);j.activeTexture(j.TEXTURE0+f);j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;k=[];for(l=0;6>l;l++)K.autoScaleCubemaps&&!f?(n=k,q=l,t=c.image[l],w=qc,t.width<=w&&t.height<=w||(x=Math.max(t.width,t.height),u=Math.floor(t.width*w/x),w=Math.floor(t.height*w/x),x=document.createElement("canvas"),x.width=
+u,x.height=w,x.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,u,w),t=x),n[q]=t):k[l]=c.image[l];l=k[0];n=0===(l.width&l.width-1)&&0===(l.height&l.height-1);q=A(c.format);t=A(c.type);E(j.TEXTURE_CUBE_MAP,c,n);for(l=0;6>l;l++)if(f){w=k[l].mipmaps;x=0;for(v=w.length;x<v;x++)u=w[x],j.compressedTexImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,x,q,u.width,u.height,0,u.data)}else j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,q,q,t,k[l]);c.generateMipmaps&&n&&j.generateMipmap(j.TEXTURE_CUBE_MAP);c.needsUpdate=
+!1;if(c.onUpdate)c.onUpdate()}else j.activeTexture(j.TEXTURE0+f),j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else q instanceof THREE.WebGLRenderTargetCube?(c=q,j.activeTexture(j.TEXTURE0+k),j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture)):K.setTexture(q,k)}else if("tv"===l){void 0===c._array&&(c._array=[]);l=0;for(n=c.value.length;l<n;l++)c._array[l]=C();j.uniform1iv(f,c._array);l=0;for(n=c.value.length;l<n;l++)q=c.value[l],k=c._array[l],q&&K.setTexture(q,k)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+
 l);if((d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==h.cameraPosition)ua.getPositionFromMatrix(a.matrixWorld),j.uniform3f(h.cameraPosition,ua.x,ua.y,ua.z);(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==h.viewMatrix&&j.uniformMatrix4fv(h.viewMatrix,!1,a.matrixWorldInverse.elements)}j.uniformMatrix4fv(h.modelViewMatrix,!1,e._modelViewMatrix.elements);h.normalMatrix&&j.uniformMatrix3fv(h.normalMatrix,
-!1,e._normalMatrix.elements);null!==h.modelMatrix&&j.uniformMatrix4fv(h.modelMatrix,!1,e.matrixWorld.elements);return g}function C(){var a=aa;a>=Wb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Wb);aa+=1;return a}function F(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function z(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function D(a){a!==Aa&&(j.lineWidth(a),Aa=a)}function y(a,b,c){Ha!==a&&(a?j.enable(j.POLYGON_OFFSET_FILL):j.disable(j.POLYGON_OFFSET_FILL),
-Ha=a);if(a&&(Xa!==b||Sa!==c))j.polygonOffset(b,c),Xa=b,Sa=c}function O(a){for(var a=a.split("\n"),b=0,c=a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function x(a,b){var c;"fragment"===a?c=j.createShader(j.FRAGMENT_SHADER):"vertex"===a&&(c=j.createShader(j.VERTEX_SHADER));j.shaderSource(c,b);j.compileShader(c);return!j.getShaderParameter(c,j.COMPILE_STATUS)?(console.error(j.getShaderInfoLog(c)),console.error(O(b)),null):c}function B(a,b,c){c?(j.texParameteri(a,j.TEXTURE_WRAP_S,A(b.wrapS)),
-j.texParameteri(a,j.TEXTURE_WRAP_T,A(b.wrapT)),j.texParameteri(a,j.TEXTURE_MAG_FILTER,A(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,A(b.minFilter))):(j.texParameteri(a,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_MAG_FILTER,v(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,v(b.minFilter)));if(ya&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy))j.texParameterf(a,ya.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,
+!1,e._normalMatrix.elements);null!==h.modelMatrix&&j.uniformMatrix4fv(h.modelMatrix,!1,e.matrixWorld.elements);return g}function C(){var a=aa;a>=Wb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Wb);aa+=1;return a}function z(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function y(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function F(a){a!==Aa&&(j.lineWidth(a),Aa=a)}function x(a,b,c){Ha!==a&&(a?j.enable(j.POLYGON_OFFSET_FILL):j.disable(j.POLYGON_OFFSET_FILL),
+Ha=a);if(a&&(Xa!==b||Sa!==c))j.polygonOffset(b,c),Xa=b,Sa=c}function O(a){for(var a=a.split("\n"),b=0,c=a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function B(a,b){var c;"fragment"===a?c=j.createShader(j.FRAGMENT_SHADER):"vertex"===a&&(c=j.createShader(j.VERTEX_SHADER));j.shaderSource(c,b);j.compileShader(c);return!j.getShaderParameter(c,j.COMPILE_STATUS)?(console.error(j.getShaderInfoLog(c)),console.error(O(b)),null):c}function E(a,b,c){c?(j.texParameteri(a,j.TEXTURE_WRAP_S,A(b.wrapS)),
+j.texParameteri(a,j.TEXTURE_WRAP_T,A(b.wrapT)),j.texParameteri(a,j.TEXTURE_MAG_FILTER,A(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,A(b.minFilter))):(j.texParameteri(a,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_MAG_FILTER,D(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,D(b.minFilter)));if(ya&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy))j.texParameterf(a,ya.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,
 Xb)),b.__oldAnisotropy=b.anisotropy}function I(a,b){j.bindRenderbuffer(j.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_COMPONENT16,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_ATTACHMENT,j.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_STENCIL,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_STENCIL_ATTACHMENT,j.RENDERBUFFER,a)):j.renderbufferStorage(j.RENDERBUFFER,
-j.RGBA4,b.width,b.height)}function v(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?j.NEAREST:j.LINEAR}function A(a){if(a===THREE.RepeatWrapping)return j.REPEAT;if(a===THREE.ClampToEdgeWrapping)return j.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return j.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return j.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return j.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return j.NEAREST_MIPMAP_LINEAR;
+j.RGBA4,b.width,b.height)}function D(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?j.NEAREST:j.LINEAR}function A(a){if(a===THREE.RepeatWrapping)return j.REPEAT;if(a===THREE.ClampToEdgeWrapping)return j.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return j.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return j.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return j.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return j.NEAREST_MIPMAP_LINEAR;
 if(a===THREE.LinearFilter)return j.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return j.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return j.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return j.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return j.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return j.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return j.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return j.BYTE;if(a===THREE.ShortType)return j.SHORT;
 if(a===THREE.UnsignedShortType)return j.UNSIGNED_SHORT;if(a===THREE.IntType)return j.INT;if(a===THREE.UnsignedIntType)return j.UNSIGNED_INT;if(a===THREE.FloatType)return j.FLOAT;if(a===THREE.AlphaFormat)return j.ALPHA;if(a===THREE.RGBFormat)return j.RGB;if(a===THREE.RGBAFormat)return j.RGBA;if(a===THREE.LuminanceFormat)return j.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return j.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return j.FUNC_ADD;if(a===THREE.SubtractEquation)return j.FUNC_SUBTRACT;if(a===
 THREE.ReverseSubtractEquation)return j.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return j.ZERO;if(a===THREE.OneFactor)return j.ONE;if(a===THREE.SrcColorFactor)return j.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return j.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return j.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return j.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return j.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return j.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return j.DST_COLOR;
@@ -424,14 +425,14 @@ Lb=function(a){a=a.target;a.removeEventListener("dispose",Lb);if(a&&a.__webglTex
 j.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&j.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&j.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&j.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&j.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&j.deleteBuffer(a.__webglUV2Buffer);void 0!==a.__webglSkinIndicesBuffer&&j.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&j.deleteBuffer(a.__webglSkinWeightsBuffer);
 void 0!==a.__webglFaceBuffer&&j.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&j.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&j.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)j.deleteBuffer(a.__webglCustomAttributesList[b].buffer)},Ob=function(a){var b=a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1,a=0;for(c=da.length;a<c;a++)if(d=da[a],d.program===b){d.usedTimes--;0===
 d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=da.length;a<c;a++)d=da[a],d.program!==b&&e.push(d);da=e;j.deleteProgram(b);K.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=j.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=j.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=j.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=j.createBuffer());
-a.hasPositions&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,a.positionArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.position),j.vertexAttribPointer(b.attributes.position,3,j.FLOAT,!1,0,0));if(a.hasNormals){j.bindBuffer(j.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,f,g,h,i,k,l,m,n,p,q=3*a.count;for(p=0;p<q;p+=9)n=a.normalArray,d=n[p],e=n[p+1],f=n[p+2],g=n[p+3],i=n[p+4],l=n[p+5],h=n[p+6],k=n[p+7],m=n[p+8],d=(d+g+h)/
+a.hasPositions&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,a.positionArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.position),j.vertexAttribPointer(b.attributes.position,3,j.FLOAT,!1,0,0));if(a.hasNormals){j.bindBuffer(j.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,f,g,h,i,k,l,m,n,p,r=3*a.count;for(p=0;p<r;p+=9)n=a.normalArray,d=n[p],e=n[p+1],f=n[p+2],g=n[p+3],i=n[p+4],l=n[p+5],h=n[p+6],k=n[p+7],m=n[p+8],d=(d+g+h)/
 3,e=(e+i+k)/3,f=(f+l+m)/3,n[p]=d,n[p+1]=e,n[p+2]=f,n[p+3]=d,n[p+4]=e,n[p+5]=f,n[p+6]=d,n[p+7]=e,n[p+8]=f}j.bufferData(j.ARRAY_BUFFER,a.normalArray,j.DYNAMIC_DRAW);j.enableVertexAttribArray(b.attributes.normal);j.vertexAttribPointer(b.attributes.normal,3,j.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglUvBuffer),j.bufferData(j.ARRAY_BUFFER,a.uvArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.uv),j.vertexAttribPointer(b.attributes.uv,2,j.FLOAT,!1,0,0));a.hasColors&&
-c.vertexColors!==THREE.NoColors&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,a.colorArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.color),j.vertexAttribPointer(b.attributes.color,3,j.FLOAT,!1,0,0));j.drawArrays(j.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var i,k,l,m;i=E(a,b,c,d,f);b=i.attributes;a=e.attributes;c=!1;i=16777215*e.id+2*i.id+(d.wireframe?1:0);i!==Z&&(Z=i,c=!0);c&&g();if(f instanceof
-THREE.Mesh)if(f=a.index){e=e.offsets;1<e.length&&(c=!0);for(var n=0,p=e.length;n<p;n++){var q=e[n].index;if(c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,4*q*m)):d.defaultAttributeValues&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,f.buffer)}j.drawElements(j.TRIANGLES,
+c.vertexColors!==THREE.NoColors&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,a.colorArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.color),j.vertexAttribPointer(b.attributes.color,3,j.FLOAT,!1,0,0));j.drawArrays(j.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var i,k,l,m;i=v(a,b,c,d,f);b=i.attributes;a=e.attributes;c=!1;i=16777215*e.id+2*i.id+(d.wireframe?1:0);i!==Z&&(Z=i,c=!0);c&&g();if(f instanceof
+THREE.Mesh)if(f=a.index){e=e.offsets;1<e.length&&(c=!0);for(var n=0,p=e.length;n<p;n++){var r=e[n].index;if(c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,4*r*m)):d.defaultAttributeValues&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,f.buffer)}j.drawElements(j.TRIANGLES,
 e[n].count,j.UNSIGNED_SHORT,2*e[n].start);K.info.render.calls++;K.info.render.vertices+=e[n].count;K.info.render.faces+=e[n].count/3}}else{if(c)for(k in b)"index"!==k&&(l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&j.vertexAttrib3fv(l,d.defaultAttributeValues[k]))));
 d=e.attributes.position;j.drawArrays(j.TRIANGLES,0,d.numItems/3);K.info.render.calls++;K.info.render.vertices+=d.numItems/3;K.info.render.faces+=d.numItems/3/3}else if(f instanceof THREE.ParticleSystem){if(c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&
 j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));d=a.position;j.drawArrays(j.POINTS,0,d.numItems/3);K.info.render.calls++;K.info.render.points+=d.numItems/3}}else if(f instanceof THREE.Line&&c){for(k in b)l=b[k],i=a[k],0<=l&&(i?(m=i.itemSize,j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[k]&&(2===d.defaultAttributeValues[k].length?j.vertexAttrib2fv(l,d.defaultAttributeValues[k]):3===d.defaultAttributeValues[k].length&&
-j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));k=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES;D(d.linewidth);d=a.position;j.drawArrays(k,0,d.numItems/3);K.info.render.calls++;K.info.render.points+=d.numItems}}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var i,l,c=E(a,b,c,d,f),a=c.attributes,b=!1,c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==Z&&(Z=c,b=!0);b&&g();if(!d.morphTargets&&0<=a.position)b&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(a.position),j.vertexAttribPointer(a.position,
+j.vertexAttrib3fv(l,d.defaultAttributeValues[k])));k=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES;F(d.linewidth);d=a.position;j.drawArrays(k,0,d.numItems/3);K.info.render.calls++;K.info.render.points+=d.numItems}}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var i,l,c=v(a,b,c,d,f),a=c.attributes,b=!1,c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==Z&&(Z=c,b=!0);b&&g();if(!d.morphTargets&&0<=a.position)b&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(a.position),j.vertexAttribPointer(a.position,
 3,j.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0)):0<=c.position&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var m=0;l=f.morphTargetForcedOrder;for(i=f.morphTargetInfluences;m<d.numSupportedMorphTargets&&
 m<l.length;)0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l[m]]),h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l[m]]),h(c["morphNormal"+m]),j.vertexAttribPointer(c["morphNormal"+m],3,j.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[m]=i[l[m]],m++}else{l=[];i=f.morphTargetInfluences;var n,p=i.length;for(n=0;n<p;n++)m=i[n],0<m&&l.push([m,
 n]);l.length>d.numSupportedMorphTargets?(l.sort(k),l.length=d.numSupportedMorphTargets):l.length>d.numSupportedMorphNormals?l.sort(k):0===l.length&&l.push([0,0]);for(m=0;m<d.numSupportedMorphTargets;)l[m]?(n=l[m][1],0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[n]),h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[n]),h(c["morphNormal"+
@@ -439,73 +440,73 @@ m]),j.vertexAttribPointer(c["morphNormal"+m],3,j.FLOAT,!1,0,0)),f.__webglMorphTa
 j.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,j.FLOAT,!1,0,0))}0<=a.color&&(f.geometry.faces.length&&0<f.geometry.faces[0].vertexColors.length||f.geometry.__webglColorBuffer?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglColorBuffer),h(a.color),j.vertexAttribPointer(a.color,3,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&j.vertexAttrib3fv(a.color,d.defaultAttributeValues.color));0<=a.normal&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglNormalBuffer),h(a.normal),j.vertexAttribPointer(a.normal,3,j.FLOAT,
 !1,0,0));0<=a.tangent&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglTangentBuffer),h(a.tangent),j.vertexAttribPointer(a.tangent,4,j.FLOAT,!1,0,0));0<=a.uv&&(f.geometry.faceVertexUvs[0]?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUVBuffer),h(a.uv),j.vertexAttribPointer(a.uv,2,j.FLOAT,!1,0,0)):d.defaultAttributeValues&&j.vertexAttrib2fv(a.uv,d.defaultAttributeValues.uv));0<=a.uv2&&(f.geometry.faceVertexUvs[1]?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUV2Buffer),h(a.uv2),j.vertexAttribPointer(a.uv2,2,j.FLOAT,!1,0,0)):
 d.defaultAttributeValues&&j.vertexAttrib2fv(a.uv2,d.defaultAttributeValues.uv2));d.skinning&&(0<=a.skinIndex&&0<=a.skinWeight)&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),h(a.skinIndex),j.vertexAttribPointer(a.skinIndex,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),h(a.skinWeight),j.vertexAttribPointer(a.skinWeight,4,j.FLOAT,!1,0,0));0<=a.lineDistance&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglLineDistanceBuffer),h(a.lineDistance),j.vertexAttribPointer(a.lineDistance,
-1,j.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(d.wireframe?(D(d.wireframeLinewidth),b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),j.drawElements(j.LINES,e.__webglLineCount,j.UNSIGNED_SHORT,0)):(b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),j.drawElements(j.TRIANGLES,e.__webglFaceCount,j.UNSIGNED_SHORT,0)),K.info.render.calls++,K.info.render.vertices+=e.__webglFaceCount,K.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?j.LINE_STRIP:
-j.LINES,D(d.linewidth),j.drawArrays(f,0,e.__webglLineCount),K.info.render.calls++):f instanceof THREE.ParticleSystem?(j.drawArrays(j.POINTS,0,e.__webglParticleCount),K.info.render.calls++,K.info.render.points+=e.__webglParticleCount):f instanceof THREE.Ribbon&&(j.drawArrays(j.TRIANGLE_STRIP,0,e.__webglVertexCount),K.info.render.calls++)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,
+1,j.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(d.wireframe?(F(d.wireframeLinewidth),b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),j.drawElements(j.LINES,e.__webglLineCount,j.UNSIGNED_SHORT,0)):(b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),j.drawElements(j.TRIANGLES,e.__webglFaceCount,j.UNSIGNED_SHORT,0)),K.info.render.calls++,K.info.render.vertices+=e.__webglFaceCount,K.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?j.LINE_STRIP:
+j.LINES,F(d.linewidth),j.drawArrays(f,0,e.__webglLineCount),K.info.render.calls++):f instanceof THREE.ParticleSystem?(j.drawArrays(j.POINTS,0,e.__webglParticleCount),K.info.render.calls++,K.info.render.points+=e.__webglParticleCount):f instanceof THREE.Ribbon&&(j.drawArrays(j.TRIANGLE_STRIP,0,e.__webglVertexCount),K.info.render.calls++)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,
 f,g,h,k=a.__lights,p=a.fog;Ea=-1;wa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);ta.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);na.setFromMatrix(ta);this.autoUpdateObjects&&this.initWebGLObjects(a);l(this.renderPluginsPre,a,b);K.info.render.calls=0;K.info.render.vertices=0;K.info.render.faces=0;K.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,
-this.autoClearStencil);h=a.__webglObjects;d=0;for(e=h.length;d<e;d++)if(f=h[d],g=f.object,f.id=d,f.render=!1,g.visible&&(!(g instanceof THREE.Mesh||g instanceof THREE.ParticleSystem)||!g.frustumCulled||na.intersectsObject(g))){var q=g;q._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,q.matrixWorld);q._normalMatrix.getNormalMatrix(q._modelViewMatrix);var q=f,r=q.buffer,t=void 0,s=t=void 0,s=q.object.material;if(s instanceof THREE.MeshFaceMaterial)t=r.materialIndex,t=s.materials[t],t.transparent?
-(q.transparent=t,q.opaque=null):(q.opaque=t,q.transparent=null);else if(t=s)t.transparent?(q.transparent=t,q.opaque=null):(q.opaque=t,q.transparent=null);f.render=!0;!0===this.sortObjects&&(null!==g.renderDepth?f.z=g.renderDepth:(ua.getPositionFromMatrix(g.matrixWorld),ua.applyProjection(ta),f.z=ua.z))}this.sortObjects&&h.sort(i);h=a.__webglObjectsImmediate;d=0;for(e=h.length;d<e;d++)f=h[d],g=f.object,g.visible&&(g._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,g.matrixWorld),g._normalMatrix.getNormalMatrix(g._modelViewMatrix),
-g=f.object.material,g.transparent?(f.transparent=g,f.opaque=null):(f.opaque=g,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),y(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),m(a.__webglObjects,!1,"",b,k,p,!0,d),n(a.__webglObjectsImmediate,"",b,k,p,!1,d)):(d=null,this.setBlending(THREE.NoBlending),m(a.__webglObjects,!0,"opaque",b,k,p,!1,d),n(a.__webglObjectsImmediate,
+this.autoClearStencil);h=a.__webglObjects;d=0;for(e=h.length;d<e;d++)if(f=h[d],g=f.object,f.id=d,f.render=!1,g.visible&&(!(g instanceof THREE.Mesh||g instanceof THREE.ParticleSystem)||!g.frustumCulled||na.intersectsObject(g))){var r=g;r._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,r.matrixWorld);r._normalMatrix.getNormalMatrix(r._modelViewMatrix);var r=f,s=r.buffer,q=void 0,t=q=void 0,t=r.object.material;if(t instanceof THREE.MeshFaceMaterial)q=s.materialIndex,q=t.materials[q],q.transparent?
+(r.transparent=q,r.opaque=null):(r.opaque=q,r.transparent=null);else if(q=t)q.transparent?(r.transparent=q,r.opaque=null):(r.opaque=q,r.transparent=null);f.render=!0;!0===this.sortObjects&&(null!==g.renderDepth?f.z=g.renderDepth:(ua.getPositionFromMatrix(g.matrixWorld),ua.applyProjection(ta),f.z=ua.z))}this.sortObjects&&h.sort(i);h=a.__webglObjectsImmediate;d=0;for(e=h.length;d<e;d++)f=h[d],g=f.object,g.visible&&(g._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,g.matrixWorld),g._normalMatrix.getNormalMatrix(g._modelViewMatrix),
+g=f.object.material,g.transparent?(f.transparent=g,f.opaque=null):(f.opaque=g,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),x(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),m(a.__webglObjects,!1,"",b,k,p,!0,d),n(a.__webglObjectsImmediate,"",b,k,p,!1,d)):(d=null,this.setBlending(THREE.NoBlending),m(a.__webglObjects,!0,"opaque",b,k,p,!1,d),n(a.__webglObjectsImmediate,
 "opaque",b,k,p,!1,d),m(a.__webglObjects,!1,"transparent",b,k,p,!0,d),n(a.__webglObjectsImmediate,"transparent",b,k,p,!0,d));l(this.renderPluginsPost,a,b);c&&(c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter)&&(c instanceof THREE.WebGLRenderTargetCube?(j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture),j.generateMipmap(j.TEXTURE_CUBE_MAP),j.bindTexture(j.TEXTURE_CUBE_MAP,null)):(j.bindTexture(j.TEXTURE_2D,c.__webglTexture),j.generateMipmap(j.TEXTURE_2D),j.bindTexture(j.TEXTURE_2D,
-null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=E(a,b,c,d,e);Z=-1;K.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,j,na):e.render(function(a){K.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)t(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)r(a.__objectsRemoved[0],
-a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;void 0===h.__webglInit&&(void 0!==h.__webglActive&&r(h,a),t(h,a));var i=h,l=i.geometry,m=void 0,n=void 0,s=void 0;if(l instanceof THREE.BufferGeometry){var u=j.DYNAMIC_DRAW,w=!l.dynamic,v=l.attributes,z=void 0,y=void 0;for(z in v)y=v[z],y.needsUpdate&&("index"===z?(j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,y.buffer),j.bufferData(j.ELEMENT_ARRAY_BUFFER,y.array,u)):(j.bindBuffer(j.ARRAY_BUFFER,
-y.buffer),j.bufferData(j.ARRAY_BUFFER,y.array,u)),y.needsUpdate=!1),w&&!y.dynamic&&(y.array=null)}else if(i instanceof THREE.Mesh){for(var E=0,A=l.geometryGroupsList.length;E<A;E++)if(m=l.geometryGroupsList[E],s=d(i,m),l.buffersNeedUpdate&&c(m,i),n=s.attributes&&p(s),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||n){var x=m,F=i,C=j.DYNAMIC_DRAW,D=!l.dynamic,G=s;if(x.__inittedArrays){var J=e(G),K=
-G.vertexColors?G.vertexColors:!1,N=f(G),O=J===THREE.SmoothShading,B=void 0,I=void 0,V=void 0,M=void 0,R=void 0,Q=void 0,T=void 0,ea=void 0,za=void 0,Z=void 0,aa=void 0,P=void 0,X=void 0,W=void 0,Fa=void 0,fa=void 0,Ea=void 0,ba=void 0,da=void 0,ja=void 0,ga=void 0,ha=void 0,ma=void 0,na=void 0,qa=void 0,ra=void 0,va=void 0,wa=void 0,xa=void 0,Ga=void 0,Ha=void 0,Ja=void 0,Ia=void 0,Pa=void 0,Ua=void 0,Ka=void 0,ya=void 0,Aa=void 0,Sa=void 0,Wa=void 0,fb=0,gb=0,Ra=0,Ta=0,Xa=0,lb=0,Va=0,yb=0,cb=0,sa=
-0,Ba=0,L=0,Qa=void 0,mb=x.__vertexArray,hb=x.__uvArray,ib=x.__uv2Array,Ab=x.__normalArray,Ya=x.__tangentArray,nb=x.__colorArray,Za=x.__skinIndexArray,$a=x.__skinWeightArray,tb=x.__morphTargetsArrays,ub=x.__morphNormalsArrays,vb=x.__webglCustomAttributesList,H=void 0,jb=x.__faceArray,Bb=x.__lineArray,La=F.geometry,Ib=La.elementsNeedUpdate,Eb=La.uvsNeedUpdate,Kb=La.normalsNeedUpdate,Wb=La.tangentsNeedUpdate,Xb=La.colorsNeedUpdate,Yb=La.morphTargetsNeedUpdate,xc=La.vertices,$=x.faces3,ob=La.faces,Jb=
-La.faceVertexUvs[0],Lb=La.faceVertexUvs[1],yc=La.skinIndices,Zb=La.skinWeights,$b=La.morphTargets,Mb=La.morphNormals;if(La.verticesNeedUpdate){B=0;for(I=$.length;B<I;B++)M=ob[$[B]],P=xc[M.a],X=xc[M.b],W=xc[M.c],mb[gb]=P.x,mb[gb+1]=P.y,mb[gb+2]=P.z,mb[gb+3]=X.x,mb[gb+4]=X.y,mb[gb+5]=X.z,mb[gb+6]=W.x,mb[gb+7]=W.y,mb[gb+8]=W.z,gb+=9;j.bindBuffer(j.ARRAY_BUFFER,x.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,mb,C)}if(Yb){Ua=0;for(Ka=$b.length;Ua<Ka;Ua++){B=Ba=0;for(I=$.length;B<I;B++)Sa=$[B],M=ob[Sa],
-P=$b[Ua].vertices[M.a],X=$b[Ua].vertices[M.b],W=$b[Ua].vertices[M.c],ya=tb[Ua],ya[Ba]=P.x,ya[Ba+1]=P.y,ya[Ba+2]=P.z,ya[Ba+3]=X.x,ya[Ba+4]=X.y,ya[Ba+5]=X.z,ya[Ba+6]=W.x,ya[Ba+7]=W.y,ya[Ba+8]=W.z,G.morphNormals&&(O?(Wa=Mb[Ua].vertexNormals[Sa],ba=Wa.a,da=Wa.b,ja=Wa.c):ja=da=ba=Mb[Ua].faceNormals[Sa],Aa=ub[Ua],Aa[Ba]=ba.x,Aa[Ba+1]=ba.y,Aa[Ba+2]=ba.z,Aa[Ba+3]=da.x,Aa[Ba+4]=da.y,Aa[Ba+5]=da.z,Aa[Ba+6]=ja.x,Aa[Ba+7]=ja.y,Aa[Ba+8]=ja.z),Ba+=9;j.bindBuffer(j.ARRAY_BUFFER,x.__webglMorphTargetsBuffers[Ua]);
-j.bufferData(j.ARRAY_BUFFER,tb[Ua],C);G.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglMorphNormalsBuffers[Ua]),j.bufferData(j.ARRAY_BUFFER,ub[Ua],C))}}if(Zb.length){B=0;for(I=$.length;B<I;B++)M=ob[$[B]],na=Zb[M.a],qa=Zb[M.b],ra=Zb[M.c],$a[sa]=na.x,$a[sa+1]=na.y,$a[sa+2]=na.z,$a[sa+3]=na.w,$a[sa+4]=qa.x,$a[sa+5]=qa.y,$a[sa+6]=qa.z,$a[sa+7]=qa.w,$a[sa+8]=ra.x,$a[sa+9]=ra.y,$a[sa+10]=ra.z,$a[sa+11]=ra.w,va=yc[M.a],wa=yc[M.b],xa=yc[M.c],Za[sa]=va.x,Za[sa+1]=va.y,Za[sa+2]=va.z,Za[sa+3]=va.w,Za[sa+
-4]=wa.x,Za[sa+5]=wa.y,Za[sa+6]=wa.z,Za[sa+7]=wa.w,Za[sa+8]=xa.x,Za[sa+9]=xa.y,Za[sa+10]=xa.z,Za[sa+11]=xa.w,sa+=12;0<sa&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,Za,C),j.bindBuffer(j.ARRAY_BUFFER,x.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,$a,C))}if(Xb&&K){B=0;for(I=$.length;B<I;B++)M=ob[$[B]],T=M.vertexColors,ea=M.color,3===T.length&&K===THREE.VertexColors?(ga=T[0],ha=T[1],ma=T[2]):ma=ha=ga=ea,nb[cb]=ga.r,nb[cb+1]=ga.g,nb[cb+2]=ga.b,nb[cb+3]=
-ha.r,nb[cb+4]=ha.g,nb[cb+5]=ha.b,nb[cb+6]=ma.r,nb[cb+7]=ma.g,nb[cb+8]=ma.b,cb+=9;0<cb&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,nb,C))}if(Wb&&La.hasTangents){B=0;for(I=$.length;B<I;B++)M=ob[$[B]],za=M.vertexTangents,Fa=za[0],fa=za[1],Ea=za[2],Ya[Va]=Fa.x,Ya[Va+1]=Fa.y,Ya[Va+2]=Fa.z,Ya[Va+3]=Fa.w,Ya[Va+4]=fa.x,Ya[Va+5]=fa.y,Ya[Va+6]=fa.z,Ya[Va+7]=fa.w,Ya[Va+8]=Ea.x,Ya[Va+9]=Ea.y,Ya[Va+10]=Ea.z,Ya[Va+11]=Ea.w,Va+=12;j.bindBuffer(j.ARRAY_BUFFER,x.__webglTangentBuffer);
-j.bufferData(j.ARRAY_BUFFER,Ya,C)}if(Kb&&J){B=0;for(I=$.length;B<I;B++)if(M=ob[$[B]],R=M.vertexNormals,Q=M.normal,3===R.length&&O)for(Ga=0;3>Ga;Ga++)Ja=R[Ga],Ab[lb]=Ja.x,Ab[lb+1]=Ja.y,Ab[lb+2]=Ja.z,lb+=3;else for(Ga=0;3>Ga;Ga++)Ab[lb]=Q.x,Ab[lb+1]=Q.y,Ab[lb+2]=Q.z,lb+=3;j.bindBuffer(j.ARRAY_BUFFER,x.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Ab,C)}if(Eb&&Jb&&N){B=0;for(I=$.length;B<I;B++)if(V=$[B],Z=Jb[V],void 0!==Z)for(Ga=0;3>Ga;Ga++)Ia=Z[Ga],hb[Ra]=Ia.x,hb[Ra+1]=Ia.y,Ra+=2;0<Ra&&(j.bindBuffer(j.ARRAY_BUFFER,
-x.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,hb,C))}if(Eb&&Lb&&N){B=0;for(I=$.length;B<I;B++)if(V=$[B],aa=Lb[V],void 0!==aa)for(Ga=0;3>Ga;Ga++)Pa=aa[Ga],ib[Ta]=Pa.x,ib[Ta+1]=Pa.y,Ta+=2;0<Ta&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,ib,C))}if(Ib){B=0;for(I=$.length;B<I;B++)jb[Xa]=fb,jb[Xa+1]=fb+1,jb[Xa+2]=fb+2,Xa+=3,Bb[yb]=fb,Bb[yb+1]=fb+1,Bb[yb+2]=fb,Bb[yb+3]=fb+2,Bb[yb+4]=fb+1,Bb[yb+5]=fb+2,yb+=6,fb+=3;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,x.__webglFaceBuffer);
-j.bufferData(j.ELEMENT_ARRAY_BUFFER,jb,C);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,x.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Bb,C)}if(vb){Ga=0;for(Ha=vb.length;Ga<Ha;Ga++)if(H=vb[Ga],H.__original.needsUpdate){L=0;if(1===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){B=0;for(I=$.length;B<I;B++)M=ob[$[B]],H.array[L]=H.value[M.a],H.array[L+1]=H.value[M.b],H.array[L+2]=H.value[M.c],L+=3}else{if("faces"===H.boundTo){B=0;for(I=$.length;B<I;B++)Qa=H.value[$[B]],H.array[L]=Qa,H.array[L+1]=
-Qa,H.array[L+2]=Qa,L+=3}}else if(2===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){B=0;for(I=$.length;B<I;B++)M=ob[$[B]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}else{if("faces"===H.boundTo){B=0;for(I=$.length;B<I;B++)W=X=P=Qa=H.value[$[B]],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}}else if(3===H.size){var pa;pa="c"===H.type?
-["r","g","b"]:["x","y","z"];if(void 0===H.boundTo||"vertices"===H.boundTo){B=0;for(I=$.length;B<I;B++)M=ob[$[B]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+2]=P[pa[2]],H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}else if("faces"===H.boundTo){B=0;for(I=$.length;B<I;B++)W=X=P=Qa=H.value[$[B]],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+2]=P[pa[2]],
-H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}else if("faceVertices"===H.boundTo){B=0;for(I=$.length;B<I;B++)Qa=H.value[$[B]],P=Qa[0],X=Qa[1],W=Qa[2],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+2]=P[pa[2]],H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}}else if(4===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){B=
-0;for(I=$.length;B<I;B++)M=ob[$[B]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faces"===H.boundTo){B=0;for(I=$.length;B<I;B++)W=X=P=Qa=H.value[$[B]],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,
-H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faceVertices"===H.boundTo){B=0;for(I=$.length;B<I;B++)Qa=H.value[$[B]],P=Qa[0],X=Qa[1],W=Qa[2],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}j.bindBuffer(j.ARRAY_BUFFER,H.buffer);j.bufferData(j.ARRAY_BUFFER,H.array,C)}}D&&(delete x.__inittedArrays,delete x.__colorArray,
-delete x.__normalArray,delete x.__tangentArray,delete x.__uvArray,delete x.__uv2Array,delete x.__faceArray,delete x.__vertexArray,delete x.__lineArray,delete x.__skinIndexArray,delete x.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;s.attributes&&q(s)}else if(i instanceof THREE.Ribbon){s=d(i,l);n=s.attributes&&p(s);if(l.verticesNeedUpdate||
+null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=v(a,b,c,d,e);Z=-1;K.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,j,na):e.render(function(a){K.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)r(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)q(a.__objectsRemoved[0],
+a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;void 0===h.__webglInit&&(void 0!==h.__webglActive&&q(h,a),r(h,a));var i=h,l=i.geometry,m=void 0,n=void 0,t=void 0;if(l instanceof THREE.BufferGeometry){var u=j.DYNAMIC_DRAW,w=!l.dynamic,x=l.attributes,y=void 0,z=void 0;for(y in x)z=x[y],z.needsUpdate&&("index"===y?(j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,z.buffer),j.bufferData(j.ELEMENT_ARRAY_BUFFER,z.array,u)):(j.bindBuffer(j.ARRAY_BUFFER,
+z.buffer),j.bufferData(j.ARRAY_BUFFER,z.array,u)),z.needsUpdate=!1),w&&!z.dynamic&&(z.array=null)}else if(i instanceof THREE.Mesh){for(var A=0,B=l.geometryGroupsList.length;A<B;A++)if(m=l.geometryGroupsList[A],t=d(i,m),l.buffersNeedUpdate&&c(m,i),n=t.attributes&&p(t),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||n){var v=m,D=i,C=j.DYNAMIC_DRAW,F=!l.dynamic,G=t;if(v.__inittedArrays){var J=e(G),K=
+G.vertexColors?G.vertexColors:!1,N=f(G),O=J===THREE.SmoothShading,E=void 0,I=void 0,V=void 0,M=void 0,R=void 0,Q=void 0,T=void 0,ea=void 0,za=void 0,Z=void 0,aa=void 0,P=void 0,X=void 0,W=void 0,Fa=void 0,fa=void 0,Ea=void 0,ba=void 0,da=void 0,ja=void 0,ga=void 0,ha=void 0,ma=void 0,na=void 0,qa=void 0,ra=void 0,va=void 0,wa=void 0,xa=void 0,Ga=void 0,Ha=void 0,Ja=void 0,Ia=void 0,Pa=void 0,Ua=void 0,Ka=void 0,ya=void 0,Aa=void 0,Sa=void 0,Wa=void 0,fb=0,gb=0,Ra=0,Ta=0,Xa=0,lb=0,Va=0,yb=0,cb=0,sa=
+0,Ba=0,L=0,Qa=void 0,mb=v.__vertexArray,hb=v.__uvArray,ib=v.__uv2Array,Ab=v.__normalArray,Ya=v.__tangentArray,nb=v.__colorArray,Za=v.__skinIndexArray,$a=v.__skinWeightArray,tb=v.__morphTargetsArrays,ub=v.__morphNormalsArrays,vb=v.__webglCustomAttributesList,H=void 0,jb=v.__faceArray,Bb=v.__lineArray,La=D.geometry,Ib=La.elementsNeedUpdate,Eb=La.uvsNeedUpdate,Kb=La.normalsNeedUpdate,Wb=La.tangentsNeedUpdate,Xb=La.colorsNeedUpdate,Yb=La.morphTargetsNeedUpdate,xc=La.vertices,$=v.faces3,ob=La.faces,Jb=
+La.faceVertexUvs[0],Lb=La.faceVertexUvs[1],yc=La.skinIndices,Zb=La.skinWeights,$b=La.morphTargets,Mb=La.morphNormals;if(La.verticesNeedUpdate){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],P=xc[M.a],X=xc[M.b],W=xc[M.c],mb[gb]=P.x,mb[gb+1]=P.y,mb[gb+2]=P.z,mb[gb+3]=X.x,mb[gb+4]=X.y,mb[gb+5]=X.z,mb[gb+6]=W.x,mb[gb+7]=W.y,mb[gb+8]=W.z,gb+=9;j.bindBuffer(j.ARRAY_BUFFER,v.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,mb,C)}if(Yb){Ua=0;for(Ka=$b.length;Ua<Ka;Ua++){E=Ba=0;for(I=$.length;E<I;E++)Sa=$[E],M=ob[Sa],
+P=$b[Ua].vertices[M.a],X=$b[Ua].vertices[M.b],W=$b[Ua].vertices[M.c],ya=tb[Ua],ya[Ba]=P.x,ya[Ba+1]=P.y,ya[Ba+2]=P.z,ya[Ba+3]=X.x,ya[Ba+4]=X.y,ya[Ba+5]=X.z,ya[Ba+6]=W.x,ya[Ba+7]=W.y,ya[Ba+8]=W.z,G.morphNormals&&(O?(Wa=Mb[Ua].vertexNormals[Sa],ba=Wa.a,da=Wa.b,ja=Wa.c):ja=da=ba=Mb[Ua].faceNormals[Sa],Aa=ub[Ua],Aa[Ba]=ba.x,Aa[Ba+1]=ba.y,Aa[Ba+2]=ba.z,Aa[Ba+3]=da.x,Aa[Ba+4]=da.y,Aa[Ba+5]=da.z,Aa[Ba+6]=ja.x,Aa[Ba+7]=ja.y,Aa[Ba+8]=ja.z),Ba+=9;j.bindBuffer(j.ARRAY_BUFFER,v.__webglMorphTargetsBuffers[Ua]);
+j.bufferData(j.ARRAY_BUFFER,tb[Ua],C);G.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglMorphNormalsBuffers[Ua]),j.bufferData(j.ARRAY_BUFFER,ub[Ua],C))}}if(Zb.length){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],na=Zb[M.a],qa=Zb[M.b],ra=Zb[M.c],$a[sa]=na.x,$a[sa+1]=na.y,$a[sa+2]=na.z,$a[sa+3]=na.w,$a[sa+4]=qa.x,$a[sa+5]=qa.y,$a[sa+6]=qa.z,$a[sa+7]=qa.w,$a[sa+8]=ra.x,$a[sa+9]=ra.y,$a[sa+10]=ra.z,$a[sa+11]=ra.w,va=yc[M.a],wa=yc[M.b],xa=yc[M.c],Za[sa]=va.x,Za[sa+1]=va.y,Za[sa+2]=va.z,Za[sa+3]=va.w,Za[sa+
+4]=wa.x,Za[sa+5]=wa.y,Za[sa+6]=wa.z,Za[sa+7]=wa.w,Za[sa+8]=xa.x,Za[sa+9]=xa.y,Za[sa+10]=xa.z,Za[sa+11]=xa.w,sa+=12;0<sa&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,Za,C),j.bindBuffer(j.ARRAY_BUFFER,v.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,$a,C))}if(Xb&&K){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],T=M.vertexColors,ea=M.color,3===T.length&&K===THREE.VertexColors?(ga=T[0],ha=T[1],ma=T[2]):ma=ha=ga=ea,nb[cb]=ga.r,nb[cb+1]=ga.g,nb[cb+2]=ga.b,nb[cb+3]=
+ha.r,nb[cb+4]=ha.g,nb[cb+5]=ha.b,nb[cb+6]=ma.r,nb[cb+7]=ma.g,nb[cb+8]=ma.b,cb+=9;0<cb&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,nb,C))}if(Wb&&La.hasTangents){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],za=M.vertexTangents,Fa=za[0],fa=za[1],Ea=za[2],Ya[Va]=Fa.x,Ya[Va+1]=Fa.y,Ya[Va+2]=Fa.z,Ya[Va+3]=Fa.w,Ya[Va+4]=fa.x,Ya[Va+5]=fa.y,Ya[Va+6]=fa.z,Ya[Va+7]=fa.w,Ya[Va+8]=Ea.x,Ya[Va+9]=Ea.y,Ya[Va+10]=Ea.z,Ya[Va+11]=Ea.w,Va+=12;j.bindBuffer(j.ARRAY_BUFFER,v.__webglTangentBuffer);
+j.bufferData(j.ARRAY_BUFFER,Ya,C)}if(Kb&&J){E=0;for(I=$.length;E<I;E++)if(M=ob[$[E]],R=M.vertexNormals,Q=M.normal,3===R.length&&O)for(Ga=0;3>Ga;Ga++)Ja=R[Ga],Ab[lb]=Ja.x,Ab[lb+1]=Ja.y,Ab[lb+2]=Ja.z,lb+=3;else for(Ga=0;3>Ga;Ga++)Ab[lb]=Q.x,Ab[lb+1]=Q.y,Ab[lb+2]=Q.z,lb+=3;j.bindBuffer(j.ARRAY_BUFFER,v.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Ab,C)}if(Eb&&Jb&&N){E=0;for(I=$.length;E<I;E++)if(V=$[E],Z=Jb[V],void 0!==Z)for(Ga=0;3>Ga;Ga++)Ia=Z[Ga],hb[Ra]=Ia.x,hb[Ra+1]=Ia.y,Ra+=2;0<Ra&&(j.bindBuffer(j.ARRAY_BUFFER,
+v.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,hb,C))}if(Eb&&Lb&&N){E=0;for(I=$.length;E<I;E++)if(V=$[E],aa=Lb[V],void 0!==aa)for(Ga=0;3>Ga;Ga++)Pa=aa[Ga],ib[Ta]=Pa.x,ib[Ta+1]=Pa.y,Ta+=2;0<Ta&&(j.bindBuffer(j.ARRAY_BUFFER,v.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,ib,C))}if(Ib){E=0;for(I=$.length;E<I;E++)jb[Xa]=fb,jb[Xa+1]=fb+1,jb[Xa+2]=fb+2,Xa+=3,Bb[yb]=fb,Bb[yb+1]=fb+1,Bb[yb+2]=fb,Bb[yb+3]=fb+2,Bb[yb+4]=fb+1,Bb[yb+5]=fb+2,yb+=6,fb+=3;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,v.__webglFaceBuffer);
+j.bufferData(j.ELEMENT_ARRAY_BUFFER,jb,C);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,v.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Bb,C)}if(vb){Ga=0;for(Ha=vb.length;Ga<Ha;Ga++)if(H=vb[Ga],H.__original.needsUpdate){L=0;if(1===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],H.array[L]=H.value[M.a],H.array[L+1]=H.value[M.b],H.array[L+2]=H.value[M.c],L+=3}else{if("faces"===H.boundTo){E=0;for(I=$.length;E<I;E++)Qa=H.value[$[E]],H.array[L]=Qa,H.array[L+1]=
+Qa,H.array[L+2]=Qa,L+=3}}else if(2===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}else{if("faces"===H.boundTo){E=0;for(I=$.length;E<I;E++)W=X=P=Qa=H.value[$[E]],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=X.x,H.array[L+3]=X.y,H.array[L+4]=W.x,H.array[L+5]=W.y,L+=6}}else if(3===H.size){var pa;pa="c"===H.type?
+["r","g","b"]:["x","y","z"];if(void 0===H.boundTo||"vertices"===H.boundTo){E=0;for(I=$.length;E<I;E++)M=ob[$[E]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+2]=P[pa[2]],H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}else if("faces"===H.boundTo){E=0;for(I=$.length;E<I;E++)W=X=P=Qa=H.value[$[E]],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+2]=P[pa[2]],
+H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}else if("faceVertices"===H.boundTo){E=0;for(I=$.length;E<I;E++)Qa=H.value[$[E]],P=Qa[0],X=Qa[1],W=Qa[2],H.array[L]=P[pa[0]],H.array[L+1]=P[pa[1]],H.array[L+2]=P[pa[2]],H.array[L+3]=X[pa[0]],H.array[L+4]=X[pa[1]],H.array[L+5]=X[pa[2]],H.array[L+6]=W[pa[0]],H.array[L+7]=W[pa[1]],H.array[L+8]=W[pa[2]],L+=9}}else if(4===H.size)if(void 0===H.boundTo||"vertices"===H.boundTo){E=
+0;for(I=$.length;E<I;E++)M=ob[$[E]],P=H.value[M.a],X=H.value[M.b],W=H.value[M.c],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faces"===H.boundTo){E=0;for(I=$.length;E<I;E++)W=X=P=Qa=H.value[$[E]],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,
+H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}else if("faceVertices"===H.boundTo){E=0;for(I=$.length;E<I;E++)Qa=H.value[$[E]],P=Qa[0],X=Qa[1],W=Qa[2],H.array[L]=P.x,H.array[L+1]=P.y,H.array[L+2]=P.z,H.array[L+3]=P.w,H.array[L+4]=X.x,H.array[L+5]=X.y,H.array[L+6]=X.z,H.array[L+7]=X.w,H.array[L+8]=W.x,H.array[L+9]=W.y,H.array[L+10]=W.z,H.array[L+11]=W.w,L+=12}j.bindBuffer(j.ARRAY_BUFFER,H.buffer);j.bufferData(j.ARRAY_BUFFER,H.array,C)}}F&&(delete v.__inittedArrays,delete v.__colorArray,
+delete v.__normalArray,delete v.__tangentArray,delete v.__uvArray,delete v.__uv2Array,delete v.__faceArray,delete v.__vertexArray,delete v.__lineArray,delete v.__skinIndexArray,delete v.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.Ribbon){t=d(i,l);n=t.attributes&&p(t);if(l.verticesNeedUpdate||
 l.colorsNeedUpdate||l.normalsNeedUpdate||n){var ab=l,ac=j.DYNAMIC_DRAW,Pb=void 0,Qb=void 0,Rb=void 0,bc=void 0,ca=void 0,cc=void 0,dc=void 0,ec=void 0,Nb=void 0,Ca=void 0,Fb=void 0,ka=void 0,Ma=void 0,Ob=ab.vertices,Ec=ab.colors,Fc=ab.normals,pc=Ob.length,qc=Ec.length,rc=Fc.length,fc=ab.__vertexArray,gc=ab.__colorArray,hc=ab.__normalArray,sc=ab.colorsNeedUpdate,tc=ab.normalsNeedUpdate,zc=ab.__webglCustomAttributesList;if(ab.verticesNeedUpdate){for(Pb=0;Pb<pc;Pb++)bc=Ob[Pb],ca=3*Pb,fc[ca]=bc.x,fc[ca+
 1]=bc.y,fc[ca+2]=bc.z;j.bindBuffer(j.ARRAY_BUFFER,ab.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,fc,ac)}if(sc){for(Qb=0;Qb<qc;Qb++)cc=Ec[Qb],ca=3*Qb,gc[ca]=cc.r,gc[ca+1]=cc.g,gc[ca+2]=cc.b;j.bindBuffer(j.ARRAY_BUFFER,ab.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,gc,ac)}if(tc){for(Rb=0;Rb<rc;Rb++)dc=Fc[Rb],ca=3*Rb,hc[ca]=dc.x,hc[ca+1]=dc.y,hc[ca+2]=dc.z;j.bindBuffer(j.ARRAY_BUFFER,ab.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,hc,ac)}if(zc){ec=0;for(Nb=zc.length;ec<Nb;ec++)if(ka=zc[ec],
 ka.needsUpdate&&(void 0===ka.boundTo||"vertices"===ka.boundTo)){ca=0;Fb=ka.value.length;if(1===ka.size)for(Ca=0;Ca<Fb;Ca++)ka.array[Ca]=ka.value[Ca];else if(2===ka.size)for(Ca=0;Ca<Fb;Ca++)Ma=ka.value[Ca],ka.array[ca]=Ma.x,ka.array[ca+1]=Ma.y,ca+=2;else if(3===ka.size)if("c"===ka.type)for(Ca=0;Ca<Fb;Ca++)Ma=ka.value[Ca],ka.array[ca]=Ma.r,ka.array[ca+1]=Ma.g,ka.array[ca+2]=Ma.b,ca+=3;else for(Ca=0;Ca<Fb;Ca++)Ma=ka.value[Ca],ka.array[ca]=Ma.x,ka.array[ca+1]=Ma.y,ka.array[ca+2]=Ma.z,ca+=3;else if(4===
-ka.size)for(Ca=0;Ca<Fb;Ca++)Ma=ka.value[Ca],ka.array[ca]=Ma.x,ka.array[ca+1]=Ma.y,ka.array[ca+2]=Ma.z,ka.array[ca+3]=Ma.w,ca+=4;j.bindBuffer(j.ARRAY_BUFFER,ka.buffer);j.bufferData(j.ARRAY_BUFFER,ka.array,ac)}}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.normalsNeedUpdate=!1;s.attributes&&q(s)}else if(i instanceof THREE.Line){s=d(i,l);n=s.attributes&&p(s);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||n){var bb=l,ic=j.DYNAMIC_DRAW,Sb=void 0,Tb=void 0,Ub=void 0,jc=void 0,
+ka.size)for(Ca=0;Ca<Fb;Ca++)Ma=ka.value[Ca],ka.array[ca]=Ma.x,ka.array[ca+1]=Ma.y,ka.array[ca+2]=Ma.z,ka.array[ca+3]=Ma.w,ca+=4;j.bindBuffer(j.ARRAY_BUFFER,ka.buffer);j.bufferData(j.ARRAY_BUFFER,ka.array,ac)}}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.normalsNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.Line){t=d(i,l);n=t.attributes&&p(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||n){var bb=l,ic=j.DYNAMIC_DRAW,Sb=void 0,Tb=void 0,Ub=void 0,jc=void 0,
 oa=void 0,kc=void 0,Gc=bb.vertices,Hc=bb.colors,Ic=bb.lineDistances,uc=Gc.length,vc=Hc.length,Oc=Ic.length,lc=bb.__vertexArray,mc=bb.__colorArray,Jc=bb.__lineDistanceArray,Pc=bb.colorsNeedUpdate,Qc=bb.lineDistancesNeedUpdate,Ac=bb.__webglCustomAttributesList,nc=void 0,Kc=void 0,Da=void 0,Gb=void 0,Na=void 0,la=void 0;if(bb.verticesNeedUpdate){for(Sb=0;Sb<uc;Sb++)jc=Gc[Sb],oa=3*Sb,lc[oa]=jc.x,lc[oa+1]=jc.y,lc[oa+2]=jc.z;j.bindBuffer(j.ARRAY_BUFFER,bb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,
 lc,ic)}if(Pc){for(Tb=0;Tb<vc;Tb++)kc=Hc[Tb],oa=3*Tb,mc[oa]=kc.r,mc[oa+1]=kc.g,mc[oa+2]=kc.b;j.bindBuffer(j.ARRAY_BUFFER,bb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,mc,ic)}if(Qc){for(Ub=0;Ub<Oc;Ub++)Jc[Ub]=Ic[Ub];j.bindBuffer(j.ARRAY_BUFFER,bb.__webglLineDistanceBuffer);j.bufferData(j.ARRAY_BUFFER,Jc,ic)}if(Ac){nc=0;for(Kc=Ac.length;nc<Kc;nc++)if(la=Ac[nc],la.needsUpdate&&(void 0===la.boundTo||"vertices"===la.boundTo)){oa=0;Gb=la.value.length;if(1===la.size)for(Da=0;Da<Gb;Da++)la.array[Da]=
 la.value[Da];else if(2===la.size)for(Da=0;Da<Gb;Da++)Na=la.value[Da],la.array[oa]=Na.x,la.array[oa+1]=Na.y,oa+=2;else if(3===la.size)if("c"===la.type)for(Da=0;Da<Gb;Da++)Na=la.value[Da],la.array[oa]=Na.r,la.array[oa+1]=Na.g,la.array[oa+2]=Na.b,oa+=3;else for(Da=0;Da<Gb;Da++)Na=la.value[Da],la.array[oa]=Na.x,la.array[oa+1]=Na.y,la.array[oa+2]=Na.z,oa+=3;else if(4===la.size)for(Da=0;Da<Gb;Da++)Na=la.value[Da],la.array[oa]=Na.x,la.array[oa+1]=Na.y,la.array[oa+2]=Na.z,la.array[oa+3]=Na.w,oa+=4;j.bindBuffer(j.ARRAY_BUFFER,
-la.buffer);j.bufferData(j.ARRAY_BUFFER,la.array,ic)}}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;s.attributes&&q(s)}else if(i instanceof THREE.ParticleSystem){s=d(i,l);n=s.attributes&&p(s);if(l.verticesNeedUpdate||l.colorsNeedUpdate||i.sortParticles||n){var pb=l,Bc=j.DYNAMIC_DRAW,Vb=i,Oa=void 0,qb=void 0,rb=void 0,U=void 0,sb=void 0,zb=void 0,oc=pb.vertices,Cc=oc.length,Dc=pb.colors,Lc=Dc.length,Cb=pb.__vertexArray,Db=pb.__colorArray,wb=pb.__sortArray,Mc=pb.verticesNeedUpdate,
+la.buffer);j.bufferData(j.ARRAY_BUFFER,la.array,ic)}}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;t.attributes&&s(t)}else if(i instanceof THREE.ParticleSystem){t=d(i,l);n=t.attributes&&p(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||i.sortParticles||n){var pb=l,Bc=j.DYNAMIC_DRAW,Vb=i,Oa=void 0,qb=void 0,rb=void 0,U=void 0,sb=void 0,zb=void 0,oc=pb.vertices,Cc=oc.length,Dc=pb.colors,Lc=Dc.length,Cb=pb.__vertexArray,Db=pb.__colorArray,wb=pb.__sortArray,Mc=pb.verticesNeedUpdate,
 Nc=pb.colorsNeedUpdate,xb=pb.__webglCustomAttributesList,db=void 0,Hb=void 0,Y=void 0,eb=void 0,ia=void 0,S=void 0;if(Vb.sortParticles){kb.copy(ta);kb.multiply(Vb.matrixWorld);for(Oa=0;Oa<Cc;Oa++)rb=oc[Oa],ua.copy(rb),ua.applyProjection(kb),wb[Oa]=[ua.z,Oa];wb.sort(k);for(Oa=0;Oa<Cc;Oa++)rb=oc[wb[Oa][1]],U=3*Oa,Cb[U]=rb.x,Cb[U+1]=rb.y,Cb[U+2]=rb.z;for(qb=0;qb<Lc;qb++)U=3*qb,zb=Dc[wb[qb][1]],Db[U]=zb.r,Db[U+1]=zb.g,Db[U+2]=zb.b;if(xb){db=0;for(Hb=xb.length;db<Hb;db++)if(S=xb[db],void 0===S.boundTo||
 "vertices"===S.boundTo)if(U=0,eb=S.value.length,1===S.size)for(Y=0;Y<eb;Y++)sb=wb[Y][1],S.array[Y]=S.value[sb];else if(2===S.size)for(Y=0;Y<eb;Y++)sb=wb[Y][1],ia=S.value[sb],S.array[U]=ia.x,S.array[U+1]=ia.y,U+=2;else if(3===S.size)if("c"===S.type)for(Y=0;Y<eb;Y++)sb=wb[Y][1],ia=S.value[sb],S.array[U]=ia.r,S.array[U+1]=ia.g,S.array[U+2]=ia.b,U+=3;else for(Y=0;Y<eb;Y++)sb=wb[Y][1],ia=S.value[sb],S.array[U]=ia.x,S.array[U+1]=ia.y,S.array[U+2]=ia.z,U+=3;else if(4===S.size)for(Y=0;Y<eb;Y++)sb=wb[Y][1],
 ia=S.value[sb],S.array[U]=ia.x,S.array[U+1]=ia.y,S.array[U+2]=ia.z,S.array[U+3]=ia.w,U+=4}}else{if(Mc)for(Oa=0;Oa<Cc;Oa++)rb=oc[Oa],U=3*Oa,Cb[U]=rb.x,Cb[U+1]=rb.y,Cb[U+2]=rb.z;if(Nc)for(qb=0;qb<Lc;qb++)zb=Dc[qb],U=3*qb,Db[U]=zb.r,Db[U+1]=zb.g,Db[U+2]=zb.b;if(xb){db=0;for(Hb=xb.length;db<Hb;db++)if(S=xb[db],S.needsUpdate&&(void 0===S.boundTo||"vertices"===S.boundTo))if(eb=S.value.length,U=0,1===S.size)for(Y=0;Y<eb;Y++)S.array[Y]=S.value[Y];else if(2===S.size)for(Y=0;Y<eb;Y++)ia=S.value[Y],S.array[U]=
 ia.x,S.array[U+1]=ia.y,U+=2;else if(3===S.size)if("c"===S.type)for(Y=0;Y<eb;Y++)ia=S.value[Y],S.array[U]=ia.r,S.array[U+1]=ia.g,S.array[U+2]=ia.b,U+=3;else for(Y=0;Y<eb;Y++)ia=S.value[Y],S.array[U]=ia.x,S.array[U+1]=ia.y,S.array[U+2]=ia.z,U+=3;else if(4===S.size)for(Y=0;Y<eb;Y++)ia=S.value[Y],S.array[U]=ia.x,S.array[U+1]=ia.y,S.array[U+2]=ia.z,S.array[U+3]=ia.w,U+=4}}if(Mc||Vb.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,pb.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,Cb,Bc);if(Nc||Vb.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,
-pb.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,Db,Bc);if(xb){db=0;for(Hb=xb.length;db<Hb;db++)if(S=xb[db],S.needsUpdate||Vb.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,S.buffer),j.bufferData(j.ARRAY_BUFFER,S.array,Bc)}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;s.attributes&&q(s)}}};this.initMaterial=function(a,b,c,d){var e,f,g,h;a.addEventListener("dispose",Mb);var i,k,l,m,n;a instanceof THREE.MeshDepthMaterial?n="depth":a instanceof THREE.MeshNormalMaterial?n="normal":a instanceof THREE.MeshBasicMaterial?
-n="basic":a instanceof THREE.MeshLambertMaterial?n="lambert":a instanceof THREE.MeshPhongMaterial?n="phong":a instanceof THREE.LineBasicMaterial?n="basic":a instanceof THREE.LineDashedMaterial?n="dashed":a instanceof THREE.ParticleBasicMaterial&&(n="particle_basic");if(n){var p=THREE.ShaderLib[n];a.uniforms=THREE.UniformsUtils.clone(p.uniforms);a.vertexShader=p.vertexShader;a.fragmentShader=p.fragmentShader}var q=e=0,t=0,r=p=0;for(f=b.length;r<f;r++)g=b[r],g.onlyShadow||(g instanceof THREE.DirectionalLight&&
-e++,g instanceof THREE.PointLight&&q++,g instanceof THREE.SpotLight&&t++,g instanceof THREE.HemisphereLight&&p++);f=q;g=t;h=p;t=p=0;for(q=b.length;t<q;t++)r=b[t],r.castShadow&&(r instanceof THREE.SpotLight&&p++,r instanceof THREE.DirectionalLight&&!r.shadowCascade&&p++);m=p;Eb&&d&&d.useVertexTexture?l=1024:(b=j.getParameter(j.MAX_VERTEX_UNIFORM_VECTORS),b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(b=Math.min(d.bones.length,b),b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+
-d.bones.length+", this GPU supports just "+b+" (try OpenGL instead of ANGLE)")),l=b);a:{var t=a.fragmentShader,q=a.vertexShader,p=a.uniforms,b=a.attributes,r=a.defines,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,maxBones:l,useVertexTexture:Eb&&d&&d.useVertexTexture,boneTextureWidth:d&&
+pb.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,Db,Bc);if(xb){db=0;for(Hb=xb.length;db<Hb;db++)if(S=xb[db],S.needsUpdate||Vb.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,S.buffer),j.bufferData(j.ARRAY_BUFFER,S.array,Bc)}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;t.attributes&&s(t)}}};this.initMaterial=function(a,b,c,d){var e,f,g,h;a.addEventListener("dispose",Mb);var i,k,l,m,n;a instanceof THREE.MeshDepthMaterial?n="depth":a instanceof THREE.MeshNormalMaterial?n="normal":a instanceof THREE.MeshBasicMaterial?
+n="basic":a instanceof THREE.MeshLambertMaterial?n="lambert":a instanceof THREE.MeshPhongMaterial?n="phong":a instanceof THREE.LineBasicMaterial?n="basic":a instanceof THREE.LineDashedMaterial?n="dashed":a instanceof THREE.ParticleBasicMaterial&&(n="particle_basic");if(n){var p=THREE.ShaderLib[n];a.uniforms=THREE.UniformsUtils.clone(p.uniforms);a.vertexShader=p.vertexShader;a.fragmentShader=p.fragmentShader}var r=e=0,q=0,s=p=0;for(f=b.length;s<f;s++)g=b[s],g.onlyShadow||(g instanceof THREE.DirectionalLight&&
+e++,g instanceof THREE.PointLight&&r++,g instanceof THREE.SpotLight&&q++,g instanceof THREE.HemisphereLight&&p++);f=r;g=q;h=p;q=p=0;for(r=b.length;q<r;q++)s=b[q],s.castShadow&&(s instanceof THREE.SpotLight&&p++,s instanceof THREE.DirectionalLight&&!s.shadowCascade&&p++);m=p;Eb&&d&&d.useVertexTexture?l=1024:(b=j.getParameter(j.MAX_VERTEX_UNIFORM_VECTORS),b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(b=Math.min(d.bones.length,b),b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+
+d.bones.length+", this GPU supports just "+b+" (try OpenGL instead of ANGLE)")),l=b);a:{var q=a.fragmentShader,r=a.vertexShader,p=a.uniforms,b=a.attributes,s=a.defines,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,maxBones:l,useVertexTexture:Eb&&d&&d.useVertexTexture,boneTextureWidth:d&&
 d.boneTextureWidth,boneTextureHeight:d&&d.boneTextureHeight,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLights:g,maxHemiLights:h,maxShadows:m,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround,
-doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide},d=a.index0AttributeName,s,u,w;e=[];n?e.push(n):(e.push(t),e.push(q));for(u in r)e.push(u),e.push(r[u]);for(s in c)e.push(s),e.push(c[s]);n=e.join();s=0;for(u=da.length;s<u;s++)if(e=da[s],e.code===n){e.usedTimes++;k=e.program;break a}s="SHADOWMAP_TYPE_BASIC";c.shadowMapType===THREE.PCFShadowMap?s="SHADOWMAP_TYPE_PCF":c.shadowMapType===THREE.PCFSoftShadowMap&&(s="SHADOWMAP_TYPE_PCF_SOFT");u=[];for(w in r)e=r[w],!1!==e&&(e="#define "+
+doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide},d=a.index0AttributeName,t,u,w;e=[];n?e.push(n):(e.push(q),e.push(r));for(u in s)e.push(u),e.push(s[u]);for(t in c)e.push(t),e.push(c[t]);n=e.join();t=0;for(u=da.length;t<u;t++)if(e=da[t],e.code===n){e.usedTimes++;k=e.program;break a}t="SHADOWMAP_TYPE_BASIC";c.shadowMapType===THREE.PCFShadowMap?t="SHADOWMAP_TYPE_PCF":c.shadowMapType===THREE.PCFSoftShadowMap&&(t="SHADOWMAP_TYPE_PCF_SOFT");u=[];for(w in s)e=s[w],!1!==e&&(e="#define "+
 w+" "+e,u.push(e));e=u.join("\n");w=j.createProgram();u=["precision "+R+" float;","precision "+R+" int;",e,Ib?"#define VERTEX_TEXTURES":"",K.gammaInput?"#define GAMMA_INPUT":"",K.gammaOutput?"#define GAMMA_OUTPUT":"",K.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+
 c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.boneTextureWidth?"#define N_BONE_PIXEL_X "+c.boneTextureWidth.toFixed(1):"",c.boneTextureHeight?"#define N_BONE_PIXEL_Y "+c.boneTextureHeight.toFixed(1):"",
-c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+s:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
-s=["precision "+R+" float;","precision "+R+" int;",c.bumpMap||c.normalMap?"#extension GL_OES_standard_derivatives : enable":"",e,"#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",K.gammaInput?"#define GAMMA_INPUT":"",K.gammaOutput?"#define GAMMA_OUTPUT":"",K.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":
+c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+t:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
+t=["precision "+R+" float;","precision "+R+" int;",c.bumpMap||c.normalMap?"#extension GL_OES_standard_derivatives : enable":"",e,"#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",K.gammaInput?"#define GAMMA_INPUT":"",K.gammaOutput?"#define GAMMA_OUTPUT":"",K.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":
 "",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":
-"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+s:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");u=x("vertex",u+q);s=x("fragment",s+t);j.attachShader(w,u);j.attachShader(w,s);d&&j.bindAttribLocation(w,0,d);j.linkProgram(w);j.getProgramParameter(w,j.LINK_STATUS)||(console.error("Could not initialise shader\nVALIDATE_STATUS: "+j.getProgramParameter(w,
-j.VALIDATE_STATUS)+", gl error ["+j.getError()+"]"),console.error("Program Info Log: "+j.getProgramInfoLog(w)));j.deleteShader(s);j.deleteShader(u);w.uniforms={};w.attributes={};var v;s="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?s.push("boneTexture"):s.push("boneGlobalMatrices");for(v in p)s.push(v);v=s;s=0;for(u=v.length;s<u;s++)p=v[s],w.uniforms[p]=j.getUniformLocation(w,p);s="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");
-for(v=0;v<c.maxMorphTargets;v++)s.push("morphTarget"+v);for(v=0;v<c.maxMorphNormals;v++)s.push("morphNormal"+v);for(k in b)s.push(k);k=s;v=0;for(b=k.length;v<b;v++)s=k[v],w.attributes[s]=j.getAttribLocation(w,s);w.id=za++;da.push({program:w,code:n,usedTimes:1});K.info.memory.programs=da.length;k=w}a.program=k;v=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";for(k=0;k<this.maxMorphTargets;k++)w=b+k,0<=v[w]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=
+"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+t:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");u=B("vertex",u+r);t=B("fragment",t+q);j.attachShader(w,u);j.attachShader(w,t);d&&j.bindAttribLocation(w,0,d);j.linkProgram(w);j.getProgramParameter(w,j.LINK_STATUS)||(console.error("Could not initialise shader\nVALIDATE_STATUS: "+j.getProgramParameter(w,
+j.VALIDATE_STATUS)+", gl error ["+j.getError()+"]"),console.error("Program Info Log: "+j.getProgramInfoLog(w)));j.deleteShader(t);j.deleteShader(u);w.uniforms={};w.attributes={};var v;t="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?t.push("boneTexture"):t.push("boneGlobalMatrices");for(v in p)t.push(v);v=t;t=0;for(u=v.length;t<u;t++)p=v[t],w.uniforms[p]=j.getUniformLocation(w,p);t="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");
+for(v=0;v<c.maxMorphTargets;v++)t.push("morphTarget"+v);for(v=0;v<c.maxMorphNormals;v++)t.push("morphNormal"+v);for(k in b)t.push(k);k=t;v=0;for(b=k.length;v<b;v++)t=k[v],w.attributes[t]=j.getAttribLocation(w,t);w.id=za++;da.push({program:w,code:n,usedTimes:1});K.info.memory.programs=da.length;k=w}a.program=k;v=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";for(k=0;k<this.maxMorphTargets;k++)w=b+k,0<=v[w]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=
 0;b="morphNormal";for(k=0;k<this.maxMorphNormals;k++)w=b+k,0<=v[w]&&a.numSupportedMorphNormals++}a.uniformsList=[];for(i in a.uniforms)a.uniformsList.push([a.uniforms[i],i])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?j.disable(j.CULL_FACE):(b===THREE.FrontFaceDirectionCW?j.frontFace(j.CW):j.frontFace(j.CCW),a===THREE.CullFaceBack?j.cullFace(j.BACK):a===THREE.CullFaceFront?j.cullFace(j.FRONT):j.cullFace(j.FRONT_AND_BACK),j.enable(j.CULL_FACE))};this.setMaterialFaces=function(a){var b=
 a.side===THREE.DoubleSide,a=a.side===THREE.BackSide;P!==b&&(b?j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),P=b);T!==a&&(a?j.frontFace(j.CW):j.frontFace(j.CCW),T=a)};this.setDepthTest=function(a){Ja!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),Ja=a)};this.setDepthWrite=function(a){ga!==a&&(j.depthMask(a),ga=a)};this.setBlending=function(a,b,c,d){a!==ma&&(a===THREE.NoBlending?j.disable(j.BLEND):a===THREE.AdditiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.SRC_ALPHA,
 j.ONE)):a===THREE.SubtractiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.SRC_COLOR)):a===THREE.CustomBlending?j.enable(j.BLEND):(j.enable(j.BLEND),j.blendEquationSeparate(j.FUNC_ADD,j.FUNC_ADD),j.blendFuncSeparate(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA,j.ONE,j.ONE_MINUS_SRC_ALPHA)),ma=a);if(a===THREE.CustomBlending){if(b!==va&&(j.blendEquation(A(b)),va=b),
 c!==ja||d!==Pa)j.blendFunc(A(c),A(d)),ja=c,Pa=d}else Pa=ja=va=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",Kb),a.__webglTexture=j.createTexture(),K.info.memory.textures++);j.activeTexture(j.TEXTURE0+b);j.bindTexture(j.TEXTURE_2D,a.__webglTexture);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,a.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=0===
-(c.width&c.width-1)&&0===(c.height&c.height-1),e=A(a.format),f=A(a.type);B(j.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,i=g.length;h<i;h++)c=g[h],j.texImage2D(j.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else j.texImage2D(j.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture){h=0;for(i=g.length;h<i;h++)c=g[h],j.compressedTexImage2D(j.TEXTURE_2D,h,e,c.width,c.height,0,c.data)}else if(0<
+(c.width&c.width-1)&&0===(c.height&c.height-1),e=A(a.format),f=A(a.type);E(j.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,i=g.length;h<i;h++)c=g[h],j.texImage2D(j.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else j.texImage2D(j.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture){h=0;for(i=g.length;h<i;h++)c=g[h],j.compressedTexImage2D(j.TEXTURE_2D,h,e,c.width,c.height,0,c.data)}else if(0<
 g.length&&d){h=0;for(i=g.length;h<i;h++)c=g[h],j.texImage2D(j.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else j.texImage2D(j.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&j.generateMipmap(j.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else j.activeTexture(j.TEXTURE0+b),j.bindTexture(j.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&
-(a.stencilBuffer=!0);a.addEventListener("dispose",Lb);a.__webglTexture=j.createTexture();K.info.memory.textures++;var c=0===(a.width&a.width-1)&&0===(a.height&a.height-1),d=A(a.format),e=A(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];j.bindTexture(j.TEXTURE_CUBE_MAP,a.__webglTexture);B(j.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=j.createFramebuffer();a.__webglRenderbuffer[f]=j.createRenderbuffer();j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,
-a.height,0,d,e,null);var g=a,h=j.TEXTURE_CUBE_MAP_POSITIVE_X+f;j.bindFramebuffer(j.FRAMEBUFFER,a.__webglFramebuffer[f]);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,h,g.__webglTexture,0);I(a.__webglRenderbuffer[f],a)}c&&j.generateMipmap(j.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=j.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:j.createRenderbuffer(),j.bindTexture(j.TEXTURE_2D,a.__webglTexture),B(j.TEXTURE_2D,a,c),j.texImage2D(j.TEXTURE_2D,
+(a.stencilBuffer=!0);a.addEventListener("dispose",Lb);a.__webglTexture=j.createTexture();K.info.memory.textures++;var c=0===(a.width&a.width-1)&&0===(a.height&a.height-1),d=A(a.format),e=A(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];j.bindTexture(j.TEXTURE_CUBE_MAP,a.__webglTexture);E(j.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=j.createFramebuffer();a.__webglRenderbuffer[f]=j.createRenderbuffer();j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,
+a.height,0,d,e,null);var g=a,h=j.TEXTURE_CUBE_MAP_POSITIVE_X+f;j.bindFramebuffer(j.FRAMEBUFFER,a.__webglFramebuffer[f]);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,h,g.__webglTexture,0);I(a.__webglRenderbuffer[f],a)}c&&j.generateMipmap(j.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=j.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:j.createRenderbuffer(),j.bindTexture(j.TEXTURE_2D,a.__webglTexture),E(j.TEXTURE_2D,a,c),j.texImage2D(j.TEXTURE_2D,
 0,d,a.width,a.height,0,d,e,null),d=j.TEXTURE_2D,j.bindFramebuffer(j.FRAMEBUFFER,a.__webglFramebuffer),j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_ATTACHMENT,j.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_STENCIL_ATTACHMENT,j.RENDERBUFFER,a.__webglRenderbuffer):I(a.__webglRenderbuffer,a),c&&j.generateMipmap(j.TEXTURE_2D);
 b?j.bindTexture(j.TEXTURE_CUBE_MAP,null):j.bindTexture(j.TEXTURE_2D,null);j.bindRenderbuffer(j.RENDERBUFFER,null);j.bindFramebuffer(j.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=tb,a=ub,d=hb,e=ib);b!==ea&&(j.bindFramebuffer(j.FRAMEBUFFER,b),j.viewport(d,e,c,a),ea=b);vb=c;jb=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:
 THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null};
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;a.shareDepthFrom=this.shareDepthFrom;
 return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};THREE.RenderableFace3=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidModel=new THREE.Vector3;this.normalModel=new THREE.Vector3;this.normalModelView=new THREE.Vector3;this.vertexNormalsLength=0;this.vertexNormalsModel=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.vertexNormalsModelView=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.material=this.color=null;this.uvs=[[]];this.z=
-0};THREE.RenderableObject=function(){this.id=0;this.object=null;this.z=0};THREE.RenderableParticle=function(){this.id=0;this.object=null;this.z=this.y=this.x=0;this.rotation=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.vertexColors=[new THREE.Color,new THREE.Color];this.material=null;this.z=0};THREE.GeometryUtils={merge:function(a,b,c){var d,e,f=a.vertices.length,h=b instanceof THREE.Mesh?b.geometry:b,g=a.vertices,i=h.vertices,k=a.faces,l=h.faces,a=a.faceVertexUvs[0],h=h.faceVertexUvs[0];void 0===c&&(c=0);b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,e=(new THREE.Matrix3).getNormalMatrix(d));for(var b=0,m=i.length;b<m;b++){var n=i[b].clone();d&&n.applyMatrix4(d);g.push(n)}b=0;for(m=l.length;b<m;b++){var n=l[b],t,s,p=n.vertexNormals,q=n.vertexColors;t=new THREE.Face3(n.a+
-f,n.b+f,n.c+f);t.normal.copy(n.normal);e&&t.normal.applyMatrix3(e).normalize();g=0;for(i=p.length;g<i;g++)s=p[g].clone(),e&&s.applyMatrix3(e).normalize(),t.vertexNormals.push(s);t.color.copy(n.color);g=0;for(i=q.length;g<i;g++)s=q[g],t.vertexColors.push(s.clone());t.materialIndex=n.materialIndex+c;t.centroid.copy(n.centroid);d&&t.centroid.applyMatrix4(d);k.push(t)}b=0;for(m=h.length;b<m;b++){c=h[b];d=[];g=0;for(i=c.length;g<i;g++)d.push(new THREE.Vector2(c[g].x,c[g].y));a.push(d)}},removeMaterials:function(a,
+0};THREE.RenderableObject=function(){this.id=0;this.object=null;this.z=0};THREE.RenderableParticle=function(){this.id=0;this.object=null;this.z=this.y=this.x=0;this.rotation=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.vertexColors=[new THREE.Color,new THREE.Color];this.material=null;this.z=0};THREE.GeometryUtils={merge:function(a,b,c){var d,e,f=a.vertices.length,h=b instanceof THREE.Mesh?b.geometry:b,g=a.vertices,i=h.vertices,k=a.faces,l=h.faces,a=a.faceVertexUvs[0],h=h.faceVertexUvs[0];void 0===c&&(c=0);b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,e=(new THREE.Matrix3).getNormalMatrix(d));for(var b=0,m=i.length;b<m;b++){var n=i[b].clone();d&&n.applyMatrix4(d);g.push(n)}b=0;for(m=l.length;b<m;b++){var n=l[b],r,t,p=n.vertexNormals,s=n.vertexColors;r=new THREE.Face3(n.a+
+f,n.b+f,n.c+f);r.normal.copy(n.normal);e&&r.normal.applyMatrix3(e).normalize();g=0;for(i=p.length;g<i;g++)t=p[g].clone(),e&&t.applyMatrix3(e).normalize(),r.vertexNormals.push(t);r.color.copy(n.color);g=0;for(i=s.length;g<i;g++)t=s[g],r.vertexColors.push(t.clone());r.materialIndex=n.materialIndex+c;r.centroid.copy(n.centroid);d&&r.centroid.applyMatrix4(d);k.push(r)}b=0;for(m=h.length;b<m;b++){c=h[b];d=[];g=0;for(i=c.length;g<i;g++)d.push(new THREE.Vector2(c[g].x,c[g].y));a.push(d)}},removeMaterials:function(a,
 b){for(var c={},d=0,e=b.length;d<e;d++)c[b[d]]=!0;for(var f,h=[],d=0,e=a.faces.length;d<e;d++)f=a.faces[d],f.materialIndex in c||h.push(f);a.faces=h},randomPointInTriangle:function(){var a=new THREE.Vector3;return function(b,c,d){var e=new THREE.Vector3,f=THREE.Math.random16(),h=THREE.Math.random16();1<f+h&&(f=1-f,h=1-h);var g=1-f-h;e.copy(b);e.multiplyScalar(f);a.copy(c);a.multiplyScalar(h);e.add(a);a.copy(d);a.multiplyScalar(g);e.add(a);return e}}(),randomPointInFace:function(a,b){return THREE.GeometryUtils.randomPointInTriangle(b.vertices[a.a],
 b.vertices[a.b],b.vertices[a.c])},randomPointsInGeometry:function(a,b){function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2);return k[e]>a?b(c,e-1):k[e]<a?b(e+1,d):e}return b(0,k.length-1)}var d,e,f=a.faces,h=a.vertices,g=f.length,i=0,k=[],l,m,n;for(e=0;e<g;e++)d=f[e],l=h[d.a],m=h[d.b],n=h[d.c],d._area=THREE.GeometryUtils.triangleArea(l,m,n),i+=d._area,k[e]=i;d=[];for(e=0;e<b;e++)h=THREE.Math.random16()*i,h=c(h),d[e]=THREE.GeometryUtils.randomPointInFace(f[h],a,!0);return d},triangleArea:function(){var a=
 new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){a.subVectors(d,c);b.subVectors(e,c);a.cross(b);return 0.5*a.length()}}(),center:function(a){a.computeBoundingBox();var b=a.boundingBox,c=new THREE.Vector3;c.addVectors(b.min,b.max);c.multiplyScalar(-0.5);a.applyMatrix((new THREE.Matrix4).makeTranslation(c.x,c.y,c.z));a.computeBoundingBox();return c},triangulateQuads:function(a){var b,c,d,e,f=[],h=[];b=0;for(c=a.faceVertexUvs.length;b<c;b++)h[b]=[];b=0;for(c=a.faces.length;b<c;b++){f.push(a.faces[b]);
@@ -516,14 +517,14 @@ i,!0);k.responseType="arraybuffer";k.send(null)}else k=new XMLHttpRequest,k.onlo
 b){function c(a){return a.charCodeAt(0)+(a.charCodeAt(1)<<8)+(a.charCodeAt(2)<<16)+(a.charCodeAt(3)<<24)}var d={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},e=c("DXT1"),f=c("DXT3"),h=c("DXT5"),g=new Int32Array(a,0,31);if(542327876!==g[0])return console.error("ImageUtils.parseDDS(): Invalid magic number in DDS header"),d;if(!g[20]&4)return console.error("ImageUtils.parseDDS(): Unsupported format, must contain a FourCC code"),d;var i=g[21];switch(i){case e:e=8;d.format=THREE.RGB_S3TC_DXT1_Format;
 break;case f:e=16;d.format=THREE.RGBA_S3TC_DXT3_Format;break;case h:e=16;d.format=THREE.RGBA_S3TC_DXT5_Format;break;default:return console.error("ImageUtils.parseDDS(): Unsupported FourCC code: ",String.fromCharCode(i&255,i>>8&255,i>>16&255,i>>24&255)),d}d.mipmapCount=1;g[2]&131072&&!1!==b&&(d.mipmapCount=Math.max(1,g[7]));d.isCubemap=g[28]&512?!0:!1;d.width=g[4];d.height=g[3];for(var g=g[1]+4,f=d.width,h=d.height,i=d.isCubemap?6:1,k=0;k<i;k++){for(var l=0;l<d.mipmapCount;l++){var m=Math.max(4,f)/
 4*Math.max(4,h)/4*e,n={data:new Uint8Array(a,g,m),width:f,height:h};d.mipmaps.push(n);g+=m;f=Math.max(0.5*f,1);h=Math.max(0.5*h,1)}f=d.width;h=d.height}return d},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=b|1,d=a.width,e=a.height,f=document.createElement("canvas");f.width=d;f.height=e;var h=f.getContext("2d");h.drawImage(a,0,0);for(var g=h.getImageData(0,0,d,e).data,i=h.createImageData(d,e),k=i.data,l=0;l<d;l++)for(var m=
-0;m<e;m++){var n=0>m-1?0:m-1,t=m+1>e-1?e-1:m+1,s=0>l-1?0:l-1,p=l+1>d-1?d-1:l+1,q=[],r=[0,0,g[4*(m*d+l)]/255*b];q.push([-1,0,g[4*(m*d+s)]/255*b]);q.push([-1,-1,g[4*(n*d+s)]/255*b]);q.push([0,-1,g[4*(n*d+l)]/255*b]);q.push([1,-1,g[4*(n*d+p)]/255*b]);q.push([1,0,g[4*(m*d+p)]/255*b]);q.push([1,1,g[4*(t*d+p)]/255*b]);q.push([0,1,g[4*(t*d+l)]/255*b]);q.push([-1,1,g[4*(t*d+s)]/255*b]);n=[];s=q.length;for(t=0;t<s;t++){var p=q[t],u=q[(t+1)%s],p=[p[0]-r[0],p[1]-r[1],p[2]-r[2]],u=[u[0]-r[0],u[1]-r[1],u[2]-r[2]];
-n.push(c([p[1]*u[2]-p[2]*u[1],p[2]*u[0]-p[0]*u[2],p[0]*u[1]-p[1]*u[0]]))}q=[0,0,0];for(t=0;t<n.length;t++)q[0]+=n[t][0],q[1]+=n[t][1],q[2]+=n[t][2];q[0]/=n.length;q[1]/=n.length;q[2]/=n.length;r=4*(m*d+l);k[r]=255*((q[0]+1)/2)|0;k[r+1]=255*((q[1]+1)/2)|0;k[r+2]=255*q[2]|0;k[r+3]=255}h.putImageData(i,0,0);return f},generateDataTexture:function(a,b,c){for(var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),h=Math.floor(255*c.g),c=Math.floor(255*c.b),g=0;g<d;g++)e[3*g]=f,e[3*g+1]=h,e[3*g+2]=c;a=new THREE.DataTexture(e,
+0;m<e;m++){var n=0>m-1?0:m-1,r=m+1>e-1?e-1:m+1,t=0>l-1?0:l-1,p=l+1>d-1?d-1:l+1,s=[],q=[0,0,g[4*(m*d+l)]/255*b];s.push([-1,0,g[4*(m*d+t)]/255*b]);s.push([-1,-1,g[4*(n*d+t)]/255*b]);s.push([0,-1,g[4*(n*d+l)]/255*b]);s.push([1,-1,g[4*(n*d+p)]/255*b]);s.push([1,0,g[4*(m*d+p)]/255*b]);s.push([1,1,g[4*(r*d+p)]/255*b]);s.push([0,1,g[4*(r*d+l)]/255*b]);s.push([-1,1,g[4*(r*d+t)]/255*b]);n=[];t=s.length;for(r=0;r<t;r++){var p=s[r],u=s[(r+1)%t],p=[p[0]-q[0],p[1]-q[1],p[2]-q[2]],u=[u[0]-q[0],u[1]-q[1],u[2]-q[2]];
+n.push(c([p[1]*u[2]-p[2]*u[1],p[2]*u[0]-p[0]*u[2],p[0]*u[1]-p[1]*u[0]]))}s=[0,0,0];for(r=0;r<n.length;r++)s[0]+=n[r][0],s[1]+=n[r][1],s[2]+=n[r][2];s[0]/=n.length;s[1]/=n.length;s[2]/=n.length;q=4*(m*d+l);k[q]=255*((s[0]+1)/2)|0;k[q+1]=255*((s[1]+1)/2)|0;k[q+2]=255*s[2]|0;k[q+3]=255}h.putImageData(i,0,0);return f},generateDataTexture:function(a,b,c){for(var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),h=Math.floor(255*c.g),c=Math.floor(255*c.b),g=0;g<d;g++)e[3*g]=f,e[3*g+1]=h,e[3*g+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(){return this.faces[this.face][this.weight][this.style]},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){for(var b=this.getFace(),c=this.size/b.resolution,d=
-0,e=String(a).split(""),f=e.length,h=[],a=0;a<f;a++){var g=new THREE.Path,g=this.extractGlyphPoints(e[a],b,c,d,g),d=d+g.offset;h.push(g.path)}return{paths:h,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],h,g,i,k,l,m,n,t,s,p,q,r=b.glyphs[a]||b.glyphs["?"];if(r){if(r.o){b=r._cachedOutline||(r._cachedOutline=r.o.split(" "));k=b.length;for(a=0;a<k;)switch(i=b[a++],i){case "m":i=b[a++]*c+d;l=b[a++]*c;e.moveTo(i,l);break;case "l":i=b[a++]*c+d;l=b[a++]*c;e.lineTo(i,l);break;case "q":i=b[a++]*
-c+d;l=b[a++]*c;t=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(t,s,i,l);if(h=f[f.length-1]){m=h.x;n=h.y;h=1;for(g=this.divisions;h<=g;h++){var u=h/g;THREE.Shape.Utils.b2(u,m,t,i);THREE.Shape.Utils.b2(u,n,s,l)}}break;case "b":if(i=b[a++]*c+d,l=b[a++]*c,t=b[a++]*c+d,s=b[a++]*-c,p=b[a++]*c+d,q=b[a++]*-c,e.bezierCurveTo(i,l,t,s,p,q),h=f[f.length-1]){m=h.x;n=h.y;h=1;for(g=this.divisions;h<=g;h++)u=h/g,THREE.Shape.Utils.b3(u,m,t,p,i),THREE.Shape.Utils.b3(u,n,s,q,l)}}}return{offset:r.ha*c,path:e}}}};
+0,e=String(a).split(""),f=e.length,h=[],a=0;a<f;a++){var g=new THREE.Path,g=this.extractGlyphPoints(e[a],b,c,d,g),d=d+g.offset;h.push(g.path)}return{paths:h,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],h,g,i,k,l,m,n,r,t,p,s,q=b.glyphs[a]||b.glyphs["?"];if(q){if(q.o){b=q._cachedOutline||(q._cachedOutline=q.o.split(" "));k=b.length;for(a=0;a<k;)switch(i=b[a++],i){case "m":i=b[a++]*c+d;l=b[a++]*c;e.moveTo(i,l);break;case "l":i=b[a++]*c+d;l=b[a++]*c;e.lineTo(i,l);break;case "q":i=b[a++]*
+c+d;l=b[a++]*c;r=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(r,t,i,l);if(h=f[f.length-1]){m=h.x;n=h.y;h=1;for(g=this.divisions;h<=g;h++){var u=h/g;THREE.Shape.Utils.b2(u,m,r,i);THREE.Shape.Utils.b2(u,n,t,l)}}break;case "b":if(i=b[a++]*c+d,l=b[a++]*c,r=b[a++]*c+d,t=b[a++]*-c,p=b[a++]*c+d,s=b[a++]*-c,e.bezierCurveTo(i,l,r,t,p,s),h=f[f.length-1]){m=h.x;n=h.y;h=1;for(g=this.divisions;h<=g;h++)u=h/g,THREE.Shape.Utils.b3(u,m,r,p,i),THREE.Shape.Utils.b3(u,n,t,s,l)}}}return{offset:q.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){var b=b||{},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,h=0;h<b;f=h++)e+=a[f].x*a[h].y-a[h].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],h=[],g=[],i,k,l;if(0<b(a))for(k=0;k<e;k++)h[k]=k;else for(k=0;k<e;k++)h[k]=e-1-k;var m=2*e;for(k=e-1;2<e;){if(0>=m--){console.log("Warning, unable to triangulate polygon!");break}i=k;e<=i&&(i=0);k=i+1;e<=k&&(k=0);l=k+1;e<=l&&(l=0);var n;a:{var t=n=void 0,s=void 0,p=void 0,q=void 0,r=void 0,u=void 0,w=void 0,E=
-void 0,t=a[h[i]].x,s=a[h[i]].y,p=a[h[k]].x,q=a[h[k]].y,r=a[h[l]].x,u=a[h[l]].y;if(1E-10>(p-t)*(u-s)-(q-s)*(r-t))n=!1;else{var C=void 0,F=void 0,z=void 0,D=void 0,y=void 0,O=void 0,x=void 0,B=void 0,I=void 0,v=void 0,I=B=x=E=w=void 0,C=r-p,F=u-q,z=t-r,D=s-u,y=p-t,O=q-s;for(n=0;n<e;n++)if(!(n===i||n===k||n===l))if(w=a[h[n]].x,E=a[h[n]].y,x=w-t,B=E-s,I=w-p,v=E-q,w-=r,E-=u,I=C*v-F*I,x=y*B-O*x,B=z*E-D*w,0<=I&&0<=B&&0<=x){n=!1;break a}n=!0}}if(n){f.push([a[h[i]],a[h[k]],a[h[l]]]);g.push([h[i],h[k],h[l]]);
+(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,h=0;h<b;f=h++)e+=a[f].x*a[h].y-a[h].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],h=[],g=[],i,k,l;if(0<b(a))for(k=0;k<e;k++)h[k]=k;else for(k=0;k<e;k++)h[k]=e-1-k;var m=2*e;for(k=e-1;2<e;){if(0>=m--){console.log("Warning, unable to triangulate polygon!");break}i=k;e<=i&&(i=0);k=i+1;e<=k&&(k=0);l=k+1;e<=l&&(l=0);var n;a:{var r=n=void 0,t=void 0,p=void 0,s=void 0,q=void 0,u=void 0,w=void 0,v=
+void 0,r=a[h[i]].x,t=a[h[i]].y,p=a[h[k]].x,s=a[h[k]].y,q=a[h[l]].x,u=a[h[l]].y;if(1E-10>(p-r)*(u-t)-(s-t)*(q-r))n=!1;else{var C=void 0,z=void 0,y=void 0,F=void 0,x=void 0,O=void 0,B=void 0,E=void 0,I=void 0,D=void 0,I=E=B=v=w=void 0,C=q-p,z=u-s,y=r-q,F=t-u,x=p-r,O=s-t;for(n=0;n<e;n++)if(!(n===i||n===k||n===l))if(w=a[h[n]].x,v=a[h[n]].y,B=w-r,E=v-t,I=w-p,D=v-s,w-=q,v-=u,I=C*D-z*I,B=x*E-O*B,E=y*v-F*w,0<=I&&0<=E&&0<=B){n=!1;break a}n=!0}}if(n){f.push([a[h[i]],a[h[k]],a[h[l]]]);g.push([h[i],h[k],h[l]]);
 i=k;for(l=k+1;l<e;i++,l++)h[i]=h[l];e--;m=2*e}}return d?g:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};
 THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),f+=c.distanceTo(d),b.push(f),d=c;return this.cacheArcLengths=b};
 THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0;this.getLengths()};THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,f;f=b?b:a*c[e-1];for(var h=0,g=e-1,i;h<=g;)if(d=Math.floor(h+(g-h)/2),i=c[d]-f,0>i)h=d+1;else if(0<i)g=d-1;else{g=d;break}d=g;if(c[d]==f)return d/(e-1);h=c[d];return c=(d+(f-h)/(c[d+1]-h))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4,a=a+1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};
@@ -544,17 +545,17 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var h=Array.prototype.s
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var h=this.actions[this.actions.length-1].args;this.absarc(a+h[h.length-2],b+h[h.length-1],c,d,e,f)};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,h){var g=this.actions[this.actions.length-1].args;this.absellipse(a+g[g.length-2],b+g[g.length-1],c,d,e,f,h)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,h){var g=Array.prototype.slice.call(arguments),i=new THREE.EllipseCurve(a,b,c,d,e,f,h);this.curves.push(i);i=i.getPoint(h?1:0);g.push(i.x);g.push(i.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:g})};
 THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;c<a;c++)b.push(this.getPoint(c/a));return b};
-THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);var a=a||12,c=[],d,e,f,h,g,i,k,l,m,n,t,s,p;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],h=f.action,f=f.args,h){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:g=f[2];i=f[3];m=f[0];n=f[1];0<c.length?(h=c[c.length-1],t=h.x,
-s=h.y):(h=this.actions[d-1].args,t=h[h.length-2],s=h[h.length-1]);for(f=1;f<=a;f++)p=f/a,h=THREE.Shape.Utils.b2(p,t,m,g),p=THREE.Shape.Utils.b2(p,s,n,i),c.push(new THREE.Vector2(h,p));break;case THREE.PathActions.BEZIER_CURVE_TO:g=f[4];i=f[5];m=f[0];n=f[1];k=f[2];l=f[3];0<c.length?(h=c[c.length-1],t=h.x,s=h.y):(h=this.actions[d-1].args,t=h[h.length-2],s=h[h.length-1]);for(f=1;f<=a;f++)p=f/a,h=THREE.Shape.Utils.b3(p,t,m,k,g),p=THREE.Shape.Utils.b3(p,s,n,l,i),c.push(new THREE.Vector2(h,p));break;case THREE.PathActions.CSPLINE_THRU:h=
-this.actions[d-1].args;p=[new THREE.Vector2(h[h.length-2],h[h.length-1])];h=a*f[0].length;p=p.concat(f[0]);p=new THREE.SplineCurve(p);for(f=1;f<=h;f++)c.push(p.getPointAt(f/h));break;case THREE.PathActions.ARC:g=f[0];i=f[1];n=f[2];k=f[3];h=f[4];m=!!f[5];t=h-k;s=2*a;for(f=1;f<=s;f++)p=f/s,m||(p=1-p),p=k+p*t,h=g+n*Math.cos(p),p=i+n*Math.sin(p),c.push(new THREE.Vector2(h,p));break;case THREE.PathActions.ELLIPSE:g=f[0];i=f[1];n=f[2];l=f[3];k=f[4];h=f[5];m=!!f[6];t=h-k;s=2*a;for(f=1;f<=s;f++)p=f/s,m||
-(p=1-p),p=k+p*t,h=g+n*Math.cos(p),p=i+l*Math.sin(p),c.push(new THREE.Vector2(h,p))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
+THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);var a=a||12,c=[],d,e,f,h,g,i,k,l,m,n,r,t,p;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],h=f.action,f=f.args,h){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:g=f[2];i=f[3];m=f[0];n=f[1];0<c.length?(h=c[c.length-1],r=h.x,
+t=h.y):(h=this.actions[d-1].args,r=h[h.length-2],t=h[h.length-1]);for(f=1;f<=a;f++)p=f/a,h=THREE.Shape.Utils.b2(p,r,m,g),p=THREE.Shape.Utils.b2(p,t,n,i),c.push(new THREE.Vector2(h,p));break;case THREE.PathActions.BEZIER_CURVE_TO:g=f[4];i=f[5];m=f[0];n=f[1];k=f[2];l=f[3];0<c.length?(h=c[c.length-1],r=h.x,t=h.y):(h=this.actions[d-1].args,r=h[h.length-2],t=h[h.length-1]);for(f=1;f<=a;f++)p=f/a,h=THREE.Shape.Utils.b3(p,r,m,k,g),p=THREE.Shape.Utils.b3(p,t,n,l,i),c.push(new THREE.Vector2(h,p));break;case THREE.PathActions.CSPLINE_THRU:h=
+this.actions[d-1].args;p=[new THREE.Vector2(h[h.length-2],h[h.length-1])];h=a*f[0].length;p=p.concat(f[0]);p=new THREE.SplineCurve(p);for(f=1;f<=h;f++)c.push(p.getPointAt(f/h));break;case THREE.PathActions.ARC:g=f[0];i=f[1];n=f[2];k=f[3];h=f[4];m=!!f[5];r=h-k;t=2*a;for(f=1;f<=t;f++)p=f/t,m||(p=1-p),p=k+p*r,h=g+n*Math.cos(p),p=i+n*Math.sin(p),c.push(new THREE.Vector2(h,p));break;case THREE.PathActions.ELLIPSE:g=f[0];i=f[1];n=f[2];l=f[3];k=f[4];h=f[5];m=!!f[6];r=h-k;t=2*a;for(f=1;f<=t;f++)p=f/t,m||
+(p=1-p),p=k+p*r,h=g+n*Math.cos(p),p=i+l*Math.sin(p),c.push(new THREE.Vector2(h,p))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
 THREE.Path.prototype.toShapes=function(a){var b,c,d,e,f=[],h=new THREE.Path;b=0;for(c=this.actions.length;b<c;b++)d=this.actions[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=h.actions.length&&(f.push(h),h=new THREE.Path),h[d].apply(h,e);0!=h.actions.length&&f.push(h);if(0==f.length)return[];var g;e=[];if(1==f.length)return d=f[0],g=new THREE.Shape,g.actions=d.actions,g.curves=d.curves,e.push(g),e;b=!THREE.Shape.Utils.isClockWise(f[0].getPoints());if(a?!b:b){g=new THREE.Shape;b=0;for(c=
 f.length;b<c;b++)d=f[b],h=THREE.Shape.Utils.isClockWise(d.getPoints()),(h=a?!h:h)?(g.actions=d.actions,g.curves=d.curves,e.push(g),g=new THREE.Shape):g.holes.push(d)}else{g=void 0;b=0;for(c=f.length;b<c;b++)d=f[b],h=THREE.Shape.Utils.isClockWise(d.getPoints()),(h=a?!h:h)?(g&&e.push(g),g=new THREE.Shape,g.actions=d.actions,g.curves=d.curves):g.holes.push(d);e.push(g)}return e};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);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={removeHoles:function(a,b){var c=a.concat(),d=c.concat(),e,f,h,g,i,k,l,m,n,t,s=[];for(i=0;i<b.length;i++){k=b[i];Array.prototype.push.apply(d,k);f=Number.POSITIVE_INFINITY;for(e=0;e<k.length;e++){n=k[e];t=[];for(m=0;m<c.length;m++)l=c[m],l=n.distanceToSquared(l),t.push(l),l<f&&(f=l,h=e,g=m)}e=0<=g-1?g-1:c.length-1;f=0<=h-1?h-1:k.length-1;var p=[k[h],c[g],c[e]];m=THREE.FontUtils.Triangulate.area(p);var q=[k[h],k[f],c[g]];n=THREE.FontUtils.Triangulate.area(q);t=g;l=h;g+=1;h+=-1;0>
-g&&(g+=c.length);g%=c.length;0>h&&(h+=k.length);h%=k.length;e=0<=g-1?g-1:c.length-1;f=0<=h-1?h-1:k.length-1;p=[k[h],c[g],c[e]];p=THREE.FontUtils.Triangulate.area(p);q=[k[h],k[f],c[g]];q=THREE.FontUtils.Triangulate.area(q);m+n>p+q&&(g=t,h=l,0>g&&(g+=c.length),g%=c.length,0>h&&(h+=k.length),h%=k.length,e=0<=g-1?g-1:c.length-1,f=0<=h-1?h-1:k.length-1);m=c.slice(0,g);n=c.slice(g);t=k.slice(h);l=k.slice(0,h);f=[k[h],k[f],c[g]];s.push([k[h],c[g],c[e]]);s.push(f);c=m.concat(t).concat(l).concat(n)}return{shape:c,
-isolatedPts:s,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),f,h,g,i,k={};f=0;for(h=d.length;f<h;f++)i=d[f].x+":"+d[f].y,void 0!==k[i]&&console.log("Duplicate point",i),k[i]=f;f=0;for(h=c.length;f<h;f++){g=c[f];for(d=0;3>d;d++)i=g[d].x+":"+g[d].y,i=k[i],void 0!==i&&(g[d]=i)}f=0;for(h=e.length;f<h;f++){g=e[f];for(d=0;3>d;d++)i=g[d].x+":"+g[d].y,i=k[i],void 0!==i&&(g[d]=i)}return c.concat(e)},
+THREE.Shape.Utils={removeHoles:function(a,b){var c=a.concat(),d=c.concat(),e,f,h,g,i,k,l,m,n,r,t=[];for(i=0;i<b.length;i++){k=b[i];Array.prototype.push.apply(d,k);f=Number.POSITIVE_INFINITY;for(e=0;e<k.length;e++){n=k[e];r=[];for(m=0;m<c.length;m++)l=c[m],l=n.distanceToSquared(l),r.push(l),l<f&&(f=l,h=e,g=m)}e=0<=g-1?g-1:c.length-1;f=0<=h-1?h-1:k.length-1;var p=[k[h],c[g],c[e]];m=THREE.FontUtils.Triangulate.area(p);var s=[k[h],k[f],c[g]];n=THREE.FontUtils.Triangulate.area(s);r=g;l=h;g+=1;h+=-1;0>
+g&&(g+=c.length);g%=c.length;0>h&&(h+=k.length);h%=k.length;e=0<=g-1?g-1:c.length-1;f=0<=h-1?h-1:k.length-1;p=[k[h],c[g],c[e]];p=THREE.FontUtils.Triangulate.area(p);s=[k[h],k[f],c[g]];s=THREE.FontUtils.Triangulate.area(s);m+n>p+s&&(g=r,h=l,0>g&&(g+=c.length),g%=c.length,0>h&&(h+=k.length),h%=k.length,e=0<=g-1?g-1:c.length-1,f=0<=h-1?h-1:k.length-1);m=c.slice(0,g);n=c.slice(g);r=k.slice(h);l=k.slice(0,h);f=[k[h],k[f],c[g]];t.push([k[h],c[g],c[e]]);t.push(f);c=m.concat(r).concat(l).concat(n)}return{shape:c,
+isolatedPts:t,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),f,h,g,i,k={};f=0;for(h=d.length;f<h;f++)i=d[f].x+":"+d[f].y,void 0!==k[i]&&console.log("Duplicate point",i),k[i]=f;f=0;for(h=c.length;f<h;f++){g=c[f];for(d=0;3>d;d++)i=g[d].x+":"+g[d].y,i=k[i],void 0!==i&&(g[d]=i)}f=0;for(h=e.length;f<h;f++){g=e[f];for(d=0;3>d;d++)i=g[d].x+":"+g[d].y,i=k[i],void 0!==i&&(g[d]=i)}return c.concat(e)},
 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.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(){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.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};
 THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};
@@ -567,7 +568,7 @@ b)};c.LINEAR=0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation
 THREE.Animation.prototype.play=function(a,b){if(!1===this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;var c,d=this.hierarchy.length,e;for(c=0;c<d;c++){e=this.hierarchy[c];e.matrixAutoUpdate=!0;void 0===e.animationCache&&(e.animationCache={},e.animationCache.prevKey={pos:0,rot:0,scl:0},e.animationCache.nextKey={pos:0,rot:0,scl:0},e.animationCache.originalMatrix=e instanceof THREE.Bone?e.skinMatrix:e.matrix);var f=e.animationCache.prevKey;e=e.animationCache.nextKey;
 f.pos=this.data.hierarchy[c].keys[0];f.rot=this.data.hierarchy[c].keys[0];f.scl=this.data.hierarchy[c].keys[0];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};THREE.Animation.prototype.pause=function(){!0===this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this)};
-THREE.Animation.prototype.update=function(a){if(!1!==this.isPlaying){var b=["pos","rot","scl"],c,d,e,f,h,g,i,k,l;l=this.currentTime+=a*this.timeScale;k=this.currentTime%=this.data.length;parseInt(Math.min(k*this.data.fps,this.data.length*this.data.fps),10);for(var m=0,n=this.hierarchy.length;m<n;m++){a=this.hierarchy[m];i=a.animationCache;for(var t=0;3>t;t++){c=b[t];h=i.prevKey[c];g=i.nextKey[c];if(g.time<=l){if(k<l)if(this.loop){h=this.data.hierarchy[m].keys[0];for(g=this.getNextKeyWith(c,m,1);g.time<
+THREE.Animation.prototype.update=function(a){if(!1!==this.isPlaying){var b=["pos","rot","scl"],c,d,e,f,h,g,i,k,l;l=this.currentTime+=a*this.timeScale;k=this.currentTime%=this.data.length;parseInt(Math.min(k*this.data.fps,this.data.length*this.data.fps),10);for(var m=0,n=this.hierarchy.length;m<n;m++){a=this.hierarchy[m];i=a.animationCache;for(var r=0;3>r;r++){c=b[r];h=i.prevKey[c];g=i.nextKey[c];if(g.time<=l){if(k<l)if(this.loop){h=this.data.hierarchy[m].keys[0];for(g=this.getNextKeyWith(c,m,1);g.time<
 k;)h=g,g=this.getNextKeyWith(c,m,g.index+1)}else{this.stop();return}else{do h=g,g=this.getNextKeyWith(c,m,g.index+1);while(g.time<k)}i.prevKey[c]=h;i.nextKey[c]=g}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;d=(k-h.time)/(g.time-h.time);e=h[c];f=g[c];if(0>d||1<d)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+m),d=0>d?0:1;if("pos"===c)if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+
 (f[2]-e[2])*d;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)this.points[0]=this.getPrevKeyWith("pos",m,h.index-1).pos,this.points[1]=e,this.points[2]=f,this.points[3]=this.getNextKeyWith("pos",m,g.index+1).pos,d=0.33*d+0.33,e=this.interpolateCatmullRom(this.points,d),c.x=e[0],c.y=e[1],c.z=e[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(d=this.interpolateCatmullRom(this.points,1.01*d),
 this.target.set(d[0],d[1],d[2]),this.target.sub(c),this.target.y=0,this.target.normalize(),d=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,d,0))}else"rot"===c?THREE.Quaternion.slerp(e,f,a.quaternion,d):"scl"===c&&(c=a.scale,c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+(f[2]-e[2])*d)}}}};
@@ -590,31 +591,31 @@ THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;thi
 THREE.CombinedCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);var c=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);var a=a||50,c=void 0!==c?c:0,d=void 0!==d?d:2*Math.PI,b=void 0!==b?Math.max(3,b):8,e,f=[];e=new THREE.Vector3;var h=new THREE.Vector2(0.5,0.5);this.vertices.push(e);f.push(h);for(e=0;e<=b;e++){var g=new THREE.Vector3,i=c+e/b*d;g.x=a*Math.cos(i);g.y=a*Math.sin(i);this.vertices.push(g);f.push(new THREE.Vector2((g.x/a+1)/2,(g.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,c,c])),this.faceVertexUvs[0].push([f[e],
-f[e+1],h]);this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){function h(a,b,c,d,e,f,h,p){var q,r=g.widthSegments,u=g.heightSegments,w=e/2,E=f/2,C=g.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)q="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)q="y",u=g.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)q="x",r=g.depthSegments;var F=r+1,z=u+1,D=e/r,y=f/u,O=new THREE.Vector3;O[q]=0<h?1:-1;for(e=0;e<z;e++)for(f=0;f<F;f++){var x=new THREE.Vector3;x[a]=(f*D-w)*c;x[b]=(e*y-E)*d;x[q]=h;g.vertices.push(x)}for(e=
-0;e<u;e++)for(f=0;f<r;f++)E=f+F*e,a=f+F*(e+1),b=f+1+F*(e+1),c=f+1+F*e,d=new THREE.Vector2(f/r,1-e/u),h=new THREE.Vector2(f/r,1-(e+1)/u),q=new THREE.Vector2((f+1)/r,1-(e+1)/u),w=new THREE.Vector2((f+1)/r,1-e/u),E=new THREE.Face3(E+C,a+C,c+C),E.normal.copy(O),E.vertexNormals.push(O.clone(),O.clone(),O.clone()),E.materialIndex=p,g.faces.push(E),g.faceVertexUvs[0].push([d,h,w]),E=new THREE.Face3(a+C,b+C,c+C),E.normal.copy(O),E.vertexNormals.push(O.clone(),O.clone(),O.clone()),E.materialIndex=p,g.faces.push(E),
-g.faceVertexUvs[0].push([h,q,w])}THREE.Geometry.call(this);var g=this;this.width=a;this.height=b;this.depth=c;this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;a=this.width/2;b=this.height/2;c=this.depth/2;h("z","y",-1,-1,this.depth,this.height,a,0);h("z","y",1,-1,this.depth,this.height,-a,1);h("x","z",1,1,this.width,this.depth,b,2);h("x","z",1,-1,this.width,this.depth,-b,3);h("x","y",1,-1,this.width,this.height,c,4);h("x","y",-1,-1,this.width,this.height,-c,5);this.computeCentroids();
-this.mergeVertices()};THREE.CubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.radiusTop=a=void 0!==a?a:20;this.radiusBottom=b=void 0!==b?b:20;this.height=c=void 0!==c?c:100;this.radialSegments=d=d||8;this.heightSegments=e=e||1;this.openEnded=f=void 0!==f?f:!1;var h=c/2,g,i,k=[],l=[];for(i=0;i<=e;i++){var m=[],n=[],t=i/e,s=t*(b-a)+a;for(g=0;g<=d;g++){var p=g/d,q=new THREE.Vector3;q.x=s*Math.sin(2*p*Math.PI);q.y=-t*c+h;q.z=s*Math.cos(2*p*Math.PI);this.vertices.push(q);m.push(this.vertices.length-1);n.push(new THREE.Vector2(p,
-1-t))}k.push(m);l.push(n)}c=(b-a)/c;for(g=0;g<d;g++){0!==a?(m=this.vertices[k[0][g]].clone(),n=this.vertices[k[0][g+1]].clone()):(m=this.vertices[k[1][g]].clone(),n=this.vertices[k[1][g+1]].clone());m.setY(Math.sqrt(m.x*m.x+m.z*m.z)*c).normalize();n.setY(Math.sqrt(n.x*n.x+n.z*n.z)*c).normalize();for(i=0;i<e;i++){var t=k[i][g],s=k[i+1][g],p=k[i+1][g+1],q=k[i][g+1],r=m.clone(),u=m.clone(),w=n.clone(),E=n.clone(),C=l[i][g].clone(),F=l[i+1][g].clone(),z=l[i+1][g+1].clone(),D=l[i][g+1].clone();this.faces.push(new THREE.Face3(t,
-s,q,[r,u,E]));this.faceVertexUvs[0].push([C,F,D]);this.faces.push(new THREE.Face3(s,p,q,[u,w,E]));this.faceVertexUvs[0].push([F,z,D])}}if(!1===f&&0<a){this.vertices.push(new THREE.Vector3(0,h,0));for(g=0;g<d;g++)t=k[0][g],s=k[0][g+1],p=this.vertices.length-1,r=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),w=new THREE.Vector3(0,1,0),C=l[0][g].clone(),F=l[0][g+1].clone(),z=new THREE.Vector2(F.u,0),this.faces.push(new THREE.Face3(t,s,p,[r,u,w])),this.faceVertexUvs[0].push([C,F,z])}if(!1===f&&0<
-b){this.vertices.push(new THREE.Vector3(0,-h,0));for(g=0;g<d;g++)t=k[i][g+1],s=k[i][g],p=this.vertices.length-1,r=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),C=l[i][g+1].clone(),F=l[i][g].clone(),z=new THREE.Vector2(F.u,1),this.faces.push(new THREE.Face3(t,s,p,[r,u,w])),this.faceVertexUvs[0].push([C,F,z])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
+f[e+1],h]);this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){function h(a,b,c,d,e,f,h,p){var s,q=g.widthSegments,u=g.heightSegments,w=e/2,v=f/2,C=g.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",u=g.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)s="x",q=g.depthSegments;var z=q+1,y=u+1,F=e/q,x=f/u,O=new THREE.Vector3;O[s]=0<h?1:-1;for(e=0;e<y;e++)for(f=0;f<z;f++){var B=new THREE.Vector3;B[a]=(f*F-w)*c;B[b]=(e*x-v)*d;B[s]=h;g.vertices.push(B)}for(e=
+0;e<u;e++)for(f=0;f<q;f++)v=f+z*e,a=f+z*(e+1),b=f+1+z*(e+1),c=f+1+z*e,d=new THREE.Vector2(f/q,1-e/u),h=new THREE.Vector2(f/q,1-(e+1)/u),s=new THREE.Vector2((f+1)/q,1-(e+1)/u),w=new THREE.Vector2((f+1)/q,1-e/u),v=new THREE.Face3(v+C,a+C,c+C),v.normal.copy(O),v.vertexNormals.push(O.clone(),O.clone(),O.clone()),v.materialIndex=p,g.faces.push(v),g.faceVertexUvs[0].push([d,h,w]),v=new THREE.Face3(a+C,b+C,c+C),v.normal.copy(O),v.vertexNormals.push(O.clone(),O.clone(),O.clone()),v.materialIndex=p,g.faces.push(v),
+g.faceVertexUvs[0].push([h,s,w])}THREE.Geometry.call(this);var g=this;this.width=a;this.height=b;this.depth=c;this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;a=this.width/2;b=this.height/2;c=this.depth/2;h("z","y",-1,-1,this.depth,this.height,a,0);h("z","y",1,-1,this.depth,this.height,-a,1);h("x","z",1,1,this.width,this.depth,b,2);h("x","z",1,-1,this.width,this.depth,-b,3);h("x","y",1,-1,this.width,this.height,c,4);h("x","y",-1,-1,this.width,this.height,-c,5);this.computeCentroids();
+this.mergeVertices()};THREE.CubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.radiusTop=a=void 0!==a?a:20;this.radiusBottom=b=void 0!==b?b:20;this.height=c=void 0!==c?c:100;this.radialSegments=d=d||8;this.heightSegments=e=e||1;this.openEnded=f=void 0!==f?f:!1;var h=c/2,g,i,k=[],l=[];for(i=0;i<=e;i++){var m=[],n=[],r=i/e,t=r*(b-a)+a;for(g=0;g<=d;g++){var p=g/d,s=new THREE.Vector3;s.x=t*Math.sin(2*p*Math.PI);s.y=-r*c+h;s.z=t*Math.cos(2*p*Math.PI);this.vertices.push(s);m.push(this.vertices.length-1);n.push(new THREE.Vector2(p,
+1-r))}k.push(m);l.push(n)}c=(b-a)/c;for(g=0;g<d;g++){0!==a?(m=this.vertices[k[0][g]].clone(),n=this.vertices[k[0][g+1]].clone()):(m=this.vertices[k[1][g]].clone(),n=this.vertices[k[1][g+1]].clone());m.setY(Math.sqrt(m.x*m.x+m.z*m.z)*c).normalize();n.setY(Math.sqrt(n.x*n.x+n.z*n.z)*c).normalize();for(i=0;i<e;i++){var r=k[i][g],t=k[i+1][g],p=k[i+1][g+1],s=k[i][g+1],q=m.clone(),u=m.clone(),w=n.clone(),v=n.clone(),C=l[i][g].clone(),z=l[i+1][g].clone(),y=l[i+1][g+1].clone(),F=l[i][g+1].clone();this.faces.push(new THREE.Face3(r,
+t,s,[q,u,v]));this.faceVertexUvs[0].push([C,z,F]);this.faces.push(new THREE.Face3(t,p,s,[u,w,v]));this.faceVertexUvs[0].push([z,y,F])}}if(!1===f&&0<a){this.vertices.push(new THREE.Vector3(0,h,0));for(g=0;g<d;g++)r=k[0][g],t=k[0][g+1],p=this.vertices.length-1,q=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),w=new THREE.Vector3(0,1,0),C=l[0][g].clone(),z=l[0][g+1].clone(),y=new THREE.Vector2(z.u,0),this.faces.push(new THREE.Face3(r,t,p,[q,u,w])),this.faceVertexUvs[0].push([C,z,y])}if(!1===f&&0<
+b){this.vertices.push(new THREE.Vector3(0,-h,0));for(g=0;g<d;g++)r=k[i][g+1],t=k[i][g],p=this.vertices.length-1,q=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),C=l[i][g+1].clone(),z=l[i][g].clone(),y=new THREE.Vector2(z.u,1),this.faces.push(new THREE.Face3(r,t,p,[q,u,w])),this.faceVertexUvs[0].push([C,z,y])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,f=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,i=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();f.set(-d.y,d.x);g.set(e.y,-e.x);h.copy(a).add(f);i.copy(a).add(g);if(h.equals(i))return g.clone();
-h.copy(b).add(f);i.copy(c).add(g);f=d.dot(g);g=i.sub(h).dot(g);0===f&&(console.log("Either infinite or no solutions!"),0===g?console.log("Its finite solutions."):console.log("Too bad, no solutions."));g/=f;return 0>g?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(g).add(h).sub(a).clone()}function e(c,d){var e,f;for(N=c.length;0<=--N;){e=N;f=N-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*l,
-g=0;g<h;g++){var i=ba*g,k=ba*(g+1),m=d+e+i,i=d+f+i,n=d+f+k,k=d+e+k,p=c,q=g,r=h,s=e,v=f,m=m+B,i=i+B,n=n+B,k=k+B;x.faces.push(new THREE.Face4(m,i,n,k,null,null,u));m=w.generateSideWallUV(x,a,p,b,m,i,n,k,q,r,s,v);x.faceVertexUvs[0].push(m)}}}function f(a,b,c){x.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=B;d+=B;e+=B;x.faces.push(new THREE.Face3(c,d,e,null,null,r));c=f?w.generateBottomUV(x,a,b,c,d,e):w.generateTopUV(x,a,b,c,d,e);x.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:
-100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,l=void 0!==b.bevelSegments?b.bevelSegments:3,m=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,p,q=!1,r=b.material,u=b.extrudeMaterial,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,E,C,F,z;s&&(p=s.getSpacedPoints(t),q=!0,m=!1,E=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,
-!1),C=new THREE.Vector3,F=new THREE.Vector3,z=new THREE.Vector3);m||(k=i=l=0);var D,y,O,x=this,B=this.vertices.length,n=a.extractPoints(n),I=n.shape,n=n.holes;if(s=!THREE.Shape.Utils.isClockWise(I)){I=I.reverse();y=0;for(O=n.length;y<O;y++)D=n[y],THREE.Shape.Utils.isClockWise(D)&&(n[y]=D.reverse());s=!1}var v=THREE.Shape.Utils.triangulateShape(I,n),s=I;y=0;for(O=n.length;y<O;y++)D=n[y],I=I.concat(D);var A,G,R,J,ba=I.length,qa=v.length,ra=[],N=0,M=s.length;A=M-1;for(G=N+1;N<M;N++,A++,G++)A===M&&(A=
-0),G===M&&(G=0),ra[N]=d(s[N],s[A],s[G]);var Q=[],K,da=ra.concat();y=0;for(O=n.length;y<O;y++){D=n[y];K=[];N=0;M=D.length;A=M-1;for(G=N+1;N<M;N++,A++,G++)A===M&&(A=0),G===M&&(G=0),K[N]=d(D[N],D[A],D[G]);Q.push(K);da=da.concat(K)}for(A=0;A<l;A++){D=A/l;R=i*(1-D);G=k*Math.sin(D*Math.PI/2);N=0;for(M=s.length;N<M;N++)J=c(s[N],ra[N],G),f(J.x,J.y,-R);y=0;for(O=n.length;y<O;y++){D=n[y];K=Q[y];N=0;for(M=D.length;N<M;N++)J=c(D[N],K[N],G),f(J.x,J.y,-R)}}G=k;for(N=0;N<ba;N++)J=m?c(I[N],da[N],G):I[N],q?(F.copy(E.normals[0]).multiplyScalar(J.x),
-C.copy(E.binormals[0]).multiplyScalar(J.y),z.copy(p[0]).add(F).add(C),f(z.x,z.y,z.z)):f(J.x,J.y,0);for(D=1;D<=t;D++)for(N=0;N<ba;N++)J=m?c(I[N],da[N],G):I[N],q?(F.copy(E.normals[D]).multiplyScalar(J.x),C.copy(E.binormals[D]).multiplyScalar(J.y),z.copy(p[D]).add(F).add(C),f(z.x,z.y,z.z)):f(J.x,J.y,g/t*D);for(A=l-1;0<=A;A--){D=A/l;R=i*(1-D);G=k*Math.sin(D*Math.PI/2);N=0;for(M=s.length;N<M;N++)J=c(s[N],ra[N],G),f(J.x,J.y,g+R);y=0;for(O=n.length;y<O;y++){D=n[y];K=Q[y];N=0;for(M=D.length;N<M;N++)J=c(D[N],
-K[N],G),q?f(J.x,J.y+p[t-1].y,p[t-1].x+R):f(J.x,J.y,g+R)}}if(m){i=0*ba;for(N=0;N<qa;N++)g=v[N],h(g[2]+i,g[1]+i,g[0]+i,!0);i=ba*(t+2*l);for(N=0;N<qa;N++)g=v[N],h(g[0]+i,g[1]+i,g[2]+i,!1)}else{for(N=0;N<qa;N++)g=v[N],h(g[2],g[1],g[0],!0);for(N=0;N<qa;N++)g=v[N],h(g[0]+ba*t,g[1]+ba*t,g[2]+ba*t,!1)}g=0;e(s,g);g+=s.length;y=0;for(O=n.length;y<O;y++)D=n[y],e(D,g),g+=D.length};
+h.copy(b).add(f);i.copy(c).add(g);f=d.dot(g);g=i.sub(h).dot(g);0===f&&(console.log("Either infinite or no solutions!"),0===g?console.log("Its finite solutions."):console.log("Too bad, no solutions."));g/=f;return 0>g?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(g).add(h).sub(a).clone()}function e(c,d){var e,f;for(N=c.length;0<=--N;){e=N;f=N-1;0>f&&(f=c.length-1);for(var g=0,h=r+2*l,
+g=0;g<h;g++){var i=ba*g,k=ba*(g+1),m=d+e+i,i=d+f+i,n=d+f+k,k=d+e+k,p=c,q=g,s=h,t=e,v=f,m=m+E,i=i+E,n=n+E,k=k+E;B.faces.push(new THREE.Face4(m,i,n,k,null,null,u));m=w.generateSideWallUV(B,a,p,b,m,i,n,k,q,s,t,v);B.faceVertexUvs[0].push(m)}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=E;d+=E;e+=E;B.faces.push(new THREE.Face3(c,d,e,null,null,q));c=f?w.generateBottomUV(B,a,b,c,d,e):w.generateTopUV(B,a,b,c,d,e);B.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:
+100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,l=void 0!==b.bevelSegments?b.bevelSegments:3,m=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,p,s=!1,q=b.material,u=b.extrudeMaterial,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,C,z,y;t&&(p=t.getSpacedPoints(r),s=!0,m=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,
+!1),C=new THREE.Vector3,z=new THREE.Vector3,y=new THREE.Vector3);m||(k=i=l=0);var F,x,O,B=this,E=this.vertices.length,n=a.extractPoints(n),I=n.shape,n=n.holes;if(t=!THREE.Shape.Utils.isClockWise(I)){I=I.reverse();x=0;for(O=n.length;x<O;x++)F=n[x],THREE.Shape.Utils.isClockWise(F)&&(n[x]=F.reverse());t=!1}var D=THREE.Shape.Utils.triangulateShape(I,n),t=I;x=0;for(O=n.length;x<O;x++)F=n[x],I=I.concat(F);var A,G,R,J,ba=I.length,qa=D.length,ra=[],N=0,M=t.length;A=M-1;for(G=N+1;N<M;N++,A++,G++)A===M&&(A=
+0),G===M&&(G=0),ra[N]=d(t[N],t[A],t[G]);var Q=[],K,da=ra.concat();x=0;for(O=n.length;x<O;x++){F=n[x];K=[];N=0;M=F.length;A=M-1;for(G=N+1;N<M;N++,A++,G++)A===M&&(A=0),G===M&&(G=0),K[N]=d(F[N],F[A],F[G]);Q.push(K);da=da.concat(K)}for(A=0;A<l;A++){F=A/l;R=i*(1-F);G=k*Math.sin(F*Math.PI/2);N=0;for(M=t.length;N<M;N++)J=c(t[N],ra[N],G),f(J.x,J.y,-R);x=0;for(O=n.length;x<O;x++){F=n[x];K=Q[x];N=0;for(M=F.length;N<M;N++)J=c(F[N],K[N],G),f(J.x,J.y,-R)}}G=k;for(N=0;N<ba;N++)J=m?c(I[N],da[N],G):I[N],s?(z.copy(v.normals[0]).multiplyScalar(J.x),
+C.copy(v.binormals[0]).multiplyScalar(J.y),y.copy(p[0]).add(z).add(C),f(y.x,y.y,y.z)):f(J.x,J.y,0);for(F=1;F<=r;F++)for(N=0;N<ba;N++)J=m?c(I[N],da[N],G):I[N],s?(z.copy(v.normals[F]).multiplyScalar(J.x),C.copy(v.binormals[F]).multiplyScalar(J.y),y.copy(p[F]).add(z).add(C),f(y.x,y.y,y.z)):f(J.x,J.y,g/r*F);for(A=l-1;0<=A;A--){F=A/l;R=i*(1-F);G=k*Math.sin(F*Math.PI/2);N=0;for(M=t.length;N<M;N++)J=c(t[N],ra[N],G),f(J.x,J.y,g+R);x=0;for(O=n.length;x<O;x++){F=n[x];K=Q[x];N=0;for(M=F.length;N<M;N++)J=c(F[N],
+K[N],G),s?f(J.x,J.y+p[r-1].y,p[r-1].x+R):f(J.x,J.y,g+R)}}if(m){i=0*ba;for(N=0;N<qa;N++)g=D[N],h(g[2]+i,g[1]+i,g[0]+i,!0);i=ba*(r+2*l);for(N=0;N<qa;N++)g=D[N],h(g[0]+i,g[1]+i,g[2]+i,!1)}else{for(N=0;N<qa;N++)g=D[N],h(g[2],g[1],g[0],!0);for(N=0;N<qa;N++)g=D[N],h(g[0]+ba*r,g[1]+ba*r,g[2]+ba*r,!1)}g=0;e(t,g);g+=t.length;x=0;for(O=n.length;x<O;x++)F=n[x],e(F,g),g+=F.length};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,h,g){var b=a.vertices[e].x,c=a.vertices[e].y,e=a.vertices[e].z,d=a.vertices[f].x,i=a.vertices[f].y,f=a.vertices[f].z,k=a.vertices[h].x,
 l=a.vertices[h].y,h=a.vertices[h].z,m=a.vertices[g].x,n=a.vertices[g].y,a=a.vertices[g].z;return 0.01>Math.abs(c-i)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(k,1-h),new THREE.Vector2(m,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(i,1-f),new THREE.Vector2(l,1-h),new THREE.Vector2(n,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();this.addShapeList(a,b);this.computeCentroids();this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);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,h,g=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var i=e.shape,k=e.holes;if(!THREE.Shape.Utils.isClockWise(i)){i=i.reverse();e=0;for(f=k.length;e<f;e++)h=k[e],THREE.Shape.Utils.isClockWise(h)&&(k[e]=h.reverse())}var l=THREE.Shape.Utils.triangulateShape(i,k);e=0;for(f=k.length;e<f;e++)h=k[e],
-i=i.concat(h);k=i.length;f=l.length;for(e=0;e<k;e++)h=i[e],this.vertices.push(new THREE.Vector3(h.x,h.y,0));for(e=0;e<f;e++)k=l[e],i=k[0]+g,h=k[1]+g,k=k[2]+g,this.faces.push(new THREE.Face3(i,h,k,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,i,h,k))};THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var b=b||12,c=c||0,d=d||2*Math.PI,e=1/(a.length-1),f=1/b,h=0,g=b;h<=g;h++)for(var i=c+h*f*d,k=Math.cos(i),l=Math.sin(i),i=0,m=a.length;i<m;i++){var n=a[i],t=new THREE.Vector3;t.x=k*n.x-l*n.y;t.y=l*n.x+k*n.y;t.z=n.z;this.vertices.push(t)}c=a.length;h=0;for(g=b;h<g;h++){i=0;for(m=a.length-1;i<m;i++){var b=l=i+c*h,d=l+c,k=l+1+c,l=l+1,n=h*f,t=i*e,s=n+f,p=t+e;this.faces.push(new THREE.Face3(b,d,l));this.faceVertexUvs[0].push([new THREE.Vector2(n,
-t),new THREE.Vector2(s,t),new THREE.Vector2(n,p)]);this.faces.push(new THREE.Face3(d,k,l));this.faceVertexUvs[0].push([new THREE.Vector2(s,t),new THREE.Vector2(s,p),new THREE.Vector2(n,p)])}}this.mergeVertices();this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.width=a;this.height=b;this.widthSegments=c||1;this.heightSegments=d||1;for(var e=a/2,f=b/2,c=this.widthSegments,d=this.heightSegments,h=c+1,g=d+1,i=this.width/c,k=this.height/d,l=new THREE.Vector3(0,0,1),a=0;a<g;a++)for(b=0;b<h;b++)this.vertices.push(new THREE.Vector3(b*i-e,-(a*k-f),0));for(a=0;a<d;a++)for(b=0;b<c;b++){var m=b+h*a,e=b+h*(a+1),f=b+1+h*(a+1),g=b+1+h*a,i=new THREE.Vector2(b/c,1-a/d),k=new THREE.Vector2(b/c,1-(a+1)/
-d),n=new THREE.Vector2((b+1)/c,1-(a+1)/d),t=new THREE.Vector2((b+1)/c,1-a/d),m=new THREE.Face3(m,e,g);m.normal.copy(l);m.vertexNormals.push(l.clone(),l.clone(),l.clone());this.faces.push(m);this.faceVertexUvs[0].push([i,k,t]);m=new THREE.Face3(e,f,g);m.normal.copy(l);m.vertexNormals.push(l.clone(),l.clone(),l.clone());this.faces.push(m);this.faceVertexUvs[0].push([k,n,t])}this.computeCentroids()};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);for(var a=a||0,b=b||50,e=void 0!==e?e:0,f=void 0!==f?f:2*Math.PI,c=void 0!==c?Math.max(3,c):8,d=void 0!==d?Math.max(3,d):8,h=[],g=a,i=(b-a)/d,a=0;a<=d;a++){for(b=0;b<=c;b++){var k=new THREE.Vector3,l=e+b/c*f;k.x=g*Math.cos(l);k.y=g*Math.sin(l);this.vertices.push(k);h.push(new THREE.Vector2((k.x/g+1)/2,-(k.y/g+1)/2+1))}g+=i}e=new THREE.Vector3(0,0,1);for(a=0;a<d;a++){f=a*c;for(b=0;b<=c;b++){var l=b+f,i=l+a,k=l+c+a,m=l+c+1+a;this.faces.push(new THREE.Face3(i,
-k,m,[e,e,e]));this.faceVertexUvs[0].push([h[i],h[k],h[m]]);i=l+a;k=l+c+1+a;m=l+1+a;this.faces.push(new THREE.Face3(i,k,m,[e,e,e]));this.faceVertexUvs[0].push([h[i],h[k],h[m]])}}this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,g)};THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry=function(a,b,c,d,e,f,h){THREE.Geometry.call(this);this.radius=a=a||50;this.widthSegments=b=Math.max(3,Math.floor(b)||8);this.heightSegments=c=Math.max(2,Math.floor(c)||6);this.phiStart=d=void 0!==d?d:0;this.phiLength=e=void 0!==e?e:2*Math.PI;this.thetaStart=f=void 0!==f?f:0;this.thetaLength=h=void 0!==h?h:Math.PI;var g,i,k=[],l=[];for(i=0;i<=c;i++){var m=[],n=[];for(g=0;g<=b;g++){var t=g/b,s=i/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+t*e)*Math.sin(f+s*h);p.y=a*Math.cos(f+s*h);
-p.z=a*Math.sin(d+t*e)*Math.sin(f+s*h);this.vertices.push(p);m.push(this.vertices.length-1);n.push(new THREE.Vector2(t,1-s))}k.push(m);l.push(n)}for(i=0;i<this.heightSegments;i++)for(g=0;g<this.widthSegments;g++){var b=k[i][g+1],c=k[i][g],d=k[i+1][g],e=k[i+1][g+1],f=this.vertices[b].clone().normalize(),h=this.vertices[c].clone().normalize(),m=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),t=l[i][g+1].clone(),s=l[i][g].clone(),p=l[i+1][g].clone(),q=l[i+1][g+1].clone();Math.abs(this.vertices[b].y)===
-this.radius?(this.faces.push(new THREE.Face3(b,d,e,[f,m,n])),this.faceVertexUvs[0].push([t,p,q])):Math.abs(this.vertices[d].y)===this.radius?(this.faces.push(new THREE.Face3(b,c,d,[f,h,m])),this.faceVertexUvs[0].push([t,s,p])):(this.faces.push(new THREE.Face3(b,c,e,[f,h,n])),this.faceVertexUvs[0].push([t,s,q]),this.faces.push(new THREE.Face3(c,d,e,[h,m,n])),this.faceVertexUvs[0].push([s,p,q]))}this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
+i=i.concat(h);k=i.length;f=l.length;for(e=0;e<k;e++)h=i[e],this.vertices.push(new THREE.Vector3(h.x,h.y,0));for(e=0;e<f;e++)k=l[e],i=k[0]+g,h=k[1]+g,k=k[2]+g,this.faces.push(new THREE.Face3(i,h,k,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,i,h,k))};THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var b=b||12,c=c||0,d=d||2*Math.PI,e=1/(a.length-1),f=1/b,h=0,g=b;h<=g;h++)for(var i=c+h*f*d,k=Math.cos(i),l=Math.sin(i),i=0,m=a.length;i<m;i++){var n=a[i],r=new THREE.Vector3;r.x=k*n.x-l*n.y;r.y=l*n.x+k*n.y;r.z=n.z;this.vertices.push(r)}c=a.length;h=0;for(g=b;h<g;h++){i=0;for(m=a.length-1;i<m;i++){var b=l=i+c*h,d=l+c,k=l+1+c,l=l+1,n=h*f,r=i*e,t=n+f,p=r+e;this.faces.push(new THREE.Face3(b,d,l));this.faceVertexUvs[0].push([new THREE.Vector2(n,
+r),new THREE.Vector2(t,r),new THREE.Vector2(n,p)]);this.faces.push(new THREE.Face3(d,k,l));this.faceVertexUvs[0].push([new THREE.Vector2(t,r),new THREE.Vector2(t,p),new THREE.Vector2(n,p)])}}this.mergeVertices();this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.width=a;this.height=b;this.widthSegments=c||1;this.heightSegments=d||1;for(var e=a/2,f=b/2,c=this.widthSegments,d=this.heightSegments,h=c+1,g=d+1,i=this.width/c,k=this.height/d,l=new THREE.Vector3(0,0,1),a=0;a<g;a++)for(b=0;b<h;b++)this.vertices.push(new THREE.Vector3(b*i-e,-(a*k-f),0));for(a=0;a<d;a++)for(b=0;b<c;b++){var m=b+h*a,e=b+h*(a+1),f=b+1+h*(a+1),g=b+1+h*a,i=new THREE.Vector2(b/c,1-a/d),k=new THREE.Vector2(b/c,1-(a+1)/
+d),n=new THREE.Vector2((b+1)/c,1-(a+1)/d),r=new THREE.Vector2((b+1)/c,1-a/d),m=new THREE.Face3(m,e,g);m.normal.copy(l);m.vertexNormals.push(l.clone(),l.clone(),l.clone());this.faces.push(m);this.faceVertexUvs[0].push([i,k,r]);m=new THREE.Face3(e,f,g);m.normal.copy(l);m.vertexNormals.push(l.clone(),l.clone(),l.clone());this.faces.push(m);this.faceVertexUvs[0].push([k,n,r])}this.computeCentroids()};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);for(var a=a||0,b=b||50,e=void 0!==e?e:0,f=void 0!==f?f:2*Math.PI,c=void 0!==c?Math.max(3,c):8,d=void 0!==d?Math.max(3,d):8,h=[],g=a,i=(b-a)/d,a=0;a<=d;a++){for(b=0;b<=c;b++){var k=new THREE.Vector3,l=e+b/c*f;k.x=g*Math.cos(l);k.y=g*Math.sin(l);this.vertices.push(k);h.push(new THREE.Vector2((k.x/g+1)/2,-(k.y/g+1)/2+1))}g+=i}e=new THREE.Vector3(0,0,1);for(a=0;a<d;a++){f=a*c;for(b=0;b<=c;b++){var l=b+f,i=l+a,k=l+c+a,m=l+c+1+a;this.faces.push(new THREE.Face3(i,
+k,m,[e,e,e]));this.faceVertexUvs[0].push([h[i],h[k],h[m]]);i=l+a;k=l+c+1+a;m=l+1+a;this.faces.push(new THREE.Face3(i,k,m,[e,e,e]));this.faceVertexUvs[0].push([h[i],h[k],h[m]])}}this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,g)};THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry=function(a,b,c,d,e,f,h){THREE.Geometry.call(this);this.radius=a=a||50;this.widthSegments=b=Math.max(3,Math.floor(b)||8);this.heightSegments=c=Math.max(2,Math.floor(c)||6);this.phiStart=d=void 0!==d?d:0;this.phiLength=e=void 0!==e?e:2*Math.PI;this.thetaStart=f=void 0!==f?f:0;this.thetaLength=h=void 0!==h?h:Math.PI;var g,i,k=[],l=[];for(i=0;i<=c;i++){var m=[],n=[];for(g=0;g<=b;g++){var r=g/b,t=i/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+r*e)*Math.sin(f+t*h);p.y=a*Math.cos(f+t*h);
+p.z=a*Math.sin(d+r*e)*Math.sin(f+t*h);this.vertices.push(p);m.push(this.vertices.length-1);n.push(new THREE.Vector2(r,1-t))}k.push(m);l.push(n)}for(i=0;i<this.heightSegments;i++)for(g=0;g<this.widthSegments;g++){var b=k[i][g+1],c=k[i][g],d=k[i+1][g],e=k[i+1][g+1],f=this.vertices[b].clone().normalize(),h=this.vertices[c].clone().normalize(),m=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),r=l[i][g+1].clone(),t=l[i][g].clone(),p=l[i+1][g].clone(),s=l[i+1][g+1].clone();Math.abs(this.vertices[b].y)===
+this.radius?(this.faces.push(new THREE.Face3(b,d,e,[f,m,n])),this.faceVertexUvs[0].push([r,p,s])):Math.abs(this.vertices[d].y)===this.radius?(this.faces.push(new THREE.Face3(b,c,d,[f,h,m])),this.faceVertexUvs[0].push([r,t,p])):(this.faces.push(new THREE.Face3(b,c,e,[f,h,n])),this.faceVertexUvs[0].push([r,t,s]),this.faces.push(new THREE.Face3(c,d,e,[h,m,n])),this.faceVertexUvs[0].push([t,p,s]))}this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
 a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TextGeometry=function(a,b){var b=b||{},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)};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.radialSegments=c||8;this.tubularSegments=d||6;this.arc=e||2*Math.PI;e=new THREE.Vector3;a=[];b=[];for(c=0;c<=this.radialSegments;c++)for(d=0;d<=this.tubularSegments;d++){var f=d/this.tubularSegments*this.arc,h=2*c/this.radialSegments*Math.PI;e.x=this.radius*Math.cos(f);e.y=this.radius*Math.sin(f);var g=new THREE.Vector3;g.x=(this.radius+this.tube*Math.cos(h))*Math.cos(f);g.y=(this.radius+this.tube*
 Math.cos(h))*Math.sin(f);g.z=this.tube*Math.sin(h);this.vertices.push(g);a.push(new THREE.Vector2(d/this.tubularSegments,c/this.radialSegments));b.push(g.clone().sub(e).normalize())}for(c=1;c<=this.radialSegments;c++)for(d=1;d<=this.tubularSegments;d++){var e=(this.tubularSegments+1)*c+d-1,f=(this.tubularSegments+1)*(c-1)+d-1,h=(this.tubularSegments+1)*(c-1)+d,g=(this.tubularSegments+1)*c+d,i=new THREE.Face3(e,f,g,[b[e],b[f],b[g]]);i.normal.add(b[e]);i.normal.add(b[f]);i.normal.add(b[g]);i.normal.normalize();
 this.faces.push(i);this.faceVertexUvs[0].push([a[e].clone(),a[f].clone(),a[g].clone()]);i=new THREE.Face3(f,h,g,[b[f],b[h],b[g]]);i.normal.add(b[f]);i.normal.add(b[h]);i.normal.add(b[g]);i.normal.normalize();this.faces.push(i);this.faceVertexUvs[0].push([a[f].clone(),a[h].clone(),a[g].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry=function(a,b,c,d,e,f,h){function g(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a),a=b/c*a,b=Math.cos(a),f=0.5*(d*(2+b))*f,g=0.5*d*(2+b)*g,d=0.5*e*d*Math.sin(a);return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.radialSegments=c||64;this.tubularSegments=d||8;this.p=e||2;this.q=f||3;this.heightScale=h||1;this.grid=Array(this.radialSegments);c=new THREE.Vector3;d=new THREE.Vector3;e=new THREE.Vector3;for(a=0;a<this.radialSegments;++a){this.grid[a]=
@@ -626,10 +627,10 @@ h=new THREE.Vector2((b+1)/this.segments,(c+1)/this.radialSegments),i=new THREE.V
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],h=[],g=new THREE.Vector3,i=new THREE.Matrix4,b=b+1,k,l,m;this.tangents=e;this.normals=f;this.binormals=h;for(k=0;k<b;k++)l=k/(b-1),e[k]=a.getTangentAt(l),e[k].normalize();f[0]=new THREE.Vector3;h[0]=new THREE.Vector3;a=Number.MAX_VALUE;k=Math.abs(e[0].x);l=Math.abs(e[0].y);m=Math.abs(e[0].z);k<=a&&(a=k,d.set(1,0,0));l<=a&&(a=l,d.set(0,1,0));m<=a&&d.set(0,0,1);g.crossVectors(e[0],
 d).normalize();f[0].crossVectors(e[0],g);h[0].crossVectors(e[0],f[0]);for(k=1;k<b;k++)f[k]=f[k-1].clone(),h[k]=h[k-1].clone(),g.crossVectors(e[k-1],e[k]),1E-4<g.length()&&(g.normalize(),d=Math.acos(THREE.Math.clamp(e[k-1].dot(e[k]),-1,1)),f[k].applyMatrix4(i.makeRotationAxis(g,d))),h[k].crossVectors(e[k],f[k]);if(c){d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1));d/=b-1;0<e[0].dot(g.crossVectors(f[0],f[b-1]))&&(d=-d);for(k=1;k<b;k++)f[k].applyMatrix4(i.makeRotationAxis(e[k],d*k)),h[k].crossVectors(e[k],
 f[k])}};THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=g.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+0.5,a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+0.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()]);d.centroid.add(a).add(b).add(c).divideScalar(3);g.faces.push(d);d=Math.atan2(d.centroid.z,-d.centroid.x);g.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),
-h(c.uv,c,d)])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+0.5,a.y));return a.clone()}THREE.Geometry.call(this);for(var c=c||1,d=d||0,g=this,i=0,k=a.length;i<k;i++)e(new THREE.Vector3(a[i][0],a[i][1],a[i][2]));for(var l=this.vertices,a=[],i=0,k=b.length;i<k;i++){var m=l[b[i][0]],n=l[b[i][1]],t=l[b[i][2]];a[i]=new THREE.Face3(m.index,n.index,t.index,[m.clone(),n.clone(),t.clone()])}i=0;for(k=a.length;i<k;i++){n=a[i];l=d;b=Math.pow(2,
-l);Math.pow(4,l);for(var l=e(g.vertices[n.a]),m=e(g.vertices[n.b]),s=e(g.vertices[n.c]),n=[],t=0;t<=b;t++){n[t]=[];for(var p=e(l.clone().lerp(s,t/b)),q=e(m.clone().lerp(s,t/b)),r=b-t,u=0;u<=r;u++)n[t][u]=0==u&&t==b?p:e(p.clone().lerp(q,u/r))}for(t=0;t<b;t++)for(u=0;u<2*(b-t)-1;u++)l=Math.floor(u/2),0==u%2?f(n[t][l+1],n[t+1][l],n[t][l]):f(n[t][l+1],n[t+1][l+1],n[t+1][l])}i=0;for(k=this.faceVertexUvs[0].length;i<k;i++)d=this.faceVertexUvs[0][i],a=d[0].x,b=d[1].x,l=d[2].x,m=Math.max(a,Math.max(b,l)),
-n=Math.min(a,Math.min(b,l)),0.9<m&&0.1>n&&(0.2>a&&(d[0].x+=1),0.2>b&&(d[1].x+=1),0.2>l&&(d[2].x+=1));i=0;for(k=this.vertices.length;i<k;i++)this.vertices[i].multiplyScalar(c);this.mergeVertices();this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.IcosahedronGeometry=function(a,b){this.radius=a;this.detail=b;var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[[-1,c,0],[1,c,0],[-1,-c,0],[1,-c,0],[0,-1,c],[0,1,c],[0,-1,-c],[0,1,-c],[c,0,-1],[c,0,1],[-c,0,-1],[-c,0,1]],[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]],a,b)};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],[[0,2,4],[0,4,3],[0,3,5],[0,5,2],[1,2,5],[1,5,3],[1,3,4],[1,4,2]],a,b)};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,1,1],[-1,-1,1],[-1,1,-1],[1,-1,-1]],[[2,1,0],[0,3,2],[1,3,0],[2,3,1]],a,b)};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],h,g,i,k,l=b+1;for(h=0;h<=c;h++){k=h/c;for(g=0;g<=b;g++)i=g/b,i=a(i,k),d.push(i)}var m,n,t,s;for(h=0;h<c;h++)for(g=0;g<b;g++)a=h*l+g,d=h*l+g+1,k=(h+1)*l+g+1,i=(h+1)*l+g,m=new THREE.Vector2(g/b,h/c),n=new THREE.Vector2((g+1)/b,h/c),t=new THREE.Vector2((g+1)/b,(h+1)/c),s=new THREE.Vector2(g/b,(h+1)/c),e.push(new THREE.Face3(a,d,i)),f.push([m,n,s]),e.push(new THREE.Face3(d,k,i)),
-f.push([n,t,s]);this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.AxisHelper=function(a){var a=a||1,b=new THREE.Geometry;b.vertices.push(new THREE.Vector3,new THREE.Vector3(a,0,0),new THREE.Vector3,new THREE.Vector3(0,a,0),new THREE.Vector3,new THREE.Vector3(0,0,a));b.colors.push(new THREE.Color(16711680),new THREE.Color(16755200),new THREE.Color(65280),new THREE.Color(11206400),new THREE.Color(255),new THREE.Color(43775));a=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,b,a,THREE.LinePieces)};
+h(c.uv,c,d)])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+0.5,a.y));return a.clone()}THREE.Geometry.call(this);for(var c=c||1,d=d||0,g=this,i=0,k=a.length;i<k;i++)e(new THREE.Vector3(a[i][0],a[i][1],a[i][2]));for(var l=this.vertices,a=[],i=0,k=b.length;i<k;i++){var m=l[b[i][0]],n=l[b[i][1]],r=l[b[i][2]];a[i]=new THREE.Face3(m.index,n.index,r.index,[m.clone(),n.clone(),r.clone()])}i=0;for(k=a.length;i<k;i++){n=a[i];l=d;b=Math.pow(2,
+l);Math.pow(4,l);for(var l=e(g.vertices[n.a]),m=e(g.vertices[n.b]),t=e(g.vertices[n.c]),n=[],r=0;r<=b;r++){n[r]=[];for(var p=e(l.clone().lerp(t,r/b)),s=e(m.clone().lerp(t,r/b)),q=b-r,u=0;u<=q;u++)n[r][u]=0==u&&r==b?p:e(p.clone().lerp(s,u/q))}for(r=0;r<b;r++)for(u=0;u<2*(b-r)-1;u++)l=Math.floor(u/2),0==u%2?f(n[r][l+1],n[r+1][l],n[r][l]):f(n[r][l+1],n[r+1][l+1],n[r+1][l])}i=0;for(k=this.faceVertexUvs[0].length;i<k;i++)d=this.faceVertexUvs[0][i],a=d[0].x,b=d[1].x,l=d[2].x,m=Math.max(a,Math.max(b,l)),
+n=Math.min(a,Math.min(b,l)),0.9<m&&0.1>n&&(0.2>a&&(d[0].x+=1),0.2>b&&(d[1].x+=1),0.2>l&&(d[2].x+=1));i=0;for(k=this.vertices.length;i<k;i++)this.vertices[i].multiplyScalar(c);this.mergeVertices();this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.IcosahedronGeometry=function(a,b){this.radius=a;this.detail=b;var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[[-1,c,0],[1,c,0],[-1,-c,0],[1,-c,0],[0,-1,c],[0,1,c],[0,-1,-c],[0,1,-c],[c,0,-1],[c,0,1],[-c,0,-1],[-c,0,1]],[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]],a,b)};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],[[0,2,4],[0,4,3],[0,3,5],[0,5,2],[1,2,5],[1,5,3],[1,3,4],[1,4,2]],a,b)};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,1,1],[-1,-1,1],[-1,1,-1],[1,-1,-1]],[[2,1,0],[0,3,2],[1,3,0],[2,3,1]],a,b)};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],h,g,i,k,l=b+1;for(h=0;h<=c;h++){k=h/c;for(g=0;g<=b;g++)i=g/b,i=a(i,k),d.push(i)}var m,n,r,t;for(h=0;h<c;h++)for(g=0;g<b;g++)a=h*l+g,d=h*l+g+1,k=(h+1)*l+g+1,i=(h+1)*l+g,m=new THREE.Vector2(g/b,h/c),n=new THREE.Vector2((g+1)/b,h/c),r=new THREE.Vector2((g+1)/b,(h+1)/c),t=new THREE.Vector2(g/b,(h+1)/c),e.push(new THREE.Face3(a,d,i)),f.push([m,n,t]),e.push(new THREE.Face3(d,k,i)),
+f.push([n,r,t]);this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.AxisHelper=function(a){var a=a||1,b=new THREE.Geometry;b.vertices.push(new THREE.Vector3,new THREE.Vector3(a,0,0),new THREE.Vector3,new THREE.Vector3(0,a,0),new THREE.Vector3,new THREE.Vector3(0,0,a));b.colors.push(new THREE.Color(16711680),new THREE.Color(16755200),new THREE.Color(65280),new THREE.Color(11206400),new THREE.Color(255),new THREE.Color(43775));a=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,b,a,THREE.LinePieces)};
 THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);THREE.ArrowHelper=function(a,b,c,d){THREE.Object3D.call(this);void 0===d&&(d=16776960);void 0===c&&(c=1);this.position=b;b=new THREE.Geometry;b.vertices.push(new THREE.Vector3(0,0,0));b.vertices.push(new THREE.Vector3(0,1,0));this.line=new THREE.Line(b,new THREE.LineBasicMaterial({color:d}));this.line.matrixAutoUpdate=!1;this.add(this.line);b=new THREE.CylinderGeometry(0,0.05,0.25,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,0.875,0));this.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:d}));
 this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(a);this.setLength(c)};THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.ArrowHelper.prototype.setDirection=function(){var a=new THREE.Vector3,b;return function(c){0.99999<c.y?this.quaternion.set(0,0,0,1):-0.99999>c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();THREE.ArrowHelper.prototype.setLength=function(a){this.scale.set(a,a,a)};
 THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.setHex(a);this.cone.material.color.setHex(a)};THREE.BoxHelper=function(a){var b=[new THREE.Vector3(1,1,1),new THREE.Vector3(-1,1,1),new THREE.Vector3(-1,-1,1),new THREE.Vector3(1,-1,1),new THREE.Vector3(1,1,-1),new THREE.Vector3(-1,1,-1),new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,-1,-1)];this.vertices=b;var c=new THREE.Geometry;c.vertices.push(b[0],b[1],b[1],b[2],b[2],b[3],b[3],b[0],b[4],b[5],b[5],b[6],b[6],b[7],b[7],b[4],b[0],b[4],b[1],b[5],b[2],b[6],b[3],b[7]);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);
@@ -659,38 +660,38 @@ THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=thi
 THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b};
 THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1};
 THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;b<c;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a;if(d.mirroredLoop){if(d.time>d.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),h=d.weight;
-f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*h,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*h;this.morphTargetInfluences[d.lastFrame]=(1-e)*h}}};THREE.LensFlarePlugin=function(){function a(a,c){var d=b.createProgram(),e=b.createShader(b.FRAGMENT_SHADER),f=b.createShader(b.VERTEX_SHADER),g="precision "+c+" float;\n";b.shaderSource(e,g+a.fragmentShader);b.shaderSource(f,g+a.vertexShader);b.compileShader(e);b.compileShader(f);b.attachShader(d,e);b.attachShader(d,f);b.linkProgram(d);return d}var b,c,d,e,f,h,g,i,k,l,m,n,t;this.init=function(s){b=s.context;c=s;d=s.getPrecision();e=new Float32Array(16);f=new Uint16Array(6);s=0;e[s++]=-1;e[s++]=-1;
-e[s++]=0;e[s++]=0;e[s++]=1;e[s++]=-1;e[s++]=1;e[s++]=0;e[s++]=1;e[s++]=1;e[s++]=1;e[s++]=1;e[s++]=-1;e[s++]=1;e[s++]=0;e[s++]=1;s=0;f[s++]=0;f[s++]=1;f[s++]=2;f[s++]=0;f[s++]=2;f[s++]=3;h=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,h);b.bufferData(b.ARRAY_BUFFER,e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);i=b.createTexture();k=b.createTexture();b.bindTexture(b.TEXTURE_2D,i);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,
+f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*h,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*h;this.morphTargetInfluences[d.lastFrame]=(1-e)*h}}};THREE.LensFlarePlugin=function(){function a(a,c){var d=b.createProgram(),e=b.createShader(b.FRAGMENT_SHADER),f=b.createShader(b.VERTEX_SHADER),g="precision "+c+" float;\n";b.shaderSource(e,g+a.fragmentShader);b.shaderSource(f,g+a.vertexShader);b.compileShader(e);b.compileShader(f);b.attachShader(d,e);b.attachShader(d,f);b.linkProgram(d);return d}var b,c,d,e,f,h,g,i,k,l,m,n,r;this.init=function(t){b=t.context;c=t;d=t.getPrecision();e=new Float32Array(16);f=new Uint16Array(6);t=0;e[t++]=-1;e[t++]=-1;
+e[t++]=0;e[t++]=0;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;t=0;f[t++]=0;f[t++]=1;f[t++]=2;f[t++]=0;f[t++]=2;f[t++]=3;h=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,h);b.bufferData(b.ARRAY_BUFFER,e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);i=b.createTexture();k=b.createTexture();b.bindTexture(b.TEXTURE_2D,i);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,
 0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,k);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);
-b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(l=!1,m=a(THREE.ShaderFlares.lensFlare,d)):(l=!0,m=a(THREE.ShaderFlares.lensFlareVertexTexture,d));n={};t={};n.vertex=b.getAttribLocation(m,"position");n.uv=b.getAttribLocation(m,"uv");t.renderType=b.getUniformLocation(m,"renderType");t.map=b.getUniformLocation(m,"map");t.occlusionMap=b.getUniformLocation(m,"occlusionMap");t.opacity=
-b.getUniformLocation(m,"opacity");t.color=b.getUniformLocation(m,"color");t.scale=b.getUniformLocation(m,"scale");t.rotation=b.getUniformLocation(m,"rotation");t.screenPosition=b.getUniformLocation(m,"screenPosition")};this.render=function(a,d,e,f){var a=a.__webglFlares,u=a.length;if(u){var w=new THREE.Vector3,E=f/e,C=0.5*e,F=0.5*f,z=16/f,D=new THREE.Vector2(z*E,z),y=new THREE.Vector3(1,1,0),O=new THREE.Vector2(1,1),x=t,z=n;b.useProgram(m);b.enableVertexAttribArray(n.vertex);b.enableVertexAttribArray(n.uv);
-b.uniform1i(x.occlusionMap,0);b.uniform1i(x.map,1);b.bindBuffer(b.ARRAY_BUFFER,h);b.vertexAttribPointer(z.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(z.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.disable(b.CULL_FACE);b.depthMask(!1);var B,I,v,A,G;for(B=0;B<u;B++)if(z=16/f,D.set(z*E,z),A=a[B],w.set(A.matrixWorld.elements[12],A.matrixWorld.elements[13],A.matrixWorld.elements[14]),w.applyMatrix4(d.matrixWorldInverse),w.applyProjection(d.projectionMatrix),y.copy(w),O.x=y.x*C+C,
-O.y=y.y*F+F,l||0<O.x&&O.x<e&&0<O.y&&O.y<f){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,O.x-8,O.y-8,16,16,0);b.uniform1i(x.renderType,0);b.uniform2f(x.scale,D.x,D.y);b.uniform3f(x.screenPosition,y.x,y.y,y.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,k);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,O.x-8,O.y-8,16,16,0);b.uniform1i(x.renderType,1);b.disable(b.DEPTH_TEST);
-b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);A.positionScreen.copy(y);A.customUpdateCallback?A.customUpdateCallback(A):A.updateLensFlares();b.uniform1i(x.renderType,2);b.enable(b.BLEND);I=0;for(v=A.lensFlares.length;I<v;I++)G=A.lensFlares[I],0.001<G.opacity&&0.001<G.scale&&(y.x=G.x,y.y=G.y,y.z=G.z,z=G.size*G.scale/f,D.x=z*E,D.y=z,b.uniform3f(x.screenPosition,y.x,y.y,y.z),b.uniform2f(x.scale,D.x,D.y),b.uniform1f(x.rotation,G.rotation),b.uniform1f(x.opacity,
-G.opacity),b.uniform3f(x.color,G.color.r,G.color.g,G.color.b),c.setBlending(G.blending,G.blendEquation,G.blendSrc,G.blendDst),c.setTexture(G.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0))}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,h=new THREE.Frustum,g=new THREE.Matrix4,i=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
-vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(m,n){var t,s,p,q,r,u,w,E,C,F=[];q=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
-a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);t=0;for(s=m.__lights.length;t<s;t++)if(p=m.__lights[t],p.castShadow)if(p instanceof THREE.DirectionalLight&&p.shadowCascade)for(r=0;r<p.shadowCascadeCount;r++){var z;if(p.shadowCascadeArray[r])z=p.shadowCascadeArray[r];else{C=p;w=r;z=new THREE.DirectionalLight;z.isVirtual=!0;z.onlyShadow=!0;z.castShadow=!0;z.shadowCameraNear=C.shadowCameraNear;z.shadowCameraFar=C.shadowCameraFar;z.shadowCameraLeft=C.shadowCameraLeft;z.shadowCameraRight=C.shadowCameraRight;
-z.shadowCameraBottom=C.shadowCameraBottom;z.shadowCameraTop=C.shadowCameraTop;z.shadowCameraVisible=C.shadowCameraVisible;z.shadowDarkness=C.shadowDarkness;z.shadowBias=C.shadowCascadeBias[w];z.shadowMapWidth=C.shadowCascadeWidth[w];z.shadowMapHeight=C.shadowCascadeHeight[w];z.pointsWorld=[];z.pointsFrustum=[];E=z.pointsWorld;u=z.pointsFrustum;for(var D=0;8>D;D++)E[D]=new THREE.Vector3,u[D]=new THREE.Vector3;E=C.shadowCascadeNearZ[w];C=C.shadowCascadeFarZ[w];u[0].set(-1,-1,E);u[1].set(1,-1,E);u[2].set(-1,
-1,E);u[3].set(1,1,E);u[4].set(-1,-1,C);u[5].set(1,-1,C);u[6].set(-1,1,C);u[7].set(1,1,C);z.originalCamera=n;u=new THREE.Gyroscope;u.position=p.shadowCascadeOffset;u.add(z);u.add(z.target);n.add(u);p.shadowCascadeArray[r]=z;console.log("Created virtualLight",z)}w=p;E=r;C=w.shadowCascadeArray[E];C.position.copy(w.position);C.target.position.copy(w.target.position);C.lookAt(C.target);C.shadowCameraVisible=w.shadowCameraVisible;C.shadowDarkness=w.shadowDarkness;C.shadowBias=w.shadowCascadeBias[E];u=w.shadowCascadeNearZ[E];
-w=w.shadowCascadeFarZ[E];C=C.pointsFrustum;C[0].z=u;C[1].z=u;C[2].z=u;C[3].z=u;C[4].z=w;C[5].z=w;C[6].z=w;C[7].z=w;F[q]=z;q++}else F[q]=p,q++;t=0;for(s=F.length;t<s;t++){p=F[t];p.shadowMap||(r=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(r=THREE.NearestFilter),p.shadowMap=new THREE.WebGLRenderTarget(p.shadowMapWidth,p.shadowMapHeight,{minFilter:r,magFilter:r,format:THREE.RGBAFormat}),p.shadowMapSize=new THREE.Vector2(p.shadowMapWidth,p.shadowMapHeight),p.shadowMatrix=new THREE.Matrix4);
+b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(l=!1,m=a(THREE.ShaderFlares.lensFlare,d)):(l=!0,m=a(THREE.ShaderFlares.lensFlareVertexTexture,d));n={};r={};n.vertex=b.getAttribLocation(m,"position");n.uv=b.getAttribLocation(m,"uv");r.renderType=b.getUniformLocation(m,"renderType");r.map=b.getUniformLocation(m,"map");r.occlusionMap=b.getUniformLocation(m,"occlusionMap");r.opacity=
+b.getUniformLocation(m,"opacity");r.color=b.getUniformLocation(m,"color");r.scale=b.getUniformLocation(m,"scale");r.rotation=b.getUniformLocation(m,"rotation");r.screenPosition=b.getUniformLocation(m,"screenPosition")};this.render=function(a,d,e,f){var a=a.__webglFlares,u=a.length;if(u){var w=new THREE.Vector3,v=f/e,C=0.5*e,z=0.5*f,y=16/f,F=new THREE.Vector2(y*v,y),x=new THREE.Vector3(1,1,0),O=new THREE.Vector2(1,1),B=r,y=n;b.useProgram(m);b.enableVertexAttribArray(n.vertex);b.enableVertexAttribArray(n.uv);
+b.uniform1i(B.occlusionMap,0);b.uniform1i(B.map,1);b.bindBuffer(b.ARRAY_BUFFER,h);b.vertexAttribPointer(y.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(y.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.disable(b.CULL_FACE);b.depthMask(!1);var E,I,D,A,G;for(E=0;E<u;E++)if(y=16/f,F.set(y*v,y),A=a[E],w.set(A.matrixWorld.elements[12],A.matrixWorld.elements[13],A.matrixWorld.elements[14]),w.applyMatrix4(d.matrixWorldInverse),w.applyProjection(d.projectionMatrix),x.copy(w),O.x=x.x*C+C,
+O.y=x.y*z+z,l||0<O.x&&O.x<e&&0<O.y&&O.y<f){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,O.x-8,O.y-8,16,16,0);b.uniform1i(B.renderType,0);b.uniform2f(B.scale,F.x,F.y);b.uniform3f(B.screenPosition,x.x,x.y,x.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,k);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,O.x-8,O.y-8,16,16,0);b.uniform1i(B.renderType,1);b.disable(b.DEPTH_TEST);
+b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);A.positionScreen.copy(x);A.customUpdateCallback?A.customUpdateCallback(A):A.updateLensFlares();b.uniform1i(B.renderType,2);b.enable(b.BLEND);I=0;for(D=A.lensFlares.length;I<D;I++)G=A.lensFlares[I],0.001<G.opacity&&0.001<G.scale&&(x.x=G.x,x.y=G.y,x.z=G.z,y=G.size*G.scale/f,F.x=y*v,F.y=y,b.uniform3f(B.screenPosition,x.x,x.y,x.z),b.uniform2f(B.scale,F.x,F.y),b.uniform1f(B.rotation,G.rotation),b.uniform1f(B.opacity,
+G.opacity),b.uniform3f(B.color,G.color.r,G.color.g,G.color.b),c.setBlending(G.blending,G.blendEquation,G.blendSrc,G.blendDst),c.setTexture(G.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0))}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,h=new THREE.Frustum,g=new THREE.Matrix4,i=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
+vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(m,n){var r,t,p,s,q,u,w,v,C,z=[];s=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
+a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);r=0;for(t=m.__lights.length;r<t;r++)if(p=m.__lights[r],p.castShadow)if(p instanceof THREE.DirectionalLight&&p.shadowCascade)for(q=0;q<p.shadowCascadeCount;q++){var y;if(p.shadowCascadeArray[q])y=p.shadowCascadeArray[q];else{C=p;w=q;y=new THREE.DirectionalLight;y.isVirtual=!0;y.onlyShadow=!0;y.castShadow=!0;y.shadowCameraNear=C.shadowCameraNear;y.shadowCameraFar=C.shadowCameraFar;y.shadowCameraLeft=C.shadowCameraLeft;y.shadowCameraRight=C.shadowCameraRight;
+y.shadowCameraBottom=C.shadowCameraBottom;y.shadowCameraTop=C.shadowCameraTop;y.shadowCameraVisible=C.shadowCameraVisible;y.shadowDarkness=C.shadowDarkness;y.shadowBias=C.shadowCascadeBias[w];y.shadowMapWidth=C.shadowCascadeWidth[w];y.shadowMapHeight=C.shadowCascadeHeight[w];y.pointsWorld=[];y.pointsFrustum=[];v=y.pointsWorld;u=y.pointsFrustum;for(var F=0;8>F;F++)v[F]=new THREE.Vector3,u[F]=new THREE.Vector3;v=C.shadowCascadeNearZ[w];C=C.shadowCascadeFarZ[w];u[0].set(-1,-1,v);u[1].set(1,-1,v);u[2].set(-1,
+1,v);u[3].set(1,1,v);u[4].set(-1,-1,C);u[5].set(1,-1,C);u[6].set(-1,1,C);u[7].set(1,1,C);y.originalCamera=n;u=new THREE.Gyroscope;u.position=p.shadowCascadeOffset;u.add(y);u.add(y.target);n.add(u);p.shadowCascadeArray[q]=y;console.log("Created virtualLight",y)}w=p;v=q;C=w.shadowCascadeArray[v];C.position.copy(w.position);C.target.position.copy(w.target.position);C.lookAt(C.target);C.shadowCameraVisible=w.shadowCameraVisible;C.shadowDarkness=w.shadowDarkness;C.shadowBias=w.shadowCascadeBias[v];u=w.shadowCascadeNearZ[v];
+w=w.shadowCascadeFarZ[v];C=C.pointsFrustum;C[0].z=u;C[1].z=u;C[2].z=u;C[3].z=u;C[4].z=w;C[5].z=w;C[6].z=w;C[7].z=w;z[s]=y;s++}else z[s]=p,s++;r=0;for(t=z.length;r<t;r++){p=z[r];p.shadowMap||(q=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(q=THREE.NearestFilter),p.shadowMap=new THREE.WebGLRenderTarget(p.shadowMapWidth,p.shadowMapHeight,{minFilter:q,magFilter:q,format:THREE.RGBAFormat}),p.shadowMapSize=new THREE.Vector2(p.shadowMapWidth,p.shadowMapHeight),p.shadowMatrix=new THREE.Matrix4);
 if(!p.shadowCamera){if(p instanceof THREE.SpotLight)p.shadowCamera=new THREE.PerspectiveCamera(p.shadowCameraFov,p.shadowMapWidth/p.shadowMapHeight,p.shadowCameraNear,p.shadowCameraFar);else if(p instanceof THREE.DirectionalLight)p.shadowCamera=new THREE.OrthographicCamera(p.shadowCameraLeft,p.shadowCameraRight,p.shadowCameraTop,p.shadowCameraBottom,p.shadowCameraNear,p.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}m.add(p.shadowCamera);!0===m.autoUpdate&&m.updateMatrixWorld()}p.shadowCameraVisible&&
-!p.cameraHelper&&(p.cameraHelper=new THREE.CameraHelper(p.shadowCamera),p.shadowCamera.add(p.cameraHelper));if(p.isVirtual&&z.originalCamera==n){r=n;q=p.shadowCamera;u=p.pointsFrustum;C=p.pointsWorld;i.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(w=0;8>w;w++)E=C[w],E.copy(u[w]),THREE.ShadowMapPlugin.__projector.unprojectVector(E,r),E.applyMatrix4(q.matrixWorldInverse),E.x<i.x&&(i.x=E.x),E.x>k.x&&(k.x=E.x),E.y<i.y&&(i.y=E.y),E.y>k.y&&(k.y=E.y),E.z<i.z&&(i.z=E.z),E.z>k.z&&
-(k.z=E.z);q.left=i.x;q.right=k.x;q.top=k.y;q.bottom=i.y;q.updateProjectionMatrix()}q=p.shadowMap;u=p.shadowMatrix;r=p.shadowCamera;r.position.getPositionFromMatrix(p.matrixWorld);l.getPositionFromMatrix(p.target.matrixWorld);r.lookAt(l);r.updateMatrixWorld();r.matrixWorldInverse.getInverse(r.matrixWorld);p.cameraHelper&&(p.cameraHelper.visible=p.shadowCameraVisible);p.shadowCameraVisible&&p.cameraHelper.update();u.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);u.multiply(r.projectionMatrix);u.multiply(r.matrixWorldInverse);
-g.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse);h.setFromMatrix(g);b.setRenderTarget(q);b.clear();C=m.__webglObjects;p=0;for(q=C.length;p<q;p++)if(w=C[p],u=w.object,w.render=!1,u.visible&&u.castShadow&&(!(u instanceof THREE.Mesh||u instanceof THREE.ParticleSystem)||!u.frustumCulled||h.intersectsObject(u)))u._modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,u.matrixWorld),w.render=!0;p=0;for(q=C.length;p<q;p++)w=C[p],w.render&&(u=w.object,w=w.buffer,D=u.material instanceof THREE.MeshFaceMaterial?
-u.material.materials[0]:u.material,E=0<u.geometry.morphTargets.length&&D.morphTargets,D=u instanceof THREE.SkinnedMesh&&D.skinning,E=u.customDepthMaterial?u.customDepthMaterial:D?E?f:e:E?d:c,w instanceof THREE.BufferGeometry?b.renderBufferDirect(r,m.__lights,null,E,w,u):b.renderBuffer(r,m.__lights,null,E,w,u));C=m.__webglObjectsImmediate;p=0;for(q=C.length;p<q;p++)w=C[p],u=w.object,u.visible&&u.castShadow&&(u._modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,u.matrixWorld),b.renderImmediateObject(r,
-m.__lights,null,c,u))}t=b.getClearColor();s=b.getClearAlpha();a.clearColor(t.r,t.g,t.b,s);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){function a(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var b,c,d,e,f,h,g,i,k,l;this.init=function(a){b=a.context;c=a;d=a.getPrecision();e=new Float32Array(16);f=new Uint16Array(6);a=0;e[a++]=-1;e[a++]=-1;e[a++]=0;e[a++]=0;e[a++]=1;e[a++]=-1;e[a++]=1;e[a++]=0;e[a++]=1;e[a++]=1;e[a++]=1;e[a++]=1;e[a++]=-1;e[a++]=1;e[a++]=0;e[a++]=1;a=0;f[a++]=0;f[a++]=1;f[a++]=2;f[a++]=0;f[a++]=2;f[a++]=3;h=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,h);b.bufferData(b.ARRAY_BUFFER,
-e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);var a=THREE.ShaderSprite.sprite,n=b.createProgram(),t=b.createShader(b.FRAGMENT_SHADER),s=b.createShader(b.VERTEX_SHADER),p="precision "+d+" float;\n";b.shaderSource(t,p+a.fragmentShader);b.shaderSource(s,p+a.vertexShader);b.compileShader(t);b.compileShader(s);b.attachShader(n,t);b.attachShader(n,s);b.linkProgram(n);i=n;k={};l={};k.position=b.getAttribLocation(i,"position");k.uv=b.getAttribLocation(i,
+!p.cameraHelper&&(p.cameraHelper=new THREE.CameraHelper(p.shadowCamera),p.shadowCamera.add(p.cameraHelper));if(p.isVirtual&&y.originalCamera==n){q=n;s=p.shadowCamera;u=p.pointsFrustum;C=p.pointsWorld;i.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(w=0;8>w;w++)v=C[w],v.copy(u[w]),THREE.ShadowMapPlugin.__projector.unprojectVector(v,q),v.applyMatrix4(s.matrixWorldInverse),v.x<i.x&&(i.x=v.x),v.x>k.x&&(k.x=v.x),v.y<i.y&&(i.y=v.y),v.y>k.y&&(k.y=v.y),v.z<i.z&&(i.z=v.z),v.z>k.z&&
+(k.z=v.z);s.left=i.x;s.right=k.x;s.top=k.y;s.bottom=i.y;s.updateProjectionMatrix()}s=p.shadowMap;u=p.shadowMatrix;q=p.shadowCamera;q.position.getPositionFromMatrix(p.matrixWorld);l.getPositionFromMatrix(p.target.matrixWorld);q.lookAt(l);q.updateMatrixWorld();q.matrixWorldInverse.getInverse(q.matrixWorld);p.cameraHelper&&(p.cameraHelper.visible=p.shadowCameraVisible);p.shadowCameraVisible&&p.cameraHelper.update();u.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);u.multiply(q.projectionMatrix);u.multiply(q.matrixWorldInverse);
+g.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse);h.setFromMatrix(g);b.setRenderTarget(s);b.clear();C=m.__webglObjects;p=0;for(s=C.length;p<s;p++)if(w=C[p],u=w.object,w.render=!1,u.visible&&u.castShadow&&(!(u instanceof THREE.Mesh||u instanceof THREE.ParticleSystem)||!u.frustumCulled||h.intersectsObject(u)))u._modelViewMatrix.multiplyMatrices(q.matrixWorldInverse,u.matrixWorld),w.render=!0;p=0;for(s=C.length;p<s;p++)w=C[p],w.render&&(u=w.object,w=w.buffer,F=u.material instanceof THREE.MeshFaceMaterial?
+u.material.materials[0]:u.material,v=0<u.geometry.morphTargets.length&&F.morphTargets,F=u instanceof THREE.SkinnedMesh&&F.skinning,v=u.customDepthMaterial?u.customDepthMaterial:F?v?f:e:v?d:c,w instanceof THREE.BufferGeometry?b.renderBufferDirect(q,m.__lights,null,v,w,u):b.renderBuffer(q,m.__lights,null,v,w,u));C=m.__webglObjectsImmediate;p=0;for(s=C.length;p<s;p++)w=C[p],u=w.object,u.visible&&u.castShadow&&(u._modelViewMatrix.multiplyMatrices(q.matrixWorldInverse,u.matrixWorld),b.renderImmediateObject(q,
+m.__lights,null,c,u))}r=b.getClearColor();t=b.getClearAlpha();a.clearColor(r.r,r.g,r.b,t);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){function a(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var b,c,d,e,f,h,g,i,k,l;this.init=function(a){b=a.context;c=a;d=a.getPrecision();e=new Float32Array(16);f=new Uint16Array(6);a=0;e[a++]=-1;e[a++]=-1;e[a++]=0;e[a++]=0;e[a++]=1;e[a++]=-1;e[a++]=1;e[a++]=0;e[a++]=1;e[a++]=1;e[a++]=1;e[a++]=1;e[a++]=-1;e[a++]=1;e[a++]=0;e[a++]=1;a=0;f[a++]=0;f[a++]=1;f[a++]=2;f[a++]=0;f[a++]=2;f[a++]=3;h=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,h);b.bufferData(b.ARRAY_BUFFER,
+e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);var a=THREE.ShaderSprite.sprite,n=b.createProgram(),r=b.createShader(b.FRAGMENT_SHADER),t=b.createShader(b.VERTEX_SHADER),p="precision "+d+" float;\n";b.shaderSource(r,p+a.fragmentShader);b.shaderSource(t,p+a.vertexShader);b.compileShader(r);b.compileShader(t);b.attachShader(n,r);b.attachShader(n,t);b.linkProgram(n);i=n;k={};l={};k.position=b.getAttribLocation(i,"position");k.uv=b.getAttribLocation(i,
 "uv");l.uvOffset=b.getUniformLocation(i,"uvOffset");l.uvScale=b.getUniformLocation(i,"uvScale");l.rotation=b.getUniformLocation(i,"rotation");l.scale=b.getUniformLocation(i,"scale");l.alignment=b.getUniformLocation(i,"alignment");l.color=b.getUniformLocation(i,"color");l.map=b.getUniformLocation(i,"map");l.opacity=b.getUniformLocation(i,"opacity");l.useScreenCoordinates=b.getUniformLocation(i,"useScreenCoordinates");l.sizeAttenuation=b.getUniformLocation(i,"sizeAttenuation");l.screenPosition=b.getUniformLocation(i,
-"screenPosition");l.modelViewMatrix=b.getUniformLocation(i,"modelViewMatrix");l.projectionMatrix=b.getUniformLocation(i,"projectionMatrix");l.fogType=b.getUniformLocation(i,"fogType");l.fogDensity=b.getUniformLocation(i,"fogDensity");l.fogNear=b.getUniformLocation(i,"fogNear");l.fogFar=b.getUniformLocation(i,"fogFar");l.fogColor=b.getUniformLocation(i,"fogColor");l.alphaTest=b.getUniformLocation(i,"alphaTest")};this.render=function(d,e,f,s){var p=d.__webglSprites,q=p.length;if(q){var r=k,u=l,w=s/
-f,f=0.5*f,E=0.5*s;b.useProgram(i);b.enableVertexAttribArray(r.position);b.enableVertexAttribArray(r.uv);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.bindBuffer(b.ARRAY_BUFFER,h);b.vertexAttribPointer(r.position,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(r.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.uniformMatrix4fv(u.projectionMatrix,!1,e.projectionMatrix.elements);b.activeTexture(b.TEXTURE0);b.uniform1i(u.map,0);var C=r=0,F=d.fog;F?(b.uniform3f(u.fogColor,F.color.r,F.color.g,F.color.b),
-F instanceof THREE.Fog?(b.uniform1f(u.fogNear,F.near),b.uniform1f(u.fogFar,F.far),b.uniform1i(u.fogType,1),C=r=1):F instanceof THREE.FogExp2&&(b.uniform1f(u.fogDensity,F.density),b.uniform1i(u.fogType,2),C=r=2)):(b.uniform1i(u.fogType,0),C=r=0);for(var z,D,y=[],F=0;F<q;F++)z=p[F],D=z.material,z.visible&&0!==D.opacity&&(D.useScreenCoordinates?z.z=-z.position.z:(z._modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,z.matrixWorld),z.z=-z._modelViewMatrix.elements[14]));p.sort(a);for(F=0;F<q;F++)z=
-p[F],D=z.material,z.visible&&0!==D.opacity&&(D.map&&D.map.image&&D.map.image.width)&&(b.uniform1f(u.alphaTest,D.alphaTest),!0===D.useScreenCoordinates?(b.uniform1i(u.useScreenCoordinates,1),b.uniform3f(u.screenPosition,(z.position.x*c.devicePixelRatio-f)/f,(E-z.position.y*c.devicePixelRatio)/E,Math.max(0,Math.min(1,z.position.z))),y[0]=c.devicePixelRatio,y[1]=c.devicePixelRatio):(b.uniform1i(u.useScreenCoordinates,0),b.uniform1i(u.sizeAttenuation,D.sizeAttenuation?1:0),b.uniformMatrix4fv(u.modelViewMatrix,
-!1,z._modelViewMatrix.elements),y[0]=1,y[1]=1),e=d.fog&&D.fog?C:0,r!==e&&(b.uniform1i(u.fogType,e),r=e),e=1/(D.scaleByViewport?s:1),y[0]*=e*w*z.scale.x,y[1]*=e*z.scale.y,b.uniform2f(u.uvScale,D.uvScale.x,D.uvScale.y),b.uniform2f(u.uvOffset,D.uvOffset.x,D.uvOffset.y),b.uniform2f(u.alignment,D.alignment.x,D.alignment.y),b.uniform1f(u.opacity,D.opacity),b.uniform3f(u.color,D.color.r,D.color.g,D.color.b),b.uniform1f(u.rotation,z.rotation),b.uniform2fv(u.scale,y),c.setBlending(D.blending,D.blendEquation,
-D.blendSrc,D.blendDst),c.setDepthTest(D.depthTest),c.setDepthWrite(D.depthWrite),c.setTexture(D.map,0),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,h=new THREE.Frustum,g=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
-vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(i,k){var l,m,n,t,s,p;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===i.autoUpdate&&i.updateMatrixWorld();k.matrixWorldInverse.getInverse(k.matrixWorld);g.multiplyMatrices(k.projectionMatrix,
-k.matrixWorldInverse);h.setFromMatrix(g);b.setRenderTarget(this.renderTarget);b.clear();p=i.__webglObjects;l=0;for(m=p.length;l<m;l++)if(n=p[l],s=n.object,n.render=!1,s.visible&&(!(s instanceof THREE.Mesh||s instanceof THREE.ParticleSystem)||!s.frustumCulled||h.intersectsObject(s)))s._modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,s.matrixWorld),n.render=!0;var q;l=0;for(m=p.length;l<m;l++)if(n=p[l],n.render&&(s=n.object,n=n.buffer,!(s instanceof THREE.ParticleSystem)||s.customDepthMaterial))(q=
-s.material instanceof THREE.MeshFaceMaterial?s.material.materials[0]:s.material)&&b.setMaterialFaces(s.material),t=0<s.geometry.morphTargets.length&&q.morphTargets,q=s instanceof THREE.SkinnedMesh&&q.skinning,t=s.customDepthMaterial?s.customDepthMaterial:q?t?f:e:t?d:c,n instanceof THREE.BufferGeometry?b.renderBufferDirect(k,i.__lights,null,t,n,s):b.renderBuffer(k,i.__lights,null,t,n,s);p=i.__webglObjectsImmediate;l=0;for(m=p.length;l<m;l++)n=p[l],s=n.object,s.visible&&(s._modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,
-s.matrixWorld),b.renderImmediateObject(k,i.__lights,null,c,s));l=b.getClearColor();m=b.getClearAlpha();a.clearColor(l.r,l.g,l.b,m);a.enable(a.BLEND)}};THREE.ShaderFlares={lensFlareVertexTexture:{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}",
+"screenPosition");l.modelViewMatrix=b.getUniformLocation(i,"modelViewMatrix");l.projectionMatrix=b.getUniformLocation(i,"projectionMatrix");l.fogType=b.getUniformLocation(i,"fogType");l.fogDensity=b.getUniformLocation(i,"fogDensity");l.fogNear=b.getUniformLocation(i,"fogNear");l.fogFar=b.getUniformLocation(i,"fogFar");l.fogColor=b.getUniformLocation(i,"fogColor");l.alphaTest=b.getUniformLocation(i,"alphaTest")};this.render=function(d,e,f,t){var p=d.__webglSprites,s=p.length;if(s){var q=k,u=l,w=t/
+f,f=0.5*f,v=0.5*t;b.useProgram(i);b.enableVertexAttribArray(q.position);b.enableVertexAttribArray(q.uv);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.bindBuffer(b.ARRAY_BUFFER,h);b.vertexAttribPointer(q.position,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(q.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.uniformMatrix4fv(u.projectionMatrix,!1,e.projectionMatrix.elements);b.activeTexture(b.TEXTURE0);b.uniform1i(u.map,0);var C=q=0,z=d.fog;z?(b.uniform3f(u.fogColor,z.color.r,z.color.g,z.color.b),
+z instanceof THREE.Fog?(b.uniform1f(u.fogNear,z.near),b.uniform1f(u.fogFar,z.far),b.uniform1i(u.fogType,1),C=q=1):z instanceof THREE.FogExp2&&(b.uniform1f(u.fogDensity,z.density),b.uniform1i(u.fogType,2),C=q=2)):(b.uniform1i(u.fogType,0),C=q=0);for(var y,F,x=[],z=0;z<s;z++)y=p[z],F=y.material,y.visible&&0!==F.opacity&&(F.useScreenCoordinates?y.z=-y.position.z:(y._modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,y.matrixWorld),y.z=-y._modelViewMatrix.elements[14]));p.sort(a);for(z=0;z<s;z++)y=
+p[z],F=y.material,y.visible&&0!==F.opacity&&(F.map&&F.map.image&&F.map.image.width)&&(b.uniform1f(u.alphaTest,F.alphaTest),!0===F.useScreenCoordinates?(b.uniform1i(u.useScreenCoordinates,1),b.uniform3f(u.screenPosition,(y.position.x*c.devicePixelRatio-f)/f,(v-y.position.y*c.devicePixelRatio)/v,Math.max(0,Math.min(1,y.position.z))),x[0]=c.devicePixelRatio,x[1]=c.devicePixelRatio):(b.uniform1i(u.useScreenCoordinates,0),b.uniform1i(u.sizeAttenuation,F.sizeAttenuation?1:0),b.uniformMatrix4fv(u.modelViewMatrix,
+!1,y._modelViewMatrix.elements),x[0]=1,x[1]=1),e=d.fog&&F.fog?C:0,q!==e&&(b.uniform1i(u.fogType,e),q=e),e=1/(F.scaleByViewport?t:1),x[0]*=e*w*y.scale.x,x[1]*=e*y.scale.y,b.uniform2f(u.uvScale,F.uvScale.x,F.uvScale.y),b.uniform2f(u.uvOffset,F.uvOffset.x,F.uvOffset.y),b.uniform2f(u.alignment,F.alignment.x,F.alignment.y),b.uniform1f(u.opacity,F.opacity),b.uniform3f(u.color,F.color.r,F.color.g,F.color.b),b.uniform1f(u.rotation,y.rotation),b.uniform2fv(u.scale,x),c.setBlending(F.blending,F.blendEquation,
+F.blendSrc,F.blendDst),c.setDepthTest(F.depthTest),c.setDepthWrite(F.depthWrite),c.setTexture(F.map,0),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,h=new THREE.Frustum,g=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
+vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(i,k){var l,m,n,r,t,p;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===i.autoUpdate&&i.updateMatrixWorld();k.matrixWorldInverse.getInverse(k.matrixWorld);g.multiplyMatrices(k.projectionMatrix,
+k.matrixWorldInverse);h.setFromMatrix(g);b.setRenderTarget(this.renderTarget);b.clear();p=i.__webglObjects;l=0;for(m=p.length;l<m;l++)if(n=p[l],t=n.object,n.render=!1,t.visible&&(!(t instanceof THREE.Mesh||t instanceof THREE.ParticleSystem)||!t.frustumCulled||h.intersectsObject(t)))t._modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,t.matrixWorld),n.render=!0;var s;l=0;for(m=p.length;l<m;l++)if(n=p[l],n.render&&(t=n.object,n=n.buffer,!(t instanceof THREE.ParticleSystem)||t.customDepthMaterial))(s=
+t.material instanceof THREE.MeshFaceMaterial?t.material.materials[0]:t.material)&&b.setMaterialFaces(t.material),r=0<t.geometry.morphTargets.length&&s.morphTargets,s=t instanceof THREE.SkinnedMesh&&s.skinning,r=t.customDepthMaterial?t.customDepthMaterial:s?r?f:e:r?d:c,n instanceof THREE.BufferGeometry?b.renderBufferDirect(k,i.__lights,null,r,n,t):b.renderBuffer(k,i.__lights,null,r,n,t);p=i.__webglObjectsImmediate;l=0;for(m=p.length;l<m;l++)n=p[l],t=n.object,t.visible&&(t._modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,
+t.matrixWorld),b.renderImmediateObject(k,i.__lights,null,c,t));l=b.getClearColor();m=b.getClearAlpha();a.clearColor(l.r,l.g,l.b,m);a.enable(a.BLEND)}};THREE.ShaderFlares={lensFlareVertexTexture:{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}"},lensFlare:{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}"}};THREE.ShaderSprite={sprite:{vertexShader:"uniform int useScreenCoordinates;\nuniform int sizeAttenuation;\nuniform vec3 screenPosition;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 alignment;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position + alignment;\nvec2 rotatedPosition;\nrotatedPosition.x = ( cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y ) * scale.x;\nrotatedPosition.y = ( sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y ) * scale.y;\nvec4 finalPosition;\nif( useScreenCoordinates != 0 ) {\nfinalPosition = vec4( screenPosition.xy + rotatedPosition, screenPosition.z, 1.0 );\n} else {\nfinalPosition = projectionMatrix * modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition * ( sizeAttenuation == 1 ? 1.0 : finalPosition.z );\n}\ngl_Position = finalPosition;\n}",
 fragmentShader:"uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"}};