Browse Source

Updated builds.

Mr.doob 11 năm trước cách đây
mục cha
commit
6f155bc98b
3 tập tin đã thay đổi với 198 bổ sung64 xóa
  1. 135 3
      build/three.js
  2. 59 57
      build/three.min.js
  3. 4 4
      src/loaders/CompressedTextureLoader.js

+ 135 - 3
build/three.js

@@ -12712,6 +12712,136 @@ THREE.TextureLoader.prototype = {
 
 };
 
+// File:src/loaders/CompressedTextureLoader.js
+
+/**
+ * @author mrdoob / http://mrdoob.com/
+ *
+ * Abstract Base class to block based textures loader (dds, pvr, ...)
+ */
+
+THREE.CompressedTextureLoader = function () {
+	// override in sub classes
+	this._parser = null;
+};
+
+
+THREE.CompressedTextureLoader.prototype = {
+
+	constructor: THREE.CompressedTextureLoader,
+
+	load: function ( url, onLoad, onError ) {
+
+		var scope = this;
+
+		var images = [];
+
+		var texture = new THREE.CompressedTexture();
+		texture.image = images;
+
+		// no flipping for cube textures
+		// (also flipping doesn't work for compressed textures )
+
+		texture.flipY = false;
+
+		// can't generate mipmaps for compressed textures
+		// mips must be embedded in DDS files
+
+		texture.generateMipmaps = false;
+
+		if ( url instanceof Array ) {
+
+			var loaded = 0;
+
+			var loader = new THREE.XHRLoader();
+			loader.setResponseType( 'arraybuffer' );
+
+			var loadTexture = function ( i ) {
+
+				loader.load( url[ i ], function ( buffer ) {
+
+					var texDatas = scope._parser( buffer, true );
+
+					images[ i ] = {
+						width: texDatas.width,
+						height: texDatas.height,
+						format: texDatas.format,
+						mipmaps: texDatas.mipmaps
+					}
+
+					loaded += 1;
+
+					if ( loaded === 6 ) {
+
+						texture.format = texDatas.format;
+						texture.needsUpdate = true;
+
+						if ( onLoad ) onLoad( texture );
+
+					}
+
+				} );
+
+			}
+
+			for ( var i = 0, il = url.length; i < il; ++ i ) {
+
+				loadTexture( i );
+
+			}
+
+		} else {
+
+			// compressed cubemap texture stored in a single DDS file
+
+			var loader = new THREE.XHRLoader();
+			loader.setResponseType( 'arraybuffer' );
+			loader.load( url, function ( buffer ) {
+
+				var texDatas = scope._parser( buffer, true );
+
+				if ( texDatas.isCubemap ) {
+
+					var faces = texDatas.mipmaps.length / texDatas.mipmapCount;
+
+					for ( var f = 0; f < faces; f ++ ) {
+
+						images[ f ] = { mipmaps : [] };
+
+						for ( var i = 0; i < texDatas.mipmapCount; i ++ ) {
+
+							images[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] );
+							images[ f ].format = texDatas.format;
+							images[ f ].width = texDatas.width;
+							images[ f ].height = texDatas.height;
+
+						}
+
+					}
+
+				} else {
+
+					texture.image.width = texDatas.width;
+					texture.image.height = texDatas.height;
+					texture.mipmaps = texDatas.mipmaps;
+
+				}
+
+				texture.format = texDatas.format;
+				texture.needsUpdate = true;
+
+				if ( onLoad ) onLoad( texture );
+
+			} );
+
+		}
+
+		return texture;
+
+	}
+
+};
+
 // File:src/materials/Material.js
 
 /**
@@ -33918,7 +34048,7 @@ THREE.SpritePlugin = function () {
 		_renderer = renderer;
 
 		vertices = new Float32Array( [
-			- 0.5, - 0.5, 0, 0, 
+			- 0.5, - 0.5, 0, 0,
 			  0.5, - 0.5, 1, 0,
 			  0.5,   0.5, 1, 1,
 			- 0.5,   0.5, 0, 1
@@ -33967,11 +34097,11 @@ THREE.SpritePlugin = function () {
 
 			alphaTest:			_gl.getUniformLocation( program, 'alphaTest' )
 		};
-		
+
 		var canvas = document.createElement( 'canvas' );
 		canvas.width = 8;
 		canvas.height = 8;
-		
+
 		var context = canvas.getContext( '2d' );
 		context.fillStyle = 'white';
 		context.fillRect( 0, 0, 8, 8 );
@@ -34137,6 +34267,8 @@ THREE.SpritePlugin = function () {
 		// restore gl
 
 		_gl.enable( _gl.CULL_FACE );
+		
+		_renderer.resetGLState();
 
 	};
 

+ 59 - 57
build/three.min.js

@@ -96,8 +96,8 @@ console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotati
 b[10]=g*f):"ZXY"===a.order?(a=f*h,k=f*e,m=d*h,n=d*e,b[0]=a-n*c,b[4]=-g*e,b[8]=m+k*c,b[1]=k+m*c,b[5]=g*h,b[9]=n-a*c,b[2]=-g*d,b[6]=c,b[10]=g*f):"ZYX"===a.order?(a=g*h,k=g*e,m=c*h,n=c*e,b[0]=f*h,b[4]=m*d-k,b[8]=a*d+n,b[1]=f*e,b[5]=n*d+a,b[9]=k*d-m,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,m=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=m*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+m,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,m=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=k*
 e-m,b[2]=m*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var m=c*h,c=c*k,n=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(n+e);b[4]=m-g;b[8]=c+h;b[1]=m+g;b[5]=1-
 (a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,g){var f=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),
-multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],m=c[1],n=c[5],q=c[9],r=c[13],t=c[2],s=c[6],p=c[10],v=c[14],w=c[3],u=c[7],A=c[11],c=c[15],x=d[0],G=d[4],C=d[8],B=d[12],y=d[1],D=d[5],J=d[9],N=d[13],Q=d[2],E=d[6],da=d[10],V=d[14],R=d[3],
-S=d[7],L=d[11],d=d[15];e[0]=g*x+f*y+h*Q+k*R;e[4]=g*G+f*D+h*E+k*S;e[8]=g*C+f*J+h*da+k*L;e[12]=g*B+f*N+h*V+k*d;e[1]=m*x+n*y+q*Q+r*R;e[5]=m*G+n*D+q*E+r*S;e[9]=m*C+n*J+q*da+r*L;e[13]=m*B+n*N+q*V+r*d;e[2]=t*x+s*y+p*Q+v*R;e[6]=t*G+s*D+p*E+v*S;e[10]=t*C+s*J+p*da+v*L;e[14]=t*B+s*N+p*V+v*d;e[3]=w*x+u*y+A*Q+c*R;e[7]=w*G+u*D+A*E+c*S;e[11]=w*C+u*J+A*da+c*L;e[15]=w*B+u*N+A*V+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];
+multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],m=c[1],n=c[5],q=c[9],r=c[13],t=c[2],s=c[6],p=c[10],v=c[14],w=c[3],u=c[7],z=c[11],c=c[15],x=d[0],G=d[4],C=d[8],B=d[12],y=d[1],D=d[5],J=d[9],N=d[13],Q=d[2],E=d[6],da=d[10],V=d[14],R=d[3],
+S=d[7],L=d[11],d=d[15];e[0]=g*x+f*y+h*Q+k*R;e[4]=g*G+f*D+h*E+k*S;e[8]=g*C+f*J+h*da+k*L;e[12]=g*B+f*N+h*V+k*d;e[1]=m*x+n*y+q*Q+r*R;e[5]=m*G+n*D+q*E+r*S;e[9]=m*C+n*J+q*da+r*L;e[13]=m*B+n*N+q*V+r*d;e[2]=t*x+s*y+p*Q+v*R;e[6]=t*G+s*D+p*E+v*S;e[10]=t*C+s*J+p*da+v*L;e[14]=t*B+s*N+p*V+v*d;e[3]=w*x+u*y+z*Q+c*R;e[7]=w*G+u*D+z*E+c*S;e[11]=w*C+u*J+z*da+c*L;e[15]=w*B+u*N+z*V+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=
@@ -185,12 +185,12 @@ u=p.vertexNormals[2],m[s]=v.x,m[s+1]=v.y,m[s+2]=v.z,m[s+3]=w.x,m[s+4]=w.y,m[s+5]
 5]=w.b,n[s+6]=p.r,n[s+7]=p.g,n[s+8]=p.b);!0===f&&(p=e[0][r][0],v=e[0][r][1],w=e[0][r][2],q[t]=p.x,q[t+1]=p.y,q[t+2]=v.x,q[t+3]=v.y,q[t+4]=w.x,q[t+5]=w.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}if(void 0===b||0===
 b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;
 if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.set(c[e],c[e+1],c[e+2]),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=
-this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,g,f,h,k,m,n,q=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,p=new THREE.Vector3;if(a.index)for(var v=a.index.array,w=0<this.offsets.length?this.offsets:[{start:0,count:v.length,index:0}],u=0,A=w.length;u<A;++u){e=w[u].start;g=w[u].count;
+this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,g,f,h,k,m,n,q=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,p=new THREE.Vector3;if(a.index)for(var v=a.index.array,w=0<this.offsets.length?this.offsets:[{start:0,count:v.length,index:0}],u=0,z=w.length;u<z;++u){e=w[u].start;g=w[u].count;
 for(var x=w[u].index,d=e,e=e+g;d<e;d+=3)g=x+v[d],f=x+v[d+1],h=x+v[d+2],k=b[3*g],m=b[3*g+1],n=b[3*g+2],q.set(k,m,n),k=b[3*f],m=b[3*f+1],n=b[3*f+2],r.set(k,m,n),k=b[3*h],m=b[3*h+1],n=b[3*h+2],t.set(k,m,n),s.subVectors(t,r),p.subVectors(q,r),s.cross(p),c[3*g]+=s.x,c[3*g+1]+=s.y,c[3*g+2]+=s.z,c[3*f]+=s.x,c[3*f+1]+=s.y,c[3*f+2]+=s.z,c[3*h]+=s.x,c[3*h+1]+=s.y,c[3*h+2]+=s.z}else for(d=0,e=b.length;d<e;d+=9)k=b[d],m=b[d+1],n=b[d+2],q.set(k,m,n),k=b[d+3],m=b[d+4],n=b[d+5],r.set(k,m,n),k=b[d+6],m=b[d+7],n=
-b[d+8],t.set(k,m,n),s.subVectors(t,r),p.subVectors(q,r),s.cross(p),c[d]=s.x,c[d+1]=s.y,c[d+2]=s.z,c[d+3]=s.x,c[d+4]=s.y,c[d+5]=s.z,c[d+6]=s.x,c[d+7]=s.y,c[d+8]=s.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q=d[3*a];r=d[3*a+1];t=d[3*a+2];s=d[3*b];p=d[3*b+1];v=d[3*b+2];w=d[3*c];u=d[3*c+1];A=d[3*c+2];x=g[2*a];G=g[2*a+1];C=g[2*b];B=g[2*b+1];y=g[2*c];D=g[2*c+1];J=s-q;N=w-q;Q=p-r;E=u-r;da=v-t;V=A-t;R=C-x;S=y-x;L=B-G;xa=D-G;P=1/(R*xa-S*L);ya.set((xa*J-
+b[d+8],t.set(k,m,n),s.subVectors(t,r),p.subVectors(q,r),s.cross(p),c[d]=s.x,c[d+1]=s.y,c[d+2]=s.z,c[d+3]=s.x,c[d+4]=s.y,c[d+5]=s.z,c[d+6]=s.x,c[d+7]=s.y,c[d+8]=s.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q=d[3*a];r=d[3*a+1];t=d[3*a+2];s=d[3*b];p=d[3*b+1];v=d[3*b+2];w=d[3*c];u=d[3*c+1];z=d[3*c+2];x=g[2*a];G=g[2*a+1];C=g[2*b];B=g[2*b+1];y=g[2*c];D=g[2*c+1];J=s-q;N=w-q;Q=p-r;E=u-r;da=v-t;V=z-t;R=C-x;S=y-x;L=B-G;xa=D-G;P=1/(R*xa-S*L);ya.set((xa*J-
 L*N)*P,(xa*Q-L*E)*P,(xa*da-L*V)*P);la.set((R*N-S*J)*P,(R*E-S*Q)*P,(R*V-S*da)*P);k[a].add(ya);k[b].add(ya);k[c].add(ya);m[a].add(la);m[b].add(la);m[c].add(la)}function b(a){Ca.x=e[3*a];Ca.y=e[3*a+1];Ca.z=e[3*a+2];hb.copy(Ca);I=k[a];Ga.copy(I);Ga.sub(Ca.multiplyScalar(Ca.dot(I))).normalize();Ta.crossVectors(hb,I);Na=Ta.dot(m[a]);Ra=0>Na?-1:1;h[4*a]=Ga.x;h[4*a+1]=Ga.y;h[4*a+2]=Ga.z;h[4*a+3]=Ra}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,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],m=[],n=0;n<f;n++)k[n]=new THREE.Vector3,m[n]=new THREE.Vector3;var q,
-r,t,s,p,v,w,u,A,x,G,C,B,y,D,J,N,Q,E,da,V,R,S,L,xa,P,ya=new THREE.Vector3,la=new THREE.Vector3,sa,K,ha,ra,Ia;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var ta=this.drawcalls,n=0;for(K=ta.length;n<K;++n){sa=ta[n].start;ha=ta[n].count;var Ja=ta[n].index,f=sa;for(sa+=ha;f<sa;f+=3)ha=Ja+c[f],ra=Ja+c[f+1],Ia=Ja+c[f+2],a(ha,ra,Ia)}var Ga=new THREE.Vector3,Ta=new THREE.Vector3,Ca=new THREE.Vector3,hb=new THREE.Vector3,Ra,I,Na,n=0;for(K=ta.length;n<K;++n)for(sa=ta[n].start,ha=ta[n].count,Ja=
+r,t,s,p,v,w,u,z,x,G,C,B,y,D,J,N,Q,E,da,V,R,S,L,xa,P,ya=new THREE.Vector3,la=new THREE.Vector3,sa,K,ha,ra,Ia;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var ta=this.drawcalls,n=0;for(K=ta.length;n<K;++n){sa=ta[n].start;ha=ta[n].count;var Ja=ta[n].index,f=sa;for(sa+=ha;f<sa;f+=3)ha=Ja+c[f],ra=Ja+c[f+1],Ia=Ja+c[f+2],a(ha,ra,Ia)}var Ga=new THREE.Vector3,Ta=new THREE.Vector3,Ca=new THREE.Vector3,hb=new THREE.Vector3,Ra,I,Na,n=0;for(K=ta.length;n<K;++n)for(sa=ta[n].start,ha=ta[n].count,Ja=
 ta[n].index,f=sa,sa+=ha;f<sa;f+=3)ha=Ja+c[f],ra=Ja+c[f+1],Ia=Ja+c[f+2],b(ha),b(ra),b(Ia)}},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),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],m=0,n=0,q=new Int32Array(6),r=new Int32Array(c.length),t=new Int32Array(c.length),s=0;s<c.length;s++)r[s]=-1,t[s]=-1;for(c=0;c<d;c++){for(var p=n=0;3>p;p++)s=a[3*c+p],-1==r[s]?(q[2*p]=s,
 q[2*p+1]=-1,n++):r[s]<k.index?(q[2*p]=s,q[2*p+1]=-1,m++):(q[2*p]=s,q[2*p+1]=r[s]);if(f+n>k.index+b)for(k={start:g,count:0,index:f},h.push(k),n=0;6>n;n+=2)p=q[n+1],-1<p&&p<k.index&&(q[n+1]=-1);for(n=0;6>n;n+=2)s=q[n],p=q[n+1],-1===p&&(p=f++),r[s]=p,t[p]=s,e[g++]=p-k.index,k.count++}this.reorderBuffers(e,t,f);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+
 1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!=e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*c));for(var g=0;g<c;g++){var f=b[g];for(e in this.attributes)if("index"!=e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,m=d[e],n=0;n<k;n++)m[g*k+n]=h[f*k+n]}this.attributes.index.array=a;for(e in this.attributes)"index"!=e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=
@@ -206,8 +206,8 @@ c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=ne
 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 g=new THREE.Geometry;g.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var f=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,
 b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),f.push(k)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();g.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,
-b,c,d,e,g,f,h,k,m,n,q,r,t,s,p,v,w=[],u=[];c=new THREE.Vector3;var A=new THREE.Vector3,x=new THREE.Vector3,G=new THREE.Vector3,C=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,f=this.vertices[d],h=this.vertices[v],k=this.vertices[e],m=g[0],n=g[1],q=g[2],g=h.x-f.x,r=k.x-f.x,t=h.y-f.y,s=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=n.x-m.x,p=q.x-m.x,n=n.y-m.y,m=q.y-
-m.y,q=1/(k*m-p*n),c.set((m*g-n*r)*q,(m*t-n*s)*q,(m*h-n*f)*q),A.set((k*r-p*g)*q,(k*s-p*t)*q,(k*f-p*h)*q),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(A),u[v].add(A),u[e].add(A);A=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)C.copy(e.vertexNormals[c]),d=e[A[c]],v=w[d],x.copy(v),x.sub(C.multiplyScalar(C.dot(v))).normalize(),G.crossVectors(e.vertexNormals[c],v),d=G.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,
+b,c,d,e,g,f,h,k,m,n,q,r,t,s,p,v,w=[],u=[];c=new THREE.Vector3;var z=new THREE.Vector3,x=new THREE.Vector3,G=new THREE.Vector3,C=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,f=this.vertices[d],h=this.vertices[v],k=this.vertices[e],m=g[0],n=g[1],q=g[2],g=h.x-f.x,r=k.x-f.x,t=h.y-f.y,s=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=n.x-m.x,p=q.x-m.x,n=n.y-m.y,m=q.y-
+m.y,q=1/(k*m-p*n),c.set((m*g-n*r)*q,(m*t-n*s)*q,(m*h-n*f)*q),z.set((k*r-p*g)*q,(k*s-p*t)*q,(k*f-p*h)*q),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(z),u[v].add(z),u[e].add(z);z=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)C.copy(e.vertexNormals[c]),d=e[z[c]],v=w[d],x.copy(v),x.sub(C.multiplyScalar(C.dot(v))).normalize(),G.crossVectors(e.vertexNormals[c],v),d=G.dot(u[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,g=this.vertices,f=a.vertices,h=this.faces,k=a.faces,m=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,q=f.length;n<q;n++){var r=f[n].clone();void 0!==b&&r.applyMatrix4(b);g.push(r)}n=0;for(q=k.length;n<q;n++){var f=k[n],t,s=f.vertexNormals,p=f.vertexColors,r=new THREE.Face3(f.a+e,f.b+
 e,f.c+e);r.normal.copy(f.normal);void 0!==d&&r.normal.applyMatrix3(d).normalize();b=0;for(g=s.length;b<g;b++)t=s[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),r.vertexNormals.push(t);r.color.copy(f.color);b=0;for(g=p.length;b<g;b++)t=p[b],r.vertexColors.push(t.clone());r.materialIndex=f.materialIndex+c;h.push(r)}n=0;for(q=a.length;n<q;n++)if(c=a[n],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));m.push(d)}}},mergeVertices:function(){var a={},b=[],c=[],d,
@@ -215,8 +215,8 @@ e=Math.pow(10,4),g,f;g=0;for(f=this.vertices.length;g<f;g++)d=this.vertices[g],d
 1);g=this.vertices.length-b.length;this.vertices=b;return g},makeGroups:function(){var a=0;return function(b,c){var d,e,g,f,h={},k,m=this.morphTargets.length,n=this.morphNormals.length;this.geometryGroups={};this.geometryGroupsList=[];d=0;for(e=this.faces.length;d<e;d++)g=this.faces[d],g=b?g.materialIndex:0,g in h||(h[g]={hash:g,counter:0}),f=h[g].hash+"_"+h[g].counter,f in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:g,vertices:0,numMorphTargets:m,numMorphNormals:n},this.geometryGroups[f]=
 k,this.geometryGroupsList.push(k)),this.geometryGroups[f].vertices+3>c&&(h[g].counter+=1,f=h[g].hash+"_"+h[g].counter,f in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:g,vertices:0,numMorphTargets:m,numMorphNormals:n},this.geometryGroups[f]=k,this.geometryGroupsList.push(k))),this.geometryGroups[f].faces3.push(d),this.geometryGroups[f].vertices+=3}}(),toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==
 m[b])return m[b];m[b]=k.length/3;k.push(a.x,a.y,a.z);return m[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==q[b])return q[b];q[b]=n.length;n.push(a.getHex());return q[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==t[b])return t[b];t[b]=r.length/2;r.push(a.x,a.y);return t[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=
-this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],m={},n=[],q={},r=[],t={};for(f=0;f<this.faces.length;f++){var s=this.faces[f],p=void 0!==this.faceVertexUvs[0][f],v=0<s.normal.length(),w=0<s.vertexNormals.length,u=1!==s.color.r||1!==s.color.g||1!==s.color.b,A=0<s.vertexColors.length,x=0,x=a(x,0,0),x=a(x,1,!1),x=a(x,2,!1),x=a(x,3,p),x=a(x,4,v),x=a(x,5,w),x=a(x,6,u),x=a(x,7,A);h.push(x);
-h.push(s.a,s.b,s.c);p&&(p=this.faceVertexUvs[0][f],h.push(d(p[0]),d(p[1]),d(p[2])));v&&h.push(b(s.normal));w&&(v=s.vertexNormals,h.push(b(v[0]),b(v[1]),b(v[2])));u&&h.push(c(s.color));A&&(s=s.vertexColors,h.push(c(s[0]),c(s[1]),c(s[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<n.length&&(e.data.colors=n);0<r.length&&(e.data.uvs=[r]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=
+this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],m={},n=[],q={},r=[],t={};for(f=0;f<this.faces.length;f++){var s=this.faces[f],p=void 0!==this.faceVertexUvs[0][f],v=0<s.normal.length(),w=0<s.vertexNormals.length,u=1!==s.color.r||1!==s.color.g||1!==s.color.b,z=0<s.vertexColors.length,x=0,x=a(x,0,0),x=a(x,1,!1),x=a(x,2,!1),x=a(x,3,p),x=a(x,4,v),x=a(x,5,w),x=a(x,6,u),x=a(x,7,z);h.push(x);
+h.push(s.a,s.b,s.c);p&&(p=this.faceVertexUvs[0][f],h.push(d(p[0]),d(p[1]),d(p[2])));v&&h.push(b(s.normal));w&&(v=s.vertexNormals,h.push(b(v[0]),b(v[1]),b(v[2])));u&&h.push(c(s.color));z&&(s=s.vertexColors,h.push(c(s[0]),c(s[1]),c(s[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<n.length&&(e.data.colors=n);0<r.length&&(e.data.uvs=[r]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=
 b.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],g=[],f=0,h=e.length;f<h;f++)g.push(new THREE.Vector2(e[f].x,e[f].y));a.faceVertexUvs[0].push(g)}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Script=function(a){this.uuid=THREE.Math.generateUUID();this.source=a};THREE.Script.prototype={constructor:THREE.Script,clone:function(){return new THREE.Script(this.source)}};
 THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
 THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};
@@ -258,10 +258,10 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
 a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var g=new XMLHttpRequest,f=0;g.onreadystatechange=function(){if(g.readyState===g.DONE)if(200===g.status||0===g.status){if(g.responseText){var h=JSON.parse(g.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+'" ('+g.status+")");else g.readyState===g.LOADING?e&&(0===f&&(f=g.getResponseHeader("Content-Length")),e({total:f,loaded:g.responseText.length})):g.readyState===g.HEADERS_RECEIVED&&void 0!==e&&(f=g.getResponseHeader("Content-Length"))};g.open("GET",b,!0);g.withCredentials=this.withCredentials;g.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,f,h,k,m,n,q,r,t,s,p,v,w,u=a.faces;n=a.vertices;var A=a.normals,x=a.colors,G=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&G++;for(d=0;d<G;d++)c.faceVertexUvs[d]=[]}k=0;for(m=n.length;k<m;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(m=u.length;k<m;)if(b=u[k++],t=b&1,h=b&2,d=b&8,q=b&16,s=b&32,n=b&64,b&=128,t){t=new THREE.Face3;
-t.a=u[k];t.b=u[k+1];t.c=u[k+3];p=new THREE.Face3;p.a=u[k+1];p.b=u[k+2];p.c=u[k+3];k+=4;h&&(h=u[k++],t.materialIndex=h,p.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<G;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==f&&c.faceVertexUvs[d][h].push(w),0!==f&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(A[q++],A[q++],A[q]),p.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*u[k++],s=new THREE.Vector3(A[q++],
-A[q++],A[q]),2!==d&&t.vertexNormals.push(s),0!==d&&p.vertexNormals.push(s);n&&(n=u[k++],n=x[n],t.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=u[k++],n=x[n],2!==d&&t.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(t);c.faces.push(p)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<G;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)r=u[k++],w=v[2*r],r=v[2*r+1],
-w=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(A[q++],A[q++],A[q]));if(s)for(d=0;3>d;d++)q=3*u[k++],s=new THREE.Vector3(A[q++],A[q++],A[q]),t.vertexNormals.push(s);n&&(n=u[k++],t.color.setHex(x[n]));if(b)for(d=0;3>d;d++)n=u[k++],t.vertexColors.push(new THREE.Color(x[n]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,f=a.skinWeights.length;d<f;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,f,h,k,m,n,q,r,t,s,p,v,w,u=a.faces;n=a.vertices;var z=a.normals,x=a.colors,G=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&G++;for(d=0;d<G;d++)c.faceVertexUvs[d]=[]}k=0;for(m=n.length;k<m;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(m=u.length;k<m;)if(b=u[k++],t=b&1,h=b&2,d=b&8,q=b&16,s=b&32,n=b&64,b&=128,t){t=new THREE.Face3;
+t.a=u[k];t.b=u[k+1];t.c=u[k+3];p=new THREE.Face3;p.a=u[k+1];p.b=u[k+2];p.c=u[k+3];k+=4;h&&(h=u[k++],t.materialIndex=h,p.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<G;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==f&&c.faceVertexUvs[d][h].push(w),0!==f&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(z[q++],z[q++],z[q]),p.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*u[k++],s=new THREE.Vector3(z[q++],
+z[q++],z[q]),2!==d&&t.vertexNormals.push(s),0!==d&&p.vertexNormals.push(s);n&&(n=u[k++],n=x[n],t.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=u[k++],n=x[n],2!==d&&t.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(t);c.faces.push(p)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<G;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)r=u[k++],w=v[2*r],r=v[2*r+1],
+w=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(z[q++],z[q++],z[q]));if(s)for(d=0;3>d;d++)q=3*u[k++],s=new THREE.Vector3(z[q++],z[q++],z[q]),t.vertexNormals.push(s);n&&(n=u[k++],t.color.setHex(x[n]));if(b)for(d=0;3>d;d++)n=u[k++],t.vertexColors.push(new THREE.Color(x[n]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,f=a.skinWeights.length;d<f;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,f=a.skinIndices.length;d<f;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,f,h,k,m,n;d=0;for(f=a.morphTargets.length;d<f;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],m=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var q=new THREE.Vector3;q.x=n[h]*b;q.y=n[h+1]*b;q.z=n[h+2]*b;m.push(q)}}if(void 0!==a.morphColors)for(d=
 0,f=a.morphColors.length;d<f;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,m=a.morphColors[d].colors,b=0,h=m.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(m[b],m[b+1],m[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};
@@ -278,7 +278,9 @@ d.parse(h.data);break;case "Geometry":f=c.parse(h.data).geometry}f.uuid=h.uuid;v
 b.aspect,b.near,b.far);break;case "OrthographicCamera":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case "AmbientLight":e=new THREE.AmbientLight(b.color);break;case "DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case "PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance);break;case "SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent);break;case "HemisphereLight":e=new THREE.HemisphereLight(b.color,
 b.groundColor,b.intensity);break;case "Mesh":e=c[b.geometry];var g=d[b.material];void 0===e&&console.error("THREE.ObjectLoader: Undefined geometry "+b.geometry);void 0===g&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,g);break;case "Sprite":g=d[b.material];void 0===g&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Sprite(g);break;case "Group":e=new THREE.Group;break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&
 (e.name=b.name);void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==b.visible&&(e.visible=b.visible);void 0!==b.userData&&(e.userData=b.userData);void 0!==b.script&&(e.script=new THREE.Script(b.script));if(void 0!==b.children)for(var f in b.children)e.add(this.parseObject(b.children[f],c,d));return e}}()};
-THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=new THREE.ImageLoader(this.manager);e.setCrossOrigin(this.crossOrigin);e.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}};
+THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=new THREE.ImageLoader(this.manager);e.setCrossOrigin(this.crossOrigin);e.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.CompressedTextureLoader=function(){this._parser=null};
+THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c){var d=this,e=[],g=new THREE.CompressedTexture;g.image=e;g.flipY=!1;g.generateMipmaps=!1;if(a instanceof Array){var f=0,h=new THREE.XHRLoader;h.setResponseType("arraybuffer");c=function(c){h.load(a[c],function(a){a=d._parser(a,!0);e[c]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};f+=1;6===f&&(g.format=a.format,g.needsUpdate=!0,b&&b(g))})};for(var k=0,m=a.length;k<m;++k)c(k)}else h=
+new THREE.XHRLoader,h.setResponseType("arraybuffer"),h.load(a,function(a){a=d._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,f=0;f<c;f++){e[f]={mipmaps:[]};for(var h=0;h<a.mipmapCount;h++)e[f].mipmaps.push(a.mipmaps[f*a.mipmapCount+h]),e[f].format=a.format,e[f].width=a.width,e[f].height=a.height}else g.image.width=a.width,g.image.height=a.height,g.mipmaps=a.mipmaps;g.format=a.format;g.needsUpdate=!0;b&&b(g)});return g}};
 THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.type="Material";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=
 !0};
 THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},toJSON:function(){var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(a.name=
@@ -333,11 +335,11 @@ THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometr
 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,g=new THREE.Vector3;return function(f,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==f.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(f.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var m=
-this.material;if(void 0!==m){var n=k.attributes,q,r,t=f.precision;if(void 0!==n.index){var s=n.index.array,p=n.position.array,v=k.offsets;0===v.length&&(v=[{start:0,count:s.length,index:0}]);for(var w=0,u=v.length;w<u;++w)for(var n=v[w].start,A=v[w].index,k=n,x=n+v[w].count;k<x;k+=3){n=A+s[k];q=A+s[k+1];r=A+s[k+2];d.set(p[3*n],p[3*n+1],p[3*n+2]);e.set(p[3*q],p[3*q+1],p[3*q+2]);g.set(p[3*r],p[3*r+1],p[3*r+2]);var G=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==
+this.material;if(void 0!==m){var n=k.attributes,q,r,t=f.precision;if(void 0!==n.index){var s=n.index.array,p=n.position.array,v=k.offsets;0===v.length&&(v=[{start:0,count:s.length,index:0}]);for(var w=0,u=v.length;w<u;++w)for(var n=v[w].start,z=v[w].index,k=n,x=n+v[w].count;k<x;k+=3){n=z+s[k];q=z+s[k+1];r=z+s[k+2];d.set(p[3*n],p[3*n+1],p[3*n+2]);e.set(p[3*q],p[3*q+1],p[3*q+2]);g.set(p[3*r],p[3*r+1],p[3*r+2]);var G=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==
 THREE.DoubleSide);if(null!==G){G.applyMatrix4(this.matrixWorld);var C=f.ray.origin.distanceTo(G);C<t||C<f.near||C>f.far||h.push({distance:C,point:G,face:new THREE.Face3(n,q,r,THREE.Triangle.normal(d,e,g)),faceIndex:null,object:this})}}}else for(p=n.position.array,s=k=0,x=p.length;k<x;k+=3,s+=9)n=k,q=k+1,r=k+2,d.set(p[s],p[s+1],p[s+2]),e.set(p[s+3],p[s+4],p[s+5]),g.set(p[s+6],p[s+7],p[s+8]),G=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==THREE.DoubleSide),
-null!==G&&(G.applyMatrix4(this.matrixWorld),C=f.ray.origin.distanceTo(G),C<t||C<f.near||C>f.far||h.push({distance:C,point:G,face:new THREE.Face3(n,q,r,THREE.Triangle.normal(d,e,g)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,p=!0===s?this.material.materials:null,t=f.precision,v=k.vertices,w=0,u=k.faces.length;w<u;w++)if(A=k.faces[w],m=!0===s?p[A.materialIndex]:this.material,void 0!==m){n=v[A.a];q=v[A.b];r=v[A.c];if(!0===
-m.morphTargets){G=k.morphTargets;C=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var x=0,B=G.length;x<B;x++){var y=C[x];if(0!==y){var D=G[x].vertices;d.x+=(D[A.a].x-n.x)*y;d.y+=(D[A.a].y-n.y)*y;d.z+=(D[A.a].z-n.z)*y;e.x+=(D[A.b].x-q.x)*y;e.y+=(D[A.b].y-q.y)*y;e.z+=(D[A.b].z-q.z)*y;g.x+=(D[A.c].x-r.x)*y;g.y+=(D[A.c].y-r.y)*y;g.z+=(D[A.c].z-r.z)*y}}d.add(n);e.add(q);g.add(r);n=d;q=e;r=g}G=m.side===THREE.BackSide?b.intersectTriangle(r,q,n,!0):b.intersectTriangle(n,q,r,m.side!==
-THREE.DoubleSide);null!==G&&(G.applyMatrix4(this.matrixWorld),C=f.ray.origin.distanceTo(G),C<t||C<f.near||C>f.far||h.push({distance:C,point:G,face:A,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
+null!==G&&(G.applyMatrix4(this.matrixWorld),C=f.ray.origin.distanceTo(G),C<t||C<f.near||C>f.far||h.push({distance:C,point:G,face:new THREE.Face3(n,q,r,THREE.Triangle.normal(d,e,g)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,p=!0===s?this.material.materials:null,t=f.precision,v=k.vertices,w=0,u=k.faces.length;w<u;w++)if(z=k.faces[w],m=!0===s?p[z.materialIndex]:this.material,void 0!==m){n=v[z.a];q=v[z.b];r=v[z.c];if(!0===
+m.morphTargets){G=k.morphTargets;C=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var x=0,B=G.length;x<B;x++){var y=C[x];if(0!==y){var D=G[x].vertices;d.x+=(D[z.a].x-n.x)*y;d.y+=(D[z.a].y-n.y)*y;d.z+=(D[z.a].z-n.z)*y;e.x+=(D[z.b].x-q.x)*y;e.y+=(D[z.b].y-q.y)*y;e.z+=(D[z.b].z-q.z)*y;g.x+=(D[z.c].x-r.x)*y;g.y+=(D[z.c].y-r.y)*y;g.z+=(D[z.c].z-r.z)*y}}d.add(n);e.add(q);g.add(r);n=d;q=e;r=g}G=m.side===THREE.BackSide?b.intersectTriangle(r,q,n,!0):b.intersectTriangle(n,q,r,m.side!==
+THREE.DoubleSide);null!==G&&(G.applyMatrix4(this.matrixWorld),C=f.ray.origin.distanceTo(G),C<t||C<f.near||C>f.far||h.push({distance:C,point:G,face:z,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
 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)}};
@@ -437,7 +439,7 @@ g.__colorArray=new Float32Array(3*k);g.__sortArray=[];g.__webglParticleCount=k;b
 object:e,opaque:null,transparent:null,z:0});e.__webglActive=!0}var s=Ta[e.id];if(s&&(!1===e.frustumCulled||!0===Ac.intersectsObject(e))){var p=e.geometry,t,x,y;if(p instanceof THREE.BufferGeometry)for(var B=p.attributes,C=p.attributesKeys,G=0,D=C.length;G<D;G++){var N=C[G],L=B[N];void 0===L.buffer&&(L.buffer=l.createBuffer(),L.needsUpdate=!0);if(!0===L.needsUpdate){var J="index"===N?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;l.bindBuffer(J,L.buffer);l.bufferData(J,L.array,l.STATIC_DRAW);L.needsUpdate=
 !1}}else if(e instanceof THREE.Mesh){(p.buffersNeedUpdate||p.groupsNeedUpdate)&&v(a,e,p);for(var Q=0,S=p.geometryGroupsList.length;Q<S;Q++)if(t=p.geometryGroupsList[Q],y=d(e,t),(p.buffersNeedUpdate||p.groupsNeedUpdate)&&c(t,e),x=y.attributes&&u(y),p.verticesNeedUpdate||p.morphTargetsNeedUpdate||p.elementsNeedUpdate||p.uvsNeedUpdate||p.normalsNeedUpdate||p.colorsNeedUpdate||p.tangentsNeedUpdate||x){var E=t,K=l.DYNAMIC_DRAW,ta=!p.dynamic,R=y;if(E.__inittedArrays){var V=R&&void 0!==R.shading&&R.shading===
 THREE.SmoothShading,M=void 0,P=void 0,Ja=void 0,W=void 0,da=void 0,xa=void 0,Na=void 0,la=void 0,va=void 0,sa=void 0,ya=void 0,X=void 0,Y=void 0,Z=void 0,ra=void 0,ha=void 0,Ia=void 0,oa=void 0,O=void 0,ub=void 0,ma=void 0,pc=void 0,ka=void 0,qc=void 0,rc=void 0,sc=void 0,Aa=void 0,Ea=void 0,Fa=void 0,ga=void 0,Xa=void 0,tb=void 0,ua=void 0,Bc=void 0,Oa=void 0,Tb=void 0,ab=void 0,nb=void 0,Gb=void 0,Mb=void 0,ib=0,Ya=0,tc=0,uc=0,wb=0,Za=0,Pa=0,bb=0,Ka=0,fa=0,qa=0,F=0,La=void 0,cb=E.__vertexArray,
-Nb=E.__uvArray,xb=E.__uv2Array,db=E.__normalArray,za=E.__tangentArray,Ma=E.__colorArray,pa=E.__skinIndexArray,Ba=E.__skinWeightArray,ec=E.__morphTargetsArrays,jb=E.__morphNormalsArrays,yb=E.__webglCustomAttributesList,z=void 0,$a=E.__faceArray,Sa=E.__lineArray,Ha=e.geometry,eb=Ha.elementsNeedUpdate,zb=Ha.uvsNeedUpdate,fb=Ha.normalsNeedUpdate,Uc=Ha.tangentsNeedUpdate,vb=Ha.colorsNeedUpdate,ea=Ha.morphTargetsNeedUpdate,Cc=Ha.vertices,H=E.faces3,$=Ha.faces,aa=Ha.faceVertexUvs[0],Ua=Ha.faceVertexUvs[1],
+Nb=E.__uvArray,xb=E.__uv2Array,db=E.__normalArray,za=E.__tangentArray,Ma=E.__colorArray,pa=E.__skinIndexArray,Ba=E.__skinWeightArray,ec=E.__morphTargetsArrays,jb=E.__morphNormalsArrays,yb=E.__webglCustomAttributesList,A=void 0,$a=E.__faceArray,Sa=E.__lineArray,Ha=e.geometry,eb=Ha.elementsNeedUpdate,zb=Ha.uvsNeedUpdate,fb=Ha.normalsNeedUpdate,Uc=Ha.tangentsNeedUpdate,vb=Ha.colorsNeedUpdate,ea=Ha.morphTargetsNeedUpdate,Cc=Ha.vertices,H=E.faces3,$=Ha.faces,aa=Ha.faceVertexUvs[0],Ua=Ha.faceVertexUvs[1],
 wa=Ha.skinIndices,Yb=Ha.skinWeights,Zb=Ha.morphTargets,$b=Ha.morphNormals;if(Ha.verticesNeedUpdate){M=0;for(P=H.length;M<P;M++)W=$[H[M]],X=Cc[W.a],Y=Cc[W.b],Z=Cc[W.c],cb[Ya]=X.x,cb[Ya+1]=X.y,cb[Ya+2]=X.z,cb[Ya+3]=Y.x,cb[Ya+4]=Y.y,cb[Ya+5]=Y.z,cb[Ya+6]=Z.x,cb[Ya+7]=Z.y,cb[Ya+8]=Z.z,Ya+=9;l.bindBuffer(l.ARRAY_BUFFER,E.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,cb,K)}if(ea)for(Oa=0,Tb=Zb.length;Oa<Tb;Oa++){M=qa=0;for(P=H.length;M<P;M++)Gb=H[M],W=$[Gb],X=Zb[Oa].vertices[W.a],Y=Zb[Oa].vertices[W.b],
 Z=Zb[Oa].vertices[W.c],ab=ec[Oa],ab[qa]=X.x,ab[qa+1]=X.y,ab[qa+2]=X.z,ab[qa+3]=Y.x,ab[qa+4]=Y.y,ab[qa+5]=Y.z,ab[qa+6]=Z.x,ab[qa+7]=Z.y,ab[qa+8]=Z.z,R.morphNormals&&(V?(Mb=$b[Oa].vertexNormals[Gb],oa=Mb.a,O=Mb.b,ub=Mb.c):ub=O=oa=$b[Oa].faceNormals[Gb],nb=jb[Oa],nb[qa]=oa.x,nb[qa+1]=oa.y,nb[qa+2]=oa.z,nb[qa+3]=O.x,nb[qa+4]=O.y,nb[qa+5]=O.z,nb[qa+6]=ub.x,nb[qa+7]=ub.y,nb[qa+8]=ub.z),qa+=9;l.bindBuffer(l.ARRAY_BUFFER,E.__webglMorphTargetsBuffers[Oa]);l.bufferData(l.ARRAY_BUFFER,ec[Oa],K);R.morphNormals&&
 (l.bindBuffer(l.ARRAY_BUFFER,E.__webglMorphNormalsBuffers[Oa]),l.bufferData(l.ARRAY_BUFFER,jb[Oa],K))}if(Yb.length){M=0;for(P=H.length;M<P;M++)W=$[H[M]],qc=Yb[W.a],rc=Yb[W.b],sc=Yb[W.c],Ba[fa]=qc.x,Ba[fa+1]=qc.y,Ba[fa+2]=qc.z,Ba[fa+3]=qc.w,Ba[fa+4]=rc.x,Ba[fa+5]=rc.y,Ba[fa+6]=rc.z,Ba[fa+7]=rc.w,Ba[fa+8]=sc.x,Ba[fa+9]=sc.y,Ba[fa+10]=sc.z,Ba[fa+11]=sc.w,Aa=wa[W.a],Ea=wa[W.b],Fa=wa[W.c],pa[fa]=Aa.x,pa[fa+1]=Aa.y,pa[fa+2]=Aa.z,pa[fa+3]=Aa.w,pa[fa+4]=Ea.x,pa[fa+5]=Ea.y,pa[fa+6]=Ea.z,pa[fa+7]=Ea.w,pa[fa+
@@ -445,30 +447,30 @@ Z=Zb[Oa].vertices[W.c],ab=ec[Oa],ab[qa]=X.x,ab[qa+1]=X.y,ab[qa+2]=X.z,ab[qa+3]=Y
 ka.r,Ma[Ka+7]=ka.g,Ma[Ka+8]=ka.b,Ka+=9;0<Ka&&(l.bindBuffer(l.ARRAY_BUFFER,E.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,Ma,K))}if(Uc&&Ha.hasTangents){M=0;for(P=H.length;M<P;M++)W=$[H[M]],va=W.vertexTangents,ra=va[0],ha=va[1],Ia=va[2],za[Pa]=ra.x,za[Pa+1]=ra.y,za[Pa+2]=ra.z,za[Pa+3]=ra.w,za[Pa+4]=ha.x,za[Pa+5]=ha.y,za[Pa+6]=ha.z,za[Pa+7]=ha.w,za[Pa+8]=Ia.x,za[Pa+9]=Ia.y,za[Pa+10]=Ia.z,za[Pa+11]=Ia.w,Pa+=12;l.bindBuffer(l.ARRAY_BUFFER,E.__webglTangentBuffer);l.bufferData(l.ARRAY_BUFFER,za,K)}if(fb){M=
 0;for(P=H.length;M<P;M++)if(W=$[H[M]],da=W.vertexNormals,xa=W.normal,3===da.length&&V)for(ga=0;3>ga;ga++)tb=da[ga],db[Za]=tb.x,db[Za+1]=tb.y,db[Za+2]=tb.z,Za+=3;else for(ga=0;3>ga;ga++)db[Za]=xa.x,db[Za+1]=xa.y,db[Za+2]=xa.z,Za+=3;l.bindBuffer(l.ARRAY_BUFFER,E.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,db,K)}if(zb&&aa){M=0;for(P=H.length;M<P;M++)if(Ja=H[M],sa=aa[Ja],void 0!==sa)for(ga=0;3>ga;ga++)ua=sa[ga],Nb[tc]=ua.x,Nb[tc+1]=ua.y,tc+=2;0<tc&&(l.bindBuffer(l.ARRAY_BUFFER,E.__webglUVBuffer),
 l.bufferData(l.ARRAY_BUFFER,Nb,K))}if(zb&&Ua){M=0;for(P=H.length;M<P;M++)if(Ja=H[M],ya=Ua[Ja],void 0!==ya)for(ga=0;3>ga;ga++)Bc=ya[ga],xb[uc]=Bc.x,xb[uc+1]=Bc.y,uc+=2;0<uc&&(l.bindBuffer(l.ARRAY_BUFFER,E.__webglUV2Buffer),l.bufferData(l.ARRAY_BUFFER,xb,K))}if(eb){M=0;for(P=H.length;M<P;M++)$a[wb]=ib,$a[wb+1]=ib+1,$a[wb+2]=ib+2,wb+=3,Sa[bb]=ib,Sa[bb+1]=ib+1,Sa[bb+2]=ib,Sa[bb+3]=ib+2,Sa[bb+4]=ib+1,Sa[bb+5]=ib+2,bb+=6,ib+=3;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,E.__webglFaceBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,
-$a,K);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,E.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,Sa,K)}if(yb)for(ga=0,Xa=yb.length;ga<Xa;ga++)if(z=yb[ga],z.__original.needsUpdate){F=0;if(1===z.size)if(void 0===z.boundTo||"vertices"===z.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],z.array[F]=z.value[W.a],z.array[F+1]=z.value[W.b],z.array[F+2]=z.value[W.c],F+=3;else{if("faces"===z.boundTo)for(M=0,P=H.length;M<P;M++)La=z.value[H[M]],z.array[F]=La,z.array[F+1]=La,z.array[F+2]=La,F+=3}else if(2===z.size)if(void 0===
-z.boundTo||"vertices"===z.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],X=z.value[W.a],Y=z.value[W.b],Z=z.value[W.c],z.array[F]=X.x,z.array[F+1]=X.y,z.array[F+2]=Y.x,z.array[F+3]=Y.y,z.array[F+4]=Z.x,z.array[F+5]=Z.y,F+=6;else{if("faces"===z.boundTo)for(M=0,P=H.length;M<P;M++)Z=Y=X=La=z.value[H[M]],z.array[F]=X.x,z.array[F+1]=X.y,z.array[F+2]=Y.x,z.array[F+3]=Y.y,z.array[F+4]=Z.x,z.array[F+5]=Z.y,F+=6}else if(3===z.size){var ba;ba="c"===z.type?["r","g","b"]:["x","y","z"];if(void 0===z.boundTo||"vertices"===
-z.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],X=z.value[W.a],Y=z.value[W.b],Z=z.value[W.c],z.array[F]=X[ba[0]],z.array[F+1]=X[ba[1]],z.array[F+2]=X[ba[2]],z.array[F+3]=Y[ba[0]],z.array[F+4]=Y[ba[1]],z.array[F+5]=Y[ba[2]],z.array[F+6]=Z[ba[0]],z.array[F+7]=Z[ba[1]],z.array[F+8]=Z[ba[2]],F+=9;else if("faces"===z.boundTo)for(M=0,P=H.length;M<P;M++)Z=Y=X=La=z.value[H[M]],z.array[F]=X[ba[0]],z.array[F+1]=X[ba[1]],z.array[F+2]=X[ba[2]],z.array[F+3]=Y[ba[0]],z.array[F+4]=Y[ba[1]],z.array[F+5]=Y[ba[2]],
-z.array[F+6]=Z[ba[0]],z.array[F+7]=Z[ba[1]],z.array[F+8]=Z[ba[2]],F+=9;else if("faceVertices"===z.boundTo)for(M=0,P=H.length;M<P;M++)La=z.value[H[M]],X=La[0],Y=La[1],Z=La[2],z.array[F]=X[ba[0]],z.array[F+1]=X[ba[1]],z.array[F+2]=X[ba[2]],z.array[F+3]=Y[ba[0]],z.array[F+4]=Y[ba[1]],z.array[F+5]=Y[ba[2]],z.array[F+6]=Z[ba[0]],z.array[F+7]=Z[ba[1]],z.array[F+8]=Z[ba[2]],F+=9}else if(4===z.size)if(void 0===z.boundTo||"vertices"===z.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],X=z.value[W.a],Y=z.value[W.b],
-Z=z.value[W.c],z.array[F]=X.x,z.array[F+1]=X.y,z.array[F+2]=X.z,z.array[F+3]=X.w,z.array[F+4]=Y.x,z.array[F+5]=Y.y,z.array[F+6]=Y.z,z.array[F+7]=Y.w,z.array[F+8]=Z.x,z.array[F+9]=Z.y,z.array[F+10]=Z.z,z.array[F+11]=Z.w,F+=12;else if("faces"===z.boundTo)for(M=0,P=H.length;M<P;M++)Z=Y=X=La=z.value[H[M]],z.array[F]=X.x,z.array[F+1]=X.y,z.array[F+2]=X.z,z.array[F+3]=X.w,z.array[F+4]=Y.x,z.array[F+5]=Y.y,z.array[F+6]=Y.z,z.array[F+7]=Y.w,z.array[F+8]=Z.x,z.array[F+9]=Z.y,z.array[F+10]=Z.z,z.array[F+11]=
-Z.w,F+=12;else if("faceVertices"===z.boundTo)for(M=0,P=H.length;M<P;M++)La=z.value[H[M]],X=La[0],Y=La[1],Z=La[2],z.array[F]=X.x,z.array[F+1]=X.y,z.array[F+2]=X.z,z.array[F+3]=X.w,z.array[F+4]=Y.x,z.array[F+5]=Y.y,z.array[F+6]=Y.z,z.array[F+7]=Y.w,z.array[F+8]=Z.x,z.array[F+9]=Z.y,z.array[F+10]=Z.z,z.array[F+11]=Z.w,F+=12;l.bindBuffer(l.ARRAY_BUFFER,z.buffer);l.bufferData(l.ARRAY_BUFFER,z.array,K)}ta&&(delete E.__inittedArrays,delete E.__colorArray,delete E.__normalArray,delete E.__tangentArray,delete E.__uvArray,
-delete E.__uv2Array,delete E.__faceArray,delete E.__vertexArray,delete E.__lineArray,delete E.__skinIndexArray,delete E.__skinWeightArray)}}p.verticesNeedUpdate=!1;p.morphTargetsNeedUpdate=!1;p.elementsNeedUpdate=!1;p.uvsNeedUpdate=!1;p.normalsNeedUpdate=!1;p.colorsNeedUpdate=!1;p.tangentsNeedUpdate=!1;p.buffersNeedUpdate=!1;y.attributes&&A(y)}else if(e instanceof THREE.Line){y=d(e,p);x=y.attributes&&u(y);if(p.verticesNeedUpdate||p.colorsNeedUpdate||p.lineDistancesNeedUpdate||x){var ac=l.DYNAMIC_DRAW,
+$a,K);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,E.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,Sa,K)}if(yb)for(ga=0,Xa=yb.length;ga<Xa;ga++)if(A=yb[ga],A.__original.needsUpdate){F=0;if(1===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],A.array[F]=A.value[W.a],A.array[F+1]=A.value[W.b],A.array[F+2]=A.value[W.c],F+=3;else{if("faces"===A.boundTo)for(M=0,P=H.length;M<P;M++)La=A.value[H[M]],A.array[F]=La,A.array[F+1]=La,A.array[F+2]=La,F+=3}else if(2===A.size)if(void 0===
+A.boundTo||"vertices"===A.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],X=A.value[W.a],Y=A.value[W.b],Z=A.value[W.c],A.array[F]=X.x,A.array[F+1]=X.y,A.array[F+2]=Y.x,A.array[F+3]=Y.y,A.array[F+4]=Z.x,A.array[F+5]=Z.y,F+=6;else{if("faces"===A.boundTo)for(M=0,P=H.length;M<P;M++)Z=Y=X=La=A.value[H[M]],A.array[F]=X.x,A.array[F+1]=X.y,A.array[F+2]=Y.x,A.array[F+3]=Y.y,A.array[F+4]=Z.x,A.array[F+5]=Z.y,F+=6}else if(3===A.size){var ba;ba="c"===A.type?["r","g","b"]:["x","y","z"];if(void 0===A.boundTo||"vertices"===
+A.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],X=A.value[W.a],Y=A.value[W.b],Z=A.value[W.c],A.array[F]=X[ba[0]],A.array[F+1]=X[ba[1]],A.array[F+2]=X[ba[2]],A.array[F+3]=Y[ba[0]],A.array[F+4]=Y[ba[1]],A.array[F+5]=Y[ba[2]],A.array[F+6]=Z[ba[0]],A.array[F+7]=Z[ba[1]],A.array[F+8]=Z[ba[2]],F+=9;else if("faces"===A.boundTo)for(M=0,P=H.length;M<P;M++)Z=Y=X=La=A.value[H[M]],A.array[F]=X[ba[0]],A.array[F+1]=X[ba[1]],A.array[F+2]=X[ba[2]],A.array[F+3]=Y[ba[0]],A.array[F+4]=Y[ba[1]],A.array[F+5]=Y[ba[2]],
+A.array[F+6]=Z[ba[0]],A.array[F+7]=Z[ba[1]],A.array[F+8]=Z[ba[2]],F+=9;else if("faceVertices"===A.boundTo)for(M=0,P=H.length;M<P;M++)La=A.value[H[M]],X=La[0],Y=La[1],Z=La[2],A.array[F]=X[ba[0]],A.array[F+1]=X[ba[1]],A.array[F+2]=X[ba[2]],A.array[F+3]=Y[ba[0]],A.array[F+4]=Y[ba[1]],A.array[F+5]=Y[ba[2]],A.array[F+6]=Z[ba[0]],A.array[F+7]=Z[ba[1]],A.array[F+8]=Z[ba[2]],F+=9}else if(4===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],X=A.value[W.a],Y=A.value[W.b],
+Z=A.value[W.c],A.array[F]=X.x,A.array[F+1]=X.y,A.array[F+2]=X.z,A.array[F+3]=X.w,A.array[F+4]=Y.x,A.array[F+5]=Y.y,A.array[F+6]=Y.z,A.array[F+7]=Y.w,A.array[F+8]=Z.x,A.array[F+9]=Z.y,A.array[F+10]=Z.z,A.array[F+11]=Z.w,F+=12;else if("faces"===A.boundTo)for(M=0,P=H.length;M<P;M++)Z=Y=X=La=A.value[H[M]],A.array[F]=X.x,A.array[F+1]=X.y,A.array[F+2]=X.z,A.array[F+3]=X.w,A.array[F+4]=Y.x,A.array[F+5]=Y.y,A.array[F+6]=Y.z,A.array[F+7]=Y.w,A.array[F+8]=Z.x,A.array[F+9]=Z.y,A.array[F+10]=Z.z,A.array[F+11]=
+Z.w,F+=12;else if("faceVertices"===A.boundTo)for(M=0,P=H.length;M<P;M++)La=A.value[H[M]],X=La[0],Y=La[1],Z=La[2],A.array[F]=X.x,A.array[F+1]=X.y,A.array[F+2]=X.z,A.array[F+3]=X.w,A.array[F+4]=Y.x,A.array[F+5]=Y.y,A.array[F+6]=Y.z,A.array[F+7]=Y.w,A.array[F+8]=Z.x,A.array[F+9]=Z.y,A.array[F+10]=Z.z,A.array[F+11]=Z.w,F+=12;l.bindBuffer(l.ARRAY_BUFFER,A.buffer);l.bufferData(l.ARRAY_BUFFER,A.array,K)}ta&&(delete E.__inittedArrays,delete E.__colorArray,delete E.__normalArray,delete E.__tangentArray,delete E.__uvArray,
+delete E.__uv2Array,delete E.__faceArray,delete E.__vertexArray,delete E.__lineArray,delete E.__skinIndexArray,delete E.__skinWeightArray)}}p.verticesNeedUpdate=!1;p.morphTargetsNeedUpdate=!1;p.elementsNeedUpdate=!1;p.uvsNeedUpdate=!1;p.normalsNeedUpdate=!1;p.colorsNeedUpdate=!1;p.tangentsNeedUpdate=!1;p.buffersNeedUpdate=!1;y.attributes&&z(y)}else if(e instanceof THREE.Line){y=d(e,p);x=y.attributes&&u(y);if(p.verticesNeedUpdate||p.colorsNeedUpdate||p.lineDistancesNeedUpdate||x){var ac=l.DYNAMIC_DRAW,
 Ob,ob,Pb,pb,ia,Ab,Ub=p.vertices,Xb=p.colors,Fb=p.lineDistances,Lb=Ub.length,Jb=Xb.length,Vb=Fb.length,kb=p.__vertexArray,lb=p.__colorArray,Kb=p.__lineDistanceArray,mc=p.colorsNeedUpdate,nc=p.lineDistancesNeedUpdate,mb=p.__webglCustomAttributesList,gb,sb,Da,ic,Va,na;if(p.verticesNeedUpdate){for(Ob=0;Ob<Lb;Ob++)pb=Ub[Ob],ia=3*Ob,kb[ia]=pb.x,kb[ia+1]=pb.y,kb[ia+2]=pb.z;l.bindBuffer(l.ARRAY_BUFFER,p.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,kb,ac)}if(mc){for(ob=0;ob<Jb;ob++)Ab=Xb[ob],ia=3*ob,lb[ia]=
 Ab.r,lb[ia+1]=Ab.g,lb[ia+2]=Ab.b;l.bindBuffer(l.ARRAY_BUFFER,p.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,lb,ac)}if(nc){for(Pb=0;Pb<Vb;Pb++)Kb[Pb]=Fb[Pb];l.bindBuffer(l.ARRAY_BUFFER,p.__webglLineDistanceBuffer);l.bufferData(l.ARRAY_BUFFER,Kb,ac)}if(mb)for(gb=0,sb=mb.length;gb<sb;gb++)if(na=mb[gb],na.needsUpdate&&(void 0===na.boundTo||"vertices"===na.boundTo)){ia=0;ic=na.value.length;if(1===na.size)for(Da=0;Da<ic;Da++)na.array[Da]=na.value[Da];else if(2===na.size)for(Da=0;Da<ic;Da++)Va=na.value[Da],
 na.array[ia]=Va.x,na.array[ia+1]=Va.y,ia+=2;else if(3===na.size)if("c"===na.type)for(Da=0;Da<ic;Da++)Va=na.value[Da],na.array[ia]=Va.r,na.array[ia+1]=Va.g,na.array[ia+2]=Va.b,ia+=3;else for(Da=0;Da<ic;Da++)Va=na.value[Da],na.array[ia]=Va.x,na.array[ia+1]=Va.y,na.array[ia+2]=Va.z,ia+=3;else if(4===na.size)for(Da=0;Da<ic;Da++)Va=na.value[Da],na.array[ia]=Va.x,na.array[ia+1]=Va.y,na.array[ia+2]=Va.z,na.array[ia+3]=Va.w,ia+=4;l.bindBuffer(l.ARRAY_BUFFER,na.buffer);l.bufferData(l.ARRAY_BUFFER,na.array,
-ac)}}p.verticesNeedUpdate=!1;p.colorsNeedUpdate=!1;p.lineDistancesNeedUpdate=!1;y.attributes&&A(y)}else if(e instanceof THREE.PointCloud){y=d(e,p);x=y.attributes&&u(y);if(p.verticesNeedUpdate||p.colorsNeedUpdate||e.sortParticles||x){var fc=l.DYNAMIC_DRAW,Wa,Bb,Cb,U,Db,Qb,wc=p.vertices,gc=wc.length,hc=p.colors,kc=hc.length,bc=p.__vertexArray,cc=p.__colorArray,Hb=p.__sortArray,Wb=p.verticesNeedUpdate,lc=p.colorsNeedUpdate,Ib=p.__webglCustomAttributesList,qb,jc,ca,rb,ja,T;if(e.sortParticles){Dc.copy(xc);
+ac)}}p.verticesNeedUpdate=!1;p.colorsNeedUpdate=!1;p.lineDistancesNeedUpdate=!1;y.attributes&&z(y)}else if(e instanceof THREE.PointCloud){y=d(e,p);x=y.attributes&&u(y);if(p.verticesNeedUpdate||p.colorsNeedUpdate||e.sortParticles||x){var fc=l.DYNAMIC_DRAW,Wa,Bb,Cb,U,Db,Qb,wc=p.vertices,gc=wc.length,hc=p.colors,kc=hc.length,bc=p.__vertexArray,cc=p.__colorArray,Hb=p.__sortArray,Wb=p.verticesNeedUpdate,lc=p.colorsNeedUpdate,Ib=p.__webglCustomAttributesList,qb,jc,ca,rb,ja,T;if(e.sortParticles){Dc.copy(xc);
 Dc.multiply(e.matrixWorld);for(Wa=0;Wa<gc;Wa++)Cb=wc[Wa],Qa.copy(Cb),Qa.applyProjection(Dc),Hb[Wa]=[Qa.z,Wa];Hb.sort(n);for(Wa=0;Wa<gc;Wa++)Cb=wc[Hb[Wa][1]],U=3*Wa,bc[U]=Cb.x,bc[U+1]=Cb.y,bc[U+2]=Cb.z;for(Bb=0;Bb<kc;Bb++)U=3*Bb,Qb=hc[Hb[Bb][1]],cc[U]=Qb.r,cc[U+1]=Qb.g,cc[U+2]=Qb.b;if(Ib)for(qb=0,jc=Ib.length;qb<jc;qb++)if(T=Ib[qb],void 0===T.boundTo||"vertices"===T.boundTo)if(U=0,rb=T.value.length,1===T.size)for(ca=0;ca<rb;ca++)Db=Hb[ca][1],T.array[ca]=T.value[Db];else if(2===T.size)for(ca=0;ca<rb;ca++)Db=
 Hb[ca][1],ja=T.value[Db],T.array[U]=ja.x,T.array[U+1]=ja.y,U+=2;else if(3===T.size)if("c"===T.type)for(ca=0;ca<rb;ca++)Db=Hb[ca][1],ja=T.value[Db],T.array[U]=ja.r,T.array[U+1]=ja.g,T.array[U+2]=ja.b,U+=3;else for(ca=0;ca<rb;ca++)Db=Hb[ca][1],ja=T.value[Db],T.array[U]=ja.x,T.array[U+1]=ja.y,T.array[U+2]=ja.z,U+=3;else if(4===T.size)for(ca=0;ca<rb;ca++)Db=Hb[ca][1],ja=T.value[Db],T.array[U]=ja.x,T.array[U+1]=ja.y,T.array[U+2]=ja.z,T.array[U+3]=ja.w,U+=4}else{if(Wb)for(Wa=0;Wa<gc;Wa++)Cb=wc[Wa],U=3*
 Wa,bc[U]=Cb.x,bc[U+1]=Cb.y,bc[U+2]=Cb.z;if(lc)for(Bb=0;Bb<kc;Bb++)Qb=hc[Bb],U=3*Bb,cc[U]=Qb.r,cc[U+1]=Qb.g,cc[U+2]=Qb.b;if(Ib)for(qb=0,jc=Ib.length;qb<jc;qb++)if(T=Ib[qb],T.needsUpdate&&(void 0===T.boundTo||"vertices"===T.boundTo))if(rb=T.value.length,U=0,1===T.size)for(ca=0;ca<rb;ca++)T.array[ca]=T.value[ca];else if(2===T.size)for(ca=0;ca<rb;ca++)ja=T.value[ca],T.array[U]=ja.x,T.array[U+1]=ja.y,U+=2;else if(3===T.size)if("c"===T.type)for(ca=0;ca<rb;ca++)ja=T.value[ca],T.array[U]=ja.r,T.array[U+1]=
 ja.g,T.array[U+2]=ja.b,U+=3;else for(ca=0;ca<rb;ca++)ja=T.value[ca],T.array[U]=ja.x,T.array[U+1]=ja.y,T.array[U+2]=ja.z,U+=3;else if(4===T.size)for(ca=0;ca<rb;ca++)ja=T.value[ca],T.array[U]=ja.x,T.array[U+1]=ja.y,T.array[U+2]=ja.z,T.array[U+3]=ja.w,U+=4}if(Wb||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,p.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,bc,fc);if(lc||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,p.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,cc,fc);if(Ib)for(qb=0,jc=Ib.length;qb<
-jc;qb++)if(T=Ib[qb],T.needsUpdate||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,T.buffer),l.bufferData(l.ARRAY_BUFFER,T.array,fc)}p.verticesNeedUpdate=!1;p.colorsNeedUpdate=!1;y.attributes&&A(y)}for(var dc=0,Eb=s.length;dc<Eb;dc++){var yc=s[dc],Rb=yc,oc=Rb.object,vc=Rb.buffer,zc=oc.geometry,Sb=oc.material;Sb instanceof THREE.MeshFaceMaterial?(Sb=Sb.materials[zc instanceof THREE.BufferGeometry?0:vc.materialIndex],Rb.material=Sb,Sb.transparent?Ra.push(Rb):hb.push(Rb)):Sb&&(Rb.material=Sb,Sb.transparent?
+jc;qb++)if(T=Ib[qb],T.needsUpdate||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,T.buffer),l.bufferData(l.ARRAY_BUFFER,T.array,fc)}p.verticesNeedUpdate=!1;p.colorsNeedUpdate=!1;y.attributes&&z(y)}for(var dc=0,Eb=s.length;dc<Eb;dc++){var yc=s[dc],Rb=yc,oc=Rb.object,vc=Rb.buffer,zc=oc.geometry,Sb=oc.material;Sb instanceof THREE.MeshFaceMaterial?(Sb=Sb.materials[zc instanceof THREE.BufferGeometry?0:vc.materialIndex],Rb.material=Sb,Sb.transparent?Ra.push(Rb):hb.push(Rb)):Sb&&(Rb.material=Sb,Sb.transparent?
 Ra.push(Rb):hb.push(Rb));yc.render=!0;!0===I.sortObjects&&(null!==e.renderDepth?yc.z=e.renderDepth:(Qa.setFromMatrixPosition(e.matrixWorld),Qa.applyProjection(xc),yc.z=Qa.z))}}}dc=0;for(Eb=e.children.length;dc<Eb;dc++)q(a,e.children[dc],f)}}function r(a,b,c){if(0!==a.length)for(var d=0,e=a.length;d<e;d++)a[d].render(b,c,zc,Gc)}function t(a,b,c,d,e,g){for(var f,h,k,l=a.length-1;-1!==l;l--){f=a[l];h=f.object;k=f.buffer;B(h,b);if(g)f=g;else{f=f.material;if(!f)continue;e&&I.setBlending(f.blending,f.blendEquation,
 f.blendSrc,f.blendDst);I.setDepthTest(f.depthTest);I.setDepthWrite(f.depthWrite);N(f.polygonOffset,f.polygonOffsetFactor,f.polygonOffsetUnits)}I.setMaterialFaces(f);k instanceof THREE.BufferGeometry?I.renderBufferDirect(b,c,d,f,k,h):I.renderBuffer(b,c,d,f,k,h)}}function s(a,b,c,d,e,f,g){for(var h,k,l=0,m=a.length;l<m;l++)if(h=a[l],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&I.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);I.setDepthTest(h.depthTest);I.setDepthWrite(h.depthWrite);
 N(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}I.renderImmediateObject(c,d,e,h,k)}}function p(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function v(a,b,d){var e=!1;a=b.material;if(void 0===d.geometryGroups||d.groupsNeedUpdate)delete Ta[b.id],d.makeGroups(a instanceof THREE.MeshFaceMaterial,Fb?4294967296:65535),d.groupsNeedUpdate=!1;for(var f=0,g=d.geometryGroupsList.length;f<g;f++){a=d.geometryGroupsList[f];if(a.__webglVertexBuffer)e=
 !1;else{e=a;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();var h=void 0,k=void 0;if(e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],h=0,k=e.numMorphTargets;h<
 k;h++)e.__webglMorphTargetsBuffers.push(l.createBuffer());if(e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],h=0,k=e.numMorphNormals;h<k;h++)e.__webglMorphNormalsBuffers.push(l.createBuffer());I.info.memory.geometries++;c(a,b);d.verticesNeedUpdate=!0;d.morphTargetsNeedUpdate=!0;d.elementsNeedUpdate=!0;d.uvsNeedUpdate=!0;d.normalsNeedUpdate=!0;d.tangentsNeedUpdate=!0;e=d.colorsNeedUpdate=!0}(e||void 0===b.__webglActive)&&w(Ta,a,b)}b.__webglActive=!0}function w(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 u(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function A(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function x(a,b,c,d,e){var f,g,h,k;ec=0;if(d.needsUpdate){d.program&&Hc(d);d.addEventListener("dispose",Ic);var m;d instanceof THREE.MeshDepthMaterial?m="depth":d instanceof THREE.MeshNormalMaterial?m="normal":d instanceof THREE.MeshBasicMaterial?m="basic":d instanceof THREE.MeshLambertMaterial?
+a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function u(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function z(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function x(a,b,c,d,e){var f,g,h,k;ec=0;if(d.needsUpdate){d.program&&Hc(d);d.addEventListener("dispose",Ic);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,r=0,s=0,t=0,q=0,
-u=b.length;q<u;q++){var v=b[q];v.onlyShadow||!1===v.visible||(v instanceof THREE.DirectionalLight&&p++,v instanceof THREE.PointLight&&r++,v instanceof THREE.SpotLight&&s++,v instanceof THREE.HemisphereLight&&t++)}f=p;g=r;h=s;k=t;for(var w,x=0,A=0,B=b.length;A<B;A++){var N=b[A];N.castShadow&&(N instanceof THREE.SpotLight&&x++,N instanceof THREE.DirectionalLight&&!N.shadowCascade&&x++)}w=x;var J;if(fc&&e&&e.skeleton&&e.skeleton.useVertexTexture)J=1024;else{var K=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),
+u=b.length;q<u;q++){var v=b[q];v.onlyShadow||!1===v.visible||(v instanceof THREE.DirectionalLight&&p++,v instanceof THREE.PointLight&&r++,v instanceof THREE.SpotLight&&s++,v instanceof THREE.HemisphereLight&&t++)}f=p;g=r;h=s;k=t;for(var w,x=0,z=0,B=b.length;z<B;z++){var N=b[z];N.castShadow&&(N instanceof THREE.SpotLight&&x++,N instanceof THREE.DirectionalLight&&!N.shadowCascade&&x++)}w=x;var J;if(fc&&e&&e.skeleton&&e.skeleton.useVertexTexture)J=1024;else{var K=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),
 ta=Math.floor((K-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(ta=Math.min(e.skeleton.bones.length,ta),ta<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+ta+" (try OpenGL instead of ANGLE)"));J=ta}var R={precision:P,supportsVertexTextures:gc,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:Ia,skinning:d.skinning,maxBones:J,useVertexTexture:fc&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:I.maxMorphTargets,maxMorphNormals:I.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:w,shadowMapEnabled:I.shadowMapEnabled&&e.receiveShadow&&0<w,shadowMapType:I.shadowMapType,shadowMapDebug:I.shadowMapDebug,
 shadowMapCascade:I.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},M=[];m?M.push(m):(M.push(d.fragmentShader),M.push(d.vertexShader));if(void 0!==d.defines)for(var V in d.defines)M.push(V),M.push(d.defines[V]);for(V in R)M.push(V),M.push(R[V]);for(var Ga=M.join(),W,Ta=0,Ja=Na.length;Ta<Ja;Ta++){var da=Na[Ta];if(da.code===Ga){W=da;W.usedTimes++;break}}void 0===W&&(W=new THREE.WebGLProgram(I,Ga,d,R),
@@ -486,8 +488,8 @@ pa.spot.anglesCos;O.spotLightExponent.value=pa.spot.exponents;O.hemisphereLightS
 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 Ba;d.map?Ba=d.map:d.specularMap?Ba=d.specularMap:d.normalMap?Ba=d.normalMap:d.bumpMap?Ba=d.bumpMap:d.alphaMap&&(Ba=d.alphaMap);if(void 0!==Ba){var vb=Ba.offset,Eb=Ba.repeat;O.offsetRepeat.value.set(vb.x,vb.y,Eb.x,Eb.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 instanceof THREE.CubeRefractionMapping}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=L.height/2,O.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(O.shininess.value=d.shininess,I.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?(I.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 yb=0,z=0,Kb=b.length;z<Kb;z++){var Sa=
-b[z];Sa.castShadow&&(Sa instanceof THREE.SpotLight||Sa instanceof THREE.DirectionalLight&&!Sa.shadowCascade)&&(O.shadowMap.value[yb]=Sa.shadowMap,O.shadowMapSize.value[yb]=Sa.shadowMapSize,O.shadowMatrix.value[yb]=Sa.shadowMatrix,O.shadowDarkness.value[yb]=Sa.shadowDarkness,O.shadowBias.value[yb]=Sa.shadowBias,yb++)}for(var Ha=d.uniformsList,eb,zb,fb,sb=0,Lb=Ha.length;sb<Lb;sb++){var ea=Ha[sb][0];if(!1!==ea.needsUpdate){var Jb=ea.type,H=ea.value,$=Ha[sb][1];switch(Jb){case "1i":l.uniform1i($,H);break;
+THREE.MeshLambertMaterial?(I.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 yb=0,A=0,Kb=b.length;A<Kb;A++){var Sa=
+b[A];Sa.castShadow&&(Sa instanceof THREE.SpotLight||Sa instanceof THREE.DirectionalLight&&!Sa.shadowCascade)&&(O.shadowMap.value[yb]=Sa.shadowMap,O.shadowMapSize.value[yb]=Sa.shadowMapSize,O.shadowMatrix.value[yb]=Sa.shadowMatrix,O.shadowDarkness.value[yb]=Sa.shadowDarkness,O.shadowBias.value[yb]=Sa.shadowBias,yb++)}for(var Ha=d.uniformsList,eb,zb,fb,sb=0,Lb=Ha.length;sb<Lb;sb++){var ea=Ha[sb][0];if(!1!==ea.needsUpdate){var Jb=ea.type,H=ea.value,$=Ha[sb][1];switch(Jb){case "1i":l.uniform1i($,H);break;
 case "1f":l.uniform1f($,H);break;case "2f":l.uniform2f($,H[0],H[1]);break;case "3f":l.uniform3f($,H[0],H[1],H[2]);break;case "4f":l.uniform4f($,H[0],H[1],H[2],H[3]);break;case "1iv":l.uniform1iv($,H);break;case "3iv":l.uniform3iv($,H);break;case "1fv":l.uniform1fv($,H);break;case "2fv":l.uniform2fv($,H);break;case "3fv":l.uniform3fv($,H);break;case "4fv":l.uniform4fv($,H);break;case "Matrix3fv":l.uniformMatrix3fv($,!1,H);break;case "Matrix4fv":l.uniformMatrix4fv($,!1,H);break;case "i":l.uniform1i($,
 H);break;case "f":l.uniform1f($,H);break;case "v2":l.uniform2f($,H.x,H.y);break;case "v3":l.uniform3f($,H.x,H.y,H.z);break;case "v4":l.uniform4f($,H.x,H.y,H.z,H.w);break;case "c":l.uniform3f($,H.r,H.g,H.b);break;case "iv1":l.uniform1iv($,H);break;case "iv":l.uniform3iv($,H);break;case "fv1":l.uniform1fv($,H);break;case "fv":l.uniform3fv($,H);break;case "v2v":void 0===ea._array&&(ea._array=new Float32Array(2*H.length));for(var aa=0,Ua=H.length;aa<Ua;aa++)fb=2*aa,ea._array[fb]=H[aa].x,ea._array[fb+
 1]=H[aa].y;l.uniform2fv($,ea._array);break;case "v3v":void 0===ea._array&&(ea._array=new Float32Array(3*H.length));aa=0;for(Ua=H.length;aa<Ua;aa++)fb=3*aa,ea._array[fb]=H[aa].x,ea._array[fb+1]=H[aa].y,ea._array[fb+2]=H[aa].z;l.uniform3fv($,ea._array);break;case "v4v":void 0===ea._array&&(ea._array=new Float32Array(4*H.length));aa=0;for(Ua=H.length;aa<Ua;aa++)fb=4*aa,ea._array[fb]=H[aa].x,ea._array[fb+1]=H[aa].y,ea._array[fb+2]=H[aa].z,ea._array[fb+3]=H[aa].w;l.uniform4fv($,ea._array);break;case "m3":l.uniformMatrix3fv($,
@@ -584,8 +586,8 @@ a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=Stri
 break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d;n=b[a++]*c;t=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(t,s,k,n);if(f=g[g.length-1])for(q=f.x,r=f.y,f=1,h=this.divisions;f<=h;f++){var u=f/h;THREE.Shape.Utils.b2(u,q,t,k);THREE.Shape.Utils.b2(u,r,s,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,t=b[a++]*c+d,s=b[a++]*c,p=b[a++]*c+d,v=b[a++]*c,e.bezierCurveTo(t,s,p,v,k,n),f=g[g.length-1])for(q=f.x,r=f.y,f=1,h=this.divisions;f<=h;f++)u=f/h,THREE.Shape.Utils.b3(u,q,t,p,k),THREE.Shape.Utils.b3(u,
 r,s,v,n)}return{offset:w.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,m,n;if(0<b(a))for(m=0;m<e;m++)f[m]=m;else for(m=0;m<e;m++)f[m]=e-1-m;var q=2*e;for(m=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=m;e<=k&&(k=0);m=k+1;e<=m&&(m=0);n=m+1;e<=n&&(n=0);var r;a:{var t=r=void 0,s=void 0,p=void 0,v=void 0,w=void 0,u=void 0,A=void 0,x=
-void 0,t=a[f[k]].x,s=a[f[k]].y,p=a[f[m]].x,v=a[f[m]].y,w=a[f[n]].x,u=a[f[n]].y;if(1E-10>(p-t)*(u-s)-(v-s)*(w-t))r=!1;else{var G=void 0,C=void 0,B=void 0,y=void 0,D=void 0,J=void 0,N=void 0,Q=void 0,E=void 0,da=void 0,E=Q=N=x=A=void 0,G=w-p,C=u-v,B=t-w,y=s-u,D=p-t,J=v-s;for(r=0;r<e;r++)if(A=a[f[r]].x,x=a[f[r]].y,!(A===t&&x===s||A===p&&x===v||A===w&&x===u)&&(N=A-t,Q=x-s,E=A-p,da=x-v,A-=w,x-=u,E=G*da-C*E,N=D*Q-J*N,Q=B*x-y*A,-1E-10<=E&&-1E-10<=Q&&-1E-10<=N)){r=!1;break a}r=!0}}if(r){g.push([a[f[k]],a[f[m]],
+(function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,m,n;if(0<b(a))for(m=0;m<e;m++)f[m]=m;else for(m=0;m<e;m++)f[m]=e-1-m;var q=2*e;for(m=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=m;e<=k&&(k=0);m=k+1;e<=m&&(m=0);n=m+1;e<=n&&(n=0);var r;a:{var t=r=void 0,s=void 0,p=void 0,v=void 0,w=void 0,u=void 0,z=void 0,x=
+void 0,t=a[f[k]].x,s=a[f[k]].y,p=a[f[m]].x,v=a[f[m]].y,w=a[f[n]].x,u=a[f[n]].y;if(1E-10>(p-t)*(u-s)-(v-s)*(w-t))r=!1;else{var G=void 0,C=void 0,B=void 0,y=void 0,D=void 0,J=void 0,N=void 0,Q=void 0,E=void 0,da=void 0,E=Q=N=x=z=void 0,G=w-p,C=u-v,B=t-w,y=s-u,D=p-t,J=v-s;for(r=0;r<e;r++)if(z=a[f[r]].x,x=a[f[r]].y,!(z===t&&x===s||z===p&&x===v||z===w&&x===u)&&(N=z-t,Q=x-s,E=z-p,da=x-v,z-=w,x-=u,E=G*da-C*E,N=D*Q-J*N,Q=B*x-y*z,-1E-10<=E&&-1E-10<=Q&&-1E-10<=N)){r=!1;break a}r=!0}}if(r){g.push([a[f[k]],a[f[m]],
 a[f[n]]]);h.push([f[k],f[m],f[n]]);k=m;for(n=m+1;n<e;k++,n++)f[k]=f[n];e--;q=2*e}}return d?h:g};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.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};
@@ -665,20 +667,20 @@ g;d.nextKey=f}f.time>=this.currentTime?g.interpolate(f,this.currentTime):g.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.isPlaying=!1};
 THREE.MorphAnimation.prototype={play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(){var a=0,b=0;return function(c){if(!1!==this.isPlaying){this.currentTime+=c;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);c=this.duration/this.frames;var d=Math.floor(this.currentTime/c);d!=b&&(this.mesh.morphTargetInfluences[a]=0,this.mesh.morphTargetInfluences[b]=1,this.mesh.morphTargetInfluences[d]=
 0,a=b,b=d);this.mesh.morphTargetInfluences[d]=this.currentTime%c/c;this.mesh.morphTargetInfluences[a]=1-this.mesh.morphTargetInfluences[d]}}}()};
-THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,p){var v,w=h.widthSegments,u=h.heightSegments,A=e/2,x=f/2,G=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var C=w+1,B=u+1,y=e/w,D=f/u,J=new THREE.Vector3;J[v]=0<g?1:-1;for(e=0;e<B;e++)for(f=0;f<C;f++){var N=new THREE.Vector3;N[a]=(f*y-A)*c;N[b]=(e*D-x)*d;N[v]=g;h.vertices.push(N)}for(e=
-0;e<u;e++)for(f=0;f<w;f++)x=f+C*e,a=f+C*(e+1),b=f+1+C*(e+1),c=f+1+C*e,d=new THREE.Vector2(f/w,1-e/u),g=new THREE.Vector2(f/w,1-(e+1)/u),v=new THREE.Vector2((f+1)/w,1-(e+1)/u),A=new THREE.Vector2((f+1)/w,1-e/u),x=new THREE.Face3(x+G,a+G,c+G),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=p,h.faces.push(x),h.faceVertexUvs[0].push([d,g,A]),x=new THREE.Face3(a+G,b+G,c+G),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=p,h.faces.push(x),
-h.faceVertexUvs[0].push([g.clone(),v,A.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d,0);f("z","y",1,-1,c,b,-d,1);f("x","z",1,1,a,c,e,2);f("x","z",1,-1,a,c,-e,3);f("x","y",1,-1,a,b,g,4);f("x","y",-1,-1,a,b,-g,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,p){var v,w=h.widthSegments,u=h.heightSegments,z=e/2,x=f/2,G=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var C=w+1,B=u+1,y=e/w,D=f/u,J=new THREE.Vector3;J[v]=0<g?1:-1;for(e=0;e<B;e++)for(f=0;f<C;f++){var N=new THREE.Vector3;N[a]=(f*y-z)*c;N[b]=(e*D-x)*d;N[v]=g;h.vertices.push(N)}for(e=
+0;e<u;e++)for(f=0;f<w;f++)x=f+C*e,a=f+C*(e+1),b=f+1+C*(e+1),c=f+1+C*e,d=new THREE.Vector2(f/w,1-e/u),g=new THREE.Vector2(f/w,1-(e+1)/u),v=new THREE.Vector2((f+1)/w,1-(e+1)/u),z=new THREE.Vector2((f+1)/w,1-e/u),x=new THREE.Face3(x+G,a+G,c+G),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=p,h.faces.push(x),h.faceVertexUvs[0].push([d,g,z]),x=new THREE.Face3(a+G,b+G,c+G),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=p,h.faces.push(x),
+h.faceVertexUvs[0].push([g.clone(),v,z.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d,0);f("z","y",1,-1,c,b,-d,1);f("x","z",1,1,a,c,e,2);f("x","z",1,-1,a,c,-e,3);f("x","y",1,-1,a,b,g,4);f("x","y",-1,-1,a,b,-g,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,g=[];e=new THREE.Vector3;var f=new THREE.Vector2(0.5,0.5);this.vertices.push(e);g.push(f);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);g.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 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([g[e].clone(),g[e+1].clone(),f.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,g){console.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry.");return new THREE.BoxGeometry(a,b,c,d,e,g)};
 THREE.CylinderGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;var f=c/2,h,k,m=[],n=[];for(k=0;k<=e;k++){var q=[],r=[],t=k/e,s=t*(b-a)+a;for(h=0;h<=d;h++){var p=h/d,v=new THREE.Vector3;v.x=s*Math.sin(p*Math.PI*2);v.y=-t*c+f;v.z=s*Math.cos(p*Math.PI*2);this.vertices.push(v);q.push(this.vertices.length-
-1);r.push(new THREE.Vector2(p,1-t))}m.push(q);n.push(r)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[m[0][h]].clone(),r=this.vertices[m[0][h+1]].clone()):(q=this.vertices[m[1][h]].clone(),r=this.vertices[m[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),k=0;k<e;k++){var t=m[k][h],s=m[k+1][h],p=m[k+1][h+1],v=m[k][h+1],w=q.clone(),u=q.clone(),A=r.clone(),x=r.clone(),G=n[k][h].clone(),C=n[k+1][h].clone(),B=n[k+1][h+1].clone(),
-y=n[k][h+1].clone();this.faces.push(new THREE.Face3(t,s,v,[w,u,x]));this.faceVertexUvs[0].push([G,C,y]);this.faces.push(new THREE.Face3(s,p,v,[u.clone(),A,x.clone()]));this.faceVertexUvs[0].push([C.clone(),B,y.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,f,0)),h=0;h<d;h++)t=m[0][h],s=m[0][h+1],p=this.vertices.length-1,w=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),A=new THREE.Vector3(0,1,0),G=n[0][h].clone(),C=n[0][h+1].clone(),B=new THREE.Vector2(C.x,0),this.faces.push(new THREE.Face3(t,
-s,p,[w,u,A])),this.faceVertexUvs[0].push([G,C,B]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-f,0)),h=0;h<d;h++)t=m[k][h+1],s=m[k][h],p=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),A=new THREE.Vector3(0,-1,0),G=n[k][h+1].clone(),C=n[k][h].clone(),B=new THREE.Vector2(C.x,1),this.faces.push(new THREE.Face3(t,s,p,[w,u,A])),this.faceVertexUvs[0].push([G,C,B]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);
+1);r.push(new THREE.Vector2(p,1-t))}m.push(q);n.push(r)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[m[0][h]].clone(),r=this.vertices[m[0][h+1]].clone()):(q=this.vertices[m[1][h]].clone(),r=this.vertices[m[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),k=0;k<e;k++){var t=m[k][h],s=m[k+1][h],p=m[k+1][h+1],v=m[k][h+1],w=q.clone(),u=q.clone(),z=r.clone(),x=r.clone(),G=n[k][h].clone(),C=n[k+1][h].clone(),B=n[k+1][h+1].clone(),
+y=n[k][h+1].clone();this.faces.push(new THREE.Face3(t,s,v,[w,u,x]));this.faceVertexUvs[0].push([G,C,y]);this.faces.push(new THREE.Face3(s,p,v,[u.clone(),z,x.clone()]));this.faceVertexUvs[0].push([C.clone(),B,y.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,f,0)),h=0;h<d;h++)t=m[0][h],s=m[0][h+1],p=this.vertices.length-1,w=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,1,0),G=n[0][h].clone(),C=n[0][h+1].clone(),B=new THREE.Vector2(C.x,0),this.faces.push(new THREE.Face3(t,
+s,p,[w,u,z])),this.faceVertexUvs[0].push([G,C,B]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-f,0)),h=0;h<d;h++)t=m[k][h+1],s=m[k][h],p=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),G=n[k][h+1].clone(),C=n[k][h].clone(),B=new THREE.Vector2(C.x,1),this.faces.push(new THREE.Face3(t,s,p,[w,u,z])),this.faceVertexUvs[0].push([G,C,B]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);
 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.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(c,d){var e,f;for(K=c.length;0<=--K;){e=K;f=K-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;g<h;g++){var k=ya*g,m=ya*(g+1),p=d+e+k,k=d+f+k,q=d+f+m,m=d+e+m,r=c,s=g,v=h,w=e,x=f,p=p+Q,k=k+Q,q=q+Q,m=m+Q;N.faces.push(new THREE.Face3(p,k,m,null,null,u));N.faces.push(new THREE.Face3(k,q,m,null,null,u));p=A.generateSideWallUV(N,a,r,b,p,k,q,m,s,v,w,x);N.faceVertexUvs[0].push([p[0],p[1],p[3]]);
-N.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function g(a,b,c){N.vertices.push(new THREE.Vector3(a,b,c))}function f(c,d,e,f){c+=Q;d+=Q;e+=Q;N.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?A.generateBottomUV(N,a,b,c,d,e):A.generateTopUV(N,a,b,c,d,e);N.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,m=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,r=void 0!==
-b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,p,v=!1,w=b.material,u=b.extrudeMaterial,A=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,x,G,C,B;s&&(p=s.getSpacedPoints(t),v=!0,q=!1,x=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),G=new THREE.Vector3,C=new THREE.Vector3,B=new THREE.Vector3);q||(m=k=n=0);var y,D,J,N=this,Q=this.vertices.length,s=a.extractPoints(r),r=s.shape,E=s.holes;if(s=!THREE.Shape.Utils.isClockWise(r)){r=
+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(c,d){var e,f;for(K=c.length;0<=--K;){e=K;f=K-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;g<h;g++){var k=ya*g,m=ya*(g+1),p=d+e+k,k=d+f+k,q=d+f+m,m=d+e+m,r=c,s=g,v=h,w=e,x=f,p=p+Q,k=k+Q,q=q+Q,m=m+Q;N.faces.push(new THREE.Face3(p,k,m,null,null,u));N.faces.push(new THREE.Face3(k,q,m,null,null,u));p=z.generateSideWallUV(N,a,r,b,p,k,q,m,s,v,w,x);N.faceVertexUvs[0].push([p[0],p[1],p[3]]);
+N.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function g(a,b,c){N.vertices.push(new THREE.Vector3(a,b,c))}function f(c,d,e,f){c+=Q;d+=Q;e+=Q;N.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?z.generateBottomUV(N,a,b,c,d,e):z.generateTopUV(N,a,b,c,d,e);N.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,m=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,r=void 0!==
+b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,p,v=!1,w=b.material,u=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,x,G,C,B;s&&(p=s.getSpacedPoints(t),v=!0,q=!1,x=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),G=new THREE.Vector3,C=new THREE.Vector3,B=new THREE.Vector3);q||(m=k=n=0);var y,D,J,N=this,Q=this.vertices.length,s=a.extractPoints(r),r=s.shape,E=s.holes;if(s=!THREE.Shape.Utils.isClockWise(r)){r=
 r.reverse();D=0;for(J=E.length;D<J;D++)y=E[D],THREE.Shape.Utils.isClockWise(y)&&(E[D]=y.reverse());s=!1}var da=THREE.Shape.Utils.triangulateShape(r,E),V=r;D=0;for(J=E.length;D<J;D++)y=E[D],r=r.concat(y);var R,S,L,xa,P,ya=r.length,la,sa=da.length,s=[],K=0;L=V.length;R=L-1;for(S=K+1;K<L;K++,R++,S++)R===L&&(R=0),S===L&&(S=0),s[K]=d(V[K],V[R],V[S]);var ha=[],ra,Ia=s.concat();D=0;for(J=E.length;D<J;D++){y=E[D];ra=[];K=0;L=y.length;R=L-1;for(S=K+1;K<L;K++,R++,S++)R===L&&(R=0),S===L&&(S=0),ra[K]=d(y[K],
 y[R],y[S]);ha.push(ra);Ia=Ia.concat(ra)}for(R=0;R<n;R++){L=R/n;xa=k*(1-L);S=m*Math.sin(L*Math.PI/2);K=0;for(L=V.length;K<L;K++)P=c(V[K],s[K],S),g(P.x,P.y,-xa);D=0;for(J=E.length;D<J;D++)for(y=E[D],ra=ha[D],K=0,L=y.length;K<L;K++)P=c(y[K],ra[K],S),g(P.x,P.y,-xa)}S=m;for(K=0;K<ya;K++)P=q?c(r[K],Ia[K],S):r[K],v?(C.copy(x.normals[0]).multiplyScalar(P.x),G.copy(x.binormals[0]).multiplyScalar(P.y),B.copy(p[0]).add(C).add(G),g(B.x,B.y,B.z)):g(P.x,P.y,0);for(L=1;L<=t;L++)for(K=0;K<ya;K++)P=q?c(r[K],Ia[K],
 S):r[K],v?(C.copy(x.normals[L]).multiplyScalar(P.x),G.copy(x.binormals[L]).multiplyScalar(P.y),B.copy(p[L]).add(C).add(G),g(B.x,B.y,B.z)):g(P.x,P.y,h/t*L);for(R=n-1;0<=R;R--){L=R/n;xa=k*(1-L);S=m*Math.sin(L*Math.PI/2);K=0;for(L=V.length;K<L;K++)P=c(V[K],s[K],S),g(P.x,P.y,h+xa);D=0;for(J=E.length;D<J;D++)for(y=E[D],ra=ha[D],K=0,L=y.length;K<L;K++)P=c(y[K],ra[K],S),v?g(P.x,P.y+p[t-1].y,p[t-1].x+xa):g(P.x,P.y,h+xa)}(function(){if(q){var a;a=0*ya;for(K=0;K<sa;K++)la=da[K],f(la[2]+a,la[1]+a,la[0]+a,!0);
@@ -780,37 +782,37 @@ THREE.LensFlarePlugin=function(){function a(a,b){var d=c.createProgram(),e=c.cre
 -1;g[b++]=0;g[b++]=0;g[b++]=1;g[b++]=-1;g[b++]=1;g[b++]=0;g[b++]=1;g[b++]=1;g[b++]=1;g[b++]=1;g[b++]=-1;g[b++]=1;g[b++]=0;g[b++]=1;b=0;f[b++]=0;f[b++]=1;f[b++]=2;f[b++]=0;f[b++]=2;f[b++]=3;h=c.createBuffer();k=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,h);c.bufferData(c.ARRAY_BUFFER,g,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.bufferData(c.ELEMENT_ARRAY_BUFFER,f,c.STATIC_DRAW);m=c.createTexture();n=c.createTexture();c.bindTexture(c.TEXTURE_2D,m);c.texImage2D(c.TEXTURE_2D,0,c.RGB,16,
 16,0,c.RGB,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);c.bindTexture(c.TEXTURE_2D,n);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,16,16,0,c.RGBA,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);
 c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);0>=c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(q=!1,r=a(THREE.ShaderFlares.lensFlare,e)):(q=!0,r=a(THREE.ShaderFlares.lensFlareVertexTexture,e));t={};s={};t.vertex=c.getAttribLocation(r,"position");t.uv=c.getAttribLocation(r,"uv");s.renderType=c.getUniformLocation(r,"renderType");s.map=c.getUniformLocation(r,"map");s.occlusionMap=c.getUniformLocation(r,"occlusionMap");s.opacity=
-c.getUniformLocation(r,"opacity");s.color=c.getUniformLocation(r,"color");s.scale=c.getUniformLocation(r,"scale");s.rotation=c.getUniformLocation(r,"rotation");s.screenPosition=c.getUniformLocation(r,"screenPosition")};this.render=function(a,e,f,g){b.length=0;a.traverseVisible(function(a){a instanceof THREE.LensFlare&&b.push(a)});if(0!==b.length){a=new THREE.Vector3;var A=g/f,x=0.5*f,G=0.5*g,C=16/g,B=new THREE.Vector2(C*A,C),y=new THREE.Vector3(1,1,0),D=new THREE.Vector2(1,1),J=s,C=t;c.useProgram(r);
-c.enableVertexAttribArray(t.vertex);c.enableVertexAttribArray(t.uv);c.uniform1i(J.occlusionMap,0);c.uniform1i(J.map,1);c.bindBuffer(c.ARRAY_BUFFER,h);c.vertexAttribPointer(C.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(C.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.disable(c.CULL_FACE);c.depthMask(!1);for(var N=0,Q=b.length;N<Q;N++){C=16/g;B.set(C*A,C);var E=b[N];a.set(E.matrixWorld.elements[12],E.matrixWorld.elements[13],E.matrixWorld.elements[14]);a.applyMatrix4(e.matrixWorldInverse);
+c.getUniformLocation(r,"opacity");s.color=c.getUniformLocation(r,"color");s.scale=c.getUniformLocation(r,"scale");s.rotation=c.getUniformLocation(r,"rotation");s.screenPosition=c.getUniformLocation(r,"screenPosition")};this.render=function(a,e,f,g){b.length=0;a.traverseVisible(function(a){a instanceof THREE.LensFlare&&b.push(a)});if(0!==b.length){a=new THREE.Vector3;var z=g/f,x=0.5*f,G=0.5*g,C=16/g,B=new THREE.Vector2(C*z,C),y=new THREE.Vector3(1,1,0),D=new THREE.Vector2(1,1),J=s,C=t;c.useProgram(r);
+c.enableVertexAttribArray(t.vertex);c.enableVertexAttribArray(t.uv);c.uniform1i(J.occlusionMap,0);c.uniform1i(J.map,1);c.bindBuffer(c.ARRAY_BUFFER,h);c.vertexAttribPointer(C.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(C.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.disable(c.CULL_FACE);c.depthMask(!1);for(var N=0,Q=b.length;N<Q;N++){C=16/g;B.set(C*z,C);var E=b[N];a.set(E.matrixWorld.elements[12],E.matrixWorld.elements[13],E.matrixWorld.elements[14]);a.applyMatrix4(e.matrixWorldInverse);
 a.applyProjection(e.projectionMatrix);y.copy(a);D.x=y.x*x+x;D.y=y.y*G+G;if(q||0<D.x&&D.x<f&&0<D.y&&D.y<g){c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,m);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGB,D.x-8,D.y-8,16,16,0);c.uniform1i(J.renderType,0);c.uniform2f(J.scale,B.x,B.y);c.uniform3f(J.screenPosition,y.x,y.y,y.z);c.disable(c.BLEND);c.enable(c.DEPTH_TEST);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,n);c.copyTexImage2D(c.TEXTURE_2D,
-0,c.RGBA,D.x-8,D.y-8,16,16,0);c.uniform1i(J.renderType,1);c.disable(c.DEPTH_TEST);c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,m);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);E.positionScreen.copy(y);E.customUpdateCallback?E.customUpdateCallback(E):E.updateLensFlares();c.uniform1i(J.renderType,2);c.enable(c.BLEND);for(var da=0,V=E.lensFlares.length;da<V;da++){var R=E.lensFlares[da];0.001<R.opacity&&0.001<R.scale&&(y.x=R.x,y.y=R.y,y.z=R.z,C=R.size*R.scale/g,B.x=C*A,B.y=C,c.uniform3f(J.screenPosition,
+0,c.RGBA,D.x-8,D.y-8,16,16,0);c.uniform1i(J.renderType,1);c.disable(c.DEPTH_TEST);c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,m);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);E.positionScreen.copy(y);E.customUpdateCallback?E.customUpdateCallback(E):E.updateLensFlares();c.uniform1i(J.renderType,2);c.enable(c.BLEND);for(var da=0,V=E.lensFlares.length;da<V;da++){var R=E.lensFlares[da];0.001<R.opacity&&0.001<R.scale&&(y.x=R.x,y.y=R.y,y.z=R.z,C=R.size*R.scale/g,B.x=C*z,B.y=C,c.uniform3f(J.screenPosition,
 y.x,y.y,y.z),c.uniform2f(J.scale,B.x,B.y),c.uniform1f(J.rotation,R.rotation),c.uniform1f(J.opacity,R.opacity),c.uniform3f(J.color,R.color.r,R.color.g,R.color.b),d.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),d.setTexture(R.texture,1),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0))}}}c.enable(c.CULL_FACE);c.enable(c.DEPTH_TEST);c.depthMask(!0);d.resetGLState()}}};
 THREE.ShadowMapPlugin=function(){function a(b,c,d){if(c.visible){var f=e[c.id];if(f&&c.castShadow&&(!1===c.frustumCulled||!0===n.intersectsObject(c)))for(var g=0,h=f.length;g<h;g++){var k=f[g];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);p.push(k)}g=0;for(h=c.children.length;g<h;g++)a(b,c.children[g],d)}}var b,c,d,e,g,f,h,k,m,n=new THREE.Frustum,q=new THREE.Matrix4,r=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,p=[];this.init=function(a,n,p,q){b=a.context;c=
 a;d=n;e=p;g=q;a=THREE.ShaderLib.depthRGBA;n=THREE.UniformsUtils.clone(a.uniforms);f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n});h=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,morphTargets:!0});k=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,skinning:!0});m=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,
-uniforms:n,morphTargets:!0,skinning:!0});f._shadowPass=!0;h._shadowPass=!0;k._shadowPass=!0;m._shadowPass=!0};this.render=function(a,b){!1!==c.shadowMapEnabled&&!1!==c.shadowMapAutoUpdate&&this.update(a,b)};this.update=function(e,w){var u,A,x,G,C,B,y,D,J=[];G=0;b.clearColor(1,1,1,1);b.disable(b.BLEND);b.enable(b.CULL_FACE);b.frontFace(b.CCW);c.shadowMapCullFace===THREE.CullFaceFront?b.cullFace(b.FRONT):b.cullFace(b.BACK);c.setDepthTest(!0);u=0;for(A=d.length;u<A;u++)if(x=d[u],x.castShadow)if(x instanceof
+uniforms:n,morphTargets:!0,skinning:!0});f._shadowPass=!0;h._shadowPass=!0;k._shadowPass=!0;m._shadowPass=!0};this.render=function(a,b){!1!==c.shadowMapEnabled&&!1!==c.shadowMapAutoUpdate&&this.update(a,b)};this.update=function(e,w){var u,z,x,G,C,B,y,D,J=[];G=0;b.clearColor(1,1,1,1);b.disable(b.BLEND);b.enable(b.CULL_FACE);b.frontFace(b.CCW);c.shadowMapCullFace===THREE.CullFaceFront?b.cullFace(b.FRONT):b.cullFace(b.BACK);c.setDepthTest(!0);u=0;for(z=d.length;u<z;u++)if(x=d[u],x.castShadow)if(x instanceof
 THREE.DirectionalLight&&x.shadowCascade)for(C=0;C<x.shadowCascadeCount;C++){var N;if(x.shadowCascadeArray[C])N=x.shadowCascadeArray[C];else{y=x;var Q=C;N=new THREE.DirectionalLight;N.isVirtual=!0;N.onlyShadow=!0;N.castShadow=!0;N.shadowCameraNear=y.shadowCameraNear;N.shadowCameraFar=y.shadowCameraFar;N.shadowCameraLeft=y.shadowCameraLeft;N.shadowCameraRight=y.shadowCameraRight;N.shadowCameraBottom=y.shadowCameraBottom;N.shadowCameraTop=y.shadowCameraTop;N.shadowCameraVisible=y.shadowCameraVisible;
 N.shadowDarkness=y.shadowDarkness;N.shadowBias=y.shadowCascadeBias[Q];N.shadowMapWidth=y.shadowCascadeWidth[Q];N.shadowMapHeight=y.shadowCascadeHeight[Q];N.pointsWorld=[];N.pointsFrustum=[];D=N.pointsWorld;B=N.pointsFrustum;for(var E=0;8>E;E++)D[E]=new THREE.Vector3,B[E]=new THREE.Vector3;D=y.shadowCascadeNearZ[Q];y=y.shadowCascadeFarZ[Q];B[0].set(-1,-1,D);B[1].set(1,-1,D);B[2].set(-1,1,D);B[3].set(1,1,D);B[4].set(-1,-1,y);B[5].set(1,-1,y);B[6].set(-1,1,y);B[7].set(1,1,y);N.originalCamera=w;B=new THREE.Gyroscope;
 B.position.copy(x.shadowCascadeOffset);B.add(N);B.add(N.target);w.add(B);x.shadowCascadeArray[C]=N;console.log("Created virtualLight",N)}Q=x;D=C;y=Q.shadowCascadeArray[D];y.position.copy(Q.position);y.target.position.copy(Q.target.position);y.lookAt(y.target);y.shadowCameraVisible=Q.shadowCameraVisible;y.shadowDarkness=Q.shadowDarkness;y.shadowBias=Q.shadowCascadeBias[D];B=Q.shadowCascadeNearZ[D];Q=Q.shadowCascadeFarZ[D];y=y.pointsFrustum;y[0].z=B;y[1].z=B;y[2].z=B;y[3].z=B;y[4].z=Q;y[5].z=Q;y[6].z=
-Q;y[7].z=Q;J[G]=N;G++}else J[G]=x,G++;u=0;for(A=J.length;u<A;u++){x=J[u];x.shadowMap||(C=THREE.LinearFilter,c.shadowMapType===THREE.PCFSoftShadowMap&&(C=THREE.NearestFilter),x.shadowMap=new THREE.WebGLRenderTarget(x.shadowMapWidth,x.shadowMapHeight,{minFilter:C,magFilter:C,format:THREE.RGBAFormat}),x.shadowMapSize=new THREE.Vector2(x.shadowMapWidth,x.shadowMapHeight),x.shadowMatrix=new THREE.Matrix4);if(!x.shadowCamera){if(x instanceof THREE.SpotLight)x.shadowCamera=new THREE.PerspectiveCamera(x.shadowCameraFov,
+Q;y[7].z=Q;J[G]=N;G++}else J[G]=x,G++;u=0;for(z=J.length;u<z;u++){x=J[u];x.shadowMap||(C=THREE.LinearFilter,c.shadowMapType===THREE.PCFSoftShadowMap&&(C=THREE.NearestFilter),x.shadowMap=new THREE.WebGLRenderTarget(x.shadowMapWidth,x.shadowMapHeight,{minFilter:C,magFilter:C,format:THREE.RGBAFormat}),x.shadowMapSize=new THREE.Vector2(x.shadowMapWidth,x.shadowMapHeight),x.shadowMatrix=new THREE.Matrix4);if(!x.shadowCamera){if(x instanceof THREE.SpotLight)x.shadowCamera=new THREE.PerspectiveCamera(x.shadowCameraFov,
 x.shadowMapWidth/x.shadowMapHeight,x.shadowCameraNear,x.shadowCameraFar);else if(x instanceof THREE.DirectionalLight)x.shadowCamera=new THREE.OrthographicCamera(x.shadowCameraLeft,x.shadowCameraRight,x.shadowCameraTop,x.shadowCameraBottom,x.shadowCameraNear,x.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}e.add(x.shadowCamera);!0===e.autoUpdate&&e.updateMatrixWorld()}x.shadowCameraVisible&&!x.cameraHelper&&(x.cameraHelper=new THREE.CameraHelper(x.shadowCamera),x.shadowCamera.add(x.cameraHelper));
 if(x.isVirtual&&N.originalCamera==w){C=w;G=x.shadowCamera;B=x.pointsFrustum;y=x.pointsWorld;r.set(Infinity,Infinity,Infinity);t.set(-Infinity,-Infinity,-Infinity);for(Q=0;8>Q;Q++)D=y[Q],D.copy(B[Q]),THREE.ShadowMapPlugin.__projector.unprojectVector(D,C),D.applyMatrix4(G.matrixWorldInverse),D.x<r.x&&(r.x=D.x),D.x>t.x&&(t.x=D.x),D.y<r.y&&(r.y=D.y),D.y>t.y&&(t.y=D.y),D.z<r.z&&(r.z=D.z),D.z>t.z&&(t.z=D.z);G.left=r.x;G.right=t.x;G.top=t.y;G.bottom=r.y;G.updateProjectionMatrix()}G=x.shadowMap;B=x.shadowMatrix;
 C=x.shadowCamera;C.position.setFromMatrixPosition(x.matrixWorld);s.setFromMatrixPosition(x.target.matrixWorld);C.lookAt(s);C.updateMatrixWorld();C.matrixWorldInverse.getInverse(C.matrixWorld);x.cameraHelper&&(x.cameraHelper.visible=x.shadowCameraVisible);x.shadowCameraVisible&&x.cameraHelper.update();B.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);B.multiply(C.projectionMatrix);B.multiply(C.matrixWorldInverse);q.multiplyMatrices(C.projectionMatrix,C.matrixWorldInverse);n.setFromMatrix(q);c.setRenderTarget(G);
 c.clear();p.length=0;a(e,e,C);x=0;for(G=p.length;x<G;x++)y=p[x],B=y.object,y=y.buffer,Q=B.material instanceof THREE.MeshFaceMaterial?B.material.materials[0]:B.material,D=void 0!==B.geometry.morphTargets&&0<B.geometry.morphTargets.length&&Q.morphTargets,E=B instanceof THREE.SkinnedMesh&&Q.skinning,D=B.customDepthMaterial?B.customDepthMaterial:E?D?m:k:D?h:f,c.setMaterialFaces(Q),y instanceof THREE.BufferGeometry?c.renderBufferDirect(C,d,null,D,y,B):c.renderBuffer(C,d,null,D,y,B);x=0;for(G=g.length;x<
-G;x++)y=g[x],B=y.object,B.visible&&B.castShadow&&(B._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,B.matrixWorld),c.renderImmediateObject(C,d,null,f,B))}u=c.getClearColor();A=c.getClearAlpha();b.clearColor(u.r,u.g,u.b,A);b.enable(b.BLEND);c.shadowMapCullFace===THREE.CullFaceFront&&b.cullFace(b.BACK);c.resetGLState()}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;
-THREE.SpritePlugin=function(){var a,b,c,d,e,g,f,h,k,m,n,q,r,t,s,p,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,A,x,G=[],C,B,y,D,J;this.init=function(w){u=w.context;A=w;C=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);B=new Uint16Array([0,1,2,0,2,3]);y=u.createBuffer();D=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,y);u.bufferData(u.ARRAY_BUFFER,C,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,D);u.bufferData(u.ELEMENT_ARRAY_BUFFER,B,u.STATIC_DRAW);w=u.createProgram();
-var G=u.createShader(u.VERTEX_SHADER),E=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(G,["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"));
-u.shaderSource(E,["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"));
+G;x++)y=g[x],B=y.object,B.visible&&B.castShadow&&(B._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,B.matrixWorld),c.renderImmediateObject(C,d,null,f,B))}u=c.getClearColor();z=c.getClearAlpha();b.clearColor(u.r,u.g,u.b,z);b.enable(b.BLEND);c.shadowMapCullFace===THREE.CullFaceFront&&b.cullFace(b.BACK);c.resetGLState()}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;
+THREE.SpritePlugin=function(){var a,b,c,d,e,g,f,h,k,m,n,q,r,t,s,p,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,z,x,G=[],C,B,y,D,J;this.init=function(w){u=w.context;z=w;C=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);B=new Uint16Array([0,1,2,0,2,3]);y=u.createBuffer();D=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,y);u.bufferData(u.ARRAY_BUFFER,C,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,D);u.bufferData(u.ELEMENT_ARRAY_BUFFER,B,u.STATIC_DRAW);w=u.createProgram();
+var G=u.createShader(u.VERTEX_SHADER),E=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(G,["precision "+z.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
+u.shaderSource(E,["precision "+z.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
 u.compileShader(G);u.compileShader(E);u.attachShader(w,G);u.attachShader(w,E);u.linkProgram(w);J=w;p=u.getAttribLocation(J,"position");v=u.getAttribLocation(J,"uv");a=u.getUniformLocation(J,"uvOffset");b=u.getUniformLocation(J,"uvScale");c=u.getUniformLocation(J,"rotation");d=u.getUniformLocation(J,"scale");e=u.getUniformLocation(J,"color");g=u.getUniformLocation(J,"map");f=u.getUniformLocation(J,"opacity");h=u.getUniformLocation(J,"modelViewMatrix");k=u.getUniformLocation(J,"projectionMatrix");m=
 u.getUniformLocation(J,"fogType");n=u.getUniformLocation(J,"fogDensity");q=u.getUniformLocation(J,"fogNear");r=u.getUniformLocation(J,"fogFar");t=u.getUniformLocation(J,"fogColor");s=u.getUniformLocation(J,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;G=w.getContext("2d");G.fillStyle="white";G.fillRect(0,0,8,8);x=new THREE.Texture(w);x.needsUpdate=!0};this.render=function(B,C,E,da){G.length=0;B.traverseVisible(function(a){a instanceof THREE.Sprite&&G.push(a)});if(0!==G.length){u.useProgram(J);
 u.enableVertexAttribArray(p);u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,y);u.vertexAttribPointer(p,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,D);u.uniformMatrix4fv(k,!1,C.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(g,0);da=E=0;var V=B.fog;V?(u.uniform3f(t,V.color.r,V.color.g,V.color.b),V instanceof THREE.Fog?(u.uniform1f(q,V.near),u.uniform1f(r,V.far),u.uniform1i(m,
 1),da=E=1):V instanceof THREE.FogExp2&&(u.uniform1f(n,V.density),u.uniform1i(m,2),da=E=2)):(u.uniform1i(m,0),da=E=0);for(var V=0,R=G.length;V<R;V++){var S=G[V],L=S.material;S._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,S.matrixWorld);S.z=-S._modelViewMatrix.elements[14]}G.sort(w);C=[];V=0;for(R=G.length;V<R;V++)S=G[V],L=S.material,u.uniform1f(s,L.alphaTest),u.uniformMatrix4fv(h,!1,S._modelViewMatrix.elements),C[0]=S.scale.x,C[1]=S.scale.y,S=0,B.fog&&L.fog&&(S=da),E!==S&&(u.uniform1i(m,
-S),E=S),null!==L.map?(u.uniform2f(a,L.map.offset.x,L.map.offset.y),u.uniform2f(b,L.map.repeat.x,L.map.repeat.y)):(u.uniform2f(a,0,0),u.uniform2f(b,1,1)),u.uniform1f(f,L.opacity),u.uniform3f(e,L.color.r,L.color.g,L.color.b),u.uniform1f(c,L.rotation),u.uniform2fv(d,C),A.setBlending(L.blending,L.blendEquation,L.blendSrc,L.blendDst),A.setDepthTest(L.depthTest),A.setDepthWrite(L.depthWrite),L.map&&L.map.image&&L.map.image.width?A.setTexture(L.map,0):A.setTexture(x,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,
-0);u.enable(u.CULL_FACE)}}};
+S),E=S),null!==L.map?(u.uniform2f(a,L.map.offset.x,L.map.offset.y),u.uniform2f(b,L.map.repeat.x,L.map.repeat.y)):(u.uniform2f(a,0,0),u.uniform2f(b,1,1)),u.uniform1f(f,L.opacity),u.uniform3f(e,L.color.r,L.color.g,L.color.b),u.uniform1f(c,L.rotation),u.uniform2fv(d,C),z.setBlending(L.blending,L.blendEquation,L.blendSrc,L.blendDst),z.setDepthTest(L.depthTest),z.setDepthWrite(L.depthWrite),L.map&&L.map.image&&L.map.image.width?z.setTexture(L.map,0):z.setTexture(x,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,
+0);u.enable(u.CULL_FACE);z.resetGLState()}}};
 THREE.DepthPassPlugin=function(){function a(b,c,d){if(c.visible){var f=e[c.id];if(f&&(!1===c.frustumCulled||!0===n.intersectsObject(c)))for(var g=0,h=f.length;g<h;g++){var k=f[g];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);r.push(k)}g=0;for(h=c.children.length;g<h;g++)a(b,c.children[g],d)}}this.enabled=!1;this.renderTarget=null;var b,c,d,e,g,f,h,k,m,n=new THREE.Frustum,q=new THREE.Matrix4,r=[];this.init=function(a,n,p,q){b=a.context;c=a;d=n;e=p;g=q;a=THREE.ShaderLib.depthRGBA;
 n=THREE.UniformsUtils.clone(a.uniforms);f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n});h=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,morphTargets:!0});k=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,skinning:!0});m=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,morphTargets:!0,skinning:!0});f._shadowPass=
-!0;h._shadowPass=!0;k._shadowPass=!0;m._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(e,s){var p,v,w,u,A;b.clearColor(1,1,1,1);b.disable(b.BLEND);c.setDepthTest(!0);!0===e.autoUpdate&&e.updateMatrixWorld();s.matrixWorldInverse.getInverse(s.matrixWorld);q.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse);n.setFromMatrix(q);c.setRenderTarget(this.renderTarget);c.clear();r.length=0;a(e,e,s);var x;p=0;for(v=r.length;p<v;p++)w=r[p],A=w.object,w=w.buffer,
-A instanceof THREE.PointCloud&&!A.customDepthMaterial||((x=A.material instanceof THREE.MeshFaceMaterial?A.material.materials[0]:A.material)&&c.setMaterialFaces(A.material),u=void 0!==A.geometry.morphTargets&&0<A.geometry.morphTargets.length&&x.morphTargets,x=A instanceof THREE.SkinnedMesh&&x.skinning,u=A.customDepthMaterial?A.customDepthMaterial:x?u?m:k:u?h:f,w instanceof THREE.BufferGeometry?c.renderBufferDirect(s,d,null,u,w,A):c.renderBuffer(s,d,null,u,w,A));p=0;for(v=g.length;p<v;p++)w=g[p],A=
-w.object,A.visible&&(A._modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,A.matrixWorld),c.renderImmediateObject(s,d,null,f,A));p=c.getClearColor();v=c.getClearAlpha();b.clearColor(p.r,p.g,p.b,v);b.enable(b.BLEND)}};
+!0;h._shadowPass=!0;k._shadowPass=!0;m._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(e,s){var p,v,w,u,z;b.clearColor(1,1,1,1);b.disable(b.BLEND);c.setDepthTest(!0);!0===e.autoUpdate&&e.updateMatrixWorld();s.matrixWorldInverse.getInverse(s.matrixWorld);q.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse);n.setFromMatrix(q);c.setRenderTarget(this.renderTarget);c.clear();r.length=0;a(e,e,s);var x;p=0;for(v=r.length;p<v;p++)w=r[p],z=w.object,w=w.buffer,
+z instanceof THREE.PointCloud&&!z.customDepthMaterial||((x=z.material instanceof THREE.MeshFaceMaterial?z.material.materials[0]:z.material)&&c.setMaterialFaces(z.material),u=void 0!==z.geometry.morphTargets&&0<z.geometry.morphTargets.length&&x.morphTargets,x=z instanceof THREE.SkinnedMesh&&x.skinning,u=z.customDepthMaterial?z.customDepthMaterial:x?u?m:k:u?h:f,w instanceof THREE.BufferGeometry?c.renderBufferDirect(s,d,null,u,w,z):c.renderBuffer(s,d,null,u,w,z));p=0;for(v=g.length;p<v;p++)w=g[p],z=
+w.object,z.visible&&(z._modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,z.matrixWorld),c.renderImmediateObject(s,d,null,f,z));p=c.getClearColor();v=c.getClearAlpha();b.clearColor(p.r,p.g,p.b,v);b.enable(b.BLEND)}};
 THREE.ShaderFlares={lensFlareVertexTexture:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
 lensFlare:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}};

+ 4 - 4
src/loaders/CompressedTextureLoader.js

@@ -1,7 +1,7 @@
-/*
+/**
  * @author mrdoob / http://mrdoob.com/
  *
- * Abstract Base class to block based textures loader (dds, pvr, ...) 
+ * Abstract Base class to block based textures loader (dds, pvr, ...)
  */
 
 THREE.CompressedTextureLoader = function () {
@@ -41,7 +41,7 @@ THREE.CompressedTextureLoader.prototype = {
 			loader.setResponseType( 'arraybuffer' );
 
 			var loadTexture = function ( i ) {
-		
+
 				loader.load( url[ i ], function ( buffer ) {
 
 					var texDatas = scope._parser( buffer, true );
@@ -123,5 +123,5 @@ THREE.CompressedTextureLoader.prototype = {
 		return texture;
 
 	}
-	
+
 };