Browse Source

Updated builds.

Mr.doob 10 years ago
parent
commit
91f8c0be31
2 changed files with 61 additions and 54 deletions
  1. 8 1
      build/three.js
  2. 53 53
      build/three.min.js

+ 8 - 1
build/three.js

@@ -20269,7 +20269,14 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 	function renderMesh( material, geometry, object, program, updateBuffers ) {
 	function renderMesh( material, geometry, object, program, updateBuffers ) {
 
 
-		var mode = material.wireframe === true ? _gl.LINES : _gl.TRIANGLES;
+		var mode = _gl.TRIANGLES;
+
+		if ( material.wireframe === true ) {
+
+			mode = _gl.LINES;
+			state.setLineWidth( material.wireframeLinewidth * pixelRatio );
+
+		}
 
 
 		var index = geometry.attributes.index;
 		var index = geometry.attributes.index;
 
 

+ 53 - 53
build/three.min.js

@@ -101,8 +101,8 @@ g*h;var k=g*e,l=c*h,m=c*e;b[0]=f*h;b[4]=-f*e;b[8]=d;b[1]=k+l*d;b[5]=a-m*d;b[9]=-
 f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,l=c*f,m=c*d,b[0]=f*h,b[4]=m-a*e,b[8]=l*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-m*e):"XZY"===a.order&&(a=g*f,k=g*d,l=c*f,m=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+m,b[5]=g*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=m*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
 f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,l=c*f,m=c*d,b[0]=f*h,b[4]=m-a*e,b[8]=l*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-m*e):"XZY"===a.order&&(a=g*f,k=g*d,l=c*f,m=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+m,b[5]=g*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=m*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
 makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var l=c*h,c=c*k,m=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(m+e);b[4]=l-g;b[8]=c+h;b[1]=l+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+m);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var f=this.elements;c.subVectors(d,
 makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var l=c*h,c=c*k,m=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(m+e);b[4]=l-g;b[8]=c+h;b[1]=l+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+m);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var f=this.elements;c.subVectors(d,
 e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,
 e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,
-d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],l=c[1],m=c[5],p=c[9],n=c[13],q=c[2],t=c[6],r=c[10],u=c[14],v=c[3],w=c[7],A=c[11],c=c[15],x=d[0],J=d[4],H=d[8],D=d[12],y=d[1],G=d[5],I=d[9],C=d[13],K=d[2],N=d[6],F=d[10],B=d[14],E=d[3],L=d[7],Q=d[11],d=d[15];e[0]=g*x+f*y+h*K+k*E;e[4]=g*J+f*G+h*N+k*L;e[8]=g*H+f*I+h*F+k*Q;e[12]=g*D+f*C+h*B+k*d;e[1]=l*x+m*y+p*K+n*E;e[5]=l*J+m*G+p*N+n*L;e[9]=l*H+m*I+p*F+n*Q;e[13]=l*D+m*C+p*B+n*d;e[2]=q*x+t*y+r*K+u*E;e[6]=q*J+t*G+r*N+u*L;e[10]=q*H+t*I+r*F+u*Q;e[14]=
-q*D+t*C+r*B+u*d;e[3]=v*x+w*y+A*K+c*E;e[7]=v*J+w*G+A*N+c*L;e[11]=v*H+w*I+A*F+c*Q;e[15]=v*D+w*C+A*B+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=
+d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],l=c[1],m=c[5],p=c[9],n=c[13],q=c[2],t=c[6],r=c[10],u=c[14],v=c[3],w=c[7],A=c[11],c=c[15],x=d[0],J=d[4],G=d[8],D=d[12],y=d[1],H=d[5],I=d[9],C=d[13],K=d[2],N=d[6],F=d[10],B=d[14],E=d[3],L=d[7],Q=d[11],d=d[15];e[0]=g*x+f*y+h*K+k*E;e[4]=g*J+f*H+h*N+k*L;e[8]=g*G+f*I+h*F+k*Q;e[12]=g*D+f*C+h*B+k*d;e[1]=l*x+m*y+p*K+n*E;e[5]=l*J+m*H+p*N+n*L;e[9]=l*G+m*I+p*F+n*Q;e[13]=l*D+m*C+p*B+n*d;e[2]=q*x+t*y+r*K+u*E;e[6]=q*J+t*H+r*N+u*L;e[10]=q*G+t*I+r*F+u*Q;e[14]=
+q*D+t*C+r*B+u*d;e[3]=v*x+w*y+A*K+c*E;e[7]=v*J+w*H+A*N+c*L;e[11]=v*G+w*I+A*F+c*Q;e[15]=v*D+w*C+A*B+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=
 a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
 a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],l=a[2],m=a[6],p=a[10],n=a[14];return a[3]*(+e*h*m-d*k*
 a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],l=a[2],m=a[6],p=a[10],n=a[14];return a[3]*(+e*h*m-d*k*
@@ -202,9 +202,9 @@ return this},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THR
 b;a++)c=this.faces[a],e=this.vertices[c.a],g=this.vertices[c.b],f=this.vertices[c.c],h.subVectors(f,g),k.subVectors(e,g),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=c.vertexNormals,3===e.length?(e[0].copy(d[c.a]),e[1].copy(d[c.b]),e[2].copy(d[c.c])):(e[0]=d[c.a].clone(),
 b;a++)c=this.faces[a],e=this.vertices[c.a],g=this.vertices[c.b],f=this.vertices[c.c],h.subVectors(f,g),k.subVectors(e,g),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=c.vertexNormals,3===e.length?(e[0].copy(d[c.a]),e[1].copy(d[c.b]),e[2].copy(d[c.c])):(e[0]=d[c.a].clone(),
 e[1]=d[c.b].clone(),e[2]=d[c.c].clone())},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var g=new THREE.Geometry;
 e[1]=d[c.b].clone(),e[2]=d[c.c].clone())},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var g=new THREE.Geometry;
 g.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var f=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),f.push(k)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();g.computeVertexNormals();
 g.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var f=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),f.push(k)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();g.computeVertexNormals();
-c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,g,f,h,k,l,m,p,n,q,t,r,u,v=[],w=[];c=new THREE.Vector3;var A=new THREE.Vector3,x=new THREE.Vector3,J=new THREE.Vector3,H=new THREE.Vector3;
+c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,g,f,h,k,l,m,p,n,q,t,r,u,v=[],w=[];c=new THREE.Vector3;var A=new THREE.Vector3,x=new THREE.Vector3,J=new THREE.Vector3,G=new THREE.Vector3;
 a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,w[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,f=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=g[0],m=g[1],p=g[2],g=h.x-f.x,n=k.x-f.x,q=h.y-f.y,t=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=m.x-l.x,r=p.x-l.x,m=m.y-l.y,l=p.y-l.y,p=1/(k*l-r*m),c.set((l*g-m*n)*p,(l*q-m*t)*p,(l*h-m*f)*p),A.set((k*n-r*g)*p,(k*t-r*q)*p,(k*f-r*h)*p),v[d].add(c),v[u].add(c),v[e].add(c),w[d].add(A),
 a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,w[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,f=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=g[0],m=g[1],p=g[2],g=h.x-f.x,n=k.x-f.x,q=h.y-f.y,t=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=m.x-l.x,r=p.x-l.x,m=m.y-l.y,l=p.y-l.y,p=1/(k*l-r*m),c.set((l*g-m*n)*p,(l*q-m*t)*p,(l*h-m*f)*p),A.set((k*n-r*g)*p,(k*t-r*q)*p,(k*f-r*h)*p),v[d].add(c),v[u].add(c),v[e].add(c),w[d].add(A),
-w[u].add(A),w[e].add(A);A=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)H.copy(e.vertexNormals[c]),d=e[A[c]],u=v[d],x.copy(u),x.sub(H.multiplyScalar(H.dot(u))).normalize(),J.crossVectors(e.vertexNormals[c],u),d=J.dot(w[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,x.y,x.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=
+w[u].add(A),w[e].add(A);A=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)G.copy(e.vertexNormals[c]),d=e[A[c]],u=v[d],x.copy(u),x.sub(G.multiplyScalar(G.dot(u))).normalize(),J.crossVectors(e.vertexNormals[c],u),d=J.dot(w[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,x.y,x.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=
 a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var c,d=this.vertices.length,e=this.vertices,g=a.vertices,f=this.faces,
 a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var c,d=this.vertices.length,e=this.vertices,g=a.vertices,f=this.faces,
 h=a.faces,k=this.faceVertexUvs[0],l=a.faceVertexUvs[0];void 0!==b&&(c=(new THREE.Matrix3).getNormalMatrix(b));for(var m=0,p=g.length;m<p;m++){var n=g[m].clone();void 0!==b&&n.applyMatrix4(b);e.push(n)}m=0;for(p=h.length;m<p;m++){var q=h[m],t,r=q.vertexNormals,u=q.vertexColors,n=new THREE.Face3(q.a+d,q.b+d,q.c+d);n.normal.copy(q.normal);void 0!==c&&n.normal.applyMatrix3(c).normalize();e=0;for(g=r.length;e<g;e++)t=r[e].clone(),void 0!==c&&t.applyMatrix3(c).normalize(),n.vertexNormals.push(t);n.color.copy(q.color);
 h=a.faces,k=this.faceVertexUvs[0],l=a.faceVertexUvs[0];void 0!==b&&(c=(new THREE.Matrix3).getNormalMatrix(b));for(var m=0,p=g.length;m<p;m++){var n=g[m].clone();void 0!==b&&n.applyMatrix4(b);e.push(n)}m=0;for(p=h.length;m<p;m++){var q=h[m],t,r=q.vertexNormals,u=q.vertexColors,n=new THREE.Face3(q.a+d,q.b+d,q.c+d);n.normal.copy(q.normal);void 0!==c&&n.normal.applyMatrix3(c).normalize();e=0;for(g=r.length;e<g;e++)t=r[e].clone(),void 0!==c&&t.applyMatrix3(c).normalize(),n.vertexNormals.push(t);n.color.copy(q.color);
 e=0;for(g=u.length;e<g;e++)q=u[e],n.vertexColors.push(q.clone());f.push(n)}m=0;for(p=l.length;m<p;m++)if(c=l[m],d=[],void 0!==c){e=0;for(g=c.length;e<g;e++)d.push(c[e].clone());k.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),g,f;g=0;for(f=this.vertices.length;g<f;g++)d=
 e=0;for(g=u.length;e<g;e++)q=u[e],n.vertexColors.push(q.clone());f.push(n)}m=0;for(p=l.length;m<p;m++)if(c=l[m],d=[],void 0!==c){e=0;for(g=c.length;e<g;e++)d.push(c[e].clone());k.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),g,f;g=0;for(f=this.vertices.length;g<f;g++)d=
@@ -236,10 +236,10 @@ if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.fro
 b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
 b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
 this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,g,f,h,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3;if(a.index)for(var q=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,
 this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,g,f,h,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3;if(a.index)for(var q=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,
 count:q.length,index:0}],r=0,u=t.length;r<u;++r){e=t[r].start;g=t[r].count;for(var v=t[r].index,d=e,e=e+g;d<e;d+=3)g=3*(v+q[d]),f=3*(v+q[d+1]),h=3*(v+q[d+2]),k.fromArray(b,g),l.fromArray(b,f),m.fromArray(b,h),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),m.fromArray(b,d+6),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[d]=p.x,
 count:q.length,index:0}],r=0,u=t.length;r<u;++r){e=t[r].start;g=t[r].count;for(var v=t[r].index,d=e,e=e+g;d<e;d+=3)g=3*(v+q[d]),f=3*(v+q[d+1]),h=3*(v+q[d+2]),k.fromArray(b,g),l.fromArray(b,f),m.fromArray(b,h),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),m.fromArray(b,d+6),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[d]=p.x,
-c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);n.fromArray(d,3*b);q.fromArray(d,3*c);t.fromArray(g,2*a);r.fromArray(g,2*b);u.fromArray(g,2*c);v=n.x-p.x;w=q.x-p.x;A=n.y-p.y;x=q.y-p.y;J=n.z-p.z;H=q.z-p.z;D=r.x-t.x;y=u.x-t.x;G=r.y-t.y;I=u.y-t.y;C=1/(D*I-y*G);K.set((I*v-G*w)*C,(I*A-G*x)*C,(I*J-G*H)*C);N.set((D*w-y*v)*C,(D*x-y*A)*C,(D*H-y*J)*C);k[a].add(K);
+c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);n.fromArray(d,3*b);q.fromArray(d,3*c);t.fromArray(g,2*a);r.fromArray(g,2*b);u.fromArray(g,2*c);v=n.x-p.x;w=q.x-p.x;A=n.y-p.y;x=q.y-p.y;J=n.z-p.z;G=q.z-p.z;D=r.x-t.x;y=u.x-t.x;H=r.y-t.y;I=u.y-t.y;C=1/(D*I-y*H);K.set((I*v-H*w)*C,(I*A-H*x)*C,(I*J-H*G)*C);N.set((D*w-y*v)*C,(D*x-y*A)*C,(D*G-y*J)*C);k[a].add(K);
 k[b].add(K);k[c].add(K);l[a].add(N);l[b].add(N);l[c].add(N)}function b(a){da.fromArray(e,3*a);ja.copy(da);qa=k[a];T.copy(qa);T.sub(da.multiplyScalar(da.dot(qa))).normalize();z.crossVectors(ja,qa);ga=z.dot(l[a]);la=0>ga?-1:1;h[4*a]=T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=la}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
 k[b].add(K);k[c].add(K);l[a].add(N);l[b].add(N);l[c].add(N)}function b(a){da.fromArray(e,3*a);ja.copy(da);qa=k[a];T.copy(qa);T.sub(da.multiplyScalar(da.dot(qa))).normalize();z.crossVectors(ja,qa);ga=z.dot(l[a]);la=0>ga?-1:1;h[4*a]=T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=la}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
-else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],l=[],m=0;m<f;m++)k[m]=new THREE.Vector3,l[m]=new THREE.Vector3;var p=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,t=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,v,w,A,x,J,H,
-D,y,G,I,C,K=new THREE.Vector3,N=new THREE.Vector3,F,B,E,L,Q;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var S=this.drawcalls,m=0;for(B=S.length;m<B;++m){F=S[m].start;E=S[m].count;var P=S[m].index,f=F;for(F+=E;f<F;f+=3)E=P+c[f],L=P+c[f+1],Q=P+c[f+2],a(E,L,Q)}var T=new THREE.Vector3,z=new THREE.Vector3,da=new THREE.Vector3,ja=new THREE.Vector3,la,qa,ga,m=0;for(B=S.length;m<B;++m)for(F=S[m].start,E=S[m].count,P=S[m].index,f=F,F+=E;f<F;f+=3)E=P+c[f],L=P+c[f+1],Q=P+c[f+2],b(E),b(L),b(Q)}},
+else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],l=[],m=0;m<f;m++)k[m]=new THREE.Vector3,l[m]=new THREE.Vector3;var p=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,t=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,v,w,A,x,J,G,
+D,y,H,I,C,K=new THREE.Vector3,N=new THREE.Vector3,F,B,E,L,Q;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var S=this.drawcalls,m=0;for(B=S.length;m<B;++m){F=S[m].start;E=S[m].count;var P=S[m].index,f=F;for(F+=E;f<F;f+=3)E=P+c[f],L=P+c[f+1],Q=P+c[f+2],a(E,L,Q)}var T=new THREE.Vector3,z=new THREE.Vector3,da=new THREE.Vector3,ja=new THREE.Vector3,la,qa,ga,m=0;for(B=S.length;m<B;++m)for(F=S[m].start,E=S[m].count,P=S[m].index,f=F,F+=E;f<F;f+=3)E=P+c[f],L=P+c[f+1],Q=P+c[f+2],b(E),b(L),b(Q)}},
 computeOffsets:function(a){void 0===a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,m=0,p=new Int32Array(6),n=new Int32Array(c.length),q=new Int32Array(c.length),t=0;t<c.length;t++)n[t]=-1,q[t]=-1;for(c=0;c<d;c++){for(var r=m=0;3>r;r++)t=b[3*c+r],-1===n[t]?(p[2*r]=t,p[2*r+1]=-1,m++):
 computeOffsets:function(a){void 0===a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,m=0,p=new Int32Array(6),n=new Int32Array(c.length),q=new Int32Array(c.length),t=0;t<c.length;t++)n[t]=-1,q[t]=-1;for(c=0;c<d;c++){for(var r=m=0;3>r;r++)t=b[3*c+r],-1===n[t]?(p[2*r]=t,p[2*r+1]=-1,m++):
 n[t]<k.index?(p[2*r]=t,p[2*r+1]=-1,l++):(p[2*r]=t,p[2*r+1]=n[t]);if(f+m>k.index+a)for(k={start:g,count:0,index:f},h.push(k),m=0;6>m;m+=2)r=p[m+1],-1<r&&r<k.index&&(p[m+1]=-1);for(m=0;6>m;m+=2)t=p[m],r=p[m+1],-1===r&&(r=f++),n[t]=r,q[r]=t,e[g++]=r-k.index,k.count++}this.reorderBuffers(e,q,f);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===
 n[t]<k.index?(p[2*r]=t,p[2*r+1]=-1,l++):(p[2*r]=t,p[2*r+1]=n[t]);if(f+m>k.index+a)for(k={start:g,count:0,index:f},h.push(k),m=0;6>m;m+=2)r=p[m+1],-1<r&&r<k.index&&(p[m+1]=-1);for(m=0;6>m;m+=2)t=p[m],r=p[m+1],-1===r&&(r=f++),n[t]=r,q[r]=t,e[g++]=r-k.index,k.count++}this.reorderBuffers(e,q,f);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===
 b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,g=a.attributes[d],f=g.array,h=0,g=g.itemSize*b;h<f.length;h++,g++)e[g]=f[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!==e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*
 b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,g=a.attributes[d],f=g.array,h=0,g=g.itemSize*b;h<f.length;h++,g++)e[g]=f[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!==e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*
@@ -389,8 +389,8 @@ THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morp
 THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3;return function(f,h){var k=this.geometry,l=this.material;if(void 0!==l&&(null===k.boundingSphere&&k.computeBoundingSphere(),c.copy(k.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==f.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(f.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))){var m,
 THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3;return function(f,h){var k=this.geometry,l=this.material;if(void 0!==l&&(null===k.boundingSphere&&k.computeBoundingSphere(),c.copy(k.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==f.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(f.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))){var m,
 p,n;if(k instanceof THREE.BufferGeometry)if(m=k.attributes,void 0!==m.index){var q=m.index.array,t=m.position.array,r=k.offsets;0===r.length&&(r=[{start:0,count:q.length,index:0}]);for(var u=0,v=r.length;u<v;++u){m=r[u].start;for(var w=r[u].index,k=m,A=m+r[u].count;k<A;k+=3){m=w+q[k];p=w+q[k+1];n=w+q[k+2];d.fromArray(t,3*m);e.fromArray(t,3*p);g.fromArray(t,3*n);var x=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide);if(null!==x){x.applyMatrix4(this.matrixWorld);
 p,n;if(k instanceof THREE.BufferGeometry)if(m=k.attributes,void 0!==m.index){var q=m.index.array,t=m.position.array,r=k.offsets;0===r.length&&(r=[{start:0,count:q.length,index:0}]);for(var u=0,v=r.length;u<v;++u){m=r[u].start;for(var w=r[u].index,k=m,A=m+r[u].count;k<A;k+=3){m=w+q[k];p=w+q[k+1];n=w+q[k+2];d.fromArray(t,3*m);e.fromArray(t,3*p);g.fromArray(t,3*n);var x=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide);if(null!==x){x.applyMatrix4(this.matrixWorld);
 var J=f.ray.origin.distanceTo(x);J<f.near||J>f.far||h.push({distance:J,point:x,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(k/3),object:this})}}}}else for(t=m.position.array,q=k=0,A=t.length;k<A;k+=3,q+=9)m=k,p=k+1,n=k+2,d.fromArray(t,q),e.fromArray(t,q+3),g.fromArray(t,q+6),x=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide),null!==x&&(x.applyMatrix4(this.matrixWorld),J=f.ray.origin.distanceTo(x),J<f.near||
 var J=f.ray.origin.distanceTo(x);J<f.near||J>f.far||h.push({distance:J,point:x,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(k/3),object:this})}}}}else for(t=m.position.array,q=k=0,A=t.length;k<A;k+=3,q+=9)m=k,p=k+1,n=k+2,d.fromArray(t,q),e.fromArray(t,q+3),g.fromArray(t,q+6),x=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide),null!==x&&(x.applyMatrix4(this.matrixWorld),J=f.ray.origin.distanceTo(x),J<f.near||
-J>f.far||h.push({distance:J,point:x,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,g)),index:Math.floor(k/3),object:this}));else if(k instanceof THREE.Geometry)for(q=l instanceof THREE.MeshFaceMaterial,t=!0===q?l.materials:null,r=k.vertices,u=k.faces,v=0,w=u.length;v<w;v++)if(A=u[v],x=!0===q?t[A.materialIndex]:l,void 0!==x){m=r[A.a];p=r[A.b];n=r[A.c];if(!0===x.morphTargets){var J=k.morphTargets,H=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var D=0,y=J.length;D<y;D++){var G=
-H[D];if(0!==G){var I=J[D].vertices;d.x+=(I[A.a].x-m.x)*G;d.y+=(I[A.a].y-m.y)*G;d.z+=(I[A.a].z-m.z)*G;e.x+=(I[A.b].x-p.x)*G;e.y+=(I[A.b].y-p.y)*G;e.z+=(I[A.b].z-p.z)*G;g.x+=(I[A.c].x-n.x)*G;g.y+=(I[A.c].y-n.y)*G;g.z+=(I[A.c].z-n.z)*G}}d.add(m);e.add(p);g.add(n);m=d;p=e;n=g}x=x.side===THREE.BackSide?b.intersectTriangle(n,p,m,!0):b.intersectTriangle(m,p,n,x.side!==THREE.DoubleSide);null!==x&&(x.applyMatrix4(this.matrixWorld),J=f.ray.origin.distanceTo(x),J<f.near||J>f.far||h.push({distance:J,point:x,
+J>f.far||h.push({distance:J,point:x,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,g)),index:Math.floor(k/3),object:this}));else if(k instanceof THREE.Geometry)for(q=l instanceof THREE.MeshFaceMaterial,t=!0===q?l.materials:null,r=k.vertices,u=k.faces,v=0,w=u.length;v<w;v++)if(A=u[v],x=!0===q?t[A.materialIndex]:l,void 0!==x){m=r[A.a];p=r[A.b];n=r[A.c];if(!0===x.morphTargets){var J=k.morphTargets,G=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var D=0,y=J.length;D<y;D++){var H=
+G[D];if(0!==H){var I=J[D].vertices;d.x+=(I[A.a].x-m.x)*H;d.y+=(I[A.a].y-m.y)*H;d.z+=(I[A.a].z-m.z)*H;e.x+=(I[A.b].x-p.x)*H;e.y+=(I[A.b].y-p.y)*H;e.z+=(I[A.b].z-p.z)*H;g.x+=(I[A.c].x-n.x)*H;g.y+=(I[A.c].y-n.y)*H;g.z+=(I[A.c].z-n.z)*H}}d.add(m);e.add(p);g.add(n);m=d;p=e;n=g}x=x.side===THREE.BackSide?b.intersectTriangle(n,p,m,!0):b.intersectTriangle(m,p,n,x.side!==THREE.DoubleSide);null!==x&&(x.applyMatrix4(this.matrixWorld),J=f.ray.origin.distanceTo(x),J<f.near||J>f.far||h.push({distance:J,point:x,
 face:A,faceIndex:v,object:this}))}}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};
 face:A,faceIndex:v,object:this}))}}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};
 THREE.Mesh.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON(a));void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a));b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Mesh.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON(a));void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a));b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.clone=function(a){void 0===a&&(a=new THREE.Bone(this.skin));THREE.Object3D.prototype.clone.call(this,a);a.skin=this.skin;return a};
 THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.clone=function(a){void 0===a&&(a=new THREE.Bone(this.skin));THREE.Object3D.prototype.clone.call(this,a);a.skin=this.skin;return a};
@@ -493,9 +493,9 @@ a&&(k=a[g],void 0!==k))switch(k.length){case 2:s.vertexAttrib2fv(h,k);break;case
 b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function e(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ha.init(a),a instanceof THREE.Light)L.push(a);else if(a instanceof THREE.Sprite)P.push(a);else if(a instanceof THREE.LensFlare)T.push(a);else{var b=ha.objects[a.id];!b||!1!==a.frustumCulled&&!0!==Ha.intersectsObject(a)||(a.material.transparent?S.push(b):Q.push(b),!0===z.sortObjects&&(ka.setFromMatrixPosition(a.matrixWorld),
 b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function e(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ha.init(a),a instanceof THREE.Light)L.push(a);else if(a instanceof THREE.Sprite)P.push(a);else if(a instanceof THREE.LensFlare)T.push(a);else{var b=ha.objects[a.id];!b||!1!==a.frustumCulled&&!0!==Ha.intersectsObject(a)||(a.material.transparent?S.push(b):Q.push(b),!0===z.sortObjects&&(ka.setFromMatrixPosition(a.matrixWorld),
 ka.applyProjection(ya),b.z=ka.z))}for(var b=0,c=a.children.length;b<c;b++)e(a.children[b])}}function g(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g].object,l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l._normalMatrix.getNormalMatrix(l._modelViewMatrix);null===e&&(f=k.material);if(f instanceof THREE.MeshFaceMaterial)for(var l=f.materials,n=0,m=l.length;n<m;n++)z.renderBufferDirect(b,c,d,l[n],k);else z.renderBufferDirect(b,c,d,f,k)}}function f(a,b,c,d,e,f){for(var g=
 ka.applyProjection(ya),b.z=ka.z))}for(var b=0,c=a.children.length;b<c;b++)e(a.children[b])}}function g(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g].object,l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l._normalMatrix.getNormalMatrix(l._modelViewMatrix);null===e&&(f=k.material);if(f instanceof THREE.MeshFaceMaterial)for(var l=f.materials,n=0,m=l.length;n<m;n++)z.renderBufferDirect(b,c,d,l[n],k);else z.renderBufferDirect(b,c,d,f,k)}}function f(a,b,c,d,e,f){for(var g=
 f,h=0,k=a.length;h<k;h++){var l=a[h],n=l.object;!0===n.visible&&(null===f&&(g=l[b]),z.renderImmediateObject(c,d,e,g,n))}}function h(a){k(a);!0===a.transparent?R.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):R.setBlending(THREE.NoBlending);R.setDepthFunc(a.depthFunc);R.setDepthTest(a.depthTest);R.setDepthWrite(a.depthWrite);R.setColorWrite(a.colorWrite);R.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}
 f,h=0,k=a.length;h<k;h++){var l=a[h],n=l.object;!0===n.visible&&(null===f&&(g=l[b]),z.renderImmediateObject(c,d,e,g,n))}}function h(a){k(a);!0===a.transparent?R.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):R.setBlending(THREE.NoBlending);R.setDepthFunc(a.depthFunc);R.setDepthTest(a.depthTest);R.setDepthWrite(a.depthWrite);R.setColorWrite(a.colorWrite);R.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}
-function k(a){R.setDoubleSided(a.side===THREE.DoubleSide);R.setFlipSided(a.side===THREE.BackSide)}function l(a,b,c,d,e){var f,g,h,k;Wa=0;if(d.needsUpdate){a:{for(var l=Tb[d.type],r=0,u=0,x=0,A=0,y=0,I=b.length;y<I;y++){var B=b[y];B.onlyShadow||!1===B.visible||(B instanceof THREE.DirectionalLight&&r++,B instanceof THREE.PointLight&&u++,B instanceof THREE.SpotLight&&x++,B instanceof THREE.HemisphereLight&&A++)}f=r;g=u;h=x;k=A;for(var J,C=0,H=0,E=b.length;H<E;H++){var K=b[H];K.castShadow&&(K instanceof
-THREE.SpotLight&&C++,K instanceof THREE.DirectionalLight&&!K.shadowCascade&&C++)}J=C;var G;if(cb&&e&&e.skeleton&&e.skeleton.useVertexTexture)G=1024;else{var L=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),Q=Math.floor((L-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(Q=Math.min(e.skeleton.bones.length,Q),Q<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+Q+" (try OpenGL instead of ANGLE)"));G=Q}var N={precision:D,supportsVertexTextures:db,
-map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,emissiveMap:!!d.emissiveMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:F,skinning:d.skinning,maxBones:G,useVertexTexture:cb&&e&&e.skeleton&&e.skeleton.useVertexTexture,
+function k(a){R.setDoubleSided(a.side===THREE.DoubleSide);R.setFlipSided(a.side===THREE.BackSide)}function l(a,b,c,d,e){var f,g,h,k;Wa=0;if(d.needsUpdate){a:{for(var l=Tb[d.type],r=0,u=0,x=0,A=0,y=0,I=b.length;y<I;y++){var B=b[y];B.onlyShadow||!1===B.visible||(B instanceof THREE.DirectionalLight&&r++,B instanceof THREE.PointLight&&u++,B instanceof THREE.SpotLight&&x++,B instanceof THREE.HemisphereLight&&A++)}f=r;g=u;h=x;k=A;for(var J,G=0,C=0,E=b.length;C<E;C++){var K=b[C];K.castShadow&&(K instanceof
+THREE.SpotLight&&G++,K instanceof THREE.DirectionalLight&&!K.shadowCascade&&G++)}J=G;var H;if(cb&&e&&e.skeleton&&e.skeleton.useVertexTexture)H=1024;else{var L=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),Q=Math.floor((L-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(Q=Math.min(e.skeleton.bones.length,Q),Q<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+Q+" (try OpenGL instead of ANGLE)"));H=Q}var N={precision:D,supportsVertexTextures:db,
+map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,emissiveMap:!!d.emissiveMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:F,skinning:d.skinning,maxBones:H,useVertexTexture:cb&&e&&e.skeleton&&e.skeleton.useVertexTexture,
 morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:z.maxMorphTargets,maxMorphNormals:z.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:J,shadowMapEnabled:ia.enabled&&e.receiveShadow&&0<J,shadowMapType:ia.type,shadowMapDebug:ia.debug,shadowMapCascade:ia.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},P=[];l?P.push(l):(P.push(d.fragmentShader),P.push(d.vertexShader));
 morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:z.maxMorphTargets,maxMorphNormals:z.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:J,shadowMapEnabled:ia.enabled&&e.receiveShadow&&0<J,shadowMapType:ia.type,shadowMapDebug:ia.debug,shadowMapCascade:ia.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},P=[];l?P.push(l):(P.push(d.fragmentShader),P.push(d.vertexShader));
 if(void 0!==d.defines)for(var S in d.defines)P.push(S),P.push(d.defines[S]);for(S in N)P.push(S),P.push(N[S]);var T=P.join();if(!d.program)d.addEventListener("dispose",Fb);else if(d.program.code!==T)Gb(d);else if(void 0!==l)break a;else if(d.__webglShader.uniforms===d.uniforms)break a;if(l){var V=THREE.ShaderLib[l];d.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(V.uniforms),vertexShader:V.vertexShader,fragmentShader:V.fragmentShader}}else d.__webglShader={name:d.type,uniforms:d.uniforms,
 if(void 0!==d.defines)for(var S in d.defines)P.push(S),P.push(d.defines[S]);for(S in N)P.push(S),P.push(N[S]);var T=P.join();if(!d.program)d.addEventListener("dispose",Fb);else if(d.program.code!==T)Gb(d);else if(void 0!==l)break a;else if(d.__webglShader.uniforms===d.uniforms)break a;if(l){var V=THREE.ShaderLib[l];d.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(V.uniforms),vertexShader:V.vertexShader,fragmentShader:V.fragmentShader}}else d.__webglShader={name:d.type,uniforms:d.uniforms,
 vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var ga,xa=0,Ga=da.length;xa<Ga;xa++){var Fa=da[xa];if(Fa.code===T){ga=Fa;ga.usedTimes++;break}}void 0===ga&&(ga=new THREE.WebGLProgram(z,T,d,N),da.push(ga),z.info.memory.programs=da.length);d.program=ga;var Ea=ga.getAttributes();if(d.morphTargets)for(var ra=d.numSupportedMorphTargets=0;ra<z.maxMorphTargets;ra++)0<=Ea["morphTarget"+ra]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(ra=d.numSupportedMorphNormals=0;ra<z.maxMorphNormals;ra++)0<=
 vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var ga,xa=0,Ga=da.length;xa<Ga;xa++){var Fa=da[xa];if(Fa.code===T){ga=Fa;ga.usedTimes++;break}}void 0===ga&&(ga=new THREE.WebGLProgram(z,T,d,N),da.push(ga),z.info.memory.programs=da.length);d.program=ga;var Ea=ga.getAttributes();if(d.morphTargets)for(var ra=d.numSupportedMorphTargets=0;ra<z.maxMorphTargets;ra++)0<=Ea["morphTarget"+ra]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(ra=d.numSupportedMorphNormals=0;ra<z.maxMorphNormals;ra++)0<=
@@ -534,16 +534,16 @@ if(a===THREE.FloatType)return s.FLOAT;b=V.get("OES_texture_half_float");if(null!
 if(a===THREE.ZeroFactor)return s.ZERO;if(a===THREE.OneFactor)return s.ONE;if(a===THREE.SrcColorFactor)return s.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return s.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return s.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return s.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return s.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return s.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return s.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return s.ONE_MINUS_DST_COLOR;
 if(a===THREE.ZeroFactor)return s.ZERO;if(a===THREE.OneFactor)return s.ONE;if(a===THREE.SrcColorFactor)return s.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return s.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return s.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return s.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return s.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return s.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return s.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return s.ONE_MINUS_DST_COLOR;
 if(a===THREE.SrcAlphaSaturateFactor)return s.SRC_ALPHA_SATURATE;b=V.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=V.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
 if(a===THREE.SrcAlphaSaturateFactor)return s.SRC_ALPHA_SATURATE;b=V.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=V.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
 if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=V.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var w=void 0!==a.canvas?a.canvas:document.createElement("canvas"),A=void 0!==
 if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=V.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var w=void 0!==a.canvas?a.canvas:document.createElement("canvas"),A=void 0!==
-a.context?a.context:null,x=w.width,J=w.height,H=1,D=void 0!==a.precision?a.precision:"highp",y=void 0!==a.alpha?a.alpha:!1,G=void 0!==a.depth?a.depth:!0,I=void 0!==a.stencil?a.stencil:!0,C=void 0!==a.antialias?a.antialias:!1,K=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,N=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,F=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,B=new THREE.Color(0),E=0,L=[],Q=[],S=[],P=[],T=[];this.domElement=w;this.context=null;this.sortObjects=
+a.context?a.context:null,x=w.width,J=w.height,G=1,D=void 0!==a.precision?a.precision:"highp",y=void 0!==a.alpha?a.alpha:!1,H=void 0!==a.depth?a.depth:!0,I=void 0!==a.stencil?a.stencil:!0,C=void 0!==a.antialias?a.antialias:!1,K=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,N=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,F=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,B=new THREE.Color(0),E=0,L=[],Q=[],S=[],P=[],T=[];this.domElement=w;this.context=null;this.sortObjects=
 this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var z=this,da=[],ja=null,la=null,qa=-1,ga="",Na=null,Wa=0,Ga=0,Ea=0,xa=w.width,Fa=w.height,ra=0,Ua=0,Ha=new THREE.Frustum,ya=new THREE.Matrix4,ka=new THREE.Vector3,ca=new THREE.Vector3,Ya=!0,Hb=
 this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var z=this,da=[],ja=null,la=null,qa=-1,ga="",Na=null,Wa=0,Ga=0,Ea=0,xa=w.width,Fa=w.height,ra=0,Ua=0,Ha=new THREE.Frustum,ya=new THREE.Matrix4,ka=new THREE.Vector3,ca=new THREE.Vector3,Ya=!0,Hb=
-{ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},s;try{a={alpha:y,depth:G,stencil:I,antialias:C,premultipliedAlpha:K,preserveDrawingBuffer:N};s=A||w.getContext("webgl",a)||w.getContext("experimental-webgl",a);if(null===s){if(null!==w.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";
+{ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},s;try{a={alpha:y,depth:H,stencil:I,antialias:C,premultipliedAlpha:K,preserveDrawingBuffer:N};s=A||w.getContext("webgl",a)||w.getContext("experimental-webgl",a);if(null===s){if(null!==w.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";
 throw"Error creating WebGL context.";}w.addEventListener("webglcontextlost",function(a){a.preventDefault();Va();ab();ha.objects={}},!1)}catch(Ab){console.error("THREE.WebGLRenderer: "+Ab)}var R=new THREE.WebGLState(s,v);void 0===s.getShaderPrecisionFormat&&(s.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var V=new THREE.WebGLExtensions(s),ha=new THREE.WebGLObjects(s,this.info);V.get("OES_texture_float");V.get("OES_texture_float_linear");V.get("OES_texture_half_float");
 throw"Error creating WebGL context.";}w.addEventListener("webglcontextlost",function(a){a.preventDefault();Va();ab();ha.objects={}},!1)}catch(Ab){console.error("THREE.WebGLRenderer: "+Ab)}var R=new THREE.WebGLState(s,v);void 0===s.getShaderPrecisionFormat&&(s.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var V=new THREE.WebGLExtensions(s),ha=new THREE.WebGLObjects(s,this.info);V.get("OES_texture_float");V.get("OES_texture_float_linear");V.get("OES_texture_half_float");
 V.get("OES_texture_half_float_linear");V.get("OES_standard_derivatives");V.get("ANGLE_instanced_arrays");V.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);F&&V.get("EXT_frag_depth");var Ma=function(a,b,c,d){!0===K&&(a*=d,b*=d,c*=d);s.clearColor(a,b,c,d)},ab=function(){R.init();s.viewport(Ga,Ea,xa,Fa);Ma(B.r,B.g,B.b,E)},Va=function(){Na=ja=null;ga="";qa=-1;Ya=!0;R.reset()};ab();this.context=s;this.extensions=V;this.state=R;var ia=new THREE.WebGLShadowMap(this,L,ha);this.shadowMap=
 V.get("OES_texture_half_float_linear");V.get("OES_standard_derivatives");V.get("ANGLE_instanced_arrays");V.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);F&&V.get("EXT_frag_depth");var Ma=function(a,b,c,d){!0===K&&(a*=d,b*=d,c*=d);s.clearColor(a,b,c,d)},ab=function(){R.init();s.viewport(Ga,Ea,xa,Fa);Ma(B.r,B.g,B.b,E)},Va=function(){Na=ja=null;ga="";qa=-1;Ya=!0;R.reset()};ab();this.context=s;this.extensions=V;this.state=R;var ia=new THREE.WebGLShadowMap(this,L,ha);this.shadowMap=
-ia;var Ta=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),A=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Bb=s.getParameter(s.MAX_TEXTURE_SIZE),Vb=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),db=0<A,cb=db&&V.get("OES_texture_float"),Cb=V.get("ANGLE_instanced_arrays"),y=s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT),A=s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT),G=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);a=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT);
-var Sb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(V.get("WEBGL_compressed_texture_pvrtc")||V.get("WEBGL_compressed_texture_s3tc"))for(var b=s.getParameter(s.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),y=0<y.precision&&0<G.precision,A=0<A.precision&&0<a.precision;"highp"!==D||y||(A?(D="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(D="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));
+ia;var Ta=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),A=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Bb=s.getParameter(s.MAX_TEXTURE_SIZE),Vb=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),db=0<A,cb=db&&V.get("OES_texture_float"),Cb=V.get("ANGLE_instanced_arrays"),y=s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT),A=s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT),H=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);a=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT);
+var Sb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(V.get("WEBGL_compressed_texture_pvrtc")||V.get("WEBGL_compressed_texture_s3tc"))for(var b=s.getParameter(s.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),y=0<y.precision&&0<H.precision,A=0<A.precision&&0<a.precision;"highp"!==D||y||(A?(D="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(D="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));
 "mediump"!==D||A||(D="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Db=new THREE.SpritePlugin(this,P),Eb=new THREE.LensFlarePlugin(this,T);this.getContext=function(){return s};this.forceContextLoss=function(){V.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return db};this.supportsInstancedArrays=function(){return Cb};this.supportsFloatTextures=function(){return V.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return V.get("OES_texture_half_float")};
 "mediump"!==D||A||(D="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Db=new THREE.SpritePlugin(this,P),Eb=new THREE.LensFlarePlugin(this,T);this.getContext=function(){return s};this.forceContextLoss=function(){V.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return db};this.supportsInstancedArrays=function(){return Cb};this.supportsFloatTextures=function(){return V.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return V.get("OES_texture_half_float")};
 this.supportsStandardDerivatives=function(){return V.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return V.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return V.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return V.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=V.get("EXT_texture_filter_anisotropic");return a=null!==b?s.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):
 this.supportsStandardDerivatives=function(){return V.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return V.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return V.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return V.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=V.get("EXT_texture_filter_anisotropic");return a=null!==b?s.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):
-0}}();this.getPrecision=function(){return D};this.getPixelRatio=function(){return H};this.setPixelRatio=function(a){void 0!==a&&(H=a)};this.getSize=function(){return{width:x,height:J}};this.setSize=function(a,b,c){x=a;J=b;w.width=a*H;w.height=b*H;!1!==c&&(w.style.width=a+"px",w.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ga=a*H;Ea=b*H;xa=c*H;Fa=d*H;s.viewport(Ga,Ea,xa,Fa)};this.setScissor=function(a,b,c,d){s.scissor(a*H,b*H,c*H,d*H)};this.enableScissorTest=function(a){a?
+0}}();this.getPrecision=function(){return D};this.getPixelRatio=function(){return G};this.setPixelRatio=function(a){void 0!==a&&(G=a)};this.getSize=function(){return{width:x,height:J}};this.setSize=function(a,b,c){x=a;J=b;w.width=a*G;w.height=b*G;!1!==c&&(w.style.width=a+"px",w.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ga=a*G;Ea=b*G;xa=c*G;Fa=d*G;s.viewport(Ga,Ea,xa,Fa)};this.setScissor=function(a,b,c,d){s.scissor(a*G,b*G,c*G,d*G)};this.enableScissorTest=function(a){a?
 s.enable(s.SCISSOR_TEST):s.disable(s.SCISSOR_TEST)};this.getClearColor=function(){return B};this.setClearColor=function(a,b){B.set(a);E=void 0!==b?b:1;Ma(B.r,B.g,B.b,E)};this.getClearAlpha=function(){return E};this.setClearAlpha=function(a){E=a;Ma(B.r,B.g,B.b,E)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=s.COLOR_BUFFER_BIT;if(void 0===b||b)d|=s.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=s.STENCIL_BUFFER_BIT;s.clear(d)};this.clearColor=function(){s.clear(s.COLOR_BUFFER_BIT)};this.clearDepth=
 s.enable(s.SCISSOR_TEST):s.disable(s.SCISSOR_TEST)};this.getClearColor=function(){return B};this.setClearColor=function(a,b){B.set(a);E=void 0!==b?b:1;Ma(B.r,B.g,B.b,E)};this.getClearAlpha=function(){return E};this.setClearAlpha=function(a){E=a;Ma(B.r,B.g,B.b,E)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=s.COLOR_BUFFER_BIT;if(void 0===b||b)d|=s.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=s.STENCIL_BUFFER_BIT;s.clear(d)};this.clearColor=function(){s.clear(s.COLOR_BUFFER_BIT)};this.clearDepth=
 function(){s.clear(s.DEPTH_BUFFER_BIT)};this.clearStencil=function(){s.clear(s.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=Va;var xb=function(a){a=a.target;a.removeEventListener("dispose",xb);a.image&&a.image.__webglTextureCube?(s.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(s.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);z.info.memory.textures--},
 function(){s.clear(s.DEPTH_BUFFER_BIT)};this.clearStencil=function(){s.clear(s.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=Va;var xb=function(a){a=a.target;a.removeEventListener("dispose",xb);a.image&&a.image.__webglTextureCube?(s.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(s.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);z.info.memory.textures--},
 bb=function(a){a=a.target;a.removeEventListener("dispose",bb);if(a&&void 0!==a.__webglTexture){s.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)s.deleteFramebuffer(a.__webglFramebuffer[b]),s.deleteRenderbuffer(a.__webglRenderbuffer[b]);else s.deleteFramebuffer(a.__webglFramebuffer),s.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}z.info.memory.textures--},Fb=function(a){a=a.target;
 bb=function(a){a=a.target;a.removeEventListener("dispose",bb);if(a&&void 0!==a.__webglTexture){s.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)s.deleteFramebuffer(a.__webglFramebuffer[b]),s.deleteRenderbuffer(a.__webglRenderbuffer[b]);else s.deleteFramebuffer(a.__webglFramebuffer),s.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}z.info.memory.textures--},Fb=function(a){a=a.target;
@@ -551,12 +551,12 @@ a.removeEventListener("dispose",Fb);Gb(a)},Gb=function(a){var b=a.program.progra
 !a.__webglNormalBuffer&&(a.__webglNormalBuffer=s.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=s.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=s.createBuffer());b=b.getAttributes();a.hasPositions&&(s.bindBuffer(s.ARRAY_BUFFER,a.__webglVertexBuffer),s.bufferData(s.ARRAY_BUFFER,a.positionArray,s.DYNAMIC_DRAW),R.enableAttribute(b.position),s.vertexAttribPointer(b.position,3,s.FLOAT,!1,0,0));if(a.hasNormals){s.bindBuffer(s.ARRAY_BUFFER,a.__webglNormalBuffer);
 !a.__webglNormalBuffer&&(a.__webglNormalBuffer=s.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=s.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=s.createBuffer());b=b.getAttributes();a.hasPositions&&(s.bindBuffer(s.ARRAY_BUFFER,a.__webglVertexBuffer),s.bufferData(s.ARRAY_BUFFER,a.positionArray,s.DYNAMIC_DRAW),R.enableAttribute(b.position),s.vertexAttribPointer(b.position,3,s.FLOAT,!1,0,0));if(a.hasNormals){s.bindBuffer(s.ARRAY_BUFFER,a.__webglNormalBuffer);
 if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,k,l,n,m,p,q,r=3*a.count;for(q=0;q<r;q+=9)p=a.normalArray,d=p[q],e=p[q+1],f=p[q+2],g=p[q+3],k=p[q+4],n=p[q+5],h=p[q+6],l=p[q+7],m=p[q+8],d=(d+g+h)/3,e=(e+k+l)/3,f=(f+n+m)/3,p[q]=d,p[q+1]=e,p[q+2]=f,p[q+3]=d,p[q+4]=e,p[q+5]=f,p[q+6]=d,p[q+7]=e,p[q+8]=f}s.bufferData(s.ARRAY_BUFFER,a.normalArray,s.DYNAMIC_DRAW);R.enableAttribute(b.normal);s.vertexAttribPointer(b.normal,3,s.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(s.bindBuffer(s.ARRAY_BUFFER,
 if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,k,l,n,m,p,q,r=3*a.count;for(q=0;q<r;q+=9)p=a.normalArray,d=p[q],e=p[q+1],f=p[q+2],g=p[q+3],k=p[q+4],n=p[q+5],h=p[q+6],l=p[q+7],m=p[q+8],d=(d+g+h)/3,e=(e+k+l)/3,f=(f+n+m)/3,p[q]=d,p[q+1]=e,p[q+2]=f,p[q+3]=d,p[q+4]=e,p[q+5]=f,p[q+6]=d,p[q+7]=e,p[q+8]=f}s.bufferData(s.ARRAY_BUFFER,a.normalArray,s.DYNAMIC_DRAW);R.enableAttribute(b.normal);s.vertexAttribPointer(b.normal,3,s.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(s.bindBuffer(s.ARRAY_BUFFER,
 a.__webglUvBuffer),s.bufferData(s.ARRAY_BUFFER,a.uvArray,s.DYNAMIC_DRAW),R.enableAttribute(b.uv),s.vertexAttribPointer(b.uv,2,s.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(s.bindBuffer(s.ARRAY_BUFFER,a.__webglColorBuffer),s.bufferData(s.ARRAY_BUFFER,a.colorArray,s.DYNAMIC_DRAW),R.enableAttribute(b.color),s.vertexAttribPointer(b.color,3,s.FLOAT,!1,0,0));R.disableUnusedAttributes();s.drawArrays(s.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f){if(!1!==e.visible){h(e);
 a.__webglUvBuffer),s.bufferData(s.ARRAY_BUFFER,a.uvArray,s.DYNAMIC_DRAW),R.enableAttribute(b.uv),s.vertexAttribPointer(b.uv,2,s.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(s.bindBuffer(s.ARRAY_BUFFER,a.__webglColorBuffer),s.bufferData(s.ARRAY_BUFFER,a.colorArray,s.DYNAMIC_DRAW),R.enableAttribute(b.color),s.vertexAttribPointer(b.color,3,s.FLOAT,!1,0,0));R.disableUnusedAttributes();s.drawArrays(s.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f){if(!1!==e.visible){h(e);
-var g=ha.geometries.get(f);a=l(a,c,d,e,f);c=!1;d=g.id+"_"+a.id+"_"+(e.wireframe?1:0);d!==ga&&(ga=d,c=!0);c&&R.initAttributes();if(f instanceof THREE.Mesh)a:if(f=c,c=!0===e.wireframe?s.LINES:s.TRIANGLES,d=g.attributes.index){var k,n;d.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(k=s.UNSIGNED_INT,n=4):(k=s.UNSIGNED_SHORT,n=2);var m=g.offsets;if(0===m.length){f&&(b(e,a,g,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){var p=
-V.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}p.drawElementsInstancedANGLE(c,d.array.length,k,0,g.maxInstancedCount)}else s.drawElements(c,d.array.length,k,0);z.info.render.calls++;z.info.render.vertices+=d.array.length;z.info.render.faces+=d.array.length/3}else{f=!0;for(var q=0,r=m.length;q<r;q++){p=m[q].index;f&&(b(e,a,g,p),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,
-d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&0<m[q].instances){p=V.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}p.drawElementsInstancedANGLE(c,m[q].count,k,m[q].start*n,m[q].count,k,m[q].instances)}else s.drawElements(c,m[q].count,k,m[q].start*n);z.info.render.calls++;z.info.render.vertices+=m[q].count;z.info.render.faces+=m[q].count/
-3}}}else if(m=g.offsets,0===m.length){f&&b(e,a,g,0);e=g.attributes.position;if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){p=V.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}e instanceof THREE.InterleavedBufferAttribute?p.drawArraysInstancedANGLE(c,0,e.data.array.length/e.data.stride,g.maxInstancedCount):p.drawArraysInstancedANGLE(c,
-0,e.array.length/e.itemSize,g.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?s.drawArrays(c,0,e.data.array.length/e.data.stride):s.drawArrays(c,0,e.array.length/e.itemSize);z.info.render.calls++;z.info.render.vertices+=e.array.length/e.itemSize;z.info.render.faces+=e.array.length/(3*e.itemSize)}else for(f&&b(e,a,g,0),q=0,r=m.length;q<r;q++){if(g instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");
-break a}else s.drawArrays(c,m[q].start,m[q].count);z.info.render.calls++;z.info.render.vertices+=m[q].count;z.info.render.faces+=m[q].count/3}else if(f instanceof THREE.Line)if(f=f instanceof THREE.LineSegments?s.LINES:s.LINE_STRIP,R.setLineWidth((void 0!==e.linewidth?e.linewidth:1)*H),k=g.attributes.index)if(k.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(n=s.UNSIGNED_INT,m=4):(n=s.UNSIGNED_SHORT,m=2),d=g.offsets,0===d.length)c&&(b(e,a,g,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,k.buffer)),
+var g=ha.geometries.get(f);a=l(a,c,d,e,f);c=!1;d=g.id+"_"+a.id+"_"+(e.wireframe?1:0);d!==ga&&(ga=d,c=!0);c&&R.initAttributes();if(f instanceof THREE.Mesh)a:if(f=c,c=s.TRIANGLES,!0===e.wireframe&&(c=s.LINES,R.setLineWidth(e.wireframeLinewidth*G)),d=g.attributes.index){var k,n;d.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(k=s.UNSIGNED_INT,n=4):(k=s.UNSIGNED_SHORT,n=2);var m=g.offsets;if(0===m.length){f&&(b(e,a,g,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&
+0<g.maxInstancedCount){var p=V.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}p.drawElementsInstancedANGLE(c,d.array.length,k,0,g.maxInstancedCount)}else s.drawElements(c,d.array.length,k,0);z.info.render.calls++;z.info.render.vertices+=d.array.length;z.info.render.faces+=d.array.length/3}else{f=!0;for(var q=0,r=m.length;q<r;q++){p=m[q].index;f&&
+(b(e,a,g,p),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&0<m[q].instances){p=V.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}p.drawElementsInstancedANGLE(c,m[q].count,k,m[q].start*n,m[q].count,k,m[q].instances)}else s.drawElements(c,m[q].count,k,m[q].start*n);z.info.render.calls++;z.info.render.vertices+=
+m[q].count;z.info.render.faces+=m[q].count/3}}}else if(m=g.offsets,0===m.length){f&&b(e,a,g,0);e=g.attributes.position;if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){p=V.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}e instanceof THREE.InterleavedBufferAttribute?p.drawArraysInstancedANGLE(c,0,e.data.array.length/e.data.stride,
+g.maxInstancedCount):p.drawArraysInstancedANGLE(c,0,e.array.length/e.itemSize,g.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?s.drawArrays(c,0,e.data.array.length/e.data.stride):s.drawArrays(c,0,e.array.length/e.itemSize);z.info.render.calls++;z.info.render.vertices+=e.array.length/e.itemSize;z.info.render.faces+=e.array.length/(3*e.itemSize)}else for(f&&b(e,a,g,0),q=0,r=m.length;q<r;q++){if(g instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");
+break a}else s.drawArrays(c,m[q].start,m[q].count);z.info.render.calls++;z.info.render.vertices+=m[q].count;z.info.render.faces+=m[q].count/3}else if(f instanceof THREE.Line)if(f=f instanceof THREE.LineSegments?s.LINES:s.LINE_STRIP,R.setLineWidth((void 0!==e.linewidth?e.linewidth:1)*G),k=g.attributes.index)if(k.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(n=s.UNSIGNED_INT,m=4):(n=s.UNSIGNED_SHORT,m=2),d=g.offsets,0===d.length)c&&(b(e,a,g,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,k.buffer)),
 s.drawElements(f,k.array.length,n,0),z.info.render.calls++,z.info.render.vertices+=k.array.length;else for(1<d.length&&(c=!0),p=0,q=d.length;p<q;p++)r=d[p].index,c&&(b(e,a,g,r),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,k.buffer)),s.drawElements(f,d[p].count,n,d[p].start*m),z.info.render.calls++,z.info.render.vertices+=d[p].count;else if(c&&b(e,a,g,0),e=g.attributes.position,d=g.offsets,0===d.length)s.drawArrays(f,0,e.array.length/3),z.info.render.calls++,z.info.render.vertices+=e.array.length/3;else for(p=
 s.drawElements(f,k.array.length,n,0),z.info.render.calls++,z.info.render.vertices+=k.array.length;else for(1<d.length&&(c=!0),p=0,q=d.length;p<q;p++)r=d[p].index,c&&(b(e,a,g,r),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,k.buffer)),s.drawElements(f,d[p].count,n,d[p].start*m),z.info.render.calls++,z.info.render.vertices+=d[p].count;else if(c&&b(e,a,g,0),e=g.attributes.position,d=g.offsets,0===d.length)s.drawArrays(f,0,e.array.length/3),z.info.render.calls++,z.info.render.vertices+=e.array.length/3;else for(p=
 0,q=d.length;p<q;p++)s.drawArrays(f,d[p].index,d[p].count),z.info.render.calls++,z.info.render.vertices+=d[p].count;else if(f instanceof THREE.PointCloud)if(d=c,c=s.POINTS,k=g.attributes.index)if(k.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(n=s.UNSIGNED_INT,m=4):(n=s.UNSIGNED_SHORT,m=2),f=g.offsets,0===f.length)d&&(b(e,a,g,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,k.buffer)),s.drawElements(c,k.array.length,n,0),z.info.render.calls++,z.info.render.points+=k.array.length;else for(1<
 0,q=d.length;p<q;p++)s.drawArrays(f,d[p].index,d[p].count),z.info.render.calls++,z.info.render.vertices+=d[p].count;else if(f instanceof THREE.PointCloud)if(d=c,c=s.POINTS,k=g.attributes.index)if(k.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(n=s.UNSIGNED_INT,m=4):(n=s.UNSIGNED_SHORT,m=2),f=g.offsets,0===f.length)d&&(b(e,a,g,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,k.buffer)),s.drawElements(c,k.array.length,n,0),z.info.render.calls++,z.info.render.points+=k.array.length;else for(1<
 f.length&&(d=!0),p=0,q=f.length;p<q;p++)r=f[p].index,d&&(b(e,a,g,r),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,k.buffer)),s.drawElements(c,f[p].count,n,f[p].start*m),z.info.render.calls++,z.info.render.points+=f[p].count;else if(d&&b(e,a,g,0),e=g.attributes.position,f=g.offsets,0===f.length)s.drawArrays(c,0,e.array.length/3),z.info.render.calls++,z.info.render.points+=e.array.length/3;else for(p=0,q=f.length;p<q;p++)s.drawArrays(c,f[p].index,f[p].count),z.info.render.calls++,z.info.render.points+=f[p].count}};
 f.length&&(d=!0),p=0,q=f.length;p<q;p++)r=f[p].index,d&&(b(e,a,g,r),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,k.buffer)),s.drawElements(c,f[p].count,n,f[p].start*m),z.info.render.calls++,z.info.render.points+=f[p].count;else if(d&&b(e,a,g,0),e=g.attributes.position,f=g.offsets,0===f.length)s.drawArrays(c,0,e.array.length/3),z.info.render.calls++,z.info.render.points+=e.array.length/3;else for(p=0,q=f.length;p<q;p++)s.drawArrays(c,f[p].index,f[p].count),z.info.render.calls++,z.info.render.points+=f[p].count}};
@@ -607,41 +607,41 @@ return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGL
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){var e=b.createShader(c);b.shaderSource(e,d);b.compileShader(e);!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(e)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",c===b.VERTEX_SHADER?"vertex":"fragment",b.getShaderInfoLog(e),a(d));return e}}();
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){var e=b.createShader(c);b.shaderSource(e,d);b.compileShader(e);!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(e)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",c===b.VERTEX_SHADER?"vertex":"fragment",b.getShaderInfoLog(e),a(d));return e}}();
 THREE.WebGLShadowMap=function(a,b,c){function d(a,b){if(!0===a.visible){var e=c.objects[a.id];e&&a.castShadow&&(!1===a.frustumCulled||!0===f.intersectsObject(a))&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),n.push(e));for(var e=0,g=a.children.length;e<g;e++)d(a.children[e],b)}}var e=a.context,g=a.state,f=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,m=c.objectsImmediate,p=new THREE.Vector3,n=[],q=THREE.ShaderLib.depthRGBA,t=THREE.UniformsUtils.clone(q.uniforms),
 THREE.WebGLShadowMap=function(a,b,c){function d(a,b){if(!0===a.visible){var e=c.objects[a.id];e&&a.castShadow&&(!1===a.frustumCulled||!0===f.intersectsObject(a))&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),n.push(e));for(var e=0,g=a.children.length;e<g;e++)d(a.children[e],b)}}var e=a.context,g=a.state,f=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,m=c.objectsImmediate,p=new THREE.Vector3,n=[],q=THREE.ShaderLib.depthRGBA,t=THREE.UniformsUtils.clone(q.uniforms),
 r=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader}),u=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0}),v=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,skinning:!0}),w=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0,skinning:!0});r._shadowPass=!0;u._shadowPass=!0;v._shadowPass=
 r=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader}),u=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0}),v=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,skinning:!0}),w=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0,skinning:!0});r._shadowPass=!0;u._shadowPass=!0;v._shadowPass=
-!0;w._shadowPass=!0;var A=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=this.debug=!1;this.render=function(c,q){if(!1!==A.enabled){var t,D,y,G,I,C,K,N=[];G=0;e.clearColor(1,1,1,1);g.setBlend(!1);e.enable(e.CULL_FACE);e.frontFace(e.CCW);A.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);g.setDepthTest(!0);t=0;for(D=b.length;t<D;t++)if(y=b[t],y.castShadow)if(y instanceof THREE.DirectionalLight&&y.shadowCascade)for(I=0;I<y.shadowCascadeCount;I++){var F;
+!0;w._shadowPass=!0;var A=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=this.debug=!1;this.render=function(c,q){if(!1!==A.enabled){var t,D,y,H,I,C,K,N=[];H=0;e.clearColor(1,1,1,1);g.setBlend(!1);e.enable(e.CULL_FACE);e.frontFace(e.CCW);A.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);g.setDepthTest(!0);t=0;for(D=b.length;t<D;t++)if(y=b[t],y.castShadow)if(y instanceof THREE.DirectionalLight&&y.shadowCascade)for(I=0;I<y.shadowCascadeCount;I++){var F;
 if(y.shadowCascadeArray[I])F=y.shadowCascadeArray[I];else{var B=y;K=I;F=new THREE.DirectionalLight;F.isVirtual=!0;F.onlyShadow=!0;F.castShadow=!0;F.shadowCameraNear=B.shadowCameraNear;F.shadowCameraFar=B.shadowCameraFar;F.shadowCameraLeft=B.shadowCameraLeft;F.shadowCameraRight=B.shadowCameraRight;F.shadowCameraBottom=B.shadowCameraBottom;F.shadowCameraTop=B.shadowCameraTop;F.shadowCameraVisible=B.shadowCameraVisible;F.shadowDarkness=B.shadowDarkness;F.shadowBias=B.shadowCascadeBias[K];F.shadowMapWidth=
 if(y.shadowCascadeArray[I])F=y.shadowCascadeArray[I];else{var B=y;K=I;F=new THREE.DirectionalLight;F.isVirtual=!0;F.onlyShadow=!0;F.castShadow=!0;F.shadowCameraNear=B.shadowCameraNear;F.shadowCameraFar=B.shadowCameraFar;F.shadowCameraLeft=B.shadowCameraLeft;F.shadowCameraRight=B.shadowCameraRight;F.shadowCameraBottom=B.shadowCameraBottom;F.shadowCameraTop=B.shadowCameraTop;F.shadowCameraVisible=B.shadowCameraVisible;F.shadowDarkness=B.shadowDarkness;F.shadowBias=B.shadowCascadeBias[K];F.shadowMapWidth=
 B.shadowCascadeWidth[K];F.shadowMapHeight=B.shadowCascadeHeight[K];F.pointsWorld=[];F.pointsFrustum=[];var E=F.pointsWorld;C=F.pointsFrustum;for(var L=0;8>L;L++)E[L]=new THREE.Vector3,C[L]=new THREE.Vector3;E=B.shadowCascadeNearZ[K];B=B.shadowCascadeFarZ[K];C[0].set(-1,-1,E);C[1].set(1,-1,E);C[2].set(-1,1,E);C[3].set(1,1,E);C[4].set(-1,-1,B);C[5].set(1,-1,B);C[6].set(-1,1,B);C[7].set(1,1,B);F.originalCamera=q;C=new THREE.Gyroscope;C.position.copy(y.shadowCascadeOffset);C.add(F);C.add(F.target);q.add(C);
 B.shadowCascadeWidth[K];F.shadowMapHeight=B.shadowCascadeHeight[K];F.pointsWorld=[];F.pointsFrustum=[];var E=F.pointsWorld;C=F.pointsFrustum;for(var L=0;8>L;L++)E[L]=new THREE.Vector3,C[L]=new THREE.Vector3;E=B.shadowCascadeNearZ[K];B=B.shadowCascadeFarZ[K];C[0].set(-1,-1,E);C[1].set(1,-1,E);C[2].set(-1,1,E);C[3].set(1,1,E);C[4].set(-1,-1,B);C[5].set(1,-1,B);C[6].set(-1,1,B);C[7].set(1,1,B);F.originalCamera=q;C=new THREE.Gyroscope;C.position.copy(y.shadowCascadeOffset);C.add(F);C.add(F.target);q.add(C);
-y.shadowCascadeArray[I]=F}K=y;E=I;B=K.shadowCascadeArray[E];B.position.copy(K.position);B.target.position.copy(K.target.position);B.lookAt(B.target);B.shadowCameraVisible=K.shadowCameraVisible;B.shadowDarkness=K.shadowDarkness;B.shadowBias=K.shadowCascadeBias[E];C=K.shadowCascadeNearZ[E];K=K.shadowCascadeFarZ[E];B=B.pointsFrustum;B[0].z=C;B[1].z=C;B[2].z=C;B[3].z=C;B[4].z=K;B[5].z=K;B[6].z=K;B[7].z=K;N[G]=F;G++}else N[G]=y,G++;t=0;for(D=N.length;t<D;t++){y=N[t];y.shadowMap||(I=THREE.LinearFilter,
+y.shadowCascadeArray[I]=F}K=y;E=I;B=K.shadowCascadeArray[E];B.position.copy(K.position);B.target.position.copy(K.target.position);B.lookAt(B.target);B.shadowCameraVisible=K.shadowCameraVisible;B.shadowDarkness=K.shadowDarkness;B.shadowBias=K.shadowCascadeBias[E];C=K.shadowCascadeNearZ[E];K=K.shadowCascadeFarZ[E];B=B.pointsFrustum;B[0].z=C;B[1].z=C;B[2].z=C;B[3].z=C;B[4].z=K;B[5].z=K;B[6].z=K;B[7].z=K;N[H]=F;H++}else N[H]=y,H++;t=0;for(D=N.length;t<D;t++){y=N[t];y.shadowMap||(I=THREE.LinearFilter,
 A.type===THREE.PCFSoftShadowMap&&(I=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:I,magFilter:I,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4);if(!y.shadowCamera){if(y instanceof THREE.SpotLight)y.shadowCamera=new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,y.shadowCameraNear,y.shadowCameraFar);else if(y instanceof THREE.DirectionalLight)y.shadowCamera=
 A.type===THREE.PCFSoftShadowMap&&(I=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:I,magFilter:I,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4);if(!y.shadowCamera){if(y instanceof THREE.SpotLight)y.shadowCamera=new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,y.shadowCameraNear,y.shadowCameraFar);else if(y instanceof THREE.DirectionalLight)y.shadowCamera=
-new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",y);continue}c.add(y.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),c.add(y.cameraHelper));if(y.isVirtual&&F.originalCamera==q){I=q;G=y.shadowCamera;C=y.pointsFrustum;B=y.pointsWorld;
-k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(K=0;8>K;K++)E=B[K],E.copy(C[K]),E.unproject(I),E.applyMatrix4(G.matrixWorldInverse),E.x<k.x&&(k.x=E.x),E.x>l.x&&(l.x=E.x),E.y<k.y&&(k.y=E.y),E.y>l.y&&(l.y=E.y),E.z<k.z&&(k.z=E.z),E.z>l.z&&(l.z=E.z);G.left=k.x;G.right=l.x;G.top=l.y;G.bottom=k.y;G.updateProjectionMatrix()}G=y.shadowMap;C=y.shadowMatrix;I=y.shadowCamera;I.position.setFromMatrixPosition(y.matrixWorld);p.setFromMatrixPosition(y.target.matrixWorld);I.lookAt(p);I.updateMatrixWorld();
-I.matrixWorldInverse.getInverse(I.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);C.multiply(I.projectionMatrix);C.multiply(I.matrixWorldInverse);h.multiplyMatrices(I.projectionMatrix,I.matrixWorldInverse);f.setFromMatrix(h);a.setRenderTarget(G);a.clear();n.length=0;d(c,I);y=0;for(G=n.length;y<G;y++)C=n[y],C=C.object,B=C.material instanceof THREE.MeshFaceMaterial?C.material.materials[0]:
-C.material,K=void 0!==C.geometry.morphTargets&&0<C.geometry.morphTargets.length&&B.morphTargets,E=C instanceof THREE.SkinnedMesh&&B.skinning,K=C.customDepthMaterial?C.customDepthMaterial:E?K?w:v:K?u:r,a.setMaterialFaces(B),a.renderBufferDirect(I,b,null,K,C);y=0;for(G=m.length;y<G;y++)C=m[y],C=C.object,C.visible&&C.castShadow&&(C._modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,C.matrixWorld),a.renderImmediateObject(I,b,null,r,C))}t=a.getClearColor();D=a.getClearAlpha();e.clearColor(t.r,t.g,
+new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",y);continue}c.add(y.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),c.add(y.cameraHelper));if(y.isVirtual&&F.originalCamera==q){I=q;H=y.shadowCamera;C=y.pointsFrustum;B=y.pointsWorld;
+k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(K=0;8>K;K++)E=B[K],E.copy(C[K]),E.unproject(I),E.applyMatrix4(H.matrixWorldInverse),E.x<k.x&&(k.x=E.x),E.x>l.x&&(l.x=E.x),E.y<k.y&&(k.y=E.y),E.y>l.y&&(l.y=E.y),E.z<k.z&&(k.z=E.z),E.z>l.z&&(l.z=E.z);H.left=k.x;H.right=l.x;H.top=l.y;H.bottom=k.y;H.updateProjectionMatrix()}H=y.shadowMap;C=y.shadowMatrix;I=y.shadowCamera;I.position.setFromMatrixPosition(y.matrixWorld);p.setFromMatrixPosition(y.target.matrixWorld);I.lookAt(p);I.updateMatrixWorld();
+I.matrixWorldInverse.getInverse(I.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);C.multiply(I.projectionMatrix);C.multiply(I.matrixWorldInverse);h.multiplyMatrices(I.projectionMatrix,I.matrixWorldInverse);f.setFromMatrix(h);a.setRenderTarget(H);a.clear();n.length=0;d(c,I);y=0;for(H=n.length;y<H;y++)C=n[y],C=C.object,B=C.material instanceof THREE.MeshFaceMaterial?C.material.materials[0]:
+C.material,K=void 0!==C.geometry.morphTargets&&0<C.geometry.morphTargets.length&&B.morphTargets,E=C instanceof THREE.SkinnedMesh&&B.skinning,K=C.customDepthMaterial?C.customDepthMaterial:E?K?w:v:K?u:r,a.setMaterialFaces(B),a.renderBufferDirect(I,b,null,K,C);y=0;for(H=m.length;y<H;y++)C=m[y],C=C.object,C.visible&&C.castShadow&&(C._modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,C.matrixWorld),a.renderImmediateObject(I,b,null,r,C))}t=a.getClearColor();D=a.getClearAlpha();e.clearColor(t.r,t.g,
 t.b,D);g.setBlend(!0);A.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState()}}};
 t.b,D);g.setBlend(!0);A.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState()}}};
-THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),g=null,f=null,h=null,k=null,l=null,m=null,p=null,n=null,q=null,t=null,r=null,u=null,v=null,w=null,A=null,x=null,J=null,H=null,D=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),y=void 0,G={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);a.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);a.enable(a.CULL_FACE);a.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.SRC_ALPHA,
+THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),g=null,f=null,h=null,k=null,l=null,m=null,p=null,n=null,q=null,t=null,r=null,u=null,v=null,w=null,A=null,x=null,J=null,G=null,D=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),y=void 0,H={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);a.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);a.enable(a.CULL_FACE);a.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.SRC_ALPHA,
 a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&(a.disableVertexAttribArray(b),e[b]=0)};this.setBlend=function(b){b!==g&&(b?a.enable(a.BLEND):a.disable(a.BLEND),g=b)};this.setBlending=function(c,d,e,g,q,t,r){c!==f&&(c===THREE.NoBlending?this.setBlend(!1):c===THREE.AdditiveBlending?
 a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&(a.disableVertexAttribArray(b),e[b]=0)};this.setBlend=function(b){b!==g&&(b?a.enable(a.BLEND):a.disable(a.BLEND),g=b)};this.setBlending=function(c,d,e,g,q,t,r){c!==f&&(c===THREE.NoBlending?this.setBlend(!1):c===THREE.AdditiveBlending?
 (this.setBlend(!0),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(this.setBlend(!0),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(this.setBlend(!0),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?this.setBlend(!0):(this.setBlend(!0),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),f=
 (this.setBlend(!0),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(this.setBlend(!0),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(this.setBlend(!0),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?this.setBlend(!0):(this.setBlend(!0),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),f=
 c);if(c===THREE.CustomBlending){q=q||d;t=t||e;r=r||g;if(d!==h||q!==m)a.blendEquationSeparate(b(d),b(q)),h=d,m=q;if(e!==k||g!==l||t!==p||r!==n)a.blendFuncSeparate(b(e),b(g),b(t),b(r)),k=e,l=g,p=t,n=r}else n=p=m=l=k=h=null};this.setDepthFunc=function(b){if(q!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);
 c);if(c===THREE.CustomBlending){q=q||d;t=t||e;r=r||g;if(d!==h||q!==m)a.blendEquationSeparate(b(d),b(q)),h=d,m=q;if(e!==k||g!==l||t!==p||r!==n)a.blendFuncSeparate(b(e),b(g),b(t),b(r)),k=e,l=g,p=t,n=r}else n=p=m=l=k=h=null};this.setDepthFunc=function(b){if(q!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);
 break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);q=b}};this.setDepthTest=function(b){t!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),t=b)};this.setDepthWrite=function(b){r!==b&&(a.depthMask(b),r=b)};this.setColorWrite=function(b){u!==b&&(a.colorMask(b,b,b,b),u=b)};this.setDoubleSided=function(b){v!==b&&(b?a.disable(a.CULL_FACE):
 break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);q=b}};this.setDepthTest=function(b){t!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),t=b)};this.setDepthWrite=function(b){r!==b&&(a.depthMask(b),r=b)};this.setColorWrite=function(b){u!==b&&(a.colorMask(b,b,b,b),u=b)};this.setDoubleSided=function(b){v!==b&&(b?a.disable(a.CULL_FACE):
-a.enable(a.CULL_FACE),v=b)};this.setFlipSided=function(b){w!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),w=b)};this.setLineWidth=function(b){b!==A&&(a.lineWidth(b),A=b)};this.setPolygonOffset=function(b,c,d){x!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),x=b);!b||J===c&&H===d||(a.polygonOffset(c,d),J=c,H=d)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+D-1);y!==b&&(a.activeTexture(b),y=b)};this.bindTexture=function(b,d){void 0===y&&c.activeTexture();var e=G[y];
-void 0===e&&(e={type:void 0,texture:void 0},G[y]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<e.length;b++)1===e[b]&&(a.disableVertexAttribArray(b),e[b]=0);w=v=u=r=t=f=null}};
-THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,l,m,p,n=a.context,q=a.state,t,r,u,v,w,A;this.render=function(x,J,H,D){if(0!==b.length){x=new THREE.Vector3;var y=D/H,G=.5*H,I=.5*D,C=16/D,K=new THREE.Vector2(C*y,C),N=new THREE.Vector3(1,1,0),F=new THREE.Vector2(1,1);if(void 0===u){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),B=new Uint16Array([0,1,2,0,2,3]);t=n.createBuffer();r=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,t);n.bufferData(n.ARRAY_BUFFER,C,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
+a.enable(a.CULL_FACE),v=b)};this.setFlipSided=function(b){w!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),w=b)};this.setLineWidth=function(b){b!==A&&(a.lineWidth(b),A=b)};this.setPolygonOffset=function(b,c,d){x!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),x=b);!b||J===c&&G===d||(a.polygonOffset(c,d),J=c,G=d)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+D-1);y!==b&&(a.activeTexture(b),y=b)};this.bindTexture=function(b,d){void 0===y&&c.activeTexture();var e=H[y];
+void 0===e&&(e={type:void 0,texture:void 0},H[y]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<e.length;b++)1===e[b]&&(a.disableVertexAttribArray(b),e[b]=0);w=v=u=r=t=f=null}};
+THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,l,m,p,n=a.context,q=a.state,t,r,u,v,w,A;this.render=function(x,J,G,D){if(0!==b.length){x=new THREE.Vector3;var y=D/G,H=.5*G,I=.5*D,C=16/D,K=new THREE.Vector2(C*y,C),N=new THREE.Vector3(1,1,0),F=new THREE.Vector2(1,1);if(void 0===u){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),B=new Uint16Array([0,1,2,0,2,3]);t=n.createBuffer();r=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,t);n.bufferData(n.ARRAY_BUFFER,C,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
 r);n.bufferData(n.ELEMENT_ARRAY_BUFFER,B,n.STATIC_DRAW);w=n.createTexture();A=n.createTexture();q.bindTexture(n.TEXTURE_2D,w);n.texImage2D(n.TEXTURE_2D,0,n.RGB,16,16,0,n.RGB,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);q.bindTexture(n.TEXTURE_2D,A);n.texImage2D(n.TEXTURE_2D,0,
 r);n.bufferData(n.ELEMENT_ARRAY_BUFFER,B,n.STATIC_DRAW);w=n.createTexture();A=n.createTexture();q.bindTexture(n.TEXTURE_2D,w);n.texImage2D(n.TEXTURE_2D,0,n.RGB,16,16,0,n.RGB,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);q.bindTexture(n.TEXTURE_2D,A);n.texImage2D(n.TEXTURE_2D,0,
 n.RGBA,16,16,0,n.RGBA,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);var C=(v=0<n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 n.RGBA,16,16,0,n.RGBA,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);var C=(v=0<n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
 fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
 B=n.createProgram(),E=n.createShader(n.FRAGMENT_SHADER),L=n.createShader(n.VERTEX_SHADER),Q="precision "+a.getPrecision()+" float;\n";n.shaderSource(E,Q+C.fragmentShader);n.shaderSource(L,Q+C.vertexShader);n.compileShader(E);n.compileShader(L);n.attachShader(B,E);n.attachShader(B,L);n.linkProgram(B);u=B;m=n.getAttribLocation(u,"position");p=n.getAttribLocation(u,"uv");c=n.getUniformLocation(u,"renderType");d=n.getUniformLocation(u,"map");e=n.getUniformLocation(u,"occlusionMap");g=n.getUniformLocation(u,
 B=n.createProgram(),E=n.createShader(n.FRAGMENT_SHADER),L=n.createShader(n.VERTEX_SHADER),Q="precision "+a.getPrecision()+" float;\n";n.shaderSource(E,Q+C.fragmentShader);n.shaderSource(L,Q+C.vertexShader);n.compileShader(E);n.compileShader(L);n.attachShader(B,E);n.attachShader(B,L);n.linkProgram(B);u=B;m=n.getAttribLocation(u,"position");p=n.getAttribLocation(u,"uv");c=n.getUniformLocation(u,"renderType");d=n.getUniformLocation(u,"map");e=n.getUniformLocation(u,"occlusionMap");g=n.getUniformLocation(u,
 "opacity");f=n.getUniformLocation(u,"color");h=n.getUniformLocation(u,"scale");k=n.getUniformLocation(u,"rotation");l=n.getUniformLocation(u,"screenPosition")}n.useProgram(u);q.initAttributes();q.enableAttribute(m);q.enableAttribute(p);q.disableUnusedAttributes();n.uniform1i(e,0);n.uniform1i(d,1);n.bindBuffer(n.ARRAY_BUFFER,t);n.vertexAttribPointer(m,2,n.FLOAT,!1,16,0);n.vertexAttribPointer(p,2,n.FLOAT,!1,16,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r);n.disable(n.CULL_FACE);n.depthMask(!1);B=0;for(E=
 "opacity");f=n.getUniformLocation(u,"color");h=n.getUniformLocation(u,"scale");k=n.getUniformLocation(u,"rotation");l=n.getUniformLocation(u,"screenPosition")}n.useProgram(u);q.initAttributes();q.enableAttribute(m);q.enableAttribute(p);q.disableUnusedAttributes();n.uniform1i(e,0);n.uniform1i(d,1);n.bindBuffer(n.ARRAY_BUFFER,t);n.vertexAttribPointer(m,2,n.FLOAT,!1,16,0);n.vertexAttribPointer(p,2,n.FLOAT,!1,16,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r);n.disable(n.CULL_FACE);n.depthMask(!1);B=0;for(E=
-b.length;B<E;B++)if(C=16/D,K.set(C*y,C),L=b[B],x.set(L.matrixWorld.elements[12],L.matrixWorld.elements[13],L.matrixWorld.elements[14]),x.applyMatrix4(J.matrixWorldInverse),x.applyProjection(J.projectionMatrix),N.copy(x),F.x=N.x*G+G,F.y=N.y*I+I,v||0<F.x&&F.x<H&&0<F.y&&F.y<D){q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,null);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,w);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGB,F.x-8,F.y-8,16,16,0);n.uniform1i(c,0);n.uniform2f(h,K.x,K.y);n.uniform3f(l,
+b.length;B<E;B++)if(C=16/D,K.set(C*y,C),L=b[B],x.set(L.matrixWorld.elements[12],L.matrixWorld.elements[13],L.matrixWorld.elements[14]),x.applyMatrix4(J.matrixWorldInverse),x.applyProjection(J.projectionMatrix),N.copy(x),F.x=N.x*H+H,F.y=N.y*I+I,v||0<F.x&&F.x<G&&0<F.y&&F.y<D){q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,null);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,w);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGB,F.x-8,F.y-8,16,16,0);n.uniform1i(c,0);n.uniform2f(h,K.x,K.y);n.uniform3f(l,
 N.x,N.y,N.z);q.setBlend(!1);n.enable(n.DEPTH_TEST);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,A);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,F.x-8,F.y-8,16,16,0);n.uniform1i(c,1);n.disable(n.DEPTH_TEST);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,w);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);L.positionScreen.copy(N);L.customUpdateCallback?L.customUpdateCallback(L):L.updateLensFlares();n.uniform1i(c,2);q.setBlend(!0);for(var Q=
 N.x,N.y,N.z);q.setBlend(!1);n.enable(n.DEPTH_TEST);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,A);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,F.x-8,F.y-8,16,16,0);n.uniform1i(c,1);n.disable(n.DEPTH_TEST);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,w);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);L.positionScreen.copy(N);L.customUpdateCallback?L.customUpdateCallback(L):L.updateLensFlares();n.uniform1i(c,2);q.setBlend(!0);for(var Q=
 0,S=L.lensFlares.length;Q<S;Q++){var P=L.lensFlares[Q];.001<P.opacity&&.001<P.scale&&(N.x=P.x,N.y=P.y,N.z=P.z,C=P.size*P.scale/D,K.x=C*y,K.y=C,n.uniform3f(l,N.x,N.y,N.z),n.uniform2f(h,K.x,K.y),n.uniform1f(k,P.rotation),n.uniform1f(g,P.opacity),n.uniform3f(f,P.color.r,P.color.g,P.color.b),q.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst),a.setTexture(P.texture,1),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0))}}n.enable(n.CULL_FACE);n.enable(n.DEPTH_TEST);n.depthMask(!0);a.resetGLState()}}};
 0,S=L.lensFlares.length;Q<S;Q++){var P=L.lensFlares[Q];.001<P.opacity&&.001<P.scale&&(N.x=P.x,N.y=P.y,N.z=P.z,C=P.size*P.scale/D,K.x=C*y,K.y=C,n.uniform3f(l,N.x,N.y,N.z),n.uniform2f(h,K.x,K.y),n.uniform1f(k,P.rotation),n.uniform1f(g,P.opacity),n.uniform3f(f,P.color.r,P.color.g,P.color.b),q.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst),a.setTexture(P.texture,1),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0))}}n.enable(n.CULL_FACE);n.enable(n.DEPTH_TEST);n.depthMask(!0);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,l,m,p,n,q,t,r,u,v,w;function A(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,J=a.state,H,D,y,G,I=new THREE.Vector3,C=new THREE.Quaternion,K=new THREE.Vector3;this.render=function(N,F){if(0!==b.length){if(void 0===y){var B=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),E=new Uint16Array([0,1,2,0,2,3]);H=x.createBuffer();D=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,H);x.bufferData(x.ARRAY_BUFFER,B,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,
+THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,l,m,p,n,q,t,r,u,v,w;function A(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,J=a.state,G,D,y,H,I=new THREE.Vector3,C=new THREE.Quaternion,K=new THREE.Vector3;this.render=function(N,F){if(0!==b.length){if(void 0===y){var B=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),E=new Uint16Array([0,1,2,0,2,3]);G=x.createBuffer();D=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,G);x.bufferData(x.ARRAY_BUFFER,B,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,
 D);x.bufferData(x.ELEMENT_ARRAY_BUFFER,E,x.STATIC_DRAW);var B=x.createProgram(),E=x.createShader(x.VERTEX_SHADER),L=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(E,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
 D);x.bufferData(x.ELEMENT_ARRAY_BUFFER,E,x.STATIC_DRAW);var B=x.createProgram(),E=x.createShader(x.VERTEX_SHADER),L=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(E,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
 x.shaderSource(L,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
 x.shaderSource(L,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
 x.compileShader(E);x.compileShader(L);x.attachShader(B,E);x.attachShader(B,L);x.linkProgram(B);y=B;v=x.getAttribLocation(y,"position");w=x.getAttribLocation(y,"uv");c=x.getUniformLocation(y,"uvOffset");d=x.getUniformLocation(y,"uvScale");e=x.getUniformLocation(y,"rotation");g=x.getUniformLocation(y,"scale");f=x.getUniformLocation(y,"color");h=x.getUniformLocation(y,"map");k=x.getUniformLocation(y,"opacity");l=x.getUniformLocation(y,"modelViewMatrix");m=x.getUniformLocation(y,"projectionMatrix");p=
 x.compileShader(E);x.compileShader(L);x.attachShader(B,E);x.attachShader(B,L);x.linkProgram(B);y=B;v=x.getAttribLocation(y,"position");w=x.getAttribLocation(y,"uv");c=x.getUniformLocation(y,"uvOffset");d=x.getUniformLocation(y,"uvScale");e=x.getUniformLocation(y,"rotation");g=x.getUniformLocation(y,"scale");f=x.getUniformLocation(y,"color");h=x.getUniformLocation(y,"map");k=x.getUniformLocation(y,"opacity");l=x.getUniformLocation(y,"modelViewMatrix");m=x.getUniformLocation(y,"projectionMatrix");p=
-x.getUniformLocation(y,"fogType");n=x.getUniformLocation(y,"fogDensity");q=x.getUniformLocation(y,"fogNear");t=x.getUniformLocation(y,"fogFar");r=x.getUniformLocation(y,"fogColor");u=x.getUniformLocation(y,"alphaTest");B=document.createElement("canvas");B.width=8;B.height=8;E=B.getContext("2d");E.fillStyle="white";E.fillRect(0,0,8,8);G=new THREE.Texture(B);G.needsUpdate=!0}x.useProgram(y);J.initAttributes();J.enableAttribute(v);J.enableAttribute(w);J.disableUnusedAttributes();x.disable(x.CULL_FACE);
-J.setBlend(!0);x.bindBuffer(x.ARRAY_BUFFER,H);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(w,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,D);x.uniformMatrix4fv(m,!1,F.projectionMatrix.elements);J.activeTexture(x.TEXTURE0);x.uniform1i(h,0);E=B=0;(L=N.fog)?(x.uniform3f(r,L.color.r,L.color.g,L.color.b),L instanceof THREE.Fog?(x.uniform1f(q,L.near),x.uniform1f(t,L.far),x.uniform1i(p,1),E=B=1):L instanceof THREE.FogExp2&&(x.uniform1f(n,L.density),x.uniform1i(p,2),E=B=2)):
+x.getUniformLocation(y,"fogType");n=x.getUniformLocation(y,"fogDensity");q=x.getUniformLocation(y,"fogNear");t=x.getUniformLocation(y,"fogFar");r=x.getUniformLocation(y,"fogColor");u=x.getUniformLocation(y,"alphaTest");B=document.createElement("canvas");B.width=8;B.height=8;E=B.getContext("2d");E.fillStyle="white";E.fillRect(0,0,8,8);H=new THREE.Texture(B);H.needsUpdate=!0}x.useProgram(y);J.initAttributes();J.enableAttribute(v);J.enableAttribute(w);J.disableUnusedAttributes();x.disable(x.CULL_FACE);
+J.setBlend(!0);x.bindBuffer(x.ARRAY_BUFFER,G);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(w,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,D);x.uniformMatrix4fv(m,!1,F.projectionMatrix.elements);J.activeTexture(x.TEXTURE0);x.uniform1i(h,0);E=B=0;(L=N.fog)?(x.uniform3f(r,L.color.r,L.color.g,L.color.b),L instanceof THREE.Fog?(x.uniform1f(q,L.near),x.uniform1f(t,L.far),x.uniform1i(p,1),E=B=1):L instanceof THREE.FogExp2&&(x.uniform1f(n,L.density),x.uniform1i(p,2),E=B=2)):
 (x.uniform1i(p,0),E=B=0);for(var L=0,Q=b.length;L<Q;L++){var S=b[L];S._modelViewMatrix.multiplyMatrices(F.matrixWorldInverse,S.matrixWorld);S.z=-S._modelViewMatrix.elements[14]}b.sort(A);for(var P=[],L=0,Q=b.length;L<Q;L++){var S=b[L],T=S.material;x.uniform1f(u,T.alphaTest);x.uniformMatrix4fv(l,!1,S._modelViewMatrix.elements);S.matrixWorld.decompose(I,C,K);P[0]=K.x;P[1]=K.y;S=0;N.fog&&T.fog&&(S=E);B!==S&&(x.uniform1i(p,S),B=S);null!==T.map?(x.uniform2f(c,T.map.offset.x,T.map.offset.y),x.uniform2f(d,
 (x.uniform1i(p,0),E=B=0);for(var L=0,Q=b.length;L<Q;L++){var S=b[L];S._modelViewMatrix.multiplyMatrices(F.matrixWorldInverse,S.matrixWorld);S.z=-S._modelViewMatrix.elements[14]}b.sort(A);for(var P=[],L=0,Q=b.length;L<Q;L++){var S=b[L],T=S.material;x.uniform1f(u,T.alphaTest);x.uniformMatrix4fv(l,!1,S._modelViewMatrix.elements);S.matrixWorld.decompose(I,C,K);P[0]=K.x;P[1]=K.y;S=0;N.fog&&T.fog&&(S=E);B!==S&&(x.uniform1i(p,S),B=S);null!==T.map?(x.uniform2f(c,T.map.offset.x,T.map.offset.y),x.uniform2f(d,
-T.map.repeat.x,T.map.repeat.y)):(x.uniform2f(c,0,0),x.uniform2f(d,1,1));x.uniform1f(k,T.opacity);x.uniform3f(f,T.color.r,T.color.g,T.color.b);x.uniform1f(e,T.rotation);x.uniform2fv(g,P);J.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst);J.setDepthTest(T.depthTest);J.setDepthWrite(T.depthWrite);T.map&&T.map.image&&T.map.image.width?a.setTexture(T.map,0):a.setTexture(G,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}x.enable(x.CULL_FACE);a.resetGLState()}}};
+T.map.repeat.x,T.map.repeat.y)):(x.uniform2f(c,0,0),x.uniform2f(d,1,1));x.uniform1f(k,T.opacity);x.uniform3f(f,T.color.r,T.color.g,T.color.b);x.uniform1f(e,T.rotation);x.uniform2fv(g,P);J.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst);J.setDepthTest(T.depthTest);J.setDepthWrite(T.depthWrite);T.map&&T.map.image&&T.map.image.width?a.setTexture(T.map,0):a.setTexture(H,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}x.enable(x.CULL_FACE);a.resetGLState()}}};
 THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
 THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
 THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture([],b);g.flipY=!1;var f=0;b=function(b){e.load(a[b],function(a){g.images[b]=a;f+=1;6===f&&(g.needsUpdate=!0,c&&
 THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture([],b);g.flipY=!1;var f=0;b=function(b){e.load(a[b],function(a){g.images[b]=a;f+=1;6===f&&(g.needsUpdate=!0,c&&
 c(g))},void 0,d)};for(var h=0,k=a.length;h<k;++h)b(h);return g},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,g=document.createElement("canvas");
 c(g))},void 0,d)};for(var h=0,k=a.length;h<k;++h)b(h);return g},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,g=document.createElement("canvas");
@@ -655,7 +655,7 @@ break;case "l":k=b[a++]*c+d;m=b[a++]*c;e.lineTo(k,m);break;case "q":k=b[a++]*c+d
 n,t,u,m)}return{offset:v.ha*c,path:e}}}};
 n,t,u,m)}return{offset:v.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
 (function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,l,m;if(0<b(a))for(l=0;l<e;l++)f[l]=l;else for(l=0;l<e;l++)f[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);m=l+1;e<=m&&(m=0);var n;a:{var q=n=void 0,t=void 0,r=void 0,
 (function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,l,m;if(0<b(a))for(l=0;l<e;l++)f[l]=l;else for(l=0;l<e;l++)f[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);m=l+1;e<=m&&(m=0);var n;a:{var q=n=void 0,t=void 0,r=void 0,
-u=void 0,v=void 0,w=void 0,A=void 0,x=void 0,q=a[f[k]].x,t=a[f[k]].y,r=a[f[l]].x,u=a[f[l]].y,v=a[f[m]].x,w=a[f[m]].y;if(1E-10>(r-q)*(w-t)-(u-t)*(v-q))n=!1;else{var J=void 0,H=void 0,D=void 0,y=void 0,G=void 0,I=void 0,C=void 0,K=void 0,N=void 0,F=void 0,N=K=C=x=A=void 0,J=v-r,H=w-u,D=q-v,y=t-w,G=r-q,I=u-t;for(n=0;n<e;n++)if(A=a[f[n]].x,x=a[f[n]].y,!(A===q&&x===t||A===r&&x===u||A===v&&x===w)&&(C=A-q,K=x-t,N=A-r,F=x-u,A-=v,x-=w,N=J*F-H*N,C=G*K-I*C,K=D*x-y*A,-1E-10<=N&&-1E-10<=K&&-1E-10<=C)){n=!1;break a}n=
+u=void 0,v=void 0,w=void 0,A=void 0,x=void 0,q=a[f[k]].x,t=a[f[k]].y,r=a[f[l]].x,u=a[f[l]].y,v=a[f[m]].x,w=a[f[m]].y;if(1E-10>(r-q)*(w-t)-(u-t)*(v-q))n=!1;else{var J=void 0,G=void 0,D=void 0,y=void 0,H=void 0,I=void 0,C=void 0,K=void 0,N=void 0,F=void 0,N=K=C=x=A=void 0,J=v-r,G=w-u,D=q-v,y=t-w,H=r-q,I=u-t;for(n=0;n<e;n++)if(A=a[f[n]].x,x=a[f[n]].y,!(A===q&&x===t||A===r&&x===u||A===v&&x===w)&&(C=A-q,K=x-t,N=A-r,F=x-u,A-=v,x-=w,N=J*F-G*N,C=H*K-I*C,K=D*x-y*A,-1E-10<=N&&-1E-10<=K&&-1E-10<=C)){n=!1;break a}n=
 !0}}if(n){g.push([a[f[k]],a[f[l]],a[f[m]]]);h.push([f[k],f[l],f[m]]);k=l;for(m=l+1;m<e;k++,m++)f[k]=f[m];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
 !0}}if(n){g.push([a[f[k]],a[f[l]],a[f[m]]]);h.push([f[k],f[l],f[m]]);k=l;for(m=l+1;m<e;k++,m++)f[k]=f[m];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);THREE.Audio.prototype.constructor=THREE.Audio;
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);THREE.Audio.prototype.constructor=THREE.Audio;
 THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this};
 THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this};
@@ -697,8 +697,8 @@ THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransfor
 THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,g){var f=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,m=a.x-d.x,p=a.y-d.y,D=h*k-f*l,y=h*m-f*p;if(1E-10<Math.abs(D)){if(0<D){if(0>y||y>D)return[];k=l*m-k*p;if(0>k||k>D)return[]}else{if(0<y||y<D)return[];k=l*m-k*p;if(0<k||k<D)return[]}if(0===k)return!g||0!==y&&y!==D?[a]:[];if(k===D)return!g||0!==y&&y!==D?[b]:[];if(0===
 THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,g){var f=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,m=a.x-d.x,p=a.y-d.y,D=h*k-f*l,y=h*m-f*p;if(1E-10<Math.abs(D)){if(0<D){if(0>y||y>D)return[];k=l*m-k*p;if(0>k||k>D)return[]}else{if(0<y||y<D)return[];k=l*m-k*p;if(0<k||k<D)return[]}if(0===k)return!g||0!==y&&y!==D?[a]:[];if(k===D)return!g||0!==y&&y!==D?[b]:[];if(0===
 y)return[d];if(y===D)return[e];g=k/D;return[{x:a.x+g*f,y:a.y+g*h}]}if(0!==y||l*m!==k*p)return[];h=0===f&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==f?(a.x<b.x?(f=a,k=a.x,h=b,a=b.x):(f=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,D=d.x,l=e,d=e.x):(b=e,D=e.x,l=d,d=d.x)):(a.y<b.y?(f=a,k=a.y,h=b,a=b.y):(f=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,D=d.y,l=e,d=e.y):(b=e,D=e.y,l=d,d=d.y));return k<=D?a<D?[]:a===D?g?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
 y)return[d];if(y===D)return[e];g=k/D;return[{x:a.x+g*f,y:a.y+g*h}]}if(0!==y||l*m!==k*p)return[];h=0===f&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==f?(a.x<b.x?(f=a,k=a.x,h=b,a=b.x):(f=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,D=d.x,l=e,d=e.x):(b=e,D=e.x,l=d,d=d.x)):(a.y<b.y?(f=a,k=a.y,h=b,a=b.y):(f=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,D=d.y,l=e,d=e.y):(b=e,D=e.y,l=d,d=d.y));return k<=D?a<D?[]:a===D?g?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
 k===d?g?[]:[f]:a<=d?[f,h]:[f,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,k,l,m={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)l=h[g].x+":"+h[g].y,void 0!==m[l]&&console.warn("THREE.Shape: Duplicate point",l),m[l]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
 k===d?g?[]:[f]:a<=d?[f,h]:[f,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,k,l,m={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)l=h[g].x+":"+h[g].y,void 0!==m[l]&&console.warn("THREE.Shape: Duplicate point",l),m[l]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
-0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],m,p,H,D,y,G=[],I,C,K,N=0;for(m=b.length;N<m;N++)l.push(N);I=0;for(var F=2*
-l.length;0<l.length;){F--;if(0>F){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=I;p<h.length;p++){H=h[p];m=-1;for(N=0;N<l.length;N++)if(D=l[N],y=H.x+":"+H.y+":"+D,void 0===G[y]){k=b[D];for(C=0;C<k.length;C++)if(D=k[C],c(p,C)&&!f(H,D)&&!g(H,D)){m=C;l.splice(N,1);I=h.slice(0,p+1);D=h.slice(p);C=k.slice(m);K=k.slice(0,m+1);h=I.concat(C).concat(K).concat(D);I=p;break}if(0<=m)break;G[y]=!0}if(0<=m)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g,
+0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],m,p,G,D,y,H=[],I,C,K,N=0;for(m=b.length;N<m;N++)l.push(N);I=0;for(var F=2*
+l.length;0<l.length;){F--;if(0>F){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=I;p<h.length;p++){G=h[p];m=-1;for(N=0;N<l.length;N++)if(D=l[N],y=G.x+":"+G.y+":"+D,void 0===H[y]){k=b[D];for(C=0;C<k.length;C++)if(D=k[C],c(p,C)&&!f(G,D)&&!g(G,D)){m=C;l.splice(N,1);I=h.slice(0,p+1);D=h.slice(p);C=k.slice(m);K=k.slice(0,m+1);h=I.concat(C).concat(K).concat(D);I=p;break}if(0<=m)break;H[y]=!0}if(0<=m)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g,
 !1);g=0;for(f=p.length;g<f;g++)for(k=p[g],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=m[l],void 0!==l&&(k[h]=l);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
 !1);g=0;for(f=p.length;g<f;g++)for(k=p[g],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=m[l],void 0!==l&&(k[h]=l);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
 a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};
 a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};
 THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
 THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
@@ -739,8 +739,8 @@ g.interpolate(f,f.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorld
 THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
 THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
 THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);a=this.duration/this.frames;var b=Math.floor(this.currentTime/a),c=this.mesh.morphTargetInfluences;b!==this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=
 THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);a=this.duration/this.frames;var b=Math.floor(this.currentTime/a),c=this.mesh.morphTargetInfluences;b!==this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=
 1,c[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);c[b]=this.currentTime%a/a;c[this.lastFrame]=1-c[b]}}};
 1,c[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);c[b]=this.currentTime%a/a;c[this.lastFrame]=1-c[b]}}};
-THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g){var r,u=h.widthSegments,v=h.heightSegments,w=e/2,A=f/2,x=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)r="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)r="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)r="x",u=h.depthSegments;var J=u+1,H=v+1,D=e/u,y=f/v,G=new THREE.Vector3;G[r]=0<g?1:-1;for(e=0;e<H;e++)for(f=0;f<J;f++){var I=new THREE.Vector3;I[a]=(f*D-w)*c;I[b]=(e*y-A)*d;I[r]=g;h.vertices.push(I)}for(e=0;e<
-v;e++)for(f=0;f<u;f++)A=f+J*e,a=f+J*(e+1),b=f+1+J*(e+1),c=f+1+J*e,d=new THREE.Vector2(f/u,1-e/v),g=new THREE.Vector2(f/u,1-(e+1)/v),r=new THREE.Vector2((f+1)/u,1-(e+1)/v),w=new THREE.Vector2((f+1)/u,1-e/v),A=new THREE.Face3(A+x,a+x,c+x),A.normal.copy(G),A.vertexNormals.push(G.clone(),G.clone(),G.clone()),h.faces.push(A),h.faceVertexUvs[0].push([d,g,w]),A=new THREE.Face3(a+x,b+x,c+x),A.normal.copy(G),A.vertexNormals.push(G.clone(),G.clone(),G.clone()),h.faces.push(A),h.faceVertexUvs[0].push([g.clone(),
+THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g){var r,u=h.widthSegments,v=h.heightSegments,w=e/2,A=f/2,x=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)r="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)r="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)r="x",u=h.depthSegments;var J=u+1,G=v+1,D=e/u,y=f/v,H=new THREE.Vector3;H[r]=0<g?1:-1;for(e=0;e<G;e++)for(f=0;f<J;f++){var I=new THREE.Vector3;I[a]=(f*D-w)*c;I[b]=(e*y-A)*d;I[r]=g;h.vertices.push(I)}for(e=0;e<
+v;e++)for(f=0;f<u;f++)A=f+J*e,a=f+J*(e+1),b=f+1+J*(e+1),c=f+1+J*e,d=new THREE.Vector2(f/u,1-e/v),g=new THREE.Vector2(f/u,1-(e+1)/v),r=new THREE.Vector2((f+1)/u,1-(e+1)/v),w=new THREE.Vector2((f+1)/u,1-e/v),A=new THREE.Face3(A+x,a+x,c+x),A.normal.copy(H),A.vertexNormals.push(H.clone(),H.clone(),H.clone()),h.faces.push(A),h.faceVertexUvs[0].push([d,g,w]),A=new THREE.Face3(a+x,b+x,c+x),A.normal.copy(H),A.vertexNormals.push(H.clone(),H.clone(),H.clone()),h.faces.push(A),h.faceVertexUvs[0].push([g.clone(),
 r,w.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d);f("z","y",1,-1,c,b,-d);f("x","z",1,1,a,c,e);f("x","z",1,-1,a,c,-e);f("x","y",1,-1,a,b,g);f("x","y",-1,-1,a,b,-g);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 r,w.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d);f("z","y",1,-1,c,b,-d);f("x","z",1,1,a,c,e);f("x","z",1,-1,a,c,-e);f("x","y",1,-1,a,b,g);f("x","y",-1,-1,a,b,-g);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.CubeGeometry=THREE.BoxGeometry;
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.CubeGeometry=THREE.BoxGeometry;
 THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,g=[];e=new THREE.Vector3;var f=new THREE.Vector2(.5,.5);this.vertices.push(e);g.push(f);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);g.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,g=[];e=new THREE.Vector3;var f=new THREE.Vector2(.5,.5);this.vertices.push(e);g.push(f);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);g.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
@@ -749,20 +749,20 @@ THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);thi
 [];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(g,3));this.addAttribute("normal",new THREE.BufferAttribute(f,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
 [];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(g,3));this.addAttribute("normal",new THREE.BufferAttribute(f,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
 THREE.CylinderGeometry=function(a,b,c,d,e,g,f,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g,thetaStart:f,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;f=void 0!==f?f:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,m,p=[],n=[];for(m=0;m<=e;m++){var q=[],t=[],r=m/e,u=r*(b-a)+a;for(l=0;l<=d;l++){var v=l/d,w=new THREE.Vector3;w.x=u*Math.sin(v*h+
 THREE.CylinderGeometry=function(a,b,c,d,e,g,f,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g,thetaStart:f,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;f=void 0!==f?f:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,m,p=[],n=[];for(m=0;m<=e;m++){var q=[],t=[],r=m/e,u=r*(b-a)+a;for(l=0;l<=d;l++){var v=l/d,w=new THREE.Vector3;w.x=u*Math.sin(v*h+
 f);w.y=-r*c+k;w.z=u*Math.cos(v*h+f);this.vertices.push(w);q.push(this.vertices.length-1);t.push(new THREE.Vector2(v,1-r))}p.push(q);n.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(f=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(f=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),f.setY(Math.sqrt(f.x*f.x+f.z*f.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),m=0;m<e;m++){var q=p[m][l],t=p[m+1][l],r=p[m+1][l+1],u=p[m][l+1],v=f.clone(),w=f.clone(),
 f);w.y=-r*c+k;w.z=u*Math.cos(v*h+f);this.vertices.push(w);q.push(this.vertices.length-1);t.push(new THREE.Vector2(v,1-r))}p.push(q);n.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(f=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(f=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),f.setY(Math.sqrt(f.x*f.x+f.z*f.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),m=0;m<e;m++){var q=p[m][l],t=p[m+1][l],r=p[m+1][l+1],u=p[m][l+1],v=f.clone(),w=f.clone(),
-A=h.clone(),x=h.clone(),J=n[m][l].clone(),H=n[m+1][l].clone(),D=n[m+1][l+1].clone(),y=n[m][l+1].clone();this.faces.push(new THREE.Face3(q,t,u,[v,w,x]));this.faceVertexUvs[0].push([J,H,y]);this.faces.push(new THREE.Face3(t,r,u,[w.clone(),A,x.clone()]));this.faceVertexUvs[0].push([H.clone(),D,y.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=p[0][l],t=p[0][l+1],r=this.vertices.length-1,v=new THREE.Vector3(0,1,0),w=new THREE.Vector3(0,1,0),A=new THREE.Vector3(0,
-1,0),J=n[0][l].clone(),H=n[0][l+1].clone(),D=new THREE.Vector2(H.x,0),this.faces.push(new THREE.Face3(q,t,r,[v,w,A])),this.faceVertexUvs[0].push([J,H,D]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=p[e][l+1],t=p[e][l],r=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),A=new THREE.Vector3(0,-1,0),J=n[e][l+1].clone(),H=n[e][l].clone(),D=new THREE.Vector2(H.x,1),this.faces.push(new THREE.Face3(q,t,r,[v,w,A])),this.faceVertexUvs[0].push([J,
-H,D]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
+A=h.clone(),x=h.clone(),J=n[m][l].clone(),G=n[m+1][l].clone(),D=n[m+1][l+1].clone(),y=n[m][l+1].clone();this.faces.push(new THREE.Face3(q,t,u,[v,w,x]));this.faceVertexUvs[0].push([J,G,y]);this.faces.push(new THREE.Face3(t,r,u,[w.clone(),A,x.clone()]));this.faceVertexUvs[0].push([G.clone(),D,y.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=p[0][l],t=p[0][l+1],r=this.vertices.length-1,v=new THREE.Vector3(0,1,0),w=new THREE.Vector3(0,1,0),A=new THREE.Vector3(0,
+1,0),J=n[0][l].clone(),G=n[0][l+1].clone(),D=new THREE.Vector2(G.x,0),this.faces.push(new THREE.Face3(q,t,r,[v,w,A])),this.faceVertexUvs[0].push([J,G,D]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=p[e][l+1],t=p[e][l],r=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),A=new THREE.Vector3(0,-1,0),J=n[e][l+1].clone(),G=n[e][l].clone(),D=new THREE.Vector2(G.x,1),this.faces.push(new THREE.Face3(q,t,r,[v,w,A])),this.faceVertexUvs[0].push([J,
+G,D]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
 THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,m=h.length;l<m;l++)for(var p=h[l],n=0;3>n;n++){d[0]=p[f[n]];d[1]=p[f[(n+1)%3]];d.sort(g);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:l,
 THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,m=h.length;l<m;l++)for(var p=h[l],n=0;3>n;n++){d[0]=p[f[n]];d[1]=p[f[(n+1)%3]];d.sort(g);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:l,
 face2:void 0}:e[q].face2=l}d=[];for(q in e)if(g=e[q],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=c)f=k[g.vert1],d.push(f.x),d.push(f.y),d.push(f.z),f=k[g.vert2],d.push(f.x),d.push(f.y),d.push(f.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
 face2:void 0}:e[q].face2=l}d=[];for(q in e)if(g=e[q],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=c)f=k[g.vert1],d.push(f.x),d.push(f.y),d.push(f.z),f=k[g.vert2],d.push(f.x),d.push(f.y),d.push(f.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
 THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=
-!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(z=a.length;0<=--z;){c=z;d=z-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*m,e=0;e<f;e++){var g=S*e,h=S*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+I,g=g+I,l=l+I,h=h+I;G.faces.push(new THREE.Face3(k,g,h));G.faces.push(new THREE.Face3(g,l,h));k=v.generateSideWallUV(G,k,g,l,h);G.faceVertexUvs[0].push([k[0],k[1],k[3]]);G.faceVertexUvs[0].push([k[1],
-k[2],k[3]])}}}function g(a,b,c){G.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=I;b+=I;c+=I;G.faces.push(new THREE.Face3(a,b,c));a=v.generateTopUV(G,a,b,c);G.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,t=b.extrudePath,
-r,u=!1,v=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,A,x,J;t&&(r=t.getSpacedPoints(q),u=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,q,!1),A=new THREE.Vector3,x=new THREE.Vector3,J=new THREE.Vector3);p||(l=k=m=0);var H,D,y,G=this,I=this.vertices.length,t=a.extractPoints(n),n=t.shape,C=t.holes;if(t=!THREE.Shape.Utils.isClockWise(n)){n=n.reverse();D=0;for(y=C.length;D<y;D++)H=C[D],THREE.Shape.Utils.isClockWise(H)&&(C[D]=H.reverse());t=
-!1}var K=THREE.Shape.Utils.triangulateShape(n,C),N=n;D=0;for(y=C.length;D<y;D++)H=C[D],n=n.concat(H);var F,B,E,L,Q,S=n.length,P,T=K.length,t=[],z=0;E=N.length;F=E-1;for(B=z+1;z<E;z++,F++,B++)F===E&&(F=0),B===E&&(B=0),t[z]=d(N[z],N[F],N[B]);var da=[],ja,la=t.concat();D=0;for(y=C.length;D<y;D++){H=C[D];ja=[];z=0;E=H.length;F=E-1;for(B=z+1;z<E;z++,F++,B++)F===E&&(F=0),B===E&&(B=0),ja[z]=d(H[z],H[F],H[B]);da.push(ja);la=la.concat(ja)}for(F=0;F<m;F++){E=F/m;L=k*(1-E);B=l*Math.sin(E*Math.PI/2);z=0;for(E=
-N.length;z<E;z++)Q=c(N[z],t[z],B),g(Q.x,Q.y,-L);D=0;for(y=C.length;D<y;D++)for(H=C[D],ja=da[D],z=0,E=H.length;z<E;z++)Q=c(H[z],ja[z],B),g(Q.x,Q.y,-L)}B=l;for(z=0;z<S;z++)Q=p?c(n[z],la[z],B):n[z],u?(x.copy(w.normals[0]).multiplyScalar(Q.x),A.copy(w.binormals[0]).multiplyScalar(Q.y),J.copy(r[0]).add(x).add(A),g(J.x,J.y,J.z)):g(Q.x,Q.y,0);for(E=1;E<=q;E++)for(z=0;z<S;z++)Q=p?c(n[z],la[z],B):n[z],u?(x.copy(w.normals[E]).multiplyScalar(Q.x),A.copy(w.binormals[E]).multiplyScalar(Q.y),J.copy(r[E]).add(x).add(A),
-g(J.x,J.y,J.z)):g(Q.x,Q.y,h/q*E);for(F=m-1;0<=F;F--){E=F/m;L=k*(1-E);B=l*Math.sin(E*Math.PI/2);z=0;for(E=N.length;z<E;z++)Q=c(N[z],t[z],B),g(Q.x,Q.y,h+L);D=0;for(y=C.length;D<y;D++)for(H=C[D],ja=da[D],z=0,E=H.length;z<E;z++)Q=c(H[z],ja[z],B),u?g(Q.x,Q.y+r[q-1].y,r[q-1].x+L):g(Q.x,Q.y,h+L)}(function(){if(p){var a;a=0*S;for(z=0;z<T;z++)P=K[z],f(P[2]+a,P[1]+a,P[0]+a);a=q+2*m;a*=S;for(z=0;z<T;z++)P=K[z],f(P[0]+a,P[1]+a,P[2]+a)}else{for(z=0;z<T;z++)P=K[z],f(P[2],P[1],P[0]);for(z=0;z<T;z++)P=K[z],f(P[0]+
-S*q,P[1]+S*q,P[2]+S*q)}})();(function(){var a=0;e(N,a);a+=N.length;D=0;for(y=C.length;D<y;D++)H=C[D],e(H,a),a+=H.length})()};
+!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(z=a.length;0<=--z;){c=z;d=z-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*m,e=0;e<f;e++){var g=S*e,h=S*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+I,g=g+I,l=l+I,h=h+I;H.faces.push(new THREE.Face3(k,g,h));H.faces.push(new THREE.Face3(g,l,h));k=v.generateSideWallUV(H,k,g,l,h);H.faceVertexUvs[0].push([k[0],k[1],k[3]]);H.faceVertexUvs[0].push([k[1],
+k[2],k[3]])}}}function g(a,b,c){H.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=I;b+=I;c+=I;H.faces.push(new THREE.Face3(a,b,c));a=v.generateTopUV(H,a,b,c);H.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,t=b.extrudePath,
+r,u=!1,v=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,A,x,J;t&&(r=t.getSpacedPoints(q),u=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,q,!1),A=new THREE.Vector3,x=new THREE.Vector3,J=new THREE.Vector3);p||(l=k=m=0);var G,D,y,H=this,I=this.vertices.length,t=a.extractPoints(n),n=t.shape,C=t.holes;if(t=!THREE.Shape.Utils.isClockWise(n)){n=n.reverse();D=0;for(y=C.length;D<y;D++)G=C[D],THREE.Shape.Utils.isClockWise(G)&&(C[D]=G.reverse());t=
+!1}var K=THREE.Shape.Utils.triangulateShape(n,C),N=n;D=0;for(y=C.length;D<y;D++)G=C[D],n=n.concat(G);var F,B,E,L,Q,S=n.length,P,T=K.length,t=[],z=0;E=N.length;F=E-1;for(B=z+1;z<E;z++,F++,B++)F===E&&(F=0),B===E&&(B=0),t[z]=d(N[z],N[F],N[B]);var da=[],ja,la=t.concat();D=0;for(y=C.length;D<y;D++){G=C[D];ja=[];z=0;E=G.length;F=E-1;for(B=z+1;z<E;z++,F++,B++)F===E&&(F=0),B===E&&(B=0),ja[z]=d(G[z],G[F],G[B]);da.push(ja);la=la.concat(ja)}for(F=0;F<m;F++){E=F/m;L=k*(1-E);B=l*Math.sin(E*Math.PI/2);z=0;for(E=
+N.length;z<E;z++)Q=c(N[z],t[z],B),g(Q.x,Q.y,-L);D=0;for(y=C.length;D<y;D++)for(G=C[D],ja=da[D],z=0,E=G.length;z<E;z++)Q=c(G[z],ja[z],B),g(Q.x,Q.y,-L)}B=l;for(z=0;z<S;z++)Q=p?c(n[z],la[z],B):n[z],u?(x.copy(w.normals[0]).multiplyScalar(Q.x),A.copy(w.binormals[0]).multiplyScalar(Q.y),J.copy(r[0]).add(x).add(A),g(J.x,J.y,J.z)):g(Q.x,Q.y,0);for(E=1;E<=q;E++)for(z=0;z<S;z++)Q=p?c(n[z],la[z],B):n[z],u?(x.copy(w.normals[E]).multiplyScalar(Q.x),A.copy(w.binormals[E]).multiplyScalar(Q.y),J.copy(r[E]).add(x).add(A),
+g(J.x,J.y,J.z)):g(Q.x,Q.y,h/q*E);for(F=m-1;0<=F;F--){E=F/m;L=k*(1-E);B=l*Math.sin(E*Math.PI/2);z=0;for(E=N.length;z<E;z++)Q=c(N[z],t[z],B),g(Q.x,Q.y,h+L);D=0;for(y=C.length;D<y;D++)for(G=C[D],ja=da[D],z=0,E=G.length;z<E;z++)Q=c(G[z],ja[z],B),u?g(Q.x,Q.y+r[q-1].y,r[q-1].x+L):g(Q.x,Q.y,h+L)}(function(){if(p){var a;a=0*S;for(z=0;z<T;z++)P=K[z],f(P[2]+a,P[1]+a,P[0]+a);a=q+2*m;a*=S;for(z=0;z<T;z++)P=K[z],f(P[0]+a,P[1]+a,P[2]+a)}else{for(z=0;z<T;z++)P=K[z],f(P[2],P[1],P[0]);for(z=0;z<T;z++)P=K[z],f(P[0]+
+S*q,P[1]+S*q,P[2]+S*q)}})();(function(){var a=0;e(N,a);a+=N.length;D=0;for(y=C.length;D<y;D++)G=C[D],e(G,a),a+=G.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=l.length;e<g;e++)f=l[e],THREE.Shape.Utils.isClockWise(f)&&(l[e]=f.reverse());var m=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(g=l.length;e<g;e++)f=l[e],
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=l.length;e<g;e++)f=l[e],THREE.Shape.Utils.isClockWise(f)&&(l[e]=f.reverse());var m=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(g=l.length;e<g;e++)f=l[e],