Browse Source

Updated builds.

Mr.doob 11 years ago
parent
commit
d3fe8399bf
2 changed files with 180 additions and 182 deletions
  1. 11 13
      build/three.js
  2. 169 169
      build/three.min.js

+ 11 - 13
build/three.js

@@ -7183,9 +7183,15 @@ THREE.EventDispatcher.prototype = {
 
 				if ( attributes.index !== undefined ) {
 
-					var offsets = geometry.offsets;
 					var indices = attributes.index.array;
 					var positions = attributes.position.array;
+					var offsets = geometry.offsets;
+
+					if ( offsets.length === 0 ) {
+
+						offsets = [ { start: 0, count: positions.length, index: 0 } ];
+
+					}
 
 					for ( var oi = 0, ol = offsets.length; oi < ol; ++oi ) {
 
@@ -32541,10 +32547,6 @@ THREE.CircleGeometry = function ( radius, segments, thetaStart, thetaLength ) {
 
 	for ( var i = 0; i <= segments; i ++ ) {
 
-		indices[ offset     ] = i + 1;
-		indices[ offset + 1 ] = i + 2;
-		indices[ offset + 2 ] = 0;
-
 		var segment = thetaStart + i / segments * thetaLength;
 
 		var x = radius * Math.cos( segment );
@@ -32558,19 +32560,15 @@ THREE.CircleGeometry = function ( radius, segments, thetaStart, thetaLength ) {
 		uvs[ offset2     ] = ( x / radius + 1 ) / 2;
 		uvs[ offset2 + 1 ] = ( y / radius + 1 ) / 2;
 
+		indices[ offset     ] = i + 1;
+		indices[ offset + 1 ] = i + 2;
+		indices[ offset + 2 ] = 0;
+
 		offset += 3;
 		offset2 += 2;
 
 	}
 
-	for ( var i = 1; i <= segments; i ++ ) {
-
-		indices[ offset     ] = i;
-		indices[ offset + 1 ] = i + 1;
-		indices[ offset + 2 ] = 0;
-
-	}
-
 	this.attributes[ 'index' ] = { array: indices, itemSize: 1 };
 	this.attributes[ 'position' ] = { array: vertices, itemSize: 3 };
 	this.attributes[ 'normal' ] = { array: normals, itemSize: 3 };

+ 169 - 169
build/three.min.js

@@ -95,8 +95,8 @@ a instanceof THREE.Euler&&console.error("ERROR: Matrix's .makeRotationFromEuler(
 f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=n+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,l=d*h,n=d*e,b[0]=a-n*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=f*h,b[9]=n-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,l=c*h,n=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+n,b[1]=g*e,b[5]=n*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=
 g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("DEPRECATED: Matrix4's .setRotationFromQuaternion() has been deprecated in favor of makeRotationFromQuaternion.  Please update your code.");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*
 h,c=c*k,n=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(n+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=
-a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Matrix4's .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],n=c[5],r=c[9],p=c[13],s=c[2],u=c[6],q=c[10],w=c[14],v=c[3],t=c[7],x=c[11],
-c=c[15],F=d[0],z=d[4],N=d[8],H=d[12],E=d[1],L=d[5],B=d[9],C=d[13],O=d[2],D=d[6],A=d[10],y=d[14],K=d[3],G=d[7],Q=d[11],d=d[15];e[0]=f*F+g*E+h*O+k*K;e[4]=f*z+g*L+h*D+k*G;e[8]=f*N+g*B+h*A+k*Q;e[12]=f*H+g*C+h*y+k*d;e[1]=l*F+n*E+r*O+p*K;e[5]=l*z+n*L+r*D+p*G;e[9]=l*N+n*B+r*A+p*Q;e[13]=l*H+n*C+r*y+p*d;e[2]=s*F+u*E+q*O+w*K;e[6]=s*z+u*L+q*D+w*G;e[10]=s*N+u*B+q*A+w*Q;e[14]=s*H+u*C+q*y+w*d;e[3]=v*F+t*E+x*O+c*K;e[7]=v*z+t*L+x*D+c*G;e[11]=v*N+t*B+x*A+c*Q;e[15]=v*H+t*C+x*y+c*d;return this},multiplyToArray:function(a,
+a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Matrix4's .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],n=c[5],r=c[9],p=c[13],s=c[2],u=c[6],q=c[10],w=c[14],v=c[3],t=c[7],y=c[11],
+c=c[15],E=d[0],x=d[4],L=d[8],A=d[12],D=d[1],M=d[5],z=d[9],G=d[13],P=d[2],C=d[6],B=d[10],F=d[14],K=d[3],H=d[7],Q=d[11],d=d[15];e[0]=f*E+g*D+h*P+k*K;e[4]=f*x+g*M+h*C+k*H;e[8]=f*L+g*z+h*B+k*Q;e[12]=f*A+g*G+h*F+k*d;e[1]=l*E+n*D+r*P+p*K;e[5]=l*x+n*M+r*C+p*H;e[9]=l*L+n*z+r*B+p*Q;e[13]=l*A+n*G+r*F+p*d;e[2]=s*E+u*D+q*P+w*K;e[6]=s*x+u*M+q*C+w*H;e[10]=s*L+u*z+q*B+w*Q;e[14]=s*A+u*G+q*F+w*d;e[3]=v*E+t*D+y*P+c*K;e[7]=v*x+t*M+y*C+c*H;e[11]=v*L+t*z+y*B+c*Q;e[15]=v*A+t*G+y*F+c*d;return this},multiplyToArray:function(a,
 b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
 return a.applyProjection(this)},multiplyVector4:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b){for(var c=0,d=b.length;c<
 d;c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("DEPRECATED: Matrix4's .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("DEPRECATED: Matrix4's .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],
@@ -146,13 +146,13 @@ a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.Eve
 THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&
 c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;e<d;e++)c[e]=b[e];for(e=0;e<d;e++)c[e].call(this,a)}}}};(function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c);this.near=d||0;this.far=e||Infinity};var b=new a.Sphere,c=new a.Ray;new a.Plane;new a.Vector3;var d=new a.Vector3,e=new a.Matrix4,f=function(a,b){return a.distance-b.distance},g=new a.Vector3,h=new a.Vector3,k=new a.Vector3,l=function(f,n,s){if(f instanceof a.Sprite){d.setFromMatrixPosition(f.matrixWorld);var u=n.ray.distanceToPoint(d);if(u>f.scale.x)return s;s.push({distance:u,point:f.position,face:null,object:f})}else if(f instanceof
 a.LOD)d.setFromMatrixPosition(f.matrixWorld),u=n.ray.origin.distanceTo(d),l(f.getObjectForDistance(u),n,s);else if(f instanceof a.Mesh){var q=f.geometry;null===q.boundingSphere&&q.computeBoundingSphere();b.copy(q.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===n.ray.isIntersectionSphere(b))return s;e.getInverse(f.matrixWorld);c.copy(n.ray).applyMatrix4(e);if(null!==q.boundingBox&&!1===c.isIntersectionBox(q.boundingBox))return s;if(q instanceof a.BufferGeometry){var w=f.material;if(void 0===
-w)return s;var v=q.attributes,t,x,F=n.precision;if(void 0!==v.index)for(var z=q.offsets,N=v.index.array,H=v.position.array,E=0,L=z.length;E<L;++E)for(var v=z[E].start,B=z[E].index,q=v,C=v+z[E].count;q<C;q+=3){v=B+N[q];t=B+N[q+1];x=B+N[q+2];g.set(H[3*v],H[3*v+1],H[3*v+2]);h.set(H[3*t],H[3*t+1],H[3*t+2]);k.set(H[3*x],H[3*x+1],H[3*x+2]);var O=w.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,w.side!==a.DoubleSide);null!==O&&(O.applyMatrix4(f.matrixWorld),u=n.ray.origin.distanceTo(O),
-u<F||u<n.near||u>n.far||s.push({distance:u,point:O,indices:[v,t,x],face:null,faceIndex:null,object:f}))}else for(H=v.position.array,q=0,C=v.position.array.length;q<C;q+=3)v=q,t=q+1,x=q+2,g.set(H[3*v],H[3*v+1],H[3*v+2]),h.set(H[3*t],H[3*t+1],H[3*t+2]),k.set(H[3*x],H[3*x+1],H[3*x+2]),O=w.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,w.side!==a.DoubleSide),null!==O&&(O.applyMatrix4(f.matrixWorld),u=n.ray.origin.distanceTo(O),u<F||u<n.near||u>n.far||s.push({distance:u,point:O,
-indices:[v,t,x],face:null,faceIndex:null,object:f}))}else if(q instanceof a.Geometry)for(N=f.material instanceof a.MeshFaceMaterial,H=!0===N?f.material.materials:null,F=n.precision,z=q.vertices,E=0,L=q.faces.length;E<L;E++)if(B=q.faces[E],w=!0===N?H[B.materialIndex]:f.material,void 0!==w){v=z[B.a];t=z[B.b];x=z[B.c];if(!0===w.morphTargets){u=q.morphTargets;O=f.morphTargetInfluences;g.set(0,0,0);h.set(0,0,0);k.set(0,0,0);for(var C=0,D=u.length;C<D;C++){var A=O[C];if(0!==A){var y=u[C].vertices;g.x+=
-(y[B.a].x-v.x)*A;g.y+=(y[B.a].y-v.y)*A;g.z+=(y[B.a].z-v.z)*A;h.x+=(y[B.b].x-t.x)*A;h.y+=(y[B.b].y-t.y)*A;h.z+=(y[B.b].z-t.z)*A;k.x+=(y[B.c].x-x.x)*A;k.y+=(y[B.c].y-x.y)*A;k.z+=(y[B.c].z-x.z)*A}}g.add(v);h.add(t);k.add(x);v=g;t=h;x=k}O=w.side===a.BackSide?c.intersectTriangle(x,t,v,!0):c.intersectTriangle(v,t,x,w.side!==a.DoubleSide);null!==O&&(O.applyMatrix4(f.matrixWorld),u=n.ray.origin.distanceTo(O),u<F||u<n.near||u>n.far||s.push({distance:u,point:O,face:B,faceIndex:E,object:f}))}}else if(f instanceof
-a.Line){F=n.linePrecision;w=F*F;q=f.geometry;null===q.boundingSphere&&q.computeBoundingSphere();b.copy(q.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===n.ray.isIntersectionSphere(b))return s;e.getInverse(f.matrixWorld);c.copy(n.ray).applyMatrix4(e);if(q instanceof a.Geometry)for(z=q.vertices,F=z.length,v=new a.Vector3,t=new a.Vector3,x=f.type===a.LineStrip?1:2,q=0;q<F-1;q+=x)c.distanceSqToSegment(z[q],z[q+1],t,v)>w||(u=c.origin.distanceTo(t),u<n.near||u>n.far||s.push({distance:u,point:v.clone().applyMatrix4(f.matrixWorld),
-face:null,faceIndex:null,object:f}))}},n=function(a,b,c){a=a.getDescendants();for(var d=0,e=a.length;d<e;d++)l(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b)};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===b&&n(a,this,c);l(a,this,c);c.sort(f);return c};a.Raycaster.prototype.intersectObjects=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)l(a[d],this,c),!0===b&&n(a[d],this,c);c.sort(f);
-return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this._rotation=new THREE.Euler;this._quaternion=new THREE.Quaternion;this.scale=new THREE.Vector3(1,1,1);this._rotation._quaternion=this.quaternion;this._quaternion._euler=this.rotation;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;
+w)return s;var v=q.attributes,t,y,E=n.precision;if(void 0!==v.index){var x=v.index.array,L=v.position.array,A=q.offsets;0===A.length&&(A=[{start:0,count:L.length,index:0}]);for(var D=0,M=A.length;D<M;++D)for(var v=A[D].start,z=A[D].index,q=v,G=v+A[D].count;q<G;q+=3){v=z+x[q];t=z+x[q+1];y=z+x[q+2];g.set(L[3*v],L[3*v+1],L[3*v+2]);h.set(L[3*t],L[3*t+1],L[3*t+2]);k.set(L[3*y],L[3*y+1],L[3*y+2]);var P=w.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,w.side!==a.DoubleSide);null!==
+P&&(P.applyMatrix4(f.matrixWorld),u=n.ray.origin.distanceTo(P),u<E||u<n.near||u>n.far||s.push({distance:u,point:P,indices:[v,t,y],face:null,faceIndex:null,object:f}))}}else for(L=v.position.array,q=0,G=v.position.array.length;q<G;q+=3)v=q,t=q+1,y=q+2,g.set(L[3*v],L[3*v+1],L[3*v+2]),h.set(L[3*t],L[3*t+1],L[3*t+2]),k.set(L[3*y],L[3*y+1],L[3*y+2]),P=w.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,w.side!==a.DoubleSide),null!==P&&(P.applyMatrix4(f.matrixWorld),u=n.ray.origin.distanceTo(P),
+u<E||u<n.near||u>n.far||s.push({distance:u,point:P,indices:[v,t,y],face:null,faceIndex:null,object:f}))}else if(q instanceof a.Geometry)for(L=f.material instanceof a.MeshFaceMaterial,A=!0===L?f.material.materials:null,E=n.precision,x=q.vertices,D=0,M=q.faces.length;D<M;D++)if(z=q.faces[D],w=!0===L?A[z.materialIndex]:f.material,void 0!==w){v=x[z.a];t=x[z.b];y=x[z.c];if(!0===w.morphTargets){u=q.morphTargets;P=f.morphTargetInfluences;g.set(0,0,0);h.set(0,0,0);k.set(0,0,0);for(var G=0,C=u.length;G<C;G++){var B=
+P[G];if(0!==B){var F=u[G].vertices;g.x+=(F[z.a].x-v.x)*B;g.y+=(F[z.a].y-v.y)*B;g.z+=(F[z.a].z-v.z)*B;h.x+=(F[z.b].x-t.x)*B;h.y+=(F[z.b].y-t.y)*B;h.z+=(F[z.b].z-t.z)*B;k.x+=(F[z.c].x-y.x)*B;k.y+=(F[z.c].y-y.y)*B;k.z+=(F[z.c].z-y.z)*B}}g.add(v);h.add(t);k.add(y);v=g;t=h;y=k}P=w.side===a.BackSide?c.intersectTriangle(y,t,v,!0):c.intersectTriangle(v,t,y,w.side!==a.DoubleSide);null!==P&&(P.applyMatrix4(f.matrixWorld),u=n.ray.origin.distanceTo(P),u<E||u<n.near||u>n.far||s.push({distance:u,point:P,face:z,
+faceIndex:D,object:f}))}}else if(f instanceof a.Line){E=n.linePrecision;w=E*E;q=f.geometry;null===q.boundingSphere&&q.computeBoundingSphere();b.copy(q.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===n.ray.isIntersectionSphere(b))return s;e.getInverse(f.matrixWorld);c.copy(n.ray).applyMatrix4(e);if(q instanceof a.Geometry)for(x=q.vertices,E=x.length,v=new a.Vector3,t=new a.Vector3,y=f.type===a.LineStrip?1:2,q=0;q<E-1;q+=y)c.distanceSqToSegment(x[q],x[q+1],t,v)>w||(u=c.origin.distanceTo(t),u<
+n.near||u>n.far||s.push({distance:u,point:v.clone().applyMatrix4(f.matrixWorld),face:null,faceIndex:null,object:f}))}},n=function(a,b,c){a=a.getDescendants();for(var d=0,e=a.length;d<e;d++)l(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b)};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===b&&n(a,this,c);l(a,this,c);c.sort(f);return c};a.Raycaster.prototype.intersectObjects=function(a,b){for(var c=
+[],d=0,e=a.length;d<e;d++)l(a[d],this,c),!0===b&&n(a[d],this,c);c.sort(f);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this._rotation=new THREE.Euler;this._quaternion=new THREE.Quaternion;this.scale=new THREE.Vector3(1,1,1);this._rotation._quaternion=this.quaternion;this._quaternion._euler=this.rotation;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;
 this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};
 THREE.Object3D.prototype={constructor:THREE.Object3D,get rotation(){return this._rotation},set rotation(a){this._rotation=a;this._rotation._quaternion=this._quaternion;this._quaternion._euler=this._rotation;this._rotation._updateQuaternion()},get quaternion(){return this._quaternion},set quaternion(a){this._quaternion=a;this._quaternion._euler=this._rotation;this._rotation._quaternion=this._quaternion;this._quaternion._updateEuler()},get eulerOrder(){console.warn("DEPRECATED: Object3D's .eulerOrder has been moved to Object3D's .rotation.order.");
 return this.rotation.order},set eulerOrder(a){console.warn("DEPRECATED: Object3D's .eulerOrder has been moved to Object3D's .rotation.order.");this.rotation.order=a},get useQuaternion(){console.warn("DEPRECATED: Object3D's .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){console.warn("DEPRECATED: Object3D's .useQuaternion has been removed. The library now uses quaternions by default.")},applyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix);
@@ -164,23 +164,23 @@ this.children.indexOf(a);if(-1!==b){a.parent=void 0;a.dispatchEvent({type:"remov
 b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];if(e.name===a||!0===b&&(e=e.getObjectByName(a,b),void 0!==e))return e}},getChildByName:function(a,b){console.warn("DEPRECATED: Object3D's .getChildByName() has been renamed to .getObjectByName().");return this.getObjectByName(a,b)},getDescendants:function(a){void 0===a&&(a=[]);Array.prototype.push.apply(a,this.children);for(var b=0,c=this.children.length;b<c;b++)this.children[b].getDescendants(a);return a},updateMatrix:function(){this.matrix.compose(this.position,
 this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);
 a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));
-if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(n===p){var a=new THREE.RenderableVertex;r.push(a);p++;n++;return a}return r[n++]}function b(){if(u===w){var a=new THREE.RenderableFace;q.push(a);w++;u++;return a}return q[u++]}function c(){if(t===F){var a=new THREE.RenderableLine;x.push(a);F++;t++;return a}return x[t++]}function d(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function e(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&
-0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var f,g,h=[],k=0,l,n,r=[],p=0,s,u,q=[],w=0,v,t,x=[],F=0,z,N,H=[],E=0,L={objects:[],lights:[],elements:[]},B=new THREE.Vector3,C=new THREE.Vector3,O=new THREE.Vector3,D=new THREE.Vector3,A=new THREE.Vector4,y=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),K=new THREE.Box3,G=Array(3),Q=new THREE.Matrix4,Y=
+if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(n===p){var a=new THREE.RenderableVertex;r.push(a);p++;n++;return a}return r[n++]}function b(){if(u===w){var a=new THREE.RenderableFace;q.push(a);w++;u++;return a}return q[u++]}function c(){if(t===E){var a=new THREE.RenderableLine;y.push(a);E++;t++;return a}return y[t++]}function d(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function e(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&
+0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var f,g,h=[],k=0,l,n,r=[],p=0,s,u,q=[],w=0,v,t,y=[],E=0,x,L,A=[],D=0,M={objects:[],lights:[],elements:[]},z=new THREE.Vector3,G=new THREE.Vector3,P=new THREE.Vector3,C=new THREE.Vector3,B=new THREE.Vector4,F=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),K=new THREE.Box3,H=Array(3),Q=new THREE.Matrix4,Y=
 new THREE.Matrix4,R,ka=new THREE.Matrix4,da=new THREE.Matrix3,X=new THREE.Frustum,J=new THREE.Vector4,S=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 fa=function(a){if(!1!==a.visible){if(a instanceof THREE.Light)L.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===X.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:
-(D.setFromMatrixPosition(a.matrixWorld),D.applyProjection(Y),f.z=D.z);L.objects.push(f)}for(var b=0,c=a.children.length;b<c;b++)fa(a.children[b])}},I=new function(){var d=[],e=[],f=null,g=null,h=new THREE.Matrix3,k=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(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},n=function(a,b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;G[0]=
-a.positionScreen;G[1]=b.positionScreen;G[2]=c.positionScreen;return y.isIntersectionBox(K.setFromPoints(G))},q=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:n,checkBackfaceCulling:q,pushVertex:function(b,c,d){l=a();l.position.set(b,
-c,d);k(l)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=r[a],e=r[b];v=c();v.id=f.id;v.v1.copy(d);v.v2.copy(e);v.z=(d.positionScreen.z+e.positionScreen.z)/2;v.material=f.material;L.elements.push(v)},pushTriangle:function(a,c,k){var l=r[a],p=r[c],u=r[k];if(!1!==n(l,p,u)&&(g.side===THREE.DoubleSide||!0===q(l,p,u))){s=b();s.id=f.id;s.v1.copy(l);s.v2.copy(p);s.v3.copy(u);s.z=(l.positionScreen.z+p.positionScreen.z+u.positionScreen.z)/3;for(l=0;3>
-l;l++)p=3*arguments[l],u=s.vertexNormalsModel[l],u.set(d[p],d[p+1],d[p+2]),u.applyMatrix3(h).normalize(),p=2*arguments[l],s.uvs[l].set(e[p],e[p+1]);s.vertexNormalsLength=3;s.material=f.material;L.elements.push(s)}}}};this.projectScene=function(f,h,k,l){var q,p,w,x,F,D,y,G;N=t=u=0;L.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);X.setFromMatrix(Y);g=0;
-L.objects.length=0;L.lights.length=0;fa(f);!0===k&&L.objects.sort(d);f=0;for(k=L.objects.length;f<k;f++)if(q=L.objects[f].object,p=q.geometry,I.setObject(q),R=q.matrixWorld,n=0,q instanceof THREE.Mesh)if(p instanceof THREE.BufferGeometry){if(D=p.attributes,q=p.offsets,void 0!==D.position){y=D.position.array;p=0;for(x=y.length;p<x;p+=3)I.pushVertex(y[p],y[p+1],y[p+2]);if(void 0!==D.normal)for(G=D.normal.array,p=0,x=G.length;p<x;p+=3)I.pushNormal(G[p],G[p+1],G[p+2]);if(void 0!==D.uv)for(G=D.uv.array,
-p=0,x=G.length;p<x;p+=2)I.pushUv(G[p],G[p+1]);if(void 0!==D.index)if(D=D.index.array,0<q.length)for(f=0;f<q.length;f++)for(x=q[f],y=x.index,p=x.start,x=x.start+x.count;p<x;p+=3)I.pushTriangle(D[p]+y,D[p+1]+y,D[p+2]+y);else for(p=0,x=D.length;p<x;p+=3)I.pushTriangle(D[p],D[p+1],D[p+2]);else for(p=0,x=y.length/3;p<x;p+=3)I.pushTriangle(p,p+1,p+2)}}else{if(p instanceof THREE.Geometry){w=p.vertices;x=p.faces;D=p.faceVertexUvs[0];da.getNormalMatrix(R);y=q.material instanceof THREE.MeshFaceMaterial;G=!0===
-y?q.material:null;for(var K=0,Ea=w.length;K<Ea;K++){var ga=w[K];I.pushVertex(ga.x,ga.y,ga.z)}K=0;for(Ea=x.length;K<Ea;K++){w=x[K];var ua=!0===y?G.materials[w.materialIndex]:q.material;if(void 0!==ua){var ca=ua.side,ga=r[w.a],V=r[w.b],qa=r[w.c];if(!0===ua.morphTargets){F=p.morphTargets;var Fa=q.morphTargetInfluences,xa=ga.position,Ja=V.position,Ba=qa.position;B.set(0,0,0);C.set(0,0,0);O.set(0,0,0);for(var Ka=0,ha=F.length;Ka<ha;Ka++){var la=Fa[Ka];if(0!==la){var ma=F[Ka].vertices;B.x+=(ma[w.a].x-xa.x)*
-la;B.y+=(ma[w.a].y-xa.y)*la;B.z+=(ma[w.a].z-xa.z)*la;C.x+=(ma[w.b].x-Ja.x)*la;C.y+=(ma[w.b].y-Ja.y)*la;C.z+=(ma[w.b].z-Ja.z)*la;O.x+=(ma[w.c].x-Ba.x)*la;O.y+=(ma[w.c].y-Ba.y)*la;O.z+=(ma[w.c].z-Ba.z)*la}}ga.position.add(B);V.position.add(C);qa.position.add(O);I.projectVertex(ga);I.projectVertex(V);I.projectVertex(qa)}if(!1!==I.checkTriangleVisibility(ga,V,qa)){Fa=I.checkBackfaceCulling(ga,V,qa);if(ca!==THREE.DoubleSide){if(ca===THREE.FrontSide&&!1===Fa)continue;if(ca===THREE.BackSide&&!0===Fa)continue}s=
-b();s.id=q.id;s.v1.copy(ga);s.v2.copy(V);s.v3.copy(qa);s.normalModel.copy(w.normal);!1!==Fa||ca!==THREE.BackSide&&ca!==THREE.DoubleSide||s.normalModel.negate();s.normalModel.applyMatrix3(da).normalize();F=w.vertexNormals;xa=0;for(Ja=Math.min(F.length,3);xa<Ja;xa++)Ba=s.vertexNormalsModel[xa],Ba.copy(F[xa]),!1!==Fa||ca!==THREE.BackSide&&ca!==THREE.DoubleSide||Ba.negate(),Ba.applyMatrix3(da).normalize();s.vertexNormalsLength=F.length;ca=D[K];if(void 0!==ca)for(F=0;3>F;F++)s.uvs[F].copy(ca[F]);s.color=
-w.color;s.material=ua;s.z=(ga.positionScreen.z+V.positionScreen.z+qa.positionScreen.z)/3;L.elements.push(s)}}}}}else if(q instanceof THREE.Line)if(p instanceof THREE.BufferGeometry){if(D=p.attributes,void 0!==D.position){y=D.position.array;p=0;for(x=y.length;p<x;p+=3)I.pushVertex(y[p],y[p+1],y[p+2]);if(void 0!==D.index)for(D=D.index.array,p=0,x=D.length;p<x;p+=2)I.pushLine(D[p],D[p+1]);else for(p=0,x=y.length/3-1;p<x;p++)I.pushLine(p,p+1)}}else{if(p instanceof THREE.Geometry&&(ka.multiplyMatrices(Y,
+-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 fa=function(a){if(!1!==a.visible){if(a instanceof THREE.Light)M.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===X.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:
+(C.setFromMatrixPosition(a.matrixWorld),C.applyProjection(Y),f.z=C.z);M.objects.push(f)}for(var b=0,c=a.children.length;b<c;b++)fa(a.children[b])}},I=new function(){var d=[],e=[],f=null,g=null,h=new THREE.Matrix3,k=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(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},n=function(a,b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;H[0]=
+a.positionScreen;H[1]=b.positionScreen;H[2]=c.positionScreen;return F.isIntersectionBox(K.setFromPoints(H))},q=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:n,checkBackfaceCulling:q,pushVertex:function(b,c,d){l=a();l.position.set(b,
+c,d);k(l)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=r[a],e=r[b];v=c();v.id=f.id;v.v1.copy(d);v.v2.copy(e);v.z=(d.positionScreen.z+e.positionScreen.z)/2;v.material=f.material;M.elements.push(v)},pushTriangle:function(a,c,k){var l=r[a],p=r[c],u=r[k];if(!1!==n(l,p,u)&&(g.side===THREE.DoubleSide||!0===q(l,p,u))){s=b();s.id=f.id;s.v1.copy(l);s.v2.copy(p);s.v3.copy(u);s.z=(l.positionScreen.z+p.positionScreen.z+u.positionScreen.z)/3;for(l=0;3>
+l;l++)p=3*arguments[l],u=s.vertexNormalsModel[l],u.set(d[p],d[p+1],d[p+2]),u.applyMatrix3(h).normalize(),p=2*arguments[l],s.uvs[l].set(e[p],e[p+1]);s.vertexNormalsLength=3;s.material=f.material;M.elements.push(s)}}}};this.projectScene=function(f,h,k,l){var q,p,w,y,E,C,F,H;L=t=u=0;M.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);X.setFromMatrix(Y);g=0;
+M.objects.length=0;M.lights.length=0;fa(f);!0===k&&M.objects.sort(d);f=0;for(k=M.objects.length;f<k;f++)if(q=M.objects[f].object,p=q.geometry,I.setObject(q),R=q.matrixWorld,n=0,q instanceof THREE.Mesh)if(p instanceof THREE.BufferGeometry){if(C=p.attributes,q=p.offsets,void 0!==C.position){F=C.position.array;p=0;for(y=F.length;p<y;p+=3)I.pushVertex(F[p],F[p+1],F[p+2]);if(void 0!==C.normal)for(H=C.normal.array,p=0,y=H.length;p<y;p+=3)I.pushNormal(H[p],H[p+1],H[p+2]);if(void 0!==C.uv)for(H=C.uv.array,
+p=0,y=H.length;p<y;p+=2)I.pushUv(H[p],H[p+1]);if(void 0!==C.index)if(C=C.index.array,0<q.length)for(f=0;f<q.length;f++)for(y=q[f],F=y.index,p=y.start,y=y.start+y.count;p<y;p+=3)I.pushTriangle(C[p]+F,C[p+1]+F,C[p+2]+F);else for(p=0,y=C.length;p<y;p+=3)I.pushTriangle(C[p],C[p+1],C[p+2]);else for(p=0,y=F.length/3;p<y;p+=3)I.pushTriangle(p,p+1,p+2)}}else{if(p instanceof THREE.Geometry){w=p.vertices;y=p.faces;C=p.faceVertexUvs[0];da.getNormalMatrix(R);F=q.material instanceof THREE.MeshFaceMaterial;H=!0===
+F?q.material:null;for(var K=0,Ea=w.length;K<Ea;K++){var ga=w[K];I.pushVertex(ga.x,ga.y,ga.z)}K=0;for(Ea=y.length;K<Ea;K++){w=y[K];var ua=!0===F?H.materials[w.materialIndex]:q.material;if(void 0!==ua){var ca=ua.side,ga=r[w.a],V=r[w.b],qa=r[w.c];if(!0===ua.morphTargets){E=p.morphTargets;var Fa=q.morphTargetInfluences,xa=ga.position,Ja=V.position,Ba=qa.position;z.set(0,0,0);G.set(0,0,0);P.set(0,0,0);for(var Ka=0,ha=E.length;Ka<ha;Ka++){var la=Fa[Ka];if(0!==la){var ma=E[Ka].vertices;z.x+=(ma[w.a].x-xa.x)*
+la;z.y+=(ma[w.a].y-xa.y)*la;z.z+=(ma[w.a].z-xa.z)*la;G.x+=(ma[w.b].x-Ja.x)*la;G.y+=(ma[w.b].y-Ja.y)*la;G.z+=(ma[w.b].z-Ja.z)*la;P.x+=(ma[w.c].x-Ba.x)*la;P.y+=(ma[w.c].y-Ba.y)*la;P.z+=(ma[w.c].z-Ba.z)*la}}ga.position.add(z);V.position.add(G);qa.position.add(P);I.projectVertex(ga);I.projectVertex(V);I.projectVertex(qa)}if(!1!==I.checkTriangleVisibility(ga,V,qa)){Fa=I.checkBackfaceCulling(ga,V,qa);if(ca!==THREE.DoubleSide){if(ca===THREE.FrontSide&&!1===Fa)continue;if(ca===THREE.BackSide&&!0===Fa)continue}s=
+b();s.id=q.id;s.v1.copy(ga);s.v2.copy(V);s.v3.copy(qa);s.normalModel.copy(w.normal);!1!==Fa||ca!==THREE.BackSide&&ca!==THREE.DoubleSide||s.normalModel.negate();s.normalModel.applyMatrix3(da).normalize();E=w.vertexNormals;xa=0;for(Ja=Math.min(E.length,3);xa<Ja;xa++)Ba=s.vertexNormalsModel[xa],Ba.copy(E[xa]),!1!==Fa||ca!==THREE.BackSide&&ca!==THREE.DoubleSide||Ba.negate(),Ba.applyMatrix3(da).normalize();s.vertexNormalsLength=E.length;ca=C[K];if(void 0!==ca)for(E=0;3>E;E++)s.uvs[E].copy(ca[E]);s.color=
+w.color;s.material=ua;s.z=(ga.positionScreen.z+V.positionScreen.z+qa.positionScreen.z)/3;M.elements.push(s)}}}}}else if(q instanceof THREE.Line)if(p instanceof THREE.BufferGeometry){if(C=p.attributes,void 0!==C.position){F=C.position.array;p=0;for(y=F.length;p<y;p+=3)I.pushVertex(F[p],F[p+1],F[p+2]);if(void 0!==C.index)for(C=C.index.array,p=0,y=C.length;p<y;p+=2)I.pushLine(C[p],C[p+1]);else for(p=0,y=F.length/3-1;p<y;p++)I.pushLine(p,p+1)}}else{if(p instanceof THREE.Geometry&&(ka.multiplyMatrices(Y,
 R),w=q.geometry.vertices,0!==w.length))for(ga=a(),ga.positionScreen.copy(w[0]).applyMatrix4(ka),p=q.type===THREE.LinePieces?2:1,K=1,Ea=w.length;K<Ea;K++)ga=a(),ga.positionScreen.copy(w[K]).applyMatrix4(ka),0<(K+1)%p||(V=r[n-2],J.copy(ga.positionScreen),S.copy(V.positionScreen),!0===e(J,S)&&(J.multiplyScalar(1/J.w),S.multiplyScalar(1/S.w),v=c(),v.id=q.id,v.v1.positionScreen.copy(J),v.v2.positionScreen.copy(S),v.z=Math.max(J.z,S.z),v.material=q.material,q.material.vertexColors===THREE.VertexColors&&
-(v.vertexColors[0].copy(q.geometry.colors[K]),v.vertexColors[1].copy(q.geometry.colors[K-1])),L.elements.push(v)))}else q instanceof THREE.Sprite&&(A.set(R.elements[12],R.elements[13],R.elements[14],1),A.applyMatrix4(Y),p=1/A.w,A.z*=p,-1<=A.z&&1>=A.z&&(N===E?(x=new THREE.RenderableSprite,H.push(x),E++,N++,z=x):z=H[N++],z.id=q.id,z.x=A.x*p,z.y=A.y*p,z.z=A.z,z.object=q,z.rotation=q.rotation,z.scale.x=q.scale.x*Math.abs(z.x-(A.x+h.projectionMatrix.elements[0])/(A.w+h.projectionMatrix.elements[12])),
-z.scale.y=q.scale.y*Math.abs(z.y-(A.y+h.projectionMatrix.elements[5])/(A.w+h.projectionMatrix.elements[13])),z.material=q.material,L.elements.push(z)));!0===l&&L.elements.sort(d);return L}};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};
+(v.vertexColors[0].copy(q.geometry.colors[K]),v.vertexColors[1].copy(q.geometry.colors[K-1])),M.elements.push(v)))}else q instanceof THREE.Sprite&&(B.set(R.elements[12],R.elements[13],R.elements[14],1),B.applyMatrix4(Y),p=1/B.w,B.z*=p,-1<=B.z&&1>=B.z&&(L===D?(y=new THREE.RenderableSprite,A.push(y),D++,L++,x=y):x=A[L++],x.id=q.id,x.x=B.x*p,x.y=B.y*p,x.z=B.z,x.object=q,x.rotation=q.rotation,x.scale.x=q.scale.x*Math.abs(x.x-(B.x+h.projectionMatrix.elements[0])/(B.w+h.projectionMatrix.elements[12])),
+x.scale.y=q.scale.y*Math.abs(x.y-(B.y+h.projectionMatrix.elements[5])/(B.w+h.projectionMatrix.elements[13])),x.material=q.material,M.elements.push(x)));!0===l&&M.elements.sort(d);return M}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0};
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}};THREE.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,g)};THREE.BufferAttribute=function(){};
 THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},set:function(a){this.array.set(a)},setX:function(a,b){this.array[a*this.itemSize]=b},setY:function(a,b){this.array[a*this.itemSize+1]=b},setZ:function(a,b){this.array[a*this.itemSize+2]=b},setXY:function(a,b,c){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d},setXYZW:function(a,b,c,d,e){a*=this.itemSize;
 this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e}};THREE.Int8Attribute=function(a,b){this.array=new Int8Array(a*b);this.itemSize=b};THREE.Int8Attribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.Uint8Attribute=function(a,b){this.array=new Uint8Array(a*b);this.itemSize=b};THREE.Uint8Attribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.Uint8ClampedAttribute=function(a,b){this.array=new Uint8ClampedArray(a*b);this.itemSize=b};
@@ -191,11 +191,11 @@ THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:fu
 b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0)},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var a=this.attributes.position.array;if(a){var b=this.boundingBox;3<=a.length&&(b.min.x=b.max.x=a[0],b.min.y=b.max.y=a[1],b.min.z=b.max.z=a[2]);for(var c=3,d=a.length;c<d;c+=3){var e=a[c],f=a[c+1],g=a[c+2];e<b.min.x?b.min.x=e:e>b.max.x&&(b.max.x=e);f<b.min.y?b.min.y=f:
 f>b.max.y&&(b.max.y=f);g<b.min.z?b.min.z=g:g>b.max.z&&(b.max.z=g)}}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)},computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.addPoint(b);a.center(d);for(var g=0,
 e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){if(this.attributes.position){var a,b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else for(a=0,b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0;var e=this.attributes.position.array,
-f=this.attributes.normal.array,g,h,k,l,n,r,p=new THREE.Vector3,s=new THREE.Vector3,u=new THREE.Vector3,q=new THREE.Vector3,w=new THREE.Vector3;if(this.attributes.index){var v=this.attributes.index.array,t=this.offsets;c=0;for(d=t.length;c<d;++c){b=t[c].start;g=t[c].count;var x=t[c].index;a=b;for(b+=g;a<b;a+=3)g=x+v[a],h=x+v[a+1],k=x+v[a+2],l=e[3*g],n=e[3*g+1],r=e[3*g+2],p.set(l,n,r),l=e[3*h],n=e[3*h+1],r=e[3*h+2],s.set(l,n,r),l=e[3*k],n=e[3*k+1],r=e[3*k+2],u.set(l,n,r),q.subVectors(u,s),w.subVectors(p,
+f=this.attributes.normal.array,g,h,k,l,n,r,p=new THREE.Vector3,s=new THREE.Vector3,u=new THREE.Vector3,q=new THREE.Vector3,w=new THREE.Vector3;if(this.attributes.index){var v=this.attributes.index.array,t=this.offsets;c=0;for(d=t.length;c<d;++c){b=t[c].start;g=t[c].count;var y=t[c].index;a=b;for(b+=g;a<b;a+=3)g=y+v[a],h=y+v[a+1],k=y+v[a+2],l=e[3*g],n=e[3*g+1],r=e[3*g+2],p.set(l,n,r),l=e[3*h],n=e[3*h+1],r=e[3*h+2],s.set(l,n,r),l=e[3*k],n=e[3*k+1],r=e[3*k+2],u.set(l,n,r),q.subVectors(u,s),w.subVectors(p,
 s),q.cross(w),f[3*g]+=q.x,f[3*g+1]+=q.y,f[3*g+2]+=q.z,f[3*h]+=q.x,f[3*h+1]+=q.y,f[3*h+2]+=q.z,f[3*k]+=q.x,f[3*k+1]+=q.y,f[3*k+2]+=q.z}}else for(a=0,b=e.length;a<b;a+=9)l=e[a],n=e[a+1],r=e[a+2],p.set(l,n,r),l=e[a+3],n=e[a+4],r=e[a+5],s.set(l,n,r),l=e[a+6],n=e[a+7],r=e[a+8],u.set(l,n,r),q.subVectors(u,s),w.subVectors(p,s),q.cross(w),f[a]=q.x,f[a+1]=q.y,f[a+2]=q.z,f[a+3]=q.x,f[a+4]=q.y,f[a+5]=q.z,f[a+6]=q.x,f[a+7]=q.y,f[a+8]=q.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){r=d[3*a];p=d[3*a+1];s=d[3*a+2];u=d[3*b];q=d[3*b+1];w=d[3*b+2];v=d[3*c];t=d[3*c+1];x=d[3*c+2];F=f[2*a];z=f[2*a+1];N=f[2*b];H=f[2*b+1];E=f[2*c];L=f[2*c+1];B=u-r;C=v-r;O=q-p;D=t-p;A=w-s;y=x-s;K=N-F;G=E-F;Q=H-z;Y=L-z;R=1/(K*Y-G*Q);ka.set((Y*B-Q*C)*R,(Y*O-Q*D)*R,(Y*A-Q*y)*R);da.set((K*C-G*B)*R,(K*D-G*O)*R,(K*y-G*A)*R);k[a].add(ka);
+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){r=d[3*a];p=d[3*a+1];s=d[3*a+2];u=d[3*b];q=d[3*b+1];w=d[3*b+2];v=d[3*c];t=d[3*c+1];y=d[3*c+2];E=f[2*a];x=f[2*a+1];L=f[2*b];A=f[2*b+1];D=f[2*c];M=f[2*c+1];z=u-r;G=v-r;P=q-p;C=t-p;B=w-s;F=y-s;K=L-E;H=D-E;Q=A-x;Y=M-x;R=1/(K*Y-H*Q);ka.set((Y*z-Q*G)*R,(Y*P-Q*C)*R,(Y*B-Q*F)*R);da.set((K*G-H*z)*R,(K*C-H*P)*R,(K*F-H*B)*R);k[a].add(ka);
 k[b].add(ka);k[c].add(ka);l[a].add(da);l[b].add(da);l[c].add(da)}function b(a){aa.x=e[3*a];aa.y=e[3*a+1];aa.z=e[3*a+2];Ga.copy(aa);Aa=k[a];T.copy(Aa);T.sub(aa.multiplyScalar(aa.dot(Aa))).normalize();wa.crossVectors(Ga,Aa);Ha=wa.dot(l[a]);Ia=0>Ha?-1:1;h[4*a]=T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=Ia}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
-else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent={itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var r,p,s,u,q,w,v,t,x,F,z,N,H,E,L,B,C,O,D,A,y,K,G,Q,Y,R,ka=new THREE.Vector3,da=new THREE.Vector3,X,J,S,fa,I,ia=this.offsets,n=0;for(J=ia.length;n<J;++n){X=
+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 r,p,s,u,q,w,v,t,y,E,x,L,A,D,M,z,G,P,C,B,F,K,H,Q,Y,R,ka=new THREE.Vector3,da=new THREE.Vector3,X,J,S,fa,I,ia=this.offsets,n=0;for(J=ia.length;n<J;++n){X=
 ia[n].start;S=ia[n].count;var ta=ia[n].index,g=X;for(X+=S;g<X;g+=3)S=ta+c[g],fa=ta+c[g+1],I=ta+c[g+2],a(S,fa,I)}var T=new THREE.Vector3,wa=new THREE.Vector3,aa=new THREE.Vector3,Ga=new THREE.Vector3,Ia,Aa,Ha,n=0;for(J=ia.length;n<J;++n)for(X=ia[n].start,S=ia[n].count,ta=ia[n].index,g=X,X+=S;g<X;g+=3)S=ta+c[g],fa=ta+c[g+1],I=ta+c[g+2],b(S),b(fa),b(I)}},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,r=new Int32Array(6),p=new Int32Array(c.length),s=new Int32Array(c.length),u=0;u<c.length;u++)p[u]=-1,s[u]=-1;for(c=0;c<d;c++){for(var q=n=0;3>q;q++)u=a[3*c+q],-1==p[u]?(r[2*q]=u,r[2*q+1]=-1,n++):p[u]<k.index?(r[2*q]=u,r[2*q+1]=-1,l++):(r[2*q]=u,r[2*q+1]=p[u]);if(g+n>k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)q=r[n+1],-1<q&&q<k.index&&(r[n+1]=-1);for(n=0;6>n;n+=2)u=r[n],q=r[n+1],-1===q&&(q=g++),
 p[u]=q,s[q]=u,e[f++]=q-k.index,k.count++}this.reorderBuffers(e,s,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,
@@ -207,9 +207,9 @@ computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=
 a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),k.subVectors(e,f),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=
 d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=
 this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<
-d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,n,r,p,s,u,q,w,v=[],t=[];c=new THREE.Vector3;var x=new THREE.Vector3,F=new THREE.Vector3,z=new THREE.Vector3,N=new THREE.Vector3;a=0;for(b=this.vertices.length;a<
-b;a++)v[a]=new THREE.Vector3,t[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,w=e.b,e=e.c,g=this.vertices[d],h=this.vertices[w],k=this.vertices[e],l=f[0],n=f[1],r=f[2],f=h.x-g.x,p=k.x-g.x,s=h.y-g.y,u=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-l.x,q=r.x-l.x,n=n.y-l.y,l=r.y-l.y,r=1/(k*l-q*n),c.set((l*f-n*p)*r,(l*s-n*u)*r,(l*h-n*g)*r),x.set((k*p-q*f)*r,(k*u-q*s)*r,(k*g-q*h)*r),v[d].add(c),v[w].add(c),v[e].add(c),t[d].add(x),t[w].add(x),t[e].add(x);x=
-["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)N.copy(e.vertexNormals[c]),d=e[x[c]],w=v[d],F.copy(w),F.sub(N.multiplyScalar(N.dot(w))).normalize(),z.crossVectors(e.vertexNormals[c],w),d=z.dot(t[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(F.x,F.y,F.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===
+d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,n,r,p,s,u,q,w,v=[],t=[];c=new THREE.Vector3;var y=new THREE.Vector3,E=new THREE.Vector3,x=new THREE.Vector3,L=new THREE.Vector3;a=0;for(b=this.vertices.length;a<
+b;a++)v[a]=new THREE.Vector3,t[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,w=e.b,e=e.c,g=this.vertices[d],h=this.vertices[w],k=this.vertices[e],l=f[0],n=f[1],r=f[2],f=h.x-g.x,p=k.x-g.x,s=h.y-g.y,u=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-l.x,q=r.x-l.x,n=n.y-l.y,l=r.y-l.y,r=1/(k*l-q*n),c.set((l*f-n*p)*r,(l*s-n*u)*r,(l*h-n*g)*r),y.set((k*p-q*f)*r,(k*u-q*s)*r,(k*g-q*h)*r),v[d].add(c),v[w].add(c),v[e].add(c),t[d].add(y),t[w].add(y),t[e].add(y);y=
+["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)L.copy(e.vertexNormals[c]),d=e[y[c]],w=v[d],E.copy(w),E.sub(L.multiplyScalar(L.dot(w))).normalize(),x.crossVectors(e.vertexNormals[c],w),d=x.dot(t[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(E.x,E.y,E.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===
 this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):
 c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=this.vertices.length-b.length;this.vertices=b;return f},makeGroups:function(){var a=0;return function(b,c){var d,e,f,g,h={},k=this.morphTargets.length,l=this.morphNormals.length;this.geometryGroups=
 {};d=0;for(e=this.faces.length;d<e;d++)f=this.faces[d],f=b?f.materialIndex:0,f in h||(h[f]={hash:f,counter:0}),g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(this.geometryGroups[g]={faces3:[],materialIndex:f,vertices:0,numMorphTargets:k,numMorphNormals:l}),this.geometryGroups[g].vertices+3>c&&(h[f].counter+=1,g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(this.geometryGroups[g]={faces3:[],materialIndex:f,vertices:0,numMorphTargets:k,numMorphNormals:l})),this.geometryGroups[g].faces3.push(d),
@@ -242,10 +242,10 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
 a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText);if(void 0!==h.metadata&&"scene"===h.metadata.type){console.error('THREE.JSONLoader: "'+b+'" seems to be a Scene. Use THREE.SceneLoader instead.');return}h=a.parse(h,d);c(h.geometry,h.materials)}else console.error('THREE.JSONLoader: "'+b+'" seems to be unreachable or the file is empty.');
 a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load \""+b+'" ('+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)};
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,n,r,p,s,u,q,w,v,t=a.faces;n=a.vertices;var x=a.normals,F=a.colors,z=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&z++;for(d=0;d<z;d++)c.faceVertexUvs[d]=[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=t.length;k<l;)if(b=t[k++],s=b&1,h=b&2,d=b&8,r=b&16,u=b&32,n=b&64,b&=128,s){s=new THREE.Face3;
-s.a=t[k];s.b=t[k+1];s.c=t[k+3];q=new THREE.Face3;q.a=t[k+1];q.b=t[k+2];q.c=t[k+3];k+=4;h&&(h=t[k++],s.materialIndex=h,q.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(w=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)p=t[k++],v=w[2*p],p=w[2*p+1],v=new THREE.Vector2(v,p),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);r&&(r=3*t[k++],s.normal.set(x[r++],x[r++],x[r]),q.normal.copy(s.normal));if(u)for(d=0;4>d;d++)r=3*t[k++],u=new THREE.Vector3(x[r++],
-x[r++],x[r]),2!==d&&s.vertexNormals.push(u),0!==d&&q.vertexNormals.push(u);n&&(n=t[k++],n=F[n],s.color.setHex(n),q.color.setHex(n));if(b)for(d=0;4>d;d++)n=t[k++],n=F[n],2!==d&&s.vertexColors.push(new THREE.Color(n)),0!==d&&q.vertexColors.push(new THREE.Color(n));c.faces.push(s);c.faces.push(q)}else{s=new THREE.Face3;s.a=t[k++];s.b=t[k++];s.c=t[k++];h&&(h=t[k++],s.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(w=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)p=t[k++],v=w[2*p],p=w[2*p+1],
-v=new THREE.Vector2(v,p),c.faceVertexUvs[d][h].push(v);r&&(r=3*t[k++],s.normal.set(x[r++],x[r++],x[r]));if(u)for(d=0;3>d;d++)r=3*t[k++],u=new THREE.Vector3(x[r++],x[r++],x[r]),s.vertexNormals.push(u);n&&(n=t[k++],s.color.setHex(F[n]));if(b)for(d=0;3>d;d++)n=t[k++],s.vertexColors.push(new THREE.Color(F[n]));c.faces.push(s)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,n,r,p,s,u,q,w,v,t=a.faces;n=a.vertices;var y=a.normals,E=a.colors,x=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&x++;for(d=0;d<x;d++)c.faceVertexUvs[d]=[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=t.length;k<l;)if(b=t[k++],s=b&1,h=b&2,d=b&8,r=b&16,u=b&32,n=b&64,b&=128,s){s=new THREE.Face3;
+s.a=t[k];s.b=t[k+1];s.c=t[k+3];q=new THREE.Face3;q.a=t[k+1];q.b=t[k+2];q.c=t[k+3];k+=4;h&&(h=t[k++],s.materialIndex=h,q.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<x;d++)for(w=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)p=t[k++],v=w[2*p],p=w[2*p+1],v=new THREE.Vector2(v,p),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);r&&(r=3*t[k++],s.normal.set(y[r++],y[r++],y[r]),q.normal.copy(s.normal));if(u)for(d=0;4>d;d++)r=3*t[k++],u=new THREE.Vector3(y[r++],
+y[r++],y[r]),2!==d&&s.vertexNormals.push(u),0!==d&&q.vertexNormals.push(u);n&&(n=t[k++],n=E[n],s.color.setHex(n),q.color.setHex(n));if(b)for(d=0;4>d;d++)n=t[k++],n=E[n],2!==d&&s.vertexColors.push(new THREE.Color(n)),0!==d&&q.vertexColors.push(new THREE.Color(n));c.faces.push(s);c.faces.push(q)}else{s=new THREE.Face3;s.a=t[k++];s.b=t[k++];s.c=t[k++];h&&(h=t[k++],s.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<x;d++)for(w=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)p=t[k++],v=w[2*p],p=w[2*p+1],
+v=new THREE.Vector2(v,p),c.faceVertexUvs[d][h].push(v);r&&(r=3*t[k++],s.normal.set(y[r++],y[r++],y[r]));if(u)for(d=0;3>d;d++)r=3*t[k++],u=new THREE.Vector3(y[r++],y[r++],y[r]),s.vertexNormals.push(u);n&&(n=t[k++],s.color.setHex(E[n]));if(b)for(d=0;3>d;d++)n=t[k++],s.vertexColors.push(new THREE.Color(E[n]));c.faces.push(s)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
 1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+
 "), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,n;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var r=new THREE.Vector3;r.x=n[h]*b;r.y=n[h+1]*b;r.z=n[h+2]*b;l.push(r)}}if(void 0!==a.morphColors)for(d=
 0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
@@ -260,29 +260,29 @@ d.parse(h.data);break;case "Geometry":g=c.parse(h.data).geometry}g.uuid=h.uuid;v
 b.aspect,b.near,b.far);break;case "OrthographicCamera":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case "AmbientLight":e=new THREE.AmbientLight(b.color);break;case "DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case "PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance);break;case "SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent);break;case "HemisphereLight":e=new THREE.HemisphereLight(b.color,
 b.groundColor,b.intensity);break;case "Mesh":e=c[b.geometry];var f=d[b.material];void 0===e&&console.error("THREE.ObjectLoader: Undefined geometry "+b.geometry);void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,f);break;case "Sprite":f=d[b.material];void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Sprite(f);break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&(e.name=b.name);void 0!==b.matrix?
 (a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==b.visible&&(e.visible=b.visible);void 0!==b.userData&&(e.userData=b.userData);if(void 0!==b.children)for(var g in b.children)e.add(this.parseObject(b.children[g],c,d));return e}}()};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){};this.geometryHandlers={};this.hierarchyHandlers={};this.addGeometryHandler("ascii",THREE.JSONLoader)};
-THREE.SceneLoader.prototype={constructor:THREE.SceneLoader,load:function(a,b,c,d){var e=this;c=new THREE.XHRLoader(e.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(c){e.parse(JSON.parse(c),b,a)})},setCrossOrigin:function(a){this.crossOrigin=a},addGeometryHandler:function(a,b){this.geometryHandlers[a]={loaderClass:b}},addHierarchyHandler:function(a,b){this.hierarchyHandlers[a]={loaderClass:b}},parse:function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:s+a}function e(){f(E.scene,
-B.objects)}function f(a,b){var c,e,g,h,l,n;for(n in b){var r=E.objects[n],s=b[n];if(void 0===r){if(s.type&&s.type in p.hierarchyHandlers){if(void 0===s.loading){c={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,userData:1,skin:1,morph:1,mirroredLoop:1,duration:1};var t={},v;for(v in s)v in c||(t[v]=s[v]);q=E.materials[s.material];s.loading=!0;c=p.hierarchyHandlers[s.type].loaderObject;c.options?c.load(d(s.url,B.urlBaseType),k(n,a,q,s)):c.load(d(s.url,B.urlBaseType),k(n,
-a,q,s),t)}}else if(void 0!==s.geometry){if(u=E.geometries[s.geometry]){r=!1;q=E.materials[s.material];r=q instanceof THREE.ShaderMaterial;e=s.position;g=s.rotation;h=s.scale;c=s.matrix;l=s.quaternion;s.material||(q=new THREE.MeshFaceMaterial(E.face_materials[s.geometry]));q instanceof THREE.MeshFaceMaterial&&0===q.materials.length&&(q=new THREE.MeshFaceMaterial(E.face_materials[s.geometry]));if(q instanceof THREE.MeshFaceMaterial)for(t=0;t<q.materials.length;t++)r=r||q.materials[t]instanceof THREE.ShaderMaterial;
+THREE.SceneLoader.prototype={constructor:THREE.SceneLoader,load:function(a,b,c,d){var e=this;c=new THREE.XHRLoader(e.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(c){e.parse(JSON.parse(c),b,a)})},setCrossOrigin:function(a){this.crossOrigin=a},addGeometryHandler:function(a,b){this.geometryHandlers[a]={loaderClass:b}},addHierarchyHandler:function(a,b){this.hierarchyHandlers[a]={loaderClass:b}},parse:function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:s+a}function e(){f(D.scene,
+z.objects)}function f(a,b){var c,e,g,h,l,n;for(n in b){var r=D.objects[n],s=b[n];if(void 0===r){if(s.type&&s.type in p.hierarchyHandlers){if(void 0===s.loading){c={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,userData:1,skin:1,morph:1,mirroredLoop:1,duration:1};var t={},v;for(v in s)v in c||(t[v]=s[v]);q=D.materials[s.material];s.loading=!0;c=p.hierarchyHandlers[s.type].loaderObject;c.options?c.load(d(s.url,z.urlBaseType),k(n,a,q,s)):c.load(d(s.url,z.urlBaseType),k(n,
+a,q,s),t)}}else if(void 0!==s.geometry){if(u=D.geometries[s.geometry]){r=!1;q=D.materials[s.material];r=q instanceof THREE.ShaderMaterial;e=s.position;g=s.rotation;h=s.scale;c=s.matrix;l=s.quaternion;s.material||(q=new THREE.MeshFaceMaterial(D.face_materials[s.geometry]));q instanceof THREE.MeshFaceMaterial&&0===q.materials.length&&(q=new THREE.MeshFaceMaterial(D.face_materials[s.geometry]));if(q instanceof THREE.MeshFaceMaterial)for(t=0;t<q.materials.length;t++)r=r||q.materials[t]instanceof THREE.ShaderMaterial;
 r&&u.computeTangents();s.skin?r=new THREE.SkinnedMesh(u,q):s.morph?(r=new THREE.MorphAnimMesh(u,q),void 0!==s.duration&&(r.duration=s.duration),void 0!==s.time&&(r.time=s.time),void 0!==s.mirroredLoop&&(r.mirroredLoop=s.mirroredLoop),q.morphNormals&&u.computeMorphNormals()):r=new THREE.Mesh(u,q);r.name=n;c?(r.matrixAutoUpdate=!1,r.matrix.set(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])):(r.position.fromArray(e),l?r.quaternion.fromArray(l):r.rotation.fromArray(g),
-r.scale.fromArray(h));r.visible=s.visible;r.castShadow=s.castShadow;r.receiveShadow=s.receiveShadow;a.add(r);E.objects[n]=r}}else if("AmbientLight"===s.type||"PointLight"===s.type||"DirectionalLight"===s.type||"SpotLight"===s.type||"HemisphereLight"===s.type||"AreaLight"===s.type){t=s.color;c=s.intensity;e=s.distance;g=s.position;h=s.rotation;switch(s.type){case "AmbientLight":x=new THREE.AmbientLight(t);break;case "PointLight":x=new THREE.PointLight(t,c,e);x.position.fromArray(g);break;case "DirectionalLight":x=
-new THREE.DirectionalLight(t,c);x.position.fromArray(s.direction);break;case "SpotLight":x=new THREE.SpotLight(t,c,e,1);x.angle=s.angle;x.position.fromArray(g);x.target.set(g[0],g[1]-e,g[2]);x.target.applyEuler(new THREE.Euler(h[0],h[1],h[2],"XYZ"));break;case "HemisphereLight":x=new THREE.DirectionalLight(t,c,e);x.target.set(g[0],g[1]-e,g[2]);x.target.applyEuler(new THREE.Euler(h[0],h[1],h[2],"XYZ"));break;case "AreaLight":x=new THREE.AreaLight(t,c),x.position.fromArray(g),x.width=s.size,x.height=
-s.size_y}a.add(x);x.name=n;E.lights[n]=x;E.objects[n]=x}else"PerspectiveCamera"===s.type||"OrthographicCamera"===s.type?(e=s.position,g=s.rotation,l=s.quaternion,"PerspectiveCamera"===s.type?w=new THREE.PerspectiveCamera(s.fov,s.aspect,s.near,s.far):"OrthographicCamera"===s.type&&(w=new THREE.OrthographicCamera(s.left,s.right,s.top,s.bottom,s.near,s.far)),w.name=n,w.position.fromArray(e),void 0!==l?w.quaternion.fromArray(l):void 0!==g&&w.rotation.fromArray(g),a.add(w),E.cameras[n]=w,E.objects[n]=
-w):(e=s.position,g=s.rotation,h=s.scale,l=s.quaternion,r=new THREE.Object3D,r.name=n,r.position.fromArray(e),l?r.quaternion.fromArray(l):r.rotation.fromArray(g),r.scale.fromArray(h),r.visible=void 0!==s.visible?s.visible:!1,a.add(r),E.objects[n]=r,E.empties[n]=r);if(r){if(void 0!==s.userData)for(var F in s.userData)r.userData[F]=s.userData[F];if(void 0!==s.groups)for(t=0;t<s.groups.length;t++)c=s.groups[t],void 0===E.groups[c]&&(E.groups[c]=[]),E.groups[c].push(n)}}void 0!==r&&void 0!==s.children&&
-f(r,s.children)}}function g(a,b,c,d,f){var g=f.rotation,h=f.quaternion,k=f.scale;a.position.fromArray(f.position);h?a.quaternion.fromArray(h):a.rotation.fromArray(g);a.scale.fromArray(k);d&&a.traverse(function(a){a.material=d});var l=void 0!==f.visible?f.visible:!0;a.traverse(function(a){a.visible=l});c.add(a);a.name=b;E.objects[b]=a;e()}function h(a){return function(b,c){b.name=a;E.geometries[a]=b;E.face_materials[a]=c;e();F-=1;p.onLoadComplete();n()}}function k(a,b,c,d){return function(e){g(e.content?
-e.content:e.dae?e.scene:e,a,b,c,d);F-=1;p.onLoadComplete();n()}}function l(a){return function(b,c){b.name=a;E.geometries[a]=b;E.face_materials[a]=c}}function n(){p.callbackProgress({totalModels:N,totalTextures:H,loadedModels:N-F,loadedTextures:H-z},E);p.onLoadProgress();if(0===F&&0===z){for(var a=0;a<L.length;a++){var c=L[a],d=E.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,E.scene.add(c.object.target));c.object.target.userData.targetInverse=c.object}b(E)}}function r(a,
-b){b(a);if(void 0!==a.children)for(var c in a.children)r(a.children[c],b)}var p=this,s=THREE.Loader.prototype.extractUrlBase(c),u,q,w,v,t,x,F,z,N,H,E,L=[],B=a,C;for(C in this.geometryHandlers)a=this.geometryHandlers[C].loaderClass,this.geometryHandlers[C].loaderObject=new a;for(C in this.hierarchyHandlers)a=this.hierarchyHandlers[C].loaderClass,this.hierarchyHandlers[C].loaderObject=new a;z=F=0;E={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},objects:{},cameras:{},
-lights:{},fogs:{},empties:{},groups:{}};B.transform&&(C=B.transform.position,a=B.transform.rotation,c=B.transform.scale,C&&E.scene.position.fromArray(C),a&&E.scene.rotation.fromArray(a),c&&E.scene.scale.fromArray(c),C||a||c)&&(E.scene.updateMatrix(),E.scene.updateMatrixWorld());C=function(a){return function(){z-=a;n();p.onLoadComplete()}};for(var O in B.fogs)a=B.fogs[O],"linear"===a.type?v=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(v=new THREE.FogExp2(0,a.density)),a=a.color,v.color.setRGB(a[0],
-a[1],a[2]),E.fogs[O]=v;for(var D in B.geometries)v=B.geometries[D],v.type in this.geometryHandlers&&(F+=1,p.onLoadStart());for(var A in B.objects)r(B.objects[A],function(a){a.type&&a.type in p.hierarchyHandlers&&(F+=1,p.onLoadStart())});N=F;for(D in B.geometries)if(v=B.geometries[D],"cube"===v.type)u=new THREE.BoxGeometry(v.width,v.height,v.depth,v.widthSegments,v.heightSegments,v.depthSegments),u.name=D,E.geometries[D]=u;else if("plane"===v.type)u=new THREE.PlaneGeometry(v.width,v.height,v.widthSegments,
-v.heightSegments),u.name=D,E.geometries[D]=u;else if("sphere"===v.type)u=new THREE.SphereGeometry(v.radius,v.widthSegments,v.heightSegments),u.name=D,E.geometries[D]=u;else if("cylinder"===v.type)u=new THREE.CylinderGeometry(v.topRad,v.botRad,v.height,v.radSegs,v.heightSegs),u.name=D,E.geometries[D]=u;else if("torus"===v.type)u=new THREE.TorusGeometry(v.radius,v.tube,v.segmentsR,v.segmentsT),u.name=D,E.geometries[D]=u;else if("icosahedron"===v.type)u=new THREE.IcosahedronGeometry(v.radius,v.subdivisions),
-u.name=D,E.geometries[D]=u;else if(v.type in this.geometryHandlers){A={};for(t in v)"type"!==t&&"url"!==t&&(A[t]=v[t]);this.geometryHandlers[v.type].loaderObject.load(d(v.url,B.urlBaseType),h(D),A)}else"embedded"===v.type&&(A=B.embeds[v.id],A.metadata=B.metadata,A&&(A=this.geometryHandlers.ascii.loaderObject.parse(A,""),l(D)(A.geometry,A.materials)));for(var y in B.textures)if(D=B.textures[y],D.url instanceof Array)for(z+=D.url.length,t=0;t<D.url.length;t++)p.onLoadStart();else z+=1,p.onLoadStart();
-H=z;for(y in B.textures){D=B.textures[y];void 0!==D.mapping&&void 0!==THREE[D.mapping]&&(D.mapping=new THREE[D.mapping]);if(D.url instanceof Array){A=D.url.length;v=[];for(t=0;t<A;t++)v[t]=d(D.url[t],B.urlBaseType);t=(t=/\.dds$/i.test(v[0]))?THREE.ImageUtils.loadCompressedTextureCube(v,D.mapping,C(A)):THREE.ImageUtils.loadTextureCube(v,D.mapping,C(A))}else t=/\.dds$/i.test(D.url),A=d(D.url,B.urlBaseType),v=C(1),t=t?THREE.ImageUtils.loadCompressedTexture(A,D.mapping,v):THREE.ImageUtils.loadTexture(A,
-D.mapping,v),void 0!==THREE[D.minFilter]&&(t.minFilter=THREE[D.minFilter]),void 0!==THREE[D.magFilter]&&(t.magFilter=THREE[D.magFilter]),D.anisotropy&&(t.anisotropy=D.anisotropy),D.repeat&&(t.repeat.set(D.repeat[0],D.repeat[1]),1!==D.repeat[0]&&(t.wrapS=THREE.RepeatWrapping),1!==D.repeat[1]&&(t.wrapT=THREE.RepeatWrapping)),D.offset&&t.offset.set(D.offset[0],D.offset[1]),D.wrap&&(A={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==A[D.wrap[0]]&&(t.wrapS=A[D.wrap[0]]),void 0!==
-A[D.wrap[1]]&&(t.wrapT=A[D.wrap[1]]));E.textures[y]=t}var K,G;for(K in B.materials){y=B.materials[K];for(G in y.parameters)"envMap"===G||"map"===G||"lightMap"===G||"bumpMap"===G?y.parameters[G]=E.textures[y.parameters[G]]:"shading"===G?y.parameters[G]="flat"===y.parameters[G]?THREE.FlatShading:THREE.SmoothShading:"side"===G?y.parameters[G]="double"==y.parameters[G]?THREE.DoubleSide:"back"==y.parameters[G]?THREE.BackSide:THREE.FrontSide:"blending"===G?y.parameters[G]=y.parameters[G]in THREE?THREE[y.parameters[G]]:
-THREE.NormalBlending:"combine"===G?y.parameters[G]=y.parameters[G]in THREE?THREE[y.parameters[G]]:THREE.MultiplyOperation:"vertexColors"===G?"face"==y.parameters[G]?y.parameters[G]=THREE.FaceColors:y.parameters[G]&&(y.parameters[G]=THREE.VertexColors):"wrapRGB"===G&&(C=y.parameters[G],y.parameters[G]=new THREE.Vector3(C[0],C[1],C[2]));void 0!==y.parameters.opacity&&1>y.parameters.opacity&&(y.parameters.transparent=!0);y.parameters.normalMap?(C=THREE.ShaderLib.normalmap,D=THREE.UniformsUtils.clone(C.uniforms),
-t=y.parameters.color,A=y.parameters.specular,v=y.parameters.ambient,O=y.parameters.shininess,D.tNormal.value=E.textures[y.parameters.normalMap],y.parameters.normalScale&&D.uNormalScale.value.set(y.parameters.normalScale[0],y.parameters.normalScale[1]),y.parameters.map&&(D.tDiffuse.value=y.parameters.map,D.enableDiffuse.value=!0),y.parameters.envMap&&(D.tCube.value=y.parameters.envMap,D.enableReflection.value=!0,D.reflectivity.value=y.parameters.reflectivity),y.parameters.lightMap&&(D.tAO.value=y.parameters.lightMap,
-D.enableAO.value=!0),y.parameters.specularMap&&(D.tSpecular.value=E.textures[y.parameters.specularMap],D.enableSpecular.value=!0),y.parameters.displacementMap&&(D.tDisplacement.value=E.textures[y.parameters.displacementMap],D.enableDisplacement.value=!0,D.uDisplacementBias.value=y.parameters.displacementBias,D.uDisplacementScale.value=y.parameters.displacementScale),D.diffuse.value.setHex(t),D.specular.value.setHex(A),D.ambient.value.setHex(v),D.shininess.value=O,y.parameters.opacity&&(D.opacity.value=
-y.parameters.opacity),q=new THREE.ShaderMaterial({fragmentShader:C.fragmentShader,vertexShader:C.vertexShader,uniforms:D,lights:!0,fog:!0})):q=new THREE[y.type](y.parameters);q.name=K;E.materials[K]=q}for(K in B.materials)if(y=B.materials[K],y.parameters.materials){G=[];for(t=0;t<y.parameters.materials.length;t++)G.push(E.materials[y.parameters.materials[t]]);E.materials[K].materials=G}e();E.cameras&&B.defaults.camera&&(E.currentCamera=E.cameras[B.defaults.camera]);E.fogs&&B.defaults.fog&&(E.scene.fog=
-E.fogs[B.defaults.fog]);p.callbackSync(E);n()}};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){c=new THREE.ImageLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)})},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};
+r.scale.fromArray(h));r.visible=s.visible;r.castShadow=s.castShadow;r.receiveShadow=s.receiveShadow;a.add(r);D.objects[n]=r}}else if("AmbientLight"===s.type||"PointLight"===s.type||"DirectionalLight"===s.type||"SpotLight"===s.type||"HemisphereLight"===s.type||"AreaLight"===s.type){t=s.color;c=s.intensity;e=s.distance;g=s.position;h=s.rotation;switch(s.type){case "AmbientLight":y=new THREE.AmbientLight(t);break;case "PointLight":y=new THREE.PointLight(t,c,e);y.position.fromArray(g);break;case "DirectionalLight":y=
+new THREE.DirectionalLight(t,c);y.position.fromArray(s.direction);break;case "SpotLight":y=new THREE.SpotLight(t,c,e,1);y.angle=s.angle;y.position.fromArray(g);y.target.set(g[0],g[1]-e,g[2]);y.target.applyEuler(new THREE.Euler(h[0],h[1],h[2],"XYZ"));break;case "HemisphereLight":y=new THREE.DirectionalLight(t,c,e);y.target.set(g[0],g[1]-e,g[2]);y.target.applyEuler(new THREE.Euler(h[0],h[1],h[2],"XYZ"));break;case "AreaLight":y=new THREE.AreaLight(t,c),y.position.fromArray(g),y.width=s.size,y.height=
+s.size_y}a.add(y);y.name=n;D.lights[n]=y;D.objects[n]=y}else"PerspectiveCamera"===s.type||"OrthographicCamera"===s.type?(e=s.position,g=s.rotation,l=s.quaternion,"PerspectiveCamera"===s.type?w=new THREE.PerspectiveCamera(s.fov,s.aspect,s.near,s.far):"OrthographicCamera"===s.type&&(w=new THREE.OrthographicCamera(s.left,s.right,s.top,s.bottom,s.near,s.far)),w.name=n,w.position.fromArray(e),void 0!==l?w.quaternion.fromArray(l):void 0!==g&&w.rotation.fromArray(g),a.add(w),D.cameras[n]=w,D.objects[n]=
+w):(e=s.position,g=s.rotation,h=s.scale,l=s.quaternion,r=new THREE.Object3D,r.name=n,r.position.fromArray(e),l?r.quaternion.fromArray(l):r.rotation.fromArray(g),r.scale.fromArray(h),r.visible=void 0!==s.visible?s.visible:!1,a.add(r),D.objects[n]=r,D.empties[n]=r);if(r){if(void 0!==s.userData)for(var E in s.userData)r.userData[E]=s.userData[E];if(void 0!==s.groups)for(t=0;t<s.groups.length;t++)c=s.groups[t],void 0===D.groups[c]&&(D.groups[c]=[]),D.groups[c].push(n)}}void 0!==r&&void 0!==s.children&&
+f(r,s.children)}}function g(a,b,c,d,f){var g=f.rotation,h=f.quaternion,k=f.scale;a.position.fromArray(f.position);h?a.quaternion.fromArray(h):a.rotation.fromArray(g);a.scale.fromArray(k);d&&a.traverse(function(a){a.material=d});var l=void 0!==f.visible?f.visible:!0;a.traverse(function(a){a.visible=l});c.add(a);a.name=b;D.objects[b]=a;e()}function h(a){return function(b,c){b.name=a;D.geometries[a]=b;D.face_materials[a]=c;e();E-=1;p.onLoadComplete();n()}}function k(a,b,c,d){return function(e){g(e.content?
+e.content:e.dae?e.scene:e,a,b,c,d);E-=1;p.onLoadComplete();n()}}function l(a){return function(b,c){b.name=a;D.geometries[a]=b;D.face_materials[a]=c}}function n(){p.callbackProgress({totalModels:L,totalTextures:A,loadedModels:L-E,loadedTextures:A-x},D);p.onLoadProgress();if(0===E&&0===x){for(var a=0;a<M.length;a++){var c=M[a],d=D.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,D.scene.add(c.object.target));c.object.target.userData.targetInverse=c.object}b(D)}}function r(a,
+b){b(a);if(void 0!==a.children)for(var c in a.children)r(a.children[c],b)}var p=this,s=THREE.Loader.prototype.extractUrlBase(c),u,q,w,v,t,y,E,x,L,A,D,M=[],z=a,G;for(G in this.geometryHandlers)a=this.geometryHandlers[G].loaderClass,this.geometryHandlers[G].loaderObject=new a;for(G in this.hierarchyHandlers)a=this.hierarchyHandlers[G].loaderClass,this.hierarchyHandlers[G].loaderObject=new a;x=E=0;D={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},objects:{},cameras:{},
+lights:{},fogs:{},empties:{},groups:{}};z.transform&&(G=z.transform.position,a=z.transform.rotation,c=z.transform.scale,G&&D.scene.position.fromArray(G),a&&D.scene.rotation.fromArray(a),c&&D.scene.scale.fromArray(c),G||a||c)&&(D.scene.updateMatrix(),D.scene.updateMatrixWorld());G=function(a){return function(){x-=a;n();p.onLoadComplete()}};for(var P in z.fogs)a=z.fogs[P],"linear"===a.type?v=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(v=new THREE.FogExp2(0,a.density)),a=a.color,v.color.setRGB(a[0],
+a[1],a[2]),D.fogs[P]=v;for(var C in z.geometries)v=z.geometries[C],v.type in this.geometryHandlers&&(E+=1,p.onLoadStart());for(var B in z.objects)r(z.objects[B],function(a){a.type&&a.type in p.hierarchyHandlers&&(E+=1,p.onLoadStart())});L=E;for(C in z.geometries)if(v=z.geometries[C],"cube"===v.type)u=new THREE.BoxGeometry(v.width,v.height,v.depth,v.widthSegments,v.heightSegments,v.depthSegments),u.name=C,D.geometries[C]=u;else if("plane"===v.type)u=new THREE.PlaneGeometry(v.width,v.height,v.widthSegments,
+v.heightSegments),u.name=C,D.geometries[C]=u;else if("sphere"===v.type)u=new THREE.SphereGeometry(v.radius,v.widthSegments,v.heightSegments),u.name=C,D.geometries[C]=u;else if("cylinder"===v.type)u=new THREE.CylinderGeometry(v.topRad,v.botRad,v.height,v.radSegs,v.heightSegs),u.name=C,D.geometries[C]=u;else if("torus"===v.type)u=new THREE.TorusGeometry(v.radius,v.tube,v.segmentsR,v.segmentsT),u.name=C,D.geometries[C]=u;else if("icosahedron"===v.type)u=new THREE.IcosahedronGeometry(v.radius,v.subdivisions),
+u.name=C,D.geometries[C]=u;else if(v.type in this.geometryHandlers){B={};for(t in v)"type"!==t&&"url"!==t&&(B[t]=v[t]);this.geometryHandlers[v.type].loaderObject.load(d(v.url,z.urlBaseType),h(C),B)}else"embedded"===v.type&&(B=z.embeds[v.id],B.metadata=z.metadata,B&&(B=this.geometryHandlers.ascii.loaderObject.parse(B,""),l(C)(B.geometry,B.materials)));for(var F in z.textures)if(C=z.textures[F],C.url instanceof Array)for(x+=C.url.length,t=0;t<C.url.length;t++)p.onLoadStart();else x+=1,p.onLoadStart();
+A=x;for(F in z.textures){C=z.textures[F];void 0!==C.mapping&&void 0!==THREE[C.mapping]&&(C.mapping=new THREE[C.mapping]);if(C.url instanceof Array){B=C.url.length;v=[];for(t=0;t<B;t++)v[t]=d(C.url[t],z.urlBaseType);t=(t=/\.dds$/i.test(v[0]))?THREE.ImageUtils.loadCompressedTextureCube(v,C.mapping,G(B)):THREE.ImageUtils.loadTextureCube(v,C.mapping,G(B))}else t=/\.dds$/i.test(C.url),B=d(C.url,z.urlBaseType),v=G(1),t=t?THREE.ImageUtils.loadCompressedTexture(B,C.mapping,v):THREE.ImageUtils.loadTexture(B,
+C.mapping,v),void 0!==THREE[C.minFilter]&&(t.minFilter=THREE[C.minFilter]),void 0!==THREE[C.magFilter]&&(t.magFilter=THREE[C.magFilter]),C.anisotropy&&(t.anisotropy=C.anisotropy),C.repeat&&(t.repeat.set(C.repeat[0],C.repeat[1]),1!==C.repeat[0]&&(t.wrapS=THREE.RepeatWrapping),1!==C.repeat[1]&&(t.wrapT=THREE.RepeatWrapping)),C.offset&&t.offset.set(C.offset[0],C.offset[1]),C.wrap&&(B={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==B[C.wrap[0]]&&(t.wrapS=B[C.wrap[0]]),void 0!==
+B[C.wrap[1]]&&(t.wrapT=B[C.wrap[1]]));D.textures[F]=t}var K,H;for(K in z.materials){F=z.materials[K];for(H in F.parameters)"envMap"===H||"map"===H||"lightMap"===H||"bumpMap"===H?F.parameters[H]=D.textures[F.parameters[H]]:"shading"===H?F.parameters[H]="flat"===F.parameters[H]?THREE.FlatShading:THREE.SmoothShading:"side"===H?F.parameters[H]="double"==F.parameters[H]?THREE.DoubleSide:"back"==F.parameters[H]?THREE.BackSide:THREE.FrontSide:"blending"===H?F.parameters[H]=F.parameters[H]in THREE?THREE[F.parameters[H]]:
+THREE.NormalBlending:"combine"===H?F.parameters[H]=F.parameters[H]in THREE?THREE[F.parameters[H]]:THREE.MultiplyOperation:"vertexColors"===H?"face"==F.parameters[H]?F.parameters[H]=THREE.FaceColors:F.parameters[H]&&(F.parameters[H]=THREE.VertexColors):"wrapRGB"===H&&(G=F.parameters[H],F.parameters[H]=new THREE.Vector3(G[0],G[1],G[2]));void 0!==F.parameters.opacity&&1>F.parameters.opacity&&(F.parameters.transparent=!0);F.parameters.normalMap?(G=THREE.ShaderLib.normalmap,C=THREE.UniformsUtils.clone(G.uniforms),
+t=F.parameters.color,B=F.parameters.specular,v=F.parameters.ambient,P=F.parameters.shininess,C.tNormal.value=D.textures[F.parameters.normalMap],F.parameters.normalScale&&C.uNormalScale.value.set(F.parameters.normalScale[0],F.parameters.normalScale[1]),F.parameters.map&&(C.tDiffuse.value=F.parameters.map,C.enableDiffuse.value=!0),F.parameters.envMap&&(C.tCube.value=F.parameters.envMap,C.enableReflection.value=!0,C.reflectivity.value=F.parameters.reflectivity),F.parameters.lightMap&&(C.tAO.value=F.parameters.lightMap,
+C.enableAO.value=!0),F.parameters.specularMap&&(C.tSpecular.value=D.textures[F.parameters.specularMap],C.enableSpecular.value=!0),F.parameters.displacementMap&&(C.tDisplacement.value=D.textures[F.parameters.displacementMap],C.enableDisplacement.value=!0,C.uDisplacementBias.value=F.parameters.displacementBias,C.uDisplacementScale.value=F.parameters.displacementScale),C.diffuse.value.setHex(t),C.specular.value.setHex(B),C.ambient.value.setHex(v),C.shininess.value=P,F.parameters.opacity&&(C.opacity.value=
+F.parameters.opacity),q=new THREE.ShaderMaterial({fragmentShader:G.fragmentShader,vertexShader:G.vertexShader,uniforms:C,lights:!0,fog:!0})):q=new THREE[F.type](F.parameters);q.name=K;D.materials[K]=q}for(K in z.materials)if(F=z.materials[K],F.parameters.materials){H=[];for(t=0;t<F.parameters.materials.length;t++)H.push(D.materials[F.parameters.materials[t]]);D.materials[K].materials=H}e();D.cameras&&z.defaults.camera&&(D.currentCamera=D.cameras[z.defaults.camera]);D.fogs&&z.defaults.fog&&(D.scene.fog=
+D.fogs[z.defaults.fog]);p.callbackSync(D);n()}};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){c=new THREE.ImageLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)})},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};
 THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;
 a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);
 THREE.MaterialIdCount=0;THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=!1;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);
@@ -323,27 +323,27 @@ THREE.LOD.prototype.clone=function(a){void 0===a&&(a=new THREE.LOD);THREE.Object
 THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Particle=THREE.Sprite;THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)){this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}this.dispatchEvent({type:"objectAdded",object:a});a.dispatchEvent({type:"addedToScene",scene:this});for(b=0;b<a.children.length;b++)this.__addObject(a.children[b])};
 THREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){var b=this.__lights.indexOf(a);-1!==b&&this.__lights.splice(b,1);if(a.shadowCascadeArray)for(b=0;b<a.shadowCascadeArray.length;b++)this.__removeObject(a.shadowCascadeArray[b])}else a instanceof THREE.Camera||(this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),-1!==b&&this.__objectsAdded.splice(b,1));this.dispatchEvent({type:"objectRemoved",object:a});a.dispatchEvent({type:"removedFromScene",scene:this});for(b=
-0;b<a.children.length;b++)this.__removeObject(a.children[b])};THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Object3D.prototype.clone.call(this,a);null!==this.fog&&(a.fog=this.fog.clone());null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone());a.autoUpdate=this.autoUpdate;a.matrixAutoUpdate=this.matrixAutoUpdate;return a};THREE.Fog=function(a,b,c){this.name="";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name="";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};THREE.CanvasRenderer=function(a){function b(a,b,c,d){l(b);n(c);r(d);p(a.getStyle());B.stroke();qa.expandByScalar(2*b)}function c(a){s(a.getStyle());B.fill()}function d(a){e(a.target)}function e(a){var b=a.wrapS===THREE.RepeatWrapping,c=a.wrapT===THREE.RepeatWrapping,d=a.image,e=document.createElement("canvas");e.width=d.width;e.height=d.height;var f=e.getContext("2d");f.setTransform(1,0,0,-1,0,d.height);f.drawImage(d,0,0);Ha[a.id]=B.createPattern(e,!0===b&&!0===c?"repeat":!0===b&&!1===c?"repeat-x":
+0;b<a.children.length;b++)this.__removeObject(a.children[b])};THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Object3D.prototype.clone.call(this,a);null!==this.fog&&(a.fog=this.fog.clone());null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone());a.autoUpdate=this.autoUpdate;a.matrixAutoUpdate=this.matrixAutoUpdate;return a};THREE.Fog=function(a,b,c){this.name="";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name="";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};THREE.CanvasRenderer=function(a){function b(a,b,c,d){l(b);n(c);r(d);p(a.getStyle());z.stroke();qa.expandByScalar(2*b)}function c(a){s(a.getStyle());z.fill()}function d(a){e(a.target)}function e(a){var b=a.wrapS===THREE.RepeatWrapping,c=a.wrapT===THREE.RepeatWrapping,d=a.image,e=document.createElement("canvas");e.width=d.width;e.height=d.height;var f=e.getContext("2d");f.setTransform(1,0,0,-1,0,d.height);f.drawImage(d,0,0);Ha[a.id]=z.createPattern(e,!0===b&&!0===c?"repeat":!0===b&&!1===c?"repeat-x":
 !1===b&&!0===c?"repeat-y":"no-repeat")}function f(a,b,c,f,g,h,k,l,m,n,p,r,q){if(!(q instanceof THREE.DataTexture)){!1===q.hasEventListener("update",d)&&(void 0!==q.image&&0<q.image.width&&e(q),q.addEventListener("update",d));var u=Ha[q.id];if(void 0!==u){s(u);var u=q.offset.x/q.repeat.x,t=q.offset.y/q.repeat.y,v=q.image.width*q.repeat.x;q=q.image.height*q.repeat.y;k=(k+u)*v;l=(l+t)*q;c-=a;f-=b;g-=a;h-=b;m=(m+u)*v-k;n=(n+t)*q-l;p=(p+u)*v-k;r=(r+t)*q-l;q=m*r-p*n;0!==q&&(u=1/q,q=(r*c-n*g)*u,n=(r*f-n*
-h)*u,c=(m*g-p*c)*u,f=(m*h-p*f)*u,a=a-q*k-c*l,b=b-n*k-f*l,B.save(),B.transform(q,n,c,f,a,b),B.fill(),B.restore())}else s("rgba(0,0,0,1)"),B.fill()}}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function h(a){D!==a&&(D=B.globalAlpha=a)}function k(a){A!==a&&(a===THREE.NormalBlending?B.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?B.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(B.globalCompositeOperation=
-"darker"),A=a)}function l(a){G!==a&&(G=B.lineWidth=a)}function n(a){Q!==a&&(Q=B.lineCap=a)}function r(a){Y!==a&&(Y=B.lineJoin=a)}function p(a){y!==a&&(y=B.strokeStyle=a)}function s(a){K!==a&&(K=B.fillStyle=a)}function u(a,b){if(R!==a||ka!==b)B.setLineDash([a,b]),R=a,ka=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var q=THREE.Math.smoothstep;a=a||{};var w=this,v,t,x,F=new THREE.Projector,z=void 0!==a.canvas?a.canvas:document.createElement("canvas"),N=z.width,H=z.height,E=Math.floor(N/2),L=
-Math.floor(H/2),B=z.getContext("2d",{alpha:!0===a.alpha}),C=new THREE.Color(0),O=0,D=1,A=0,y=null,K=null,G=null,Q=null,Y=null,R=null,ka=0,da,X,J,S;new THREE.RenderableVertex;new THREE.RenderableVertex;var fa,I,ia,ta,T,wa,aa=new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;var Ga=new THREE.Color,Ia=new THREE.Color,Aa=new THREE.Color,Ha={},Ca,Da,Ra,Sa,Ea,ga,ua,ca=new THREE.Box2,V=new THREE.Box2,qa=new THREE.Box2,Fa=new THREE.Color,xa=new THREE.Color,Ja=new THREE.Color,
-Ba=new THREE.Vector3,Ka=new THREE.Vector3,ha=new THREE.Vector3,la=new THREE.Matrix3;void 0===B.setLineDash&&(B.setLineDash=void 0!==B.mozDash?function(a){B.mozDash=null!==a[0]?a:null}:function(){});this.domElement=z;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){N=a*this.devicePixelRatio;H=b*this.devicePixelRatio;z.width=N;z.height=H;E=Math.floor(N/2);L=Math.floor(H/2);1!==this.devicePixelRatio&&!1!==c&&(z.style.width=a+"px",z.style.height=b+"px");ca.min.set(-E,-L);ca.max.set(E,L);V.min.set(-E,-L);V.max.set(E,L);D=1;A=0;Y=Q=G=K=y=null;this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){B.setTransform(c/N,0,0,-d/H,a,H-b);B.translate(E,L)};this.setScissor=function(){};this.enableScissorTest=function(){};this.setClearColor=
-function(a,b){C.set(a);O=void 0!==b?b:1;V.min.set(-E,-L);V.max.set(E,L)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){!1===V.empty()&&(V.intersect(ca),V.expandByScalar(2),1>O&&B.clearRect(V.min.x|0,V.min.y|0,V.max.x-V.min.x|0,V.max.y-V.min.y|0),0<O&&(k(THREE.NormalBlending),h(1),s("rgba("+Math.floor(255*C.r)+","+Math.floor(255*
-C.g)+","+Math.floor(255*C.b)+","+O+")"),B.fillRect(V.min.x|0,V.min.y|0,V.max.x-V.min.x|0,V.max.y-V.min.y|0)),V.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,z){if(!1===z instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");else{!0===this.autoClear&&this.clear();w.info.render.vertices=0;w.info.render.faces=0;v=F.projectScene(a,z,this.sortObjects,this.sortElements);
-t=v.elements;x=v.lights;da=z;la.getNormalMatrix(z.matrixWorldInverse);Fa.setRGB(0,0,0);xa.setRGB(0,0,0);Ja.setRGB(0,0,0);for(var D=0,H=x.length;D<H;D++){var y=x[D],C=y.color;y instanceof THREE.AmbientLight?Fa.add(C):y instanceof THREE.DirectionalLight?xa.add(C):y instanceof THREE.PointLight&&Ja.add(C)}D=0;for(H=t.length;D<H;D++){var G=t[D],K=G.material;if(void 0!==K&&!1!==K.visible){qa.makeEmpty();if(G instanceof THREE.RenderableSprite){X=G;X.x*=E;X.y*=L;var y=X,m=G,C=K;h(C.opacity);k(C.blending);
-var N=m.scale.x*E,m=m.scale.y*L,G=0.5*Math.sqrt(N*N+m*m);qa.min.set(y.x-G,y.y-G);qa.max.set(y.x+G,y.y+G);if(C instanceof THREE.SpriteMaterial||C instanceof THREE.ParticleSystemMaterial){var O=C.map;if(null!==O){!1===O.hasEventListener("update",d)&&(void 0!==O.image&&0<O.image.width&&e(O),O.addEventListener("update",d));G=Ha[O.id];void 0!==G?s(G):s("rgba( 0, 0, 0, 1 )");var A=O.image,G=A.width*O.offset.x,K=A.height*O.offset.y,Q=A.width*O.repeat.x,O=A.height*O.repeat.y,A=N/Q,R=m/O;B.save();B.translate(y.x,
-y.y);0!==C.rotation&&B.rotate(C.rotation);B.translate(-N/2,-m/2);B.scale(A,R);B.translate(-G,-K);B.fillRect(G,K,Q,O)}else s(C.color.getStyle()),B.save(),B.translate(y.x,y.y),0!==C.rotation&&B.rotate(C.rotation),B.scale(N,-m),B.fillRect(-0.5,-0.5,1,1);B.restore()}else C instanceof THREE.SpriteCanvasMaterial&&(p(C.color.getStyle()),s(C.color.getStyle()),B.save(),B.translate(y.x,y.y),0!==C.rotation&&B.rotate(C.rotation),B.scale(N,m),C.program(B),B.restore())}else if(G instanceof THREE.RenderableLine){if(X=
-G.v1,J=G.v2,X.positionScreen.x*=E,X.positionScreen.y*=L,J.positionScreen.x*=E,J.positionScreen.y*=L,qa.setFromPoints([X.positionScreen,J.positionScreen]),!0===ca.isIntersectionBox(qa))if(y=X,C=J,N=G,m=K,h(m.opacity),k(m.blending),B.beginPath(),B.moveTo(y.positionScreen.x,y.positionScreen.y),B.lineTo(C.positionScreen.x,C.positionScreen.y),m instanceof THREE.LineBasicMaterial){l(m.linewidth);n(m.linecap);r(m.linejoin);if(m.vertexColors!==THREE.VertexColors)p(m.color.getStyle());else if(G=N.vertexColors[0].getStyle(),
-N=N.vertexColors[1].getStyle(),G===N)p(G);else{try{var Y=B.createLinearGradient(y.positionScreen.x,y.positionScreen.y,C.positionScreen.x,C.positionScreen.y);Y.addColorStop(0,G);Y.addColorStop(1,N)}catch(ka){Y=G}p(Y)}B.stroke();qa.expandByScalar(2*m.linewidth)}else m instanceof THREE.LineDashedMaterial&&(l(m.linewidth),n(m.linecap),r(m.linejoin),p(m.color.getStyle()),u(m.dashSize,m.gapSize),B.stroke(),qa.expandByScalar(2*m.linewidth),u(null,null))}else if(G instanceof THREE.RenderableFace){X=G.v1;
-J=G.v2;S=G.v3;if(-1>X.positionScreen.z||1<X.positionScreen.z)continue;if(-1>J.positionScreen.z||1<J.positionScreen.z)continue;if(-1>S.positionScreen.z||1<S.positionScreen.z)continue;X.positionScreen.x*=E;X.positionScreen.y*=L;J.positionScreen.x*=E;J.positionScreen.y*=L;S.positionScreen.x*=E;S.positionScreen.y*=L;0<K.overdraw&&(g(X.positionScreen,J.positionScreen,K.overdraw),g(J.positionScreen,S.positionScreen,K.overdraw),g(S.positionScreen,X.positionScreen,K.overdraw));qa.setFromPoints([X.positionScreen,
-J.positionScreen,S.positionScreen]);if(!0===ca.isIntersectionBox(qa)){C=X;N=J;m=S;y=K;w.info.render.vertices+=3;w.info.render.faces++;h(y.opacity);k(y.blending);fa=C.positionScreen.x;I=C.positionScreen.y;ia=N.positionScreen.x;ta=N.positionScreen.y;T=m.positionScreen.x;wa=m.positionScreen.y;var K=fa,Q=I,O=ia,A=ta,R=T,Ab=wa;B.beginPath();B.moveTo(K,Q);B.lineTo(O,A);B.lineTo(R,Ab);B.closePath();if((y instanceof THREE.MeshLambertMaterial||y instanceof THREE.MeshPhongMaterial)&&null===y.map){Ga.copy(y.color);
-Ia.copy(y.emissive);y.vertexColors===THREE.FaceColors&&Ga.multiply(G.color);aa.copy(Fa);Ka.copy(C.positionWorld).add(N.positionWorld).add(m.positionWorld).divideScalar(3);C=Ka;N=G.normalModel;m=aa;G=0;for(K=x.length;G<K;G++)Q=x[G],Aa.copy(Q.color),Q instanceof THREE.DirectionalLight?(O=Ba.setFromMatrixPosition(Q.matrixWorld).normalize(),A=N.dot(O),0>=A||(A*=Q.intensity,m.add(Aa.multiplyScalar(A)))):Q instanceof THREE.PointLight&&(O=Ba.setFromMatrixPosition(Q.matrixWorld),A=N.dot(Ba.subVectors(O,C).normalize()),
-0>=A||(A*=0==Q.distance?1:1-Math.min(C.distanceTo(O)/Q.distance,1),0!=A&&(A*=Q.intensity,m.add(Aa.multiplyScalar(A)))));aa.multiply(Ga).add(Ia);!0===y.wireframe?b(aa,y.wireframeLinewidth,y.wireframeLinecap,y.wireframeLinejoin):c(aa)}else y instanceof THREE.MeshBasicMaterial||y instanceof THREE.MeshLambertMaterial||y instanceof THREE.MeshPhongMaterial?null!==y.map?y.map.mapping instanceof THREE.UVMapping&&(Ca=G.uvs,f(fa,I,ia,ta,T,wa,Ca[0].x,Ca[0].y,Ca[1].x,Ca[1].y,Ca[2].x,Ca[2].y,y.map)):null!==y.envMap?
-y.envMap.mapping instanceof THREE.SphericalReflectionMapping?(ha.copy(G.vertexNormalsModel[0]).applyMatrix3(la),Da=0.5*ha.x+0.5,Ra=0.5*ha.y+0.5,ha.copy(G.vertexNormalsModel[1]).applyMatrix3(la),Sa=0.5*ha.x+0.5,Ea=0.5*ha.y+0.5,ha.copy(G.vertexNormalsModel[2]).applyMatrix3(la),ga=0.5*ha.x+0.5,ua=0.5*ha.y+0.5,f(fa,I,ia,ta,T,wa,Da,Ra,Sa,Ea,ga,ua,y.envMap)):y.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ha.copy(G.vertexNormalsModel[0]).applyMatrix3(la),Da=-0.5*ha.x+0.5,Ra=-0.5*ha.y+0.5,
-ha.copy(G.vertexNormalsModel[1]).applyMatrix3(la),Sa=-0.5*ha.x+0.5,Ea=-0.5*ha.y+0.5,ha.copy(G.vertexNormalsModel[2]).applyMatrix3(la),ga=-0.5*ha.x+0.5,ua=-0.5*ha.y+0.5,f(fa,I,ia,ta,T,wa,Da,Ra,Sa,Ea,ga,ua,y.envMap)):(aa.copy(y.color),y.vertexColors===THREE.FaceColors&&aa.multiply(G.color),!0===y.wireframe?b(aa,y.wireframeLinewidth,y.wireframeLinecap,y.wireframeLinejoin):c(aa)):(y instanceof THREE.MeshDepthMaterial?aa.r=aa.g=aa.b=1-q(C.positionScreen.z*C.positionScreen.w,da.near,da.far):y instanceof
-THREE.MeshNormalMaterial?(ha.copy(G.normalModel).applyMatrix3(la),aa.setRGB(ha.x,ha.y,ha.z).multiplyScalar(0.5).addScalar(0.5)):aa.setRGB(1,1,1),!0===y.wireframe?b(aa,y.wireframeLinewidth,y.wireframeLinecap,y.wireframeLinejoin):c(aa))}}V.union(qa)}}}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",fog_fragment:"#ifdef USE_FOG\n\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#ifdef FOG_EXP2\n\t\tconst float LOG2 = 1.442695;\n\t\tfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\n\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
+h)*u,c=(m*g-p*c)*u,f=(m*h-p*f)*u,a=a-q*k-c*l,b=b-n*k-f*l,z.save(),z.transform(q,n,c,f,a,b),z.fill(),z.restore())}else s("rgba(0,0,0,1)"),z.fill()}}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function h(a){C!==a&&(C=z.globalAlpha=a)}function k(a){B!==a&&(a===THREE.NormalBlending?z.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?z.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(z.globalCompositeOperation=
+"darker"),B=a)}function l(a){H!==a&&(H=z.lineWidth=a)}function n(a){Q!==a&&(Q=z.lineCap=a)}function r(a){Y!==a&&(Y=z.lineJoin=a)}function p(a){F!==a&&(F=z.strokeStyle=a)}function s(a){K!==a&&(K=z.fillStyle=a)}function u(a,b){if(R!==a||ka!==b)z.setLineDash([a,b]),R=a,ka=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var q=THREE.Math.smoothstep;a=a||{};var w=this,v,t,y,E=new THREE.Projector,x=void 0!==a.canvas?a.canvas:document.createElement("canvas"),L=x.width,A=x.height,D=Math.floor(L/2),M=
+Math.floor(A/2),z=x.getContext("2d",{alpha:!0===a.alpha}),G=new THREE.Color(0),P=0,C=1,B=0,F=null,K=null,H=null,Q=null,Y=null,R=null,ka=0,da,X,J,S;new THREE.RenderableVertex;new THREE.RenderableVertex;var fa,I,ia,ta,T,wa,aa=new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;var Ga=new THREE.Color,Ia=new THREE.Color,Aa=new THREE.Color,Ha={},Ca,Da,Ra,Sa,Ea,ga,ua,ca=new THREE.Box2,V=new THREE.Box2,qa=new THREE.Box2,Fa=new THREE.Color,xa=new THREE.Color,Ja=new THREE.Color,
+Ba=new THREE.Vector3,Ka=new THREE.Vector3,ha=new THREE.Vector3,la=new THREE.Matrix3;void 0===z.setLineDash&&(z.setLineDash=void 0!==z.mozDash?function(a){z.mozDash=null!==a[0]?a:null}:function(){});this.domElement=x;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){L=a*this.devicePixelRatio;A=b*this.devicePixelRatio;x.width=L;x.height=A;D=Math.floor(L/2);M=Math.floor(A/2);1!==this.devicePixelRatio&&!1!==c&&(x.style.width=a+"px",x.style.height=b+"px");ca.min.set(-D,-M);ca.max.set(D,M);V.min.set(-D,-M);V.max.set(D,M);C=1;B=0;Y=Q=H=K=F=null;this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){z.setTransform(c/L,0,0,-d/A,a,A-b);z.translate(D,M)};this.setScissor=function(){};this.enableScissorTest=function(){};this.setClearColor=
+function(a,b){G.set(a);P=void 0!==b?b:1;V.min.set(-D,-M);V.max.set(D,M)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){!1===V.empty()&&(V.intersect(ca),V.expandByScalar(2),1>P&&z.clearRect(V.min.x|0,V.min.y|0,V.max.x-V.min.x|0,V.max.y-V.min.y|0),0<P&&(k(THREE.NormalBlending),h(1),s("rgba("+Math.floor(255*G.r)+","+Math.floor(255*
+G.g)+","+Math.floor(255*G.b)+","+P+")"),z.fillRect(V.min.x|0,V.min.y|0,V.max.x-V.min.x|0,V.max.y-V.min.y|0)),V.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,x){if(!1===x instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");else{!0===this.autoClear&&this.clear();w.info.render.vertices=0;w.info.render.faces=0;v=E.projectScene(a,x,this.sortObjects,this.sortElements);
+t=v.elements;y=v.lights;da=x;la.getNormalMatrix(x.matrixWorldInverse);Fa.setRGB(0,0,0);xa.setRGB(0,0,0);Ja.setRGB(0,0,0);for(var C=0,F=y.length;C<F;C++){var A=y[C],G=A.color;A instanceof THREE.AmbientLight?Fa.add(G):A instanceof THREE.DirectionalLight?xa.add(G):A instanceof THREE.PointLight&&Ja.add(G)}C=0;for(F=t.length;C<F;C++){var H=t[C],K=H.material;if(void 0!==K&&!1!==K.visible){qa.makeEmpty();if(H instanceof THREE.RenderableSprite){X=H;X.x*=D;X.y*=M;var A=X,m=H,G=K;h(G.opacity);k(G.blending);
+var L=m.scale.x*D,m=m.scale.y*M,H=0.5*Math.sqrt(L*L+m*m);qa.min.set(A.x-H,A.y-H);qa.max.set(A.x+H,A.y+H);if(G instanceof THREE.SpriteMaterial||G instanceof THREE.ParticleSystemMaterial){var P=G.map;if(null!==P){!1===P.hasEventListener("update",d)&&(void 0!==P.image&&0<P.image.width&&e(P),P.addEventListener("update",d));H=Ha[P.id];void 0!==H?s(H):s("rgba( 0, 0, 0, 1 )");var B=P.image,H=B.width*P.offset.x,K=B.height*P.offset.y,Q=B.width*P.repeat.x,P=B.height*P.repeat.y,B=L/Q,R=m/P;z.save();z.translate(A.x,
+A.y);0!==G.rotation&&z.rotate(G.rotation);z.translate(-L/2,-m/2);z.scale(B,R);z.translate(-H,-K);z.fillRect(H,K,Q,P)}else s(G.color.getStyle()),z.save(),z.translate(A.x,A.y),0!==G.rotation&&z.rotate(G.rotation),z.scale(L,-m),z.fillRect(-0.5,-0.5,1,1);z.restore()}else G instanceof THREE.SpriteCanvasMaterial&&(p(G.color.getStyle()),s(G.color.getStyle()),z.save(),z.translate(A.x,A.y),0!==G.rotation&&z.rotate(G.rotation),z.scale(L,m),G.program(z),z.restore())}else if(H instanceof THREE.RenderableLine){if(X=
+H.v1,J=H.v2,X.positionScreen.x*=D,X.positionScreen.y*=M,J.positionScreen.x*=D,J.positionScreen.y*=M,qa.setFromPoints([X.positionScreen,J.positionScreen]),!0===ca.isIntersectionBox(qa))if(A=X,G=J,L=H,m=K,h(m.opacity),k(m.blending),z.beginPath(),z.moveTo(A.positionScreen.x,A.positionScreen.y),z.lineTo(G.positionScreen.x,G.positionScreen.y),m instanceof THREE.LineBasicMaterial){l(m.linewidth);n(m.linecap);r(m.linejoin);if(m.vertexColors!==THREE.VertexColors)p(m.color.getStyle());else if(H=L.vertexColors[0].getStyle(),
+L=L.vertexColors[1].getStyle(),H===L)p(H);else{try{var Y=z.createLinearGradient(A.positionScreen.x,A.positionScreen.y,G.positionScreen.x,G.positionScreen.y);Y.addColorStop(0,H);Y.addColorStop(1,L)}catch(ka){Y=H}p(Y)}z.stroke();qa.expandByScalar(2*m.linewidth)}else m instanceof THREE.LineDashedMaterial&&(l(m.linewidth),n(m.linecap),r(m.linejoin),p(m.color.getStyle()),u(m.dashSize,m.gapSize),z.stroke(),qa.expandByScalar(2*m.linewidth),u(null,null))}else if(H instanceof THREE.RenderableFace){X=H.v1;
+J=H.v2;S=H.v3;if(-1>X.positionScreen.z||1<X.positionScreen.z)continue;if(-1>J.positionScreen.z||1<J.positionScreen.z)continue;if(-1>S.positionScreen.z||1<S.positionScreen.z)continue;X.positionScreen.x*=D;X.positionScreen.y*=M;J.positionScreen.x*=D;J.positionScreen.y*=M;S.positionScreen.x*=D;S.positionScreen.y*=M;0<K.overdraw&&(g(X.positionScreen,J.positionScreen,K.overdraw),g(J.positionScreen,S.positionScreen,K.overdraw),g(S.positionScreen,X.positionScreen,K.overdraw));qa.setFromPoints([X.positionScreen,
+J.positionScreen,S.positionScreen]);if(!0===ca.isIntersectionBox(qa)){G=X;L=J;m=S;A=K;w.info.render.vertices+=3;w.info.render.faces++;h(A.opacity);k(A.blending);fa=G.positionScreen.x;I=G.positionScreen.y;ia=L.positionScreen.x;ta=L.positionScreen.y;T=m.positionScreen.x;wa=m.positionScreen.y;var K=fa,Q=I,P=ia,B=ta,R=T,Ab=wa;z.beginPath();z.moveTo(K,Q);z.lineTo(P,B);z.lineTo(R,Ab);z.closePath();if((A instanceof THREE.MeshLambertMaterial||A instanceof THREE.MeshPhongMaterial)&&null===A.map){Ga.copy(A.color);
+Ia.copy(A.emissive);A.vertexColors===THREE.FaceColors&&Ga.multiply(H.color);aa.copy(Fa);Ka.copy(G.positionWorld).add(L.positionWorld).add(m.positionWorld).divideScalar(3);G=Ka;L=H.normalModel;m=aa;H=0;for(K=y.length;H<K;H++)Q=y[H],Aa.copy(Q.color),Q instanceof THREE.DirectionalLight?(P=Ba.setFromMatrixPosition(Q.matrixWorld).normalize(),B=L.dot(P),0>=B||(B*=Q.intensity,m.add(Aa.multiplyScalar(B)))):Q instanceof THREE.PointLight&&(P=Ba.setFromMatrixPosition(Q.matrixWorld),B=L.dot(Ba.subVectors(P,G).normalize()),
+0>=B||(B*=0==Q.distance?1:1-Math.min(G.distanceTo(P)/Q.distance,1),0!=B&&(B*=Q.intensity,m.add(Aa.multiplyScalar(B)))));aa.multiply(Ga).add(Ia);!0===A.wireframe?b(aa,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):c(aa)}else A instanceof THREE.MeshBasicMaterial||A instanceof THREE.MeshLambertMaterial||A instanceof THREE.MeshPhongMaterial?null!==A.map?A.map.mapping instanceof THREE.UVMapping&&(Ca=H.uvs,f(fa,I,ia,ta,T,wa,Ca[0].x,Ca[0].y,Ca[1].x,Ca[1].y,Ca[2].x,Ca[2].y,A.map)):null!==A.envMap?
+A.envMap.mapping instanceof THREE.SphericalReflectionMapping?(ha.copy(H.vertexNormalsModel[0]).applyMatrix3(la),Da=0.5*ha.x+0.5,Ra=0.5*ha.y+0.5,ha.copy(H.vertexNormalsModel[1]).applyMatrix3(la),Sa=0.5*ha.x+0.5,Ea=0.5*ha.y+0.5,ha.copy(H.vertexNormalsModel[2]).applyMatrix3(la),ga=0.5*ha.x+0.5,ua=0.5*ha.y+0.5,f(fa,I,ia,ta,T,wa,Da,Ra,Sa,Ea,ga,ua,A.envMap)):A.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ha.copy(H.vertexNormalsModel[0]).applyMatrix3(la),Da=-0.5*ha.x+0.5,Ra=-0.5*ha.y+0.5,
+ha.copy(H.vertexNormalsModel[1]).applyMatrix3(la),Sa=-0.5*ha.x+0.5,Ea=-0.5*ha.y+0.5,ha.copy(H.vertexNormalsModel[2]).applyMatrix3(la),ga=-0.5*ha.x+0.5,ua=-0.5*ha.y+0.5,f(fa,I,ia,ta,T,wa,Da,Ra,Sa,Ea,ga,ua,A.envMap)):(aa.copy(A.color),A.vertexColors===THREE.FaceColors&&aa.multiply(H.color),!0===A.wireframe?b(aa,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):c(aa)):(A instanceof THREE.MeshDepthMaterial?aa.r=aa.g=aa.b=1-q(G.positionScreen.z*G.positionScreen.w,da.near,da.far):A instanceof
+THREE.MeshNormalMaterial?(ha.copy(H.normalModel).applyMatrix3(la),aa.setRGB(ha.x,ha.y,ha.z).multiplyScalar(0.5).addScalar(0.5)):aa.setRGB(1,1,1),!0===A.wireframe?b(aa,A.wireframeLinewidth,A.wireframeLinecap,A.wireframeLinejoin):c(aa))}}V.union(qa)}}}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",fog_fragment:"#ifdef USE_FOG\n\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#ifdef FOG_EXP2\n\t\tconst float LOG2 = 1.442695;\n\t\tfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\n\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
 envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\tuniform samplerCube envMap;\n\tuniform float flipEnvMap;\n\tuniform int combine;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\t\tuniform bool useRefract;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\n\tvec3 reflectVec;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = normalize( vec3( vec4( normal, 0.0 ) * viewMatrix ) );\n\t\tif ( useRefract ) {\n\t\t\treflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t} else { \n\t\t\treflectVec = reflect( cameraToVertex, worldNormal );\n\t\t}\n\t#else\n\t\treflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t\tvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#endif\n\t#ifdef GAMMA_INPUT\n\t\tcubeColor.xyz *= cubeColor.xyz;\n\t#endif\n\tif ( combine == 1 ) {\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n\t} else if ( combine == 2 ) {\n\t\tgl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n\t} else {\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n\t}\n#endif",
 envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n\tuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#endif\n\t#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\t#endif\n\t#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\t#endif\n#endif",
 envmap_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\tvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\n\tworldNormal = normalize( worldNormal );\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tif ( useRefract ) {\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t} else {\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t}\n#endif",
@@ -396,21 +396,21 @@ function c(a,b){var c=b.geometry,g=a.faces3,h=3*g.length,k=1*g.length,l=3*g.leng
 !0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function g(a,b,c,d){for(var e in b){var f=b[e],g=c[e];if(0<=
 f)if(g){var h=g.itemSize;m.bindBuffer(m.ARRAY_BUFFER,g.buffer);k(f);m.vertexAttribPointer(f,h,m.FLOAT,!1,0,d*h*4)}else a.defaultAttributeValues&&(2===a.defaultAttributeValues[e].length?m.vertexAttrib2fv(f,a.defaultAttributeValues[e]):3===a.defaultAttributeValues[e].length&&m.vertexAttrib3fv(f,a.defaultAttributeValues[e]))}l()}function h(){for(var a=0,b=la.length;a<b;a++)la[a]=0}function k(a){la[a]=1;0===ma[a]&&(m.enableVertexAttribArray(a),ma[a]=1)}function l(){for(var a=0,b=ma.length;a<b;a++)ma[a]!==
 la[a]&&(m.disableVertexAttribArray(a),ma[a]=0)}function n(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function r(a,b){return b[0]-a[0]}function p(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)Ga=ta=null,wa=aa=Ha=Aa=ga=Ea=Ca=-1,Xa=!0,a[d].render(b,c,Ka,ha),Ga=ta=null,wa=aa=Ha=Aa=ga=Ea=Ca=-1,Xa=!0}function s(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&&I.setBlending(k.blending,
-k.blendEquation,k.blendSrc,k.blendDst);I.setDepthTest(k.depthTest);I.setDepthWrite(k.depthWrite);C(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits)}I.setMaterialFaces(k);l instanceof THREE.BufferGeometry?I.renderBufferDirect(d,e,f,k,l,m):I.renderBuffer(d,e,f,k,l,m)}}function u(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&&I.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);I.setDepthTest(h.depthTest);
-I.setDepthWrite(h.depthWrite);C(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}I.renderImmediateObject(c,d,e,h,k)}}function q(a,d){var e,f,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,f=a.geometry,void 0!==f&&void 0===f.__webglInit))if(f.__webglInit=!0,f.addEventListener("dispose",Bb),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.blendEquation,k.blendSrc,k.blendDst);I.setDepthTest(k.depthTest);I.setDepthWrite(k.depthWrite);G(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits)}I.setMaterialFaces(k);l instanceof THREE.BufferGeometry?I.renderBufferDirect(d,e,f,k,l,m):I.renderBuffer(d,e,f,k,l,m)}}function u(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&&I.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);I.setDepthTest(h.depthTest);
+I.setDepthWrite(h.depthWrite);G(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}I.renderImmediateObject(c,d,e,h,k)}}function q(a,d){var e,f,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,f=a.geometry,void 0!==f&&void 0===f.__webglInit))if(f.__webglInit=!0,f.addEventListener("dispose",Bb),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,rb?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());I.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(),I.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(),I.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)w(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=f.geometryGroups[e],w(d.__webglObjects,g,a)}else a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,w(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 w(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 t(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function x(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Line?F(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)&&F(b.__webglObjectsImmediate,a);delete a.__webglActive}function F(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function z(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function N(a,b,c,d,e){Ia=0;d.needsUpdate&&(d.program&&Cb(d),I.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(I.maxMorphTargets));
-var f=!1,g=d.program,h=g.uniforms,k=d.uniforms;g.id!==ta&&(m.useProgram(g.program),ta=g.id,f=!0);d.id!==wa&&(wa=d.id,f=!0);if(f||a!==Ga)m.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),a!==Ga&&(Ga=a);if(d.skinning)if(xb&&e.useVertexTexture){if(null!==h.boneTexture){var l=H();m.uniform1i(h.boneTexture,l);I.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(Xa){var n,p=l=0,q=0,s,r,u,t=Ob,v=t.directional.colors,w=t.directional.positions,x=t.point.colors,F=t.point.positions,B=t.point.distances,z=t.spot.colors,D=
-t.spot.positions,C=t.spot.distances,G=t.spot.directions,N=t.spot.anglesCos,A=t.spot.exponents,Q=t.hemi.skyColors,J=t.hemi.groundColors,ia=t.hemi.positions,aa=0,R=0,Y=0,X=0,cc=0,Z=0,$=0,T=0,S=n=0;c=u=S=0;for(f=b.length;c<f;c++)if(n=b[c],!n.onlyShadow)if(s=n.color,r=n.intensity,u=n.distance,n instanceof THREE.AmbientLight)n.visible&&(I.gammaInput?(l+=s.r*s.r,p+=s.g*s.g,q+=s.b*s.b):(l+=s.r,p+=s.g,q+=s.b));else if(n instanceof THREE.DirectionalLight){if(cc+=1,n.visible&&(oa.setFromMatrixPosition(n.matrixWorld),
-va.setFromMatrixPosition(n.target.matrixWorld),oa.sub(va),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))n=3*aa,w[n]=oa.x,w[n+1]=oa.y,w[n+2]=oa.z,I.gammaInput?E(v,n,s,r*r):L(v,n,s,r),aa+=1}else n instanceof THREE.PointLight?(Z+=1,n.visible&&(S=3*R,I.gammaInput?E(x,S,s,r*r):L(x,S,s,r),va.setFromMatrixPosition(n.matrixWorld),F[S]=va.x,F[S+1]=va.y,F[S+2]=va.z,B[R]=u,R+=1)):n instanceof THREE.SpotLight?($+=1,n.visible&&(S=3*Y,I.gammaInput?E(z,S,s,r*r):L(z,S,s,r),va.setFromMatrixPosition(n.matrixWorld),
-D[S]=va.x,D[S+1]=va.y,D[S+2]=va.z,C[Y]=u,oa.copy(va),va.setFromMatrixPosition(n.target.matrixWorld),oa.sub(va),oa.normalize(),G[S]=oa.x,G[S+1]=oa.y,G[S+2]=oa.z,N[Y]=Math.cos(n.angle),A[Y]=n.exponent,Y+=1)):n instanceof THREE.HemisphereLight&&(T+=1,n.visible&&(oa.setFromMatrixPosition(n.matrixWorld),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))&&(u=3*X,ia[u]=oa.x,ia[u+1]=oa.y,ia[u+2]=oa.z,s=n.color,n=n.groundColor,I.gammaInput?(r*=r,E(Q,u,s,r),E(J,u,n,r)):(L(Q,u,s,r),L(J,u,n,r)),X+=1);c=3*aa;for(f=
-Math.max(v.length,3*cc);c<f;c++)v[c]=0;c=3*R;for(f=Math.max(x.length,3*Z);c<f;c++)x[c]=0;c=3*Y;for(f=Math.max(z.length,3*$);c<f;c++)z[c]=0;c=3*X;for(f=Math.max(Q.length,3*T);c<f;c++)Q[c]=0;c=3*X;for(f=Math.max(J.length,3*T);c<f;c++)J[c]=0;t.directional.length=aa;t.point.length=R;t.spot.length=Y;t.hemi.length=X;t.ambient[0]=l;t.ambient[1]=p;t.ambient[2]=q;Xa=!1}c=Ob;k.ambientLightColor.value=c.ambient;k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;
+THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function w(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 t(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function y(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Line?E(b.__webglObjects,a):a instanceof THREE.Sprite?x(b.__webglSprites,a):a instanceof THREE.LensFlare?
+x(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&E(b.__webglObjectsImmediate,a);delete a.__webglActive}function E(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function x(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function L(a,b,c,d,e){Ia=0;d.needsUpdate&&(d.program&&Cb(d),I.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(I.maxMorphTargets));
+var f=!1,g=d.program,h=g.uniforms,k=d.uniforms;g.id!==ta&&(m.useProgram(g.program),ta=g.id,f=!0);d.id!==wa&&(wa=d.id,f=!0);if(f||a!==Ga)m.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),a!==Ga&&(Ga=a);if(d.skinning)if(xb&&e.useVertexTexture){if(null!==h.boneTexture){var l=A();m.uniform1i(h.boneTexture,l);I.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(Xa){var n,p=l=0,q=0,s,r,u,t=Ob,v=t.directional.colors,w=t.directional.positions,y=t.point.colors,E=t.point.positions,z=t.point.distances,x=t.spot.colors,C=
+t.spot.positions,G=t.spot.distances,H=t.spot.directions,L=t.spot.anglesCos,B=t.spot.exponents,Q=t.hemi.skyColors,J=t.hemi.groundColors,ia=t.hemi.positions,aa=0,R=0,Y=0,X=0,cc=0,Z=0,$=0,T=0,S=n=0;c=u=S=0;for(f=b.length;c<f;c++)if(n=b[c],!n.onlyShadow)if(s=n.color,r=n.intensity,u=n.distance,n instanceof THREE.AmbientLight)n.visible&&(I.gammaInput?(l+=s.r*s.r,p+=s.g*s.g,q+=s.b*s.b):(l+=s.r,p+=s.g,q+=s.b));else if(n instanceof THREE.DirectionalLight){if(cc+=1,n.visible&&(oa.setFromMatrixPosition(n.matrixWorld),
+va.setFromMatrixPosition(n.target.matrixWorld),oa.sub(va),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))n=3*aa,w[n]=oa.x,w[n+1]=oa.y,w[n+2]=oa.z,I.gammaInput?D(v,n,s,r*r):M(v,n,s,r),aa+=1}else n instanceof THREE.PointLight?(Z+=1,n.visible&&(S=3*R,I.gammaInput?D(y,S,s,r*r):M(y,S,s,r),va.setFromMatrixPosition(n.matrixWorld),E[S]=va.x,E[S+1]=va.y,E[S+2]=va.z,z[R]=u,R+=1)):n instanceof THREE.SpotLight?($+=1,n.visible&&(S=3*Y,I.gammaInput?D(x,S,s,r*r):M(x,S,s,r),va.setFromMatrixPosition(n.matrixWorld),
+C[S]=va.x,C[S+1]=va.y,C[S+2]=va.z,G[Y]=u,oa.copy(va),va.setFromMatrixPosition(n.target.matrixWorld),oa.sub(va),oa.normalize(),H[S]=oa.x,H[S+1]=oa.y,H[S+2]=oa.z,L[Y]=Math.cos(n.angle),B[Y]=n.exponent,Y+=1)):n instanceof THREE.HemisphereLight&&(T+=1,n.visible&&(oa.setFromMatrixPosition(n.matrixWorld),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))&&(u=3*X,ia[u]=oa.x,ia[u+1]=oa.y,ia[u+2]=oa.z,s=n.color,n=n.groundColor,I.gammaInput?(r*=r,D(Q,u,s,r),D(J,u,n,r)):(M(Q,u,s,r),M(J,u,n,r)),X+=1);c=3*aa;for(f=
+Math.max(v.length,3*cc);c<f;c++)v[c]=0;c=3*R;for(f=Math.max(y.length,3*Z);c<f;c++)y[c]=0;c=3*Y;for(f=Math.max(x.length,3*$);c<f;c++)x[c]=0;c=3*X;for(f=Math.max(Q.length,3*T);c<f;c++)Q[c]=0;c=3*X;for(f=Math.max(J.length,3*T);c<f;c++)J[c]=0;t.directional.length=aa;t.point.length=R;t.spot.length=Y;t.hemi.length=X;t.ambient[0]=l;t.ambient[1]=p;t.ambient[2]=q;Xa=!1}c=Ob;k.ambientLightColor.value=c.ambient;k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;
 k.pointLightColor.value=c.point.colors;k.pointLightPosition.value=c.point.positions;k.pointLightDistance.value=c.point.distances;k.spotLightColor.value=c.spot.colors;k.spotLightPosition.value=c.spot.positions;k.spotLightDistance.value=c.spot.distances;k.spotLightDirection.value=c.spot.directions;k.spotLightAngleCos.value=c.spot.anglesCos;k.spotLightExponent.value=c.spot.exponents;k.hemisphereLightSkyColor.value=c.hemi.skyColors;k.hemisphereLightGroundColor.value=c.hemi.groundColors;k.hemisphereLightDirection.value=
 c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=d.opacity;I.gammaInput?k.diffuse.value.copyGammaToLinear(d.color):k.diffuse.value=d.color;k.map.value=d.map;k.lightMap.value=d.lightMap;k.specularMap.value=d.specularMap;d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale);d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale));var V;d.map?V=d.map:d.specularMap?
 V=d.specularMap:d.normalMap?V=d.normalMap:d.bumpMap&&(V=d.bumpMap);void 0!==V&&(c=V.offset,V=V.repeat,k.offsetRepeat.value.set(c.x,c.y,V.x,V.y));k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio;k.combine.value=d.combine;k.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=
@@ -419,24 +419,24 @@ k.specular.value.copyGammaToLinear(d.specular)):(k.ambient.value=d.ambient,k.emi
 a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(k.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(c=V=0,f=b.length;c<f;c++)l=b[c],l.castShadow&&(l instanceof THREE.SpotLight||l instanceof THREE.DirectionalLight&&!l.shadowCascade)&&(k.shadowMap.value[V]=l.shadowMap,k.shadowMapSize.value[V]=l.shadowMapSize,k.shadowMatrix.value[V]=l.shadowMatrix,k.shadowDarkness.value[V]=l.shadowDarkness,k.shadowBias.value[V]=l.shadowBias,V++);b=d.uniformsList;
 k=0;for(V=b.length;k<V;k++)if(f=g.uniforms[b[k][1]])if(c=b[k][0],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"===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=H(),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",Db),c.image.__webglTextureCube=m.createTexture(),I.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++)I.autoScaleCubemaps&&!f?(q=l,t=p,v=c.image[p],x=Ab,v.width<=x&&v.height<=x||(F=Math.max(v.width,v.height),w=Math.floor(v.width*x/F),x=Math.floor(v.height*x/F),F=document.createElement("canvas"),F.width=
-w,F.height=x,F.getContext("2d").drawImage(v,0,0,v.width,v.height,0,0,w,x),v=F),q[t]=v):l[p]=c.image[p];p=l[0];q=THREE.Math.isPowerOfTwo(p.width)&&THREE.Math.isPowerOfTwo(p.height);t=y(c.format);v=y(c.type);O(m.TEXTURE_CUBE_MAP,c,q);for(p=0;6>p;p++)if(f)for(x=l[p].mipmaps,F=0,B=x.length;F<B;F++)w=x[F],c.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+p,F,t,w.width,w.height,0,w.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+p,F,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)):I.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]=H();m.uniform1iv(f,c._array);p=0;for(q=
+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=A(),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",Db),c.image.__webglTextureCube=m.createTexture(),I.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++)I.autoScaleCubemaps&&!f?(q=l,t=p,v=c.image[p],y=Ab,v.width<=y&&v.height<=y||(E=Math.max(v.width,v.height),w=Math.floor(v.width*y/E),y=Math.floor(v.height*y/E),E=document.createElement("canvas"),E.width=
+w,E.height=y,E.getContext("2d").drawImage(v,0,0,v.width,v.height,0,0,w,y),v=E),q[t]=v):l[p]=c.image[p];p=l[0];q=THREE.Math.isPowerOfTwo(p.width)&&THREE.Math.isPowerOfTwo(p.height);t=F(c.format);v=F(c.type);P(m.TEXTURE_CUBE_MAP,c,q);for(p=0;6>p;p++)if(f)for(y=l[p].mipmaps,E=0,z=y.length;E<z;E++)w=y[E],c.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+p,E,t,w.width,w.height,0,w.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+p,E,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)):I.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]=A();m.uniform1iv(f,c._array);p=0;for(q=
 c.value.length;p<q;p++)t=c.value[p],l=c._array[p],t&&I.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&&(va.setFromMatrixPosition(a.matrixWorld),m.uniform3f(h.cameraPosition,va.x,va.y,va.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 H(){var a=Ia;a>=Pb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Pb);Ia+=1;return a}function E(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 L(a,b,c,
-d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function B(a){a!==qa&&(m.lineWidth(a),qa=a)}function C(a,b,c){ua!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),ua=a);!a||ca===b&&V===c||(m.polygonOffset(b,c),ca=b,V=c)}function O(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,y(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,y(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,y(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,y(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),
-m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,A(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,A(b.minFilter)));cb&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(m.texParameterf(a,cb.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Eb)),b.__oldAnisotropy=b.anisotropy)}function D(a,b){m.bindRenderbuffer(m.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,
-m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,b.width,b.height)}function A(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?m.NEAREST:m.LINEAR}function y(a){if(a===THREE.RepeatWrapping)return m.REPEAT;if(a===THREE.ClampToEdgeWrapping)return m.CLAMP_TO_EDGE;
+!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 A(){var a=Ia;a>=Pb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Pb);Ia+=1;return a}function D(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function M(a,b,c,
+d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function z(a){a!==qa&&(m.lineWidth(a),qa=a)}function G(a,b,c){ua!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),ua=a);!a||ca===b&&V===c||(m.polygonOffset(b,c),ca=b,V=c)}function P(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,F(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,F(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,F(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,F(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),
+m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,B(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,B(b.minFilter)));cb&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(m.texParameterf(a,cb.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Eb)),b.__oldAnisotropy=b.anisotropy)}function C(a,b){m.bindRenderbuffer(m.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,
+m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,b.width,b.height)}function B(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?m.NEAREST:m.LINEAR}function F(a){if(a===THREE.RepeatWrapping)return m.REPEAT;if(a===THREE.ClampToEdgeWrapping)return m.CLAMP_TO_EDGE;
 if(a===THREE.MirroredRepeatWrapping)return m.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return m.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return m.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return m.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return m.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return m.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return m.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return m.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return m.UNSIGNED_SHORT_4_4_4_4;
 if(a===THREE.UnsignedShort5551Type)return m.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return m.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return m.BYTE;if(a===THREE.ShortType)return m.SHORT;if(a===THREE.UnsignedShortType)return m.UNSIGNED_SHORT;if(a===THREE.IntType)return m.INT;if(a===THREE.UnsignedIntType)return m.UNSIGNED_INT;if(a===THREE.FloatType)return m.FLOAT;if(a===THREE.AlphaFormat)return m.ALPHA;if(a===THREE.RGBFormat)return m.RGB;if(a===THREE.RGBAFormat)return m.RGBA;if(a===
 THREE.LuminanceFormat)return m.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return m.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return m.FUNC_ADD;if(a===THREE.SubtractEquation)return m.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return m.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return m.ZERO;if(a===THREE.OneFactor)return m.ONE;if(a===THREE.SrcColorFactor)return m.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return m.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return m.SRC_ALPHA;if(a===
 THREE.OneMinusSrcAlphaFactor)return m.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return m.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return m.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return m.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return m.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return m.SRC_ALPHA_SATURATE;if(void 0!==Oa){if(a===THREE.RGB_S3TC_DXT1_Format)return Oa.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Oa.COMPRESSED_RGBA_S3TC_DXT1_EXT;
-if(a===THREE.RGBA_S3TC_DXT3_Format)return Oa.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Oa.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var K=void 0!==a.canvas?a.canvas:document.createElement("canvas"),G=void 0!==a.context?a.context:null,Q=void 0!==a.precision?a.precision:"highp",Y=void 0!==a.alpha?a.alpha:!1,R=void 0!==a.depth?a.depth:!0,ka=void 0!==a.stencil?a.stencil:!0,da=void 0!==a.antialias?a.antialias:!1,X=void 0!==
+if(a===THREE.RGBA_S3TC_DXT3_Format)return Oa.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Oa.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var K=void 0!==a.canvas?a.canvas:document.createElement("canvas"),H=void 0!==a.context?a.context:null,Q=void 0!==a.precision?a.precision:"highp",Y=void 0!==a.alpha?a.alpha:!1,R=void 0!==a.depth?a.depth:!0,ka=void 0!==a.stencil?a.stencil:!0,da=void 0!==a.antialias?a.antialias:!1,X=void 0!==
 a.premultipliedAlpha?a.premultipliedAlpha:!0,J=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,S=new THREE.Color(0),fa=0;this.domElement=K;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=
 THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var I=this,ia=[],ta=null,T=null,wa=-1,aa=null,Ga=null,Ia=0,Aa=-1,Ha=-1,Ca=-1,Da=-1,Ra=-1,Sa=-1,Ea=-1,ga=-1,ua=null,ca=null,V=null,qa=null,Fa=0,xa=0,Ja=K.width,Ba=K.height,
 Ka=0,ha=0,la=new Uint8Array(16),ma=new Uint8Array(16),wb=new THREE.Frustum,Nb=new THREE.Matrix4,ac=new THREE.Matrix4,va=new THREE.Vector3,oa=new THREE.Vector3,Xa=!0,Ob={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,nb,qb,cb,Oa,rb;(function(){try{var a={alpha:Y,depth:R,stencil:ka,
-antialias:da,premultipliedAlpha:X,preserveDrawingBuffer:J};m=G||K.getContext("webgl",a)||K.getContext("experimental-webgl",a);if(null===m)throw"Error creating WebGL context.";}catch(b){console.error(b)}nb=m.getExtension("OES_texture_float");m.getExtension("OES_texture_float_linear");qb=m.getExtension("OES_standard_derivatives");cb=m.getExtension("EXT_texture_filter_anisotropic")||m.getExtension("MOZ_EXT_texture_filter_anisotropic")||m.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Oa=m.getExtension("WEBGL_compressed_texture_s3tc")||
+antialias:da,premultipliedAlpha:X,preserveDrawingBuffer:J};m=H||K.getContext("webgl",a)||K.getContext("experimental-webgl",a);if(null===m)throw"Error creating WebGL context.";}catch(b){console.error(b)}nb=m.getExtension("OES_texture_float");m.getExtension("OES_texture_float_linear");qb=m.getExtension("OES_standard_derivatives");cb=m.getExtension("EXT_texture_filter_anisotropic")||m.getExtension("MOZ_EXT_texture_filter_anisotropic")||m.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Oa=m.getExtension("WEBGL_compressed_texture_s3tc")||
 m.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||m.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");rb=m.getExtension("OES_element_index_uint");null===nb&&console.log("THREE.WebGLRenderer: Float textures not supported.");null===qb&&console.log("THREE.WebGLRenderer: Standard derivatives not supported.");null===cb&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");null===Oa&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");null===rb&&
 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);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.viewport(Fa,xa,Ja,Ba);m.clearColor(S.r,
 S.g,S.b,fa);this.context=m;var Pb=m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),bc=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS);m.getParameter(m.MAX_TEXTURE_SIZE);var Ab=m.getParameter(m.MAX_CUBE_MAP_TEXTURE_SIZE),Eb=cb?m.getParameter(cb.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Fb=0<bc,xb=Fb&&nb;Oa&&m.getParameter(m.COMPRESSED_TEXTURE_FORMATS);var dc=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.HIGH_FLOAT),ec=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,
@@ -453,11 +453,11 @@ m.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&m.delet
 a=0;for(c=ia.length;a<c;a++)if(d=ia[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=ia.length;a<c;a++)d=ia[a],d.program!==b&&e.push(d);ia=e;m.deleteProgram(b);I.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){h();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),k(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,p,n,q,s,r,t,u,v=3*a.count;for(u=0;u<v;u+=9)t=a.normalArray,d=t[u],e=t[u+1],f=t[u+2],g=t[u+3],n=
 t[u+4],s=t[u+5],p=t[u+6],q=t[u+7],r=t[u+8],d=(d+g+p)/3,e=(e+n+q)/3,f=(f+s+r)/3,t[u]=d,t[u+1]=e,t[u+2]=f,t[u+3]=d,t[u+4]=e,t[u+5]=f,t[u+6]=d,t[u+7]=e,t[u+8]=f}m.bufferData(m.ARRAY_BUFFER,a.normalArray,m.DYNAMIC_DRAW);k(b.attributes.normal);m.vertexAttribPointer(b.attributes.normal,3,m.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglUvBuffer),m.bufferData(m.ARRAY_BUFFER,a.uvArray,m.DYNAMIC_DRAW),k(b.attributes.uv),m.vertexAttribPointer(b.attributes.uv,2,m.FLOAT,!1,0,0));a.hasColors&&
-c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),k(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));l();m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var k=N(a,b,c,d,f);a=k.attributes;b=e.attributes;c=!1;k=16777215*e.id+2*k.id+(d.wireframe?1:0);k!==aa&&(aa=k,c=!0);c&&h();if(f instanceof THREE.Mesh)if(f=b.index){var l;
+c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),k(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));l();m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var k=L(a,b,c,d,f);a=k.attributes;b=e.attributes;c=!1;k=16777215*e.id+2*k.id+(d.wireframe?1:0);k!==aa&&(aa=k,c=!0);c&&h();if(f instanceof THREE.Mesh)if(f=b.index){var l;
 f.array instanceof Uint32Array?(k=m.UNSIGNED_INT,l=4):(k=m.UNSIGNED_SHORT,l=2);e=e.offsets;if(0===e.length)c&&(g(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.TRIANGLES,f.array.length,k,0),I.info.render.calls++,I.info.render.vertices+=f.array.length,I.info.render.faces+=f.array.length/3;else{c=!0;for(var p=0,n=e.length;p<n;p++){var q=e[p].index;c&&(g(d,a,b,q),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer));m.drawElements(m.TRIANGLES,e[p].count,k,e[p].start*l);I.info.render.calls++;
 I.info.render.vertices+=e[p].count;I.info.render.faces+=e[p].count/3}}}else c&&g(d,a,b,0),d=e.attributes.position,m.drawArrays(m.TRIANGLES,0,d.array.length/3),I.info.render.calls++,I.info.render.vertices+=d.array.length/3,I.info.render.faces+=d.array.length/9;else if(f instanceof THREE.ParticleSystem)c&&g(d,a,b,0),d=b.position,m.drawArrays(m.POINTS,0,d.array.length/3),I.info.render.calls++,I.info.render.points+=d.array.length/3;else if(f instanceof THREE.Line)if(k=f.type===THREE.LineStrip?m.LINE_STRIP:
-m.LINES,B(d.linewidth),f=b.index)if(f.array instanceof Uint32Array?(k=m.UNSIGNED_INT,l=4):(k=m.UNSIGNED_SHORT,l=2),e=e.offsets,0===e.length)c&&(g(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,f.array.length,k,0),I.info.render.calls++,I.info.render.vertices+=f.array.length;else for(1<e.length&&(c=!0),p=0,n=e.length;p<n;p++)q=e[p].index,c&&(g(d,a,b,q),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,e[p].count,k,e[p].start*l),I.info.render.calls++,
-I.info.render.vertices+=e[p].count;else c&&g(d,a,b,0),d=b.position,m.drawArrays(k,0,d.array.length/3),I.info.render.calls++,I.info.render.points+=d.array.length/3}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,p;c=N(a,b,c,d,f);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==aa&&(aa=c,a=!0);a&&h();if(!d.morphTargets&&0<=b.position)a&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),k(b.position),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));else if(f.morphTargetBase){c=
+m.LINES,z(d.linewidth),f=b.index)if(f.array instanceof Uint32Array?(k=m.UNSIGNED_INT,l=4):(k=m.UNSIGNED_SHORT,l=2),e=e.offsets,0===e.length)c&&(g(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,f.array.length,k,0),I.info.render.calls++,I.info.render.vertices+=f.array.length;else for(1<e.length&&(c=!0),p=0,n=e.length;p<n;p++)q=e[p].index,c&&(g(d,a,b,q),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,e[p].count,k,e[p].start*l),I.info.render.calls++,
+I.info.render.vertices+=e[p].count;else c&&g(d,a,b,0),d=b.position,m.drawArrays(k,0,d.array.length/3),I.info.render.calls++,I.info.render.points+=d.array.length/3}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,p;c=L(a,b,c,d,f);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==aa&&(aa=c,a=!0);a&&h();if(!d.morphTargets&&0<=b.position)a&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),k(b.position),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));else if(f.morphTargetBase){c=
 d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),k(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0)):0<=c.position&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),k(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var n=0;p=f.morphTargetForcedOrder;for(g=f.morphTargetInfluences;n<d.numSupportedMorphTargets&&n<p.length;)0<=c["morphTarget"+n]&&
 (m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[p[n]]),k(c["morphTarget"+n]),m.vertexAttribPointer(c["morphTarget"+n],3,m.FLOAT,!1,0,0)),0<=c["morphNormal"+n]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[p[n]]),k(c["morphNormal"+n]),m.vertexAttribPointer(c["morphNormal"+n],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[n]=g[p[n]],n++}else{p=[];g=f.morphTargetInfluences;var q,s=g.length;for(q=0;q<s;q++)n=g[q],0<n&&p.push([n,q]);p.length>d.numSupportedMorphTargets?
 (p.sort(r),p.length=d.numSupportedMorphTargets):p.length>d.numSupportedMorphNormals?p.sort(r):0===p.length&&p.push([0,0]);for(n=0;n<d.numSupportedMorphTargets;)p[n]?(q=p[n][1],0<=c["morphTarget"+n]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[q]),k(c["morphTarget"+n]),m.vertexAttribPointer(c["morphTarget"+n],3,m.FLOAT,!1,0,0)),0<=c["morphNormal"+n]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[q]),k(c["morphNormal"+n]),m.vertexAttribPointer(c["morphNormal"+
@@ -465,32 +465,32 @@ n],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[n]=g[q]):f.__webglMorphTarg
 c.size,m.FLOAT,!1,0,0));0<=b.color&&(0<f.geometry.colors.length||0<f.geometry.faces.length?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglColorBuffer),k(b.color),m.vertexAttribPointer(b.color,3,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglNormalBuffer),k(b.normal),m.vertexAttribPointer(b.normal,3,m.FLOAT,!1,0,0));0<=b.tangent&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglTangentBuffer),k(b.tangent),m.vertexAttribPointer(b.tangent,
 4,m.FLOAT,!1,0,0));0<=b.uv&&(f.geometry.faceVertexUvs[0]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUVBuffer),k(b.uv),m.vertexAttribPointer(b.uv,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(f.geometry.faceVertexUvs[1]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUV2Buffer),k(b.uv2),m.vertexAttribPointer(b.uv2,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&
 (m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),k(b.skinIndex),m.vertexAttribPointer(b.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),k(b.skinWeight),m.vertexAttribPointer(b.skinWeight,4,m.FLOAT,!1,0,0));0<=b.lineDistance&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglLineDistanceBuffer),k(b.lineDistance),m.vertexAttribPointer(b.lineDistance,1,m.FLOAT,!1,0,0))}l();f instanceof THREE.Mesh?(f=e.__typeArray===Uint32Array?m.UNSIGNED_INT:m.UNSIGNED_SHORT,d.wireframe?
-(B(d.wireframeLinewidth),a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),m.drawElements(m.LINES,e.__webglLineCount,f,0)):(a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),m.drawElements(m.TRIANGLES,e.__webglFaceCount,f,0)),I.info.render.calls++,I.info.render.vertices+=e.__webglFaceCount,I.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,B(d.linewidth),m.drawArrays(f,0,e.__webglLineCount),I.info.render.calls++):
+(z(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)),I.info.render.calls++,I.info.render.vertices+=e.__webglFaceCount,I.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,z(d.linewidth),m.drawArrays(f,0,e.__webglLineCount),I.info.render.calls++):
 f instanceof THREE.ParticleSystem&&(m.drawArrays(m.POINTS,0,e.__webglParticleCount),I.info.render.calls++,I.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h,k=a.__lights,l=a.fog;wa=-1;Xa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Nb.multiplyMatrices(b.projectionMatrix,
 b.matrixWorldInverse);wb.setFromMatrix(Nb);this.autoUpdateObjects&&this.initWebGLObjects(a);p(this.renderPluginsPre,a,b);I.info.render.calls=0;I.info.render.vertices=0;I.info.render.faces=0;I.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||
 wb.intersectsObject(g))){var q=g;q._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,q.matrixWorld);q._normalMatrix.getNormalMatrix(q._modelViewMatrix);var q=f,r=q.object,t=q.buffer,v=r.geometry,r=r.material;r instanceof THREE.MeshFaceMaterial?(r=r.materials[v instanceof THREE.BufferGeometry?0:t.materialIndex],r.transparent?(q.transparent=r,q.opaque=null):(q.opaque=r,q.transparent=null)):r&&(r.transparent?(q.transparent=r,q.opaque=null):(q.opaque=r,q.transparent=null));f.render=!0;!0===this.sortObjects&&
 (null!==g.renderDepth?f.z=g.renderDepth:(va.setFromMatrixPosition(g.matrixWorld),va.applyProjection(Nb),f.z=va.z))}this.sortObjects&&h.sort(n);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),C(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),s(a.__webglObjects,!1,"",b,k,l,!0,d),u(a.__webglObjectsImmediate,"",b,k,l,!1,d)):(d=null,this.setBlending(THREE.NoBlending),s(a.__webglObjects,!0,"opaque",b,k,l,!1,d),u(a.__webglObjectsImmediate,"opaque",b,k,l,!1,d),s(a.__webglObjects,!1,"transparent",b,k,l,!0,d),u(a.__webglObjectsImmediate,"transparent",b,k,l,!0,d));p(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=N(a,b,c,d,e);aa=-1;I.setMaterialFaces(d);
-e.immediateRenderCallback?e.immediateRenderCallback(f,m,wb):e.render(function(a){I.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)q(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)x(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;
-void 0===h.__webglInit&&(void 0!==h.__webglActive&&x(h,a),q(h,a));var k=h,l=k.geometry,p=void 0,n=void 0,s=void 0;if(l instanceof THREE.BufferGeometry){var u=m.DYNAMIC_DRAW,w=l.attributes,F=void 0,y=void 0;for(F in w)y=w[F],y.needsUpdate&&("index"===F?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,y.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,y.array,u)):(m.bindBuffer(m.ARRAY_BUFFER,y.buffer),m.bufferData(m.ARRAY_BUFFER,y.array,u)),y.needsUpdate=!1)}else if(k instanceof THREE.Mesh){for(var B=0,E=l.geometryGroupsList.length;B<
-E;B++)if(p=l.geometryGroupsList[B],s=d(k,p),l.buffersNeedUpdate&&c(p,k),n=s.attributes&&v(s),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||n){var z=p,D=k,C=m.DYNAMIC_DRAW,G=!l.dynamic,H=s;if(z.__inittedArrays){var K=e(H),L=H.vertexColors?H.vertexColors:!1,N=f(H),O=K===THREE.SmoothShading,A=void 0,I=void 0,Q=void 0,J=void 0,ia=void 0,aa=void 0,R=void 0,Y=void 0,S=void 0,V=void 0,X=void 0,T=void 0,
-Z=void 0,$=void 0,ta=void 0,Ia=void 0,Aa=void 0,da=void 0,Ha=void 0,wa=void 0,ga=void 0,fa=void 0,ha=void 0,Ga=void 0,ka=void 0,la=void 0,oa=void 0,qa=void 0,Ca=void 0,ca=void 0,Ea=void 0,xa=void 0,Ba=void 0,Fa=void 0,ma=void 0,Ja=void 0,ua=void 0,Da=void 0,Ra=void 0,Sa=void 0,ab=0,bb=0,Ka=0,Oa=0,Xa=0,db=0,Qa=0,ob=0,Ya=0,sa=0,ya=0,P=0,Pa=void 0,eb=z.__vertexArray,cb=z.__uvArray,nb=z.__uv2Array,sb=z.__normalArray,Ta=z.__tangentArray,fb=z.__colorArray,Ua=z.__skinIndexArray,Va=z.__skinWeightArray,rb=
-z.__morphTargetsArrays,wb=z.__morphNormalsArrays,qb=z.__webglCustomAttributesList,M=void 0,Rb=z.__faceArray,tb=z.__lineArray,La=D.geometry,Ab=La.elementsNeedUpdate,xb=La.uvsNeedUpdate,Db=La.normalsNeedUpdate,Fb=La.tangentsNeedUpdate,Ob=La.colorsNeedUpdate,Pb=La.morphTargetsNeedUpdate,gc=La.vertices,ea=z.faces3,gb=La.faces,Bb=La.faceVertexUvs[0],Cb=La.faceVertexUvs[1],hc=La.skinIndices,Sb=La.skinWeights,Tb=La.morphTargets,Eb=La.morphNormals;if(La.verticesNeedUpdate){A=0;for(I=ea.length;A<I;A++)J=gb[ea[A]],
-T=gc[J.a],Z=gc[J.b],$=gc[J.c],eb[bb]=T.x,eb[bb+1]=T.y,eb[bb+2]=T.z,eb[bb+3]=Z.x,eb[bb+4]=Z.y,eb[bb+5]=Z.z,eb[bb+6]=$.x,eb[bb+7]=$.y,eb[bb+8]=$.z,bb+=9;m.bindBuffer(m.ARRAY_BUFFER,z.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,eb,C)}if(Pb)for(ma=0,Ja=Tb.length;ma<Ja;ma++){A=ya=0;for(I=ea.length;A<I;A++)Ra=ea[A],J=gb[Ra],T=Tb[ma].vertices[J.a],Z=Tb[ma].vertices[J.b],$=Tb[ma].vertices[J.c],ua=rb[ma],ua[ya]=T.x,ua[ya+1]=T.y,ua[ya+2]=T.z,ua[ya+3]=Z.x,ua[ya+4]=Z.y,ua[ya+5]=Z.z,ua[ya+6]=$.x,ua[ya+7]=
-$.y,ua[ya+8]=$.z,H.morphNormals&&(O?(Sa=Eb[ma].vertexNormals[Ra],da=Sa.a,Ha=Sa.b,wa=Sa.c):wa=Ha=da=Eb[ma].faceNormals[Ra],Da=wb[ma],Da[ya]=da.x,Da[ya+1]=da.y,Da[ya+2]=da.z,Da[ya+3]=Ha.x,Da[ya+4]=Ha.y,Da[ya+5]=Ha.z,Da[ya+6]=wa.x,Da[ya+7]=wa.y,Da[ya+8]=wa.z),ya+=9;m.bindBuffer(m.ARRAY_BUFFER,z.__webglMorphTargetsBuffers[ma]);m.bufferData(m.ARRAY_BUFFER,rb[ma],C);H.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglMorphNormalsBuffers[ma]),m.bufferData(m.ARRAY_BUFFER,wb[ma],C))}if(Sb.length){A=0;for(I=
-ea.length;A<I;A++)J=gb[ea[A]],Ga=Sb[J.a],ka=Sb[J.b],la=Sb[J.c],Va[sa]=Ga.x,Va[sa+1]=Ga.y,Va[sa+2]=Ga.z,Va[sa+3]=Ga.w,Va[sa+4]=ka.x,Va[sa+5]=ka.y,Va[sa+6]=ka.z,Va[sa+7]=ka.w,Va[sa+8]=la.x,Va[sa+9]=la.y,Va[sa+10]=la.z,Va[sa+11]=la.w,oa=hc[J.a],qa=hc[J.b],Ca=hc[J.c],Ua[sa]=oa.x,Ua[sa+1]=oa.y,Ua[sa+2]=oa.z,Ua[sa+3]=oa.w,Ua[sa+4]=qa.x,Ua[sa+5]=qa.y,Ua[sa+6]=qa.z,Ua[sa+7]=qa.w,Ua[sa+8]=Ca.x,Ua[sa+9]=Ca.y,Ua[sa+10]=Ca.z,Ua[sa+11]=Ca.w,sa+=12;0<sa&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglSkinIndicesBuffer),
-m.bufferData(m.ARRAY_BUFFER,Ua,C),m.bindBuffer(m.ARRAY_BUFFER,z.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,Va,C))}if(Ob&&L){A=0;for(I=ea.length;A<I;A++)J=gb[ea[A]],R=J.vertexColors,Y=J.color,3===R.length&&L===THREE.VertexColors?(ga=R[0],fa=R[1],ha=R[2]):ha=fa=ga=Y,fb[Ya]=ga.r,fb[Ya+1]=ga.g,fb[Ya+2]=ga.b,fb[Ya+3]=fa.r,fb[Ya+4]=fa.g,fb[Ya+5]=fa.b,fb[Ya+6]=ha.r,fb[Ya+7]=ha.g,fb[Ya+8]=ha.b,Ya+=9;0<Ya&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,fb,C))}if(Fb&&
-La.hasTangents){A=0;for(I=ea.length;A<I;A++)J=gb[ea[A]],S=J.vertexTangents,ta=S[0],Ia=S[1],Aa=S[2],Ta[Qa]=ta.x,Ta[Qa+1]=ta.y,Ta[Qa+2]=ta.z,Ta[Qa+3]=ta.w,Ta[Qa+4]=Ia.x,Ta[Qa+5]=Ia.y,Ta[Qa+6]=Ia.z,Ta[Qa+7]=Ia.w,Ta[Qa+8]=Aa.x,Ta[Qa+9]=Aa.y,Ta[Qa+10]=Aa.z,Ta[Qa+11]=Aa.w,Qa+=12;m.bindBuffer(m.ARRAY_BUFFER,z.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,Ta,C)}if(Db&&K){A=0;for(I=ea.length;A<I;A++)if(J=gb[ea[A]],ia=J.vertexNormals,aa=J.normal,3===ia.length&&O)for(ca=0;3>ca;ca++)xa=ia[ca],sb[db]=xa.x,
-sb[db+1]=xa.y,sb[db+2]=xa.z,db+=3;else for(ca=0;3>ca;ca++)sb[db]=aa.x,sb[db+1]=aa.y,sb[db+2]=aa.z,db+=3;m.bindBuffer(m.ARRAY_BUFFER,z.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,sb,C)}if(xb&&Bb&&N){A=0;for(I=ea.length;A<I;A++)if(Q=ea[A],V=Bb[Q],void 0!==V)for(ca=0;3>ca;ca++)Ba=V[ca],cb[Ka]=Ba.x,cb[Ka+1]=Ba.y,Ka+=2;0<Ka&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,cb,C))}if(xb&&Cb&&N){A=0;for(I=ea.length;A<I;A++)if(Q=ea[A],X=Cb[Q],void 0!==X)for(ca=0;3>ca;ca++)Fa=
-X[ca],nb[Oa]=Fa.x,nb[Oa+1]=Fa.y,Oa+=2;0<Oa&&(m.bindBuffer(m.ARRAY_BUFFER,z.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,nb,C))}if(Ab){A=0;for(I=ea.length;A<I;A++)Rb[Xa]=ab,Rb[Xa+1]=ab+1,Rb[Xa+2]=ab+2,Xa+=3,tb[ob]=ab,tb[ob+1]=ab+1,tb[ob+2]=ab,tb[ob+3]=ab+2,tb[ob+4]=ab+1,tb[ob+5]=ab+2,ob+=6,ab+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,z.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,Rb,C);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,z.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,tb,C)}if(qb)for(ca=
-0,Ea=qb.length;ca<Ea;ca++)if(M=qb[ca],M.__original.needsUpdate){P=0;if(1===M.size)if(void 0===M.boundTo||"vertices"===M.boundTo)for(A=0,I=ea.length;A<I;A++)J=gb[ea[A]],M.array[P]=M.value[J.a],M.array[P+1]=M.value[J.b],M.array[P+2]=M.value[J.c],P+=3;else{if("faces"===M.boundTo)for(A=0,I=ea.length;A<I;A++)Pa=M.value[ea[A]],M.array[P]=Pa,M.array[P+1]=Pa,M.array[P+2]=Pa,P+=3}else if(2===M.size)if(void 0===M.boundTo||"vertices"===M.boundTo)for(A=0,I=ea.length;A<I;A++)J=gb[ea[A]],T=M.value[J.a],Z=M.value[J.b],
-$=M.value[J.c],M.array[P]=T.x,M.array[P+1]=T.y,M.array[P+2]=Z.x,M.array[P+3]=Z.y,M.array[P+4]=$.x,M.array[P+5]=$.y,P+=6;else{if("faces"===M.boundTo)for(A=0,I=ea.length;A<I;A++)$=Z=T=Pa=M.value[ea[A]],M.array[P]=T.x,M.array[P+1]=T.y,M.array[P+2]=Z.x,M.array[P+3]=Z.y,M.array[P+4]=$.x,M.array[P+5]=$.y,P+=6}else if(3===M.size){var ra;ra="c"===M.type?["r","g","b"]:["x","y","z"];if(void 0===M.boundTo||"vertices"===M.boundTo)for(A=0,I=ea.length;A<I;A++)J=gb[ea[A]],T=M.value[J.a],Z=M.value[J.b],$=M.value[J.c],
-M.array[P]=T[ra[0]],M.array[P+1]=T[ra[1]],M.array[P+2]=T[ra[2]],M.array[P+3]=Z[ra[0]],M.array[P+4]=Z[ra[1]],M.array[P+5]=Z[ra[2]],M.array[P+6]=$[ra[0]],M.array[P+7]=$[ra[1]],M.array[P+8]=$[ra[2]],P+=9;else if("faces"===M.boundTo)for(A=0,I=ea.length;A<I;A++)$=Z=T=Pa=M.value[ea[A]],M.array[P]=T[ra[0]],M.array[P+1]=T[ra[1]],M.array[P+2]=T[ra[2]],M.array[P+3]=Z[ra[0]],M.array[P+4]=Z[ra[1]],M.array[P+5]=Z[ra[2]],M.array[P+6]=$[ra[0]],M.array[P+7]=$[ra[1]],M.array[P+8]=$[ra[2]],P+=9;else if("faceVertices"===
-M.boundTo)for(A=0,I=ea.length;A<I;A++)Pa=M.value[ea[A]],T=Pa[0],Z=Pa[1],$=Pa[2],M.array[P]=T[ra[0]],M.array[P+1]=T[ra[1]],M.array[P+2]=T[ra[2]],M.array[P+3]=Z[ra[0]],M.array[P+4]=Z[ra[1]],M.array[P+5]=Z[ra[2]],M.array[P+6]=$[ra[0]],M.array[P+7]=$[ra[1]],M.array[P+8]=$[ra[2]],P+=9}else if(4===M.size)if(void 0===M.boundTo||"vertices"===M.boundTo)for(A=0,I=ea.length;A<I;A++)J=gb[ea[A]],T=M.value[J.a],Z=M.value[J.b],$=M.value[J.c],M.array[P]=T.x,M.array[P+1]=T.y,M.array[P+2]=T.z,M.array[P+3]=T.w,M.array[P+
-4]=Z.x,M.array[P+5]=Z.y,M.array[P+6]=Z.z,M.array[P+7]=Z.w,M.array[P+8]=$.x,M.array[P+9]=$.y,M.array[P+10]=$.z,M.array[P+11]=$.w,P+=12;else if("faces"===M.boundTo)for(A=0,I=ea.length;A<I;A++)$=Z=T=Pa=M.value[ea[A]],M.array[P]=T.x,M.array[P+1]=T.y,M.array[P+2]=T.z,M.array[P+3]=T.w,M.array[P+4]=Z.x,M.array[P+5]=Z.y,M.array[P+6]=Z.z,M.array[P+7]=Z.w,M.array[P+8]=$.x,M.array[P+9]=$.y,M.array[P+10]=$.z,M.array[P+11]=$.w,P+=12;else if("faceVertices"===M.boundTo)for(A=0,I=ea.length;A<I;A++)Pa=M.value[ea[A]],
-T=Pa[0],Z=Pa[1],$=Pa[2],M.array[P]=T.x,M.array[P+1]=T.y,M.array[P+2]=T.z,M.array[P+3]=T.w,M.array[P+4]=Z.x,M.array[P+5]=Z.y,M.array[P+6]=Z.z,M.array[P+7]=Z.w,M.array[P+8]=$.x,M.array[P+9]=$.y,M.array[P+10]=$.z,M.array[P+11]=$.w,P+=12;m.bindBuffer(m.ARRAY_BUFFER,M.buffer);m.bufferData(m.ARRAY_BUFFER,M.array,C)}G&&(delete z.__inittedArrays,delete z.__colorArray,delete z.__normalArray,delete z.__tangentArray,delete z.__uvArray,delete z.__uv2Array,delete z.__faceArray,delete z.__vertexArray,delete z.__lineArray,
-delete z.__skinIndexArray,delete z.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;s.attributes&&t(s)}else if(k instanceof THREE.Line){s=d(k,l);n=s.attributes&&v(s);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||n){var Wa=l,Ub=m.DYNAMIC_DRAW,Jb=void 0,Kb=void 0,Lb=void 0,Vb=void 0,pa=void 0,Wb=void 0,Gb=Wa.vertices,
+d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),G(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),s(a.__webglObjects,!1,"",b,k,l,!0,d),u(a.__webglObjectsImmediate,"",b,k,l,!1,d)):(d=null,this.setBlending(THREE.NoBlending),s(a.__webglObjects,!0,"opaque",b,k,l,!1,d),u(a.__webglObjectsImmediate,"opaque",b,k,l,!1,d),s(a.__webglObjects,!1,"transparent",b,k,l,!0,d),u(a.__webglObjectsImmediate,"transparent",b,k,l,!0,d));p(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=L(a,b,c,d,e);aa=-1;I.setMaterialFaces(d);
+e.immediateRenderCallback?e.immediateRenderCallback(f,m,wb):e.render(function(a){I.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)q(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)y(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;
+void 0===h.__webglInit&&(void 0!==h.__webglActive&&y(h,a),q(h,a));var k=h,l=k.geometry,p=void 0,n=void 0,s=void 0;if(l instanceof THREE.BufferGeometry){var u=m.DYNAMIC_DRAW,w=l.attributes,E=void 0,z=void 0;for(E in w)z=w[E],z.needsUpdate&&("index"===E?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,z.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,z.array,u)):(m.bindBuffer(m.ARRAY_BUFFER,z.buffer),m.bufferData(m.ARRAY_BUFFER,z.array,u)),z.needsUpdate=!1)}else if(k instanceof THREE.Mesh){for(var A=0,D=l.geometryGroupsList.length;A<
+D;A++)if(p=l.geometryGroupsList[A],s=d(k,p),l.buffersNeedUpdate&&c(p,k),n=s.attributes&&v(s),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||n){var x=p,C=k,G=m.DYNAMIC_DRAW,H=!l.dynamic,F=s;if(x.__inittedArrays){var L=e(F),K=F.vertexColors?F.vertexColors:!1,M=f(F),P=L===THREE.SmoothShading,B=void 0,I=void 0,Q=void 0,J=void 0,ia=void 0,aa=void 0,R=void 0,Y=void 0,S=void 0,V=void 0,X=void 0,T=void 0,
+Z=void 0,$=void 0,ta=void 0,Ia=void 0,Aa=void 0,da=void 0,Ha=void 0,wa=void 0,ga=void 0,fa=void 0,ha=void 0,Ga=void 0,ka=void 0,la=void 0,oa=void 0,qa=void 0,Ca=void 0,ca=void 0,Ea=void 0,xa=void 0,Ba=void 0,Fa=void 0,ma=void 0,Ja=void 0,ua=void 0,Da=void 0,Ra=void 0,Sa=void 0,ab=0,bb=0,Ka=0,Oa=0,Xa=0,db=0,Qa=0,ob=0,Ya=0,sa=0,ya=0,O=0,Pa=void 0,eb=x.__vertexArray,cb=x.__uvArray,nb=x.__uv2Array,sb=x.__normalArray,Ta=x.__tangentArray,fb=x.__colorArray,Ua=x.__skinIndexArray,Va=x.__skinWeightArray,rb=
+x.__morphTargetsArrays,wb=x.__morphNormalsArrays,qb=x.__webglCustomAttributesList,N=void 0,Rb=x.__faceArray,tb=x.__lineArray,La=C.geometry,Ab=La.elementsNeedUpdate,xb=La.uvsNeedUpdate,Db=La.normalsNeedUpdate,Fb=La.tangentsNeedUpdate,Ob=La.colorsNeedUpdate,Pb=La.morphTargetsNeedUpdate,gc=La.vertices,ea=x.faces3,gb=La.faces,Bb=La.faceVertexUvs[0],Cb=La.faceVertexUvs[1],hc=La.skinIndices,Sb=La.skinWeights,Tb=La.morphTargets,Eb=La.morphNormals;if(La.verticesNeedUpdate){B=0;for(I=ea.length;B<I;B++)J=gb[ea[B]],
+T=gc[J.a],Z=gc[J.b],$=gc[J.c],eb[bb]=T.x,eb[bb+1]=T.y,eb[bb+2]=T.z,eb[bb+3]=Z.x,eb[bb+4]=Z.y,eb[bb+5]=Z.z,eb[bb+6]=$.x,eb[bb+7]=$.y,eb[bb+8]=$.z,bb+=9;m.bindBuffer(m.ARRAY_BUFFER,x.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,eb,G)}if(Pb)for(ma=0,Ja=Tb.length;ma<Ja;ma++){B=ya=0;for(I=ea.length;B<I;B++)Ra=ea[B],J=gb[Ra],T=Tb[ma].vertices[J.a],Z=Tb[ma].vertices[J.b],$=Tb[ma].vertices[J.c],ua=rb[ma],ua[ya]=T.x,ua[ya+1]=T.y,ua[ya+2]=T.z,ua[ya+3]=Z.x,ua[ya+4]=Z.y,ua[ya+5]=Z.z,ua[ya+6]=$.x,ua[ya+7]=
+$.y,ua[ya+8]=$.z,F.morphNormals&&(P?(Sa=Eb[ma].vertexNormals[Ra],da=Sa.a,Ha=Sa.b,wa=Sa.c):wa=Ha=da=Eb[ma].faceNormals[Ra],Da=wb[ma],Da[ya]=da.x,Da[ya+1]=da.y,Da[ya+2]=da.z,Da[ya+3]=Ha.x,Da[ya+4]=Ha.y,Da[ya+5]=Ha.z,Da[ya+6]=wa.x,Da[ya+7]=wa.y,Da[ya+8]=wa.z),ya+=9;m.bindBuffer(m.ARRAY_BUFFER,x.__webglMorphTargetsBuffers[ma]);m.bufferData(m.ARRAY_BUFFER,rb[ma],G);F.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,x.__webglMorphNormalsBuffers[ma]),m.bufferData(m.ARRAY_BUFFER,wb[ma],G))}if(Sb.length){B=0;for(I=
+ea.length;B<I;B++)J=gb[ea[B]],Ga=Sb[J.a],ka=Sb[J.b],la=Sb[J.c],Va[sa]=Ga.x,Va[sa+1]=Ga.y,Va[sa+2]=Ga.z,Va[sa+3]=Ga.w,Va[sa+4]=ka.x,Va[sa+5]=ka.y,Va[sa+6]=ka.z,Va[sa+7]=ka.w,Va[sa+8]=la.x,Va[sa+9]=la.y,Va[sa+10]=la.z,Va[sa+11]=la.w,oa=hc[J.a],qa=hc[J.b],Ca=hc[J.c],Ua[sa]=oa.x,Ua[sa+1]=oa.y,Ua[sa+2]=oa.z,Ua[sa+3]=oa.w,Ua[sa+4]=qa.x,Ua[sa+5]=qa.y,Ua[sa+6]=qa.z,Ua[sa+7]=qa.w,Ua[sa+8]=Ca.x,Ua[sa+9]=Ca.y,Ua[sa+10]=Ca.z,Ua[sa+11]=Ca.w,sa+=12;0<sa&&(m.bindBuffer(m.ARRAY_BUFFER,x.__webglSkinIndicesBuffer),
+m.bufferData(m.ARRAY_BUFFER,Ua,G),m.bindBuffer(m.ARRAY_BUFFER,x.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,Va,G))}if(Ob&&K){B=0;for(I=ea.length;B<I;B++)J=gb[ea[B]],R=J.vertexColors,Y=J.color,3===R.length&&K===THREE.VertexColors?(ga=R[0],fa=R[1],ha=R[2]):ha=fa=ga=Y,fb[Ya]=ga.r,fb[Ya+1]=ga.g,fb[Ya+2]=ga.b,fb[Ya+3]=fa.r,fb[Ya+4]=fa.g,fb[Ya+5]=fa.b,fb[Ya+6]=ha.r,fb[Ya+7]=ha.g,fb[Ya+8]=ha.b,Ya+=9;0<Ya&&(m.bindBuffer(m.ARRAY_BUFFER,x.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,fb,G))}if(Fb&&
+La.hasTangents){B=0;for(I=ea.length;B<I;B++)J=gb[ea[B]],S=J.vertexTangents,ta=S[0],Ia=S[1],Aa=S[2],Ta[Qa]=ta.x,Ta[Qa+1]=ta.y,Ta[Qa+2]=ta.z,Ta[Qa+3]=ta.w,Ta[Qa+4]=Ia.x,Ta[Qa+5]=Ia.y,Ta[Qa+6]=Ia.z,Ta[Qa+7]=Ia.w,Ta[Qa+8]=Aa.x,Ta[Qa+9]=Aa.y,Ta[Qa+10]=Aa.z,Ta[Qa+11]=Aa.w,Qa+=12;m.bindBuffer(m.ARRAY_BUFFER,x.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,Ta,G)}if(Db&&L){B=0;for(I=ea.length;B<I;B++)if(J=gb[ea[B]],ia=J.vertexNormals,aa=J.normal,3===ia.length&&P)for(ca=0;3>ca;ca++)xa=ia[ca],sb[db]=xa.x,
+sb[db+1]=xa.y,sb[db+2]=xa.z,db+=3;else for(ca=0;3>ca;ca++)sb[db]=aa.x,sb[db+1]=aa.y,sb[db+2]=aa.z,db+=3;m.bindBuffer(m.ARRAY_BUFFER,x.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,sb,G)}if(xb&&Bb&&M){B=0;for(I=ea.length;B<I;B++)if(Q=ea[B],V=Bb[Q],void 0!==V)for(ca=0;3>ca;ca++)Ba=V[ca],cb[Ka]=Ba.x,cb[Ka+1]=Ba.y,Ka+=2;0<Ka&&(m.bindBuffer(m.ARRAY_BUFFER,x.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,cb,G))}if(xb&&Cb&&M){B=0;for(I=ea.length;B<I;B++)if(Q=ea[B],X=Cb[Q],void 0!==X)for(ca=0;3>ca;ca++)Fa=
+X[ca],nb[Oa]=Fa.x,nb[Oa+1]=Fa.y,Oa+=2;0<Oa&&(m.bindBuffer(m.ARRAY_BUFFER,x.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,nb,G))}if(Ab){B=0;for(I=ea.length;B<I;B++)Rb[Xa]=ab,Rb[Xa+1]=ab+1,Rb[Xa+2]=ab+2,Xa+=3,tb[ob]=ab,tb[ob+1]=ab+1,tb[ob+2]=ab,tb[ob+3]=ab+2,tb[ob+4]=ab+1,tb[ob+5]=ab+2,ob+=6,ab+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,x.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,Rb,G);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,x.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,tb,G)}if(qb)for(ca=
+0,Ea=qb.length;ca<Ea;ca++)if(N=qb[ca],N.__original.needsUpdate){O=0;if(1===N.size)if(void 0===N.boundTo||"vertices"===N.boundTo)for(B=0,I=ea.length;B<I;B++)J=gb[ea[B]],N.array[O]=N.value[J.a],N.array[O+1]=N.value[J.b],N.array[O+2]=N.value[J.c],O+=3;else{if("faces"===N.boundTo)for(B=0,I=ea.length;B<I;B++)Pa=N.value[ea[B]],N.array[O]=Pa,N.array[O+1]=Pa,N.array[O+2]=Pa,O+=3}else if(2===N.size)if(void 0===N.boundTo||"vertices"===N.boundTo)for(B=0,I=ea.length;B<I;B++)J=gb[ea[B]],T=N.value[J.a],Z=N.value[J.b],
+$=N.value[J.c],N.array[O]=T.x,N.array[O+1]=T.y,N.array[O+2]=Z.x,N.array[O+3]=Z.y,N.array[O+4]=$.x,N.array[O+5]=$.y,O+=6;else{if("faces"===N.boundTo)for(B=0,I=ea.length;B<I;B++)$=Z=T=Pa=N.value[ea[B]],N.array[O]=T.x,N.array[O+1]=T.y,N.array[O+2]=Z.x,N.array[O+3]=Z.y,N.array[O+4]=$.x,N.array[O+5]=$.y,O+=6}else if(3===N.size){var ra;ra="c"===N.type?["r","g","b"]:["x","y","z"];if(void 0===N.boundTo||"vertices"===N.boundTo)for(B=0,I=ea.length;B<I;B++)J=gb[ea[B]],T=N.value[J.a],Z=N.value[J.b],$=N.value[J.c],
+N.array[O]=T[ra[0]],N.array[O+1]=T[ra[1]],N.array[O+2]=T[ra[2]],N.array[O+3]=Z[ra[0]],N.array[O+4]=Z[ra[1]],N.array[O+5]=Z[ra[2]],N.array[O+6]=$[ra[0]],N.array[O+7]=$[ra[1]],N.array[O+8]=$[ra[2]],O+=9;else if("faces"===N.boundTo)for(B=0,I=ea.length;B<I;B++)$=Z=T=Pa=N.value[ea[B]],N.array[O]=T[ra[0]],N.array[O+1]=T[ra[1]],N.array[O+2]=T[ra[2]],N.array[O+3]=Z[ra[0]],N.array[O+4]=Z[ra[1]],N.array[O+5]=Z[ra[2]],N.array[O+6]=$[ra[0]],N.array[O+7]=$[ra[1]],N.array[O+8]=$[ra[2]],O+=9;else if("faceVertices"===
+N.boundTo)for(B=0,I=ea.length;B<I;B++)Pa=N.value[ea[B]],T=Pa[0],Z=Pa[1],$=Pa[2],N.array[O]=T[ra[0]],N.array[O+1]=T[ra[1]],N.array[O+2]=T[ra[2]],N.array[O+3]=Z[ra[0]],N.array[O+4]=Z[ra[1]],N.array[O+5]=Z[ra[2]],N.array[O+6]=$[ra[0]],N.array[O+7]=$[ra[1]],N.array[O+8]=$[ra[2]],O+=9}else if(4===N.size)if(void 0===N.boundTo||"vertices"===N.boundTo)for(B=0,I=ea.length;B<I;B++)J=gb[ea[B]],T=N.value[J.a],Z=N.value[J.b],$=N.value[J.c],N.array[O]=T.x,N.array[O+1]=T.y,N.array[O+2]=T.z,N.array[O+3]=T.w,N.array[O+
+4]=Z.x,N.array[O+5]=Z.y,N.array[O+6]=Z.z,N.array[O+7]=Z.w,N.array[O+8]=$.x,N.array[O+9]=$.y,N.array[O+10]=$.z,N.array[O+11]=$.w,O+=12;else if("faces"===N.boundTo)for(B=0,I=ea.length;B<I;B++)$=Z=T=Pa=N.value[ea[B]],N.array[O]=T.x,N.array[O+1]=T.y,N.array[O+2]=T.z,N.array[O+3]=T.w,N.array[O+4]=Z.x,N.array[O+5]=Z.y,N.array[O+6]=Z.z,N.array[O+7]=Z.w,N.array[O+8]=$.x,N.array[O+9]=$.y,N.array[O+10]=$.z,N.array[O+11]=$.w,O+=12;else if("faceVertices"===N.boundTo)for(B=0,I=ea.length;B<I;B++)Pa=N.value[ea[B]],
+T=Pa[0],Z=Pa[1],$=Pa[2],N.array[O]=T.x,N.array[O+1]=T.y,N.array[O+2]=T.z,N.array[O+3]=T.w,N.array[O+4]=Z.x,N.array[O+5]=Z.y,N.array[O+6]=Z.z,N.array[O+7]=Z.w,N.array[O+8]=$.x,N.array[O+9]=$.y,N.array[O+10]=$.z,N.array[O+11]=$.w,O+=12;m.bindBuffer(m.ARRAY_BUFFER,N.buffer);m.bufferData(m.ARRAY_BUFFER,N.array,G)}H&&(delete x.__inittedArrays,delete x.__colorArray,delete x.__normalArray,delete x.__tangentArray,delete x.__uvArray,delete x.__uv2Array,delete x.__faceArray,delete x.__vertexArray,delete x.__lineArray,
+delete x.__skinIndexArray,delete x.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;s.attributes&&t(s)}else if(k instanceof THREE.Line){s=d(k,l);n=s.attributes&&v(s);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||n){var Wa=l,Ub=m.DYNAMIC_DRAW,Jb=void 0,Kb=void 0,Lb=void 0,Vb=void 0,pa=void 0,Wb=void 0,Gb=Wa.vertices,
 Hb=Wa.colors,Ib=Wa.lineDistances,Qb=Gb.length,bc=Hb.length,dc=Ib.length,Xb=Wa.__vertexArray,Yb=Wa.__colorArray,mc=Wa.__lineDistanceArray,ec=Wa.colorsNeedUpdate,fc=Wa.lineDistancesNeedUpdate,ic=Wa.__webglCustomAttributesList,Zb=void 0,nc=void 0,za=void 0,yb=void 0,Ma=void 0,na=void 0;if(Wa.verticesNeedUpdate){for(Jb=0;Jb<Qb;Jb++)Vb=Gb[Jb],pa=3*Jb,Xb[pa]=Vb.x,Xb[pa+1]=Vb.y,Xb[pa+2]=Vb.z;m.bindBuffer(m.ARRAY_BUFFER,Wa.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,Xb,Ub)}if(ec){for(Kb=0;Kb<bc;Kb++)Wb=
 Hb[Kb],pa=3*Kb,Yb[pa]=Wb.r,Yb[pa+1]=Wb.g,Yb[pa+2]=Wb.b;m.bindBuffer(m.ARRAY_BUFFER,Wa.__webglColorBuffer);m.bufferData(m.ARRAY_BUFFER,Yb,Ub)}if(fc){for(Lb=0;Lb<dc;Lb++)mc[Lb]=Ib[Lb];m.bindBuffer(m.ARRAY_BUFFER,Wa.__webglLineDistanceBuffer);m.bufferData(m.ARRAY_BUFFER,mc,Ub)}if(ic)for(Zb=0,nc=ic.length;Zb<nc;Zb++)if(na=ic[Zb],na.needsUpdate&&(void 0===na.boundTo||"vertices"===na.boundTo)){pa=0;yb=na.value.length;if(1===na.size)for(za=0;za<yb;za++)na.array[za]=na.value[za];else if(2===na.size)for(za=
 0;za<yb;za++)Ma=na.value[za],na.array[pa]=Ma.x,na.array[pa+1]=Ma.y,pa+=2;else if(3===na.size)if("c"===na.type)for(za=0;za<yb;za++)Ma=na.value[za],na.array[pa]=Ma.r,na.array[pa+1]=Ma.g,na.array[pa+2]=Ma.b,pa+=3;else for(za=0;za<yb;za++)Ma=na.value[za],na.array[pa]=Ma.x,na.array[pa+1]=Ma.y,na.array[pa+2]=Ma.z,pa+=3;else if(4===na.size)for(za=0;za<yb;za++)Ma=na.value[za],na.array[pa]=Ma.x,na.array[pa+1]=Ma.y,na.array[pa+2]=Ma.z,na.array[pa+3]=Ma.w,pa+=4;m.bindBuffer(m.ARRAY_BUFFER,na.buffer);m.bufferData(m.ARRAY_BUFFER,
@@ -507,14 +507,14 @@ maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLigh
 d.push(a.defines[t]);for(l in c)d.push(l),d.push(c[l]);n=d.join();var u;l=0;for(t=ia.length;l<t;l++)if(d=ia[l],d.code===n){u=d;u.usedTimes++;break}void 0===u&&(u=new THREE.WebGLProgram(this,n,a,c),ia.push(u),I.info.memory.programs=ia.length);a.program=u;u=a.program.attributes;if(a.morphTargets)for(a.numSupportedMorphTargets=0,t="morphTarget",l=0;l<this.maxMorphTargets;l++)n=t+l,0<=u[n]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(a.numSupportedMorphNormals=0,t="morphNormal",l=0;l<this.maxMorphNormals;l++)n=
 t+l,0<=u[n]&&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;Aa!==
 b&&(b?m.disable(m.CULL_FACE):m.enable(m.CULL_FACE),Aa=b);Ha!==a&&(a?m.frontFace(m.CW):m.frontFace(m.CCW),Ha=a)};this.setDepthTest=function(a){Ea!==a&&(a?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),Ea=a)};this.setDepthWrite=function(a){ga!==a&&(m.depthMask(a),ga=a)};this.setBlending=function(a,b,c,d){a!==Ca&&(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)),Ca=a);if(a===THREE.CustomBlending){if(b!==Da&&(m.blendEquation(y(b)),Da=b),c!==Ra||d!==Sa)m.blendFunc(y(c),y(d)),Ra=c,Sa=d}else Sa=
+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)),Ca=a);if(a===THREE.CustomBlending){if(b!==Da&&(m.blendEquation(F(b)),Da=b),c!==Ra||d!==Sa)m.blendFunc(F(c),F(d)),Ra=c,Sa=d}else Sa=
 Ra=Da=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",Db),a.__webglTexture=m.createTexture(),I.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=y(a.format),f=y(a.type);O(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=F(a.format),f=F(a.type);P(m.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,c.data):m.texImage2D(m.TEXTURE_2D,h,
 e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&m.generateMipmap(m.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+b),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===a.depthBuffer&&
-(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Ib);a.__webglTexture=m.createTexture();I.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=y(a.format),e=y(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);O(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);D(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),
-O(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):
-D(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=Ja,a=Ba,d=Fa,e=xa);b!==T&&(m.bindFramebuffer(m.FRAMEBUFFER,b),m.viewport(d,e,c,a),T=b);Ka=c;ha=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);
+(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Ib);a.__webglTexture=m.createTexture();I.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=F(a.format),e=F(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);P(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);C(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),
+P(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):
+C(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=Ja,a=Ba,d=Fa,e=xa);b!==T&&(m.bindFramebuffer(m.FRAMEBUFFER,b),m.viewport(d,e,c,a),T=b);Ka=c;ha=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);
 this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:
 THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null};
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;
@@ -545,8 +545,8 @@ h]=f,e[3*h+1]=g,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.need
 String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,n,r,p,s,u,q,w,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*
 c+d;n=b[a++]*c;s=b[a++]*c+d;u=b[a++]*c;e.quadraticCurveTo(s,u,k,n);if(g=f[f.length-1])for(r=g.x,p=g.y,g=1,h=this.divisions;g<=h;g++){var t=g/h;THREE.Shape.Utils.b2(t,r,s,k);THREE.Shape.Utils.b2(t,p,u,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,s=b[a++]*c+d,u=b[a++]*-c,q=b[a++]*c+d,w=b[a++]*-c,e.bezierCurveTo(k,n,s,u,q,w),g=f[f.length-1])for(r=g.x,p=g.y,g=1,h=this.divisions;g<=h;g++)t=g/h,THREE.Shape.Utils.b3(t,r,s,q,k),THREE.Shape.Utils.b3(t,p,u,w,n)}return{offset:v.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var r=2*e;for(l=e-1;2<e;){if(0>=r--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var p;a:{var s=p=void 0,u=void 0,q=void 0,w=void 0,v=void 0,t=void 0,x=void 0,F=
-void 0,s=a[g[k]].x,u=a[g[k]].y,q=a[g[l]].x,w=a[g[l]].y,v=a[g[n]].x,t=a[g[n]].y;if(1E-10>(q-s)*(t-u)-(w-u)*(v-s))p=!1;else{var z=void 0,N=void 0,H=void 0,E=void 0,L=void 0,B=void 0,C=void 0,O=void 0,D=void 0,A=void 0,D=O=C=F=x=void 0,z=v-q,N=t-w,H=s-v,E=u-t,L=q-s,B=w-u;for(p=0;p<e;p++)if(x=a[g[p]].x,F=a[g[p]].y,!(x===s&&F===u||x===q&&F===w||x===v&&F===t)&&(C=x-s,O=F-u,D=x-q,A=F-w,x-=v,F-=t,D=z*A-N*D,C=L*O-B*C,O=H*F-E*x,-1E-10<=D&&-1E-10<=O&&-1E-10<=C)){p=!1;break a}p=!0}}if(p){f.push([a[g[k]],a[g[l]],
+(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var r=2*e;for(l=e-1;2<e;){if(0>=r--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var p;a:{var s=p=void 0,u=void 0,q=void 0,w=void 0,v=void 0,t=void 0,y=void 0,E=
+void 0,s=a[g[k]].x,u=a[g[k]].y,q=a[g[l]].x,w=a[g[l]].y,v=a[g[n]].x,t=a[g[n]].y;if(1E-10>(q-s)*(t-u)-(w-u)*(v-s))p=!1;else{var x=void 0,L=void 0,A=void 0,D=void 0,M=void 0,z=void 0,G=void 0,P=void 0,C=void 0,B=void 0,C=P=G=E=y=void 0,x=v-q,L=t-w,A=s-v,D=u-t,M=q-s,z=w-u;for(p=0;p<e;p++)if(y=a[g[p]].x,E=a[g[p]].y,!(y===s&&E===u||y===q&&E===w||y===v&&E===t)&&(G=y-s,P=E-u,C=y-q,B=E-w,y-=v,E-=t,C=x*B-L*C,G=M*P-z*G,P=A*E-D*y,-1E-10<=C&&-1E-10<=P&&-1E-10<=G)){p=!1;break a}p=!0}}if(p){f.push([a[g[k]],a[g[l]],
 a[g[n]]]);h.push([g[k],g[l],g[n]]);k=l;for(n=l+1;n<e;k++,n++)g[k]=g[n];e--;r=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(a){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};
 THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),f+=c.distanceTo(d),b.push(f),d=c;return this.cacheArcLengths=b};
 THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0;this.getLengths()};THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,f;f=b?b:a*c[e-1];for(var g=0,h=e-1,k;g<=h;)if(d=Math.floor(g+(h-g)/2),k=c[d]-f,0>k)g=d+1;else if(0<k)h=d-1;else{h=d;break}d=h;if(c[d]==f)return d/(e-1);g=c[d];return c=(d+(f-g)/(c[d+1]-g))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};
@@ -576,11 +576,11 @@ THREE.PathActions.MOVE_TO&&0!=h.actions.length&&(g.push(h),h=new THREE.Path),h[e
 p:s},h[p].s.actions=l.actions,h[p].s.curves=l.curves,r&&p++,e[p]=[]):e[p].push({h:l,p:s[0]});if(1<h.length){c=!1;d=[];a=0;for(g=h.length;a<g;a++)n[a]=[];a=0;for(g=h.length;a<g;a++)for(l=e[a],k=0;k<l.length;k++){r=l[k];p=!0;for(s=0;s<h.length;s++)b(r.p,h[s].p)&&(a!=s&&d.push({froms:a,tos:s,hole:k}),p?(p=!1,n[s].push(r)):c=!0);p&&n[a].push(r)}0<d.length&&(c||(e=n))}c=0;for(d=h.length;c<d;c++)for(n=h[c].s,f.push(n),a=e[c],g=0,l=a.length;g<l;g++)n.holes.push(a[g].h);return f};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};
 THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};
 THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,r=a.y-d.y,H=h*k-g*l,E=h*n-g*r;if(1E-10<Math.abs(H)){if(0<H){if(0>E||E>H)return[];k=l*n-k*r;if(0>k||k>H)return[]}else{if(0<E||E<H)return[];k=l*n-k*r;if(0<k||k<H)return[]}if(0==k)return!f||0!=E&&E!=H?[a]:[];if(k==H)return!f||0!=E&&E!=H?[b]:[];if(0==E)return[d];
-if(E==H)return[e];f=k/H;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=E||l*n!=k*r)return[];h=0==g&&0==h;k=0==k&&0==l;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,H=d.x,l=e,d=e.x):(b=e,H=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,H=d.y,l=e,d=e.y):(b=e,H=e.y,l=d,d=d.y));return k<=H?a<H?[]:a==H?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,r=a.y-d.y,A=h*k-g*l,D=h*n-g*r;if(1E-10<Math.abs(A)){if(0<A){if(0>D||D>A)return[];k=l*n-k*r;if(0>k||k>A)return[]}else{if(0<D||D<A)return[];k=l*n-k*r;if(0<k||k<A)return[]}if(0==k)return!f||0!=D&&D!=A?[a]:[];if(k==A)return!f||0!=D&&D!=A?[b]:[];if(0==D)return[d];
+if(D==A)return[e];f=k/A;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=D||l*n!=k*r)return[];h=0==g&&0==h;k=0==k&&0==l;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,A=d.x,l=e,d=e.x):(b=e,A=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,A=d.y,l=e,d=e.y):(b=e,A=e.y,l=d,d=d.y));return k<=A?a<A?[]:a==A?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
 [g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,n={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+":"+h[f].y,void 0!==n[l]&&console.log("Duplicate point",l),n[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;
-d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,r,N,H,E,L=[],B,C,O,D=0;for(n=b.length;D<n;D++)l.push(D);for(var A=2*l.length;0<l.length;){A--;if(0>A){console.log("Infinite Loop! Holes left:"+
-l.length+", Probably Hole outside Shape!");break}for(r=0;r<h.length;r++){N=h[r];n=-1;for(D=0;D<l.length;D++)if(H=l[D],E=N.x+":"+N.y+":"+H,void 0===L[E]){k=b[H];for(B=0;B<k.length;B++)if(H=k[B],c(r,B)&&!f(N,H)&&!g(N,H)){n=B;l.splice(D,1);H=h.slice(0,r+1);B=h.slice(r);C=k.slice(n);O=k.slice(0,n+1);h=H.concat(C).concat(O).concat(B);break}if(0<=n)break;L[E]=!0}if(0<=n)break}}return h}(a,b);var r=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=r.length;f<g;f++)for(k=r[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=
+d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,r,L,A,D,M=[],z,G,P,C=0;for(n=b.length;C<n;C++)l.push(C);for(var B=2*l.length;0<l.length;){B--;if(0>B){console.log("Infinite Loop! Holes left:"+
+l.length+", Probably Hole outside Shape!");break}for(r=0;r<h.length;r++){L=h[r];n=-1;for(C=0;C<l.length;C++)if(A=l[C],D=L.x+":"+L.y+":"+A,void 0===M[D]){k=b[A];for(z=0;z<k.length;z++)if(A=k[z],c(r,z)&&!f(L,A)&&!g(L,A)){n=z;l.splice(C,1);A=h.slice(0,r+1);z=h.slice(r);G=k.slice(n);P=k.slice(0,n+1);h=A.concat(G).concat(P).concat(z);break}if(0<=n)break;M[D]=!0}if(0<=n)break}}return h}(a,b);var r=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=r.length;f<g;f++)for(k=r[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=
 n[l],void 0!==l&&(k[h]=l);return r.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
 b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};
 THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};
@@ -615,21 +615,21 @@ THREE.CombinedCamera.prototype.toOrthographic=function(){var a=this.cameraP.aspe
 THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;this.left=-a/2;this.right=a/2;this.top=b/2;this.bottom=-b/2};THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.updateProjectionMatrix=function(){this.inPerspectiveMode?this.toPerspective():(this.toPerspective(),this.toOrthographic())};
 THREE.CombinedCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);var c=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
-THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,q){var w,v=h.widthSegments,t=h.heightSegments,x=e/2,F=f/2,z=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)w="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)w="y",t=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)w="x",v=h.depthSegments;var N=v+1,H=t+1,E=e/v,L=f/t,B=new THREE.Vector3;B[w]=0<g?1:-1;for(e=0;e<H;e++)for(f=0;f<N;f++){var C=new THREE.Vector3;C[a]=(f*E-x)*c;C[b]=(e*L-F)*d;C[w]=g;h.vertices.push(C)}for(e=
-0;e<t;e++)for(f=0;f<v;f++)F=f+N*e,a=f+N*(e+1),b=f+1+N*(e+1),c=f+1+N*e,d=new THREE.Vector2(f/v,1-e/t),g=new THREE.Vector2(f/v,1-(e+1)/t),w=new THREE.Vector2((f+1)/v,1-(e+1)/t),x=new THREE.Vector2((f+1)/v,1-e/t),F=new THREE.Face3(F+z,a+z,c+z),F.normal.copy(B),F.vertexNormals.push(B.clone(),B.clone(),B.clone()),F.materialIndex=q,h.faces.push(F),h.faceVertexUvs[0].push([d,g,x]),F=new THREE.Face3(a+z,b+z,c+z),F.normal.copy(B),F.vertexNormals.push(B.clone(),B.clone(),B.clone()),F.materialIndex=q,h.faces.push(F),
-h.faceVertexUvs[0].push([g.clone(),w,x.clone()])}THREE.Geometry.call(this);this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=new Uint16Array(3*(b+1)),f=new Float32Array(3*(b+2)),g=new Float32Array(3*(b+2)),h=new Float32Array(2*(b+2));g[2]=1;h[0]=0.5;h[1]=0.5;for(var k=3,l=2,n=0;n<=b;n++){e[k]=n+1;e[k+1]=n+2;e[k+2]=0;var r=c+n/b*d,p=a*Math.cos(r),r=a*Math.sin(r);f[k]=p;f[k+1]=r;g[k+2]=1;h[l]=(p/a+1)/2;h[l+
-1]=(r/a+1)/2;k+=3;l+=2}for(n=1;n<=b;n++)e[k]=n,e[k+1]=n+1,e[k+2]=0;this.attributes.index={array:e,itemSize:1};this.attributes.position={array:f,itemSize:3};this.attributes.normal={array:g,itemSize:3};this.attributes.uv={array:h,itemSize:2};this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){console.warn("DEPRECATED: THREE.CubeGeometry is deprecated. Use THREE.BoxGeometry instead.");return new THREE.BoxGeometry(a,b,c,d,e,f)};THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;var g=c/2,h,k,l=[],n=[];for(k=0;k<=e;k++){var r=[],p=[],s=k/e,u=s*(b-a)+a;for(h=0;h<=d;h++){var q=h/d,w=new THREE.Vector3;w.x=u*Math.sin(q*Math.PI*2);w.y=-s*c+g;w.z=u*Math.cos(q*Math.PI*2);this.vertices.push(w);r.push(this.vertices.length-1);p.push(new THREE.Vector2(q,
-1-s))}l.push(r);n.push(p)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(r=this.vertices[l[0][h]].clone(),p=this.vertices[l[0][h+1]].clone()):(r=this.vertices[l[1][h]].clone(),p=this.vertices[l[1][h+1]].clone()),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),p.setY(Math.sqrt(p.x*p.x+p.z*p.z)*c).normalize(),k=0;k<e;k++){var s=l[k][h],u=l[k+1][h],q=l[k+1][h+1],w=l[k][h+1],v=r.clone(),t=r.clone(),x=p.clone(),F=p.clone(),z=n[k][h].clone(),N=n[k+1][h].clone(),H=n[k+1][h+1].clone(),E=n[k][h+1].clone();this.faces.push(new THREE.Face3(s,
-u,w,[v,t,F]));this.faceVertexUvs[0].push([z,N,E]);this.faces.push(new THREE.Face3(u,q,w,[t.clone(),x,F.clone()]));this.faceVertexUvs[0].push([N.clone(),H,E.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)s=l[0][h],u=l[0][h+1],q=this.vertices.length-1,v=new THREE.Vector3(0,1,0),t=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),z=n[0][h].clone(),N=n[0][h+1].clone(),H=new THREE.Vector2(N.x,0),this.faces.push(new THREE.Face3(s,u,q,[v,t,x])),this.faceVertexUvs[0].push([z,
-N,H]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)s=l[k][h+1],u=l[k][h],q=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),t=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),z=n[k][h+1].clone(),N=n[k][h].clone(),H=new THREE.Vector2(N.x,1),this.faces.push(new THREE.Face3(s,u,q,[v,t,x])),this.faceVertexUvs[0].push([z,N,H]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
+THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,q){var w,v=h.widthSegments,t=h.heightSegments,y=e/2,E=f/2,x=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)w="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)w="y",t=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)w="x",v=h.depthSegments;var L=v+1,A=t+1,D=e/v,M=f/t,z=new THREE.Vector3;z[w]=0<g?1:-1;for(e=0;e<A;e++)for(f=0;f<L;f++){var G=new THREE.Vector3;G[a]=(f*D-y)*c;G[b]=(e*M-E)*d;G[w]=g;h.vertices.push(G)}for(e=
+0;e<t;e++)for(f=0;f<v;f++)E=f+L*e,a=f+L*(e+1),b=f+1+L*(e+1),c=f+1+L*e,d=new THREE.Vector2(f/v,1-e/t),g=new THREE.Vector2(f/v,1-(e+1)/t),w=new THREE.Vector2((f+1)/v,1-(e+1)/t),y=new THREE.Vector2((f+1)/v,1-e/t),E=new THREE.Face3(E+x,a+x,c+x),E.normal.copy(z),E.vertexNormals.push(z.clone(),z.clone(),z.clone()),E.materialIndex=q,h.faces.push(E),h.faceVertexUvs[0].push([d,g,y]),E=new THREE.Face3(a+x,b+x,c+x),E.normal.copy(z),E.vertexNormals.push(z.clone(),z.clone(),z.clone()),E.materialIndex=q,h.faces.push(E),
+h.faceVertexUvs[0].push([g.clone(),w,y.clone()])}THREE.Geometry.call(this);this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=new Uint16Array(3*(b+1)),f=new Float32Array(3*(b+2)),g=new Float32Array(3*(b+2)),h=new Float32Array(2*(b+2));g[2]=1;h[0]=0.5;h[1]=0.5;for(var k=3,l=2,n=0;n<=b;n++){var r=c+n/b*d,p=a*Math.cos(r),r=a*Math.sin(r);f[k]=p;f[k+1]=r;g[k+2]=1;h[l]=(p/a+1)/2;h[l+1]=(r/a+1)/2;e[k]=n+1;e[k+
+1]=n+2;e[k+2]=0;k+=3;l+=2}this.attributes.index={array:e,itemSize:1};this.attributes.position={array:f,itemSize:3};this.attributes.normal={array:g,itemSize:3};this.attributes.uv={array:h,itemSize:2};this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){console.warn("DEPRECATED: THREE.CubeGeometry is deprecated. Use THREE.BoxGeometry instead.");return new THREE.BoxGeometry(a,b,c,d,e,f)};THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;var g=c/2,h,k,l=[],n=[];for(k=0;k<=e;k++){var r=[],p=[],s=k/e,u=s*(b-a)+a;for(h=0;h<=d;h++){var q=h/d,w=new THREE.Vector3;w.x=u*Math.sin(q*Math.PI*2);w.y=-s*c+g;w.z=u*Math.cos(q*Math.PI*2);this.vertices.push(w);r.push(this.vertices.length-1);p.push(new THREE.Vector2(q,
+1-s))}l.push(r);n.push(p)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(r=this.vertices[l[0][h]].clone(),p=this.vertices[l[0][h+1]].clone()):(r=this.vertices[l[1][h]].clone(),p=this.vertices[l[1][h+1]].clone()),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),p.setY(Math.sqrt(p.x*p.x+p.z*p.z)*c).normalize(),k=0;k<e;k++){var s=l[k][h],u=l[k+1][h],q=l[k+1][h+1],w=l[k][h+1],v=r.clone(),t=r.clone(),y=p.clone(),E=p.clone(),x=n[k][h].clone(),L=n[k+1][h].clone(),A=n[k+1][h+1].clone(),D=n[k][h+1].clone();this.faces.push(new THREE.Face3(s,
+u,w,[v,t,E]));this.faceVertexUvs[0].push([x,L,D]);this.faces.push(new THREE.Face3(u,q,w,[t.clone(),y,E.clone()]));this.faceVertexUvs[0].push([L.clone(),A,D.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)s=l[0][h],u=l[0][h+1],q=this.vertices.length-1,v=new THREE.Vector3(0,1,0),t=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),x=n[0][h].clone(),L=n[0][h+1].clone(),A=new THREE.Vector2(L.x,0),this.faces.push(new THREE.Face3(s,u,q,[v,t,y])),this.faceVertexUvs[0].push([x,
+L,A]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)s=l[k][h+1],u=l[k][h],q=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),t=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),x=n[k][h+1].clone(),L=n[k][h].clone(),A=new THREE.Vector2(L.x,1),this.faces.push(new THREE.Face3(s,u,q,[v,t,y])),this.faceVertexUvs[0].push([x,L,A]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.Math.sign,e=1,e=a.x-b.x,f=a.y-b.y,g=c.x-a.x,h=c.y-a.y,k=e*e+f*f;if(1E-10<Math.abs(e*h-f*g)){var l=Math.sqrt(k),d=Math.sqrt(g*g+h*h),k=b.x-f/l;b=b.y+e/l;g=((c.x-h/d-k)*h-(c.y+g/d-b)*g)/(e*h-f*g);c=k+e*g-a.x;a=b+f*g-a.y;e=c*c+a*a;if(2>=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10<e?1E-10<g&&(a=!0):-1E-10>e?-1E-10>g&&
-(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(J=c.length;0<=--J;){e=J;f=J-1;0>f&&(f=c.length-1);for(var g=0,h=s+2*n,g=0;g<h;g++){var k=ka*g,l=ka*(g+1),p=d+e+k,k=d+f+k,q=d+f+l,l=d+e+l,r=c,u=g,v=h,w=e,y=f,p=p+O,k=k+O,q=q+O,l=l+O;C.faces.push(new THREE.Face3(p,k,l,null,null,t));C.faces.push(new THREE.Face3(k,q,l,null,null,t));p=x.generateSideWallUV(C,a,r,b,p,k,q,l,u,v,w,y);C.faceVertexUvs[0].push([p[0],p[1],
-p[3]]);C.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function f(a,b,c){C.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=O;d+=O;e+=O;C.faces.push(new THREE.Face3(c,d,e,null,null,v));c=f?x.generateBottomUV(C,a,b,c,d,e):x.generateTopUV(C,a,b,c,d,e);C.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,r=void 0!==b.bevelEnabled?b.bevelEnabled:!0,p=
-void 0!==b.curveSegments?b.curveSegments:12,s=void 0!==b.steps?b.steps:1,u=b.extrudePath,q,w=!1,v=b.material,t=b.extrudeMaterial,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,F,z,N,H;u&&(q=u.getSpacedPoints(s),w=!0,r=!1,F=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(u,s,!1),z=new THREE.Vector3,N=new THREE.Vector3,H=new THREE.Vector3);r||(l=k=n=0);var E,L,B,C=this,O=this.vertices.length,u=a.extractPoints(p),p=u.shape,D=u.holes;if(u=!THREE.Shape.Utils.isClockWise(p)){p=
-p.reverse();L=0;for(B=D.length;L<B;L++)E=D[L],THREE.Shape.Utils.isClockWise(E)&&(D[L]=E.reverse());u=!1}var A=THREE.Shape.Utils.triangulateShape(p,D),y=p;L=0;for(B=D.length;L<B;L++)E=D[L],p=p.concat(E);var K,G,Q,Y,R,ka=p.length,da,X=A.length,u=[],J=0;Q=y.length;K=Q-1;for(G=J+1;J<Q;J++,K++,G++)K===Q&&(K=0),G===Q&&(G=0),u[J]=d(y[J],y[K],y[G]);var S=[],fa,I=u.concat();L=0;for(B=D.length;L<B;L++){E=D[L];fa=[];J=0;Q=E.length;K=Q-1;for(G=J+1;J<Q;J++,K++,G++)K===Q&&(K=0),G===Q&&(G=0),fa[J]=d(E[J],E[K],E[G]);
-S.push(fa);I=I.concat(fa)}for(K=0;K<n;K++){Q=K/n;Y=k*(1-Q);G=l*Math.sin(Q*Math.PI/2);J=0;for(Q=y.length;J<Q;J++)R=c(y[J],u[J],G),f(R.x,R.y,-Y);L=0;for(B=D.length;L<B;L++)for(E=D[L],fa=S[L],J=0,Q=E.length;J<Q;J++)R=c(E[J],fa[J],G),f(R.x,R.y,-Y)}G=l;for(J=0;J<ka;J++)R=r?c(p[J],I[J],G):p[J],w?(N.copy(F.normals[0]).multiplyScalar(R.x),z.copy(F.binormals[0]).multiplyScalar(R.y),H.copy(q[0]).add(N).add(z),f(H.x,H.y,H.z)):f(R.x,R.y,0);for(Q=1;Q<=s;Q++)for(J=0;J<ka;J++)R=r?c(p[J],I[J],G):p[J],w?(N.copy(F.normals[Q]).multiplyScalar(R.x),
-z.copy(F.binormals[Q]).multiplyScalar(R.y),H.copy(q[Q]).add(N).add(z),f(H.x,H.y,H.z)):f(R.x,R.y,h/s*Q);for(K=n-1;0<=K;K--){Q=K/n;Y=k*(1-Q);G=l*Math.sin(Q*Math.PI/2);J=0;for(Q=y.length;J<Q;J++)R=c(y[J],u[J],G),f(R.x,R.y,h+Y);L=0;for(B=D.length;L<B;L++)for(E=D[L],fa=S[L],J=0,Q=E.length;J<Q;J++)R=c(E[J],fa[J],G),w?f(R.x,R.y+q[s-1].y,q[s-1].x+Y):f(R.x,R.y,h+Y)}(function(){if(r){var a;a=0*ka;for(J=0;J<X;J++)da=A[J],g(da[2]+a,da[1]+a,da[0]+a,!0);a=s+2*n;a*=ka;for(J=0;J<X;J++)da=A[J],g(da[0]+a,da[1]+a,da[2]+
-a,!1)}else{for(J=0;J<X;J++)da=A[J],g(da[2],da[1],da[0],!0);for(J=0;J<X;J++)da=A[J],g(da[0]+ka*s,da[1]+ka*s,da[2]+ka*s,!1)}})();(function(){var a=0;e(y,a);a+=y.length;L=0;for(B=D.length;L<B;L++)E=D[L],e(E,a),a+=E.length})()};
+(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(J=c.length;0<=--J;){e=J;f=J-1;0>f&&(f=c.length-1);for(var g=0,h=s+2*n,g=0;g<h;g++){var k=ka*g,l=ka*(g+1),p=d+e+k,k=d+f+k,q=d+f+l,l=d+e+l,r=c,u=g,v=h,w=e,z=f,p=p+P,k=k+P,q=q+P,l=l+P;G.faces.push(new THREE.Face3(p,k,l,null,null,t));G.faces.push(new THREE.Face3(k,q,l,null,null,t));p=y.generateSideWallUV(G,a,r,b,p,k,q,l,u,v,w,z);G.faceVertexUvs[0].push([p[0],p[1],
+p[3]]);G.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function f(a,b,c){G.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=P;d+=P;e+=P;G.faces.push(new THREE.Face3(c,d,e,null,null,v));c=f?y.generateBottomUV(G,a,b,c,d,e):y.generateTopUV(G,a,b,c,d,e);G.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,r=void 0!==b.bevelEnabled?b.bevelEnabled:!0,p=
+void 0!==b.curveSegments?b.curveSegments:12,s=void 0!==b.steps?b.steps:1,u=b.extrudePath,q,w=!1,v=b.material,t=b.extrudeMaterial,y=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,E,x,L,A;u&&(q=u.getSpacedPoints(s),w=!0,r=!1,E=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(u,s,!1),x=new THREE.Vector3,L=new THREE.Vector3,A=new THREE.Vector3);r||(l=k=n=0);var D,M,z,G=this,P=this.vertices.length,u=a.extractPoints(p),p=u.shape,C=u.holes;if(u=!THREE.Shape.Utils.isClockWise(p)){p=
+p.reverse();M=0;for(z=C.length;M<z;M++)D=C[M],THREE.Shape.Utils.isClockWise(D)&&(C[M]=D.reverse());u=!1}var B=THREE.Shape.Utils.triangulateShape(p,C),F=p;M=0;for(z=C.length;M<z;M++)D=C[M],p=p.concat(D);var K,H,Q,Y,R,ka=p.length,da,X=B.length,u=[],J=0;Q=F.length;K=Q-1;for(H=J+1;J<Q;J++,K++,H++)K===Q&&(K=0),H===Q&&(H=0),u[J]=d(F[J],F[K],F[H]);var S=[],fa,I=u.concat();M=0;for(z=C.length;M<z;M++){D=C[M];fa=[];J=0;Q=D.length;K=Q-1;for(H=J+1;J<Q;J++,K++,H++)K===Q&&(K=0),H===Q&&(H=0),fa[J]=d(D[J],D[K],D[H]);
+S.push(fa);I=I.concat(fa)}for(K=0;K<n;K++){Q=K/n;Y=k*(1-Q);H=l*Math.sin(Q*Math.PI/2);J=0;for(Q=F.length;J<Q;J++)R=c(F[J],u[J],H),f(R.x,R.y,-Y);M=0;for(z=C.length;M<z;M++)for(D=C[M],fa=S[M],J=0,Q=D.length;J<Q;J++)R=c(D[J],fa[J],H),f(R.x,R.y,-Y)}H=l;for(J=0;J<ka;J++)R=r?c(p[J],I[J],H):p[J],w?(L.copy(E.normals[0]).multiplyScalar(R.x),x.copy(E.binormals[0]).multiplyScalar(R.y),A.copy(q[0]).add(L).add(x),f(A.x,A.y,A.z)):f(R.x,R.y,0);for(Q=1;Q<=s;Q++)for(J=0;J<ka;J++)R=r?c(p[J],I[J],H):p[J],w?(L.copy(E.normals[Q]).multiplyScalar(R.x),
+x.copy(E.binormals[Q]).multiplyScalar(R.y),A.copy(q[Q]).add(L).add(x),f(A.x,A.y,A.z)):f(R.x,R.y,h/s*Q);for(K=n-1;0<=K;K--){Q=K/n;Y=k*(1-Q);H=l*Math.sin(Q*Math.PI/2);J=0;for(Q=F.length;J<Q;J++)R=c(F[J],u[J],H),f(R.x,R.y,h+Y);M=0;for(z=C.length;M<z;M++)for(D=C[M],fa=S[M],J=0,Q=D.length;J<Q;J++)R=c(D[J],fa[J],H),w?f(R.x,R.y+q[s-1].y,q[s-1].x+Y):f(R.x,R.y,h+Y)}(function(){if(r){var a;a=0*ka;for(J=0;J<X;J++)da=B[J],g(da[2]+a,da[1]+a,da[0]+a,!0);a=s+2*n;a*=ka;for(J=0;J<X;J++)da=B[J],g(da[0]+a,da[1]+a,da[2]+
+a,!1)}else{for(J=0;J<X;J++)da=B[J],g(da[2],da[1],da[0],!0);for(J=0;J<X;J++)da=B[J],g(da[0]+ka*s,da[1]+ka*s,da[2]+ka*s,!1)}})();(function(){var a=0;e(F,a);a+=F.length;M=0;for(z=C.length;M<z;M++)D=C[M],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,r){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;
 n=a.vertices[g].y;g=a.vertices[g].z;r=a.vertices[h].x;var p=a.vertices[h].y;a=a.vertices[h].z;return 0.01>Math.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(l,1-g),new THREE.Vector2(r,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-f),new THREE.Vector2(n,1-g),new THREE.Vector2(p,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
@@ -692,29 +692,29 @@ f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetI
 e[u++]=0;e[u++]=0;e[u++]=1;e[u++]=-1;e[u++]=1;e[u++]=0;e[u++]=1;e[u++]=1;e[u++]=1;e[u++]=1;e[u++]=-1;e[u++]=1;e[u++]=0;e[u++]=1;u=0;f[u++]=0;f[u++]=1;f[u++]=2;f[u++]=0;f[u++]=2;f[u++]=3;g=b.createBuffer();h=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);k=b.createTexture();l=b.createTexture();b.bindTexture(b.TEXTURE_2D,k);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,
 0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,l);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);
 b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(n=!1,r=a(THREE.ShaderFlares.lensFlare,d)):(n=!0,r=a(THREE.ShaderFlares.lensFlareVertexTexture,d));p={};s={};p.vertex=b.getAttribLocation(r,"position");p.uv=b.getAttribLocation(r,"uv");s.renderType=b.getUniformLocation(r,"renderType");s.map=b.getUniformLocation(r,"map");s.occlusionMap=b.getUniformLocation(r,"occlusionMap");s.opacity=
-b.getUniformLocation(r,"opacity");s.color=b.getUniformLocation(r,"color");s.scale=b.getUniformLocation(r,"scale");s.rotation=b.getUniformLocation(r,"rotation");s.screenPosition=b.getUniformLocation(r,"screenPosition")};this.render=function(a,d,e,f){a=a.__webglFlares;var t=a.length;if(t){var x=new THREE.Vector3,F=f/e,z=0.5*e,N=0.5*f,H=16/f,E=new THREE.Vector2(H*F,H),L=new THREE.Vector3(1,1,0),B=new THREE.Vector2(1,1),C=s,H=p;b.useProgram(r);b.enableVertexAttribArray(p.vertex);b.enableVertexAttribArray(p.uv);
-b.uniform1i(C.occlusionMap,0);b.uniform1i(C.map,1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(H.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(H.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(!1);var O,D,A,y,K;for(O=0;O<t;O++)if(H=16/f,E.set(H*F,H),y=a[O],x.set(y.matrixWorld.elements[12],y.matrixWorld.elements[13],y.matrixWorld.elements[14]),x.applyMatrix4(d.matrixWorldInverse),x.applyProjection(d.projectionMatrix),L.copy(x),B.x=L.x*z+z,
-B.y=L.y*N+N,n||0<B.x&&B.x<e&&0<B.y&&B.y<f)for(b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,B.x-8,B.y-8,16,16,0),b.uniform1i(C.renderType,0),b.uniform2f(C.scale,E.x,E.y),b.uniform3f(C.screenPosition,L.x,L.y,L.z),b.disable(b.BLEND),b.enable(b.DEPTH_TEST),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,l),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,B.x-8,B.y-8,16,16,0),b.uniform1i(C.renderType,1),b.disable(b.DEPTH_TEST),
-b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),y.positionScreen.copy(L),y.customUpdateCallback?y.customUpdateCallback(y):y.updateLensFlares(),b.uniform1i(C.renderType,2),b.enable(b.BLEND),D=0,A=y.lensFlares.length;D<A;D++)K=y.lensFlares[D],0.001<K.opacity&&0.001<K.scale&&(L.x=K.x,L.y=K.y,L.z=K.z,H=K.size*K.scale/f,E.x=H*F,E.y=H,b.uniform3f(C.screenPosition,L.x,L.y,L.z),b.uniform2f(C.scale,E.x,E.y),b.uniform1f(C.rotation,K.rotation),b.uniform1f(C.opacity,
-K.opacity),b.uniform3f(C.color,K.color.r,K.color.g,K.color.b),c.setBlending(K.blending,K.blendEquation,K.blendSrc,K.blendDst),c.setTexture(K.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
-vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(r,p){var s,u,q,w,v,t,x,F,z,N=[];w=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
-a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);s=0;for(u=r.__lights.length;s<u;s++)if(q=r.__lights[s],q.castShadow)if(q instanceof THREE.DirectionalLight&&q.shadowCascade)for(v=0;v<q.shadowCascadeCount;v++){var H;if(q.shadowCascadeArray[v])H=q.shadowCascadeArray[v];else{z=q;x=v;H=new THREE.DirectionalLight;H.isVirtual=!0;H.onlyShadow=!0;H.castShadow=!0;H.shadowCameraNear=z.shadowCameraNear;H.shadowCameraFar=z.shadowCameraFar;H.shadowCameraLeft=z.shadowCameraLeft;H.shadowCameraRight=z.shadowCameraRight;
-H.shadowCameraBottom=z.shadowCameraBottom;H.shadowCameraTop=z.shadowCameraTop;H.shadowCameraVisible=z.shadowCameraVisible;H.shadowDarkness=z.shadowDarkness;H.shadowBias=z.shadowCascadeBias[x];H.shadowMapWidth=z.shadowCascadeWidth[x];H.shadowMapHeight=z.shadowCascadeHeight[x];H.pointsWorld=[];H.pointsFrustum=[];F=H.pointsWorld;t=H.pointsFrustum;for(var E=0;8>E;E++)F[E]=new THREE.Vector3,t[E]=new THREE.Vector3;F=z.shadowCascadeNearZ[x];z=z.shadowCascadeFarZ[x];t[0].set(-1,-1,F);t[1].set(1,-1,F);t[2].set(-1,
-1,F);t[3].set(1,1,F);t[4].set(-1,-1,z);t[5].set(1,-1,z);t[6].set(-1,1,z);t[7].set(1,1,z);H.originalCamera=p;t=new THREE.Gyroscope;t.position.copy(q.shadowCascadeOffset);t.add(H);t.add(H.target);p.add(t);q.shadowCascadeArray[v]=H;console.log("Created virtualLight",H)}x=q;F=v;z=x.shadowCascadeArray[F];z.position.copy(x.position);z.target.position.copy(x.target.position);z.lookAt(z.target);z.shadowCameraVisible=x.shadowCameraVisible;z.shadowDarkness=x.shadowDarkness;z.shadowBias=x.shadowCascadeBias[F];
-t=x.shadowCascadeNearZ[F];x=x.shadowCascadeFarZ[F];z=z.pointsFrustum;z[0].z=t;z[1].z=t;z[2].z=t;z[3].z=t;z[4].z=x;z[5].z=x;z[6].z=x;z[7].z=x;N[w]=H;w++}else N[w]=q,w++;s=0;for(u=N.length;s<u;s++){q=N[s];q.shadowMap||(v=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(v=THREE.NearestFilter),q.shadowMap=new THREE.WebGLRenderTarget(q.shadowMapWidth,q.shadowMapHeight,{minFilter:v,magFilter:v,format:THREE.RGBAFormat}),q.shadowMapSize=new THREE.Vector2(q.shadowMapWidth,q.shadowMapHeight),q.shadowMatrix=
+b.getUniformLocation(r,"opacity");s.color=b.getUniformLocation(r,"color");s.scale=b.getUniformLocation(r,"scale");s.rotation=b.getUniformLocation(r,"rotation");s.screenPosition=b.getUniformLocation(r,"screenPosition")};this.render=function(a,d,e,f){a=a.__webglFlares;var t=a.length;if(t){var y=new THREE.Vector3,E=f/e,x=0.5*e,L=0.5*f,A=16/f,D=new THREE.Vector2(A*E,A),M=new THREE.Vector3(1,1,0),z=new THREE.Vector2(1,1),G=s,A=p;b.useProgram(r);b.enableVertexAttribArray(p.vertex);b.enableVertexAttribArray(p.uv);
+b.uniform1i(G.occlusionMap,0);b.uniform1i(G.map,1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(A.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(A.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(!1);var P,C,B,F,K;for(P=0;P<t;P++)if(A=16/f,D.set(A*E,A),F=a[P],y.set(F.matrixWorld.elements[12],F.matrixWorld.elements[13],F.matrixWorld.elements[14]),y.applyMatrix4(d.matrixWorldInverse),y.applyProjection(d.projectionMatrix),M.copy(y),z.x=M.x*x+x,
+z.y=M.y*L+L,n||0<z.x&&z.x<e&&0<z.y&&z.y<f)for(b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,z.x-8,z.y-8,16,16,0),b.uniform1i(G.renderType,0),b.uniform2f(G.scale,D.x,D.y),b.uniform3f(G.screenPosition,M.x,M.y,M.z),b.disable(b.BLEND),b.enable(b.DEPTH_TEST),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,l),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,z.x-8,z.y-8,16,16,0),b.uniform1i(G.renderType,1),b.disable(b.DEPTH_TEST),
+b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),F.positionScreen.copy(M),F.customUpdateCallback?F.customUpdateCallback(F):F.updateLensFlares(),b.uniform1i(G.renderType,2),b.enable(b.BLEND),C=0,B=F.lensFlares.length;C<B;C++)K=F.lensFlares[C],0.001<K.opacity&&0.001<K.scale&&(M.x=K.x,M.y=K.y,M.z=K.z,A=K.size*K.scale/f,D.x=A*E,D.y=A,b.uniform3f(G.screenPosition,M.x,M.y,M.z),b.uniform2f(G.scale,D.x,D.y),b.uniform1f(G.rotation,K.rotation),b.uniform1f(G.opacity,
+K.opacity),b.uniform3f(G.color,K.color.r,K.color.g,K.color.b),c.setBlending(K.blending,K.blendEquation,K.blendSrc,K.blendDst),c.setTexture(K.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
+vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(r,p){var s,u,q,w,v,t,y,E,x,L=[];w=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
+a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);s=0;for(u=r.__lights.length;s<u;s++)if(q=r.__lights[s],q.castShadow)if(q instanceof THREE.DirectionalLight&&q.shadowCascade)for(v=0;v<q.shadowCascadeCount;v++){var A;if(q.shadowCascadeArray[v])A=q.shadowCascadeArray[v];else{x=q;y=v;A=new THREE.DirectionalLight;A.isVirtual=!0;A.onlyShadow=!0;A.castShadow=!0;A.shadowCameraNear=x.shadowCameraNear;A.shadowCameraFar=x.shadowCameraFar;A.shadowCameraLeft=x.shadowCameraLeft;A.shadowCameraRight=x.shadowCameraRight;
+A.shadowCameraBottom=x.shadowCameraBottom;A.shadowCameraTop=x.shadowCameraTop;A.shadowCameraVisible=x.shadowCameraVisible;A.shadowDarkness=x.shadowDarkness;A.shadowBias=x.shadowCascadeBias[y];A.shadowMapWidth=x.shadowCascadeWidth[y];A.shadowMapHeight=x.shadowCascadeHeight[y];A.pointsWorld=[];A.pointsFrustum=[];E=A.pointsWorld;t=A.pointsFrustum;for(var D=0;8>D;D++)E[D]=new THREE.Vector3,t[D]=new THREE.Vector3;E=x.shadowCascadeNearZ[y];x=x.shadowCascadeFarZ[y];t[0].set(-1,-1,E);t[1].set(1,-1,E);t[2].set(-1,
+1,E);t[3].set(1,1,E);t[4].set(-1,-1,x);t[5].set(1,-1,x);t[6].set(-1,1,x);t[7].set(1,1,x);A.originalCamera=p;t=new THREE.Gyroscope;t.position.copy(q.shadowCascadeOffset);t.add(A);t.add(A.target);p.add(t);q.shadowCascadeArray[v]=A;console.log("Created virtualLight",A)}y=q;E=v;x=y.shadowCascadeArray[E];x.position.copy(y.position);x.target.position.copy(y.target.position);x.lookAt(x.target);x.shadowCameraVisible=y.shadowCameraVisible;x.shadowDarkness=y.shadowDarkness;x.shadowBias=y.shadowCascadeBias[E];
+t=y.shadowCascadeNearZ[E];y=y.shadowCascadeFarZ[E];x=x.pointsFrustum;x[0].z=t;x[1].z=t;x[2].z=t;x[3].z=t;x[4].z=y;x[5].z=y;x[6].z=y;x[7].z=y;L[w]=A;w++}else L[w]=q,w++;s=0;for(u=L.length;s<u;s++){q=L[s];q.shadowMap||(v=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(v=THREE.NearestFilter),q.shadowMap=new THREE.WebGLRenderTarget(q.shadowMapWidth,q.shadowMapHeight,{minFilter:v,magFilter:v,format:THREE.RGBAFormat}),q.shadowMapSize=new THREE.Vector2(q.shadowMapWidth,q.shadowMapHeight),q.shadowMatrix=
 new THREE.Matrix4);if(!q.shadowCamera){if(q instanceof THREE.SpotLight)q.shadowCamera=new THREE.PerspectiveCamera(q.shadowCameraFov,q.shadowMapWidth/q.shadowMapHeight,q.shadowCameraNear,q.shadowCameraFar);else if(q instanceof THREE.DirectionalLight)q.shadowCamera=new THREE.OrthographicCamera(q.shadowCameraLeft,q.shadowCameraRight,q.shadowCameraTop,q.shadowCameraBottom,q.shadowCameraNear,q.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}r.add(q.shadowCamera);!0===
-r.autoUpdate&&r.updateMatrixWorld()}q.shadowCameraVisible&&!q.cameraHelper&&(q.cameraHelper=new THREE.CameraHelper(q.shadowCamera),q.shadowCamera.add(q.cameraHelper));if(q.isVirtual&&H.originalCamera==p){v=p;w=q.shadowCamera;t=q.pointsFrustum;z=q.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(x=0;8>x;x++)F=z[x],F.copy(t[x]),THREE.ShadowMapPlugin.__projector.unprojectVector(F,v),F.applyMatrix4(w.matrixWorldInverse),F.x<k.x&&(k.x=F.x),F.x>l.x&&(l.x=F.x),F.y<k.y&&
-(k.y=F.y),F.y>l.y&&(l.y=F.y),F.z<k.z&&(k.z=F.z),F.z>l.z&&(l.z=F.z);w.left=k.x;w.right=l.x;w.top=l.y;w.bottom=k.y;w.updateProjectionMatrix()}w=q.shadowMap;t=q.shadowMatrix;v=q.shadowCamera;v.position.setFromMatrixPosition(q.matrixWorld);n.setFromMatrixPosition(q.target.matrixWorld);v.lookAt(n);v.updateMatrixWorld();v.matrixWorldInverse.getInverse(v.matrixWorld);q.cameraHelper&&(q.cameraHelper.visible=q.shadowCameraVisible);q.shadowCameraVisible&&q.cameraHelper.update();t.set(0.5,0,0,0.5,0,0.5,0,0.5,
-0,0,0.5,0.5,0,0,0,1);t.multiply(v.projectionMatrix);t.multiply(v.matrixWorldInverse);h.multiplyMatrices(v.projectionMatrix,v.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(w);b.clear();z=r.__webglObjects;q=0;for(w=z.length;q<w;q++)x=z[q],t=x.object,x.render=!1,!t.visible||!t.castShadow||(t instanceof THREE.Mesh||t instanceof THREE.ParticleSystem)&&t.frustumCulled&&!g.intersectsObject(t)||(t._modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,t.matrixWorld),x.render=!0);q=0;for(w=z.length;q<
-w;q++)x=z[q],x.render&&(t=x.object,x=x.buffer,E=t.material instanceof THREE.MeshFaceMaterial?t.material.materials[0]:t.material,F=void 0!==t.geometry.morphTargets&&0<t.geometry.morphTargets.length&&E.morphTargets,E=t instanceof THREE.SkinnedMesh&&E.skinning,F=t.customDepthMaterial?t.customDepthMaterial:E?F?f:e:F?d:c,x instanceof THREE.BufferGeometry?b.renderBufferDirect(v,r.__lights,null,F,x,t):b.renderBuffer(v,r.__lights,null,F,x,t));z=r.__webglObjectsImmediate;q=0;for(w=z.length;q<w;q++)x=z[q],
-t=x.object,t.visible&&t.castShadow&&(t._modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,t.matrixWorld),b.renderImmediateObject(v,r.__lights,null,c,t))}s=b.getClearColor();u=b.getClearAlpha();a.clearColor(s.r,s.g,s.b,u);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){var a,b,c,d,e,f,g,h,k,l,n,r,p,s,u,q,w;function v(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var t,x,F,z,N,H,E,L;this.init=function(v){t=v.context;x=v;z=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);N=new Uint16Array([0,1,2,0,2,3]);H=t.createBuffer();E=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,H);t.bufferData(t.ARRAY_BUFFER,z,t.STATIC_DRAW);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,E);t.bufferData(t.ELEMENT_ARRAY_BUFFER,N,t.STATIC_DRAW);v=t.createProgram();
-var C=t.createShader(t.VERTEX_SHADER),O=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(C,["precision "+x.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
-t.shaderSource(O,["precision "+x.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
-t.compileShader(C);t.compileShader(O);t.attachShader(v,C);t.attachShader(v,O);t.linkProgram(v);L=v;q=t.getAttribLocation(L,"position");w=t.getAttribLocation(L,"uv");a=t.getUniformLocation(L,"uvOffset");b=t.getUniformLocation(L,"uvScale");c=t.getUniformLocation(L,"rotation");d=t.getUniformLocation(L,"scale");e=t.getUniformLocation(L,"color");f=t.getUniformLocation(L,"map");g=t.getUniformLocation(L,"opacity");h=t.getUniformLocation(L,"modelViewMatrix");k=t.getUniformLocation(L,"projectionMatrix");l=
-t.getUniformLocation(L,"fogType");n=t.getUniformLocation(L,"fogDensity");r=t.getUniformLocation(L,"fogNear");p=t.getUniformLocation(L,"fogFar");s=t.getUniformLocation(L,"fogColor");u=t.getUniformLocation(L,"alphaTest");v=document.createElement("canvas");v.width=8;v.height=8;C=v.getContext("2d");C.fillStyle="#ffffff";C.fillRect(0,0,v.width,v.height);F=new THREE.Texture(v);F.needsUpdate=!0};this.render=function(z,C,O,D){O=z.__webglSprites;if(D=O.length){t.useProgram(L);t.enableVertexAttribArray(q);
-t.enableVertexAttribArray(w);t.disable(t.CULL_FACE);t.enable(t.BLEND);t.bindBuffer(t.ARRAY_BUFFER,H);t.vertexAttribPointer(q,2,t.FLOAT,!1,16,0);t.vertexAttribPointer(w,2,t.FLOAT,!1,16,8);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,E);t.uniformMatrix4fv(k,!1,C.projectionMatrix.elements);t.activeTexture(t.TEXTURE0);t.uniform1i(f,0);var A=0,y=0,K=z.fog;K?(t.uniform3f(s,K.color.r,K.color.g,K.color.b),K instanceof THREE.Fog?(t.uniform1f(r,K.near),t.uniform1f(p,K.far),t.uniform1i(l,1),y=A=1):K instanceof THREE.FogExp2&&
-(t.uniform1f(n,K.density),t.uniform1i(l,2),y=A=2)):(t.uniform1i(l,0),y=A=0);for(var G,N=[],K=0;K<D;K++)G=O[K],!1!==G.visible&&(G._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,G.matrixWorld),G.z=-G._modelViewMatrix.elements[14]);O.sort(v);for(K=0;K<D;K++)G=O[K],!1!==G.visible&&(C=G.material,t.uniform1f(u,C.alphaTest),t.uniformMatrix4fv(h,!1,G._modelViewMatrix.elements),N[0]=G.scale.x,N[1]=G.scale.y,G=z.fog&&C.fog?y:0,A!==G&&(t.uniform1i(l,G),A=G),null!==C.map?(t.uniform2f(a,C.map.offset.x,
-C.map.offset.y),t.uniform2f(b,C.map.repeat.x,C.map.repeat.y)):(t.uniform2f(a,0,0),t.uniform2f(b,1,1)),t.uniform1f(g,C.opacity),t.uniform3f(e,C.color.r,C.color.g,C.color.b),t.uniform1f(c,C.rotation),t.uniform2fv(d,N),x.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),x.setDepthTest(C.depthTest),x.setDepthWrite(C.depthWrite),C.map&&C.map.image&&C.map.image.width?x.setTexture(C.map,0):x.setTexture(F,0),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0));t.enable(t.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
+r.autoUpdate&&r.updateMatrixWorld()}q.shadowCameraVisible&&!q.cameraHelper&&(q.cameraHelper=new THREE.CameraHelper(q.shadowCamera),q.shadowCamera.add(q.cameraHelper));if(q.isVirtual&&A.originalCamera==p){v=p;w=q.shadowCamera;t=q.pointsFrustum;x=q.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(y=0;8>y;y++)E=x[y],E.copy(t[y]),THREE.ShadowMapPlugin.__projector.unprojectVector(E,v),E.applyMatrix4(w.matrixWorldInverse),E.x<k.x&&(k.x=E.x),E.x>l.x&&(l.x=E.x),E.y<k.y&&
+(k.y=E.y),E.y>l.y&&(l.y=E.y),E.z<k.z&&(k.z=E.z),E.z>l.z&&(l.z=E.z);w.left=k.x;w.right=l.x;w.top=l.y;w.bottom=k.y;w.updateProjectionMatrix()}w=q.shadowMap;t=q.shadowMatrix;v=q.shadowCamera;v.position.setFromMatrixPosition(q.matrixWorld);n.setFromMatrixPosition(q.target.matrixWorld);v.lookAt(n);v.updateMatrixWorld();v.matrixWorldInverse.getInverse(v.matrixWorld);q.cameraHelper&&(q.cameraHelper.visible=q.shadowCameraVisible);q.shadowCameraVisible&&q.cameraHelper.update();t.set(0.5,0,0,0.5,0,0.5,0,0.5,
+0,0,0.5,0.5,0,0,0,1);t.multiply(v.projectionMatrix);t.multiply(v.matrixWorldInverse);h.multiplyMatrices(v.projectionMatrix,v.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(w);b.clear();x=r.__webglObjects;q=0;for(w=x.length;q<w;q++)y=x[q],t=y.object,y.render=!1,!t.visible||!t.castShadow||(t instanceof THREE.Mesh||t instanceof THREE.ParticleSystem)&&t.frustumCulled&&!g.intersectsObject(t)||(t._modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,t.matrixWorld),y.render=!0);q=0;for(w=x.length;q<
+w;q++)y=x[q],y.render&&(t=y.object,y=y.buffer,D=t.material instanceof THREE.MeshFaceMaterial?t.material.materials[0]:t.material,E=void 0!==t.geometry.morphTargets&&0<t.geometry.morphTargets.length&&D.morphTargets,D=t instanceof THREE.SkinnedMesh&&D.skinning,E=t.customDepthMaterial?t.customDepthMaterial:D?E?f:e:E?d:c,y instanceof THREE.BufferGeometry?b.renderBufferDirect(v,r.__lights,null,E,y,t):b.renderBuffer(v,r.__lights,null,E,y,t));x=r.__webglObjectsImmediate;q=0;for(w=x.length;q<w;q++)y=x[q],
+t=y.object,t.visible&&t.castShadow&&(t._modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,t.matrixWorld),b.renderImmediateObject(v,r.__lights,null,c,t))}s=b.getClearColor();u=b.getClearAlpha();a.clearColor(s.r,s.g,s.b,u);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){var a,b,c,d,e,f,g,h,k,l,n,r,p,s,u,q,w;function v(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var t,y,E,x,L,A,D,M;this.init=function(v){t=v.context;y=v;x=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);L=new Uint16Array([0,1,2,0,2,3]);A=t.createBuffer();D=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,A);t.bufferData(t.ARRAY_BUFFER,x,t.STATIC_DRAW);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,D);t.bufferData(t.ELEMENT_ARRAY_BUFFER,L,t.STATIC_DRAW);v=t.createProgram();
+var G=t.createShader(t.VERTEX_SHADER),P=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(G,["precision "+y.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
+t.shaderSource(P,["precision "+y.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
+t.compileShader(G);t.compileShader(P);t.attachShader(v,G);t.attachShader(v,P);t.linkProgram(v);M=v;q=t.getAttribLocation(M,"position");w=t.getAttribLocation(M,"uv");a=t.getUniformLocation(M,"uvOffset");b=t.getUniformLocation(M,"uvScale");c=t.getUniformLocation(M,"rotation");d=t.getUniformLocation(M,"scale");e=t.getUniformLocation(M,"color");f=t.getUniformLocation(M,"map");g=t.getUniformLocation(M,"opacity");h=t.getUniformLocation(M,"modelViewMatrix");k=t.getUniformLocation(M,"projectionMatrix");l=
+t.getUniformLocation(M,"fogType");n=t.getUniformLocation(M,"fogDensity");r=t.getUniformLocation(M,"fogNear");p=t.getUniformLocation(M,"fogFar");s=t.getUniformLocation(M,"fogColor");u=t.getUniformLocation(M,"alphaTest");v=document.createElement("canvas");v.width=8;v.height=8;G=v.getContext("2d");G.fillStyle="#ffffff";G.fillRect(0,0,v.width,v.height);E=new THREE.Texture(v);E.needsUpdate=!0};this.render=function(z,x,L,C){L=z.__webglSprites;if(C=L.length){t.useProgram(M);t.enableVertexAttribArray(q);
+t.enableVertexAttribArray(w);t.disable(t.CULL_FACE);t.enable(t.BLEND);t.bindBuffer(t.ARRAY_BUFFER,A);t.vertexAttribPointer(q,2,t.FLOAT,!1,16,0);t.vertexAttribPointer(w,2,t.FLOAT,!1,16,8);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,D);t.uniformMatrix4fv(k,!1,x.projectionMatrix.elements);t.activeTexture(t.TEXTURE0);t.uniform1i(f,0);var B=0,F=0,K=z.fog;K?(t.uniform3f(s,K.color.r,K.color.g,K.color.b),K instanceof THREE.Fog?(t.uniform1f(r,K.near),t.uniform1f(p,K.far),t.uniform1i(l,1),F=B=1):K instanceof THREE.FogExp2&&
+(t.uniform1f(n,K.density),t.uniform1i(l,2),F=B=2)):(t.uniform1i(l,0),F=B=0);for(var H,Q=[],K=0;K<C;K++)H=L[K],!1!==H.visible&&(H._modelViewMatrix.multiplyMatrices(x.matrixWorldInverse,H.matrixWorld),H.z=-H._modelViewMatrix.elements[14]);L.sort(v);for(K=0;K<C;K++)H=L[K],!1!==H.visible&&(x=H.material,t.uniform1f(u,x.alphaTest),t.uniformMatrix4fv(h,!1,H._modelViewMatrix.elements),Q[0]=H.scale.x,Q[1]=H.scale.y,H=z.fog&&x.fog?F:0,B!==H&&(t.uniform1i(l,H),B=H),null!==x.map?(t.uniform2f(a,x.map.offset.x,
+x.map.offset.y),t.uniform2f(b,x.map.repeat.x,x.map.repeat.y)):(t.uniform2f(a,0,0),t.uniform2f(b,1,1)),t.uniform1f(g,x.opacity),t.uniform3f(e,x.color.r,x.color.g,x.color.b),t.uniform1f(c,x.rotation),t.uniform2fv(d,Q),y.setBlending(x.blending,x.blendEquation,x.blendSrc,x.blendDst),y.setDepthTest(x.depthTest),y.setDepthWrite(x.depthWrite),x.map&&x.map.image&&x.map.image.width?y.setTexture(x.map,0):y.setTexture(E,0),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0));t.enable(t.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
 vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(k,l){var n,r,p,s,u,q;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===k.autoUpdate&&k.updateMatrixWorld();l.matrixWorldInverse.getInverse(l.matrixWorld);h.multiplyMatrices(l.projectionMatrix,
 l.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(this.renderTarget);b.clear();q=k.__webglObjects;n=0;for(r=q.length;n<r;n++)p=q[n],u=p.object,p.render=!1,!u.visible||(u instanceof THREE.Mesh||u instanceof THREE.ParticleSystem)&&u.frustumCulled&&!g.intersectsObject(u)||(u._modelViewMatrix.multiplyMatrices(l.matrixWorldInverse,u.matrixWorld),p.render=!0);var w;n=0;for(r=q.length;n<r;n++)p=q[n],p.render&&(u=p.object,p=p.buffer,u instanceof THREE.ParticleSystem&&!u.customDepthMaterial||((w=
 u.material instanceof THREE.MeshFaceMaterial?u.material.materials[0]:u.material)&&b.setMaterialFaces(u.material),s=void 0!==u.geometry.morphTargets&&0<u.geometry.morphTargets.length&&w.morphTargets,w=u instanceof THREE.SkinnedMesh&&w.skinning,s=u.customDepthMaterial?u.customDepthMaterial:w?s?f:e:s?d:c,p instanceof THREE.BufferGeometry?b.renderBufferDirect(l,k.__lights,null,s,p,u):b.renderBuffer(l,k.__lights,null,s,p,u)));q=k.__webglObjectsImmediate;n=0;for(r=q.length;n<r;n++)p=q[n],u=p.object,u.visible&&