Mr.doob пре 10 година
родитељ
комит
812338ae48
2 измењених фајлова са 125 додато и 123 уклоњено
  1. 3 1
      build/three.js
  2. 122 122
      build/three.min.js

+ 3 - 1
build/three.js

@@ -21635,7 +21635,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			if ( geometry instanceof THREE.BufferGeometry ) {
 
-				//
+				_this.info.memory.geometries ++;
 
 			} else if ( object instanceof THREE.Mesh ) {
 
@@ -23540,6 +23540,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	function setLineWidth ( width ) {
 
+		width *= pixelRatio;
+
 		if ( width !== _oldLineWidth ) {
 
 			_gl.lineWidth( width );

+ 122 - 122
build/three.min.js

@@ -98,8 +98,8 @@ console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotati
 b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,n=d*h,p=d*e,b[0]=a-p*c,b[4]=-f*e,b[8]=n+k*c,b[1]=k+n*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,n=c*h,p=c*e,b[0]=g*h,b[4]=n*d-k,b[8]=a*d+p,b[1]=g*e,b[5]=p*d+a,b[9]=k*d-n,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,n=c*g,p=c*d,b[0]=g*h,b[4]=p-a*e,b[8]=n*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+n,b[10]=a-p*e):"XZY"===a.order&&(a=f*g,k=f*d,n=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-n,b[2]=n*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("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var n=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]=n-f;b[8]=c+h;b[1]=n+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("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],n=c[1],p=c[5],q=c[9],m=c[13],t=c[2],s=c[6],r=c[10],u=c[14],v=c[3],y=c[7],H=c[11],c=c[15],x=d[0],F=d[4],z=d[8],G=d[12],D=d[1],w=d[5],C=d[9],J=d[13],U=d[2],M=d[6],K=d[10],L=d[14],N=d[3],
-T=d[7],Q=d[11],d=d[15];e[0]=f*x+g*D+h*U+k*N;e[4]=f*F+g*w+h*M+k*T;e[8]=f*z+g*C+h*K+k*Q;e[12]=f*G+g*J+h*L+k*d;e[1]=n*x+p*D+q*U+m*N;e[5]=n*F+p*w+q*M+m*T;e[9]=n*z+p*C+q*K+m*Q;e[13]=n*G+p*J+q*L+m*d;e[2]=t*x+s*D+r*U+u*N;e[6]=t*F+s*w+r*M+u*T;e[10]=t*z+s*C+r*K+u*Q;e[14]=t*G+s*J+r*L+u*d;e[3]=v*x+y*D+H*U+c*N;e[7]=v*F+y*w+H*M+c*T;e[11]=v*z+y*C+H*K+c*Q;e[15]=v*G+y*J+H*L+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]=
+multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],n=c[1],p=c[5],q=c[9],m=c[13],t=c[2],s=c[6],r=c[10],u=c[14],v=c[3],y=c[7],H=c[11],c=c[15],x=d[0],E=d[4],z=d[8],F=d[12],D=d[1],w=d[5],C=d[9],A=d[13],U=d[2],M=d[6],K=d[10],L=d[14],N=d[3],
+T=d[7],Q=d[11],d=d[15];e[0]=f*x+g*D+h*U+k*N;e[4]=f*E+g*w+h*M+k*T;e[8]=f*z+g*C+h*K+k*Q;e[12]=f*F+g*A+h*L+k*d;e[1]=n*x+p*D+q*U+m*N;e[5]=n*E+p*w+q*M+m*T;e[9]=n*z+p*C+q*K+m*Q;e[13]=n*F+p*A+q*L+m*d;e[2]=t*x+s*D+r*U+u*N;e[6]=t*E+s*w+r*M+u*T;e[10]=t*z+s*C+r*K+u*Q;e[14]=t*F+s*A+r*L+u*d;e[3]=v*x+y*D+H*U+c*N;e[7]=v*E+y*w+H*M+c*T;e[11]=v*z+y*C+H*K+c*Q;e[15]=v*F+y*A+H*L+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=
 d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
 return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=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("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=
@@ -189,10 +189,10 @@ b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);
 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.expandByPoint(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(){var a=
 this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,q=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var t=a.index.array,s=0<this.offsets.length?this.offsets:[{start:0,count:t.length,index:0}],r=0,u=s.length;r<u;++r){e=s[r].start;f=s[r].count;
 for(var v=s[r].index,d=e,e=e+f;d<e;d+=3)f=3*(v+t[d]),g=3*(v+t[d+1]),h=3*(v+t[d+2]),k.fromArray(b,f),n.fromArray(b,g),p.fromArray(b,h),q.subVectors(p,n),m.subVectors(k,n),q.cross(m),c[f]+=q.x,c[f+1]+=q.y,c[f+2]+=q.z,c[g]+=q.x,c[g+1]+=q.y,c[g+2]+=q.z,c[h]+=q.x,c[h+1]+=q.y,c[h+2]+=q.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),n.fromArray(b,d+3),p.fromArray(b,d+6),q.subVectors(p,n),m.subVectors(k,n),q.cross(m),c[d]=q.x,c[d+1]=q.y,c[d+2]=q.z,c[d+3]=q.x,c[d+4]=q.y,c[d+5]=q.z,c[d+6]=q.x,c[d+7]=q.y,
-c[d+8]=q.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q.fromArray(d,3*a);m.fromArray(d,3*b);t.fromArray(d,3*c);s.fromArray(f,2*a);r.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-q.x;y=t.x-q.x;H=m.y-q.y;x=t.y-q.y;F=m.z-q.z;z=t.z-q.z;G=r.x-s.x;D=u.x-s.x;w=r.y-s.y;C=u.y-s.y;J=1/(G*C-D*w);U.set((C*v-w*y)*J,(C*H-w*x)*J,(C*F-w*z)*J);M.set((G*y-D*v)*J,(G*x-D*H)*J,(G*z-D*F)*J);k[a].add(U);k[b].add(U);k[c].add(U);n[a].add(M);n[b].add(M);n[c].add(M)}function b(a){wa.fromArray(e,
-3*a);E.copy(wa);qa=k[a];ga.copy(qa);ga.sub(wa.multiplyScalar(wa.dot(qa))).normalize();ea.crossVectors(E,qa);xa=ea.dot(n[a]);Za=0>xa?-1:1;h[4*a]=ga.x;h[4*a+1]=ga.y;h[4*a+2]=ga.z;h[4*a+3]=Za}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.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],n=[],p=0;p<g;p++)k[p]=new THREE.Vector3,n[p]=new THREE.Vector3;var q=new THREE.Vector3,m=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,v,y,H,x,F,z,G,D,w,C,J,U=new THREE.Vector3,M=new THREE.Vector3,K,L,N,T,Q;0===this.drawcalls.length&&
-this.addDrawCall(0,c.length,0);var W=this.drawcalls,p=0;for(L=W.length;p<L;++p){K=W[p].start;N=W[p].count;var P=W[p].index,g=K;for(K+=N;g<K;g+=3)N=P+c[g],T=P+c[g+1],Q=P+c[g+2],a(N,T,Q)}var ga=new THREE.Vector3,ea=new THREE.Vector3,wa=new THREE.Vector3,E=new THREE.Vector3,Za,qa,xa,p=0;for(L=W.length;p<L;++p)for(K=W[p].start,N=W[p].count,P=W[p].index,g=K,K+=N;g<K;g+=3)N=P+c[g],T=P+c[g+1],Q=P+c[g+2],b(N),b(T),b(Q)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;
+c[d+8]=q.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q.fromArray(d,3*a);m.fromArray(d,3*b);t.fromArray(d,3*c);s.fromArray(f,2*a);r.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-q.x;y=t.x-q.x;H=m.y-q.y;x=t.y-q.y;E=m.z-q.z;z=t.z-q.z;F=r.x-s.x;D=u.x-s.x;w=r.y-s.y;C=u.y-s.y;A=1/(F*C-D*w);U.set((C*v-w*y)*A,(C*H-w*x)*A,(C*E-w*z)*A);M.set((F*y-D*v)*A,(F*x-D*H)*A,(F*z-D*E)*A);k[a].add(U);k[b].add(U);k[c].add(U);n[a].add(M);n[b].add(M);n[c].add(M)}function b(a){wa.fromArray(e,
+3*a);G.copy(wa);qa=k[a];ga.copy(qa);ga.sub(wa.multiplyScalar(wa.dot(qa))).normalize();ea.crossVectors(G,qa);xa=ea.dot(n[a]);Za=0>xa?-1:1;h[4*a]=ga.x;h[4*a+1]=ga.y;h[4*a+2]=ga.z;h[4*a+3]=Za}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.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],n=[],p=0;p<g;p++)k[p]=new THREE.Vector3,n[p]=new THREE.Vector3;var q=new THREE.Vector3,m=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,v,y,H,x,E,z,F,D,w,C,A,U=new THREE.Vector3,M=new THREE.Vector3,K,L,N,T,Q;0===this.drawcalls.length&&
+this.addDrawCall(0,c.length,0);var W=this.drawcalls,p=0;for(L=W.length;p<L;++p){K=W[p].start;N=W[p].count;var O=W[p].index,g=K;for(K+=N;g<K;g+=3)N=O+c[g],T=O+c[g+1],Q=O+c[g+2],a(N,T,Q)}var ga=new THREE.Vector3,ea=new THREE.Vector3,wa=new THREE.Vector3,G=new THREE.Vector3,Za,qa,xa,p=0;for(L=W.length;p<L;++p)for(K=W[p].start,N=W[p].count,O=W[p].index,g=K,K+=N;g<K;g+=3)N=O+c[g],T=O+c[g+1],Q=O+c[g+2],b(N),b(T),b(Q)}},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],n=0,p=0,q=new Int32Array(6),m=new Int32Array(c.length),t=new Int32Array(c.length),s=0;s<c.length;s++)m[s]=-1,t[s]=-1;for(c=0;c<d;c++){for(var r=p=0;3>r;r++)s=a[3*c+r],-1==m[s]?(q[2*r]=s,q[2*r+1]=-1,p++):m[s]<k.index?(q[2*r]=s,q[2*r+1]=-1,n++):(q[2*r]=s,q[2*r+1]=m[s]);if(g+p>k.index+b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)r=q[p+1],-1<r&&r<k.index&&(q[p+1]=
 -1);for(p=0;6>p;p+=2)s=q[p],r=q[p+1],-1===r&&(r=g++),m[s]=r,t[r]=s,e[f++]=r-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},
 normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!=e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*c));for(var f=0;f<c;f++){var g=b[f];for(e in this.attributes)if("index"!=e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,n=d[e],p=0;p<k;p++)n[f*k+p]=h[g*
@@ -208,9 +208,9 @@ g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(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,n,p,q,m,t,s,r,u,v=[],y=[];c=new THREE.Vector3;var H=new THREE.Vector3,x=new THREE.Vector3,F=new THREE.Vector3,z=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,y[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],
+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,n,p,q,m,t,s,r,u,v=[],y=[];c=new THREE.Vector3;var H=new THREE.Vector3,x=new THREE.Vector3,E=new THREE.Vector3,z=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,y[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],
 n=f[0],p=f[1],q=f[2],f=h.x-g.x,m=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-n.x,r=q.x-n.x,p=p.y-n.y,n=q.y-n.y,q=1/(k*n-r*p),c.set((n*f-p*m)*q,(n*t-p*s)*q,(n*h-p*g)*q),H.set((k*m-r*f)*q,(k*s-r*t)*q,(k*g-r*h)*q),v[d].add(c),v[u].add(c),v[e].add(c),y[d].add(H),y[u].add(H),y[e].add(H);H=["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++)z.copy(e.vertexNormals[c]),d=e[H[c]],u=v[d],x.copy(u),x.sub(z.multiplyScalar(z.dot(u))).normalize(),
-F.crossVectors(e.vertexNormals[c],u),d=F.dot(y[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,x.y,x.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);
+E.crossVectors(e.vertexNormals[c],u),d=E.dot(y[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,x.y,x.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);
 this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,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,n=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 m=g[p].clone();void 0!==b&&m.applyMatrix4(b);f.push(m)}p=0;for(q=k.length;p<
 q;p++){var g=k[p],t,s=g.vertexNormals,r=g.vertexColors,m=new THREE.Face3(g.a+e,g.b+e,g.c+e);m.normal.copy(g.normal);void 0!==d&&m.normal.applyMatrix3(d).normalize();b=0;for(f=s.length;b<f;b++)t=s[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),m.vertexNormals.push(t);m.color.copy(g.color);b=0;for(f=r.length;b<f;b++)t=r[b],m.vertexColors.push(t.clone());m.materialIndex=g.materialIndex+c;h.push(m)}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(c[b].clone());
 n.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<
@@ -261,9 +261,9 @@ 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.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText);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,n,p,q,m,t,s,r,u,v,y=a.faces;p=a.vertices;var H=a.normals,x=a.colors,F=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&F++;for(d=0;d<F;d++)c.faceVertexUvs[d]=[]}k=0;for(n=p.length;k<n;)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(n=y.length;k<n;)if(b=y[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=y[k];t.b=y[k+1];t.c=y[k+3];r=new THREE.Face3;r.a=y[k+1];r.b=y[k+2];r.c=y[k+3];k+=4;h&&(h=y[k++],t.materialIndex=h,r.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<F;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=y[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);q&&(q=3*y[k++],t.normal.set(H[q++],H[q++],H[q]),r.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*y[k++],s=new THREE.Vector3(H[q++],
-H[q++],H[q]),2!==d&&t.vertexNormals.push(s),0!==d&&r.vertexNormals.push(s);p&&(p=y[k++],p=x[p],t.color.setHex(p),r.color.setHex(p));if(b)for(d=0;4>d;d++)p=y[k++],p=x[p],2!==d&&t.vertexColors.push(new THREE.Color(p)),0!==d&&r.vertexColors.push(new THREE.Color(p));c.faces.push(t);c.faces.push(r)}else{t=new THREE.Face3;t.a=y[k++];t.b=y[k++];t.c=y[k++];h&&(h=y[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<F;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=y[k++],v=u[2*m],m=u[2*m+1],
+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,n,p,q,m,t,s,r,u,v,y=a.faces;p=a.vertices;var H=a.normals,x=a.colors,E=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&E++;for(d=0;d<E;d++)c.faceVertexUvs[d]=[]}k=0;for(n=p.length;k<n;)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(n=y.length;k<n;)if(b=y[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=y[k];t.b=y[k+1];t.c=y[k+3];r=new THREE.Face3;r.a=y[k+1];r.b=y[k+2];r.c=y[k+3];k+=4;h&&(h=y[k++],t.materialIndex=h,r.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<E;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=y[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);q&&(q=3*y[k++],t.normal.set(H[q++],H[q++],H[q]),r.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*y[k++],s=new THREE.Vector3(H[q++],
+H[q++],H[q]),2!==d&&t.vertexNormals.push(s),0!==d&&r.vertexNormals.push(s);p&&(p=y[k++],p=x[p],t.color.setHex(p),r.color.setHex(p));if(b)for(d=0;4>d;d++)p=y[k++],p=x[p],2!==d&&t.vertexColors.push(new THREE.Color(p)),0!==d&&r.vertexColors.push(new THREE.Color(p));c.faces.push(t);c.faces.push(r)}else{t=new THREE.Face3;t.a=y[k++];t.b=y[k++];t.c=y[k++];h&&(h=y[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<E;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=y[k++],v=u[2*m],m=u[2*m+1],
 v=new THREE.Vector2(v,m),c.faceVertexUvs[d][h].push(v);q&&(q=3*y[k++],t.normal.set(H[q++],H[q++],H[q]));if(s)for(d=0;3>d;d++)q=3*y[k++],s=new THREE.Vector3(H[q++],H[q++],H[q]),t.vertexNormals.push(s);p&&(p=y[k++],t.color.setHex(x[p]));if(b)for(d=0;3>d;d++)p=y[k++],t.vertexColors.push(new THREE.Color(x[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],
 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,n,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=[],n=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;n.push(q)}}if(void 0!==a.morphColors)for(d=
@@ -343,11 +343,11 @@ face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function
 THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
 THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var n=
-this.material;if(void 0!==n){var p=k.attributes,q,m,t=g.precision;if(void 0!==p.index){var s=p.index.array,r=p.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:s.length,index:0}]);for(var v=0,y=u.length;v<y;++v)for(var p=u[v].start,H=u[v].index,k=p,x=p+u[v].count;k<x;k+=3){p=H+s[k];q=H+s[k+1];m=H+s[k+2];d.fromArray(r,3*p);e.fromArray(r,3*q);f.fromArray(r,3*m);var F=n.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,n.side!==THREE.DoubleSide);if(null!==F){F.applyMatrix4(this.matrixWorld);
-var z=g.ray.origin.distanceTo(F);z<t||z<g.near||z>g.far||h.push({distance:z,point:F,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(r=p.position.array,s=k=0,x=r.length;k<x;k+=3,s+=9)p=k,q=k+1,m=k+2,d.fromArray(r,s),e.fromArray(r,s+3),f.fromArray(r,s+6),F=n.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,n.side!==THREE.DoubleSide),null!==F&&(F.applyMatrix4(this.matrixWorld),z=g.ray.origin.distanceTo(F),z<t||z<g.near||z>
-g.far||h.push({distance:z,point:F,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,r=!0===s?this.material.materials:null,t=g.precision,u=k.vertices,v=0,y=k.faces.length;v<y;v++)if(H=k.faces[v],n=!0===s?r[H.materialIndex]:this.material,void 0!==n){p=u[H.a];q=u[H.b];m=u[H.c];if(!0===n.morphTargets){F=k.morphTargets;z=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
-0,0);for(var x=0,G=F.length;x<G;x++){var D=z[x];if(0!==D){var w=F[x].vertices;d.x+=(w[H.a].x-p.x)*D;d.y+=(w[H.a].y-p.y)*D;d.z+=(w[H.a].z-p.z)*D;e.x+=(w[H.b].x-q.x)*D;e.y+=(w[H.b].y-q.y)*D;e.z+=(w[H.b].z-q.z)*D;f.x+=(w[H.c].x-m.x)*D;f.y+=(w[H.c].y-m.y)*D;f.z+=(w[H.c].z-m.z)*D}}d.add(p);e.add(q);f.add(m);p=d;q=e;m=f}F=n.side===THREE.BackSide?b.intersectTriangle(m,q,p,!0):b.intersectTriangle(p,q,m,n.side!==THREE.DoubleSide);null!==F&&(F.applyMatrix4(this.matrixWorld),z=g.ray.origin.distanceTo(F),z<t||
-z<g.near||z>g.far||h.push({distance:z,point:F,face:H,faceIndex:v,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;
+this.material;if(void 0!==n){var p=k.attributes,q,m,t=g.precision;if(void 0!==p.index){var s=p.index.array,r=p.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:s.length,index:0}]);for(var v=0,y=u.length;v<y;++v)for(var p=u[v].start,H=u[v].index,k=p,x=p+u[v].count;k<x;k+=3){p=H+s[k];q=H+s[k+1];m=H+s[k+2];d.fromArray(r,3*p);e.fromArray(r,3*q);f.fromArray(r,3*m);var E=n.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,n.side!==THREE.DoubleSide);if(null!==E){E.applyMatrix4(this.matrixWorld);
+var z=g.ray.origin.distanceTo(E);z<t||z<g.near||z>g.far||h.push({distance:z,point:E,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(r=p.position.array,s=k=0,x=r.length;k<x;k+=3,s+=9)p=k,q=k+1,m=k+2,d.fromArray(r,s),e.fromArray(r,s+3),f.fromArray(r,s+6),E=n.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,n.side!==THREE.DoubleSide),null!==E&&(E.applyMatrix4(this.matrixWorld),z=g.ray.origin.distanceTo(E),z<t||z<g.near||z>
+g.far||h.push({distance:z,point:E,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,r=!0===s?this.material.materials:null,t=g.precision,u=k.vertices,v=0,y=k.faces.length;v<y;v++)if(H=k.faces[v],n=!0===s?r[H.materialIndex]:this.material,void 0!==n){p=u[H.a];q=u[H.b];m=u[H.c];if(!0===n.morphTargets){E=k.morphTargets;z=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
+0,0);for(var x=0,F=E.length;x<F;x++){var D=z[x];if(0!==D){var w=E[x].vertices;d.x+=(w[H.a].x-p.x)*D;d.y+=(w[H.a].y-p.y)*D;d.z+=(w[H.a].z-p.z)*D;e.x+=(w[H.b].x-q.x)*D;e.y+=(w[H.b].y-q.y)*D;e.z+=(w[H.b].z-q.z)*D;f.x+=(w[H.c].x-m.x)*D;f.y+=(w[H.c].y-m.y)*D;f.z+=(w[H.c].z-m.z)*D}}d.add(p);e.add(q);f.add(m);p=d;q=e;m=f}E=n.side===THREE.BackSide?b.intersectTriangle(m,q,p,!0):b.intersectTriangle(p,q,m,n.side!==THREE.DoubleSide);null!==E&&(E.applyMatrix4(this.matrixWorld),z=g.ray.origin.distanceTo(E),z<t||
+z<g.near||z>g.far||h.push({distance:z,point:E,face:H,faceIndex:v,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;
 THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),
 this.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};
 THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}};
@@ -444,33 +444,33 @@ f),a.__skinWeightArray=new Float32Array(4*f));c=null!==aa.get("OES_element_index
 2*h;if(e.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var m in e.attributes){var g=e.attributes[m],h={},n;for(n in g)h[n]=g[n];if(!h.__webglInitialized||h.createUniqueBuffers)h.__webglInitialized=!0,c=1,"v2"===h.type?c=2:"v3"===h.type?c=3:"v4"===h.type?c=4:"c"===h.type&&(c=3),h.size=c,h.array=new Float32Array(f*c),h.buffer=l.createBuffer(),h.buffer.belongsToAttribute=m,g.needsUpdate=!0,h.__original=g;a.__webglCustomAttributesList.push(h)}}a.__inittedArrays=
 !0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var f=0,k=b.length;f<k;f++){var m=b[f],n=e[m];if(0<=n){var p=c[m];void 0!==p?(m=p.itemSize,l.bindBuffer(l.ARRAY_BUFFER,p.buffer),g(n),l.vertexAttribPointer(n,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(n,a.defaultAttributeValues[m]):
 3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(n,a.defaultAttributeValues[m]))}}h()}function f(){for(var a=0,b=kb.length;a<b;a++)kb[a]=0}function g(a){kb[a]=1;0===Ma[a]&&(l.enableVertexAttribArray(a),Ma[a]=1)}function h(){for(var a=0,b=Ma.length;a<b;a++)Ma[a]!==kb[a]&&(l.disableVertexAttribArray(a),Ma[a]=0)}function k(a,b){return a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function n(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function p(a,b){return b[0]-
-a[0]}function q(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group)){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",ic));var c=a.geometry;if(void 0!==c&&void 0===c.__webglInit&&(c.__webglInit=!0,c.addEventListener("dispose",jc),!(c instanceof THREE.BufferGeometry)))if(a instanceof THREE.Mesh)r(a,c);else if(a instanceof THREE.Line){if(void 0===c.__webglVertexBuffer){c.__webglVertexBuffer=
-l.createBuffer();c.__webglColorBuffer=l.createBuffer();c.__webglLineDistanceBuffer=l.createBuffer();A.info.memory.geometries++;var d=c.vertices.length;c.__vertexArray=new Float32Array(3*d);c.__colorArray=new Float32Array(3*d);c.__lineDistanceArray=new Float32Array(1*d);c.__webglLineCount=d;b(a);c.verticesNeedUpdate=!0;c.colorsNeedUpdate=!0;c.lineDistancesNeedUpdate=!0}}else a instanceof THREE.PointCloud&&void 0===c.__webglVertexBuffer&&(c.__webglVertexBuffer=l.createBuffer(),c.__webglColorBuffer=
-l.createBuffer(),A.info.memory.geometries++,d=c.vertices.length,c.__vertexArray=new Float32Array(3*d),c.__colorArray=new Float32Array(3*d),c.__sortArray=[],c.__webglParticleCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0);if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh)if(c instanceof THREE.BufferGeometry)u(Fa,c,a);else{if(c instanceof THREE.Geometry)for(var c=sb[c.id],d=0,e=c.length;d<e;d++)u(Fa,c[d],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?
+a[0]}function q(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group)){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",ic));var c=a.geometry;if(void 0!==c&&void 0===c.__webglInit)if(c.__webglInit=!0,c.addEventListener("dispose",jc),c instanceof THREE.BufferGeometry)J.info.memory.geometries++;else if(a instanceof THREE.Mesh)r(a,c);else if(a instanceof THREE.Line){if(void 0===c.__webglVertexBuffer){c.__webglVertexBuffer=
+l.createBuffer();c.__webglColorBuffer=l.createBuffer();c.__webglLineDistanceBuffer=l.createBuffer();J.info.memory.geometries++;var d=c.vertices.length;c.__vertexArray=new Float32Array(3*d);c.__colorArray=new Float32Array(3*d);c.__lineDistanceArray=new Float32Array(1*d);c.__webglLineCount=d;b(a);c.verticesNeedUpdate=!0;c.colorsNeedUpdate=!0;c.lineDistancesNeedUpdate=!0}}else a instanceof THREE.PointCloud&&void 0===c.__webglVertexBuffer&&(c.__webglVertexBuffer=l.createBuffer(),c.__webglColorBuffer=
+l.createBuffer(),J.info.memory.geometries++,d=c.vertices.length,c.__vertexArray=new Float32Array(3*d),c.__colorArray=new Float32Array(3*d),c.__sortArray=[],c.__webglParticleCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0);if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh)if(c instanceof THREE.BufferGeometry)u(Fa,c,a);else{if(c instanceof THREE.Geometry)for(var c=sb[c.id],d=0,e=c.length;d<e;d++)u(Fa,c[d],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?
 u(Fa,c,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&Ga.push({id:null,object:a,opaque:null,transparent:null,z:0});if(a instanceof THREE.Light)pa.push(a);else if(a instanceof THREE.Sprite)tb.push(a);else if(a instanceof THREE.LensFlare)eb.push(a);else if((c=Fa[a.id])&&(!1===a.frustumCulled||!0===ub.intersectsObject(a)))for(d=0,e=c.length;d<e;d++){var f=c[d],g=f,h=g.object,k=g.buffer,m=h.geometry,h=h.material;h instanceof THREE.MeshFaceMaterial?(h=h.materials[m instanceof
-THREE.BufferGeometry?0:k.materialIndex],g.material=h,h.transparent?ya.push(g):Ta.push(g)):h&&(g.material=h,h.transparent?ya.push(g):Ta.push(g));f.render=!0;!0===A.sortObjects&&(Ca.setFromMatrixPosition(a.matrixWorld),Ca.applyProjection(vb),f.z=Ca.z)}}d=0;for(e=a.children.length;d<e;d++)q(a.children[d])}}function m(a,b,c,d,e,f){for(var g,h=0,k=a.length;h<k;h++){g=a[h];var l=g.object,m=g.buffer;G(l,b);if(f)g=f;else{g=g.material;if(!g)continue;e&&A.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);
-A.setDepthTest(g.depthTest);A.setDepthWrite(g.depthWrite);J(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}A.setMaterialFaces(g);m instanceof THREE.BufferGeometry?A.renderBufferDirect(b,c,d,g,m,l):A.renderBuffer(b,c,d,g,m,l)}}function t(a,b,c,d,e,f,g){for(var h,k=0,l=a.length;k<l;k++){h=a[k];var m=h.object;if(m.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&A.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);A.setDepthTest(h.depthTest);A.setDepthWrite(h.depthWrite);J(h.polygonOffset,
-h.polygonOffsetFactor,h.polygonOffsetUnits)}A.renderImmediateObject(c,d,e,h,m)}}}function s(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function r(a,b){var d=a.material,e=!1;if(void 0===sb[b.id]||!0===b.groupsNeedUpdate){delete Fa[a.id];for(var f=sb,g=b.id,d=d instanceof THREE.MeshFaceMaterial,h=aa.get("OES_element_index_uint")?4294967296:65535,k,e={},m=b.morphTargets.length,n=b.morphNormals.length,p,q={},r=[],t=0,s=b.faces.length;t<s;t++){k=
+THREE.BufferGeometry?0:k.materialIndex],g.material=h,h.transparent?ya.push(g):Ta.push(g)):h&&(g.material=h,h.transparent?ya.push(g):Ta.push(g));f.render=!0;!0===J.sortObjects&&(Ca.setFromMatrixPosition(a.matrixWorld),Ca.applyProjection(vb),f.z=Ca.z)}}d=0;for(e=a.children.length;d<e;d++)q(a.children[d])}}function m(a,b,c,d,e,f){for(var g,h=0,k=a.length;h<k;h++){g=a[h];var l=g.object,m=g.buffer;F(l,b);if(f)g=f;else{g=g.material;if(!g)continue;e&&J.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);
+J.setDepthTest(g.depthTest);J.setDepthWrite(g.depthWrite);A(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}J.setMaterialFaces(g);m instanceof THREE.BufferGeometry?J.renderBufferDirect(b,c,d,g,m,l):J.renderBuffer(b,c,d,g,m,l)}}function t(a,b,c,d,e,f,g){for(var h,k=0,l=a.length;k<l;k++){h=a[k];var m=h.object;if(m.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&J.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);J.setDepthTest(h.depthTest);J.setDepthWrite(h.depthWrite);A(h.polygonOffset,
+h.polygonOffsetFactor,h.polygonOffsetUnits)}J.renderImmediateObject(c,d,e,h,m)}}}function s(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function r(a,b){var d=a.material,e=!1;if(void 0===sb[b.id]||!0===b.groupsNeedUpdate){delete Fa[a.id];for(var f=sb,g=b.id,d=d instanceof THREE.MeshFaceMaterial,h=aa.get("OES_element_index_uint")?4294967296:65535,k,e={},m=b.morphTargets.length,n=b.morphNormals.length,p,q={},r=[],t=0,s=b.faces.length;t<s;t++){k=
 b.faces[t];var v=d?k.materialIndex:0;v in e||(e[v]={hash:v,counter:0});k=e[v].hash+"_"+e[v].counter;k in q||(p={id:kc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:n},q[k]=p,r.push(p));q[k].vertices+3>h&&(e[v].counter+=1,k=e[v].hash+"_"+e[v].counter,k in q||(p={id:kc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:n},q[k]=p,r.push(p)));q[k].faces3.push(t);q[k].vertices+=3}f[g]=r;b.groupsNeedUpdate=!1}f=sb[b.id];g=0;for(d=f.length;g<d;g++){h=f[g];
 if(void 0===h.__webglVertexBuffer){e=h;e.__webglVertexBuffer=l.createBuffer();e.__webglNormalBuffer=l.createBuffer();e.__webglTangentBuffer=l.createBuffer();e.__webglColorBuffer=l.createBuffer();e.__webglUVBuffer=l.createBuffer();e.__webglUV2Buffer=l.createBuffer();e.__webglSkinIndicesBuffer=l.createBuffer();e.__webglSkinWeightsBuffer=l.createBuffer();e.__webglFaceBuffer=l.createBuffer();e.__webglLineBuffer=l.createBuffer();n=m=void 0;if(e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],m=0,n=
-e.numMorphTargets;m<n;m++)e.__webglMorphTargetsBuffers.push(l.createBuffer());if(e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],m=0,n=e.numMorphNormals;m<n;m++)e.__webglMorphNormalsBuffers.push(l.createBuffer());A.info.memory.geometries++;c(h,a);b.verticesNeedUpdate=!0;b.morphTargetsNeedUpdate=!0;b.elementsNeedUpdate=!0;b.uvsNeedUpdate=!0;b.normalsNeedUpdate=!0;b.tangentsNeedUpdate=!0;e=b.colorsNeedUpdate=!0}else e=!1;(e||void 0===a.__webglActive)&&u(Fa,h,a)}a.__webglActive=!0}function u(a,
+e.numMorphTargets;m<n;m++)e.__webglMorphTargetsBuffers.push(l.createBuffer());if(e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],m=0,n=e.numMorphNormals;m<n;m++)e.__webglMorphNormalsBuffers.push(l.createBuffer());J.info.memory.geometries++;c(h,a);b.verticesNeedUpdate=!0;b.morphTargetsNeedUpdate=!0;b.elementsNeedUpdate=!0;b.uvsNeedUpdate=!0;b.normalsNeedUpdate=!0;b.tangentsNeedUpdate=!0;e=b.colorsNeedUpdate=!0}else e=!1;(e||void 0===a.__webglActive)&&u(Fa,h,a)}a.__webglActive=!0}function u(a,
 b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function v(a){var b=a.geometry,e,f;if(b instanceof THREE.BufferGeometry)for(var g=b.attributes,h=b.attributesKeys,k=0,m=h.length;k<m;k++){var n=h[k],p=g[n];void 0===p.buffer&&(p.buffer=l.createBuffer(),p.needsUpdate=!0);if(!0===p.needsUpdate){var q="index"===n?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;l.bindBuffer(q,p.buffer);l.bufferData(q,p.array,l.STATIC_DRAW);p.needsUpdate=!1}}else if(a instanceof THREE.Mesh){!0===
-b.groupsNeedUpdate&&r(a,b);for(var t=sb[b.id],k=0,s=t.length;k<s;k++){var u=t[k];f=d(a,u);!0===b.groupsNeedUpdate&&c(u,a);e=f.attributes&&y(f);if(b.verticesNeedUpdate||b.morphTargetsNeedUpdate||b.elementsNeedUpdate||b.uvsNeedUpdate||b.normalsNeedUpdate||b.colorsNeedUpdate||b.tangentsNeedUpdate||e){var v=u,x=a,z=l.DYNAMIC_DRAW,G=!b.dynamic,D=f;if(v.__inittedArrays){var C=D&&void 0!==D.shading&&D.shading===THREE.SmoothShading,w=void 0,F=void 0,J=void 0,A=void 0,Q=void 0,M=void 0,K=void 0,N=void 0,P=
-void 0,T=void 0,U=void 0,E=void 0,L=void 0,X=void 0,W=void 0,pa=void 0,Ea=void 0,db=void 0,Fa=void 0,ga=void 0,Ta=void 0,aa=void 0,Ga=void 0,ya=void 0,ha=void 0,O=void 0,ea=void 0,fa=void 0,ma=void 0,Y=void 0,tb=void 0,qa=void 0,Ca=void 0,za=void 0,Ha=void 0,wa=void 0,na=void 0,$a=void 0,eb=void 0,la=void 0,Na=0,Ua=0,mb=0,xa=0,Xa=0,Va=0,Ia=0,nb=0,Oa=0,ia=0,ra=0,I=0,Aa=void 0,ab=v.__vertexArray,wb=v.__uvArray,ob=v.__uv2Array,Pa=v.__normalArray,Ba=v.__tangentArray,bb=v.__colorArray,Ka=v.__skinIndexArray,
-La=v.__skinWeightArray,Za=v.__morphTargetsArrays,xb=v.__morphNormalsArrays,pb=v.__webglCustomAttributesList,B=void 0,cb=v.__faceArray,sa=v.__lineArray,oa=x.geometry,Sa=oa.elementsNeedUpdate,Ma=oa.uvsNeedUpdate,Ab=oa.normalsNeedUpdate,Hb=oa.tangentsNeedUpdate,Ib=oa.colorsNeedUpdate,lb=oa.morphTargetsNeedUpdate,Cb=oa.vertices,V=v.faces3,Ja=oa.faces,Wa=oa.faceVertexUvs[0],Db=oa.faceVertexUvs[1],Pb=oa.skinIndices,$=oa.skinWeights,Eb=oa.morphTargets,R=oa.morphNormals;if(oa.verticesNeedUpdate){w=0;for(F=
-V.length;w<F;w++)A=Ja[V[w]],E=Cb[A.a],L=Cb[A.b],X=Cb[A.c],ab[Ua]=E.x,ab[Ua+1]=E.y,ab[Ua+2]=E.z,ab[Ua+3]=L.x,ab[Ua+4]=L.y,ab[Ua+5]=L.z,ab[Ua+6]=X.x,ab[Ua+7]=X.y,ab[Ua+8]=X.z,Ua+=9;l.bindBuffer(l.ARRAY_BUFFER,v.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,ab,z)}if(lb)for(Ha=0,wa=Eb.length;Ha<wa;Ha++){w=ra=0;for(F=V.length;w<F;w++)eb=V[w],A=Ja[eb],E=Eb[Ha].vertices[A.a],L=Eb[Ha].vertices[A.b],X=Eb[Ha].vertices[A.c],na=Za[Ha],na[ra]=E.x,na[ra+1]=E.y,na[ra+2]=E.z,na[ra+3]=L.x,na[ra+4]=L.y,na[ra+5]=
+b.groupsNeedUpdate&&r(a,b);for(var t=sb[b.id],k=0,s=t.length;k<s;k++){var u=t[k];f=d(a,u);!0===b.groupsNeedUpdate&&c(u,a);e=f.attributes&&y(f);if(b.verticesNeedUpdate||b.morphTargetsNeedUpdate||b.elementsNeedUpdate||b.uvsNeedUpdate||b.normalsNeedUpdate||b.colorsNeedUpdate||b.tangentsNeedUpdate||e){var v=u,x=a,z=l.DYNAMIC_DRAW,F=!b.dynamic,D=f;if(v.__inittedArrays){var C=D&&void 0!==D.shading&&D.shading===THREE.SmoothShading,w=void 0,E=void 0,J=void 0,A=void 0,Q=void 0,M=void 0,K=void 0,N=void 0,O=
+void 0,T=void 0,U=void 0,G=void 0,L=void 0,X=void 0,W=void 0,pa=void 0,Ea=void 0,db=void 0,Fa=void 0,ga=void 0,Ta=void 0,aa=void 0,Ga=void 0,ya=void 0,ha=void 0,P=void 0,ea=void 0,fa=void 0,ma=void 0,Y=void 0,tb=void 0,qa=void 0,Ca=void 0,za=void 0,Ha=void 0,wa=void 0,na=void 0,$a=void 0,eb=void 0,la=void 0,Na=0,Ua=0,mb=0,xa=0,Xa=0,Va=0,Ia=0,nb=0,Oa=0,ia=0,ra=0,I=0,Aa=void 0,ab=v.__vertexArray,wb=v.__uvArray,ob=v.__uv2Array,Pa=v.__normalArray,Ba=v.__tangentArray,bb=v.__colorArray,Ka=v.__skinIndexArray,
+La=v.__skinWeightArray,Za=v.__morphTargetsArrays,xb=v.__morphNormalsArrays,pb=v.__webglCustomAttributesList,B=void 0,cb=v.__faceArray,sa=v.__lineArray,oa=x.geometry,Sa=oa.elementsNeedUpdate,Ma=oa.uvsNeedUpdate,Ab=oa.normalsNeedUpdate,Hb=oa.tangentsNeedUpdate,Ib=oa.colorsNeedUpdate,lb=oa.morphTargetsNeedUpdate,Cb=oa.vertices,V=v.faces3,Ja=oa.faces,Wa=oa.faceVertexUvs[0],Db=oa.faceVertexUvs[1],Pb=oa.skinIndices,$=oa.skinWeights,Eb=oa.morphTargets,R=oa.morphNormals;if(oa.verticesNeedUpdate){w=0;for(E=
+V.length;w<E;w++)A=Ja[V[w]],G=Cb[A.a],L=Cb[A.b],X=Cb[A.c],ab[Ua]=G.x,ab[Ua+1]=G.y,ab[Ua+2]=G.z,ab[Ua+3]=L.x,ab[Ua+4]=L.y,ab[Ua+5]=L.z,ab[Ua+6]=X.x,ab[Ua+7]=X.y,ab[Ua+8]=X.z,Ua+=9;l.bindBuffer(l.ARRAY_BUFFER,v.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,ab,z)}if(lb)for(Ha=0,wa=Eb.length;Ha<wa;Ha++){w=ra=0;for(E=V.length;w<E;w++)eb=V[w],A=Ja[eb],G=Eb[Ha].vertices[A.a],L=Eb[Ha].vertices[A.b],X=Eb[Ha].vertices[A.c],na=Za[Ha],na[ra]=G.x,na[ra+1]=G.y,na[ra+2]=G.z,na[ra+3]=L.x,na[ra+4]=L.y,na[ra+5]=
 L.z,na[ra+6]=X.x,na[ra+7]=X.y,na[ra+8]=X.z,D.morphNormals&&(C?(la=R[Ha].vertexNormals[eb],db=la.a,Fa=la.b,ga=la.c):ga=Fa=db=R[Ha].faceNormals[eb],$a=xb[Ha],$a[ra]=db.x,$a[ra+1]=db.y,$a[ra+2]=db.z,$a[ra+3]=Fa.x,$a[ra+4]=Fa.y,$a[ra+5]=Fa.z,$a[ra+6]=ga.x,$a[ra+7]=ga.y,$a[ra+8]=ga.z),ra+=9;l.bindBuffer(l.ARRAY_BUFFER,v.__webglMorphTargetsBuffers[Ha]);l.bufferData(l.ARRAY_BUFFER,Za[Ha],z);D.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglMorphNormalsBuffers[Ha]),l.bufferData(l.ARRAY_BUFFER,xb[Ha],
-z))}if($.length){w=0;for(F=V.length;w<F;w++)A=Ja[V[w]],ya=$[A.a],ha=$[A.b],O=$[A.c],La[ia]=ya.x,La[ia+1]=ya.y,La[ia+2]=ya.z,La[ia+3]=ya.w,La[ia+4]=ha.x,La[ia+5]=ha.y,La[ia+6]=ha.z,La[ia+7]=ha.w,La[ia+8]=O.x,La[ia+9]=O.y,La[ia+10]=O.z,La[ia+11]=O.w,ea=Pb[A.a],fa=Pb[A.b],ma=Pb[A.c],Ka[ia]=ea.x,Ka[ia+1]=ea.y,Ka[ia+2]=ea.z,Ka[ia+3]=ea.w,Ka[ia+4]=fa.x,Ka[ia+5]=fa.y,Ka[ia+6]=fa.z,Ka[ia+7]=fa.w,Ka[ia+8]=ma.x,Ka[ia+9]=ma.y,Ka[ia+10]=ma.z,Ka[ia+11]=ma.w,ia+=12;0<ia&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglSkinIndicesBuffer),
-l.bufferData(l.ARRAY_BUFFER,Ka,z),l.bindBuffer(l.ARRAY_BUFFER,v.__webglSkinWeightsBuffer),l.bufferData(l.ARRAY_BUFFER,La,z))}if(Ib){w=0;for(F=V.length;w<F;w++)A=Ja[V[w]],K=A.vertexColors,N=A.color,3===K.length&&D.vertexColors===THREE.VertexColors?(Ta=K[0],aa=K[1],Ga=K[2]):Ga=aa=Ta=N,bb[Oa]=Ta.r,bb[Oa+1]=Ta.g,bb[Oa+2]=Ta.b,bb[Oa+3]=aa.r,bb[Oa+4]=aa.g,bb[Oa+5]=aa.b,bb[Oa+6]=Ga.r,bb[Oa+7]=Ga.g,bb[Oa+8]=Ga.b,Oa+=9;0<Oa&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,bb,
-z))}if(Hb&&oa.hasTangents){w=0;for(F=V.length;w<F;w++)A=Ja[V[w]],P=A.vertexTangents,W=P[0],pa=P[1],Ea=P[2],Ba[Ia]=W.x,Ba[Ia+1]=W.y,Ba[Ia+2]=W.z,Ba[Ia+3]=W.w,Ba[Ia+4]=pa.x,Ba[Ia+5]=pa.y,Ba[Ia+6]=pa.z,Ba[Ia+7]=pa.w,Ba[Ia+8]=Ea.x,Ba[Ia+9]=Ea.y,Ba[Ia+10]=Ea.z,Ba[Ia+11]=Ea.w,Ia+=12;l.bindBuffer(l.ARRAY_BUFFER,v.__webglTangentBuffer);l.bufferData(l.ARRAY_BUFFER,Ba,z)}if(Ab){w=0;for(F=V.length;w<F;w++)if(A=Ja[V[w]],Q=A.vertexNormals,M=A.normal,3===Q.length&&C)for(Y=0;3>Y;Y++)qa=Q[Y],Pa[Va]=qa.x,Pa[Va+1]=
-qa.y,Pa[Va+2]=qa.z,Va+=3;else for(Y=0;3>Y;Y++)Pa[Va]=M.x,Pa[Va+1]=M.y,Pa[Va+2]=M.z,Va+=3;l.bindBuffer(l.ARRAY_BUFFER,v.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,Pa,z)}if(Ma&&Wa){w=0;for(F=V.length;w<F;w++)if(J=V[w],T=Wa[J],void 0!==T)for(Y=0;3>Y;Y++)Ca=T[Y],wb[mb]=Ca.x,wb[mb+1]=Ca.y,mb+=2;0<mb&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglUVBuffer),l.bufferData(l.ARRAY_BUFFER,wb,z))}if(Ma&&Db){w=0;for(F=V.length;w<F;w++)if(J=V[w],U=Db[J],void 0!==U)for(Y=0;3>Y;Y++)za=U[Y],ob[xa]=za.x,ob[xa+1]=za.y,
-xa+=2;0<xa&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglUV2Buffer),l.bufferData(l.ARRAY_BUFFER,ob,z))}if(Sa){w=0;for(F=V.length;w<F;w++)cb[Xa]=Na,cb[Xa+1]=Na+1,cb[Xa+2]=Na+2,Xa+=3,sa[nb]=Na,sa[nb+1]=Na+1,sa[nb+2]=Na,sa[nb+3]=Na+2,sa[nb+4]=Na+1,sa[nb+5]=Na+2,nb+=6,Na+=3;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,v.__webglFaceBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,cb,z);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,v.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,sa,z)}if(pb)for(Y=0,tb=pb.length;Y<tb;Y++)if(B=
-pb[Y],B.__original.needsUpdate){I=0;if(1===B.size)if(void 0===B.boundTo||"vertices"===B.boundTo)for(w=0,F=V.length;w<F;w++)A=Ja[V[w]],B.array[I]=B.value[A.a],B.array[I+1]=B.value[A.b],B.array[I+2]=B.value[A.c],I+=3;else{if("faces"===B.boundTo)for(w=0,F=V.length;w<F;w++)Aa=B.value[V[w]],B.array[I]=Aa,B.array[I+1]=Aa,B.array[I+2]=Aa,I+=3}else if(2===B.size)if(void 0===B.boundTo||"vertices"===B.boundTo)for(w=0,F=V.length;w<F;w++)A=Ja[V[w]],E=B.value[A.a],L=B.value[A.b],X=B.value[A.c],B.array[I]=E.x,
-B.array[I+1]=E.y,B.array[I+2]=L.x,B.array[I+3]=L.y,B.array[I+4]=X.x,B.array[I+5]=X.y,I+=6;else{if("faces"===B.boundTo)for(w=0,F=V.length;w<F;w++)X=L=E=Aa=B.value[V[w]],B.array[I]=E.x,B.array[I+1]=E.y,B.array[I+2]=L.x,B.array[I+3]=L.y,B.array[I+4]=X.x,B.array[I+5]=X.y,I+=6}else if(3===B.size){var S;S="c"===B.type?["r","g","b"]:["x","y","z"];if(void 0===B.boundTo||"vertices"===B.boundTo)for(w=0,F=V.length;w<F;w++)A=Ja[V[w]],E=B.value[A.a],L=B.value[A.b],X=B.value[A.c],B.array[I]=E[S[0]],B.array[I+1]=
-E[S[1]],B.array[I+2]=E[S[2]],B.array[I+3]=L[S[0]],B.array[I+4]=L[S[1]],B.array[I+5]=L[S[2]],B.array[I+6]=X[S[0]],B.array[I+7]=X[S[1]],B.array[I+8]=X[S[2]],I+=9;else if("faces"===B.boundTo)for(w=0,F=V.length;w<F;w++)X=L=E=Aa=B.value[V[w]],B.array[I]=E[S[0]],B.array[I+1]=E[S[1]],B.array[I+2]=E[S[2]],B.array[I+3]=L[S[0]],B.array[I+4]=L[S[1]],B.array[I+5]=L[S[2]],B.array[I+6]=X[S[0]],B.array[I+7]=X[S[1]],B.array[I+8]=X[S[2]],I+=9;else if("faceVertices"===B.boundTo)for(w=0,F=V.length;w<F;w++)Aa=B.value[V[w]],
-E=Aa[0],L=Aa[1],X=Aa[2],B.array[I]=E[S[0]],B.array[I+1]=E[S[1]],B.array[I+2]=E[S[2]],B.array[I+3]=L[S[0]],B.array[I+4]=L[S[1]],B.array[I+5]=L[S[2]],B.array[I+6]=X[S[0]],B.array[I+7]=X[S[1]],B.array[I+8]=X[S[2]],I+=9}else if(4===B.size)if(void 0===B.boundTo||"vertices"===B.boundTo)for(w=0,F=V.length;w<F;w++)A=Ja[V[w]],E=B.value[A.a],L=B.value[A.b],X=B.value[A.c],B.array[I]=E.x,B.array[I+1]=E.y,B.array[I+2]=E.z,B.array[I+3]=E.w,B.array[I+4]=L.x,B.array[I+5]=L.y,B.array[I+6]=L.z,B.array[I+7]=L.w,B.array[I+
-8]=X.x,B.array[I+9]=X.y,B.array[I+10]=X.z,B.array[I+11]=X.w,I+=12;else if("faces"===B.boundTo)for(w=0,F=V.length;w<F;w++)X=L=E=Aa=B.value[V[w]],B.array[I]=E.x,B.array[I+1]=E.y,B.array[I+2]=E.z,B.array[I+3]=E.w,B.array[I+4]=L.x,B.array[I+5]=L.y,B.array[I+6]=L.z,B.array[I+7]=L.w,B.array[I+8]=X.x,B.array[I+9]=X.y,B.array[I+10]=X.z,B.array[I+11]=X.w,I+=12;else if("faceVertices"===B.boundTo)for(w=0,F=V.length;w<F;w++)Aa=B.value[V[w]],E=Aa[0],L=Aa[1],X=Aa[2],B.array[I]=E.x,B.array[I+1]=E.y,B.array[I+2]=
-E.z,B.array[I+3]=E.w,B.array[I+4]=L.x,B.array[I+5]=L.y,B.array[I+6]=L.z,B.array[I+7]=L.w,B.array[I+8]=X.x,B.array[I+9]=X.y,B.array[I+10]=X.z,B.array[I+11]=X.w,I+=12;l.bindBuffer(l.ARRAY_BUFFER,B.buffer);l.bufferData(l.ARRAY_BUFFER,B.array,z)}G&&(delete v.__inittedArrays,delete v.__colorArray,delete v.__normalArray,delete v.__tangentArray,delete v.__uvArray,delete v.__uv2Array,delete v.__faceArray,delete v.__vertexArray,delete v.__lineArray,delete v.__skinIndexArray,delete v.__skinWeightArray)}}}b.verticesNeedUpdate=
+z))}if($.length){w=0;for(E=V.length;w<E;w++)A=Ja[V[w]],ya=$[A.a],ha=$[A.b],P=$[A.c],La[ia]=ya.x,La[ia+1]=ya.y,La[ia+2]=ya.z,La[ia+3]=ya.w,La[ia+4]=ha.x,La[ia+5]=ha.y,La[ia+6]=ha.z,La[ia+7]=ha.w,La[ia+8]=P.x,La[ia+9]=P.y,La[ia+10]=P.z,La[ia+11]=P.w,ea=Pb[A.a],fa=Pb[A.b],ma=Pb[A.c],Ka[ia]=ea.x,Ka[ia+1]=ea.y,Ka[ia+2]=ea.z,Ka[ia+3]=ea.w,Ka[ia+4]=fa.x,Ka[ia+5]=fa.y,Ka[ia+6]=fa.z,Ka[ia+7]=fa.w,Ka[ia+8]=ma.x,Ka[ia+9]=ma.y,Ka[ia+10]=ma.z,Ka[ia+11]=ma.w,ia+=12;0<ia&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglSkinIndicesBuffer),
+l.bufferData(l.ARRAY_BUFFER,Ka,z),l.bindBuffer(l.ARRAY_BUFFER,v.__webglSkinWeightsBuffer),l.bufferData(l.ARRAY_BUFFER,La,z))}if(Ib){w=0;for(E=V.length;w<E;w++)A=Ja[V[w]],K=A.vertexColors,N=A.color,3===K.length&&D.vertexColors===THREE.VertexColors?(Ta=K[0],aa=K[1],Ga=K[2]):Ga=aa=Ta=N,bb[Oa]=Ta.r,bb[Oa+1]=Ta.g,bb[Oa+2]=Ta.b,bb[Oa+3]=aa.r,bb[Oa+4]=aa.g,bb[Oa+5]=aa.b,bb[Oa+6]=Ga.r,bb[Oa+7]=Ga.g,bb[Oa+8]=Ga.b,Oa+=9;0<Oa&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,bb,
+z))}if(Hb&&oa.hasTangents){w=0;for(E=V.length;w<E;w++)A=Ja[V[w]],O=A.vertexTangents,W=O[0],pa=O[1],Ea=O[2],Ba[Ia]=W.x,Ba[Ia+1]=W.y,Ba[Ia+2]=W.z,Ba[Ia+3]=W.w,Ba[Ia+4]=pa.x,Ba[Ia+5]=pa.y,Ba[Ia+6]=pa.z,Ba[Ia+7]=pa.w,Ba[Ia+8]=Ea.x,Ba[Ia+9]=Ea.y,Ba[Ia+10]=Ea.z,Ba[Ia+11]=Ea.w,Ia+=12;l.bindBuffer(l.ARRAY_BUFFER,v.__webglTangentBuffer);l.bufferData(l.ARRAY_BUFFER,Ba,z)}if(Ab){w=0;for(E=V.length;w<E;w++)if(A=Ja[V[w]],Q=A.vertexNormals,M=A.normal,3===Q.length&&C)for(Y=0;3>Y;Y++)qa=Q[Y],Pa[Va]=qa.x,Pa[Va+1]=
+qa.y,Pa[Va+2]=qa.z,Va+=3;else for(Y=0;3>Y;Y++)Pa[Va]=M.x,Pa[Va+1]=M.y,Pa[Va+2]=M.z,Va+=3;l.bindBuffer(l.ARRAY_BUFFER,v.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,Pa,z)}if(Ma&&Wa){w=0;for(E=V.length;w<E;w++)if(J=V[w],T=Wa[J],void 0!==T)for(Y=0;3>Y;Y++)Ca=T[Y],wb[mb]=Ca.x,wb[mb+1]=Ca.y,mb+=2;0<mb&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglUVBuffer),l.bufferData(l.ARRAY_BUFFER,wb,z))}if(Ma&&Db){w=0;for(E=V.length;w<E;w++)if(J=V[w],U=Db[J],void 0!==U)for(Y=0;3>Y;Y++)za=U[Y],ob[xa]=za.x,ob[xa+1]=za.y,
+xa+=2;0<xa&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglUV2Buffer),l.bufferData(l.ARRAY_BUFFER,ob,z))}if(Sa){w=0;for(E=V.length;w<E;w++)cb[Xa]=Na,cb[Xa+1]=Na+1,cb[Xa+2]=Na+2,Xa+=3,sa[nb]=Na,sa[nb+1]=Na+1,sa[nb+2]=Na,sa[nb+3]=Na+2,sa[nb+4]=Na+1,sa[nb+5]=Na+2,nb+=6,Na+=3;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,v.__webglFaceBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,cb,z);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,v.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,sa,z)}if(pb)for(Y=0,tb=pb.length;Y<tb;Y++)if(B=
+pb[Y],B.__original.needsUpdate){I=0;if(1===B.size)if(void 0===B.boundTo||"vertices"===B.boundTo)for(w=0,E=V.length;w<E;w++)A=Ja[V[w]],B.array[I]=B.value[A.a],B.array[I+1]=B.value[A.b],B.array[I+2]=B.value[A.c],I+=3;else{if("faces"===B.boundTo)for(w=0,E=V.length;w<E;w++)Aa=B.value[V[w]],B.array[I]=Aa,B.array[I+1]=Aa,B.array[I+2]=Aa,I+=3}else if(2===B.size)if(void 0===B.boundTo||"vertices"===B.boundTo)for(w=0,E=V.length;w<E;w++)A=Ja[V[w]],G=B.value[A.a],L=B.value[A.b],X=B.value[A.c],B.array[I]=G.x,
+B.array[I+1]=G.y,B.array[I+2]=L.x,B.array[I+3]=L.y,B.array[I+4]=X.x,B.array[I+5]=X.y,I+=6;else{if("faces"===B.boundTo)for(w=0,E=V.length;w<E;w++)X=L=G=Aa=B.value[V[w]],B.array[I]=G.x,B.array[I+1]=G.y,B.array[I+2]=L.x,B.array[I+3]=L.y,B.array[I+4]=X.x,B.array[I+5]=X.y,I+=6}else if(3===B.size){var S;S="c"===B.type?["r","g","b"]:["x","y","z"];if(void 0===B.boundTo||"vertices"===B.boundTo)for(w=0,E=V.length;w<E;w++)A=Ja[V[w]],G=B.value[A.a],L=B.value[A.b],X=B.value[A.c],B.array[I]=G[S[0]],B.array[I+1]=
+G[S[1]],B.array[I+2]=G[S[2]],B.array[I+3]=L[S[0]],B.array[I+4]=L[S[1]],B.array[I+5]=L[S[2]],B.array[I+6]=X[S[0]],B.array[I+7]=X[S[1]],B.array[I+8]=X[S[2]],I+=9;else if("faces"===B.boundTo)for(w=0,E=V.length;w<E;w++)X=L=G=Aa=B.value[V[w]],B.array[I]=G[S[0]],B.array[I+1]=G[S[1]],B.array[I+2]=G[S[2]],B.array[I+3]=L[S[0]],B.array[I+4]=L[S[1]],B.array[I+5]=L[S[2]],B.array[I+6]=X[S[0]],B.array[I+7]=X[S[1]],B.array[I+8]=X[S[2]],I+=9;else if("faceVertices"===B.boundTo)for(w=0,E=V.length;w<E;w++)Aa=B.value[V[w]],
+G=Aa[0],L=Aa[1],X=Aa[2],B.array[I]=G[S[0]],B.array[I+1]=G[S[1]],B.array[I+2]=G[S[2]],B.array[I+3]=L[S[0]],B.array[I+4]=L[S[1]],B.array[I+5]=L[S[2]],B.array[I+6]=X[S[0]],B.array[I+7]=X[S[1]],B.array[I+8]=X[S[2]],I+=9}else if(4===B.size)if(void 0===B.boundTo||"vertices"===B.boundTo)for(w=0,E=V.length;w<E;w++)A=Ja[V[w]],G=B.value[A.a],L=B.value[A.b],X=B.value[A.c],B.array[I]=G.x,B.array[I+1]=G.y,B.array[I+2]=G.z,B.array[I+3]=G.w,B.array[I+4]=L.x,B.array[I+5]=L.y,B.array[I+6]=L.z,B.array[I+7]=L.w,B.array[I+
+8]=X.x,B.array[I+9]=X.y,B.array[I+10]=X.z,B.array[I+11]=X.w,I+=12;else if("faces"===B.boundTo)for(w=0,E=V.length;w<E;w++)X=L=G=Aa=B.value[V[w]],B.array[I]=G.x,B.array[I+1]=G.y,B.array[I+2]=G.z,B.array[I+3]=G.w,B.array[I+4]=L.x,B.array[I+5]=L.y,B.array[I+6]=L.z,B.array[I+7]=L.w,B.array[I+8]=X.x,B.array[I+9]=X.y,B.array[I+10]=X.z,B.array[I+11]=X.w,I+=12;else if("faceVertices"===B.boundTo)for(w=0,E=V.length;w<E;w++)Aa=B.value[V[w]],G=Aa[0],L=Aa[1],X=Aa[2],B.array[I]=G.x,B.array[I+1]=G.y,B.array[I+2]=
+G.z,B.array[I+3]=G.w,B.array[I+4]=L.x,B.array[I+5]=L.y,B.array[I+6]=L.z,B.array[I+7]=L.w,B.array[I+8]=X.x,B.array[I+9]=X.y,B.array[I+10]=X.z,B.array[I+11]=X.w,I+=12;l.bindBuffer(l.ARRAY_BUFFER,B.buffer);l.bufferData(l.ARRAY_BUFFER,B.array,z)}F&&(delete v.__inittedArrays,delete v.__colorArray,delete v.__normalArray,delete v.__tangentArray,delete v.__uvArray,delete v.__uv2Array,delete v.__faceArray,delete v.__vertexArray,delete v.__lineArray,delete v.__skinIndexArray,delete v.__skinWeightArray)}}}b.verticesNeedUpdate=
 !1;b.morphTargetsNeedUpdate=!1;b.elementsNeedUpdate=!1;b.uvsNeedUpdate=!1;b.normalsNeedUpdate=!1;b.colorsNeedUpdate=!1;b.tangentsNeedUpdate=!1;f.attributes&&H(f)}else if(a instanceof THREE.Line){f=d(a,b);e=f.attributes&&y(f);if(b.verticesNeedUpdate||b.colorsNeedUpdate||b.lineDistancesNeedUpdate||e){var Z=l.DYNAMIC_DRAW,Da,ka,Bb,Fb,ba,gb,ta=b.vertices,Qb=b.colors,Rb=b.lineDistances,qb=ta.length,Sb=Qb.length,yb=Rb.length,Gb=b.__vertexArray,rb=b.__colorArray,kb=b.__lineDistanceArray,Mb=b.colorsNeedUpdate,
 Ob=b.lineDistancesNeedUpdate,hb=b.__webglCustomAttributesList,Ya,ib,ua,Kb,Qa,ca;if(b.verticesNeedUpdate){for(Da=0;Da<qb;Da++)Fb=ta[Da],ba=3*Da,Gb[ba]=Fb.x,Gb[ba+1]=Fb.y,Gb[ba+2]=Fb.z;l.bindBuffer(l.ARRAY_BUFFER,b.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,Gb,Z)}if(Mb){for(ka=0;ka<Sb;ka++)gb=Qb[ka],ba=3*ka,rb[ba]=gb.r,rb[ba+1]=gb.g,rb[ba+2]=gb.b;l.bindBuffer(l.ARRAY_BUFFER,b.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,rb,Z)}if(Ob){for(Bb=0;Bb<yb;Bb++)kb[Bb]=Rb[Bb];l.bindBuffer(l.ARRAY_BUFFER,
 b.__webglLineDistanceBuffer);l.bufferData(l.ARRAY_BUFFER,kb,Z)}if(hb)for(Ya=0,ib=hb.length;Ya<ib;Ya++)if(ca=hb[Ya],ca.needsUpdate&&(void 0===ca.boundTo||"vertices"===ca.boundTo)){ba=0;Kb=ca.value.length;if(1===ca.size)for(ua=0;ua<Kb;ua++)ca.array[ua]=ca.value[ua];else if(2===ca.size)for(ua=0;ua<Kb;ua++)Qa=ca.value[ua],ca.array[ba]=Qa.x,ca.array[ba+1]=Qa.y,ba+=2;else if(3===ca.size)if("c"===ca.type)for(ua=0;ua<Kb;ua++)Qa=ca.value[ua],ca.array[ba]=Qa.r,ca.array[ba+1]=Qa.g,ca.array[ba+2]=Qa.b,ba+=3;
@@ -480,39 +480,39 @@ y(f);if(b.verticesNeedUpdate||b.colorsNeedUpdate||e){var jb=l.DYNAMIC_DRAW,Tb,Ub
 1]=Ra.g,da.array[ja+2]=Ra.b,ja+=3;else for(va=0;va<Lb;va++)Ra=da.value[va],da.array[ja]=Ra.x,da.array[ja+1]=Ra.y,da.array[ja+2]=Ra.z,ja+=3;else if(4===da.size)for(va=0;va<Lb;va++)Ra=da.value[va],da.array[ja]=Ra.x,da.array[ja+1]=Ra.y,da.array[ja+2]=Ra.z,da.array[ja+3]=Ra.w,ja+=4;l.bindBuffer(l.ARRAY_BUFFER,da.buffer);l.bufferData(l.ARRAY_BUFFER,da.array,jb);da.needsUpdate=!1}}b.verticesNeedUpdate=!1;b.colorsNeedUpdate=!1;f.attributes&&H(f)}}function y(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;
 return!1}function H(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function x(a,b,c,d,e){var f,g,h,k;Mb=0;if(d.needsUpdate){d.program&&lc(d);d.addEventListener("dispose",mc);var m;d instanceof THREE.MeshDepthMaterial?m="depth":d instanceof THREE.MeshNormalMaterial?m="normal":d instanceof THREE.MeshBasicMaterial?m="basic":d instanceof THREE.MeshLambertMaterial?m="lambert":d instanceof THREE.MeshPhongMaterial?m="phong":d instanceof THREE.LineBasicMaterial?m="basic":d instanceof THREE.LineDashedMaterial?
 m="dashed":d instanceof THREE.PointCloudMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var p=0,q=0,r=0,t=0,s=0,v=b.length;s<v;s++){var u=b[s];u.onlyShadow||!1===u.visible||(u instanceof THREE.DirectionalLight&&p++,u instanceof THREE.PointLight&&q++,u instanceof
-THREE.SpotLight&&r++,u instanceof THREE.HemisphereLight&&t++)}f=p;g=q;h=r;k=t;for(var x,y=0,H=0,G=b.length;H<G;H++){var C=b[H];C.castShadow&&(C instanceof THREE.SpotLight&&y++,C instanceof THREE.DirectionalLight&&!C.shadowCascade&&y++)}x=y;var E;if(Nb&&e&&e.skeleton&&e.skeleton.useVertexTexture)E=1024;else{var J=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),L=Math.floor((J-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(L=Math.min(e.skeleton.bones.length,L),L<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+
-e.skeleton.bones.length+", this GPU supports just "+L+" (try OpenGL instead of ANGLE)"));E=L}var K={precision:ga,supportsVertexTextures:Vb,map:!!d.map,envMap:!!d.envMap,lightMap:!!d.lightMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:X,skinning:d.skinning,maxBones:E,useVertexTexture:Nb&&e&&e.skeleton&&e.skeleton.useVertexTexture,
-morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:A.maxMorphTargets,maxMorphNormals:A.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:x,shadowMapEnabled:A.shadowMapEnabled&&e.receiveShadow&&0<x,shadowMapType:A.shadowMapType,shadowMapDebug:A.shadowMapDebug,shadowMapCascade:A.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},N=[];m?N.push(m):
-(N.push(d.fragmentShader),N.push(d.vertexShader));if(void 0!==d.defines)for(var P in d.defines)N.push(P),N.push(d.defines[P]);for(P in K)N.push(P),N.push(K[P]);for(var W=N.join(),pa,Ea=0,db=Xa.length;Ea<db;Ea++){var Fa=Xa[Ea];if(Fa.code===W){pa=Fa;pa.usedTimes++;break}}void 0===pa&&(pa=new THREE.WebGLProgram(A,W,d,K),Xa.push(pa),A.info.memory.programs=Xa.length);d.program=pa;var Ta=pa.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var aa,Ga="morphTarget",ya=0;ya<A.maxMorphTargets;ya++)aa=
-Ga+ya,0<=Ta[aa]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,Ga="morphNormal",ya=0;ya<A.maxMorphNormals;ya++)aa=Ga+ya,0<=Ta[aa]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var ea in d.__webglShader.uniforms){var tb=d.program.uniforms[ea];tb&&d.uniformsList.push([d.__webglShader.uniforms[ea],tb])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(A.maxMorphTargets));var qa=!1,eb=!1,xa=!1,wa=
-d.program,ha=wa.uniforms,O=d.__webglShader.uniforms;wa.id!==Wb&&(l.useProgram(wa.program),Wb=wa.id,xa=eb=qa=!0);d.id!==Hb&&(-1===Hb&&(xa=!0),Hb=d.id,eb=!0);if(qa||a!==Ib)l.uniformMatrix4fv(ha.projectionMatrix,!1,a.projectionMatrix.elements),X&&l.uniform1f(ha.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Ib&&(Ib=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==ha.cameraPosition&&(Ca.setFromMatrixPosition(a.matrixWorld),l.uniform3f(ha.cameraPosition,
+THREE.SpotLight&&r++,u instanceof THREE.HemisphereLight&&t++)}f=p;g=q;h=r;k=t;for(var x,y=0,H=0,F=b.length;H<F;H++){var A=b[H];A.castShadow&&(A instanceof THREE.SpotLight&&y++,A instanceof THREE.DirectionalLight&&!A.shadowCascade&&y++)}x=y;var C;if(Nb&&e&&e.skeleton&&e.skeleton.useVertexTexture)C=1024;else{var G=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),L=Math.floor((G-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(L=Math.min(e.skeleton.bones.length,L),L<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+
+e.skeleton.bones.length+", this GPU supports just "+L+" (try OpenGL instead of ANGLE)"));C=L}var K={precision:ga,supportsVertexTextures:Vb,map:!!d.map,envMap:!!d.envMap,lightMap:!!d.lightMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:X,skinning:d.skinning,maxBones:C,useVertexTexture:Nb&&e&&e.skeleton&&e.skeleton.useVertexTexture,
+morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:J.maxMorphTargets,maxMorphNormals:J.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:x,shadowMapEnabled:J.shadowMapEnabled&&e.receiveShadow&&0<x,shadowMapType:J.shadowMapType,shadowMapDebug:J.shadowMapDebug,shadowMapCascade:J.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},N=[];m?N.push(m):
+(N.push(d.fragmentShader),N.push(d.vertexShader));if(void 0!==d.defines)for(var O in d.defines)N.push(O),N.push(d.defines[O]);for(O in K)N.push(O),N.push(K[O]);for(var W=N.join(),pa,Ea=0,db=Xa.length;Ea<db;Ea++){var Fa=Xa[Ea];if(Fa.code===W){pa=Fa;pa.usedTimes++;break}}void 0===pa&&(pa=new THREE.WebGLProgram(J,W,d,K),Xa.push(pa),J.info.memory.programs=Xa.length);d.program=pa;var Ta=pa.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var aa,Ga="morphTarget",ya=0;ya<J.maxMorphTargets;ya++)aa=
+Ga+ya,0<=Ta[aa]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,Ga="morphNormal",ya=0;ya<J.maxMorphNormals;ya++)aa=Ga+ya,0<=Ta[aa]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var ea in d.__webglShader.uniforms){var tb=d.program.uniforms[ea];tb&&d.uniformsList.push([d.__webglShader.uniforms[ea],tb])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(J.maxMorphTargets));var qa=!1,eb=!1,xa=!1,wa=
+d.program,ha=wa.uniforms,P=d.__webglShader.uniforms;wa.id!==Wb&&(l.useProgram(wa.program),Wb=wa.id,xa=eb=qa=!0);d.id!==Hb&&(-1===Hb&&(xa=!0),Hb=d.id,eb=!0);if(qa||a!==Ib)l.uniformMatrix4fv(ha.projectionMatrix,!1,a.projectionMatrix.elements),X&&l.uniform1f(ha.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Ib&&(Ib=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==ha.cameraPosition&&(Ca.setFromMatrixPosition(a.matrixWorld),l.uniform3f(ha.cameraPosition,
 Ca.x,Ca.y,Ca.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==ha.viewMatrix&&l.uniformMatrix4fv(ha.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==ha.bindMatrix&&l.uniformMatrix4fv(ha.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==ha.bindMatrixInverse&&l.uniformMatrix4fv(ha.bindMatrixInverse,!1,e.bindMatrixInverse.elements),
-Nb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==ha.boneTexture){var Za=z();l.uniform1i(ha.boneTexture,Za);A.setTexture(e.skeleton.boneTexture,Za)}null!==ha.boneTextureWidth&&l.uniform1i(ha.boneTextureWidth,e.skeleton.boneTextureWidth);null!==ha.boneTextureHeight&&l.uniform1i(ha.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==ha.boneGlobalMatrices&&l.uniformMatrix4fv(ha.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(eb){c&&d.fog&&(O.fogColor.value=
-c.color,c instanceof THREE.Fog?(O.fogNear.value=c.near,O.fogFar.value=c.far):c instanceof THREE.FogExp2&&(O.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Ob){var xa=!0,fa,fb,Y,Ma=0,Sa=0,Ya=0,za,Ha,hb,na,$a,jb,la=nc,Na=la.directional.colors,Ua=la.directional.positions,mb=la.point.colors,kb=la.point.positions,sb=la.point.distances,Va=la.spot.colors,Ia=la.spot.positions,nb=la.spot.distances,Oa=la.spot.directions,ia=la.spot.anglesCos,
-ra=la.spot.exponents,I=la.hemi.skyColors,Aa=la.hemi.groundColors,ab=la.hemi.positions,wb=0,ob=0,Pa=0,Ba=0,bb=0,Ka=0,La=0,ib=0,xb=0,pb=0,B=0,cb=0;fa=0;for(fb=b.length;fa<fb;fa++)Y=b[fa],Y.onlyShadow||(za=Y.color,na=Y.intensity,jb=Y.distance,Y instanceof THREE.AmbientLight?Y.visible&&(A.gammaInput?(Ma+=za.r*za.r,Sa+=za.g*za.g,Ya+=za.b*za.b):(Ma+=za.r,Sa+=za.g,Ya+=za.b)):Y instanceof THREE.DirectionalLight?(bb+=1,Y.visible&&(ma.setFromMatrixPosition(Y.matrixWorld),Ca.setFromMatrixPosition(Y.target.matrixWorld),
-ma.sub(Ca),ma.normalize(),xb=3*wb,Ua[xb]=ma.x,Ua[xb+1]=ma.y,Ua[xb+2]=ma.z,A.gammaInput?D(Na,xb,za,na*na):w(Na,xb,za,na),wb+=1)):Y instanceof THREE.PointLight?(Ka+=1,Y.visible&&(pb=3*ob,A.gammaInput?D(mb,pb,za,na*na):w(mb,pb,za,na),Ca.setFromMatrixPosition(Y.matrixWorld),kb[pb]=Ca.x,kb[pb+1]=Ca.y,kb[pb+2]=Ca.z,sb[ob]=jb,ob+=1)):Y instanceof THREE.SpotLight?(La+=1,Y.visible&&(B=3*Pa,A.gammaInput?D(Va,B,za,na*na):w(Va,B,za,na),ma.setFromMatrixPosition(Y.matrixWorld),Ia[B]=ma.x,Ia[B+1]=ma.y,Ia[B+2]=ma.z,
-nb[Pa]=jb,Ca.setFromMatrixPosition(Y.target.matrixWorld),ma.sub(Ca),ma.normalize(),Oa[B]=ma.x,Oa[B+1]=ma.y,Oa[B+2]=ma.z,ia[Pa]=Math.cos(Y.angle),ra[Pa]=Y.exponent,Pa+=1)):Y instanceof THREE.HemisphereLight&&(ib+=1,Y.visible&&(ma.setFromMatrixPosition(Y.matrixWorld),ma.normalize(),cb=3*Ba,ab[cb]=ma.x,ab[cb+1]=ma.y,ab[cb+2]=ma.z,Ha=Y.color,hb=Y.groundColor,A.gammaInput?($a=na*na,D(I,cb,Ha,$a),D(Aa,cb,hb,$a)):(w(I,cb,Ha,na),w(Aa,cb,hb,na)),Ba+=1)));fa=3*wb;for(fb=Math.max(Na.length,3*bb);fa<fb;fa++)Na[fa]=
-0;fa=3*ob;for(fb=Math.max(mb.length,3*Ka);fa<fb;fa++)mb[fa]=0;fa=3*Pa;for(fb=Math.max(Va.length,3*La);fa<fb;fa++)Va[fa]=0;fa=3*Ba;for(fb=Math.max(I.length,3*ib);fa<fb;fa++)I[fa]=0;fa=3*Ba;for(fb=Math.max(Aa.length,3*ib);fa<fb;fa++)Aa[fa]=0;la.directional.length=wb;la.point.length=ob;la.spot.length=Pa;la.hemi.length=Ba;la.ambient[0]=Ma;la.ambient[1]=Sa;la.ambient[2]=Ya;Ob=!1}if(xa){var sa=nc;O.ambientLightColor.value=sa.ambient;O.directionalLightColor.value=sa.directional.colors;O.directionalLightDirection.value=
-sa.directional.positions;O.pointLightColor.value=sa.point.colors;O.pointLightPosition.value=sa.point.positions;O.pointLightDistance.value=sa.point.distances;O.spotLightColor.value=sa.spot.colors;O.spotLightPosition.value=sa.spot.positions;O.spotLightDistance.value=sa.spot.distances;O.spotLightDirection.value=sa.spot.directions;O.spotLightAngleCos.value=sa.spot.anglesCos;O.spotLightExponent.value=sa.spot.exponents;O.hemisphereLightSkyColor.value=sa.hemi.skyColors;O.hemisphereLightGroundColor.value=
-sa.hemi.groundColors;O.hemisphereLightDirection.value=sa.hemi.positions;F(O,!0)}else F(O,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){O.opacity.value=d.opacity;A.gammaInput?O.diffuse.value.copyGammaToLinear(d.color):O.diffuse.value=d.color;O.map.value=d.map;O.lightMap.value=d.lightMap;O.specularMap.value=d.specularMap;O.alphaMap.value=d.alphaMap;d.bumpMap&&(O.bumpMap.value=d.bumpMap,O.bumpScale.value=d.bumpScale);d.normalMap&&
-(O.normalMap.value=d.normalMap,O.normalScale.value.copy(d.normalScale));var oa;d.map?oa=d.map:d.specularMap?oa=d.specularMap:d.normalMap?oa=d.normalMap:d.bumpMap?oa=d.bumpMap:d.alphaMap&&(oa=d.alphaMap);if(void 0!==oa){var ub=oa.offset,zb=oa.repeat;O.offsetRepeat.value.set(ub.x,ub.y,zb.x,zb.y)}O.envMap.value=d.envMap;O.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;O.reflectivity.value=d.reflectivity;O.refractionRatio.value=d.refractionRatio;O.combine.value=d.combine;O.useRefract.value=
-d.envMap&&(d.envMap.mapping===THREE.CubeRefractionMapping||d.envMap.mapping===THREE.EquirectangularRefractionMapping)}d instanceof THREE.LineBasicMaterial?(O.diffuse.value=d.color,O.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(O.diffuse.value=d.color,O.opacity.value=d.opacity,O.dashSize.value=d.dashSize,O.totalSize.value=d.dashSize+d.gapSize,O.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(O.psColor.value=d.color,O.opacity.value=d.opacity,O.size.value=d.size,O.scale.value=
-Q.height/2,O.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(O.shininess.value=d.shininess,A.gammaInput?(O.ambient.value.copyGammaToLinear(d.ambient),O.emissive.value.copyGammaToLinear(d.emissive),O.specular.value.copyGammaToLinear(d.specular)):(O.ambient.value=d.ambient,O.emissive.value=d.emissive,O.specular.value=d.specular),d.wrapAround&&O.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(A.gammaInput?(O.ambient.value.copyGammaToLinear(d.ambient),O.emissive.value.copyGammaToLinear(d.emissive)):
-(O.ambient.value=d.ambient,O.emissive.value=d.emissive),d.wrapAround&&O.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(O.mNear.value=a.near,O.mFar.value=a.far,O.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(O.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&O.shadowMatrix)for(var Ab=0,vb=0,Xb=b.length;vb<Xb;vb++){var lb=b[vb];lb.castShadow&&(lb instanceof THREE.SpotLight||lb instanceof THREE.DirectionalLight&&!lb.shadowCascade)&&(O.shadowMap.value[Ab]=
-lb.shadowMap,O.shadowMapSize.value[Ab]=lb.shadowMapSize,O.shadowMatrix.value[Ab]=lb.shadowMatrix,O.shadowDarkness.value[Ab]=lb.shadowDarkness,O.shadowBias.value[Ab]=lb.shadowBias,Ab++)}for(var Cb=d.uniformsList,V,Ja,Wa,Db=0,Pb=Cb.length;Db<Pb;Db++){var $=Cb[Db][0];if(!1!==$.needsUpdate){var Eb=$.type,R=$.value,S=Cb[Db][1];switch(Eb){case "1i":l.uniform1i(S,R);break;case "1f":l.uniform1f(S,R);break;case "2f":l.uniform2f(S,R[0],R[1]);break;case "3f":l.uniform3f(S,R[0],R[1],R[2]);break;case "4f":l.uniform4f(S,
+Nb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==ha.boneTexture){var Za=z();l.uniform1i(ha.boneTexture,Za);J.setTexture(e.skeleton.boneTexture,Za)}null!==ha.boneTextureWidth&&l.uniform1i(ha.boneTextureWidth,e.skeleton.boneTextureWidth);null!==ha.boneTextureHeight&&l.uniform1i(ha.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==ha.boneGlobalMatrices&&l.uniformMatrix4fv(ha.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(eb){c&&d.fog&&(P.fogColor.value=
+c.color,c instanceof THREE.Fog?(P.fogNear.value=c.near,P.fogFar.value=c.far):c instanceof THREE.FogExp2&&(P.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Ob){var xa=!0,fa,fb,Y,Ma=0,Sa=0,Ya=0,za,Ha,hb,na,$a,jb,la=nc,Na=la.directional.colors,Ua=la.directional.positions,mb=la.point.colors,kb=la.point.positions,sb=la.point.distances,Va=la.spot.colors,Ia=la.spot.positions,nb=la.spot.distances,Oa=la.spot.directions,ia=la.spot.anglesCos,
+ra=la.spot.exponents,I=la.hemi.skyColors,Aa=la.hemi.groundColors,ab=la.hemi.positions,wb=0,ob=0,Pa=0,Ba=0,bb=0,Ka=0,La=0,ib=0,xb=0,pb=0,B=0,cb=0;fa=0;for(fb=b.length;fa<fb;fa++)Y=b[fa],Y.onlyShadow||(za=Y.color,na=Y.intensity,jb=Y.distance,Y instanceof THREE.AmbientLight?Y.visible&&(J.gammaInput?(Ma+=za.r*za.r,Sa+=za.g*za.g,Ya+=za.b*za.b):(Ma+=za.r,Sa+=za.g,Ya+=za.b)):Y instanceof THREE.DirectionalLight?(bb+=1,Y.visible&&(ma.setFromMatrixPosition(Y.matrixWorld),Ca.setFromMatrixPosition(Y.target.matrixWorld),
+ma.sub(Ca),ma.normalize(),xb=3*wb,Ua[xb]=ma.x,Ua[xb+1]=ma.y,Ua[xb+2]=ma.z,J.gammaInput?D(Na,xb,za,na*na):w(Na,xb,za,na),wb+=1)):Y instanceof THREE.PointLight?(Ka+=1,Y.visible&&(pb=3*ob,J.gammaInput?D(mb,pb,za,na*na):w(mb,pb,za,na),Ca.setFromMatrixPosition(Y.matrixWorld),kb[pb]=Ca.x,kb[pb+1]=Ca.y,kb[pb+2]=Ca.z,sb[ob]=jb,ob+=1)):Y instanceof THREE.SpotLight?(La+=1,Y.visible&&(B=3*Pa,J.gammaInput?D(Va,B,za,na*na):w(Va,B,za,na),ma.setFromMatrixPosition(Y.matrixWorld),Ia[B]=ma.x,Ia[B+1]=ma.y,Ia[B+2]=ma.z,
+nb[Pa]=jb,Ca.setFromMatrixPosition(Y.target.matrixWorld),ma.sub(Ca),ma.normalize(),Oa[B]=ma.x,Oa[B+1]=ma.y,Oa[B+2]=ma.z,ia[Pa]=Math.cos(Y.angle),ra[Pa]=Y.exponent,Pa+=1)):Y instanceof THREE.HemisphereLight&&(ib+=1,Y.visible&&(ma.setFromMatrixPosition(Y.matrixWorld),ma.normalize(),cb=3*Ba,ab[cb]=ma.x,ab[cb+1]=ma.y,ab[cb+2]=ma.z,Ha=Y.color,hb=Y.groundColor,J.gammaInput?($a=na*na,D(I,cb,Ha,$a),D(Aa,cb,hb,$a)):(w(I,cb,Ha,na),w(Aa,cb,hb,na)),Ba+=1)));fa=3*wb;for(fb=Math.max(Na.length,3*bb);fa<fb;fa++)Na[fa]=
+0;fa=3*ob;for(fb=Math.max(mb.length,3*Ka);fa<fb;fa++)mb[fa]=0;fa=3*Pa;for(fb=Math.max(Va.length,3*La);fa<fb;fa++)Va[fa]=0;fa=3*Ba;for(fb=Math.max(I.length,3*ib);fa<fb;fa++)I[fa]=0;fa=3*Ba;for(fb=Math.max(Aa.length,3*ib);fa<fb;fa++)Aa[fa]=0;la.directional.length=wb;la.point.length=ob;la.spot.length=Pa;la.hemi.length=Ba;la.ambient[0]=Ma;la.ambient[1]=Sa;la.ambient[2]=Ya;Ob=!1}if(xa){var sa=nc;P.ambientLightColor.value=sa.ambient;P.directionalLightColor.value=sa.directional.colors;P.directionalLightDirection.value=
+sa.directional.positions;P.pointLightColor.value=sa.point.colors;P.pointLightPosition.value=sa.point.positions;P.pointLightDistance.value=sa.point.distances;P.spotLightColor.value=sa.spot.colors;P.spotLightPosition.value=sa.spot.positions;P.spotLightDistance.value=sa.spot.distances;P.spotLightDirection.value=sa.spot.directions;P.spotLightAngleCos.value=sa.spot.anglesCos;P.spotLightExponent.value=sa.spot.exponents;P.hemisphereLightSkyColor.value=sa.hemi.skyColors;P.hemisphereLightGroundColor.value=
+sa.hemi.groundColors;P.hemisphereLightDirection.value=sa.hemi.positions;E(P,!0)}else E(P,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){P.opacity.value=d.opacity;J.gammaInput?P.diffuse.value.copyGammaToLinear(d.color):P.diffuse.value=d.color;P.map.value=d.map;P.lightMap.value=d.lightMap;P.specularMap.value=d.specularMap;P.alphaMap.value=d.alphaMap;d.bumpMap&&(P.bumpMap.value=d.bumpMap,P.bumpScale.value=d.bumpScale);d.normalMap&&
+(P.normalMap.value=d.normalMap,P.normalScale.value.copy(d.normalScale));var oa;d.map?oa=d.map:d.specularMap?oa=d.specularMap:d.normalMap?oa=d.normalMap:d.bumpMap?oa=d.bumpMap:d.alphaMap&&(oa=d.alphaMap);if(void 0!==oa){var ub=oa.offset,zb=oa.repeat;P.offsetRepeat.value.set(ub.x,ub.y,zb.x,zb.y)}P.envMap.value=d.envMap;P.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;P.reflectivity.value=d.reflectivity;P.refractionRatio.value=d.refractionRatio;P.combine.value=d.combine;P.useRefract.value=
+d.envMap&&(d.envMap.mapping===THREE.CubeRefractionMapping||d.envMap.mapping===THREE.EquirectangularRefractionMapping)}d instanceof THREE.LineBasicMaterial?(P.diffuse.value=d.color,P.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(P.diffuse.value=d.color,P.opacity.value=d.opacity,P.dashSize.value=d.dashSize,P.totalSize.value=d.dashSize+d.gapSize,P.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(P.psColor.value=d.color,P.opacity.value=d.opacity,P.size.value=d.size,P.scale.value=
+Q.height/2,P.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(P.shininess.value=d.shininess,J.gammaInput?(P.ambient.value.copyGammaToLinear(d.ambient),P.emissive.value.copyGammaToLinear(d.emissive),P.specular.value.copyGammaToLinear(d.specular)):(P.ambient.value=d.ambient,P.emissive.value=d.emissive,P.specular.value=d.specular),d.wrapAround&&P.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(J.gammaInput?(P.ambient.value.copyGammaToLinear(d.ambient),P.emissive.value.copyGammaToLinear(d.emissive)):
+(P.ambient.value=d.ambient,P.emissive.value=d.emissive),d.wrapAround&&P.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(P.mNear.value=a.near,P.mFar.value=a.far,P.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(P.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&P.shadowMatrix)for(var Ab=0,vb=0,Xb=b.length;vb<Xb;vb++){var lb=b[vb];lb.castShadow&&(lb instanceof THREE.SpotLight||lb instanceof THREE.DirectionalLight&&!lb.shadowCascade)&&(P.shadowMap.value[Ab]=
+lb.shadowMap,P.shadowMapSize.value[Ab]=lb.shadowMapSize,P.shadowMatrix.value[Ab]=lb.shadowMatrix,P.shadowDarkness.value[Ab]=lb.shadowDarkness,P.shadowBias.value[Ab]=lb.shadowBias,Ab++)}for(var Cb=d.uniformsList,V,Ja,Wa,Db=0,Pb=Cb.length;Db<Pb;Db++){var $=Cb[Db][0];if(!1!==$.needsUpdate){var Eb=$.type,R=$.value,S=Cb[Db][1];switch(Eb){case "1i":l.uniform1i(S,R);break;case "1f":l.uniform1f(S,R);break;case "2f":l.uniform2f(S,R[0],R[1]);break;case "3f":l.uniform3f(S,R[0],R[1],R[2]);break;case "4f":l.uniform4f(S,
 R[0],R[1],R[2],R[3]);break;case "1iv":l.uniform1iv(S,R);break;case "3iv":l.uniform3iv(S,R);break;case "1fv":l.uniform1fv(S,R);break;case "2fv":l.uniform2fv(S,R);break;case "3fv":l.uniform3fv(S,R);break;case "4fv":l.uniform4fv(S,R);break;case "Matrix3fv":l.uniformMatrix3fv(S,!1,R);break;case "Matrix4fv":l.uniformMatrix4fv(S,!1,R);break;case "i":l.uniform1i(S,R);break;case "f":l.uniform1f(S,R);break;case "v2":l.uniform2f(S,R.x,R.y);break;case "v3":l.uniform3f(S,R.x,R.y,R.z);break;case "v4":l.uniform4f(S,
 R.x,R.y,R.z,R.w);break;case "c":l.uniform3f(S,R.r,R.g,R.b);break;case "iv1":l.uniform1iv(S,R);break;case "iv":l.uniform3iv(S,R);break;case "fv1":l.uniform1fv(S,R);break;case "fv":l.uniform3fv(S,R);break;case "v2v":void 0===$._array&&($._array=new Float32Array(2*R.length));for(var Z=0,Da=R.length;Z<Da;Z++)Wa=2*Z,$._array[Wa]=R[Z].x,$._array[Wa+1]=R[Z].y;l.uniform2fv(S,$._array);break;case "v3v":void 0===$._array&&($._array=new Float32Array(3*R.length));Z=0;for(Da=R.length;Z<Da;Z++)Wa=3*Z,$._array[Wa]=
 R[Z].x,$._array[Wa+1]=R[Z].y,$._array[Wa+2]=R[Z].z;l.uniform3fv(S,$._array);break;case "v4v":void 0===$._array&&($._array=new Float32Array(4*R.length));Z=0;for(Da=R.length;Z<Da;Z++)Wa=4*Z,$._array[Wa]=R[Z].x,$._array[Wa+1]=R[Z].y,$._array[Wa+2]=R[Z].z,$._array[Wa+3]=R[Z].w;l.uniform4fv(S,$._array);break;case "m3":l.uniformMatrix3fv(S,!1,R.elements);break;case "m3v":void 0===$._array&&($._array=new Float32Array(9*R.length));Z=0;for(Da=R.length;Z<Da;Z++)R[Z].flattenToArrayOffset($._array,9*Z);l.uniformMatrix3fv(S,
 !1,$._array);break;case "m4":l.uniformMatrix4fv(S,!1,R.elements);break;case "m4v":void 0===$._array&&($._array=new Float32Array(16*R.length));Z=0;for(Da=R.length;Z<Da;Z++)R[Z].flattenToArrayOffset($._array,16*Z);l.uniformMatrix4fv(S,!1,$._array);break;case "t":V=R;Ja=z();l.uniform1i(S,Ja);if(!V)continue;if(V instanceof THREE.CubeTexture||V.image instanceof Array&&6===V.image.length){var ka=V,Bb=Ja;if(6===ka.image.length)if(ka.needsUpdate){ka.image.__webglTextureCube||(ka.addEventListener("dispose",
-Jb),ka.image.__webglTextureCube=l.createTexture(),A.info.memory.textures++);l.activeTexture(l.TEXTURE0+Bb);l.bindTexture(l.TEXTURE_CUBE_MAP,ka.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,ka.flipY);for(var Fb=ka instanceof THREE.CompressedTexture,ba=ka.image[0]instanceof THREE.DataTexture,gb=[],ta=0;6>ta;ta++)gb[ta]=!A.autoScaleCubemaps||Fb||ba?ba?ka.image[ta].image:ka.image[ta]:M(ka.image[ta],Dc);var Qb=gb[0],Rb=THREE.Math.isPowerOfTwo(Qb.width)&&THREE.Math.isPowerOfTwo(Qb.height),
+Jb),ka.image.__webglTextureCube=l.createTexture(),J.info.memory.textures++);l.activeTexture(l.TEXTURE0+Bb);l.bindTexture(l.TEXTURE_CUBE_MAP,ka.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,ka.flipY);for(var Fb=ka instanceof THREE.CompressedTexture,ba=ka.image[0]instanceof THREE.DataTexture,gb=[],ta=0;6>ta;ta++)gb[ta]=!J.autoScaleCubemaps||Fb||ba?ba?ka.image[ta].image:ka.image[ta]:M(ka.image[ta],Dc);var Qb=gb[0],Rb=THREE.Math.isPowerOfTwo(Qb.width)&&THREE.Math.isPowerOfTwo(Qb.height),
 qb=T(ka.format),Sb=T(ka.type);U(l.TEXTURE_CUBE_MAP,ka,Rb);for(ta=0;6>ta;ta++)if(Fb)for(var yb,Gb=gb[ta].mipmaps,rb=0,Yb=Gb.length;rb<Yb;rb++)yb=Gb[rb],ka.format!==THREE.RGBAFormat&&ka.format!==THREE.RGBFormat?-1<oc().indexOf(qb)?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ta,rb,qb,yb.width,yb.height,0,yb.data):console.warn("Attempt to load unsupported compressed texture format"):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ta,rb,qb,yb.width,yb.height,0,qb,Sb,yb.data);else ba?l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+
-ta,0,qb,gb[ta].width,gb[ta].height,0,qb,Sb,gb[ta].data):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ta,0,qb,qb,Sb,gb[ta]);ka.generateMipmaps&&Rb&&l.generateMipmap(l.TEXTURE_CUBE_MAP);ka.needsUpdate=!1;if(ka.onUpdate)ka.onUpdate()}else l.activeTexture(l.TEXTURE0+Bb),l.bindTexture(l.TEXTURE_CUBE_MAP,ka.image.__webglTextureCube)}else if(V instanceof THREE.WebGLRenderTargetCube){var Zb=V;l.activeTexture(l.TEXTURE0+Ja);l.bindTexture(l.TEXTURE_CUBE_MAP,Zb.__webglTexture)}else A.setTexture(V,Ja);break;case "tv":void 0===
-$._array&&($._array=[]);Z=0;for(Da=$.value.length;Z<Da;Z++)$._array[Z]=z();l.uniform1iv(S,$._array);Z=0;for(Da=$.value.length;Z<Da;Z++)V=$.value[Z],Ja=$._array[Z],V&&A.setTexture(V,Ja);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Eb)}}}}l.uniformMatrix4fv(ha.modelViewMatrix,!1,e._modelViewMatrix.elements);ha.normalMatrix&&l.uniformMatrix3fv(ha.normalMatrix,!1,e._normalMatrix.elements);null!==ha.modelMatrix&&l.uniformMatrix4fv(ha.modelMatrix,!1,e.matrixWorld.elements);return wa}
-function F(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=
-b;a.hemisphereLightDirection.needsUpdate=b}function z(){var a=Mb;a>=pc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+pc);Mb+=1;return a}function G(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function D(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 w(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!==qc&&(l.lineWidth(a),qc=a)}function J(a,
+ta,0,qb,gb[ta].width,gb[ta].height,0,qb,Sb,gb[ta].data):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ta,0,qb,qb,Sb,gb[ta]);ka.generateMipmaps&&Rb&&l.generateMipmap(l.TEXTURE_CUBE_MAP);ka.needsUpdate=!1;if(ka.onUpdate)ka.onUpdate()}else l.activeTexture(l.TEXTURE0+Bb),l.bindTexture(l.TEXTURE_CUBE_MAP,ka.image.__webglTextureCube)}else if(V instanceof THREE.WebGLRenderTargetCube){var Zb=V;l.activeTexture(l.TEXTURE0+Ja);l.bindTexture(l.TEXTURE_CUBE_MAP,Zb.__webglTexture)}else J.setTexture(V,Ja);break;case "tv":void 0===
+$._array&&($._array=[]);Z=0;for(Da=$.value.length;Z<Da;Z++)$._array[Z]=z();l.uniform1iv(S,$._array);Z=0;for(Da=$.value.length;Z<Da;Z++)V=$.value[Z],Ja=$._array[Z],V&&J.setTexture(V,Ja);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Eb)}}}}l.uniformMatrix4fv(ha.modelViewMatrix,!1,e._modelViewMatrix.elements);ha.normalMatrix&&l.uniformMatrix3fv(ha.normalMatrix,!1,e._normalMatrix.elements);null!==ha.modelMatrix&&l.uniformMatrix4fv(ha.modelMatrix,!1,e.matrixWorld.elements);return wa}
+function E(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=
+b;a.hemisphereLightDirection.needsUpdate=b}function z(){var a=Mb;a>=pc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+pc);Mb+=1;return a}function F(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function D(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 w(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*=O;a!==qc&&(l.lineWidth(a),qc=a)}function A(a,
 b,c){rc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),rc=a);!a||sc===b&&tc===c||(l.polygonOffset(b,c),sc=b,tc=c)}function U(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,T(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,T(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,T(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,T(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&
 b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT is set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),l.texParameteri(a,l.TEXTURE_MAG_FILTER,N(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,N(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( "+
-b.sourceFile+" )"));(c=aa.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(l.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,A.getMaxAnisotropy())),b.__oldAnisotropy=b.anisotropy)}function M(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);
+b.sourceFile+" )"));(c=aa.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(l.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,J.getMaxAnisotropy())),b.__oldAnisotropy=b.anisotropy)}function M(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);
 console.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+".");return d}return a}function K(a,b){l.bindRenderbuffer(l.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,
 l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function L(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function N(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?
 l.NEAREST:l.LINEAR}function T(a){var b;if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;if(a===
@@ -520,33 +520,33 @@ THREE.LinearMipMapLinearFilter)return l.LINEAR_MIPMAP_LINEAR;if(a===THREE.Unsign
 if(a===THREE.FloatType)return l.FLOAT;if(a===THREE.AlphaFormat)return l.ALPHA;if(a===THREE.RGBFormat)return l.RGB;if(a===THREE.RGBAFormat)return l.RGBA;if(a===THREE.LuminanceFormat)return l.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return l.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return l.FUNC_ADD;if(a===THREE.SubtractEquation)return l.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return l.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return l.ZERO;if(a===THREE.OneFactor)return l.ONE;if(a===
 THREE.SrcColorFactor)return l.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return l.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return l.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return l.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return l.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return l.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return l.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return l.SRC_ALPHA_SATURATE;
 b=aa.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=aa.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
-if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=aa.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var Q=void 0!==a.canvas?a.canvas:document.createElement("canvas"),W=void 0!==a.context?a.context:null,P=1,ga=void 0!==a.precision?a.precision:"highp",
-ea=void 0!==a.alpha?a.alpha:!1,wa=void 0!==a.depth?a.depth:!0,E=void 0!==a.stencil?a.stencil:!0,Za=void 0!==a.antialias?a.antialias:!1,qa=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,xa=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,X=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,Ea=new THREE.Color(0),db=0,pa=[],Fa={},Ga=[],Ta=[],ya=[],tb=[],eb=[];this.domElement=Q;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=
-this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var A=this,Xa=[],Wb=null,uc=null,Hb=-1,Sa=-1,Ib=null,Mb=0,zb=-1,Xb=-1,Yb=-1,Zb=-1,ec=-1,fc=-1,gc=-1,hc=-1,rc=null,sc=null,tc=null,
+if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=aa.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var Q=void 0!==a.canvas?a.canvas:document.createElement("canvas"),W=void 0!==a.context?a.context:null,O=1,ga=void 0!==a.precision?a.precision:"highp",
+ea=void 0!==a.alpha?a.alpha:!1,wa=void 0!==a.depth?a.depth:!0,G=void 0!==a.stencil?a.stencil:!0,Za=void 0!==a.antialias?a.antialias:!1,qa=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,xa=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,X=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,Ea=new THREE.Color(0),db=0,pa=[],Fa={},Ga=[],Ta=[],ya=[],tb=[],eb=[];this.domElement=Q;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=
+this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var J=this,Xa=[],Wb=null,uc=null,Hb=-1,Sa=-1,Ib=null,Mb=0,zb=-1,Xb=-1,Yb=-1,Zb=-1,ec=-1,fc=-1,gc=-1,hc=-1,rc=null,sc=null,tc=null,
 qc=null,hb=0,Ya=0,ib=Q.width,jb=Q.height,vc=0,wc=0,kb=new Uint8Array(16),Ma=new Uint8Array(16),ub=new THREE.Frustum,vb=new THREE.Matrix4;new THREE.Matrix4;var Ca=new THREE.Vector3,ma=new THREE.Vector3,Ob=!0,nc={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:[]}},l;try{var xc={alpha:ea,depth:wa,
-stencil:E,antialias:Za,premultipliedAlpha:qa,preserveDrawingBuffer:xa};l=W||Q.getContext("webgl",xc)||Q.getContext("experimental-webgl",xc);if(null===l){if(null!==Q.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}Q.addEventListener("webglcontextlost",function(a){a.preventDefault();yc();zc();Fa={}},!1)}catch(Ec){console.error(Ec)}void 0===l.getShaderPrecisionFormat&&(l.getShaderPrecisionFormat=function(){return{rangeMin:1,
+stencil:G,antialias:Za,premultipliedAlpha:qa,preserveDrawingBuffer:xa};l=W||Q.getContext("webgl",xc)||Q.getContext("experimental-webgl",xc);if(null===l){if(null!==Q.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}Q.addEventListener("webglcontextlost",function(a){a.preventDefault();yc();zc();Fa={}},!1)}catch(Ec){console.error(Ec)}void 0===l.getShaderPrecisionFormat&&(l.getShaderPrecisionFormat=function(){return{rangeMin:1,
 rangeMax:1,precision:1}});var aa=new THREE.WebGLExtensions(l);aa.get("OES_texture_float");aa.get("OES_texture_float_linear");aa.get("OES_standard_derivatives");X&&aa.get("EXT_frag_depth");var zc=function(){l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(hb,Ya,ib,jb);l.clearColor(Ea.r,
 Ea.g,Ea.b,db)},yc=function(){Ib=Wb=null;Hb=Sa=Xb=zb=hc=gc=Yb=-1;Ob=!0;for(var a=0;a<Ma.length;a++)Ma[a]=0};zc();this.context=l;var pc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Fc=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Gc=l.getParameter(l.MAX_TEXTURE_SIZE),Dc=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),Vb=0<Fc,Nb=Vb&&aa.get("OES_texture_float"),Hc=l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.HIGH_FLOAT),Ic=l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.VERTEX_SHADER,
 l.LOW_FLOAT);var Jc=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT),Kc=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT);var oc=function(){var a;return function(){if(void 0!==a)return a;a=[];if(aa.get("WEBGL_compressed_texture_pvrtc")||aa.get("WEBGL_compressed_texture_s3tc"))for(var b=l.getParameter(l.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),Lc=0<Hc.precision&&0<Jc.precision,Ac=0<Ic.precision&&
 0<Kc.precision;"highp"!==ga||Lc||(Ac?(ga="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(ga="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==ga||Ac||(ga="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Mc=new THREE.ShadowMapPlugin(this,pa,Fa,Ga),Nc=new THREE.SpritePlugin(this,tb),Oc=new THREE.LensFlarePlugin(this,eb);this.getContext=function(){return l};this.forceContextLoss=
 function(){aa.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return Vb};this.supportsFloatTextures=function(){return aa.get("OES_texture_float")};this.supportsStandardDerivatives=function(){return aa.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return aa.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return aa.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return aa.get("EXT_blend_minmax")};
-this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=aa.get("EXT_texture_filter_anisotropic");return a=null!==b?l.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return ga};this.getPixelRatio=function(){return P};this.setPixelRatio=function(a){P=a};this.setSize=function(a,b,c){Q.width=a*P;Q.height=b*P;!1!==c&&(Q.style.width=a+"px",Q.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){hb=a*P;Ya=b*P;ib=
-c*P;jb=d*P;l.viewport(hb,Ya,ib,jb)};this.setScissor=function(a,b,c,d){l.scissor(a*P,b*P,c*P,d*P)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.setClearColor=function(a,b){Ea.set(a);db=void 0!==b?b:1;l.clearColor(Ea.r,Ea.g,Ea.b,db)};this.setClearColorHex=function(a,b){console.warn("THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return Ea};this.getClearAlpha=
+this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=aa.get("EXT_texture_filter_anisotropic");return a=null!==b?l.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return ga};this.getPixelRatio=function(){return O};this.setPixelRatio=function(a){O=a};this.setSize=function(a,b,c){Q.width=a*O;Q.height=b*O;!1!==c&&(Q.style.width=a+"px",Q.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){hb=a*O;Ya=b*O;ib=
+c*O;jb=d*O;l.viewport(hb,Ya,ib,jb)};this.setScissor=function(a,b,c,d){l.scissor(a*O,b*O,c*O,d*O)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.setClearColor=function(a,b){Ea.set(a);db=void 0!==b?b:1;l.clearColor(Ea.r,Ea.g,Ea.b,db)};this.setClearColorHex=function(a,b){console.warn("THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return Ea};this.getClearAlpha=
 function(){return db};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=l.COLOR_BUFFER_BIT;if(void 0===b||b)d|=l.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};this.clearColor=function(){l.clear(l.COLOR_BUFFER_BIT)};this.clearDepth=function(){l.clear(l.DEPTH_BUFFER_BIT)};this.clearStencil=function(){l.clear(l.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=yc;var ic=function(a){a.target.traverse(function(a){a.removeEventListener("remove",
 ic);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete Fa[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=Ga,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})},jc=function(a){a=a.target;a.removeEventListener("dispose",jc);delete a.__webglInit;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];
-void 0!==c.buffer&&(l.deleteBuffer(c.buffer),delete c.buffer)}A.info.memory.geometries--}else if(b=sb[a.id],void 0!==b){for(var c=0,d=b.length;c<d;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=0,g=e.numMorphTargets;f<g;f++)l.deleteBuffer(e.__webglMorphTargetsBuffers[f]);delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)l.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}Bc(e)}delete sb[a.id]}else Bc(a);
-Sa=-1},Jb=function(a){a=a.target;a.removeEventListener("dispose",Jb);a.image&&a.image.__webglTextureCube?(l.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(l.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);A.info.memory.textures--},Cc=function(a){a=a.target;a.removeEventListener("dispose",Cc);if(a&&void 0!==a.__webglTexture){l.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=
-0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}A.info.memory.textures--},mc=function(a){a=a.target;a.removeEventListener("dispose",mc);lc(a)},Bc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),
-c=0,d=b.length;c<d;c++){var e=b[c];void 0!==a[e]&&(l.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)l.deleteBuffer(a.__webglCustomAttributesList[e].buffer);delete a.__webglCustomAttributesList}A.info.memory.geometries--},lc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Xa.length;a<c;a++)if(d=Xa[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=Xa.length;a<
-c;a++)d=Xa[a],d.program!==b&&e.push(d);Xa=e;l.deleteProgram(b);A.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){f();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=l.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=l.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=l.createBuffer());a.hasPositions&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),
+void 0!==c.buffer&&(l.deleteBuffer(c.buffer),delete c.buffer)}J.info.memory.geometries--}else if(b=sb[a.id],void 0!==b){for(var c=0,d=b.length;c<d;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=0,g=e.numMorphTargets;f<g;f++)l.deleteBuffer(e.__webglMorphTargetsBuffers[f]);delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)l.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}Bc(e)}delete sb[a.id]}else Bc(a);
+Sa=-1},Jb=function(a){a=a.target;a.removeEventListener("dispose",Jb);a.image&&a.image.__webglTextureCube?(l.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(l.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);J.info.memory.textures--},Cc=function(a){a=a.target;a.removeEventListener("dispose",Cc);if(a&&void 0!==a.__webglTexture){l.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=
+0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}J.info.memory.textures--},mc=function(a){a=a.target;a.removeEventListener("dispose",mc);lc(a)},Bc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),
+c=0,d=b.length;c<d;c++){var e=b[c];void 0!==a[e]&&(l.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)l.deleteBuffer(a.__webglCustomAttributesList[e].buffer);delete a.__webglCustomAttributesList}J.info.memory.geometries--},lc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Xa.length;a<c;a++)if(d=Xa[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=Xa.length;a<
+c;a++)d=Xa[a],d.program!==b&&e.push(d);Xa=e;l.deleteProgram(b);J.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){f();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=l.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=l.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=l.createBuffer());a.hasPositions&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),
 l.bufferData(l.ARRAY_BUFFER,a.positionArray,l.DYNAMIC_DRAW),g(b.attributes.position),l.vertexAttribPointer(b.attributes.position,3,l.FLOAT,!1,0,0));if(a.hasNormals){l.bindBuffer(l.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,k,m,n,p,q,r,t,s,v,u=3*a.count;for(v=0;v<u;v+=9)s=a.normalArray,d=s[v],e=s[v+1],k=s[v+2],m=s[v+3],p=s[v+4],r=s[v+5],n=s[v+6],q=s[v+7],t=s[v+8],d=(d+m+n)/3,e=(e+p+q)/3,k=(k+r+t)/3,s[v]=d,s[v+1]=e,s[v+2]=k,s[v+3]=d,s[v+4]=e,s[v+5]=k,s[v+6]=d,s[v+
 7]=e,s[v+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);g(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),l.bufferData(l.ARRAY_BUFFER,a.uvArray,l.DYNAMIC_DRAW),g(b.attributes.uv),l.vertexAttribPointer(b.attributes.uv,2,l.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,a.colorArray,l.DYNAMIC_DRAW),
 g(b.attributes.color),l.vertexAttribPointer(b.attributes.color,3,l.FLOAT,!1,0,0));h();l.drawArrays(l.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,g,h){if(!1!==d.visible)if(v(h),a=x(a,b,c,d,h),b=!1,c=16777215*g.id+2*a.id+(d.wireframe?1:0),c!==Sa&&(Sa=c,b=!0),b&&f(),h instanceof THREE.Mesh)if(h=!0===d.wireframe?l.LINES:l.TRIANGLES,c=g.attributes.index){var k,m;c.array instanceof Uint32Array&&aa.get("OES_element_index_uint")?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2);
-var n=g.offsets;if(0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),A.info.render.calls++,A.info.render.vertices+=c.array.length,A.info.render.faces+=c.array.length/3;else{b=!0;for(var p=0,q=n.length;p<q;p++){var s=n[p].index;b&&(e(d,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer));l.drawElements(h,n[p].count,k,n[p].start*m);A.info.render.calls++;A.info.render.vertices+=n[p].count;A.info.render.faces+=n[p].count/3}}}else b&&e(d,a,
-g,0),d=g.attributes.position,l.drawArrays(h,0,d.array.length/3),A.info.render.calls++,A.info.render.vertices+=d.array.length/3,A.info.render.faces+=d.array.length/9;else if(h instanceof THREE.PointCloud)if(h=l.POINTS,c=g.attributes.index)if(c.array instanceof Uint32Array&&aa.get("OES_element_index_uint")?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=g.offsets,0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),A.info.render.calls++,A.info.render.points+=
-c.array.length;else for(1<n.length&&(b=!0),p=0,q=n.length;p<q;p++)s=n[p].index,b&&(e(d,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),A.info.render.calls++,A.info.render.points+=n[p].count;else b&&e(d,a,g,0),d=g.attributes.position,l.drawArrays(h,0,d.array.length/3),A.info.render.calls++,A.info.render.points+=d.array.length/3;else if(h instanceof THREE.Line)if(h=h.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,C(d.linewidth),c=g.attributes.index)if(c.array instanceof
-Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=g.offsets,0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),A.info.render.calls++,A.info.render.vertices+=c.array.length;else for(1<n.length&&(b=!0),p=0,q=n.length;p<q;p++)s=n[p].index,b&&(e(d,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),A.info.render.calls++,A.info.render.vertices+=n[p].count;else b&&e(d,a,g,0),d=g.attributes.position,
-l.drawArrays(h,0,d.array.length/3),A.info.render.calls++,A.info.render.points+=d.array.length/3};this.renderBuffer=function(a,b,c,d,e,k){if(!1!==d.visible){v(k);c=x(a,b,c,d,k);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==Sa&&(Sa=c,a=!0);a&&f();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),g(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?
+var n=g.offsets;if(0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),J.info.render.calls++,J.info.render.vertices+=c.array.length,J.info.render.faces+=c.array.length/3;else{b=!0;for(var p=0,q=n.length;p<q;p++){var s=n[p].index;b&&(e(d,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer));l.drawElements(h,n[p].count,k,n[p].start*m);J.info.render.calls++;J.info.render.vertices+=n[p].count;J.info.render.faces+=n[p].count/3}}}else b&&e(d,a,
+g,0),d=g.attributes.position,l.drawArrays(h,0,d.array.length/3),J.info.render.calls++,J.info.render.vertices+=d.array.length/3,J.info.render.faces+=d.array.length/9;else if(h instanceof THREE.PointCloud)if(h=l.POINTS,c=g.attributes.index)if(c.array instanceof Uint32Array&&aa.get("OES_element_index_uint")?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=g.offsets,0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),J.info.render.calls++,J.info.render.points+=
+c.array.length;else for(1<n.length&&(b=!0),p=0,q=n.length;p<q;p++)s=n[p].index,b&&(e(d,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),J.info.render.calls++,J.info.render.points+=n[p].count;else b&&e(d,a,g,0),d=g.attributes.position,l.drawArrays(h,0,d.array.length/3),J.info.render.calls++,J.info.render.points+=d.array.length/3;else if(h instanceof THREE.Line)if(h=h.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,C(d.linewidth),c=g.attributes.index)if(c.array instanceof
+Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=g.offsets,0===n.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),J.info.render.calls++,J.info.render.vertices+=c.array.length;else for(1<n.length&&(b=!0),p=0,q=n.length;p<q;p++)s=n[p].index,b&&(e(d,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),J.info.render.calls++,J.info.render.vertices+=n[p].count;else b&&e(d,a,g,0),d=g.attributes.position,
+l.drawArrays(h,0,d.array.length/3),J.info.render.calls++,J.info.render.points+=d.array.length/3};this.renderBuffer=function(a,b,c,d,e,k){if(!1!==d.visible){v(k);c=x(a,b,c,d,k);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==Sa&&(Sa=c,a=!0);a&&f();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),g(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?
 (l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k.morphTargetBase]),g(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),g(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length)for(var m=0,n=k.morphTargetForcedOrder,q=k.morphTargetInfluences;m<d.numSupportedMorphTargets&&m<n.length;)0<=c["morphTarget"+m]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[n[m]]),
 g(c["morphTarget"+m]),l.vertexAttribPointer(c["morphTarget"+m],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[n[m]]),g(c["morphNormal"+m]),l.vertexAttribPointer(c["morphNormal"+m],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[m]=q[n[m]],m++;else{var n=[],q=k.morphTargetInfluences,s,r=q.length;for(s=0;s<r;s++)m=q[s],0<m&&n.push([m,s]);n.length>d.numSupportedMorphTargets?(n.sort(p),n.length=d.numSupportedMorphTargets):n.length>
 d.numSupportedMorphNormals?n.sort(p):0===n.length&&n.push([0,0]);for(m=0;m<d.numSupportedMorphTargets;)n[m]?(s=n[m][1],0<=c["morphTarget"+m]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[s]),g(c["morphTarget"+m]),l.vertexAttribPointer(c["morphTarget"+m],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[s]),g(c["morphNormal"+m]),l.vertexAttribPointer(c["morphNormal"+m],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[m]=
@@ -554,18 +554,18 @@ q[s]):k.__webglMorphTargetInfluences[m]=0,m++}null!==d.program.uniforms.morphTar
 (0<k.geometry.colors.length||0<k.geometry.faces.length?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglColorBuffer),g(b.color),l.vertexAttribPointer(b.color,3,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglNormalBuffer),g(b.normal),l.vertexAttribPointer(b.normal,3,l.FLOAT,!1,0,0));0<=b.tangent&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglTangentBuffer),g(b.tangent),l.vertexAttribPointer(b.tangent,4,
 l.FLOAT,!1,0,0));0<=b.uv&&(k.geometry.faceVertexUvs[0]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUVBuffer),g(b.uv),l.vertexAttribPointer(b.uv,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(k.geometry.faceVertexUvs[1]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUV2Buffer),g(b.uv2),l.vertexAttribPointer(b.uv2,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&
 0<=b.skinWeight&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),g(b.skinIndex),l.vertexAttribPointer(b.skinIndex,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),g(b.skinWeight),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0));0<=b.lineDistance&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglLineDistanceBuffer),g(b.lineDistance),l.vertexAttribPointer(b.lineDistance,1,l.FLOAT,!1,0,0))}h();k instanceof THREE.Mesh?(k=e.__typeArray===Uint32Array?l.UNSIGNED_INT:l.UNSIGNED_SHORT,
-d.wireframe?(C(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),l.drawElements(l.LINES,e.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),l.drawElements(l.TRIANGLES,e.__webglFaceCount,k,0)),A.info.render.calls++,A.info.render.vertices+=e.__webglFaceCount,A.info.render.faces+=e.__webglFaceCount/3):k instanceof THREE.Line?(k=k.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,C(d.linewidth),l.drawArrays(k,0,e.__webglLineCount),A.info.render.calls++):
-k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,e.__webglParticleCount),A.info.render.calls++,A.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=a.fog;Hb=Sa=-1;Ib=null;Ob=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});
-b.matrixWorldInverse.getInverse(b.matrixWorld);vb.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);ub.setFromMatrix(vb);pa.length=0;Ta.length=0;ya.length=0;tb.length=0;eb.length=0;q(a);!0===A.sortObjects&&(Ta.sort(k),ya.sort(n));Mc.render(a,b);A.info.render.calls=0;A.info.render.vertices=0;A.info.render.faces=0;A.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);d=0;for(var f=Ga.length;d<f;d++){var g=
-Ga[d],h=g.object;h.visible&&(G(h,b),s(g))}a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),J(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),m(Ta,b,pa,e,!0,d),m(ya,b,pa,e,!0,d),t(Ga,"",b,pa,e,!1,d)):(d=null,this.setBlending(THREE.NoBlending),m(Ta,b,pa,e,!1,d),t(Ga,"opaque",b,pa,e,!1,d),m(ya,b,pa,e,!0,d),t(Ga,"transparent",b,pa,e,!0,d));Nc.render(a,b);Oc.render(a,b,
-vc,wc);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&L(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=x(a,b,c,d,e);Sa=-1;A.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,ub):e.render(function(a){A.renderBufferImmediate(a,f,d)})};var sb={},kc=0;this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):
+d.wireframe?(C(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),l.drawElements(l.LINES,e.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),l.drawElements(l.TRIANGLES,e.__webglFaceCount,k,0)),J.info.render.calls++,J.info.render.vertices+=e.__webglFaceCount,J.info.render.faces+=e.__webglFaceCount/3):k instanceof THREE.Line?(k=k.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,C(d.linewidth),l.drawArrays(k,0,e.__webglLineCount),J.info.render.calls++):
+k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,e.__webglParticleCount),J.info.render.calls++,J.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=a.fog;Hb=Sa=-1;Ib=null;Ob=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});
+b.matrixWorldInverse.getInverse(b.matrixWorld);vb.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);ub.setFromMatrix(vb);pa.length=0;Ta.length=0;ya.length=0;tb.length=0;eb.length=0;q(a);!0===J.sortObjects&&(Ta.sort(k),ya.sort(n));Mc.render(a,b);J.info.render.calls=0;J.info.render.vertices=0;J.info.render.faces=0;J.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);d=0;for(var f=Ga.length;d<f;d++){var g=
+Ga[d],h=g.object;h.visible&&(F(h,b),s(g))}a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),A(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),m(Ta,b,pa,e,!0,d),m(ya,b,pa,e,!0,d),t(Ga,"",b,pa,e,!1,d)):(d=null,this.setBlending(THREE.NoBlending),m(Ta,b,pa,e,!1,d),t(Ga,"opaque",b,pa,e,!1,d),m(ya,b,pa,e,!0,d),t(Ga,"transparent",b,pa,e,!0,d));Nc.render(a,b);Oc.render(a,b,
+vc,wc);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&L(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=x(a,b,c,d,e);Sa=-1;J.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,ub):e.render(function(a){J.renderBufferImmediate(a,f,d)})};var sb={},kc=0;this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):
 l.frontFace(l.CCW),a===THREE.CullFaceBack?l.cullFace(l.BACK):a===THREE.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK),l.enable(l.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;zb!==b&&(b?l.disable(l.CULL_FACE):l.enable(l.CULL_FACE),zb=b);Xb!==a&&(a?l.frontFace(l.CW):l.frontFace(l.CCW),Xb=a)};this.setDepthTest=function(a){gc!==a&&(a?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),gc=a)};this.setDepthWrite=function(a){hc!==a&&
 (l.depthMask(a),hc=a)};this.setBlending=function(a,b,c,d){a!==Yb&&(a===THREE.NoBlending?l.disable(l.BLEND):a===THREE.AdditiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,l.ONE)):a===THREE.SubtractiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.SRC_COLOR)):a===THREE.CustomBlending?l.enable(l.BLEND):(l.enable(l.BLEND),
-l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),Yb=a);if(a===THREE.CustomBlending){if(b!==Zb&&(l.blendEquation(T(b)),Zb=b),c!==ec||d!==fc)l.blendFunc(T(c),T(d)),ec=c,fc=d}else fc=ec=Zb=null};this.uploadTexture=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Jb),a.__webglTexture=l.createTexture(),A.info.memory.textures++);l.bindTexture(l.TEXTURE_2D,a.__webglTexture);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,
+l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),Yb=a);if(a===THREE.CustomBlending){if(b!==Zb&&(l.blendEquation(T(b)),Zb=b),c!==ec||d!==fc)l.blendFunc(T(c),T(d)),ec=c,fc=d}else fc=ec=Zb=null};this.uploadTexture=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Jb),a.__webglTexture=l.createTexture(),J.info.memory.textures++);l.bindTexture(l.TEXTURE_2D,a.__webglTexture);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,
 a.flipY);l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);l.pixelStorei(l.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=M(a.image,Gc);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=T(a.format),e=T(a.type);U(l.TEXTURE_2D,a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<f.length&&c){for(var g=0,h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,
 d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(g=0,h=f.length;g<h;g++)b=f[g],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<oc().indexOf(d)?l.compressedTexImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,b.data):console.warn("Attempt to load unsupported compressed texture format"):l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);else if(0<f.length&&c){g=0;for(h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,
-0,d,d,e,a.image);a.generateMipmaps&&c&&l.generateMipmap(l.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()};this.setTexture=function(a,b){l.activeTexture(l.TEXTURE0+b);a.needsUpdate?A.uploadTexture(a):l.bindTexture(l.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Cc);a.__webglTexture=
-l.createTexture();A.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=T(a.format),e=T(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture);U(l.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=l.createFramebuffer();a.__webglRenderbuffer[f]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+
+0,d,d,e,a.image);a.generateMipmaps&&c&&l.generateMipmap(l.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()};this.setTexture=function(a,b){l.activeTexture(l.TEXTURE0+b);a.needsUpdate?J.uploadTexture(a):l.bindTexture(l.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Cc);a.__webglTexture=
+l.createTexture();J.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=T(a.format),e=T(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture);U(l.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=l.createFramebuffer();a.__webglRenderbuffer[f]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+
 f;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[f]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,h,g.__webglTexture,0);K(a.__webglRenderbuffer[f],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),U(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,
 a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):K(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,
 null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=ib,a=jb,d=hb,e=Ya);b!==uc&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),uc=b);vc=c;wc=a};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=
@@ -588,36 +588,36 @@ f.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader.
 e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var v in h)q.push(v);h=q;v={};q=0;for(b=h.length;q<b;q++)m=h[q],v[m]=f.getUniformLocation(g,m);this.uniforms=v;q="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)q.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)q.push("morphNormal"+h);for(var y in k)q.push(y);
 e=q;k={};y=0;for(h=e.length;y<h;y++)v=e[y],k[v]=f.getAttribLocation(g,v);this.attributes=k;this.attributesKeys=Object.keys(this.attributes);this.id=a++;this.code=c;this.usedTimes=1;this.program=g;this.vertexShader=n;this.fragmentShader=p;return this}}();
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){c=b.createShader(c);b.shaderSource(c,d);b.compileShader(c);!1===b.getShaderParameter(c,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(c)&&(console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",b.getShaderInfoLog(c)),console.warn(a(d)));return c}}();
-THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,n,p,q,m=a.context,t,s,r,u,v,y;this.render=function(H,x,F,z){if(0!==b.length){H=new THREE.Vector3;var G=z/F,D=.5*F,w=.5*z,C=16/z,J=new THREE.Vector2(C*G,C),U=new THREE.Vector3(1,1,0),M=new THREE.Vector2(1,1);if(void 0===r){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),K=new Uint16Array([0,1,2,0,2,3]);t=m.createBuffer();s=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,t);m.bufferData(m.ARRAY_BUFFER,C,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
+THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,n,p,q,m=a.context,t,s,r,u,v,y;this.render=function(H,x,E,z){if(0!==b.length){H=new THREE.Vector3;var F=z/E,D=.5*E,w=.5*z,C=16/z,A=new THREE.Vector2(C*F,C),U=new THREE.Vector3(1,1,0),M=new THREE.Vector2(1,1);if(void 0===r){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),K=new Uint16Array([0,1,2,0,2,3]);t=m.createBuffer();s=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,t);m.bufferData(m.ARRAY_BUFFER,C,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
 s);m.bufferData(m.ELEMENT_ARRAY_BUFFER,K,m.STATIC_DRAW);v=m.createTexture();y=m.createTexture();m.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);m.bindTexture(m.TEXTURE_2D,y);m.texImage2D(m.TEXTURE_2D,0,
 m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var C=(u=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
 K=m.createProgram(),L=m.createShader(m.FRAGMENT_SHADER),N=m.createShader(m.VERTEX_SHADER),T="precision "+a.getPrecision()+" float;\n";m.shaderSource(L,T+C.fragmentShader);m.shaderSource(N,T+C.vertexShader);m.compileShader(L);m.compileShader(N);m.attachShader(K,L);m.attachShader(K,N);m.linkProgram(K);r=K;p=m.getAttribLocation(r,"position");q=m.getAttribLocation(r,"uv");c=m.getUniformLocation(r,"renderType");d=m.getUniformLocation(r,"map");e=m.getUniformLocation(r,"occlusionMap");f=m.getUniformLocation(r,
-"opacity");g=m.getUniformLocation(r,"color");h=m.getUniformLocation(r,"scale");k=m.getUniformLocation(r,"rotation");n=m.getUniformLocation(r,"screenPosition")}m.useProgram(r);m.enableVertexAttribArray(p);m.enableVertexAttribArray(q);m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,t);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(q,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,s);m.disable(m.CULL_FACE);m.depthMask(!1);K=0;for(L=b.length;K<L;K++)if(C=16/z,J.set(C*
-G,C),N=b[K],H.set(N.matrixWorld.elements[12],N.matrixWorld.elements[13],N.matrixWorld.elements[14]),H.applyMatrix4(x.matrixWorldInverse),H.applyProjection(x.projectionMatrix),U.copy(H),M.x=U.x*D+D,M.y=U.y*w+w,u||0<M.x&&M.x<F&&0<M.y&&M.y<z){m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,M.x-8,M.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,J.x,J.y);m.uniform3f(n,U.x,U.y,U.z);m.disable(m.BLEND);m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,
+"opacity");g=m.getUniformLocation(r,"color");h=m.getUniformLocation(r,"scale");k=m.getUniformLocation(r,"rotation");n=m.getUniformLocation(r,"screenPosition")}m.useProgram(r);m.enableVertexAttribArray(p);m.enableVertexAttribArray(q);m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,t);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(q,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,s);m.disable(m.CULL_FACE);m.depthMask(!1);K=0;for(L=b.length;K<L;K++)if(C=16/z,A.set(C*
+F,C),N=b[K],H.set(N.matrixWorld.elements[12],N.matrixWorld.elements[13],N.matrixWorld.elements[14]),H.applyMatrix4(x.matrixWorldInverse),H.applyProjection(x.projectionMatrix),U.copy(H),M.x=U.x*D+D,M.y=U.y*w+w,u||0<M.x&&M.x<E&&0<M.y&&M.y<z){m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,M.x-8,M.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,A.x,A.y);m.uniform3f(n,U.x,U.y,U.z);m.disable(m.BLEND);m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,
 0);m.activeTexture(m.TEXTURE0);m.bindTexture(m.TEXTURE_2D,y);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,M.x-8,M.y-8,16,16,0);m.uniform1i(c,1);m.disable(m.DEPTH_TEST);m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);N.positionScreen.copy(U);N.customUpdateCallback?N.customUpdateCallback(N):N.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var T=0,Q=N.lensFlares.length;T<Q;T++){var W=N.lensFlares[T];.001<W.opacity&&.001<W.scale&&(U.x=W.x,
-U.y=W.y,U.z=W.z,C=W.size*W.scale/z,J.x=C*G,J.y=C,m.uniform3f(n,U.x,U.y,U.z),m.uniform2f(h,J.x,J.y),m.uniform1f(k,W.rotation),m.uniform1f(f,W.opacity),m.uniform3f(g,W.color.r,W.color.g,W.color.b),a.setBlending(W.blending,W.blendEquation,W.blendSrc,W.blendDst),a.setTexture(W.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
+U.y=W.y,U.z=W.z,C=W.size*W.scale/z,A.x=C*F,A.y=C,m.uniform3f(n,U.x,U.y,U.z),m.uniform2f(h,A.x,A.y),m.uniform1f(k,W.rotation),m.uniform1f(f,W.opacity),m.uniform3f(g,W.color.r,W.color.g,W.color.b),a.setBlending(W.blending,W.blendEquation,W.blendSrc,W.blendDst),a.setTexture(W.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
 THREE.ShadowMapPlugin=function(a,b,c,d){function e(a,b,d){if(b.visible){var f=c[b.id];if(f&&b.castShadow&&(!1===b.frustumCulled||!0===p.intersectsObject(b)))for(var g=0,h=f.length;g<h;g++){var k=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld);r.push(k)}g=0;for(h=b.children.length;g<h;g++)e(a,b.children[g],d)}}var f=a.context,g,h,k,n,p=new THREE.Frustum,q=new THREE.Matrix4,m=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,r=[],u=THREE.ShaderLib.depthRGBA,v=THREE.UniformsUtils.clone(u.uniforms);
 g=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader});h=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0});k=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,skinning:!0});n=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0,skinning:!0});g._shadowPass=!0;h._shadowPass=!0;k._shadowPass=
-!0;n._shadowPass=!0;this.render=function(c,v){if(!1!==a.shadowMapEnabled){var u,F,z,G,D,w,C,J,U=[];G=0;f.clearColor(1,1,1,1);f.disable(f.BLEND);f.enable(f.CULL_FACE);f.frontFace(f.CCW);a.shadowMapCullFace===THREE.CullFaceFront?f.cullFace(f.FRONT):f.cullFace(f.BACK);a.setDepthTest(!0);u=0;for(F=b.length;u<F;u++)if(z=b[u],z.castShadow)if(z instanceof THREE.DirectionalLight&&z.shadowCascade)for(D=0;D<z.shadowCascadeCount;D++){var M;if(z.shadowCascadeArray[D])M=z.shadowCascadeArray[D];else{C=z;var K=
+!0;n._shadowPass=!0;this.render=function(c,v){if(!1!==a.shadowMapEnabled){var u,E,z,F,D,w,C,A,U=[];F=0;f.clearColor(1,1,1,1);f.disable(f.BLEND);f.enable(f.CULL_FACE);f.frontFace(f.CCW);a.shadowMapCullFace===THREE.CullFaceFront?f.cullFace(f.FRONT):f.cullFace(f.BACK);a.setDepthTest(!0);u=0;for(E=b.length;u<E;u++)if(z=b[u],z.castShadow)if(z instanceof THREE.DirectionalLight&&z.shadowCascade)for(D=0;D<z.shadowCascadeCount;D++){var M;if(z.shadowCascadeArray[D])M=z.shadowCascadeArray[D];else{C=z;var K=
 D;M=new THREE.DirectionalLight;M.isVirtual=!0;M.onlyShadow=!0;M.castShadow=!0;M.shadowCameraNear=C.shadowCameraNear;M.shadowCameraFar=C.shadowCameraFar;M.shadowCameraLeft=C.shadowCameraLeft;M.shadowCameraRight=C.shadowCameraRight;M.shadowCameraBottom=C.shadowCameraBottom;M.shadowCameraTop=C.shadowCameraTop;M.shadowCameraVisible=C.shadowCameraVisible;M.shadowDarkness=C.shadowDarkness;M.shadowBias=C.shadowCascadeBias[K];M.shadowMapWidth=C.shadowCascadeWidth[K];M.shadowMapHeight=C.shadowCascadeHeight[K];
-M.pointsWorld=[];M.pointsFrustum=[];J=M.pointsWorld;w=M.pointsFrustum;for(var L=0;8>L;L++)J[L]=new THREE.Vector3,w[L]=new THREE.Vector3;J=C.shadowCascadeNearZ[K];C=C.shadowCascadeFarZ[K];w[0].set(-1,-1,J);w[1].set(1,-1,J);w[2].set(-1,1,J);w[3].set(1,1,J);w[4].set(-1,-1,C);w[5].set(1,-1,C);w[6].set(-1,1,C);w[7].set(1,1,C);M.originalCamera=v;w=new THREE.Gyroscope;w.position.copy(z.shadowCascadeOffset);w.add(M);w.add(M.target);v.add(w);z.shadowCascadeArray[D]=M;console.log("Created virtualLight",M)}K=
-z;J=D;C=K.shadowCascadeArray[J];C.position.copy(K.position);C.target.position.copy(K.target.position);C.lookAt(C.target);C.shadowCameraVisible=K.shadowCameraVisible;C.shadowDarkness=K.shadowDarkness;C.shadowBias=K.shadowCascadeBias[J];w=K.shadowCascadeNearZ[J];K=K.shadowCascadeFarZ[J];C=C.pointsFrustum;C[0].z=w;C[1].z=w;C[2].z=w;C[3].z=w;C[4].z=K;C[5].z=K;C[6].z=K;C[7].z=K;U[G]=M;G++}else U[G]=z,G++;u=0;for(F=U.length;u<F;u++){z=U[u];z.shadowMap||(D=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&
+M.pointsWorld=[];M.pointsFrustum=[];A=M.pointsWorld;w=M.pointsFrustum;for(var L=0;8>L;L++)A[L]=new THREE.Vector3,w[L]=new THREE.Vector3;A=C.shadowCascadeNearZ[K];C=C.shadowCascadeFarZ[K];w[0].set(-1,-1,A);w[1].set(1,-1,A);w[2].set(-1,1,A);w[3].set(1,1,A);w[4].set(-1,-1,C);w[5].set(1,-1,C);w[6].set(-1,1,C);w[7].set(1,1,C);M.originalCamera=v;w=new THREE.Gyroscope;w.position.copy(z.shadowCascadeOffset);w.add(M);w.add(M.target);v.add(w);z.shadowCascadeArray[D]=M;console.log("Created virtualLight",M)}K=
+z;A=D;C=K.shadowCascadeArray[A];C.position.copy(K.position);C.target.position.copy(K.target.position);C.lookAt(C.target);C.shadowCameraVisible=K.shadowCameraVisible;C.shadowDarkness=K.shadowDarkness;C.shadowBias=K.shadowCascadeBias[A];w=K.shadowCascadeNearZ[A];K=K.shadowCascadeFarZ[A];C=C.pointsFrustum;C[0].z=w;C[1].z=w;C[2].z=w;C[3].z=w;C[4].z=K;C[5].z=K;C[6].z=K;C[7].z=K;U[F]=M;F++}else U[F]=z,F++;u=0;for(E=U.length;u<E;u++){z=U[u];z.shadowMap||(D=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&
 (D=THREE.NearestFilter),z.shadowMap=new THREE.WebGLRenderTarget(z.shadowMapWidth,z.shadowMapHeight,{minFilter:D,magFilter:D,format:THREE.RGBAFormat}),z.shadowMapSize=new THREE.Vector2(z.shadowMapWidth,z.shadowMapHeight),z.shadowMatrix=new THREE.Matrix4);if(!z.shadowCamera){if(z instanceof THREE.SpotLight)z.shadowCamera=new THREE.PerspectiveCamera(z.shadowCameraFov,z.shadowMapWidth/z.shadowMapHeight,z.shadowCameraNear,z.shadowCameraFar);else if(z instanceof THREE.DirectionalLight)z.shadowCamera=new THREE.OrthographicCamera(z.shadowCameraLeft,
-z.shadowCameraRight,z.shadowCameraTop,z.shadowCameraBottom,z.shadowCameraNear,z.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}c.add(z.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}z.shadowCameraVisible&&!z.cameraHelper&&(z.cameraHelper=new THREE.CameraHelper(z.shadowCamera),c.add(z.cameraHelper));if(z.isVirtual&&M.originalCamera==v){D=v;G=z.shadowCamera;w=z.pointsFrustum;C=z.pointsWorld;m.set(Infinity,Infinity,Infinity);t.set(-Infinity,-Infinity,-Infinity);
-for(K=0;8>K;K++)J=C[K],J.copy(w[K]),J.unproject(D),J.applyMatrix4(G.matrixWorldInverse),J.x<m.x&&(m.x=J.x),J.x>t.x&&(t.x=J.x),J.y<m.y&&(m.y=J.y),J.y>t.y&&(t.y=J.y),J.z<m.z&&(m.z=J.z),J.z>t.z&&(t.z=J.z);G.left=m.x;G.right=t.x;G.top=t.y;G.bottom=m.y;G.updateProjectionMatrix()}G=z.shadowMap;w=z.shadowMatrix;D=z.shadowCamera;D.position.setFromMatrixPosition(z.matrixWorld);s.setFromMatrixPosition(z.target.matrixWorld);D.lookAt(s);D.updateMatrixWorld();D.matrixWorldInverse.getInverse(D.matrixWorld);z.cameraHelper&&
-(z.cameraHelper.visible=z.shadowCameraVisible);z.shadowCameraVisible&&z.cameraHelper.update();w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);w.multiply(D.projectionMatrix);w.multiply(D.matrixWorldInverse);q.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse);p.setFromMatrix(q);a.setRenderTarget(G);a.clear();r.length=0;e(c,c,D);z=0;for(G=r.length;z<G;z++)C=r[z],w=C.object,C=C.buffer,K=w.material instanceof THREE.MeshFaceMaterial?w.material.materials[0]:w.material,J=void 0!==w.geometry.morphTargets&&
-0<w.geometry.morphTargets.length&&K.morphTargets,L=w instanceof THREE.SkinnedMesh&&K.skinning,J=w.customDepthMaterial?w.customDepthMaterial:L?J?n:k:J?h:g,a.setMaterialFaces(K),C instanceof THREE.BufferGeometry?a.renderBufferDirect(D,b,null,J,C,w):a.renderBuffer(D,b,null,J,C,w);z=0;for(G=d.length;z<G;z++)C=d[z],w=C.object,w.visible&&w.castShadow&&(w._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,w.matrixWorld),a.renderImmediateObject(D,b,null,g,w))}u=a.getClearColor();F=a.getClearAlpha();f.clearColor(u.r,
-u.g,u.b,F);f.enable(f.BLEND);a.shadowMapCullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,n,p,q,m,t,s,r,u,v,y;function H(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,F,z,G,D,w=new THREE.Vector3,C=new THREE.Quaternion,J=new THREE.Vector3;this.render=function(U,M){if(0!==b.length){if(void 0===G){var K=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),L=new Uint16Array([0,1,2,0,2,3]);F=x.createBuffer();z=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,F);x.bufferData(x.ARRAY_BUFFER,K,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,
+z.shadowCameraRight,z.shadowCameraTop,z.shadowCameraBottom,z.shadowCameraNear,z.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}c.add(z.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}z.shadowCameraVisible&&!z.cameraHelper&&(z.cameraHelper=new THREE.CameraHelper(z.shadowCamera),c.add(z.cameraHelper));if(z.isVirtual&&M.originalCamera==v){D=v;F=z.shadowCamera;w=z.pointsFrustum;C=z.pointsWorld;m.set(Infinity,Infinity,Infinity);t.set(-Infinity,-Infinity,-Infinity);
+for(K=0;8>K;K++)A=C[K],A.copy(w[K]),A.unproject(D),A.applyMatrix4(F.matrixWorldInverse),A.x<m.x&&(m.x=A.x),A.x>t.x&&(t.x=A.x),A.y<m.y&&(m.y=A.y),A.y>t.y&&(t.y=A.y),A.z<m.z&&(m.z=A.z),A.z>t.z&&(t.z=A.z);F.left=m.x;F.right=t.x;F.top=t.y;F.bottom=m.y;F.updateProjectionMatrix()}F=z.shadowMap;w=z.shadowMatrix;D=z.shadowCamera;D.position.setFromMatrixPosition(z.matrixWorld);s.setFromMatrixPosition(z.target.matrixWorld);D.lookAt(s);D.updateMatrixWorld();D.matrixWorldInverse.getInverse(D.matrixWorld);z.cameraHelper&&
+(z.cameraHelper.visible=z.shadowCameraVisible);z.shadowCameraVisible&&z.cameraHelper.update();w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);w.multiply(D.projectionMatrix);w.multiply(D.matrixWorldInverse);q.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse);p.setFromMatrix(q);a.setRenderTarget(F);a.clear();r.length=0;e(c,c,D);z=0;for(F=r.length;z<F;z++)C=r[z],w=C.object,C=C.buffer,K=w.material instanceof THREE.MeshFaceMaterial?w.material.materials[0]:w.material,A=void 0!==w.geometry.morphTargets&&
+0<w.geometry.morphTargets.length&&K.morphTargets,L=w instanceof THREE.SkinnedMesh&&K.skinning,A=w.customDepthMaterial?w.customDepthMaterial:L?A?n:k:A?h:g,a.setMaterialFaces(K),C instanceof THREE.BufferGeometry?a.renderBufferDirect(D,b,null,A,C,w):a.renderBuffer(D,b,null,A,C,w);z=0;for(F=d.length;z<F;z++)C=d[z],w=C.object,w.visible&&w.castShadow&&(w._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,w.matrixWorld),a.renderImmediateObject(D,b,null,g,w))}u=a.getClearColor();E=a.getClearAlpha();f.clearColor(u.r,
+u.g,u.b,E);f.enable(f.BLEND);a.shadowMapCullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,n,p,q,m,t,s,r,u,v,y;function H(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,E,z,F,D,w=new THREE.Vector3,C=new THREE.Quaternion,A=new THREE.Vector3;this.render=function(U,M){if(0!==b.length){if(void 0===F){var K=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),L=new Uint16Array([0,1,2,0,2,3]);E=x.createBuffer();z=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,E);x.bufferData(x.ARRAY_BUFFER,K,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,
 z);x.bufferData(x.ELEMENT_ARRAY_BUFFER,L,x.STATIC_DRAW);var K=x.createProgram(),L=x.createShader(x.VERTEX_SHADER),N=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(L,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
 x.shaderSource(N,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\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"));
-x.compileShader(L);x.compileShader(N);x.attachShader(K,L);x.attachShader(K,N);x.linkProgram(K);G=K;v=x.getAttribLocation(G,"position");y=x.getAttribLocation(G,"uv");c=x.getUniformLocation(G,"uvOffset");d=x.getUniformLocation(G,"uvScale");e=x.getUniformLocation(G,"rotation");f=x.getUniformLocation(G,"scale");g=x.getUniformLocation(G,"color");h=x.getUniformLocation(G,"map");k=x.getUniformLocation(G,"opacity");n=x.getUniformLocation(G,"modelViewMatrix");p=x.getUniformLocation(G,"projectionMatrix");q=
-x.getUniformLocation(G,"fogType");m=x.getUniformLocation(G,"fogDensity");t=x.getUniformLocation(G,"fogNear");s=x.getUniformLocation(G,"fogFar");r=x.getUniformLocation(G,"fogColor");u=x.getUniformLocation(G,"alphaTest");K=document.createElement("canvas");K.width=8;K.height=8;L=K.getContext("2d");L.fillStyle="white";L.fillRect(0,0,8,8);D=new THREE.Texture(K);D.needsUpdate=!0}x.useProgram(G);x.enableVertexAttribArray(v);x.enableVertexAttribArray(y);x.disable(x.CULL_FACE);x.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,
-F);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(y,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,z);x.uniformMatrix4fv(p,!1,M.projectionMatrix.elements);x.activeTexture(x.TEXTURE0);x.uniform1i(h,0);L=K=0;(N=U.fog)?(x.uniform3f(r,N.color.r,N.color.g,N.color.b),N instanceof THREE.Fog?(x.uniform1f(t,N.near),x.uniform1f(s,N.far),x.uniform1i(q,1),L=K=1):N instanceof THREE.FogExp2&&(x.uniform1f(m,N.density),x.uniform1i(q,2),L=K=2)):(x.uniform1i(q,0),L=K=0);for(var N=0,T=b.length;N<
-T;N++){var Q=b[N];Q._modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,Q.matrixWorld);Q.z=-Q._modelViewMatrix.elements[14]}b.sort(H);for(var W=[],N=0,T=b.length;N<T;N++){var Q=b[N],P=Q.material;x.uniform1f(u,P.alphaTest);x.uniformMatrix4fv(n,!1,Q._modelViewMatrix.elements);Q.matrixWorld.decompose(w,C,J);W[0]=J.x;W[1]=J.y;Q=0;U.fog&&P.fog&&(Q=L);K!==Q&&(x.uniform1i(q,Q),K=Q);null!==P.map?(x.uniform2f(c,P.map.offset.x,P.map.offset.y),x.uniform2f(d,P.map.repeat.x,P.map.repeat.y)):(x.uniform2f(c,
-0,0),x.uniform2f(d,1,1));x.uniform1f(k,P.opacity);x.uniform3f(g,P.color.r,P.color.g,P.color.b);x.uniform1f(e,P.rotation);x.uniform2fv(f,W);a.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst);a.setDepthTest(P.depthTest);a.setDepthWrite(P.depthWrite);P.map&&P.map.image&&P.map.image.width?a.setTexture(P.map,0):a.setTexture(D,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}x.enable(x.CULL_FACE);a.resetGLState()}}};
+x.compileShader(L);x.compileShader(N);x.attachShader(K,L);x.attachShader(K,N);x.linkProgram(K);F=K;v=x.getAttribLocation(F,"position");y=x.getAttribLocation(F,"uv");c=x.getUniformLocation(F,"uvOffset");d=x.getUniformLocation(F,"uvScale");e=x.getUniformLocation(F,"rotation");f=x.getUniformLocation(F,"scale");g=x.getUniformLocation(F,"color");h=x.getUniformLocation(F,"map");k=x.getUniformLocation(F,"opacity");n=x.getUniformLocation(F,"modelViewMatrix");p=x.getUniformLocation(F,"projectionMatrix");q=
+x.getUniformLocation(F,"fogType");m=x.getUniformLocation(F,"fogDensity");t=x.getUniformLocation(F,"fogNear");s=x.getUniformLocation(F,"fogFar");r=x.getUniformLocation(F,"fogColor");u=x.getUniformLocation(F,"alphaTest");K=document.createElement("canvas");K.width=8;K.height=8;L=K.getContext("2d");L.fillStyle="white";L.fillRect(0,0,8,8);D=new THREE.Texture(K);D.needsUpdate=!0}x.useProgram(F);x.enableVertexAttribArray(v);x.enableVertexAttribArray(y);x.disable(x.CULL_FACE);x.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,
+E);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(y,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,z);x.uniformMatrix4fv(p,!1,M.projectionMatrix.elements);x.activeTexture(x.TEXTURE0);x.uniform1i(h,0);L=K=0;(N=U.fog)?(x.uniform3f(r,N.color.r,N.color.g,N.color.b),N instanceof THREE.Fog?(x.uniform1f(t,N.near),x.uniform1f(s,N.far),x.uniform1i(q,1),L=K=1):N instanceof THREE.FogExp2&&(x.uniform1f(m,N.density),x.uniform1i(q,2),L=K=2)):(x.uniform1i(q,0),L=K=0);for(var N=0,T=b.length;N<
+T;N++){var Q=b[N];Q._modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,Q.matrixWorld);Q.z=-Q._modelViewMatrix.elements[14]}b.sort(H);for(var W=[],N=0,T=b.length;N<T;N++){var Q=b[N],O=Q.material;x.uniform1f(u,O.alphaTest);x.uniformMatrix4fv(n,!1,Q._modelViewMatrix.elements);Q.matrixWorld.decompose(w,C,A);W[0]=A.x;W[1]=A.y;Q=0;U.fog&&O.fog&&(Q=L);K!==Q&&(x.uniform1i(q,Q),K=Q);null!==O.map?(x.uniform2f(c,O.map.offset.x,O.map.offset.y),x.uniform2f(d,O.map.repeat.x,O.map.repeat.y)):(x.uniform2f(c,
+0,0),x.uniform2f(d,1,1));x.uniform1f(k,O.opacity);x.uniform3f(g,O.color.r,O.color.g,O.color.b);x.uniform1f(e,O.rotation);x.uniform2fv(f,W);a.setBlending(O.blending,O.blendEquation,O.blendSrc,O.blendDst);a.setDepthTest(O.depthTest);a.setDepthWrite(O.depthWrite);O.map&&O.map.image&&O.map.image.width?a.setTexture(O.map,0):a.setTexture(D,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}x.enable(x.CULL_FACE);a.resetGLState()}}};
 THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
 THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);e.load(a,function(a){f.image=a;f.needsUpdate=!0;c&&c(f)},void 0,function(a){d&&d(a)});f.sourceFile=a;return f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a;g+=1;6===g&&(f.needsUpdate=!0,c&&
 c(f))})};d=0;for(var h=a.length;d<h;++d)b(d);return f},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");
@@ -631,7 +631,7 @@ break;case "l":k=b[a++]*c+d;p=b[a++]*c;e.lineTo(k,p);break;case "q":k=b[a++]*c+d
 m,s,u,p)}return{offset:v.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
 (function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,n,p;if(0<b(a))for(n=0;n<e;n++)g[n]=n;else for(n=0;n<e;n++)g[n]=e-1-n;var q=2*e;for(n=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=n;e<=k&&(k=0);n=k+1;e<=n&&(n=0);p=n+1;e<=p&&(p=0);var m;a:{var t=m=void 0,s=void 0,r=void 0,u=void 0,v=void 0,y=void 0,H=void 0,x=void 0,
-t=a[g[k]].x,s=a[g[k]].y,r=a[g[n]].x,u=a[g[n]].y,v=a[g[p]].x,y=a[g[p]].y;if(1E-10>(r-t)*(y-s)-(u-s)*(v-t))m=!1;else{var F=void 0,z=void 0,G=void 0,D=void 0,w=void 0,C=void 0,J=void 0,U=void 0,M=void 0,K=void 0,M=U=J=x=H=void 0,F=v-r,z=y-u,G=t-v,D=s-y,w=r-t,C=u-s;for(m=0;m<e;m++)if(H=a[g[m]].x,x=a[g[m]].y,!(H===t&&x===s||H===r&&x===u||H===v&&x===y)&&(J=H-t,U=x-s,M=H-r,K=x-u,H-=v,x-=y,M=F*K-z*M,J=w*U-C*J,U=G*x-D*H,-1E-10<=M&&-1E-10<=U&&-1E-10<=J)){m=!1;break a}m=!0}}if(m){f.push([a[g[k]],a[g[n]],a[g[p]]]);
+t=a[g[k]].x,s=a[g[k]].y,r=a[g[n]].x,u=a[g[n]].y,v=a[g[p]].x,y=a[g[p]].y;if(1E-10>(r-t)*(y-s)-(u-s)*(v-t))m=!1;else{var E=void 0,z=void 0,F=void 0,D=void 0,w=void 0,C=void 0,A=void 0,U=void 0,M=void 0,K=void 0,M=U=A=x=H=void 0,E=v-r,z=y-u,F=t-v,D=s-y,w=r-t,C=u-s;for(m=0;m<e;m++)if(H=a[g[m]].x,x=a[g[m]].y,!(H===t&&x===s||H===r&&x===u||H===v&&x===y)&&(A=H-t,U=x-s,M=H-r,K=x-u,H-=v,x-=y,M=E*K-z*M,A=w*U-C*A,U=F*x-D*H,-1E-10<=M&&-1E-10<=U&&-1E-10<=A)){m=!1;break a}m=!0}}if(m){f.push([a[g[k]],a[g[n]],a[g[p]]]);
 h.push([g[k],g[n],g[p]]);k=n;for(p=n+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.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain)};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);THREE.Audio.prototype.constructor=THREE.Audio;
 THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.source.connect(b.panner);b.source.start(0)})};c.send();return this};THREE.Audio.prototype.setLoop=function(a){this.source.loop=a};THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a};THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a};
@@ -668,11 +668,11 @@ h=[];var p=[],q=[],m=0,t;p[m]=void 0;q[m]=[];var s,r;s=0;for(r=e.length;s<r;s++)
 hole:n}),t?(t=!1,h[u].push(m)):s=!0);t&&h[g].push(m)}0<r.length&&(s||(q=h))}s=0;for(r=p.length;s<r;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.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
 THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,n=e.y-d.y,p=a.x-d.x,q=a.y-d.y,G=h*k-g*n,D=h*p-g*q;if(1E-10<Math.abs(G)){if(0<G){if(0>D||D>G)return[];k=n*p-k*q;if(0>k||k>G)return[]}else{if(0<D||D<G)return[];k=n*p-k*q;if(0<k||k<G)return[]}if(0==k)return!f||0!=D&&D!=G?[a]:[];if(k==G)return!f||0!=D&&D!=G?[b]:[];if(0==D)return[d];
-if(D==G)return[e];f=k/G;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=D||n*p!=k*q)return[];h=0==g&&0==h;k=0==k&&0==n;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,G=d.x,n=e,d=e.x):(b=e,G=e.x,n=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,G=d.y,n=e,d=e.y):(b=e,G=e.y,n=d,d=d.y));return k<=G?a<G?[]:a==G?f?[]:[b]:a<=d?[b,h]:[b,n]: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,n=e.y-d.y,p=a.x-d.x,q=a.y-d.y,F=h*k-g*n,D=h*p-g*q;if(1E-10<Math.abs(F)){if(0<F){if(0>D||D>F)return[];k=n*p-k*q;if(0>k||k>F)return[]}else{if(0<D||D<F)return[];k=n*p-k*q;if(0<k||k<F)return[]}if(0==k)return!f||0!=D&&D!=F?[a]:[];if(k==F)return!f||0!=D&&D!=F?[b]:[];if(0==D)return[d];
+if(D==F)return[e];f=k/F;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=D||n*p!=k*q)return[];h=0==g&&0==h;k=0==k&&0==n;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,F=d.x,n=e,d=e.x):(b=e,F=e.x,n=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,F=d.y,n=e,d=e.y):(b=e,F=e.y,n=d,d=d.y));return k<=F?a<F?[]:a==F?f?[]:[b]:a<=d?[b,h]:[b,n]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
 [g,n]}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,n,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++)n=h[f].x+":"+h[f].y,void 0!==p[n]&&console.log("Duplicate point",n),p[n]=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<n.length;e++)for(f=b[n[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,n=[],p,q,z,G,D,w=[],C,J,U,M=0;for(p=b.length;M<p;M++)n.push(M);C=0;for(var K=2*n.length;0<n.length;){K--;if(0>K){console.log("Infinite Loop! Holes left:"+
-n.length+", Probably Hole outside Shape!");break}for(q=C;q<h.length;q++){z=h[q];p=-1;for(M=0;M<n.length;M++)if(G=n[M],D=z.x+":"+z.y+":"+G,void 0===w[D]){k=b[G];for(J=0;J<k.length;J++)if(G=k[J],c(q,J)&&!f(z,G)&&!g(z,G)){p=J;n.splice(M,1);C=h.slice(0,q+1);G=h.slice(q);J=k.slice(p);U=k.slice(0,p+1);h=C.concat(J).concat(U).concat(G);C=q;break}if(0<=p)break;w[D]=!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++)n=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<n.length;e++)for(f=b[n[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,n=[],p,q,z,F,D,w=[],C,A,U,M=0;for(p=b.length;M<p;M++)n.push(M);C=0;for(var K=2*n.length;0<n.length;){K--;if(0>K){console.log("Infinite Loop! Holes left:"+
+n.length+", Probably Hole outside Shape!");break}for(q=C;q<h.length;q++){z=h[q];p=-1;for(M=0;M<n.length;M++)if(F=n[M],D=z.x+":"+z.y+":"+F,void 0===w[D]){k=b[F];for(A=0;A<k.length;A++)if(F=k[A],c(q,A)&&!f(z,F)&&!g(z,F)){p=A;n.splice(M,1);C=h.slice(0,q+1);F=h.slice(q);A=k.slice(p);U=k.slice(0,p+1);h=C.concat(A).concat(U).concat(F);C=q;break}if(0<=p)break;w[D]=!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++)n=k[h].x+":"+k[h].y,
 n=p[n],void 0!==n&&(k[h]=n);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.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};
 THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return b};
@@ -711,27 +711,27 @@ f;d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.inter
 THREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
 THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);a=this.duration/this.frames;var b=Math.floor(this.currentTime/a);b!=this.currentFrame&&(this.mesh.morphTargetInfluences[this.lastFrame]=0,this.mesh.morphTargetInfluences[this.currentFrame]=
 1,this.mesh.morphTargetInfluences[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);this.mesh.morphTargetInfluences[b]=this.currentTime%a/a;this.mesh.morphTargetInfluences[this.lastFrame]=1-this.mesh.morphTargetInfluences[b]}}};
-THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,r){var u,v=h.widthSegments,y=h.heightSegments,H=e/2,x=f/2,F=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",y=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var z=v+1,G=y+1,D=e/v,w=f/y,C=new THREE.Vector3;C[u]=0<g?1:-1;for(e=0;e<G;e++)for(f=0;f<z;f++){var J=new THREE.Vector3;J[a]=(f*D-H)*c;J[b]=(e*w-x)*d;J[u]=g;h.vertices.push(J)}for(e=
-0;e<y;e++)for(f=0;f<v;f++)x=f+z*e,a=f+z*(e+1),b=f+1+z*(e+1),c=f+1+z*e,d=new THREE.Vector2(f/v,1-e/y),g=new THREE.Vector2(f/v,1-(e+1)/y),u=new THREE.Vector2((f+1)/v,1-(e+1)/y),H=new THREE.Vector2((f+1)/v,1-e/y),x=new THREE.Face3(x+F,a+F,c+F),x.normal.copy(C),x.vertexNormals.push(C.clone(),C.clone(),C.clone()),x.materialIndex=r,h.faces.push(x),h.faceVertexUvs[0].push([d,g,H]),x=new THREE.Face3(a+F,b+F,c+F),x.normal.copy(C),x.vertexNormals.push(C.clone(),C.clone(),C.clone()),x.materialIndex=r,h.faces.push(x),
+THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,r){var u,v=h.widthSegments,y=h.heightSegments,H=e/2,x=f/2,E=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",y=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var z=v+1,F=y+1,D=e/v,w=f/y,C=new THREE.Vector3;C[u]=0<g?1:-1;for(e=0;e<F;e++)for(f=0;f<z;f++){var A=new THREE.Vector3;A[a]=(f*D-H)*c;A[b]=(e*w-x)*d;A[u]=g;h.vertices.push(A)}for(e=
+0;e<y;e++)for(f=0;f<v;f++)x=f+z*e,a=f+z*(e+1),b=f+1+z*(e+1),c=f+1+z*e,d=new THREE.Vector2(f/v,1-e/y),g=new THREE.Vector2(f/v,1-(e+1)/y),u=new THREE.Vector2((f+1)/v,1-(e+1)/y),H=new THREE.Vector2((f+1)/v,1-e/y),x=new THREE.Face3(x+E,a+E,c+E),x.normal.copy(C),x.vertexNormals.push(C.clone(),C.clone(),C.clone()),x.materialIndex=r,h.faces.push(x),h.faceVertexUvs[0].push([d,g,H]),x=new THREE.Face3(a+E,b+E,c+E),x.normal.copy(C),x.vertexNormals.push(C.clone(),C.clone(),C.clone()),x.materialIndex=r,h.faces.push(x),
 h.faceVertexUvs[0].push([g.clone(),u,H.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,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.BoxGeometry.prototype.constructor=THREE.BoxGeometry;
 THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
 THREE.CubeGeometry=function(a,b,c,d,e,f){console.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry.");return new THREE.BoxGeometry(a,b,c,d,e,f)};
 THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="CylinderGeometry";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,n=[],p=[];for(k=0;k<=e;k++){var q=[],m=[],t=k/e,s=t*(b-a)+a;for(h=0;h<=d;h++){var r=h/d,u=new THREE.Vector3;u.x=s*Math.sin(r*Math.PI*2);u.y=-t*c+g;u.z=s*Math.cos(r*Math.PI*2);this.vertices.push(u);q.push(this.vertices.length-
-1);m.push(new THREE.Vector2(r,1-t))}n.push(q);p.push(m)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[n[0][h]].clone(),m=this.vertices[n[0][h+1]].clone()):(q=this.vertices[n[1][h]].clone(),m=this.vertices[n[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),m.setY(Math.sqrt(m.x*m.x+m.z*m.z)*c).normalize(),k=0;k<e;k++){var t=n[k][h],s=n[k+1][h],r=n[k+1][h+1],u=n[k][h+1],v=q.clone(),y=q.clone(),H=m.clone(),x=m.clone(),F=p[k][h].clone(),z=p[k+1][h].clone(),G=p[k+1][h+1].clone(),
-D=p[k][h+1].clone();this.faces.push(new THREE.Face3(t,s,u,[v,y,x]));this.faceVertexUvs[0].push([F,z,D]);this.faces.push(new THREE.Face3(s,r,u,[y.clone(),H,x.clone()]));this.faceVertexUvs[0].push([z.clone(),G,D.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)t=n[0][h],s=n[0][h+1],r=this.vertices.length-1,v=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),H=new THREE.Vector3(0,1,0),F=p[0][h].clone(),z=p[0][h+1].clone(),G=new THREE.Vector2(z.x,0),this.faces.push(new THREE.Face3(t,
-s,r,[v,y,H])),this.faceVertexUvs[0].push([F,z,G]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)t=n[k][h+1],s=n[k][h],r=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),H=new THREE.Vector3(0,-1,0),F=p[k][h+1].clone(),z=p[k][h].clone(),G=new THREE.Vector2(z.x,1),this.faces.push(new THREE.Face3(t,s,r,[v,y,H])),this.faceVertexUvs[0].push([F,z,G]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);
+1);m.push(new THREE.Vector2(r,1-t))}n.push(q);p.push(m)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[n[0][h]].clone(),m=this.vertices[n[0][h+1]].clone()):(q=this.vertices[n[1][h]].clone(),m=this.vertices[n[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),m.setY(Math.sqrt(m.x*m.x+m.z*m.z)*c).normalize(),k=0;k<e;k++){var t=n[k][h],s=n[k+1][h],r=n[k+1][h+1],u=n[k][h+1],v=q.clone(),y=q.clone(),H=m.clone(),x=m.clone(),E=p[k][h].clone(),z=p[k+1][h].clone(),F=p[k+1][h+1].clone(),
+D=p[k][h+1].clone();this.faces.push(new THREE.Face3(t,s,u,[v,y,x]));this.faceVertexUvs[0].push([E,z,D]);this.faces.push(new THREE.Face3(s,r,u,[y.clone(),H,x.clone()]));this.faceVertexUvs[0].push([z.clone(),F,D.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)t=n[0][h],s=n[0][h+1],r=this.vertices.length-1,v=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),H=new THREE.Vector3(0,1,0),E=p[0][h].clone(),z=p[0][h+1].clone(),F=new THREE.Vector2(z.x,0),this.faces.push(new THREE.Face3(t,
+s,r,[v,y,H])),this.faceVertexUvs[0].push([E,z,F]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)t=n[k][h+1],s=n[k][h],r=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),H=new THREE.Vector3(0,-1,0),E=p[k][h+1].clone(),z=p[k][h].clone(),F=new THREE.Vector2(z.x,1),this.faces.push(new THREE.Face3(t,s,r,[v,y,H])),this.faceVertexUvs[0].push([E,z,F]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
 THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),m=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)==
-Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(E=a.length;0<=--E;){c=E;d=E-1;0>d&&(d=a.length-1);for(var e=0,f=t+2*p,e=0;e<f;e++){var g=ga*e,h=ga*(e+1),k=b+c+g,g=b+d+g,m=b+d+h,h=b+c+h,k=k+U,g=g+U,m=m+U,h=h+U;J.faces.push(new THREE.Face3(k,g,h,null,null,y));J.faces.push(new THREE.Face3(g,m,h,null,null,y));k=H.generateSideWallUV(J,k,g,m,h);J.faceVertexUvs[0].push([k[0],k[1],k[3]]);J.faceVertexUvs[0].push([k[1],
-k[2],k[3]])}}}function f(a,b,c){J.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=U;b+=U;c+=U;J.faces.push(new THREE.Face3(a,b,c,null,null,v));a=H.generateTopUV(J,a,b,c);J.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,n=void 0!==b.bevelSize?b.bevelSize:k-2,p=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,
-r,u=!1,v=b.material,y=b.extrudeMaterial,H=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,x,F,z,G;s&&(r=s.getSpacedPoints(t),u=!0,q=!1,x=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),F=new THREE.Vector3,z=new THREE.Vector3,G=new THREE.Vector3);q||(n=k=p=0);var D,w,C,J=this,U=this.vertices.length,s=a.extractPoints(m),m=s.shape,M=s.holes;if(s=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();w=0;for(C=M.length;w<C;w++)D=M[w],THREE.Shape.Utils.isClockWise(D)&&
-(M[w]=D.reverse());s=!1}var K=THREE.Shape.Utils.triangulateShape(m,M),L=m;w=0;for(C=M.length;w<C;w++)D=M[w],m=m.concat(D);var N,T,Q,W,P,ga=m.length,ea,wa=K.length,s=[],E=0;Q=L.length;N=Q-1;for(T=E+1;E<Q;E++,N++,T++)N===Q&&(N=0),T===Q&&(T=0),s[E]=d(L[E],L[N],L[T]);var Za=[],qa,xa=s.concat();w=0;for(C=M.length;w<C;w++){D=M[w];qa=[];E=0;Q=D.length;N=Q-1;for(T=E+1;E<Q;E++,N++,T++)N===Q&&(N=0),T===Q&&(T=0),qa[E]=d(D[E],D[N],D[T]);Za.push(qa);xa=xa.concat(qa)}for(N=0;N<p;N++){Q=N/p;W=k*(1-Q);T=n*Math.sin(Q*
-Math.PI/2);E=0;for(Q=L.length;E<Q;E++)P=c(L[E],s[E],T),f(P.x,P.y,-W);w=0;for(C=M.length;w<C;w++)for(D=M[w],qa=Za[w],E=0,Q=D.length;E<Q;E++)P=c(D[E],qa[E],T),f(P.x,P.y,-W)}T=n;for(E=0;E<ga;E++)P=q?c(m[E],xa[E],T):m[E],u?(z.copy(x.normals[0]).multiplyScalar(P.x),F.copy(x.binormals[0]).multiplyScalar(P.y),G.copy(r[0]).add(z).add(F),f(G.x,G.y,G.z)):f(P.x,P.y,0);for(Q=1;Q<=t;Q++)for(E=0;E<ga;E++)P=q?c(m[E],xa[E],T):m[E],u?(z.copy(x.normals[Q]).multiplyScalar(P.x),F.copy(x.binormals[Q]).multiplyScalar(P.y),
-G.copy(r[Q]).add(z).add(F),f(G.x,G.y,G.z)):f(P.x,P.y,h/t*Q);for(N=p-1;0<=N;N--){Q=N/p;W=k*(1-Q);T=n*Math.sin(Q*Math.PI/2);E=0;for(Q=L.length;E<Q;E++)P=c(L[E],s[E],T),f(P.x,P.y,h+W);w=0;for(C=M.length;w<C;w++)for(D=M[w],qa=Za[w],E=0,Q=D.length;E<Q;E++)P=c(D[E],qa[E],T),u?f(P.x,P.y+r[t-1].y,r[t-1].x+W):f(P.x,P.y,h+W)}(function(){if(q){var a;a=0*ga;for(E=0;E<wa;E++)ea=K[E],g(ea[2]+a,ea[1]+a,ea[0]+a);a=t+2*p;a*=ga;for(E=0;E<wa;E++)ea=K[E],g(ea[0]+a,ea[1]+a,ea[2]+a)}else{for(E=0;E<wa;E++)ea=K[E],g(ea[2],
-ea[1],ea[0]);for(E=0;E<wa;E++)ea=K[E],g(ea[0]+ga*t,ea[1]+ga*t,ea[2]+ga*t)}})();(function(){var a=0;e(L,a);a+=L.length;w=0;for(C=M.length;w<C;w++)D=M[w],e(D,a),a+=D.length})()};
+Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(G=a.length;0<=--G;){c=G;d=G-1;0>d&&(d=a.length-1);for(var e=0,f=t+2*p,e=0;e<f;e++){var g=ga*e,h=ga*(e+1),k=b+c+g,g=b+d+g,m=b+d+h,h=b+c+h,k=k+U,g=g+U,m=m+U,h=h+U;A.faces.push(new THREE.Face3(k,g,h,null,null,y));A.faces.push(new THREE.Face3(g,m,h,null,null,y));k=H.generateSideWallUV(A,k,g,m,h);A.faceVertexUvs[0].push([k[0],k[1],k[3]]);A.faceVertexUvs[0].push([k[1],
+k[2],k[3]])}}}function f(a,b,c){A.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=U;b+=U;c+=U;A.faces.push(new THREE.Face3(a,b,c,null,null,v));a=H.generateTopUV(A,a,b,c);A.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,n=void 0!==b.bevelSize?b.bevelSize:k-2,p=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,
+r,u=!1,v=b.material,y=b.extrudeMaterial,H=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,x,E,z,F;s&&(r=s.getSpacedPoints(t),u=!0,q=!1,x=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),E=new THREE.Vector3,z=new THREE.Vector3,F=new THREE.Vector3);q||(n=k=p=0);var D,w,C,A=this,U=this.vertices.length,s=a.extractPoints(m),m=s.shape,M=s.holes;if(s=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();w=0;for(C=M.length;w<C;w++)D=M[w],THREE.Shape.Utils.isClockWise(D)&&
+(M[w]=D.reverse());s=!1}var K=THREE.Shape.Utils.triangulateShape(m,M),L=m;w=0;for(C=M.length;w<C;w++)D=M[w],m=m.concat(D);var N,T,Q,W,O,ga=m.length,ea,wa=K.length,s=[],G=0;Q=L.length;N=Q-1;for(T=G+1;G<Q;G++,N++,T++)N===Q&&(N=0),T===Q&&(T=0),s[G]=d(L[G],L[N],L[T]);var Za=[],qa,xa=s.concat();w=0;for(C=M.length;w<C;w++){D=M[w];qa=[];G=0;Q=D.length;N=Q-1;for(T=G+1;G<Q;G++,N++,T++)N===Q&&(N=0),T===Q&&(T=0),qa[G]=d(D[G],D[N],D[T]);Za.push(qa);xa=xa.concat(qa)}for(N=0;N<p;N++){Q=N/p;W=k*(1-Q);T=n*Math.sin(Q*
+Math.PI/2);G=0;for(Q=L.length;G<Q;G++)O=c(L[G],s[G],T),f(O.x,O.y,-W);w=0;for(C=M.length;w<C;w++)for(D=M[w],qa=Za[w],G=0,Q=D.length;G<Q;G++)O=c(D[G],qa[G],T),f(O.x,O.y,-W)}T=n;for(G=0;G<ga;G++)O=q?c(m[G],xa[G],T):m[G],u?(z.copy(x.normals[0]).multiplyScalar(O.x),E.copy(x.binormals[0]).multiplyScalar(O.y),F.copy(r[0]).add(z).add(E),f(F.x,F.y,F.z)):f(O.x,O.y,0);for(Q=1;Q<=t;Q++)for(G=0;G<ga;G++)O=q?c(m[G],xa[G],T):m[G],u?(z.copy(x.normals[Q]).multiplyScalar(O.x),E.copy(x.binormals[Q]).multiplyScalar(O.y),
+F.copy(r[Q]).add(z).add(E),f(F.x,F.y,F.z)):f(O.x,O.y,h/t*Q);for(N=p-1;0<=N;N--){Q=N/p;W=k*(1-Q);T=n*Math.sin(Q*Math.PI/2);G=0;for(Q=L.length;G<Q;G++)O=c(L[G],s[G],T),f(O.x,O.y,h+W);w=0;for(C=M.length;w<C;w++)for(D=M[w],qa=Za[w],G=0,Q=D.length;G<Q;G++)O=c(D[G],qa[G],T),u?f(O.x,O.y+r[t-1].y,r[t-1].x+W):f(O.x,O.y,h+W)}(function(){if(q){var a;a=0*ga;for(G=0;G<wa;G++)ea=K[G],g(ea[2]+a,ea[1]+a,ea[0]+a);a=t+2*p;a*=ga;for(G=0;G<wa;G++)ea=K[G],g(ea[0]+a,ea[1]+a,ea[2]+a)}else{for(G=0;G<wa;G++)ea=K[G],g(ea[2],
+ea[1],ea[0]);for(G=0;G<wa;G++)ea=K[G],g(ea[0]+ga*t,ea[1]+ga*t,ea[2]+ga*t)}})();(function(){var a=0;e(L,a);a+=L.length;w=0;for(C=M.length;w<C;w++)D=M[w],e(D,a),a+=D.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,n=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=n.length;e<f;e++)g=n[e],THREE.Shape.Utils.isClockWise(g)&&(n[e]=g.reverse());var p=THREE.Shape.Utils.triangulateShape(k,n);e=0;for(f=n.length;e<f;e++)g=n[e],