Browse Source

Updated builds.

Mr.doob 11 years ago
parent
commit
b6a0cd876e
2 changed files with 171 additions and 124 deletions
  1. 88 42
      build/three.js
  2. 83 82
      build/three.min.js

+ 88 - 42
build/three.js

@@ -22839,45 +22839,103 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 			// indexed triangles
 			// indexed triangles
 
 
+			var type, size;
+			
+			if ( _glExtensionElementIndexUint !== null && index.array instanceof Uint32Array ) {
+				
+				type = _gl.UNSIGNED_INT;
+				size = 4;
+				
+			} else {
+				
+				type = _gl.UNSIGNED_SHORT;
+				size = 2;
+				
+			}
+
 			if ( index ) {
 			if ( index ) {
 
 
 				var offsets = geometry.offsets;
 				var offsets = geometry.offsets;
 
 
-				// if there is more than 1 chunk
-				// must set attribute pointers to use new offsets for each chunk
-				// even if geometry and materials didn't change
+				if ( offsets.length === 0 ) {
 
 
-				if ( offsets.length > 1 ) updateBuffers = true;
+					for ( attributeName in programAttributes ) {
 
 
-				for ( var i = 0, il = offsets.length; i < il; i ++ ) {
+						attributePointer = programAttributes[ attributeName ];
+						attributeItem = geometryAttributes[ attributeName ];
 
 
-					var startIndex = offsets[ i ].index;
+						if ( attributePointer >= 0 ) {
 
 
-					if ( updateBuffers ) {
+							if ( attributeItem ) {
+
+								attributeSize = attributeItem.itemSize;
+								_gl.bindBuffer( _gl.ARRAY_BUFFER, attributeItem.buffer );
+								enableAttribute( attributePointer );
+								_gl.vertexAttribPointer( attributePointer, attributeSize, _gl.FLOAT, false, 0, startIndex * attributeSize * 4 ); // 4 bytes per Float32
+
+							} else if ( material.defaultAttributeValues ) {
+
+								if ( material.defaultAttributeValues[ attributeName ].length === 2 ) {
 
 
-						for ( attributeName in programAttributes ) {
+									_gl.vertexAttrib2fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
 
 
-							attributePointer = programAttributes[ attributeName ];
-							attributeItem = geometryAttributes[ attributeName ];
+								} else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) {
 
 
-							if ( attributePointer >= 0 ) {
+									_gl.vertexAttrib3fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
 
 
-								if ( attributeItem ) {
+								}
 
 
-									attributeSize = attributeItem.itemSize;
-									_gl.bindBuffer( _gl.ARRAY_BUFFER, attributeItem.buffer );
-									enableAttribute( attributePointer );
-									_gl.vertexAttribPointer( attributePointer, attributeSize, _gl.FLOAT, false, 0, startIndex * attributeSize * 4 ); // 4 bytes per Float32
+							}
 
 
-								} else if ( material.defaultAttributeValues ) {
+						}
 
 
-									if ( material.defaultAttributeValues[ attributeName ].length === 2 ) {
+					}
 
 
-										_gl.vertexAttrib2fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
+					_gl.drawElements( _gl.TRIANGLES, index.array.length, type, 0 );
 
 
-									} else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) {
+					_this.info.render.calls ++;
+					_this.info.render.vertices += index.array.length; // not really true, here vertices can be shared
+					_this.info.render.faces += index.array.length / 3;
 
 
-										_gl.vertexAttrib3fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
+				} else {
+
+					// if there is more than 1 chunk
+					// must set attribute pointers to use new offsets for each chunk
+					// even if geometry and materials didn't change
+
+					updateBuffers = true;
+
+					for ( var i = 0, il = offsets.length; i < il; i ++ ) {
+
+						var startIndex = offsets[ i ].index;
+
+						if ( updateBuffers ) {
+
+							for ( attributeName in programAttributes ) {
+
+								attributePointer = programAttributes[ attributeName ];
+								attributeItem = geometryAttributes[ attributeName ];
+
+								if ( attributePointer >= 0 ) {
+
+									if ( attributeItem ) {
+
+										attributeSize = attributeItem.itemSize;
+										_gl.bindBuffer( _gl.ARRAY_BUFFER, attributeItem.buffer );
+										enableAttribute( attributePointer );
+										_gl.vertexAttribPointer( attributePointer, attributeSize, _gl.FLOAT, false, 0, startIndex * attributeSize * 4 ); // 4 bytes per Float32
+
+									} else if ( material.defaultAttributeValues ) {
+
+										if ( material.defaultAttributeValues[ attributeName ].length === 2 ) {
+
+											_gl.vertexAttrib2fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
+
+										} else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) {
+
+											_gl.vertexAttrib3fv( attributePointer, material.defaultAttributeValues[ attributeName ] );
+
+										}
 
 
 									}
 									}
 
 
@@ -22885,33 +22943,21 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 							}
 							}
 
 
+							// indices
+
+							_gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, index.buffer );
+
 						}
 						}
 
 
-						// indices
+						// render indexed triangles
 
 
-						_gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, index.buffer );
+						_gl.drawElements( _gl.TRIANGLES, offsets[ i ].count, type, offsets[ i ].start * size );
 
 
-					}
+						_this.info.render.calls ++;
+						_this.info.render.vertices += offsets[ i ].count; // not really true, here vertices can be shared
+						_this.info.render.faces += offsets[ i ].count / 3;
 
 
-					// render indexed triangles
-					var type, size;
-					
-					if ( _glExtensionElementIndexUint !== null && index.array instanceof Uint32Array ) {
-						
-						type = _gl.UNSIGNED_INT;
-						size = 4;
-						
-					} else {
-						
-						type = _gl.UNSIGNED_SHORT;
-						size = 2;
-						
 					}
 					}
-					_gl.drawElements( _gl.TRIANGLES, offsets[ i ].count, type, offsets[ i ].start * size ); // 2 bytes per Uint16
-
-					_this.info.render.calls ++;
-					_this.info.render.vertices += offsets[ i ].count; // not really true, here vertices can be shared
-					_this.info.render.faces += offsets[ i ].count / 3;
 
 
 				}
 				}
 
 

+ 83 - 82
build/three.min.js

@@ -169,16 +169,16 @@ if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone())
 0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var f,g,h=[],k=0,l,n,s=[],r=0,q,u,p=[],v=0,w,t,x=[],z=0,B,E,H=[],D=0,G={objects:[],lights:[],elements:[]},I=new THREE.Vector3,O=new THREE.Vector3,K=new THREE.Vector3,y=new THREE.Vector3,F=new THREE.Vector4,C=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),A=new THREE.Box3,L=Array(3),Q=new THREE.Matrix4,Y=
 0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var f,g,h=[],k=0,l,n,s=[],r=0,q,u,p=[],v=0,w,t,x=[],z=0,B,E,H=[],D=0,G={objects:[],lights:[],elements:[]},I=new THREE.Vector3,O=new THREE.Vector3,K=new THREE.Vector3,y=new THREE.Vector3,F=new THREE.Vector4,C=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),A=new THREE.Box3,L=Array(3),Q=new THREE.Matrix4,Y=
 new THREE.Matrix4,R,fa=new THREE.Matrix4,V=new THREE.Matrix3,ga=new THREE.Frustum,J=new THREE.Vector4,da=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);Y.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(Y)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);Y.multiplyMatrices(c.matrixWorld,a);return b.applyProjection(Y)}}();this.pickingRay=function(a,b){a.z=
 new THREE.Matrix4,R,fa=new THREE.Matrix4,V=new THREE.Matrix3,ga=new THREE.Frustum,J=new THREE.Vector4,da=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);Y.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(Y)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);Y.multiplyMatrices(c.matrixWorld,a);return b.applyProjection(Y)}}();this.pickingRay=function(a,b){a.z=
 -1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var W=function(a){if(!1!==a.visible){if(a instanceof THREE.Light)G.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===ga.intersectsObject(a)){if(g===k){var b=new THREE.RenderableObject;h.push(b);k++;g++;f=b}else f=h[g++];f.id=a.id;f.object=a;null!==a.renderDepth?f.z=a.renderDepth:
 -1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var W=function(a){if(!1!==a.visible){if(a instanceof THREE.Light)G.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===ga.intersectsObject(a)){if(g===k){var b=new THREE.RenderableObject;h.push(b);k++;g++;f=b}else f=h[g++];f.id=a.id;f.object=a;null!==a.renderDepth?f.z=a.renderDepth:
-(y.setFromMatrixPosition(a.matrixWorld),y.applyProjection(Y),f.z=y.z);G.objects.push(f)}for(var b=0,c=a.children.length;b<c;b++)W(a.children[b])}},N=new function(){var d=[],e=null,f=new THREE.Matrix3,g=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(R);c.copy(b).applyMatrix4(Y);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},h=function(a,b,c){L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return!0===
+(y.setFromMatrixPosition(a.matrixWorld),y.applyProjection(Y),f.z=y.z);G.objects.push(f)}for(var b=0,c=a.children.length;b<c;b++)W(a.children[b])}},M=new function(){var d=[],e=null,f=new THREE.Matrix3,g=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(R);c.copy(b).applyMatrix4(Y);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},h=function(a,b,c){L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return!0===
 a.visible||!0===b.visible||!0===c.visible||C.isIntersectionBox(A.setFromPoints(L))?0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x):!1};return{setObject:function(a){e=a;f.getNormalMatrix(e.matrixWorld);d.length=0},projectVertex:g,checkTriangleVisibility:h,pushVertex:function(b,c,d){l=a();l.position.set(b,c,d);g(l)},pushNormal:function(a,b,c){d.push(a,b,c)},pushLine:function(a,b){var d=
 a.visible||!0===b.visible||!0===c.visible||C.isIntersectionBox(A.setFromPoints(L))?0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x):!1};return{setObject:function(a){e=a;f.getNormalMatrix(e.matrixWorld);d.length=0},projectVertex:g,checkTriangleVisibility:h,pushVertex:function(b,c,d){l=a();l.position.set(b,c,d);g(l)},pushNormal:function(a,b,c){d.push(a,b,c)},pushLine:function(a,b){var d=
 s[a],f=s[b];w=c();w.id=e.id;w.v1.copy(d);w.v2.copy(f);w.z=(d.positionScreen.z+f.positionScreen.z)/2;w.material=e.material;G.elements.push(w)},pushTriangle:function(a,c,g){var k=s[a],l=s[c],n=s[g];if(!0===h(k,l,n)){q=b();q.id=e.id;q.v1.copy(k);q.v2.copy(l);q.v3.copy(n);q.z=(k.positionScreen.z+l.positionScreen.z+n.positionScreen.z)/3;for(k=0;3>k;k++)l=3*arguments[k],n=q.vertexNormalsModel[k],n.set(d[l+0],d[l+1],d[l+2]),n.applyMatrix3(f).normalize();q.vertexNormalsLength=3;q.material=e.material;G.elements.push(q)}}}};
 s[a],f=s[b];w=c();w.id=e.id;w.v1.copy(d);w.v2.copy(f);w.z=(d.positionScreen.z+f.positionScreen.z)/2;w.material=e.material;G.elements.push(w)},pushTriangle:function(a,c,g){var k=s[a],l=s[c],n=s[g];if(!0===h(k,l,n)){q=b();q.id=e.id;q.v1.copy(k);q.v2.copy(l);q.v3.copy(n);q.z=(k.positionScreen.z+l.positionScreen.z+n.positionScreen.z)/3;for(k=0;3>k;k++)l=3*arguments[k],n=q.vertexNormalsModel[k],n.set(d[l+0],d[l+1],d[l+2]),n.applyMatrix3(f).normalize();q.vertexNormalsLength=3;q.material=e.material;G.elements.push(q)}}}};
-this.projectScene=function(f,h,k,l){var p,r,v,x,y,z,C,L,A;E=t=u=0;G.elements.length=0;!0===f.autoUpdate&&f.updateMatrixWorld();void 0===h.parent&&h.updateMatrixWorld();Q.copy(h.matrixWorldInverse.getInverse(h.matrixWorld));Y.multiplyMatrices(h.projectionMatrix,Q);ga.setFromMatrix(Y);g=0;G.objects.length=0;G.lights.length=0;W(f);!0===k&&G.objects.sort(d);f=0;for(k=G.objects.length;f<k;f++)if(p=G.objects[f].object,r=p.geometry,N.setObject(p),R=p.matrixWorld,n=0,p instanceof THREE.Mesh)if(r instanceof
-THREE.BufferGeometry){if(z=r.attributes,p=r.offsets,void 0!==z.position){L=z.position.array;r=0;for(x=L.length;r<x;r+=3)N.pushVertex(L[r],L[r+1],L[r+2]);A=z.normal.array;r=0;for(x=A.length;r<x;r+=3)N.pushNormal(A[r],A[r+1],A[r+2]);if(void 0!==z.index)if(z=z.index.array,0<p.length)for(f=0;f<p.length;f++)for(x=p[f],L=x.index,r=x.start,x=x.start+x.count;r<x;r+=3)N.pushTriangle(z[r]+L,z[r+1]+L,z[r+2]+L);else for(r=0,x=z.length;r<x;r+=3)N.pushTriangle(z[r],z[r+1],z[r+2]);else for(r=0,x=L.length/3;r<x;r+=
-3)N.pushTriangle(r,r+1,r+2)}}else{if(r instanceof THREE.Geometry){v=r.vertices;x=r.faces;z=r.faceVertexUvs;V.getNormalMatrix(R);L=p.material instanceof THREE.MeshFaceMaterial;A=!0===L?p.material:null;for(var ka=0,La=v.length;ka<La;ka++){var la=v[ka];N.pushVertex(la.x,la.y,la.z)}ka=0;for(La=x.length;ka<La;ka++){v=x[ka];var Ba=!0===L?A.materials[v.materialIndex]:p.material;if(void 0!==Ba){C=Ba.side;var la=s[v.a],Ja=s[v.b],ma=s[v.c];if(!0===Ba.morphTargets){y=r.morphTargets;var Ca=p.morphTargetInfluences,
-ba=la.position,wa=Ja.position,xa=ma.position;I.set(0,0,0);O.set(0,0,0);K.set(0,0,0);for(var Na=0,hb=y.length;Na<hb;Na++){var Ma=Ca[Na];if(0!==Ma){var Da=y[Na].vertices;I.x+=(Da[v.a].x-ba.x)*Ma;I.y+=(Da[v.a].y-ba.y)*Ma;I.z+=(Da[v.a].z-ba.z)*Ma;O.x+=(Da[v.b].x-wa.x)*Ma;O.y+=(Da[v.b].y-wa.y)*Ma;O.z+=(Da[v.b].z-wa.z)*Ma;K.x+=(Da[v.c].x-xa.x)*Ma;K.y+=(Da[v.c].y-xa.y)*Ma;K.z+=(Da[v.c].z-xa.z)*Ma}}la.position.add(I);Ja.position.add(O);ma.position.add(K);N.projectVertex(la);N.projectVertex(Ja);N.projectVertex(ma)}Ca=
-N.checkTriangleVisibility(la,Ja,ma);if(!(!1===Ca&&C===THREE.FrontSide||!0===Ca&&C===THREE.BackSide)){q=b();q.id=p.id;q.v1.copy(la);q.v2.copy(Ja);q.v3.copy(ma);q.normalModel.copy(v.normal);!1!==Ca||C!==THREE.BackSide&&C!==THREE.DoubleSide||q.normalModel.negate();q.normalModel.applyMatrix3(V).normalize();q.centroidModel.copy(v.centroid).applyMatrix4(R);y=v.vertexNormals;ba=0;for(wa=Math.min(y.length,3);ba<wa;ba++)xa=q.vertexNormalsModel[ba],xa.copy(y[ba]),!1!==Ca||C!==THREE.BackSide&&C!==THREE.DoubleSide||
-xa.negate(),xa.applyMatrix3(V).normalize();q.vertexNormalsLength=y.length;y=0;for(Ca=Math.min(z.length,3);y<Ca;y++)if(C=z[y][ka],void 0!==C)for(ba=0,wa=C.length;ba<wa;ba++)q.uvs[y][ba]=C[ba];q.color=v.color;q.material=Ba;q.z=(la.positionScreen.z+Ja.positionScreen.z+ma.positionScreen.z)/3;G.elements.push(q)}}}}}else if(p instanceof THREE.Line)if(r instanceof THREE.BufferGeometry){if(z=r.attributes,void 0!==z.position){L=z.position.array;r=0;for(x=L.length;r<x;r+=3)N.pushVertex(L[r],L[r+1],L[r+2]);
-if(void 0!==z.index)for(z=z.index.array,r=0,x=z.length;r<x;r+=2)N.pushLine(z[r],z[r+1]);else for(r=0,x=L.length/3-1;r<x;r++)N.pushLine(r,r+1)}}else{if(r instanceof THREE.Geometry&&(fa.multiplyMatrices(Y,R),v=p.geometry.vertices,0!==v.length))for(la=a(),la.positionScreen.copy(v[0]).applyMatrix4(fa),r=p.type===THREE.LinePieces?2:1,ka=1,La=v.length;ka<La;ka++)la=a(),la.positionScreen.copy(v[ka]).applyMatrix4(fa),0<(ka+1)%r||(Ja=s[n-2],J.copy(la.positionScreen),da.copy(Ja.positionScreen),!0===e(J,da)&&
+this.projectScene=function(f,h,k,l){var p,r,v,x,y,z,C,L,A;E=t=u=0;G.elements.length=0;!0===f.autoUpdate&&f.updateMatrixWorld();void 0===h.parent&&h.updateMatrixWorld();Q.copy(h.matrixWorldInverse.getInverse(h.matrixWorld));Y.multiplyMatrices(h.projectionMatrix,Q);ga.setFromMatrix(Y);g=0;G.objects.length=0;G.lights.length=0;W(f);!0===k&&G.objects.sort(d);f=0;for(k=G.objects.length;f<k;f++)if(p=G.objects[f].object,r=p.geometry,M.setObject(p),R=p.matrixWorld,n=0,p instanceof THREE.Mesh)if(r instanceof
+THREE.BufferGeometry){if(z=r.attributes,p=r.offsets,void 0!==z.position){L=z.position.array;r=0;for(x=L.length;r<x;r+=3)M.pushVertex(L[r],L[r+1],L[r+2]);A=z.normal.array;r=0;for(x=A.length;r<x;r+=3)M.pushNormal(A[r],A[r+1],A[r+2]);if(void 0!==z.index)if(z=z.index.array,0<p.length)for(f=0;f<p.length;f++)for(x=p[f],L=x.index,r=x.start,x=x.start+x.count;r<x;r+=3)M.pushTriangle(z[r]+L,z[r+1]+L,z[r+2]+L);else for(r=0,x=z.length;r<x;r+=3)M.pushTriangle(z[r],z[r+1],z[r+2]);else for(r=0,x=L.length/3;r<x;r+=
+3)M.pushTriangle(r,r+1,r+2)}}else{if(r instanceof THREE.Geometry){v=r.vertices;x=r.faces;z=r.faceVertexUvs;V.getNormalMatrix(R);L=p.material instanceof THREE.MeshFaceMaterial;A=!0===L?p.material:null;for(var ka=0,La=v.length;ka<La;ka++){var la=v[ka];M.pushVertex(la.x,la.y,la.z)}ka=0;for(La=x.length;ka<La;ka++){v=x[ka];var Ba=!0===L?A.materials[v.materialIndex]:p.material;if(void 0!==Ba){C=Ba.side;var la=s[v.a],Ja=s[v.b],ma=s[v.c];if(!0===Ba.morphTargets){y=r.morphTargets;var Ca=p.morphTargetInfluences,
+ba=la.position,wa=Ja.position,xa=ma.position;I.set(0,0,0);O.set(0,0,0);K.set(0,0,0);for(var Na=0,hb=y.length;Na<hb;Na++){var Ma=Ca[Na];if(0!==Ma){var Da=y[Na].vertices;I.x+=(Da[v.a].x-ba.x)*Ma;I.y+=(Da[v.a].y-ba.y)*Ma;I.z+=(Da[v.a].z-ba.z)*Ma;O.x+=(Da[v.b].x-wa.x)*Ma;O.y+=(Da[v.b].y-wa.y)*Ma;O.z+=(Da[v.b].z-wa.z)*Ma;K.x+=(Da[v.c].x-xa.x)*Ma;K.y+=(Da[v.c].y-xa.y)*Ma;K.z+=(Da[v.c].z-xa.z)*Ma}}la.position.add(I);Ja.position.add(O);ma.position.add(K);M.projectVertex(la);M.projectVertex(Ja);M.projectVertex(ma)}Ca=
+M.checkTriangleVisibility(la,Ja,ma);if(!(!1===Ca&&C===THREE.FrontSide||!0===Ca&&C===THREE.BackSide)){q=b();q.id=p.id;q.v1.copy(la);q.v2.copy(Ja);q.v3.copy(ma);q.normalModel.copy(v.normal);!1!==Ca||C!==THREE.BackSide&&C!==THREE.DoubleSide||q.normalModel.negate();q.normalModel.applyMatrix3(V).normalize();q.centroidModel.copy(v.centroid).applyMatrix4(R);y=v.vertexNormals;ba=0;for(wa=Math.min(y.length,3);ba<wa;ba++)xa=q.vertexNormalsModel[ba],xa.copy(y[ba]),!1!==Ca||C!==THREE.BackSide&&C!==THREE.DoubleSide||
+xa.negate(),xa.applyMatrix3(V).normalize();q.vertexNormalsLength=y.length;y=0;for(Ca=Math.min(z.length,3);y<Ca;y++)if(C=z[y][ka],void 0!==C)for(ba=0,wa=C.length;ba<wa;ba++)q.uvs[y][ba]=C[ba];q.color=v.color;q.material=Ba;q.z=(la.positionScreen.z+Ja.positionScreen.z+ma.positionScreen.z)/3;G.elements.push(q)}}}}}else if(p instanceof THREE.Line)if(r instanceof THREE.BufferGeometry){if(z=r.attributes,void 0!==z.position){L=z.position.array;r=0;for(x=L.length;r<x;r+=3)M.pushVertex(L[r],L[r+1],L[r+2]);
+if(void 0!==z.index)for(z=z.index.array,r=0,x=z.length;r<x;r+=2)M.pushLine(z[r],z[r+1]);else for(r=0,x=L.length/3-1;r<x;r++)M.pushLine(r,r+1)}}else{if(r instanceof THREE.Geometry&&(fa.multiplyMatrices(Y,R),v=p.geometry.vertices,0!==v.length))for(la=a(),la.positionScreen.copy(v[0]).applyMatrix4(fa),r=p.type===THREE.LinePieces?2:1,ka=1,La=v.length;ka<La;ka++)la=a(),la.positionScreen.copy(v[ka]).applyMatrix4(fa),0<(ka+1)%r||(Ja=s[n-2],J.copy(la.positionScreen),da.copy(Ja.positionScreen),!0===e(J,da)&&
 (J.multiplyScalar(1/J.w),da.multiplyScalar(1/da.w),w=c(),w.id=p.id,w.v1.positionScreen.copy(J),w.v2.positionScreen.copy(da),w.z=Math.max(J.z,da.z),w.material=p.material,p.material.vertexColors===THREE.VertexColors&&(w.vertexColors[0].copy(p.geometry.colors[ka]),w.vertexColors[1].copy(p.geometry.colors[ka-1])),G.elements.push(w)))}else p instanceof THREE.Sprite&&(F.set(R.elements[12],R.elements[13],R.elements[14],1),F.applyMatrix4(Y),r=1/F.w,F.z*=r,-1<=F.z&&1>=F.z&&(E===D?(x=new THREE.RenderableSprite,
 (J.multiplyScalar(1/J.w),da.multiplyScalar(1/da.w),w=c(),w.id=p.id,w.v1.positionScreen.copy(J),w.v2.positionScreen.copy(da),w.z=Math.max(J.z,da.z),w.material=p.material,p.material.vertexColors===THREE.VertexColors&&(w.vertexColors[0].copy(p.geometry.colors[ka]),w.vertexColors[1].copy(p.geometry.colors[ka-1])),G.elements.push(w)))}else p instanceof THREE.Sprite&&(F.set(R.elements[12],R.elements[13],R.elements[14],1),F.applyMatrix4(Y),r=1/F.w,F.z*=r,-1<=F.z&&1>=F.z&&(E===D?(x=new THREE.RenderableSprite,
 H.push(x),D++,E++,B=x):B=H[E++],B.id=p.id,B.x=F.x*r,B.y=F.y*r,B.z=F.z,B.object=p,B.rotation=p.rotation,B.scale.x=p.scale.x*Math.abs(B.x-(F.x+h.projectionMatrix.elements[0])/(F.w+h.projectionMatrix.elements[12])),B.scale.y=p.scale.y*Math.abs(B.y-(F.y+h.projectionMatrix.elements[5])/(F.w+h.projectionMatrix.elements[13])),B.material=p.material,G.elements.push(B)));!0===l&&G.elements.sort(d);return G}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
 H.push(x),D++,E++,B=x):B=H[E++],B.id=p.id,B.x=F.x*r,B.y=F.y*r,B.z=F.z,B.object=p,B.rotation=p.rotation,B.scale.x=p.scale.x*Math.abs(B.x-(F.x+h.projectionMatrix.elements[0])/(F.w+h.projectionMatrix.elements[12])),B.scale.y=p.scale.y*Math.abs(B.y-(F.y+h.projectionMatrix.elements[5])/(F.w+h.projectionMatrix.elements[13])),B.material=p.material,G.elements.push(B)));!0===l&&G.elements.sort(d);return G}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
@@ -191,8 +191,8 @@ t[c].index;a=b;for(b+=g;a<b;a+=3)g=x+w[a],h=x+w[a+1],k=x+w[a+2],l=e[3*g],n=e[3*g
 u.set(l,n,s),p.subVectors(u,q),v.subVectors(r,q),p.cross(v),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z;this.normalizeNormals();this.normalsNeedUpdate=!0}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},computeTangents:function(){function a(a,b,c){s=d[3*a];r=d[3*a+1];q=d[3*a+2];u=d[3*b];p=d[3*b+1];v=d[3*b+2];w=d[3*c];
 u.set(l,n,s),p.subVectors(u,q),v.subVectors(r,q),p.cross(v),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z;this.normalizeNormals();this.normalsNeedUpdate=!0}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},computeTangents:function(){function a(a,b,c){s=d[3*a];r=d[3*a+1];q=d[3*a+2];u=d[3*b];p=d[3*b+1];v=d[3*b+2];w=d[3*c];
 t=d[3*c+1];x=d[3*c+2];z=f[2*a];B=f[2*a+1];E=f[2*b];H=f[2*b+1];D=f[2*c];G=f[2*c+1];I=u-s;O=w-s;K=p-r;y=t-r;F=v-q;C=x-q;A=E-z;L=D-z;Q=H-B;Y=G-B;R=1/(A*Y-L*Q);fa.set((Y*I-Q*O)*R,(Y*K-Q*y)*R,(Y*F-Q*C)*R);V.set((A*O-L*I)*R,(A*y-L*K)*R,(A*C-L*F)*R);k[a].add(fa);k[b].add(fa);k[c].add(fa);l[a].add(V);l[b].add(V);l[c].add(V)}function b(a){S.x=e[3*a];S.y=e[3*a+1];S.z=e[3*a+2];$.copy(S);ta=k[a];T.copy(ta);T.sub(S.multiplyScalar(S.dot(ta))).normalize();Ka.crossVectors($,ta);oa=Ka.dot(l[a]);Ea=0>oa?-1:1;h[4*a]=
 t=d[3*c+1];x=d[3*c+2];z=f[2*a];B=f[2*a+1];E=f[2*b];H=f[2*b+1];D=f[2*c];G=f[2*c+1];I=u-s;O=w-s;K=p-r;y=t-r;F=v-q;C=x-q;A=E-z;L=D-z;Q=H-B;Y=G-B;R=1/(A*Y-L*Q);fa.set((Y*I-Q*O)*R,(Y*K-Q*y)*R,(Y*F-Q*C)*R);V.set((A*O-L*I)*R,(A*y-L*K)*R,(A*C-L*F)*R);k[a].add(fa);k[b].add(fa);k[c].add(fa);l[a].add(V);l[b].add(V);l[c].add(V)}function b(a){S.x=e[3*a];S.y=e[3*a+1];S.z=e[3*a+2];$.copy(S);ta=k[a];T.copy(ta);T.sub(S.multiplyScalar(S.dot(ta))).normalize();Ka.crossVectors($,ta);oa=Ka.dot(l[a]);Ea=0>oa?-1:1;h[4*a]=
 T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=Ea}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent={itemSize:4,array:new Float32Array(4*
 T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=Ea}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent={itemSize:4,array:new Float32Array(4*
-g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var s,r,q,u,p,v,w,t,x,z,B,E,H,D,G,I,O,K,y,F,C,A,L,Q,Y,R,fa=new THREE.Vector3,V=new THREE.Vector3,ga,J,da,W,N,ca=this.offsets,n=0;for(J=ca.length;n<J;++n){ga=ca[n].start;da=ca[n].count;var sa=ca[n].index,g=ga;for(ga+=da;g<ga;g+=3)da=sa+c[g],W=sa+c[g+1],N=sa+c[g+2],a(da,W,N)}var T=new THREE.Vector3,Ka=new THREE.Vector3,S=new THREE.Vector3,$=new THREE.Vector3,Ea,ta,oa,n=0;for(J=ca.length;n<
-J;++n)for(ga=ca[n].start,da=ca[n].count,sa=ca[n].index,g=ga,ga+=da;g<ga;g+=3)da=sa+c[g],W=sa+c[g+1],N=sa+c[g+2],b(da),b(W),b(N)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,s=new Int32Array(6),r=new Int32Array(c.length),q=new Int32Array(c.length),u=0;u<c.length;u++)r[u]=-1,q[u]=-1;for(c=0;c<d;c++){for(var p=n=
+g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var s,r,q,u,p,v,w,t,x,z,B,E,H,D,G,I,O,K,y,F,C,A,L,Q,Y,R,fa=new THREE.Vector3,V=new THREE.Vector3,ga,J,da,W,M,ca=this.offsets,n=0;for(J=ca.length;n<J;++n){ga=ca[n].start;da=ca[n].count;var sa=ca[n].index,g=ga;for(ga+=da;g<ga;g+=3)da=sa+c[g],W=sa+c[g+1],M=sa+c[g+2],a(da,W,M)}var T=new THREE.Vector3,Ka=new THREE.Vector3,S=new THREE.Vector3,$=new THREE.Vector3,Ea,ta,oa,n=0;for(J=ca.length;n<
+J;++n)for(ga=ca[n].start,da=ca[n].count,sa=ca[n].index,g=ga,ga+=da;g<ga;g+=3)da=sa+c[g],W=sa+c[g+1],M=sa+c[g+2],b(da),b(W),b(M)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,s=new Int32Array(6),r=new Int32Array(c.length),q=new Int32Array(c.length),u=0;u<c.length;u++)r[u]=-1,q[u]=-1;for(c=0;c<d;c++){for(var p=n=
 0;3>p;p++)u=a[3*c+p],-1==r[u]?(s[2*p]=u,s[2*p+1]=-1,n++):r[u]<k.index?(s[2*p]=u,s[2*p+1]=-1,l++):(s[2*p]=u,s[2*p+1]=r[u]);if(g+n>k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)p=s[n+1],-1<p&&p<k.index&&(s[n+1]=-1);for(n=0;6>n;n+=2)u=s[n],p=s[n+1],-1===p&&(p=g++),r[u]=p,q[p]=u,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,q,g);return this.offsets=h},reorderBuffers:function(a,b,c){var d={},e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,
 0;3>p;p++)u=a[3*c+p],-1==r[u]?(s[2*p]=u,s[2*p+1]=-1,n++):r[u]<k.index?(s[2*p]=u,s[2*p+1]=-1,l++):(s[2*p]=u,s[2*p+1]=r[u]);if(g+n>k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)p=s[n+1],-1<p&&p<k.index&&(s[n+1]=-1);for(n=0;6>n;n+=2)u=s[n],p=s[n+1],-1===p&&(p=g++),r[u]=p,q[p]=u,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,q,g);return this.offsets=h},reorderBuffers:function(a,b,c){var d={},e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,
 Float64Array],f;for(f in this.attributes)if("index"!=f)for(var g=this.attributes[f].array,h=0,k=e.length;h<k;h++){var l=e[h];if(g instanceof l){d[f]=new l(this.attributes[f].itemSize*c);break}}for(e=0;e<c;e++)for(f in g=b[e],this.attributes)if("index"!=f)for(var h=this.attributes[f].array,k=this.attributes[f].itemSize,l=d[f],n=0;n<k;n++)l[e*k+n]=h[g*k+n];this.attributes.index.array=a;for(f in this.attributes)"index"!=f&&(this.attributes[f].array=d[f],this.attributes[f].numItems=this.attributes[f].itemSize*
 Float64Array],f;for(f in this.attributes)if("index"!=f)for(var g=this.attributes[f].array,h=0,k=e.length;h<k;h++){var l=e[h];if(g instanceof l){d[f]=new l(this.attributes[f].itemSize*c);break}}for(e=0;e<c;e++)for(f in g=b[e],this.attributes)if("index"!=f)for(var h=this.attributes[f].array,k=this.attributes[f].itemSize,l=d[f],n=0;n<k;n++)l[e*k+n]=h[g*k+n];this.attributes.index.array=a;for(f in this.attributes)"index"!=f&&(this.attributes[f].array=d[f],this.attributes[f].numItems=this.attributes[f].itemSize*
 c)},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,array:null},d=0,g=b.length;d<g;d++){var h=b[d];if(e instanceof h){f.array=new h(e);break}}a.attributes[c]=f}d=0;for(g=this.offsets.length;d<g;d++)b=this.offsets[d],a.offsets.push({start:b.start,index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};
 c)},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,array:null},d=0,g=b.length;d<g;d++){var h=b[d];if(e instanceof h){f.array=new h(e);break}}a.attributes[c]=f}d=0;for(g=this.offsets.length;d<g;d++)b=this.offsets[d],a.offsets.push({start:b.start,index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};
@@ -321,7 +321,7 @@ function g(a,b,c,d,g,h,k,m,l,n,p,r,q){if(!(q instanceof THREE.DataTexture)){!1==
 k-c*m,b=b-n*k-d*m,y.save(),y.transform(q,n,c,d,a,b),y.fill(),y.restore())}else v("rgba(0,0,0,1)"),y.fill()}}function h(a,b,c,d,e,f,g,h,k,m,l,n,p){var q,r;q=p.width-1;r=p.height-1;g*=q;h*=r;c-=a;d-=b;e-=a;f-=b;k=k*q-g;m=m*r-h;l=l*q-g;n=n*r-h;r=1/(k*n-l*m);q=(n*c-m*e)*r;m=(n*d-m*f)*r;c=(k*e-l*c)*r;d=(k*f-l*d)*r;a=a-q*g-c*h;b=b-m*g-d*h;y.save();y.transform(q,m,c,d,a,b);y.clip();y.drawImage(p,0,0);y.restore()}function k(a,b,c,d){pa[0]=255*a.r|0;pa[1]=255*a.g|0;pa[2]=255*a.b|0;pa[4]=255*b.r|0;pa[5]=255*
 k-c*m,b=b-n*k-d*m,y.save(),y.transform(q,n,c,d,a,b),y.fill(),y.restore())}else v("rgba(0,0,0,1)"),y.fill()}}function h(a,b,c,d,e,f,g,h,k,m,l,n,p){var q,r;q=p.width-1;r=p.height-1;g*=q;h*=r;c-=a;d-=b;e-=a;f-=b;k=k*q-g;m=m*r-h;l=l*q-g;n=n*r-h;r=1/(k*n-l*m);q=(n*c-m*e)*r;m=(n*d-m*f)*r;c=(k*e-l*c)*r;d=(k*f-l*d)*r;a=a-q*g-c*h;b=b-m*g-d*h;y.save();y.transform(q,m,c,d,a,b);y.clip();y.drawImage(p,0,0);y.restore()}function k(a,b,c,d){pa[0]=255*a.r|0;pa[1]=255*a.g|0;pa[2]=255*a.b|0;pa[4]=255*b.r|0;pa[5]=255*
 b.g|0;pa[6]=255*b.b|0;pa[8]=255*c.r|0;pa[9]=255*c.g|0;pa[10]=255*c.b|0;pa[12]=255*d.r|0;pa[13]=255*d.g|0;pa[14]=255*d.b|0;Oa.putImageData(Sa,0,0);Xa.drawImage(Ga,0,0);return Pa}function l(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function n(a){A!==a&&(A=y.globalAlpha=a)}function s(a){L!==a&&(a===THREE.NormalBlending?y.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?y.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&
 b.g|0;pa[6]=255*b.b|0;pa[8]=255*c.r|0;pa[9]=255*c.g|0;pa[10]=255*c.b|0;pa[12]=255*d.r|0;pa[13]=255*d.g|0;pa[14]=255*d.b|0;Oa.putImageData(Sa,0,0);Xa.drawImage(Ga,0,0);return Pa}function l(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function n(a){A!==a&&(A=y.globalAlpha=a)}function s(a){L!==a&&(a===THREE.NormalBlending?y.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?y.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&
 (y.globalCompositeOperation="darker"),L=a)}function r(a){R!==a&&(R=y.lineWidth=a)}function q(a){fa!==a&&(fa=y.lineCap=a)}function u(a){V!==a&&(V=y.lineJoin=a)}function p(a){Q!==a&&(Q=y.strokeStyle=a)}function v(a){Y!==a&&(Y=y.fillStyle=a)}function w(a,b){if(ga!==a||J!==b)y.setLineDash([a,b]),ga=a,J=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var t=THREE.Math.smoothstep;a=a||{};var x=this,z,B,E,H=new THREE.Projector,D=void 0!==a.canvas?a.canvas:document.createElement("canvas"),G=D.width,I=
 (y.globalCompositeOperation="darker"),L=a)}function r(a){R!==a&&(R=y.lineWidth=a)}function q(a){fa!==a&&(fa=y.lineCap=a)}function u(a){V!==a&&(V=y.lineJoin=a)}function p(a){Q!==a&&(Q=y.strokeStyle=a)}function v(a){Y!==a&&(Y=y.fillStyle=a)}function w(a,b){if(ga!==a||J!==b)y.setLineDash([a,b]),ga=a,J=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var t=THREE.Math.smoothstep;a=a||{};var x=this,z,B,E,H=new THREE.Projector,D=void 0!==a.canvas?a.canvas:document.createElement("canvas"),G=D.width,I=
-D.height,O=Math.floor(G/2),K=Math.floor(I/2),y=D.getContext("2d",{alpha:!0===a.alpha}),F=new THREE.Color(0),C=0,A=1,L=0,Q=null,Y=null,R=null,fa=null,V=null,ga=null,J=0,da,W,N,ca;new THREE.RenderableVertex;new THREE.RenderableVertex;var sa,T,Ka,S,$,Ea,ta=new THREE.Color,oa=new THREE.Color,za=new THREE.Color,Aa=new THREE.Color,Wa=new THREE.Color,Fa=new THREE.Color,ka=new THREE.Color,La=new THREE.Color,la={},Ba,Ja,ma,Ca,ba,wa,xa,Na,hb,Ma,Da=new THREE.Box2,na=new THREE.Box2,Ra=new THREE.Box2,ib=new THREE.Color,
+D.height,O=Math.floor(G/2),K=Math.floor(I/2),y=D.getContext("2d",{alpha:!0===a.alpha}),F=new THREE.Color(0),C=0,A=1,L=0,Q=null,Y=null,R=null,fa=null,V=null,ga=null,J=0,da,W,M,ca;new THREE.RenderableVertex;new THREE.RenderableVertex;var sa,T,Ka,S,$,Ea,ta=new THREE.Color,oa=new THREE.Color,za=new THREE.Color,Aa=new THREE.Color,Wa=new THREE.Color,Fa=new THREE.Color,ka=new THREE.Color,La=new THREE.Color,la={},Ba,Ja,ma,Ca,ba,wa,xa,Na,hb,Ma,Da=new THREE.Box2,na=new THREE.Box2,Ra=new THREE.Box2,ib=new THREE.Color,
 ya=new THREE.Color,ia=new THREE.Color,Qa=new THREE.Vector3,ha=new THREE.Vector3,m=new THREE.Matrix3,Ga,Oa,Sa,pa,Pa,Xa,db=16;Ga=document.createElement("canvas");Ga.width=Ga.height=2;Oa=Ga.getContext("2d");Oa.fillStyle="rgba(0,0,0,1)";Oa.fillRect(0,0,2,2);Sa=Oa.getImageData(0,0,2,2);pa=Sa.data;Pa=document.createElement("canvas");Pa.width=Pa.height=db;Xa=Pa.getContext("2d");Xa.translate(-db/2,-db/2);Xa.scale(db,db);db--;void 0===y.setLineDash&&(y.setLineDash=void 0!==y.mozDash?function(a){y.mozDash=
 ya=new THREE.Color,ia=new THREE.Color,Qa=new THREE.Vector3,ha=new THREE.Vector3,m=new THREE.Matrix3,Ga,Oa,Sa,pa,Pa,Xa,db=16;Ga=document.createElement("canvas");Ga.width=Ga.height=2;Oa=Ga.getContext("2d");Oa.fillStyle="rgba(0,0,0,1)";Oa.fillRect(0,0,2,2);Sa=Oa.getImageData(0,0,2,2);pa=Sa.data;Pa=document.createElement("canvas");Pa.width=Pa.height=db;Xa=Pa.getContext("2d");Xa.translate(-db/2,-db/2);Xa.scale(db,db);db--;void 0===y.setLineDash&&(y.setLineDash=void 0!==y.mozDash?function(a){y.mozDash=
 null!==a[0]?a:null}:function(){});this.domElement=D;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){G=a*this.devicePixelRatio;I=b*this.devicePixelRatio;O=Math.floor(G/2);K=Math.floor(I/2);D.width=G;D.height=I;1!==this.devicePixelRatio&&
 null!==a[0]?a:null}:function(){});this.domElement=D;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){G=a*this.devicePixelRatio;I=b*this.devicePixelRatio;O=Math.floor(G/2);K=Math.floor(I/2);D.width=G;D.height=I;1!==this.devicePixelRatio&&
 !1!==c&&(D.style.width=a+"px",D.style.height=b+"px");Da.min.set(-O,-K);Da.max.set(O,K);na.min.set(-O,-K);na.max.set(O,K);A=1;L=0;V=fa=R=Y=Q=null};this.setClearColor=function(a,b){F.set(a);C=void 0!==b?b:1;na.min.set(-O,-K);na.max.set(O,K)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){y.setTransform(1,0,0,-1,O,K);!1===na.empty()&&
 !1!==c&&(D.style.width=a+"px",D.style.height=b+"px");Da.min.set(-O,-K);Da.max.set(O,K);na.min.set(-O,-K);na.max.set(O,K);A=1;L=0;V=fa=R=Y=Q=null};this.setClearColor=function(a,b){F.set(a);C=void 0!==b?b:1;na.min.set(-O,-K);na.max.set(O,K)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){y.setTransform(1,0,0,-1,O,K);!1===na.empty()&&
@@ -329,10 +329,10 @@ null!==a[0]?a:null}:function(){});this.domElement=D;this.devicePixelRatio=void 0
 else{!0===this.autoClear&&this.clear();y.setTransform(1,0,0,-1,O,K);x.info.render.vertices=0;x.info.render.faces=0;z=H.projectScene(a,D,this.sortObjects,this.sortElements);B=z.elements;E=z.lights;da=D;m.getNormalMatrix(D.matrixWorldInverse);ib.setRGB(0,0,0);ya.setRGB(0,0,0);ia.setRGB(0,0,0);for(var I=0,L=E.length;I<L;I++){var C=E[I],G=C.color;C instanceof THREE.AmbientLight?ib.add(G):C instanceof THREE.DirectionalLight?ya.add(G):C instanceof THREE.PointLight&&ia.add(G)}I=0;for(L=B.length;I<L;I++){var A=
 else{!0===this.autoClear&&this.clear();y.setTransform(1,0,0,-1,O,K);x.info.render.vertices=0;x.info.render.faces=0;z=H.projectScene(a,D,this.sortObjects,this.sortElements);B=z.elements;E=z.lights;da=D;m.getNormalMatrix(D.matrixWorldInverse);ib.setRGB(0,0,0);ya.setRGB(0,0,0);ia.setRGB(0,0,0);for(var I=0,L=E.length;I<L;I++){var C=E[I],G=C.color;C instanceof THREE.AmbientLight?ib.add(G):C instanceof THREE.DirectionalLight?ya.add(G):C instanceof THREE.PointLight&&ia.add(G)}I=0;for(L=B.length;I<L;I++){var A=
 B[I],F=A.material;if(void 0!==F&&!1!==F.visible){Ra.makeEmpty();if(A instanceof THREE.RenderableSprite){W=A;W.x*=O;W.y*=K;C=W;G=F;n(G.opacity);s(G.blending);var J=A.scale.x*O,A=A.scale.y*K,F=0.5*Math.sqrt(J*J+A*A);Ra.min.set(C.x-F,C.y-F);Ra.max.set(C.x+F,C.y+F);if(G instanceof THREE.SpriteMaterial||G instanceof THREE.ParticleSystemMaterial){var Q=G.map;if(null!==Q){!1===Q.hasEventListener("update",e)&&(void 0!==Q.image&&0<Q.image.width&&f(Q),Q.addEventListener("update",e));F=la[Q.id];void 0!==F?v(F):
 B[I],F=A.material;if(void 0!==F&&!1!==F.visible){Ra.makeEmpty();if(A instanceof THREE.RenderableSprite){W=A;W.x*=O;W.y*=K;C=W;G=F;n(G.opacity);s(G.blending);var J=A.scale.x*O,A=A.scale.y*K,F=0.5*Math.sqrt(J*J+A*A);Ra.min.set(C.x-F,C.y-F);Ra.max.set(C.x+F,C.y+F);if(G instanceof THREE.SpriteMaterial||G instanceof THREE.ParticleSystemMaterial){var Q=G.map;if(null!==Q){!1===Q.hasEventListener("update",e)&&(void 0!==Q.image&&0<Q.image.width&&f(Q),Q.addEventListener("update",e));F=la[Q.id];void 0!==F?v(F):
 v("rgba( 0, 0, 0, 1 )");var R=Q.image,F=R.width*Q.offset.x,Y=R.height*Q.offset.y,V=R.width*Q.repeat.x,Q=R.height*Q.repeat.y,R=J/V,fa=A/Q;y.save();y.translate(C.x,C.y);0!==G.rotation&&y.rotate(G.rotation);y.translate(-J/2,-A/2);y.scale(R,fa);y.translate(-F,-Y);y.fillRect(F,Y,V,Q)}else v(G.color.getStyle()),y.save(),y.translate(C.x,C.y),0!==G.rotation&&y.rotate(G.rotation),y.scale(J,-A),y.fillRect(-0.5,-0.5,1,1);y.restore()}else G instanceof THREE.SpriteCanvasMaterial&&(p(G.color.getStyle()),v(G.color.getStyle()),
 v("rgba( 0, 0, 0, 1 )");var R=Q.image,F=R.width*Q.offset.x,Y=R.height*Q.offset.y,V=R.width*Q.repeat.x,Q=R.height*Q.repeat.y,R=J/V,fa=A/Q;y.save();y.translate(C.x,C.y);0!==G.rotation&&y.rotate(G.rotation);y.translate(-J/2,-A/2);y.scale(R,fa);y.translate(-F,-Y);y.fillRect(F,Y,V,Q)}else v(G.color.getStyle()),y.save(),y.translate(C.x,C.y),0!==G.rotation&&y.rotate(G.rotation),y.scale(J,-A),y.fillRect(-0.5,-0.5,1,1);y.restore()}else G instanceof THREE.SpriteCanvasMaterial&&(p(G.color.getStyle()),v(G.color.getStyle()),
-y.save(),y.translate(C.x,C.y),0!==G.rotation&&y.rotate(G.rotation),y.scale(J,A),G.program(y),y.restore())}else if(A instanceof THREE.RenderableLine){if(W=A.v1,N=A.v2,W.positionScreen.x*=O,W.positionScreen.y*=K,N.positionScreen.x*=O,N.positionScreen.y*=K,Ra.setFromPoints([W.positionScreen,N.positionScreen]),!0===Da.isIntersectionBox(Ra))if(C=W,G=N,J=A,A=F,n(A.opacity),s(A.blending),y.beginPath(),y.moveTo(C.positionScreen.x,C.positionScreen.y),y.lineTo(G.positionScreen.x,G.positionScreen.y),A instanceof
+y.save(),y.translate(C.x,C.y),0!==G.rotation&&y.rotate(G.rotation),y.scale(J,A),G.program(y),y.restore())}else if(A instanceof THREE.RenderableLine){if(W=A.v1,M=A.v2,W.positionScreen.x*=O,W.positionScreen.y*=K,M.positionScreen.x*=O,M.positionScreen.y*=K,Ra.setFromPoints([W.positionScreen,M.positionScreen]),!0===Da.isIntersectionBox(Ra))if(C=W,G=M,J=A,A=F,n(A.opacity),s(A.blending),y.beginPath(),y.moveTo(C.positionScreen.x,C.positionScreen.y),y.lineTo(G.positionScreen.x,G.positionScreen.y),A instanceof
 THREE.LineBasicMaterial){r(A.linewidth);q(A.linecap);u(A.linejoin);if(A.vertexColors!==THREE.VertexColors)p(A.color.getStyle());else if(F=J.vertexColors[0].getStyle(),J=J.vertexColors[1].getStyle(),F===J)p(F);else{try{var ga=y.createLinearGradient(C.positionScreen.x,C.positionScreen.y,G.positionScreen.x,G.positionScreen.y);ga.addColorStop(0,F);ga.addColorStop(1,J)}catch(pa){ga=F}p(ga)}y.stroke();Ra.expandByScalar(2*A.linewidth)}else A instanceof THREE.LineDashedMaterial&&(r(A.linewidth),q(A.linecap),
 THREE.LineBasicMaterial){r(A.linewidth);q(A.linecap);u(A.linejoin);if(A.vertexColors!==THREE.VertexColors)p(A.color.getStyle());else if(F=J.vertexColors[0].getStyle(),J=J.vertexColors[1].getStyle(),F===J)p(F);else{try{var ga=y.createLinearGradient(C.positionScreen.x,C.positionScreen.y,G.positionScreen.x,G.positionScreen.y);ga.addColorStop(0,F);ga.addColorStop(1,J)}catch(pa){ga=F}p(ga)}y.stroke();Ra.expandByScalar(2*A.linewidth)}else A instanceof THREE.LineDashedMaterial&&(r(A.linewidth),q(A.linecap),
-u(A.linejoin),p(A.color.getStyle()),w(A.dashSize,A.gapSize),y.stroke(),Ra.expandByScalar(2*A.linewidth),w(null,null))}else if(A instanceof THREE.RenderableFace){W=A.v1;N=A.v2;ca=A.v3;if(-1>W.positionScreen.z||1<W.positionScreen.z)continue;if(-1>N.positionScreen.z||1<N.positionScreen.z)continue;if(-1>ca.positionScreen.z||1<ca.positionScreen.z)continue;W.positionScreen.x*=O;W.positionScreen.y*=K;N.positionScreen.x*=O;N.positionScreen.y*=K;ca.positionScreen.x*=O;ca.positionScreen.y*=K;0<F.overdraw&&
-(l(W.positionScreen,N.positionScreen,F.overdraw),l(N.positionScreen,ca.positionScreen,F.overdraw),l(ca.positionScreen,W.positionScreen,F.overdraw));Ra.setFromPoints([W.positionScreen,N.positionScreen,ca.positionScreen]);if(!0===Da.isIntersectionBox(Ra)){C=W;G=N;J=ca;x.info.render.vertices+=3;x.info.render.faces++;n(F.opacity);s(F.blending);sa=C.positionScreen.x;T=C.positionScreen.y;Ka=G.positionScreen.x;S=G.positionScreen.y;$=J.positionScreen.x;Ea=J.positionScreen.y;var Y=sa,V=T,Q=Ka,R=S,fa=$,tc=
+u(A.linejoin),p(A.color.getStyle()),w(A.dashSize,A.gapSize),y.stroke(),Ra.expandByScalar(2*A.linewidth),w(null,null))}else if(A instanceof THREE.RenderableFace){W=A.v1;M=A.v2;ca=A.v3;if(-1>W.positionScreen.z||1<W.positionScreen.z)continue;if(-1>M.positionScreen.z||1<M.positionScreen.z)continue;if(-1>ca.positionScreen.z||1<ca.positionScreen.z)continue;W.positionScreen.x*=O;W.positionScreen.y*=K;M.positionScreen.x*=O;M.positionScreen.y*=K;ca.positionScreen.x*=O;ca.positionScreen.y*=K;0<F.overdraw&&
+(l(W.positionScreen,M.positionScreen,F.overdraw),l(M.positionScreen,ca.positionScreen,F.overdraw),l(ca.positionScreen,W.positionScreen,F.overdraw));Ra.setFromPoints([W.positionScreen,M.positionScreen,ca.positionScreen]);if(!0===Da.isIntersectionBox(Ra)){C=W;G=M;J=ca;x.info.render.vertices+=3;x.info.render.faces++;n(F.opacity);s(F.blending);sa=C.positionScreen.x;T=C.positionScreen.y;Ka=G.positionScreen.x;S=G.positionScreen.y;$=J.positionScreen.x;Ea=J.positionScreen.y;var Y=sa,V=T,Q=Ka,R=S,fa=$,tc=
 Ea;y.beginPath();y.moveTo(Y,V);y.lineTo(Q,R);y.lineTo(fa,tc);y.closePath();(F instanceof THREE.MeshLambertMaterial||F instanceof THREE.MeshPhongMaterial)&&null===F.map?(Fa.copy(F.color),ka.copy(F.emissive),F.vertexColors===THREE.FaceColors&&Fa.multiply(A.color),!1===F.wireframe&&F.shading===THREE.SmoothShading&&3===A.vertexNormalsLength?(oa.copy(ib),za.copy(ib),Aa.copy(ib),b(A.v1.positionWorld,A.vertexNormalsModel[0],oa),b(A.v2.positionWorld,A.vertexNormalsModel[1],za),b(A.v3.positionWorld,A.vertexNormalsModel[2],
 Ea;y.beginPath();y.moveTo(Y,V);y.lineTo(Q,R);y.lineTo(fa,tc);y.closePath();(F instanceof THREE.MeshLambertMaterial||F instanceof THREE.MeshPhongMaterial)&&null===F.map?(Fa.copy(F.color),ka.copy(F.emissive),F.vertexColors===THREE.FaceColors&&Fa.multiply(A.color),!1===F.wireframe&&F.shading===THREE.SmoothShading&&3===A.vertexNormalsLength?(oa.copy(ib),za.copy(ib),Aa.copy(ib),b(A.v1.positionWorld,A.vertexNormalsModel[0],oa),b(A.v2.positionWorld,A.vertexNormalsModel[1],za),b(A.v3.positionWorld,A.vertexNormalsModel[2],
 Aa),oa.multiply(Fa).add(ka),za.multiply(Fa).add(ka),Aa.multiply(Fa).add(ka),Wa.addColors(za,Aa).multiplyScalar(0.5),ma=k(oa,za,Aa,Wa),h(sa,T,Ka,S,$,Ea,0,0,1,0,0,1,ma)):(ta.copy(ib),b(A.centroidModel,A.normalModel,ta),ta.multiply(Fa).add(ka),!0===F.wireframe?c(ta,F.wireframeLinewidth,F.wireframeLinecap,F.wireframeLinejoin):d(ta))):F instanceof THREE.MeshBasicMaterial||F instanceof THREE.MeshLambertMaterial||F instanceof THREE.MeshPhongMaterial?null!==F.map?F.map.mapping instanceof THREE.UVMapping&&
 Aa),oa.multiply(Fa).add(ka),za.multiply(Fa).add(ka),Aa.multiply(Fa).add(ka),Wa.addColors(za,Aa).multiplyScalar(0.5),ma=k(oa,za,Aa,Wa),h(sa,T,Ka,S,$,Ea,0,0,1,0,0,1,ma)):(ta.copy(ib),b(A.centroidModel,A.normalModel,ta),ta.multiply(Fa).add(ka),!0===F.wireframe?c(ta,F.wireframeLinewidth,F.wireframeLinecap,F.wireframeLinejoin):d(ta))):F instanceof THREE.MeshBasicMaterial||F instanceof THREE.MeshLambertMaterial||F instanceof THREE.MeshPhongMaterial?null!==F.map?F.map.mapping instanceof THREE.UVMapping&&
 (Ca=A.uvs[0],g(sa,T,Ka,S,$,Ea,Ca[0].x,Ca[0].y,Ca[1].x,Ca[1].y,Ca[2].x,Ca[2].y,F.map)):null!==F.envMap?F.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(ha.copy(A.vertexNormalsModel[0]).applyMatrix3(m),ba=0.5*ha.x+0.5,wa=0.5*ha.y+0.5,ha.copy(A.vertexNormalsModel[1]).applyMatrix3(m),xa=0.5*ha.x+0.5,Na=0.5*ha.y+0.5,ha.copy(A.vertexNormalsModel[2]).applyMatrix3(m),hb=0.5*ha.x+0.5,Ma=0.5*ha.y+0.5,g(sa,T,Ka,S,$,Ea,ba,wa,xa,Na,hb,Ma,F.envMap)):(ta.copy(F.color),F.vertexColors===THREE.FaceColors&&
 (Ca=A.uvs[0],g(sa,T,Ka,S,$,Ea,Ca[0].x,Ca[0].y,Ca[1].x,Ca[1].y,Ca[2].x,Ca[2].y,F.map)):null!==F.envMap?F.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(ha.copy(A.vertexNormalsModel[0]).applyMatrix3(m),ba=0.5*ha.x+0.5,wa=0.5*ha.y+0.5,ha.copy(A.vertexNormalsModel[1]).applyMatrix3(m),xa=0.5*ha.x+0.5,Na=0.5*ha.y+0.5,ha.copy(A.vertexNormalsModel[2]).applyMatrix3(m),hb=0.5*ha.x+0.5,Ma=0.5*ha.y+0.5,g(sa,T,Ka,S,$,Ea,ba,wa,xa,Na,hb,Ma,F.envMap)):(ta.copy(F.color),F.vertexColors===THREE.FaceColors&&
@@ -389,34 +389,34 @@ function c(a,b){var c=b.geometry,g=a.faces3,h=3*g.length,k=1*g.length,l=3*g.leng
 a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var r in g.attributes){var k=g.attributes[r],l={},s;for(s in k)l[s]=k[s];if(!l.__webglInitialized||l.createUniqueBuffers)l.__webglInitialized=!0,c=1,"v2"===l.type?c=2:"v3"===l.type?c=3:"v4"===l.type?c=4:"c"===l.type&&(c=3),l.size=c,l.array=new Float32Array(h*c),l.buffer=m.createBuffer(),l.buffer.belongsToAttribute=r,k.needsUpdate=!0,l.__original=k;a.__webglCustomAttributesList.push(l)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof
 a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var r in g.attributes){var k=g.attributes[r],l={},s;for(s in k)l[s]=k[s];if(!l.__webglInitialized||l.createUniqueBuffers)l.__webglInitialized=!0,c=1,"v2"===l.type?c=2:"v3"===l.type?c=3:"v4"===l.type?c=4:"c"===l.type&&(c=3),l.size=c,l.array=new Float32Array(h*c),l.buffer=m.createBuffer(),l.buffer.belongsToAttribute=r,k.needsUpdate=!0,l.__original=k;a.__webglCustomAttributesList.push(l)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof
 THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function g(a,b,c,d){var e,f,g,k;for(f in b)g=b[f],e=c[f],0<=g&&(e?(k=e.itemSize,m.bindBuffer(m.ARRAY_BUFFER,
 THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function g(a,b,c,d){var e,f,g,k;for(f in b)g=b[f],e=c[f],0<=g&&(e?(k=e.itemSize,m.bindBuffer(m.ARRAY_BUFFER,
 e.buffer),h(g),m.vertexAttribPointer(g,k,m.FLOAT,!1,0,d*k*4)):a.defaultAttributeValues&&(2===a.defaultAttributeValues[f].length?m.vertexAttrib2fv(g,a.defaultAttributeValues[f]):3===a.defaultAttributeValues[f].length&&m.vertexAttrib3fv(g,a.defaultAttributeValues[f])))}function h(a){0===Da[a]&&(m.enableVertexAttribArray(a),Da[a]=1)}function k(){for(var a in Da)1===Da[a]&&(m.disableVertexAttribArray(a),Da[a]=0)}function l(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function n(a,b){return b[0]-a[0]}function s(a,
 e.buffer),h(g),m.vertexAttribPointer(g,k,m.FLOAT,!1,0,d*k*4)):a.defaultAttributeValues&&(2===a.defaultAttributeValues[f].length?m.vertexAttrib2fv(g,a.defaultAttributeValues[f]):3===a.defaultAttributeValues[f].length&&m.vertexAttrib3fv(g,a.defaultAttributeValues[f])))}function h(a){0===Da[a]&&(m.enableVertexAttribArray(a),Da[a]=1)}function k(){for(var a in Da)1===Da[a]&&(m.disableVertexAttribArray(a),Da[a]=0)}function l(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function n(a,b){return b[0]-a[0]}function s(a,
-b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)Ea=T=null,S=$=za=oa=la=La=Aa=-1,Qa=!0,a[d].render(b,c,hb,Ma),Ea=T=null,S=$=za=oa=la=La=Aa=-1,Qa=!0}function r(a,b,c,d,e,f,g,h){var k,m,l,n;b?(m=a.length-1,n=b=-1):(m=0,b=a.length,n=1);for(var p=m;p!==b;p+=n)if(k=a[p],k.render){m=k.object;l=k.buffer;if(h)k=h;else{k=k[c];if(!k)continue;g&&N.setBlending(k.blending,k.blendEquation,k.blendSrc,k.blendDst);N.setDepthTest(k.depthTest);N.setDepthWrite(k.depthWrite);I(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits)}N.setMaterialFaces(k);
-l instanceof THREE.BufferGeometry?N.renderBufferDirect(d,e,f,k,l,m):N.renderBuffer(d,e,f,k,l,m)}}function q(a,b,c,d,e,f,g){for(var h,k,m=0,l=a.length;m<l;m++)if(h=a[m],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&N.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);N.setDepthTest(h.depthTest);N.setDepthWrite(h.depthWrite);I(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}N.renderImmediateObject(c,d,e,h,k)}}function u(a,d){var e,f,g;if(void 0===a.__webglInit&&
+b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)Ea=T=null,S=$=za=oa=la=La=Aa=-1,Qa=!0,a[d].render(b,c,hb,Ma),Ea=T=null,S=$=za=oa=la=La=Aa=-1,Qa=!0}function r(a,b,c,d,e,f,g,h){var k,m,l,n;b?(m=a.length-1,n=b=-1):(m=0,b=a.length,n=1);for(var p=m;p!==b;p+=n)if(k=a[p],k.render){m=k.object;l=k.buffer;if(h)k=h;else{k=k[c];if(!k)continue;g&&M.setBlending(k.blending,k.blendEquation,k.blendSrc,k.blendDst);M.setDepthTest(k.depthTest);M.setDepthWrite(k.depthWrite);I(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits)}M.setMaterialFaces(k);
+l instanceof THREE.BufferGeometry?M.renderBufferDirect(d,e,f,k,l,m):M.renderBuffer(d,e,f,k,l,m)}}function q(a,b,c,d,e,f,g){for(var h,k,m=0,l=a.length;m<l;m++)if(h=a[m],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&M.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);M.setDepthTest(h.depthTest);M.setDepthWrite(h.depthWrite);I(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}M.renderImmediateObject(c,d,e,h,k)}}function u(a,d){var e,f,g;if(void 0===a.__webglInit&&
 (a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,void 0!==a.geometry&&void 0===a.geometry.__webglInit&&(a.geometry.__webglInit=!0,a.geometry.addEventListener("dispose",Ib)),f=a.geometry,void 0!==f))if(f instanceof THREE.BufferGeometry)for(g in f.attributes){var h="index"===g?m.ELEMENT_ARRAY_BUFFER:m.ARRAY_BUFFER,k=f.attributes[g];k.buffer=m.createBuffer();m.bindBuffer(h,k.buffer);m.bufferData(h,k.array,m.STATIC_DRAW)}else if(a instanceof THREE.Mesh)for(e in g=
 (a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,void 0!==a.geometry&&void 0===a.geometry.__webglInit&&(a.geometry.__webglInit=!0,a.geometry.addEventListener("dispose",Ib)),f=a.geometry,void 0!==f))if(f instanceof THREE.BufferGeometry)for(g in f.attributes){var h="index"===g?m.ELEMENT_ARRAY_BUFFER:m.ARRAY_BUFFER,k=f.attributes[g];k.buffer=m.createBuffer();m.bindBuffer(h,k.buffer);m.bufferData(h,k.array,m.STATIC_DRAW)}else if(a instanceof THREE.Mesh)for(e in g=
 a.material,void 0===f.geometryGroups&&f.makeGroups(g instanceof THREE.MeshFaceMaterial,Pa?4294967296:65535),f.geometryGroups){if(g=f.geometryGroups[e],!g.__webglVertexBuffer){h=g;h.__webglVertexBuffer=m.createBuffer();h.__webglNormalBuffer=m.createBuffer();h.__webglTangentBuffer=m.createBuffer();h.__webglColorBuffer=m.createBuffer();h.__webglUVBuffer=m.createBuffer();h.__webglUV2Buffer=m.createBuffer();h.__webglSkinIndicesBuffer=m.createBuffer();h.__webglSkinWeightsBuffer=m.createBuffer();h.__webglFaceBuffer=
 a.material,void 0===f.geometryGroups&&f.makeGroups(g instanceof THREE.MeshFaceMaterial,Pa?4294967296:65535),f.geometryGroups){if(g=f.geometryGroups[e],!g.__webglVertexBuffer){h=g;h.__webglVertexBuffer=m.createBuffer();h.__webglNormalBuffer=m.createBuffer();h.__webglTangentBuffer=m.createBuffer();h.__webglColorBuffer=m.createBuffer();h.__webglUVBuffer=m.createBuffer();h.__webglUV2Buffer=m.createBuffer();h.__webglSkinIndicesBuffer=m.createBuffer();h.__webglSkinWeightsBuffer=m.createBuffer();h.__webglFaceBuffer=
-m.createBuffer();h.__webglLineBuffer=m.createBuffer();var l=k=void 0;if(h.numMorphTargets)for(h.__webglMorphTargetsBuffers=[],k=0,l=h.numMorphTargets;k<l;k++)h.__webglMorphTargetsBuffers.push(m.createBuffer());if(h.numMorphNormals)for(h.__webglMorphNormalsBuffers=[],k=0,l=h.numMorphNormals;k<l;k++)h.__webglMorphNormalsBuffers.push(m.createBuffer());N.info.memory.geometries++;c(g,a);f.verticesNeedUpdate=!0;f.morphTargetsNeedUpdate=!0;f.elementsNeedUpdate=!0;f.uvsNeedUpdate=!0;f.normalsNeedUpdate=!0;
-f.tangentsNeedUpdate=!0;f.colorsNeedUpdate=!0}}else a instanceof THREE.Line?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=m.createBuffer(),g.__webglColorBuffer=m.createBuffer(),g.__webglLineDistanceBuffer=m.createBuffer(),N.info.memory.geometries++,g=f,h=g.vertices.length,g.__vertexArray=new Float32Array(3*h),g.__colorArray=new Float32Array(3*h),g.__lineDistanceArray=new Float32Array(1*h),g.__webglLineCount=h,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof
-THREE.ParticleSystem&&!f.__webglVertexBuffer&&(g=f,g.__webglVertexBuffer=m.createBuffer(),g.__webglColorBuffer=m.createBuffer(),N.info.memory.geometries++,g=f,h=g.vertices.length,g.__vertexArray=new Float32Array(3*h),g.__colorArray=new Float32Array(3*h),g.__sortArray=[],g.__webglParticleCount=h,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)p(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=
+m.createBuffer();h.__webglLineBuffer=m.createBuffer();var l=k=void 0;if(h.numMorphTargets)for(h.__webglMorphTargetsBuffers=[],k=0,l=h.numMorphTargets;k<l;k++)h.__webglMorphTargetsBuffers.push(m.createBuffer());if(h.numMorphNormals)for(h.__webglMorphNormalsBuffers=[],k=0,l=h.numMorphNormals;k<l;k++)h.__webglMorphNormalsBuffers.push(m.createBuffer());M.info.memory.geometries++;c(g,a);f.verticesNeedUpdate=!0;f.morphTargetsNeedUpdate=!0;f.elementsNeedUpdate=!0;f.uvsNeedUpdate=!0;f.normalsNeedUpdate=!0;
+f.tangentsNeedUpdate=!0;f.colorsNeedUpdate=!0}}else a instanceof THREE.Line?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=m.createBuffer(),g.__webglColorBuffer=m.createBuffer(),g.__webglLineDistanceBuffer=m.createBuffer(),M.info.memory.geometries++,g=f,h=g.vertices.length,g.__vertexArray=new Float32Array(3*h),g.__colorArray=new Float32Array(3*h),g.__lineDistanceArray=new Float32Array(1*h),g.__webglLineCount=h,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof
+THREE.ParticleSystem&&!f.__webglVertexBuffer&&(g=f,g.__webglVertexBuffer=m.createBuffer(),g.__webglColorBuffer=m.createBuffer(),M.info.memory.geometries++,g=f,h=g.vertices.length,g.__vertexArray=new Float32Array(3*h),g.__colorArray=new Float32Array(3*h),g.__sortArray=[],g.__webglParticleCount=h,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)p(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=
 f.geometryGroups[e],p(d.__webglObjects,g,a)}else a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,p(d.__webglObjects,f,a)):a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?d.__webglObjectsImmediate.push({id:null,object:a,opaque:null,transparent:null,z:0}):a instanceof THREE.Sprite?d.__webglSprites.push(a):a instanceof THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function p(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,
 f.geometryGroups[e],p(d.__webglObjects,g,a)}else a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,p(d.__webglObjects,f,a)):a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?d.__webglObjectsImmediate.push({id:null,object:a,opaque:null,transparent:null,z:0}):a instanceof THREE.Sprite?d.__webglSprites.push(a):a instanceof THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function p(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,
 z:0})}function v(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function w(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function t(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Line?x(b.__webglObjects,a):a instanceof THREE.Sprite?z(b.__webglSprites,a):a instanceof THREE.LensFlare?z(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&x(b.__webglObjectsImmediate,a);delete a.__webglActive}
 z:0})}function v(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function w(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function t(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Line?x(b.__webglObjects,a):a instanceof THREE.Sprite?z(b.__webglSprites,a):a instanceof THREE.LensFlare?z(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&x(b.__webglObjectsImmediate,a);delete a.__webglActive}
-function x(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function z(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function B(a,b,c,d,e){ta=0;d.needsUpdate&&(d.program&&Cb(d),N.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(N.maxMorphTargets));var f=!1,g=d.program,h=g.uniforms,k=d.uniforms;g!==T&&(m.useProgram(g),T=g,f=!0);d.id!==S&&(S=d.id,f=!0);if(f||a!==Ea)m.uniformMatrix4fv(h.projectionMatrix,
-!1,a.projectionMatrix.elements),a!==Ea&&(Ea=a);if(d.skinning)if(yb&&e.useVertexTexture){if(null!==h.boneTexture){var l=E();m.uniform1i(h.boneTexture,l);N.setTexture(e.boneTexture,l)}null!==h.boneTextureWidth&&m.uniform1i(h.boneTextureWidth,e.boneTextureWidth);null!==h.boneTextureHeight&&m.uniform1i(h.boneTextureHeight,e.boneTextureHeight)}else null!==h.boneGlobalMatrices&&m.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(k.fogColor.value=c.color,c instanceof THREE.Fog?(k.fogNear.value=
+function x(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function z(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function B(a,b,c,d,e){ta=0;d.needsUpdate&&(d.program&&Cb(d),M.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(M.maxMorphTargets));var f=!1,g=d.program,h=g.uniforms,k=d.uniforms;g!==T&&(m.useProgram(g),T=g,f=!0);d.id!==S&&(S=d.id,f=!0);if(f||a!==Ea)m.uniformMatrix4fv(h.projectionMatrix,
+!1,a.projectionMatrix.elements),a!==Ea&&(Ea=a);if(d.skinning)if(yb&&e.useVertexTexture){if(null!==h.boneTexture){var l=E();m.uniform1i(h.boneTexture,l);M.setTexture(e.boneTexture,l)}null!==h.boneTextureWidth&&m.uniform1i(h.boneTextureWidth,e.boneTextureWidth);null!==h.boneTextureHeight&&m.uniform1i(h.boneTextureHeight,e.boneTextureHeight)}else null!==h.boneGlobalMatrices&&m.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(k.fogColor.value=c.color,c instanceof THREE.Fog?(k.fogNear.value=
 c.near,k.fogFar.value=c.far):c instanceof THREE.FogExp2&&(k.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Qa){var n,p=l=0,q=0,r,s,u,t=ha,v=t.directional.colors,w=t.directional.positions,x=t.point.colors,z=t.point.positions,B=t.point.distances,I=t.spot.colors,C=t.spot.positions,F=t.spot.distances,G=t.spot.directions,O=t.spot.anglesCos,J=t.spot.exponents,Q=t.hemi.skyColors,K=t.hemi.groundColors,ca=t.hemi.positions,R=0,Y=0,
 c.near,k.fogFar.value=c.far):c instanceof THREE.FogExp2&&(k.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Qa){var n,p=l=0,q=0,r,s,u,t=ha,v=t.directional.colors,w=t.directional.positions,x=t.point.colors,z=t.point.positions,B=t.point.distances,I=t.spot.colors,C=t.spot.positions,F=t.spot.distances,G=t.spot.directions,O=t.spot.anglesCos,J=t.spot.exponents,Q=t.hemi.skyColors,K=t.hemi.groundColors,ca=t.hemi.positions,R=0,Y=0,
-W=0,sa=0,ac=0,bc=0,Z=0,oa=0,V=n=0;c=u=V=0;for(f=b.length;c<f;c++)if(n=b[c],!n.onlyShadow)if(r=n.color,s=n.intensity,u=n.distance,n instanceof THREE.AmbientLight)n.visible&&(N.gammaInput?(l+=r.r*r.r,p+=r.g*r.g,q+=r.b*r.b):(l+=r.r,p+=r.g,q+=r.b));else if(n instanceof THREE.DirectionalLight){if(ac+=1,n.visible&&(ia.setFromMatrixPosition(n.matrixWorld),ya.setFromMatrixPosition(n.target.matrixWorld),ia.sub(ya),ia.normalize(),0!==ia.x||0!==ia.y||0!==ia.z))n=3*R,w[n]=ia.x,w[n+1]=ia.y,w[n+2]=ia.z,N.gammaInput?
-H(v,n,r,s*s):D(v,n,r,s),R+=1}else n instanceof THREE.PointLight?(bc+=1,n.visible&&(V=3*Y,N.gammaInput?H(x,V,r,s*s):D(x,V,r,s),ya.setFromMatrixPosition(n.matrixWorld),z[V]=ya.x,z[V+1]=ya.y,z[V+2]=ya.z,B[Y]=u,Y+=1)):n instanceof THREE.SpotLight?(Z+=1,n.visible&&(V=3*W,N.gammaInput?H(I,V,r,s*s):D(I,V,r,s),ya.setFromMatrixPosition(n.matrixWorld),C[V]=ya.x,C[V+1]=ya.y,C[V+2]=ya.z,F[W]=u,ia.copy(ya),ya.setFromMatrixPosition(n.target.matrixWorld),ia.sub(ya),ia.normalize(),G[V]=ia.x,G[V+1]=ia.y,G[V+2]=ia.z,
-O[W]=Math.cos(n.angle),J[W]=n.exponent,W+=1)):n instanceof THREE.HemisphereLight&&(oa+=1,n.visible&&(ia.setFromMatrixPosition(n.matrixWorld),ia.normalize(),0!==ia.x||0!==ia.y||0!==ia.z))&&(u=3*sa,ca[u]=ia.x,ca[u+1]=ia.y,ca[u+2]=ia.z,r=n.color,n=n.groundColor,N.gammaInput?(s*=s,H(Q,u,r,s),H(K,u,n,s)):(D(Q,u,r,s),D(K,u,n,s)),sa+=1);c=3*R;for(f=Math.max(v.length,3*ac);c<f;c++)v[c]=0;c=3*Y;for(f=Math.max(x.length,3*bc);c<f;c++)x[c]=0;c=3*W;for(f=Math.max(I.length,3*Z);c<f;c++)I[c]=0;c=3*sa;for(f=Math.max(Q.length,
+W=0,sa=0,ac=0,bc=0,Z=0,oa=0,V=n=0;c=u=V=0;for(f=b.length;c<f;c++)if(n=b[c],!n.onlyShadow)if(r=n.color,s=n.intensity,u=n.distance,n instanceof THREE.AmbientLight)n.visible&&(M.gammaInput?(l+=r.r*r.r,p+=r.g*r.g,q+=r.b*r.b):(l+=r.r,p+=r.g,q+=r.b));else if(n instanceof THREE.DirectionalLight){if(ac+=1,n.visible&&(ia.setFromMatrixPosition(n.matrixWorld),ya.setFromMatrixPosition(n.target.matrixWorld),ia.sub(ya),ia.normalize(),0!==ia.x||0!==ia.y||0!==ia.z))n=3*R,w[n]=ia.x,w[n+1]=ia.y,w[n+2]=ia.z,M.gammaInput?
+H(v,n,r,s*s):D(v,n,r,s),R+=1}else n instanceof THREE.PointLight?(bc+=1,n.visible&&(V=3*Y,M.gammaInput?H(x,V,r,s*s):D(x,V,r,s),ya.setFromMatrixPosition(n.matrixWorld),z[V]=ya.x,z[V+1]=ya.y,z[V+2]=ya.z,B[Y]=u,Y+=1)):n instanceof THREE.SpotLight?(Z+=1,n.visible&&(V=3*W,M.gammaInput?H(I,V,r,s*s):D(I,V,r,s),ya.setFromMatrixPosition(n.matrixWorld),C[V]=ya.x,C[V+1]=ya.y,C[V+2]=ya.z,F[W]=u,ia.copy(ya),ya.setFromMatrixPosition(n.target.matrixWorld),ia.sub(ya),ia.normalize(),G[V]=ia.x,G[V+1]=ia.y,G[V+2]=ia.z,
+O[W]=Math.cos(n.angle),J[W]=n.exponent,W+=1)):n instanceof THREE.HemisphereLight&&(oa+=1,n.visible&&(ia.setFromMatrixPosition(n.matrixWorld),ia.normalize(),0!==ia.x||0!==ia.y||0!==ia.z))&&(u=3*sa,ca[u]=ia.x,ca[u+1]=ia.y,ca[u+2]=ia.z,r=n.color,n=n.groundColor,M.gammaInput?(s*=s,H(Q,u,r,s),H(K,u,n,s)):(D(Q,u,r,s),D(K,u,n,s)),sa+=1);c=3*R;for(f=Math.max(v.length,3*ac);c<f;c++)v[c]=0;c=3*Y;for(f=Math.max(x.length,3*bc);c<f;c++)x[c]=0;c=3*W;for(f=Math.max(I.length,3*Z);c<f;c++)I[c]=0;c=3*sa;for(f=Math.max(Q.length,
 3*oa);c<f;c++)Q[c]=0;c=3*sa;for(f=Math.max(K.length,3*oa);c<f;c++)K[c]=0;t.directional.length=R;t.point.length=Y;t.spot.length=W;t.hemi.length=sa;t.ambient[0]=l;t.ambient[1]=p;t.ambient[2]=q;Qa=!1}c=ha;k.ambientLightColor.value=c.ambient;k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;k.pointLightColor.value=c.point.colors;k.pointLightPosition.value=c.point.positions;k.pointLightDistance.value=c.point.distances;k.spotLightColor.value=c.spot.colors;
 3*oa);c<f;c++)Q[c]=0;c=3*sa;for(f=Math.max(K.length,3*oa);c<f;c++)K[c]=0;t.directional.length=R;t.point.length=Y;t.spot.length=W;t.hemi.length=sa;t.ambient[0]=l;t.ambient[1]=p;t.ambient[2]=q;Qa=!1}c=ha;k.ambientLightColor.value=c.ambient;k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;k.pointLightColor.value=c.point.colors;k.pointLightPosition.value=c.point.positions;k.pointLightDistance.value=c.point.distances;k.spotLightColor.value=c.spot.colors;
 k.spotLightPosition.value=c.spot.positions;k.spotLightDistance.value=c.spot.distances;k.spotLightDirection.value=c.spot.directions;k.spotLightAngleCos.value=c.spot.anglesCos;k.spotLightExponent.value=c.spot.exponents;k.hemisphereLightSkyColor.value=c.hemi.skyColors;k.hemisphereLightGroundColor.value=c.hemi.groundColors;k.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=
 k.spotLightPosition.value=c.spot.positions;k.spotLightDistance.value=c.spot.distances;k.spotLightDirection.value=c.spot.directions;k.spotLightAngleCos.value=c.spot.anglesCos;k.spotLightExponent.value=c.spot.exponents;k.hemisphereLightSkyColor.value=c.hemi.skyColors;k.hemisphereLightGroundColor.value=c.hemi.groundColors;k.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=
-d.opacity;N.gammaInput?k.diffuse.value.copyGammaToLinear(d.color):k.diffuse.value=d.color;k.map.value=d.map;k.lightMap.value=d.lightMap;k.specularMap.value=d.specularMap;d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale);d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale));var $;d.map?$=d.map:d.specularMap?$=d.specularMap:d.normalMap?$=d.normalMap:d.bumpMap&&($=d.bumpMap);void 0!==$&&(c=$.offset,$=$.repeat,k.offsetRepeat.value.set(c.x,c.y,$.x,$.y));
+d.opacity;M.gammaInput?k.diffuse.value.copyGammaToLinear(d.color):k.diffuse.value=d.color;k.map.value=d.map;k.lightMap.value=d.lightMap;k.specularMap.value=d.specularMap;d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale);d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale));var $;d.map?$=d.map:d.specularMap?$=d.specularMap:d.normalMap?$=d.normalMap:d.bumpMap&&($=d.bumpMap);void 0!==$&&(c=$.offset,$=$.repeat,k.offsetRepeat.value.set(c.x,c.y,$.x,$.y));
 k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio;k.combine.value=d.combine;k.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value=d.dashSize,k.totalSize.value=
 k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio;k.combine.value=d.combine;k.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value=d.dashSize,k.totalSize.value=
-d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.ParticleSystemMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=L.height/2,k.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(k.shininess.value=d.shininess,N.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive),k.specular.value.copyGammaToLinear(d.specular)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive,k.specular.value=d.specular),
-d.wrapAround&&k.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(N.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive),d.wrapAround&&k.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(k.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&
+d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.ParticleSystemMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=L.height/2,k.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(k.shininess.value=d.shininess,M.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive),k.specular.value.copyGammaToLinear(d.specular)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive,k.specular.value=d.specular),
+d.wrapAround&&k.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(M.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive),d.wrapAround&&k.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(k.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&
 k.shadowMatrix)for(c=$=0,f=b.length;c<f;c++)l=b[c],l.castShadow&&(l instanceof THREE.SpotLight||l instanceof THREE.DirectionalLight&&!l.shadowCascade)&&(k.shadowMap.value[$]=l.shadowMap,k.shadowMapSize.value[$]=l.shadowMapSize,k.shadowMatrix.value[$]=l.shadowMatrix,k.shadowDarkness.value[$]=l.shadowDarkness,k.shadowBias.value[$]=l.shadowBias,$++);b=d.uniformsList;k=0;for($=b.length;k<$;k++)if(f=g.uniforms[b[k][1]])if(c=b[k][0],p=c.type,l=c.value,"i"===p)m.uniform1i(f,l);else if("f"===p)m.uniform1f(f,
 k.shadowMatrix)for(c=$=0,f=b.length;c<f;c++)l=b[c],l.castShadow&&(l instanceof THREE.SpotLight||l instanceof THREE.DirectionalLight&&!l.shadowCascade)&&(k.shadowMap.value[$]=l.shadowMap,k.shadowMapSize.value[$]=l.shadowMapSize,k.shadowMatrix.value[$]=l.shadowMatrix,k.shadowDarkness.value[$]=l.shadowDarkness,k.shadowBias.value[$]=l.shadowBias,$++);b=d.uniformsList;k=0;for($=b.length;k<$;k++)if(f=g.uniforms[b[k][1]])if(c=b[k][0],p=c.type,l=c.value,"i"===p)m.uniform1i(f,l);else if("f"===p)m.uniform1f(f,
 l);else if("v2"===p)m.uniform2f(f,l.x,l.y);else if("v3"===p)m.uniform3f(f,l.x,l.y,l.z);else if("v4"===p)m.uniform4f(f,l.x,l.y,l.z,l.w);else if("c"===p)m.uniform3f(f,l.r,l.g,l.b);else if("iv1"===p)m.uniform1iv(f,l);else if("iv"===p)m.uniform3iv(f,l);else if("fv1"===p)m.uniform1fv(f,l);else if("fv"===p)m.uniform3fv(f,l);else if("v2v"===p){void 0===c._array&&(c._array=new Float32Array(2*l.length));p=0;for(q=l.length;p<q;p++)t=2*p,c._array[t]=l[p].x,c._array[t+1]=l[p].y;m.uniform2fv(f,c._array)}else if("v3v"===
 l);else if("v2"===p)m.uniform2f(f,l.x,l.y);else if("v3"===p)m.uniform3f(f,l.x,l.y,l.z);else if("v4"===p)m.uniform4f(f,l.x,l.y,l.z,l.w);else if("c"===p)m.uniform3f(f,l.r,l.g,l.b);else if("iv1"===p)m.uniform1iv(f,l);else if("iv"===p)m.uniform3iv(f,l);else if("fv1"===p)m.uniform1fv(f,l);else if("fv"===p)m.uniform3fv(f,l);else if("v2v"===p){void 0===c._array&&(c._array=new Float32Array(2*l.length));p=0;for(q=l.length;p<q;p++)t=2*p,c._array[t]=l[p].x,c._array[t+1]=l[p].y;m.uniform2fv(f,c._array)}else if("v3v"===
 p){void 0===c._array&&(c._array=new Float32Array(3*l.length));p=0;for(q=l.length;p<q;p++)t=3*p,c._array[t]=l[p].x,c._array[t+1]=l[p].y,c._array[t+2]=l[p].z;m.uniform3fv(f,c._array)}else if("v4v"===p){void 0===c._array&&(c._array=new Float32Array(4*l.length));p=0;for(q=l.length;p<q;p++)t=4*p,c._array[t]=l[p].x,c._array[t+1]=l[p].y,c._array[t+2]=l[p].z,c._array[t+3]=l[p].w;m.uniform4fv(f,c._array)}else if("m4"===p)void 0===c._array&&(c._array=new Float32Array(16)),l.flattenToArray(c._array),m.uniformMatrix4fv(f,
 p){void 0===c._array&&(c._array=new Float32Array(3*l.length));p=0;for(q=l.length;p<q;p++)t=3*p,c._array[t]=l[p].x,c._array[t+1]=l[p].y,c._array[t+2]=l[p].z;m.uniform3fv(f,c._array)}else if("v4v"===p){void 0===c._array&&(c._array=new Float32Array(4*l.length));p=0;for(q=l.length;p<q;p++)t=4*p,c._array[t]=l[p].x,c._array[t+1]=l[p].y,c._array[t+2]=l[p].z,c._array[t+3]=l[p].w;m.uniform4fv(f,c._array)}else if("m4"===p)void 0===c._array&&(c._array=new Float32Array(16)),l.flattenToArray(c._array),m.uniformMatrix4fv(f,
-!1,c._array);else if("m4v"===p){void 0===c._array&&(c._array=new Float32Array(16*l.length));p=0;for(q=l.length;p<q;p++)l[p].flattenToArrayOffset(c._array,16*p);m.uniformMatrix4fv(f,!1,c._array)}else if("t"===p){if(t=l,l=E(),m.uniform1i(f,l),t)if(t.image instanceof Array&&6===t.image.length){if(c=t,f=l,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||(c.addEventListener("dispose",tb),c.image.__webglTextureCube=m.createTexture(),N.info.memory.textures++);m.activeTexture(m.TEXTURE0+f);
-m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;l=[];for(p=0;6>p;p++)N.autoScaleCubemaps&&!f?(q=l,t=p,v=c.image[p],x=Wb,v.width<=x&&v.height<=x||(z=Math.max(v.width,v.height),w=Math.floor(v.width*x/z),x=Math.floor(v.height*x/z),z=document.createElement("canvas"),z.width=w,z.height=x,z.getContext("2d").drawImage(v,0,0,v.width,v.height,0,0,w,x),v=z),q[t]=v):l[p]=c.image[p];p=l[0];q=THREE.Math.isPowerOfTwo(p.width)&&
+!1,c._array);else if("m4v"===p){void 0===c._array&&(c._array=new Float32Array(16*l.length));p=0;for(q=l.length;p<q;p++)l[p].flattenToArrayOffset(c._array,16*p);m.uniformMatrix4fv(f,!1,c._array)}else if("t"===p){if(t=l,l=E(),m.uniform1i(f,l),t)if(t.image instanceof Array&&6===t.image.length){if(c=t,f=l,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||(c.addEventListener("dispose",tb),c.image.__webglTextureCube=m.createTexture(),M.info.memory.textures++);m.activeTexture(m.TEXTURE0+f);
+m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;l=[];for(p=0;6>p;p++)M.autoScaleCubemaps&&!f?(q=l,t=p,v=c.image[p],x=Wb,v.width<=x&&v.height<=x||(z=Math.max(v.width,v.height),w=Math.floor(v.width*x/z),x=Math.floor(v.height*x/z),z=document.createElement("canvas"),z.width=w,z.height=x,z.getContext("2d").drawImage(v,0,0,v.width,v.height,0,0,w,x),v=z),q[t]=v):l[p]=c.image[p];p=l[0];q=THREE.Math.isPowerOfTwo(p.width)&&
 THREE.Math.isPowerOfTwo(p.height);t=A(c.format);v=A(c.type);y(m.TEXTURE_CUBE_MAP,c,q);for(p=0;6>p;p++)if(f)for(x=l[p].mipmaps,z=0,B=x.length;z<B;z++)w=x[z],c.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+p,z,t,w.width,w.height,0,w.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+p,z,t,w.width,w.height,0,t,v,w.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,t,t,v,l[p]);c.generateMipmaps&&q&&m.generateMipmap(m.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else m.activeTexture(m.TEXTURE0+
 THREE.Math.isPowerOfTwo(p.height);t=A(c.format);v=A(c.type);y(m.TEXTURE_CUBE_MAP,c,q);for(p=0;6>p;p++)if(f)for(x=l[p].mipmaps,z=0,B=x.length;z<B;z++)w=x[z],c.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+p,z,t,w.width,w.height,0,w.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+p,z,t,w.width,w.height,0,t,v,w.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,t,t,v,l[p]);c.generateMipmaps&&q&&m.generateMipmap(m.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else m.activeTexture(m.TEXTURE0+
-f),m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else t instanceof THREE.WebGLRenderTargetCube?(c=t,m.activeTexture(m.TEXTURE0+l),m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture)):N.setTexture(t,l)}else if("tv"===p){void 0===c._array&&(c._array=[]);p=0;for(q=c.value.length;p<q;p++)c._array[p]=E();m.uniform1iv(f,c._array);p=0;for(q=c.value.length;p<q;p++)t=c.value[p],l=c._array[p],t&&N.setTexture(t,l)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+p);(d instanceof
+f),m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else t instanceof THREE.WebGLRenderTargetCube?(c=t,m.activeTexture(m.TEXTURE0+l),m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture)):M.setTexture(t,l)}else if("tv"===p){void 0===c._array&&(c._array=[]);p=0;for(q=c.value.length;p<q;p++)c._array[p]=E();m.uniform1iv(f,c._array);p=0;for(q=c.value.length;p<q;p++)t=c.value[p],l=c._array[p],t&&M.setTexture(t,l)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+p);(d instanceof
 THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==h.cameraPosition&&(ya.setFromMatrixPosition(a.matrixWorld),m.uniform3f(h.cameraPosition,ya.x,ya.y,ya.z));(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==h.viewMatrix&&m.uniformMatrix4fv(h.viewMatrix,!1,a.matrixWorldInverse.elements)}m.uniformMatrix4fv(h.modelViewMatrix,!1,e._modelViewMatrix.elements);h.normalMatrix&&m.uniformMatrix3fv(h.normalMatrix,
 THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==h.cameraPosition&&(ya.setFromMatrixPosition(a.matrixWorld),m.uniform3f(h.cameraPosition,ya.x,ya.y,ya.z));(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==h.viewMatrix&&m.uniformMatrix4fv(h.viewMatrix,!1,a.matrixWorldInverse.elements)}m.uniformMatrix4fv(h.modelViewMatrix,!1,e._modelViewMatrix.elements);h.normalMatrix&&m.uniformMatrix3fv(h.normalMatrix,
 !1,e._normalMatrix.elements);null!==h.modelMatrix&&m.uniformMatrix4fv(h.modelMatrix,!1,e.matrixWorld.elements);return g}function E(){var a=ta;a>=Xa&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Xa);ta+=1;return a}function H(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function D(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function G(a){a!==Ca&&(m.lineWidth(a),Ca=a)}function I(a,b,c){Ba!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),
 !1,e._normalMatrix.elements);null!==h.modelMatrix&&m.uniformMatrix4fv(h.modelMatrix,!1,e.matrixWorld.elements);return g}function E(){var a=ta;a>=Xa&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Xa);ta+=1;return a}function H(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function D(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function G(a){a!==Ca&&(m.lineWidth(a),Ca=a)}function I(a,b,c){Ba!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),
 Ba=a);!a||Ja===b&&ma===c||(m.polygonOffset(b,c),Ja=b,ma=c)}function O(a){a=a.split("\n");for(var b=0,c=a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function K(a,b){var c;"fragment"===a?c=m.createShader(m.FRAGMENT_SHADER):"vertex"===a&&(c=m.createShader(m.VERTEX_SHADER));m.shaderSource(c,b);m.compileShader(c);return m.getShaderParameter(c,m.COMPILE_STATUS)?c:(console.error(m.getShaderInfoLog(c)),console.error(O(b)),null)}function y(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,A(b.wrapS)),
 Ba=a);!a||Ja===b&&ma===c||(m.polygonOffset(b,c),Ja=b,ma=c)}function O(a){a=a.split("\n");for(var b=0,c=a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function K(a,b){var c;"fragment"===a?c=m.createShader(m.FRAGMENT_SHADER):"vertex"===a&&(c=m.createShader(m.VERTEX_SHADER));m.shaderSource(c,b);m.compileShader(c);return m.getShaderParameter(c,m.COMPILE_STATUS)?c:(console.error(m.getShaderInfoLog(c)),console.error(O(b)),null)}function y(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,A(b.wrapS)),
@@ -429,7 +429,7 @@ THREE.ReverseSubtractEquation)return m.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFa
 if(a===THREE.OneMinusDstColorFactor)return m.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return m.SRC_ALPHA_SATURATE;if(void 0!==pa){if(a===THREE.RGB_S3TC_DXT1_Format)return pa.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return pa.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return pa.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return pa.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);
 if(a===THREE.OneMinusDstColorFactor)return m.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return m.SRC_ALPHA_SATURATE;if(void 0!==pa){if(a===THREE.RGB_S3TC_DXT1_Format)return pa.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return pa.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return pa.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return pa.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);
 a=a||{};var L=void 0!==a.canvas?a.canvas:document.createElement("canvas"),Q=void 0!==a.context?a.context:null,Y=void 0!==a.precision?a.precision:"highp",R=void 0!==a.alpha?a.alpha:!1,fa=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,V=void 0!==a.antialias?a.antialias:!1,ga=void 0!==a.stencil?a.stencil:!0,J=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,da=new THREE.Color(0),W=0;this.domElement=L;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:
 a=a||{};var L=void 0!==a.canvas?a.canvas:document.createElement("canvas"),Q=void 0!==a.context?a.context:null,Y=void 0!==a.precision?a.precision:"highp",R=void 0!==a.alpha?a.alpha:!1,fa=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,V=void 0!==a.antialias?a.antialias:!1,ga=void 0!==a.stencil?a.stencil:!0,J=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,da=new THREE.Color(0),W=0;this.domElement=L;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:
 void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=
 void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=
-[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var N=this,ca=[],sa=0,T=null,Ka=null,S=-1,$=null,Ea=null,ta=0,oa=-1,za=-1,Aa=-1,Wa=-1,Fa=-1,ka=-1,La=-1,la=-1,Ba=null,Ja=null,ma=null,Ca=null,ba=0,wa=0,xa=L.width,Na=L.height,hb=0,Ma=0,Da=new Uint8Array(16),na=new THREE.Frustum,Ra=new THREE.Matrix4,ib=new THREE.Matrix4,ya=new THREE.Vector3,ia=new THREE.Vector3,Qa=!0,ha={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,
+[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var M=this,ca=[],sa=0,T=null,Ka=null,S=-1,$=null,Ea=null,ta=0,oa=-1,za=-1,Aa=-1,Wa=-1,Fa=-1,ka=-1,La=-1,la=-1,Ba=null,Ja=null,ma=null,Ca=null,ba=0,wa=0,xa=L.width,Na=L.height,hb=0,Ma=0,Da=new Uint8Array(16),na=new THREE.Frustum,Ra=new THREE.Matrix4,ib=new THREE.Matrix4,ya=new THREE.Vector3,ia=new THREE.Vector3,Qa=!0,ha={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,
 colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},m,Ga,Oa,Sa,pa,Pa;(function(){try{var a={alpha:R,premultipliedAlpha:fa,antialias:V,stencil:ga,preserveDrawingBuffer:J};m=Q||L.getContext("webgl",a)||L.getContext("experimental-webgl",a);if(null===m)throw"Error creating WebGL context.";}catch(b){console.error(b)}Ga=m.getExtension("OES_texture_float");m.getExtension("OES_texture_float_linear");
 colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},m,Ga,Oa,Sa,pa,Pa;(function(){try{var a={alpha:R,premultipliedAlpha:fa,antialias:V,stencil:ga,preserveDrawingBuffer:J};m=Q||L.getContext("webgl",a)||L.getContext("experimental-webgl",a);if(null===m)throw"Error creating WebGL context.";}catch(b){console.error(b)}Ga=m.getExtension("OES_texture_float");m.getExtension("OES_texture_float_linear");
 Oa=m.getExtension("OES_standard_derivatives");Sa=m.getExtension("EXT_texture_filter_anisotropic")||m.getExtension("MOZ_EXT_texture_filter_anisotropic")||m.getExtension("WEBKIT_EXT_texture_filter_anisotropic");pa=m.getExtension("WEBGL_compressed_texture_s3tc")||m.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||m.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");Pa=m.getExtension("OES_element_index_uint");null===Ga&&console.log("THREE.WebGLRenderer: Float textures not supported.");null===Oa&&
 Oa=m.getExtension("OES_standard_derivatives");Sa=m.getExtension("EXT_texture_filter_anisotropic")||m.getExtension("MOZ_EXT_texture_filter_anisotropic")||m.getExtension("WEBKIT_EXT_texture_filter_anisotropic");pa=m.getExtension("WEBGL_compressed_texture_s3tc")||m.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||m.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");Pa=m.getExtension("OES_element_index_uint");null===Ga&&console.log("THREE.WebGLRenderer: Float textures not supported.");null===Oa&&
 console.log("THREE.WebGLRenderer: Standard derivatives not supported.");null===Sa&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");null===pa&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");null===Pa&&console.log("THREE.WebGLRenderer: elementindex as unsigned integer not supported.");void 0===m.getShaderPrecisionFormat&&(m.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})})();m.clearColor(0,0,0,1);m.clearDepth(1);
 console.log("THREE.WebGLRenderer: Standard derivatives not supported.");null===Sa&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");null===pa&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");null===Pa&&console.log("THREE.WebGLRenderer: elementindex as unsigned integer not supported.");void 0===m.getShaderPrecisionFormat&&(m.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})})();m.clearColor(0,0,0,1);m.clearDepth(1);
@@ -440,82 +440,83 @@ Y||Bb||(Y="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"
 1!==this.devicePixelRatio&&!1!==c&&(L.style.width=a+"px",L.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){ba=a*this.devicePixelRatio;wa=b*this.devicePixelRatio;xa=c*this.devicePixelRatio;Na=d*this.devicePixelRatio;m.viewport(ba,wa,xa,Na)};this.setScissor=function(a,b,c,d){m.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};
 1!==this.devicePixelRatio&&!1!==c&&(L.style.width=a+"px",L.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){ba=a*this.devicePixelRatio;wa=b*this.devicePixelRatio;xa=c*this.devicePixelRatio;Na=d*this.devicePixelRatio;m.viewport(ba,wa,xa,Na)};this.setScissor=function(a,b,c,d){m.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};
 this.setClearColor=function(a,b){da.set(a);W=void 0!==b?b:1;m.clearColor(da.r,da.g,da.b,W)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return da};this.getClearAlpha=function(){return W};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=m.COLOR_BUFFER_BIT;if(void 0===b||b)d|=m.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=m.STENCIL_BUFFER_BIT;m.clear(d)};this.clearColor=
 this.setClearColor=function(a,b){da.set(a);W=void 0!==b?b:1;m.clearColor(da.r,da.g,da.b,W)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return da};this.getClearAlpha=function(){return W};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=m.COLOR_BUFFER_BIT;if(void 0===b||b)d|=m.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=m.STENCIL_BUFFER_BIT;m.clear(d)};this.clearColor=
 function(){m.clear(m.COLOR_BUFFER_BIT)};this.clearDepth=function(){m.clear(m.DEPTH_BUFFER_BIT)};this.clearStencil=function(){m.clear(m.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){T=null;S=$=la=La=Aa=-1;Qa=!0;za=oa=-1;this.shadowMapPlugin.update(a,b)};var Ib=function(a){a=
 function(){m.clear(m.COLOR_BUFFER_BIT)};this.clearDepth=function(){m.clear(m.DEPTH_BUFFER_BIT)};this.clearStencil=function(){m.clear(m.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){T=null;S=$=la=La=Aa=-1;Qa=!0;za=oa=-1;this.shadowMapPlugin.update(a,b)};var Ib=function(a){a=
-a.target;a.removeEventListener("dispose",Ib);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&m.deleteBuffer(b[c].buffer);N.info.memory.geometries--}else if(void 0!==a.geometryGroups)for(b in a.geometryGroups){c=a.geometryGroups[b];if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)m.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(void 0!==c.numMorphNormals)for(d=0,e=c.numMorphNormals;d<e;d++)m.deleteBuffer(c.__webglMorphNormalsBuffers[d]);
-Lb(c)}else Lb(a)},tb=function(a){a=a.target;a.removeEventListener("dispose",tb);a.image&&a.image.__webglTextureCube?m.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,m.deleteTexture(a.__webglTexture));N.info.memory.textures--},Jb=function(a){a=a.target;a.removeEventListener("dispose",Jb);if(a&&a.__webglTexture)if(m.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)m.deleteFramebuffer(a.__webglFramebuffer[b]),m.deleteRenderbuffer(a.__webglRenderbuffer[b]);
-else m.deleteFramebuffer(a.__webglFramebuffer),m.deleteRenderbuffer(a.__webglRenderbuffer);N.info.memory.textures--},Kb=function(a){a=a.target;a.removeEventListener("dispose",Kb);Cb(a)},Lb=function(a){void 0!==a.__webglVertexBuffer&&m.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&m.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&m.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&m.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&
+a.target;a.removeEventListener("dispose",Ib);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&m.deleteBuffer(b[c].buffer);M.info.memory.geometries--}else if(void 0!==a.geometryGroups)for(b in a.geometryGroups){c=a.geometryGroups[b];if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)m.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(void 0!==c.numMorphNormals)for(d=0,e=c.numMorphNormals;d<e;d++)m.deleteBuffer(c.__webglMorphNormalsBuffers[d]);
+Lb(c)}else Lb(a)},tb=function(a){a=a.target;a.removeEventListener("dispose",tb);a.image&&a.image.__webglTextureCube?m.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,m.deleteTexture(a.__webglTexture));M.info.memory.textures--},Jb=function(a){a=a.target;a.removeEventListener("dispose",Jb);if(a&&a.__webglTexture)if(m.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)m.deleteFramebuffer(a.__webglFramebuffer[b]),m.deleteRenderbuffer(a.__webglRenderbuffer[b]);
+else m.deleteFramebuffer(a.__webglFramebuffer),m.deleteRenderbuffer(a.__webglRenderbuffer);M.info.memory.textures--},Kb=function(a){a=a.target;a.removeEventListener("dispose",Kb);Cb(a)},Lb=function(a){void 0!==a.__webglVertexBuffer&&m.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&m.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&m.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&m.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&
 m.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&m.deleteBuffer(a.__webglUV2Buffer);void 0!==a.__webglSkinIndicesBuffer&&m.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&m.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&m.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&m.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&m.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)m.deleteBuffer(a.__webglCustomAttributesList[b].buffer);
 m.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&m.deleteBuffer(a.__webglUV2Buffer);void 0!==a.__webglSkinIndicesBuffer&&m.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&m.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&m.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&m.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&m.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)m.deleteBuffer(a.__webglCustomAttributesList[b].buffer);
-N.info.memory.geometries--},Cb=function(a){var b=a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=ca.length;a<c;a++)if(d=ca[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=ca.length;a<c;a++)d=ca[a],d.program!==b&&e.push(d);ca=e;m.deleteProgram(b);N.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=m.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=
+M.info.memory.geometries--},Cb=function(a){var b=a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=ca.length;a<c;a++)if(d=ca[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=ca.length;a<c;a++)d=ca[a],d.program!==b&&e.push(d);ca=e;m.deleteProgram(b);M.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=m.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=
 m.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=m.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=m.createBuffer());a.hasPositions&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.position),m.vertexAttribPointer(b.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormals){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,
 m.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=m.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=m.createBuffer());a.hasPositions&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.position),m.vertexAttribPointer(b.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormals){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,
 e,f,g,h,k,l,n,p,q,r,s=3*a.count;for(r=0;r<s;r+=9)q=a.normalArray,d=q[r],e=q[r+1],f=q[r+2],g=q[r+3],k=q[r+4],n=q[r+5],h=q[r+6],l=q[r+7],p=q[r+8],d=(d+g+h)/3,e=(e+k+l)/3,f=(f+n+p)/3,q[r]=d,q[r+1]=e,q[r+2]=f,q[r+3]=d,q[r+4]=e,q[r+5]=f,q[r+6]=d,q[r+7]=e,q[r+8]=f}m.bufferData(m.ARRAY_BUFFER,a.normalArray,m.DYNAMIC_DRAW);m.enableVertexAttribArray(b.attributes.normal);m.vertexAttribPointer(b.attributes.normal,3,m.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglUvBuffer),m.bufferData(m.ARRAY_BUFFER,
 e,f,g,h,k,l,n,p,q,r,s=3*a.count;for(r=0;r<s;r+=9)q=a.normalArray,d=q[r],e=q[r+1],f=q[r+2],g=q[r+3],k=q[r+4],n=q[r+5],h=q[r+6],l=q[r+7],p=q[r+8],d=(d+g+h)/3,e=(e+k+l)/3,f=(f+n+p)/3,q[r]=d,q[r+1]=e,q[r+2]=f,q[r+3]=d,q[r+4]=e,q[r+5]=f,q[r+6]=d,q[r+7]=e,q[r+8]=f}m.bufferData(m.ARRAY_BUFFER,a.normalArray,m.DYNAMIC_DRAW);m.enableVertexAttribArray(b.attributes.normal);m.vertexAttribPointer(b.attributes.normal,3,m.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglUvBuffer),m.bufferData(m.ARRAY_BUFFER,
 a.uvArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.uv),m.vertexAttribPointer(b.attributes.uv,2,m.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var l,
 a.uvArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.uv),m.vertexAttribPointer(b.attributes.uv,2,m.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var l,
-n,p,q,r=B(a,b,c,d,f);a=r.attributes;b=e.attributes;c=!1;r=16777215*e.id+2*r.id+(d.wireframe?1:0);r!==$&&($=r,c=!0);c&&k();if(f instanceof THREE.Mesh)if(f=b.index){e=e.offsets;1<e.length&&(c=!0);for(var r=0,s=e.length;r<s;r++){var t=e[r].index;if(c){for(n in a)p=a[n],l=b[n],0<=p&&(l?(q=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,q,m.FLOAT,!1,0,t*q*4)):d.defaultAttributeValues&&(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):
-3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n])));m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)}null!==Pa&&f.array instanceof Uint32Array?(l=m.UNSIGNED_INT,p=4):(l=m.UNSIGNED_SHORT,p=2);m.drawElements(m.TRIANGLES,e[r].count,l,e[r].start*p);N.info.render.calls++;N.info.render.vertices+=e[r].count;N.info.render.faces+=e[r].count/3}}else{if(c)for(n in a)"index"!==n&&(p=a[n],l=b[n],0<=p&&(l?(q=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,
-q,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[n]&&(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n]))));d=e.attributes.position;m.drawArrays(m.TRIANGLES,0,d.array.length/3);N.info.render.calls++;N.info.render.vertices+=d.array.length/3;N.info.render.faces+=d.array.length/3/3}else if(f instanceof THREE.ParticleSystem){if(c)for(n in a)p=a[n],l=b[n],0<=
-p&&(l?(q=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,q,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[n]&&(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n])));d=b.position;m.drawArrays(m.POINTS,0,d.array.length/3);N.info.render.calls++;N.info.render.points+=d.array.length/3}else if(f instanceof THREE.Line)if(n=f.type===
-THREE.LineStrip?m.LINE_STRIP:m.LINES,G(d.linewidth),f=b.index)for(e=e.offsets,1<e.length&&(c=!0),r=0,s=e.length;r<s;r++)t=e[r].index,c&&(g(d,a,b,t),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),null!==Pa&&f.array instanceof Uint32Array?(l=m.UNSIGNED_INT,p=4):(l=m.UNSIGNED_SHORT,p=2),m.drawElements(m.LINES,e[r].count,l,e[r].start*p),N.info.render.calls++,N.info.render.vertices+=e[r].count;else c&&g(d,a,b,0),d=b.position,m.drawArrays(n,0,d.array.length/3),N.info.render.calls++,N.info.render.points+=
-d.array.length}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,l;c=B(a,b,c,d,f);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==$&&($=c,a=!0);a&&k();if(!d.morphTargets&&0<=b.position)a&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),h(b.position),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),
-h(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0)):0<=c.position&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),h(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var p=0;l=f.morphTargetForcedOrder;for(g=f.morphTargetInfluences;p<d.numSupportedMorphTargets&&p<l.length;)0<=c["morphTarget"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l[p]]),h(c["morphTarget"+p]),m.vertexAttribPointer(c["morphTarget"+p],3,m.FLOAT,
-!1,0,0)),0<=c["morphNormal"+p]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l[p]]),h(c["morphNormal"+p]),m.vertexAttribPointer(c["morphNormal"+p],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[l[p]],p++}else{l=[];g=f.morphTargetInfluences;var r,q=g.length;for(r=0;r<q;r++)p=g[r],0<p&&l.push([p,r]);l.length>d.numSupportedMorphTargets?(l.sort(n),l.length=d.numSupportedMorphTargets):l.length>d.numSupportedMorphNormals?l.sort(n):0===l.length&&l.push([0,0]);for(p=0;p<
-d.numSupportedMorphTargets;)l[p]?(r=l[p][1],0<=c["morphTarget"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[r]),h(c["morphTarget"+p]),m.vertexAttribPointer(c["morphTarget"+p],3,m.FLOAT,!1,0,0)),0<=c["morphNormal"+p]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[r]),h(c["morphNormal"+p]),m.vertexAttribPointer(c["morphNormal"+p],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[r]):f.__webglMorphTargetInfluences[p]=0,p++}null!==d.program.uniforms.morphTargetInfluences&&
-m.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(g=0,l=e.__webglCustomAttributesList.length;g<l;g++)c=e.__webglCustomAttributesList[g],0<=b[c.buffer.belongsToAttribute]&&(m.bindBuffer(m.ARRAY_BUFFER,c.buffer),h(b[c.buffer.belongsToAttribute]),m.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,m.FLOAT,!1,0,0));0<=b.color&&(0<f.geometry.colors.length||0<f.geometry.faces.length?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglColorBuffer),
-h(b.color),m.vertexAttribPointer(b.color,3,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglNormalBuffer),h(b.normal),m.vertexAttribPointer(b.normal,3,m.FLOAT,!1,0,0));0<=b.tangent&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglTangentBuffer),h(b.tangent),m.vertexAttribPointer(b.tangent,4,m.FLOAT,!1,0,0));0<=b.uv&&(f.geometry.faceVertexUvs[0]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUVBuffer),h(b.uv),m.vertexAttribPointer(b.uv,
-2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(f.geometry.faceVertexUvs[1]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUV2Buffer),h(b.uv2),m.vertexAttribPointer(b.uv2,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),h(b.skinIndex),m.vertexAttribPointer(b.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,
+n,p,q;l=B(a,b,c,d,f);a=l.attributes;b=e.attributes;c=!1;l=16777215*e.id+2*l.id+(d.wireframe?1:0);l!==$&&($=l,c=!0);c&&k();if(f instanceof THREE.Mesh){f=b.index;var r,s;null!==Pa&&f.array instanceof Uint32Array?(r=m.UNSIGNED_INT,s=4):(r=m.UNSIGNED_SHORT,s=2);if(f)if(e=e.offsets,0===e.length){for(n in a)p=a[n],l=b[n],0<=p&&(l?(q=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,q,m.FLOAT,!1,0,v*q*4)):d.defaultAttributeValues&&(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,
+d.defaultAttributeValues[n]):3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n])));m.drawElements(m.TRIANGLES,f.array.length,r,0);M.info.render.calls++;M.info.render.vertices+=f.array.length;M.info.render.faces+=f.array.length/3}else{c=!0;for(var t=0,u=e.length;t<u;t++){var v=e[t].index;if(c){for(n in a)p=a[n],l=b[n],0<=p&&(l?(q=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,q,m.FLOAT,!1,0,v*q*4)):d.defaultAttributeValues&&(2===d.defaultAttributeValues[n].length?
+m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n])));m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)}m.drawElements(m.TRIANGLES,e[t].count,r,e[t].start*s);M.info.render.calls++;M.info.render.vertices+=e[t].count;M.info.render.faces+=e[t].count/3}}else{if(c)for(n in a)"index"!==n&&(p=a[n],l=b[n],0<=p&&(l?(q=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,l.buffer),h(p),m.vertexAttribPointer(p,q,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&
+d.defaultAttributeValues[n]&&(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n]))));d=e.attributes.position;m.drawArrays(m.TRIANGLES,0,d.array.length/3);M.info.render.calls++;M.info.render.vertices+=d.array.length/3;M.info.render.faces+=d.array.length/3/3}}else if(f instanceof THREE.ParticleSystem){if(c)for(n in a)p=a[n],l=b[n],0<=p&&(l?(q=l.itemSize,m.bindBuffer(m.ARRAY_BUFFER,
+l.buffer),h(p),m.vertexAttribPointer(p,q,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&d.defaultAttributeValues[n]&&(2===d.defaultAttributeValues[n].length?m.vertexAttrib2fv(p,d.defaultAttributeValues[n]):3===d.defaultAttributeValues[n].length&&m.vertexAttrib3fv(p,d.defaultAttributeValues[n])));d=b.position;m.drawArrays(m.POINTS,0,d.array.length/3);M.info.render.calls++;M.info.render.points+=d.array.length/3}else if(f instanceof THREE.Line)if(n=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,G(d.linewidth),
+f=b.index)for(e=e.offsets,1<e.length&&(c=!0),t=0,u=e.length;t<u;t++)v=e[t].index,c&&(g(d,a,b,v),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),null!==Pa&&f.array instanceof Uint32Array?(r=m.UNSIGNED_INT,s=4):(r=m.UNSIGNED_SHORT,s=2),m.drawElements(m.LINES,e[t].count,r,e[t].start*s),M.info.render.calls++,M.info.render.vertices+=e[t].count;else c&&g(d,a,b,0),d=b.position,m.drawArrays(n,0,d.array.length/3),M.info.render.calls++,M.info.render.points+=d.array.length}};this.renderBuffer=function(a,b,c,
+d,e,f){if(!1!==d.visible){var g,l;c=B(a,b,c,d,f);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==$&&($=c,a=!0);a&&k();if(!d.morphTargets&&0<=b.position)a&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),h(b.position),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),h(c.position),m.vertexAttribPointer(c.position,
+3,m.FLOAT,!1,0,0)):0<=c.position&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),h(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var p=0;l=f.morphTargetForcedOrder;for(g=f.morphTargetInfluences;p<d.numSupportedMorphTargets&&p<l.length;)0<=c["morphTarget"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l[p]]),h(c["morphTarget"+p]),m.vertexAttribPointer(c["morphTarget"+p],3,m.FLOAT,!1,0,0)),0<=c["morphNormal"+p]&&d.morphNormals&&
+(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l[p]]),h(c["morphNormal"+p]),m.vertexAttribPointer(c["morphNormal"+p],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[l[p]],p++}else{l=[];g=f.morphTargetInfluences;var q,r=g.length;for(q=0;q<r;q++)p=g[q],0<p&&l.push([p,q]);l.length>d.numSupportedMorphTargets?(l.sort(n),l.length=d.numSupportedMorphTargets):l.length>d.numSupportedMorphNormals?l.sort(n):0===l.length&&l.push([0,0]);for(p=0;p<d.numSupportedMorphTargets;)l[p]?(q=l[p][1],0<=
+c["morphTarget"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[q]),h(c["morphTarget"+p]),m.vertexAttribPointer(c["morphTarget"+p],3,m.FLOAT,!1,0,0)),0<=c["morphNormal"+p]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[q]),h(c["morphNormal"+p]),m.vertexAttribPointer(c["morphNormal"+p],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[q]):f.__webglMorphTargetInfluences[p]=0,p++}null!==d.program.uniforms.morphTargetInfluences&&m.uniform1fv(d.program.uniforms.morphTargetInfluences,
+f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(g=0,l=e.__webglCustomAttributesList.length;g<l;g++)c=e.__webglCustomAttributesList[g],0<=b[c.buffer.belongsToAttribute]&&(m.bindBuffer(m.ARRAY_BUFFER,c.buffer),h(b[c.buffer.belongsToAttribute]),m.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,m.FLOAT,!1,0,0));0<=b.color&&(0<f.geometry.colors.length||0<f.geometry.faces.length?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglColorBuffer),h(b.color),m.vertexAttribPointer(b.color,
+3,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglNormalBuffer),h(b.normal),m.vertexAttribPointer(b.normal,3,m.FLOAT,!1,0,0));0<=b.tangent&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglTangentBuffer),h(b.tangent),m.vertexAttribPointer(b.tangent,4,m.FLOAT,!1,0,0));0<=b.uv&&(f.geometry.faceVertexUvs[0]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUVBuffer),h(b.uv),m.vertexAttribPointer(b.uv,2,m.FLOAT,!1,0,0)):
+d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(f.geometry.faceVertexUvs[1]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUV2Buffer),h(b.uv2),m.vertexAttribPointer(b.uv2,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),h(b.skinIndex),m.vertexAttribPointer(b.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,
 e.__webglSkinWeightsBuffer),h(b.skinWeight),m.vertexAttribPointer(b.skinWeight,4,m.FLOAT,!1,0,0));0<=b.lineDistance&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglLineDistanceBuffer),h(b.lineDistance),m.vertexAttribPointer(b.lineDistance,1,m.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(f=null!==Pa&&e.__typeArray instanceof Uint32Array?m.UNSIGNED_INT:m.UNSIGNED_SHORT,d.wireframe?(G(d.wireframeLinewidth),a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),m.drawElements(m.LINES,e.__webglLineCount,f,0)):
 e.__webglSkinWeightsBuffer),h(b.skinWeight),m.vertexAttribPointer(b.skinWeight,4,m.FLOAT,!1,0,0));0<=b.lineDistance&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglLineDistanceBuffer),h(b.lineDistance),m.vertexAttribPointer(b.lineDistance,1,m.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(f=null!==Pa&&e.__typeArray instanceof Uint32Array?m.UNSIGNED_INT:m.UNSIGNED_SHORT,d.wireframe?(G(d.wireframeLinewidth),a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),m.drawElements(m.LINES,e.__webglLineCount,f,0)):
-(a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),m.drawElements(m.TRIANGLES,e.__webglFaceCount,f,0)),N.info.render.calls++,N.info.render.vertices+=e.__webglFaceCount,N.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,G(d.linewidth),m.drawArrays(f,0,e.__webglLineCount),N.info.render.calls++):f instanceof THREE.ParticleSystem&&(m.drawArrays(m.POINTS,0,e.__webglParticleCount),N.info.render.calls++,N.info.render.points+=e.__webglParticleCount)}};
-this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h,k=a.__lights,p=a.fog;S=-1;Qa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Ra.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);na.setFromMatrix(Ra);this.autoUpdateObjects&&this.initWebGLObjects(a);s(this.renderPluginsPre,a,b);N.info.render.calls=
-0;N.info.render.vertices=0;N.info.render.faces=0;N.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);h=a.__webglObjects;d=0;for(e=h.length;d<e;d++)if(f=h[d],g=f.object,f.id=d,f.render=!1,g.visible&&(!(g instanceof THREE.Mesh||g instanceof THREE.ParticleSystem)||!g.frustumCulled||na.intersectsObject(g))){var n=g;n._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,n.matrixWorld);n._normalMatrix.getNormalMatrix(n._modelViewMatrix);
+(a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),m.drawElements(m.TRIANGLES,e.__webglFaceCount,f,0)),M.info.render.calls++,M.info.render.vertices+=e.__webglFaceCount,M.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,G(d.linewidth),m.drawArrays(f,0,e.__webglLineCount),M.info.render.calls++):f instanceof THREE.ParticleSystem&&(m.drawArrays(m.POINTS,0,e.__webglParticleCount),M.info.render.calls++,M.info.render.points+=e.__webglParticleCount)}};
+this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h,k=a.__lights,p=a.fog;S=-1;Qa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Ra.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);na.setFromMatrix(Ra);this.autoUpdateObjects&&this.initWebGLObjects(a);s(this.renderPluginsPre,a,b);M.info.render.calls=
+0;M.info.render.vertices=0;M.info.render.faces=0;M.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);h=a.__webglObjects;d=0;for(e=h.length;d<e;d++)if(f=h[d],g=f.object,f.id=d,f.render=!1,g.visible&&(!(g instanceof THREE.Mesh||g instanceof THREE.ParticleSystem)||!g.frustumCulled||na.intersectsObject(g))){var n=g;n._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,n.matrixWorld);n._normalMatrix.getNormalMatrix(n._modelViewMatrix);
 var n=f,t=n.object,u=n.buffer,v=t.geometry,t=t.material;t instanceof THREE.MeshFaceMaterial?(t=t.materials[v instanceof THREE.BufferGeometry?0:u.materialIndex],t.transparent?(n.transparent=t,n.opaque=null):(n.opaque=t,n.transparent=null)):t&&(t.transparent?(n.transparent=t,n.opaque=null):(n.opaque=t,n.transparent=null));f.render=!0;!0===this.sortObjects&&(null!==g.renderDepth?f.z=g.renderDepth:(ya.setFromMatrixPosition(g.matrixWorld),ya.applyProjection(Ra),f.z=ya.z))}this.sortObjects&&h.sort(l);h=
 var n=f,t=n.object,u=n.buffer,v=t.geometry,t=t.material;t instanceof THREE.MeshFaceMaterial?(t=t.materials[v instanceof THREE.BufferGeometry?0:u.materialIndex],t.transparent?(n.transparent=t,n.opaque=null):(n.opaque=t,n.transparent=null)):t&&(t.transparent?(n.transparent=t,n.opaque=null):(n.opaque=t,n.transparent=null));f.render=!0;!0===this.sortObjects&&(null!==g.renderDepth?f.z=g.renderDepth:(ya.setFromMatrixPosition(g.matrixWorld),ya.applyProjection(Ra),f.z=ya.z))}this.sortObjects&&h.sort(l);h=
 a.__webglObjectsImmediate;d=0;for(e=h.length;d<e;d++)f=h[d],g=f.object,g.visible&&(g._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,g.matrixWorld),g._normalMatrix.getNormalMatrix(g._modelViewMatrix),g=f.object.material,g.transparent?(f.transparent=g,f.opaque=null):(f.opaque=g,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),I(d.polygonOffset,d.polygonOffsetFactor,
 a.__webglObjectsImmediate;d=0;for(e=h.length;d<e;d++)f=h[d],g=f.object,g.visible&&(g._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,g.matrixWorld),g._normalMatrix.getNormalMatrix(g._modelViewMatrix),g=f.object.material,g.transparent?(f.transparent=g,f.opaque=null):(f.opaque=g,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),I(d.polygonOffset,d.polygonOffsetFactor,
 d.polygonOffsetUnits),r(a.__webglObjects,!1,"",b,k,p,!0,d),q(a.__webglObjectsImmediate,"",b,k,p,!1,d)):(d=null,this.setBlending(THREE.NoBlending),r(a.__webglObjects,!0,"opaque",b,k,p,!1,d),q(a.__webglObjectsImmediate,"opaque",b,k,p,!1,d),r(a.__webglObjects,!1,"transparent",b,k,p,!0,d),q(a.__webglObjectsImmediate,"transparent",b,k,p,!0,d));s(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?
 d.polygonOffsetUnits),r(a.__webglObjects,!1,"",b,k,p,!0,d),q(a.__webglObjectsImmediate,"",b,k,p,!1,d)):(d=null,this.setBlending(THREE.NoBlending),r(a.__webglObjects,!0,"opaque",b,k,p,!1,d),q(a.__webglObjectsImmediate,"opaque",b,k,p,!1,d),r(a.__webglObjects,!1,"transparent",b,k,p,!0,d),q(a.__webglObjectsImmediate,"transparent",b,k,p,!0,d));s(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?
-(m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,c.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=B(a,b,c,d,e);$=-1;N.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,m,na):e.render(function(a){N.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=
-function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)u(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)t(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;void 0===h.__webglInit&&(void 0!==h.__webglActive&&t(h,a),u(h,a));var k=h,l=k.geometry,p=void 0,r=void 0,q=void 0;if(l instanceof
-THREE.BufferGeometry){var s=m.DYNAMIC_DRAW,x=l.attributes,z=void 0,y=void 0;for(z in x)y=x[z],y.needsUpdate&&("index"===z?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,y.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,y.array,s)):(m.bindBuffer(m.ARRAY_BUFFER,y.buffer),m.bufferData(m.ARRAY_BUFFER,y.array,s)),y.needsUpdate=!1)}else if(k instanceof THREE.Mesh){for(var B=0,I=l.geometryGroupsList.length;B<I;B++)if(p=l.geometryGroupsList[B],q=d(k,p),l.buffersNeedUpdate&&c(p,k),r=q.attributes&&v(q),l.verticesNeedUpdate||
-l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||r){var A=p,D=k,C=m.DYNAMIC_DRAW,F=!l.dynamic,G=q;if(A.__inittedArrays){var H=e(G),O=G.vertexColors?G.vertexColors:!1,L=f(G),N=H===THREE.SmoothShading,E=void 0,J=void 0,Q=void 0,K=void 0,ca=void 0,R=void 0,Y=void 0,W=void 0,V=void 0,$=void 0,sa=void 0,S=void 0,T=void 0,Z=void 0,oa=void 0,ta=void 0,Ea=void 0,da=void 0,Ka=void 0,fa=void 0,ga=void 0,ha=void 0,za=void 0,ka=void 0,
-ia=void 0,la=void 0,na=void 0,pa=void 0,Aa=void 0,ba=void 0,Da=void 0,Ca=void 0,La=void 0,Ja=void 0,ma=void 0,Ma=void 0,wa=void 0,xa=void 0,Pa=void 0,Wa=void 0,Fa=0,Ba=0,Na=0,Qa=0,Sa=0,Ga=0,Za=0,Oa=0,eb=0,va=0,Ha=0,P=0,Ya=void 0,jb=A.__vertexArray,db=A.__uvArray,hb=A.__uv2Array,Xa=A.__normalArray,$a=A.__tangentArray,kb=A.__colorArray,ab=A.__skinIndexArray,bb=A.__skinWeightArray,xb=A.__morphTargetsArrays,yb=A.__morphNormalsArrays,tb=A.__webglCustomAttributesList,M=void 0,Mb=A.__faceArray,ub=A.__lineArray,
+(m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,c.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=B(a,b,c,d,e);$=-1;M.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,m,na):e.render(function(a){M.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=
+function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)u(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)t(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;void 0===h.__webglInit&&(void 0!==h.__webglActive&&t(h,a),u(h,a));var k=h,l=k.geometry,p=void 0,q=void 0,r=void 0;if(l instanceof
+THREE.BufferGeometry){var s=m.DYNAMIC_DRAW,x=l.attributes,z=void 0,y=void 0;for(z in x)y=x[z],y.needsUpdate&&("index"===z?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,y.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,y.array,s)):(m.bindBuffer(m.ARRAY_BUFFER,y.buffer),m.bufferData(m.ARRAY_BUFFER,y.array,s)),y.needsUpdate=!1)}else if(k instanceof THREE.Mesh){for(var B=0,I=l.geometryGroupsList.length;B<I;B++)if(p=l.geometryGroupsList[B],r=d(k,p),l.buffersNeedUpdate&&c(p,k),q=r.attributes&&v(r),l.verticesNeedUpdate||
+l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||q){var A=p,D=k,C=m.DYNAMIC_DRAW,F=!l.dynamic,G=r;if(A.__inittedArrays){var H=e(G),O=G.vertexColors?G.vertexColors:!1,L=f(G),M=H===THREE.SmoothShading,E=void 0,J=void 0,Q=void 0,K=void 0,ca=void 0,R=void 0,Y=void 0,W=void 0,V=void 0,$=void 0,sa=void 0,S=void 0,T=void 0,Z=void 0,oa=void 0,ta=void 0,Ea=void 0,da=void 0,Ka=void 0,fa=void 0,ga=void 0,ha=void 0,za=void 0,ka=void 0,
+ia=void 0,la=void 0,na=void 0,pa=void 0,Aa=void 0,ba=void 0,Da=void 0,Ca=void 0,La=void 0,Ja=void 0,ma=void 0,Ma=void 0,wa=void 0,xa=void 0,Pa=void 0,Wa=void 0,Fa=0,Ba=0,Na=0,Qa=0,Sa=0,Ga=0,Za=0,Oa=0,eb=0,va=0,Ha=0,P=0,Ya=void 0,jb=A.__vertexArray,db=A.__uvArray,hb=A.__uv2Array,Xa=A.__normalArray,$a=A.__tangentArray,kb=A.__colorArray,ab=A.__skinIndexArray,bb=A.__skinWeightArray,xb=A.__morphTargetsArrays,yb=A.__morphNormalsArrays,tb=A.__webglCustomAttributesList,N=void 0,Mb=A.__faceArray,ub=A.__lineArray,
 Ta=D.geometry,Hb=Ta.elementsNeedUpdate,Bb=Ta.uvsNeedUpdate,Ib=Ta.normalsNeedUpdate,Jb=Ta.tangentsNeedUpdate,Kb=Ta.colorsNeedUpdate,Lb=Ta.morphTargetsNeedUpdate,cc=Ta.vertices,ea=A.faces3,lb=Ta.faces,Cb=Ta.faceVertexUvs[0],ic=Ta.faceVertexUvs[1],dc=Ta.skinIndices,Nb=Ta.skinWeights,Ob=Ta.morphTargets,jc=Ta.morphNormals;if(Ta.verticesNeedUpdate){E=0;for(J=ea.length;E<J;E++)K=lb[ea[E]],S=cc[K.a],T=cc[K.b],Z=cc[K.c],jb[Ba]=S.x,jb[Ba+1]=S.y,jb[Ba+2]=S.z,jb[Ba+3]=T.x,jb[Ba+4]=T.y,jb[Ba+5]=T.z,jb[Ba+6]=Z.x,
 Ta=D.geometry,Hb=Ta.elementsNeedUpdate,Bb=Ta.uvsNeedUpdate,Ib=Ta.normalsNeedUpdate,Jb=Ta.tangentsNeedUpdate,Kb=Ta.colorsNeedUpdate,Lb=Ta.morphTargetsNeedUpdate,cc=Ta.vertices,ea=A.faces3,lb=Ta.faces,Cb=Ta.faceVertexUvs[0],ic=Ta.faceVertexUvs[1],dc=Ta.skinIndices,Nb=Ta.skinWeights,Ob=Ta.morphTargets,jc=Ta.morphNormals;if(Ta.verticesNeedUpdate){E=0;for(J=ea.length;E<J;E++)K=lb[ea[E]],S=cc[K.a],T=cc[K.b],Z=cc[K.c],jb[Ba]=S.x,jb[Ba+1]=S.y,jb[Ba+2]=S.z,jb[Ba+3]=T.x,jb[Ba+4]=T.y,jb[Ba+5]=T.z,jb[Ba+6]=Z.x,
-jb[Ba+7]=Z.y,jb[Ba+8]=Z.z,Ba+=9;m.bindBuffer(m.ARRAY_BUFFER,A.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,jb,C)}if(Lb)for(ma=0,Ma=Ob.length;ma<Ma;ma++){E=Ha=0;for(J=ea.length;E<J;E++)Pa=ea[E],K=lb[Pa],S=Ob[ma].vertices[K.a],T=Ob[ma].vertices[K.b],Z=Ob[ma].vertices[K.c],wa=xb[ma],wa[Ha]=S.x,wa[Ha+1]=S.y,wa[Ha+2]=S.z,wa[Ha+3]=T.x,wa[Ha+4]=T.y,wa[Ha+5]=T.z,wa[Ha+6]=Z.x,wa[Ha+7]=Z.y,wa[Ha+8]=Z.z,G.morphNormals&&(N?(Wa=jc[ma].vertexNormals[Pa],da=Wa.a,Ka=Wa.b,fa=Wa.c):fa=Ka=da=jc[ma].faceNormals[Pa],
+jb[Ba+7]=Z.y,jb[Ba+8]=Z.z,Ba+=9;m.bindBuffer(m.ARRAY_BUFFER,A.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,jb,C)}if(Lb)for(ma=0,Ma=Ob.length;ma<Ma;ma++){E=Ha=0;for(J=ea.length;E<J;E++)Pa=ea[E],K=lb[Pa],S=Ob[ma].vertices[K.a],T=Ob[ma].vertices[K.b],Z=Ob[ma].vertices[K.c],wa=xb[ma],wa[Ha]=S.x,wa[Ha+1]=S.y,wa[Ha+2]=S.z,wa[Ha+3]=T.x,wa[Ha+4]=T.y,wa[Ha+5]=T.z,wa[Ha+6]=Z.x,wa[Ha+7]=Z.y,wa[Ha+8]=Z.z,G.morphNormals&&(M?(Wa=jc[ma].vertexNormals[Pa],da=Wa.a,Ka=Wa.b,fa=Wa.c):fa=Ka=da=jc[ma].faceNormals[Pa],
 xa=yb[ma],xa[Ha]=da.x,xa[Ha+1]=da.y,xa[Ha+2]=da.z,xa[Ha+3]=Ka.x,xa[Ha+4]=Ka.y,xa[Ha+5]=Ka.z,xa[Ha+6]=fa.x,xa[Ha+7]=fa.y,xa[Ha+8]=fa.z),Ha+=9;m.bindBuffer(m.ARRAY_BUFFER,A.__webglMorphTargetsBuffers[ma]);m.bufferData(m.ARRAY_BUFFER,xb[ma],C);G.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglMorphNormalsBuffers[ma]),m.bufferData(m.ARRAY_BUFFER,yb[ma],C))}if(Nb.length){E=0;for(J=ea.length;E<J;E++)K=lb[ea[E]],ka=Nb[K.a],ia=Nb[K.b],la=Nb[K.c],bb[va]=ka.x,bb[va+1]=ka.y,bb[va+2]=ka.z,bb[va+3]=ka.w,bb[va+
 xa=yb[ma],xa[Ha]=da.x,xa[Ha+1]=da.y,xa[Ha+2]=da.z,xa[Ha+3]=Ka.x,xa[Ha+4]=Ka.y,xa[Ha+5]=Ka.z,xa[Ha+6]=fa.x,xa[Ha+7]=fa.y,xa[Ha+8]=fa.z),Ha+=9;m.bindBuffer(m.ARRAY_BUFFER,A.__webglMorphTargetsBuffers[ma]);m.bufferData(m.ARRAY_BUFFER,xb[ma],C);G.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglMorphNormalsBuffers[ma]),m.bufferData(m.ARRAY_BUFFER,yb[ma],C))}if(Nb.length){E=0;for(J=ea.length;E<J;E++)K=lb[ea[E]],ka=Nb[K.a],ia=Nb[K.b],la=Nb[K.c],bb[va]=ka.x,bb[va+1]=ka.y,bb[va+2]=ka.z,bb[va+3]=ka.w,bb[va+
 4]=ia.x,bb[va+5]=ia.y,bb[va+6]=ia.z,bb[va+7]=ia.w,bb[va+8]=la.x,bb[va+9]=la.y,bb[va+10]=la.z,bb[va+11]=la.w,na=dc[K.a],pa=dc[K.b],Aa=dc[K.c],ab[va]=na.x,ab[va+1]=na.y,ab[va+2]=na.z,ab[va+3]=na.w,ab[va+4]=pa.x,ab[va+5]=pa.y,ab[va+6]=pa.z,ab[va+7]=pa.w,ab[va+8]=Aa.x,ab[va+9]=Aa.y,ab[va+10]=Aa.z,ab[va+11]=Aa.w,va+=12;0<va&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,ab,C),m.bindBuffer(m.ARRAY_BUFFER,A.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,bb,C))}if(Kb&&
 4]=ia.x,bb[va+5]=ia.y,bb[va+6]=ia.z,bb[va+7]=ia.w,bb[va+8]=la.x,bb[va+9]=la.y,bb[va+10]=la.z,bb[va+11]=la.w,na=dc[K.a],pa=dc[K.b],Aa=dc[K.c],ab[va]=na.x,ab[va+1]=na.y,ab[va+2]=na.z,ab[va+3]=na.w,ab[va+4]=pa.x,ab[va+5]=pa.y,ab[va+6]=pa.z,ab[va+7]=pa.w,ab[va+8]=Aa.x,ab[va+9]=Aa.y,ab[va+10]=Aa.z,ab[va+11]=Aa.w,va+=12;0<va&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,ab,C),m.bindBuffer(m.ARRAY_BUFFER,A.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,bb,C))}if(Kb&&
 O){E=0;for(J=ea.length;E<J;E++)K=lb[ea[E]],Y=K.vertexColors,W=K.color,3===Y.length&&O===THREE.VertexColors?(ga=Y[0],ha=Y[1],za=Y[2]):za=ha=ga=W,kb[eb]=ga.r,kb[eb+1]=ga.g,kb[eb+2]=ga.b,kb[eb+3]=ha.r,kb[eb+4]=ha.g,kb[eb+5]=ha.b,kb[eb+6]=za.r,kb[eb+7]=za.g,kb[eb+8]=za.b,eb+=9;0<eb&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,kb,C))}if(Jb&&Ta.hasTangents){E=0;for(J=ea.length;E<J;E++)K=lb[ea[E]],V=K.vertexTangents,oa=V[0],ta=V[1],Ea=V[2],$a[Za]=oa.x,$a[Za+1]=oa.y,$a[Za+
 O){E=0;for(J=ea.length;E<J;E++)K=lb[ea[E]],Y=K.vertexColors,W=K.color,3===Y.length&&O===THREE.VertexColors?(ga=Y[0],ha=Y[1],za=Y[2]):za=ha=ga=W,kb[eb]=ga.r,kb[eb+1]=ga.g,kb[eb+2]=ga.b,kb[eb+3]=ha.r,kb[eb+4]=ha.g,kb[eb+5]=ha.b,kb[eb+6]=za.r,kb[eb+7]=za.g,kb[eb+8]=za.b,eb+=9;0<eb&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,kb,C))}if(Jb&&Ta.hasTangents){E=0;for(J=ea.length;E<J;E++)K=lb[ea[E]],V=K.vertexTangents,oa=V[0],ta=V[1],Ea=V[2],$a[Za]=oa.x,$a[Za+1]=oa.y,$a[Za+
-2]=oa.z,$a[Za+3]=oa.w,$a[Za+4]=ta.x,$a[Za+5]=ta.y,$a[Za+6]=ta.z,$a[Za+7]=ta.w,$a[Za+8]=Ea.x,$a[Za+9]=Ea.y,$a[Za+10]=Ea.z,$a[Za+11]=Ea.w,Za+=12;m.bindBuffer(m.ARRAY_BUFFER,A.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,$a,C)}if(Ib&&H){E=0;for(J=ea.length;E<J;E++)if(K=lb[ea[E]],ca=K.vertexNormals,R=K.normal,3===ca.length&&N)for(ba=0;3>ba;ba++)Ca=ca[ba],Xa[Ga]=Ca.x,Xa[Ga+1]=Ca.y,Xa[Ga+2]=Ca.z,Ga+=3;else for(ba=0;3>ba;ba++)Xa[Ga]=R.x,Xa[Ga+1]=R.y,Xa[Ga+2]=R.z,Ga+=3;m.bindBuffer(m.ARRAY_BUFFER,A.__webglNormalBuffer);
+2]=oa.z,$a[Za+3]=oa.w,$a[Za+4]=ta.x,$a[Za+5]=ta.y,$a[Za+6]=ta.z,$a[Za+7]=ta.w,$a[Za+8]=Ea.x,$a[Za+9]=Ea.y,$a[Za+10]=Ea.z,$a[Za+11]=Ea.w,Za+=12;m.bindBuffer(m.ARRAY_BUFFER,A.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,$a,C)}if(Ib&&H){E=0;for(J=ea.length;E<J;E++)if(K=lb[ea[E]],ca=K.vertexNormals,R=K.normal,3===ca.length&&M)for(ba=0;3>ba;ba++)Ca=ca[ba],Xa[Ga]=Ca.x,Xa[Ga+1]=Ca.y,Xa[Ga+2]=Ca.z,Ga+=3;else for(ba=0;3>ba;ba++)Xa[Ga]=R.x,Xa[Ga+1]=R.y,Xa[Ga+2]=R.z,Ga+=3;m.bindBuffer(m.ARRAY_BUFFER,A.__webglNormalBuffer);
 m.bufferData(m.ARRAY_BUFFER,Xa,C)}if(Bb&&Cb&&L){E=0;for(J=ea.length;E<J;E++)if(Q=ea[E],$=Cb[Q],void 0!==$)for(ba=0;3>ba;ba++)La=$[ba],db[Na]=La.x,db[Na+1]=La.y,Na+=2;0<Na&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,db,C))}if(Bb&&ic&&L){E=0;for(J=ea.length;E<J;E++)if(Q=ea[E],sa=ic[Q],void 0!==sa)for(ba=0;3>ba;ba++)Ja=sa[ba],hb[Qa]=Ja.x,hb[Qa+1]=Ja.y,Qa+=2;0<Qa&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,hb,C))}if(Hb){E=0;for(J=ea.length;E<
 m.bufferData(m.ARRAY_BUFFER,Xa,C)}if(Bb&&Cb&&L){E=0;for(J=ea.length;E<J;E++)if(Q=ea[E],$=Cb[Q],void 0!==$)for(ba=0;3>ba;ba++)La=$[ba],db[Na]=La.x,db[Na+1]=La.y,Na+=2;0<Na&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,db,C))}if(Bb&&ic&&L){E=0;for(J=ea.length;E<J;E++)if(Q=ea[E],sa=ic[Q],void 0!==sa)for(ba=0;3>ba;ba++)Ja=sa[ba],hb[Qa]=Ja.x,hb[Qa+1]=Ja.y,Qa+=2;0<Qa&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,hb,C))}if(Hb){E=0;for(J=ea.length;E<
-J;E++)Mb[Sa]=Fa,Mb[Sa+1]=Fa+1,Mb[Sa+2]=Fa+2,Sa+=3,ub[Oa]=Fa,ub[Oa+1]=Fa+1,ub[Oa+2]=Fa,ub[Oa+3]=Fa+2,ub[Oa+4]=Fa+1,ub[Oa+5]=Fa+2,Oa+=6,Fa+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,A.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,Mb,C);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,A.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,ub,C)}if(tb)for(ba=0,Da=tb.length;ba<Da;ba++)if(M=tb[ba],M.__original.needsUpdate){P=0;if(1===M.size)if(void 0===M.boundTo||"vertices"===M.boundTo)for(E=0,J=ea.length;E<
-J;E++)K=lb[ea[E]],M.array[P]=M.value[K.a],M.array[P+1]=M.value[K.b],M.array[P+2]=M.value[K.c],P+=3;else{if("faces"===M.boundTo)for(E=0,J=ea.length;E<J;E++)Ya=M.value[ea[E]],M.array[P]=Ya,M.array[P+1]=Ya,M.array[P+2]=Ya,P+=3}else if(2===M.size)if(void 0===M.boundTo||"vertices"===M.boundTo)for(E=0,J=ea.length;E<J;E++)K=lb[ea[E]],S=M.value[K.a],T=M.value[K.b],Z=M.value[K.c],M.array[P]=S.x,M.array[P+1]=S.y,M.array[P+2]=T.x,M.array[P+3]=T.y,M.array[P+4]=Z.x,M.array[P+5]=Z.y,P+=6;else{if("faces"===M.boundTo)for(E=
-0,J=ea.length;E<J;E++)Z=T=S=Ya=M.value[ea[E]],M.array[P]=S.x,M.array[P+1]=S.y,M.array[P+2]=T.x,M.array[P+3]=T.y,M.array[P+4]=Z.x,M.array[P+5]=Z.y,P+=6}else if(3===M.size){var ua;ua="c"===M.type?["r","g","b"]:["x","y","z"];if(void 0===M.boundTo||"vertices"===M.boundTo)for(E=0,J=ea.length;E<J;E++)K=lb[ea[E]],S=M.value[K.a],T=M.value[K.b],Z=M.value[K.c],M.array[P]=S[ua[0]],M.array[P+1]=S[ua[1]],M.array[P+2]=S[ua[2]],M.array[P+3]=T[ua[0]],M.array[P+4]=T[ua[1]],M.array[P+5]=T[ua[2]],M.array[P+6]=Z[ua[0]],
-M.array[P+7]=Z[ua[1]],M.array[P+8]=Z[ua[2]],P+=9;else if("faces"===M.boundTo)for(E=0,J=ea.length;E<J;E++)Z=T=S=Ya=M.value[ea[E]],M.array[P]=S[ua[0]],M.array[P+1]=S[ua[1]],M.array[P+2]=S[ua[2]],M.array[P+3]=T[ua[0]],M.array[P+4]=T[ua[1]],M.array[P+5]=T[ua[2]],M.array[P+6]=Z[ua[0]],M.array[P+7]=Z[ua[1]],M.array[P+8]=Z[ua[2]],P+=9;else if("faceVertices"===M.boundTo)for(E=0,J=ea.length;E<J;E++)Ya=M.value[ea[E]],S=Ya[0],T=Ya[1],Z=Ya[2],M.array[P]=S[ua[0]],M.array[P+1]=S[ua[1]],M.array[P+2]=S[ua[2]],M.array[P+
-3]=T[ua[0]],M.array[P+4]=T[ua[1]],M.array[P+5]=T[ua[2]],M.array[P+6]=Z[ua[0]],M.array[P+7]=Z[ua[1]],M.array[P+8]=Z[ua[2]],P+=9}else if(4===M.size)if(void 0===M.boundTo||"vertices"===M.boundTo)for(E=0,J=ea.length;E<J;E++)K=lb[ea[E]],S=M.value[K.a],T=M.value[K.b],Z=M.value[K.c],M.array[P]=S.x,M.array[P+1]=S.y,M.array[P+2]=S.z,M.array[P+3]=S.w,M.array[P+4]=T.x,M.array[P+5]=T.y,M.array[P+6]=T.z,M.array[P+7]=T.w,M.array[P+8]=Z.x,M.array[P+9]=Z.y,M.array[P+10]=Z.z,M.array[P+11]=Z.w,P+=12;else if("faces"===
-M.boundTo)for(E=0,J=ea.length;E<J;E++)Z=T=S=Ya=M.value[ea[E]],M.array[P]=S.x,M.array[P+1]=S.y,M.array[P+2]=S.z,M.array[P+3]=S.w,M.array[P+4]=T.x,M.array[P+5]=T.y,M.array[P+6]=T.z,M.array[P+7]=T.w,M.array[P+8]=Z.x,M.array[P+9]=Z.y,M.array[P+10]=Z.z,M.array[P+11]=Z.w,P+=12;else if("faceVertices"===M.boundTo)for(E=0,J=ea.length;E<J;E++)Ya=M.value[ea[E]],S=Ya[0],T=Ya[1],Z=Ya[2],M.array[P]=S.x,M.array[P+1]=S.y,M.array[P+2]=S.z,M.array[P+3]=S.w,M.array[P+4]=T.x,M.array[P+5]=T.y,M.array[P+6]=T.z,M.array[P+
-7]=T.w,M.array[P+8]=Z.x,M.array[P+9]=Z.y,M.array[P+10]=Z.z,M.array[P+11]=Z.w,P+=12;m.bindBuffer(m.ARRAY_BUFFER,M.buffer);m.bufferData(m.ARRAY_BUFFER,M.array,C)}F&&(delete A.__inittedArrays,delete A.__colorArray,delete A.__normalArray,delete A.__tangentArray,delete A.__uvArray,delete A.__uv2Array,delete A.__faceArray,delete A.__vertexArray,delete A.__lineArray,delete A.__skinIndexArray,delete A.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=
-!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;q.attributes&&w(q)}else if(k instanceof THREE.Line){q=d(k,l);r=q.attributes&&v(q);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||r){var cb=l,Pb=m.DYNAMIC_DRAW,Db=void 0,Eb=void 0,Fb=void 0,Qb=void 0,ra=void 0,Rb=void 0,kc=cb.vertices,lc=cb.colors,mc=cb.lineDistances,Wb=kc.length,Xb=lc.length,Yb=mc.length,Sb=cb.__vertexArray,Tb=cb.__colorArray,nc=cb.__lineDistanceArray,Zb=cb.colorsNeedUpdate,
+J;E++)Mb[Sa]=Fa,Mb[Sa+1]=Fa+1,Mb[Sa+2]=Fa+2,Sa+=3,ub[Oa]=Fa,ub[Oa+1]=Fa+1,ub[Oa+2]=Fa,ub[Oa+3]=Fa+2,ub[Oa+4]=Fa+1,ub[Oa+5]=Fa+2,Oa+=6,Fa+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,A.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,Mb,C);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,A.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,ub,C)}if(tb)for(ba=0,Da=tb.length;ba<Da;ba++)if(N=tb[ba],N.__original.needsUpdate){P=0;if(1===N.size)if(void 0===N.boundTo||"vertices"===N.boundTo)for(E=0,J=ea.length;E<
+J;E++)K=lb[ea[E]],N.array[P]=N.value[K.a],N.array[P+1]=N.value[K.b],N.array[P+2]=N.value[K.c],P+=3;else{if("faces"===N.boundTo)for(E=0,J=ea.length;E<J;E++)Ya=N.value[ea[E]],N.array[P]=Ya,N.array[P+1]=Ya,N.array[P+2]=Ya,P+=3}else if(2===N.size)if(void 0===N.boundTo||"vertices"===N.boundTo)for(E=0,J=ea.length;E<J;E++)K=lb[ea[E]],S=N.value[K.a],T=N.value[K.b],Z=N.value[K.c],N.array[P]=S.x,N.array[P+1]=S.y,N.array[P+2]=T.x,N.array[P+3]=T.y,N.array[P+4]=Z.x,N.array[P+5]=Z.y,P+=6;else{if("faces"===N.boundTo)for(E=
+0,J=ea.length;E<J;E++)Z=T=S=Ya=N.value[ea[E]],N.array[P]=S.x,N.array[P+1]=S.y,N.array[P+2]=T.x,N.array[P+3]=T.y,N.array[P+4]=Z.x,N.array[P+5]=Z.y,P+=6}else if(3===N.size){var ua;ua="c"===N.type?["r","g","b"]:["x","y","z"];if(void 0===N.boundTo||"vertices"===N.boundTo)for(E=0,J=ea.length;E<J;E++)K=lb[ea[E]],S=N.value[K.a],T=N.value[K.b],Z=N.value[K.c],N.array[P]=S[ua[0]],N.array[P+1]=S[ua[1]],N.array[P+2]=S[ua[2]],N.array[P+3]=T[ua[0]],N.array[P+4]=T[ua[1]],N.array[P+5]=T[ua[2]],N.array[P+6]=Z[ua[0]],
+N.array[P+7]=Z[ua[1]],N.array[P+8]=Z[ua[2]],P+=9;else if("faces"===N.boundTo)for(E=0,J=ea.length;E<J;E++)Z=T=S=Ya=N.value[ea[E]],N.array[P]=S[ua[0]],N.array[P+1]=S[ua[1]],N.array[P+2]=S[ua[2]],N.array[P+3]=T[ua[0]],N.array[P+4]=T[ua[1]],N.array[P+5]=T[ua[2]],N.array[P+6]=Z[ua[0]],N.array[P+7]=Z[ua[1]],N.array[P+8]=Z[ua[2]],P+=9;else if("faceVertices"===N.boundTo)for(E=0,J=ea.length;E<J;E++)Ya=N.value[ea[E]],S=Ya[0],T=Ya[1],Z=Ya[2],N.array[P]=S[ua[0]],N.array[P+1]=S[ua[1]],N.array[P+2]=S[ua[2]],N.array[P+
+3]=T[ua[0]],N.array[P+4]=T[ua[1]],N.array[P+5]=T[ua[2]],N.array[P+6]=Z[ua[0]],N.array[P+7]=Z[ua[1]],N.array[P+8]=Z[ua[2]],P+=9}else if(4===N.size)if(void 0===N.boundTo||"vertices"===N.boundTo)for(E=0,J=ea.length;E<J;E++)K=lb[ea[E]],S=N.value[K.a],T=N.value[K.b],Z=N.value[K.c],N.array[P]=S.x,N.array[P+1]=S.y,N.array[P+2]=S.z,N.array[P+3]=S.w,N.array[P+4]=T.x,N.array[P+5]=T.y,N.array[P+6]=T.z,N.array[P+7]=T.w,N.array[P+8]=Z.x,N.array[P+9]=Z.y,N.array[P+10]=Z.z,N.array[P+11]=Z.w,P+=12;else if("faces"===
+N.boundTo)for(E=0,J=ea.length;E<J;E++)Z=T=S=Ya=N.value[ea[E]],N.array[P]=S.x,N.array[P+1]=S.y,N.array[P+2]=S.z,N.array[P+3]=S.w,N.array[P+4]=T.x,N.array[P+5]=T.y,N.array[P+6]=T.z,N.array[P+7]=T.w,N.array[P+8]=Z.x,N.array[P+9]=Z.y,N.array[P+10]=Z.z,N.array[P+11]=Z.w,P+=12;else if("faceVertices"===N.boundTo)for(E=0,J=ea.length;E<J;E++)Ya=N.value[ea[E]],S=Ya[0],T=Ya[1],Z=Ya[2],N.array[P]=S.x,N.array[P+1]=S.y,N.array[P+2]=S.z,N.array[P+3]=S.w,N.array[P+4]=T.x,N.array[P+5]=T.y,N.array[P+6]=T.z,N.array[P+
+7]=T.w,N.array[P+8]=Z.x,N.array[P+9]=Z.y,N.array[P+10]=Z.z,N.array[P+11]=Z.w,P+=12;m.bindBuffer(m.ARRAY_BUFFER,N.buffer);m.bufferData(m.ARRAY_BUFFER,N.array,C)}F&&(delete A.__inittedArrays,delete A.__colorArray,delete A.__normalArray,delete A.__tangentArray,delete A.__uvArray,delete A.__uv2Array,delete A.__faceArray,delete A.__vertexArray,delete A.__lineArray,delete A.__skinIndexArray,delete A.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=
+!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;r.attributes&&w(r)}else if(k instanceof THREE.Line){r=d(k,l);q=r.attributes&&v(r);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||q){var cb=l,Pb=m.DYNAMIC_DRAW,Db=void 0,Eb=void 0,Fb=void 0,Qb=void 0,ra=void 0,Rb=void 0,kc=cb.vertices,lc=cb.colors,mc=cb.lineDistances,Wb=kc.length,Xb=lc.length,Yb=mc.length,Sb=cb.__vertexArray,Tb=cb.__colorArray,nc=cb.__lineDistanceArray,Zb=cb.colorsNeedUpdate,
 $b=cb.lineDistancesNeedUpdate,ec=cb.__webglCustomAttributesList,Ub=void 0,oc=void 0,Ia=void 0,zb=void 0,Ua=void 0,qa=void 0;if(cb.verticesNeedUpdate){for(Db=0;Db<Wb;Db++)Qb=kc[Db],ra=3*Db,Sb[ra]=Qb.x,Sb[ra+1]=Qb.y,Sb[ra+2]=Qb.z;m.bindBuffer(m.ARRAY_BUFFER,cb.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,Sb,Pb)}if(Zb){for(Eb=0;Eb<Xb;Eb++)Rb=lc[Eb],ra=3*Eb,Tb[ra]=Rb.r,Tb[ra+1]=Rb.g,Tb[ra+2]=Rb.b;m.bindBuffer(m.ARRAY_BUFFER,cb.__webglColorBuffer);m.bufferData(m.ARRAY_BUFFER,Tb,Pb)}if($b){for(Fb=0;Fb<
 $b=cb.lineDistancesNeedUpdate,ec=cb.__webglCustomAttributesList,Ub=void 0,oc=void 0,Ia=void 0,zb=void 0,Ua=void 0,qa=void 0;if(cb.verticesNeedUpdate){for(Db=0;Db<Wb;Db++)Qb=kc[Db],ra=3*Db,Sb[ra]=Qb.x,Sb[ra+1]=Qb.y,Sb[ra+2]=Qb.z;m.bindBuffer(m.ARRAY_BUFFER,cb.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,Sb,Pb)}if(Zb){for(Eb=0;Eb<Xb;Eb++)Rb=lc[Eb],ra=3*Eb,Tb[ra]=Rb.r,Tb[ra+1]=Rb.g,Tb[ra+2]=Rb.b;m.bindBuffer(m.ARRAY_BUFFER,cb.__webglColorBuffer);m.bufferData(m.ARRAY_BUFFER,Tb,Pb)}if($b){for(Fb=0;Fb<
 Yb;Fb++)nc[Fb]=mc[Fb];m.bindBuffer(m.ARRAY_BUFFER,cb.__webglLineDistanceBuffer);m.bufferData(m.ARRAY_BUFFER,nc,Pb)}if(ec)for(Ub=0,oc=ec.length;Ub<oc;Ub++)if(qa=ec[Ub],qa.needsUpdate&&(void 0===qa.boundTo||"vertices"===qa.boundTo)){ra=0;zb=qa.value.length;if(1===qa.size)for(Ia=0;Ia<zb;Ia++)qa.array[Ia]=qa.value[Ia];else if(2===qa.size)for(Ia=0;Ia<zb;Ia++)Ua=qa.value[Ia],qa.array[ra]=Ua.x,qa.array[ra+1]=Ua.y,ra+=2;else if(3===qa.size)if("c"===qa.type)for(Ia=0;Ia<zb;Ia++)Ua=qa.value[Ia],qa.array[ra]=
 Yb;Fb++)nc[Fb]=mc[Fb];m.bindBuffer(m.ARRAY_BUFFER,cb.__webglLineDistanceBuffer);m.bufferData(m.ARRAY_BUFFER,nc,Pb)}if(ec)for(Ub=0,oc=ec.length;Ub<oc;Ub++)if(qa=ec[Ub],qa.needsUpdate&&(void 0===qa.boundTo||"vertices"===qa.boundTo)){ra=0;zb=qa.value.length;if(1===qa.size)for(Ia=0;Ia<zb;Ia++)qa.array[Ia]=qa.value[Ia];else if(2===qa.size)for(Ia=0;Ia<zb;Ia++)Ua=qa.value[Ia],qa.array[ra]=Ua.x,qa.array[ra+1]=Ua.y,ra+=2;else if(3===qa.size)if("c"===qa.type)for(Ia=0;Ia<zb;Ia++)Ua=qa.value[Ia],qa.array[ra]=
-Ua.r,qa.array[ra+1]=Ua.g,qa.array[ra+2]=Ua.b,ra+=3;else for(Ia=0;Ia<zb;Ia++)Ua=qa.value[Ia],qa.array[ra]=Ua.x,qa.array[ra+1]=Ua.y,qa.array[ra+2]=Ua.z,ra+=3;else if(4===qa.size)for(Ia=0;Ia<zb;Ia++)Ua=qa.value[Ia],qa.array[ra]=Ua.x,qa.array[ra+1]=Ua.y,qa.array[ra+2]=Ua.z,qa.array[ra+3]=Ua.w,ra+=4;m.bindBuffer(m.ARRAY_BUFFER,qa.buffer);m.bufferData(m.ARRAY_BUFFER,qa.array,Pb)}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;q.attributes&&w(q)}else if(k instanceof THREE.ParticleSystem){q=
-d(k,l);r=q.attributes&&v(q);if(l.verticesNeedUpdate||l.colorsNeedUpdate||k.sortParticles||r){var mb=l,fc=m.DYNAMIC_DRAW,Gb=k,Va=void 0,nb=void 0,ob=void 0,X=void 0,pb=void 0,sb=void 0,Vb=mb.vertices,gc=Vb.length,hc=mb.colors,pc=hc.length,vb=mb.__vertexArray,wb=mb.__colorArray,qb=mb.__sortArray,qc=mb.verticesNeedUpdate,rc=mb.colorsNeedUpdate,rb=mb.__webglCustomAttributesList,fb=void 0,Ab=void 0,aa=void 0,gb=void 0,ja=void 0,U=void 0;if(Gb.sortParticles){ib.copy(Ra);ib.multiply(Gb.matrixWorld);for(Va=
+Ua.r,qa.array[ra+1]=Ua.g,qa.array[ra+2]=Ua.b,ra+=3;else for(Ia=0;Ia<zb;Ia++)Ua=qa.value[Ia],qa.array[ra]=Ua.x,qa.array[ra+1]=Ua.y,qa.array[ra+2]=Ua.z,ra+=3;else if(4===qa.size)for(Ia=0;Ia<zb;Ia++)Ua=qa.value[Ia],qa.array[ra]=Ua.x,qa.array[ra+1]=Ua.y,qa.array[ra+2]=Ua.z,qa.array[ra+3]=Ua.w,ra+=4;m.bindBuffer(m.ARRAY_BUFFER,qa.buffer);m.bufferData(m.ARRAY_BUFFER,qa.array,Pb)}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;r.attributes&&w(r)}else if(k instanceof THREE.ParticleSystem){r=
+d(k,l);q=r.attributes&&v(r);if(l.verticesNeedUpdate||l.colorsNeedUpdate||k.sortParticles||q){var mb=l,fc=m.DYNAMIC_DRAW,Gb=k,Va=void 0,nb=void 0,ob=void 0,X=void 0,pb=void 0,sb=void 0,Vb=mb.vertices,gc=Vb.length,hc=mb.colors,pc=hc.length,vb=mb.__vertexArray,wb=mb.__colorArray,qb=mb.__sortArray,qc=mb.verticesNeedUpdate,rc=mb.colorsNeedUpdate,rb=mb.__webglCustomAttributesList,fb=void 0,Ab=void 0,aa=void 0,gb=void 0,ja=void 0,U=void 0;if(Gb.sortParticles){ib.copy(Ra);ib.multiply(Gb.matrixWorld);for(Va=
 0;Va<gc;Va++)ob=Vb[Va],ya.copy(ob),ya.applyProjection(ib),qb[Va]=[ya.z,Va];qb.sort(n);for(Va=0;Va<gc;Va++)ob=Vb[qb[Va][1]],X=3*Va,vb[X]=ob.x,vb[X+1]=ob.y,vb[X+2]=ob.z;for(nb=0;nb<pc;nb++)X=3*nb,sb=hc[qb[nb][1]],wb[X]=sb.r,wb[X+1]=sb.g,wb[X+2]=sb.b;if(rb)for(fb=0,Ab=rb.length;fb<Ab;fb++)if(U=rb[fb],void 0===U.boundTo||"vertices"===U.boundTo)if(X=0,gb=U.value.length,1===U.size)for(aa=0;aa<gb;aa++)pb=qb[aa][1],U.array[aa]=U.value[pb];else if(2===U.size)for(aa=0;aa<gb;aa++)pb=qb[aa][1],ja=U.value[pb],
 0;Va<gc;Va++)ob=Vb[Va],ya.copy(ob),ya.applyProjection(ib),qb[Va]=[ya.z,Va];qb.sort(n);for(Va=0;Va<gc;Va++)ob=Vb[qb[Va][1]],X=3*Va,vb[X]=ob.x,vb[X+1]=ob.y,vb[X+2]=ob.z;for(nb=0;nb<pc;nb++)X=3*nb,sb=hc[qb[nb][1]],wb[X]=sb.r,wb[X+1]=sb.g,wb[X+2]=sb.b;if(rb)for(fb=0,Ab=rb.length;fb<Ab;fb++)if(U=rb[fb],void 0===U.boundTo||"vertices"===U.boundTo)if(X=0,gb=U.value.length,1===U.size)for(aa=0;aa<gb;aa++)pb=qb[aa][1],U.array[aa]=U.value[pb];else if(2===U.size)for(aa=0;aa<gb;aa++)pb=qb[aa][1],ja=U.value[pb],
 U.array[X]=ja.x,U.array[X+1]=ja.y,X+=2;else if(3===U.size)if("c"===U.type)for(aa=0;aa<gb;aa++)pb=qb[aa][1],ja=U.value[pb],U.array[X]=ja.r,U.array[X+1]=ja.g,U.array[X+2]=ja.b,X+=3;else for(aa=0;aa<gb;aa++)pb=qb[aa][1],ja=U.value[pb],U.array[X]=ja.x,U.array[X+1]=ja.y,U.array[X+2]=ja.z,X+=3;else if(4===U.size)for(aa=0;aa<gb;aa++)pb=qb[aa][1],ja=U.value[pb],U.array[X]=ja.x,U.array[X+1]=ja.y,U.array[X+2]=ja.z,U.array[X+3]=ja.w,X+=4}else{if(qc)for(Va=0;Va<gc;Va++)ob=Vb[Va],X=3*Va,vb[X]=ob.x,vb[X+1]=ob.y,
 U.array[X]=ja.x,U.array[X+1]=ja.y,X+=2;else if(3===U.size)if("c"===U.type)for(aa=0;aa<gb;aa++)pb=qb[aa][1],ja=U.value[pb],U.array[X]=ja.r,U.array[X+1]=ja.g,U.array[X+2]=ja.b,X+=3;else for(aa=0;aa<gb;aa++)pb=qb[aa][1],ja=U.value[pb],U.array[X]=ja.x,U.array[X+1]=ja.y,U.array[X+2]=ja.z,X+=3;else if(4===U.size)for(aa=0;aa<gb;aa++)pb=qb[aa][1],ja=U.value[pb],U.array[X]=ja.x,U.array[X+1]=ja.y,U.array[X+2]=ja.z,U.array[X+3]=ja.w,X+=4}else{if(qc)for(Va=0;Va<gc;Va++)ob=Vb[Va],X=3*Va,vb[X]=ob.x,vb[X+1]=ob.y,
 vb[X+2]=ob.z;if(rc)for(nb=0;nb<pc;nb++)sb=hc[nb],X=3*nb,wb[X]=sb.r,wb[X+1]=sb.g,wb[X+2]=sb.b;if(rb)for(fb=0,Ab=rb.length;fb<Ab;fb++)if(U=rb[fb],U.needsUpdate&&(void 0===U.boundTo||"vertices"===U.boundTo))if(gb=U.value.length,X=0,1===U.size)for(aa=0;aa<gb;aa++)U.array[aa]=U.value[aa];else if(2===U.size)for(aa=0;aa<gb;aa++)ja=U.value[aa],U.array[X]=ja.x,U.array[X+1]=ja.y,X+=2;else if(3===U.size)if("c"===U.type)for(aa=0;aa<gb;aa++)ja=U.value[aa],U.array[X]=ja.r,U.array[X+1]=ja.g,U.array[X+2]=ja.b,X+=
 vb[X+2]=ob.z;if(rc)for(nb=0;nb<pc;nb++)sb=hc[nb],X=3*nb,wb[X]=sb.r,wb[X+1]=sb.g,wb[X+2]=sb.b;if(rb)for(fb=0,Ab=rb.length;fb<Ab;fb++)if(U=rb[fb],U.needsUpdate&&(void 0===U.boundTo||"vertices"===U.boundTo))if(gb=U.value.length,X=0,1===U.size)for(aa=0;aa<gb;aa++)U.array[aa]=U.value[aa];else if(2===U.size)for(aa=0;aa<gb;aa++)ja=U.value[aa],U.array[X]=ja.x,U.array[X+1]=ja.y,X+=2;else if(3===U.size)if("c"===U.type)for(aa=0;aa<gb;aa++)ja=U.value[aa],U.array[X]=ja.r,U.array[X+1]=ja.g,U.array[X+2]=ja.b,X+=
 3;else for(aa=0;aa<gb;aa++)ja=U.value[aa],U.array[X]=ja.x,U.array[X+1]=ja.y,U.array[X+2]=ja.z,X+=3;else if(4===U.size)for(aa=0;aa<gb;aa++)ja=U.value[aa],U.array[X]=ja.x,U.array[X+1]=ja.y,U.array[X+2]=ja.z,U.array[X+3]=ja.w,X+=4}if(qc||Gb.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,mb.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,vb,fc);if(rc||Gb.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,mb.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,wb,fc);if(rb)for(fb=0,Ab=rb.length;fb<Ab;fb++)if(U=rb[fb],U.needsUpdate||
 3;else for(aa=0;aa<gb;aa++)ja=U.value[aa],U.array[X]=ja.x,U.array[X+1]=ja.y,U.array[X+2]=ja.z,X+=3;else if(4===U.size)for(aa=0;aa<gb;aa++)ja=U.value[aa],U.array[X]=ja.x,U.array[X+1]=ja.y,U.array[X+2]=ja.z,U.array[X+3]=ja.w,X+=4}if(qc||Gb.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,mb.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,vb,fc);if(rc||Gb.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,mb.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,wb,fc);if(rb)for(fb=0,Ab=rb.length;fb<Ab;fb++)if(U=rb[fb],U.needsUpdate||
-Gb.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,U.buffer),m.bufferData(m.ARRAY_BUFFER,U.array,fc)}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;q.attributes&&w(q)}}};this.initMaterial=function(a,b,c,d){var e,f,g,h;a.addEventListener("dispose",Kb);var k,l,p,n,r;a instanceof THREE.MeshDepthMaterial?r="depth":a instanceof THREE.MeshNormalMaterial?r="normal":a instanceof THREE.MeshBasicMaterial?r="basic":a instanceof THREE.MeshLambertMaterial?r="lambert":a instanceof THREE.MeshPhongMaterial?r="phong":a instanceof
-THREE.LineBasicMaterial?r="basic":a instanceof THREE.LineDashedMaterial?r="dashed":a instanceof THREE.ParticleSystemMaterial&&(r="particle_basic");if(r){var q=THREE.ShaderLib[r];a.uniforms=THREE.UniformsUtils.clone(q.uniforms);a.vertexShader=q.vertexShader;a.fragmentShader=q.fragmentShader}var s=e=0,t=0,u=q=0;for(f=b.length;u<f;u++)g=b[u],g.onlyShadow||!1===g.visible||(g instanceof THREE.DirectionalLight&&e++,g instanceof THREE.PointLight&&s++,g instanceof THREE.SpotLight&&t++,g instanceof THREE.HemisphereLight&&
-q++);f=s;g=t;h=q;t=q=0;for(s=b.length;t<s;t++)u=b[t],u.castShadow&&(u instanceof THREE.SpotLight&&q++,u instanceof THREE.DirectionalLight&&!u.shadowCascade&&q++);n=q;yb&&d&&d.useVertexTexture?p=1024:(b=m.getParameter(m.MAX_VERTEX_UNIFORM_VECTORS),b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(b=Math.min(d.bones.length,b),b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+d.bones.length+", this GPU supports just "+b+" (try OpenGL instead of ANGLE)")),p=b);a:{t=a.fragmentShader;
-s=a.vertexShader;q=a.uniforms;b=a.attributes;u=a.defines;c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,maxBones:p,useVertexTexture:yb&&d&&d.useVertexTexture,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,
-maxDirLights:e,maxPointLights:f,maxSpotLights:g,maxHemiLights:h,maxShadows:n,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow&&0<n,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide};d=a.index0AttributeName;var v,w,x;e=[];r?e.push(r):(e.push(t),e.push(s));for(w in u)e.push(w),e.push(u[w]);for(v in c)e.push(v),
-e.push(c[v]);r=e.join();v=0;for(w=ca.length;v<w;v++)if(e=ca[v],e.code===r){e.usedTimes++;l=e.program;break a}v="SHADOWMAP_TYPE_BASIC";c.shadowMapType===THREE.PCFShadowMap?v="SHADOWMAP_TYPE_PCF":c.shadowMapType===THREE.PCFSoftShadowMap&&(v="SHADOWMAP_TYPE_PCF_SOFT");w=[];for(x in u)e=u[x],!1!==e&&(e="#define "+x+" "+e,w.push(e));e=w.join("\n");x=m.createProgram();w=["precision "+Y+" float;","precision "+Y+" int;",e,xb?"#define VERTEX_TEXTURES":"",N.gammaInput?"#define GAMMA_INPUT":"",N.gammaOutput?
+Gb.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,U.buffer),m.bufferData(m.ARRAY_BUFFER,U.array,fc)}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;r.attributes&&w(r)}}};this.initMaterial=function(a,b,c,d){var e,f,g,h;a.addEventListener("dispose",Kb);var k,l,p,n,q;a instanceof THREE.MeshDepthMaterial?q="depth":a instanceof THREE.MeshNormalMaterial?q="normal":a instanceof THREE.MeshBasicMaterial?q="basic":a instanceof THREE.MeshLambertMaterial?q="lambert":a instanceof THREE.MeshPhongMaterial?q="phong":a instanceof
+THREE.LineBasicMaterial?q="basic":a instanceof THREE.LineDashedMaterial?q="dashed":a instanceof THREE.ParticleSystemMaterial&&(q="particle_basic");if(q){var r=THREE.ShaderLib[q];a.uniforms=THREE.UniformsUtils.clone(r.uniforms);a.vertexShader=r.vertexShader;a.fragmentShader=r.fragmentShader}var s=e=0,t=0,u=r=0;for(f=b.length;u<f;u++)g=b[u],g.onlyShadow||!1===g.visible||(g instanceof THREE.DirectionalLight&&e++,g instanceof THREE.PointLight&&s++,g instanceof THREE.SpotLight&&t++,g instanceof THREE.HemisphereLight&&
+r++);f=s;g=t;h=r;t=r=0;for(s=b.length;t<s;t++)u=b[t],u.castShadow&&(u instanceof THREE.SpotLight&&r++,u instanceof THREE.DirectionalLight&&!u.shadowCascade&&r++);n=r;yb&&d&&d.useVertexTexture?p=1024:(b=m.getParameter(m.MAX_VERTEX_UNIFORM_VECTORS),b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(b=Math.min(d.bones.length,b),b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+d.bones.length+", this GPU supports just "+b+" (try OpenGL instead of ANGLE)")),p=b);a:{t=a.fragmentShader;
+s=a.vertexShader;r=a.uniforms;b=a.attributes;u=a.defines;c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,maxBones:p,useVertexTexture:yb&&d&&d.useVertexTexture,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,
+maxDirLights:e,maxPointLights:f,maxSpotLights:g,maxHemiLights:h,maxShadows:n,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow&&0<n,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide};d=a.index0AttributeName;var v,w,x;e=[];q?e.push(q):(e.push(t),e.push(s));for(w in u)e.push(w),e.push(u[w]);for(v in c)e.push(v),
+e.push(c[v]);q=e.join();v=0;for(w=ca.length;v<w;v++)if(e=ca[v],e.code===q){e.usedTimes++;l=e.program;break a}v="SHADOWMAP_TYPE_BASIC";c.shadowMapType===THREE.PCFShadowMap?v="SHADOWMAP_TYPE_PCF":c.shadowMapType===THREE.PCFSoftShadowMap&&(v="SHADOWMAP_TYPE_PCF_SOFT");w=[];for(x in u)e=u[x],!1!==e&&(e="#define "+x+" "+e,w.push(e));e=w.join("\n");x=m.createProgram();w=["precision "+Y+" float;","precision "+Y+" int;",e,xb?"#define VERTEX_TEXTURES":"",M.gammaInput?"#define GAMMA_INPUT":"",M.gammaOutput?
 "#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":
 "#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":
 "",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+v:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":
 "",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+v:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":
 "","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
 "","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
-v=["precision "+Y+" float;","precision "+Y+" int;",c.bumpMap||c.normalMap?"#extension GL_OES_standard_derivatives : enable":"",e,"#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",N.gammaInput?"#define GAMMA_INPUT":"",N.gammaOutput?"#define GAMMA_OUTPUT":"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&
+v=["precision "+Y+" float;","precision "+Y+" int;",c.bumpMap||c.normalMap?"#extension GL_OES_standard_derivatives : enable":"",e,"#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",M.gammaInput?"#define GAMMA_INPUT":"",M.gammaOutput?"#define GAMMA_OUTPUT":"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&
 c.fogExp?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+v:
 c.fogExp?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+v:
 "",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");w=K("vertex",w+s);v=K("fragment",v+t);m.attachShader(x,w);m.attachShader(x,v);void 0!==d&&m.bindAttribLocation(x,0,d);m.linkProgram(x);!1===m.getProgramParameter(x,m.LINK_STATUS)&&(console.error("Could not initialise shader"),console.error("gl.VALIDATE_STATUS",m.getProgramParameter(x,m.VALIDATE_STATUS)),console.error("gl.getError()",
 "",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");w=K("vertex",w+s);v=K("fragment",v+t);m.attachShader(x,w);m.attachShader(x,v);void 0!==d&&m.bindAttribLocation(x,0,d);m.linkProgram(x);!1===m.getProgramParameter(x,m.LINK_STATUS)&&(console.error("Could not initialise shader"),console.error("gl.VALIDATE_STATUS",m.getProgramParameter(x,m.VALIDATE_STATUS)),console.error("gl.getError()",
-m.getError()));""!==m.getProgramInfoLog(x)&&console.error("gl.getProgramInfoLog()",m.getProgramInfoLog(x));m.deleteShader(v);m.deleteShader(w);x.uniforms={};x.attributes={};var z;v="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?(v.push("boneTexture"),v.push("boneTextureWidth"),v.push("boneTextureHeight")):v.push("boneGlobalMatrices");for(z in q)v.push(z);z=v;v=0;for(w=z.length;v<w;v++)q=z[v],x.uniforms[q]=m.getUniformLocation(x,
-q);v="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(z=0;z<c.maxMorphTargets;z++)v.push("morphTarget"+z);for(z=0;z<c.maxMorphNormals;z++)v.push("morphNormal"+z);for(l in b)v.push(l);l=v;z=0;for(b=l.length;z<b;z++)v=l[z],x.attributes[v]=m.getAttribLocation(x,v);x.id=sa++;ca.push({program:x,code:r,usedTimes:1});N.info.memory.programs=ca.length;l=x}a.program=l;z=a.program.attributes;if(a.morphTargets)for(a.numSupportedMorphTargets=0,b="morphTarget",l=0;l<this.maxMorphTargets;l++)x=
+m.getError()));""!==m.getProgramInfoLog(x)&&console.error("gl.getProgramInfoLog()",m.getProgramInfoLog(x));m.deleteShader(v);m.deleteShader(w);x.uniforms={};x.attributes={};var z;v="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?(v.push("boneTexture"),v.push("boneTextureWidth"),v.push("boneTextureHeight")):v.push("boneGlobalMatrices");for(z in r)v.push(z);z=v;v=0;for(w=z.length;v<w;v++)r=z[v],x.uniforms[r]=m.getUniformLocation(x,
+r);v="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(z=0;z<c.maxMorphTargets;z++)v.push("morphTarget"+z);for(z=0;z<c.maxMorphNormals;z++)v.push("morphNormal"+z);for(l in b)v.push(l);l=v;z=0;for(b=l.length;z<b;z++)v=l[z],x.attributes[v]=m.getAttribLocation(x,v);x.id=sa++;ca.push({program:x,code:q,usedTimes:1});M.info.memory.programs=ca.length;l=x}a.program=l;z=a.program.attributes;if(a.morphTargets)for(a.numSupportedMorphTargets=0,b="morphTarget",l=0;l<this.maxMorphTargets;l++)x=
 b+l,0<=z[x]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(a.numSupportedMorphNormals=0,b="morphNormal",l=0;l<this.maxMorphNormals;l++)x=b+l,0<=z[x]&&a.numSupportedMorphNormals++;a.uniformsList=[];for(k in a.uniforms)a.uniformsList.push([a.uniforms[k],k])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?m.disable(m.CULL_FACE):(b===THREE.FrontFaceDirectionCW?m.frontFace(m.CW):m.frontFace(m.CCW),a===THREE.CullFaceBack?m.cullFace(m.BACK):a===THREE.CullFaceFront?m.cullFace(m.FRONT):m.cullFace(m.FRONT_AND_BACK),
 b+l,0<=z[x]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(a.numSupportedMorphNormals=0,b="morphNormal",l=0;l<this.maxMorphNormals;l++)x=b+l,0<=z[x]&&a.numSupportedMorphNormals++;a.uniformsList=[];for(k in a.uniforms)a.uniformsList.push([a.uniforms[k],k])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?m.disable(m.CULL_FACE):(b===THREE.FrontFaceDirectionCW?m.frontFace(m.CW):m.frontFace(m.CCW),a===THREE.CullFaceBack?m.cullFace(m.BACK):a===THREE.CullFaceFront?m.cullFace(m.FRONT):m.cullFace(m.FRONT_AND_BACK),
 m.enable(m.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;oa!==b&&(b?m.disable(m.CULL_FACE):m.enable(m.CULL_FACE),oa=b);za!==a&&(a?m.frontFace(m.CW):m.frontFace(m.CCW),za=a)};this.setDepthTest=function(a){La!==a&&(a?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),La=a)};this.setDepthWrite=function(a){la!==a&&(m.depthMask(a),la=a)};this.setBlending=function(a,b,c,d){a!==Aa&&(a===THREE.NoBlending?m.disable(m.BLEND):a===THREE.AdditiveBlending?
 m.enable(m.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;oa!==b&&(b?m.disable(m.CULL_FACE):m.enable(m.CULL_FACE),oa=b);za!==a&&(a?m.frontFace(m.CW):m.frontFace(m.CCW),za=a)};this.setDepthTest=function(a){La!==a&&(a?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),La=a)};this.setDepthWrite=function(a){la!==a&&(m.depthMask(a),la=a)};this.setBlending=function(a,b,c,d){a!==Aa&&(a===THREE.NoBlending?m.disable(m.BLEND):a===THREE.AdditiveBlending?
 (m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.SRC_ALPHA,m.ONE)):a===THREE.SubtractiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.SRC_COLOR)):a===THREE.CustomBlending?m.enable(m.BLEND):(m.enable(m.BLEND),m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)),Aa=
 (m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.SRC_ALPHA,m.ONE)):a===THREE.SubtractiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.SRC_COLOR)):a===THREE.CustomBlending?m.enable(m.BLEND):(m.enable(m.BLEND),m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)),Aa=
-a);if(a===THREE.CustomBlending){if(b!==Wa&&(m.blendEquation(A(b)),Wa=b),c!==Fa||d!==ka)m.blendFunc(A(c),A(d)),Fa=c,ka=d}else ka=Fa=Wa=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",tb),a.__webglTexture=m.createTexture(),N.info.memory.textures++);m.activeTexture(m.TEXTURE0+b);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);
+a);if(a===THREE.CustomBlending){if(b!==Wa&&(m.blendEquation(A(b)),Wa=b),c!==Fa||d!==ka)m.blendFunc(A(c),A(d)),Fa=c,ka=d}else ka=Fa=Wa=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",tb),a.__webglTexture=m.createTexture(),M.info.memory.textures++);m.activeTexture(m.TEXTURE0+b);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);
 m.pixelStorei(m.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=A(a.format),f=A(a.type);y(m.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<
 m.pixelStorei(m.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=A(a.format),f=A(a.type);y(m.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<
 k;h++)c=g[h],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,c.data):m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&m.generateMipmap(m.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+b),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)};
 k;h++)c=g[h],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,c.data):m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&m.generateMipmap(m.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+b),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)};
-this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Jb);a.__webglTexture=m.createTexture();N.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=A(a.format),e=A(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);y(m.TEXTURE_CUBE_MAP,
+this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Jb);a.__webglTexture=m.createTexture();M.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=A(a.format),e=A(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);y(m.TEXTURE_CUBE_MAP,
 a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);F(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=
 a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);F(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=
 a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),y(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&
 a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),y(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&
 a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):F(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=xa,a=Na,d=ba,e=wa);b!==Ka&&(m.bindFramebuffer(m.FRAMEBUFFER,b),
 a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):F(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=xa,a=Na,d=ba,e=wa);b!==Ka&&(m.bindFramebuffer(m.FRAMEBUFFER,b),
@@ -621,11 +622,11 @@ e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone()
 u,v,[w,t,z]));this.faceVertexUvs[0].push([B,E,D]);this.faces.push(new THREE.Face3(u,p,v,[t.clone(),x,z.clone()]));this.faceVertexUvs[0].push([E.clone(),H,D.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)q=l[0][h],u=l[0][h+1],p=this.vertices.length-1,w=new THREE.Vector3(0,1,0),t=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),B=n[0][h].clone(),E=n[0][h+1].clone(),H=new THREE.Vector2(E.x,0),this.faces.push(new THREE.Face3(q,u,p,[w,t,x])),this.faceVertexUvs[0].push([B,
 u,v,[w,t,z]));this.faceVertexUvs[0].push([B,E,D]);this.faces.push(new THREE.Face3(u,p,v,[t.clone(),x,z.clone()]));this.faceVertexUvs[0].push([E.clone(),H,D.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)q=l[0][h],u=l[0][h+1],p=this.vertices.length-1,w=new THREE.Vector3(0,1,0),t=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),B=n[0][h].clone(),E=n[0][h+1].clone(),H=new THREE.Vector2(E.x,0),this.faces.push(new THREE.Face3(q,u,p,[w,t,x])),this.faceVertexUvs[0].push([B,
 E,H]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)q=l[k][h+1],u=l[k][h],p=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),t=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),B=n[k][h+1].clone(),E=n[k][h].clone(),H=new THREE.Vector2(E.x,1),this.faces.push(new THREE.Face3(q,u,p,[w,t,x])),this.faceVertexUvs[0].push([B,E,H]);this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 E,H]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)q=l[k][h+1],u=l[k][h],p=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),t=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),B=n[k][h+1].clone(),E=n[k][h].clone(),H=new THREE.Vector2(E.x,1),this.faces.push(new THREE.Face3(q,u,p,[w,t,x])),this.faceVertexUvs[0].push([B,E,H]);this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.Math.sign,e=1,e=a.x-b.x,f=a.y-b.y,g=c.x-a.x,h=c.y-a.y,k=e*e+f*f;if(1E-10<Math.abs(e*h-f*g)){var l=Math.sqrt(k),d=Math.sqrt(g*g+h*h),k=b.x-f/l;b=b.y+e/l;g=((c.x-h/d-k)*h-(c.y+g/d-b)*g)/(e*h-f*g);c=k+e*g-a.x;a=b+f*g-a.y;e=c*c+a*a;if(2>=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10<e?1E-10<g&&(a=!0):-1E-10>e?-1E-10>g&&
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.Math.sign,e=1,e=a.x-b.x,f=a.y-b.y,g=c.x-a.x,h=c.y-a.y,k=e*e+f*f;if(1E-10<Math.abs(e*h-f*g)){var l=Math.sqrt(k),d=Math.sqrt(g*g+h*h),k=b.x-f/l;b=b.y+e/l;g=((c.x-h/d-k)*h-(c.y+g/d-b)*g)/(e*h-f*g);c=k+e*g-a.x;a=b+f*g-a.y;e=c*c+a*a;if(2>=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10<e?1E-10<g&&(a=!0):-1E-10>e?-1E-10>g&&
-(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(J=c.length;0<=--J;){e=J;f=J-1;0>f&&(f=c.length-1);for(var g=0,h=q+2*n,g=0;g<h;g++){var k=fa*g,l=fa*(g+1),p=d+e+k,k=d+f+k,r=d+f+l,l=d+e+l,s=c,u=g,v=h,w=e,y=f,p=p+K,k=k+K,r=r+K,l=l+K;O.faces.push(new THREE.Face3(p,k,l,null,null,t));O.faces.push(new THREE.Face3(k,r,l,null,null,t));p=x.generateSideWallUV(O,a,s,b,p,k,r,l,u,v,w,y);O.faceVertexUvs[0].push([p[0],p[1],
+(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(J=c.length;0<=--J;){e=J;f=J-1;0>f&&(f=c.length-1);for(var g=0,h=q+2*n,g=0;g<h;g++){var k=fa*g,l=fa*(g+1),p=d+e+k,k=d+f+k,s=d+f+l,l=d+e+l,r=c,u=g,v=h,w=e,y=f,p=p+K,k=k+K,s=s+K,l=l+K;O.faces.push(new THREE.Face3(p,k,l,null,null,t));O.faces.push(new THREE.Face3(k,s,l,null,null,t));p=x.generateSideWallUV(O,a,r,b,p,k,s,l,u,v,w,y);O.faceVertexUvs[0].push([p[0],p[1],
 p[3]]);O.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function f(a,b,c){O.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=K;d+=K;e+=K;O.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?x.generateBottomUV(O,a,b,c,d,e):x.generateTopUV(O,a,b,c,d,e);O.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,s=void 0!==b.bevelEnabled?b.bevelEnabled:!0,r=
 p[3]]);O.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function f(a,b,c){O.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=K;d+=K;e+=K;O.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?x.generateBottomUV(O,a,b,c,d,e):x.generateTopUV(O,a,b,c,d,e);O.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,s=void 0!==b.bevelEnabled?b.bevelEnabled:!0,r=
 void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,u=b.extrudePath,p,v=!1,w=b.material,t=b.extrudeMaterial,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,z,B,E,H;u&&(p=u.getSpacedPoints(q),v=!0,s=!1,z=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(u,q,!1),B=new THREE.Vector3,E=new THREE.Vector3,H=new THREE.Vector3);s||(l=k=n=0);var D,G,I,O=this,K=this.vertices.length,u=a.extractPoints(r),r=u.shape,y=u.holes;if(u=!THREE.Shape.Utils.isClockWise(r)){r=
 void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,u=b.extrudePath,p,v=!1,w=b.material,t=b.extrudeMaterial,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,z,B,E,H;u&&(p=u.getSpacedPoints(q),v=!0,s=!1,z=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(u,q,!1),B=new THREE.Vector3,E=new THREE.Vector3,H=new THREE.Vector3);s||(l=k=n=0);var D,G,I,O=this,K=this.vertices.length,u=a.extractPoints(r),r=u.shape,y=u.holes;if(u=!THREE.Shape.Utils.isClockWise(r)){r=
-r.reverse();G=0;for(I=y.length;G<I;G++)D=y[G],THREE.Shape.Utils.isClockWise(D)&&(y[G]=D.reverse());u=!1}var F=THREE.Shape.Utils.triangulateShape(r,y),C=r;G=0;for(I=y.length;G<I;G++)D=y[G],r=r.concat(D);var A,L,Q,Y,R,fa=r.length,V,ga=F.length,u=[],J=0;Q=C.length;A=Q-1;for(L=J+1;J<Q;J++,A++,L++)A===Q&&(A=0),L===Q&&(L=0),u[J]=d(C[J],C[A],C[L]);var da=[],W,N=u.concat();G=0;for(I=y.length;G<I;G++){D=y[G];W=[];J=0;Q=D.length;A=Q-1;for(L=J+1;J<Q;J++,A++,L++)A===Q&&(A=0),L===Q&&(L=0),W[J]=d(D[J],D[A],D[L]);
-da.push(W);N=N.concat(W)}for(A=0;A<n;A++){Q=A/n;Y=k*(1-Q);L=l*Math.sin(Q*Math.PI/2);J=0;for(Q=C.length;J<Q;J++)R=c(C[J],u[J],L),f(R.x,R.y,-Y);G=0;for(I=y.length;G<I;G++)for(D=y[G],W=da[G],J=0,Q=D.length;J<Q;J++)R=c(D[J],W[J],L),f(R.x,R.y,-Y)}L=l;for(J=0;J<fa;J++)R=s?c(r[J],N[J],L):r[J],v?(E.copy(z.normals[0]).multiplyScalar(R.x),B.copy(z.binormals[0]).multiplyScalar(R.y),H.copy(p[0]).add(E).add(B),f(H.x,H.y,H.z)):f(R.x,R.y,0);for(Q=1;Q<=q;Q++)for(J=0;J<fa;J++)R=s?c(r[J],N[J],L):r[J],v?(E.copy(z.normals[Q]).multiplyScalar(R.x),
+r.reverse();G=0;for(I=y.length;G<I;G++)D=y[G],THREE.Shape.Utils.isClockWise(D)&&(y[G]=D.reverse());u=!1}var F=THREE.Shape.Utils.triangulateShape(r,y),C=r;G=0;for(I=y.length;G<I;G++)D=y[G],r=r.concat(D);var A,L,Q,Y,R,fa=r.length,V,ga=F.length,u=[],J=0;Q=C.length;A=Q-1;for(L=J+1;J<Q;J++,A++,L++)A===Q&&(A=0),L===Q&&(L=0),u[J]=d(C[J],C[A],C[L]);var da=[],W,M=u.concat();G=0;for(I=y.length;G<I;G++){D=y[G];W=[];J=0;Q=D.length;A=Q-1;for(L=J+1;J<Q;J++,A++,L++)A===Q&&(A=0),L===Q&&(L=0),W[J]=d(D[J],D[A],D[L]);
+da.push(W);M=M.concat(W)}for(A=0;A<n;A++){Q=A/n;Y=k*(1-Q);L=l*Math.sin(Q*Math.PI/2);J=0;for(Q=C.length;J<Q;J++)R=c(C[J],u[J],L),f(R.x,R.y,-Y);G=0;for(I=y.length;G<I;G++)for(D=y[G],W=da[G],J=0,Q=D.length;J<Q;J++)R=c(D[J],W[J],L),f(R.x,R.y,-Y)}L=l;for(J=0;J<fa;J++)R=s?c(r[J],M[J],L):r[J],v?(E.copy(z.normals[0]).multiplyScalar(R.x),B.copy(z.binormals[0]).multiplyScalar(R.y),H.copy(p[0]).add(E).add(B),f(H.x,H.y,H.z)):f(R.x,R.y,0);for(Q=1;Q<=q;Q++)for(J=0;J<fa;J++)R=s?c(r[J],M[J],L):r[J],v?(E.copy(z.normals[Q]).multiplyScalar(R.x),
 B.copy(z.binormals[Q]).multiplyScalar(R.y),H.copy(p[Q]).add(E).add(B),f(H.x,H.y,H.z)):f(R.x,R.y,h/q*Q);for(A=n-1;0<=A;A--){Q=A/n;Y=k*(1-Q);L=l*Math.sin(Q*Math.PI/2);J=0;for(Q=C.length;J<Q;J++)R=c(C[J],u[J],L),f(R.x,R.y,h+Y);G=0;for(I=y.length;G<I;G++)for(D=y[G],W=da[G],J=0,Q=D.length;J<Q;J++)R=c(D[J],W[J],L),v?f(R.x,R.y+p[q-1].y,p[q-1].x+Y):f(R.x,R.y,h+Y)}(function(){if(s){var a;a=0*fa;for(J=0;J<ga;J++)V=F[J],g(V[2]+a,V[1]+a,V[0]+a,!0);a=q+2*n;a*=fa;for(J=0;J<ga;J++)V=F[J],g(V[0]+a,V[1]+a,V[2]+a,
 B.copy(z.binormals[Q]).multiplyScalar(R.y),H.copy(p[Q]).add(E).add(B),f(H.x,H.y,H.z)):f(R.x,R.y,h/q*Q);for(A=n-1;0<=A;A--){Q=A/n;Y=k*(1-Q);L=l*Math.sin(Q*Math.PI/2);J=0;for(Q=C.length;J<Q;J++)R=c(C[J],u[J],L),f(R.x,R.y,h+Y);G=0;for(I=y.length;G<I;G++)for(D=y[G],W=da[G],J=0,Q=D.length;J<Q;J++)R=c(D[J],W[J],L),v?f(R.x,R.y+p[q-1].y,p[q-1].x+Y):f(R.x,R.y,h+Y)}(function(){if(s){var a;a=0*fa;for(J=0;J<ga;J++)V=F[J],g(V[2]+a,V[1]+a,V[0]+a,!0);a=q+2*n;a*=fa;for(J=0;J<ga;J++)V=F[J],g(V[0]+a,V[1]+a,V[2]+a,
 !1)}else{for(J=0;J<ga;J++)V=F[J],g(V[2],V[1],V[0],!0);for(J=0;J<ga;J++)V=F[J],g(V[0]+fa*q,V[1]+fa*q,V[2]+fa*q,!1)}})();(function(){var a=0;e(C,a);a+=C.length;G=0;for(I=y.length;G<I;G++)D=y[G],e(D,a),a+=D.length})()};
 !1)}else{for(J=0;J<ga;J++)V=F[J],g(V[2],V[1],V[0],!0);for(J=0;J<ga;J++)V=F[J],g(V[0]+fa*q,V[1]+fa*q,V[2]+fa*q,!1)}})();(function(){var a=0;e(C,a);a+=C.length;G=0;for(I=y.length;G<I;G++)D=y[G],e(D,a),a+=D.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,g,h,k,l,n,s){b=a.vertices[e].x;c=a.vertices[e].y;e=a.vertices[e].z;d=a.vertices[f].x;k=a.vertices[f].y;f=a.vertices[f].z;l=a.vertices[g].x;
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,g,h,k,l,n,s){b=a.vertices[e].x;c=a.vertices[e].y;e=a.vertices[e].z;d=a.vertices[f].x;k=a.vertices[f].y;f=a.vertices[f].z;l=a.vertices[g].x;
@@ -649,7 +650,7 @@ c/this.radialSegments),g=new THREE.Vector2((b+1)/this.segments,(c+1)/this.radial
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,s;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);s=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));s<=a&&d.set(0,0,1);h.crossVectors(e[0],
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,s;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);s=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));s<=a&&d.set(0,0,1);h.crossVectors(e[0],
 d).normalize();f[0].crossVectors(e[0],h);g[0].crossVectors(e[0],f[0]);for(l=1;l<b;l++)f[l]=f[l-1].clone(),g[l]=g[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),f[l].applyMatrix4(k.makeRotationAxis(h,d))),g[l].crossVectors(e[l],f[l]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),l=1;l<b;l++)f[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),g[l].crossVectors(e[l],
 d).normalize();f[0].crossVectors(e[0],h);g[0].crossVectors(e[0],f[0]);for(l=1;l<b;l++)f[l]=f[l-1].clone(),g[l]=g[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),f[l].applyMatrix4(k.makeRotationAxis(h,d))),g[l].crossVectors(e[l],f[l]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),l=1;l<b;l++)f[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),g[l].crossVectors(e[l],
 f[l])};THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+0.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+0.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);d.centroid.add(a).add(b).add(c).divideScalar(3);k.faces.push(d);d=d.centroid;d=Math.atan2(d.z,-d.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,
 f[l])};THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+0.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+0.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);d.centroid.add(a).add(b).add(c).divideScalar(3);k.faces.push(d);d=d.centroid;d=Math.atan2(d.z,-d.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,
-c,d)])}function g(a,b){var c=Math.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],n=0;n<=c;n++){l[n]=[];for(var q=e(d.clone().lerp(h,n/c)),r=e(g.clone().lerp(h,n/c)),s=c-n,u=0;u<=s;u++)l[n][u]=0==u&&n==c?q:e(q.clone().lerp(r,u/s))}for(n=0;n<c;n++)for(u=0;u<2*(c-n)-1;u++)d=Math.floor(u/2),0==u%2?f(l[n][d+1],l[n+1][d],l[n][d]):f(l[n][d+1],l[n+1][d+1],l[n+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/
+c,d)])}function g(a,b){var c=Math.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],n=0;n<=c;n++){l[n]=[];for(var q=e(d.clone().lerp(h,n/c)),s=e(g.clone().lerp(h,n/c)),r=c-n,u=0;u<=r;u++)l[n][u]=0==u&&n==c?q:e(q.clone().lerp(s,u/r))}for(n=0;n<c;n++)for(u=0;u<2*(c-n)-1;u++)d=Math.floor(u/2),0==u%2?f(l[n][d+1],l[n+1][d],l[n][d]):f(l[n][d+1],l[n+1][d+1],l[n+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/
 2/Math.PI+0.5,a.y));return a.clone()}THREE.Geometry.call(this);c=c||1;d=d||0;for(var k=this,l=0,n=a.length;l<n;l++)e(new THREE.Vector3(a[l][0],a[l][1],a[l][2]));a=this.vertices;for(var s=[],l=0,n=b.length;l<n;l++){var r=a[b[l][0]],q=a[b[l][1]],u=a[b[l][2]];s[l]=new THREE.Face3(r.index,q.index,u.index,[r.clone(),q.clone(),u.clone()])}l=0;for(n=s.length;l<n;l++)g(s[l],d);l=0;for(n=this.faceVertexUvs[0].length;l<n;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,s=b[2].x,r=Math.max(d,Math.max(a,s)),
 2/Math.PI+0.5,a.y));return a.clone()}THREE.Geometry.call(this);c=c||1;d=d||0;for(var k=this,l=0,n=a.length;l<n;l++)e(new THREE.Vector3(a[l][0],a[l][1],a[l][2]));a=this.vertices;for(var s=[],l=0,n=b.length;l<n;l++){var r=a[b[l][0]],q=a[b[l][1]],u=a[b[l][2]];s[l]=new THREE.Face3(r.index,q.index,u.index,[r.clone(),q.clone(),u.clone()])}l=0;for(n=s.length;l<n;l++)g(s[l],d);l=0;for(n=this.faceVertexUvs[0].length;l<n;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,s=b[2].x,r=Math.max(d,Math.max(a,s)),
 q=Math.min(d,Math.min(a,s)),0.9<r&&0.1>q&&(0.2>d&&(b[0].x+=1),0.2>a&&(b[1].x+=1),0.2>s&&(b[2].x+=1));l=0;for(n=this.vertices.length;l<n;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.IcosahedronGeometry=function(a,b){this.radius=a;this.detail=b;var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[[-1,c,0],[1,c,0],[-1,-c,0],[1,-c,0],[0,-1,c],[0,1,c],[0,-1,-c],[0,1,-c],[c,0,-1],[c,0,1],[-c,0,-1],[-c,0,1]],[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]],a,b)};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],[[0,2,4],[0,4,3],[0,3,5],[0,5,2],[1,2,5],[1,5,3],[1,3,4],[1,4,2]],a,b)};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,1,1],[-1,-1,1],[-1,1,-1],[1,-1,-1]],[[2,1,0],[0,3,2],[1,3,0],[2,3,1]],a,b)};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,n=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var s,r,q,u;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*n+h,d=g*n+h+1,l=(g+1)*n+h+1,k=(g+1)*n+h,s=new THREE.Vector2(h/b,g/c),r=new THREE.Vector2((h+1)/b,g/c),q=new THREE.Vector2((h+1)/b,(g+1)/c),u=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,d,k)),f.push([s,r,u]),e.push(new THREE.Face3(d,l,k)),
 q=Math.min(d,Math.min(a,s)),0.9<r&&0.1>q&&(0.2>d&&(b[0].x+=1),0.2>a&&(b[1].x+=1),0.2>s&&(b[2].x+=1));l=0;for(n=this.vertices.length;l<n;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.IcosahedronGeometry=function(a,b){this.radius=a;this.detail=b;var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[[-1,c,0],[1,c,0],[-1,-c,0],[1,-c,0],[0,-1,c],[0,1,c],[0,-1,-c],[0,1,-c],[c,0,-1],[c,0,1],[-c,0,-1],[-c,0,1]],[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]],a,b)};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],[[0,2,4],[0,4,3],[0,3,5],[0,5,2],[1,2,5],[1,5,3],[1,3,4],[1,4,2]],a,b)};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,1,1],[-1,-1,1],[-1,1,-1],[1,-1,-1]],[[2,1,0],[0,3,2],[1,3,0],[2,3,1]],a,b)};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,n=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var s,r,q,u;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*n+h,d=g*n+h+1,l=(g+1)*n+h+1,k=(g+1)*n+h,s=new THREE.Vector2(h/b,g/c),r=new THREE.Vector2((h+1)/b,g/c),q=new THREE.Vector2((h+1)/b,(g+1)/c),u=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,d,k)),f.push([s,r,u]),e.push(new THREE.Face3(d,l,k)),
 f.push([r.clone(),q,u.clone()]);this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.AxisHelper=function(a){a=a||1;var b=new THREE.Geometry;b.vertices.push(new THREE.Vector3,new THREE.Vector3(a,0,0),new THREE.Vector3,new THREE.Vector3(0,a,0),new THREE.Vector3,new THREE.Vector3(0,0,a));b.colors.push(new THREE.Color(16711680),new THREE.Color(16755200),new THREE.Color(65280),new THREE.Color(11206400),new THREE.Color(255),new THREE.Color(43775));a=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,b,a,THREE.LinePieces)};
 f.push([r.clone(),q,u.clone()]);this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.AxisHelper=function(a){a=a||1;var b=new THREE.Geometry;b.vertices.push(new THREE.Vector3,new THREE.Vector3(a,0,0),new THREE.Vector3,new THREE.Vector3(0,a,0),new THREE.Vector3,new THREE.Vector3(0,0,a));b.colors.push(new THREE.Color(16711680),new THREE.Color(16755200),new THREE.Color(65280),new THREE.Color(11206400),new THREE.Color(255),new THREE.Color(43775));a=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,b,a,THREE.LinePieces)};