瀏覽代碼

Updated builds.

Mr.doob 11 年之前
父節點
當前提交
88a104b6c4
共有 2 個文件被更改,包括 230 次插入202 次删除
  1. 28 0
      build/three.js
  2. 202 202
      build/three.min.js

+ 28 - 0
build/three.js

@@ -7096,6 +7096,34 @@ THREE.EventDispatcher.prototype = {
 
 			} );
 
+
+		} else if ( object instanceof THREE.PointCloud ) {
+
+			var vertices = object.geometry.vertices;
+
+			for ( var i = 0; i < vertices.length; i ++ ) {
+
+				var v = vertices[ i ];
+
+				matrixPosition.copy( v ).applyMatrix4( object.matrixWorld );
+
+				var distance = raycaster.ray.distanceToPoint( matrixPosition );
+
+				if ( distance < 1 ) { // needs a better test; particle size?
+
+					intersects.push( {
+
+						distance: distance,
+						index: i,
+						face: null,
+						object: object
+
+					} );
+
+				}
+
+			}
+
 		} else if ( object instanceof THREE.LOD ) {
 
 			matrixPosition.setFromMatrixPosition( object.matrixWorld );

+ 202 - 202
build/three.min.js

@@ -89,22 +89,22 @@ multiplyVector3Array:function(a){console.warn("DEPRECATED: Matrix3's .multiplyVe
 a;b[6]*=a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],k=a[7],a=a[8];return b*f*a-b*g*k-c*e*a+c*g*h+d*e*k-d*f*h},getInverse:function(a,b){var c=a.elements,d=this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-
 c[1]*c[4];c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");console.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];
 a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){var a=this.elements;return new THREE.Matrix3(a[0],
-a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8])}};THREE.Matrix4=function(a,b,c,d,e,f,g,h,k,l,p,q,r,t,s,n){var v=this.elements=new Float32Array(16);v[0]=void 0!==a?a:1;v[4]=b||0;v[8]=c||0;v[12]=d||0;v[1]=e||0;v[5]=void 0!==f?f:1;v[9]=g||0;v[13]=h||0;v[2]=k||0;v[6]=l||0;v[10]=void 0!==p?p:1;v[14]=q||0;v[3]=r||0;v[7]=t||0;v[11]=s||0;v[15]=void 0!==n?n:1};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,l,p,q,r,t,s,n){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=f;v[9]=g;v[13]=h;v[2]=k;v[6]=l;v[10]=p;v[14]=q;v[3]=r;v[7]=t;v[11]=s;v[15]=n;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("DEPRECATED: Matrix4's .extractPosition() has been renamed to .copyPosition().");
+a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8])}};THREE.Matrix4=function(a,b,c,d,e,f,g,h,k,l,p,q,r,s,t,n){var v=this.elements=new Float32Array(16);v[0]=void 0!==a?a:1;v[4]=b||0;v[8]=c||0;v[12]=d||0;v[1]=e||0;v[5]=void 0!==f?f:1;v[9]=g||0;v[13]=h||0;v[2]=k||0;v[6]=l||0;v[10]=void 0!==p?p:1;v[14]=q||0;v[3]=r||0;v[7]=s||0;v[11]=t||0;v[15]=void 0!==n?n:1};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,l,p,q,r,s,t,n){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=f;v[9]=g;v[13]=h;v[2]=k;v[6]=l;v[10]=p;v[14]=q;v[3]=r;v[7]=s;v[11]=t;v[15]=n;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("DEPRECATED: Matrix4's .extractPosition() has been renamed to .copyPosition().");
 return this.copyPosition(a)},copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractRotation:function(){var a=new THREE.Vector3;return function(b){var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),f=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){!1===
 a instanceof THREE.Euler&&console.error("ERROR: Matrix's .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.  Please update your code.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=f*h;var k=f*e,l=c*h,p=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+l*d;b[5]=a-p*d;b[9]=-c*g;b[2]=p-a*d;b[6]=l+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,l=d*h,p=d*e,b[0]=a+p*c,b[4]=l*c-k,b[8]=
 f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=p+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,l=d*h,p=d*e,b[0]=a-p*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=f*h,b[9]=p-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,l=c*h,p=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+p,b[1]=g*e,b[5]=p*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,l=c*g,p=c*d,b[0]=g*h,b[4]=p-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-p*e):"XZY"===a.order&&(a=f*g,k=f*d,l=c*g,p=c*d,b[0]=
 g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+p,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=p*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("DEPRECATED: Matrix4's .setRotationFromQuaternion() has been deprecated in favor of makeRotationFromQuaternion.  Please update your code.");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*
 h,c=c*k,p=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(p+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+p);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=
-a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Matrix4's .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],p=c[5],q=c[9],r=c[13],t=c[2],s=c[6],n=c[10],v=c[14],w=c[3],u=c[7],y=c[11],
-c=c[15],M=d[0],B=d[4],D=d[8],z=d[12],F=d[1],H=d[5],C=d[9],x=d[13],A=d[2],O=d[6],K=d[10],L=d[14],J=d[3],G=d[7],Q=d[11],d=d[15];e[0]=f*M+g*F+h*A+k*J;e[4]=f*B+g*H+h*O+k*G;e[8]=f*D+g*C+h*K+k*Q;e[12]=f*z+g*x+h*L+k*d;e[1]=l*M+p*F+q*A+r*J;e[5]=l*B+p*H+q*O+r*G;e[9]=l*D+p*C+q*K+r*Q;e[13]=l*z+p*x+q*L+r*d;e[2]=t*M+s*F+n*A+v*J;e[6]=t*B+s*H+n*O+v*G;e[10]=t*D+s*C+n*K+v*Q;e[14]=t*z+s*x+n*L+v*d;e[3]=w*M+u*F+y*A+c*J;e[7]=w*B+u*H+y*O+c*G;e[11]=w*D+u*C+y*K+c*Q;e[15]=w*z+u*x+y*L+c*d;return this},multiplyToArray:function(a,
+a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Matrix4's .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],p=c[5],q=c[9],r=c[13],s=c[2],t=c[6],n=c[10],v=c[14],w=c[3],u=c[7],x=c[11],
+c=c[15],F=d[0],C=d[4],D=d[8],z=d[12],G=d[1],I=d[5],B=d[9],y=d[13],A=d[2],O=d[6],L=d[10],M=d[14],K=d[3],H=d[7],Q=d[11],d=d[15];e[0]=f*F+g*G+h*A+k*K;e[4]=f*C+g*I+h*O+k*H;e[8]=f*D+g*B+h*L+k*Q;e[12]=f*z+g*y+h*M+k*d;e[1]=l*F+p*G+q*A+r*K;e[5]=l*C+p*I+q*O+r*H;e[9]=l*D+p*B+q*L+r*Q;e[13]=l*z+p*y+q*M+r*d;e[2]=s*F+t*G+n*A+v*K;e[6]=s*C+t*I+n*O+v*H;e[10]=s*D+t*B+n*L+v*Q;e[14]=s*z+t*y+n*M+v*d;e[3]=w*F+u*G+x*A+c*K;e[7]=w*C+u*I+x*O+c*H;e[11]=w*D+u*B+x*L+c*Q;e[15]=w*z+u*y+x*M+c*d;return this},multiplyToArray:function(a,
 b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
 return a.applyProjection(this)},multiplyVector4:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);
 void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("DEPRECATED: Matrix4's .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("DEPRECATED: Matrix4's .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=
 this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],l=a[2],p=a[6],q=a[10],r=a[14];return a[3]*(+e*h*p-d*k*p-e*g*q+c*k*q+d*g*r-c*h*r)+a[7]*(+b*h*r-b*k*q+e*f*q-d*f*r+d*k*l-e*h*l)+a[11]*(+b*k*p-b*g*r-e*f*p+c*f*r+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*p+b*g*q+d*f*p-c*f*q+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,
 b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=new THREE.Vector3;return function(){console.warn("DEPRECATED: Matrix4's .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=
-this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],p=d[9],q=d[13],r=d[2],t=d[6],s=d[10],n=d[14],v=d[3],w=d[7],u=d[11],d=d[15];c[0]=p*n*w-q*s*w+q*t*u-l*n*u-p*t*d+l*s*d;c[4]=h*s*w-g*n*w-h*t*u+f*n*u+g*t*d-f*s*d;c[8]=g*q*w-h*p*w+h*l*u-f*q*u-g*l*d+f*p*d;c[12]=h*p*t-g*q*t-h*l*s+f*q*s+g*l*n-f*p*n;c[1]=q*s*v-p*n*v-q*r*u+k*n*u+p*r*d-k*s*d;c[5]=g*n*v-h*s*v+h*r*u-e*n*u-g*r*d+e*s*d;c[9]=h*p*v-g*q*v-h*k*
-u+e*q*u+g*k*d-e*p*d;c[13]=g*q*r-h*p*r+h*k*s-e*q*s-g*k*n+e*p*n;c[2]=l*n*v-q*t*v+q*r*w-k*n*w-l*r*d+k*t*d;c[6]=h*t*v-f*n*v-h*r*w+e*n*w+f*r*d-e*t*d;c[10]=f*q*v-h*l*v+h*k*w-e*q*w-f*k*d+e*l*d;c[14]=h*l*r-f*q*r-h*k*t+e*q*t+f*k*n-e*l*n;c[3]=p*t*v-l*s*v-p*r*w+k*s*w+l*r*u-k*t*u;c[7]=f*s*v-g*t*v+g*r*w-e*s*w-f*r*u+e*t*u;c[11]=g*l*v-f*p*v-g*k*w+e*p*w+f*k*u-e*l*u;c[15]=f*p*r-g*l*r+g*k*t-e*p*t-f*k*s+e*l*s;c=e*c[0]+k*c[4]+r*c[8]+v*c[12];if(0==c){if(b)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");
+this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],p=d[9],q=d[13],r=d[2],s=d[6],t=d[10],n=d[14],v=d[3],w=d[7],u=d[11],d=d[15];c[0]=p*n*w-q*t*w+q*s*u-l*n*u-p*s*d+l*t*d;c[4]=h*t*w-g*n*w-h*s*u+f*n*u+g*s*d-f*t*d;c[8]=g*q*w-h*p*w+h*l*u-f*q*u-g*l*d+f*p*d;c[12]=h*p*s-g*q*s-h*l*t+f*q*t+g*l*n-f*p*n;c[1]=q*t*v-p*n*v-q*r*u+k*n*u+p*r*d-k*t*d;c[5]=g*n*v-h*t*v+h*r*u-e*n*u-g*r*d+e*t*d;c[9]=h*p*v-g*q*v-h*k*
+u+e*q*u+g*k*d-e*p*d;c[13]=g*q*r-h*p*r+h*k*t-e*q*t-g*k*n+e*p*n;c[2]=l*n*v-q*s*v+q*r*w-k*n*w-l*r*d+k*s*d;c[6]=h*s*v-f*n*v-h*r*w+e*n*w+f*r*d-e*s*d;c[10]=f*q*v-h*l*v+h*k*w-e*q*w-f*k*d+e*l*d;c[14]=h*l*r-f*q*r-h*k*s+e*q*s+f*k*n-e*l*n;c[3]=p*s*v-l*t*v-p*r*w+k*t*w+l*r*u-k*s*u;c[7]=f*t*v-g*s*v+g*r*w-e*t*w-f*r*u+e*s*u;c[11]=g*l*v-f*p*v-g*k*w+e*p*w+f*k*u-e*l*u;c[15]=f*p*r-g*l*r+g*k*s-e*p*s-f*k*t+e*l*t;c=e*c[0]+k*c[4]+r*c[8]+v*c[12];if(0==c){if(b)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");
 console.warn("Matrix4.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.warn("DEPRECATED: Matrix4's .translate() has been removed.")},rotateX:function(a){console.warn("DEPRECATED: Matrix4's .rotateX() has been removed.")},rotateY:function(a){console.warn("DEPRECATED: Matrix4's .rotateY() has been removed.")},rotateZ:function(a){console.warn("DEPRECATED: Matrix4's .rotateZ() has been removed.")},rotateByAxis:function(a,
 b){console.warn("DEPRECATED: Matrix4's .rotateByAxis() has been removed.")},scale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},
 makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,k=e*f,l=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*g+d*h,l*g+c,l*h-d*f,0,k*h-
@@ -123,8 +123,8 @@ clone:function(){return(new THREE.Ray).copy(this)}};THREE.Sphere=function(a,b){t
 THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;f<g;f++)e=Math.max(e,d.distanceToSquared(b[f]));this.radius=Math.sqrt(e);return this}}(),copy:function(a){this.center.copy(a.center);this.radius=a.radius;return this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=
 this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);
 return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};
-THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],p=c[8],q=c[9],r=c[10],t=c[11],s=c[12],n=c[13],v=c[14],c=c[15];b[0].setComponents(f-a,l-g,t-p,c-s).normalize();b[1].setComponents(f+
-a,l+g,t+p,c+s).normalize();b[2].setComponents(f+d,l+h,t+q,c+n).normalize();b[3].setComponents(f-d,l-h,t-q,c-n).normalize();b[4].setComponents(f-e,l-k,t-r,c-v).normalize();b[5].setComponents(f+e,l+k,t+r,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
+THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],p=c[8],q=c[9],r=c[10],s=c[11],t=c[12],n=c[13],v=c[14],c=c[15];b[0].setComponents(f-a,l-g,s-p,c-t).normalize();b[1].setComponents(f+
+a,l+g,s+p,c+t).normalize();b[2].setComponents(f+d,l+h,s+q,c+n).normalize();b[3].setComponents(f-d,l-h,s-q,c-n).normalize();b[4].setComponents(f-e,l-k,s-r,c-v).normalize();b[5].setComponents(f+e,l+k,s+r,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
 c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var g=f.distanceToPoint(a),f=f.distanceToPoint(b);if(0>g&&0>f)return!1}return!0}}(),
 containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
 THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,
@@ -145,15 +145,15 @@ clone:function(){return(new THREE.Triangle).copy(this)}};THREE.Clock=function(a)
 THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),
 a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){};
 THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&
-c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;e<d;e++)c[e]=b[e];for(e=0;e<d;e++)c[e].call(this,a)}}}};(function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c);this.near=d||0;this.far=e||Infinity};var b=new a.Sphere,c=new a.Ray;new a.Plane;new a.Vector3;var d=new a.Vector3,e=new a.Matrix4,f=function(a,b){return a.distance-b.distance},g=new a.Vector3,h=new a.Vector3,k=new a.Vector3,l=function(f,p,t){if(f instanceof a.Sprite){d.setFromMatrixPosition(f.matrixWorld);var s=p.ray.distanceToPoint(d);if(s>f.scale.x)return t;t.push({distance:s,point:f.position,face:null,object:f})}else if(f instanceof
-a.LOD)d.setFromMatrixPosition(f.matrixWorld),s=p.ray.origin.distanceTo(d),l(f.getObjectForDistance(s),p,t);else if(f instanceof a.Mesh){var n=f.geometry;null===n.boundingSphere&&n.computeBoundingSphere();b.copy(n.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===p.ray.isIntersectionSphere(b))return t;e.getInverse(f.matrixWorld);c.copy(p.ray).applyMatrix4(e);if(null!==n.boundingBox&&!1===c.isIntersectionBox(n.boundingBox))return t;if(n instanceof a.BufferGeometry){var v=f.material;if(void 0===
-v)return t;var w=n.attributes,u,y,M=p.precision;if(void 0!==w.index){var B=w.index.array,D=w.position.array,z=n.offsets;0===z.length&&(z=[{start:0,count:D.length,index:0}]);for(var F=0,H=z.length;F<H;++F)for(var w=z[F].start,C=z[F].index,n=w,x=w+z[F].count;n<x;n+=3){w=C+B[n];u=C+B[n+1];y=C+B[n+2];g.set(D[3*w],D[3*w+1],D[3*w+2]);h.set(D[3*u],D[3*u+1],D[3*u+2]);k.set(D[3*y],D[3*y+1],D[3*y+2]);var A=v.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,v.side!==a.DoubleSide);null!==
-A&&(A.applyMatrix4(f.matrixWorld),s=p.ray.origin.distanceTo(A),s<M||s<p.near||s>p.far||t.push({distance:s,point:A,indices:[w,u,y],face:null,faceIndex:null,object:f}))}}else for(D=w.position.array,n=0,x=w.position.array.length;n<x;n+=3)w=n,u=n+1,y=n+2,g.set(D[3*w],D[3*w+1],D[3*w+2]),h.set(D[3*u],D[3*u+1],D[3*u+2]),k.set(D[3*y],D[3*y+1],D[3*y+2]),A=v.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,v.side!==a.DoubleSide),null!==A&&(A.applyMatrix4(f.matrixWorld),s=p.ray.origin.distanceTo(A),
-s<M||s<p.near||s>p.far||t.push({distance:s,point:A,indices:[w,u,y],face:null,faceIndex:null,object:f}))}else if(n instanceof a.Geometry)for(D=f.material instanceof a.MeshFaceMaterial,z=!0===D?f.material.materials:null,M=p.precision,B=n.vertices,F=0,H=n.faces.length;F<H;F++)if(C=n.faces[F],v=!0===D?z[C.materialIndex]:f.material,void 0!==v){w=B[C.a];u=B[C.b];y=B[C.c];if(!0===v.morphTargets){s=n.morphTargets;A=f.morphTargetInfluences;g.set(0,0,0);h.set(0,0,0);k.set(0,0,0);for(var x=0,O=s.length;x<O;x++){var K=
-A[x];if(0!==K){var L=s[x].vertices;g.x+=(L[C.a].x-w.x)*K;g.y+=(L[C.a].y-w.y)*K;g.z+=(L[C.a].z-w.z)*K;h.x+=(L[C.b].x-u.x)*K;h.y+=(L[C.b].y-u.y)*K;h.z+=(L[C.b].z-u.z)*K;k.x+=(L[C.c].x-y.x)*K;k.y+=(L[C.c].y-y.y)*K;k.z+=(L[C.c].z-y.z)*K}}g.add(w);h.add(u);k.add(y);w=g;u=h;y=k}A=v.side===a.BackSide?c.intersectTriangle(y,u,w,!0):c.intersectTriangle(w,u,y,v.side!==a.DoubleSide);null!==A&&(A.applyMatrix4(f.matrixWorld),s=p.ray.origin.distanceTo(A),s<M||s<p.near||s>p.far||t.push({distance:s,point:A,face:C,
-faceIndex:F,object:f}))}}else if(f instanceof a.Line){M=p.linePrecision;v=M*M;n=f.geometry;null===n.boundingSphere&&n.computeBoundingSphere();b.copy(n.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===p.ray.isIntersectionSphere(b))return t;e.getInverse(f.matrixWorld);c.copy(p.ray).applyMatrix4(e);if(n instanceof a.Geometry)for(B=n.vertices,M=B.length,w=new a.Vector3,u=new a.Vector3,y=f.type===a.LineStrip?1:2,n=0;n<M-1;n+=y)c.distanceSqToSegment(B[n],B[n+1],u,w)>v||(s=c.origin.distanceTo(u),s<
-p.near||s>p.far||t.push({distance:s,point:w.clone().applyMatrix4(f.matrixWorld),face:null,faceIndex:null,object:f}))}},p=function(a,b,c){a=a.getDescendants();for(var d=0,e=a.length;d<e;d++)l(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b)};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===b&&p(a,this,c);l(a,this,c);c.sort(f);return c};a.Raycaster.prototype.intersectObjects=function(a,b){for(var c=
-[],d=0,e=a.length;d<e;d++)l(a[d],this,c),!0===b&&p(a[d],this,c);c.sort(f);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;var a=this;Object.defineProperties(this,{rotation:{enumerable:!0,value:(new THREE.Euler).onChange(function(){a.quaternion.setFromEuler(a.rotation,!1)})},quaternion:{enumerable:!0,value:(new THREE.Quaternion).onChange(function(){a.rotation.setFromQuaternion(a.quaternion,void 0,!1)})},scale:{enumerable:!0,
+c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;e<d;e++)c[e]=b[e];for(e=0;e<d;e++)c[e].call(this,a)}}}};(function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c);this.near=d||0;this.far=e||Infinity};var b=new a.Sphere,c=new a.Ray;new a.Plane;new a.Vector3;var d=new a.Vector3,e=new a.Matrix4,f=function(a,b){return a.distance-b.distance},g=new a.Vector3,h=new a.Vector3,k=new a.Vector3,l=function(f,p,s){if(f instanceof a.Sprite){d.setFromMatrixPosition(f.matrixWorld);var t=p.ray.distanceToPoint(d);if(t>f.scale.x)return s;s.push({distance:t,point:f.position,face:null,object:f})}else if(f instanceof
+a.PointCloud)for(var n=f.geometry.vertices,v=0;v<n.length;v++)d.copy(n[v]).applyMatrix4(f.matrixWorld),t=p.ray.distanceToPoint(d),1>t&&s.push({distance:t,index:v,face:null,object:f});else if(f instanceof a.LOD)d.setFromMatrixPosition(f.matrixWorld),t=p.ray.origin.distanceTo(d),l(f.getObjectForDistance(t),p,s);else if(f instanceof a.Mesh){v=f.geometry;null===v.boundingSphere&&v.computeBoundingSphere();b.copy(v.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===p.ray.isIntersectionSphere(b))return s;
+e.getInverse(f.matrixWorld);c.copy(p.ray).applyMatrix4(e);if(null!==v.boundingBox&&!1===c.isIntersectionBox(v.boundingBox))return s;if(v instanceof a.BufferGeometry){var w=f.material;if(void 0===w)return s;var u=v.attributes,x,F,C=p.precision;if(void 0!==u.index){var n=u.index.array,D=u.position.array,z=v.offsets;0===z.length&&(z=[{start:0,count:D.length,index:0}]);for(var G=0,I=z.length;G<I;++G){u=z[G].start;x=z[G].count;for(var B=z[G].index,v=u,y=u+x;v<y;v+=3){u=B+n[v];x=B+n[v+1];F=B+n[v+2];g.set(D[3*
+u],D[3*u+1],D[3*u+2]);h.set(D[3*x],D[3*x+1],D[3*x+2]);k.set(D[3*F],D[3*F+1],D[3*F+2]);var A=w.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,w.side!==a.DoubleSide);null!==A&&(A.applyMatrix4(f.matrixWorld),t=p.ray.origin.distanceTo(A),t<C||t<p.near||t>p.far||s.push({distance:t,point:A,indices:[u,x,F],face:null,faceIndex:null,object:f}))}}}else for(D=u.position.array,v=0,y=u.position.array.length;v<y;v+=3)u=v,x=v+1,F=v+2,g.set(D[3*u],D[3*u+1],D[3*u+2]),h.set(D[3*x],D[3*x+
+1],D[3*x+2]),k.set(D[3*F],D[3*F+1],D[3*F+2]),A=w.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,w.side!==a.DoubleSide),null!==A&&(A.applyMatrix4(f.matrixWorld),t=p.ray.origin.distanceTo(A),t<C||t<p.near||t>p.far||s.push({distance:t,point:A,indices:[u,x,F],face:null,faceIndex:null,object:f}))}else if(v instanceof a.Geometry)for(D=f.material instanceof a.MeshFaceMaterial,z=!0===D?f.material.materials:null,C=p.precision,n=v.vertices,G=0,I=v.faces.length;G<I;G++)if(B=v.faces[G],
+w=!0===D?z[B.materialIndex]:f.material,void 0!==w){u=n[B.a];x=n[B.b];F=n[B.c];if(!0===w.morphTargets){t=v.morphTargets;A=f.morphTargetInfluences;g.set(0,0,0);h.set(0,0,0);k.set(0,0,0);for(var y=0,O=t.length;y<O;y++){var L=A[y];if(0!==L){var M=t[y].vertices;g.x+=(M[B.a].x-u.x)*L;g.y+=(M[B.a].y-u.y)*L;g.z+=(M[B.a].z-u.z)*L;h.x+=(M[B.b].x-x.x)*L;h.y+=(M[B.b].y-x.y)*L;h.z+=(M[B.b].z-x.z)*L;k.x+=(M[B.c].x-F.x)*L;k.y+=(M[B.c].y-F.y)*L;k.z+=(M[B.c].z-F.z)*L}}g.add(u);h.add(x);k.add(F);u=g;x=h;F=k}A=w.side===
+a.BackSide?c.intersectTriangle(F,x,u,!0):c.intersectTriangle(u,x,F,w.side!==a.DoubleSide);null!==A&&(A.applyMatrix4(f.matrixWorld),t=p.ray.origin.distanceTo(A),t<C||t<p.near||t>p.far||s.push({distance:t,point:A,face:B,faceIndex:G,object:f}))}}else if(f instanceof a.Line){C=p.linePrecision;w=C*C;v=f.geometry;null===v.boundingSphere&&v.computeBoundingSphere();b.copy(v.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===p.ray.isIntersectionSphere(b))return s;e.getInverse(f.matrixWorld);c.copy(p.ray).applyMatrix4(e);
+if(v instanceof a.Geometry)for(n=v.vertices,C=n.length,u=new a.Vector3,x=new a.Vector3,F=f.type===a.LineStrip?1:2,v=0;v<C-1;v+=F)c.distanceSqToSegment(n[v],n[v+1],x,u)>w||(t=c.origin.distanceTo(x),t<p.near||t>p.far||s.push({distance:t,point:u.clone().applyMatrix4(f.matrixWorld),face:null,faceIndex:null,object:f}))}},p=function(a,b,c){a=a.getDescendants();for(var d=0,e=a.length;d<e;d++)l(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=
+function(a,b){this.ray.set(a,b)};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===b&&p(a,this,c);l(a,this,c);c.sort(f);return c};a.Raycaster.prototype.intersectObjects=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)l(a[d],this,c),!0===b&&p(a[d],this,c);c.sort(f);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;var a=this;Object.defineProperties(this,{rotation:{enumerable:!0,value:(new THREE.Euler).onChange(function(){a.quaternion.setFromEuler(a.rotation,!1)})},quaternion:{enumerable:!0,value:(new THREE.Quaternion).onChange(function(){a.rotation.setFromQuaternion(a.quaternion,void 0,!1)})},scale:{enumerable:!0,
 value:new THREE.Vector3(1,1,1)}});this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};
 THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){console.warn("DEPRECATED: Object3D's .eulerOrder has been moved to Object3D's .rotation.order.");return this.rotation.order},set eulerOrder(a){console.warn("DEPRECATED: Object3D's .eulerOrder has been moved to Object3D's .rotation.order.");this.rotation.order=a},get useQuaternion(){console.warn("DEPRECATED: Object3D's .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){console.warn("DEPRECATED: Object3D's .useQuaternion has been removed. The library now uses quaternions by default.")},
 applyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix);this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},setRotationFromQuaternion:function(a){this.quaternion.copy(a)},rotateOnAxis:function(){var a=new THREE.Quaternion;return function(b,c){a.setFromAxisAngle(b,
@@ -164,23 +164,23 @@ a.parent.remove(a);a.parent=this;a.dispatchEvent({type:"added"});this.children.p
 getObjectById:function(a,b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];if(e.id===a||!0===b&&(e=e.getObjectById(a,b),void 0!==e))return e}},getObjectByName:function(a,b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];if(e.name===a||!0===b&&(e=e.getObjectByName(a,b),void 0!==e))return e}},getChildByName:function(a,b){console.warn("DEPRECATED: Object3D's .getChildByName() has been renamed to .getObjectByName().");return this.getObjectByName(a,b)},getDescendants:function(a){void 0===
 a&&(a=[]);Array.prototype.push.apply(a,this.children);for(var b=0,c=this.children.length;b<c;b++)this.children[b].getDescendants(a);return a},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),
 this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=
-this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(p===r){var a=new THREE.RenderableVertex;q.push(a);r++;p++;return a}return q[p++]}function b(){if(s===v){var a=new THREE.RenderableFace;n.push(a);v++;s++;return a}return n[s++]}function c(){if(u===M){var a=new THREE.RenderableLine;y.push(a);M++;u++;return a}return y[u++]}function d(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function e(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&
-0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var f,g,h=[],k=0,l,p,q=[],r=0,t,s,n=[],v=0,w,u,y=[],M=0,B,D,z=[],F=0,H={objects:[],lights:[],elements:[]},C=new THREE.Vector3,x=new THREE.Vector3,A=new THREE.Vector3,O=new THREE.Vector3,K=new THREE.Vector4,L=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),J=new THREE.Box3,G=Array(3),Q=new THREE.Matrix4,Y=
+this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(p===r){var a=new THREE.RenderableVertex;q.push(a);r++;p++;return a}return q[p++]}function b(){if(t===v){var a=new THREE.RenderableFace;n.push(a);v++;t++;return a}return n[t++]}function c(){if(u===F){var a=new THREE.RenderableLine;x.push(a);F++;u++;return a}return x[u++]}function d(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function e(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&
+0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var f,g,h=[],k=0,l,p,q=[],r=0,s,t,n=[],v=0,w,u,x=[],F=0,C,D,z=[],G=0,I={objects:[],lights:[],elements:[]},B=new THREE.Vector3,y=new THREE.Vector3,A=new THREE.Vector3,O=new THREE.Vector3,L=new THREE.Vector4,M=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),K=new THREE.Box3,H=Array(3),Q=new THREE.Matrix4,Y=
 new THREE.Matrix4,U,la=new THREE.Matrix4,W=new THREE.Matrix3,R=new THREE.Frustum,E=new THREE.Vector4,da=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);Y.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(Y)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);Y.multiplyMatrices(c.matrixWorld,a);return b.applyProjection(Y)}}();this.pickingRay=function(a,b){a.z=
--1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var V=function(a){if(!1!==a.visible){if(a instanceof THREE.Light)H.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===R.intersectsObject(a)){if(g===k){var b=new THREE.RenderableObject;h.push(b);k++;g++;f=b}else f=h[g++];f.id=a.id;f.object=a;null!==a.renderDepth?f.z=a.renderDepth:
-(O.setFromMatrixPosition(a.matrixWorld),O.applyProjection(Y),f.z=O.z);H.objects.push(f)}for(var b=0,c=a.children.length;b<c;b++)V(a.children[b])}},X=new function(){var d=[],e=[],f=null,g=null,h=new THREE.Matrix3,k=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(U);c.copy(b).applyMatrix4(Y);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},p=function(a,b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;G[0]=a.positionScreen;
-G[1]=b.positionScreen;G[2]=c.positionScreen;return L.isIntersectionBox(J.setFromPoints(G))},n=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:p,checkBackfaceCulling:n,pushVertex:function(b,c,d){l=a();l.position.set(b,c,d);
-k(l)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=q[a],e=q[b];w=c();w.id=f.id;w.v1.copy(d);w.v2.copy(e);w.z=(d.positionScreen.z+e.positionScreen.z)/2;w.material=f.material;H.elements.push(w)},pushTriangle:function(a,c,k){var l=q[a],r=q[c],s=q[k];if(!1!==p(l,r,s)&&(g.side===THREE.DoubleSide||!0===n(l,r,s))){t=b();t.id=f.id;t.v1.copy(l);t.v2.copy(r);t.v3.copy(s);t.z=(l.positionScreen.z+r.positionScreen.z+s.positionScreen.z)/3;for(l=0;3>l;l++)r=
-3*arguments[l],s=t.vertexNormalsModel[l],s.set(d[r],d[r+1],d[r+2]),s.applyMatrix3(h).normalize(),r=2*arguments[l],t.uvs[l].set(e[r],e[r+1]);t.vertexNormalsLength=3;t.material=f.material;H.elements.push(t)}}}};this.projectScene=function(f,h,k,l){var r,n,v,y,M,J,G,L;D=u=s=0;H.elements.length=0;!0===f.autoUpdate&&f.updateMatrixWorld();void 0===h.parent&&h.updateMatrixWorld();Q.copy(h.matrixWorldInverse.getInverse(h.matrixWorld));Y.multiplyMatrices(h.projectionMatrix,Q);R.setFromMatrix(Y);g=0;H.objects.length=
-0;H.lights.length=0;V(f);!0===k&&H.objects.sort(d);f=0;for(k=H.objects.length;f<k;f++)if(r=H.objects[f].object,n=r.geometry,X.setObject(r),U=r.matrixWorld,p=0,r instanceof THREE.Mesh)if(n instanceof THREE.BufferGeometry){if(J=n.attributes,r=n.offsets,void 0!==J.position){G=J.position.array;n=0;for(y=G.length;n<y;n+=3)X.pushVertex(G[n],G[n+1],G[n+2]);if(void 0!==J.normal)for(L=J.normal.array,n=0,y=L.length;n<y;n+=3)X.pushNormal(L[n],L[n+1],L[n+2]);if(void 0!==J.uv)for(L=J.uv.array,n=0,y=L.length;n<
-y;n+=2)X.pushUv(L[n],L[n+1]);if(void 0!==J.index)if(J=J.index.array,0<r.length)for(f=0;f<r.length;f++)for(y=r[f],G=y.index,n=y.start,y=y.start+y.count;n<y;n+=3)X.pushTriangle(J[n]+G,J[n+1]+G,J[n+2]+G);else for(n=0,y=J.length;n<y;n+=3)X.pushTriangle(J[n],J[n+1],J[n+2]);else for(n=0,y=G.length/3;n<y;n+=3)X.pushTriangle(n,n+1,n+2)}}else{if(n instanceof THREE.Geometry){v=n.vertices;y=n.faces;J=n.faceVertexUvs[0];W.getNormalMatrix(U);G=r.material instanceof THREE.MeshFaceMaterial;L=!0===G?r.material:null;
-for(var O=0,Fa=v.length;O<Fa;O++){var ia=v[O];X.pushVertex(ia.x,ia.y,ia.z)}O=0;for(Fa=y.length;O<Fa;O++){v=y[O];var ma=!0===G?L.materials[v.materialIndex]:r.material;if(void 0!==ma){var ya=ma.side,ia=q[v.a],Z=q[v.b],qa=q[v.c];if(!0===ma.morphTargets){M=n.morphTargets;var ua=r.morphTargetInfluences,Ca=ia.position,va=Z.position,Da=qa.position;C.set(0,0,0);x.set(0,0,0);A.set(0,0,0);for(var Ja=0,ja=M.length;Ja<ja;Ja++){var ra=ua[Ja];if(0!==ra){var Ka=M[Ja].vertices;C.x+=(Ka[v.a].x-Ca.x)*ra;C.y+=(Ka[v.a].y-
-Ca.y)*ra;C.z+=(Ka[v.a].z-Ca.z)*ra;x.x+=(Ka[v.b].x-va.x)*ra;x.y+=(Ka[v.b].y-va.y)*ra;x.z+=(Ka[v.b].z-va.z)*ra;A.x+=(Ka[v.c].x-Da.x)*ra;A.y+=(Ka[v.c].y-Da.y)*ra;A.z+=(Ka[v.c].z-Da.z)*ra}}ia.position.add(C);Z.position.add(x);qa.position.add(A);X.projectVertex(ia);X.projectVertex(Z);X.projectVertex(qa)}if(!1!==X.checkTriangleVisibility(ia,Z,qa)){ua=X.checkBackfaceCulling(ia,Z,qa);if(ya!==THREE.DoubleSide){if(ya===THREE.FrontSide&&!1===ua)continue;if(ya===THREE.BackSide&&!0===ua)continue}t=b();t.id=r.id;
-t.v1.copy(ia);t.v2.copy(Z);t.v3.copy(qa);t.normalModel.copy(v.normal);!1!==ua||ya!==THREE.BackSide&&ya!==THREE.DoubleSide||t.normalModel.negate();t.normalModel.applyMatrix3(W).normalize();M=v.vertexNormals;Ca=0;for(va=Math.min(M.length,3);Ca<va;Ca++)Da=t.vertexNormalsModel[Ca],Da.copy(M[Ca]),!1!==ua||ya!==THREE.BackSide&&ya!==THREE.DoubleSide||Da.negate(),Da.applyMatrix3(W).normalize();t.vertexNormalsLength=M.length;ya=J[O];if(void 0!==ya)for(M=0;3>M;M++)t.uvs[M].copy(ya[M]);t.color=v.color;t.material=
-ma;t.z=(ia.positionScreen.z+Z.positionScreen.z+qa.positionScreen.z)/3;H.elements.push(t)}}}}}else if(r instanceof THREE.Line)if(n instanceof THREE.BufferGeometry){if(J=n.attributes,void 0!==J.position){G=J.position.array;n=0;for(y=G.length;n<y;n+=3)X.pushVertex(G[n],G[n+1],G[n+2]);if(void 0!==J.index)for(J=J.index.array,n=0,y=J.length;n<y;n+=2)X.pushLine(J[n],J[n+1]);else for(n=0,y=G.length/3-1;n<y;n++)X.pushLine(n,n+1)}}else{if(n instanceof THREE.Geometry&&(la.multiplyMatrices(Y,U),v=r.geometry.vertices,
+-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var V=function(a){if(!1!==a.visible){if(a instanceof THREE.Light)I.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===R.intersectsObject(a)){if(g===k){var b=new THREE.RenderableObject;h.push(b);k++;g++;f=b}else f=h[g++];f.id=a.id;f.object=a;null!==a.renderDepth?f.z=a.renderDepth:
+(O.setFromMatrixPosition(a.matrixWorld),O.applyProjection(Y),f.z=O.z);I.objects.push(f)}for(var b=0,c=a.children.length;b<c;b++)V(a.children[b])}},X=new function(){var d=[],e=[],f=null,g=null,h=new THREE.Matrix3,k=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(U);c.copy(b).applyMatrix4(Y);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},p=function(a,b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;H[0]=a.positionScreen;
+H[1]=b.positionScreen;H[2]=c.positionScreen;return M.isIntersectionBox(K.setFromPoints(H))},r=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:p,checkBackfaceCulling:r,pushVertex:function(b,c,d){l=a();l.position.set(b,c,d);
+k(l)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=q[a],e=q[b];w=c();w.id=f.id;w.v1.copy(d);w.v2.copy(e);w.z=(d.positionScreen.z+e.positionScreen.z)/2;w.material=f.material;I.elements.push(w)},pushTriangle:function(a,c,k){var l=q[a],n=q[c],t=q[k];if(!1!==p(l,n,t)&&(g.side===THREE.DoubleSide||!0===r(l,n,t))){s=b();s.id=f.id;s.v1.copy(l);s.v2.copy(n);s.v3.copy(t);s.z=(l.positionScreen.z+n.positionScreen.z+t.positionScreen.z)/3;for(l=0;3>l;l++)n=
+3*arguments[l],t=s.vertexNormalsModel[l],t.set(d[n],d[n+1],d[n+2]),t.applyMatrix3(h).normalize(),n=2*arguments[l],s.uvs[l].set(e[n],e[n+1]);s.vertexNormalsLength=3;s.material=f.material;I.elements.push(s)}}}};this.projectScene=function(f,h,k,l){var r,n,v,x,F,K,H,M;D=u=t=0;I.elements.length=0;!0===f.autoUpdate&&f.updateMatrixWorld();void 0===h.parent&&h.updateMatrixWorld();Q.copy(h.matrixWorldInverse.getInverse(h.matrixWorld));Y.multiplyMatrices(h.projectionMatrix,Q);R.setFromMatrix(Y);g=0;I.objects.length=
+0;I.lights.length=0;V(f);!0===k&&I.objects.sort(d);f=0;for(k=I.objects.length;f<k;f++)if(r=I.objects[f].object,n=r.geometry,X.setObject(r),U=r.matrixWorld,p=0,r instanceof THREE.Mesh)if(n instanceof THREE.BufferGeometry){if(K=n.attributes,r=n.offsets,void 0!==K.position){H=K.position.array;n=0;for(x=H.length;n<x;n+=3)X.pushVertex(H[n],H[n+1],H[n+2]);if(void 0!==K.normal)for(M=K.normal.array,n=0,x=M.length;n<x;n+=3)X.pushNormal(M[n],M[n+1],M[n+2]);if(void 0!==K.uv)for(M=K.uv.array,n=0,x=M.length;n<
+x;n+=2)X.pushUv(M[n],M[n+1]);if(void 0!==K.index)if(K=K.index.array,0<r.length)for(f=0;f<r.length;f++)for(x=r[f],H=x.index,n=x.start,x=x.start+x.count;n<x;n+=3)X.pushTriangle(K[n]+H,K[n+1]+H,K[n+2]+H);else for(n=0,x=K.length;n<x;n+=3)X.pushTriangle(K[n],K[n+1],K[n+2]);else for(n=0,x=H.length/3;n<x;n+=3)X.pushTriangle(n,n+1,n+2)}}else{if(n instanceof THREE.Geometry){v=n.vertices;x=n.faces;K=n.faceVertexUvs[0];W.getNormalMatrix(U);H=r.material instanceof THREE.MeshFaceMaterial;M=!0===H?r.material:null;
+for(var O=0,Fa=v.length;O<Fa;O++){var ia=v[O];X.pushVertex(ia.x,ia.y,ia.z)}O=0;for(Fa=x.length;O<Fa;O++){v=x[O];var ma=!0===H?M.materials[v.materialIndex]:r.material;if(void 0!==ma){var ya=ma.side,ia=q[v.a],Z=q[v.b],qa=q[v.c];if(!0===ma.morphTargets){F=n.morphTargets;var ua=r.morphTargetInfluences,Ca=ia.position,va=Z.position,Da=qa.position;B.set(0,0,0);y.set(0,0,0);A.set(0,0,0);for(var Ja=0,ja=F.length;Ja<ja;Ja++){var ra=ua[Ja];if(0!==ra){var Ka=F[Ja].vertices;B.x+=(Ka[v.a].x-Ca.x)*ra;B.y+=(Ka[v.a].y-
+Ca.y)*ra;B.z+=(Ka[v.a].z-Ca.z)*ra;y.x+=(Ka[v.b].x-va.x)*ra;y.y+=(Ka[v.b].y-va.y)*ra;y.z+=(Ka[v.b].z-va.z)*ra;A.x+=(Ka[v.c].x-Da.x)*ra;A.y+=(Ka[v.c].y-Da.y)*ra;A.z+=(Ka[v.c].z-Da.z)*ra}}ia.position.add(B);Z.position.add(y);qa.position.add(A);X.projectVertex(ia);X.projectVertex(Z);X.projectVertex(qa)}if(!1!==X.checkTriangleVisibility(ia,Z,qa)){ua=X.checkBackfaceCulling(ia,Z,qa);if(ya!==THREE.DoubleSide){if(ya===THREE.FrontSide&&!1===ua)continue;if(ya===THREE.BackSide&&!0===ua)continue}s=b();s.id=r.id;
+s.v1.copy(ia);s.v2.copy(Z);s.v3.copy(qa);s.normalModel.copy(v.normal);!1!==ua||ya!==THREE.BackSide&&ya!==THREE.DoubleSide||s.normalModel.negate();s.normalModel.applyMatrix3(W).normalize();F=v.vertexNormals;Ca=0;for(va=Math.min(F.length,3);Ca<va;Ca++)Da=s.vertexNormalsModel[Ca],Da.copy(F[Ca]),!1!==ua||ya!==THREE.BackSide&&ya!==THREE.DoubleSide||Da.negate(),Da.applyMatrix3(W).normalize();s.vertexNormalsLength=F.length;ya=K[O];if(void 0!==ya)for(F=0;3>F;F++)s.uvs[F].copy(ya[F]);s.color=v.color;s.material=
+ma;s.z=(ia.positionScreen.z+Z.positionScreen.z+qa.positionScreen.z)/3;I.elements.push(s)}}}}}else if(r instanceof THREE.Line)if(n instanceof THREE.BufferGeometry){if(K=n.attributes,void 0!==K.position){H=K.position.array;n=0;for(x=H.length;n<x;n+=3)X.pushVertex(H[n],H[n+1],H[n+2]);if(void 0!==K.index)for(K=K.index.array,n=0,x=K.length;n<x;n+=2)X.pushLine(K[n],K[n+1]);else for(n=0,x=H.length/3-1;n<x;n++)X.pushLine(n,n+1)}}else{if(n instanceof THREE.Geometry&&(la.multiplyMatrices(Y,U),v=r.geometry.vertices,
 0!==v.length))for(ia=a(),ia.positionScreen.copy(v[0]).applyMatrix4(la),n=r.type===THREE.LinePieces?2:1,O=1,Fa=v.length;O<Fa;O++)ia=a(),ia.positionScreen.copy(v[O]).applyMatrix4(la),0<(O+1)%n||(Z=q[p-2],E.copy(ia.positionScreen),da.copy(Z.positionScreen),!0===e(E,da)&&(E.multiplyScalar(1/E.w),da.multiplyScalar(1/da.w),w=c(),w.id=r.id,w.v1.positionScreen.copy(E),w.v2.positionScreen.copy(da),w.z=Math.max(E.z,da.z),w.material=r.material,r.material.vertexColors===THREE.VertexColors&&(w.vertexColors[0].copy(r.geometry.colors[O]),
-w.vertexColors[1].copy(r.geometry.colors[O-1])),H.elements.push(w)))}else r instanceof THREE.Sprite&&(K.set(U.elements[12],U.elements[13],U.elements[14],1),K.applyMatrix4(Y),n=1/K.w,K.z*=n,-1<=K.z&&1>=K.z&&(D===F?(y=new THREE.RenderableSprite,z.push(y),F++,D++,B=y):B=z[D++],B.id=r.id,B.x=K.x*n,B.y=K.y*n,B.z=K.z,B.object=r,B.rotation=r.rotation,B.scale.x=r.scale.x*Math.abs(B.x-(K.x+h.projectionMatrix.elements[0])/(K.w+h.projectionMatrix.elements[12])),B.scale.y=r.scale.y*Math.abs(B.y-(K.y+h.projectionMatrix.elements[5])/
-(K.w+h.projectionMatrix.elements[13])),B.material=r.material,H.elements.push(B)));!0===l&&H.elements.sort(d);return H}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0};
+w.vertexColors[1].copy(r.geometry.colors[O-1])),I.elements.push(w)))}else r instanceof THREE.Sprite&&(L.set(U.elements[12],U.elements[13],U.elements[14],1),L.applyMatrix4(Y),n=1/L.w,L.z*=n,-1<=L.z&&1>=L.z&&(D===G?(x=new THREE.RenderableSprite,z.push(x),G++,D++,C=x):C=z[D++],C.id=r.id,C.x=L.x*n,C.y=L.y*n,C.z=L.z,C.object=r,C.rotation=r.rotation,C.scale.x=r.scale.x*Math.abs(C.x-(L.x+h.projectionMatrix.elements[0])/(L.w+h.projectionMatrix.elements[12])),C.scale.y=r.scale.y*Math.abs(C.y-(L.y+h.projectionMatrix.elements[5])/
+(L.w+h.projectionMatrix.elements[13])),C.material=r.material,I.elements.push(C)));!0===l&&I.elements.sort(d);return I}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0};
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}};THREE.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,g)};THREE.BufferAttribute=function(){};
 THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},set:function(a){this.array.set(a);return this},setX:function(a,b){this.array[a*this.itemSize]=b;return this},setY:function(a,b){this.array[a*this.itemSize+1]=b;return this},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a]=b;this.array[a+1]=
 c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e;return this}};THREE.Int8Attribute=function(a,b){this.array=new Int8Array(a);this.itemSize=b};THREE.Int8Attribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.Uint8Attribute=function(a,b){this.array=new Uint8Array(a);this.itemSize=b};THREE.Uint8Attribute.prototype=Object.create(THREE.BufferAttribute.prototype);
@@ -191,14 +191,14 @@ THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:fu
 b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0)},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var a=this.attributes.position.array;if(a){var b=this.boundingBox;3<=a.length&&(b.min.x=b.max.x=a[0],b.min.y=b.max.y=a[1],b.min.z=b.max.z=a[2]);for(var c=3,d=a.length;c<d;c+=3){var e=a[c],f=a[c+1],g=a[c+2];e<b.min.x?b.min.x=e:e>b.max.x&&(b.max.x=e);f<b.min.y?b.min.y=f:
 f>b.max.y&&(b.max.y=f);g<b.min.z?b.min.z=g:g>b.max.z&&(b.max.z=g)}}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error("THREE.BufferGeometry.computeBoundingBox()",'Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')},computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===
 this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.addPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error("THREE.BufferGeometry.computeBoundingSphere()",'Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),
-computeFaceNormals:function(){},computeVertexNormals:function(){if(this.attributes.position){var a,b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else for(a=0,b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0;var e=this.attributes.position.array,f=this.attributes.normal.array,g,h,k,l,p,q,r=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,n=new THREE.Vector3,v=new THREE.Vector3;
-if(this.attributes.index){var w=this.attributes.index.array,u=0<this.offsets.length?this.offsets:[{start:0,count:w.length,index:0}];c=0;for(d=u.length;c<d;++c){b=u[c].start;g=u[c].count;var y=u[c].index;a=b;for(b+=g;a<b;a+=3)g=y+w[a],h=y+w[a+1],k=y+w[a+2],l=e[3*g],p=e[3*g+1],q=e[3*g+2],r.set(l,p,q),l=e[3*h],p=e[3*h+1],q=e[3*h+2],t.set(l,p,q),l=e[3*k],p=e[3*k+1],q=e[3*k+2],s.set(l,p,q),n.subVectors(s,t),v.subVectors(r,t),n.cross(v),f[3*g]+=n.x,f[3*g+1]+=n.y,f[3*g+2]+=n.z,f[3*h]+=n.x,f[3*h+1]+=n.y,
-f[3*h+2]+=n.z,f[3*k]+=n.x,f[3*k+1]+=n.y,f[3*k+2]+=n.z}}else for(a=0,b=e.length;a<b;a+=9)l=e[a],p=e[a+1],q=e[a+2],r.set(l,p,q),l=e[a+3],p=e[a+4],q=e[a+5],t.set(l,p,q),l=e[a+6],p=e[a+7],q=e[a+8],s.set(l,p,q),n.subVectors(s,t),v.subVectors(r,t),n.cross(v),f[a]=n.x,f[a+1]=n.y,f[a+2]=n.z,f[a+3]=n.x,f[a+4]=n.y,f[a+5]=n.z,f[a+6]=n.x,f[a+7]=n.y,f[a+8]=n.z;this.normalizeNormals();this.normalsNeedUpdate=!0}},computeTangents:function(){function a(a,b,c){q=d[3*a];r=d[3*a+1];t=d[3*a+2];s=d[3*b];n=d[3*b+1];v=d[3*
-b+2];w=d[3*c];u=d[3*c+1];y=d[3*c+2];M=f[2*a];B=f[2*a+1];D=f[2*b];z=f[2*b+1];F=f[2*c];H=f[2*c+1];C=s-q;x=w-q;A=n-r;O=u-r;K=v-t;L=y-t;J=D-M;G=F-M;Q=z-B;Y=H-B;U=1/(J*Y-G*Q);la.set((Y*C-Q*x)*U,(Y*A-Q*O)*U,(Y*K-Q*L)*U);W.set((J*x-G*C)*U,(J*O-G*A)*U,(J*L-G*K)*U);k[a].add(la);k[b].add(la);k[c].add(la);l[a].add(W);l[b].add(W);l[c].add(W)}function b(a){fa.x=e[3*a];fa.y=e[3*a+1];fa.z=e[3*a+2];za.copy(fa);Ea=k[a];wa.copy(Ea);wa.sub(fa.multiplyScalar(fa.dot(Ea))).normalize();Ha.crossVectors(za,Ea);Ga=Ha.dot(l[a]);
+computeFaceNormals:function(){},computeVertexNormals:function(){if(this.attributes.position){var a,b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else for(a=0,b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0;var e=this.attributes.position.array,f=this.attributes.normal.array,g,h,k,l,p,q,r=new THREE.Vector3,s=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3,v=new THREE.Vector3;
+if(this.attributes.index){var w=this.attributes.index.array,u=0<this.offsets.length?this.offsets:[{start:0,count:w.length,index:0}];c=0;for(d=u.length;c<d;++c){b=u[c].start;g=u[c].count;var x=u[c].index;a=b;for(b+=g;a<b;a+=3)g=x+w[a],h=x+w[a+1],k=x+w[a+2],l=e[3*g],p=e[3*g+1],q=e[3*g+2],r.set(l,p,q),l=e[3*h],p=e[3*h+1],q=e[3*h+2],s.set(l,p,q),l=e[3*k],p=e[3*k+1],q=e[3*k+2],t.set(l,p,q),n.subVectors(t,s),v.subVectors(r,s),n.cross(v),f[3*g]+=n.x,f[3*g+1]+=n.y,f[3*g+2]+=n.z,f[3*h]+=n.x,f[3*h+1]+=n.y,
+f[3*h+2]+=n.z,f[3*k]+=n.x,f[3*k+1]+=n.y,f[3*k+2]+=n.z}}else for(a=0,b=e.length;a<b;a+=9)l=e[a],p=e[a+1],q=e[a+2],r.set(l,p,q),l=e[a+3],p=e[a+4],q=e[a+5],s.set(l,p,q),l=e[a+6],p=e[a+7],q=e[a+8],t.set(l,p,q),n.subVectors(t,s),v.subVectors(r,s),n.cross(v),f[a]=n.x,f[a+1]=n.y,f[a+2]=n.z,f[a+3]=n.x,f[a+4]=n.y,f[a+5]=n.z,f[a+6]=n.x,f[a+7]=n.y,f[a+8]=n.z;this.normalizeNormals();this.normalsNeedUpdate=!0}},computeTangents:function(){function a(a,b,c){q=d[3*a];r=d[3*a+1];s=d[3*a+2];t=d[3*b];n=d[3*b+1];v=d[3*
+b+2];w=d[3*c];u=d[3*c+1];x=d[3*c+2];F=f[2*a];C=f[2*a+1];D=f[2*b];z=f[2*b+1];G=f[2*c];I=f[2*c+1];B=t-q;y=w-q;A=n-r;O=u-r;L=v-s;M=x-s;K=D-F;H=G-F;Q=z-C;Y=I-C;U=1/(K*Y-H*Q);la.set((Y*B-Q*y)*U,(Y*A-Q*O)*U,(Y*L-Q*M)*U);W.set((K*y-H*B)*U,(K*O-H*A)*U,(K*M-H*L)*U);k[a].add(la);k[b].add(la);k[c].add(la);l[a].add(W);l[b].add(W);l[c].add(W)}function b(a){fa.x=e[3*a];fa.y=e[3*a+1];fa.z=e[3*a+2];za.copy(fa);Ea=k[a];wa.copy(Ea);wa.sub(fa.multiplyScalar(fa.dot(Ea))).normalize();Ha.crossVectors(za,Ea);Ga=Ha.dot(l[a]);
 Ia=0>Ga?-1:1;h[4*a]=wa.x;h[4*a+1]=wa.y;h[4*a+2]=wa.z;h[4*a+3]=Ia}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent=
-{itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],p=0;p<g;p++)k[p]=new THREE.Vector3,l[p]=new THREE.Vector3;var q,r,t,s,n,v,w,u,y,M,B,D,z,F,H,C,x,A,O,K,L,J,G,Q,Y,U,la=new THREE.Vector3,W=new THREE.Vector3,R,E,da,V,X,P=this.offsets,p=0;for(E=P.length;p<E;++p){R=P[p].start;da=P[p].count;var ga=P[p].index,g=R;for(R+=da;g<R;g+=3)da=ga+c[g],V=ga+c[g+1],X=ga+c[g+2],a(da,V,X)}var wa=new THREE.Vector3,Ha=new THREE.Vector3,fa=new THREE.Vector3,za=new THREE.Vector3,
-Ia,Ea,Ga,p=0;for(E=P.length;p<E;++p)for(R=P[p].start,da=P[p].count,ga=P[p].index,g=R,R+=da;g<R;g+=3)da=ga+c[g],V=ga+c[g+1],X=ga+c[g+2],b(da),b(V),b(X)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,p=0,q=new Int32Array(6),r=new Int32Array(c.length),t=new Int32Array(c.length),s=0;s<c.length;s++)r[s]=-1,t[s]=-1;for(c=
-0;c<d;c++){for(var n=p=0;3>n;n++)s=a[3*c+n],-1==r[s]?(q[2*n]=s,q[2*n+1]=-1,p++):r[s]<k.index?(q[2*n]=s,q[2*n+1]=-1,l++):(q[2*n]=s,q[2*n+1]=r[s]);if(g+p>k.index+b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)n=q[p+1],-1<n&&n<k.index&&(q[p+1]=-1);for(p=0;6>p;p+=2)s=q[p],n=q[p+1],-1===n&&(n=g++),r[s]=n,t[n]=s,e[f++]=n-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},normalizeNormals:function(){for(var a=this.attributes.normal.array,
+{itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],p=0;p<g;p++)k[p]=new THREE.Vector3,l[p]=new THREE.Vector3;var q,r,s,t,n,v,w,u,x,F,C,D,z,G,I,B,y,A,O,L,M,K,H,Q,Y,U,la=new THREE.Vector3,W=new THREE.Vector3,R,E,da,V,X,P=this.offsets,p=0;for(E=P.length;p<E;++p){R=P[p].start;da=P[p].count;var ga=P[p].index,g=R;for(R+=da;g<R;g+=3)da=ga+c[g],V=ga+c[g+1],X=ga+c[g+2],a(da,V,X)}var wa=new THREE.Vector3,Ha=new THREE.Vector3,fa=new THREE.Vector3,za=new THREE.Vector3,
+Ia,Ea,Ga,p=0;for(E=P.length;p<E;++p)for(R=P[p].start,da=P[p].count,ga=P[p].index,g=R,R+=da;g<R;g+=3)da=ga+c[g],V=ga+c[g+1],X=ga+c[g+2],b(da),b(V),b(X)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,p=0,q=new Int32Array(6),r=new Int32Array(c.length),s=new Int32Array(c.length),t=0;t<c.length;t++)r[t]=-1,s[t]=-1;for(c=
+0;c<d;c++){for(var n=p=0;3>n;n++)t=a[3*c+n],-1==r[t]?(q[2*n]=t,q[2*n+1]=-1,p++):r[t]<k.index?(q[2*n]=t,q[2*n+1]=-1,l++):(q[2*n]=t,q[2*n+1]=r[t]);if(g+p>k.index+b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)n=q[p+1],-1<n&&n<k.index&&(q[p+1]=-1);for(p=0;6>p;p+=2)t=q[p],n=q[p+1],-1===n&&(n=g++),r[t]=n,s[n]=t,e[f++]=n-k.index,k.count++}this.reorderBuffers(e,s,g);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},normalizeNormals:function(){for(var a=this.attributes.normal.array,
 b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],f;for(f in this.attributes)if("index"!=f)for(var g=this.attributes[f].array,h=0,k=e.length;h<k;h++){var l=e[h];if(g instanceof l){d[f]=new l(this.attributes[f].itemSize*c);break}}for(e=0;e<c;e++)for(f in g=b[e],this.attributes)if("index"!=
 f)for(var h=this.attributes[f].array,k=this.attributes[f].itemSize,l=d[f],p=0;p<k;p++)l[e*k+p]=h[g*k+p];this.attributes.index.array=a;for(f in this.attributes)"index"!=f&&(this.attributes[f].array=d[f],this.attributes[f].numItems=this.attributes[f].itemSize*c)},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,
 array:null},d=0,g=b.length;d<g;d++){var h=b[d];if(e instanceof h){f.array=new h(e);break}}a.attributes[c]=f}d=0;for(g=this.offsets.length;d<g;d++)b=this.offsets[d],a.offsets.push({start:b.start,index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=
@@ -208,12 +208,12 @@ computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=
 a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),k.subVectors(e,f),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=
 d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=
 this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<
-d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,p,q,r,t,s,n,v,w=[],u=[];c=new THREE.Vector3;var y=new THREE.Vector3,M=new THREE.Vector3,B=new THREE.Vector3,D=new THREE.Vector3;a=0;for(b=this.vertices.length;a<
-b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,g=this.vertices[d],h=this.vertices[v],k=this.vertices[e],l=f[0],p=f[1],q=f[2],f=h.x-g.x,r=k.x-g.x,t=h.y-g.y,s=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=p.x-l.x,n=q.x-l.x,p=p.y-l.y,l=q.y-l.y,q=1/(k*l-n*p),c.set((l*f-p*r)*q,(l*t-p*s)*q,(l*h-p*g)*q),y.set((k*r-n*f)*q,(k*s-n*t)*q,(k*g-n*h)*q),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(y),u[v].add(y),u[e].add(y);y=
-["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++)D.copy(e.vertexNormals[c]),d=e[y[c]],v=w[d],M.copy(v),M.sub(D.multiplyScalar(D.dot(v))).normalize(),B.crossVectors(e.vertexNormals[c],v),d=B.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(M.x,M.y,M.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===
+d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,p,q,r,s,t,n,v,w=[],u=[];c=new THREE.Vector3;var x=new THREE.Vector3,F=new THREE.Vector3,C=new THREE.Vector3,D=new THREE.Vector3;a=0;for(b=this.vertices.length;a<
+b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,g=this.vertices[d],h=this.vertices[v],k=this.vertices[e],l=f[0],p=f[1],q=f[2],f=h.x-g.x,r=k.x-g.x,s=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=p.x-l.x,n=q.x-l.x,p=p.y-l.y,l=q.y-l.y,q=1/(k*l-n*p),c.set((l*f-p*r)*q,(l*s-p*t)*q,(l*h-p*g)*q),x.set((k*r-n*f)*q,(k*t-n*s)*q,(k*g-n*h)*q),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(x),u[v].add(x),u[e].add(x);x=
+["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++)D.copy(e.vertexNormals[c]),d=e[x[c]],v=w[d],F.copy(v),F.sub(D.multiplyScalar(D.dot(v))).normalize(),C.crossVectors(e.vertexNormals[c],v),d=C.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(F.x,F.y,F.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===
 this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,k=a.faces,l=this.faceVertexUvs[0];
-a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var p=0,q=g.length;p<q;p++){var r=g[p].clone();void 0!==b&&r.applyMatrix4(b);f.push(r)}p=0;for(q=k.length;p<q;p++){var g=k[p],t,s=g.vertexNormals,n=g.vertexColors,r=new THREE.Face3(g.a+e,g.b+e,g.c+e);r.normal.copy(g.normal);void 0!==d&&r.normal.applyMatrix3(d).normalize();b=0;for(f=s.length;b<f;b++)t=s[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),r.vertexNormals.push(t);r.color.copy(g.color);
-b=0;for(f=n.length;b<f;b++)t=n[b],r.vertexColors.push(t.clone());r.materialIndex=g.materialIndex+c;h.push(r)}p=0;for(q=a.length;p<q;p++)if(c=a[p],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));l.push(d)}}},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=
+a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var p=0,q=g.length;p<q;p++){var r=g[p].clone();void 0!==b&&r.applyMatrix4(b);f.push(r)}p=0;for(q=k.length;p<q;p++){var g=k[p],s,t=g.vertexNormals,n=g.vertexColors,r=new THREE.Face3(g.a+e,g.b+e,g.c+e);r.normal.copy(g.normal);void 0!==d&&r.normal.applyMatrix3(d).normalize();b=0;for(f=t.length;b<f;b++)s=t[b].clone(),void 0!==d&&s.applyMatrix3(d).normalize(),r.vertexNormals.push(s);r.color.copy(g.color);
+b=0;for(f=n.length;b<f;b++)s=n[b],r.vertexColors.push(s.clone());r.materialIndex=g.materialIndex+c;h.push(r)}p=0;for(q=a.length;p<q;p++)if(c=a[p],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));l.push(d)}}},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=
 c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=this.vertices.length-b.length;this.vertices=b;return f},makeGroups:function(){var a=0;return function(b,c){var d,e,f,g,h={},k=this.morphTargets.length,l=this.morphNormals.length;this.geometryGroups=
 {};d=0;for(e=this.faces.length;d<e;d++)f=this.faces[d],f=b?f.materialIndex:0,f in h||(h[f]={hash:f,counter:0}),g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(this.geometryGroups[g]={faces3:[],materialIndex:f,vertices:0,numMorphTargets:k,numMorphNormals:l}),this.geometryGroups[g].vertices+3>c&&(h[f].counter+=1,g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(this.geometryGroups[g]={faces3:[],materialIndex:f,vertices:0,numMorphTargets:k,numMorphNormals:l})),this.geometryGroups[g].faces3.push(d),
 this.geometryGroups[g].vertices+=3;this.geometryGroupsList=[];for(var p in this.geometryGroups)this.geometryGroups[p].id=a++,this.geometryGroupsList.push(this.geometryGroups[p])}}(),clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],f=[],g=0,h=e.length;g<h;g++)f.push(new THREE.Vector2(e[g].x,e[g].y));a.faceVertexUvs[0].push(f)}return a},
@@ -245,10 +245,10 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
 a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText);if(void 0!==h.metadata&&"scene"===h.metadata.type){console.error('THREE.JSONLoader: "'+b+'" seems to be a Scene. Use THREE.SceneLoader instead.');return}h=a.parse(h,d);c(h.geometry,h.materials)}else console.error('THREE.JSONLoader: "'+b+'" seems to be unreachable or the file is empty.');
 a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load \""+b+'" ('+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)};
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,p,q,r,t,s,n,v,w,u=a.faces;p=a.vertices;var y=a.normals,M=a.colors,B=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&B++;for(d=0;d<B;d++)c.faceVertexUvs[d]=[]}k=0;for(l=p.length;k<l;)d=new THREE.Vector3,d.x=p[k++]*b,d.y=p[k++]*b,d.z=p[k++]*b,c.vertices.push(d);k=0;for(l=u.length;k<l;)if(b=u[k++],t=b&1,h=b&2,d=b&8,q=b&16,s=b&32,p=b&64,b&=128,t){t=new THREE.Face3;
-t.a=u[k];t.b=u[k+1];t.c=u[k+3];n=new THREE.Face3;n.a=u[k+1];n.b=u[k+2];n.c=u[k+3];k+=4;h&&(h=u[k++],t.materialIndex=h,n.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<B;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(y[q++],y[q++],y[q]),n.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*u[k++],s=new THREE.Vector3(y[q++],
-y[q++],y[q]),2!==d&&t.vertexNormals.push(s),0!==d&&n.vertexNormals.push(s);p&&(p=u[k++],p=M[p],t.color.setHex(p),n.color.setHex(p));if(b)for(d=0;4>d;d++)p=u[k++],p=M[p],2!==d&&t.vertexColors.push(new THREE.Color(p)),0!==d&&n.vertexColors.push(new THREE.Color(p));c.faces.push(t);c.faces.push(n)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<B;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],
-w=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(y[q++],y[q++],y[q]));if(s)for(d=0;3>d;d++)q=3*u[k++],s=new THREE.Vector3(y[q++],y[q++],y[q]),t.vertexNormals.push(s);p&&(p=u[k++],t.color.setHex(M[p]));if(b)for(d=0;3>d;d++)p=u[k++],t.vertexColors.push(new THREE.Color(M[p]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,p,q,r,s,t,n,v,w,u=a.faces;p=a.vertices;var x=a.normals,F=a.colors,C=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&C++;for(d=0;d<C;d++)c.faceVertexUvs[d]=[]}k=0;for(l=p.length;k<l;)d=new THREE.Vector3,d.x=p[k++]*b,d.y=p[k++]*b,d.z=p[k++]*b,c.vertices.push(d);k=0;for(l=u.length;k<l;)if(b=u[k++],s=b&1,h=b&2,d=b&8,q=b&16,t=b&32,p=b&64,b&=128,s){s=new THREE.Face3;
+s.a=u[k];s.b=u[k+1];s.c=u[k+3];n=new THREE.Face3;n.a=u[k+1];n.b=u[k+2];n.c=u[k+3];k+=4;h&&(h=u[k++],s.materialIndex=h,n.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<C;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],s.normal.set(x[q++],x[q++],x[q]),n.normal.copy(s.normal));if(t)for(d=0;4>d;d++)q=3*u[k++],t=new THREE.Vector3(x[q++],
+x[q++],x[q]),2!==d&&s.vertexNormals.push(t),0!==d&&n.vertexNormals.push(t);p&&(p=u[k++],p=F[p],s.color.setHex(p),n.color.setHex(p));if(b)for(d=0;4>d;d++)p=u[k++],p=F[p],2!==d&&s.vertexColors.push(new THREE.Color(p)),0!==d&&n.vertexColors.push(new THREE.Color(p));c.faces.push(s);c.faces.push(n)}else{s=new THREE.Face3;s.a=u[k++];s.b=u[k++];s.c=u[k++];h&&(h=u[k++],s.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<C;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],
+w=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],s.normal.set(x[q++],x[q++],x[q]));if(t)for(d=0;3>d;d++)q=3*u[k++],t=new THREE.Vector3(x[q++],x[q++],x[q]),s.vertexNormals.push(t);p&&(p=u[k++],s.color.setHex(F[p]));if(b)for(d=0;3>d;d++)p=u[k++],s.vertexColors.push(new THREE.Color(F[p]));c.faces.push(s)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
 1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+
 "), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,p;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,p=a.morphTargets[d].vertices,h=0,k=p.length;h<k;h+=3){var q=new THREE.Vector3;q.x=p[h]*b;q.y=p[h+1]*b;q.z=p[h+2]*b;l.push(q)}}if(void 0!==a.morphColors)for(d=
 0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)p=new THREE.Color(16755200),p.setRGB(l[b],l[b+1],l[b+2]),k.push(p)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
@@ -304,27 +304,27 @@ THREE.LOD.prototype.clone=function(a){void 0===a&&(a=new THREE.LOD);THREE.Object
 THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Particle=THREE.Sprite;THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)){this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}this.dispatchEvent({type:"objectAdded",object:a});a.dispatchEvent({type:"addedToScene",scene:this});for(b=0;b<a.children.length;b++)this.__addObject(a.children[b])};
 THREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){var b=this.__lights.indexOf(a);-1!==b&&this.__lights.splice(b,1);if(a.shadowCascadeArray)for(b=0;b<a.shadowCascadeArray.length;b++)this.__removeObject(a.shadowCascadeArray[b])}else a instanceof THREE.Camera||(this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),-1!==b&&this.__objectsAdded.splice(b,1));this.dispatchEvent({type:"objectRemoved",object:a});a.dispatchEvent({type:"removedFromScene",scene:this});for(b=
-0;b<a.children.length;b++)this.__removeObject(a.children[b])};THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Object3D.prototype.clone.call(this,a);null!==this.fog&&(a.fog=this.fog.clone());null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone());a.autoUpdate=this.autoUpdate;a.matrixAutoUpdate=this.matrixAutoUpdate;return a};THREE.Fog=function(a,b,c){this.name="";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name="";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};THREE.CanvasRenderer=function(a){function b(a,b,c,d){l(b);p(c);q(d);r(a.getStyle());C.stroke();qa.expandByScalar(2*b)}function c(a){t(a.getStyle());C.fill()}function d(a){e(a.target)}function e(a){var b=a.wrapS===THREE.RepeatWrapping,c=a.wrapT===THREE.RepeatWrapping,d=a.image,e=document.createElement("canvas");e.width=d.width;e.height=d.height;var f=e.getContext("2d");f.setTransform(1,0,0,-1,0,d.height);f.drawImage(d,0,0);Ga[a.id]=C.createPattern(e,!0===b&&!0===c?"repeat":!0===b&&!1===c?"repeat-x":
-!1===b&&!0===c?"repeat-y":"no-repeat")}function f(a,b,c,f,g,h,k,l,p,m,n,r,q){if(!(q instanceof THREE.DataTexture)){!1===q.hasEventListener("update",d)&&(void 0!==q.image&&0<q.image.width&&e(q),q.addEventListener("update",d));var s=Ga[q.id];if(void 0!==s){t(s);var s=q.offset.x/q.repeat.x,u=q.offset.y/q.repeat.y,v=q.image.width*q.repeat.x;q=q.image.height*q.repeat.y;k=(k+s)*v;l=(l+u)*q;c-=a;f-=b;g-=a;h-=b;p=(p+s)*v-k;m=(m+u)*q-l;n=(n+s)*v-k;r=(r+u)*q-l;q=p*r-n*m;0!==q&&(s=1/q,q=(r*c-m*g)*s,m=(r*f-m*
-h)*s,c=(p*g-n*c)*s,f=(p*h-n*f)*s,a=a-q*k-c*l,b=b-m*k-f*l,C.save(),C.transform(q,m,c,f,a,b),C.fill(),C.restore())}else t("rgba(0,0,0,1)"),C.fill()}}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function h(a){O!==a&&(O=C.globalAlpha=a)}function k(a){K!==a&&(a===THREE.NormalBlending?C.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?C.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(C.globalCompositeOperation=
-"darker"),K=a)}function l(a){G!==a&&(G=C.lineWidth=a)}function p(a){Q!==a&&(Q=C.lineCap=a)}function q(a){Y!==a&&(Y=C.lineJoin=a)}function r(a){L!==a&&(L=C.strokeStyle=a)}function t(a){J!==a&&(J=C.fillStyle=a)}function s(a,b){if(U!==a||la!==b)C.setLineDash([a,b]),U=a,la=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var n=THREE.Math.smoothstep;a=a||{};var v=this,w,u,y,M=new THREE.Projector,B=void 0!==a.canvas?a.canvas:document.createElement("canvas"),D=B.width,z=B.height,F=Math.floor(D/2),H=
-Math.floor(z/2),C=B.getContext("2d",{alpha:!0===a.alpha}),x=new THREE.Color(0),A=0,O=1,K=0,L=null,J=null,G=null,Q=null,Y=null,U=null,la=0,W,R,E,da;new THREE.RenderableVertex;new THREE.RenderableVertex;var V,X,P,ga,wa,Ha,fa=new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;var za=new THREE.Color,Ia=new THREE.Color,Ea=new THREE.Color,Ga={},ha,Oa,Ra,Sa,Fa,ia,ma,ya=new THREE.Box2,Z=new THREE.Box2,qa=new THREE.Box2,ua=new THREE.Color,Ca=new THREE.Color,va=new THREE.Color,
-Da=new THREE.Vector3,Ja=new THREE.Vector3,ja=new THREE.Vector3,ra=new THREE.Matrix3;void 0===C.setLineDash&&(C.setLineDash=function(){});this.domElement=B;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){D=a*this.devicePixelRatio;
-z=b*this.devicePixelRatio;B.width=D;B.height=z;F=Math.floor(D/2);H=Math.floor(z/2);!1!==c&&(B.style.width=a+"px",B.style.height=b+"px");ya.min.set(-F,-H);ya.max.set(F,H);Z.min.set(-F,-H);Z.max.set(F,H);O=1;K=0;Y=Q=G=J=L=null;this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){C.setTransform(c*this.devicePixelRatio/D,0,0,-(d*this.devicePixelRatio)/z,a*this.devicePixelRatio,z-b*this.devicePixelRatio);C.translate(F,H)};this.setScissor=function(){};this.enableScissorTest=function(){};this.setClearColor=
-function(a,b){x.set(a);A=void 0!==b?b:1;Z.min.set(-F,-H);Z.max.set(F,H)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){!1===Z.empty()&&(Z.intersect(ya),Z.expandByScalar(2),1>A&&C.clearRect(Z.min.x|0,Z.min.y|0,Z.max.x-Z.min.x|0,Z.max.y-Z.min.y|0),0<A&&(k(THREE.NormalBlending),h(1),t("rgba("+Math.floor(255*x.r)+","+Math.floor(255*
-x.g)+","+Math.floor(255*x.b)+","+A+")"),C.fillRect(Z.min.x|0,Z.min.y|0,Z.max.x-Z.min.x|0,Z.max.y-Z.min.y|0)),Z.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,B){if(!1===B instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");else{!0===this.autoClear&&this.clear();v.info.render.vertices=0;v.info.render.faces=0;w=M.projectScene(a,B,this.sortObjects,this.sortElements);
-u=w.elements;y=w.lights;W=B;ra.getNormalMatrix(B.matrixWorldInverse);ua.setRGB(0,0,0);Ca.setRGB(0,0,0);va.setRGB(0,0,0);for(var z=0,J=y.length;z<J;z++){var x=y[z],D=x.color;x instanceof THREE.AmbientLight?ua.add(D):x instanceof THREE.DirectionalLight?Ca.add(D):x instanceof THREE.PointLight&&va.add(D)}z=0;for(J=u.length;z<J;z++){var G=u[z],A=G.material;if(void 0!==A&&0!==A.opacity){qa.makeEmpty();if(G instanceof THREE.RenderableSprite){R=G;R.x*=F;R.y*=H;var x=R,L=G,D=A;h(D.opacity);k(D.blending);var m=
-L.scale.x*F,L=L.scale.y*H,G=0.5*Math.sqrt(m*m+L*L);qa.min.set(x.x-G,x.y-G);qa.max.set(x.x+G,x.y+G);if(D instanceof THREE.SpriteMaterial){var Q=D.map;if(null!==Q){!1===Q.hasEventListener("update",d)&&(void 0!==Q.image&&0<Q.image.width&&e(Q),Q.addEventListener("update",d));G=Ga[Q.id];void 0!==G?t(G):t("rgba( 0, 0, 0, 1 )");var O=Q.image,G=O.width*Q.offset.x,A=O.height*Q.offset.y,K=O.width*Q.repeat.x,Q=O.height*Q.repeat.y,O=m/K,U=L/Q;C.save();C.translate(x.x,x.y);0!==D.rotation&&C.rotate(D.rotation);
-C.translate(-m/2,-L/2);C.scale(O,U);C.translate(-G,-A);C.fillRect(G,A,K,Q)}else t(D.color.getStyle()),C.save(),C.translate(x.x,x.y),0!==D.rotation&&C.rotate(D.rotation),C.scale(m,-L),C.fillRect(-0.5,-0.5,1,1);C.restore()}else D instanceof THREE.SpriteCanvasMaterial&&(r(D.color.getStyle()),t(D.color.getStyle()),C.save(),C.translate(x.x,x.y),0!==D.rotation&&C.rotate(D.rotation),C.scale(m,L),D.program(C),C.restore())}else if(G instanceof THREE.RenderableLine){if(R=G.v1,E=G.v2,R.positionScreen.x*=F,R.positionScreen.y*=
-H,E.positionScreen.x*=F,E.positionScreen.y*=H,qa.setFromPoints([R.positionScreen,E.positionScreen]),!0===ya.isIntersectionBox(qa))if(x=R,D=E,m=G,L=A,h(L.opacity),k(L.blending),C.beginPath(),C.moveTo(x.positionScreen.x,x.positionScreen.y),C.lineTo(D.positionScreen.x,D.positionScreen.y),L instanceof THREE.LineBasicMaterial){l(L.linewidth);p(L.linecap);q(L.linejoin);if(L.vertexColors!==THREE.VertexColors)r(L.color.getStyle());else if(G=m.vertexColors[0].getStyle(),m=m.vertexColors[1].getStyle(),G===
-m)r(G);else{try{var Y=C.createLinearGradient(x.positionScreen.x,x.positionScreen.y,D.positionScreen.x,D.positionScreen.y);Y.addColorStop(0,G);Y.addColorStop(1,m)}catch(la){Y=G}r(Y)}C.stroke();qa.expandByScalar(2*L.linewidth)}else L instanceof THREE.LineDashedMaterial&&(l(L.linewidth),p(L.linecap),q(L.linejoin),r(L.color.getStyle()),s(L.dashSize,L.gapSize),C.stroke(),qa.expandByScalar(2*L.linewidth),s(null,null))}else if(G instanceof THREE.RenderableFace){R=G.v1;E=G.v2;da=G.v3;if(-1>R.positionScreen.z||
-1<R.positionScreen.z)continue;if(-1>E.positionScreen.z||1<E.positionScreen.z)continue;if(-1>da.positionScreen.z||1<da.positionScreen.z)continue;R.positionScreen.x*=F;R.positionScreen.y*=H;E.positionScreen.x*=F;E.positionScreen.y*=H;da.positionScreen.x*=F;da.positionScreen.y*=H;0<A.overdraw&&(g(R.positionScreen,E.positionScreen,A.overdraw),g(E.positionScreen,da.positionScreen,A.overdraw),g(da.positionScreen,R.positionScreen,A.overdraw));qa.setFromPoints([R.positionScreen,E.positionScreen,da.positionScreen]);
-if(!0===ya.isIntersectionBox(qa)){D=R;m=E;L=da;x=A;v.info.render.vertices+=3;v.info.render.faces++;h(x.opacity);k(x.blending);V=D.positionScreen.x;X=D.positionScreen.y;P=m.positionScreen.x;ga=m.positionScreen.y;wa=L.positionScreen.x;Ha=L.positionScreen.y;var A=V,K=X,Q=P,O=ga,U=wa,Db=Ha;C.beginPath();C.moveTo(A,K);C.lineTo(Q,O);C.lineTo(U,Db);C.closePath();if((x instanceof THREE.MeshLambertMaterial||x instanceof THREE.MeshPhongMaterial)&&null===x.map){za.copy(x.color);Ia.copy(x.emissive);x.vertexColors===
-THREE.FaceColors&&za.multiply(G.color);fa.copy(ua);Ja.copy(D.positionWorld).add(m.positionWorld).add(L.positionWorld).divideScalar(3);D=Ja;m=G.normalModel;L=fa;G=0;for(A=y.length;G<A;G++)K=y[G],Ea.copy(K.color),K instanceof THREE.DirectionalLight?(Q=Da.setFromMatrixPosition(K.matrixWorld).normalize(),O=m.dot(Q),0>=O||(O*=K.intensity,L.add(Ea.multiplyScalar(O)))):K instanceof THREE.PointLight&&(Q=Da.setFromMatrixPosition(K.matrixWorld),O=m.dot(Da.subVectors(Q,D).normalize()),0>=O||(O*=0==K.distance?
-1:1-Math.min(D.distanceTo(Q)/K.distance,1),0!=O&&(O*=K.intensity,L.add(Ea.multiplyScalar(O)))));fa.multiply(za).add(Ia);!0===x.wireframe?b(fa,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):c(fa)}else x instanceof THREE.MeshBasicMaterial||x instanceof THREE.MeshLambertMaterial||x instanceof THREE.MeshPhongMaterial?null!==x.map?x.map.mapping instanceof THREE.UVMapping&&(ha=G.uvs,f(V,X,P,ga,wa,Ha,ha[0].x,ha[0].y,ha[1].x,ha[1].y,ha[2].x,ha[2].y,x.map)):null!==x.envMap?x.envMap.mapping instanceof
-THREE.SphericalReflectionMapping?(ja.copy(G.vertexNormalsModel[0]).applyMatrix3(ra),Oa=0.5*ja.x+0.5,Ra=0.5*ja.y+0.5,ja.copy(G.vertexNormalsModel[1]).applyMatrix3(ra),Sa=0.5*ja.x+0.5,Fa=0.5*ja.y+0.5,ja.copy(G.vertexNormalsModel[2]).applyMatrix3(ra),ia=0.5*ja.x+0.5,ma=0.5*ja.y+0.5,f(V,X,P,ga,wa,Ha,Oa,Ra,Sa,Fa,ia,ma,x.envMap)):x.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ja.copy(G.vertexNormalsModel[0]).applyMatrix3(ra),Oa=-0.5*ja.x+0.5,Ra=-0.5*ja.y+0.5,ja.copy(G.vertexNormalsModel[1]).applyMatrix3(ra),
-Sa=-0.5*ja.x+0.5,Fa=-0.5*ja.y+0.5,ja.copy(G.vertexNormalsModel[2]).applyMatrix3(ra),ia=-0.5*ja.x+0.5,ma=-0.5*ja.y+0.5,f(V,X,P,ga,wa,Ha,Oa,Ra,Sa,Fa,ia,ma,x.envMap)):(fa.copy(x.color),x.vertexColors===THREE.FaceColors&&fa.multiply(G.color),!0===x.wireframe?b(fa,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):c(fa)):(x instanceof THREE.MeshDepthMaterial?fa.r=fa.g=fa.b=1-n(D.positionScreen.z*D.positionScreen.w,W.near,W.far):x instanceof THREE.MeshNormalMaterial?(ja.copy(G.normalModel).applyMatrix3(ra),
-fa.setRGB(ja.x,ja.y,ja.z).multiplyScalar(0.5).addScalar(0.5)):fa.setRGB(1,1,1),!0===x.wireframe?b(fa,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):c(fa))}}Z.union(qa)}}}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tconst float LOG2 = 1.442695;\n\t\tfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\n\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
+0;b<a.children.length;b++)this.__removeObject(a.children[b])};THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Object3D.prototype.clone.call(this,a);null!==this.fog&&(a.fog=this.fog.clone());null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone());a.autoUpdate=this.autoUpdate;a.matrixAutoUpdate=this.matrixAutoUpdate;return a};THREE.Fog=function(a,b,c){this.name="";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name="";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};THREE.CanvasRenderer=function(a){function b(a,b,c,d){l(b);p(c);q(d);r(a.getStyle());B.stroke();qa.expandByScalar(2*b)}function c(a){s(a.getStyle());B.fill()}function d(a){e(a.target)}function e(a){var b=a.wrapS===THREE.RepeatWrapping,c=a.wrapT===THREE.RepeatWrapping,d=a.image,e=document.createElement("canvas");e.width=d.width;e.height=d.height;var f=e.getContext("2d");f.setTransform(1,0,0,-1,0,d.height);f.drawImage(d,0,0);Ga[a.id]=B.createPattern(e,!0===b&&!0===c?"repeat":!0===b&&!1===c?"repeat-x":
+!1===b&&!0===c?"repeat-y":"no-repeat")}function f(a,b,c,f,g,h,k,l,p,m,n,r,q){if(!(q instanceof THREE.DataTexture)){!1===q.hasEventListener("update",d)&&(void 0!==q.image&&0<q.image.width&&e(q),q.addEventListener("update",d));var t=Ga[q.id];if(void 0!==t){s(t);var t=q.offset.x/q.repeat.x,u=q.offset.y/q.repeat.y,v=q.image.width*q.repeat.x;q=q.image.height*q.repeat.y;k=(k+t)*v;l=(l+u)*q;c-=a;f-=b;g-=a;h-=b;p=(p+t)*v-k;m=(m+u)*q-l;n=(n+t)*v-k;r=(r+u)*q-l;q=p*r-n*m;0!==q&&(t=1/q,q=(r*c-m*g)*t,m=(r*f-m*
+h)*t,c=(p*g-n*c)*t,f=(p*h-n*f)*t,a=a-q*k-c*l,b=b-m*k-f*l,B.save(),B.transform(q,m,c,f,a,b),B.fill(),B.restore())}else s("rgba(0,0,0,1)"),B.fill()}}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function h(a){O!==a&&(O=B.globalAlpha=a)}function k(a){L!==a&&(a===THREE.NormalBlending?B.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?B.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(B.globalCompositeOperation=
+"darker"),L=a)}function l(a){H!==a&&(H=B.lineWidth=a)}function p(a){Q!==a&&(Q=B.lineCap=a)}function q(a){Y!==a&&(Y=B.lineJoin=a)}function r(a){M!==a&&(M=B.strokeStyle=a)}function s(a){K!==a&&(K=B.fillStyle=a)}function t(a,b){if(U!==a||la!==b)B.setLineDash([a,b]),U=a,la=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var n=THREE.Math.smoothstep;a=a||{};var v=this,w,u,x,F=new THREE.Projector,C=void 0!==a.canvas?a.canvas:document.createElement("canvas"),D=C.width,z=C.height,G=Math.floor(D/2),I=
+Math.floor(z/2),B=C.getContext("2d",{alpha:!0===a.alpha}),y=new THREE.Color(0),A=0,O=1,L=0,M=null,K=null,H=null,Q=null,Y=null,U=null,la=0,W,R,E,da;new THREE.RenderableVertex;new THREE.RenderableVertex;var V,X,P,ga,wa,Ha,fa=new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;var za=new THREE.Color,Ia=new THREE.Color,Ea=new THREE.Color,Ga={},ha,Oa,Ra,Sa,Fa,ia,ma,ya=new THREE.Box2,Z=new THREE.Box2,qa=new THREE.Box2,ua=new THREE.Color,Ca=new THREE.Color,va=new THREE.Color,
+Da=new THREE.Vector3,Ja=new THREE.Vector3,ja=new THREE.Vector3,ra=new THREE.Matrix3;void 0===B.setLineDash&&(B.setLineDash=function(){});this.domElement=C;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){D=a*this.devicePixelRatio;
+z=b*this.devicePixelRatio;C.width=D;C.height=z;G=Math.floor(D/2);I=Math.floor(z/2);!1!==c&&(C.style.width=a+"px",C.style.height=b+"px");ya.min.set(-G,-I);ya.max.set(G,I);Z.min.set(-G,-I);Z.max.set(G,I);O=1;L=0;Y=Q=H=K=M=null;this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){B.setTransform(c*this.devicePixelRatio/D,0,0,-(d*this.devicePixelRatio)/z,a*this.devicePixelRatio,z-b*this.devicePixelRatio);B.translate(G,I)};this.setScissor=function(){};this.enableScissorTest=function(){};this.setClearColor=
+function(a,b){y.set(a);A=void 0!==b?b:1;Z.min.set(-G,-I);Z.max.set(G,I)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){!1===Z.empty()&&(Z.intersect(ya),Z.expandByScalar(2),1>A&&B.clearRect(Z.min.x|0,Z.min.y|0,Z.max.x-Z.min.x|0,Z.max.y-Z.min.y|0),0<A&&(k(THREE.NormalBlending),h(1),s("rgba("+Math.floor(255*y.r)+","+Math.floor(255*
+y.g)+","+Math.floor(255*y.b)+","+A+")"),B.fillRect(Z.min.x|0,Z.min.y|0,Z.max.x-Z.min.x|0,Z.max.y-Z.min.y|0)),Z.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,C){if(!1===C instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");else{!0===this.autoClear&&this.clear();v.info.render.vertices=0;v.info.render.faces=0;w=F.projectScene(a,C,this.sortObjects,this.sortElements);
+u=w.elements;x=w.lights;W=C;ra.getNormalMatrix(C.matrixWorldInverse);ua.setRGB(0,0,0);Ca.setRGB(0,0,0);va.setRGB(0,0,0);for(var z=0,K=x.length;z<K;z++){var y=x[z],D=y.color;y instanceof THREE.AmbientLight?ua.add(D):y instanceof THREE.DirectionalLight?Ca.add(D):y instanceof THREE.PointLight&&va.add(D)}z=0;for(K=u.length;z<K;z++){var H=u[z],A=H.material;if(void 0!==A&&0!==A.opacity){qa.makeEmpty();if(H instanceof THREE.RenderableSprite){R=H;R.x*=G;R.y*=I;var y=R,M=H,D=A;h(D.opacity);k(D.blending);var m=
+M.scale.x*G,M=M.scale.y*I,H=0.5*Math.sqrt(m*m+M*M);qa.min.set(y.x-H,y.y-H);qa.max.set(y.x+H,y.y+H);if(D instanceof THREE.SpriteMaterial){var Q=D.map;if(null!==Q){!1===Q.hasEventListener("update",d)&&(void 0!==Q.image&&0<Q.image.width&&e(Q),Q.addEventListener("update",d));H=Ga[Q.id];void 0!==H?s(H):s("rgba( 0, 0, 0, 1 )");var O=Q.image,H=O.width*Q.offset.x,A=O.height*Q.offset.y,L=O.width*Q.repeat.x,Q=O.height*Q.repeat.y,O=m/L,U=M/Q;B.save();B.translate(y.x,y.y);0!==D.rotation&&B.rotate(D.rotation);
+B.translate(-m/2,-M/2);B.scale(O,U);B.translate(-H,-A);B.fillRect(H,A,L,Q)}else s(D.color.getStyle()),B.save(),B.translate(y.x,y.y),0!==D.rotation&&B.rotate(D.rotation),B.scale(m,-M),B.fillRect(-0.5,-0.5,1,1);B.restore()}else D instanceof THREE.SpriteCanvasMaterial&&(r(D.color.getStyle()),s(D.color.getStyle()),B.save(),B.translate(y.x,y.y),0!==D.rotation&&B.rotate(D.rotation),B.scale(m,M),D.program(B),B.restore())}else if(H instanceof THREE.RenderableLine){if(R=H.v1,E=H.v2,R.positionScreen.x*=G,R.positionScreen.y*=
+I,E.positionScreen.x*=G,E.positionScreen.y*=I,qa.setFromPoints([R.positionScreen,E.positionScreen]),!0===ya.isIntersectionBox(qa))if(y=R,D=E,m=H,M=A,h(M.opacity),k(M.blending),B.beginPath(),B.moveTo(y.positionScreen.x,y.positionScreen.y),B.lineTo(D.positionScreen.x,D.positionScreen.y),M instanceof THREE.LineBasicMaterial){l(M.linewidth);p(M.linecap);q(M.linejoin);if(M.vertexColors!==THREE.VertexColors)r(M.color.getStyle());else if(H=m.vertexColors[0].getStyle(),m=m.vertexColors[1].getStyle(),H===
+m)r(H);else{try{var Y=B.createLinearGradient(y.positionScreen.x,y.positionScreen.y,D.positionScreen.x,D.positionScreen.y);Y.addColorStop(0,H);Y.addColorStop(1,m)}catch(la){Y=H}r(Y)}B.stroke();qa.expandByScalar(2*M.linewidth)}else M instanceof THREE.LineDashedMaterial&&(l(M.linewidth),p(M.linecap),q(M.linejoin),r(M.color.getStyle()),t(M.dashSize,M.gapSize),B.stroke(),qa.expandByScalar(2*M.linewidth),t(null,null))}else if(H instanceof THREE.RenderableFace){R=H.v1;E=H.v2;da=H.v3;if(-1>R.positionScreen.z||
+1<R.positionScreen.z)continue;if(-1>E.positionScreen.z||1<E.positionScreen.z)continue;if(-1>da.positionScreen.z||1<da.positionScreen.z)continue;R.positionScreen.x*=G;R.positionScreen.y*=I;E.positionScreen.x*=G;E.positionScreen.y*=I;da.positionScreen.x*=G;da.positionScreen.y*=I;0<A.overdraw&&(g(R.positionScreen,E.positionScreen,A.overdraw),g(E.positionScreen,da.positionScreen,A.overdraw),g(da.positionScreen,R.positionScreen,A.overdraw));qa.setFromPoints([R.positionScreen,E.positionScreen,da.positionScreen]);
+if(!0===ya.isIntersectionBox(qa)){D=R;m=E;M=da;y=A;v.info.render.vertices+=3;v.info.render.faces++;h(y.opacity);k(y.blending);V=D.positionScreen.x;X=D.positionScreen.y;P=m.positionScreen.x;ga=m.positionScreen.y;wa=M.positionScreen.x;Ha=M.positionScreen.y;var A=V,L=X,Q=P,O=ga,U=wa,Db=Ha;B.beginPath();B.moveTo(A,L);B.lineTo(Q,O);B.lineTo(U,Db);B.closePath();if((y instanceof THREE.MeshLambertMaterial||y instanceof THREE.MeshPhongMaterial)&&null===y.map){za.copy(y.color);Ia.copy(y.emissive);y.vertexColors===
+THREE.FaceColors&&za.multiply(H.color);fa.copy(ua);Ja.copy(D.positionWorld).add(m.positionWorld).add(M.positionWorld).divideScalar(3);D=Ja;m=H.normalModel;M=fa;H=0;for(A=x.length;H<A;H++)L=x[H],Ea.copy(L.color),L instanceof THREE.DirectionalLight?(Q=Da.setFromMatrixPosition(L.matrixWorld).normalize(),O=m.dot(Q),0>=O||(O*=L.intensity,M.add(Ea.multiplyScalar(O)))):L instanceof THREE.PointLight&&(Q=Da.setFromMatrixPosition(L.matrixWorld),O=m.dot(Da.subVectors(Q,D).normalize()),0>=O||(O*=0==L.distance?
+1:1-Math.min(D.distanceTo(Q)/L.distance,1),0!=O&&(O*=L.intensity,M.add(Ea.multiplyScalar(O)))));fa.multiply(za).add(Ia);!0===y.wireframe?b(fa,y.wireframeLinewidth,y.wireframeLinecap,y.wireframeLinejoin):c(fa)}else y instanceof THREE.MeshBasicMaterial||y instanceof THREE.MeshLambertMaterial||y instanceof THREE.MeshPhongMaterial?null!==y.map?y.map.mapping instanceof THREE.UVMapping&&(ha=H.uvs,f(V,X,P,ga,wa,Ha,ha[0].x,ha[0].y,ha[1].x,ha[1].y,ha[2].x,ha[2].y,y.map)):null!==y.envMap?y.envMap.mapping instanceof
+THREE.SphericalReflectionMapping?(ja.copy(H.vertexNormalsModel[0]).applyMatrix3(ra),Oa=0.5*ja.x+0.5,Ra=0.5*ja.y+0.5,ja.copy(H.vertexNormalsModel[1]).applyMatrix3(ra),Sa=0.5*ja.x+0.5,Fa=0.5*ja.y+0.5,ja.copy(H.vertexNormalsModel[2]).applyMatrix3(ra),ia=0.5*ja.x+0.5,ma=0.5*ja.y+0.5,f(V,X,P,ga,wa,Ha,Oa,Ra,Sa,Fa,ia,ma,y.envMap)):y.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ja.copy(H.vertexNormalsModel[0]).applyMatrix3(ra),Oa=-0.5*ja.x+0.5,Ra=-0.5*ja.y+0.5,ja.copy(H.vertexNormalsModel[1]).applyMatrix3(ra),
+Sa=-0.5*ja.x+0.5,Fa=-0.5*ja.y+0.5,ja.copy(H.vertexNormalsModel[2]).applyMatrix3(ra),ia=-0.5*ja.x+0.5,ma=-0.5*ja.y+0.5,f(V,X,P,ga,wa,Ha,Oa,Ra,Sa,Fa,ia,ma,y.envMap)):(fa.copy(y.color),y.vertexColors===THREE.FaceColors&&fa.multiply(H.color),!0===y.wireframe?b(fa,y.wireframeLinewidth,y.wireframeLinecap,y.wireframeLinejoin):c(fa)):(y instanceof THREE.MeshDepthMaterial?fa.r=fa.g=fa.b=1-n(D.positionScreen.z*D.positionScreen.w,W.near,W.far):y instanceof THREE.MeshNormalMaterial?(ja.copy(H.normalModel).applyMatrix3(ra),
+fa.setRGB(ja.x,ja.y,ja.z).multiplyScalar(0.5).addScalar(0.5)):fa.setRGB(1,1,1),!0===y.wireframe?b(fa,y.wireframeLinewidth,y.wireframeLinecap,y.wireframeLinejoin):c(fa))}}Z.union(qa)}}}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tconst float LOG2 = 1.442695;\n\t\tfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\n\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
 envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\tuniform samplerCube envMap;\n\tuniform float flipEnvMap;\n\tuniform int combine;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\t\tuniform bool useRefract;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\n\tvec3 reflectVec;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = normalize( vec3( vec4( normal, 0.0 ) * viewMatrix ) );\n\t\tif ( useRefract ) {\n\t\t\treflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t} else { \n\t\t\treflectVec = reflect( cameraToVertex, worldNormal );\n\t\t}\n\t#else\n\t\treflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t\tvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#endif\n\t#ifdef GAMMA_INPUT\n\t\tcubeColor.xyz *= cubeColor.xyz;\n\t#endif\n\tif ( combine == 1 ) {\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n\t} else if ( combine == 2 ) {\n\t\tgl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n\t} else {\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n\t}\n#endif",
 envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n\tuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#endif\n\t#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\t#endif\n\t#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\t#endif\n#endif",
 envmap_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\tvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\n\tworldNormal = normalize( worldNormal );\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tif ( useRefract ) {\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t} else {\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t}\n#endif",
@@ -382,54 +382,54 @@ function c(a,b){var c=b.geometry,g=a.faces3,h=3*g.length,k=1*g.length,l=3*g.leng
 2*l;if(g.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var q in g.attributes){var k=g.attributes[q],l={},t;for(t in k)l[t]=k[t];if(!l.__webglInitialized||l.createUniqueBuffers)l.__webglInitialized=!0,c=1,"v2"===l.type?c=2:"v3"===l.type?c=3:"v4"===l.type?c=4:"c"===l.type&&(c=3),l.size=c,l.array=new Float32Array(h*c),l.buffer=m.createBuffer(),l.buffer.belongsToAttribute=q,k.needsUpdate=!0,l.__original=k;a.__webglCustomAttributesList.push(l)}}a.__inittedArrays=
 !0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function g(a,b,c,d){for(var e in b){var f=b[e],g=c[e];if(0<=
 f)if(g){var h=g.itemSize;m.bindBuffer(m.ARRAY_BUFFER,g.buffer);k(f);m.vertexAttribPointer(f,h,m.FLOAT,!1,0,d*h*4)}else a.defaultAttributeValues&&(2===a.defaultAttributeValues[e].length?m.vertexAttrib2fv(f,a.defaultAttributeValues[e]):3===a.defaultAttributeValues[e].length&&m.vertexAttrib3fv(f,a.defaultAttributeValues[e]))}l()}function h(){for(var a=0,b=Ka.length;a<b;a++)Ka[a]=0}function k(a){Ka[a]=1;0===ob[a]&&(m.enableVertexAttribArray(a),ob[a]=1)}function l(){for(var a=0,b=ob.length;a<b;a++)ob[a]!==
-Ka[a]&&(m.disableVertexAttribArray(a),ob[a]=0)}function p(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function q(a,b){return b[0]-a[0]}function r(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)Ia=wa=null,fa=za=ha=Ga=ma=ia=Oa=-1,cb=!0,a[d].render(b,c,ja,ra),Ia=wa=null,fa=za=ha=Ga=ma=ia=Oa=-1,cb=!0}function t(a,b,c,d,e,f,g,h){var k,m,l,p;b?(m=a.length-1,p=b=-1):(m=0,b=a.length,p=1);for(var n=m;n!==b;n+=p)if(k=a[n],k.render){m=k.object;l=k.buffer;if(h)k=h;else{k=k[c];if(!k)continue;g&&P.setBlending(k.blending,
-k.blendEquation,k.blendSrc,k.blendDst);P.setDepthTest(k.depthTest);P.setDepthWrite(k.depthWrite);x(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits)}P.setMaterialFaces(k);l instanceof THREE.BufferGeometry?P.renderBufferDirect(d,e,f,k,l,m):P.renderBuffer(d,e,f,k,l,m)}}function s(a,b,c,d,e,f,g){for(var h,k,m=0,l=a.length;m<l;m++)if(h=a[m],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&P.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);P.setDepthTest(h.depthTest);
-P.setDepthWrite(h.depthWrite);x(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}P.renderImmediateObject(c,d,e,h,k)}}function n(a,d){var e,f,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,f=a.geometry,void 0!==f&&void 0===f.__webglInit))if(f.__webglInit=!0,f.addEventListener("dispose",Eb),f instanceof THREE.BufferGeometry)for(g in f.attributes){var h="index"===g?m.ELEMENT_ARRAY_BUFFER:m.ARRAY_BUFFER,k=f.attributes[g];
+Ka[a]&&(m.disableVertexAttribArray(a),ob[a]=0)}function p(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function q(a,b){return b[0]-a[0]}function r(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)Ia=wa=null,fa=za=ha=Ga=ma=ia=Oa=-1,cb=!0,a[d].render(b,c,ja,ra),Ia=wa=null,fa=za=ha=Ga=ma=ia=Oa=-1,cb=!0}function s(a,b,c,d,e,f,g,h){var k,m,l,p;b?(m=a.length-1,p=b=-1):(m=0,b=a.length,p=1);for(var n=m;n!==b;n+=p)if(k=a[n],k.render){m=k.object;l=k.buffer;if(h)k=h;else{k=k[c];if(!k)continue;g&&P.setBlending(k.blending,
+k.blendEquation,k.blendSrc,k.blendDst);P.setDepthTest(k.depthTest);P.setDepthWrite(k.depthWrite);y(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits)}P.setMaterialFaces(k);l instanceof THREE.BufferGeometry?P.renderBufferDirect(d,e,f,k,l,m):P.renderBuffer(d,e,f,k,l,m)}}function t(a,b,c,d,e,f,g){for(var h,k,m=0,l=a.length;m<l;m++)if(h=a[m],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&P.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);P.setDepthTest(h.depthTest);
+P.setDepthWrite(h.depthWrite);y(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}P.renderImmediateObject(c,d,e,h,k)}}function n(a,d){var e,f,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,f=a.geometry,void 0!==f&&void 0===f.__webglInit))if(f.__webglInit=!0,f.addEventListener("dispose",Eb),f instanceof THREE.BufferGeometry)for(g in f.attributes){var h="index"===g?m.ELEMENT_ARRAY_BUFFER:m.ARRAY_BUFFER,k=f.attributes[g];
 k.buffer=m.createBuffer();m.bindBuffer(h,k.buffer);m.bufferData(h,k.array,m.STATIC_DRAW)}else if(a instanceof THREE.Mesh)for(e in g=a.material,void 0===f.geometryGroups&&f.makeGroups(g instanceof THREE.MeshFaceMaterial,pb?4294967296:65535),f.geometryGroups){if(g=f.geometryGroups[e],!g.__webglVertexBuffer){h=g;h.__webglVertexBuffer=m.createBuffer();h.__webglNormalBuffer=m.createBuffer();h.__webglTangentBuffer=m.createBuffer();h.__webglColorBuffer=m.createBuffer();h.__webglUVBuffer=m.createBuffer();
 h.__webglUV2Buffer=m.createBuffer();h.__webglSkinIndicesBuffer=m.createBuffer();h.__webglSkinWeightsBuffer=m.createBuffer();h.__webglFaceBuffer=m.createBuffer();h.__webglLineBuffer=m.createBuffer();var l=k=void 0;if(h.numMorphTargets)for(h.__webglMorphTargetsBuffers=[],k=0,l=h.numMorphTargets;k<l;k++)h.__webglMorphTargetsBuffers.push(m.createBuffer());if(h.numMorphNormals)for(h.__webglMorphNormalsBuffers=[],k=0,l=h.numMorphNormals;k<l;k++)h.__webglMorphNormalsBuffers.push(m.createBuffer());P.info.memory.geometries++;
 c(g,a);f.verticesNeedUpdate=!0;f.morphTargetsNeedUpdate=!0;f.elementsNeedUpdate=!0;f.uvsNeedUpdate=!0;f.normalsNeedUpdate=!0;f.tangentsNeedUpdate=!0;f.colorsNeedUpdate=!0}}else a instanceof THREE.Line?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=m.createBuffer(),g.__webglColorBuffer=m.createBuffer(),g.__webglLineDistanceBuffer=m.createBuffer(),P.info.memory.geometries++,g=f,h=g.vertices.length,g.__vertexArray=new Float32Array(3*h),g.__colorArray=new Float32Array(3*h),g.__lineDistanceArray=new Float32Array(1*
 h),g.__webglLineCount=h,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof THREE.PointCloud&&!f.__webglVertexBuffer&&(g=f,g.__webglVertexBuffer=m.createBuffer(),g.__webglColorBuffer=m.createBuffer(),P.info.memory.geometries++,g=f,h=g.vertices.length,g.__vertexArray=new Float32Array(3*h),g.__colorArray=new Float32Array(3*h),g.__sortArray=[],g.__webglParticleCount=h,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof
 THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)v(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=f.geometryGroups[e],v(d.__webglObjects,g,a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?(f=a.geometry,v(d.__webglObjects,f,a)):a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?d.__webglObjectsImmediate.push({id:null,object:a,opaque:null,transparent:null,z:0}):a instanceof THREE.Sprite?d.__webglSprites.push(a):a instanceof
-THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function v(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function w(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function u(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function y(a,b){a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line?M(b.__webglObjects,a):a instanceof THREE.Sprite?B(b.__webglSprites,a):a instanceof THREE.LensFlare?
-B(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&M(b.__webglObjectsImmediate,a);delete a.__webglActive}function M(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function B(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function D(a,b,c,d,e){Ea=0;d.needsUpdate&&(d.program&&Fb(d),P.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(P.maxMorphTargets));
+THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function v(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function w(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function u(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function x(a,b){a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line?F(b.__webglObjects,a):a instanceof THREE.Sprite?C(b.__webglSprites,a):a instanceof THREE.LensFlare?
+C(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&F(b.__webglObjectsImmediate,a);delete a.__webglActive}function F(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function C(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function D(a,b,c,d,e){Ea=0;d.needsUpdate&&(d.program&&Fb(d),P.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(P.maxMorphTargets));
 var f=!1,g=d.program,h=g.uniforms,k=d.uniforms;g.id!==wa&&(m.useProgram(g.program),wa=g.id,f=!0);d.id!==fa&&(fa=d.id,f=!0);if(f||a!==Ia)m.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),da&&m.uniform1f(h.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Ia&&(Ia=a);if(d.skinning)if(Gb&&e.skeleton.useVertexTexture){if(null!==h.boneTexture){var l=z();m.uniform1i(h.boneTexture,l);P.setTexture(e.skeleton.boneTexture,l)}null!==h.boneTextureWidth&&m.uniform1i(h.boneTextureWidth,e.skeleton.boneTextureWidth);
 null!==h.boneTextureHeight&&m.uniform1i(h.boneTextureHeight,e.skeleton.boneTextureHeight)}else null!==h.boneGlobalMatrices&&m.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(f){c&&d.fog&&(k.fogColor.value=c.color,c instanceof THREE.Fog?(k.fogNear.value=c.near,k.fogFar.value=c.far):c instanceof THREE.FogExp2&&(k.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(cb){var p,n=l=0,r=0,q,t,s,u=Bb,v=u.directional.colors,
-w=u.directional.positions,y=u.point.colors,x=u.point.positions,B=u.point.distances,C=u.spot.colors,M=u.spot.positions,D=u.spot.distances,G=u.spot.directions,Q=u.spot.anglesCos,O=u.spot.exponents,E=u.hemi.skyColors,K=u.hemi.groundColors,U=u.hemi.positions,Y=0,ga=0,R=0,X=0,$=0,aa=0,ba=0,Z=0,W=p=0;c=s=W=0;for(f=b.length;c<f;c++)if(p=b[c],!p.onlyShadow)if(q=p.color,t=p.intensity,s=p.distance,p instanceof THREE.AmbientLight)p.visible&&(P.gammaInput?(l+=q.r*q.r,n+=q.g*q.g,r+=q.b*q.b):(l+=q.r,n+=q.g,r+=
-q.b));else if(p instanceof THREE.DirectionalLight){if($+=1,p.visible&&(oa.setFromMatrixPosition(p.matrixWorld),xa.setFromMatrixPosition(p.target.matrixWorld),oa.sub(xa),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))p=3*Y,w[p]=oa.x,w[p+1]=oa.y,w[p+2]=oa.z,P.gammaInput?F(v,p,q,t*t):H(v,p,q,t),Y+=1}else p instanceof THREE.PointLight?(aa+=1,p.visible&&(W=3*ga,P.gammaInput?F(y,W,q,t*t):H(y,W,q,t),xa.setFromMatrixPosition(p.matrixWorld),x[W]=xa.x,x[W+1]=xa.y,x[W+2]=xa.z,B[ga]=s,ga+=1)):p instanceof THREE.SpotLight?
-(ba+=1,p.visible&&(W=3*R,P.gammaInput?F(C,W,q,t*t):H(C,W,q,t),xa.setFromMatrixPosition(p.matrixWorld),M[W]=xa.x,M[W+1]=xa.y,M[W+2]=xa.z,D[R]=s,oa.copy(xa),xa.setFromMatrixPosition(p.target.matrixWorld),oa.sub(xa),oa.normalize(),G[W]=oa.x,G[W+1]=oa.y,G[W+2]=oa.z,Q[R]=Math.cos(p.angle),O[R]=p.exponent,R+=1)):p instanceof THREE.HemisphereLight&&(Z+=1,p.visible&&(oa.setFromMatrixPosition(p.matrixWorld),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))&&(s=3*X,U[s]=oa.x,U[s+1]=oa.y,U[s+2]=oa.z,q=p.color,p=
-p.groundColor,P.gammaInput?(t*=t,F(E,s,q,t),F(K,s,p,t)):(H(E,s,q,t),H(K,s,p,t)),X+=1);c=3*Y;for(f=Math.max(v.length,3*$);c<f;c++)v[c]=0;c=3*ga;for(f=Math.max(y.length,3*aa);c<f;c++)y[c]=0;c=3*R;for(f=Math.max(C.length,3*ba);c<f;c++)C[c]=0;c=3*X;for(f=Math.max(E.length,3*Z);c<f;c++)E[c]=0;c=3*X;for(f=Math.max(K.length,3*Z);c<f;c++)K[c]=0;u.directional.length=Y;u.point.length=ga;u.spot.length=R;u.hemi.length=X;u.ambient[0]=l;u.ambient[1]=n;u.ambient[2]=r;cb=!1}c=Bb;k.ambientLightColor.value=c.ambient;
+w=u.directional.positions,x=u.point.colors,F=u.point.positions,y=u.point.distances,C=u.spot.colors,B=u.spot.positions,D=u.spot.distances,H=u.spot.directions,Q=u.spot.anglesCos,O=u.spot.exponents,E=u.hemi.skyColors,L=u.hemi.groundColors,U=u.hemi.positions,Y=0,ga=0,R=0,X=0,$=0,aa=0,ba=0,Z=0,W=p=0;c=s=W=0;for(f=b.length;c<f;c++)if(p=b[c],!p.onlyShadow)if(q=p.color,t=p.intensity,s=p.distance,p instanceof THREE.AmbientLight)p.visible&&(P.gammaInput?(l+=q.r*q.r,n+=q.g*q.g,r+=q.b*q.b):(l+=q.r,n+=q.g,r+=
+q.b));else if(p instanceof THREE.DirectionalLight){if($+=1,p.visible&&(oa.setFromMatrixPosition(p.matrixWorld),xa.setFromMatrixPosition(p.target.matrixWorld),oa.sub(xa),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))p=3*Y,w[p]=oa.x,w[p+1]=oa.y,w[p+2]=oa.z,P.gammaInput?G(v,p,q,t*t):I(v,p,q,t),Y+=1}else p instanceof THREE.PointLight?(aa+=1,p.visible&&(W=3*ga,P.gammaInput?G(x,W,q,t*t):I(x,W,q,t),xa.setFromMatrixPosition(p.matrixWorld),F[W]=xa.x,F[W+1]=xa.y,F[W+2]=xa.z,y[ga]=s,ga+=1)):p instanceof THREE.SpotLight?
+(ba+=1,p.visible&&(W=3*R,P.gammaInput?G(C,W,q,t*t):I(C,W,q,t),xa.setFromMatrixPosition(p.matrixWorld),B[W]=xa.x,B[W+1]=xa.y,B[W+2]=xa.z,D[R]=s,oa.copy(xa),xa.setFromMatrixPosition(p.target.matrixWorld),oa.sub(xa),oa.normalize(),H[W]=oa.x,H[W+1]=oa.y,H[W+2]=oa.z,Q[R]=Math.cos(p.angle),O[R]=p.exponent,R+=1)):p instanceof THREE.HemisphereLight&&(Z+=1,p.visible&&(oa.setFromMatrixPosition(p.matrixWorld),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))&&(s=3*X,U[s]=oa.x,U[s+1]=oa.y,U[s+2]=oa.z,q=p.color,p=
+p.groundColor,P.gammaInput?(t*=t,G(E,s,q,t),G(L,s,p,t)):(I(E,s,q,t),I(L,s,p,t)),X+=1);c=3*Y;for(f=Math.max(v.length,3*$);c<f;c++)v[c]=0;c=3*ga;for(f=Math.max(x.length,3*aa);c<f;c++)x[c]=0;c=3*R;for(f=Math.max(C.length,3*ba);c<f;c++)C[c]=0;c=3*X;for(f=Math.max(E.length,3*Z);c<f;c++)E[c]=0;c=3*X;for(f=Math.max(L.length,3*Z);c<f;c++)L[c]=0;u.directional.length=Y;u.point.length=ga;u.spot.length=R;u.hemi.length=X;u.ambient[0]=l;u.ambient[1]=n;u.ambient[2]=r;cb=!1}c=Bb;k.ambientLightColor.value=c.ambient;
 k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;k.pointLightColor.value=c.point.colors;k.pointLightPosition.value=c.point.positions;k.pointLightDistance.value=c.point.distances;k.spotLightColor.value=c.spot.colors;k.spotLightPosition.value=c.spot.positions;k.spotLightDistance.value=c.spot.distances;k.spotLightDirection.value=c.spot.directions;k.spotLightAngleCos.value=c.spot.anglesCos;k.spotLightExponent.value=c.spot.exponents;k.hemisphereLightSkyColor.value=
 c.hemi.skyColors;k.hemisphereLightGroundColor.value=c.hemi.groundColors;k.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=d.opacity;P.gammaInput?k.diffuse.value.copyGammaToLinear(d.color):k.diffuse.value=d.color;k.map.value=d.map;k.lightMap.value=d.lightMap;k.specularMap.value=d.specularMap;d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale);d.normalMap&&
 (k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale));var V;d.map?V=d.map:d.specularMap?V=d.specularMap:d.normalMap?V=d.normalMap:d.bumpMap&&(V=d.bumpMap);void 0!==V&&(c=V.offset,V=V.repeat,k.offsetRepeat.value.set(c.x,c.y,V.x,V.y));k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio;k.combine.value=d.combine;k.useRefract.value=d.envMap&&d.envMap.mapping instanceof
-THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value=d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=J.height/2,k.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(k.shininess.value=
+THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value=d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=K.height/2,k.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(k.shininess.value=
 d.shininess,P.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive),k.specular.value.copyGammaToLinear(d.specular)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive,k.specular.value=d.specular),d.wrapAround&&k.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(P.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive),d.wrapAround&&
 k.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(k.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(c=V=0,f=b.length;c<f;c++)l=b[c],l.castShadow&&(l instanceof THREE.SpotLight||l instanceof THREE.DirectionalLight&&!l.shadowCascade)&&(k.shadowMap.value[V]=l.shadowMap,k.shadowMapSize.value[V]=l.shadowMapSize,k.shadowMatrix.value[V]=l.shadowMatrix,
 k.shadowDarkness.value[V]=l.shadowDarkness,k.shadowBias.value[V]=l.shadowBias,V++);b=d.uniformsList;k=0;for(V=b.length;k<V;k++)if(f=g.uniforms[b[k][1]])if(c=b[k][0],n=c.type,l=c.value,"i"===n)m.uniform1i(f,l);else if("f"===n)m.uniform1f(f,l);else if("v2"===n)m.uniform2f(f,l.x,l.y);else if("v3"===n)m.uniform3f(f,l.x,l.y,l.z);else if("v4"===n)m.uniform4f(f,l.x,l.y,l.z,l.w);else if("c"===n)m.uniform3f(f,l.r,l.g,l.b);else if("iv1"===n)m.uniform1iv(f,l);else if("iv"===n)m.uniform3iv(f,l);else if("fv1"===
 n)m.uniform1fv(f,l);else if("fv"===n)m.uniform3fv(f,l);else if("v2v"===n){void 0===c._array&&(c._array=new Float32Array(2*l.length));n=0;for(r=l.length;n<r;n++)u=2*n,c._array[u]=l[n].x,c._array[u+1]=l[n].y;m.uniform2fv(f,c._array)}else if("v3v"===n){void 0===c._array&&(c._array=new Float32Array(3*l.length));n=0;for(r=l.length;n<r;n++)u=3*n,c._array[u]=l[n].x,c._array[u+1]=l[n].y,c._array[u+2]=l[n].z;m.uniform3fv(f,c._array)}else if("v4v"===n){void 0===c._array&&(c._array=new Float32Array(4*l.length));
 n=0;for(r=l.length;n<r;n++)u=4*n,c._array[u]=l[n].x,c._array[u+1]=l[n].y,c._array[u+2]=l[n].z,c._array[u+3]=l[n].w;m.uniform4fv(f,c._array)}else if("m3"===n)m.uniformMatrix3fv(f,!1,l.elements);else if("m3v"===n){void 0===c._array&&(c._array=new Float32Array(9*l.length));n=0;for(r=l.length;n<r;n++)l[n].flattenToArrayOffset(c._array,9*n);m.uniformMatrix3fv(f,!1,c._array)}else if("m4"===n)m.uniformMatrix4fv(f,!1,l.elements);else if("m4v"===n){void 0===c._array&&(c._array=new Float32Array(16*l.length));
 n=0;for(r=l.length;n<r;n++)l[n].flattenToArrayOffset(c._array,16*n);m.uniformMatrix4fv(f,!1,c._array)}else if("t"===n){if(u=l,l=z(),m.uniform1i(f,l),u)if(u.image instanceof Array&&6===u.image.length){if(c=u,f=l,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||(c.addEventListener("dispose",Hb),c.image.__webglTextureCube=m.createTexture(),P.info.memory.textures++);m.activeTexture(m.TEXTURE0+f);m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,
-c.flipY);f=c instanceof THREE.CompressedTexture;l=[];for(n=0;6>n;n++)P.autoScaleCubemaps&&!f?(r=l,u=n,v=c.image[n],y=dc,v.width<=y&&v.height<=y||(x=Math.max(v.width,v.height),w=Math.floor(v.width*y/x),y=Math.floor(v.height*y/x),x=document.createElement("canvas"),x.width=w,x.height=y,x.getContext("2d").drawImage(v,0,0,v.width,v.height,0,0,w,y),v=x),r[u]=v):l[n]=c.image[n];n=l[0];r=THREE.Math.isPowerOfTwo(n.width)&&THREE.Math.isPowerOfTwo(n.height);u=L(c.format);v=L(c.type);A(m.TEXTURE_CUBE_MAP,c,r);
-for(n=0;6>n;n++)if(f)for(y=l[n].mipmaps,x=0,B=y.length;x<B;x++)w=y[x],c.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,x,u,w.width,w.height,0,w.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,x,u,w.width,w.height,0,u,v,w.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,u,u,v,l[n]);c.generateMipmaps&&r&&m.generateMipmap(m.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else m.activeTexture(m.TEXTURE0+f),m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else u instanceof
+c.flipY);f=c instanceof THREE.CompressedTexture;l=[];for(n=0;6>n;n++)P.autoScaleCubemaps&&!f?(r=l,u=n,v=c.image[n],x=dc,v.width<=x&&v.height<=x||(F=Math.max(v.width,v.height),w=Math.floor(v.width*x/F),x=Math.floor(v.height*x/F),F=document.createElement("canvas"),F.width=w,F.height=x,F.getContext("2d").drawImage(v,0,0,v.width,v.height,0,0,w,x),v=F),r[u]=v):l[n]=c.image[n];n=l[0];r=THREE.Math.isPowerOfTwo(n.width)&&THREE.Math.isPowerOfTwo(n.height);u=M(c.format);v=M(c.type);A(m.TEXTURE_CUBE_MAP,c,r);
+for(n=0;6>n;n++)if(f)for(x=l[n].mipmaps,F=0,y=x.length;F<y;F++)w=x[F],c.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,F,u,w.width,w.height,0,w.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,F,u,w.width,w.height,0,u,v,w.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,u,u,v,l[n]);c.generateMipmaps&&r&&m.generateMipmap(m.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else m.activeTexture(m.TEXTURE0+f),m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else u instanceof
 THREE.WebGLRenderTargetCube?(c=u,m.activeTexture(m.TEXTURE0+l),m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture)):P.setTexture(u,l)}else if("tv"===n){void 0===c._array&&(c._array=[]);n=0;for(r=c.value.length;n<r;n++)c._array[n]=z();m.uniform1iv(f,c._array);n=0;for(r=c.value.length;n<r;n++)u=c.value[n],l=c._array[n],u&&P.setTexture(u,l)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+n);(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==h.cameraPosition&&
 (xa.setFromMatrixPosition(a.matrixWorld),m.uniform3f(h.cameraPosition,xa.x,xa.y,xa.z));(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==h.viewMatrix&&m.uniformMatrix4fv(h.viewMatrix,!1,a.matrixWorldInverse.elements)}m.uniformMatrix4fv(h.modelViewMatrix,!1,e._modelViewMatrix.elements);h.normalMatrix&&m.uniformMatrix3fv(h.normalMatrix,!1,e._normalMatrix.elements);null!==h.modelMatrix&&m.uniformMatrix4fv(h.modelMatrix,
-!1,e.matrixWorld.elements);return g}function z(){var a=Ea;a>=Cb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Cb);Ea+=1;return a}function F(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function H(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function C(a){a!==ua&&(m.lineWidth(a),ua=a)}function x(a,b,c){ya!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),ya=a);!a||Z===b&&qa===c||(m.polygonOffset(b,c),Z=b,qa=c)}function A(a,
-b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,L(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,L(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,L(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,L(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,K(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,K(b.minFilter)));db&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(m.texParameterf(a,
+!1,e.matrixWorld.elements);return g}function z(){var a=Ea;a>=Cb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Cb);Ea+=1;return a}function G(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function I(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function B(a){a!==ua&&(m.lineWidth(a),ua=a)}function y(a,b,c){ya!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),ya=a);!a||Z===b&&qa===c||(m.polygonOffset(b,c),Z=b,qa=c)}function A(a,
+b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,M(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,M(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,M(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,M(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,L(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,L(b.minFilter)));db&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(m.texParameterf(a,
 db.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Ib)),b.__oldAnisotropy=b.anisotropy)}function O(a,b){m.bindRenderbuffer(m.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,
-a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,b.width,b.height)}function K(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?m.NEAREST:m.LINEAR}function L(a){if(a===THREE.RepeatWrapping)return m.REPEAT;if(a===THREE.ClampToEdgeWrapping)return m.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return m.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return m.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return m.NEAREST_MIPMAP_NEAREST;if(a===
+a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,b.width,b.height)}function L(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?m.NEAREST:m.LINEAR}function M(a){if(a===THREE.RepeatWrapping)return m.REPEAT;if(a===THREE.ClampToEdgeWrapping)return m.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return m.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return m.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return m.NEAREST_MIPMAP_NEAREST;if(a===
 THREE.NearestMipMapLinearFilter)return m.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return m.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return m.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return m.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return m.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return m.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return m.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return m.UNSIGNED_SHORT_5_6_5;if(a===
 THREE.ByteType)return m.BYTE;if(a===THREE.ShortType)return m.SHORT;if(a===THREE.UnsignedShortType)return m.UNSIGNED_SHORT;if(a===THREE.IntType)return m.INT;if(a===THREE.UnsignedIntType)return m.UNSIGNED_INT;if(a===THREE.FloatType)return m.FLOAT;if(a===THREE.AlphaFormat)return m.ALPHA;if(a===THREE.RGBFormat)return m.RGB;if(a===THREE.RGBAFormat)return m.RGBA;if(a===THREE.LuminanceFormat)return m.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return m.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return m.FUNC_ADD;
 if(a===THREE.SubtractEquation)return m.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return m.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return m.ZERO;if(a===THREE.OneFactor)return m.ONE;if(a===THREE.SrcColorFactor)return m.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return m.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return m.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return m.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return m.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return m.ONE_MINUS_DST_ALPHA;
 if(a===THREE.DstColorFactor)return m.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return m.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return m.SRC_ALPHA_SATURATE;if(void 0!==Pa){if(a===THREE.RGB_S3TC_DXT1_Format)return Pa.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Pa.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Pa.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Pa.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",
-THREE.REVISION);a=a||{};var J=void 0!==a.canvas?a.canvas:document.createElement("canvas"),G=void 0!==a.context?a.context:null,Q=void 0!==a.precision?a.precision:"highp",Y=void 0!==a.alpha?a.alpha:!1,U=void 0!==a.depth?a.depth:!0,la=void 0!==a.stencil?a.stencil:!0,W=void 0!==a.antialias?a.antialias:!1,R=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,E=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,da=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,V=new THREE.Color(0),
-X=0;this.domElement=J;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=
-8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var P=this,ga=[],wa=null,Ha=null,fa=-1,za=null,Ia=null,Ea=0,Ga=-1,ha=-1,Oa=-1,Ra=-1,Sa=-1,Fa=-1,ia=-1,ma=-1,ya=null,Z=null,qa=null,ua=null,Ca=0,va=0,Da=J.width,Ja=J.height,ja=0,ra=0,Ka=new Uint8Array(16),ob=new Uint8Array(16),Ab=new THREE.Frustum,Pb=new THREE.Matrix4,cc=new THREE.Matrix4,xa=new THREE.Vector3,
-oa=new THREE.Vector3,cb=!0,Bb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},m,sb,xb,db,Pa,pb;(function(){try{var a={alpha:Y,depth:U,stencil:la,antialias:W,premultipliedAlpha:R,preserveDrawingBuffer:E};m=G||J.getContext("webgl",a)||J.getContext("experimental-webgl",a);if(null===m)throw"Error creating WebGL context.";
+THREE.REVISION);a=a||{};var K=void 0!==a.canvas?a.canvas:document.createElement("canvas"),H=void 0!==a.context?a.context:null,Q=void 0!==a.precision?a.precision:"highp",Y=void 0!==a.alpha?a.alpha:!1,U=void 0!==a.depth?a.depth:!0,la=void 0!==a.stencil?a.stencil:!0,W=void 0!==a.antialias?a.antialias:!1,R=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,E=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,da=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,V=new THREE.Color(0),
+X=0;this.domElement=K;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=
+8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var P=this,ga=[],wa=null,Ha=null,fa=-1,za=null,Ia=null,Ea=0,Ga=-1,ha=-1,Oa=-1,Ra=-1,Sa=-1,Fa=-1,ia=-1,ma=-1,ya=null,Z=null,qa=null,ua=null,Ca=0,va=0,Da=K.width,Ja=K.height,ja=0,ra=0,Ka=new Uint8Array(16),ob=new Uint8Array(16),Ab=new THREE.Frustum,Pb=new THREE.Matrix4,cc=new THREE.Matrix4,xa=new THREE.Vector3,
+oa=new THREE.Vector3,cb=!0,Bb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},m,sb,xb,db,Pa,pb;(function(){try{var a={alpha:Y,depth:U,stencil:la,antialias:W,premultipliedAlpha:R,preserveDrawingBuffer:E};m=H||K.getContext("webgl",a)||K.getContext("experimental-webgl",a);if(null===m)throw"Error creating WebGL context.";
 }catch(b){console.error(b)}sb=m.getExtension("OES_texture_float");m.getExtension("OES_texture_float_linear");xb=m.getExtension("OES_standard_derivatives");db=m.getExtension("EXT_texture_filter_anisotropic")||m.getExtension("MOZ_EXT_texture_filter_anisotropic")||m.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Pa=m.getExtension("WEBGL_compressed_texture_s3tc")||m.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||m.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");pb=m.getExtension("OES_element_index_uint");
 null===sb&&console.log("THREE.WebGLRenderer: Float textures not supported.");null===xb&&console.log("THREE.WebGLRenderer: Standard derivatives not supported.");null===db&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");null===Pa&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");null===pb&&console.log("THREE.WebGLRenderer: elementindex as unsigned integer not supported.");void 0===m.getShaderPrecisionFormat&&(m.getShaderPrecisionFormat=function(){return{rangeMin:1,
 rangeMax:1,precision:1}});da&&m.getExtension("EXT_frag_depth")})();m.clearColor(0,0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.viewport(Ca,va,Da,Ja);m.clearColor(V.r,V.g,V.b,X);this.context=m;var Cb=m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),Db=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS);m.getParameter(m.MAX_TEXTURE_SIZE);
 var dc=m.getParameter(m.MAX_CUBE_MAP_TEXTURE_SIZE),Ib=db?m.getParameter(db.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Jb=0<Db,Gb=Jb&&sb;Pa&&m.getParameter(m.COMPRESSED_TEXTURE_FORMATS);var ec=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.HIGH_FLOAT),qc=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.LOW_FLOAT);var rc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_FLOAT),sc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,
 m.LOW_FLOAT);var tc=0<ec.precision&&0<rc.precision,Kb=0<qc.precision&&0<sc.precision;"highp"!==Q||tc||(Kb?(Q="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(Q="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));"mediump"!==Q||Kb||(Q="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return m};this.supportsVertexTextures=function(){return Jb};this.supportsFloatTextures=function(){return sb};
-this.supportsStandardDerivatives=function(){return xb};this.supportsCompressedTextureS3TC=function(){return Pa};this.getMaxAnisotropy=function(){return Ib};this.getPrecision=function(){return Q};this.setSize=function(a,b,c){J.width=a*this.devicePixelRatio;J.height=b*this.devicePixelRatio;!1!==c&&(J.style.width=a+"px",J.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ca=a*this.devicePixelRatio;va=b*this.devicePixelRatio;Da=c*this.devicePixelRatio;Ja=d*this.devicePixelRatio;
+this.supportsStandardDerivatives=function(){return xb};this.supportsCompressedTextureS3TC=function(){return Pa};this.getMaxAnisotropy=function(){return Ib};this.getPrecision=function(){return Q};this.setSize=function(a,b,c){K.width=a*this.devicePixelRatio;K.height=b*this.devicePixelRatio;!1!==c&&(K.style.width=a+"px",K.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ca=a*this.devicePixelRatio;va=b*this.devicePixelRatio;Da=c*this.devicePixelRatio;Ja=d*this.devicePixelRatio;
 m.viewport(Ca,va,Da,Ja)};this.setScissor=function(a,b,c,d){m.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColor=function(a,b){V.set(a);X=void 0!==b?b:1;m.clearColor(V.r,V.g,V.b,X)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};
 this.getClearColor=function(){return V};this.getClearAlpha=function(){return X};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=m.COLOR_BUFFER_BIT;if(void 0===b||b)d|=m.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=m.STENCIL_BUFFER_BIT;m.clear(d)};this.clearColor=function(){m.clear(m.COLOR_BUFFER_BIT)};this.clearDepth=function(){m.clear(m.DEPTH_BUFFER_BIT)};this.clearStencil=function(){m.clear(m.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=
 function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){wa=null;fa=za=ma=ia=Oa=-1;cb=!0;ha=Ga=-1;this.shadowMapPlugin.update(a,b)};var Eb=function(a){a=a.target;a.removeEventListener("dispose",Eb);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&m.deleteBuffer(b[c].buffer);P.info.memory.geometries--}else if(void 0!==a.geometryGroups)for(b in a.geometryGroups){c=
@@ -442,7 +442,7 @@ m.createBuffer());a.hasPositions&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBu
 p+r)/3,f=(f+q+t)/3,s[u]=d,s[u+1]=e,s[u+2]=f,s[u+3]=d,s[u+4]=e,s[u+5]=f,s[u+6]=d,s[u+7]=e,s[u+8]=f}m.bufferData(m.ARRAY_BUFFER,a.normalArray,m.DYNAMIC_DRAW);k(b.attributes.normal);m.vertexAttribPointer(b.attributes.normal,3,m.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglUvBuffer),m.bufferData(m.ARRAY_BUFFER,a.uvArray,m.DYNAMIC_DRAW),k(b.attributes.uv),m.vertexAttribPointer(b.attributes.uv,2,m.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,
 a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),k(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));l();m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var k=D(a,b,c,d,f);a=k.attributes;b=e.attributes;c=!1;k=16777215*e.id+2*k.id+(d.wireframe?1:0);k!==za&&(za=k,c=!0);c&&h();if(f instanceof THREE.Mesh)if(f=b.index){var l;f.array instanceof Uint32Array?(k=m.UNSIGNED_INT,l=4):(k=
 m.UNSIGNED_SHORT,l=2);e=e.offsets;if(0===e.length)c&&(g(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.TRIANGLES,f.array.length,k,0),P.info.render.calls++,P.info.render.vertices+=f.array.length,P.info.render.faces+=f.array.length/3;else{c=!0;for(var n=0,p=e.length;n<p;n++){var r=e[n].index;c&&(g(d,a,b,r),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer));m.drawElements(m.TRIANGLES,e[n].count,k,e[n].start*l);P.info.render.calls++;P.info.render.vertices+=e[n].count;P.info.render.faces+=
-e[n].count/3}}}else c&&g(d,a,b,0),d=e.attributes.position,m.drawArrays(m.TRIANGLES,0,d.array.length/3),P.info.render.calls++,P.info.render.vertices+=d.array.length/3,P.info.render.faces+=d.array.length/9;else if(f instanceof THREE.PointCloud)c&&g(d,a,b,0),d=b.position,m.drawArrays(m.POINTS,0,d.array.length/3),P.info.render.calls++,P.info.render.points+=d.array.length/3;else if(f instanceof THREE.Line)if(k=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,C(d.linewidth),f=b.index)if(f.array instanceof
+e[n].count/3}}}else c&&g(d,a,b,0),d=e.attributes.position,m.drawArrays(m.TRIANGLES,0,d.array.length/3),P.info.render.calls++,P.info.render.vertices+=d.array.length/3,P.info.render.faces+=d.array.length/9;else if(f instanceof THREE.PointCloud)c&&g(d,a,b,0),d=b.position,m.drawArrays(m.POINTS,0,d.array.length/3),P.info.render.calls++,P.info.render.points+=d.array.length/3;else if(f instanceof THREE.Line)if(k=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,B(d.linewidth),f=b.index)if(f.array instanceof
 Uint32Array?(k=m.UNSIGNED_INT,l=4):(k=m.UNSIGNED_SHORT,l=2),e=e.offsets,0===e.length)c&&(g(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,f.array.length,k,0),P.info.render.calls++,P.info.render.vertices+=f.array.length;else for(1<e.length&&(c=!0),n=0,p=e.length;n<p;n++)r=e[n].index,c&&(g(d,a,b,r),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,e[n].count,k,e[n].start*l),P.info.render.calls++,P.info.render.vertices+=e[n].count;else c&&g(d,a,b,0),
 d=b.position,m.drawArrays(k,0,d.array.length/3),P.info.render.calls++,P.info.render.points+=d.array.length/3}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,n;c=D(a,b,c,d,f);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==za&&(za=c,a=!0);a&&h();if(!d.morphTargets&&0<=b.position)a&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),k(b.position),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&
 0<=c.position?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),k(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0)):0<=c.position&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),k(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var p=0;n=f.morphTargetForcedOrder;for(g=f.morphTargetInfluences;p<d.numSupportedMorphTargets&&p<n.length;)0<=c["morphTarget"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[n[p]]),
@@ -451,32 +451,32 @@ d.numSupportedMorphNormals?n.sort(q):0===n.length&&n.push([0,0]);for(p=0;p<d.num
 g[r]):f.__webglMorphTargetInfluences[p]=0,p++}null!==d.program.uniforms.morphTargetInfluences&&m.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(g=0,n=e.__webglCustomAttributesList.length;g<n;g++)c=e.__webglCustomAttributesList[g],0<=b[c.buffer.belongsToAttribute]&&(m.bindBuffer(m.ARRAY_BUFFER,c.buffer),k(b[c.buffer.belongsToAttribute]),m.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,m.FLOAT,!1,0,0));0<=b.color&&
 (0<f.geometry.colors.length||0<f.geometry.faces.length?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglColorBuffer),k(b.color),m.vertexAttribPointer(b.color,3,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglNormalBuffer),k(b.normal),m.vertexAttribPointer(b.normal,3,m.FLOAT,!1,0,0));0<=b.tangent&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglTangentBuffer),k(b.tangent),m.vertexAttribPointer(b.tangent,4,m.FLOAT,!1,
 0,0));0<=b.uv&&(f.geometry.faceVertexUvs[0]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUVBuffer),k(b.uv),m.vertexAttribPointer(b.uv,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(f.geometry.faceVertexUvs[1]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUV2Buffer),k(b.uv2),m.vertexAttribPointer(b.uv2,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(m.bindBuffer(m.ARRAY_BUFFER,
-e.__webglSkinIndicesBuffer),k(b.skinIndex),m.vertexAttribPointer(b.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),k(b.skinWeight),m.vertexAttribPointer(b.skinWeight,4,m.FLOAT,!1,0,0));0<=b.lineDistance&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglLineDistanceBuffer),k(b.lineDistance),m.vertexAttribPointer(b.lineDistance,1,m.FLOAT,!1,0,0))}l();f instanceof THREE.Mesh?(f=e.__typeArray===Uint32Array?m.UNSIGNED_INT:m.UNSIGNED_SHORT,d.wireframe?(C(d.wireframeLinewidth),a&&
-m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),m.drawElements(m.LINES,e.__webglLineCount,f,0)):(a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),m.drawElements(m.TRIANGLES,e.__webglFaceCount,f,0)),P.info.render.calls++,P.info.render.vertices+=e.__webglFaceCount,P.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,C(d.linewidth),m.drawArrays(f,0,e.__webglLineCount),P.info.render.calls++):f instanceof THREE.PointCloud&&
+e.__webglSkinIndicesBuffer),k(b.skinIndex),m.vertexAttribPointer(b.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),k(b.skinWeight),m.vertexAttribPointer(b.skinWeight,4,m.FLOAT,!1,0,0));0<=b.lineDistance&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglLineDistanceBuffer),k(b.lineDistance),m.vertexAttribPointer(b.lineDistance,1,m.FLOAT,!1,0,0))}l();f instanceof THREE.Mesh?(f=e.__typeArray===Uint32Array?m.UNSIGNED_INT:m.UNSIGNED_SHORT,d.wireframe?(B(d.wireframeLinewidth),a&&
+m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),m.drawElements(m.LINES,e.__webglLineCount,f,0)):(a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),m.drawElements(m.TRIANGLES,e.__webglFaceCount,f,0)),P.info.render.calls++,P.info.render.vertices+=e.__webglFaceCount,P.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,B(d.linewidth),m.drawArrays(f,0,e.__webglLineCount),P.info.render.calls++):f instanceof THREE.PointCloud&&
 (m.drawArrays(m.POINTS,0,e.__webglParticleCount),P.info.render.calls++,P.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h,k=a.__lights,l=a.fog;fa=-1;cb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Pb.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);
 Ab.setFromMatrix(Pb);this.autoUpdateObjects&&this.initWebGLObjects(a);r(this.renderPluginsPre,a,b);P.info.render.calls=0;P.info.render.vertices=0;P.info.render.faces=0;P.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);h=a.__webglObjects;d=0;for(e=h.length;d<e;d++)if(f=h[d],g=f.object,f.id=d,f.render=!1,g.visible&&(!1===g.frustumCulled||!0===Ab.intersectsObject(g))){var n=g;n._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
 n.matrixWorld);n._normalMatrix.getNormalMatrix(n._modelViewMatrix);var n=f,q=n.object,u=n.buffer,v=q.geometry,q=q.material;q instanceof THREE.MeshFaceMaterial?(q=q.materials[v instanceof THREE.BufferGeometry?0:u.materialIndex],q.transparent?(n.transparent=q,n.opaque=null):(n.opaque=q,n.transparent=null)):q&&(q.transparent?(n.transparent=q,n.opaque=null):(n.opaque=q,n.transparent=null));f.render=!0;!0===this.sortObjects&&(null!==g.renderDepth?f.z=g.renderDepth:(xa.setFromMatrixPosition(g.matrixWorld),
 xa.applyProjection(Pb),f.z=xa.z))}this.sortObjects&&h.sort(p);h=a.__webglObjectsImmediate;d=0;for(e=h.length;d<e;d++)f=h[d],g=f.object,g.visible&&(g._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,g.matrixWorld),g._normalMatrix.getNormalMatrix(g._modelViewMatrix),g=f.object.material,g.transparent?(f.transparent=g,f.opaque=null):(f.opaque=g,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),
-this.setDepthWrite(d.depthWrite),x(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),t(a.__webglObjects,!1,"",b,k,l,!0,d),s(a.__webglObjectsImmediate,"",b,k,l,!1,d)):(d=null,this.setBlending(THREE.NoBlending),t(a.__webglObjects,!0,"opaque",b,k,l,!1,d),s(a.__webglObjectsImmediate,"opaque",b,k,l,!1,d),t(a.__webglObjects,!1,"transparent",b,k,l,!0,d),s(a.__webglObjectsImmediate,"transparent",b,k,l,!0,d));r(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&
+this.setDepthWrite(d.depthWrite),y(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),s(a.__webglObjects,!1,"",b,k,l,!0,d),t(a.__webglObjectsImmediate,"",b,k,l,!1,d)):(d=null,this.setBlending(THREE.NoBlending),s(a.__webglObjects,!0,"opaque",b,k,l,!1,d),t(a.__webglObjectsImmediate,"opaque",b,k,l,!1,d),s(a.__webglObjects,!1,"transparent",b,k,l,!0,d),t(a.__webglObjectsImmediate,"transparent",b,k,l,!0,d));r(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&
 c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,c.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=D(a,b,c,d,e);za=-1;P.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,
-m,Ab):e.render(function(a){P.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)n(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)y(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;void 0===h.__webglInit&&(void 0!==h.__webglActive&&
-y(h,a),n(h,a));var k=h,l=k.geometry,p=void 0,r=void 0,s=void 0;if(l instanceof THREE.BufferGeometry){var t=m.DYNAMIC_DRAW,v=l.attributes,x=void 0,B=void 0;for(x in v)B=v[x],B.needsUpdate&&("index"===x?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,B.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,B.array,t)):(m.bindBuffer(m.ARRAY_BUFFER,B.buffer),m.bufferData(m.ARRAY_BUFFER,B.array,t)),B.needsUpdate=!1)}else if(k instanceof THREE.Mesh){for(var C=0,M=l.geometryGroupsList.length;C<M;C++)if(p=l.geometryGroupsList[C],
-s=d(k,p),l.buffersNeedUpdate&&c(p,k),r=s.attributes&&w(s),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||r){var z=p,F=k,D=m.DYNAMIC_DRAW,G=!l.dynamic,P=s;if(z.__inittedArrays){var H=e(P),J=P.vertexColors?P.vertexColors:!1,L=f(P),Q=H===THREE.SmoothShading,A=void 0,E=void 0,O=void 0,K=void 0,U=void 0,fa=void 0,Y=void 0,ga=void 0,R=void 0,V=void 0,W=void 0,$=void 0,aa=void 0,ba=void 0,wa=void 0,X=void 0,
+m,Ab):e.render(function(a){P.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)n(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)x(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;void 0===h.__webglInit&&(void 0!==h.__webglActive&&
+x(h,a),n(h,a));var k=h,l=k.geometry,p=void 0,r=void 0,s=void 0;if(l instanceof THREE.BufferGeometry){var t=m.DYNAMIC_DRAW,v=l.attributes,F=void 0,y=void 0;for(F in v)y=v[F],y.needsUpdate&&("index"===F?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,y.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,y.array,t)):(m.bindBuffer(m.ARRAY_BUFFER,y.buffer),m.bufferData(m.ARRAY_BUFFER,y.array,t)),y.needsUpdate=!1)}else if(k instanceof THREE.Mesh){for(var C=0,B=l.geometryGroupsList.length;C<B;C++)if(p=l.geometryGroupsList[C],
+s=d(k,p),l.buffersNeedUpdate&&c(p,k),r=s.attributes&&w(s),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||r){var z=p,G=k,D=m.DYNAMIC_DRAW,H=!l.dynamic,P=s;if(z.__inittedArrays){var I=e(P),K=P.vertexColors?P.vertexColors:!1,M=f(P),Q=I===THREE.SmoothShading,A=void 0,E=void 0,O=void 0,L=void 0,U=void 0,fa=void 0,Y=void 0,ga=void 0,R=void 0,V=void 0,W=void 0,$=void 0,aa=void 0,ba=void 0,wa=void 0,X=void 0,
 Z=void 0,da=void 0,Ia=void 0,Ga=void 0,Ea=void 0,ia=void 0,za=void 0,ja=void 0,Ha=void 0,la=void 0,oa=void 0,qa=void 0,ra=void 0,ha=void 0,ya=void 0,Fa=void 0,Ca=void 0,Da=void 0,ma=void 0,Ka=void 0,ua=void 0,va=void 0,Oa=void 0,Ja=void 0,ab=0,bb=0,Ra=0,Sa=0,Pa=0,eb=0,Ta=0,qb=0,Ya=0,ta=0,Aa=0,N=0,Qa=void 0,fb=z.__vertexArray,cb=z.__uvArray,db=z.__uv2Array,tb=z.__normalArray,Ua=z.__tangentArray,gb=z.__colorArray,Va=z.__skinIndexArray,Wa=z.__skinWeightArray,ob=z.__morphTargetsArrays,sb=z.__morphNormalsArrays,
-pb=z.__webglCustomAttributesList,I=void 0,Tb=z.__faceArray,ub=z.__lineArray,La=F.geometry,Ab=La.elementsNeedUpdate,xb=La.uvsNeedUpdate,Db=La.normalsNeedUpdate,Gb=La.tangentsNeedUpdate,Hb=La.colorsNeedUpdate,Jb=La.morphTargetsNeedUpdate,fc=La.vertices,ea=z.faces3,hb=La.faces,Bb=La.faceVertexUvs[0],Cb=La.faceVertexUvs[1],gc=La.skinIndices,Ub=La.skinWeights,Vb=La.morphTargets,Eb=La.morphNormals;if(La.verticesNeedUpdate){A=0;for(E=ea.length;A<E;A++)K=hb[ea[A]],$=fc[K.a],aa=fc[K.b],ba=fc[K.c],fb[bb]=$.x,
-fb[bb+1]=$.y,fb[bb+2]=$.z,fb[bb+3]=aa.x,fb[bb+4]=aa.y,fb[bb+5]=aa.z,fb[bb+6]=ba.x,fb[bb+7]=ba.y,fb[bb+8]=ba.z,bb+=9;m.bindBuffer(m.ARRAY_BUFFER,z.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,fb,D)}if(Jb)for(ma=0,Ka=Vb.length;ma<Ka;ma++){A=Aa=0;for(E=ea.length;A<E;A++)Oa=ea[A],K=hb[Oa],$=Vb[ma].vertices[K.a],aa=Vb[ma].vertices[K.b],ba=Vb[ma].vertices[K.c],ua=ob[ma],ua[Aa]=$.x,ua[Aa+1]=$.y,ua[Aa+2]=$.z,ua[Aa+3]=aa.x,ua[Aa+4]=aa.y,ua[Aa+5]=aa.z,ua[Aa+6]=ba.x,ua[Aa+7]=ba.y,ua[Aa+8]=ba.z,P.morphNormals&&
-(Q?(Ja=Eb[ma].vertexNormals[Oa],da=Ja.a,Ia=Ja.b,Ga=Ja.c):Ga=Ia=da=Eb[ma].faceNormals[Oa],va=sb[ma],va[Aa]=da.x,va[Aa+1]=da.y,va[Aa+2]=da.z,va[Aa+3]=Ia.x,va[Aa+4]=Ia.y,va[Aa+5]=Ia.z,va[Aa+6]=Ga.x,va[Aa+7]=Ga.y,va[Aa+8]=Ga.z),Aa+=9;m.bindBuffer(m.ARRAY_BUFFER,z.__webglMorphTargetsBuffers[ma]);m.bufferData(m.ARRAY_BUFFER,ob[ma],D);P.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglMorphNormalsBuffers[ma]),m.bufferData(m.ARRAY_BUFFER,sb[ma],D))}if(Ub.length){A=0;for(E=ea.length;A<E;A++)K=hb[ea[A]],
-ja=Ub[K.a],Ha=Ub[K.b],la=Ub[K.c],Wa[ta]=ja.x,Wa[ta+1]=ja.y,Wa[ta+2]=ja.z,Wa[ta+3]=ja.w,Wa[ta+4]=Ha.x,Wa[ta+5]=Ha.y,Wa[ta+6]=Ha.z,Wa[ta+7]=Ha.w,Wa[ta+8]=la.x,Wa[ta+9]=la.y,Wa[ta+10]=la.z,Wa[ta+11]=la.w,oa=gc[K.a],qa=gc[K.b],ra=gc[K.c],Va[ta]=oa.x,Va[ta+1]=oa.y,Va[ta+2]=oa.z,Va[ta+3]=oa.w,Va[ta+4]=qa.x,Va[ta+5]=qa.y,Va[ta+6]=qa.z,Va[ta+7]=qa.w,Va[ta+8]=ra.x,Va[ta+9]=ra.y,Va[ta+10]=ra.z,Va[ta+11]=ra.w,ta+=12;0<ta&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Va,
-D),m.bindBuffer(m.ARRAY_BUFFER,z.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,Wa,D))}if(Hb&&J){A=0;for(E=ea.length;A<E;A++)K=hb[ea[A]],Y=K.vertexColors,ga=K.color,3===Y.length&&J===THREE.VertexColors?(Ea=Y[0],ia=Y[1],za=Y[2]):za=ia=Ea=ga,gb[Ya]=Ea.r,gb[Ya+1]=Ea.g,gb[Ya+2]=Ea.b,gb[Ya+3]=ia.r,gb[Ya+4]=ia.g,gb[Ya+5]=ia.b,gb[Ya+6]=za.r,gb[Ya+7]=za.g,gb[Ya+8]=za.b,Ya+=9;0<Ya&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,gb,D))}if(Gb&&La.hasTangents){A=0;for(E=
-ea.length;A<E;A++)K=hb[ea[A]],R=K.vertexTangents,wa=R[0],X=R[1],Z=R[2],Ua[Ta]=wa.x,Ua[Ta+1]=wa.y,Ua[Ta+2]=wa.z,Ua[Ta+3]=wa.w,Ua[Ta+4]=X.x,Ua[Ta+5]=X.y,Ua[Ta+6]=X.z,Ua[Ta+7]=X.w,Ua[Ta+8]=Z.x,Ua[Ta+9]=Z.y,Ua[Ta+10]=Z.z,Ua[Ta+11]=Z.w,Ta+=12;m.bindBuffer(m.ARRAY_BUFFER,z.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,Ua,D)}if(Db&&H){A=0;for(E=ea.length;A<E;A++)if(K=hb[ea[A]],U=K.vertexNormals,fa=K.normal,3===U.length&&Q)for(ha=0;3>ha;ha++)Fa=U[ha],tb[eb]=Fa.x,tb[eb+1]=Fa.y,tb[eb+2]=Fa.z,eb+=3;else for(ha=
-0;3>ha;ha++)tb[eb]=fa.x,tb[eb+1]=fa.y,tb[eb+2]=fa.z,eb+=3;m.bindBuffer(m.ARRAY_BUFFER,z.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,tb,D)}if(xb&&Bb&&L){A=0;for(E=ea.length;A<E;A++)if(O=ea[A],V=Bb[O],void 0!==V)for(ha=0;3>ha;ha++)Ca=V[ha],cb[Ra]=Ca.x,cb[Ra+1]=Ca.y,Ra+=2;0<Ra&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,cb,D))}if(xb&&Cb&&L){A=0;for(E=ea.length;A<E;A++)if(O=ea[A],W=Cb[O],void 0!==W)for(ha=0;3>ha;ha++)Da=W[ha],db[Sa]=Da.x,db[Sa+1]=Da.y,Sa+=2;0<Sa&&
-(m.bindBuffer(m.ARRAY_BUFFER,z.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,db,D))}if(Ab){A=0;for(E=ea.length;A<E;A++)Tb[Pa]=ab,Tb[Pa+1]=ab+1,Tb[Pa+2]=ab+2,Pa+=3,ub[qb]=ab,ub[qb+1]=ab+1,ub[qb+2]=ab,ub[qb+3]=ab+2,ub[qb+4]=ab+1,ub[qb+5]=ab+2,qb+=6,ab+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,z.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,Tb,D);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,z.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,ub,D)}if(pb)for(ha=0,ya=pb.length;ha<ya;ha++)if(I=pb[ha],
-I.__original.needsUpdate){N=0;if(1===I.size)if(void 0===I.boundTo||"vertices"===I.boundTo)for(A=0,E=ea.length;A<E;A++)K=hb[ea[A]],I.array[N]=I.value[K.a],I.array[N+1]=I.value[K.b],I.array[N+2]=I.value[K.c],N+=3;else{if("faces"===I.boundTo)for(A=0,E=ea.length;A<E;A++)Qa=I.value[ea[A]],I.array[N]=Qa,I.array[N+1]=Qa,I.array[N+2]=Qa,N+=3}else if(2===I.size)if(void 0===I.boundTo||"vertices"===I.boundTo)for(A=0,E=ea.length;A<E;A++)K=hb[ea[A]],$=I.value[K.a],aa=I.value[K.b],ba=I.value[K.c],I.array[N]=$.x,
-I.array[N+1]=$.y,I.array[N+2]=aa.x,I.array[N+3]=aa.y,I.array[N+4]=ba.x,I.array[N+5]=ba.y,N+=6;else{if("faces"===I.boundTo)for(A=0,E=ea.length;A<E;A++)ba=aa=$=Qa=I.value[ea[A]],I.array[N]=$.x,I.array[N+1]=$.y,I.array[N+2]=aa.x,I.array[N+3]=aa.y,I.array[N+4]=ba.x,I.array[N+5]=ba.y,N+=6}else if(3===I.size){var sa;sa="c"===I.type?["r","g","b"]:["x","y","z"];if(void 0===I.boundTo||"vertices"===I.boundTo)for(A=0,E=ea.length;A<E;A++)K=hb[ea[A]],$=I.value[K.a],aa=I.value[K.b],ba=I.value[K.c],I.array[N]=$[sa[0]],
-I.array[N+1]=$[sa[1]],I.array[N+2]=$[sa[2]],I.array[N+3]=aa[sa[0]],I.array[N+4]=aa[sa[1]],I.array[N+5]=aa[sa[2]],I.array[N+6]=ba[sa[0]],I.array[N+7]=ba[sa[1]],I.array[N+8]=ba[sa[2]],N+=9;else if("faces"===I.boundTo)for(A=0,E=ea.length;A<E;A++)ba=aa=$=Qa=I.value[ea[A]],I.array[N]=$[sa[0]],I.array[N+1]=$[sa[1]],I.array[N+2]=$[sa[2]],I.array[N+3]=aa[sa[0]],I.array[N+4]=aa[sa[1]],I.array[N+5]=aa[sa[2]],I.array[N+6]=ba[sa[0]],I.array[N+7]=ba[sa[1]],I.array[N+8]=ba[sa[2]],N+=9;else if("faceVertices"===
-I.boundTo)for(A=0,E=ea.length;A<E;A++)Qa=I.value[ea[A]],$=Qa[0],aa=Qa[1],ba=Qa[2],I.array[N]=$[sa[0]],I.array[N+1]=$[sa[1]],I.array[N+2]=$[sa[2]],I.array[N+3]=aa[sa[0]],I.array[N+4]=aa[sa[1]],I.array[N+5]=aa[sa[2]],I.array[N+6]=ba[sa[0]],I.array[N+7]=ba[sa[1]],I.array[N+8]=ba[sa[2]],N+=9}else if(4===I.size)if(void 0===I.boundTo||"vertices"===I.boundTo)for(A=0,E=ea.length;A<E;A++)K=hb[ea[A]],$=I.value[K.a],aa=I.value[K.b],ba=I.value[K.c],I.array[N]=$.x,I.array[N+1]=$.y,I.array[N+2]=$.z,I.array[N+3]=
-$.w,I.array[N+4]=aa.x,I.array[N+5]=aa.y,I.array[N+6]=aa.z,I.array[N+7]=aa.w,I.array[N+8]=ba.x,I.array[N+9]=ba.y,I.array[N+10]=ba.z,I.array[N+11]=ba.w,N+=12;else if("faces"===I.boundTo)for(A=0,E=ea.length;A<E;A++)ba=aa=$=Qa=I.value[ea[A]],I.array[N]=$.x,I.array[N+1]=$.y,I.array[N+2]=$.z,I.array[N+3]=$.w,I.array[N+4]=aa.x,I.array[N+5]=aa.y,I.array[N+6]=aa.z,I.array[N+7]=aa.w,I.array[N+8]=ba.x,I.array[N+9]=ba.y,I.array[N+10]=ba.z,I.array[N+11]=ba.w,N+=12;else if("faceVertices"===I.boundTo)for(A=0,E=
-ea.length;A<E;A++)Qa=I.value[ea[A]],$=Qa[0],aa=Qa[1],ba=Qa[2],I.array[N]=$.x,I.array[N+1]=$.y,I.array[N+2]=$.z,I.array[N+3]=$.w,I.array[N+4]=aa.x,I.array[N+5]=aa.y,I.array[N+6]=aa.z,I.array[N+7]=aa.w,I.array[N+8]=ba.x,I.array[N+9]=ba.y,I.array[N+10]=ba.z,I.array[N+11]=ba.w,N+=12;m.bindBuffer(m.ARRAY_BUFFER,I.buffer);m.bufferData(m.ARRAY_BUFFER,I.array,D)}G&&(delete z.__inittedArrays,delete z.__colorArray,delete z.__normalArray,delete z.__tangentArray,delete z.__uvArray,delete z.__uv2Array,delete z.__faceArray,
+pb=z.__webglCustomAttributesList,J=void 0,Tb=z.__faceArray,ub=z.__lineArray,La=G.geometry,Ab=La.elementsNeedUpdate,xb=La.uvsNeedUpdate,Db=La.normalsNeedUpdate,Gb=La.tangentsNeedUpdate,Hb=La.colorsNeedUpdate,Jb=La.morphTargetsNeedUpdate,fc=La.vertices,ea=z.faces3,hb=La.faces,Bb=La.faceVertexUvs[0],Cb=La.faceVertexUvs[1],gc=La.skinIndices,Ub=La.skinWeights,Vb=La.morphTargets,Eb=La.morphNormals;if(La.verticesNeedUpdate){A=0;for(E=ea.length;A<E;A++)L=hb[ea[A]],$=fc[L.a],aa=fc[L.b],ba=fc[L.c],fb[bb]=$.x,
+fb[bb+1]=$.y,fb[bb+2]=$.z,fb[bb+3]=aa.x,fb[bb+4]=aa.y,fb[bb+5]=aa.z,fb[bb+6]=ba.x,fb[bb+7]=ba.y,fb[bb+8]=ba.z,bb+=9;m.bindBuffer(m.ARRAY_BUFFER,z.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,fb,D)}if(Jb)for(ma=0,Ka=Vb.length;ma<Ka;ma++){A=Aa=0;for(E=ea.length;A<E;A++)Oa=ea[A],L=hb[Oa],$=Vb[ma].vertices[L.a],aa=Vb[ma].vertices[L.b],ba=Vb[ma].vertices[L.c],ua=ob[ma],ua[Aa]=$.x,ua[Aa+1]=$.y,ua[Aa+2]=$.z,ua[Aa+3]=aa.x,ua[Aa+4]=aa.y,ua[Aa+5]=aa.z,ua[Aa+6]=ba.x,ua[Aa+7]=ba.y,ua[Aa+8]=ba.z,P.morphNormals&&
+(Q?(Ja=Eb[ma].vertexNormals[Oa],da=Ja.a,Ia=Ja.b,Ga=Ja.c):Ga=Ia=da=Eb[ma].faceNormals[Oa],va=sb[ma],va[Aa]=da.x,va[Aa+1]=da.y,va[Aa+2]=da.z,va[Aa+3]=Ia.x,va[Aa+4]=Ia.y,va[Aa+5]=Ia.z,va[Aa+6]=Ga.x,va[Aa+7]=Ga.y,va[Aa+8]=Ga.z),Aa+=9;m.bindBuffer(m.ARRAY_BUFFER,z.__webglMorphTargetsBuffers[ma]);m.bufferData(m.ARRAY_BUFFER,ob[ma],D);P.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglMorphNormalsBuffers[ma]),m.bufferData(m.ARRAY_BUFFER,sb[ma],D))}if(Ub.length){A=0;for(E=ea.length;A<E;A++)L=hb[ea[A]],
+ja=Ub[L.a],Ha=Ub[L.b],la=Ub[L.c],Wa[ta]=ja.x,Wa[ta+1]=ja.y,Wa[ta+2]=ja.z,Wa[ta+3]=ja.w,Wa[ta+4]=Ha.x,Wa[ta+5]=Ha.y,Wa[ta+6]=Ha.z,Wa[ta+7]=Ha.w,Wa[ta+8]=la.x,Wa[ta+9]=la.y,Wa[ta+10]=la.z,Wa[ta+11]=la.w,oa=gc[L.a],qa=gc[L.b],ra=gc[L.c],Va[ta]=oa.x,Va[ta+1]=oa.y,Va[ta+2]=oa.z,Va[ta+3]=oa.w,Va[ta+4]=qa.x,Va[ta+5]=qa.y,Va[ta+6]=qa.z,Va[ta+7]=qa.w,Va[ta+8]=ra.x,Va[ta+9]=ra.y,Va[ta+10]=ra.z,Va[ta+11]=ra.w,ta+=12;0<ta&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Va,
+D),m.bindBuffer(m.ARRAY_BUFFER,z.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,Wa,D))}if(Hb&&K){A=0;for(E=ea.length;A<E;A++)L=hb[ea[A]],Y=L.vertexColors,ga=L.color,3===Y.length&&K===THREE.VertexColors?(Ea=Y[0],ia=Y[1],za=Y[2]):za=ia=Ea=ga,gb[Ya]=Ea.r,gb[Ya+1]=Ea.g,gb[Ya+2]=Ea.b,gb[Ya+3]=ia.r,gb[Ya+4]=ia.g,gb[Ya+5]=ia.b,gb[Ya+6]=za.r,gb[Ya+7]=za.g,gb[Ya+8]=za.b,Ya+=9;0<Ya&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,gb,D))}if(Gb&&La.hasTangents){A=0;for(E=
+ea.length;A<E;A++)L=hb[ea[A]],R=L.vertexTangents,wa=R[0],X=R[1],Z=R[2],Ua[Ta]=wa.x,Ua[Ta+1]=wa.y,Ua[Ta+2]=wa.z,Ua[Ta+3]=wa.w,Ua[Ta+4]=X.x,Ua[Ta+5]=X.y,Ua[Ta+6]=X.z,Ua[Ta+7]=X.w,Ua[Ta+8]=Z.x,Ua[Ta+9]=Z.y,Ua[Ta+10]=Z.z,Ua[Ta+11]=Z.w,Ta+=12;m.bindBuffer(m.ARRAY_BUFFER,z.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,Ua,D)}if(Db&&I){A=0;for(E=ea.length;A<E;A++)if(L=hb[ea[A]],U=L.vertexNormals,fa=L.normal,3===U.length&&Q)for(ha=0;3>ha;ha++)Fa=U[ha],tb[eb]=Fa.x,tb[eb+1]=Fa.y,tb[eb+2]=Fa.z,eb+=3;else for(ha=
+0;3>ha;ha++)tb[eb]=fa.x,tb[eb+1]=fa.y,tb[eb+2]=fa.z,eb+=3;m.bindBuffer(m.ARRAY_BUFFER,z.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,tb,D)}if(xb&&Bb&&M){A=0;for(E=ea.length;A<E;A++)if(O=ea[A],V=Bb[O],void 0!==V)for(ha=0;3>ha;ha++)Ca=V[ha],cb[Ra]=Ca.x,cb[Ra+1]=Ca.y,Ra+=2;0<Ra&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,cb,D))}if(xb&&Cb&&M){A=0;for(E=ea.length;A<E;A++)if(O=ea[A],W=Cb[O],void 0!==W)for(ha=0;3>ha;ha++)Da=W[ha],db[Sa]=Da.x,db[Sa+1]=Da.y,Sa+=2;0<Sa&&
+(m.bindBuffer(m.ARRAY_BUFFER,z.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,db,D))}if(Ab){A=0;for(E=ea.length;A<E;A++)Tb[Pa]=ab,Tb[Pa+1]=ab+1,Tb[Pa+2]=ab+2,Pa+=3,ub[qb]=ab,ub[qb+1]=ab+1,ub[qb+2]=ab,ub[qb+3]=ab+2,ub[qb+4]=ab+1,ub[qb+5]=ab+2,qb+=6,ab+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,z.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,Tb,D);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,z.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,ub,D)}if(pb)for(ha=0,ya=pb.length;ha<ya;ha++)if(J=pb[ha],
+J.__original.needsUpdate){N=0;if(1===J.size)if(void 0===J.boundTo||"vertices"===J.boundTo)for(A=0,E=ea.length;A<E;A++)L=hb[ea[A]],J.array[N]=J.value[L.a],J.array[N+1]=J.value[L.b],J.array[N+2]=J.value[L.c],N+=3;else{if("faces"===J.boundTo)for(A=0,E=ea.length;A<E;A++)Qa=J.value[ea[A]],J.array[N]=Qa,J.array[N+1]=Qa,J.array[N+2]=Qa,N+=3}else if(2===J.size)if(void 0===J.boundTo||"vertices"===J.boundTo)for(A=0,E=ea.length;A<E;A++)L=hb[ea[A]],$=J.value[L.a],aa=J.value[L.b],ba=J.value[L.c],J.array[N]=$.x,
+J.array[N+1]=$.y,J.array[N+2]=aa.x,J.array[N+3]=aa.y,J.array[N+4]=ba.x,J.array[N+5]=ba.y,N+=6;else{if("faces"===J.boundTo)for(A=0,E=ea.length;A<E;A++)ba=aa=$=Qa=J.value[ea[A]],J.array[N]=$.x,J.array[N+1]=$.y,J.array[N+2]=aa.x,J.array[N+3]=aa.y,J.array[N+4]=ba.x,J.array[N+5]=ba.y,N+=6}else if(3===J.size){var sa;sa="c"===J.type?["r","g","b"]:["x","y","z"];if(void 0===J.boundTo||"vertices"===J.boundTo)for(A=0,E=ea.length;A<E;A++)L=hb[ea[A]],$=J.value[L.a],aa=J.value[L.b],ba=J.value[L.c],J.array[N]=$[sa[0]],
+J.array[N+1]=$[sa[1]],J.array[N+2]=$[sa[2]],J.array[N+3]=aa[sa[0]],J.array[N+4]=aa[sa[1]],J.array[N+5]=aa[sa[2]],J.array[N+6]=ba[sa[0]],J.array[N+7]=ba[sa[1]],J.array[N+8]=ba[sa[2]],N+=9;else if("faces"===J.boundTo)for(A=0,E=ea.length;A<E;A++)ba=aa=$=Qa=J.value[ea[A]],J.array[N]=$[sa[0]],J.array[N+1]=$[sa[1]],J.array[N+2]=$[sa[2]],J.array[N+3]=aa[sa[0]],J.array[N+4]=aa[sa[1]],J.array[N+5]=aa[sa[2]],J.array[N+6]=ba[sa[0]],J.array[N+7]=ba[sa[1]],J.array[N+8]=ba[sa[2]],N+=9;else if("faceVertices"===
+J.boundTo)for(A=0,E=ea.length;A<E;A++)Qa=J.value[ea[A]],$=Qa[0],aa=Qa[1],ba=Qa[2],J.array[N]=$[sa[0]],J.array[N+1]=$[sa[1]],J.array[N+2]=$[sa[2]],J.array[N+3]=aa[sa[0]],J.array[N+4]=aa[sa[1]],J.array[N+5]=aa[sa[2]],J.array[N+6]=ba[sa[0]],J.array[N+7]=ba[sa[1]],J.array[N+8]=ba[sa[2]],N+=9}else if(4===J.size)if(void 0===J.boundTo||"vertices"===J.boundTo)for(A=0,E=ea.length;A<E;A++)L=hb[ea[A]],$=J.value[L.a],aa=J.value[L.b],ba=J.value[L.c],J.array[N]=$.x,J.array[N+1]=$.y,J.array[N+2]=$.z,J.array[N+3]=
+$.w,J.array[N+4]=aa.x,J.array[N+5]=aa.y,J.array[N+6]=aa.z,J.array[N+7]=aa.w,J.array[N+8]=ba.x,J.array[N+9]=ba.y,J.array[N+10]=ba.z,J.array[N+11]=ba.w,N+=12;else if("faces"===J.boundTo)for(A=0,E=ea.length;A<E;A++)ba=aa=$=Qa=J.value[ea[A]],J.array[N]=$.x,J.array[N+1]=$.y,J.array[N+2]=$.z,J.array[N+3]=$.w,J.array[N+4]=aa.x,J.array[N+5]=aa.y,J.array[N+6]=aa.z,J.array[N+7]=aa.w,J.array[N+8]=ba.x,J.array[N+9]=ba.y,J.array[N+10]=ba.z,J.array[N+11]=ba.w,N+=12;else if("faceVertices"===J.boundTo)for(A=0,E=
+ea.length;A<E;A++)Qa=J.value[ea[A]],$=Qa[0],aa=Qa[1],ba=Qa[2],J.array[N]=$.x,J.array[N+1]=$.y,J.array[N+2]=$.z,J.array[N+3]=$.w,J.array[N+4]=aa.x,J.array[N+5]=aa.y,J.array[N+6]=aa.z,J.array[N+7]=aa.w,J.array[N+8]=ba.x,J.array[N+9]=ba.y,J.array[N+10]=ba.z,J.array[N+11]=ba.w,N+=12;m.bindBuffer(m.ARRAY_BUFFER,J.buffer);m.bufferData(m.ARRAY_BUFFER,J.array,D)}H&&(delete z.__inittedArrays,delete z.__colorArray,delete z.__normalArray,delete z.__tangentArray,delete z.__uvArray,delete z.__uv2Array,delete z.__faceArray,
 delete z.__vertexArray,delete z.__lineArray,delete z.__skinIndexArray,delete z.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;s.attributes&&u(s)}else if(k instanceof THREE.Line){s=d(k,l);r=s.attributes&&w(s);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||r){var Xa=l,Wb=m.DYNAMIC_DRAW,Lb=void 0,Mb=void 0,Nb=void 0,Xb=
 void 0,pa=void 0,Yb=void 0,Fb=Xa.vertices,Ib=Xa.colors,Kb=Xa.lineDistances,Qb=Fb.length,Rb=Ib.length,Sb=Kb.length,Zb=Xa.__vertexArray,$b=Xa.__colorArray,lc=Xa.__lineDistanceArray,dc=Xa.colorsNeedUpdate,ec=Xa.lineDistancesNeedUpdate,hc=Xa.__webglCustomAttributesList,ac=void 0,mc=void 0,Ba=void 0,yb=void 0,Ma=void 0,na=void 0;if(Xa.verticesNeedUpdate){for(Lb=0;Lb<Qb;Lb++)Xb=Fb[Lb],pa=3*Lb,Zb[pa]=Xb.x,Zb[pa+1]=Xb.y,Zb[pa+2]=Xb.z;m.bindBuffer(m.ARRAY_BUFFER,Xa.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,
 Zb,Wb)}if(dc){for(Mb=0;Mb<Rb;Mb++)Yb=Ib[Mb],pa=3*Mb,$b[pa]=Yb.r,$b[pa+1]=Yb.g,$b[pa+2]=Yb.b;m.bindBuffer(m.ARRAY_BUFFER,Xa.__webglColorBuffer);m.bufferData(m.ARRAY_BUFFER,$b,Wb)}if(ec){for(Nb=0;Nb<Sb;Nb++)lc[Nb]=Kb[Nb];m.bindBuffer(m.ARRAY_BUFFER,Xa.__webglLineDistanceBuffer);m.bufferData(m.ARRAY_BUFFER,lc,Wb)}if(hc)for(ac=0,mc=hc.length;ac<mc;ac++)if(na=hc[ac],na.needsUpdate&&(void 0===na.boundTo||"vertices"===na.boundTo)){pa=0;yb=na.value.length;if(1===na.size)for(Ba=0;Ba<yb;Ba++)na.array[Ba]=na.value[Ba];
@@ -495,21 +495,21 @@ wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side==
 0,t="morphTarget",l=0;l<this.maxMorphTargets;l++)p=t+l,0<=u[p]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(a.numSupportedMorphNormals=0,t="morphNormal",l=0;l<this.maxMorphNormals;l++)p=t+l,0<=u[p]&&a.numSupportedMorphNormals++;a.uniformsList=[];for(k in a.uniforms)a.uniformsList.push([a.uniforms[k],k])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?m.disable(m.CULL_FACE):(b===THREE.FrontFaceDirectionCW?m.frontFace(m.CW):m.frontFace(m.CCW),a===THREE.CullFaceBack?m.cullFace(m.BACK):
 a===THREE.CullFaceFront?m.cullFace(m.FRONT):m.cullFace(m.FRONT_AND_BACK),m.enable(m.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;Ga!==b&&(b?m.disable(m.CULL_FACE):m.enable(m.CULL_FACE),Ga=b);ha!==a&&(a?m.frontFace(m.CW):m.frontFace(m.CCW),ha=a)};this.setDepthTest=function(a){ia!==a&&(a?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),ia=a)};this.setDepthWrite=function(a){ma!==a&&(m.depthMask(a),ma=a)};this.setBlending=function(a,b,c,d){a!==
 Oa&&(a===THREE.NoBlending?m.disable(m.BLEND):a===THREE.AdditiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.SRC_ALPHA,m.ONE)):a===THREE.SubtractiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.SRC_COLOR)):a===THREE.CustomBlending?m.enable(m.BLEND):(m.enable(m.BLEND),m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,
-m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)),Oa=a);if(a===THREE.CustomBlending){if(b!==Ra&&(m.blendEquation(L(b)),Ra=b),c!==Sa||d!==Fa)m.blendFunc(L(c),L(d)),Sa=c,Fa=d}else Fa=Sa=Ra=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",Hb),a.__webglTexture=m.createTexture(),P.info.memory.textures++);m.activeTexture(m.TEXTURE0+b);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
-a.premultiplyAlpha);m.pixelStorei(m.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=L(a.format),f=L(a.type);A(m.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=
+m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)),Oa=a);if(a===THREE.CustomBlending){if(b!==Ra&&(m.blendEquation(M(b)),Ra=b),c!==Sa||d!==Fa)m.blendFunc(M(c),M(d)),Sa=c,Fa=d}else Fa=Sa=Ra=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",Hb),a.__webglTexture=m.createTexture(),P.info.memory.textures++);m.activeTexture(m.TEXTURE0+b);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
+a.premultiplyAlpha);m.pixelStorei(m.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=M(a.format),f=M(a.type);A(m.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=
 0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,c.data):m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&m.generateMipmap(m.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+b),m.bindTexture(m.TEXTURE_2D,
-a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Rb);a.__webglTexture=m.createTexture();P.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=L(a.format),e=L(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);
+a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Rb);a.__webglTexture=m.createTexture();P.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=M(a.format),e=M(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);
 A(m.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);O(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),
 a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),A(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):
 a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):O(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Da,a=Ja,d=Ca,e=va);b!==Ha&&(m.bindFramebuffer(m.FRAMEBUFFER,
 b),m.viewport(d,e,c,a),Ha=b);ja=c;ra=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:
 THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null};
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;
-a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.fragmentShader,h=d.vertexShader,k=d.uniforms,l=d.attributes,p=d.defines,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var r="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?r="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(r="SHADOWMAP_TYPE_PCF_SOFT");var t,s;t=[];for(var n in p)s=p[n],!1!==s&&(s="#define "+n+" "+s,t.push(s));t=t.join("\n");p=f.createProgram();d instanceof
-THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",t,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+e.maxBones,e.map?"#define USE_MAP":
+a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.fragmentShader,h=d.vertexShader,k=d.uniforms,l=d.attributes,p=d.defines,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var r="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?r="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(r="SHADOWMAP_TYPE_PCF_SOFT");var s,t;s=[];for(var n in p)t=p[n],!1!==t&&(t="#define "+n+" "+t,s.push(t));s=s.join("\n");p=f.createProgram();d instanceof
+THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",s,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+e.maxBones,e.map?"#define USE_MAP":
 "",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":
 "",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"),
-b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",t,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG":
+b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",s,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG":
 "",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?
 "#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));h=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+h);g=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+g);f.attachShader(p,h);f.attachShader(p,g);void 0!==q&&f.bindAttribLocation(p,0,q);f.linkProgram(p);!1===f.getProgramParameter(p,f.LINK_STATUS)&&(console.error("Could not initialise shader"),
 console.error("gl.VALIDATE_STATUS",f.getProgramParameter(p,f.VALIDATE_STATUS)),console.error("gl.getError()",f.getError()));""!==f.getProgramInfoLog(p)&&console.error("gl.getProgramInfoLog()",f.getProgramInfoLog(p));f.deleteShader(h);f.deleteShader(g);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&
@@ -524,16 +524,16 @@ k,!0);l.responseType="arraybuffer";l.send(null)}else l=new XMLHttpRequest,l.onlo
 b,c,d){var e=[];e.loadCount=0;var f=new THREE.CompressedTexture;f.image=e;void 0!==b&&(f.mapping=b);f.flipY=!1;f.generateMipmaps=!1;var g=new XMLHttpRequest;g.onload=function(){var a=THREE.ImageUtils.parseDDS(g.response,!0);if(a.isCubemap)for(var b=a.mipmaps.length/a.mipmapCount,d=0;d<b;d++){e[d]={mipmaps:[]};for(var p=0;p<a.mipmapCount;p++)e[d].mipmaps.push(a.mipmaps[d*a.mipmapCount+p]),e[d].format=a.format,e[d].width=a.width,e[d].height=a.height}else f.image.width=a.width,f.image.height=a.height,
 f.mipmaps=a.mipmaps;f.format=a.format;f.needsUpdate=!0;c&&c(f)};g.onerror=d;g.open("GET",a,!0);g.responseType="arraybuffer";g.send(null);return f},parseDDS:function(a,b){function c(a){return a.charCodeAt(0)+(a.charCodeAt(1)<<8)+(a.charCodeAt(2)<<16)+(a.charCodeAt(3)<<24)}function d(a,b,c,d){var e=c*d*4;a=new Uint8Array(a,b,e);for(var e=new Uint8Array(e),f=b=0,g=0;g<d;g++)for(var h=0;h<c;h++){var k=a[f];f++;var l=a[f];f++;var p=a[f];f++;var r=a[f];f++;e[b]=p;b++;e[b]=l;b++;e[b]=k;b++;e[b]=r;b++}return e}
 var e={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},f=c("DXT1"),g=c("DXT3"),h=c("DXT5"),k=new Int32Array(a,0,31);if(542327876!==k[0])return console.error("ImageUtils.parseDDS(): Invalid magic number in DDS header"),e;if(!k[20]&4)return console.error("ImageUtils.parseDDS(): Unsupported format, must contain a FourCC code"),e;var l=k[21],p=!1;switch(l){case f:f=8;e.format=THREE.RGB_S3TC_DXT1_Format;break;case g:f=16;e.format=THREE.RGBA_S3TC_DXT3_Format;break;case h:f=16;e.format=THREE.RGBA_S3TC_DXT5_Format;
-break;default:if(32==k[22]&&k[23]&16711680&&k[24]&65280&&k[25]&255&&k[26]&4278190080)p=!0,f=64,e.format=THREE.RGBAFormat;else return console.error("ImageUtils.parseDDS(): Unsupported FourCC code: ",String.fromCharCode(l&255,l>>8&255,l>>16&255,l>>24&255)),e}e.mipmapCount=1;k[2]&131072&&!1!==b&&(e.mipmapCount=Math.max(1,k[7]));e.isCubemap=k[28]&512?!0:!1;e.width=k[4];e.height=k[3];for(var k=k[1]+4,g=e.width,h=e.height,l=e.isCubemap?6:1,q=0;q<l;q++){for(var r=0;r<e.mipmapCount;r++){if(p)var t=d(a,k,
-g,h),s=t.length;else s=Math.max(4,g)/4*Math.max(4,h)/4*f,t=new Uint8Array(a,k,s);e.mipmaps.push({data:t,width:g,height:h});k+=s;g=Math.max(0.5*g,1);h=Math.max(0.5*h,1)}g=e.width;h=e.height}return e},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,
-e),l=k.data,p=0;p<d;p++)for(var q=0;q<e;q++){var r=0>q-1?0:q-1,t=q+1>e-1?e-1:q+1,s=0>p-1?0:p-1,n=p+1>d-1?d-1:p+1,v=[],w=[0,0,h[4*(q*d+p)]/255*b];v.push([-1,0,h[4*(q*d+s)]/255*b]);v.push([-1,-1,h[4*(r*d+s)]/255*b]);v.push([0,-1,h[4*(r*d+p)]/255*b]);v.push([1,-1,h[4*(r*d+n)]/255*b]);v.push([1,0,h[4*(q*d+n)]/255*b]);v.push([1,1,h[4*(t*d+n)]/255*b]);v.push([0,1,h[4*(t*d+p)]/255*b]);v.push([-1,1,h[4*(t*d+s)]/255*b]);r=[];s=v.length;for(t=0;t<s;t++){var n=v[t],u=v[(t+1)%s],n=[n[0]-w[0],n[1]-w[1],n[2]-w[2]],
-u=[u[0]-w[0],u[1]-w[1],u[2]-w[2]];r.push(c([n[1]*u[2]-n[2]*u[1],n[2]*u[0]-n[0]*u[2],n[0]*u[1]-n[1]*u[0]]))}v=[0,0,0];for(t=0;t<r.length;t++)v[0]+=r[t][0],v[1]+=r[t][1],v[2]+=r[t][2];v[0]/=r.length;v[1]/=r.length;v[2]/=r.length;w=4*(q*d+p);l[w]=(v[0]+1)/2*255|0;l[w+1]=(v[1]+1)/2*255|0;l[w+2]=255*v[2]|0;l[w+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,b,c){var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*
+break;default:if(32==k[22]&&k[23]&16711680&&k[24]&65280&&k[25]&255&&k[26]&4278190080)p=!0,f=64,e.format=THREE.RGBAFormat;else return console.error("ImageUtils.parseDDS(): Unsupported FourCC code: ",String.fromCharCode(l&255,l>>8&255,l>>16&255,l>>24&255)),e}e.mipmapCount=1;k[2]&131072&&!1!==b&&(e.mipmapCount=Math.max(1,k[7]));e.isCubemap=k[28]&512?!0:!1;e.width=k[4];e.height=k[3];for(var k=k[1]+4,g=e.width,h=e.height,l=e.isCubemap?6:1,q=0;q<l;q++){for(var r=0;r<e.mipmapCount;r++){if(p)var s=d(a,k,
+g,h),t=s.length;else t=Math.max(4,g)/4*Math.max(4,h)/4*f,s=new Uint8Array(a,k,t);e.mipmaps.push({data:s,width:g,height:h});k+=t;g=Math.max(0.5*g,1);h=Math.max(0.5*h,1)}g=e.width;h=e.height}return e},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,
+e),l=k.data,p=0;p<d;p++)for(var q=0;q<e;q++){var r=0>q-1?0:q-1,s=q+1>e-1?e-1:q+1,t=0>p-1?0:p-1,n=p+1>d-1?d-1:p+1,v=[],w=[0,0,h[4*(q*d+p)]/255*b];v.push([-1,0,h[4*(q*d+t)]/255*b]);v.push([-1,-1,h[4*(r*d+t)]/255*b]);v.push([0,-1,h[4*(r*d+p)]/255*b]);v.push([1,-1,h[4*(r*d+n)]/255*b]);v.push([1,0,h[4*(q*d+n)]/255*b]);v.push([1,1,h[4*(s*d+n)]/255*b]);v.push([0,1,h[4*(s*d+p)]/255*b]);v.push([-1,1,h[4*(s*d+t)]/255*b]);r=[];t=v.length;for(s=0;s<t;s++){var n=v[s],u=v[(s+1)%t],n=[n[0]-w[0],n[1]-w[1],n[2]-w[2]],
+u=[u[0]-w[0],u[1]-w[1],u[2]-w[2]];r.push(c([n[1]*u[2]-n[2]*u[1],n[2]*u[0]-n[0]*u[2],n[0]*u[1]-n[1]*u[0]]))}v=[0,0,0];for(s=0;s<r.length;s++)v[0]+=r[s][0],v[1]+=r[s][1],v[2]+=r[s][2];v[0]/=r.length;v[1]/=r.length;v[2]/=r.length;w=4*(q*d+p);l[w]=(v[0]+1)/2*255|0;l[w+1]=(v[1]+1)/2*255|0;l[w+2]=255*v[2]|0;l[w+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,b,c){var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*
 h]=f,e[3*h+1]=g,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=
-String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,p,q,r,t,s,n,v,w=b.glyphs[a]||b.glyphs["?"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;p=b[a++]*c;e.moveTo(k,p);break;case "l":k=b[a++]*c+d;p=b[a++]*c;e.lineTo(k,p);break;case "q":k=b[a++]*
-c+d;p=b[a++]*c;t=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(t,s,k,p);if(g=f[f.length-1])for(q=g.x,r=g.y,g=1,h=this.divisions;g<=h;g++){var u=g/h;THREE.Shape.Utils.b2(u,q,t,k);THREE.Shape.Utils.b2(u,r,s,p)}break;case "b":if(k=b[a++]*c+d,p=b[a++]*c,t=b[a++]*c+d,s=b[a++]*-c,n=b[a++]*c+d,v=b[a++]*-c,e.bezierCurveTo(k,p,t,s,n,v),g=f[f.length-1])for(q=g.x,r=g.y,g=1,h=this.divisions;g<=h;g++)u=g/h,THREE.Shape.Utils.b3(u,q,t,n,k),THREE.Shape.Utils.b3(u,r,s,v,p)}return{offset:w.ha*c,path:e}}}};
+String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,p,q,r,s,t,n,v,w=b.glyphs[a]||b.glyphs["?"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;p=b[a++]*c;e.moveTo(k,p);break;case "l":k=b[a++]*c+d;p=b[a++]*c;e.lineTo(k,p);break;case "q":k=b[a++]*
+c+d;p=b[a++]*c;s=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(s,t,k,p);if(g=f[f.length-1])for(q=g.x,r=g.y,g=1,h=this.divisions;g<=h;g++){var u=g/h;THREE.Shape.Utils.b2(u,q,s,k);THREE.Shape.Utils.b2(u,r,t,p)}break;case "b":if(k=b[a++]*c+d,p=b[a++]*c,s=b[a++]*c+d,t=b[a++]*-c,n=b[a++]*c+d,v=b[a++]*-c,e.bezierCurveTo(k,p,s,t,n,v),g=f[f.length-1])for(q=g.x,r=g.y,g=1,h=this.divisions;g<=h;g++)u=g/h,THREE.Shape.Utils.b3(u,q,s,n,k),THREE.Shape.Utils.b3(u,r,t,v,p)}return{offset:w.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,p;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var q=2*e;for(l=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);p=l+1;e<=p&&(p=0);var r;a:{var t=r=void 0,s=void 0,n=void 0,v=void 0,w=void 0,u=void 0,y=void 0,M=
-void 0,t=a[g[k]].x,s=a[g[k]].y,n=a[g[l]].x,v=a[g[l]].y,w=a[g[p]].x,u=a[g[p]].y;if(1E-10>(n-t)*(u-s)-(v-s)*(w-t))r=!1;else{var B=void 0,D=void 0,z=void 0,F=void 0,H=void 0,C=void 0,x=void 0,A=void 0,O=void 0,K=void 0,O=A=x=M=y=void 0,B=w-n,D=u-v,z=t-w,F=s-u,H=n-t,C=v-s;for(r=0;r<e;r++)if(y=a[g[r]].x,M=a[g[r]].y,!(y===t&&M===s||y===n&&M===v||y===w&&M===u)&&(x=y-t,A=M-s,O=y-n,K=M-v,y-=w,M-=u,O=B*K-D*O,x=H*A-C*x,A=z*M-F*y,-1E-10<=O&&-1E-10<=A&&-1E-10<=x)){r=!1;break a}r=!0}}if(r){f.push([a[g[k]],a[g[l]],
+(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,p;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var q=2*e;for(l=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);p=l+1;e<=p&&(p=0);var r;a:{var s=r=void 0,t=void 0,n=void 0,v=void 0,w=void 0,u=void 0,x=void 0,F=
+void 0,s=a[g[k]].x,t=a[g[k]].y,n=a[g[l]].x,v=a[g[l]].y,w=a[g[p]].x,u=a[g[p]].y;if(1E-10>(n-s)*(u-t)-(v-t)*(w-s))r=!1;else{var C=void 0,D=void 0,z=void 0,G=void 0,I=void 0,B=void 0,y=void 0,A=void 0,O=void 0,L=void 0,O=A=y=F=x=void 0,C=w-n,D=u-v,z=s-w,G=t-u,I=n-s,B=v-t;for(r=0;r<e;r++)if(x=a[g[r]].x,F=a[g[r]].y,!(x===s&&F===t||x===n&&F===v||x===w&&F===u)&&(y=x-s,A=F-t,O=x-n,L=F-v,x-=w,F-=u,O=C*L-D*O,y=I*A-B*y,A=z*F-G*x,-1E-10<=O&&-1E-10<=A&&-1E-10<=y)){r=!1;break a}r=!0}}if(r){f.push([a[g[k]],a[g[l]],
 a[g[p]]]);h.push([g[k],g[l],g[p]]);k=l;for(p=l+1;p<e;k++,p++)g[k]=g[p];e--;q=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(a){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};
 THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),f+=c.distanceTo(d),b.push(f),d=c;return this.cacheArcLengths=b};
 THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0;this.getLengths()};THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,f;f=b?b:a*c[e-1];for(var g=0,h=e-1,k;g<=h;)if(d=Math.floor(g+(h-g)/2),k=c[d]-f,0>k)g=d+1;else if(0<k)h=d-1;else{h=d;break}d=h;if(c[d]==f)return d/(e-1);g=c[d];return c=(d+(f-g)/(c[d+1]-g))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};
@@ -554,21 +554,21 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.s
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(k);k=k.getPoint(1);h.push(k.x);h.push(k.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})};
 THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};
-THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,l,p,q,r,t,s,n;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];q=f[0];r=f[1];0<c.length?(g=c[c.length-1],t=g.x,
-s=g.y):(g=this.actions[d-1].args,t=g[g.length-2],s=g[g.length-1]);for(f=1;f<=a;f++)n=f/a,g=THREE.Shape.Utils.b2(n,t,q,h),n=THREE.Shape.Utils.b2(n,s,r,k),c.push(new THREE.Vector2(g,n));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];q=f[0];r=f[1];l=f[2];p=f[3];0<c.length?(g=c[c.length-1],t=g.x,s=g.y):(g=this.actions[d-1].args,t=g[g.length-2],s=g[g.length-1]);for(f=1;f<=a;f++)n=f/a,g=THREE.Shape.Utils.b3(n,t,q,l,h),n=THREE.Shape.Utils.b3(n,s,r,p,k),c.push(new THREE.Vector2(g,n));break;case THREE.PathActions.CSPLINE_THRU:g=
-this.actions[d-1].args;n=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;n=n.concat(f[0]);n=new THREE.SplineCurve(n);for(f=1;f<=g;f++)c.push(n.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];r=f[2];l=f[3];g=f[4];q=!!f[5];t=g-l;s=2*a;for(f=1;f<=s;f++)n=f/s,q||(n=1-n),n=l+n*t,g=h+r*Math.cos(n),n=k+r*Math.sin(n),c.push(new THREE.Vector2(g,n));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],r=f[2],p=f[3],l=f[4],g=f[5],q=!!f[6],t=g-l,s=2*a,f=1;f<=s;f++)n=f/s,q||
-(n=1-n),n=l+n*t,g=h+r*Math.cos(n),n=k+p*Math.sin(n),c.push(new THREE.Vector2(g,n))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
+THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,l,p,q,r,s,t,n;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];q=f[0];r=f[1];0<c.length?(g=c[c.length-1],s=g.x,
+t=g.y):(g=this.actions[d-1].args,s=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)n=f/a,g=THREE.Shape.Utils.b2(n,s,q,h),n=THREE.Shape.Utils.b2(n,t,r,k),c.push(new THREE.Vector2(g,n));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];q=f[0];r=f[1];l=f[2];p=f[3];0<c.length?(g=c[c.length-1],s=g.x,t=g.y):(g=this.actions[d-1].args,s=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)n=f/a,g=THREE.Shape.Utils.b3(n,s,q,l,h),n=THREE.Shape.Utils.b3(n,t,r,p,k),c.push(new THREE.Vector2(g,n));break;case THREE.PathActions.CSPLINE_THRU:g=
+this.actions[d-1].args;n=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;n=n.concat(f[0]);n=new THREE.SplineCurve(n);for(f=1;f<=g;f++)c.push(n.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];r=f[2];l=f[3];g=f[4];q=!!f[5];s=g-l;t=2*a;for(f=1;f<=t;f++)n=f/t,q||(n=1-n),n=l+n*s,g=h+r*Math.cos(n),n=k+r*Math.sin(n),c.push(new THREE.Vector2(g,n));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],r=f[2],p=f[3],l=f[4],g=f[5],q=!!f[6],s=g-l,t=2*a,f=1;f<=t;f++)n=f/t,q||
+(n=1-n),n=l+n*s,g=h+r*Math.cos(n),n=k+p*Math.sin(n),c.push(new THREE.Vector2(g,n))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
 THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,l=h.y-g.y;if(1E-10<Math.abs(l)){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.y<g.y||a.y>h.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=
 h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;b<c;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);0!=g.actions.length&&f.push(g);return f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var f,g,h,k=[];if(1==e.length)return g=e[0],h=new THREE.Shape,h.actions=g.actions,h.curves=g.curves,k.push(h),k;var l=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),l=a?!l:l;
-h=[];var p=[],q=[],r=0,t;p[r]=void 0;q[r]=[];var s,n;s=0;for(n=e.length;s<n;s++)g=e[s],t=g.getPoints(),f=THREE.Shape.Utils.isClockWise(t),(f=a?!f:f)?(!l&&p[r]&&r++,p[r]={s:new THREE.Shape,p:t},p[r].s.actions=g.actions,p[r].s.curves=g.curves,l&&r++,q[r]=[]):q[r].push({h:g,p:t[0]});if(!p[0])return c(e);if(1<p.length){s=!1;n=[];g=0;for(e=p.length;g<e;g++)h[g]=[];g=0;for(e=p.length;g<e;g++)for(f=q[g],l=0;l<f.length;l++){r=f[l];t=!0;for(var v=0;v<p.length;v++)d(r.p,p[v].p)&&(g!=v&&n.push({froms:g,tos:v,
-hole:l}),t?(t=!1,h[v].push(r)):s=!0);t&&h[g].push(r)}0<n.length&&(s||(q=h))}s=0;for(n=p.length;s<n;s++)for(h=p[s].s,k.push(h),g=q[s],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};
+h=[];var p=[],q=[],r=0,s;p[r]=void 0;q[r]=[];var t,n;t=0;for(n=e.length;t<n;t++)g=e[t],s=g.getPoints(),f=THREE.Shape.Utils.isClockWise(s),(f=a?!f:f)?(!l&&p[r]&&r++,p[r]={s:new THREE.Shape,p:s},p[r].s.actions=g.actions,p[r].s.curves=g.curves,l&&r++,q[r]=[]):q[r].push({h:g,p:s[0]});if(!p[0])return c(e);if(1<p.length){t=!1;n=[];g=0;for(e=p.length;g<e;g++)h[g]=[];g=0;for(e=p.length;g<e;g++)for(f=q[g],l=0;l<f.length;l++){r=f[l];s=!0;for(var v=0;v<p.length;v++)d(r.p,p[v].p)&&(g!=v&&n.push({froms:g,tos:v,
+hole:l}),s?(s=!1,h[v].push(r)):t=!0);s&&h[g].push(r)}0<n.length&&(t||(q=h))}t=0;for(n=p.length;t<n;t++)for(h=p[t].s,k.push(h),g=q[t],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};
 THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};
 THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,p=a.x-d.x,q=a.y-d.y,z=h*k-g*l,F=h*p-g*q;if(1E-10<Math.abs(z)){if(0<z){if(0>F||F>z)return[];k=l*p-k*q;if(0>k||k>z)return[]}else{if(0<F||F<z)return[];k=l*p-k*q;if(0<k||k<z)return[]}if(0==k)return!f||0!=F&&F!=z?[a]:[];if(k==z)return!f||0!=F&&F!=z?[b]:[];if(0==F)return[d];
-if(F==z)return[e];f=k/z;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=F||l*p!=k*q)return[];h=0==g&&0==h;k=0==k&&0==l;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,z=d.x,l=e,d=e.x):(b=e,z=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,z=d.y,l=e,d=e.y):(b=e,z=e.y,l=d,d=d.y));return k<=z?a<z?[]:a==z?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,p=a.x-d.x,q=a.y-d.y,z=h*k-g*l,G=h*p-g*q;if(1E-10<Math.abs(z)){if(0<z){if(0>G||G>z)return[];k=l*p-k*q;if(0>k||k>z)return[]}else{if(0<G||G<z)return[];k=l*p-k*q;if(0<k||k<z)return[]}if(0==k)return!f||0!=G&&G!=z?[a]:[];if(k==z)return!f||0!=G&&G!=z?[b]:[];if(0==G)return[d];
+if(G==z)return[e];f=k/z;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=G||l*p!=k*q)return[];h=0==g&&0==h;k=0==k&&0==l;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,z=d.x,l=e,d=e.x):(b=e,z=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,z=d.y,l=e,d=e.y):(b=e,z=e.y,l=d,d=d.y));return k<=z?a<z?[]:a==z?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
 [g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,p={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+":"+h[f].y,void 0!==p[l]&&console.log("Duplicate point",l),p[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;
-d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],p,q,D,z,F,H=[],C,x,A,O=0;for(p=b.length;O<p;O++)l.push(O);C=0;for(var K=2*l.length;0<l.length;){K--;if(0>K){console.log("Infinite Loop! Holes left:"+
-l.length+", Probably Hole outside Shape!");break}for(q=C;q<h.length;q++){D=h[q];p=-1;for(O=0;O<l.length;O++)if(z=l[O],F=D.x+":"+D.y+":"+z,void 0===H[F]){k=b[z];for(x=0;x<k.length;x++)if(z=k[x],c(q,x)&&!f(D,z)&&!g(D,z)){p=x;l.splice(O,1);C=h.slice(0,q+1);z=h.slice(q);x=k.slice(p);A=k.slice(0,p+1);h=C.concat(x).concat(A).concat(z);C=q;break}if(0<=p)break;H[F]=!0}if(0<=p)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,
+d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<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=[],p,q,D,z,G,I=[],B,y,A,O=0;for(p=b.length;O<p;O++)l.push(O);B=0;for(var L=2*l.length;0<l.length;){L--;if(0>L){console.log("Infinite Loop! Holes left:"+
+l.length+", Probably Hole outside Shape!");break}for(q=B;q<h.length;q++){D=h[q];p=-1;for(O=0;O<l.length;O++)if(z=l[O],G=D.x+":"+D.y+":"+z,void 0===I[G]){k=b[z];for(y=0;y<k.length;y++)if(z=k[y],c(q,y)&&!f(D,z)&&!g(D,z)){p=y;l.splice(O,1);B=h.slice(0,q+1);z=h.slice(q);y=k.slice(p);A=k.slice(0,p+1);h=B.concat(y).concat(A).concat(z);B=q;break}if(0<=p)break;I[G]=!0}if(0<=p)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,
 l=p[l],void 0!==l&&(k[h]=l);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
 b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.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.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};
 THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};
@@ -581,12 +581,12 @@ d[c[1]].z,d[c[2]].z,d[c[3]].z,e);return b});THREE.AnimationHandler={LINEAR:0,CAT
 THREE.Animation.prototype.stop=function(){this.isPlaying=!1;THREE.AnimationHandler.stop(this)};
 THREE.Animation.prototype.reset=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];c.matrixAutoUpdate=!0;void 0===c.animationCache&&(c.animationCache={});void 0===c.animationCache[this.data.name]&&(c.animationCache[this.data.name]={},c.animationCache[this.data.name].prevKey={pos:0,rot:0,scl:0},c.animationCache[this.data.name].nextKey={pos:0,rot:0,scl:0},c.animationCache[this.data.name].originalMatrix=c instanceof THREE.Bone?c.skinMatrix:c.matrix);for(var c=c.animationCache[this.data.name],
 d=0;3>d;d++){for(var e=this.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.time<this.currentTime&&g.index>f.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}};
-THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,r,t,s,n;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];s=a[c[2]];n=a[c[3]];c=e*e;r=e*c;d[0]=f(q[0],t[0],s[0],n[0],e,c,r);d[1]=f(q[1],t[1],s[1],n[1],e,c,r);d[2]=f(q[2],t[2],s[2],n[2],e,c,r);return d},f=function(a,b,c,d,e,f,r){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*
-r+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){var h;f=this.data.length;if(!0===this.loop&&this.currentTime>f)this.currentTime%=f,this.reset();else if(!1===this.loop&&this.currentTime>f){this.stop();return}f=0;for(var k=this.hierarchy.length;f<k;f++)for(var l=this.hierarchy[f],p=l.animationCache[this.data.name],q=0;3>q;q++){h=this.keyTypes[q];var r=p.prevKey[h],t=p.nextKey[h];if(t.time<=this.currentTime){r=this.data.hierarchy[f].keys[0];
-for(t=this.getNextKeyWith(h,f,1);t.time<this.currentTime&&t.index>r.index;)r=t,t=this.getNextKeyWith(h,f,t.index+1);p.prevKey[h]=r;p.nextKey[h]=t}l.matrixAutoUpdate=!0;l.matrixWorldNeedsUpdate=!0;var s=(this.currentTime-r.time)/(t.time-r.time),n=r[h],v=t[h];0>s&&(s=0);1<s&&(s=1);if("pos"===h)if(h=l.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=n[0]+(v[0]-n[0])*s,c.y=n[1]+(v[1]-n[1])*s,c.z=n[2]+(v[2]-n[2])*s,l instanceof THREE.Bone&&(r=this.weight/(this.weight+l.accumulatedPosWeight),
-h.lerp(c,r),l.accumulatedPosWeight+=this.weight);else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,r.index-1).pos,a[1]=n,a[2]=v,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,s=0.33*s+0.33,t=e(a,s),l instanceof THREE.Bone?(r=this.weight/(this.weight+l.accumulatedPosWeight),l.accumulatedPosWeight+=this.weight):r=1,h.x+=(t[0]-h.x)*r,h.y+=(t[1]-h.y)*r,h.z+=(t[2]-h.z)*r,this.interpolationType===
-THREE.AnimationHandler.CATMULLROM_FORWARD&&(s=e(a,1.01*s),b.set(s[0],s[1],s[2]),b.sub(h),b.y=0,b.normalize(),h=Math.atan2(b.x,b.z),l.rotation.set(0,h,0))}else"rot"===h?(THREE.Quaternion.slerp(n,v,d,s),l instanceof THREE.Bone?0===l.accumulatedRotWeight?(l.quaternion.copy(d),l.accumulatedRotWeight=this.weight):(r=this.weight/(this.weight+l.accumulatedRotWeight),THREE.Quaternion.slerp(l.quaternion,d,l.quaternion,r),l.accumulatedRotWeight+=this.weight):l.quaternion.copy(d)):"scl"===h&&(h=l.scale,c.x=
-n[0]+(v[0]-n[0])*s,c.y=n[1]+(v[1]-n[1])*s,c.z=n[2]+(v[2]-n[2])*s,l instanceof THREE.Bone&&(r=this.weight/(this.weight+l.accumulatedSclWeight),h.lerp(c,r),l.accumulatedSclWeight+=this.weight))}return!0}}}();
+THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,r,s,t,n;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];s=a[c[1]];t=a[c[2]];n=a[c[3]];c=e*e;r=e*c;d[0]=f(q[0],s[0],t[0],n[0],e,c,r);d[1]=f(q[1],s[1],t[1],n[1],e,c,r);d[2]=f(q[2],s[2],t[2],n[2],e,c,r);return d},f=function(a,b,c,d,e,f,r){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*
+r+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){var h;f=this.data.length;if(!0===this.loop&&this.currentTime>f)this.currentTime%=f,this.reset();else if(!1===this.loop&&this.currentTime>f){this.stop();return}f=0;for(var k=this.hierarchy.length;f<k;f++)for(var l=this.hierarchy[f],p=l.animationCache[this.data.name],q=0;3>q;q++){h=this.keyTypes[q];var r=p.prevKey[h],s=p.nextKey[h];if(s.time<=this.currentTime){r=this.data.hierarchy[f].keys[0];
+for(s=this.getNextKeyWith(h,f,1);s.time<this.currentTime&&s.index>r.index;)r=s,s=this.getNextKeyWith(h,f,s.index+1);p.prevKey[h]=r;p.nextKey[h]=s}l.matrixAutoUpdate=!0;l.matrixWorldNeedsUpdate=!0;var t=(this.currentTime-r.time)/(s.time-r.time),n=r[h],v=s[h];0>t&&(t=0);1<t&&(t=1);if("pos"===h)if(h=l.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=n[0]+(v[0]-n[0])*t,c.y=n[1]+(v[1]-n[1])*t,c.z=n[2]+(v[2]-n[2])*t,l instanceof THREE.Bone&&(r=this.weight/(this.weight+l.accumulatedPosWeight),
+h.lerp(c,r),l.accumulatedPosWeight+=this.weight);else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,r.index-1).pos,a[1]=n,a[2]=v,a[3]=this.getNextKeyWith("pos",f,s.index+1).pos,t=0.33*t+0.33,s=e(a,t),l instanceof THREE.Bone?(r=this.weight/(this.weight+l.accumulatedPosWeight),l.accumulatedPosWeight+=this.weight):r=1,h.x+=(s[0]-h.x)*r,h.y+=(s[1]-h.y)*r,h.z+=(s[2]-h.z)*r,this.interpolationType===
+THREE.AnimationHandler.CATMULLROM_FORWARD&&(t=e(a,1.01*t),b.set(t[0],t[1],t[2]),b.sub(h),b.y=0,b.normalize(),h=Math.atan2(b.x,b.z),l.rotation.set(0,h,0))}else"rot"===h?(THREE.Quaternion.slerp(n,v,d,t),l instanceof THREE.Bone?0===l.accumulatedRotWeight?(l.quaternion.copy(d),l.accumulatedRotWeight=this.weight):(r=this.weight/(this.weight+l.accumulatedRotWeight),THREE.Quaternion.slerp(l.quaternion,d,l.quaternion,r),l.accumulatedRotWeight+=this.weight):l.quaternion.copy(d)):"scl"===h&&(h=l.scale,c.x=
+n[0]+(v[0]-n[0])*t,c.y=n[1]+(v[1]-n[1])*t,c.z=n[2]+(v[2]-n[2])*t,l instanceof THREE.Bone&&(r=this.weight/(this.weight+l.accumulatedSclWeight),h.lerp(c,r),l.accumulatedSclWeight+=this.weight))}return!0}}}();
 THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};THREE.KeyFrameAnimation=function(a){this.root=a.node;this.data=THREE.AnimationHandler.init(a);this.hierarchy=THREE.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=0.001;this.isPlaying=!1;this.loop=this.isPaused=!0;a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 d.matrixWorldNeedsUpdate=!0}}};
@@ -605,44 +605,44 @@ THREE.CombinedCamera.prototype.toOrthographic=function(){var a=this.cameraP.aspe
 THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;this.left=-a/2;this.right=a/2;this.top=b/2;this.bottom=-b/2};THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.updateProjectionMatrix=function(){this.inPerspectiveMode?this.toPerspective():(this.toPerspective(),this.toOrthographic())};
 THREE.CombinedCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);var c=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
-THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,n){var v,w=h.widthSegments,u=h.heightSegments,y=e/2,M=f/2,B=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var D=w+1,z=u+1,F=e/w,H=f/u,C=new THREE.Vector3;C[v]=0<g?1:-1;for(e=0;e<z;e++)for(f=0;f<D;f++){var x=new THREE.Vector3;x[a]=(f*F-y)*c;x[b]=(e*H-M)*d;x[v]=g;h.vertices.push(x)}for(e=
-0;e<u;e++)for(f=0;f<w;f++)M=f+D*e,a=f+D*(e+1),b=f+1+D*(e+1),c=f+1+D*e,d=new THREE.Vector2(f/w,1-e/u),g=new THREE.Vector2(f/w,1-(e+1)/u),v=new THREE.Vector2((f+1)/w,1-(e+1)/u),y=new THREE.Vector2((f+1)/w,1-e/u),M=new THREE.Face3(M+B,a+B,c+B),M.normal.copy(C),M.vertexNormals.push(C.clone(),C.clone(),C.clone()),M.materialIndex=n,h.faces.push(M),h.faceVertexUvs[0].push([d,g,y]),M=new THREE.Face3(a+B,b+B,c+B),M.normal.copy(C),M.vertexNormals.push(C.clone(),C.clone(),C.clone()),M.materialIndex=n,h.faces.push(M),
-h.faceVertexUvs[0].push([g.clone(),v,y.clone()])}THREE.Geometry.call(this);this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(0.5,0.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,0,1);for(e=1;e<=
-b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){console.warn("DEPRECATED: THREE.CubeGeometry is deprecated. Use THREE.BoxGeometry instead.");return new THREE.BoxGeometry(a,b,c,d,e,f)};THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;var g=c/2,h,k,l=[],p=[];for(k=0;k<=e;k++){var q=[],r=[],t=k/e,s=t*(b-a)+a;for(h=0;h<=d;h++){var n=h/d,v=new THREE.Vector3;v.x=s*Math.sin(n*Math.PI*2);v.y=-t*c+g;v.z=s*Math.cos(n*Math.PI*2);this.vertices.push(v);q.push(this.vertices.length-1);r.push(new THREE.Vector2(n,
-1-t))}l.push(q);p.push(r)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[l[0][h]].clone(),r=this.vertices[l[0][h+1]].clone()):(q=this.vertices[l[1][h]].clone(),r=this.vertices[l[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),k=0;k<e;k++){var t=l[k][h],s=l[k+1][h],n=l[k+1][h+1],v=l[k][h+1],w=q.clone(),u=q.clone(),y=r.clone(),M=r.clone(),B=p[k][h].clone(),D=p[k+1][h].clone(),z=p[k+1][h+1].clone(),F=p[k][h+1].clone();this.faces.push(new THREE.Face3(t,
-s,v,[w,u,M]));this.faceVertexUvs[0].push([B,D,F]);this.faces.push(new THREE.Face3(s,n,v,[u.clone(),y,M.clone()]));this.faceVertexUvs[0].push([D.clone(),z,F.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)t=l[0][h],s=l[0][h+1],n=this.vertices.length-1,w=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),B=p[0][h].clone(),D=p[0][h+1].clone(),z=new THREE.Vector2(D.x,0),this.faces.push(new THREE.Face3(t,s,n,[w,u,y])),this.faceVertexUvs[0].push([B,
-D,z]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)t=l[k][h+1],s=l[k][h],n=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),B=p[k][h+1].clone(),D=p[k][h].clone(),z=new THREE.Vector2(D.x,1),this.faces.push(new THREE.Face3(t,s,n,[w,u,y])),this.faceVertexUvs[0].push([B,D,z]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
+THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,n){var v,w=h.widthSegments,u=h.heightSegments,x=e/2,F=f/2,C=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var D=w+1,z=u+1,G=e/w,I=f/u,B=new THREE.Vector3;B[v]=0<g?1:-1;for(e=0;e<z;e++)for(f=0;f<D;f++){var y=new THREE.Vector3;y[a]=(f*G-x)*c;y[b]=(e*I-F)*d;y[v]=g;h.vertices.push(y)}for(e=
+0;e<u;e++)for(f=0;f<w;f++)F=f+D*e,a=f+D*(e+1),b=f+1+D*(e+1),c=f+1+D*e,d=new THREE.Vector2(f/w,1-e/u),g=new THREE.Vector2(f/w,1-(e+1)/u),v=new THREE.Vector2((f+1)/w,1-(e+1)/u),x=new THREE.Vector2((f+1)/w,1-e/u),F=new THREE.Face3(F+C,a+C,c+C),F.normal.copy(B),F.vertexNormals.push(B.clone(),B.clone(),B.clone()),F.materialIndex=n,h.faces.push(F),h.faceVertexUvs[0].push([d,g,x]),F=new THREE.Face3(a+C,b+C,c+C),F.normal.copy(B),F.vertexNormals.push(B.clone(),B.clone(),B.clone()),F.materialIndex=n,h.faces.push(F),
+h.faceVertexUvs[0].push([g.clone(),v,x.clone()])}THREE.Geometry.call(this);this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(0.5,0.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,0,1);for(e=1;e<=
+b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){console.warn("DEPRECATED: THREE.CubeGeometry is deprecated. Use THREE.BoxGeometry instead.");return new THREE.BoxGeometry(a,b,c,d,e,f)};THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;var g=c/2,h,k,l=[],p=[];for(k=0;k<=e;k++){var q=[],r=[],s=k/e,t=s*(b-a)+a;for(h=0;h<=d;h++){var n=h/d,v=new THREE.Vector3;v.x=t*Math.sin(n*Math.PI*2);v.y=-s*c+g;v.z=t*Math.cos(n*Math.PI*2);this.vertices.push(v);q.push(this.vertices.length-1);r.push(new THREE.Vector2(n,
+1-s))}l.push(q);p.push(r)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[l[0][h]].clone(),r=this.vertices[l[0][h+1]].clone()):(q=this.vertices[l[1][h]].clone(),r=this.vertices[l[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),k=0;k<e;k++){var s=l[k][h],t=l[k+1][h],n=l[k+1][h+1],v=l[k][h+1],w=q.clone(),u=q.clone(),x=r.clone(),F=r.clone(),C=p[k][h].clone(),D=p[k+1][h].clone(),z=p[k+1][h+1].clone(),G=p[k][h+1].clone();this.faces.push(new THREE.Face3(s,
+t,v,[w,u,F]));this.faceVertexUvs[0].push([C,D,G]);this.faces.push(new THREE.Face3(t,n,v,[u.clone(),x,F.clone()]));this.faceVertexUvs[0].push([D.clone(),z,G.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)s=l[0][h],t=l[0][h+1],n=this.vertices.length-1,w=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),C=p[0][h].clone(),D=p[0][h+1].clone(),z=new THREE.Vector2(D.x,0),this.faces.push(new THREE.Face3(s,t,n,[w,u,x])),this.faceVertexUvs[0].push([C,
+D,z]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)s=l[k][h+1],t=l[k][h],n=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),C=p[k][h+1].clone(),D=p[k][h].clone(),z=new THREE.Vector2(D.x,1),this.faces.push(new THREE.Face3(s,t,n,[w,u,x])),this.faceVertexUvs[0].push([C,D,z]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.Math.sign,e=1,e=a.x-b.x,f=a.y-b.y,g=c.x-a.x,h=c.y-a.y,k=e*e+f*f;if(1E-10<Math.abs(e*h-f*g)){var l=Math.sqrt(k),d=Math.sqrt(g*g+h*h),k=b.x-f/l;b=b.y+e/l;g=((c.x-h/d-k)*h-(c.y+g/d-b)*g)/(e*h-f*g);c=k+e*g-a.x;a=b+f*g-a.y;e=c*c+a*a;if(2>=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10<e?1E-10<g&&(a=!0):-1E-10>e?-1E-10>g&&
-(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(E=c.length;0<=--E;){e=E;f=E-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*p,g=0;g<h;g++){var k=la*g,l=la*(g+1),n=d+e+k,k=d+f+k,q=d+f+l,l=d+e+l,r=c,s=g,v=h,w=e,z=f,n=n+A,k=k+A,q=q+A,l=l+A;x.faces.push(new THREE.Face3(n,k,l,null,null,u));x.faces.push(new THREE.Face3(k,q,l,null,null,u));n=y.generateSideWallUV(x,a,r,b,n,k,q,l,s,v,w,z);x.faceVertexUvs[0].push([n[0],n[1],
-n[3]]);x.faceVertexUvs[0].push([n[1],n[2],n[3]])}}}function f(a,b,c){x.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=A;d+=A;e+=A;x.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?y.generateBottomUV(x,a,b,c,d,e):y.generateTopUV(x,a,b,c,d,e);x.faceVertexUvs[0].push(c)}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,p=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,r=
-void 0!==b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,n,v=!1,w=b.material,u=b.extrudeMaterial,y=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,M,B,D,z;s&&(n=s.getSpacedPoints(t),v=!0,q=!1,M=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),B=new THREE.Vector3,D=new THREE.Vector3,z=new THREE.Vector3);q||(l=k=p=0);var F,H,C,x=this,A=this.vertices.length,s=a.extractPoints(r),r=s.shape,O=s.holes;if(s=!THREE.Shape.Utils.isClockWise(r)){r=
-r.reverse();H=0;for(C=O.length;H<C;H++)F=O[H],THREE.Shape.Utils.isClockWise(F)&&(O[H]=F.reverse());s=!1}var K=THREE.Shape.Utils.triangulateShape(r,O),L=r;H=0;for(C=O.length;H<C;H++)F=O[H],r=r.concat(F);var J,G,Q,Y,U,la=r.length,W,R=K.length,s=[],E=0;Q=L.length;J=Q-1;for(G=E+1;E<Q;E++,J++,G++)J===Q&&(J=0),G===Q&&(G=0),s[E]=d(L[E],L[J],L[G]);var da=[],V,X=s.concat();H=0;for(C=O.length;H<C;H++){F=O[H];V=[];E=0;Q=F.length;J=Q-1;for(G=E+1;E<Q;E++,J++,G++)J===Q&&(J=0),G===Q&&(G=0),V[E]=d(F[E],F[J],F[G]);
-da.push(V);X=X.concat(V)}for(J=0;J<p;J++){Q=J/p;Y=k*(1-Q);G=l*Math.sin(Q*Math.PI/2);E=0;for(Q=L.length;E<Q;E++)U=c(L[E],s[E],G),f(U.x,U.y,-Y);H=0;for(C=O.length;H<C;H++)for(F=O[H],V=da[H],E=0,Q=F.length;E<Q;E++)U=c(F[E],V[E],G),f(U.x,U.y,-Y)}G=l;for(E=0;E<la;E++)U=q?c(r[E],X[E],G):r[E],v?(D.copy(M.normals[0]).multiplyScalar(U.x),B.copy(M.binormals[0]).multiplyScalar(U.y),z.copy(n[0]).add(D).add(B),f(z.x,z.y,z.z)):f(U.x,U.y,0);for(Q=1;Q<=t;Q++)for(E=0;E<la;E++)U=q?c(r[E],X[E],G):r[E],v?(D.copy(M.normals[Q]).multiplyScalar(U.x),
-B.copy(M.binormals[Q]).multiplyScalar(U.y),z.copy(n[Q]).add(D).add(B),f(z.x,z.y,z.z)):f(U.x,U.y,h/t*Q);for(J=p-1;0<=J;J--){Q=J/p;Y=k*(1-Q);G=l*Math.sin(Q*Math.PI/2);E=0;for(Q=L.length;E<Q;E++)U=c(L[E],s[E],G),f(U.x,U.y,h+Y);H=0;for(C=O.length;H<C;H++)for(F=O[H],V=da[H],E=0,Q=F.length;E<Q;E++)U=c(F[E],V[E],G),v?f(U.x,U.y+n[t-1].y,n[t-1].x+Y):f(U.x,U.y,h+Y)}(function(){if(q){var a;a=0*la;for(E=0;E<R;E++)W=K[E],g(W[2]+a,W[1]+a,W[0]+a,!0);a=t+2*p;a*=la;for(E=0;E<R;E++)W=K[E],g(W[0]+a,W[1]+a,W[2]+a,!1)}else{for(E=
-0;E<R;E++)W=K[E],g(W[2],W[1],W[0],!0);for(E=0;E<R;E++)W=K[E],g(W[0]+la*t,W[1]+la*t,W[2]+la*t,!1)}})();(function(){var a=0;e(L,a);a+=L.length;H=0;for(C=O.length;H<C;H++)F=O[H],e(F,a),a+=F.length})()};
+(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(E=c.length;0<=--E;){e=E;f=E-1;0>f&&(f=c.length-1);for(var g=0,h=s+2*p,g=0;g<h;g++){var k=la*g,l=la*(g+1),n=d+e+k,k=d+f+k,q=d+f+l,l=d+e+l,r=c,t=g,v=h,w=e,z=f,n=n+A,k=k+A,q=q+A,l=l+A;y.faces.push(new THREE.Face3(n,k,l,null,null,u));y.faces.push(new THREE.Face3(k,q,l,null,null,u));n=x.generateSideWallUV(y,a,r,b,n,k,q,l,t,v,w,z);y.faceVertexUvs[0].push([n[0],n[1],
+n[3]]);y.faceVertexUvs[0].push([n[1],n[2],n[3]])}}}function f(a,b,c){y.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=A;d+=A;e+=A;y.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?x.generateBottomUV(y,a,b,c,d,e):x.generateTopUV(y,a,b,c,d,e);y.faceVertexUvs[0].push(c)}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,p=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,r=
+void 0!==b.curveSegments?b.curveSegments:12,s=void 0!==b.steps?b.steps:1,t=b.extrudePath,n,v=!1,w=b.material,u=b.extrudeMaterial,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,F,C,D,z;t&&(n=t.getSpacedPoints(s),v=!0,q=!1,F=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),C=new THREE.Vector3,D=new THREE.Vector3,z=new THREE.Vector3);q||(l=k=p=0);var G,I,B,y=this,A=this.vertices.length,t=a.extractPoints(r),r=t.shape,O=t.holes;if(t=!THREE.Shape.Utils.isClockWise(r)){r=
+r.reverse();I=0;for(B=O.length;I<B;I++)G=O[I],THREE.Shape.Utils.isClockWise(G)&&(O[I]=G.reverse());t=!1}var L=THREE.Shape.Utils.triangulateShape(r,O),M=r;I=0;for(B=O.length;I<B;I++)G=O[I],r=r.concat(G);var K,H,Q,Y,U,la=r.length,W,R=L.length,t=[],E=0;Q=M.length;K=Q-1;for(H=E+1;E<Q;E++,K++,H++)K===Q&&(K=0),H===Q&&(H=0),t[E]=d(M[E],M[K],M[H]);var da=[],V,X=t.concat();I=0;for(B=O.length;I<B;I++){G=O[I];V=[];E=0;Q=G.length;K=Q-1;for(H=E+1;E<Q;E++,K++,H++)K===Q&&(K=0),H===Q&&(H=0),V[E]=d(G[E],G[K],G[H]);
+da.push(V);X=X.concat(V)}for(K=0;K<p;K++){Q=K/p;Y=k*(1-Q);H=l*Math.sin(Q*Math.PI/2);E=0;for(Q=M.length;E<Q;E++)U=c(M[E],t[E],H),f(U.x,U.y,-Y);I=0;for(B=O.length;I<B;I++)for(G=O[I],V=da[I],E=0,Q=G.length;E<Q;E++)U=c(G[E],V[E],H),f(U.x,U.y,-Y)}H=l;for(E=0;E<la;E++)U=q?c(r[E],X[E],H):r[E],v?(D.copy(F.normals[0]).multiplyScalar(U.x),C.copy(F.binormals[0]).multiplyScalar(U.y),z.copy(n[0]).add(D).add(C),f(z.x,z.y,z.z)):f(U.x,U.y,0);for(Q=1;Q<=s;Q++)for(E=0;E<la;E++)U=q?c(r[E],X[E],H):r[E],v?(D.copy(F.normals[Q]).multiplyScalar(U.x),
+C.copy(F.binormals[Q]).multiplyScalar(U.y),z.copy(n[Q]).add(D).add(C),f(z.x,z.y,z.z)):f(U.x,U.y,h/s*Q);for(K=p-1;0<=K;K--){Q=K/p;Y=k*(1-Q);H=l*Math.sin(Q*Math.PI/2);E=0;for(Q=M.length;E<Q;E++)U=c(M[E],t[E],H),f(U.x,U.y,h+Y);I=0;for(B=O.length;I<B;I++)for(G=O[I],V=da[I],E=0,Q=G.length;E<Q;E++)U=c(G[E],V[E],H),v?f(U.x,U.y+n[s-1].y,n[s-1].x+Y):f(U.x,U.y,h+Y)}(function(){if(q){var a;a=0*la;for(E=0;E<R;E++)W=L[E],g(W[2]+a,W[1]+a,W[0]+a,!0);a=s+2*p;a*=la;for(E=0;E<R;E++)W=L[E],g(W[0]+a,W[1]+a,W[2]+a,!1)}else{for(E=
+0;E<R;E++)W=L[E],g(W[2],W[1],W[0],!0);for(E=0;E<R;E++)W=L[E],g(W[0]+la*s,W[1]+la*s,W[2]+la*s,!1)}})();(function(){var a=0;e(M,a);a+=M.length;I=0;for(B=O.length;I<B;I++)G=O[I],e(G,a),a+=G.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,g,h,k,l,p,q){b=a.vertices[e].x;c=a.vertices[e].y;e=a.vertices[e].z;d=a.vertices[f].x;k=a.vertices[f].y;f=a.vertices[f].z;l=a.vertices[g].x;
 p=a.vertices[g].y;g=a.vertices[g].z;q=a.vertices[h].x;var r=a.vertices[h].y;a=a.vertices[h].z;return 0.01>Math.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(l,1-g),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-f),new THREE.Vector2(p,1-g),new THREE.Vector2(r,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var p=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],
-k=k.concat(g);l=k.length;f=p.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=p[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,g,l))};THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),p=Math.sin(k),k=0,q=a.length;k<q;k++){var r=a[k],t=new THREE.Vector3;t.x=l*r.x-p*r.y;t.y=p*r.x+l*r.y;t.z=r.z;this.vertices.push(t)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,q=a.length-1;k<q;k++){b=p=k+c*g;d=p+c;var l=p+1+c,p=p+1,r=g*f,t=k*e,s=r+f,n=t+e;this.faces.push(new THREE.Face3(b,d,p));this.faceVertexUvs[0].push([new THREE.Vector2(r,
-t),new THREE.Vector2(s,t),new THREE.Vector2(r,n)]);this.faces.push(new THREE.Face3(d,l,p));this.faceVertexUvs[0].push([new THREE.Vector2(s,t),new THREE.Vector2(s,n),new THREE.Vector2(r,n)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,l=b/d,p=new THREE.Vector3(0,0,1);for(a=0;a<h;a++){var q=a*l-f;for(b=0;b<g;b++)this.vertices.push(new THREE.Vector3(b*k-e,-q,0))}for(a=0;a<d;a++)for(b=0;b<c;b++){var r=b+g*a,e=b+g*(a+1),f=b+1+g*(a+1),h=b+1+g*a,k=new THREE.Vector2(b/c,1-a/d),l=new THREE.Vector2(b/c,1-(a+1)/d),q=new THREE.Vector2((b+1)/c,1-(a+1)/d),t=new THREE.Vector2((b+
-1)/c,1-a/d),r=new THREE.Face3(r,e,h);r.normal.copy(p);r.vertexNormals.push(p.clone(),p.clone(),p.clone());this.faces.push(r);this.faceVertexUvs[0].push([k,l,t]);r=new THREE.Face3(e,f,h);r.normal.copy(p);r.vertexNormals.push(p.clone(),p.clone(),p.clone());this.faces.push(r);this.faceVertexUvs[0].push([l.clone(),q,t.clone()])}};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(3,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<=d;a++){for(g=0;g<=c;g++){var p=new THREE.Vector3,q=e+g/c*f;p.x=k*Math.cos(q);p.y=k*Math.sin(q);this.vertices.push(p);h.push(new THREE.Vector2((p.x/b+1)/2,(p.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*c,g=0;g<=c;g++)q=g+e,f=q+a,l=q+c+a,p=q+c+1+a,this.faces.push(new THREE.Face3(f,
-l,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[p].clone()]),f=q+a,l=q+c+1+a,p=q+1+a,this.faces.push(new THREE.Face3(f,l,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[p].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],p=[];for(k=0;k<=c;k++){var q=[],r=[];for(h=0;h<=b;h++){var t=h/b,s=k/c,n=new THREE.Vector3;n.x=-a*Math.cos(d+t*e)*Math.sin(f+s*g);n.y=a*Math.cos(f+s*g);n.z=
-a*Math.sin(d+t*e)*Math.sin(f+s*g);this.vertices.push(n);q.push(this.vertices.length-1);r.push(new THREE.Vector2(t,1-s))}l.push(q);p.push(r)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var q=this.vertices[d].clone().normalize(),r=this.vertices[e].clone().normalize(),t=this.vertices[f].clone().normalize(),s=this.vertices[g].clone().normalize(),n=p[k][h+1].clone(),v=p[k][h].clone(),w=p[k+1][h].clone(),u=p[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(n.x=(n.x+
-v.x)/2,this.faces.push(new THREE.Face3(d,f,g,[q,t,s])),this.faceVertexUvs[0].push([n,w,u])):Math.abs(this.vertices[f].y)===a?(w.x=(w.x+u.x)/2,this.faces.push(new THREE.Face3(d,e,f,[q,r,t])),this.faceVertexUvs[0].push([n,v,w])):(this.faces.push(new THREE.Face3(d,e,g,[q,r,s])),this.faceVertexUvs[0].push([n,v,u]),this.faces.push(new THREE.Face3(e,f,g,[r.clone(),t,s.clone()])),this.faceVertexUvs[0].push([v.clone(),w,u.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
+k=k.concat(g);l=k.length;f=p.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=p[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,g,l))};THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),p=Math.sin(k),k=0,q=a.length;k<q;k++){var r=a[k],s=new THREE.Vector3;s.x=l*r.x-p*r.y;s.y=p*r.x+l*r.y;s.z=r.z;this.vertices.push(s)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,q=a.length-1;k<q;k++){b=p=k+c*g;d=p+c;var l=p+1+c,p=p+1,r=g*f,s=k*e,t=r+f,n=s+e;this.faces.push(new THREE.Face3(b,d,p));this.faceVertexUvs[0].push([new THREE.Vector2(r,
+s),new THREE.Vector2(t,s),new THREE.Vector2(r,n)]);this.faces.push(new THREE.Face3(d,l,p));this.faceVertexUvs[0].push([new THREE.Vector2(t,s),new THREE.Vector2(t,n),new THREE.Vector2(r,n)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,l=b/d,p=new THREE.Vector3(0,0,1);for(a=0;a<h;a++){var q=a*l-f;for(b=0;b<g;b++)this.vertices.push(new THREE.Vector3(b*k-e,-q,0))}for(a=0;a<d;a++)for(b=0;b<c;b++){var r=b+g*a,e=b+g*(a+1),f=b+1+g*(a+1),h=b+1+g*a,k=new THREE.Vector2(b/c,1-a/d),l=new THREE.Vector2(b/c,1-(a+1)/d),q=new THREE.Vector2((b+1)/c,1-(a+1)/d),s=new THREE.Vector2((b+
+1)/c,1-a/d),r=new THREE.Face3(r,e,h);r.normal.copy(p);r.vertexNormals.push(p.clone(),p.clone(),p.clone());this.faces.push(r);this.faceVertexUvs[0].push([k,l,s]);r=new THREE.Face3(e,f,h);r.normal.copy(p);r.vertexNormals.push(p.clone(),p.clone(),p.clone());this.faces.push(r);this.faceVertexUvs[0].push([l.clone(),q,s.clone()])}};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(3,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<=d;a++){for(g=0;g<=c;g++){var p=new THREE.Vector3,q=e+g/c*f;p.x=k*Math.cos(q);p.y=k*Math.sin(q);this.vertices.push(p);h.push(new THREE.Vector2((p.x/b+1)/2,(p.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*c,g=0;g<=c;g++)q=g+e,f=q+a,l=q+c+a,p=q+c+1+a,this.faces.push(new THREE.Face3(f,
+l,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[p].clone()]),f=q+a,l=q+c+1+a,p=q+1+a,this.faces.push(new THREE.Face3(f,l,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[p].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],p=[];for(k=0;k<=c;k++){var q=[],r=[];for(h=0;h<=b;h++){var s=h/b,t=k/c,n=new THREE.Vector3;n.x=-a*Math.cos(d+s*e)*Math.sin(f+t*g);n.y=a*Math.cos(f+t*g);n.z=
+a*Math.sin(d+s*e)*Math.sin(f+t*g);this.vertices.push(n);q.push(this.vertices.length-1);r.push(new THREE.Vector2(s,1-t))}l.push(q);p.push(r)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var q=this.vertices[d].clone().normalize(),r=this.vertices[e].clone().normalize(),s=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),n=p[k][h+1].clone(),v=p[k][h].clone(),w=p[k+1][h].clone(),u=p[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(n.x=(n.x+
+v.x)/2,this.faces.push(new THREE.Face3(d,f,g,[q,s,t])),this.faceVertexUvs[0].push([n,w,u])):Math.abs(this.vertices[f].y)===a?(w.x=(w.x+u.x)/2,this.faces.push(new THREE.Face3(d,e,f,[q,r,s])),this.faceVertexUvs[0].push([n,v,w])):(this.faces.push(new THREE.Face3(d,e,g,[q,r,t])),this.faceVertexUvs[0].push([n,v,u]),this.faces.push(new THREE.Face3(e,f,g,[r.clone(),s,t.clone()])),this.faceVertexUvs[0].push([v.clone(),w,u.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
 a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var p=l/d*e,q=k/c*Math.PI*2;f.x=a*Math.cos(p);f.y=a*Math.sin(p);var r=new THREE.Vector3;r.x=(a+b*Math.cos(q))*Math.cos(p);r.y=(a+b*Math.cos(q))*Math.sin(p);r.z=b*Math.sin(q);this.vertices.push(r);g.push(new THREE.Vector2(l/d,k/c));h.push(r.clone().sub(f).normalize())}for(k=
-1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,p=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(p),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),p=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(p),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*0.5;g=d*(2+b)*g*0.5;d=e*d*Math.sin(a)*0.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),l=new THREE.Vector3,p=new THREE.Vector3,q=new THREE.Vector3,r=0;r<c;++r){k[r]=Array(d);var t=r/c*2*e*Math.PI,
-s=h(t,f,e,a,g),t=h(t+0.01,f,e,a,g);l.subVectors(t,s);p.addVectors(t,s);q.crossVectors(l,p);p.crossVectors(q,l);q.normalize();p.normalize();for(t=0;t<d;++t){var n=t/d*2*Math.PI,v=-b*Math.cos(n),n=b*Math.sin(n),w=new THREE.Vector3;w.x=s.x+v*p.x+n*q.x;w.y=s.y+v*p.y+n*q.y;w.z=s.z+v*p.z+n*q.z;k[r][t]=this.vertices.push(w)-1}}for(r=0;r<c;++r)for(t=0;t<d;++t)e=(r+1)%c,f=(t+1)%d,a=k[r][t],b=k[e][t],e=k[e][f],f=k[r][f],g=new THREE.Vector2(r/c,t/d),l=new THREE.Vector2((r+1)/c,t/d),p=new THREE.Vector2((r+1)/
-c,(t+1)/d),q=new THREE.Vector2(r/c,(t+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,q]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),p,q.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var f=[],g,h,k=b+1,l,p,q,r,t=new THREE.Vector3,s,n,v;s=new THREE.TubeGeometry.FrenetFrames(a,b,e);n=s.normals;v=s.binormals;this.tangents=s.tangents;this.normals=n;this.binormals=v;for(s=0;s<k;s++)for(f[s]=[],l=s/(k-1),r=a.getPointAt(l),g=n[s],h=v[s],l=0;l<d;l++)p=l/d*2*Math.PI,q=-c*Math.cos(p),p=c*Math.sin(p),t.copy(r),t.x+=q*g.x+p*
-h.x,t.y+=q*g.y+p*h.y,t.z+=q*g.z+p*h.z,f[s][l]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(s=0;s<b;s++)for(l=0;l<d;l++)k=e?(s+1)%b:s+1,t=(l+1)%d,a=f[s][l],c=f[k][l],k=f[k][t],t=f[s][t],n=new THREE.Vector2(s/b,l/d),v=new THREE.Vector2((s+1)/b,l/d),g=new THREE.Vector2((s+1)/b,(l+1)/d),h=new THREE.Vector2(s/b,(l+1)/d),this.faces.push(new THREE.Face3(a,c,t)),this.faceVertexUvs[0].push([n,v,h]),this.faces.push(new THREE.Face3(c,k,t)),this.faceVertexUvs[0].push([v.clone(),g,h.clone()]);this.computeFaceNormals();
+1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,p=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(p),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),p=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(p),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*0.5;g=d*(2+b)*g*0.5;d=e*d*Math.sin(a)*0.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),l=new THREE.Vector3,p=new THREE.Vector3,q=new THREE.Vector3,r=0;r<c;++r){k[r]=Array(d);var s=r/c*2*e*Math.PI,
+t=h(s,f,e,a,g),s=h(s+0.01,f,e,a,g);l.subVectors(s,t);p.addVectors(s,t);q.crossVectors(l,p);p.crossVectors(q,l);q.normalize();p.normalize();for(s=0;s<d;++s){var n=s/d*2*Math.PI,v=-b*Math.cos(n),n=b*Math.sin(n),w=new THREE.Vector3;w.x=t.x+v*p.x+n*q.x;w.y=t.y+v*p.y+n*q.y;w.z=t.z+v*p.z+n*q.z;k[r][s]=this.vertices.push(w)-1}}for(r=0;r<c;++r)for(s=0;s<d;++s)e=(r+1)%c,f=(s+1)%d,a=k[r][s],b=k[e][s],e=k[e][f],f=k[r][f],g=new THREE.Vector2(r/c,s/d),l=new THREE.Vector2((r+1)/c,s/d),p=new THREE.Vector2((r+1)/
+c,(s+1)/d),q=new THREE.Vector2(r/c,(s+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,q]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),p,q.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var f=[],g,h,k=b+1,l,p,q,r,s=new THREE.Vector3,t,n,v;t=new THREE.TubeGeometry.FrenetFrames(a,b,e);n=t.normals;v=t.binormals;this.tangents=t.tangents;this.normals=n;this.binormals=v;for(t=0;t<k;t++)for(f[t]=[],l=t/(k-1),r=a.getPointAt(l),g=n[t],h=v[t],l=0;l<d;l++)p=l/d*2*Math.PI,q=-c*Math.cos(p),p=c*Math.sin(p),s.copy(r),s.x+=q*g.x+p*
+h.x,s.y+=q*g.y+p*h.y,s.z+=q*g.z+p*h.z,f[t][l]=this.vertices.push(new THREE.Vector3(s.x,s.y,s.z))-1;for(t=0;t<b;t++)for(l=0;l<d;l++)k=e?(t+1)%b:t+1,s=(l+1)%d,a=f[t][l],c=f[k][l],k=f[k][s],s=f[t][s],n=new THREE.Vector2(t/b,l/d),v=new THREE.Vector2((t+1)/b,l/d),g=new THREE.Vector2((t+1)/b,(l+1)/d),h=new THREE.Vector2(t/b,(l+1)/d),this.faces.push(new THREE.Face3(a,c,s)),this.faceVertexUvs[0].push([n,v,h]),this.faces.push(new THREE.Face3(c,k,s)),this.faceVertexUvs[0].push([v.clone(),g,h.clone()]);this.computeFaceNormals();
 this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,p,q;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)p=l/(b-1),e[l]=a.getTangentAt(p),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);p=Math.abs(e[0].y);q=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));p<=a&&(a=p,d.set(0,1,0));q<=a&&d.set(0,0,1);h.crossVectors(e[0],
 d).normalize();f[0].crossVectors(e[0],h);g[0].crossVectors(e[0],f[0]);for(l=1;l<b;l++)f[l]=f[l-1].clone(),g[l]=g[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),f[l].applyMatrix4(k.makeRotationAxis(h,d))),g[l].crossVectors(e[l],f[l]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),l=1;l<b;l++)f[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),g[l].crossVectors(e[l],
 f[l])};THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+0.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+0.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);v.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(v.z,-v.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,
 b){var c=Math.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],n=0;n<=c;n++){l[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(g.clone().lerp(h,n/c)),r=c-n,s=0;s<=r;s++)l[n][s]=0==s&&n==c?p:e(p.clone().lerp(q,s/r))}for(n=0;n<c;n++)for(s=0;s<2*(c-n)-1;s++)d=Math.floor(s/2),0==s%2?f(l[n][d+1],l[n+1][d],l[n][d]):f(l[n][d+1],l[n+1][d+1],l[n+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/
-Math.PI+0.5,a.y));return a.clone()}THREE.Geometry.call(this);c=c||1;d=d||0;for(var k=this,l=0,p=a.length;l<p;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var q=[],r=l=0,p=b.length;l<p;l+=3,r++){var t=a[b[l]],s=a[b[l+1]],n=a[b[l+2]];q[r]=new THREE.Face3(t.index,s.index,n.index,[t.clone(),s.clone(),n.clone()])}for(var v=new THREE.Vector3,l=0,p=q.length;l<p;l++)g(q[l],d);l=0;for(p=this.faceVertexUvs[0].length;l<p;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,q=b[2].x,r=Math.max(d,
-Math.max(a,q)),t=Math.min(d,Math.min(a,q)),0.9<r&&0.1>t&&(0.2>d&&(b[0].x+=1),0.2>a&&(b[1].x+=1),0.2>q&&(b[2].x+=1));l=0;for(p=this.vertices.length;l<p;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.IcosahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b)};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b)};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b)};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,p=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var q,r,t,s;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*p+h,d=g*p+h+1,l=(g+1)*p+h+1,k=(g+1)*p+h,q=new THREE.Vector2(h/b,g/c),r=new THREE.Vector2((h+1)/b,g/c),t=new THREE.Vector2((h+1)/b,(g+1)/c),s=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,d,k)),f.push([q,r,s]),e.push(new THREE.Face3(d,l,k)),
-f.push([r.clone(),t,s.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.AxisHelper=function(a){a=a||1;var b=new THREE.Geometry;b.vertices.push(new THREE.Vector3,new THREE.Vector3(a,0,0),new THREE.Vector3,new THREE.Vector3(0,a,0),new THREE.Vector3,new THREE.Vector3(0,0,a));b.colors.push(new THREE.Color(16711680),new THREE.Color(16755200),new THREE.Color(65280),new THREE.Color(11206400),new THREE.Color(255),new THREE.Color(43775));a=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,b,a,THREE.LinePieces)};
+Math.PI+0.5,a.y));return a.clone()}THREE.Geometry.call(this);c=c||1;d=d||0;for(var k=this,l=0,p=a.length;l<p;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var q=[],r=l=0,p=b.length;l<p;l+=3,r++){var s=a[b[l]],t=a[b[l+1]],n=a[b[l+2]];q[r]=new THREE.Face3(s.index,t.index,n.index,[s.clone(),t.clone(),n.clone()])}for(var v=new THREE.Vector3,l=0,p=q.length;l<p;l++)g(q[l],d);l=0;for(p=this.faceVertexUvs[0].length;l<p;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,q=b[2].x,r=Math.max(d,
+Math.max(a,q)),s=Math.min(d,Math.min(a,q)),0.9<r&&0.1>s&&(0.2>d&&(b[0].x+=1),0.2>a&&(b[1].x+=1),0.2>q&&(b[2].x+=1));l=0;for(p=this.vertices.length;l<p;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.IcosahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b)};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b)};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b)};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,p=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var q,r,s,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*p+h,d=g*p+h+1,l=(g+1)*p+h+1,k=(g+1)*p+h,q=new THREE.Vector2(h/b,g/c),r=new THREE.Vector2((h+1)/b,g/c),s=new THREE.Vector2((h+1)/b,(g+1)/c),t=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,d,k)),f.push([q,r,t]),e.push(new THREE.Face3(d,l,k)),
+f.push([r.clone(),s,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.AxisHelper=function(a){a=a||1;var b=new THREE.Geometry;b.vertices.push(new THREE.Vector3,new THREE.Vector3(a,0,0),new THREE.Vector3,new THREE.Vector3(0,a,0),new THREE.Vector3,new THREE.Vector3(0,0,a));b.colors.push(new THREE.Color(16711680),new THREE.Color(16755200),new THREE.Color(65280),new THREE.Color(11206400),new THREE.Color(255),new THREE.Color(43775));a=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,b,a,THREE.LinePieces)};
 THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);THREE.ArrowHelper=function(a,b,c,d,e,f){THREE.Object3D.call(this);void 0===d&&(d=16776960);void 0===c&&(c=1);void 0===e&&(e=0.2*c);void 0===f&&(f=0.2*e);this.position=b;b=new THREE.Geometry;b.vertices.push(new THREE.Vector3(0,0,0));b.vertices.push(new THREE.Vector3(0,1,0));this.line=new THREE.Line(b,new THREE.LineBasicMaterial({color:d}));this.line.matrixAutoUpdate=!1;this.add(this.line);b=new THREE.CylinderGeometry(0,0.5,1,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-0.5,0));this.cone=
 new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:d}));this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(a);this.setLength(c,e,f)};THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.ArrowHelper.prototype.setDirection=function(){var a=new THREE.Vector3,b;return function(c){0.99999<c.y?this.quaternion.set(0,0,0,1):-0.99999>c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();
 THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=0.2*a);void 0===c&&(c=0.2*b);this.line.scale.set(1,a,1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};THREE.BoxHelper=function(a){var b=[new THREE.Vector3(1,1,1),new THREE.Vector3(-1,1,1),new THREE.Vector3(-1,-1,1),new THREE.Vector3(1,-1,1),new THREE.Vector3(1,1,-1),new THREE.Vector3(-1,1,-1),new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,-1,-1)];this.vertices=b;var c=new THREE.Geometry;c.vertices.push(b[0],b[1],b[1],b[2],b[2],b[3],b[3],b[0],b[4],b[5],b[5],b[6],b[6],b[7],b[7],b[4],b[0],b[4],b[1],b[5],b[2],b[6],b[3],b[7]);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);
@@ -654,7 +654,7 @@ THREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THR
 1.1,-1);d("u2",-0.7,1.1,-1);d("u3",0,2,-1);d("cf1",-1,0,1);d("cf2",1,0,1);d("cf3",0,-1,1);d("cf4",0,1,1);d("cn1",-1,0,-1);d("cn2",1,0,-1);d("cn3",0,-1,-1);d("cn4",0,1,-1);this.geometry.verticesNeedUpdate=!0}}();THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;b=b||1;var c=new THREE.Geometry;c.vertices.push(new THREE.Vector3(-b,b,0),new THREE.Vector3(b,b,0),new THREE.Vector3(b,-b,0),new THREE.Vector3(-b,-b,0),new THREE.Vector3(-b,b,0));var d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightPlane=new THREE.Line(c,d);this.add(this.lightPlane);
 c=new THREE.Geometry;c.vertices.push(new THREE.Vector3,new THREE.Vector3);d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(c,d);this.add(this.targetLine);this.update()};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);
 THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};
-THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(c);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var l=k.vertices,k=k.faces,p=0,q=0,r=k.length;q<r;q++)for(var t=k[q],s=0;3>s;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var n=d.toString();void 0===e[n]?(e[n]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},p++):e[n].face2=q}h.addAttribute("position",new THREE.Float32Attribute(6*p,3));d=h.attributes.position.array;
+THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(c);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var l=k.vertices,k=k.faces,p=0,q=0,r=k.length;q<r;q++)for(var s=k[q],t=0;3>t;t++){d[0]=s[g[t]];d[1]=s[g[(t+1)%3]];d.sort(f);var n=d.toString();void 0===e[n]?(e[n]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},p++):e[n].face2=q}h.addAttribute("position",new THREE.Float32Attribute(6*p,3));d=h.attributes.position.array;
 f=0;for(n in e)if(g=e[n],void 0===g.face2||0.9999>k[g.face1].normal.dot(k[g.face2].normal))p=l[g.vert1],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z,p=l[g.vert2],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z;THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.FaceNormalsHelper.prototype.update=function(){var a=this.geometry.vertices,b=this.object,c=b.geometry.vertices,d=b.geometry.faces,e=b.matrixWorld;b.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(e);for(var f=b=0,g=d.length;b<g;b++,f+=2){var h=d[b];a[f].copy(c[h.a]).add(c[h.b]).add(c[h.c]).divideScalar(3).applyMatrix4(e);a[f+1].copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a[f])}this.geometry.verticesNeedUpdate=!0;return this};THREE.GridHelper=function(a,b){var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924);this.color2=new THREE.Color(8947848);for(var e=-a;e<=a;e+=b){c.vertices.push(new THREE.Vector3(-a,0,e),new THREE.Vector3(a,0,e),new THREE.Vector3(e,0,-a),new THREE.Vector3(e,0,a));var f=0===e?this.color1:this.color2;c.colors.push(f,f,f,f)}THREE.Line.call(this,c,d,THREE.LinePieces)};THREE.GridHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a);this.color2.set(b);this.geometry.colorsNeedUpdate=!0};THREE.HemisphereLightHelper=function(a,b,c,d){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.colors=[new THREE.Color,new THREE.Color];a=new THREE.SphereGeometry(b,4,2);a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(b=0;8>b;b++)a.faces[b].color=this.colors[4>b?0:1];b=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(a,b);this.add(this.lightSphere);
@@ -664,12 +664,12 @@ THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this
 THREE.SkeletonHelper.prototype=Object.create(THREE.Line.prototype);THREE.SkeletonHelper.prototype.update=function(){for(var a=this.geometry,b=0,c=0;c<this.skeleton.bones.length;c++){var d=this.skeleton.bones[c];d.parent instanceof THREE.Bone&&(a.vertices[b].setFromMatrixPosition(d.skinMatrix),a.vertices[b+1].setFromMatrixPosition(d.parent.skinMatrix),b+=2)}a.verticesNeedUpdate=!0;a.computeBoundingSphere()};THREE.SpotLightHelper=function(a){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;a=new THREE.CylinderGeometry(0,1,1,8,1,!0);a.applyMatrix((new THREE.Matrix4).makeTranslation(0,-0.5,0));a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var b=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(a,b);this.add(this.cone);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype);
 THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1E4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:16711680;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexNormals.length;g<h;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};
 THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype);
-THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var p=f[k],q=0,r=p.vertexNormals.length;q<r;q++){var t=p.vertexNormals[q];d[h].copy(e[p[a[q]]]).applyMatrix4(g);b.copy(t).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
+THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var p=f[k],q=0,r=p.vertexNormals.length;q<r;q++){var s=p.vertexNormals[q];d[h].copy(e[p[a[q]]]).applyMatrix4(g);b.copy(s).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
 b.add(d[h]);h+=1;d[h].copy(b);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:255;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexTangents.length;g<h;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.update()};THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype);
-THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var p=f[k],q=0,r=p.vertexTangents.length;q<r;q++){var t=p.vertexTangents[q];d[h].copy(e[p[a[q]]]).applyMatrix4(g);b.copy(t).transformDirection(g).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
-h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,l=a.geometry.faces,p=0,q=new Uint32Array(6*l.length),r=0,t=l.length;r<t;r++)for(var s=l[r],n=0;3>n;n++){d[0]=s[g[n]];d[1]=s[g[(n+1)%3]];d.sort(f);var v=d.toString();void 0===e[v]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[v]=!0,p++)}h.addAttribute("position",new THREE.Float32Attribute(6*p,3));d=
-h.attributes.position.array;r=0;for(t=p;r<t;r++)for(n=0;2>n;n++)p=k[q[2*r+n]],g=6*r+3*n,d[g+0]=p.x,d[g+1]=p.y,d[g+2]=p.z}else if(a.geometry instanceof THREE.BufferGeometry&&void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,t=a.geometry.attributes.index.array,l=a.geometry.offsets,p=0,q=new Uint32Array(2*t.length),s=0,w=l.length;s<w;++s)for(var n=l[s].start,v=l[s].count,g=l[s].index,r=n,u=n+v;r<u;r+=3)for(n=0;3>n;n++)d[0]=g+t[r+n],d[1]=g+t[r+(n+1)%3],d.sort(f),v=d.toString(),
-void 0===e[v]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[v]=!0,p++);h.addAttribute("position",new THREE.Float32Attribute(6*p,3));d=h.attributes.position.array;r=0;for(t=p;r<t;r++)for(n=0;2>n;n++)g=6*r+3*n,p=3*q[2*r+n],d[g+0]=k[p],d[g+1]=k[p+1],d[g+2]=k[p+2]}else if(a.geometry instanceof THREE.BufferGeometry)for(k=a.geometry.attributes.position.array,p=k.length/3,q=p/3,h.addAttribute("position",new THREE.Float32Attribute(6*p,3)),d=h.attributes.position.array,r=0,t=q;r<t;r++)for(n=0;3>n;n++)g=18*r+6*n,q=9*r+3*n,
+THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var p=f[k],q=0,r=p.vertexTangents.length;q<r;q++){var s=p.vertexTangents[q];d[h].copy(e[p[a[q]]]).applyMatrix4(g);b.copy(s).transformDirection(g).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
+h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,l=a.geometry.faces,p=0,q=new Uint32Array(6*l.length),r=0,s=l.length;r<s;r++)for(var t=l[r],n=0;3>n;n++){d[0]=t[g[n]];d[1]=t[g[(n+1)%3]];d.sort(f);var v=d.toString();void 0===e[v]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[v]=!0,p++)}h.addAttribute("position",new THREE.Float32Attribute(6*p,3));d=
+h.attributes.position.array;r=0;for(s=p;r<s;r++)for(n=0;2>n;n++)p=k[q[2*r+n]],g=6*r+3*n,d[g+0]=p.x,d[g+1]=p.y,d[g+2]=p.z}else if(a.geometry instanceof THREE.BufferGeometry&&void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,s=a.geometry.attributes.index.array,l=a.geometry.offsets,p=0,q=new Uint32Array(2*s.length),t=0,w=l.length;t<w;++t)for(var n=l[t].start,v=l[t].count,g=l[t].index,r=n,u=n+v;r<u;r+=3)for(n=0;3>n;n++)d[0]=g+s[r+n],d[1]=g+s[r+(n+1)%3],d.sort(f),v=d.toString(),
+void 0===e[v]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[v]=!0,p++);h.addAttribute("position",new THREE.Float32Attribute(6*p,3));d=h.attributes.position.array;r=0;for(s=p;r<s;r++)for(n=0;2>n;n++)g=6*r+3*n,p=3*q[2*r+n],d[g+0]=k[p],d[g+1]=k[p+1],d[g+2]=k[p+2]}else if(a.geometry instanceof THREE.BufferGeometry)for(k=a.geometry.attributes.position.array,p=k.length/3,q=p/3,h.addAttribute("position",new THREE.Float32Attribute(6*p,3)),d=h.attributes.position.array,r=0,s=q;r<s;r++)for(n=0;3>n;n++)g=18*r+6*n,q=9*r+3*n,
 d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],p=9*r+(n+1)%3*3,d[g+3]=k[p],d[g+4]=k[p+1],d[g+5]=k[p+2];THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);
 THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})};
 THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a<b;a++)c=this.lensFlares[a],c.x=this.positionScreen.x+d*c.distance,c.y=this.positionScreen.y+e*c.distance,c.wantedRotation=c.x*Math.PI*0.25,c.rotation+=0.25*(c.wantedRotation-c.rotation)};THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);
@@ -679,36 +679,36 @@ THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=thi
 THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b};
 THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1};
 THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;b<c;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a;if(d.mirroredLoop){if(d.time>d.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;
-f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}};THREE.LensFlarePlugin=function(){function a(a,c){var d=b.createProgram(),e=b.createShader(b.FRAGMENT_SHADER),f=b.createShader(b.VERTEX_SHADER),g="precision "+c+" float;\n";b.shaderSource(e,g+a.fragmentShader);b.shaderSource(f,g+a.vertexShader);b.compileShader(e);b.compileShader(f);b.attachShader(d,e);b.attachShader(d,f);b.linkProgram(d);return d}var b,c,d,e,f,g,h,k,l,p,q,r,t;this.init=function(s){b=s.context;c=s;d=s.getPrecision();e=new Float32Array(16);f=new Uint16Array(6);s=0;e[s++]=-1;e[s++]=-1;
-e[s++]=0;e[s++]=0;e[s++]=1;e[s++]=-1;e[s++]=1;e[s++]=0;e[s++]=1;e[s++]=1;e[s++]=1;e[s++]=1;e[s++]=-1;e[s++]=1;e[s++]=0;e[s++]=1;s=0;f[s++]=0;f[s++]=1;f[s++]=2;f[s++]=0;f[s++]=2;f[s++]=3;g=b.createBuffer();h=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);k=b.createTexture();l=b.createTexture();b.bindTexture(b.TEXTURE_2D,k);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,
+f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}};THREE.LensFlarePlugin=function(){function a(a,c){var d=b.createProgram(),e=b.createShader(b.FRAGMENT_SHADER),f=b.createShader(b.VERTEX_SHADER),g="precision "+c+" float;\n";b.shaderSource(e,g+a.fragmentShader);b.shaderSource(f,g+a.vertexShader);b.compileShader(e);b.compileShader(f);b.attachShader(d,e);b.attachShader(d,f);b.linkProgram(d);return d}var b,c,d,e,f,g,h,k,l,p,q,r,s;this.init=function(t){b=t.context;c=t;d=t.getPrecision();e=new Float32Array(16);f=new Uint16Array(6);t=0;e[t++]=-1;e[t++]=-1;
+e[t++]=0;e[t++]=0;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;t=0;f[t++]=0;f[t++]=1;f[t++]=2;f[t++]=0;f[t++]=2;f[t++]=3;g=b.createBuffer();h=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);k=b.createTexture();l=b.createTexture();b.bindTexture(b.TEXTURE_2D,k);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,
 0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,l);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);
-b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(p=!1,q=a(THREE.ShaderFlares.lensFlare,d)):(p=!0,q=a(THREE.ShaderFlares.lensFlareVertexTexture,d));r={};t={};r.vertex=b.getAttribLocation(q,"position");r.uv=b.getAttribLocation(q,"uv");t.renderType=b.getUniformLocation(q,"renderType");t.map=b.getUniformLocation(q,"map");t.occlusionMap=b.getUniformLocation(q,"occlusionMap");t.opacity=
-b.getUniformLocation(q,"opacity");t.color=b.getUniformLocation(q,"color");t.scale=b.getUniformLocation(q,"scale");t.rotation=b.getUniformLocation(q,"rotation");t.screenPosition=b.getUniformLocation(q,"screenPosition")};this.render=function(a,d,e,f){a=a.__webglFlares;var u=a.length;if(u){var y=new THREE.Vector3,M=f/e,B=0.5*e,D=0.5*f,z=16/f,F=new THREE.Vector2(z*M,z),H=new THREE.Vector3(1,1,0),C=new THREE.Vector2(1,1),x=t,z=r;b.useProgram(q);b.enableVertexAttribArray(r.vertex);b.enableVertexAttribArray(r.uv);
-b.uniform1i(x.occlusionMap,0);b.uniform1i(x.map,1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(z.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(z.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(!1);var A,O,K,L,J;for(A=0;A<u;A++)if(z=16/f,F.set(z*M,z),L=a[A],y.set(L.matrixWorld.elements[12],L.matrixWorld.elements[13],L.matrixWorld.elements[14]),y.applyMatrix4(d.matrixWorldInverse),y.applyProjection(d.projectionMatrix),H.copy(y),C.x=H.x*B+B,
-C.y=H.y*D+D,p||0<C.x&&C.x<e&&0<C.y&&C.y<f)for(b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,C.x-8,C.y-8,16,16,0),b.uniform1i(x.renderType,0),b.uniform2f(x.scale,F.x,F.y),b.uniform3f(x.screenPosition,H.x,H.y,H.z),b.disable(b.BLEND),b.enable(b.DEPTH_TEST),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,l),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,C.x-8,C.y-8,16,16,0),b.uniform1i(x.renderType,1),b.disable(b.DEPTH_TEST),
-b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),L.positionScreen.copy(H),L.customUpdateCallback?L.customUpdateCallback(L):L.updateLensFlares(),b.uniform1i(x.renderType,2),b.enable(b.BLEND),O=0,K=L.lensFlares.length;O<K;O++)J=L.lensFlares[O],0.001<J.opacity&&0.001<J.scale&&(H.x=J.x,H.y=J.y,H.z=J.z,z=J.size*J.scale/f,F.x=z*M,F.y=z,b.uniform3f(x.screenPosition,H.x,H.y,H.z),b.uniform2f(x.scale,F.x,F.y),b.uniform1f(x.rotation,J.rotation),b.uniform1f(x.opacity,
-J.opacity),b.uniform3f(x.color,J.color.r,J.color.g,J.color.b),c.setBlending(J.blending,J.blendEquation,J.blendSrc,J.blendDst),c.setTexture(J.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,p=new THREE.Vector3;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
-vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(q,r){var t,s,n,v,w,u,y,M,B,D=[];v=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
-a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);t=0;for(s=q.__lights.length;t<s;t++)if(n=q.__lights[t],n.castShadow)if(n instanceof THREE.DirectionalLight&&n.shadowCascade)for(w=0;w<n.shadowCascadeCount;w++){var z;if(n.shadowCascadeArray[w])z=n.shadowCascadeArray[w];else{B=n;y=w;z=new THREE.DirectionalLight;z.isVirtual=!0;z.onlyShadow=!0;z.castShadow=!0;z.shadowCameraNear=B.shadowCameraNear;z.shadowCameraFar=B.shadowCameraFar;z.shadowCameraLeft=B.shadowCameraLeft;z.shadowCameraRight=B.shadowCameraRight;
-z.shadowCameraBottom=B.shadowCameraBottom;z.shadowCameraTop=B.shadowCameraTop;z.shadowCameraVisible=B.shadowCameraVisible;z.shadowDarkness=B.shadowDarkness;z.shadowBias=B.shadowCascadeBias[y];z.shadowMapWidth=B.shadowCascadeWidth[y];z.shadowMapHeight=B.shadowCascadeHeight[y];z.pointsWorld=[];z.pointsFrustum=[];var F=z.pointsWorld;u=z.pointsFrustum;for(M=0;8>M;M++)F[M]=new THREE.Vector3,u[M]=new THREE.Vector3;F=B.shadowCascadeNearZ[y];B=B.shadowCascadeFarZ[y];u[0].set(-1,-1,F);u[1].set(1,-1,F);u[2].set(-1,
-1,F);u[3].set(1,1,F);u[4].set(-1,-1,B);u[5].set(1,-1,B);u[6].set(-1,1,B);u[7].set(1,1,B);z.originalCamera=r;u=new THREE.Gyroscope;u.position.copy(n.shadowCascadeOffset);u.add(z);u.add(z.target);r.add(u);n.shadowCascadeArray[w]=z;console.log("Created virtualLight",z)}y=n;F=w;B=y.shadowCascadeArray[F];B.position.copy(y.position);B.target.position.copy(y.target.position);B.lookAt(B.target);B.shadowCameraVisible=y.shadowCameraVisible;B.shadowDarkness=y.shadowDarkness;B.shadowBias=y.shadowCascadeBias[F];
-u=y.shadowCascadeNearZ[F];y=y.shadowCascadeFarZ[F];B=B.pointsFrustum;B[0].z=u;B[1].z=u;B[2].z=u;B[3].z=u;B[4].z=y;B[5].z=y;B[6].z=y;B[7].z=y;D[v]=z;v++}else D[v]=n,v++;t=0;for(s=D.length;t<s;t++){n=D[t];n.shadowMap||(w=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(w=THREE.NearestFilter),n.shadowMap=new THREE.WebGLRenderTarget(n.shadowMapWidth,n.shadowMapHeight,{minFilter:w,magFilter:w,format:THREE.RGBAFormat}),n.shadowMapSize=new THREE.Vector2(n.shadowMapWidth,n.shadowMapHeight),n.shadowMatrix=
+b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(p=!1,q=a(THREE.ShaderFlares.lensFlare,d)):(p=!0,q=a(THREE.ShaderFlares.lensFlareVertexTexture,d));r={};s={};r.vertex=b.getAttribLocation(q,"position");r.uv=b.getAttribLocation(q,"uv");s.renderType=b.getUniformLocation(q,"renderType");s.map=b.getUniformLocation(q,"map");s.occlusionMap=b.getUniformLocation(q,"occlusionMap");s.opacity=
+b.getUniformLocation(q,"opacity");s.color=b.getUniformLocation(q,"color");s.scale=b.getUniformLocation(q,"scale");s.rotation=b.getUniformLocation(q,"rotation");s.screenPosition=b.getUniformLocation(q,"screenPosition")};this.render=function(a,d,e,f){a=a.__webglFlares;var u=a.length;if(u){var x=new THREE.Vector3,F=f/e,C=0.5*e,D=0.5*f,z=16/f,G=new THREE.Vector2(z*F,z),I=new THREE.Vector3(1,1,0),B=new THREE.Vector2(1,1),y=s,z=r;b.useProgram(q);b.enableVertexAttribArray(r.vertex);b.enableVertexAttribArray(r.uv);
+b.uniform1i(y.occlusionMap,0);b.uniform1i(y.map,1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(z.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(z.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(!1);var A,O,L,M,K;for(A=0;A<u;A++)if(z=16/f,G.set(z*F,z),M=a[A],x.set(M.matrixWorld.elements[12],M.matrixWorld.elements[13],M.matrixWorld.elements[14]),x.applyMatrix4(d.matrixWorldInverse),x.applyProjection(d.projectionMatrix),I.copy(x),B.x=I.x*C+C,
+B.y=I.y*D+D,p||0<B.x&&B.x<e&&0<B.y&&B.y<f)for(b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,B.x-8,B.y-8,16,16,0),b.uniform1i(y.renderType,0),b.uniform2f(y.scale,G.x,G.y),b.uniform3f(y.screenPosition,I.x,I.y,I.z),b.disable(b.BLEND),b.enable(b.DEPTH_TEST),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,l),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,B.x-8,B.y-8,16,16,0),b.uniform1i(y.renderType,1),b.disable(b.DEPTH_TEST),
+b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),M.positionScreen.copy(I),M.customUpdateCallback?M.customUpdateCallback(M):M.updateLensFlares(),b.uniform1i(y.renderType,2),b.enable(b.BLEND),O=0,L=M.lensFlares.length;O<L;O++)K=M.lensFlares[O],0.001<K.opacity&&0.001<K.scale&&(I.x=K.x,I.y=K.y,I.z=K.z,z=K.size*K.scale/f,G.x=z*F,G.y=z,b.uniform3f(y.screenPosition,I.x,I.y,I.z),b.uniform2f(y.scale,G.x,G.y),b.uniform1f(y.rotation,K.rotation),b.uniform1f(y.opacity,
+K.opacity),b.uniform3f(y.color,K.color.r,K.color.g,K.color.b),c.setBlending(K.blending,K.blendEquation,K.blendSrc,K.blendDst),c.setTexture(K.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,p=new THREE.Vector3;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
+vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(q,r){var s,t,n,v,w,u,x,F,C,D=[];v=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
+a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);s=0;for(t=q.__lights.length;s<t;s++)if(n=q.__lights[s],n.castShadow)if(n instanceof THREE.DirectionalLight&&n.shadowCascade)for(w=0;w<n.shadowCascadeCount;w++){var z;if(n.shadowCascadeArray[w])z=n.shadowCascadeArray[w];else{C=n;x=w;z=new THREE.DirectionalLight;z.isVirtual=!0;z.onlyShadow=!0;z.castShadow=!0;z.shadowCameraNear=C.shadowCameraNear;z.shadowCameraFar=C.shadowCameraFar;z.shadowCameraLeft=C.shadowCameraLeft;z.shadowCameraRight=C.shadowCameraRight;
+z.shadowCameraBottom=C.shadowCameraBottom;z.shadowCameraTop=C.shadowCameraTop;z.shadowCameraVisible=C.shadowCameraVisible;z.shadowDarkness=C.shadowDarkness;z.shadowBias=C.shadowCascadeBias[x];z.shadowMapWidth=C.shadowCascadeWidth[x];z.shadowMapHeight=C.shadowCascadeHeight[x];z.pointsWorld=[];z.pointsFrustum=[];var G=z.pointsWorld;u=z.pointsFrustum;for(F=0;8>F;F++)G[F]=new THREE.Vector3,u[F]=new THREE.Vector3;G=C.shadowCascadeNearZ[x];C=C.shadowCascadeFarZ[x];u[0].set(-1,-1,G);u[1].set(1,-1,G);u[2].set(-1,
+1,G);u[3].set(1,1,G);u[4].set(-1,-1,C);u[5].set(1,-1,C);u[6].set(-1,1,C);u[7].set(1,1,C);z.originalCamera=r;u=new THREE.Gyroscope;u.position.copy(n.shadowCascadeOffset);u.add(z);u.add(z.target);r.add(u);n.shadowCascadeArray[w]=z;console.log("Created virtualLight",z)}x=n;G=w;C=x.shadowCascadeArray[G];C.position.copy(x.position);C.target.position.copy(x.target.position);C.lookAt(C.target);C.shadowCameraVisible=x.shadowCameraVisible;C.shadowDarkness=x.shadowDarkness;C.shadowBias=x.shadowCascadeBias[G];
+u=x.shadowCascadeNearZ[G];x=x.shadowCascadeFarZ[G];C=C.pointsFrustum;C[0].z=u;C[1].z=u;C[2].z=u;C[3].z=u;C[4].z=x;C[5].z=x;C[6].z=x;C[7].z=x;D[v]=z;v++}else D[v]=n,v++;s=0;for(t=D.length;s<t;s++){n=D[s];n.shadowMap||(w=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(w=THREE.NearestFilter),n.shadowMap=new THREE.WebGLRenderTarget(n.shadowMapWidth,n.shadowMapHeight,{minFilter:w,magFilter:w,format:THREE.RGBAFormat}),n.shadowMapSize=new THREE.Vector2(n.shadowMapWidth,n.shadowMapHeight),n.shadowMatrix=
 new THREE.Matrix4);if(!n.shadowCamera){if(n instanceof THREE.SpotLight)n.shadowCamera=new THREE.PerspectiveCamera(n.shadowCameraFov,n.shadowMapWidth/n.shadowMapHeight,n.shadowCameraNear,n.shadowCameraFar);else if(n instanceof THREE.DirectionalLight)n.shadowCamera=new THREE.OrthographicCamera(n.shadowCameraLeft,n.shadowCameraRight,n.shadowCameraTop,n.shadowCameraBottom,n.shadowCameraNear,n.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}q.add(n.shadowCamera);!0===
-q.autoUpdate&&q.updateMatrixWorld()}n.shadowCameraVisible&&!n.cameraHelper&&(n.cameraHelper=new THREE.CameraHelper(n.shadowCamera),n.shadowCamera.add(n.cameraHelper));if(n.isVirtual&&z.originalCamera==r){w=r;v=n.shadowCamera;u=n.pointsFrustum;B=n.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(y=0;8>y;y++)F=B[y],F.copy(u[y]),THREE.ShadowMapPlugin.__projector.unprojectVector(F,w),F.applyMatrix4(v.matrixWorldInverse),F.x<k.x&&(k.x=F.x),F.x>l.x&&(l.x=F.x),F.y<k.y&&
-(k.y=F.y),F.y>l.y&&(l.y=F.y),F.z<k.z&&(k.z=F.z),F.z>l.z&&(l.z=F.z);v.left=k.x;v.right=l.x;v.top=l.y;v.bottom=k.y;v.updateProjectionMatrix()}v=n.shadowMap;u=n.shadowMatrix;w=n.shadowCamera;w.position.setFromMatrixPosition(n.matrixWorld);p.setFromMatrixPosition(n.target.matrixWorld);w.lookAt(p);w.updateMatrixWorld();w.matrixWorldInverse.getInverse(w.matrixWorld);n.cameraHelper&&(n.cameraHelper.visible=n.shadowCameraVisible);n.shadowCameraVisible&&n.cameraHelper.update();u.set(0.5,0,0,0.5,0,0.5,0,0.5,
-0,0,0.5,0.5,0,0,0,1);u.multiply(w.projectionMatrix);u.multiply(w.matrixWorldInverse);h.multiplyMatrices(w.projectionMatrix,w.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(v);b.clear();B=q.__webglObjects;n=0;for(v=B.length;n<v;n++)y=B[n],u=y.object,y.render=!1,u.visible&&u.castShadow&&(!1===u.frustumCulled||!0===g.intersectsObject(u))&&(u._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,u.matrixWorld),y.render=!0);var H;n=0;for(v=B.length;n<v;n++)y=B[n],y.render&&(u=y.object,y=y.buffer,
-F=u.material instanceof THREE.MeshFaceMaterial?u.material.materials[0]:u.material,M=void 0!==u.geometry.morphTargets&&0<u.geometry.morphTargets.length&&F.morphTargets,H=u instanceof THREE.SkinnedMesh&&F.skinning,M=u.customDepthMaterial?u.customDepthMaterial:H?M?f:e:M?d:c,b.setMaterialFaces(F),y instanceof THREE.BufferGeometry?b.renderBufferDirect(w,q.__lights,null,M,y,u):b.renderBuffer(w,q.__lights,null,M,y,u));B=q.__webglObjectsImmediate;n=0;for(v=B.length;n<v;n++)y=B[n],u=y.object,u.visible&&u.castShadow&&
-(u._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,u.matrixWorld),b.renderImmediateObject(w,q.__lights,null,c,u))}t=b.getClearColor();s=b.getClearAlpha();a.clearColor(t.r,t.g,t.b,s);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){var a,b,c,d,e,f,g,h,k,l,p,q,r,t,s,n,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,y,M,B,D,z,F,H;this.init=function(w){u=w.context;y=w;B=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);D=new Uint16Array([0,1,2,0,2,3]);z=u.createBuffer();F=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,z);u.bufferData(u.ARRAY_BUFFER,B,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,F);u.bufferData(u.ELEMENT_ARRAY_BUFFER,D,u.STATIC_DRAW);w=u.createProgram();
-var x=u.createShader(u.VERTEX_SHADER),A=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(x,["precision "+y.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"));
-u.shaderSource(A,["precision "+y.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
-u.compileShader(x);u.compileShader(A);u.attachShader(w,x);u.attachShader(w,A);u.linkProgram(w);H=w;n=u.getAttribLocation(H,"position");v=u.getAttribLocation(H,"uv");a=u.getUniformLocation(H,"uvOffset");b=u.getUniformLocation(H,"uvScale");c=u.getUniformLocation(H,"rotation");d=u.getUniformLocation(H,"scale");e=u.getUniformLocation(H,"color");f=u.getUniformLocation(H,"map");g=u.getUniformLocation(H,"opacity");h=u.getUniformLocation(H,"modelViewMatrix");k=u.getUniformLocation(H,"projectionMatrix");l=
-u.getUniformLocation(H,"fogType");p=u.getUniformLocation(H,"fogDensity");q=u.getUniformLocation(H,"fogNear");r=u.getUniformLocation(H,"fogFar");t=u.getUniformLocation(H,"fogColor");s=u.getUniformLocation(H,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;x=w.getContext("2d");x.fillStyle="#ffffff";x.fillRect(0,0,w.width,w.height);M=new THREE.Texture(w);M.needsUpdate=!0};this.render=function(C,x,A,B){A=C.__webglSprites;if(B=A.length){u.useProgram(H);u.enableVertexAttribArray(n);
-u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,z);u.vertexAttribPointer(n,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,F);u.uniformMatrix4fv(k,!1,x.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(f,0);var D=0,L=0,J=C.fog;J?(u.uniform3f(t,J.color.r,J.color.g,J.color.b),J instanceof THREE.Fog?(u.uniform1f(q,J.near),u.uniform1f(r,J.far),u.uniform1i(l,1),L=D=1):J instanceof THREE.FogExp2&&
-(u.uniform1f(p,J.density),u.uniform1i(l,2),L=D=2)):(u.uniform1i(l,0),L=D=0);for(var G,Q=[],J=0;J<B;J++)G=A[J],!1!==G.visible&&(G._modelViewMatrix.multiplyMatrices(x.matrixWorldInverse,G.matrixWorld),G.z=-G._modelViewMatrix.elements[14]);A.sort(w);for(J=0;J<B;J++)G=A[J],!1!==G.visible&&(x=G.material,u.uniform1f(s,x.alphaTest),u.uniformMatrix4fv(h,!1,G._modelViewMatrix.elements),Q[0]=G.scale.x,Q[1]=G.scale.y,G=C.fog&&x.fog?L:0,D!==G&&(u.uniform1i(l,G),D=G),null!==x.map?(u.uniform2f(a,x.map.offset.x,
-x.map.offset.y),u.uniform2f(b,x.map.repeat.x,x.map.repeat.y)):(u.uniform2f(a,0,0),u.uniform2f(b,1,1)),u.uniform1f(g,x.opacity),u.uniform3f(e,x.color.r,x.color.g,x.color.b),u.uniform1f(c,x.rotation),u.uniform2fv(d,Q),y.setBlending(x.blending,x.blendEquation,x.blendSrc,x.blendDst),y.setDepthTest(x.depthTest),y.setDepthWrite(x.depthWrite),x.map&&x.map.image&&x.map.image.width?y.setTexture(x.map,0):y.setTexture(M,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,0));u.enable(u.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
-vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(k,l){var p,q,r,t,s,n;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===k.autoUpdate&&k.updateMatrixWorld();l.matrixWorldInverse.getInverse(l.matrixWorld);h.multiplyMatrices(l.projectionMatrix,
-l.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(this.renderTarget);b.clear();n=k.__webglObjects;p=0;for(q=n.length;p<q;p++)r=n[p],s=r.object,r.render=!1,!s.visible||!1!==s.frustumCulled&&!0!==g.intersectsObject(s)||(s._modelViewMatrix.multiplyMatrices(l.matrixWorldInverse,s.matrixWorld),r.render=!0);var v;p=0;for(q=n.length;p<q;p++)r=n[p],r.render&&(s=r.object,r=r.buffer,s instanceof THREE.PointCloud&&!s.customDepthMaterial||((v=s.material instanceof THREE.MeshFaceMaterial?s.material.materials[0]:
-s.material)&&b.setMaterialFaces(s.material),t=void 0!==s.geometry.morphTargets&&0<s.geometry.morphTargets.length&&v.morphTargets,v=s instanceof THREE.SkinnedMesh&&v.skinning,t=s.customDepthMaterial?s.customDepthMaterial:v?t?f:e:t?d:c,r instanceof THREE.BufferGeometry?b.renderBufferDirect(l,k.__lights,null,t,r,s):b.renderBuffer(l,k.__lights,null,t,r,s)));n=k.__webglObjectsImmediate;p=0;for(q=n.length;p<q;p++)r=n[p],s=r.object,s.visible&&(s._modelViewMatrix.multiplyMatrices(l.matrixWorldInverse,s.matrixWorld),
-b.renderImmediateObject(l,k.__lights,null,c,s));p=b.getClearColor();q=b.getClearAlpha();a.clearColor(p.r,p.g,p.b,q);a.enable(a.BLEND)}};THREE.ShaderFlares={lensFlareVertexTexture:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
+q.autoUpdate&&q.updateMatrixWorld()}n.shadowCameraVisible&&!n.cameraHelper&&(n.cameraHelper=new THREE.CameraHelper(n.shadowCamera),n.shadowCamera.add(n.cameraHelper));if(n.isVirtual&&z.originalCamera==r){w=r;v=n.shadowCamera;u=n.pointsFrustum;C=n.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(x=0;8>x;x++)G=C[x],G.copy(u[x]),THREE.ShadowMapPlugin.__projector.unprojectVector(G,w),G.applyMatrix4(v.matrixWorldInverse),G.x<k.x&&(k.x=G.x),G.x>l.x&&(l.x=G.x),G.y<k.y&&
+(k.y=G.y),G.y>l.y&&(l.y=G.y),G.z<k.z&&(k.z=G.z),G.z>l.z&&(l.z=G.z);v.left=k.x;v.right=l.x;v.top=l.y;v.bottom=k.y;v.updateProjectionMatrix()}v=n.shadowMap;u=n.shadowMatrix;w=n.shadowCamera;w.position.setFromMatrixPosition(n.matrixWorld);p.setFromMatrixPosition(n.target.matrixWorld);w.lookAt(p);w.updateMatrixWorld();w.matrixWorldInverse.getInverse(w.matrixWorld);n.cameraHelper&&(n.cameraHelper.visible=n.shadowCameraVisible);n.shadowCameraVisible&&n.cameraHelper.update();u.set(0.5,0,0,0.5,0,0.5,0,0.5,
+0,0,0.5,0.5,0,0,0,1);u.multiply(w.projectionMatrix);u.multiply(w.matrixWorldInverse);h.multiplyMatrices(w.projectionMatrix,w.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(v);b.clear();C=q.__webglObjects;n=0;for(v=C.length;n<v;n++)x=C[n],u=x.object,x.render=!1,u.visible&&u.castShadow&&(!1===u.frustumCulled||!0===g.intersectsObject(u))&&(u._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,u.matrixWorld),x.render=!0);var I;n=0;for(v=C.length;n<v;n++)x=C[n],x.render&&(u=x.object,x=x.buffer,
+G=u.material instanceof THREE.MeshFaceMaterial?u.material.materials[0]:u.material,F=void 0!==u.geometry.morphTargets&&0<u.geometry.morphTargets.length&&G.morphTargets,I=u instanceof THREE.SkinnedMesh&&G.skinning,F=u.customDepthMaterial?u.customDepthMaterial:I?F?f:e:F?d:c,b.setMaterialFaces(G),x instanceof THREE.BufferGeometry?b.renderBufferDirect(w,q.__lights,null,F,x,u):b.renderBuffer(w,q.__lights,null,F,x,u));C=q.__webglObjectsImmediate;n=0;for(v=C.length;n<v;n++)x=C[n],u=x.object,u.visible&&u.castShadow&&
+(u._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,u.matrixWorld),b.renderImmediateObject(w,q.__lights,null,c,u))}s=b.getClearColor();t=b.getClearAlpha();a.clearColor(s.r,s.g,s.b,t);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){var a,b,c,d,e,f,g,h,k,l,p,q,r,s,t,n,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,x,F,C,D,z,G,I;this.init=function(w){u=w.context;x=w;C=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);D=new Uint16Array([0,1,2,0,2,3]);z=u.createBuffer();G=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,z);u.bufferData(u.ARRAY_BUFFER,C,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,G);u.bufferData(u.ELEMENT_ARRAY_BUFFER,D,u.STATIC_DRAW);w=u.createProgram();
+var y=u.createShader(u.VERTEX_SHADER),A=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(y,["precision "+x.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"));
+u.shaderSource(A,["precision "+x.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
+u.compileShader(y);u.compileShader(A);u.attachShader(w,y);u.attachShader(w,A);u.linkProgram(w);I=w;n=u.getAttribLocation(I,"position");v=u.getAttribLocation(I,"uv");a=u.getUniformLocation(I,"uvOffset");b=u.getUniformLocation(I,"uvScale");c=u.getUniformLocation(I,"rotation");d=u.getUniformLocation(I,"scale");e=u.getUniformLocation(I,"color");f=u.getUniformLocation(I,"map");g=u.getUniformLocation(I,"opacity");h=u.getUniformLocation(I,"modelViewMatrix");k=u.getUniformLocation(I,"projectionMatrix");l=
+u.getUniformLocation(I,"fogType");p=u.getUniformLocation(I,"fogDensity");q=u.getUniformLocation(I,"fogNear");r=u.getUniformLocation(I,"fogFar");s=u.getUniformLocation(I,"fogColor");t=u.getUniformLocation(I,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;y=w.getContext("2d");y.fillStyle="#ffffff";y.fillRect(0,0,w.width,w.height);F=new THREE.Texture(w);F.needsUpdate=!0};this.render=function(B,y,A,C){A=B.__webglSprites;if(C=A.length){u.useProgram(I);u.enableVertexAttribArray(n);
+u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,z);u.vertexAttribPointer(n,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,G);u.uniformMatrix4fv(k,!1,y.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(f,0);var D=0,M=0,K=B.fog;K?(u.uniform3f(s,K.color.r,K.color.g,K.color.b),K instanceof THREE.Fog?(u.uniform1f(q,K.near),u.uniform1f(r,K.far),u.uniform1i(l,1),M=D=1):K instanceof THREE.FogExp2&&
+(u.uniform1f(p,K.density),u.uniform1i(l,2),M=D=2)):(u.uniform1i(l,0),M=D=0);for(var H,Q=[],K=0;K<C;K++)H=A[K],!1!==H.visible&&(H._modelViewMatrix.multiplyMatrices(y.matrixWorldInverse,H.matrixWorld),H.z=-H._modelViewMatrix.elements[14]);A.sort(w);for(K=0;K<C;K++)H=A[K],!1!==H.visible&&(y=H.material,u.uniform1f(t,y.alphaTest),u.uniformMatrix4fv(h,!1,H._modelViewMatrix.elements),Q[0]=H.scale.x,Q[1]=H.scale.y,H=B.fog&&y.fog?M:0,D!==H&&(u.uniform1i(l,H),D=H),null!==y.map?(u.uniform2f(a,y.map.offset.x,
+y.map.offset.y),u.uniform2f(b,y.map.repeat.x,y.map.repeat.y)):(u.uniform2f(a,0,0),u.uniform2f(b,1,1)),u.uniform1f(g,y.opacity),u.uniform3f(e,y.color.r,y.color.g,y.color.b),u.uniform1f(c,y.rotation),u.uniform2fv(d,Q),x.setBlending(y.blending,y.blendEquation,y.blendSrc,y.blendDst),x.setDepthTest(y.depthTest),x.setDepthWrite(y.depthWrite),y.map&&y.map.image&&y.map.image.width?x.setTexture(y.map,0):x.setTexture(F,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,0));u.enable(u.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
+vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(k,l){var p,q,r,s,t,n;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===k.autoUpdate&&k.updateMatrixWorld();l.matrixWorldInverse.getInverse(l.matrixWorld);h.multiplyMatrices(l.projectionMatrix,
+l.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(this.renderTarget);b.clear();n=k.__webglObjects;p=0;for(q=n.length;p<q;p++)r=n[p],t=r.object,r.render=!1,!t.visible||!1!==t.frustumCulled&&!0!==g.intersectsObject(t)||(t._modelViewMatrix.multiplyMatrices(l.matrixWorldInverse,t.matrixWorld),r.render=!0);var v;p=0;for(q=n.length;p<q;p++)r=n[p],r.render&&(t=r.object,r=r.buffer,t instanceof THREE.PointCloud&&!t.customDepthMaterial||((v=t.material instanceof THREE.MeshFaceMaterial?t.material.materials[0]:
+t.material)&&b.setMaterialFaces(t.material),s=void 0!==t.geometry.morphTargets&&0<t.geometry.morphTargets.length&&v.morphTargets,v=t instanceof THREE.SkinnedMesh&&v.skinning,s=t.customDepthMaterial?t.customDepthMaterial:v?s?f:e:s?d:c,r instanceof THREE.BufferGeometry?b.renderBufferDirect(l,k.__lights,null,s,r,t):b.renderBuffer(l,k.__lights,null,s,r,t)));n=k.__webglObjectsImmediate;p=0;for(q=n.length;p<q;p++)r=n[p],t=r.object,t.visible&&(t._modelViewMatrix.multiplyMatrices(l.matrixWorldInverse,t.matrixWorld),
+b.renderImmediateObject(l,k.__lights,null,c,t));p=b.getClearColor();q=b.getClearAlpha();a.clearColor(p.r,p.g,p.b,q);a.enable(a.BLEND)}};THREE.ShaderFlares={lensFlareVertexTexture:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},lensFlare:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}};