Browse Source

Updated builds.

Mr.doob 11 years ago
parent
commit
892de25b19
2 changed files with 89 additions and 84 deletions
  1. 11 6
      build/three.js
  2. 78 78
      build/three.min.js

+ 11 - 6
build/three.js

@@ -20049,17 +20049,17 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		}
 
-		this.setViewport( 0, 0, _canvas.width, _canvas.height );
+		this.setViewport( 0, 0, width, height );
 
 	};
 
 	this.setViewport = function ( x, y, width, height ) {
 
-		_viewportX = x !== undefined ? x : 0;
-		_viewportY = y !== undefined ? y : 0;
+		_viewportX = x * this.devicePixelRatio;
+		_viewportY = y * this.devicePixelRatio;
 
-		_viewportWidth = width !== undefined ? width : _canvas.width;
-		_viewportHeight = height !== undefined ? height : _canvas.height;
+		_viewportWidth = width * this.devicePixelRatio;
+		_viewportHeight = height * this.devicePixelRatio;
 
 		_gl.viewport( _viewportX, _viewportY, _viewportWidth, _viewportHeight );
 
@@ -20067,7 +20067,12 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	this.setScissor = function ( x, y, width, height ) {
 
-		_gl.scissor( x, y, width, height );
+		_gl.scissor(
+			x * this.devicePixelRatio,
+			y * this.devicePixelRatio,
+			width * this.devicePixelRatio,
+			height * this.devicePixelRatio
+		);
 
 	};
 

+ 78 - 78
build/three.min.js

@@ -92,7 +92,7 @@ f*d,b[1]=f*e,b[5]=f*g,b[9]=-c,b[2]=i*c-k,b[6]=m+a*c,b[10]=f*h):"ZXY"===a.order?(
 h*g,b[4]=-e,b[8]=d*g,b[1]=a*e+m,b[5]=f*g,b[9]=i*e-k,b[2]=k*e-i,b[6]=c*g,b[10]=m*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,h=c+c,g=d+d,i=e+e,a=c*h,k=c*g,c=
 c*i,m=d*g,d=d*i,e=e*i,h=f*h,g=f*g,f=f*i;b[0]=1-(m+e);b[4]=k-f;b[8]=c+g;b[1]=k+f;b[5]=1-(a+e);b[9]=d-h;b[2]=c-g;b[6]=d+h;b[10]=1-(a+m);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 h=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);h[0]=a.x;
 h[4]=b.x;h[8]=c.x;h[1]=a.y;h[5]=b.y;h[9]=c.y;h[2]=a.z;h[6]=b.z;h[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],h=c[4],g=c[8],i=c[12],k=c[1],m=c[5],l=c[9],p=c[13],s=c[2],t=c[6],n=c[10],q=c[14],u=c[3],r=c[7],v=c[11],c=c[15],
-y=d[0],D=d[4],M=d[8],B=d[12],I=d[1],w=d[5],G=d[9],N=d[13],x=d[2],E=d[6],A=d[10],z=d[14],C=d[3],L=d[7],F=d[11],d=d[15];e[0]=f*y+h*I+g*x+i*C;e[4]=f*D+h*w+g*E+i*L;e[8]=f*M+h*G+g*A+i*F;e[12]=f*B+h*N+g*z+i*d;e[1]=k*y+m*I+l*x+p*C;e[5]=k*D+m*w+l*E+p*L;e[9]=k*M+m*G+l*A+p*F;e[13]=k*B+m*N+l*z+p*d;e[2]=s*y+t*I+n*x+q*C;e[6]=s*D+t*w+n*E+q*L;e[10]=s*M+t*G+n*A+q*F;e[14]=s*B+t*N+n*z+q*d;e[3]=u*y+r*I+v*x+c*C;e[7]=u*D+r*w+v*E+c*L;e[11]=u*M+r*G+v*A+c*F;e[15]=u*B+r*N+v*z+c*d;return this},multiplyToArray:function(a,b,
+y=d[0],D=d[4],L=d[8],B=d[12],I=d[1],w=d[5],G=d[9],N=d[13],x=d[2],E=d[6],A=d[10],z=d[14],C=d[3],M=d[7],F=d[11],d=d[15];e[0]=f*y+h*I+g*x+i*C;e[4]=f*D+h*w+g*E+i*M;e[8]=f*L+h*G+g*A+i*F;e[12]=f*B+h*N+g*z+i*d;e[1]=k*y+m*I+l*x+p*C;e[5]=k*D+m*w+l*E+p*M;e[9]=k*L+m*G+l*A+p*F;e[13]=k*B+m*N+l*z+p*d;e[2]=s*y+t*I+n*x+q*C;e[6]=s*D+t*w+n*E+q*M;e[10]=s*L+t*G+n*A+q*F;e[14]=s*B+t*N+n*z+q*d;e[3]=u*y+r*I+v*x+c*C;e[7]=u*D+r*w+v*E+c*M;e[11]=u*L+r*G+v*A+c*F;e[15]=u*B+r*N+v*z+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(){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.applyProjection(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("DEPRECATED: Matrix4's .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");
 a.transformDirection(this)},crossVector:function(a){console.warn("DEPRECATED: Matrix4's .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],h=a[5],g=a[9],i=a[13],k=a[2],m=a[6],l=a[10],p=a[14];return a[3]*(+e*g*m-d*i*m-e*h*l+c*i*l+d*h*p-c*g*p)+a[7]*(+b*g*p-b*i*l+e*f*l-d*f*p+d*i*k-e*g*k)+a[11]*(+b*i*m-b*h*p-e*f*m+c*f*p+e*h*k-c*i*k)+a[15]*(-d*h*k-b*g*m+b*h*l+d*f*m-c*f*
@@ -143,9 +143,9 @@ THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:functio
 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(){var a=[];return function(b){if(void 0!==this._listeners){var c=this._listeners[b.type];if(void 0!==c){b.target=this;for(var d=c.length,e=0;e<d;e++)a[e]=c[e];for(e=0;e<d;e++)a[e].call(this,
 b)}}}}()};(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},h=new a.Vector3,g=new a.Vector3,i=new a.Vector3,k=function(f,m,s){if(f instanceof a.Sprite){d.setFromMatrixPosition(f.matrixWorld);var t=m.ray.distanceToPoint(d);if(t>f.scale.x)return s;s.push({distance:t,point:f.position,face:null,object:f})}else if(f instanceof
 a.LOD)d.setFromMatrixPosition(f.matrixWorld),t=m.ray.origin.distanceTo(d),k(f.getObjectForDistance(t),m,s);else if(f instanceof a.Mesh){var n=f.geometry;null===n.boundingSphere&&n.computeBoundingSphere();b.copy(n.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===m.ray.isIntersectionSphere(b))return s;e.getInverse(f.matrixWorld);c.copy(m.ray).applyMatrix4(e);if(null!==n.boundingBox&&!1===c.isIntersectionBox(n.boundingBox))return s;if(n instanceof a.BufferGeometry){var q=f.material;if(void 0===
-q||!1===n.dynamic)return s;var u,r,v=m.precision;if(void 0!==n.attributes.index)for(var y=n.offsets,D=n.attributes.index.array,M=n.attributes.position.array,B=n.offsets.length,I=n.attributes.index.array.length/3,I=0;I<B;++I)for(var t=y[I].start,w=y[I].index,n=t,G=t+y[I].count;n<G;n+=3)t=w+D[n],u=w+D[n+1],r=w+D[n+2],h.set(M[3*t],M[3*t+1],M[3*t+2]),g.set(M[3*u],M[3*u+1],M[3*u+2]),i.set(M[3*r],M[3*r+1],M[3*r+2]),u=q.side===a.BackSide?c.intersectTriangle(i,g,h,!0):c.intersectTriangle(h,g,i,q.side!==a.DoubleSide),
-null!==u&&(u.applyMatrix4(f.matrixWorld),t=m.ray.origin.distanceTo(u),t<v||(t<m.near||t>m.far)||s.push({distance:t,point:u,face:null,faceIndex:null,object:f}));else{M=n.attributes.position.array;I=n.attributes.position.array.length;for(n=0;n<I;n+=3)t=n,u=n+1,r=n+2,h.set(M[3*t],M[3*t+1],M[3*t+2]),g.set(M[3*u],M[3*u+1],M[3*u+2]),i.set(M[3*r],M[3*r+1],M[3*r+2]),u=q.side===a.BackSide?c.intersectTriangle(i,g,h,!0):c.intersectTriangle(h,g,i,q.side!==a.DoubleSide),null!==u&&(u.applyMatrix4(f.matrixWorld),
-t=m.ray.origin.distanceTo(u),t<v||(t<m.near||t>m.far)||s.push({distance:t,point:u,face:null,faceIndex:null,object:f}))}}else if(n instanceof a.Geometry){D=f.material instanceof a.MeshFaceMaterial;M=!0===D?f.material.materials:null;v=m.precision;y=n.vertices;B=0;for(I=n.faces.length;B<I;B++)if(w=n.faces[B],q=!0===D?M[w.materialIndex]:f.material,void 0!==q){t=y[w.a];u=y[w.b];r=y[w.c];if(!0===q.morphTargets){var G=n.morphTargets,N=f.morphTargetInfluences;h.set(0,0,0);g.set(0,0,0);i.set(0,0,0);for(var x=
+q||!1===n.dynamic)return s;var u,r,v=m.precision;if(void 0!==n.attributes.index)for(var y=n.offsets,D=n.attributes.index.array,L=n.attributes.position.array,B=n.offsets.length,I=n.attributes.index.array.length/3,I=0;I<B;++I)for(var t=y[I].start,w=y[I].index,n=t,G=t+y[I].count;n<G;n+=3)t=w+D[n],u=w+D[n+1],r=w+D[n+2],h.set(L[3*t],L[3*t+1],L[3*t+2]),g.set(L[3*u],L[3*u+1],L[3*u+2]),i.set(L[3*r],L[3*r+1],L[3*r+2]),u=q.side===a.BackSide?c.intersectTriangle(i,g,h,!0):c.intersectTriangle(h,g,i,q.side!==a.DoubleSide),
+null!==u&&(u.applyMatrix4(f.matrixWorld),t=m.ray.origin.distanceTo(u),t<v||(t<m.near||t>m.far)||s.push({distance:t,point:u,face:null,faceIndex:null,object:f}));else{L=n.attributes.position.array;I=n.attributes.position.array.length;for(n=0;n<I;n+=3)t=n,u=n+1,r=n+2,h.set(L[3*t],L[3*t+1],L[3*t+2]),g.set(L[3*u],L[3*u+1],L[3*u+2]),i.set(L[3*r],L[3*r+1],L[3*r+2]),u=q.side===a.BackSide?c.intersectTriangle(i,g,h,!0):c.intersectTriangle(h,g,i,q.side!==a.DoubleSide),null!==u&&(u.applyMatrix4(f.matrixWorld),
+t=m.ray.origin.distanceTo(u),t<v||(t<m.near||t>m.far)||s.push({distance:t,point:u,face:null,faceIndex:null,object:f}))}}else if(n instanceof a.Geometry){D=f.material instanceof a.MeshFaceMaterial;L=!0===D?f.material.materials:null;v=m.precision;y=n.vertices;B=0;for(I=n.faces.length;B<I;B++)if(w=n.faces[B],q=!0===D?L[w.materialIndex]:f.material,void 0!==q){t=y[w.a];u=y[w.b];r=y[w.c];if(!0===q.morphTargets){var G=n.morphTargets,N=f.morphTargetInfluences;h.set(0,0,0);g.set(0,0,0);i.set(0,0,0);for(var x=
 0,E=G.length;x<E;x++){var A=N[x];if(0!==A){var z=G[x].vertices;h.x+=(z[w.a].x-t.x)*A;h.y+=(z[w.a].y-t.y)*A;h.z+=(z[w.a].z-t.z)*A;g.x+=(z[w.b].x-u.x)*A;g.y+=(z[w.b].y-u.y)*A;g.z+=(z[w.b].z-u.z)*A;i.x+=(z[w.c].x-r.x)*A;i.y+=(z[w.c].y-r.y)*A;i.z+=(z[w.c].z-r.z)*A}}h.add(t);g.add(u);i.add(r);t=h;u=g;r=i}u=q.side===a.BackSide?c.intersectTriangle(r,u,t,!0):c.intersectTriangle(t,u,r,q.side!==a.DoubleSide);null!==u&&(u.applyMatrix4(f.matrixWorld),t=m.ray.origin.distanceTo(u),t<v||(t<m.near||t>m.far)||s.push({distance:t,
 point:u,face:w,faceIndex:B,object:f}))}}}else if(f instanceof a.Line){v=m.linePrecision;q=v*v;n=f.geometry;null===n.boundingSphere&&n.computeBoundingSphere();b.copy(n.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===m.ray.isIntersectionSphere(b))return s;e.getInverse(f.matrixWorld);c.copy(m.ray).applyMatrix4(e);if(n instanceof a.Geometry){y=n.vertices;v=y.length;u=new a.Vector3;r=new a.Vector3;I=f.type===a.LineStrip?1:2;for(n=0;n<v-1;n+=I)c.distanceSqToSegment(y[n],y[n+1],r,u)>q||(t=c.origin.distanceTo(r),
 t<m.near||t>m.far||s.push({distance:t,point:u.clone().applyMatrix4(f.matrixWorld),face:null,faceIndex:null,object:f}))}}},m=function(a,b,c){for(var a=a.getDescendants(),d=0,e=a.length;d<e;d++)k(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&&m(a,this,c);k(a,this,c);c.sort(f);return c};a.Raycaster.prototype.intersectObjects=function(a,
@@ -162,17 +162,17 @@ b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];if(e.name=
 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(i===m){var a=new THREE.RenderableVertex;k.push(a);m++;i++;return a}return k[i++]}function b(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,h=-a.z+a.w,g=-b.z+b.w;if(0<=e&&0<=f&&0<=h&&0<=g)return!0;if(0>e&&0>f||0>h&&0>g)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>h?c=Math.max(c,h/(h-g)):0>g&&(d=Math.min(d,h/(h-g)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var d,e,f=[],h=
-0,g,i,k=[],m=0,l,p,s=[],t=0,n,q,u=[],r=0,v,y,D=[],M=0,B={objects:[],sprites:[],lights:[],elements:[]},I=new THREE.Vector3,w=new THREE.Vector3,G=new THREE.Vector3,N=new THREE.Vector3,x=new THREE.Vector4,E=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),A=new THREE.Box3,z=Array(3),C=new THREE.Matrix4,L=new THREE.Matrix4,F,Z=new THREE.Matrix4,ea=new THREE.Matrix3,Ba=new THREE.Matrix3,H=new THREE.Vector3,V=new THREE.Frustum,da=new THREE.Vector4,ia=new THREE.Vector4;this.projectVector=
-function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);L.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(L)};var K=new THREE.Matrix4;this.unprojectVector=function(a,b){K.getInverse(b.projectionMatrix);L.multiplyMatrices(b.matrixWorld,K);return a.applyProjection(L)};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 P=function(a){if(e===
-h){var b=new THREE.RenderableObject;f.push(b);h++;e++;d=b}else d=f[e++];d.id=a.id;d.object=a;null!==a.renderDepth?d.z=a.renderDepth:(N.setFromMatrixPosition(a.matrixWorld),N.applyProjection(L),d.z=N.z);return d},ja=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(F);c.copy(b).applyMatrix4(L);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},Fa=function(a){if(!1!==a.visible){a instanceof THREE.Light?B.lights.push(a):a instanceof
-THREE.Mesh||a instanceof THREE.Line?(!1===a.frustumCulled||!0===V.intersectsObject(a))&&B.objects.push(P(a)):a instanceof THREE.Sprite&&B.sprites.push(P(a));for(var b=0,c=a.children.length;b<c;b++)Fa(a.children[b])}};this.projectScene=function(d,f,h,m){var K=!1,N,P,T,U,Ia,$,fa,ua,Ma;y=q=p=0;B.elements.length=0;!0===d.autoUpdate&&d.updateMatrixWorld();void 0===f.parent&&f.updateMatrixWorld();C.copy(f.matrixWorldInverse.getInverse(f.matrixWorld));L.multiplyMatrices(f.projectionMatrix,C);Ba.getNormalMatrix(C);
-V.setFromMatrix(L);e=0;B.objects.length=0;B.sprites.length=0;B.lights.length=0;Fa(d);!0===h&&B.objects.sort(b);for(var h=0,xa=B.objects.length;h<xa;h++)if(d=B.objects[h].object,F=d.matrixWorld,i=0,d instanceof THREE.Mesh){N=d.geometry;P=N.vertices;T=N.faces;Ia=N.faceVertexUvs;ea.getNormalMatrix(F);ua=d.material instanceof THREE.MeshFaceMaterial;Ma=!0===ua?d.material:null;for(var ma=0,ka=P.length;ma<ka;ma++)g=a(),g.position.copy(P[ma]),ja(g);ma=0;for(ka=T.length;ma<ka;ma++){P=T[ma];var Ja=!0===ua?
+0,g,i,k=[],m=0,l,p,s=[],t=0,n,q,u=[],r=0,v,y,D=[],L=0,B={objects:[],sprites:[],lights:[],elements:[]},I=new THREE.Vector3,w=new THREE.Vector3,G=new THREE.Vector3,N=new THREE.Vector3,x=new THREE.Vector4,E=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),A=new THREE.Box3,z=Array(3),C=new THREE.Matrix4,M=new THREE.Matrix4,F,Z=new THREE.Matrix4,ea=new THREE.Matrix3,Ba=new THREE.Matrix3,H=new THREE.Vector3,V=new THREE.Frustum,da=new THREE.Vector4,ia=new THREE.Vector4;this.projectVector=
+function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);M.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(M)};var K=new THREE.Matrix4;this.unprojectVector=function(a,b){K.getInverse(b.projectionMatrix);M.multiplyMatrices(b.matrixWorld,K);return a.applyProjection(M)};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 P=function(a){if(e===
+h){var b=new THREE.RenderableObject;f.push(b);h++;e++;d=b}else d=f[e++];d.id=a.id;d.object=a;null!==a.renderDepth?d.z=a.renderDepth:(N.setFromMatrixPosition(a.matrixWorld),N.applyProjection(M),d.z=N.z);return d},ja=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(F);c.copy(b).applyMatrix4(M);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},Fa=function(a){if(!1!==a.visible){a instanceof THREE.Light?B.lights.push(a):a instanceof
+THREE.Mesh||a instanceof THREE.Line?(!1===a.frustumCulled||!0===V.intersectsObject(a))&&B.objects.push(P(a)):a instanceof THREE.Sprite&&B.sprites.push(P(a));for(var b=0,c=a.children.length;b<c;b++)Fa(a.children[b])}};this.projectScene=function(d,f,h,m){var K=!1,N,P,T,U,Ia,$,fa,ua,Ma;y=q=p=0;B.elements.length=0;!0===d.autoUpdate&&d.updateMatrixWorld();void 0===f.parent&&f.updateMatrixWorld();C.copy(f.matrixWorldInverse.getInverse(f.matrixWorld));M.multiplyMatrices(f.projectionMatrix,C);Ba.getNormalMatrix(C);
+V.setFromMatrix(M);e=0;B.objects.length=0;B.sprites.length=0;B.lights.length=0;Fa(d);!0===h&&B.objects.sort(b);for(var h=0,xa=B.objects.length;h<xa;h++)if(d=B.objects[h].object,F=d.matrixWorld,i=0,d instanceof THREE.Mesh){N=d.geometry;P=N.vertices;T=N.faces;Ia=N.faceVertexUvs;ea.getNormalMatrix(F);ua=d.material instanceof THREE.MeshFaceMaterial;Ma=!0===ua?d.material:null;for(var ma=0,ka=P.length;ma<ka;ma++)g=a(),g.position.copy(P[ma]),ja(g);ma=0;for(ka=T.length;ma<ka;ma++){P=T[ma];var Ja=!0===ua?
 Ma.materials[P.materialIndex]:d.material;if(void 0!==Ja){var Ga=Ja.side;U=k[P.a];$=k[P.b];fa=k[P.c];if(!0===Ja.morphTargets){var K=N.morphTargets,Aa=d.morphTargetInfluences,Na=U.position,Oa=$.position,Ka=fa.position;I.set(0,0,0);w.set(0,0,0);G.set(0,0,0);for(var Qa=0,La=K.length;Qa<La;Qa++){var S=Aa[Qa];if(0!==S){var oa=K[Qa].vertices;I.x+=(oa[P.a].x-Na.x)*S;I.y+=(oa[P.a].y-Na.y)*S;I.z+=(oa[P.a].z-Na.z)*S;w.x+=(oa[P.b].x-Oa.x)*S;w.y+=(oa[P.b].y-Oa.y)*S;w.z+=(oa[P.b].z-Oa.z)*S;G.x+=(oa[P.c].x-Ka.x)*
 S;G.y+=(oa[P.c].y-Ka.y)*S;G.z+=(oa[P.c].z-Ka.z)*S}}U.position.add(I);$.position.add(w);fa.position.add(G);ja(U);ja($);ja(fa)}z[0]=U.positionScreen;z[1]=$.positionScreen;z[2]=fa.positionScreen;if(!0===U.visible||!0===$.visible||!0===fa.visible||E.isIntersectionBox(A.setFromPoints(z)))if(K=0>(fa.positionScreen.x-U.positionScreen.x)*($.positionScreen.y-U.positionScreen.y)-(fa.positionScreen.y-U.positionScreen.y)*($.positionScreen.x-U.positionScreen.x),Ga===THREE.DoubleSide||K===(Ga===THREE.FrontSide)){p===
 t?(Aa=new THREE.RenderableFace3,s.push(Aa),t++,p++,l=Aa):l=s[p++];l.id=d.id;l.v1.copy(U);l.v2.copy($);l.v3.copy(fa);l.normalModel.copy(P.normal);!1===K&&(Ga===THREE.BackSide||Ga===THREE.DoubleSide)&&l.normalModel.negate();l.normalModel.applyMatrix3(ea).normalize();l.normalModelView.copy(l.normalModel).applyMatrix3(Ba);l.centroidModel.copy(P.centroid).applyMatrix4(F);U=P.vertexNormals;$=0;for(fa=Math.min(U.length,3);$<fa;$++)Aa=l.vertexNormalsModel[$],Aa.copy(U[$]),!1===K&&(Ga===THREE.BackSide||Ga===
-THREE.DoubleSide)&&Aa.negate(),Aa.applyMatrix3(ea).normalize(),l.vertexNormalsModelView[$].copy(Aa).applyMatrix3(Ba);l.vertexNormalsLength=U.length;$=0;for(Ga=Math.min(Ia.length,3);$<Ga;$++)if(U=Ia[$][ma],void 0!==U){fa=0;for(K=U.length;fa<K;fa++)l.uvs[$][fa]=U[fa]}l.color=P.color;l.material=Ja;H.copy(l.centroidModel).applyProjection(L);l.z=H.z;B.elements.push(l)}}}}else if(d instanceof THREE.Line){Z.multiplyMatrices(L,F);P=d.geometry.vertices;U=a();U.positionScreen.copy(P[0]).applyMatrix4(Z);N=d.type===
+THREE.DoubleSide)&&Aa.negate(),Aa.applyMatrix3(ea).normalize(),l.vertexNormalsModelView[$].copy(Aa).applyMatrix3(Ba);l.vertexNormalsLength=U.length;$=0;for(Ga=Math.min(Ia.length,3);$<Ga;$++)if(U=Ia[$][ma],void 0!==U){fa=0;for(K=U.length;fa<K;fa++)l.uvs[$][fa]=U[fa]}l.color=P.color;l.material=Ja;H.copy(l.centroidModel).applyProjection(M);l.z=H.z;B.elements.push(l)}}}}else if(d instanceof THREE.Line){Z.multiplyMatrices(M,F);P=d.geometry.vertices;U=a();U.positionScreen.copy(P[0]).applyMatrix4(Z);N=d.type===
 THREE.LinePieces?2:1;ma=1;for(ka=P.length;ma<ka;ma++)U=a(),U.positionScreen.copy(P[ma]).applyMatrix4(Z),0<(ma+1)%N||($=k[i-2],da.copy(U.positionScreen),ia.copy($.positionScreen),!0===c(da,ia)&&(da.multiplyScalar(1/da.w),ia.multiplyScalar(1/ia.w),q===r?(T=new THREE.RenderableLine,u.push(T),r++,q++,n=T):n=u[q++],n.id=d.id,n.v1.positionScreen.copy(da),n.v2.positionScreen.copy(ia),n.z=Math.max(da.z,ia.z),n.material=d.material,d.material.vertexColors===THREE.VertexColors&&(n.vertexColors[0].copy(d.geometry.colors[ma]),
-n.vertexColors[1].copy(d.geometry.colors[ma-1])),B.elements.push(n)))}h=0;for(xa=B.sprites.length;h<xa;h++)d=B.sprites[h].object,F=d.matrixWorld,x.set(F.elements[12],F.elements[13],F.elements[14],1),x.applyMatrix4(L),N=1/x.w,x.z*=N,-1<=x.z&&1>=x.z&&(y===M?(T=new THREE.RenderableSprite,D.push(T),M++,y++,v=T):v=D[y++],v.id=d.id,v.x=x.x*N,v.y=x.y*N,v.z=x.z,v.object=d,v.rotation=d.rotation,v.scale.x=d.scale.x*Math.abs(v.x-(x.x+f.projectionMatrix.elements[0])/(x.w+f.projectionMatrix.elements[12])),v.scale.y=
+n.vertexColors[1].copy(d.geometry.colors[ma-1])),B.elements.push(n)))}h=0;for(xa=B.sprites.length;h<xa;h++)d=B.sprites[h].object,F=d.matrixWorld,x.set(F.elements[12],F.elements[13],F.elements[14],1),x.applyMatrix4(M),N=1/x.w,x.z*=N,-1<=x.z&&1>=x.z&&(y===L?(T=new THREE.RenderableSprite,D.push(T),L++,y++,v=T):v=D[y++],v.id=d.id,v.x=x.x*N,v.y=x.y*N,v.z=x.z,v.object=d,v.rotation=d.rotation,v.scale.x=d.scale.x*Math.abs(v.x-(x.x+f.projectionMatrix.elements[0])/(x.w+f.projectionMatrix.elements[12])),v.scale.y=
 d.scale.y*Math.abs(v.y-(x.y+f.projectionMatrix.elements[5])/(x.w+f.projectionMatrix.elements[13])),v.material=d.material,B.elements.push(v));!0===m&&B.elements.sort(b);return B}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
 return a}};THREE.Face4=function(a,b,c,d,e,f,h){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,h)};THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=
@@ -183,8 +183,8 @@ h);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){
 0;for(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++){e=this.faces[c];e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=
 e.normal.clone();e.__originalVertexNormals||(e.__originalVertexNormals=[]);a=0;for(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 h=this.morphNormals[a].vertexNormals,g,i;c=0;for(d=this.faces.length;c<d;c++)g=new THREE.Vector3,i={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(g),h.push(i)}h=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],g=h.faceNormals[c],i=h.vertexNormals[c],g.copy(e.normal),i.a.copy(e.vertexNormals[0]),i.b.copy(e.vertexNormals[1]),i.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,h,g,i,k,m,l,p,s,t,n,q,u=[],r=[];c=new THREE.Vector3;var v=new THREE.Vector3,y=new THREE.Vector3,D=new THREE.Vector3,M=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)u[a]=new THREE.Vector3,r[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,q=e.b,e=e.c,h=this.vertices[d],g=this.vertices[q],
-i=this.vertices[e],k=f[0],m=f[1],l=f[2],f=g.x-h.x,p=i.x-h.x,s=g.y-h.y,t=i.y-h.y,g=g.z-h.z,h=i.z-h.z,i=m.x-k.x,n=l.x-k.x,m=m.y-k.y,k=l.y-k.y,l=1/(i*k-n*m),c.set((k*f-m*p)*l,(k*s-m*t)*l,(k*g-m*h)*l),v.set((i*p-n*f)*l,(i*t-n*s)*l,(i*h-n*g)*l),u[d].add(c),u[q].add(c),u[e].add(c),r[d].add(v),r[q].add(v),r[e].add(v);v=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++){e=this.faces[a];for(c=0;c<Math.min(e.vertexNormals.length,3);c++)M.copy(e.vertexNormals[c]),d=e[v[c]],q=u[d],y.copy(q),y.sub(M.multiplyScalar(M.dot(q))).normalize(),
+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,h,g,i,k,m,l,p,s,t,n,q,u=[],r=[];c=new THREE.Vector3;var v=new THREE.Vector3,y=new THREE.Vector3,D=new THREE.Vector3,L=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)u[a]=new THREE.Vector3,r[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,q=e.b,e=e.c,h=this.vertices[d],g=this.vertices[q],
+i=this.vertices[e],k=f[0],m=f[1],l=f[2],f=g.x-h.x,p=i.x-h.x,s=g.y-h.y,t=i.y-h.y,g=g.z-h.z,h=i.z-h.z,i=m.x-k.x,n=l.x-k.x,m=m.y-k.y,k=l.y-k.y,l=1/(i*k-n*m),c.set((k*f-m*p)*l,(k*s-m*t)*l,(k*g-m*h)*l),v.set((i*p-n*f)*l,(i*t-n*s)*l,(i*h-n*g)*l),u[d].add(c),u[q].add(c),u[e].add(c),r[d].add(v),r[q].add(v),r[e].add(v);v=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++){e=this.faces[a];for(c=0;c<Math.min(e.vertexNormals.length,3);c++)L.copy(e.vertexNormals[c]),d=e[v[c]],q=u[d],y.copy(q),y.sub(L.multiplyScalar(L.dot(q))).normalize(),
 D.crossVectors(e.vertexNormals[c],q),d=D.dot(r[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(y.x,y.y,y.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,h;f=0;for(h=this.vertices.length;f<h;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(h=this.faces.length;f<h;f++){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];for(d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}}for(f=a.length-1;0<=f;f--){e=
 a[f];this.faces.splice(e,1);c=0;for(h=this.faceVertexUvs.length;c<h;c++)this.faceVertexUvs[c].splice(e,1)}f=this.vertices.length-b.length;this.vertices=b;return f},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],f=[],h=0,g=e.length;h<g;h++)f.push(new THREE.Vector2(e[h].x,e[h].y));a.faceVertexUvs[0].push(f)}return a},
@@ -196,9 +196,9 @@ b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal
 r.length;c<d;++c){b=r[c].start;h=r[c].count;var v=r[c].index;a=b;for(b+=h;a<b;a+=3)h=v+u[a],g=v+u[a+1],i=v+u[a+2],k=e[3*h],m=e[3*h+1],l=e[3*h+2],p.set(k,m,l),k=e[3*g],m=e[3*g+1],l=e[3*g+2],s.set(k,m,l),k=e[3*i],m=e[3*i+1],l=e[3*i+2],t.set(k,m,l),n.subVectors(t,s),q.subVectors(p,s),n.cross(q),f[3*h]+=n.x,f[3*h+1]+=n.y,f[3*h+2]+=n.z,f[3*g]+=n.x,f[3*g+1]+=n.y,f[3*g+2]+=n.z,f[3*i]+=n.x,f[3*i+1]+=n.y,f[3*i+2]+=n.z}}else{a=0;for(b=e.length;a<b;a+=9)k=e[a],m=e[a+1],l=e[a+2],p.set(k,m,l),k=e[a+3],m=e[a+4],
 l=e[a+5],s.set(k,m,l),k=e[a+6],m=e[a+7],l=e[a+8],t.set(k,m,l),n.subVectors(t,s),q.subVectors(p,s),n.cross(q),f[a]=n.x,f[a+1]=n.y,f[a+2]=n.z,f[a+3]=n.x,f[a+4]=n.y,f[a+5]=n.z,f[a+6]=n.x,f[a+7]=n.y,f[a+8]=n.z}this.normalizeNormals();this.normalsNeedUpdate=!0}},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){ea.x=d[3*a];ea.y=d[3*a+1];
 ea.z=d[3*a+2];Ba.copy(ea);V=g[a];F.copy(V);F.sub(ea.multiplyScalar(ea.dot(V))).normalize();Z.crossVectors(Ba,V);da=Z.dot(i[a]);H=0>da?-1:1;h[4*a]=F.x;h[4*a+1]=F.y;h[4*a+2]=F.z;h[4*a+3]=H}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 b=this.attributes.index.array,c=this.attributes.position.array,
-d=this.attributes.normal.array,e=this.attributes.uv.array,f=c.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent={itemSize:4,array:new Float32Array(4*f)});for(var h=this.attributes.tangent.array,g=[],i=[],k=0;k<f;k++)g[k]=new THREE.Vector3,i[k]=new THREE.Vector3;var m,l,p,s,t,n,q,u,r,v,y,D,M,B,I,f=new THREE.Vector3,k=new THREE.Vector3,w,G,N,x,E,A,z,C=this.offsets;N=0;for(x=C.length;N<x;++N){G=C[N].start;E=C[N].count;var L=C[N].index;w=G;for(G+=E;w<G;w+=3)E=L+b[w],A=L+b[w+1],z=L+b[w+
-2],m=c[3*E],l=c[3*E+1],p=c[3*E+2],s=c[3*A],t=c[3*A+1],n=c[3*A+2],q=c[3*z],u=c[3*z+1],r=c[3*z+2],v=e[2*E],y=e[2*E+1],D=e[2*A],M=e[2*A+1],B=e[2*z],I=e[2*z+1],s-=m,m=q-m,t-=l,l=u-l,n-=p,p=r-p,D-=v,v=B-v,M-=y,y=I-y,I=1/(D*y-v*M),f.set((y*s-M*m)*I,(y*t-M*l)*I,(y*n-M*p)*I),k.set((D*m-v*s)*I,(D*l-v*t)*I,(D*p-v*n)*I),g[E].add(f),g[A].add(f),g[z].add(f),i[E].add(k),i[A].add(k),i[z].add(k)}var F=new THREE.Vector3,Z=new THREE.Vector3,ea=new THREE.Vector3,Ba=new THREE.Vector3,H,V,da;N=0;for(x=C.length;N<x;++N){G=
-C[N].start;E=C[N].count;L=C[N].index;w=G;for(G+=E;w<G;w+=3)E=L+b[w],A=L+b[w+1],z=L+b[w+2],a(E),a(A),a(z)}this.tangentsNeedUpdate=this.hasTangents=!0}},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,numItems:d.numItems,array:null},d=0,h=b.length;d<h;d++){var g=b[d];if(e instanceof g){f.array=new g(e);
+d=this.attributes.normal.array,e=this.attributes.uv.array,f=c.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent={itemSize:4,array:new Float32Array(4*f)});for(var h=this.attributes.tangent.array,g=[],i=[],k=0;k<f;k++)g[k]=new THREE.Vector3,i[k]=new THREE.Vector3;var m,l,p,s,t,n,q,u,r,v,y,D,L,B,I,f=new THREE.Vector3,k=new THREE.Vector3,w,G,N,x,E,A,z,C=this.offsets;N=0;for(x=C.length;N<x;++N){G=C[N].start;E=C[N].count;var M=C[N].index;w=G;for(G+=E;w<G;w+=3)E=M+b[w],A=M+b[w+1],z=M+b[w+
+2],m=c[3*E],l=c[3*E+1],p=c[3*E+2],s=c[3*A],t=c[3*A+1],n=c[3*A+2],q=c[3*z],u=c[3*z+1],r=c[3*z+2],v=e[2*E],y=e[2*E+1],D=e[2*A],L=e[2*A+1],B=e[2*z],I=e[2*z+1],s-=m,m=q-m,t-=l,l=u-l,n-=p,p=r-p,D-=v,v=B-v,L-=y,y=I-y,I=1/(D*y-v*L),f.set((y*s-L*m)*I,(y*t-L*l)*I,(y*n-L*p)*I),k.set((D*m-v*s)*I,(D*l-v*t)*I,(D*p-v*n)*I),g[E].add(f),g[A].add(f),g[z].add(f),i[E].add(k),i[A].add(k),i[z].add(k)}var F=new THREE.Vector3,Z=new THREE.Vector3,ea=new THREE.Vector3,Ba=new THREE.Vector3,H,V,da;N=0;for(x=C.length;N<x;++N){G=
+C[N].start;E=C[N].count;M=C[N].index;w=G;for(G+=E;w<G;w+=3)E=M+b[w],A=M+b[w+1],z=M+b[w+2],a(E),a(A),a(z)}this.tangentsNeedUpdate=this.hasTangents=!0}},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,numItems:d.numItems,array:null},d=0,h=b.length;d<h;d++){var g=b[d];if(e instanceof g){f.array=new g(e);
 break}}a.attributes[c]=f}d=0;for(h=this.offsets.length;d<h;d++)b=this.offsets[d],a.offsets.push({start:b.start,index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
 THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};
 THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;return a};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
@@ -247,12 +247,12 @@ new THREE.DirectionalLight(u,c);r.position.fromArray(q.direction);break;case "Sp
 q.size_y}a.add(r);r.name=m;B.lights[m]=r;B.objects[m]=r}else"PerspectiveCamera"===q.type||"OrthographicCamera"===q.type?(e=q.position,h=q.rotation,k=q.quaternion,"PerspectiveCamera"===q.type?n=new THREE.PerspectiveCamera(q.fov,q.aspect,q.near,q.far):"OrthographicCamera"===q.type&&(n=new THREE.OrthographicCamera(q.left,q.right,q.top,q.bottom,q.near,q.far)),n.name=m,n.position.fromArray(e),void 0!==k?n.quaternion.fromArray(k):void 0!==h&&n.rotation.fromArray(h),a.add(n),B.cameras[m]=n,B.objects[m]=
 n):(e=q.position,h=q.rotation,i=q.scale,k=q.quaternion,p=new THREE.Object3D,p.name=m,p.position.fromArray(e),k?p.quaternion.fromArray(k):p.rotation.fromArray(h),p.scale.fromArray(i),p.visible=void 0!==q.visible?q.visible:!1,a.add(p),B.objects[m]=p,B.empties[m]=p);if(p){if(void 0!==q.userData)for(var y in q.userData)p.userData[y]=q.userData[y];if(void 0!==q.groups)for(u=0;u<q.groups.length;u++)c=q.groups[u],void 0===B.groups[c]&&(B.groups[c]=[]),B.groups[c].push(m)}}void 0!==p&&void 0!==q.children&&
 f(p,q.children)}}function h(a){return function(b,c){b.name=a;B.geometries[a]=b;B.face_materials[a]=c;e();v-=1;l.onLoadComplete();k()}}function g(a,b,c,d){return function(f){var f=f.content?f.content:f.dae?f.scene:f,h=d.rotation,g=d.quaternion,i=d.scale;f.position.fromArray(d.position);g?f.quaternion.fromArray(g):f.rotation.fromArray(h);f.scale.fromArray(i);c&&f.traverse(function(a){a.material=c});var m=void 0!==d.visible?d.visible:!0;f.traverse(function(a){a.visible=m});b.add(f);f.name=a;B.objects[a]=
-f;e();v-=1;l.onLoadComplete();k()}}function i(a){return function(b,c){b.name=a;B.geometries[a]=b;B.face_materials[a]=c}}function k(){l.callbackProgress({totalModels:D,totalTextures:M,loadedModels:D-v,loadedTextures:M-y},B);l.onLoadProgress();if(0===v&&0===y){for(var a=0;a<I.length;a++){var c=I[a],d=B.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,B.scene.add(c.object.target));c.object.target.userData.targetInverse=c.object}b(B)}}function m(a,b){b(a);if(void 0!==a.children)for(var c in a.children)m(a.children[c],
-b)}var l=this,p=THREE.Loader.prototype.extractUrlBase(c),s,t,n,q,u,r,v,y,D,M,B,I=[],w=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;y=v=0;B={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{},groups:{}};if(w.transform&&(G=w.transform.position,
+f;e();v-=1;l.onLoadComplete();k()}}function i(a){return function(b,c){b.name=a;B.geometries[a]=b;B.face_materials[a]=c}}function k(){l.callbackProgress({totalModels:D,totalTextures:L,loadedModels:D-v,loadedTextures:L-y},B);l.onLoadProgress();if(0===v&&0===y){for(var a=0;a<I.length;a++){var c=I[a],d=B.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,B.scene.add(c.object.target));c.object.target.userData.targetInverse=c.object}b(B)}}function m(a,b){b(a);if(void 0!==a.children)for(var c in a.children)m(a.children[c],
+b)}var l=this,p=THREE.Loader.prototype.extractUrlBase(c),s,t,n,q,u,r,v,y,D,L,B,I=[],w=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;y=v=0;B={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{},groups:{}};if(w.transform&&(G=w.transform.position,
 a=w.transform.rotation,c=w.transform.scale,G&&B.scene.position.fromArray(G),a&&B.scene.rotation.fromArray(a),c&&B.scene.scale.fromArray(c),G||a||c))B.scene.updateMatrix(),B.scene.updateMatrixWorld();G=function(a){return function(){y-=a;k();l.onLoadComplete()}};for(var N in w.fogs)a=w.fogs[N],"linear"===a.type?q=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(q=new THREE.FogExp2(0,a.density)),a=a.color,q.color.setRGB(a[0],a[1],a[2]),B.fogs[N]=q;for(var x in w.geometries)q=w.geometries[x],q.type in
 this.geometryHandlers&&(v+=1,l.onLoadStart());for(var E in w.objects)m(w.objects[E],function(a){a.type&&a.type in l.hierarchyHandlers&&(v+=1,l.onLoadStart())});D=v;for(x in w.geometries)if(q=w.geometries[x],"cube"===q.type)s=new THREE.CubeGeometry(q.width,q.height,q.depth,q.widthSegments,q.heightSegments,q.depthSegments),s.name=x,B.geometries[x]=s;else if("plane"===q.type)s=new THREE.PlaneGeometry(q.width,q.height,q.widthSegments,q.heightSegments),s.name=x,B.geometries[x]=s;else if("sphere"===q.type)s=
 new THREE.SphereGeometry(q.radius,q.widthSegments,q.heightSegments),s.name=x,B.geometries[x]=s;else if("cylinder"===q.type)s=new THREE.CylinderGeometry(q.topRad,q.botRad,q.height,q.radSegs,q.heightSegs),s.name=x,B.geometries[x]=s;else if("torus"===q.type)s=new THREE.TorusGeometry(q.radius,q.tube,q.segmentsR,q.segmentsT),s.name=x,B.geometries[x]=s;else if("icosahedron"===q.type)s=new THREE.IcosahedronGeometry(q.radius,q.subdivisions),s.name=x,B.geometries[x]=s;else if(q.type in this.geometryHandlers){E=
-{};for(u in q)"type"!==u&&"url"!==u&&(E[u]=q[u]);this.geometryHandlers[q.type].loaderObject.load(d(q.url,w.urlBaseType),h(x),E)}else"embedded"===q.type&&(E=w.embeds[q.id],E.metadata=w.metadata,E&&(E=this.geometryHandlers.ascii.loaderObject.parse(E,""),i(x)(E.geometry,E.materials)));for(var A in w.textures)if(x=w.textures[A],x.url instanceof Array){y+=x.url.length;for(u=0;u<x.url.length;u++)l.onLoadStart()}else y+=1,l.onLoadStart();M=y;for(A in w.textures){x=w.textures[A];void 0!==x.mapping&&void 0!==
+{};for(u in q)"type"!==u&&"url"!==u&&(E[u]=q[u]);this.geometryHandlers[q.type].loaderObject.load(d(q.url,w.urlBaseType),h(x),E)}else"embedded"===q.type&&(E=w.embeds[q.id],E.metadata=w.metadata,E&&(E=this.geometryHandlers.ascii.loaderObject.parse(E,""),i(x)(E.geometry,E.materials)));for(var A in w.textures)if(x=w.textures[A],x.url instanceof Array){y+=x.url.length;for(u=0;u<x.url.length;u++)l.onLoadStart()}else y+=1,l.onLoadStart();L=y;for(A in w.textures){x=w.textures[A];void 0!==x.mapping&&void 0!==
 THREE[x.mapping]&&(x.mapping=new THREE[x.mapping]);if(x.url instanceof Array){E=x.url.length;q=[];for(u=0;u<E;u++)q[u]=d(x.url[u],w.urlBaseType);u=(u=/\.dds$/i.test(q[0]))?THREE.ImageUtils.loadCompressedTextureCube(q,x.mapping,G(E)):THREE.ImageUtils.loadTextureCube(q,x.mapping,G(E))}else u=/\.dds$/i.test(x.url),E=d(x.url,w.urlBaseType),q=G(1),u=u?THREE.ImageUtils.loadCompressedTexture(E,x.mapping,q):THREE.ImageUtils.loadTexture(E,x.mapping,q),void 0!==THREE[x.minFilter]&&(u.minFilter=THREE[x.minFilter]),
 void 0!==THREE[x.magFilter]&&(u.magFilter=THREE[x.magFilter]),x.anisotropy&&(u.anisotropy=x.anisotropy),x.repeat&&(u.repeat.set(x.repeat[0],x.repeat[1]),1!==x.repeat[0]&&(u.wrapS=THREE.RepeatWrapping),1!==x.repeat[1]&&(u.wrapT=THREE.RepeatWrapping)),x.offset&&u.offset.set(x.offset[0],x.offset[1]),x.wrap&&(E={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==E[x.wrap[0]]&&(u.wrapS=E[x.wrap[0]]),void 0!==E[x.wrap[1]]&&(u.wrapT=E[x.wrap[1]]));B.textures[A]=u}var z,C;for(z in w.materials){A=
 w.materials[z];for(C in A.parameters)"envMap"===C||"map"===C||"lightMap"===C||"bumpMap"===C?A.parameters[C]=B.textures[A.parameters[C]]:"shading"===C?A.parameters[C]="flat"===A.parameters[C]?THREE.FlatShading:THREE.SmoothShading:"side"===C?A.parameters[C]="double"==A.parameters[C]?THREE.DoubleSide:"back"==A.parameters[C]?THREE.BackSide:THREE.FrontSide:"blending"===C?A.parameters[C]=A.parameters[C]in THREE?THREE[A.parameters[C]]:THREE.NormalBlending:"combine"===C?A.parameters[C]=A.parameters[C]in THREE?
@@ -299,25 +299,25 @@ THREE.LOD.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector
 THREE.LOD.prototype.clone=function(a){void 0===a&&(a=new THREE.LOD);THREE.Object3D.prototype.clone.call(this,a);for(var b=0,c=this.objects.length;b<c;b++){var d=this.objects[b].object.clone();d.visible=0===b;a.addLevel(d,this.objects[b].distance)}return a};THREE.Sprite=function(a){THREE.Object3D.call(this);this.material=void 0!==a?a:new THREE.SpriteMaterial};THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype);THREE.Sprite.prototype.updateMatrix=function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0};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){for(var d=0,e=M.length;d<e;d++){var f=M[d];ua.copy(f.color);if(f instanceof THREE.DirectionalLight){var h=sa.setFromMatrixPosition(f.matrixWorld).normalize(),g=b.dot(h);0>=g||(g*=f.intensity,c.add(ua.multiplyScalar(g)))}else f instanceof THREE.PointLight&&(h=sa.setFromMatrixPosition(f.matrixWorld),g=b.dot(sa.subVectors(h,a).normalize()),0>=g||(g*=0==f.distance?1:1-Math.min(a.distanceTo(h)/f.distance,1),0!=g&&(g*=f.intensity,c.add(ua.multiplyScalar(g)))))}}
+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){for(var d=0,e=L.length;d<e;d++){var f=L[d];ua.copy(f.color);if(f instanceof THREE.DirectionalLight){var h=sa.setFromMatrixPosition(f.matrixWorld).normalize(),g=b.dot(h);0>=g||(g*=f.intensity,c.add(ua.multiplyScalar(g)))}else f instanceof THREE.PointLight&&(h=sa.setFromMatrixPosition(f.matrixWorld),g=b.dot(sa.subVectors(h,a).normalize()),0>=g||(g*=0==f.distance?1:1-Math.min(a.distanceTo(h)/f.distance,1),0!=g&&(g*=f.intensity,c.add(ua.multiplyScalar(g)))))}}
 function c(a,b,c,d){p(b);s(c);t(d);n(a.getStyle());E.stroke();oa.expandByScalar(2*b)}function d(a){q(a.getStyle());E.fill()}function e(a){f(a.target)}function f(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);Ma[a.id]=E.createPattern(e,!0===b&&!0===c?"repeat":!0===b&&!1===c?"repeat-x":!1===b&&!0===c?"repeat-y":"no-repeat")}
 function h(a,b,c,d,h,g,j,i,k,m,l,p,n){if(!(n instanceof THREE.DataTexture)){!1===n.hasEventListener("update",e)&&(void 0!==n.image&&0<n.image.width&&f(n),n.addEventListener("update",e));var r=Ma[n.id];if(void 0!==r){q(r);var r=n.offset.x/n.repeat.x,s=n.offset.y/n.repeat.y,t=n.image.width*n.repeat.x,n=n.image.height*n.repeat.y,j=(j+r)*t,i=(i+s)*n,c=c-a,d=d-b,h=h-a,g=g-b,k=(k+r)*t-j,m=(m+s)*n-i,l=(l+r)*t-j,p=(p+s)*n-i,n=k*p-l*m;0!==n&&(r=1/n,n=(p*c-m*h)*r,m=(p*d-m*g)*r,c=(k*h-l*c)*r,d=(k*g-l*d)*r,a=
 a-n*j-c*i,b=b-m*j-d*i,E.save(),E.transform(n,m,c,d,a,b),E.fill(),E.restore())}else q("rgba(0,0,0,1)"),E.fill()}}function g(a,b,c,d,e,f,h,g,j,i,k,m,l){var n,p;n=l.width-1;p=l.height-1;h*=n;g*=p;c-=a;d-=b;e-=a;f-=b;j=j*n-h;i=i*p-g;k=k*n-h;m=m*p-g;p=1/(j*m-k*i);n=(m*c-i*e)*p;i=(m*d-i*f)*p;c=(j*e-k*c)*p;d=(j*f-k*d)*p;a=a-n*h-c*g;b=b-i*h-d*g;E.save();E.transform(n,i,c,d,a,b);E.clip();E.drawImage(l,0,0);E.restore()}function i(a,b,c,d){ba[0]=255*a.r|0;ba[1]=255*a.g|0;ba[2]=255*a.b|0;ba[4]=255*b.r|0;ba[5]=
-255*b.g|0;ba[6]=255*b.b|0;ba[8]=255*c.r|0;ba[9]=255*c.g|0;ba[10]=255*c.b|0;ba[12]=255*d.r|0;ba[13]=255*d.g|0;ba[14]=255*d.b|0;j.putImageData(cb,0,0);ta.drawImage(Ra,0,0);return va}function k(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 m(a){C!==a&&(C=E.globalAlpha=a)}function l(a){L!==a&&(a===THREE.NormalBlending?E.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?E.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&
-(E.globalCompositeOperation="darker"),L=a)}function p(a){ea!==a&&(ea=E.lineWidth=a)}function s(a){Ba!==a&&(Ba=E.lineCap=a)}function t(a){H!==a&&(H=E.lineJoin=a)}function n(a){F!==a&&(F=E.strokeStyle=a)}function q(a){Z!==a&&(Z=E.fillStyle=a)}function u(a,b){if(V!==a||da!==b)E.setLineDash([a,b]),V=a,da=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var r=THREE.Math.smoothstep,a=a||{},v=this,y,D,M,B=new THREE.Projector,I=void 0!==a.canvas?a.canvas:document.createElement("canvas"),w=I.width,G=I.height,
-N=Math.floor(w/2),x=Math.floor(G/2),E=I.getContext("2d"),A=new THREE.Color(0),z=0,C=1,L=0,F=null,Z=null,ea=null,Ba=null,H=null,V=null,da=0,ia,K,P,ja;new THREE.RenderableVertex;new THREE.RenderableVertex;var Fa,Pa,Ea,ya,Ha,Va,wa=new THREE.Color,za=new THREE.Color,T=new THREE.Color,U=new THREE.Color,Ia=new THREE.Color,$=new THREE.Color,fa=new THREE.Color,ua=new THREE.Color,Ma={},xa,ma,ka,Ja,Ga,Aa,Na,Oa,Ka,Qa,La=new THREE.Box2,S=new THREE.Box2,oa=new THREE.Box2,gb=new THREE.Color,ra=new THREE.Color,
+255*b.g|0;ba[6]=255*b.b|0;ba[8]=255*c.r|0;ba[9]=255*c.g|0;ba[10]=255*c.b|0;ba[12]=255*d.r|0;ba[13]=255*d.g|0;ba[14]=255*d.b|0;j.putImageData(cb,0,0);ta.drawImage(Ra,0,0);return va}function k(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 m(a){C!==a&&(C=E.globalAlpha=a)}function l(a){M!==a&&(a===THREE.NormalBlending?E.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?E.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&
+(E.globalCompositeOperation="darker"),M=a)}function p(a){ea!==a&&(ea=E.lineWidth=a)}function s(a){Ba!==a&&(Ba=E.lineCap=a)}function t(a){H!==a&&(H=E.lineJoin=a)}function n(a){F!==a&&(F=E.strokeStyle=a)}function q(a){Z!==a&&(Z=E.fillStyle=a)}function u(a,b){if(V!==a||da!==b)E.setLineDash([a,b]),V=a,da=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var r=THREE.Math.smoothstep,a=a||{},v=this,y,D,L,B=new THREE.Projector,I=void 0!==a.canvas?a.canvas:document.createElement("canvas"),w=I.width,G=I.height,
+N=Math.floor(w/2),x=Math.floor(G/2),E=I.getContext("2d"),A=new THREE.Color(0),z=0,C=1,M=0,F=null,Z=null,ea=null,Ba=null,H=null,V=null,da=0,ia,K,P,ja;new THREE.RenderableVertex;new THREE.RenderableVertex;var Fa,Pa,Ea,ya,Ha,Va,wa=new THREE.Color,za=new THREE.Color,T=new THREE.Color,U=new THREE.Color,Ia=new THREE.Color,$=new THREE.Color,fa=new THREE.Color,ua=new THREE.Color,Ma={},xa,ma,ka,Ja,Ga,Aa,Na,Oa,Ka,Qa,La=new THREE.Box2,S=new THREE.Box2,oa=new THREE.Box2,gb=new THREE.Color,ra=new THREE.Color,
 ga=new THREE.Color,sa=new THREE.Vector3,Ra,j,cb,ba,va,ta,Ya=16;Ra=document.createElement("canvas");Ra.width=Ra.height=2;j=Ra.getContext("2d");j.fillStyle="rgba(0,0,0,1)";j.fillRect(0,0,2,2);cb=j.getImageData(0,0,2,2);ba=cb.data;va=document.createElement("canvas");va.width=va.height=Ya;ta=va.getContext("2d");ta.translate(-Ya/2,-Ya/2);ta.scale(Ya,Ya);Ya--;void 0===E.setLineDash&&(E.setLineDash=void 0!==E.mozDash?function(a){E.mozDash=null!==a[0]?a:null}:function(){});this.domElement=I;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){w=a*this.devicePixelRatio;G=b*this.devicePixelRatio;N=Math.floor(w/2);x=Math.floor(G/2);I.width=w;I.height=G;1!==this.devicePixelRatio&&!1!==c&&(I.style.width=a+"px",I.style.height=b+"px");La.set(new THREE.Vector2(-N,
--x),new THREE.Vector2(N,x));S.set(new THREE.Vector2(-N,-x),new THREE.Vector2(N,x));C=1;L=0;H=Ba=ea=Z=F=null};this.setClearColor=function(a,b){A.set(a);z=void 0!==b?b:1;S.set(new THREE.Vector2(-N,-x),new THREE.Vector2(N,x))};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(){E.setTransform(1,0,0,-1,N,x);!1===S.empty()&&(S.intersect(La),
+-x),new THREE.Vector2(N,x));S.set(new THREE.Vector2(-N,-x),new THREE.Vector2(N,x));C=1;M=0;H=Ba=ea=Z=F=null};this.setClearColor=function(a,b){A.set(a);z=void 0!==b?b:1;S.set(new THREE.Vector2(-N,-x),new THREE.Vector2(N,x))};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(){E.setTransform(1,0,0,-1,N,x);!1===S.empty()&&(S.intersect(La),
 S.expandByScalar(2),1>z&&E.clearRect(S.min.x|0,S.min.y|0,S.max.x-S.min.x|0,S.max.y-S.min.y|0),0<z&&(l(THREE.NormalBlending),m(1),q("rgba("+Math.floor(255*A.r)+","+Math.floor(255*A.g)+","+Math.floor(255*A.b)+","+z+")"),E.fillRect(S.min.x|0,S.min.y|0,S.max.x-S.min.x|0,S.max.y-S.min.y|0)),S.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,j){if(!1===j instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
-else{!0===this.autoClear&&this.clear();E.setTransform(1,0,0,-1,N,x);v.info.render.vertices=0;v.info.render.faces=0;y=B.projectScene(a,j,this.sortObjects,this.sortElements);D=y.elements;M=y.lights;ia=j;gb.setRGB(0,0,0);ra.setRGB(0,0,0);ga.setRGB(0,0,0);for(var w=0,I=M.length;w<I;w++){var G=M[w],C=G.color;G instanceof THREE.AmbientLight?gb.add(C):G instanceof THREE.DirectionalLight?ra.add(C):G instanceof THREE.PointLight&&ga.add(C)}w=0;for(I=D.length;w<I;w++){var A=D[w],F=A.material;if(!(void 0===F||
+else{!0===this.autoClear&&this.clear();E.setTransform(1,0,0,-1,N,x);v.info.render.vertices=0;v.info.render.faces=0;y=B.projectScene(a,j,this.sortObjects,this.sortElements);D=y.elements;L=y.lights;ia=j;gb.setRGB(0,0,0);ra.setRGB(0,0,0);ga.setRGB(0,0,0);for(var w=0,I=L.length;w<I;w++){var G=L[w],C=G.color;G instanceof THREE.AmbientLight?gb.add(C):G instanceof THREE.DirectionalLight?ra.add(C):G instanceof THREE.PointLight&&ga.add(C)}w=0;for(I=D.length;w<I;w++){var A=D[w],F=A.material;if(!(void 0===F||
 !1===F.visible)){oa.makeEmpty();if(A instanceof THREE.RenderableSprite){K=A;K.x*=N;K.y*=x;G=K;C=F;m(C.opacity);l(C.blending);var z=A.scale.x*N,A=A.scale.y*x,F=0.5*Math.sqrt(z*z+A*A);oa.min.set(G.x-F,G.y-F);oa.max.set(G.x+F,G.y+F);if(!1===La.isIntersectionBox(oa))oa.makeEmpty();else if(C instanceof THREE.SpriteMaterial||C instanceof THREE.ParticleSystemMaterial){var H=C.map;if(null!==H){!1===H.hasEventListener("update",e)&&(void 0!==H.image&&0<H.image.width&&f(H),H.addEventListener("update",e));F=
-Ma[H.id];void 0!==F?q(F):q("rgba( 0, 0, 0, 1 )");var L=H.image,F=L.width*H.offset.x,Z=L.height*H.offset.y,V=L.width*H.repeat.x,H=L.height*H.repeat.y,L=z/V,da=A/H;E.save();E.translate(G.x,G.y);0!==C.rotation&&E.rotate(C.rotation);E.translate(-z/2,-A/2);E.scale(L,da);E.translate(-F,-Z);E.fillRect(F,Z,V,H)}else q(C.color.getStyle()),E.save(),E.translate(G.x,G.y),0!==C.rotation&&E.rotate(C.rotation),E.scale(z,-A),E.fillRect(-0.5,-0.5,1,1);E.restore()}else C instanceof THREE.SpriteCanvasMaterial&&(n(C.color.getStyle()),
+Ma[H.id];void 0!==F?q(F):q("rgba( 0, 0, 0, 1 )");var M=H.image,F=M.width*H.offset.x,Z=M.height*H.offset.y,V=M.width*H.repeat.x,H=M.height*H.repeat.y,M=z/V,da=A/H;E.save();E.translate(G.x,G.y);0!==C.rotation&&E.rotate(C.rotation);E.translate(-z/2,-A/2);E.scale(M,da);E.translate(-F,-Z);E.fillRect(F,Z,V,H)}else q(C.color.getStyle()),E.save(),E.translate(G.x,G.y),0!==C.rotation&&E.rotate(C.rotation),E.scale(z,-A),E.fillRect(-0.5,-0.5,1,1);E.restore()}else C instanceof THREE.SpriteCanvasMaterial&&(n(C.color.getStyle()),
 q(C.color.getStyle()),E.save(),E.translate(G.x,G.y),0!==C.rotation&&E.rotate(C.rotation),E.scale(z,A),C.program(E),E.restore())}else if(A instanceof THREE.RenderableLine){if(K=A.v1,P=A.v2,K.positionScreen.x*=N,K.positionScreen.y*=x,P.positionScreen.x*=N,P.positionScreen.y*=x,oa.setFromPoints([K.positionScreen,P.positionScreen]),!0===La.isIntersectionBox(oa))if(G=K,C=P,z=A,A=F,m(A.opacity),l(A.blending),E.beginPath(),E.moveTo(G.positionScreen.x,G.positionScreen.y),E.lineTo(C.positionScreen.x,C.positionScreen.y),
 A instanceof THREE.LineBasicMaterial){p(A.linewidth);s(A.linecap);t(A.linejoin);if(A.vertexColors!==THREE.VertexColors)n(A.color.getStyle());else if(F=z.vertexColors[0].getStyle(),z=z.vertexColors[1].getStyle(),F===z)n(F);else{try{var ea=E.createLinearGradient(G.positionScreen.x,G.positionScreen.y,C.positionScreen.x,C.positionScreen.y);ea.addColorStop(0,F);ea.addColorStop(1,z)}catch(Ba){ea=F}n(ea)}E.stroke();oa.expandByScalar(2*A.linewidth)}else A instanceof THREE.LineDashedMaterial&&(p(A.linewidth),
 s(A.linecap),t(A.linejoin),n(A.color.getStyle()),u(A.dashSize,A.gapSize),E.stroke(),oa.expandByScalar(2*A.linewidth),u(null,null))}else if(A instanceof THREE.RenderableFace3){K=A.v1;P=A.v2;ja=A.v3;if(-1>K.positionScreen.z||1<K.positionScreen.z)continue;if(-1>P.positionScreen.z||1<P.positionScreen.z)continue;if(-1>ja.positionScreen.z||1<ja.positionScreen.z)continue;K.positionScreen.x*=N;K.positionScreen.y*=x;P.positionScreen.x*=N;P.positionScreen.y*=x;ja.positionScreen.x*=N;ja.positionScreen.y*=x;
 0<F.overdraw&&(k(K.positionScreen,P.positionScreen,F.overdraw),k(P.positionScreen,ja.positionScreen,F.overdraw),k(ja.positionScreen,K.positionScreen,F.overdraw));oa.setFromPoints([K.positionScreen,P.positionScreen,ja.positionScreen]);if(!0===La.isIntersectionBox(oa)){G=K;C=P;z=ja;v.info.render.vertices+=3;v.info.render.faces++;m(F.opacity);l(F.blending);Fa=G.positionScreen.x;Pa=G.positionScreen.y;Ea=C.positionScreen.x;ya=C.positionScreen.y;Ha=z.positionScreen.x;Va=z.positionScreen.y;var Z=Fa,V=Pa,
-H=Ea,L=ya,da=Ha,ba=Va;E.beginPath();E.moveTo(Z,V);E.lineTo(H,L);E.lineTo(da,ba);E.closePath();(F instanceof THREE.MeshLambertMaterial||F instanceof THREE.MeshPhongMaterial)&&null===F.map?($.copy(F.color),fa.copy(F.emissive),F.vertexColors===THREE.FaceColors&&$.multiply(A.color),!1===F.wireframe&&F.shading===THREE.SmoothShading&&3===A.vertexNormalsLength?(za.copy(gb),T.copy(gb),U.copy(gb),b(A.v1.positionWorld,A.vertexNormalsModel[0],za),b(A.v2.positionWorld,A.vertexNormalsModel[1],T),b(A.v3.positionWorld,
+H=Ea,M=ya,da=Ha,ba=Va;E.beginPath();E.moveTo(Z,V);E.lineTo(H,M);E.lineTo(da,ba);E.closePath();(F instanceof THREE.MeshLambertMaterial||F instanceof THREE.MeshPhongMaterial)&&null===F.map?($.copy(F.color),fa.copy(F.emissive),F.vertexColors===THREE.FaceColors&&$.multiply(A.color),!1===F.wireframe&&F.shading===THREE.SmoothShading&&3===A.vertexNormalsLength?(za.copy(gb),T.copy(gb),U.copy(gb),b(A.v1.positionWorld,A.vertexNormalsModel[0],za),b(A.v2.positionWorld,A.vertexNormalsModel[1],T),b(A.v3.positionWorld,
 A.vertexNormalsModel[2],U),za.multiply($).add(fa),T.multiply($).add(fa),U.multiply($).add(fa),Ia.addColors(T,U).multiplyScalar(0.5),ka=i(za,T,U,Ia),g(Fa,Pa,Ea,ya,Ha,Va,0,0,1,0,0,1,ka)):(wa.copy(gb),b(A.centroidModel,A.normalModel,wa),wa.multiply($).add(fa),!0===F.wireframe?c(wa,F.wireframeLinewidth,F.wireframeLinecap,F.wireframeLinejoin):d(wa))):F instanceof THREE.MeshBasicMaterial||F instanceof THREE.MeshLambertMaterial||F instanceof THREE.MeshPhongMaterial?null!==F.map?F.map.mapping instanceof THREE.UVMapping&&
 (Ja=A.uvs[0],h(Fa,Pa,Ea,ya,Ha,Va,Ja[0].x,Ja[0].y,Ja[1].x,Ja[1].y,Ja[2].x,Ja[2].y,F.map)):null!==F.envMap?F.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(sa.copy(A.vertexNormalsModelView[0]),Ga=0.5*sa.x+0.5,Aa=0.5*sa.y+0.5,sa.copy(A.vertexNormalsModelView[1]),Na=0.5*sa.x+0.5,Oa=0.5*sa.y+0.5,sa.copy(A.vertexNormalsModelView[2]),Ka=0.5*sa.x+0.5,Qa=0.5*sa.y+0.5,h(Fa,Pa,Ea,ya,Ha,Va,Ga,Aa,Na,Oa,Ka,Qa,F.envMap)):(wa.copy(F.color),F.vertexColors===THREE.FaceColors&&wa.multiply(A.color),!0===
 F.wireframe?c(wa,F.wireframeLinewidth,F.wireframeLinecap,F.wireframeLinejoin):d(wa)):F instanceof THREE.MeshDepthMaterial?(xa=ia.near,ma=ia.far,za.r=za.g=za.b=1-r(G.positionScreen.z*G.positionScreen.w,xa,ma),T.r=T.g=T.b=1-r(C.positionScreen.z*C.positionScreen.w,xa,ma),U.r=U.g=U.b=1-r(z.positionScreen.z*z.positionScreen.w,xa,ma),Ia.addColors(T,U).multiplyScalar(0.5),ka=i(za,T,U,Ia),g(Fa,Pa,Ea,ya,Ha,Va,0,0,1,0,0,1,ka)):F instanceof THREE.MeshNormalMaterial&&(G=void 0,F.shading===THREE.FlatShading?(G=
@@ -386,7 +386,7 @@ g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float
 i),g.__sortArray=[],g.__webglParticleCount=i,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)n(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=f.geometryGroups[e],n(d.__webglObjects,g,a)}else a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,n(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 n(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function q(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function u(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function r(a,b){a instanceof THREE.Mesh||a instanceof
 THREE.ParticleSystem||a instanceof THREE.Line?v(b.__webglObjects,a):a instanceof THREE.Sprite?y(b.__webglSprites,a):a instanceof THREE.LensFlare?y(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&v(b.__webglObjectsImmediate,a);delete a.__webglActive}function v(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function y(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function D(a,b,c,d,e){wa=0;d.needsUpdate&&(d.program&&Bb(d),K.initMaterial(d,
-b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(K.maxMorphTargets));var f=!1,h=d.program,g=h.uniforms,i=d.uniforms;h!==Fa&&(j.useProgram(h),Fa=h,f=!0);d.id!==Ea&&(Ea=d.id,f=!0);if(f||a!==Ha)j.uniformMatrix4fv(g.projectionMatrix,!1,a.projectionMatrix.elements),a!==Ha&&(Ha=a);if(d.skinning)if(xb&&e.useVertexTexture){if(null!==g.boneTexture){var k=M();j.uniform1i(g.boneTexture,k);K.setTexture(e.boneTexture,k)}null!==g.boneTextureWidth&&
+b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(K.maxMorphTargets));var f=!1,h=d.program,g=h.uniforms,i=d.uniforms;h!==Fa&&(j.useProgram(h),Fa=h,f=!0);d.id!==Ea&&(Ea=d.id,f=!0);if(f||a!==Ha)j.uniformMatrix4fv(g.projectionMatrix,!1,a.projectionMatrix.elements),a!==Ha&&(Ha=a);if(d.skinning)if(xb&&e.useVertexTexture){if(null!==g.boneTexture){var k=L();j.uniform1i(g.boneTexture,k);K.setTexture(e.boneTexture,k)}null!==g.boneTextureWidth&&
 j.uniform1i(g.boneTextureWidth,e.boneTextureWidth);null!==g.boneTextureHeight&&j.uniform1i(g.boneTextureHeight,e.boneTextureHeight)}else null!==g.boneGlobalMatrices&&j.uniformMatrix4fv(g.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(i.fogColor.value=c.color,c instanceof THREE.Fog?(i.fogNear.value=c.near,i.fogFar.value=c.far):c instanceof THREE.FogExp2&&(i.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(sa){for(var m,
 l=k=0,p=0,n,q,r,s=Ra,t=s.directional.colors,u=s.directional.positions,v=s.point.colors,w=s.point.positions,y=s.point.distances,A=s.spot.colors,G=s.spot.positions,x=s.spot.distances,F=s.spot.directions,D=s.spot.anglesCos,N=s.spot.exponents,z=s.hemi.skyColors,H=s.hemi.groundColors,P=s.hemi.positions,U=0,ja=0,Z=0,V=0,$=0,X=0,Y=0,W=0,S=m=0,c=r=S=0,f=b.length;c<f;c++)m=b[c],m.onlyShadow||(n=m.color,q=m.intensity,r=m.distance,m instanceof THREE.AmbientLight?m.visible&&(K.gammaInput?(k+=n.r*n.r,l+=n.g*n.g,
 p+=n.b*n.b):(k+=n.r,l+=n.g,p+=n.b)):m instanceof THREE.DirectionalLight?($+=1,m.visible&&(ga.setFromMatrixPosition(m.matrixWorld),ra.setFromMatrixPosition(m.target.matrixWorld),ga.sub(ra),ga.normalize(),0===ga.x&&0===ga.y&&0===ga.z||(m=3*U,u[m]=ga.x,u[m+1]=ga.y,u[m+2]=ga.z,K.gammaInput?B(t,m,n,q*q):I(t,m,n,q),U+=1))):m instanceof THREE.PointLight?(X+=1,m.visible&&(S=3*ja,K.gammaInput?B(v,S,n,q*q):I(v,S,n,q),ra.setFromMatrixPosition(m.matrixWorld),w[S]=ra.x,w[S+1]=ra.y,w[S+2]=ra.z,y[ja]=r,ja+=1)):
@@ -395,17 +395,17 @@ P[r+2]=ga.z,n=m.color,m=m.groundColor,K.gammaInput?(q*=q,B(z,r,n,q),B(H,r,m,q)):
 c.ambient;i.directionalLightColor.value=c.directional.colors;i.directionalLightDirection.value=c.directional.positions;i.pointLightColor.value=c.point.colors;i.pointLightPosition.value=c.point.positions;i.pointLightDistance.value=c.point.distances;i.spotLightColor.value=c.spot.colors;i.spotLightPosition.value=c.spot.positions;i.spotLightDistance.value=c.spot.distances;i.spotLightDirection.value=c.spot.directions;i.spotLightAngleCos.value=c.spot.anglesCos;i.spotLightExponent.value=c.spot.exponents;
 i.hemisphereLightSkyColor.value=c.hemi.skyColors;i.hemisphereLightGroundColor.value=c.hemi.groundColors;i.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){i.opacity.value=d.opacity;K.gammaInput?i.diffuse.value.copyGammaToLinear(d.color):i.diffuse.value=d.color;i.map.value=d.map;i.lightMap.value=d.lightMap;i.specularMap.value=d.specularMap;d.bumpMap&&(i.bumpMap.value=d.bumpMap,i.bumpScale.value=
 d.bumpScale);d.normalMap&&(i.normalMap.value=d.normalMap,i.normalScale.value.copy(d.normalScale));var T;d.map?T=d.map:d.specularMap?T=d.specularMap:d.normalMap?T=d.normalMap:d.bumpMap&&(T=d.bumpMap);void 0!==T&&(c=T.offset,T=T.repeat,i.offsetRepeat.value.set(c.x,c.y,T.x,T.y));i.envMap.value=d.envMap;i.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;i.reflectivity.value=d.reflectivity;i.refractionRatio.value=d.refractionRatio;i.combine.value=d.combine;i.useRefract.value=d.envMap&&
-d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity,i.dashSize.value=d.dashSize,i.totalSize.value=d.dashSize+d.gapSize,i.scale.value=d.scale):d instanceof THREE.ParticleSystemMaterial?(i.psColor.value=d.color,i.opacity.value=d.opacity,i.size.value=d.size,i.scale.value=L.height/2,i.map.value=d.map):d instanceof THREE.MeshPhongMaterial?
+d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity,i.dashSize.value=d.dashSize,i.totalSize.value=d.dashSize+d.gapSize,i.scale.value=d.scale):d instanceof THREE.ParticleSystemMaterial?(i.psColor.value=d.color,i.opacity.value=d.opacity,i.size.value=d.size,i.scale.value=M.height/2,i.map.value=d.map):d instanceof THREE.MeshPhongMaterial?
 (i.shininess.value=d.shininess,K.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),i.emissive.value.copyGammaToLinear(d.emissive),i.specular.value.copyGammaToLinear(d.specular)):(i.ambient.value=d.ambient,i.emissive.value=d.emissive,i.specular.value=d.specular),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(K.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),i.emissive.value.copyGammaToLinear(d.emissive)):(i.ambient.value=d.ambient,i.emissive.value=
 d.emissive),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(i.mNear.value=a.near,i.mFar.value=a.far,i.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(i.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&i.shadowMatrix){c=T=0;for(f=b.length;c<f;c++)if(k=b[c],k.castShadow&&(k instanceof THREE.SpotLight||k instanceof THREE.DirectionalLight&&!k.shadowCascade))i.shadowMap.value[T]=k.shadowMap,i.shadowMapSize.value[T]=k.shadowMapSize,i.shadowMatrix.value[T]=
 k.shadowMatrix,i.shadowDarkness.value[T]=k.shadowDarkness,i.shadowBias.value[T]=k.shadowBias,T++}b=d.uniformsList;i=0;for(T=b.length;i<T;i++)if(f=h.uniforms[b[i][1]])if(c=b[i][0],l=c.type,k=c.value,"i"===l)j.uniform1i(f,k);else if("f"===l)j.uniform1f(f,k);else if("v2"===l)j.uniform2f(f,k.x,k.y);else if("v3"===l)j.uniform3f(f,k.x,k.y,k.z);else if("v4"===l)j.uniform4f(f,k.x,k.y,k.z,k.w);else if("c"===l)j.uniform3f(f,k.r,k.g,k.b);else if("iv1"===l)j.uniform1iv(f,k);else if("iv"===l)j.uniform3iv(f,k);
 else if("fv1"===l)j.uniform1fv(f,k);else if("fv"===l)j.uniform3fv(f,k);else if("v2v"===l){void 0===c._array&&(c._array=new Float32Array(2*k.length));l=0;for(p=k.length;l<p;l++)s=2*l,c._array[s]=k[l].x,c._array[s+1]=k[l].y;j.uniform2fv(f,c._array)}else if("v3v"===l){void 0===c._array&&(c._array=new Float32Array(3*k.length));l=0;for(p=k.length;l<p;l++)s=3*l,c._array[s]=k[l].x,c._array[s+1]=k[l].y,c._array[s+2]=k[l].z;j.uniform3fv(f,c._array)}else if("v4v"===l){void 0===c._array&&(c._array=new Float32Array(4*
-k.length));l=0;for(p=k.length;l<p;l++)s=4*l,c._array[s]=k[l].x,c._array[s+1]=k[l].y,c._array[s+2]=k[l].z,c._array[s+3]=k[l].w;j.uniform4fv(f,c._array)}else if("m4"===l)void 0===c._array&&(c._array=new Float32Array(16)),k.flattenToArray(c._array),j.uniformMatrix4fv(f,!1,c._array);else if("m4v"===l){void 0===c._array&&(c._array=new Float32Array(16*k.length));l=0;for(p=k.length;l<p;l++)k[l].flattenToArrayOffset(c._array,16*l);j.uniformMatrix4fv(f,!1,c._array)}else if("t"===l){if(s=k,k=M(),j.uniform1i(f,
+k.length));l=0;for(p=k.length;l<p;l++)s=4*l,c._array[s]=k[l].x,c._array[s+1]=k[l].y,c._array[s+2]=k[l].z,c._array[s+3]=k[l].w;j.uniform4fv(f,c._array)}else if("m4"===l)void 0===c._array&&(c._array=new Float32Array(16)),k.flattenToArray(c._array),j.uniformMatrix4fv(f,!1,c._array);else if("m4v"===l){void 0===c._array&&(c._array=new Float32Array(16*k.length));l=0;for(p=k.length;l<p;l++)k[l].flattenToArrayOffset(c._array,16*l);j.uniformMatrix4fv(f,!1,c._array)}else if("t"===l){if(s=k,k=L(),j.uniform1i(f,
 k),s)if(s.image instanceof Array&&6===s.image.length){if(c=s,f=k,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||(c.addEventListener("dispose",sb),c.image.__webglTextureCube=j.createTexture(),K.info.memory.textures++);j.activeTexture(j.TEXTURE0+f);j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;k=[];for(l=0;6>l;l++)K.autoScaleCubemaps&&!f?(p=k,s=l,t=c.image[l],v=Yb,t.width<=v&&t.height<=
 v||(w=Math.max(t.width,t.height),u=Math.floor(t.width*v/w),v=Math.floor(t.height*v/w),w=document.createElement("canvas"),w.width=u,w.height=v,w.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,u,v),t=w),p[s]=t):k[l]=c.image[l];l=k[0];p=THREE.Math.isPowerOfTwo(l.width)&&THREE.Math.isPowerOfTwo(l.height);s=C(c.format);t=C(c.type);E(j.TEXTURE_CUBE_MAP,c,p);for(l=0;6>l;l++)if(f){v=k[l].mipmaps;w=0;for(y=v.length;w<y;w++)u=v[w],c.format!==THREE.RGBAFormat?j.compressedTexImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+
 l,w,s,u.width,u.height,0,u.data):j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,w,s,u.width,u.height,0,s,t,u.data)}else j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,s,s,t,k[l]);c.generateMipmaps&&p&&j.generateMipmap(j.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else j.activeTexture(j.TEXTURE0+f),j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else s instanceof THREE.WebGLRenderTargetCube?(c=s,j.activeTexture(j.TEXTURE0+k),j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture)):
-K.setTexture(s,k)}else if("tv"===l){void 0===c._array&&(c._array=[]);l=0;for(p=c.value.length;l<p;l++)c._array[l]=M();j.uniform1iv(f,c._array);l=0;for(p=c.value.length;l<p;l++)s=c.value[l],k=c._array[l],s&&K.setTexture(s,k)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+l);if((d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==g.cameraPosition)ra.setFromMatrixPosition(a.matrixWorld),j.uniform3f(g.cameraPosition,ra.x,ra.y,ra.z);(d instanceof
-THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==g.viewMatrix&&j.uniformMatrix4fv(g.viewMatrix,!1,a.matrixWorldInverse.elements)}j.uniformMatrix4fv(g.modelViewMatrix,!1,e._modelViewMatrix.elements);g.normalMatrix&&j.uniformMatrix3fv(g.normalMatrix,!1,e._normalMatrix.elements);null!==g.modelMatrix&&j.uniformMatrix4fv(g.modelMatrix,!1,e.matrixWorld.elements);return h}function M(){var a=wa;a>=Hb&&console.warn("WebGLRenderer: trying to use "+
+K.setTexture(s,k)}else if("tv"===l){void 0===c._array&&(c._array=[]);l=0;for(p=c.value.length;l<p;l++)c._array[l]=L();j.uniform1iv(f,c._array);l=0;for(p=c.value.length;l<p;l++)s=c.value[l],k=c._array[l],s&&K.setTexture(s,k)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+l);if((d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==g.cameraPosition)ra.setFromMatrixPosition(a.matrixWorld),j.uniform3f(g.cameraPosition,ra.x,ra.y,ra.z);(d instanceof
+THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==g.viewMatrix&&j.uniformMatrix4fv(g.viewMatrix,!1,a.matrixWorldInverse.elements)}j.uniformMatrix4fv(g.modelViewMatrix,!1,e._modelViewMatrix.elements);g.normalMatrix&&j.uniformMatrix3fv(g.normalMatrix,!1,e._normalMatrix.elements);null!==g.modelMatrix&&j.uniformMatrix4fv(g.modelMatrix,!1,e.matrixWorld.elements);return h}function L(){var a=wa;a>=Hb&&console.warn("WebGLRenderer: trying to use "+
 a+" texture units while this GPU supports only "+Hb);wa+=1;return a}function B(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function I(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function w(a){a!==Ja&&(j.lineWidth(a),Ja=a)}function G(a,b,c){xa!==a&&(a?j.enable(j.POLYGON_OFFSET_FILL):j.disable(j.POLYGON_OFFSET_FILL),xa=a);if(a&&(ma!==b||ka!==c))j.polygonOffset(b,c),ma=b,ka=c}function N(a){for(var a=a.split("\n"),b=0,c=a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function x(a,
 b){var c;"fragment"===a?c=j.createShader(j.FRAGMENT_SHADER):"vertex"===a&&(c=j.createShader(j.VERTEX_SHADER));j.shaderSource(c,b);j.compileShader(c);return!j.getShaderParameter(c,j.COMPILE_STATUS)?(console.error(j.getShaderInfoLog(c)),console.error(N(b)),null):c}function E(a,b,c){c?(j.texParameteri(a,j.TEXTURE_WRAP_S,C(b.wrapS)),j.texParameteri(a,j.TEXTURE_WRAP_T,C(b.wrapT)),j.texParameteri(a,j.TEXTURE_MAG_FILTER,C(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,C(b.minFilter))):(j.texParameteri(a,
 j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_MAG_FILTER,z(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,z(b.minFilter)));if(va&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy))j.texParameterf(a,va.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Ab)),b.__oldAnisotropy=b.anisotropy}function A(a,b){j.bindRenderbuffer(j.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_COMPONENT16,
@@ -414,23 +414,23 @@ THREE.RepeatWrapping)return j.REPEAT;if(a===THREE.ClampToEdgeWrapping)return j.C
 if(a===THREE.UnsignedByteType)return j.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return j.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return j.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return j.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return j.BYTE;if(a===THREE.ShortType)return j.SHORT;if(a===THREE.UnsignedShortType)return j.UNSIGNED_SHORT;if(a===THREE.IntType)return j.INT;if(a===THREE.UnsignedIntType)return j.UNSIGNED_INT;if(a===THREE.FloatType)return j.FLOAT;
 if(a===THREE.AlphaFormat)return j.ALPHA;if(a===THREE.RGBFormat)return j.RGB;if(a===THREE.RGBAFormat)return j.RGBA;if(a===THREE.LuminanceFormat)return j.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return j.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return j.FUNC_ADD;if(a===THREE.SubtractEquation)return j.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return j.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return j.ZERO;if(a===THREE.OneFactor)return j.ONE;if(a===THREE.SrcColorFactor)return j.SRC_COLOR;
 if(a===THREE.OneMinusSrcColorFactor)return j.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return j.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return j.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return j.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return j.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return j.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return j.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return j.SRC_ALPHA_SATURATE;if(void 0!==ta){if(a===THREE.RGB_S3TC_DXT1_Format)return ta.COMPRESSED_RGB_S3TC_DXT1_EXT;
-if(a===THREE.RGBA_S3TC_DXT1_Format)return ta.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return ta.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return ta.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var a=a||{},L=void 0!==a.canvas?a.canvas:document.createElement("canvas"),F=void 0!==a.precision?a.precision:"highp",Z=void 0!==a.alpha?a.alpha:!1,ea=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Ba=void 0!==a.antialias?
-a.antialias:!1,H=void 0!==a.stencil?a.stencil:!0,V=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,da=new THREE.Color(0),ia=0;this.domElement=L;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=
+if(a===THREE.RGBA_S3TC_DXT1_Format)return ta.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return ta.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return ta.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var a=a||{},M=void 0!==a.canvas?a.canvas:document.createElement("canvas"),F=void 0!==a.precision?a.precision:"highp",Z=void 0!==a.alpha?a.alpha:!1,ea=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Ba=void 0!==a.antialias?
+a.antialias:!1,H=void 0!==a.stencil?a.stencil:!0,V=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,da=new THREE.Color(0),ia=0;this.domElement=M;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 K=this,P=[],ja=0,Fa=null,Pa=null,Ea=-1,ya=null,Ha=null,Va=0,wa=0,za=-1,T=-1,U=-1,Ia=-1,$=-1,fa=-1,ua=-1,Ma=-1,xa=null,ma=null,ka=null,Ja=null,Ga=
-0,Aa=0,Na=L.width,Oa=L.height,Ka=0,Qa=0,La={},S=new THREE.Frustum,oa=new THREE.Matrix4,gb=new THREE.Matrix4,ra=new THREE.Vector3,ga=new THREE.Vector3,sa=!0,Ra={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:[]}},j,cb,ba,va,ta;try{var Ya={alpha:Z,premultipliedAlpha:ea,antialias:Ba,stencil:H,
-preserveDrawingBuffer:V};j=L.getContext("webgl",Ya)||L.getContext("experimental-webgl",Ya);if(null===j)throw"Error creating WebGL context.";}catch(Wb){console.error(Wb)}cb=j.getExtension("OES_texture_float");j.getExtension("OES_texture_float_linear");ba=j.getExtension("OES_standard_derivatives");va=j.getExtension("EXT_texture_filter_anisotropic")||j.getExtension("MOZ_EXT_texture_filter_anisotropic")||j.getExtension("WEBKIT_EXT_texture_filter_anisotropic");ta=j.getExtension("WEBGL_compressed_texture_s3tc")||
+0,Aa=0,Na=M.width,Oa=M.height,Ka=0,Qa=0,La={},S=new THREE.Frustum,oa=new THREE.Matrix4,gb=new THREE.Matrix4,ra=new THREE.Vector3,ga=new THREE.Vector3,sa=!0,Ra={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:[]}},j,cb,ba,va,ta;try{var Ya={alpha:Z,premultipliedAlpha:ea,antialias:Ba,stencil:H,
+preserveDrawingBuffer:V};j=M.getContext("webgl",Ya)||M.getContext("experimental-webgl",Ya);if(null===j)throw"Error creating WebGL context.";}catch(Wb){console.error(Wb)}cb=j.getExtension("OES_texture_float");j.getExtension("OES_texture_float_linear");ba=j.getExtension("OES_standard_derivatives");va=j.getExtension("EXT_texture_filter_anisotropic")||j.getExtension("MOZ_EXT_texture_filter_anisotropic")||j.getExtension("WEBKIT_EXT_texture_filter_anisotropic");ta=j.getExtension("WEBGL_compressed_texture_s3tc")||
 j.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||j.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");cb||console.log("THREE.WebGLRenderer: Float textures not supported.");ba||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");va||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");ta||console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");void 0===j.getShaderPrecisionFormat&&(j.getShaderPrecisionFormat=function(){return{rangeMin:1,
 rangeMax:1,precision:1}});j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA);j.viewport(Ga,Aa,Na,Oa);j.clearColor(da.r,da.g,da.b,ia);this.context=j;var Hb=j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS),Xb=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);var Yb=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE),
 Ab=va?j.getParameter(va.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,wb=0<Xb,xb=wb&&cb;ta&&j.getParameter(j.COMPRESSED_TEXTURE_FORMATS);var Zb=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_FLOAT),$b=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_FLOAT);var pc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_FLOAT),qc=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,
 j.HIGH_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_INT);var rc=0<Zb.precision&&0<pc.precision,Ib=0<$b.precision&&0<qc.precision;"highp"===F&&!rc&&(Ib?(F="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(F="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));
-"mediump"===F&&!Ib&&(F="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};this.supportsVertexTextures=function(){return wb};this.supportsFloatTextures=function(){return cb};this.supportsStandardDerivatives=function(){return ba};this.supportsCompressedTextureS3TC=function(){return ta};this.getMaxAnisotropy=function(){return Ab};this.getPrecision=function(){return F};this.setSize=function(a,b,c){L.width=a*this.devicePixelRatio;L.height=b*this.devicePixelRatio;
-1!==this.devicePixelRatio&&!1!==c&&(L.style.width=a+"px",L.style.height=b+"px");this.setViewport(0,0,L.width,L.height)};this.setViewport=function(a,b,c,d){Ga=void 0!==a?a:0;Aa=void 0!==b?b:0;Na=void 0!==c?c:L.width;Oa=void 0!==d?d:L.height;j.viewport(Ga,Aa,Na,Oa)};this.setScissor=function(a,b,c,d){j.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};this.setClearColor=function(a,b){da.set(a);ia=void 0!==b?b:1;j.clearColor(da.r,da.g,da.b,ia)};
-this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return da};this.getClearAlpha=function(){return ia};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};this.clearColor=function(){j.clear(j.COLOR_BUFFER_BIT)};this.clearDepth=function(){j.clear(j.DEPTH_BUFFER_BIT)};
-this.clearStencil=function(){j.clear(j.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){Fa=null;Ea=ya=Ma=ua=U=-1;sa=!0;T=za=-1;this.shadowMapPlugin.update(a,b)};var Jb=function(a){a=a.target;a.removeEventListener("dispose",Jb);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=
-a.attributes,c;for(c in b)void 0!==b[c].buffer&&j.deleteBuffer(b[c].buffer);K.info.memory.geometries--}else if(void 0!==a.geometryGroups)for(b in a.geometryGroups){c=a.geometryGroups[b];if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)j.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(void 0!==c.numMorphNormals){d=0;for(e=c.numMorphNormals;d<e;d++)j.deleteBuffer(c.__webglMorphNormalsBuffers[d])}Cb(c)}else Cb(a)},sb=function(a){a=a.target;a.removeEventListener("dispose",sb);a.image&&
-a.image.__webglTextureCube?j.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,j.deleteTexture(a.__webglTexture));K.info.memory.textures--},Kb=function(a){a=a.target;a.removeEventListener("dispose",Kb);if(a&&a.__webglTexture)if(j.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)j.deleteFramebuffer(a.__webglFramebuffer[b]),j.deleteRenderbuffer(a.__webglRenderbuffer[b]);else j.deleteFramebuffer(a.__webglFramebuffer),j.deleteRenderbuffer(a.__webglRenderbuffer);
-K.info.memory.textures--},Lb=function(a){a=a.target;a.removeEventListener("dispose",Lb);Bb(a)},Cb=function(a){void 0!==a.__webglVertexBuffer&&j.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&j.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&j.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&j.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&j.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&j.deleteBuffer(a.__webglUV2Buffer);
-void 0!==a.__webglSkinIndicesBuffer&&j.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&j.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&j.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&j.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&j.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)j.deleteBuffer(a.__webglCustomAttributesList[b].buffer);
+"mediump"===F&&!Ib&&(F="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};this.supportsVertexTextures=function(){return wb};this.supportsFloatTextures=function(){return cb};this.supportsStandardDerivatives=function(){return ba};this.supportsCompressedTextureS3TC=function(){return ta};this.getMaxAnisotropy=function(){return Ab};this.getPrecision=function(){return F};this.setSize=function(a,b,c){M.width=a*this.devicePixelRatio;M.height=b*this.devicePixelRatio;
+1!==this.devicePixelRatio&&!1!==c&&(M.style.width=a+"px",M.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ga=a*this.devicePixelRatio;Aa=b*this.devicePixelRatio;Na=c*this.devicePixelRatio;Oa=d*this.devicePixelRatio;j.viewport(Ga,Aa,Na,Oa)};this.setScissor=function(a,b,c,d){j.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};
+this.setClearColor=function(a,b){da.set(a);ia=void 0!==b?b:1;j.clearColor(da.r,da.g,da.b,ia)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return da};this.getClearAlpha=function(){return ia};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};this.clearColor=
+function(){j.clear(j.COLOR_BUFFER_BIT)};this.clearDepth=function(){j.clear(j.DEPTH_BUFFER_BIT)};this.clearStencil=function(){j.clear(j.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){Fa=null;Ea=ya=Ma=ua=U=-1;sa=!0;T=za=-1;this.shadowMapPlugin.update(a,b)};var Jb=function(a){a=
+a.target;a.removeEventListener("dispose",Jb);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&j.deleteBuffer(b[c].buffer);K.info.memory.geometries--}else if(void 0!==a.geometryGroups)for(b in a.geometryGroups){c=a.geometryGroups[b];if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)j.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(void 0!==c.numMorphNormals){d=0;for(e=c.numMorphNormals;d<e;d++)j.deleteBuffer(c.__webglMorphNormalsBuffers[d])}Cb(c)}else Cb(a)},
+sb=function(a){a=a.target;a.removeEventListener("dispose",sb);a.image&&a.image.__webglTextureCube?j.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,j.deleteTexture(a.__webglTexture));K.info.memory.textures--},Kb=function(a){a=a.target;a.removeEventListener("dispose",Kb);if(a&&a.__webglTexture)if(j.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)j.deleteFramebuffer(a.__webglFramebuffer[b]),j.deleteRenderbuffer(a.__webglRenderbuffer[b]);
+else j.deleteFramebuffer(a.__webglFramebuffer),j.deleteRenderbuffer(a.__webglRenderbuffer);K.info.memory.textures--},Lb=function(a){a=a.target;a.removeEventListener("dispose",Lb);Bb(a)},Cb=function(a){void 0!==a.__webglVertexBuffer&&j.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&j.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&j.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&j.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&
+j.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&j.deleteBuffer(a.__webglUV2Buffer);void 0!==a.__webglSkinIndicesBuffer&&j.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&j.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&j.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&j.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&j.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)j.deleteBuffer(a.__webglCustomAttributesList[b].buffer);
 K.info.memory.geometries--},Bb=function(a){var b=a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1,a=0;for(c=P.length;a<c;a++)if(d=P[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=P.length;a<c;a++)d=P[a],d.program!==b&&e.push(d);P=e;j.deleteProgram(b);K.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=j.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=
 j.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=j.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=j.createBuffer());a.hasPositions&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,a.positionArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.position),j.vertexAttribPointer(b.attributes.position,3,j.FLOAT,!1,0,0));if(a.hasNormals){j.bindBuffer(j.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,
 e,f,h,g,i,k,m,l,p,n,q=3*a.count;for(n=0;n<q;n+=9)p=a.normalArray,d=p[n],e=p[n+1],f=p[n+2],h=p[n+3],i=p[n+4],m=p[n+5],g=p[n+6],k=p[n+7],l=p[n+8],d=(d+h+g)/3,e=(e+i+k)/3,f=(f+m+l)/3,p[n]=d,p[n+1]=e,p[n+2]=f,p[n+3]=d,p[n+4]=e,p[n+5]=f,p[n+6]=d,p[n+7]=e,p[n+8]=f}j.bufferData(j.ARRAY_BUFFER,a.normalArray,j.DYNAMIC_DRAW);j.enableVertexAttribArray(b.attributes.normal);j.vertexAttribPointer(b.attributes.normal,3,j.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglUvBuffer),j.bufferData(j.ARRAY_BUFFER,
@@ -457,20 +457,20 @@ h=f.object.material,h.transparent?(f.transparent=h,f.opaque=null):(f.opaque=h,f.
 null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=D(a,b,c,d,e);ya=-1;K.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,j,S):e.render(function(a){K.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)t(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)r(a.__objectsRemoved[0],
 a),a.__objectsRemoved.splice(0,1);for(var b=0,h=a.__webglObjects.length;b<h;b++){var g=a.__webglObjects[b].object;void 0===g.__webglInit&&(void 0!==g.__webglActive&&r(g,a),t(g,a));var i=g,k=i.geometry,l=void 0,n=void 0,p=void 0;if(k instanceof THREE.BufferGeometry){var s=j.DYNAMIC_DRAW,v=!k.dynamic,w=k.attributes,B=void 0,y=void 0;for(B in w)y=w[B],y.needsUpdate&&("index"===B?(j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,y.buffer),j.bufferData(j.ELEMENT_ARRAY_BUFFER,y.array,s)):(j.bindBuffer(j.ARRAY_BUFFER,
 y.buffer),j.bufferData(j.ARRAY_BUFFER,y.array,s)),y.needsUpdate=!1),v&&!y.dynamic&&(y.array=null)}else if(i instanceof THREE.Mesh){for(var A=0,G=k.geometryGroupsList.length;A<G;A++)if(l=k.geometryGroupsList[A],p=d(i,l),k.buffersNeedUpdate&&c(l,i),n=p.attributes&&q(p),k.verticesNeedUpdate||k.morphTargetsNeedUpdate||k.elementsNeedUpdate||k.uvsNeedUpdate||k.normalsNeedUpdate||k.colorsNeedUpdate||k.tangentsNeedUpdate||n){var x=l,F=i,I=j.DYNAMIC_DRAW,D=!k.dynamic,E=p;if(x.__inittedArrays){var C=e(E),N=
-E.vertexColors?E.vertexColors:!1,M=f(E),K=C===THREE.SmoothShading,z=void 0,H=void 0,P=void 0,L=void 0,U=void 0,T=void 0,S=void 0,Z=void 0,ja=void 0,V=void 0,Fa=void 0,X=void 0,Y=void 0,W=void 0,$=void 0,Ha=void 0,wa=void 0,da=void 0,fa=void 0,Pa=void 0,Ea=void 0,ya=void 0,ea=void 0,ga=void 0,Va=void 0,ia=void 0,ma=void 0,za=void 0,sa=void 0,ba=void 0,Ba=void 0,Aa=void 0,Ia=void 0,Ga=void 0,ka=void 0,Ja=void 0,ta=void 0,ua=void 0,La=void 0,Ma=void 0,va=0,xa=0,Na=0,Oa=0,Qa=0,hb=0,Xa=0,Ka=0,db=0,qa=
+E.vertexColors?E.vertexColors:!1,L=f(E),K=C===THREE.SmoothShading,z=void 0,H=void 0,P=void 0,M=void 0,U=void 0,T=void 0,S=void 0,Z=void 0,ja=void 0,V=void 0,Fa=void 0,X=void 0,Y=void 0,W=void 0,$=void 0,Ha=void 0,wa=void 0,da=void 0,fa=void 0,Pa=void 0,Ea=void 0,ya=void 0,ea=void 0,ga=void 0,Va=void 0,ia=void 0,ma=void 0,za=void 0,sa=void 0,ba=void 0,Ba=void 0,Aa=void 0,Ia=void 0,Ga=void 0,ka=void 0,Ja=void 0,ta=void 0,ua=void 0,La=void 0,Ma=void 0,va=0,xa=0,Na=0,Oa=0,Qa=0,hb=0,Xa=0,Ka=0,db=0,qa=
 0,Ca=0,O=0,Wa=void 0,ib=x.__vertexArray,Ya=x.__uvArray,cb=x.__uv2Array,Ra=x.__normalArray,Za=x.__tangentArray,jb=x.__colorArray,$a=x.__skinIndexArray,ab=x.__skinWeightArray,wb=x.__morphTargetsArrays,xb=x.__morphNormalsArrays,sb=x.__webglCustomAttributesList,J=void 0,Mb=x.__faceArray,tb=x.__lineArray,Sa=F.geometry,Hb=Sa.elementsNeedUpdate,Ab=Sa.uvsNeedUpdate,Ib=Sa.normalsNeedUpdate,Jb=Sa.tangentsNeedUpdate,Kb=Sa.colorsNeedUpdate,Lb=Sa.morphTargetsNeedUpdate,ac=Sa.vertices,ca=x.faces3,kb=Sa.faces,Bb=
-Sa.faceVertexUvs[0],Cb=Sa.faceVertexUvs[1],bc=Sa.skinIndices,Nb=Sa.skinWeights,Ob=Sa.morphTargets,gc=Sa.morphNormals;if(Sa.verticesNeedUpdate){z=0;for(H=ca.length;z<H;z++)L=kb[ca[z]],X=ac[L.a],Y=ac[L.b],W=ac[L.c],ib[xa]=X.x,ib[xa+1]=X.y,ib[xa+2]=X.z,ib[xa+3]=Y.x,ib[xa+4]=Y.y,ib[xa+5]=Y.z,ib[xa+6]=W.x,ib[xa+7]=W.y,ib[xa+8]=W.z,xa+=9;j.bindBuffer(j.ARRAY_BUFFER,x.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,ib,I)}if(Lb){ka=0;for(Ja=Ob.length;ka<Ja;ka++){z=Ca=0;for(H=ca.length;z<H;z++)La=ca[z],L=
-kb[La],X=Ob[ka].vertices[L.a],Y=Ob[ka].vertices[L.b],W=Ob[ka].vertices[L.c],ta=wb[ka],ta[Ca]=X.x,ta[Ca+1]=X.y,ta[Ca+2]=X.z,ta[Ca+3]=Y.x,ta[Ca+4]=Y.y,ta[Ca+5]=Y.z,ta[Ca+6]=W.x,ta[Ca+7]=W.y,ta[Ca+8]=W.z,E.morphNormals&&(K?(Ma=gc[ka].vertexNormals[La],da=Ma.a,fa=Ma.b,Pa=Ma.c):Pa=fa=da=gc[ka].faceNormals[La],ua=xb[ka],ua[Ca]=da.x,ua[Ca+1]=da.y,ua[Ca+2]=da.z,ua[Ca+3]=fa.x,ua[Ca+4]=fa.y,ua[Ca+5]=fa.z,ua[Ca+6]=Pa.x,ua[Ca+7]=Pa.y,ua[Ca+8]=Pa.z),Ca+=9;j.bindBuffer(j.ARRAY_BUFFER,x.__webglMorphTargetsBuffers[ka]);
-j.bufferData(j.ARRAY_BUFFER,wb[ka],I);E.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglMorphNormalsBuffers[ka]),j.bufferData(j.ARRAY_BUFFER,xb[ka],I))}}if(Nb.length){z=0;for(H=ca.length;z<H;z++)L=kb[ca[z]],ga=Nb[L.a],Va=Nb[L.b],ia=Nb[L.c],ab[qa]=ga.x,ab[qa+1]=ga.y,ab[qa+2]=ga.z,ab[qa+3]=ga.w,ab[qa+4]=Va.x,ab[qa+5]=Va.y,ab[qa+6]=Va.z,ab[qa+7]=Va.w,ab[qa+8]=ia.x,ab[qa+9]=ia.y,ab[qa+10]=ia.z,ab[qa+11]=ia.w,ma=bc[L.a],za=bc[L.b],sa=bc[L.c],$a[qa]=ma.x,$a[qa+1]=ma.y,$a[qa+2]=ma.z,$a[qa+3]=ma.w,$a[qa+
-4]=za.x,$a[qa+5]=za.y,$a[qa+6]=za.z,$a[qa+7]=za.w,$a[qa+8]=sa.x,$a[qa+9]=sa.y,$a[qa+10]=sa.z,$a[qa+11]=sa.w,qa+=12;0<qa&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,$a,I),j.bindBuffer(j.ARRAY_BUFFER,x.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,ab,I))}if(Kb&&N){z=0;for(H=ca.length;z<H;z++)L=kb[ca[z]],S=L.vertexColors,Z=L.color,3===S.length&&N===THREE.VertexColors?(Ea=S[0],ya=S[1],ea=S[2]):ea=ya=Ea=Z,jb[db]=Ea.r,jb[db+1]=Ea.g,jb[db+2]=Ea.b,jb[db+3]=
-ya.r,jb[db+4]=ya.g,jb[db+5]=ya.b,jb[db+6]=ea.r,jb[db+7]=ea.g,jb[db+8]=ea.b,db+=9;0<db&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,jb,I))}if(Jb&&Sa.hasTangents){z=0;for(H=ca.length;z<H;z++)L=kb[ca[z]],ja=L.vertexTangents,$=ja[0],Ha=ja[1],wa=ja[2],Za[Xa]=$.x,Za[Xa+1]=$.y,Za[Xa+2]=$.z,Za[Xa+3]=$.w,Za[Xa+4]=Ha.x,Za[Xa+5]=Ha.y,Za[Xa+6]=Ha.z,Za[Xa+7]=Ha.w,Za[Xa+8]=wa.x,Za[Xa+9]=wa.y,Za[Xa+10]=wa.z,Za[Xa+11]=wa.w,Xa+=12;j.bindBuffer(j.ARRAY_BUFFER,x.__webglTangentBuffer);
-j.bufferData(j.ARRAY_BUFFER,Za,I)}if(Ib&&C){z=0;for(H=ca.length;z<H;z++)if(L=kb[ca[z]],U=L.vertexNormals,T=L.normal,3===U.length&&K)for(ba=0;3>ba;ba++)Aa=U[ba],Ra[hb]=Aa.x,Ra[hb+1]=Aa.y,Ra[hb+2]=Aa.z,hb+=3;else for(ba=0;3>ba;ba++)Ra[hb]=T.x,Ra[hb+1]=T.y,Ra[hb+2]=T.z,hb+=3;j.bindBuffer(j.ARRAY_BUFFER,x.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Ra,I)}if(Ab&&Bb&&M){z=0;for(H=ca.length;z<H;z++)if(P=ca[z],V=Bb[P],void 0!==V)for(ba=0;3>ba;ba++)Ia=V[ba],Ya[Na]=Ia.x,Ya[Na+1]=Ia.y,Na+=2;0<Na&&(j.bindBuffer(j.ARRAY_BUFFER,
-x.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,Ya,I))}if(Ab&&Cb&&M){z=0;for(H=ca.length;z<H;z++)if(P=ca[z],Fa=Cb[P],void 0!==Fa)for(ba=0;3>ba;ba++)Ga=Fa[ba],cb[Oa]=Ga.x,cb[Oa+1]=Ga.y,Oa+=2;0<Oa&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,cb,I))}if(Hb){z=0;for(H=ca.length;z<H;z++)Mb[Qa]=va,Mb[Qa+1]=va+1,Mb[Qa+2]=va+2,Qa+=3,tb[Ka]=va,tb[Ka+1]=va+1,tb[Ka+2]=va,tb[Ka+3]=va+2,tb[Ka+4]=va+1,tb[Ka+5]=va+2,Ka+=6,va+=3;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,x.__webglFaceBuffer);
-j.bufferData(j.ELEMENT_ARRAY_BUFFER,Mb,I);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,x.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,tb,I)}if(sb){ba=0;for(Ba=sb.length;ba<Ba;ba++)if(J=sb[ba],J.__original.needsUpdate){O=0;if(1===J.size)if(void 0===J.boundTo||"vertices"===J.boundTo){z=0;for(H=ca.length;z<H;z++)L=kb[ca[z]],J.array[O]=J.value[L.a],J.array[O+1]=J.value[L.b],J.array[O+2]=J.value[L.c],O+=3}else{if("faces"===J.boundTo){z=0;for(H=ca.length;z<H;z++)Wa=J.value[ca[z]],J.array[O]=Wa,J.array[O+
-1]=Wa,J.array[O+2]=Wa,O+=3}}else if(2===J.size)if(void 0===J.boundTo||"vertices"===J.boundTo){z=0;for(H=ca.length;z<H;z++)L=kb[ca[z]],X=J.value[L.a],Y=J.value[L.b],W=J.value[L.c],J.array[O]=X.x,J.array[O+1]=X.y,J.array[O+2]=Y.x,J.array[O+3]=Y.y,J.array[O+4]=W.x,J.array[O+5]=W.y,O+=6}else{if("faces"===J.boundTo){z=0;for(H=ca.length;z<H;z++)W=Y=X=Wa=J.value[ca[z]],J.array[O]=X.x,J.array[O+1]=X.y,J.array[O+2]=Y.x,J.array[O+3]=Y.y,J.array[O+4]=W.x,J.array[O+5]=W.y,O+=6}}else if(3===J.size){var pa;pa=
-"c"===J.type?["r","g","b"]:["x","y","z"];if(void 0===J.boundTo||"vertices"===J.boundTo){z=0;for(H=ca.length;z<H;z++)L=kb[ca[z]],X=J.value[L.a],Y=J.value[L.b],W=J.value[L.c],J.array[O]=X[pa[0]],J.array[O+1]=X[pa[1]],J.array[O+2]=X[pa[2]],J.array[O+3]=Y[pa[0]],J.array[O+4]=Y[pa[1]],J.array[O+5]=Y[pa[2]],J.array[O+6]=W[pa[0]],J.array[O+7]=W[pa[1]],J.array[O+8]=W[pa[2]],O+=9}else if("faces"===J.boundTo){z=0;for(H=ca.length;z<H;z++)W=Y=X=Wa=J.value[ca[z]],J.array[O]=X[pa[0]],J.array[O+1]=X[pa[1]],J.array[O+
+Sa.faceVertexUvs[0],Cb=Sa.faceVertexUvs[1],bc=Sa.skinIndices,Nb=Sa.skinWeights,Ob=Sa.morphTargets,gc=Sa.morphNormals;if(Sa.verticesNeedUpdate){z=0;for(H=ca.length;z<H;z++)M=kb[ca[z]],X=ac[M.a],Y=ac[M.b],W=ac[M.c],ib[xa]=X.x,ib[xa+1]=X.y,ib[xa+2]=X.z,ib[xa+3]=Y.x,ib[xa+4]=Y.y,ib[xa+5]=Y.z,ib[xa+6]=W.x,ib[xa+7]=W.y,ib[xa+8]=W.z,xa+=9;j.bindBuffer(j.ARRAY_BUFFER,x.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,ib,I)}if(Lb){ka=0;for(Ja=Ob.length;ka<Ja;ka++){z=Ca=0;for(H=ca.length;z<H;z++)La=ca[z],M=
+kb[La],X=Ob[ka].vertices[M.a],Y=Ob[ka].vertices[M.b],W=Ob[ka].vertices[M.c],ta=wb[ka],ta[Ca]=X.x,ta[Ca+1]=X.y,ta[Ca+2]=X.z,ta[Ca+3]=Y.x,ta[Ca+4]=Y.y,ta[Ca+5]=Y.z,ta[Ca+6]=W.x,ta[Ca+7]=W.y,ta[Ca+8]=W.z,E.morphNormals&&(K?(Ma=gc[ka].vertexNormals[La],da=Ma.a,fa=Ma.b,Pa=Ma.c):Pa=fa=da=gc[ka].faceNormals[La],ua=xb[ka],ua[Ca]=da.x,ua[Ca+1]=da.y,ua[Ca+2]=da.z,ua[Ca+3]=fa.x,ua[Ca+4]=fa.y,ua[Ca+5]=fa.z,ua[Ca+6]=Pa.x,ua[Ca+7]=Pa.y,ua[Ca+8]=Pa.z),Ca+=9;j.bindBuffer(j.ARRAY_BUFFER,x.__webglMorphTargetsBuffers[ka]);
+j.bufferData(j.ARRAY_BUFFER,wb[ka],I);E.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglMorphNormalsBuffers[ka]),j.bufferData(j.ARRAY_BUFFER,xb[ka],I))}}if(Nb.length){z=0;for(H=ca.length;z<H;z++)M=kb[ca[z]],ga=Nb[M.a],Va=Nb[M.b],ia=Nb[M.c],ab[qa]=ga.x,ab[qa+1]=ga.y,ab[qa+2]=ga.z,ab[qa+3]=ga.w,ab[qa+4]=Va.x,ab[qa+5]=Va.y,ab[qa+6]=Va.z,ab[qa+7]=Va.w,ab[qa+8]=ia.x,ab[qa+9]=ia.y,ab[qa+10]=ia.z,ab[qa+11]=ia.w,ma=bc[M.a],za=bc[M.b],sa=bc[M.c],$a[qa]=ma.x,$a[qa+1]=ma.y,$a[qa+2]=ma.z,$a[qa+3]=ma.w,$a[qa+
+4]=za.x,$a[qa+5]=za.y,$a[qa+6]=za.z,$a[qa+7]=za.w,$a[qa+8]=sa.x,$a[qa+9]=sa.y,$a[qa+10]=sa.z,$a[qa+11]=sa.w,qa+=12;0<qa&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,$a,I),j.bindBuffer(j.ARRAY_BUFFER,x.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,ab,I))}if(Kb&&N){z=0;for(H=ca.length;z<H;z++)M=kb[ca[z]],S=M.vertexColors,Z=M.color,3===S.length&&N===THREE.VertexColors?(Ea=S[0],ya=S[1],ea=S[2]):ea=ya=Ea=Z,jb[db]=Ea.r,jb[db+1]=Ea.g,jb[db+2]=Ea.b,jb[db+3]=
+ya.r,jb[db+4]=ya.g,jb[db+5]=ya.b,jb[db+6]=ea.r,jb[db+7]=ea.g,jb[db+8]=ea.b,db+=9;0<db&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,jb,I))}if(Jb&&Sa.hasTangents){z=0;for(H=ca.length;z<H;z++)M=kb[ca[z]],ja=M.vertexTangents,$=ja[0],Ha=ja[1],wa=ja[2],Za[Xa]=$.x,Za[Xa+1]=$.y,Za[Xa+2]=$.z,Za[Xa+3]=$.w,Za[Xa+4]=Ha.x,Za[Xa+5]=Ha.y,Za[Xa+6]=Ha.z,Za[Xa+7]=Ha.w,Za[Xa+8]=wa.x,Za[Xa+9]=wa.y,Za[Xa+10]=wa.z,Za[Xa+11]=wa.w,Xa+=12;j.bindBuffer(j.ARRAY_BUFFER,x.__webglTangentBuffer);
+j.bufferData(j.ARRAY_BUFFER,Za,I)}if(Ib&&C){z=0;for(H=ca.length;z<H;z++)if(M=kb[ca[z]],U=M.vertexNormals,T=M.normal,3===U.length&&K)for(ba=0;3>ba;ba++)Aa=U[ba],Ra[hb]=Aa.x,Ra[hb+1]=Aa.y,Ra[hb+2]=Aa.z,hb+=3;else for(ba=0;3>ba;ba++)Ra[hb]=T.x,Ra[hb+1]=T.y,Ra[hb+2]=T.z,hb+=3;j.bindBuffer(j.ARRAY_BUFFER,x.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Ra,I)}if(Ab&&Bb&&L){z=0;for(H=ca.length;z<H;z++)if(P=ca[z],V=Bb[P],void 0!==V)for(ba=0;3>ba;ba++)Ia=V[ba],Ya[Na]=Ia.x,Ya[Na+1]=Ia.y,Na+=2;0<Na&&(j.bindBuffer(j.ARRAY_BUFFER,
+x.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,Ya,I))}if(Ab&&Cb&&L){z=0;for(H=ca.length;z<H;z++)if(P=ca[z],Fa=Cb[P],void 0!==Fa)for(ba=0;3>ba;ba++)Ga=Fa[ba],cb[Oa]=Ga.x,cb[Oa+1]=Ga.y,Oa+=2;0<Oa&&(j.bindBuffer(j.ARRAY_BUFFER,x.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,cb,I))}if(Hb){z=0;for(H=ca.length;z<H;z++)Mb[Qa]=va,Mb[Qa+1]=va+1,Mb[Qa+2]=va+2,Qa+=3,tb[Ka]=va,tb[Ka+1]=va+1,tb[Ka+2]=va,tb[Ka+3]=va+2,tb[Ka+4]=va+1,tb[Ka+5]=va+2,Ka+=6,va+=3;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,x.__webglFaceBuffer);
+j.bufferData(j.ELEMENT_ARRAY_BUFFER,Mb,I);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,x.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,tb,I)}if(sb){ba=0;for(Ba=sb.length;ba<Ba;ba++)if(J=sb[ba],J.__original.needsUpdate){O=0;if(1===J.size)if(void 0===J.boundTo||"vertices"===J.boundTo){z=0;for(H=ca.length;z<H;z++)M=kb[ca[z]],J.array[O]=J.value[M.a],J.array[O+1]=J.value[M.b],J.array[O+2]=J.value[M.c],O+=3}else{if("faces"===J.boundTo){z=0;for(H=ca.length;z<H;z++)Wa=J.value[ca[z]],J.array[O]=Wa,J.array[O+
+1]=Wa,J.array[O+2]=Wa,O+=3}}else if(2===J.size)if(void 0===J.boundTo||"vertices"===J.boundTo){z=0;for(H=ca.length;z<H;z++)M=kb[ca[z]],X=J.value[M.a],Y=J.value[M.b],W=J.value[M.c],J.array[O]=X.x,J.array[O+1]=X.y,J.array[O+2]=Y.x,J.array[O+3]=Y.y,J.array[O+4]=W.x,J.array[O+5]=W.y,O+=6}else{if("faces"===J.boundTo){z=0;for(H=ca.length;z<H;z++)W=Y=X=Wa=J.value[ca[z]],J.array[O]=X.x,J.array[O+1]=X.y,J.array[O+2]=Y.x,J.array[O+3]=Y.y,J.array[O+4]=W.x,J.array[O+5]=W.y,O+=6}}else if(3===J.size){var pa;pa=
+"c"===J.type?["r","g","b"]:["x","y","z"];if(void 0===J.boundTo||"vertices"===J.boundTo){z=0;for(H=ca.length;z<H;z++)M=kb[ca[z]],X=J.value[M.a],Y=J.value[M.b],W=J.value[M.c],J.array[O]=X[pa[0]],J.array[O+1]=X[pa[1]],J.array[O+2]=X[pa[2]],J.array[O+3]=Y[pa[0]],J.array[O+4]=Y[pa[1]],J.array[O+5]=Y[pa[2]],J.array[O+6]=W[pa[0]],J.array[O+7]=W[pa[1]],J.array[O+8]=W[pa[2]],O+=9}else if("faces"===J.boundTo){z=0;for(H=ca.length;z<H;z++)W=Y=X=Wa=J.value[ca[z]],J.array[O]=X[pa[0]],J.array[O+1]=X[pa[1]],J.array[O+
 2]=X[pa[2]],J.array[O+3]=Y[pa[0]],J.array[O+4]=Y[pa[1]],J.array[O+5]=Y[pa[2]],J.array[O+6]=W[pa[0]],J.array[O+7]=W[pa[1]],J.array[O+8]=W[pa[2]],O+=9}else if("faceVertices"===J.boundTo){z=0;for(H=ca.length;z<H;z++)Wa=J.value[ca[z]],X=Wa[0],Y=Wa[1],W=Wa[2],J.array[O]=X[pa[0]],J.array[O+1]=X[pa[1]],J.array[O+2]=X[pa[2]],J.array[O+3]=Y[pa[0]],J.array[O+4]=Y[pa[1]],J.array[O+5]=Y[pa[2]],J.array[O+6]=W[pa[0]],J.array[O+7]=W[pa[1]],J.array[O+8]=W[pa[2]],O+=9}}else if(4===J.size)if(void 0===J.boundTo||"vertices"===
-J.boundTo){z=0;for(H=ca.length;z<H;z++)L=kb[ca[z]],X=J.value[L.a],Y=J.value[L.b],W=J.value[L.c],J.array[O]=X.x,J.array[O+1]=X.y,J.array[O+2]=X.z,J.array[O+3]=X.w,J.array[O+4]=Y.x,J.array[O+5]=Y.y,J.array[O+6]=Y.z,J.array[O+7]=Y.w,J.array[O+8]=W.x,J.array[O+9]=W.y,J.array[O+10]=W.z,J.array[O+11]=W.w,O+=12}else if("faces"===J.boundTo){z=0;for(H=ca.length;z<H;z++)W=Y=X=Wa=J.value[ca[z]],J.array[O]=X.x,J.array[O+1]=X.y,J.array[O+2]=X.z,J.array[O+3]=X.w,J.array[O+4]=Y.x,J.array[O+5]=Y.y,J.array[O+6]=Y.z,
+J.boundTo){z=0;for(H=ca.length;z<H;z++)M=kb[ca[z]],X=J.value[M.a],Y=J.value[M.b],W=J.value[M.c],J.array[O]=X.x,J.array[O+1]=X.y,J.array[O+2]=X.z,J.array[O+3]=X.w,J.array[O+4]=Y.x,J.array[O+5]=Y.y,J.array[O+6]=Y.z,J.array[O+7]=Y.w,J.array[O+8]=W.x,J.array[O+9]=W.y,J.array[O+10]=W.z,J.array[O+11]=W.w,O+=12}else if("faces"===J.boundTo){z=0;for(H=ca.length;z<H;z++)W=Y=X=Wa=J.value[ca[z]],J.array[O]=X.x,J.array[O+1]=X.y,J.array[O+2]=X.z,J.array[O+3]=X.w,J.array[O+4]=Y.x,J.array[O+5]=Y.y,J.array[O+6]=Y.z,
 J.array[O+7]=Y.w,J.array[O+8]=W.x,J.array[O+9]=W.y,J.array[O+10]=W.z,J.array[O+11]=W.w,O+=12}else if("faceVertices"===J.boundTo){z=0;for(H=ca.length;z<H;z++)Wa=J.value[ca[z]],X=Wa[0],Y=Wa[1],W=Wa[2],J.array[O]=X.x,J.array[O+1]=X.y,J.array[O+2]=X.z,J.array[O+3]=X.w,J.array[O+4]=Y.x,J.array[O+5]=Y.y,J.array[O+6]=Y.z,J.array[O+7]=Y.w,J.array[O+8]=W.x,J.array[O+9]=W.y,J.array[O+10]=W.z,J.array[O+11]=W.w,O+=12}j.bindBuffer(j.ARRAY_BUFFER,J.buffer);j.bufferData(j.ARRAY_BUFFER,J.array,I)}}D&&(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)}}k.verticesNeedUpdate=!1;k.morphTargetsNeedUpdate=!1;k.elementsNeedUpdate=!1;k.uvsNeedUpdate=!1;k.normalsNeedUpdate=!1;k.colorsNeedUpdate=!1;k.tangentsNeedUpdate=!1;k.buffersNeedUpdate=!1;p.attributes&&u(p)}else if(i instanceof THREE.Line){p=d(i,k);n=p.attributes&&q(p);if(k.verticesNeedUpdate||
 k.colorsNeedUpdate||k.lineDistancesNeedUpdate||n){var bb=k,Pb=j.DYNAMIC_DRAW,Db=void 0,Eb=void 0,Fb=void 0,Qb=void 0,na=void 0,Rb=void 0,hc=bb.vertices,ic=bb.colors,jc=bb.lineDistances,Wb=hc.length,Xb=ic.length,Yb=jc.length,Sb=bb.__vertexArray,Tb=bb.__colorArray,kc=bb.__lineDistanceArray,Zb=bb.colorsNeedUpdate,$b=bb.lineDistancesNeedUpdate,cc=bb.__webglCustomAttributesList,Ub=void 0,lc=void 0,Da=void 0,yb=void 0,Ta=void 0,la=void 0;if(bb.verticesNeedUpdate){for(Db=0;Db<Wb;Db++)Qb=hc[Db],na=3*Db,Sb[na]=
@@ -521,7 +521,7 @@ e.generateMipmaps=!1;e.needsUpdate=!0;c&&c(e)};f.onerror=d;f.open("GET",a,!0);f.
 b,c,d){var e=[];e.loadCount=0;var f=new THREE.CompressedTexture;f.image=e;void 0!==b&&(f.mapping=b);f.flipY=!1;f.generateMipmaps=!1;var h=new XMLHttpRequest;h.onload=function(){var a=THREE.ImageUtils.parseDDS(h.response,!0);if(a.isCubemap)for(var b=a.mipmaps.length/a.mipmapCount,d=0;d<b;d++){e[d]={mipmaps:[]};for(var m=0;m<a.mipmapCount;m++)e[d].mipmaps.push(a.mipmaps[d*a.mipmapCount+m]),e[d].format=a.format,e[d].width=a.width,e[d].height=a.height}else f.image.width=a.width,f.image.height=a.height,
 f.mipmaps=a.mipmaps;f.format=a.format;f.needsUpdate=!0;c&&c(f)};h.onerror=d;h.open("GET",a,!0);h.responseType="arraybuffer";h.send(null);return f},parseDDS:function(a,b){function c(a){return a.charCodeAt(0)+(a.charCodeAt(1)<<8)+(a.charCodeAt(2)<<16)+(a.charCodeAt(3)<<24)}var d={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},e=c("DXT1"),f=c("DXT3"),h=c("DXT5"),g=new Int32Array(a,0,31);if(542327876!==g[0])return console.error("ImageUtils.parseDDS(): Invalid magic number in DDS header"),d;if(!g[20]&
 4)return console.error("ImageUtils.parseDDS(): Unsupported format, must contain a FourCC code"),d;var i=g[21],k=!1;switch(i){case e:e=8;d.format=THREE.RGB_S3TC_DXT1_Format;break;case f:e=16;d.format=THREE.RGBA_S3TC_DXT3_Format;break;case h:e=16;d.format=THREE.RGBA_S3TC_DXT5_Format;break;default:if(32==g[22]&&g[23]&16711680&&g[24]&65280&&g[25]&255&&g[26]&4278190080)k=!0,e=64,d.format=THREE.RGBAFormat;else return console.error("ImageUtils.parseDDS(): Unsupported FourCC code: ",String.fromCharCode(i&
-255,i>>8&255,i>>16&255,i>>24&255)),d}d.mipmapCount=1;g[2]&131072&&!1!==b&&(d.mipmapCount=Math.max(1,g[7]));d.isCubemap=g[28]&512?!0:!1;d.width=g[4];d.height=g[3];for(var g=g[1]+4,f=d.width,h=d.height,i=d.isCubemap?6:1,m=0;m<i;m++){for(var l=0;l<d.mipmapCount;l++){if(k){var p;p=f;for(var s=h,t=4*p*s,n=new Uint8Array(a,g,t),t=new Uint8Array(t),q=0,u=0,r=0;r<s;r++)for(var v=0;v<p;v++){var y=n[u];u++;var D=n[u];u++;var M=n[u];u++;var B=n[u];u++;t[q]=M;q++;t[q]=D;q++;t[q]=y;q++;t[q]=B;q++}p=t;s=p.length}else s=
+255,i>>8&255,i>>16&255,i>>24&255)),d}d.mipmapCount=1;g[2]&131072&&!1!==b&&(d.mipmapCount=Math.max(1,g[7]));d.isCubemap=g[28]&512?!0:!1;d.width=g[4];d.height=g[3];for(var g=g[1]+4,f=d.width,h=d.height,i=d.isCubemap?6:1,m=0;m<i;m++){for(var l=0;l<d.mipmapCount;l++){if(k){var p;p=f;for(var s=h,t=4*p*s,n=new Uint8Array(a,g,t),t=new Uint8Array(t),q=0,u=0,r=0;r<s;r++)for(var v=0;v<p;v++){var y=n[u];u++;var D=n[u];u++;var L=n[u];u++;var B=n[u];u++;t[q]=L;q++;t[q]=D;q++;t[q]=y;q++;t[q]=B;q++}p=t;s=p.length}else s=
 Math.max(4,f)/4*Math.max(4,h)/4*e,p=new Uint8Array(a,g,s);d.mipmaps.push({data:p,width:f,height:h});g+=s;f=Math.max(0.5*f,1);h=Math.max(0.5*h,1)}f=d.width;h=d.height}return d},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]},b=b|1,d=a.width,e=a.height,f=document.createElement("canvas");f.width=d;f.height=e;var h=f.getContext("2d");h.drawImage(a,0,0);for(var g=h.getImageData(0,0,d,e).data,i=h.createImageData(d,e),k=i.data,m=0;m<
 d;m++)for(var l=0;l<e;l++){var p=0>l-1?0:l-1,s=l+1>e-1?e-1:l+1,t=0>m-1?0:m-1,n=m+1>d-1?d-1:m+1,q=[],u=[0,0,g[4*(l*d+m)]/255*b];q.push([-1,0,g[4*(l*d+t)]/255*b]);q.push([-1,-1,g[4*(p*d+t)]/255*b]);q.push([0,-1,g[4*(p*d+m)]/255*b]);q.push([1,-1,g[4*(p*d+n)]/255*b]);q.push([1,0,g[4*(l*d+n)]/255*b]);q.push([1,1,g[4*(s*d+n)]/255*b]);q.push([0,1,g[4*(s*d+m)]/255*b]);q.push([-1,1,g[4*(s*d+t)]/255*b]);p=[];t=q.length;for(s=0;s<t;s++){var n=q[s],r=q[(s+1)%t],n=[n[0]-u[0],n[1]-u[1],n[2]-u[2]],r=[r[0]-u[0],
 r[1]-u[1],r[2]-u[2]];p.push(c([n[1]*r[2]-n[2]*r[1],n[2]*r[0]-n[0]*r[2],n[0]*r[1]-n[1]*r[0]]))}q=[0,0,0];for(s=0;s<p.length;s++)q[0]+=p[s][0],q[1]+=p[s][1],q[2]+=p[s][2];q[0]/=p.length;q[1]/=p.length;q[2]/=p.length;u=4*(l*d+m);k[u]=255*((q[0]+1)/2)|0;k[u+1]=255*((q[1]+1)/2)|0;k[u+2]=255*q[2]|0;k[u+3]=255}h.putImageData(i,0,0);return f},generateDataTexture:function(a,b,c){for(var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),h=Math.floor(255*c.g),c=Math.floor(255*c.b),g=0;g<d;g++)e[3*g]=f,e[3*g+
@@ -530,7 +530,7 @@ r[1]-u[1],r[2]-u[2]];p.push(c([n[1]*r[2]-n[2]*r[1],n[2]*r[0]-n[0]*r[2],n[0]*r[1]
 c+d;m=b[a++]*c;s=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(s,t,i,m);if(h=f[f.length-1]){l=h.x;p=h.y;h=1;for(g=this.divisions;h<=g;h++){var r=h/g;THREE.Shape.Utils.b2(r,l,s,i);THREE.Shape.Utils.b2(r,p,t,m)}}break;case "b":if(i=b[a++]*c+d,m=b[a++]*c,s=b[a++]*c+d,t=b[a++]*-c,n=b[a++]*c+d,q=b[a++]*-c,e.bezierCurveTo(i,m,s,t,n,q),h=f[f.length-1]){l=h.x;p=h.y;h=1;for(g=this.divisions;h<=g;h++)r=h/g,THREE.Shape.Utils.b3(r,l,s,n,i),THREE.Shape.Utils.b3(r,p,t,q,m)}}}return{offset:u.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){var b=b||{},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,h=0;h<b;f=h++)e+=a[f].x*a[h].y-a[h].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],h=[],g=[],i,k,m;if(0<b(a))for(k=0;k<e;k++)h[k]=k;else for(k=0;k<e;k++)h[k]=e-1-k;var l=2*e;for(k=e-1;2<e;){if(0>=l--){console.log("Warning, unable to triangulate polygon!");break}i=k;e<=i&&(i=0);k=i+1;e<=k&&(k=0);m=k+1;e<=m&&(m=0);var p;a:{var s=p=void 0,t=void 0,n=void 0,q=void 0,u=void 0,r=void 0,v=void 0,y=
-void 0,s=a[h[i]].x,t=a[h[i]].y,n=a[h[k]].x,q=a[h[k]].y,u=a[h[m]].x,r=a[h[m]].y;if(1E-10>(n-s)*(r-t)-(q-t)*(u-s))p=!1;else{var D=void 0,M=void 0,B=void 0,I=void 0,w=void 0,G=void 0,N=void 0,x=void 0,E=void 0,A=void 0,E=x=N=y=v=void 0,D=u-n,M=r-q,B=s-u,I=t-r,w=n-s,G=q-t;for(p=0;p<e;p++)if(v=a[h[p]].x,y=a[h[p]].y,!(v===s&&y===t||v===n&&y===q||v===u&&y===r))if(N=v-s,x=y-t,E=v-n,A=y-q,v-=u,y-=r,E=D*A-M*E,N=w*x-G*N,x=B*y-I*v,-1E-10<=E&&-1E-10<=x&&-1E-10<=N){p=!1;break a}p=!0}}if(p){f.push([a[h[i]],a[h[k]],
+void 0,s=a[h[i]].x,t=a[h[i]].y,n=a[h[k]].x,q=a[h[k]].y,u=a[h[m]].x,r=a[h[m]].y;if(1E-10>(n-s)*(r-t)-(q-t)*(u-s))p=!1;else{var D=void 0,L=void 0,B=void 0,I=void 0,w=void 0,G=void 0,N=void 0,x=void 0,E=void 0,A=void 0,E=x=N=y=v=void 0,D=u-n,L=r-q,B=s-u,I=t-r,w=n-s,G=q-t;for(p=0;p<e;p++)if(v=a[h[p]].x,y=a[h[p]].y,!(v===s&&y===t||v===n&&y===q||v===u&&y===r))if(N=v-s,x=y-t,E=v-n,A=y-q,v-=u,y-=r,E=D*A-L*E,N=w*x-G*N,x=B*y-I*v,-1E-10<=E&&-1E-10<=x&&-1E-10<=N){p=!1;break a}p=!0}}if(p){f.push([a[h[i]],a[h[k]],
 a[h[m]]]);g.push([h[i],h[k],h[m]]);i=k;for(m=k+1;m<e;i++,m++)h[i]=h[m];e--;l=2*e}}return d?g: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(){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 h=0,g=e-1,i;h<=g;)if(d=Math.floor(h+(g-h)/2),i=c[d]-f,0>i)h=d+1;else if(0<i)g=d-1;else{g=d;break}d=g;if(c[d]==f)return d/(e-1);h=c[d];return c=(d+(f-h)/(c[d+1]-h))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4,a=a+1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};
@@ -562,8 +562,8 @@ THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTr
 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 h=b.x-a.x,g=b.y-a.y,i=e.x-d.x,k=e.y-d.y,l=a.x-d.x,m=a.y-d.y,n=g*i-h*k,p=g*l-h*m;if(1E-10<Math.abs(n)){if(0<n){if(0>p||p>n)return[];d=k*l-i*m;if(0>d||d>n)return[]}else{if(0<p||p<n)return[];d=k*l-i*m;if(0<d||d<n)return[]}if(0==d)return f&&(0==p||p==n)?[]:[a];if(d==n)return f&&(0==p||p==n)?[]:[b];f=d/
 n;return[{x:a.x+f*h,y:a.y+f*g}]}if(0!=p)return[];g=0==h&&0==g;i=0==i&&0==k;if(g&&i)return a.x!=d.x||a.y!=d.y?[]:[a];if(g)return!c(d,e,a)?[]:[a];if(i)return!c(a,b,d)?[]:[d];0!=h?(a.x<b.x?(h=a,i=a.x,g=b,a=b.x):(h=b,i=b.x,g=a,a=a.x),d.x<e.x?(b=d,n=d.x,k=e,d=e.x):(b=e,n=e.x,k=d,d=d.x)):(a.y<b.y?(h=a,i=a.y,g=b,a=b.y):(h=b,i=b.y,g=a,a=a.y),d.y<e.y?(b=d,n=d.y,k=e,d=e.y):(b=e,n=e.y,k=d,d=d.y));return i<=n?a<n?[]:a==n?f?[]:[b]:a<=d?[b,g]:[b,k]:i>d?[]:i==d?f?[]:[h]:a<=d?[h,g]:[h,k]}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,h=d.x-a.x,d=d.y-a.y,a=e*c-f*b,e=e*d-f*h;return 1E-10<Math.abs(a)?(b=h*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,h,g,i,k,m={};i=a.concat();for(f in b)Array.prototype.push.apply(i,b[f]);f=0;for(h=i.length;f<h;f++)k=i[f].x+":"+i[f].y,void 0!==m[k]&&console.log("Duplicate point",k),m[k]=f;var l=a.concat(),p;f=[];var s,t,n,q=[];for(g in b)f.push(g);for(var u=2*f.length;0<f.length;){u--;if(0>u){console.log("Infinite Loop! Holes left:"+f.length+", Probably Hole outside Shape!");
-break}for(k=0;k<l.length;k++){i=l[k];h=-1;for(g=0;g<f.length;g++)if(p=f[g],n=i.x+":"+i.y+":"+p,void 0===q[n]){p=b[p];for(s=0;s<p.length;s++){t=p[s];var r;r=k;var v=s,y=l.length-1,D=r-1;0>D&&(D=y);var M=r+1;M>y&&(M=0);(y=e(l[r],l[D],l[M],p[v]))?(y=p.length-1,D=v-1,0>D&&(D=y),M=v+1,M>y&&(M=0),y=e(p[v],p[D],p[M],l[r]),r=!y?!1:!0):r=!1;if(r){a:{r=i;v=t;D=D=y=void 0;for(y=0;y<l.length;y++)if(D=y+1,D%=l.length,D=d(r,v,l[y],l[D],!0),0<D.length){r=!0;break a}r=!1}if(r=!r){a:{r=i;M=M=D=y=v=void 0;for(v=0;v<
-f.length;v++){y=b[f[v]];for(D=0;D<y.length;D++)if(M=D+1,M%=y.length,M=d(r,t,y[D],y[M],!0),0<M.length){t=!0;break a}}t=!1}r=!t}}if(r){h=s;f.splice(g,1);s=l.slice(0,k+1);l=l.slice(k);t=p.slice(h);p=p.slice(0,h+1);l=s.concat(t).concat(p).concat(l);break}}if(0<=h)break;q[n]=!0}if(0<=h)break}}n=THREE.FontUtils.Triangulate(l,!1);f=0;for(h=n.length;f<h;f++){i=n[f];for(g=0;3>g;g++)k=i[g].x+":"+i[g].y,k=m[k],void 0!==k&&(i[g]=k)}return n.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},
+break}for(k=0;k<l.length;k++){i=l[k];h=-1;for(g=0;g<f.length;g++)if(p=f[g],n=i.x+":"+i.y+":"+p,void 0===q[n]){p=b[p];for(s=0;s<p.length;s++){t=p[s];var r;r=k;var v=s,y=l.length-1,D=r-1;0>D&&(D=y);var L=r+1;L>y&&(L=0);(y=e(l[r],l[D],l[L],p[v]))?(y=p.length-1,D=v-1,0>D&&(D=y),L=v+1,L>y&&(L=0),y=e(p[v],p[D],p[L],l[r]),r=!y?!1:!0):r=!1;if(r){a:{r=i;v=t;D=D=y=void 0;for(y=0;y<l.length;y++)if(D=y+1,D%=l.length,D=d(r,v,l[y],l[D],!0),0<D.length){r=!0;break a}r=!1}if(r=!r){a:{r=i;L=L=D=y=v=void 0;for(v=0;v<
+f.length;v++){y=b[f[v]];for(D=0;D<y.length;D++)if(L=D+1,L%=y.length,L=d(r,t,y[D],y[L],!0),0<L.length){t=!0;break a}}t=!1}r=!t}}if(r){h=s;f.splice(g,1);s=l.slice(0,k+1);l=l.slice(k);t=p.slice(h);p=p.slice(0,h+1);l=s.concat(t).concat(p).concat(l);break}}if(0<=h)break;q[n]=!0}if(0<=h)break}}n=THREE.FontUtils.Triangulate(l,!1);f=0;for(h=n.length;f<h;f++){i=n[f];for(g=0;3>g;g++)k=i[g].x+":"+i[g].y,k=m[k],void 0!==k&&(i[g]=k)}return n.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(){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)};
 THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.SplineCurve=function(a){this.points=void 0==a?[]:a};THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],d=this.points,e;e=(d.length-1)*a;a=Math.floor(e);e-=a;c[0]=0==a?a:a-1;c[1]=a;c[2]=a>d.length-2?d.length-1:a+1;c[3]=a>d.length-3?d.length-1:a+2;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);return b};THREE.EllipseCurve=function(a,b,c,d,e,f,h){this.aX=a;this.aY=b;this.xRadius=c;this.yRadius=d;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=h};THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype);
@@ -599,21 +599,21 @@ THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;thi
 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.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.radius=a=a||50;this.segments=b=void 0!==b?Math.max(3,b):8;this.thetaStart=c=void 0!==c?c:0;this.thetaLength=d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var h=new THREE.Vector2(0.5,0.5);this.vertices.push(e);f.push(h);for(e=0;e<=b;e++){var g=new THREE.Vector3,i=c+e/b*d;g.x=a*Math.cos(i);g.y=a*Math.sin(i);this.vertices.push(g);f.push(new THREE.Vector2((g.x/a+1)/2,(g.y/a+1)/2))}c=new THREE.Vector3(0,0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,
-e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),h.clone()]);this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){function h(a,b,c,d,e,f,h,n){var q,u=g.widthSegments,r=g.heightSegments,v=e/2,y=f/2,D=g.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)q="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)q="y",r=g.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)q="x",u=g.depthSegments;var M=u+1,B=r+1,I=e/u,w=f/r,G=new THREE.Vector3;G[q]=0<h?1:-1;for(e=0;e<B;e++)for(f=0;f<M;f++){var N=new THREE.Vector3;N[a]=(f*I-v)*c;N[b]=(e*w-y)*d;N[q]=h;g.vertices.push(N)}for(e=
-0;e<r;e++)for(f=0;f<u;f++)y=f+M*e,a=f+M*(e+1),b=f+1+M*(e+1),c=f+1+M*e,d=new THREE.Vector2(f/u,1-e/r),h=new THREE.Vector2(f/u,1-(e+1)/r),q=new THREE.Vector2((f+1)/u,1-(e+1)/r),v=new THREE.Vector2((f+1)/u,1-e/r),y=new THREE.Face3(y+D,a+D,c+D),y.normal.copy(G),y.vertexNormals.push(G.clone(),G.clone(),G.clone()),y.materialIndex=n,g.faces.push(y),g.faceVertexUvs[0].push([d,h,v]),y=new THREE.Face3(a+D,b+D,c+D),y.normal.copy(G),y.vertexNormals.push(G.clone(),G.clone(),G.clone()),y.materialIndex=n,g.faces.push(y),
+e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),h.clone()]);this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){function h(a,b,c,d,e,f,h,n){var q,u=g.widthSegments,r=g.heightSegments,v=e/2,y=f/2,D=g.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)q="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)q="y",r=g.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)q="x",u=g.depthSegments;var L=u+1,B=r+1,I=e/u,w=f/r,G=new THREE.Vector3;G[q]=0<h?1:-1;for(e=0;e<B;e++)for(f=0;f<L;f++){var N=new THREE.Vector3;N[a]=(f*I-v)*c;N[b]=(e*w-y)*d;N[q]=h;g.vertices.push(N)}for(e=
+0;e<r;e++)for(f=0;f<u;f++)y=f+L*e,a=f+L*(e+1),b=f+1+L*(e+1),c=f+1+L*e,d=new THREE.Vector2(f/u,1-e/r),h=new THREE.Vector2(f/u,1-(e+1)/r),q=new THREE.Vector2((f+1)/u,1-(e+1)/r),v=new THREE.Vector2((f+1)/u,1-e/r),y=new THREE.Face3(y+D,a+D,c+D),y.normal.copy(G),y.vertexNormals.push(G.clone(),G.clone(),G.clone()),y.materialIndex=n,g.faces.push(y),g.faceVertexUvs[0].push([d,h,v]),y=new THREE.Face3(a+D,b+D,c+D),y.normal.copy(G),y.vertexNormals.push(G.clone(),G.clone(),G.clone()),y.materialIndex=n,g.faces.push(y),
 g.faceVertexUvs[0].push([h.clone(),q,v.clone()])}THREE.Geometry.call(this);var g=this;this.width=a;this.height=b;this.depth=c;this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;a=this.width/2;b=this.height/2;c=this.depth/2;h("z","y",-1,-1,this.depth,this.height,a,0);h("z","y",1,-1,this.depth,this.height,-a,1);h("x","z",1,1,this.width,this.depth,b,2);h("x","z",1,-1,this.width,this.depth,-b,3);h("x","y",1,-1,this.width,this.height,c,4);h("x","y",-1,-1,this.width,this.height,-c,
 5);this.computeCentroids();this.mergeVertices()};THREE.CubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.radiusTop=a=void 0!==a?a:20;this.radiusBottom=b=void 0!==b?b:20;this.height=c=void 0!==c?c:100;this.radialSegments=d=d||8;this.heightSegments=e=e||1;this.openEnded=f=void 0!==f?f:!1;var h=c/2,g,i,k=[],m=[];for(i=0;i<=e;i++){var l=[],p=[],s=i/e,t=s*(b-a)+a;for(g=0;g<=d;g++){var n=g/d,q=new THREE.Vector3;q.x=t*Math.sin(2*n*Math.PI);q.y=-s*c+h;q.z=t*Math.cos(2*n*Math.PI);this.vertices.push(q);l.push(this.vertices.length-1);p.push(new THREE.Vector2(n,
-1-s))}k.push(l);m.push(p)}c=(b-a)/c;for(g=0;g<d;g++){0!==a?(l=this.vertices[k[0][g]].clone(),p=this.vertices[k[0][g+1]].clone()):(l=this.vertices[k[1][g]].clone(),p=this.vertices[k[1][g+1]].clone());l.setY(Math.sqrt(l.x*l.x+l.z*l.z)*c).normalize();p.setY(Math.sqrt(p.x*p.x+p.z*p.z)*c).normalize();for(i=0;i<e;i++){var s=k[i][g],t=k[i+1][g],n=k[i+1][g+1],q=k[i][g+1],u=l.clone(),r=l.clone(),v=p.clone(),y=p.clone(),D=m[i][g].clone(),M=m[i+1][g].clone(),B=m[i+1][g+1].clone(),I=m[i][g+1].clone();this.faces.push(new THREE.Face3(s,
-t,q,[u,r,y]));this.faceVertexUvs[0].push([D,M,I]);this.faces.push(new THREE.Face3(t,n,q,[r.clone(),v,y.clone()]));this.faceVertexUvs[0].push([M.clone(),B,I.clone()])}}if(!1===f&&0<a){this.vertices.push(new THREE.Vector3(0,h,0));for(g=0;g<d;g++)s=k[0][g],t=k[0][g+1],n=this.vertices.length-1,u=new THREE.Vector3(0,1,0),r=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),D=m[0][g].clone(),M=m[0][g+1].clone(),B=new THREE.Vector2(M.x,0),this.faces.push(new THREE.Face3(s,t,n,[u,r,v])),this.faceVertexUvs[0].push([D,
-M,B])}if(!1===f&&0<b){this.vertices.push(new THREE.Vector3(0,-h,0));for(g=0;g<d;g++)s=k[i][g+1],t=k[i][g],n=this.vertices.length-1,u=new THREE.Vector3(0,-1,0),r=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),D=m[i][g+1].clone(),M=m[i][g].clone(),B=new THREE.Vector2(M.x,1),this.faces.push(new THREE.Face3(s,t,n,[u,r,v])),this.faceVertexUvs[0].push([D,M,B])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
+1-s))}k.push(l);m.push(p)}c=(b-a)/c;for(g=0;g<d;g++){0!==a?(l=this.vertices[k[0][g]].clone(),p=this.vertices[k[0][g+1]].clone()):(l=this.vertices[k[1][g]].clone(),p=this.vertices[k[1][g+1]].clone());l.setY(Math.sqrt(l.x*l.x+l.z*l.z)*c).normalize();p.setY(Math.sqrt(p.x*p.x+p.z*p.z)*c).normalize();for(i=0;i<e;i++){var s=k[i][g],t=k[i+1][g],n=k[i+1][g+1],q=k[i][g+1],u=l.clone(),r=l.clone(),v=p.clone(),y=p.clone(),D=m[i][g].clone(),L=m[i+1][g].clone(),B=m[i+1][g+1].clone(),I=m[i][g+1].clone();this.faces.push(new THREE.Face3(s,
+t,q,[u,r,y]));this.faceVertexUvs[0].push([D,L,I]);this.faces.push(new THREE.Face3(t,n,q,[r.clone(),v,y.clone()]));this.faceVertexUvs[0].push([L.clone(),B,I.clone()])}}if(!1===f&&0<a){this.vertices.push(new THREE.Vector3(0,h,0));for(g=0;g<d;g++)s=k[0][g],t=k[0][g+1],n=this.vertices.length-1,u=new THREE.Vector3(0,1,0),r=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),D=m[0][g].clone(),L=m[0][g+1].clone(),B=new THREE.Vector2(L.x,0),this.faces.push(new THREE.Face3(s,t,n,[u,r,v])),this.faceVertexUvs[0].push([D,
+L,B])}if(!1===f&&0<b){this.vertices.push(new THREE.Vector3(0,-h,0));for(g=0;g<d;g++)s=k[i][g+1],t=k[i][g],n=this.vertices.length-1,u=new THREE.Vector3(0,-1,0),r=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),D=m[i][g+1].clone(),L=m[i][g].clone(),B=new THREE.Vector2(L.x,1),this.faces.push(new THREE.Face3(s,t,n,[u,r,v])),this.faceVertexUvs[0].push([D,L,B])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,f=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,i=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();f.set(-d.y,d.x);g.set(e.y,-e.x);h.copy(a).add(f);i.copy(a).add(g);if(h.equals(i))return g.clone();
 h.copy(b).add(f);i.copy(c).add(g);f=d.dot(g);g=i.sub(h).dot(g);0===f&&(console.log("Either infinite or no solutions!"),0===g?console.log("Its finite solutions."):console.log("Too bad, no solutions."));g/=f;return 0>g?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(g).add(h).sub(a).clone()}function e(c,d){var e,f;for(H=c.length;0<=--H;){e=H;f=H-1;0>f&&(f=c.length-1);for(var g=0,h=s+2*m,
 g=0;g<h;g++){var i=Z*g,k=Z*(g+1),l=d+e+i,i=d+f+i,n=d+f+k,k=d+e+k,p=c,q=g,t=h,u=e,w=f,l=l+x,i=i+x,n=n+x,k=k+x;N.faces.push(new THREE.Face3(l,i,k,null,null,r));N.faces.push(new THREE.Face3(i,n,k,null,null,r));l=v.generateSideWallUV(N,a,p,b,l,i,n,k,q,t,u,w);N.faceVertexUvs[0].push([l[0],l[1],l[3]]);N.faceVertexUvs[0].push([l[1],l[2],l[3]])}}}function f(a,b,c){N.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=x;d+=x;e+=x;N.faces.push(new THREE.Face3(c,d,e,null,null,u));c=f?v.generateBottomUV(N,
-a,b,c,d,e):v.generateTopUV(N,a,b,c,d,e);N.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,l=void 0!==b.bevelEnabled?b.bevelEnabled:!0,p=void 0!==b.curveSegments?b.curveSegments:12,s=void 0!==b.steps?b.steps:1,t=b.extrudePath,n,q=!1,u=b.material,r=b.extrudeMaterial,v=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,y,D,M,B;t&&(n=
-t.getSpacedPoints(s),q=!0,l=!1,y=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),D=new THREE.Vector3,M=new THREE.Vector3,B=new THREE.Vector3);l||(k=i=m=0);var I,w,G,N=this,x=this.vertices.length,p=a.extractPoints(p),E=p.shape,p=p.holes;if(t=!THREE.Shape.Utils.isClockWise(E)){E=E.reverse();w=0;for(G=p.length;w<G;w++)I=p[w],THREE.Shape.Utils.isClockWise(I)&&(p[w]=I.reverse());t=!1}var A=THREE.Shape.Utils.triangulateShape(E,p),t=E;w=0;for(G=p.length;w<G;w++)I=p[w],E=E.concat(I);
-var z,C,L,F,Z=E.length,ea=A.length,Ba=[],H=0,V=t.length;z=V-1;for(C=H+1;H<V;H++,z++,C++)z===V&&(z=0),C===V&&(C=0),Ba[H]=d(t[H],t[z],t[C]);var da=[],ia,K=Ba.concat();w=0;for(G=p.length;w<G;w++){I=p[w];ia=[];H=0;V=I.length;z=V-1;for(C=H+1;H<V;H++,z++,C++)z===V&&(z=0),C===V&&(C=0),ia[H]=d(I[H],I[z],I[C]);da.push(ia);K=K.concat(ia)}for(z=0;z<m;z++){I=z/m;L=i*(1-I);C=k*Math.sin(I*Math.PI/2);H=0;for(V=t.length;H<V;H++)F=c(t[H],Ba[H],C),f(F.x,F.y,-L);w=0;for(G=p.length;w<G;w++){I=p[w];ia=da[w];H=0;for(V=
-I.length;H<V;H++)F=c(I[H],ia[H],C),f(F.x,F.y,-L)}}C=k;for(H=0;H<Z;H++)F=l?c(E[H],K[H],C):E[H],q?(M.copy(y.normals[0]).multiplyScalar(F.x),D.copy(y.binormals[0]).multiplyScalar(F.y),B.copy(n[0]).add(M).add(D),f(B.x,B.y,B.z)):f(F.x,F.y,0);for(I=1;I<=s;I++)for(H=0;H<Z;H++)F=l?c(E[H],K[H],C):E[H],q?(M.copy(y.normals[I]).multiplyScalar(F.x),D.copy(y.binormals[I]).multiplyScalar(F.y),B.copy(n[I]).add(M).add(D),f(B.x,B.y,B.z)):f(F.x,F.y,g/s*I);for(z=m-1;0<=z;z--){I=z/m;L=i*(1-I);C=k*Math.sin(I*Math.PI/2);
-H=0;for(V=t.length;H<V;H++)F=c(t[H],Ba[H],C),f(F.x,F.y,g+L);w=0;for(G=p.length;w<G;w++){I=p[w];ia=da[w];H=0;for(V=I.length;H<V;H++)F=c(I[H],ia[H],C),q?f(F.x,F.y+n[s-1].y,n[s-1].x+L):f(F.x,F.y,g+L)}}if(l){i=0*Z;for(H=0;H<ea;H++)g=A[H],h(g[2]+i,g[1]+i,g[0]+i,!0);i=Z*(s+2*m);for(H=0;H<ea;H++)g=A[H],h(g[0]+i,g[1]+i,g[2]+i,!1)}else{for(H=0;H<ea;H++)g=A[H],h(g[2],g[1],g[0],!0);for(H=0;H<ea;H++)g=A[H],h(g[0]+Z*s,g[1]+Z*s,g[2]+Z*s,!1)}g=0;e(t,g);g+=t.length;w=0;for(G=p.length;w<G;w++)I=p[w],e(I,g),g+=I.length};
+a,b,c,d,e):v.generateTopUV(N,a,b,c,d,e);N.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,l=void 0!==b.bevelEnabled?b.bevelEnabled:!0,p=void 0!==b.curveSegments?b.curveSegments:12,s=void 0!==b.steps?b.steps:1,t=b.extrudePath,n,q=!1,u=b.material,r=b.extrudeMaterial,v=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,y,D,L,B;t&&(n=
+t.getSpacedPoints(s),q=!0,l=!1,y=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),D=new THREE.Vector3,L=new THREE.Vector3,B=new THREE.Vector3);l||(k=i=m=0);var I,w,G,N=this,x=this.vertices.length,p=a.extractPoints(p),E=p.shape,p=p.holes;if(t=!THREE.Shape.Utils.isClockWise(E)){E=E.reverse();w=0;for(G=p.length;w<G;w++)I=p[w],THREE.Shape.Utils.isClockWise(I)&&(p[w]=I.reverse());t=!1}var A=THREE.Shape.Utils.triangulateShape(E,p),t=E;w=0;for(G=p.length;w<G;w++)I=p[w],E=E.concat(I);
+var z,C,M,F,Z=E.length,ea=A.length,Ba=[],H=0,V=t.length;z=V-1;for(C=H+1;H<V;H++,z++,C++)z===V&&(z=0),C===V&&(C=0),Ba[H]=d(t[H],t[z],t[C]);var da=[],ia,K=Ba.concat();w=0;for(G=p.length;w<G;w++){I=p[w];ia=[];H=0;V=I.length;z=V-1;for(C=H+1;H<V;H++,z++,C++)z===V&&(z=0),C===V&&(C=0),ia[H]=d(I[H],I[z],I[C]);da.push(ia);K=K.concat(ia)}for(z=0;z<m;z++){I=z/m;M=i*(1-I);C=k*Math.sin(I*Math.PI/2);H=0;for(V=t.length;H<V;H++)F=c(t[H],Ba[H],C),f(F.x,F.y,-M);w=0;for(G=p.length;w<G;w++){I=p[w];ia=da[w];H=0;for(V=
+I.length;H<V;H++)F=c(I[H],ia[H],C),f(F.x,F.y,-M)}}C=k;for(H=0;H<Z;H++)F=l?c(E[H],K[H],C):E[H],q?(L.copy(y.normals[0]).multiplyScalar(F.x),D.copy(y.binormals[0]).multiplyScalar(F.y),B.copy(n[0]).add(L).add(D),f(B.x,B.y,B.z)):f(F.x,F.y,0);for(I=1;I<=s;I++)for(H=0;H<Z;H++)F=l?c(E[H],K[H],C):E[H],q?(L.copy(y.normals[I]).multiplyScalar(F.x),D.copy(y.binormals[I]).multiplyScalar(F.y),B.copy(n[I]).add(L).add(D),f(B.x,B.y,B.z)):f(F.x,F.y,g/s*I);for(z=m-1;0<=z;z--){I=z/m;M=i*(1-I);C=k*Math.sin(I*Math.PI/2);
+H=0;for(V=t.length;H<V;H++)F=c(t[H],Ba[H],C),f(F.x,F.y,g+M);w=0;for(G=p.length;w<G;w++){I=p[w];ia=da[w];H=0;for(V=I.length;H<V;H++)F=c(I[H],ia[H],C),q?f(F.x,F.y+n[s-1].y,n[s-1].x+M):f(F.x,F.y,g+M)}}if(l){i=0*Z;for(H=0;H<ea;H++)g=A[H],h(g[2]+i,g[1]+i,g[0]+i,!0);i=Z*(s+2*m);for(H=0;H<ea;H++)g=A[H],h(g[0]+i,g[1]+i,g[2]+i,!1)}else{for(H=0;H<ea;H++)g=A[H],h(g[2],g[1],g[0],!0);for(H=0;H<ea;H++)g=A[H],h(g[0]+Z*s,g[1]+Z*s,g[2]+Z*s,!1)}g=0;e(t,g);g+=t.length;w=0;for(G=p.length;w<G;w++)I=p[w],e(I,g),g+=I.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,h,g){var b=a.vertices[e].x,c=a.vertices[e].y,e=a.vertices[e].z,d=a.vertices[f].x,i=a.vertices[f].y,f=a.vertices[f].z,k=a.vertices[h].x,
 m=a.vertices[h].y,h=a.vertices[h].z,l=a.vertices[g].x,p=a.vertices[g].y,a=a.vertices[g].z;return 0.01>Math.abs(c-i)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(k,1-h),new THREE.Vector2(l,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(i,1-f),new THREE.Vector2(m,1-h),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.computeCentroids();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};
@@ -678,28 +678,28 @@ f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetI
 e[t++]=0;e[t++]=0;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;t=0;f[t++]=0;f[t++]=1;f[t++]=2;f[t++]=0;f[t++]=2;f[t++]=3;h=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,h);b.bufferData(b.ARRAY_BUFFER,e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);i=b.createTexture();k=b.createTexture();b.bindTexture(b.TEXTURE_2D,i);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,k);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)?(m=!1,l=a(THREE.ShaderFlares.lensFlare,d)):(m=!0,l=a(THREE.ShaderFlares.lensFlareVertexTexture,d));p={};s={};p.vertex=b.getAttribLocation(l,"position");p.uv=b.getAttribLocation(l,"uv");s.renderType=b.getUniformLocation(l,"renderType");s.map=b.getUniformLocation(l,"map");s.occlusionMap=b.getUniformLocation(l,"occlusionMap");s.opacity=
-b.getUniformLocation(l,"opacity");s.color=b.getUniformLocation(l,"color");s.scale=b.getUniformLocation(l,"scale");s.rotation=b.getUniformLocation(l,"rotation");s.screenPosition=b.getUniformLocation(l,"screenPosition")};this.render=function(a,d,e,f){var a=a.__webglFlares,r=a.length;if(r){var v=new THREE.Vector3,y=f/e,D=0.5*e,M=0.5*f,B=16/f,I=new THREE.Vector2(B*y,B),w=new THREE.Vector3(1,1,0),G=new THREE.Vector2(1,1),N=s,B=p;b.useProgram(l);b.enableVertexAttribArray(p.vertex);b.enableVertexAttribArray(p.uv);
+b.getUniformLocation(l,"opacity");s.color=b.getUniformLocation(l,"color");s.scale=b.getUniformLocation(l,"scale");s.rotation=b.getUniformLocation(l,"rotation");s.screenPosition=b.getUniformLocation(l,"screenPosition")};this.render=function(a,d,e,f){var a=a.__webglFlares,r=a.length;if(r){var v=new THREE.Vector3,y=f/e,D=0.5*e,L=0.5*f,B=16/f,I=new THREE.Vector2(B*y,B),w=new THREE.Vector3(1,1,0),G=new THREE.Vector2(1,1),N=s,B=p;b.useProgram(l);b.enableVertexAttribArray(p.vertex);b.enableVertexAttribArray(p.uv);
 b.uniform1i(N.occlusionMap,0);b.uniform1i(N.map,1);b.bindBuffer(b.ARRAY_BUFFER,h);b.vertexAttribPointer(B.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(B.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.disable(b.CULL_FACE);b.depthMask(!1);var x,E,A,z,C;for(x=0;x<r;x++)if(B=16/f,I.set(B*y,B),z=a[x],v.set(z.matrixWorld.elements[12],z.matrixWorld.elements[13],z.matrixWorld.elements[14]),v.applyMatrix4(d.matrixWorldInverse),v.applyProjection(d.projectionMatrix),w.copy(v),G.x=w.x*D+D,
-G.y=w.y*M+M,m||0<G.x&&G.x<e&&0<G.y&&G.y<f){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,G.x-8,G.y-8,16,16,0);b.uniform1i(N.renderType,0);b.uniform2f(N.scale,I.x,I.y);b.uniform3f(N.screenPosition,w.x,w.y,w.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,k);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,G.x-8,G.y-8,16,16,0);b.uniform1i(N.renderType,1);b.disable(b.DEPTH_TEST);
+G.y=w.y*L+L,m||0<G.x&&G.x<e&&0<G.y&&G.y<f){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,G.x-8,G.y-8,16,16,0);b.uniform1i(N.renderType,0);b.uniform2f(N.scale,I.x,I.y);b.uniform3f(N.screenPosition,w.x,w.y,w.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,k);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,G.x-8,G.y-8,16,16,0);b.uniform1i(N.renderType,1);b.disable(b.DEPTH_TEST);
 b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);z.positionScreen.copy(w);z.customUpdateCallback?z.customUpdateCallback(z):z.updateLensFlares();b.uniform1i(N.renderType,2);b.enable(b.BLEND);E=0;for(A=z.lensFlares.length;E<A;E++)C=z.lensFlares[E],0.001<C.opacity&&0.001<C.scale&&(w.x=C.x,w.y=C.y,w.z=C.z,B=C.size*C.scale/f,I.x=B*y,I.y=B,b.uniform3f(N.screenPosition,w.x,w.y,w.z),b.uniform2f(N.scale,I.x,I.y),b.uniform1f(N.rotation,C.rotation),b.uniform1f(N.opacity,
 C.opacity),b.uniform3f(N.color,C.color.r,C.color.g,C.color.b),c.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),c.setTexture(C.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,h=new THREE.Frustum,g=new THREE.Matrix4,i=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,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(l,p){var s,t,n,q,u,r,v,y,D,M=[];q=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
+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(l,p){var s,t,n,q,u,r,v,y,D,L=[];q=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
 a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);s=0;for(t=l.__lights.length;s<t;s++)if(n=l.__lights[s],n.castShadow)if(n instanceof THREE.DirectionalLight&&n.shadowCascade)for(u=0;u<n.shadowCascadeCount;u++){var B;if(n.shadowCascadeArray[u])B=n.shadowCascadeArray[u];else{D=n;v=u;B=new THREE.DirectionalLight;B.isVirtual=!0;B.onlyShadow=!0;B.castShadow=!0;B.shadowCameraNear=D.shadowCameraNear;B.shadowCameraFar=D.shadowCameraFar;B.shadowCameraLeft=D.shadowCameraLeft;B.shadowCameraRight=D.shadowCameraRight;
 B.shadowCameraBottom=D.shadowCameraBottom;B.shadowCameraTop=D.shadowCameraTop;B.shadowCameraVisible=D.shadowCameraVisible;B.shadowDarkness=D.shadowDarkness;B.shadowBias=D.shadowCascadeBias[v];B.shadowMapWidth=D.shadowCascadeWidth[v];B.shadowMapHeight=D.shadowCascadeHeight[v];B.pointsWorld=[];B.pointsFrustum=[];y=B.pointsWorld;r=B.pointsFrustum;for(var I=0;8>I;I++)y[I]=new THREE.Vector3,r[I]=new THREE.Vector3;y=D.shadowCascadeNearZ[v];D=D.shadowCascadeFarZ[v];r[0].set(-1,-1,y);r[1].set(1,-1,y);r[2].set(-1,
 1,y);r[3].set(1,1,y);r[4].set(-1,-1,D);r[5].set(1,-1,D);r[6].set(-1,1,D);r[7].set(1,1,D);B.originalCamera=p;r=new THREE.Gyroscope;r.position=n.shadowCascadeOffset;r.add(B);r.add(B.target);p.add(r);n.shadowCascadeArray[u]=B;console.log("Created virtualLight",B)}v=n;y=u;D=v.shadowCascadeArray[y];D.position.copy(v.position);D.target.position.copy(v.target.position);D.lookAt(D.target);D.shadowCameraVisible=v.shadowCameraVisible;D.shadowDarkness=v.shadowDarkness;D.shadowBias=v.shadowCascadeBias[y];r=v.shadowCascadeNearZ[y];
-v=v.shadowCascadeFarZ[y];D=D.pointsFrustum;D[0].z=r;D[1].z=r;D[2].z=r;D[3].z=r;D[4].z=v;D[5].z=v;D[6].z=v;D[7].z=v;M[q]=B;q++}else M[q]=n,q++;s=0;for(t=M.length;s<t;s++){n=M[s];n.shadowMap||(u=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(u=THREE.NearestFilter),n.shadowMap=new THREE.WebGLRenderTarget(n.shadowMapWidth,n.shadowMapHeight,{minFilter:u,magFilter:u,format:THREE.RGBAFormat}),n.shadowMapSize=new THREE.Vector2(n.shadowMapWidth,n.shadowMapHeight),n.shadowMatrix=new THREE.Matrix4);
+v=v.shadowCascadeFarZ[y];D=D.pointsFrustum;D[0].z=r;D[1].z=r;D[2].z=r;D[3].z=r;D[4].z=v;D[5].z=v;D[6].z=v;D[7].z=v;L[q]=B;q++}else L[q]=n,q++;s=0;for(t=L.length;s<t;s++){n=L[s];n.shadowMap||(u=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(u=THREE.NearestFilter),n.shadowMap=new THREE.WebGLRenderTarget(n.shadowMapWidth,n.shadowMapHeight,{minFilter:u,magFilter:u,format:THREE.RGBAFormat}),n.shadowMapSize=new THREE.Vector2(n.shadowMapWidth,n.shadowMapHeight),n.shadowMatrix=new THREE.Matrix4);
 if(!n.shadowCamera){if(n instanceof THREE.SpotLight)n.shadowCamera=new THREE.PerspectiveCamera(n.shadowCameraFov,n.shadowMapWidth/n.shadowMapHeight,n.shadowCameraNear,n.shadowCameraFar);else if(n instanceof THREE.DirectionalLight)n.shadowCamera=new THREE.OrthographicCamera(n.shadowCameraLeft,n.shadowCameraRight,n.shadowCameraTop,n.shadowCameraBottom,n.shadowCameraNear,n.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}l.add(n.shadowCamera);!0===l.autoUpdate&&l.updateMatrixWorld()}n.shadowCameraVisible&&
 !n.cameraHelper&&(n.cameraHelper=new THREE.CameraHelper(n.shadowCamera),n.shadowCamera.add(n.cameraHelper));if(n.isVirtual&&B.originalCamera==p){u=p;q=n.shadowCamera;r=n.pointsFrustum;D=n.pointsWorld;i.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(v=0;8>v;v++)y=D[v],y.copy(r[v]),THREE.ShadowMapPlugin.__projector.unprojectVector(y,u),y.applyMatrix4(q.matrixWorldInverse),y.x<i.x&&(i.x=y.x),y.x>k.x&&(k.x=y.x),y.y<i.y&&(i.y=y.y),y.y>k.y&&(k.y=y.y),y.z<i.z&&(i.z=y.z),y.z>k.z&&
 (k.z=y.z);q.left=i.x;q.right=k.x;q.top=k.y;q.bottom=i.y;q.updateProjectionMatrix()}q=n.shadowMap;r=n.shadowMatrix;u=n.shadowCamera;u.position.setFromMatrixPosition(n.matrixWorld);m.setFromMatrixPosition(n.target.matrixWorld);u.lookAt(m);u.updateMatrixWorld();u.matrixWorldInverse.getInverse(u.matrixWorld);n.cameraHelper&&(n.cameraHelper.visible=n.shadowCameraVisible);n.shadowCameraVisible&&n.cameraHelper.update();r.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);r.multiply(u.projectionMatrix);r.multiply(u.matrixWorldInverse);
 g.multiplyMatrices(u.projectionMatrix,u.matrixWorldInverse);h.setFromMatrix(g);b.setRenderTarget(q);b.clear();D=l.__webglObjects;n=0;for(q=D.length;n<q;n++)if(v=D[n],r=v.object,v.render=!1,r.visible&&r.castShadow&&(!(r instanceof THREE.Mesh||r instanceof THREE.ParticleSystem)||!r.frustumCulled||h.intersectsObject(r)))r._modelViewMatrix.multiplyMatrices(u.matrixWorldInverse,r.matrixWorld),v.render=!0;n=0;for(q=D.length;n<q;n++)v=D[n],v.render&&(r=v.object,v=v.buffer,I=r.material instanceof THREE.MeshFaceMaterial?
 r.material.materials[0]:r.material,y=0<r.geometry.morphTargets.length&&I.morphTargets,I=r instanceof THREE.SkinnedMesh&&I.skinning,y=r.customDepthMaterial?r.customDepthMaterial:I?y?f:e:y?d:c,v instanceof THREE.BufferGeometry?b.renderBufferDirect(u,l.__lights,null,y,v,r):b.renderBuffer(u,l.__lights,null,y,v,r));D=l.__webglObjectsImmediate;n=0;for(q=D.length;n<q;n++)v=D[n],r=v.object,r.visible&&r.castShadow&&(r._modelViewMatrix.multiplyMatrices(u.matrixWorldInverse,r.matrixWorld),b.renderImmediateObject(u,
-l.__lights,null,c,r))}s=b.getClearColor();t=b.getClearAlpha();a.clearColor(s.r,s.g,s.b,t);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){var a,b,c,d,e,f,h,g,i,k,m,l,p,s,t,n,q;function u(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var r,v,y,D,M,B,I,w;this.init=function(u){r=u.context;v=u;D=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]);M=new Uint16Array([0,1,2,0,2,3]);B=r.createBuffer();I=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,B);r.bufferData(r.ARRAY_BUFFER,D,r.STATIC_DRAW);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,I);r.bufferData(r.ELEMENT_ARRAY_BUFFER,M,r.STATIC_DRAW);var u=r.createProgram(),
+l.__lights,null,c,r))}s=b.getClearColor();t=b.getClearAlpha();a.clearColor(s.r,s.g,s.b,t);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){var a,b,c,d,e,f,h,g,i,k,m,l,p,s,t,n,q;function u(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var r,v,y,D,L,B,I,w;this.init=function(u){r=u.context;v=u;D=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]);B=r.createBuffer();I=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,B);r.bufferData(r.ARRAY_BUFFER,D,r.STATIC_DRAW);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,I);r.bufferData(r.ELEMENT_ARRAY_BUFFER,L,r.STATIC_DRAW);var u=r.createProgram(),
 N=r.createShader(r.VERTEX_SHADER),x=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(N,["precision "+v.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"));
 r.shaderSource(x,["precision "+v.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"));
 r.compileShader(N);r.compileShader(x);r.attachShader(u,N);r.attachShader(u,x);r.linkProgram(u);w=u;n=r.getAttribLocation(w,"position");q=r.getAttribLocation(w,"uv");a=r.getUniformLocation(w,"uvOffset");b=r.getUniformLocation(w,"uvScale");c=r.getUniformLocation(w,"rotation");d=r.getUniformLocation(w,"scale");e=r.getUniformLocation(w,"color");f=r.getUniformLocation(w,"map");h=r.getUniformLocation(w,"opacity");g=r.getUniformLocation(w,"modelViewMatrix");i=r.getUniformLocation(w,"projectionMatrix");k=
-r.getUniformLocation(w,"fogType");m=r.getUniformLocation(w,"fogDensity");l=r.getUniformLocation(w,"fogNear");p=r.getUniformLocation(w,"fogFar");s=r.getUniformLocation(w,"fogColor");t=r.getUniformLocation(w,"alphaTest");u=document.createElement("canvas");u.width=8;u.height=8;N=u.getContext("2d");N.fillStyle="#ffffff";N.fillRect(0,0,u.width,u.height);y=new THREE.Texture(u);y.needsUpdate=!0};this.render=function(D,M){var x=D.__webglSprites,E=x.length;if(E){r.useProgram(w);r.enableVertexAttribArray(n);
-r.enableVertexAttribArray(q);r.disable(r.CULL_FACE);r.enable(r.BLEND);r.bindBuffer(r.ARRAY_BUFFER,B);r.vertexAttribPointer(n,2,r.FLOAT,!1,16,0);r.vertexAttribPointer(q,2,r.FLOAT,!1,16,8);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,I);r.uniformMatrix4fv(i,!1,M.projectionMatrix.elements);r.activeTexture(r.TEXTURE0);r.uniform1i(f,0);var A=0,z=0,C=D.fog;C?(r.uniform3f(s,C.color.r,C.color.g,C.color.b),C instanceof THREE.Fog?(r.uniform1f(l,C.near),r.uniform1f(p,C.far),r.uniform1i(k,1),z=A=1):C instanceof THREE.FogExp2&&
-(r.uniform1f(m,C.density),r.uniform1i(k,2),z=A=2)):(r.uniform1i(k,0),z=A=0);for(var L,F,Z=[],C=0;C<E;C++)L=x[C],!1!==L.visible&&(L._modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,L.matrixWorld),L.z=-L._modelViewMatrix.elements[14]);x.sort(u);for(C=0;C<E;C++)L=x[C],!1!==L.visible&&(F=L.material,r.uniform1f(t,F.alphaTest),r.uniformMatrix4fv(g,!1,L._modelViewMatrix.elements),Z[0]=L.scale.x,Z[1]=L.scale.y,L=D.fog&&F.fog?z:0,A!==L&&(r.uniform1i(k,L),A=L),null!==F.map?(r.uniform2f(a,F.map.offset.x,
+r.getUniformLocation(w,"fogType");m=r.getUniformLocation(w,"fogDensity");l=r.getUniformLocation(w,"fogNear");p=r.getUniformLocation(w,"fogFar");s=r.getUniformLocation(w,"fogColor");t=r.getUniformLocation(w,"alphaTest");u=document.createElement("canvas");u.width=8;u.height=8;N=u.getContext("2d");N.fillStyle="#ffffff";N.fillRect(0,0,u.width,u.height);y=new THREE.Texture(u);y.needsUpdate=!0};this.render=function(D,L){var x=D.__webglSprites,E=x.length;if(E){r.useProgram(w);r.enableVertexAttribArray(n);
+r.enableVertexAttribArray(q);r.disable(r.CULL_FACE);r.enable(r.BLEND);r.bindBuffer(r.ARRAY_BUFFER,B);r.vertexAttribPointer(n,2,r.FLOAT,!1,16,0);r.vertexAttribPointer(q,2,r.FLOAT,!1,16,8);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,I);r.uniformMatrix4fv(i,!1,L.projectionMatrix.elements);r.activeTexture(r.TEXTURE0);r.uniform1i(f,0);var A=0,z=0,C=D.fog;C?(r.uniform3f(s,C.color.r,C.color.g,C.color.b),C instanceof THREE.Fog?(r.uniform1f(l,C.near),r.uniform1f(p,C.far),r.uniform1i(k,1),z=A=1):C instanceof THREE.FogExp2&&
+(r.uniform1f(m,C.density),r.uniform1i(k,2),z=A=2)):(r.uniform1i(k,0),z=A=0);for(var M,F,Z=[],C=0;C<E;C++)M=x[C],!1!==M.visible&&(M._modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,M.matrixWorld),M.z=-M._modelViewMatrix.elements[14]);x.sort(u);for(C=0;C<E;C++)M=x[C],!1!==M.visible&&(F=M.material,r.uniform1f(t,F.alphaTest),r.uniformMatrix4fv(g,!1,M._modelViewMatrix.elements),Z[0]=M.scale.x,Z[1]=M.scale.y,M=D.fog&&F.fog?z:0,A!==M&&(r.uniform1i(k,M),A=M),null!==F.map?(r.uniform2f(a,F.map.offset.x,
 F.map.offset.y),r.uniform2f(b,F.map.repeat.x,F.map.repeat.y)):(r.uniform2f(a,0,0),r.uniform2f(b,1,1)),r.uniform1f(h,F.opacity),r.uniform3f(e,F.color.r,F.color.g,F.color.b),r.uniform1f(c,F.rotation),r.uniform2fv(d,Z),v.setBlending(F.blending,F.blendEquation,F.blendSrc,F.blendDst),v.setDepthTest(F.depthTest),v.setDepthWrite(F.depthWrite),F.map&&F.map.image&&F.map.image.width?v.setTexture(F.map,0):v.setTexture(y,0),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0));r.enable(r.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,h=new THREE.Frustum,g=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,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(i,k){var m,l,p,s,t,n;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===i.autoUpdate&&i.updateMatrixWorld();k.matrixWorldInverse.getInverse(k.matrixWorld);g.multiplyMatrices(k.projectionMatrix,
 k.matrixWorldInverse);h.setFromMatrix(g);b.setRenderTarget(this.renderTarget);b.clear();n=i.__webglObjects;m=0;for(l=n.length;m<l;m++)if(p=n[m],t=p.object,p.render=!1,t.visible&&(!(t instanceof THREE.Mesh||t instanceof THREE.ParticleSystem)||!t.frustumCulled||h.intersectsObject(t)))t._modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,t.matrixWorld),p.render=!0;var q;m=0;for(l=n.length;m<l;m++)if(p=n[m],p.render&&(t=p.object,p=p.buffer,!(t instanceof THREE.ParticleSystem)||t.customDepthMaterial))(q=